ocean-brain 0.3.4 → 0.4.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/package.json +5 -5
- package/scripts/postinstall-prisma.mjs +3 -2
- package/server/client/dist/assets/Calendar-CSXEuWmQ.js +25 -0
- package/server/client/dist/assets/Callout-Ap1OcxWN.js +1 -0
- package/server/client/dist/assets/Graph-C0Ax9qjI.js +1 -0
- package/server/client/dist/assets/{Image-ZxF459sC.js → Image-CSbcG-5a.js} +1 -1
- package/server/client/dist/assets/{Image.es-BQfyKc2-.js → Image.es-Fbe7aDDo.js} +1 -1
- package/server/client/dist/assets/{ModalActionRow-DyOb58KJ.js → ModalActionRow-DjI5b4bl.js} +1 -1
- package/server/client/dist/assets/Note-BY6WgYLq.js +1 -0
- package/server/client/dist/assets/Note-W4f6H9K0.css +1 -0
- package/server/client/dist/assets/Reminders-vRksvSQE.js +1 -0
- package/server/client/dist/assets/Search-Cq4tuiJO.js +1 -0
- package/server/client/dist/assets/{SurfaceCard-nZNf9lyE.js → SurfaceCard-Br6TjX5W.js} +1 -1
- package/server/client/dist/assets/Tag-ARDLA-Pb.js +1 -0
- package/server/client/dist/assets/TagNotes-CDGVrCJU.js +1 -0
- package/server/client/dist/assets/{Trash.es-BGoN5q9L.js → Trash.es-BfCEiL3-.js} +1 -1
- package/server/client/dist/assets/ViewNotes-ZBOQ1adH.js +1 -0
- package/server/client/dist/assets/Views-DQHPfdwM.js +1 -0
- package/server/client/dist/assets/{image.api-0mMkElZk.js → image.api-DGXlQ_Ca.js} +1 -1
- package/server/client/dist/assets/index-B28TO4FC.js +1 -0
- package/server/client/dist/assets/{index-DL7pUwq2.css → index-Bm9l_L20.css} +1 -1
- package/server/client/dist/assets/index-Bsx4P7EA.js +210 -0
- package/server/client/dist/assets/manage-image-Dg297A_h.js +1 -0
- package/server/client/dist/assets/manage-image-detail-hk6jWyiB.js +1 -0
- package/server/client/dist/assets/mcp-CSjmBjFR.js +1 -0
- package/server/client/dist/assets/{note-core-BCgMq5QA.js → note-core-GgFcksAF.js} +1 -1
- package/server/client/dist/assets/{note-vendor-BofYbzmZ.js → note-vendor-5N5mRkIT.js} +3 -3
- package/server/client/dist/assets/{placeholder-i-uNe71U.js → placeholder-Bmiowo28.js} +4 -4
- package/server/client/dist/assets/trash-CM7SbVtW.js +1 -0
- package/server/client/dist/assets/{useReminderMutate-tNMwwRnx.js → useReminderMutate-DsIvVpCQ.js} +2 -2
- package/server/client/dist/assets/view-dashboard-CP8nhfxQ.js +90 -0
- package/server/client/dist/index.html +4 -4
- package/server/dist/app.js +8 -84
- package/server/dist/app.js.map +1 -1
- package/server/dist/features/auth/http/api.js +43 -0
- package/server/dist/features/auth/http/api.js.map +1 -0
- package/server/dist/features/auth/http/login-page.js +28 -0
- package/server/dist/features/auth/http/login-page.js.map +1 -0
- package/server/dist/features/auth/http/pages.js +50 -0
- package/server/dist/features/auth/http/pages.js.map +1 -0
- package/server/dist/features/auth/service.js +94 -0
- package/server/dist/features/auth/service.js.map +1 -0
- package/server/dist/features/cache/graphql/cache.field.resolver.js +5 -0
- package/server/dist/features/cache/graphql/cache.field.resolver.js.map +1 -0
- package/server/dist/features/cache/graphql/cache.mutation.resolver.js +49 -0
- package/server/dist/features/cache/graphql/cache.mutation.resolver.js.map +1 -0
- package/server/dist/features/cache/graphql/cache.query.resolver.js +21 -0
- package/server/dist/features/cache/graphql/cache.query.resolver.js.map +1 -0
- package/server/dist/features/cache/graphql/cache.resolver.js +12 -0
- package/server/dist/features/cache/graphql/cache.resolver.js.map +1 -0
- package/server/dist/features/cache/graphql/cache.type-defs.js +32 -0
- package/server/dist/features/cache/graphql/cache.type-defs.js.map +1 -0
- package/server/dist/features/cache/graphql/index.js +21 -0
- package/server/dist/features/cache/graphql/index.js.map +1 -0
- package/server/dist/features/image/graphql/image.field.resolver.js +14 -0
- package/server/dist/features/image/graphql/image.field.resolver.js.map +1 -0
- package/server/dist/features/image/graphql/image.mutation.resolver.js +21 -0
- package/server/dist/features/image/graphql/image.mutation.resolver.js.map +1 -0
- package/server/dist/features/image/graphql/image.query.resolver.js +40 -0
- package/server/dist/features/image/graphql/image.query.resolver.js.map +1 -0
- package/server/dist/features/image/graphql/image.resolver.js +12 -0
- package/server/dist/features/image/graphql/image.resolver.js.map +1 -0
- package/server/dist/features/image/graphql/image.type-defs.js +31 -0
- package/server/dist/features/image/graphql/image.type-defs.js.map +1 -0
- package/server/dist/features/image/graphql/index.js +16 -0
- package/server/dist/features/image/graphql/index.js.map +1 -0
- package/server/dist/features/image/http/upload.js +48 -0
- package/server/dist/features/image/http/upload.js.map +1 -0
- package/server/dist/features/image/services/delete.js +52 -0
- package/server/dist/features/image/services/delete.js.map +1 -0
- package/server/dist/{modules/remote-image.js → features/image/services/remote-fetch.js} +1 -1
- package/server/dist/features/image/services/remote-fetch.js.map +1 -0
- package/server/dist/{modules/image-upload.js → features/image/services/upload.js} +4 -8
- package/server/dist/features/image/services/upload.js.map +1 -0
- package/server/dist/{views/mcp-admin.js → features/mcp-admin/http/handlers.js} +3 -3
- package/server/dist/features/mcp-admin/http/handlers.js.map +1 -0
- package/server/dist/{modules/mcp-admin.js → features/mcp-admin/service.js} +3 -3
- package/server/dist/features/mcp-admin/service.js.map +1 -0
- package/server/dist/features/note/graphql/index.js +8 -0
- package/server/dist/features/note/graphql/index.js.map +1 -0
- package/server/dist/features/note/graphql/note.field.resolver.js +12 -0
- package/server/dist/features/note/graphql/note.field.resolver.js.map +1 -0
- package/server/dist/features/note/graphql/note.graphql.shared.js +23 -0
- package/server/dist/features/note/graphql/note.graphql.shared.js.map +1 -0
- package/server/dist/features/note/graphql/note.mutation.resolver.js +140 -0
- package/server/dist/features/note/graphql/note.mutation.resolver.js.map +1 -0
- package/server/dist/features/note/graphql/note.query.resolver.js +382 -0
- package/server/dist/features/note/graphql/note.query.resolver.js.map +1 -0
- package/server/dist/features/note/graphql/note.resolver.js +14 -0
- package/server/dist/features/note/graphql/note.resolver.js.map +1 -0
- package/server/dist/features/note/graphql/note.type-defs.js +184 -0
- package/server/dist/features/note/graphql/note.type-defs.js.map +1 -0
- package/server/dist/{views/note.js → features/note/http/mcp.js} +27 -15
- package/server/dist/features/note/http/mcp.js.map +1 -0
- package/server/dist/{modules/note-authoring.js → features/note/services/authoring.js} +25 -7
- package/server/dist/features/note/services/authoring.js.map +1 -0
- package/server/dist/{modules/note-cleanup.js → features/note/services/cleanup.js} +14 -23
- package/server/dist/features/note/services/cleanup.js.map +1 -0
- package/server/dist/features/note/services/search-backfill.js +84 -0
- package/server/dist/features/note/services/search-backfill.js.map +1 -0
- package/server/dist/features/note/services/search.js +197 -0
- package/server/dist/features/note/services/search.js.map +1 -0
- package/server/dist/{modules/note-snapshot.js → features/note/services/snapshot.js} +51 -49
- package/server/dist/features/note/services/snapshot.js.map +1 -0
- package/server/dist/{modules/note-tag-filter.js → features/note/services/tag-filter.js} +2 -6
- package/server/dist/features/note/services/tag-filter.js.map +1 -0
- package/server/dist/{modules/note-trash.js → features/note/services/trash.js} +28 -23
- package/server/dist/features/note/services/trash.js.map +1 -0
- package/server/dist/features/placeholder/graphql/index.js +27 -0
- package/server/dist/features/placeholder/graphql/index.js.map +1 -0
- package/server/dist/features/placeholder/graphql/placeholder.field.resolver.js +5 -0
- package/server/dist/features/placeholder/graphql/placeholder.field.resolver.js.map +1 -0
- package/server/dist/features/placeholder/graphql/placeholder.mutation.resolver.js +72 -0
- package/server/dist/features/placeholder/graphql/placeholder.mutation.resolver.js.map +1 -0
- package/server/dist/features/placeholder/graphql/placeholder.query.resolver.js +36 -0
- package/server/dist/features/placeholder/graphql/placeholder.query.resolver.js.map +1 -0
- package/server/dist/features/placeholder/graphql/placeholder.resolver.js +12 -0
- package/server/dist/features/placeholder/graphql/placeholder.resolver.js.map +1 -0
- package/server/dist/features/placeholder/graphql/placeholder.type-defs.js +50 -0
- package/server/dist/features/placeholder/graphql/placeholder.type-defs.js.map +1 -0
- package/server/dist/features/reminder/graphql/index.js +27 -0
- package/server/dist/features/reminder/graphql/index.js.map +1 -0
- package/server/dist/features/reminder/graphql/reminder.field.resolver.js +10 -0
- package/server/dist/features/reminder/graphql/reminder.field.resolver.js.map +1 -0
- package/server/dist/features/reminder/graphql/reminder.mutation.resolver.js +59 -0
- package/server/dist/features/reminder/graphql/reminder.mutation.resolver.js.map +1 -0
- package/server/dist/features/reminder/graphql/reminder.query.resolver.js +79 -0
- package/server/dist/features/reminder/graphql/reminder.query.resolver.js.map +1 -0
- package/server/dist/features/reminder/graphql/reminder.resolver.js +12 -0
- package/server/dist/features/reminder/graphql/reminder.resolver.js.map +1 -0
- package/server/dist/features/reminder/graphql/reminder.type-defs.js +51 -0
- package/server/dist/features/reminder/graphql/reminder.type-defs.js.map +1 -0
- package/server/dist/features/tag/graphql/index.js +14 -0
- package/server/dist/features/tag/graphql/index.js.map +1 -0
- package/server/dist/features/tag/graphql/tag.field.resolver.js +10 -0
- package/server/dist/features/tag/graphql/tag.field.resolver.js.map +1 -0
- package/server/dist/features/tag/graphql/tag.mutation.resolver.js +15 -0
- package/server/dist/features/tag/graphql/tag.mutation.resolver.js.map +1 -0
- package/server/dist/features/tag/graphql/tag.query.resolver.js +26 -0
- package/server/dist/features/tag/graphql/tag.query.resolver.js.map +1 -0
- package/server/dist/features/tag/graphql/tag.resolver.js +12 -0
- package/server/dist/features/tag/graphql/tag.resolver.js.map +1 -0
- package/server/dist/features/tag/graphql/tag.type-defs.js +46 -0
- package/server/dist/features/tag/graphql/tag.type-defs.js.map +1 -0
- package/server/dist/{views/tag.js → features/tag/http/mcp.js} +3 -3
- package/server/dist/features/tag/http/mcp.js.map +1 -0
- package/server/dist/{modules/tag-organization.js → features/tag/services/organization.js} +38 -8
- package/server/dist/features/tag/services/organization.js.map +1 -0
- package/server/dist/features/view/graphql/index.js +11 -0
- package/server/dist/features/view/graphql/index.js.map +1 -0
- package/server/dist/features/view/graphql/view.mutation.resolver.js +53 -0
- package/server/dist/features/view/graphql/view.mutation.resolver.js.map +1 -0
- package/server/dist/features/view/graphql/view.query.resolver.js +29 -0
- package/server/dist/features/view/graphql/view.query.resolver.js.map +1 -0
- package/server/dist/features/view/graphql/view.resolver.js +10 -0
- package/server/dist/features/view/graphql/view.resolver.js.map +1 -0
- package/server/dist/features/view/graphql/view.type-defs.js +63 -0
- package/server/dist/features/view/graphql/view.type-defs.js.map +1 -0
- package/server/dist/features/view/services/workspace.js +432 -0
- package/server/dist/features/view/services/workspace.js.map +1 -0
- package/server/dist/main.js +14 -0
- package/server/dist/main.js.map +1 -1
- package/server/dist/modules/auth-guard.js +10 -9
- package/server/dist/modules/auth-guard.js.map +1 -1
- package/server/dist/modules/auth-mode.js +1 -3
- package/server/dist/modules/auth-mode.js.map +1 -1
- package/server/dist/modules/blocknote.js +8 -17
- package/server/dist/modules/blocknote.js.map +1 -1
- package/server/dist/modules/data-maintenance.js +75 -0
- package/server/dist/modules/data-maintenance.js.map +1 -0
- package/server/dist/modules/error-handler.js.map +1 -1
- package/server/dist/modules/logger.js +5 -23
- package/server/dist/modules/logger.js.map +1 -1
- package/server/dist/modules/mcp-auth.js +4 -5
- package/server/dist/modules/mcp-auth.js.map +1 -1
- package/server/dist/modules/mcp-token.js.map +1 -1
- package/server/dist/modules/prisma-runtime.js +2 -7
- package/server/dist/modules/prisma-runtime.js.map +1 -1
- package/server/dist/modules/recovery-retention.js +1 -1
- package/server/dist/modules/recovery-retention.js.map +1 -1
- package/server/dist/modules/server-events-handler.js +34 -0
- package/server/dist/modules/server-events-handler.js.map +1 -0
- package/server/dist/modules/server-events.js +32 -0
- package/server/dist/modules/server-events.js.map +1 -0
- package/server/dist/modules/use-async.js.map +1 -1
- package/server/dist/paths.js.map +1 -1
- package/server/dist/routes/api.js +34 -0
- package/server/dist/routes/api.js.map +1 -0
- package/server/dist/routes/auth-pages.js +11 -0
- package/server/dist/routes/auth-pages.js.map +1 -0
- package/server/dist/routes/client.js +27 -0
- package/server/dist/routes/client.js.map +1 -0
- package/server/dist/routes/graphql.js +33 -0
- package/server/dist/routes/graphql.js.map +1 -0
- package/server/dist/routes/index.js +11 -0
- package/server/dist/routes/index.js.map +1 -0
- package/server/dist/routes/mcp.js +30 -0
- package/server/dist/routes/mcp.js.map +1 -0
- package/server/dist/schema/index.js +11 -8
- package/server/dist/schema/index.js.map +1 -1
- package/server/dist/types/index.js.map +1 -1
- package/server/prisma/migrations/20260413143000_0014_tag_name_unique/migration.sql +32 -0
- package/server/prisma/migrations/20260414143000_0015_note_searchable_text/migration.sql +5 -0
- package/server/prisma/migrations/20260416090000_0016_view_workspace/migration.sql +50 -0
- package/server/prisma/schema.prisma +66 -12
- package/server/client/dist/assets/Calendar-Kjy1PX6L.js +0 -25
- package/server/client/dist/assets/Graph-Bl5K2qUw.js +0 -1
- package/server/client/dist/assets/Note-BfGma2Qc.css +0 -1
- package/server/client/dist/assets/Note-DN_ko2M3.js +0 -1
- package/server/client/dist/assets/Reminders-BK-Uv9Ps.js +0 -1
- package/server/client/dist/assets/Search-ClHeWvmI.js +0 -1
- package/server/client/dist/assets/Tag-Dph4V_kl.js +0 -1
- package/server/client/dist/assets/TagNotes-CxP5qHZj.js +0 -1
- package/server/client/dist/assets/index-6lIw6jYW.js +0 -1
- package/server/client/dist/assets/index-Ba2XPRI8.js +0 -205
- package/server/client/dist/assets/manage-image-Br_kKxbb.js +0 -1
- package/server/client/dist/assets/manage-image-detail-9DzqbiqI.js +0 -1
- package/server/client/dist/assets/mcp-C_So91eX.js +0 -1
- package/server/client/dist/assets/trash-Cg3nJ1m5.js +0 -1
- package/server/dist/modules/auth.js +0 -25
- package/server/dist/modules/auth.js.map +0 -1
- package/server/dist/modules/image-upload.js.map +0 -1
- package/server/dist/modules/mcp-admin.js.map +0 -1
- package/server/dist/modules/note-authoring.js.map +0 -1
- package/server/dist/modules/note-cleanup.js.map +0 -1
- package/server/dist/modules/note-snapshot.js.map +0 -1
- package/server/dist/modules/note-tag-filter.js.map +0 -1
- package/server/dist/modules/note-trash.js.map +0 -1
- package/server/dist/modules/remote-image.js.map +0 -1
- package/server/dist/modules/tag-organization.js.map +0 -1
- package/server/dist/schema/cache/index.js +0 -58
- package/server/dist/schema/cache/index.js.map +0 -1
- package/server/dist/schema/image/index.js +0 -88
- package/server/dist/schema/image/index.js.map +0 -1
- package/server/dist/schema/note/index.js +0 -582
- package/server/dist/schema/note/index.js.map +0 -1
- package/server/dist/schema/placeholder/index.js +0 -105
- package/server/dist/schema/placeholder/index.js.map +0 -1
- package/server/dist/schema/reminder/index.js +0 -161
- package/server/dist/schema/reminder/index.js.map +0 -1
- package/server/dist/schema/tag/index.js +0 -81
- package/server/dist/schema/tag/index.js.map +0 -1
- package/server/dist/urls.js +0 -9
- package/server/dist/urls.js.map +0 -1
- package/server/dist/views/auth.js +0 -305
- package/server/dist/views/auth.js.map +0 -1
- package/server/dist/views/image.js +0 -44
- package/server/dist/views/image.js.map +0 -1
- package/server/dist/views/index.js +0 -6
- package/server/dist/views/index.js.map +0 -1
- package/server/dist/views/mcp-admin.js.map +0 -1
- package/server/dist/views/note.js.map +0 -1
- package/server/dist/views/tag.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ocean-brain",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"@blocknote/server-util": "^0.46.2",
|
|
34
34
|
"@graphql-tools/schema": "^10.0.31",
|
|
35
35
|
"@graphql-tools/utils": "^11.0.0",
|
|
36
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
37
|
-
"@prisma/client": "^6.19.
|
|
36
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
37
|
+
"@prisma/client": "^6.19.3",
|
|
38
38
|
"commander": "^14.0.3",
|
|
39
39
|
"express": "^5.2.1",
|
|
40
40
|
"express-session": "^1.19.0",
|
|
41
41
|
"express-winston": "^4.2.0",
|
|
42
42
|
"graphql-http": "^1.22.4",
|
|
43
|
-
"prisma": "^6.19.
|
|
44
|
-
"sqlite3": "^
|
|
43
|
+
"prisma": "^6.19.3",
|
|
44
|
+
"sqlite3": "^6.0.1",
|
|
45
45
|
"winston": "^3.19.0",
|
|
46
46
|
"zod": "^3.25.0"
|
|
47
47
|
}
|
|
@@ -6,8 +6,9 @@ import { pathToFileURL } from 'node:url';
|
|
|
6
6
|
|
|
7
7
|
export const resolveSchemaPath = (packageRoot, doesExist = existsSync) => {
|
|
8
8
|
const candidates = [
|
|
9
|
-
|
|
10
|
-
path.resolve(packageRoot, '..', 'server', 'prisma', 'schema.prisma')
|
|
9
|
+
// In the workspace, prefer the live server schema over the bundled CLI copy.
|
|
10
|
+
path.resolve(packageRoot, '..', 'server', 'prisma', 'schema.prisma'),
|
|
11
|
+
path.join(packageRoot, 'server', 'prisma', 'schema.prisma')
|
|
11
12
|
];
|
|
12
13
|
|
|
13
14
|
const match = candidates.find((candidate) => doesExist(candidate));
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-5N5mRkIT.js";import{T as b,L as te,N as se,c as q,d as f,s as re,a as ae,M as S,b as ne,S as oe,e as F,B as O,f as ie,g as ce,u as H,q as z,h as K,P as le,i as de,j as ue,C as me}from"./index-Bsx4P7EA.js";import{a as d}from"./graph-vendor-CUxe67Lr.js";import{C as he}from"./Callout-Ap1OcxWN.js";import"./note-core-GgFcksAF.js";const ge=({day:r,cellClassName:t,dayNumberClassName:s,isCurrentMonth:i,items:o,overflowCount:c,onOpenOverflow:m})=>e.jsxs("div",{className:`min-h-[196px] rounded-[16px] border p-2.5 ${t}`.trim(),children:[e.jsx("div",{className:"mb-2.5 flex justify-end",children:e.jsx(b,{as:"span",variant:"label",className:`flex h-7 w-7 items-center justify-center rounded-[10px] ${s}`.trim(),children:r})}),i&&o.length>0?e.jsxs("div",{className:"flex flex-col gap-1.5",children:[o,c>0?e.jsxs("button",{type:"button",onClick:m,className:"focus-ring-soft w-full rounded-[10px] border border-dashed border-border-subtle/70 bg-subtle/70 py-1 text-center text-micro font-semibold text-fg-tertiary outline-none transition-colors hover:border-border-secondary/70 hover:bg-hover-subtle hover:text-fg-secondary",children:["+",c," more"]}):null]}):null]}),V=({params:r,toneClassName:t="",header:s,title:i,meta:o,titleClassName:c=""})=>e.jsx(te,{to:se,params:r,className:"focus-ring-soft group block rounded-[8px] outline-none",children:e.jsxs("div",{className:q("flex items-start gap-1.5 rounded-[8px] px-1.5 py-1 transition-colors group-hover:bg-hover-subtle",t),children:[s?e.jsx("span",{className:"mt-[2px] flex h-4 w-4 shrink-0 items-center justify-center text-fg-tertiary",children:s}):e.jsx("span",{"aria-hidden":"true",className:"mt-[6px] h-1.5 w-1.5 shrink-0 rounded-full bg-fg-placeholder"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx(b,{as:"div",variant:"label",weight:"medium",tone:"secondary",className:q("line-clamp-1",c),children:i}),o?e.jsx(b,{as:"div",variant:"micro",weight:"medium",tone:"tertiary",className:"mt-0.5",children:o}):null]})]})}),xe=({note:r,type:t})=>e.jsx(V,{params:{id:r.id},header:e.jsx(re,{size:12}),title:r.title,meta:f(Number(t==="create"?r.createdAt:r.updatedAt)).format("HH:mm")}),pe=({reminder:r})=>e.jsx(V,{params:{id:String(r.note?.id??r.noteId)},header:e.jsx(ae,{size:12}),title:r.content||r.note?.title||"No title",titleClassName:r.completed?"line-through":"",meta:f(Number(r.reminderDate)).format("HH:mm")}),L=3,Q=(r,t)=>r.map(s=>s.type==="note"?e.jsx(xe,{note:s.item,type:t},`note-${s.item.id}`):e.jsx(pe,{reminder:s.item},`reminder-${s.item.id}`)),ye=({year:r,month:t,day:s,isCurrentMonth:i,isSunday:o,isToday:c,isPast:m,notes:h,reminders:g,type:N})=>{const[M,v]=d.useState(!1),p=d.useMemo(()=>{const a=h.map(u=>({type:"note",item:u})),l=g.map(u=>({type:"reminder",item:u}));return m?[...a,...l]:[...l,...a]},[m,h,g]),D=p.length>L,w=d.useMemo(()=>Q(p.slice(0,L),N),[p,N]),$=d.useMemo(()=>Q(p,N),[p,N]),k=d.useCallback(()=>v(!0),[]),C=d.useCallback(()=>v(!1),[]),E=()=>i?c?"border-border-secondary/70 bg-[color:color-mix(in_srgb,var(--surface)_88%,var(--accent-soft-primary)_12%)]":"bg-surface border-border-subtle":"bg-muted/18 border-border-subtle/70",I=()=>c?"bg-cta text-fg-on-filled font-semibold":i?o?"text-fg-weekend font-bold":"text-fg-secondary font-bold":"text-fg-disabled opacity-55";return e.jsxs(e.Fragment,{children:[e.jsx(ge,{day:s,cellClassName:E(),dayNumberClassName:I(),isCurrentMonth:i,items:w,overflowCount:D?p.length-L:0,onOpenOverflow:k}),D&&e.jsxs(S,{isOpen:M,onClose:C,variant:"inspect",children:[e.jsx(S.Header,{title:`${r}/${String(t).padStart(2,"0")}/${String(s).padStart(2,"0")}`,onClose:C}),e.jsxs(S.Body,{children:[e.jsxs(S.Description,{className:"sr-only",children:["View all notes and reminders scheduled for day ",s,"."]}),e.jsx("div",{className:"flex max-h-[60vh] flex-col gap-2 overflow-y-auto",children:$})]})]})]})},fe=d.memo(ye),be=["January","February","March","April","May","June","July","August","September","October","November","December"],je=({month:r,year:t,type:s,onPrevMonth:i,onNextMonth:o,onToday:c,onTypeChange:m})=>e.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{className:"flex flex-wrap items-end gap-x-2.5 gap-y-1",children:[e.jsx(b,{as:"h1",variant:"display",weight:"bold",tracking:"tighter",className:"text-2xl leading-none sm:text-[2.15rem]",children:be[r-1]}),e.jsx(b,{as:"span",variant:"subheading",weight:"medium",tone:"secondary",tracking:"tight",className:"pb-0.5",children:t})]}),e.jsx(b,{as:"p",variant:"meta",weight:"medium",tone:"secondary",children:"Track note activity and reminders across the month"})]}),e.jsx("div",{className:"flex lg:justify-end",children: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(ne,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),e.jsx(b,{as:"span",variant:"label",weight:"medium",tone:"tertiary",children:"Note date"}),e.jsxs(oe,{value:s,onValueChange:g=>m(g),variant:"ghost",size:"sm",children:[e.jsx(F,{value:"create",children:"Created"}),e.jsx(F,{value:"update",children:"Updated"})]})]}),e.jsx("div",{className:"h-5 w-px bg-divider"}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(O,{variant:"ghost",size:"sm",onClick:c,children:"Today"}),e.jsx(O,{variant:"ghost",size:"icon-sm",onClick:i,children:e.jsx(ie,{width:18,height:18})}),e.jsx(O,{variant:"ghost",size:"icon-sm",onClick:o,children:e.jsx(ce,{width:18,height:18})})]})]})})]}),Ne=`
|
|
2
|
+
query NotesInDateRange($dateRange: DateRangeInput) {
|
|
3
|
+
notesInDateRange(dateRange: $dateRange) {
|
|
4
|
+
id
|
|
5
|
+
title
|
|
6
|
+
createdAt
|
|
7
|
+
updatedAt
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
`,ve=`
|
|
11
|
+
query RemindersInDateRange($dateRange: DateRangeInput) {
|
|
12
|
+
remindersInDateRange(dateRange: $dateRange) {
|
|
13
|
+
id
|
|
14
|
+
noteId
|
|
15
|
+
reminderDate
|
|
16
|
+
completed
|
|
17
|
+
priority
|
|
18
|
+
content
|
|
19
|
+
note {
|
|
20
|
+
id
|
|
21
|
+
title
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`,Me=async r=>{const t=await K(Ne,{dateRange:r});if(t.type==="error")throw t;return t.notesInDateRange},De=async r=>{const t=await K(ve,{dateRange:r});if(t.type==="error")throw t;return t.remindersInDateRange},Ce=({year:r,month:t})=>{const s=`${r}-${String(t).padStart(2,"0")}-01`,i=t===12?1:t+1,c=`${t===12?r+1:r}-${String(i).padStart(2,"0")}-01`,m={start:s,end:c},h=H({queryKey:z.calendar.notesInDateRange(r,t),queryFn:()=>Me(m)}),g=H({queryKey:z.reminders.inDateRange(r,t),queryFn:()=>De(m)});return{notes:h.data??[],reminders:g.data??[],isLoading:h.isLoading||g.isLoading,isError:h.isError||g.isError}},Re=["SUN","MON","TUE","WED","THU","FRI","SAT"],Se=[],we=[],B=ue(me);function Oe(){const r=B.useNavigate(),{year:t,month:s,type:i}=B.useSearch(),o=d.useRef(null),c=d.useRef(!1),m=d.useRef(0),h=d.useRef(0),g=d.useCallback(a=>{c.current=!0,m.current=a.pageX-(o.current?.offsetLeft??0),h.current=o.current?.scrollLeft??0,o.current&&(o.current.style.cursor="grabbing",o.current.style.userSelect="none")},[]),N=d.useCallback(a=>{if(!c.current||!o.current)return;a.preventDefault();const u=(a.pageX-o.current.offsetLeft-m.current)*1.2;o.current.scrollLeft=h.current-u},[]),M=d.useCallback(()=>{c.current=!1,o.current&&(o.current.style.cursor="grab",o.current.style.userSelect="")},[]),{notes:v,reminders:p,isLoading:D,isError:w}=Ce({year:t,month:s}),$=d.useMemo(()=>{const a=f(),l=`${a.year()}-${a.month()+1}-${a.date()}`,u=new Map;for(const n of v){const y=i==="create"?f(Number(n.createdAt)):f(Number(n.updatedAt)),x=`${y.year()}-${y.month()+1}-${y.date()}`,j=u.get(x)||[];j.push(n),u.set(x,j)}const T=new Map;for(const n of p){const y=f(Number(n.reminderDate)),x=`${y.year()}-${y.month()+1}-${y.date()}`,j=T.get(x)||[];j.push(n),T.set(x,j)}const W=new Date(t,s-1,1),X=new Date(t,s,0),A=W.getDay(),_=X.getDate(),R=[],Y=s===1?12:s-1,U=s===1?t-1:t,J=new Date(U,Y,0).getDate();for(let n=A-1;n>=0;n--)R.push({day:J-n,isCurrentMonth:!1,year:U,month:Y});for(let n=1;n<=_;n++)R.push({day:n,isCurrentMonth:!0,year:t,month:s});const P=(A+_)%7,G=P===0?0:7-P,Z=s===12?1:s+1,ee=s===12?t+1:t;for(let n=1;n<=G;n++)R.push({day:n,isCurrentMonth:!1,year:ee,month:Z});return R.map((n,y)=>{const x=`${n.year}-${n.month}-${n.day}`,j=f(`${n.year}-${String(n.month).padStart(2,"0")}-${String(n.day).padStart(2,"0")}`);return{key:x,year:n.year,month:n.month,day:n.day,isCurrentMonth:n.isCurrentMonth,isSunday:y%7===0,isToday:x===l,isPast:j.isBefore(a,"day"),notes:u.get(x)||Se,reminders:T.get(x)||we}})},[t,s,v,p,i]),k=()=>{const a=s===1?12:s-1,l=s===1?t-1:t;r({search:u=>({...u,month:a,year:l})})},C=()=>{const a=s===12?1:s+1,l=s===12?t+1:t;r({search:u=>({...u,month:a,year:l})})},E=()=>{r({search:a=>({...a,month:f().month()+1,year:f().year()})})},I=a=>{a&&r({search:l=>({...l,type:a})})};return e.jsx(le,{title:"Calendar",variant:"none",children:w?e.jsx(he,{children:"Failed to load calendar data. Please try again later."}):e.jsxs("div",{className:"surface-base",children:[e.jsx("div",{className:"border-b border-border-subtle/80 px-4 py-4 sm:px-5",children:e.jsx(je,{month:s,year:t,type:i,onPrevMonth:k,onNextMonth:C,onToday:E,onTypeChange:I})}),e.jsx("div",{ref:o,className:"cursor-grab overflow-x-auto px-4 pb-4 pt-3 sm:px-5",onMouseDown:g,onMouseMove:N,onMouseUp:M,onMouseLeave:M,children:e.jsxs("div",{className:"min-w-[1260px]",children:[e.jsx("div",{className:"mb-2.5 grid grid-cols-7 gap-1.5",children:Re.map((a,l)=>e.jsx(b,{as:"div",variant:"label",weight:"semibold",tracking:"wider",transform:"uppercase",className:`py-2 text-center ${l===0?"text-fg-weekend":"text-fg-tertiary"}`,children:a},a))}),D?e.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:Array.from({length:35}).map((a,l)=>e.jsx(de,{height:180},l))}):e.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:$.map(a=>e.jsx(fe,{year:a.year,month:a.month,day:a.day,isCurrentMonth:a.isCurrentMonth,isSunday:a.isSunday,isToday:a.isToday,isPast:a.isPast,notes:a.notes,reminders:a.reminders,type:i},a.key))})]})})]})})}export{Oe as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./note-vendor-5N5mRkIT.js";import{p as n,T as l}from"./index-Bsx4P7EA.js";import{a as e}from"./graph-vendor-CUxe67Lr.js";const o=new Map([["bold",e.createElement(e.Fragment,null,e.createElement("path",{d:"M108,84a16,16,0,1,1,16,16A16,16,0,0,1,108,84Zm128,44A108,108,0,1,1,128,20,108.12,108.12,0,0,1,236,128Zm-24,0a84,84,0,1,0-84,84A84.09,84.09,0,0,0,212,128Zm-72,36.68V132a20,20,0,0,0-20-20,12,12,0,0,0-4,23.32V168a20,20,0,0,0,20,20,12,12,0,0,0,4-23.32Z"}))],["duotone",e.createElement(e.Fragment,null,e.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),e.createElement("path",{d:"M144,176a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176Zm88-48A104,104,0,1,1,128,24,104.11,104.11,0,0,1,232,128Zm-16,0a88,88,0,1,0-88,88A88.1,88.1,0,0,0,216,128ZM124,96a12,12,0,1,0-12-12A12,12,0,0,0,124,96Z"}))],["fill",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-4,48a12,12,0,1,1-12,12A12,12,0,0,1,124,72Zm12,112a16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40a8,8,0,0,1,0,16Z"}))],["light",e.createElement(e.Fragment,null,e.createElement("path",{d:"M142,176a6,6,0,0,1-6,6,14,14,0,0,1-14-14V128a2,2,0,0,0-2-2,6,6,0,0,1,0-12,14,14,0,0,1,14,14v40a2,2,0,0,0,2,2A6,6,0,0,1,142,176ZM124,94a10,10,0,1,0-10-10A10,10,0,0,0,124,94Zm106,34A102,102,0,1,1,128,26,102.12,102.12,0,0,1,230,128Zm-12,0a90,90,0,1,0-90,90A90.1,90.1,0,0,0,218,128Z"}))],["regular",e.createElement(e.Fragment,null,e.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm16-40a8,8,0,0,1-8,8,16,16,0,0,1-16-16V128a8,8,0,0,1,0-16,16,16,0,0,1,16,16v40A8,8,0,0,1,144,176ZM112,84a12,12,0,1,1,12,12A12,12,0,0,1,112,84Z"}))],["thin",e.createElement(e.Fragment,null,e.createElement("path",{d:"M140,176a4,4,0,0,1-4,4,12,12,0,0,1-12-12V128a4,4,0,0,0-4-4,4,4,0,0,1,0-8,12,12,0,0,1,12,12v40a4,4,0,0,0,4,4A4,4,0,0,1,140,176ZM124,92a8,8,0,1,0-8-8A8,8,0,0,0,124,92Zm104,36A100,100,0,1,1,128,28,100.11,100.11,0,0,1,228,128Zm-8,0a92,92,0,1,0-92,92A92.1,92.1,0,0,0,220,128Z"}))]]),m=e.forwardRef((a,t)=>e.createElement(n,{ref:t,...a,weights:o}));m.displayName="InfoIcon";const c=m,d=({children:a,className:t=""})=>r.jsxs("div",{className:`flex items-center gap-2.5 rounded-[12px] border border-border-subtle bg-hover-subtle/50 px-4 py-3 ${t}`,children:[r.jsx(c,{className:"h-4 w-4 shrink-0 text-fg-tertiary"}),r.jsx(l,{as:"div",variant:"meta",weight:"medium",tone:"secondary",children:a})]});export{d as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as t}from"./note-vendor-5N5mRkIT.js";import{_ as Q,P as C,a1 as U,i as G,a2 as Y,a3 as J,a4 as X,a5 as ee,q as ne,N as te,F as re,T as N,a6 as oe}from"./index-Bsx4P7EA.js";import{a as i,F as se}from"./graph-vendor-CUxe67Lr.js";import"./note-core-GgFcksAF.js";const ae=s=>{let a=0;for(let r=0;r<s.length;r++)a+=s.charCodeAt(r);return a},ie={background:"#f4f6f8",nodeHub:"#2c2f36",nodeSelected:"#111318",nodeConnected:"#636b76",nodeDefault:["#d6dbe1","#c8ced6","#b7bec7","#a7afb9"],nodeDimmed:["rgba(214,219,225,0.28)","rgba(200,206,214,0.24)","rgba(183,190,199,0.24)","rgba(167,175,185,0.2)"],nodeHubDimmed:"rgba(44,47,54,0.16)",nodeStroke:"#eef1f4",nodeSelectedStroke:"#a6b0bc",labelBackground:"rgba(246,248,250,0.92)",labelText:"#222831",labelFontFamily:"Pretendard Variable, Pretendard, system-ui, sans-serif",linkIdle:"rgba(99, 107, 117, 0.34)",linkConnected:"#68717c",linkDimmed:"rgba(127, 136, 146, 0.12)",legendHub:"#2c2f36"},le={background:"#121316",nodeHub:"#d6dce3",nodeSelected:"#eef1f5",nodeConnected:"#9099a4",nodeDefault:["#343a43","#2d333c","#262c35","#20262f"],nodeDimmed:["rgba(52,58,67,0.28)","rgba(45,51,60,0.24)","rgba(38,44,53,0.22)","rgba(32,38,47,0.2)"],nodeHubDimmed:"rgba(214,220,227,0.16)",nodeStroke:"#171c23",nodeSelectedStroke:"#7f8a97",labelBackground:"rgba(16,18,22,0.9)",labelText:"#eef2f6",labelFontFamily:"Pretendard Variable, Pretendard, system-ui, sans-serif",linkIdle:"rgba(118, 127, 138, 0.42)",linkConnected:"#a2abb6",linkDimmed:"rgba(118, 127, 138, 0.1)",legendHub:"#d6dce3"};function D(s){return s==="dark"?le:ie}function de(s,a){const r=D(s),{connections:g,colorIndex:y,selectedNodeId:d,nodeId:b,isConnected:c}=a,h=d===b;return d!==null&&!h&&!c?g>3?r.nodeHubDimmed:r.nodeDimmed[y%r.nodeDimmed.length]:h?r.nodeSelected:c?r.nodeConnected:g>3?r.nodeHub:r.nodeDefault[y%r.nodeDefault.length]}function ce(s,a){const r=D(s);return a.selectedNodeId!==null&&!a.isConnected?r.linkDimmed:a.isConnected?r.linkConnected:r.linkIdle}function ue(s,a){const r=D(s);return`${a.emphasize?"700":"400"} ${a.fontSize}px ${r.labelFontFamily}`}function z(s){return s<=1?3.5:s<=3?4.5:s<=6?5.5:Math.min(7,5.5+Math.sqrt(s)*.5)}const fe=t.jsx(C,{title:"Knowledge Graph",description:t.jsx(G,{width:184,height:16,className:"rounded-full"}),children:t.jsx("div",{className:"flex h-[600px] items-center justify-center",children:t.jsx(G,{width:"100%",height:"100%"})})});function he(){const s=Y(),a=i.useRef(null),r=i.useRef(null),[g,y]=i.useState({width:800,height:600}),[d,b]=i.useState(null),{theme:c}=J(e=>e),h=D(c),v=i.useRef(h);v.current=h;const{data:w}=X({queryKey:ne.notes.graph(),queryFn:async()=>{const e=await ee();if(e.type==="error")throw e;return e.noteGraph}}),l=i.useMemo(()=>{if(w.nodes.length===0)return null;const e=w.nodes.filter(o=>o.connections>0);if(e.length===0)return null;const n=new Set(e.map(o=>o.id));return{nodes:e,links:w.links.filter(o=>n.has(o.source)&&n.has(o.target))}},[w]);i.useEffect(()=>{if(!l)return;const e=()=>{if(!a.current)return;const n=a.current.getBoundingClientRect();y({width:n.width,height:Math.max(600,window.innerHeight-150)})};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[l]),i.useEffect(()=>{if(!l||!r.current)return;const e=window.setTimeout(()=>{r.current?.zoomToFit(400,50)},500);return()=>window.clearTimeout(e)},[l]);const R=i.useRef(d);R.current=d;const B=i.useCallback(e=>{if(R.current===e.id){s({to:te,params:{id:e.id}});return}b(e.id)},[s]),L=i.useCallback(()=>{b(null)},[]),K=i.useCallback(e=>{a.current&&(a.current.style.cursor=e?"pointer":"default")},[]),I=i.useRef(!1),q=i.useCallback(()=>{I.current||(I.current=!0,r.current?.enableZoomInteraction(!1))},[]),A=i.useCallback(()=>{I.current=!1,r.current?.enableZoomInteraction(!0)},[]),H=i.useRef(new Map),O=i.useMemo(()=>{const e=new Map;if(l)for(const n of l.links)e.has(n.source)||e.set(n.source,new Set),e.has(n.target)||e.set(n.target,new Set),e.get(n.source)?.add(n.target),e.get(n.target)?.add(n.source);return e},[l]);H.current=O;const Z=i.useCallback((e,n,o)=>{const u=v.current,f=d,p=H.current,m=z(e.connections),x=e.x||0,S=e.y||0,k=f===e.id,T=f?p.get(f)?.has(e.id)??!1:!1,V=f!==null&&!k&&!T,W=ae(e.id);if(n.beginPath(),n.arc(x,S,m,0,Math.PI*2),n.fillStyle=de(c,{connections:e.connections,colorIndex:W,selectedNodeId:f,nodeId:e.id,isConnected:T}),n.fill(),V)return;n.strokeStyle=u.nodeStroke,n.lineWidth=(k?2:1)/o,n.stroke(),k&&(n.beginPath(),n.arc(x,S,m+2/o,0,Math.PI*2),n.strokeStyle=u.nodeSelectedStroke,n.lineWidth=1.5/o,n.stroke());const _=T&&e.connections>=4;if(k||_||o>2.5){const P=e.title||"Untitled",E=Math.max(10/o,2.5);n.font=ue(c,{fontSize:E,emphasize:k}),n.textAlign="center",n.textBaseline="top";const M=n.measureText(P).width,j=2/o,F=S+m+3/o;n.fillStyle=u.labelBackground,n.fillRect(x-M/2-j,F,M+j*2,E+j*2),n.fillStyle=u.labelText,n.fillText(P,x,F+j)}},[d,c]),$=i.useCallback((e,n,o)=>{const u=d,f=e.source,p=e.target,m=u?f.id===u||p.id===u:!1;n.beginPath(),n.moveTo(f.x||0,f.y||0),n.lineTo(p.x||0,p.y||0),n.strokeStyle=ce(c,{selectedNodeId:u,isConnected:m}),n.lineWidth=m?2/o:.5/o,n.stroke()},[d,c]);return l?t.jsx(C,{title:"Knowledge Graph",description:`${l.nodes.length} linked notes, ${l.links.length} connections`,children:t.jsxs("div",{ref:a,className:"surface-base graph-canvas relative overflow-hidden",style:{"--graph-bg":h.background},children:[d&&(()=>{const e=l.nodes.find(n=>n.id===d);return e?t.jsxs("div",{className:"surface-floating absolute top-3 left-3 z-10 flex items-center gap-2 px-3 py-2",children:[t.jsx(N,{as:"span",variant:"meta",weight:"semibold",truncate:!0,className:"max-w-48",children:e.title}),t.jsxs(N,{as:"span",variant:"label",tone:"tertiary",children:[e.connections," links"]}),t.jsx("button",{type:"button",onClick:()=>b(null),className:"focus-ring-soft ml-1 flex h-6 w-6 cursor-pointer items-center justify-center rounded-[8px] text-fg-tertiary transition-colors hover:bg-hover-subtle hover:text-fg-default","aria-label":"Deselect node",children:t.jsx(oe,{className:"h-3.5 w-3.5"})})]}):null})(),t.jsxs("div",{className:"surface-floating absolute top-3 right-3 z-10 flex flex-col gap-1.5 px-3 py-2.5",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"legend-dot h-2.5 w-2.5 shrink-0 rounded-full",style:{"--legend-color":h.legendHub}}),t.jsx(N,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Hub notes (4+ connections)"})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"legend-dot h-2.5 w-2.5 shrink-0 rounded-full",style:{"--legend-color":h.nodeConnected}}),t.jsx(N,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:"Connected notes"})]})]}),t.jsx(se,{ref:r,graphData:l,width:g.width,height:g.height,nodeId:"id",nodeLabel:"",nodeCanvasObject:Z,nodePointerAreaPaint:(e,n,o)=>{o.beginPath(),o.arc(e.x||0,e.y||0,Math.max(z(e.connections)+4,10),0,2*Math.PI),o.fillStyle=n,o.fill()},linkCanvasObject:$,linkCanvasObjectMode:()=>"replace",linkDirectionalParticles:0,onNodeClick:B,onNodeHover:K,onBackgroundClick:L,onNodeDrag:q,onNodeDragEnd:A,warmupTicks:30,cooldownTicks:80,d3AlphaDecay:.05,d3VelocityDecay:.3,enableZoomInteraction:!0,enablePanInteraction:!0,minZoom:.3,maxZoom:5})]})}):t.jsx(C,{title:"Knowledge Graph",description:"0 linked notes, 0 connections",children:t.jsx(re,{title:"No constellations yet",description:"Link your notes together and watch your own starry sky unfold"})})}function ke(){return t.jsx(Q,{fallback:fe,errorTitle:"Failed to load graph",errorDescription:"Retry loading your linked note constellation",renderError:({error:s,retry:a})=>t.jsx(C,{title:"Knowledge Graph",children:t.jsx(U,{title:"Failed to load graph",description:"Retry loading your linked note constellation",error:s,onRetry:a})}),children:t.jsx(he,{})})}export{ke as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./note-vendor-
|
|
1
|
+
import{j as e}from"./note-vendor-5N5mRkIT.js";import{a as g}from"./graph-vendor-CUxe67Lr.js";function u({src:r,alt:n,loading:t="lazy",className:i}){const s=g.useRef(null);return g.useEffect(()=>{if(!s.current||t!=="lazy"||!r)return;const a=new IntersectionObserver(([c])=>{if(c.isIntersecting){const A=c.target;A.src=A.dataset.src,a.unobserve(A)}});return a.observe(s.current),()=>{a.disconnect()}},[t,r]),e.jsx(e.Fragment,{children:t!=="lazy"?e.jsx("img",{src:r,alt:n,className:`${i??""} dark:brightness-[0.85] dark:saturate-[0.9]`.trim()}):e.jsx("img",{ref:s,src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2O4evXqfwAIgQN/QHwrfwAAAABJRU5ErkJggg==",alt:n,"data-src":r,className:`${i??""} dark:brightness-[0.85] dark:saturate-[0.9]`.trim()})})}export{u as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./graph-vendor-CUxe67Lr.js";import{p as m}from"./index-
|
|
1
|
+
import{a}from"./graph-vendor-CUxe67Lr.js";import{p as m}from"./index-Bsx4P7EA.js";const n=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M144,96a16,16,0,1,1,16,16A16,16,0,0,1,144,96Zm92-40V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56ZM44,60v79.72l33.86-33.86a20,20,0,0,1,28.28,0L147.31,147l17.18-17.17a20,20,0,0,1,28.28,0L212,149.09V60Zm0,136H162.34L92,125.66l-48,48Zm168,0V183l-33.37-33.37L164.28,164l32,32Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M224,56V178.06l-39.72-39.72a8,8,0,0,0-11.31,0L147.31,164,97.66,114.34a8,8,0,0,0-11.32,0L32,168.69V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),a.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM156,88a12,12,0,1,1-12,12A12,12,0,0,1,156,88Zm60,112H40V160.69l46.34-46.35a8,8,0,0,1,11.32,0h0L165,181.66a8,8,0,0,0,11.32-11.32l-17.66-17.65L173,138.34a8,8,0,0,1,11.31,0L216,170.07V200Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,42H40A14,14,0,0,0,26,56V200a14,14,0,0,0,14,14H216a14,14,0,0,0,14-14V56A14,14,0,0,0,216,42ZM40,54H216a2,2,0,0,1,2,2V163.57L188.53,134.1a14,14,0,0,0-19.8,0l-21.42,21.42L101.9,110.1a14,14,0,0,0-19.8,0L38,154.2V56A2,2,0,0,1,40,54ZM38,200V171.17l52.58-52.58a2,2,0,0,1,2.84,0L176.83,202H40A2,2,0,0,1,38,200Zm178,2H193.8l-38-38,21.41-21.42a2,2,0,0,1,2.83,0l38,38V200A2,2,0,0,1,216,202ZM146,100a10,10,0,1,1,10,10A10,10,0,0,1,146,100Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm0,16V158.75l-26.07-26.06a16,16,0,0,0-22.63,0l-20,20-44-44a16,16,0,0,0-22.62,0L40,149.37V56ZM40,172l52-52,80,80H40Zm176,28H194.63l-36-36,20-20L216,181.38V200ZM144,100a12,12,0,1,1,12,12A12,12,0,0,1,144,100Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,44H40A12,12,0,0,0,28,56V200a12,12,0,0,0,12,12H216a12,12,0,0,0,12-12V56A12,12,0,0,0,216,44ZM40,52H216a4,4,0,0,1,4,4V168.4l-32.89-32.89a12,12,0,0,0-17,0l-22.83,22.83-46.82-46.83a12,12,0,0,0-17,0L36,159V56A4,4,0,0,1,40,52ZM36,200V170.34l53.17-53.17a4,4,0,0,1,5.66,0L181.66,204H40A4,4,0,0,1,36,200Zm180,4H193l-40-40,22.83-22.83a4,4,0,0,1,5.66,0L220,179.71V200A4,4,0,0,1,216,204ZM148,100a8,8,0,1,1,8,8A8,8,0,0,1,148,100Z"}))]]),e=a.forwardRef((l,t)=>a.createElement(m,{ref:t,...l,weights:n}));e.displayName="ImageIcon";const Z=e;export{Z as I};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./graph-vendor-CUxe67Lr.js";import{p as n}from"./index-
|
|
1
|
+
import{a as e}from"./graph-vendor-CUxe67Lr.js";import{p as n}from"./index-Bsx4P7EA.js";import{j as r}from"./note-vendor-5N5mRkIT.js";const m=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"}))]]),t=e.forwardRef((a,l)=>e.createElement(n,{ref:l,...a,weights:m}));t.displayName="PlusIcon";const s=t;function p({children:a}){return r.jsx("div",{className:"flex w-full flex-col-reverse gap-2 sm:flex-row sm:justify-end",children:a})}export{p as M,s as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e,i as $,k as je,U as ee,y as te,v as we,X as Ne,F as Ce}from"./note-vendor-5N5mRkIT.js";import{p as Y,T as p,c as H,a4 as ae,ad as He,q as C,M as j,B as M,v as ne,w as Me,u as Ee,ae as ke,af as Ve,ag as Ae,d as N,l as F,I as Re,m as Se,n as Te,o as B,g as Ze,ah as De,Z as Le,D as se,k as re,ai as oe,aj as Fe,ak as le,a2 as ie,N as z,ab as Be,x as Ie,al as Oe,a3 as Pe,_ as O,P as _,a1 as P,j as $e,i as T,am as Ye,an as ze,ao as _e,ap as Ue,aq as Q,ar as qe,L as Ke,as as W}from"./index-Bsx4P7EA.js";import{a}from"./graph-vendor-CUxe67Lr.js";import{M as ce,n as Qe}from"./ModalActionRow-DjI5b4bl.js";import{C as We}from"./Callout-Ap1OcxWN.js";import{u as Ge,R as Je}from"./useReminderMutate-DsIvVpCQ.js";import{u as Xe}from"./image.api-DGXlQ_Ca.js";import{A as et,F as tt,a2 as de,a3 as at}from"./note-core-GgFcksAF.js";const nt=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,28H88A12,12,0,0,0,76,40V76H40A12,12,0,0,0,28,88V216a12,12,0,0,0,12,12H168a12,12,0,0,0,12-12V180h36a12,12,0,0,0,12-12V40A12,12,0,0,0,216,28ZM156,204H52V100H156Zm48-48H180V88a12,12,0,0,0-12-12H100V52H204Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,40V168H168V88H88V40Z",opacity:"0.2"}),a.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32Zm-8,128H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,34H88a6,6,0,0,0-6,6V82H40a6,6,0,0,0-6,6V216a6,6,0,0,0,6,6H168a6,6,0,0,0,6-6V174h42a6,6,0,0,0,6-6V40A6,6,0,0,0,216,34ZM162,210H46V94H162Zm48-48H174V88a6,6,0,0,0-6-6H94V46H210Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216,36H88a4,4,0,0,0-4,4V84H40a4,4,0,0,0-4,4V216a4,4,0,0,0,4,4H168a4,4,0,0,0,4-4V172h44a4,4,0,0,0,4-4V40A4,4,0,0,0,216,36ZM164,212H44V92H164Zm48-48H172V88a4,4,0,0,0-4-4H92V44H212Z"}))]]),st=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M216.49,79.52l-56-56A12,12,0,0,0,152,20H56A20,20,0,0,0,36,40V216a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V88A12,12,0,0,0,216.49,79.52ZM160,57l23,23H160ZM60,212V44h76V92a12,12,0,0,0,12,12h48V212Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M208,88H152V32Z",opacity:"0.2"}),a.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM152,88V44l44,44Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M212.24,83.76l-56-56A6,6,0,0,0,152,26H56A14,14,0,0,0,42,40V216a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V88A6,6,0,0,0,212.24,83.76ZM158,46.48,193.52,82H158ZM200,218H56a2,2,0,0,1-2-2V40a2,2,0,0,1,2-2h90V88a6,6,0,0,0,6,6h50V216A2,2,0,0,1,200,218Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M213.66,82.34l-56-56A8,8,0,0,0,152,24H56A16,16,0,0,0,40,40V216a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V88A8,8,0,0,0,213.66,82.34ZM160,51.31,188.69,80H160ZM200,216H56V40h88V88a8,8,0,0,0,8,8h48V216Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M210.83,85.17l-56-56A4,4,0,0,0,152,28H56A12,12,0,0,0,44,40V216a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V88A4,4,0,0,0,210.83,85.17ZM156,41.65,198.34,84H156ZM200,220H56a4,4,0,0,1-4-4V40a4,4,0,0,1,4-4h92V88a4,4,0,0,0,4,4h52V216A4,4,0,0,1,200,220Z"}))]]),rt=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M87.5,151.52l64-64a12,12,0,0,1,17,17l-64,64a12,12,0,0,1-17-17Zm131-114a60.08,60.08,0,0,0-84.87,0L103.51,67.61a12,12,0,0,0,17,17l30.07-30.06a36,36,0,0,1,50.93,50.92L171.4,135.52a12,12,0,1,0,17,17l30.08-30.06A60.09,60.09,0,0,0,218.45,37.55ZM135.52,171.4l-30.07,30.08a36,36,0,0,1-50.92-50.93l30.06-30.07a12,12,0,0,0-17-17L37.55,133.58a60,60,0,0,0,84.88,84.87l30.06-30.07a12,12,0,0,0-17-17Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M209.94,113.94l-96,96a48,48,0,0,1-67.88-67.88l96-96a48,48,0,0,1,67.88,67.88Z",opacity:"0.2"}),a.createElement("path",{d:"M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"}))],["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,32ZM144.56,173.66l-21.45,21.45a44,44,0,0,1-62.22-62.22l21.45-21.46a8,8,0,0,1,11.32,11.31L72.2,144.2a28,28,0,0,0,39.6,39.6l21.45-21.46a8,8,0,0,1,11.31,11.32Zm-34.9-16a8,8,0,0,1-11.32-11.32l48-48a8,8,0,0,1,11.32,11.32Zm85.45-34.55-21.45,21.45a8,8,0,0,1-11.32-11.31L183.8,111.8a28,28,0,0,0-39.6-39.6L122.74,93.66a8,8,0,0,1-11.31-11.32l21.46-21.45a44,44,0,0,1,62.22,62.22Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M164.25,91.75a6,6,0,0,1,0,8.49l-64,64a6,6,0,0,1-8.49-8.48l64-64A6,6,0,0,1,164.25,91.75ZM214.2,41.8a54.07,54.07,0,0,0-76.38,0L107.75,71.85a6,6,0,0,0,8.49,8.49l30.07-30.06a42,42,0,0,1,59.41,59.41l-30.08,30.07a6,6,0,1,0,8.49,8.49l30.07-30.07A54,54,0,0,0,214.2,41.8ZM139.76,175.64l-30.07,30.08a42,42,0,0,1-59.41-59.41l30.06-30.07a6,6,0,0,0-8.49-8.49l-30,30.07a54,54,0,0,0,76.38,76.39l30.07-30.08a6,6,0,0,0-8.49-8.49Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M165.66,90.34a8,8,0,0,1,0,11.32l-64,64a8,8,0,0,1-11.32-11.32l64-64A8,8,0,0,1,165.66,90.34ZM215.6,40.4a56,56,0,0,0-79.2,0L106.34,70.45a8,8,0,0,0,11.32,11.32l30.06-30a40,40,0,0,1,56.57,56.56l-30.07,30.06a8,8,0,0,0,11.31,11.32L215.6,119.6a56,56,0,0,0,0-79.2ZM138.34,174.22l-30.06,30.06a40,40,0,1,1-56.56-56.57l30.05-30.05a8,8,0,0,0-11.32-11.32L40.4,136.4a56,56,0,0,0,79.2,79.2l30.06-30.07a8,8,0,0,0-11.32-11.31Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M162.84,93.16a4,4,0,0,1,0,5.66l-64,64a4,4,0,0,1-5.66-5.66l64-64A4,4,0,0,1,162.84,93.16Zm49.95-49.95a52.07,52.07,0,0,0-73.56,0L109.17,73.27a4,4,0,0,0,5.65,5.66l30.07-30.06a44,44,0,0,1,62.24,62.24l-30.07,30.06a4,4,0,0,0,5.66,5.66l30.07-30.06A52.07,52.07,0,0,0,212.79,43.21ZM141.17,177.06l-30.06,30.07a44,44,0,0,1-62.24-62.24l30.06-30.06a4,4,0,0,0-5.66-5.66L43.21,139.23a52,52,0,0,0,73.56,73.56l30.06-30.07a4,4,0,1,0-5.66-5.66Z"}))]]),ue=a.forwardRef((t,n)=>a.createElement(Y,{ref:n,...t,weights:nt}));ue.displayName="CopyIcon";const ot=ue,me=a.forwardRef((t,n)=>a.createElement(Y,{ref:n,...t,weights:st}));me.displayName="FileIcon";const lt=me,pe=a.forwardRef((t,n)=>a.createElement(Y,{ref:n,...t,weights:rt}));pe.displayName="LinkSimpleIcon";const it=pe;function U({icon:t,title:n,className:o}){return e.jsxs("div",{className:H("flex items-center gap-2",o),children:[e.jsx("div",{className:"flex h-3.5 w-3.5 shrink-0 items-center justify-center text-current",children:t}),e.jsx(p,{as:"span",variant:"label",weight:"semibold",className:"text-current",children:n})]})}function ct({title:t,description:n,selected:o=!1,onClick:l,children:s}){return e.jsxs("button",{type:"button","aria-pressed":o,className:`focus-ring-soft flex w-full items-start justify-between gap-3 p-3 text-left transition-colors sm:p-4 ${o?"surface-floating bg-elevated":"rounded-[14px] border border-border-subtle bg-transparent hover:border-border-secondary hover:bg-hover-subtle"}`,onClick:l,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(p,{as:"div",variant:"body",weight:"semibold",tone:o?"default":"secondary",children:t}),e.jsx(p,{as:"div",variant:"meta",weight:"medium",tone:o?"secondary":"tertiary",className:"mt-1",children:n})]}),s?e.jsx("div",{className:"shrink-0",children:s}):null]})}const dt=t=>{const{data:n}=ae({queryKey:C.notes.backReferences(t.noteId),async queryFn(){const o=await He(t.noteId);if(o.type==="error")throw o;return o.backReferences}});return t.render(n)},ut=[{value:"narrow",label:"Narrow",description:"Optimized for reading long-form content"},{value:"wide",label:"Wide",description:"Balanced width suitable for most content"},{value:"full",label:"Full Width",description:"Maximize screen space utilization"}];function mt({isOpen:t,onClose:n,onSave:o,currentLayout:l="wide"}){const[s,c]=a.useState(l);a.useEffect(()=>{t&&c(l)},[t,l]);const i=()=>{o(s),n()};return e.jsxs(j,{isOpen:t,onClose:n,variant:"compact",children:[e.jsx(j.Header,{title:"Layout Settings",onClose:n}),e.jsx(j.Body,{children:e.jsx("div",{className:"flex flex-col gap-3 sm:gap-4",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(p,{as:"div",variant:"body",weight:"semibold",tone:"secondary",children:"Note layout"}),e.jsx("div",{className:"flex flex-col gap-2",children:ut.map(r=>e.jsx(ct,{title:r.label,description:r.description,selected:s===r.value,onClick:()=>c(r.value)},r.value))})]})})}),e.jsx(j.Footer,{children:e.jsxs(ce,{children:[e.jsx(M,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),e.jsx(M,{variant:"primary",size:"sm",onClick:i,children:"Apply"})]})})]})}const pt=(t,n)=>t||(n==="mobile"?"Mobile browser":n==="mcp"?"MCP":"Web browser");function ht({isOpen:t,noteId:n,onClose:o,onRestored:l}){const s=ne(),c=Me(),i=Ee({queryKey:C.notes.snapshots(n),queryFn:async()=>{const m=await ke(n);if(m.type==="error")throw m;return m.noteSnapshots},enabled:t}),r=Ve({mutationFn:Ae,onSuccess:async m=>{if(m.type==="error"){s(m.errors[0].message);return}await Promise.all([c.invalidateQueries({queryKey:C.notes.detail(n),exact:!0}),c.invalidateQueries({queryKey:C.notes.listAll(),exact:!1}),c.invalidateQueries({queryKey:C.notes.tagListAll(),exact:!1}),c.invalidateQueries({queryKey:C.notes.pinned(),exact:!0}),c.invalidateQueries({queryKey:C.notes.backReferences(n),exact:!0}),c.invalidateQueries({queryKey:C.notes.snapshots(n),exact:!1})]),s("Previous version restored."),l?.(m.restoreNoteSnapshot),o()}});return e.jsxs(j,{isOpen:t,onClose:o,variant:"inspect",children:[e.jsx(j.Header,{title:"Restore Previous Version",onClose:o}),e.jsx(j.Body,{children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(p,{as:"p",variant:"meta",tone:"secondary",children:"Choose a previous snapshot to restore this note back to that state."}),i.isLoading&&e.jsx(p,{as:"div",variant:"meta",tone:"secondary",children:"Loading previous versions..."}),!i.isLoading&&i.data?.length===0&&e.jsx(p,{as:"div",variant:"meta",tone:"secondary",className:"rounded-[14px] border border-border-subtle bg-hover-subtle/50 px-4 py-3",children:"A recovery snapshot appears before the first edit in a session. Up to five recent snapshots are kept automatically, and identical versions are skipped."}),!i.isLoading&&i.data&&i.data.length>0&&e.jsx("div",{className:"flex flex-col gap-2",children:i.data.map(m=>e.jsx("div",{className:"surface-base p-3",children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs(p,{as:"p",variant:"body",weight:"semibold",children:["Before"," ",pt(m.meta.label,m.meta.entrypoint)," ","edit"]}),e.jsx(p,{as:"p",variant:"meta",truncate:!0,tone:"secondary",children:m.title}),e.jsx(p,{as:"p",variant:"label",tone:"tertiary",children:N(m.createdAt).format("YYYY-MM-DD HH:mm:ss")})]}),e.jsx(M,{size:"sm",isLoading:r.isPending,onClick:()=>r.mutate(m.id),children:"Restore"})]})},m.id))})]})})]})}const G={low:{active:"border-border-secondary bg-elevated text-fg-default",inactive:"border-transparent bg-transparent text-fg-muted hover:bg-hover-subtle"},medium:{active:"border-border-secondary bg-elevated text-fg-default",inactive:"border-transparent bg-transparent text-fg-muted hover:bg-hover-subtle"},high:{active:"border-border-secondary bg-elevated text-fg-default",inactive:"border-transparent bg-transparent text-fg-muted hover:bg-hover-subtle"}};function ft({isOpen:t,onClose:n,onSave:o,reminder:l,mode:s}){const[c,i]=a.useState(new Date),[r,m]=a.useState("medium"),[b,x]=a.useState("");a.useEffect(()=>{t&&s==="edit"&&l?(i(new Date(Number(l.reminderDate))),m(l.priority||"medium"),x(l.content||"")):t&&s==="create"&&(i(new Date),m("medium"),x(""))},[t,s,l]);const E=()=>{o(c,r,b||void 0),n()},y=g=>r===g?G[g].active:G[g].inactive;return e.jsxs(j,{isOpen:t,onClose:n,variant:"form",children:[e.jsx(j.Header,{title:s==="create"?"Create Reminder":"Edit Reminder",onClose:n}),e.jsx(j.Body,{children:e.jsxs("div",{className:"flex flex-col gap-3 sm:gap-4",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(F,{children:"Date & Time"}),e.jsx(Re,{type:"datetime-local",size:"sm",value:N(c).format("YYYY-MM-DDTHH:mm"),onChange:g=>i(new Date(g.target.value))})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(F,{children:"Content"}),e.jsx(Se,{size:"sm",placeholder:"Enter reminder content (optional)",value:b,onChange:g=>x(g.target.value)})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(F,{children:"Priority"}),e.jsxs(Te,{type:"single",value:r,onValueChange:g=>g&&m(g),className:"gap-1.5 border-none rounded-[14px] bg-muted/70 p-1 sm:gap-2",children:[e.jsx(B,{value:"low",className:`flex-1 rounded-[10px] border ${y("low")}`,children:e.jsx(p,{as:"span",weight:"medium",className:"text-current",children:"Low"})}),e.jsx(B,{value:"medium",className:`flex-1 rounded-[10px] border ${y("medium")}`,children:e.jsx(p,{as:"span",weight:"medium",className:"text-current",children:"Medium"})}),e.jsx(B,{value:"high",className:`flex-1 rounded-[10px] border ${y("high")}`,children:e.jsx(p,{as:"span",weight:"medium",className:"text-current",children:"High"})})]})]})]})}),e.jsx(j.Footer,{children:e.jsxs(ce,{children:[e.jsx(M,{variant:"ghost",size:"sm",onClick:n,children:"Cancel"}),e.jsx(M,{variant:"primary",size:"sm",onClick:E,children:s==="create"?"Create":"Save"})]})})]})}function xt({noteId:t}){const[n,o]=a.useState(!1),[l,s]=a.useState(!1),[c,i]=a.useState("create"),[r,m]=a.useState(void 0),{onCreate:b,onUpdate:x,onDelete:E}=Ge(),y=()=>{i("create"),m(void 0),s(!0)},g=h=>{i("edit"),m(h),s(!0)},V=(h,f,u)=>{c==="create"?b(t,h,f,()=>{s(!1)},u):c==="edit"&&r&&x(r.id,t,{reminderDate:h,priority:f,content:u},()=>{s(!1)})},A=h=>{x(h.id,t,{completed:!h.completed})},S=h=>{const f=N(Number(h)),u=N();return f.isSame(u,"day")?`Today at ${f.format("HH:mm")}`:f.isSame(u.add(1,"day"),"day")?`Tomorrow at ${f.format("HH:mm")}`:f.format("YYYY-MM-DD HH:mm")},Z=h=>{const f=N(Number(h)),u=N(),w=f.diff(u,"hour");return w<=6?"high":w<=24?"medium":"low"},L=h=>{const f=N(Number(h)),u=N(),w=f.diff(u,"hour"),k=f.diff(u,"minute")%60;return w<0||k<0?"Overdue":w===0?`${k}m remaining`:`${w}h ${k}m remaining`};return e.jsxs("div",{className:"surface-base mb-5 p-4",children:[e.jsxs("div",{className:H("flex items-center justify-between",!n&&"mb-3"),children:[e.jsx("button",{type:"button",onClick:()=>o(!n),className:"focus-ring-soft flex items-center gap-2 rounded-[10px] px-2 py-1.5 text-fg-tertiary transition-colors hover:bg-hover-subtle hover:text-fg-default",children:e.jsx(U,{icon:n?e.jsx(Ze,{size:12}):e.jsx(De,{size:12}),title:"Reminders"})}),!n&&e.jsxs(M,{size:"sm",variant:"ghost",onClick:y,children:[e.jsx(Qe,{className:"w-3 h-3"}),e.jsx(p,{as:"span",variant:"label",className:"hidden sm:inline",children:"Add"})]})]}),!n&&e.jsx(Je,{noteId:t,searchParams:{offset:0,limit:9999},render:({reminders:h,totalCount:f})=>e.jsx("div",{className:"flex flex-col gap-2",children:h.length===0?e.jsx(p,{as:"p",variant:"meta",tone:"secondary",className:"py-3 text-center",children:f===0?"No reminders yet":"All reminders complete"}):e.jsx("div",{className:"flex flex-col",children:h.map(u=>{const w=u.priority||Z(u.reminderDate),k=L(u.reminderDate),D=k==="Overdue";return e.jsxs("div",{className:H("flex items-center gap-2.5 px-2 py-1.5"),children:[e.jsx(Le,{checked:u.completed,onChange:()=>A(u),size:"sm"}),e.jsx(p,{as:"div",variant:"body",weight:"medium",className:H("truncate flex-1 min-w-0",u.completed&&"line-through opacity-40"),children:u.content||S(u.reminderDate)}),e.jsxs("div",{className:H("shrink-0 flex items-center gap-1",u.completed&&"opacity-40"),children:[u.content&&e.jsx(p,{as:"span",variant:"meta",tone:"secondary",children:S(u.reminderDate)}),!u.completed&&e.jsx(p,{as:"span",variant:"label",weight:"medium",tone:D||w==="high"?"error":"tertiary",className:H(u.content&&'before:content-["·"] before:mr-1'),children:k})]}),e.jsx(se,{button:e.jsx(re,{label:"Reminder actions"}),items:[{name:"Edit",onClick:()=>g(u)},{name:"Delete",onClick:()=>E(u.id,t)}]})]},u.id)})})})}),e.jsx(ft,{isOpen:l,onClose:()=>s(!1),onSave:V,reminder:r,mode:c})]})}const gt=({editor:t})=>e.jsx($,{triggerCharacter:"/",getItems:async n=>et([...je(t).filter(o=>o.title!=="Audio"&&o.title!=="Video"&&o.title!=="File"),{title:"Table of Contents",subtext:"Insert a table of contents based on headings",onItemClick:()=>{t.insertBlocks([{type:"tableOfContents"}],t.getTextCursorPosition().block,"after")},aliases:["toc","table of contents","contents","outline","index"],group:"Other",icon:e.jsx(oe,{})}],n)}),yt=(t,n)=>n?t.filter(o=>o.id!==n):t,bt=({currentNoteId:t,onClick:n})=>e.jsx($,{triggerCharacter:"[",getItems:async o=>{const l=await Fe({query:o,limit:5});return l.type==="error"?[]:yt(l.allNotes.notes,t).map(c=>({title:c.title,onItemClick:()=>n({type:"reference",props:{id:c.id,title:c.title}})}))}}),vt="pointer-events-auto inline-flex h-7 cursor-pointer select-none items-center gap-1.5 rounded-[8px] border border-white/10 bg-white/10 px-2.5 text-xs font-medium text-white/60 opacity-75 shadow-[0_8px_18px_-14px_rgba(0,0,0,0.45)] backdrop-blur-sm transition-colors hover:bg-white/20 hover:text-white/90 hover:opacity-100 focus-ring-soft focus:text-white/90 focus:opacity-100",jt={idle:"",copied:"text-accent-success hover:text-accent-success focus:text-accent-success",failed:"text-fg-error hover:text-fg-error focus:text-fg-error"},wt={idle:"Copy",copied:"Copied",failed:"Copy failed"},Nt=({getText:t,resetDelayMs:n=2e3})=>{const[o,l]=a.useState("idle"),s=a.useRef(null),c=a.useCallback(()=>{s.current&&(clearTimeout(s.current),s.current=null)},[]),i=a.useCallback(()=>{c(),s.current=setTimeout(()=>{l("idle"),s.current=null},n)},[c,n]);a.useEffect(()=>c,[c]);const r=x=>{x.stopPropagation()},m=x=>{x.preventDefault(),x.stopPropagation()},b=async x=>{r(x);try{await navigator.clipboard.writeText(t()),l("copied")}catch{l("failed")}i()};return e.jsx("div",{className:"pointer-events-none absolute right-3 top-2 z-[1]",contentEditable:!1,onMouseDown:m,children:e.jsxs("button",{type:"button",className:H(vt,jt[o]),contentEditable:!1,onClick:b,children:[e.jsx(ot,{className:"h-3.5 w-3.5"}),e.jsx("span",{"aria-live":"polite",children:wt[o]})]})})},Ct=({contentRef:t})=>{const n=a.useRef(null),o=a.useCallback(l=>{n.current=l,t(l)},[t]);return e.jsxs(e.Fragment,{children:[e.jsx("pre",{children:e.jsx("code",{ref:o})}),e.jsx(Nt,{getText:()=>n.current?.textContent?.trimEnd()??""})]})},Ht="_Reference_102im_1",Mt={Reference:Ht},Et=le.bind(Mt),kt={type:"reference",propSchema:{id:{default:""},title:{default:"Unknown"}},content:"none"};function Vt(t){const n=ie(),o=()=>{t.editor.blur(),n({to:z,params:{id:t.inlineContent.props.id}})},l=s=>{s.preventDefault(),s.stopPropagation()};return e.jsx("span",{role:"link",tabIndex:0,contentEditable:!1,className:Et("Reference"),onMouseDown:l,onClick:s=>{l(s),o()},onKeyDown:s=>{s.key!=="Enter"&&s.key!==" "||(l(s),o())},children:e.jsxs("span",{children:["[",t.inlineContent.props.title,"]"]})})}const At=ee(kt,{render:t=>e.jsx(Vt,{...t})}),Rt=()=>{const t=we(),[n,o]=a.useState([]),l={1:"pl-3",2:"pl-[26px]",3:"pl-[40px]",4:"pl-[54px]",5:"pl-[68px]",6:"pl-[82px]"};a.useEffect(()=>{const i=()=>{const m=t.document,b=[],x=E=>{for(const y of E){if(y.type==="heading"){const g=y,V=g.props.level||1,A=g.content?.map(S=>S.text||"").join("")||"";A.trim()&&b.push({id:y.id,level:V,text:A})}y.children&&Array.isArray(y.children)&&x(y.children)}};x(m),o(b)};i();const r=t.onChange?.(i);return()=>{r&&r()}},[t]);const s=i=>{t.setTextCursorPosition(i);const r=document.querySelector(`[data-id="${i}"]`);r&&r.scrollIntoView({behavior:"smooth",block:"center"})},c=e.jsx(U,{icon:e.jsx(oe,{className:"h-3.5 w-3.5"}),title:"Table of Contents",className:"text-fg-tertiary"});return n.length===0?e.jsxs("div",{className:"surface-base w-full p-4",children:[c,e.jsx(p,{as:"p",variant:"meta",tone:"secondary",className:"mt-2",children:"Add headings to your document to generate a table of contents"})]}):e.jsxs("div",{className:"surface-base w-full p-4",children:[e.jsx("div",{className:"mb-2",children:c}),e.jsx("nav",{className:"space-y-0.5",children:n.map(i=>{const r=i.level===1;return e.jsxs("button",{type:"button",onClick:()=>s(i.id),className:H("focus-ring-soft","flex","w-full","items-center","gap-2","rounded-[10px]","px-2.5","py-1.5",l[i.level]??"pl-2.5","text-left","transition-colors","hover:bg-hover-subtle",r?"text-fg-default":"text-fg-secondary"),children:[e.jsxs(p,{as:"span",variant:"label",weight:"medium",tone:"tertiary",className:"min-w-[1.5rem]",children:["H",i.level]}),e.jsx(p,{as:"span",variant:"body",weight:r?"semibold":"medium",className:"line-clamp-2 text-current",children:i.text})]},i.id)})})]})},St=te({type:"tableOfContents",propSchema:{},content:"none"},{render:()=>e.jsx(Rt,{})})(),Tt="_Tag_1gb8h_1",Zt={Tag:Tt},Dt=le.bind(Zt),Lt={type:"tag",propSchema:{id:{default:""},tag:{default:"@Unknown"}},content:"none"};function Ft(t){const n=ie(),o=()=>{t.editor.blur(),n({to:Be,params:{id:t.inlineContent.props.id},search:{page:1}})},l=s=>{s.preventDefault(),s.stopPropagation()};return e.jsx("span",{role:"link",tabIndex:0,contentEditable:!1,className:Dt("Tag"),onMouseDown:l,onClick:s=>{l(s),o()},onKeyDown:s=>{s.key!=="Enter"&&s.key!==" "||(l(s),o())},children:e.jsx("span",{children:t.inlineContent.props.tag})})}const Bt=ee(Lt,{render:t=>e.jsx(Ft,{...t})}),It=t=>t,Ot=t=>t,Pt=It({tag:Bt,reference:At}),$t=Ot({tableOfContents:St}),R=de.codeBlock,J=te(R.config,{meta:R.implementation.meta,parse:R.implementation.parse,parseContent:R.implementation.parseContent,runsBefore:R.implementation.runsBefore,render:Ct})(),Yt={...J,extensions:R.extensions,implementation:{...J.implementation,toExternalHTML:R.implementation.toExternalHTML}},zt=tt.create({inlineContentSpecs:{...at,...Pt},blockSpecs:{...de,codeBlock:Yt,...$t}}),_t=(t,n)=>n.some(o=>o.name===`@${t}`),Ut=({onClick:t})=>e.jsx($,{triggerCharacter:"@",getItems:async n=>{const o=await Ie({query:n,limit:5});if(o.type==="error")return[];const{tags:l}=o.allTags,s=_t(n,l),c=[{title:"Add a new tag",onItemClick:async()=>{const i=await Oe({name:"@"+n});if(i.type==="error")return;const{id:r,name:m}=i.createTag;t({type:"tag",props:{id:r,tag:m}})}}];return l.length===0?c:l.map(i=>({title:i.name,onItemClick:()=>t({type:"tag",props:{id:i.id,tag:i.name}})})).concat(n&&!s?c:[])}});async function qt(t){return new Promise((n,o)=>{const l=new FileReader;l.readAsDataURL(t),l.onload=()=>n(l.result),l.onerror=s=>o(s)})}const Kt=a.forwardRef(({content:t,currentNoteId:n,editable:o,onChange:l},s)=>{const{theme:c}=Pe(r=>r),i=Ne({schema:zt,initialContent:t&&JSON.parse(t)||void 0,uploadFile:async r=>Xe({base64:await qt(r)})},[]);return a.useImperativeHandle(s,()=>({getContent:()=>JSON.stringify(i.document)})),e.jsxs(Ce,{slashMenu:!1,theme:c,editor:i,editable:o,onChange:l,children:[e.jsx(gt,{editor:i}),e.jsx(bt,{currentNoteId:n,onClick:r=>{i.insertInlineContent([r," "])}}),e.jsx(Ut,{onClick:r=>{i.insertInlineContent([r," "])}})]})}),he=$e(z),X=t=>N(Number(t)).format("YYYY-MM-DD HH:mm:ss"),I=()=>typeof globalThis.crypto?.randomUUID=="function"?globalThis.crypto.randomUUID():`${Date.now()}-${Math.random().toString(16).slice(2)}`,Qt={narrow:"max-w-[640px]",wide:"max-w-[896px]",full:"max-w-full px-4"},Wt=e.jsx(_,{title:"Loading note",variant:"none",children:e.jsxs("main",{className:"mx-auto max-w-[896px]",children:[e.jsx(T,{className:"mb-8",height:"66px"}),e.jsx(T,{className:"ml-12 mb-8",height:"150px"}),e.jsx(T,{className:"mb-5",height:"80px"}),e.jsx(T,{height:"80px"})]})});function Gt({id:t}){const n=ne(),o=he.useNavigate(),l=a.useRef(null),s=a.useRef(null),c=a.useRef(I()),i=ae({queryKey:C.notes.detail(t),queryFn:async()=>{const d=await Ye(t);if(d.type==="error")throw d;return d.note},gcTime:0}),r=i.data,[m,b]=a.useState(r.title),[x,E]=a.useState(()=>X(r.updatedAt)),[y,g]=a.useState(r.pinned),[V,A]=a.useState(r.layout||"wide"),[S,Z]=a.useState(!1),[L,h]=a.useState(!1),[f,u]=a.useState(null),[w,k]=ze(1e3);a.useEffect(()=>{b(r.title),g(r.pinned),A(r.layout||"wide"),E(X(r.updatedAt))},[r.layout,r.pinned,r.title,r.updatedAt]),a.useEffect(()=>{c.current=I(),u(null)},[t]),a.useEffect(()=>{u(d=>d?.type==="updated"&&d.updatedAt===r.updatedAt?null:d)},[r.updatedAt]),a.useEffect(()=>_e(d=>{if(d.noteId===t){if(d.type==="mcp.note.updated"){if(d.updatedAt===r.updatedAt)return;u({type:"updated",updatedAt:d.updatedAt});return}d.type==="mcp.note.deleted"&&u({type:"deleted"})}}),[t,r.updatedAt]);const D=async({title:d="",content:v=""})=>{k(async()=>{const K=await W({id:t,title:d,content:v,editSessionId:c.current});if(K.type==="error"){n(K.errors[0].message);return}b(d),E(N().format("YYYY-MM-DD HH:mm:ss"))})},q=()=>{D({title:m,content:l.current?.getContent()})},fe=d=>{b(d),D({title:d,content:l.current?.getContent()})},xe=async d=>{const v=await W({id:t,layout:d,editSessionId:c.current});if(v.type==="error"){n(v.errors[0].message);return}A(d),n("Layout has been updated.")},ge=async()=>{const d=await i.refetch();if(d.error||!d.data){n("Failed to reload the latest note state.");return}u(null)},{onCreate:ye,onDelete:be,onPinned:ve}=Ue();return e.jsx(_,{title:m,variant:"none",children:e.jsxs("main",{className:H("mx-auto",Qt[V]),children:[e.jsx("div",{className:"surface-floating sticky top-20 z-[1001] mb-7 px-5 pt-4 pb-3.5",children:e.jsxs("div",{className:"flex flex-col gap-3.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-5",children:[e.jsxs("div",{className:"min-w-0 flex-1 pt-0.5",children:[e.jsx(p,{as:"div",variant:"micro",weight:"semibold",tracking:"widest",transform:"uppercase",tone:"tertiary",className:"mb-1.5",children:"Thought in progress"}),e.jsx("input",{ref:s,placeholder:"Title",className:"text-heading sm:text-display w-full bg-transparent font-semibold leading-[1.25] tracking-[-0.02em] outline-none",type:"text",value:m,onChange:d=>fe(d.target.value)})]}),e.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[e.jsx(se,{button:e.jsx(re,{label:"Note actions",size:"lg"}),items:[{name:y?"Unpin":"Pin",onClick:()=>ve(t,y,()=>{g(d=>!d)})},{name:"Change layout",onClick:()=>Z(!0)},{type:"separator"},{name:"Clone this note",onClick:()=>ye(s.current?.value||"untitled",l.current?.getContent()||"",V)},{name:"Restore previous version",onClick:()=>h(!0)},{type:"separator"},{name:"Delete",onClick:()=>be(t,()=>{o({to:Q,search:{page:1}})})}]}),e.jsx(M,{size:"sm",variant:"subtle",isLoading:w,onClick:q,children:"Save"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-2.5 gap-y-1.5 border-t border-border-subtle/80 pt-3",children:[y&&e.jsxs(p,{as:"span",variant:"label",weight:"medium",tone:"secondary",className:"inline-flex items-center gap-1.5",children:[e.jsx(qe,{className:"h-3 w-3",weight:"fill"}),"Pinned"]}),y&&e.jsx("span",{className:"h-1 w-1 rounded-full bg-border-secondary"}),e.jsxs(p,{as:"span",variant:"label",weight:"medium",tone:"secondary",children:["Last saved ",x]})]})]})}),f&&e.jsx(We,{className:"mb-6",children:e.jsxs("div",{className:"flex w-full flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[e.jsx("span",{children:f.type==="updated"?"This note changed in MCP. Reload to review the latest version.":"This note was moved to trash from MCP. Open trash to review it."}),f.type==="updated"?e.jsx(M,{type:"button",size:"sm",variant:"subtle",className:"self-start",isLoading:i.isRefetching,onClick:ge,children:"Reload"}):e.jsx(M,{type:"button",size:"sm",variant:"subtle",className:"self-start",onClick:()=>o({to:Q,search:{page:1}}),children:"Open trash"})]})}),e.jsx(Kt,{ref:l,content:r.content,currentNoteId:t,onChange:q},`${t}:${r.updatedAt}`),e.jsx(O,{fallback:e.jsx(T,{className:"mb-5",height:"80px"}),errorTitle:"Failed to load reminders",errorDescription:"Retry loading reminder details for this note.",renderError:({error:d,retry:v})=>e.jsx(P,{title:"Failed to load reminders",description:"Retry loading reminder details for this note.",error:d,onRetry:v,showBackAction:!1,showHomeAction:!1}),children:e.jsx(xt,{noteId:t})}),e.jsx(O,{fallback:e.jsx(T,{height:"80px"}),errorTitle:"Failed to load back references",errorDescription:"Retry loading notes that link back here.",renderError:({error:d,retry:v})=>e.jsx(P,{title:"Failed to load back references",description:"Retry loading notes that link back here.",error:d,onRetry:v,showBackAction:!1,showHomeAction:!1}),children:e.jsx(dt,{noteId:t,render:d=>d&&d.length>0&&e.jsxs("div",{className:"surface-base p-4",children:[e.jsx(U,{icon:e.jsx(it,{className:"h-3.5 w-3.5"}),title:"Back References",className:"mb-3 text-fg-tertiary"}),e.jsx("ul",{className:"flex flex-col",children:d.map(v=>e.jsx("li",{children:e.jsxs(Ke,{to:z,params:{id:v.id},className:"flex items-center gap-2 rounded-[10px] px-2.5 py-1.5 text-fg-secondary transition-colors hover:bg-hover-subtle hover:text-fg-default",children:[e.jsx(lt,{className:"h-3.5 w-3.5 shrink-0 text-fg-tertiary"}),e.jsx(p,{as:"span",variant:"body",weight:"medium",className:"text-current",children:v.title})]})},v.id))})]})})}),e.jsx(mt,{isOpen:S,onClose:()=>Z(!1),onSave:xe,currentLayout:V}),e.jsx(ht,{isOpen:L,noteId:t,onClose:()=>h(!1),onRestored:()=>{c.current=I()}})]})})}function oa(){const{id:t}=he.useParams();if(!t)throw new Error("Note id is required.");return e.jsx(O,{fallback:Wt,errorTitle:"Failed to load note",errorDescription:"Retry loading the note editor.",resetKeys:[t],renderError:({error:n,retry:o})=>e.jsx(_,{title:"Note",variant:"none",children:e.jsx(P,{title:"Failed to load note",description:"Retry loading the note editor.",error:n,onRetry:o})}),children:e.jsx(Gt,{id:t},t)})}export{oa as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
._Reference_102im_1{display:inline-flex;align-items:center;cursor:pointer;font-size:.75rem;font-weight:600;padding:2px 8px;border-radius:8px;background:color-mix(in srgb,var(--elevated) 72%,var(--hover-subtle));border:1px solid var(--border-subtle);color:var(--fg-secondary);transition:background-color .15s ease,border-color .15s ease,color .15s ease}._Reference_102im_1:hover{background:var(--elevated);border-color:var(--border-secondary);color:var(--fg-default)}._Reference_102im_1:focus-visible{outline:2px solid var(--border-focus);outline-offset:2px}html.dark ._Reference_102im_1{background:color-mix(in srgb,var(--elevated) 82%,var(--hover-subtle))}._Tag_1gb8h_1{display:inline-flex;align-items:center;cursor:pointer;font-size:.75rem;font-weight:600;padding:2px 8px;border-radius:8px;background:var(--emphasis);border:1px solid var(--border-subtle);color:var(--fg-secondary);transition:background-color .15s ease,border-color .15s ease,color .15s ease}._Tag_1gb8h_1:hover{background:var(--hover-subtle);border-color:var(--border-secondary);color:var(--fg-default)}._Tag_1gb8h_1:focus-visible{outline:2px solid var(--border-focus);outline-offset:2px}html.dark ._Tag_1gb8h_1{background:var(--emphasis)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-5N5mRkIT.js";import{Z as k,T as h,L as H,N as M,D as E,k as L,d as x,_ as S,P as w,F as O,$ as C,i as o,j as U,a0 as I}from"./index-Bsx4P7EA.js";import"./graph-vendor-CUxe67Lr.js";import{u as P,R as Y}from"./useReminderMutate-DsIvVpCQ.js";import"./note-core-GgFcksAF.js";const u={high:"bg-priority-high",medium:"bg-priority-medium",low:"bg-priority-low"};function B({reminder:t,onUpdate:l,onDelete:g}){const f=y=>{const r=x(Number(y)),m=x();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=x(Number(y)),m=x(),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=u[i],c=t.noteId.toString(),n=d?"text-fg-error":"text-fg-tertiary",j=t.content?.trim()||t.note?.title||"Untitled reminder",R=t.note?.title||"Untitled note",T=!!(t.content?.trim()&&t.note?.title),D=a(t.reminderDate),$=f(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"}),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:j}),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:M,params:{id:String(t.note?.id??t.noteId)},className:"transition-colors hover:text-fg-default hover:underline",children:R})})]})]}),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(E,{button:e.jsx(L,{label:"Reminder actions",iconClassName:"h-5 w-5 text-current"}),items:[{name:"Delete",onClick:()=>g(t.id,c)}]})})]})}const v=U(I),_=[{label:"High",className:u.high},{label:"Medium",className:u.medium},{label:"Low",className:u.low}];function Z(){const t=v.useNavigate(),{page:l}=v.useSearch(),{onUpdate:g,onDelete:f}=P(),a=25,d=e.jsx("div",{className:"flex flex-wrap items-center gap-3",children:_.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(S,{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(Y,{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(O,{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:g,onDelete:f},n.id))}),s&&a<s&&e.jsx(C,{page:l,last:Math.ceil(s/a),onChange:n=>{t({search:j=>({...j,page:n})})}})]})})}})})}export{Z as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-5N5mRkIT.js";import{P as m,F as f,_ as N,a7 as b,T as h,L as w,N as S,$ as k,j as E,a8 as $,i as d}from"./index-Bsx4P7EA.js";import{a as R}from"./graph-vendor-CUxe67Lr.js";import"./note-core-GgFcksAF.js";const L=t=>t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),g=({children:t,match:s})=>{const r=s.trim();if(!r)return e.jsx("span",{children:t});const a=L(r),n=new RegExp(`(${a})`,"gi"),c=new RegExp(`^${a}$`,"i"),l=t.split(n);return e.jsx("span",{children:l.map((i,o)=>c.test(i)?e.jsx("mark",{children:i},o):e.jsx(R.Fragment,{children:i},o))})},j=E($),v=180,x=t=>t.replace(/\s+/g," ").trim(),T=(t,s)=>{const r=x(t),a=x(s).toLowerCase();if(!a)return r;const n=r.toLowerCase().indexOf(a);if(n===-1)return r.length>v?`${r.slice(0,v-1).trimEnd()}…`:r;const c=Math.max(0,n-56),l=Math.min(r.length,n+a.length+84);let i=r.slice(c,l).trim();return c>0&&(i=`…${i}`),l<r.length&&(i=`${i}…`),i},A=t=>Array.isArray(t)?t.map(s=>{if(!s||typeof s!="object")return"";const r=s.text;return typeof r=="string"?r:""}).join(""):"",B=(t,s)=>t==="heading"?`Heading ${typeof s?.level=="number"?s.level:1}`:t==="bulletListItem"?"Bullet":t==="numberedListItem"?"Numbered":t==="checkListItem"?"Checklist":t==="quote"?"Quote":t==="codeBlock"?"Code":"Content",y=(t,s)=>{Array.isArray(t)&&t.forEach(r=>{if(!r||typeof r!="object")return;const a=typeof r.type=="string"?r.type:void 0,n=typeof r.props=="object"&&r.props?r.props:void 0,c=x(A(r.content));c&&s.push({label:B(a,n),text:c});const l=r.children;Array.isArray(l)&&y(l,s)})},C=(t,s)=>{try{const r=JSON.parse(t),a=[];if(y(r,a),a.length===0)return[];const n=x(s).toLowerCase(),c=n?a.filter(i=>i.text.toLowerCase().includes(n)):a;return(c.length>0?c:a).slice(0,2).map(i=>({...i,text:T(i.text,s)}))}catch{return[]}},P=t=>t===1?"1 result":`${t} results`,M=()=>"Open the note to inspect matching content.",_=(t,s)=>`${P(s)} for "${t}"`,z=()=>e.jsx(m,{title:"Search",variant:"default",description:e.jsx(d,{width:208,height:16,className:"rounded-full"}),children:e.jsx("main",{className:"flex flex-col gap-3",children:Array.from({length:2},(t,s)=>e.jsxs("div",{className:"surface-base flex flex-col gap-3 p-4",children:[e.jsx(d,{width:"34%",height:18,className:"rounded-full"}),e.jsx("div",{className:"rounded-[14px] bg-muted px-3 py-3",children:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsxs("div",{children:[e.jsx(d,{width:84,height:12,className:"rounded-full"}),e.jsx(d,{width:"100%",height:14,className:"mt-2 rounded-full"}),e.jsx(d,{width:"82%",height:14,className:"mt-1.5 rounded-full"})]}),e.jsxs("div",{className:"border-t border-border-subtle pt-2",children:[e.jsx(d,{width:72,height:12,className:"rounded-full"}),e.jsx(d,{width:"94%",height:14,className:"mt-2 rounded-full"})]})]})})]},s))})});function F(){const t=j.useNavigate(),{page:s,query:r}=j.useSearch(),a=r.trim(),n=10;return a?e.jsx(N,{fallback:e.jsx(z,{}),errorTitle:"Failed to load search results",errorDescription:`Retry loading results for "${a}".`,resetKeys:[a,s],children:e.jsx(b,{searchParams:{query:a,limit:n,offset:(s-1)*n,fields:["content"]},render:({notes:c,totalCount:l})=>e.jsx(m,{title:"Search",description:_(a,l),variant:"default",children:e.jsxs("main",{className:"flex flex-col gap-4",children:[c.length>0?e.jsx("div",{className:"flex flex-col gap-3",children:c.map(i=>{const o=C(i.content,a);return e.jsxs("article",{className:"surface-base flex flex-col gap-3 p-4",children:[e.jsx(h,{as:"h2",variant:"body",weight:"semibold",tracking:"tight",children:e.jsx(w,{to:S,params:{id:i.id},className:"transition-colors hover:text-fg-default/85",children:e.jsx(g,{match:a,children:i.title||"Untitled"})})}),o.length>0?e.jsx("div",{className:"rounded-[14px] bg-muted px-3 py-3",children:e.jsx("div",{className:"flex flex-col gap-2",children:o.map((u,p)=>e.jsxs("div",{className:p>0?"border-t border-border-subtle pt-2":void 0,children:[e.jsx(h,{as:"div",variant:"micro",weight:"semibold",tracking:"wider",transform:"uppercase",tone:"tertiary",children:u.label}),e.jsx(h,{as:"p",variant:"meta",tone:"secondary",className:"mt-1 leading-[1.65]",children:e.jsx(g,{match:a,children:u.text})})]},`${i.id}:${u.label}:${p}`))})}):e.jsx(h,{as:"p",variant:"meta",tone:"secondary",className:"leading-[1.65]",children:M()})]},i.id)})}):e.jsx(f,{title:"No results found",description:"Try searching for a different word or phrase"}),l>n&&e.jsx(k,{page:s,last:Math.ceil(l/n),onChange:i=>{t({search:o=>({...o,page:i})})}})]})})})}):e.jsx(m,{title:"Search",description:"Search note titles and matching sections across your workspace",variant:"default",children:e.jsx("main",{children:e.jsx(f,{title:"Start searching",description:"Enter a keyword to look through note titles and matching content"})})})}export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as f}from"./note-vendor-
|
|
1
|
+
import{j as f}from"./note-vendor-5N5mRkIT.js";import{aM as o}from"./index-Bsx4P7EA.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{j as e}from"./note-vendor-5N5mRkIT.js";import{a4 as p,x as m,q as u,a9 as f,_ as j,P as h,aa as o,L as y,ab as T,T as c,$ as w,F as b,i as a,j as v,ac as N}from"./index-Bsx4P7EA.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-GgFcksAF.js";const R=s=>{const{data:t}=p({queryKey:u.tags.list(s.searchParams),async queryFn(){const i=await m({offset:s.searchParams.offset,limit:s.searchParams.limit});if(i.type==="error")throw i;return i.allTags}});return s.render(t)},A=100,P=8,_=12,x=v(N);function q(){const s=x.useNavigate(),{page:t}=x.useSearch(),{containerRef:i,limit:n}=f({minItemWidth:A,gap:P,rows:_});return e.jsx("div",{ref:i,children:e.jsx(j,{fallback:e.jsx(h,{title:"Tags",heading:e.jsx(a,{width:120,height:24,className:"rounded-full"}),description:e.jsx(a,{width:188,height:16,className:"rounded-full"}),children:e.jsxs("div",{className:"flex flex-wrap gap-2.5",children:[e.jsx(a,{width:"90px",height:"36px"}),e.jsx(a,{width:"120px",height:"36px"}),e.jsx(a,{width:"80px",height:"36px"}),e.jsx(a,{width:"100px",height:"36px"}),e.jsx(a,{width:"110px",height:"36px"}),e.jsx(a,{width:"70px",height:"36px"})]})}),errorTitle:"Failed to load tags",errorDescription:"Retry loading the tag catalog",resetKeys:[t,n],children:e.jsx(R,{searchParams:{offset:(t-1)*n,limit:n},render:({tags:d,totalCount:l})=>e.jsx(h,{title:"Tags",heading:l>0?`Tags (${l})`:void 0,description:"Browse the tags you added with @ across your notes",children:e.jsx(o,{fallback:e.jsx(b,{title:"No tags yet",description:"Add @tags inside notes and they will appear here"}),children:d.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"flex flex-wrap gap-2.5",children:d.map(r=>e.jsxs(y,{to:T,params:{id:r.id},search:{page:1},className:"inline-flex items-center gap-1.5 rounded-full border border-border-subtle bg-hover-subtle px-3 py-1.5 text-fg-secondary transition-colors hover:border-border-secondary hover:bg-hover hover:text-fg-default",children:[e.jsx(c,{as:"span",variant:"meta",weight:"medium",className:"text-current",children:r.name}),e.jsx(c,{as:"span",variant:"label",weight:"medium",tone:"tertiary",className:"text-current/70",children:r.referenceCount})]},r.id))}),e.jsx(o,{fallback:null,children:l&&n<l&&e.jsx(w,{page:t,last:Math.ceil(l/n),onChange:r=>{s({search:g=>({...g,page:r})})}})})]})})})})})})}export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-5N5mRkIT.js";import{a4 as f,at as p,q as j,ap as y,_ as N,P as g,aa as h,au as P,$ as T,F as v,i as d,j as q,ab as w}from"./index-Bsx4P7EA.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-GgFcksAF.js";const b=s=>{const{data:r}=f({queryKey:j.notes.tagList(s.searchParams),async queryFn(){const t=await p({query:s.searchParams.query,offset:s.searchParams.offset,limit:s.searchParams.limit});if(t.type==="error")throw t;return t.tagNotes}});return s.render(r)},c=q(w);function S(){const s=c.useNavigate(),{id:r}=c.useParams(),{page:t}=c.useSearch(),i=25,{onDelete:u,onPinned:m}=y();return e.jsx(N,{fallback:e.jsx(g,{title:"Tagged Notes",heading:e.jsx(d,{width:148,height:24,className:"rounded-full"}),description:e.jsx(d,{width:196,height:16,className:"rounded-full"}),variant:"default",children:e.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[e.jsx(d,{height:"112px"}),e.jsx(d,{height:"112px"}),e.jsx(d,{height:"112px"})]})}),errorTitle:"Failed to load tagged notes",errorDescription:"Retry loading notes for this tag",resetKeys:[r,t,i],children:e.jsx(b,{searchParams:{query:r,offset:(t-1)*i,limit:i},render:({notes:o,totalCount:n})=>{const l=o.flatMap(a=>a.tags).find(a=>a.id===r)?.name;return e.jsx(g,{title:l??"Tagged Notes",heading:l?n>0?`${l} (${n})`:l:"Tagged Notes",description:"Browse every note linked to this tag",variant:"default",children:e.jsx(h,{fallback:e.jsx(v,{title:"No tagged notes yet",description:"Notes tagged with this label will appear here"}),children:o.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid-auto-cards grid gap-5",children:o.map(a=>e.jsx(P,{...a,onPinned:()=>m(a.id,a.pinned),onDelete:()=>u(a.id)},a.id))}),e.jsx(h,{fallback:null,children:n&&i<n&&e.jsx(T,{page:t,last:Math.ceil(n/i),onChange:a=>{s({search:x=>({...x,page:a})})}})})]})})})}})})}export{S as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./graph-vendor-CUxe67Lr.js";import{p as l}from"./index-
|
|
1
|
+
import{a}from"./graph-vendor-CUxe67Lr.js";import{p as l}from"./index-Bsx4P7EA.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{j as e}from"./note-vendor-5N5mRkIT.js";import{P as d,F as x,_ as y,i as n,j as N,V as v,ap as b,u as V,q as h,a4 as S,aa as p,au as q,$ as C,T as R}from"./index-Bsx4P7EA.js";import{q as k,f as T,a as E}from"./view-dashboard-CP8nhfxQ.js";import"./graph-vendor-CUxe67Lr.js";import"./note-core-GgFcksAF.js";const u=N(v);function F(){const o=u.useNavigate(),{page:i,sectionId:r}=u.useSearch(),{onDelete:g,onPinned:f}=b(),a=25,{data:c}=V({queryKey:h.views.section(r),async queryFn(){const t=await k(r);if(t.type==="error")throw t;return t.viewSection}}),{data:s}=S({queryKey:h.views.sectionNotes(r,{limit:a,offset:(i-1)*a}),async queryFn(){const t=await T(r,{limit:a,offset:(i-1)*a});if(t.type==="error")throw t;return t.viewSectionNotes}}),l=c?.title||"View Notes",m=c?.tagNames??[],j=c?.mode??"and";return e.jsx(d,{title:l,heading:s.totalCount>0?`${l} (${s.totalCount})`:l,description:e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(R,{as:"span",variant:"meta",tone:"tertiary",children:E(j)}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:m.map(t=>e.jsx("span",{className:"inline-flex items-center rounded-full border border-border-subtle bg-hover-subtle px-2.5 py-1 text-xs font-medium text-fg-secondary",children:t},t))})]}),children:e.jsx(p,{fallback:e.jsx(x,{title:"No notes match this saved view",description:"Adjust the section tags or keep writing until matching notes appear."}),children:s.notes.length>0&&e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"grid-auto-cards grid gap-5",children:s.notes.map(t=>e.jsx(q,{...t,onPinned:()=>f(t.id,t.pinned),onDelete:()=>g(t.id)},t.id))}),e.jsx(p,{fallback:null,children:s.totalCount&&a<s.totalCount&&e.jsx(C,{page:i,last:Math.ceil(s.totalCount/a),onChange:t=>{o({search:w=>({...w,page:t})})}})})]})})})}function M(){const{sectionId:o,page:i}=u.useSearch();return o?e.jsx(y,{fallback:e.jsx(d,{title:"View Notes",heading:e.jsx(n,{width:180,height:24,className:"rounded-full"}),description:e.jsx(n,{width:220,height:16,className:"rounded-full"}),children:e.jsxs("div",{className:"grid-auto-cards grid gap-5",children:[e.jsx(n,{height:"112px"}),e.jsx(n,{height:"112px"}),e.jsx(n,{height:"112px"})]})}),errorTitle:"Failed to load view notes",errorDescription:"Retry loading notes for this saved view section",resetKeys:[i,o],children:e.jsx(F,{})}):e.jsx(d,{title:"View Notes",description:"Saved view note lists require a section id.",children:e.jsx(x,{title:"No section selected",description:"Return to Views and open a section from there."})})}export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-5N5mRkIT.js";import{p as ue,u as O,q as N,T as u,L as H,V as P,D as te,k as se,B as w,N as pe,t as ge,M as S,l as D,I as ae,S as fe,e as F,m as be,n as ve,o as _,r as je,v as we,w as ye,x as Ne,y as Se,z as K,A as ke,K as Te,E as Ce,P as Ve,i as I,F as Q,G as Z,H as Ee,J as $,O as U,Q as De,R as Ae,U as Me,W as re,X as ie,c as R,Y as ne}from"./index-Bsx4P7EA.js";import{a as r}from"./graph-vendor-CUxe67Lr.js";import{b as ze,f as Fe,g as Le,n as B,a as G,c as Re,d as We,E as He,s as Ie,e as qe,r as Oe,h as Pe,i as _e,j as Ke,k as Qe,u as Ze,l as $e,m as Ue,o as Be,p as Ge}from"./view-dashboard-CP8nhfxQ.js";import{S as A}from"./SurfaceCard-Br6TjX5W.js";import{M as oe,n as q}from"./ModalActionRow-DjI5b4bl.js";import"./note-core-GgFcksAF.js";const Ye=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M224.49,136.49l-72,72a12,12,0,0,1-17-17L187,140H40a12,12,0,0,1,0-24H187L135.51,64.48a12,12,0,0,1,17-17l72,72A12,12,0,0,1,224.49,136.49Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M216,128l-72,72V56Z",opacity:"0.2"}),r.createElement("path",{d:"M221.66,122.34l-72-72A8,8,0,0,0,136,56v64H40a8,8,0,0,0,0,16h96v64a8,8,0,0,0,13.66,5.66l72-72A8,8,0,0,0,221.66,122.34ZM152,180.69V75.31L204.69,128Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M221.66,133.66l-72,72A8,8,0,0,1,136,200V136H40a8,8,0,0,1,0-16h96V56a8,8,0,0,1,13.66-5.66l72,72A8,8,0,0,1,221.66,133.66Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M220.24,132.24l-72,72a6,6,0,0,1-8.48-8.48L201.51,134H40a6,6,0,0,1,0-12H201.51L139.76,60.24a6,6,0,0,1,8.48-8.48l72,72A6,6,0,0,1,220.24,132.24Z"}))],["regular",r.createElement(r.Fragment,null,r.createElement("path",{d:"M221.66,133.66l-72,72a8,8,0,0,1-11.32-11.32L196.69,136H40a8,8,0,0,1,0-16H196.69L138.34,61.66a8,8,0,0,1,11.32-11.32l72,72A8,8,0,0,1,221.66,133.66Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M218.83,130.83l-72,72a4,4,0,0,1-5.66-5.66L206.34,132H40a4,4,0,0,1,0-8H206.34L141.17,58.83a4,4,0,0,1,5.66-5.66l72,72A4,4,0,0,1,218.83,130.83Z"}))]]),le=r.forwardRef((s,i)=>r.createElement(ue,{ref:i,...s,weights:Ye}));le.displayName="ArrowRightIcon";const Je=le,Xe="flex items-start justify-between gap-3 rounded-[14px] border border-border-subtle/70 px-3 py-2.5 transition-colors hover:border-border-secondary hover:bg-hover-subtle";function et({section:s,onEdit:i,onDelete:n,dragHandle:c}){const x=ze(s),{data:l,isPending:m,isError:h,refetch:b}=O({queryKey:N.views.sectionNotes(s.id,{limit:s.limit,offset:0}),async queryFn(){const a=await Fe(s.id,{limit:s.limit,offset:0});if(a.type==="error")throw a;return a.viewSectionNotes}}),p=l?.notes??[],k=l?.totalCount??0,g=Le(s.mode);return e.jsxs(A,{className:"flex h-full flex-col gap-4",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[c&&e.jsx("div",{className:"-mr-1 shrink-0 self-center",children:c}),e.jsx("div",{className:"min-w-0",children:e.jsx(u,{as:"h2",variant:"subheading",weight:"semibold",tracking:"tight",className:"min-w-0",children:e.jsx(H,{to:P,search:x,className:"truncate hover:text-fg-default/85",children:s.title})})})]}),e.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:s.tagNames.map((a,C)=>e.jsxs("div",{className:"flex items-center gap-1.5",children:[C>0&&e.jsx("span",{className:"px-0.5 text-[10px] font-semibold tracking-[0.08em] text-fg-tertiary/85",children:g}),e.jsx("span",{className:"inline-flex items-center rounded-full border border-border-subtle/80 bg-transparent px-2.5 py-1 text-xs font-medium text-fg-secondary",children:a})]},a))})]}),e.jsx("div",{className:"shrink-0",children:e.jsx(te,{button:e.jsx(se,{label:"Section actions"}),items:[{name:"Edit section",onClick:i},{type:"separator"},{name:"Delete section",onClick:n}]})})]}),e.jsxs("div",{className:"flex flex-1 flex-col gap-2.5",children:[m&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-14 animate-pulse rounded-[14px] bg-hover-subtle"}),e.jsx("div",{className:"h-14 animate-pulse rounded-[14px] bg-hover-subtle"}),e.jsx("div",{className:"h-14 animate-pulse rounded-[14px] bg-hover-subtle"})]}),h&&e.jsxs("div",{className:"rounded-[16px] border border-border-subtle bg-hover-subtle/70 p-4",children:[e.jsx(u,{as:"p",variant:"body",weight:"semibold",children:"Failed to load this section"}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry to refresh the tag-based note block."}),e.jsx("div",{className:"mt-3",children:e.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:()=>b(),children:"Retry"})})]}),!m&&!h&&p.length===0&&e.jsxs("div",{className:"rounded-[16px] border border-dashed border-border-subtle px-4 py-5",children:[e.jsx(u,{as:"p",variant:"body",weight:"semibold",children:"No notes match yet"}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Add more notes with these tags, or edit the section filter."})]}),!m&&!h&&p.map(a=>e.jsxs(H,{to:pe,params:{id:a.id},className:Xe,children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx(u,{as:"div",variant:"body",weight:"semibold",className:"line-clamp-1",children:a.title||"Untitled"}),e.jsxs(u,{as:"div",variant:"meta",tone:"tertiary",className:"mt-1",children:["Updated ",ge(Number(a.updatedAt))]})]}),e.jsx(Je,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary"})]},a.id))]}),e.jsxs("div",{className:"flex items-center justify-between gap-3 border-t border-border-subtle/70 pt-4",children:[e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",children:m?"Loading notes...":`Showing ${p.length} of ${k} notes`}),e.jsx(w,{asChild:!0,variant:"subtle",size:"sm",children:e.jsx(H,{to:P,search:x,children:"Open list"})})]})]})}const Y=s=>String(s?.limit??5),J=s=>s?.mode??"and",X=s=>s?s.tagNames.join(", "):"",ee=s=>s?.title??"";function tt({open:s,mode:i,initialSection:n=null,availableTags:c,isTagsLoading:x=!1,onClose:l,onSubmit:m}){const[h,b]=r.useState(ee(n)),[p,k]=r.useState(X(n)),[g,a]=r.useState(J(n)),[C,L]=r.useState(Y(n)),[V,E]=r.useState("");r.useEffect(()=>{s&&(b(ee(n)),k(X(n)),a(J(n)),L(Y(n)),E(""))},[n,s]);const f=B([p]),v=d=>{const y=f.includes(d)?f.filter(W=>W!==d):[...f,d];k(y.join(", ")),E("")};return e.jsxs(S,{isOpen:s,onClose:l,variant:"form",className:"sm:max-w-[640px]",children:[e.jsx(S.Header,{title:i==="create"?"Create section":"Edit section",onClose:l}),e.jsx(S.Body,{children:e.jsxs("form",{id:"view-section-form",className:"flex flex-col gap-5",onSubmit:d=>{d.preventDefault();const y=B([p]);if(y.length===0){E("Add at least one tag for this section.");return}m({title:h,tagNames:y,mode:g,limit:Number(C)})},children:[e.jsxs("div",{className:"grid gap-4 md:grid-cols-[minmax(0,1fr)_180px]",children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{htmlFor:"view-section-title",size:"md",children:"Section title"}),e.jsx(ae,{id:"view-section-title",value:h,onChange:d=>b(d.target.value),placeholder:"Agent work",autoFocus:!0})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{htmlFor:"view-section-limit",size:"md",children:"Max notes"}),e.jsxs(fe,{value:C,onValueChange:L,children:[e.jsx(F,{value:"3",children:"3 notes"}),e.jsx(F,{value:"5",children:"5 notes"}),e.jsx(F,{value:"8",children:"8 notes"}),e.jsx(F,{value:"10",children:"10 notes"}),e.jsx(F,{value:"12",children:"12 notes"})]})]})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{htmlFor:"view-section-tags",size:"md",children:"Tags"}),e.jsx(be,{id:"view-section-tags",value:p,onChange:d=>{k(d.target.value),E("")},placeholder:"@OceanBrain, @todo",size:"sm"}),e.jsx(u,{as:"p",variant:"meta",tone:V?"default":"tertiary",className:V?"text-fg-error":void 0,children:V||"Separate tags with commas. Plain words become @tags automatically."})]}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{size:"md",children:"Tag match"}),e.jsxs(ve,{type:"single",value:g,onValueChange:d=>{(d==="and"||d==="or")&&a(d)},variant:"quiet",size:"sm",className:"self-start",children:[e.jsx(_,{value:"and","aria-label":G("and"),children:"Match all"}),e.jsx(_,{value:"or","aria-label":G("or"),children:"Match any"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(D,{size:"md",children:"Existing tags"}),e.jsx(u,{as:"span",variant:"meta",tone:"tertiary",children:x?"Loading tag catalog...":`${c.length} tags available`})]}),c.length>0?e.jsx("div",{className:"max-h-44 overflow-y-auto rounded-[18px] border border-border-subtle bg-hover-subtle/60 p-3",children:e.jsx("div",{className:"flex flex-wrap gap-2",children:c.map(d=>{const y=f.includes(d.name);return e.jsx("button",{type:"button",className:`inline-flex items-center rounded-full border px-3 py-1.5 text-sm font-medium transition-colors ${y?"border-border-secondary bg-elevated text-fg-default":"border-border-subtle bg-transparent text-fg-secondary hover:border-border-secondary hover:bg-elevated hover:text-fg-default"}`,onClick:()=>v(d.name),children:d.name},d.id)})})}):e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",children:"No tags yet. You can still type tag names manually."})]})]})}),e.jsx(S.Footer,{children:e.jsxs(oe,{children:[e.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:l,children:"Cancel"}),e.jsx(w,{type:"submit",size:"sm",form:"view-section-form",children:i==="create"?"Create section":"Save section"})]})})]})}function st({open:s,mode:i,initialTitle:n="",onClose:c,onSubmit:x}){const[l,m]=r.useState(n);return r.useEffect(()=>{s&&m(n)},[n,s]),e.jsxs(S,{isOpen:s,onClose:c,variant:"form",className:"sm:max-w-[480px]",children:[e.jsx(S.Header,{title:i==="create"?"Create view tab":"Rename view tab",onClose:c}),e.jsx(S.Body,{children:e.jsxs("form",{id:"view-tab-form",className:"flex flex-col gap-4",onSubmit:h=>{h.preventDefault(),x(l)},children:[e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(D,{htmlFor:"view-tab-title",size:"md",children:"Tab name"}),e.jsx(ae,{id:"view-tab-title",value:l,onChange:h=>m(h.target.value),placeholder:"Now",autoFocus:!0})]}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",children:"Each tab is one saved view inside the Views page."})]})}),e.jsx(S.Footer,{children:e.jsxs(oe,{children:[e.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:c,children:"Cancel"}),e.jsx(w,{type:"submit",size:"sm",form:"view-tab-form",children:i==="create"?"Create tab":"Save tab"})]})})]})}const at="Save tag-based views and switch between them without leaving your notes.",rt="focus-ring-soft inline-flex h-8 w-8 items-center justify-center rounded-[10px] text-fg-default/70 outline-none transition-colors hover:bg-hover-subtle hover:text-fg-default touch-none",it="group relative -mb-px flex h-10 min-w-[92px] max-w-[118px] shrink-0 items-center gap-0.5 rounded-t-[12px] border border-b-0 px-1.5 transition-[background-color,border-color,color,box-shadow]",nt="focus-ring-soft inline-flex min-w-0 flex-1 items-center gap-1 rounded-[9px] px-0.5 py-1.5 text-[13px] font-medium outline-none",ot="focus-ring-soft inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-[8px] text-current/55 outline-none transition-[background-color,color,opacity] hover:bg-hover-subtle hover:text-current touch-none",lt="focus-ring-soft relative mb-0.5 inline-flex h-9 shrink-0 items-center gap-1 rounded-[10px] px-2.5 text-[13px] font-medium text-fg-secondary outline-none transition-colors hover:bg-hover-subtle/85 hover:text-fg-default",ct=({tab:s,isActive:i,onSelect:n})=>{const{attributes:c,listeners:x,setNodeRef:l,setActivatorNodeRef:m,transform:h,transition:b,isDragging:p}=re({id:s.id});return e.jsxs("div",{ref:l,style:{transform:ne.Transform.toString(h),transition:b,opacity:p?.6:1},className:R(it,i?"z-10 border-border-secondary/75 bg-elevated text-fg-default shadow-[0_10px_18px_-20px_rgba(15,18,24,0.24)]":"border-transparent bg-hover-subtle/45 text-fg-secondary hover:bg-hover-subtle/75 hover:text-fg-default"),children:[e.jsx("button",{type:"button",ref:m,"aria-label":`Reorder view tab ${s.title}`,...c,...x,className:R(ot,p?"cursor-grabbing opacity-100":"cursor-grab opacity-70 group-hover:opacity-100"),children:e.jsx(ie,{className:"size-4"})}),e.jsxs("button",{type:"button",role:"tab","aria-selected":i,className:R(nt,i?"text-fg-default":"text-fg-secondary group-hover:text-fg-default"),onClick:n,children:[e.jsx("span",{className:"min-w-0 flex-1 truncate",children:s.title}),e.jsx("span",{className:"inline-flex min-w-4 shrink-0 items-center justify-center rounded-full bg-hover-subtle/75 px-1 py-0 text-[10px] leading-4 text-current/70",children:s.sections.length})]})]})},dt=({section:s,onEdit:i,onDelete:n})=>{const{attributes:c,listeners:x,setNodeRef:l,setActivatorNodeRef:m,transform:h,transition:b,isDragging:p}=re({id:s.id});return e.jsx("div",{ref:l,style:{transform:ne.Transform.toString(h),transition:b,opacity:p?.6:1},children:e.jsx(et,{section:s,onEdit:i,onDelete:n,dragHandle:e.jsx("button",{type:"button",ref:m,"aria-label":`Reorder section ${s.title}`,...c,...x,className:R(rt,p?"cursor-grabbing":"cursor-grab"),children:e.jsx(ie,{className:"size-4"})})})})};function bt(){const s=je(),i=we(),n=ye(),[c,x]=r.useState(null),[l,m]=r.useState(null),{data:h,isPending:b,isError:p,refetch:k}=O({queryKey:N.views.workspace(),async queryFn(){const t=await Re();if(t.type==="error")throw t;return t.viewWorkspace}}),g=h??He,a=We(g),{data:C,isPending:L}=O({queryKey:N.tags.list({limit:200}),async queryFn(){const t=await Ne({limit:200});if(t.type==="error")throw t;return t.allTags}}),V=Se(K(Ce,{activationConstraint:{distance:8}}),K(Te,{coordinateGetter:ke})),E=C?.tags??[],f=t=>{n.setQueryData(N.views.workspace(),t)},v=async()=>{await n.invalidateQueries({queryKey:N.views.all(),exact:!1})},d=async({active:t,over:o})=>{if(!o||t.id===o.id)return;const T=n.getQueryData(N.views.workspace())??g,j=Oe(T,String(t.id),String(o.id));f(j);const M=await Pe(j.tabs.map(z=>z.id));if(M.type==="error"){f(T),i(M.errors[0].message);return}await v()},y=async({active:t,over:o})=>{if(!a||!o||t.id===o.id)return;const T=n.getQueryData(N.views.workspace())??g,j=_e(T,a.id,String(t.id),String(o.id));f(j);const M=await Ke(a.id,j.tabs.find(z=>z.id===a.id)?.sections.map(z=>z.id)??[]);if(M.type==="error"){f(T),i(M.errors[0].message);return}await v()},W=async t=>{const o=await Qe(t);if(o.type==="error"){i(o.errors[0].message);return}await v(),x(null)},ce=async t=>{if(!a)return;const o=await Ze(a.id,t);if(o.type==="error"){i(o.errors[0].message);return}await v(),x(null)},de=async()=>{if(!a||!await s("Delete this view tab and all of its sections?"))return;const t=await $e(a.id);if(t.type==="error"){i(t.errors[0].message);return}await v()},me=async t=>{if(!a)return;const o=await Ue(a.id,t);if(o.type==="error"){i(o.errors[0].message);return}await v(),m(null)},xe=async t=>{if(!a||!l||l.mode!=="edit")return;const o=await Be(l.section.id,t);if(o.type==="error"){i(o.errors[0].message);return}await v(),m(null)},he=async t=>{if(!a||!await s("Delete this section from the current view tab?"))return;const o=await Ge(t);if(o.type==="error"){i(o.errors[0].message);return}await v()};return e.jsxs(e.Fragment,{children:[e.jsx(Ve,{title:"Views",description:at,children:b&&!h?e.jsx(A,{className:"px-6 py-8 sm:px-8 sm:py-10",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(I,{height:20,width:180,className:"rounded-full"}),e.jsx(I,{height:16,width:260,className:"rounded-full"}),e.jsx(I,{height:44,width:140,className:"rounded-[12px]"})]})}):p?e.jsxs(A,{className:"px-6 py-8 sm:px-8 sm:py-10",children:[e.jsx(u,{as:"p",variant:"body",weight:"semibold",children:"Failed to load saved views"}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:"Retry loading your saved view tabs."}),e.jsx("div",{className:"mt-4",children:e.jsx(w,{type:"button",variant:"ghost",size:"sm",onClick:()=>{k()},children:"Retry"})})]}):g.tabs.length===0?e.jsxs(A,{className:"px-6 py-8 sm:px-8 sm:py-10",children:[e.jsx(Q,{title:"Create your first view tab",description:"Start with a saved view tab, then add tag-based sections inside it."}),e.jsx("div",{className:"mt-6 flex justify-center",children:e.jsxs(w,{type:"button",onClick:()=>x({mode:"create"}),children:[e.jsx(q,{className:"h-4 w-4"}),"Create first tab"]})})]}):e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsx("div",{className:"border-b border-border-secondary/75",children:e.jsx(Z,{sensors:V,collisionDetection:$,modifiers:[Ee],onDragEnd:d,children:e.jsxs("div",{className:"flex items-end gap-1 overflow-x-auto overflow-y-hidden pb-px",children:[e.jsx(U,{items:g.tabs.map(t=>t.id),strategy:De,children:e.jsx("div",{role:"tablist","aria-label":"Views tab list",className:"flex min-w-0 items-end gap-1",children:g.tabs.map(t=>e.jsx(ct,{tab:t,isActive:t.id===a?.id,onSelect:async()=>{const o=n.getQueryData(N.views.workspace())??g,T=Ie(o,t.id);f(T);const j=await qe(t.id);if(j.type==="error"){f(o),i(j.errors[0].message);return}f(j.setActiveViewTab)}},t.id))})}),e.jsxs("button",{type:"button",className:lt,onClick:()=>x({mode:"create"}),children:[e.jsx(q,{className:"size-4"}),"Add tab"]})]})})}),a&&e.jsxs("div",{className:"flex flex-col gap-5",children:[e.jsxs(A,{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[e.jsxs("div",{children:[e.jsx(u,{as:"h2",variant:"heading",weight:"bold",tracking:"tight",children:a.title}),e.jsx(u,{as:"p",variant:"meta",tone:"tertiary",className:"mt-1",children:a.sections.length>0?`${a.sections.length} section${a.sections.length===1?"":"s"} in this view`:"Add sections to build this view"})]}),e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsxs(w,{type:"button",size:"sm",onClick:()=>m({mode:"create"}),children:[e.jsx(q,{className:"h-4 w-4"}),"Add section"]}),e.jsx(te,{button:e.jsx(se,{label:"View tab actions"}),items:[{name:"Rename",onClick:()=>x({mode:"edit",tab:a})},{type:"separator"},{name:"Delete tab",onClick:()=>{de()}}]})]})]}),a.sections.length===0?e.jsx(A,{className:"px-6 py-8 sm:px-8 sm:py-10",children:e.jsx(Q,{title:"Add the first section to this tab",description:"Sections pull notes by tag."})}):e.jsx("div",{className:"flex flex-col",children:e.jsx(Z,{sensors:V,collisionDetection:$,modifiers:[Ae],onDragEnd:y,children:e.jsx(U,{items:a.sections.map(t=>t.id),strategy:Me,children:e.jsx("div",{className:"flex flex-col gap-4",children:a.sections.map(t=>e.jsx(dt,{section:t,onEdit:()=>m({mode:"edit",section:t}),onDelete:()=>{he(t.id)}},t.id))})})})})]})]})}),e.jsx(st,{open:c!==null,mode:c?.mode??"create",initialTitle:c?.mode==="edit"?c.tab.title:"",onClose:()=>x(null),onSubmit:t=>{if(c?.mode==="edit"){ce(t);return}W(t)}}),e.jsx(tt,{open:l!==null,mode:l?.mode??"create",initialSection:l?.mode==="edit"?l.section:null,availableTags:E,isTagsLoading:L,onClose:()=>m(null),onSubmit:t=>{if(l?.mode==="edit"){xe(t);return}me(t)}})]})}export{bt as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as t,
|
|
1
|
+
import{h as t,az as n}from"./index-Bsx4P7EA.js";function o({limit:a=50,offset:e=0}={}){return t(`query FetchImages($pagination: PaginationInput) {
|
|
2
2
|
allImages(pagination: $pagination) {
|
|
3
3
|
totalCount
|
|
4
4
|
images {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./note-vendor-5N5mRkIT.js";import{p as h,a3 as p,P as M,T as t,L as i,av as f,g as o,aq as u,aw as v,ax as j,ay as E}from"./index-Bsx4P7EA.js";import{a}from"./graph-vendor-CUxe67Lr.js";import{c as N,n as w}from"./Trash.es-BfCEiL3-.js";import{I as y}from"./Image.es-Fbe7aDDo.js";import"./note-core-GgFcksAF.js";const H=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M236.37,139.4a12,12,0,0,0-12-3A84.07,84.07,0,0,1,119.6,31.59a12,12,0,0,0-15-15A108.86,108.86,0,0,0,49.69,55.07,108,108,0,0,0,136,228a107.09,107.09,0,0,0,64.93-21.69,108.86,108.86,0,0,0,38.44-54.94A12,12,0,0,0,236.37,139.4Zm-49.88,47.74A84,84,0,0,1,68.86,69.51,84.93,84.93,0,0,1,92.27,48.29Q92,52.13,92,56A108.12,108.12,0,0,0,200,164q3.87,0,7.71-.27A84.79,84.79,0,0,1,186.49,187.14Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M227.89,147.89A96,96,0,1,1,108.11,28.11,96.09,96.09,0,0,0,227.89,147.89Z",opacity:"0.2"}),a.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M235.54,150.21a104.84,104.84,0,0,1-37,52.91A104,104,0,0,1,32,120,103.09,103.09,0,0,1,52.88,57.48a104.84,104.84,0,0,1,52.91-37,8,8,0,0,1,10,10,88.08,88.08,0,0,0,109.8,109.8,8,8,0,0,1,10,10Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M232.13,143.64a6,6,0,0,0-6-1.49A90.07,90.07,0,0,1,113.86,29.85a6,6,0,0,0-7.49-7.48A102.88,102.88,0,0,0,54.48,58.68,102,102,0,0,0,197.32,201.52a102.88,102.88,0,0,0,36.31-51.89A6,6,0,0,0,232.13,143.64Zm-42,48.29a90,90,0,0,1-126-126A90.9,90.9,0,0,1,99.65,37.66,102.06,102.06,0,0,0,218.34,156.35,90.9,90.9,0,0,1,190.1,191.93Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M233.54,142.23a8,8,0,0,0-8-2,88.08,88.08,0,0,1-109.8-109.8,8,8,0,0,0-10-10,104.84,104.84,0,0,0-52.91,37A104,104,0,0,0,136,224a103.09,103.09,0,0,0,62.52-20.88,104.84,104.84,0,0,0,37-52.91A8,8,0,0,0,233.54,142.23ZM188.9,190.34A88,88,0,0,1,65.66,67.11a89,89,0,0,1,31.4-26A106,106,0,0,0,96,56,104.11,104.11,0,0,0,200,160a106,106,0,0,0,14.92-1.06A89,89,0,0,1,188.9,190.34Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M230.72,145.06a4,4,0,0,0-4-1A92.08,92.08,0,0,1,111.94,29.27a4,4,0,0,0-5-5A100.78,100.78,0,0,0,56.08,59.88a100,100,0,0,0,140,140,100.78,100.78,0,0,0,35.59-50.87A4,4,0,0,0,230.72,145.06ZM191.3,193.53A92,92,0,0,1,62.47,64.7a93,93,0,0,1,39.88-30.35,100.09,100.09,0,0,0,119.3,119.3A93,93,0,0,1,191.3,193.53Z"}))]]),b=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M203.57,51A107.9,107.9,0,0,0,20,128c0,44.72,27.6,82.25,72,97.94A36,36,0,0,0,140,192a12,12,0,0,1,12-12h46.21a35.79,35.79,0,0,0,35.1-28A108.6,108.6,0,0,0,236,127.09,107.23,107.23,0,0,0,203.57,51Zm6.34,95.67a11.91,11.91,0,0,1-11.7,9.3H152a36,36,0,0,0-36,36,12,12,0,0,1-16,11.3c-16.65-5.88-30.65-15.76-40.48-28.56A76,76,0,0,1,44,128a84,84,0,0,1,83.13-84H128a84.35,84.35,0,0,1,84,83.29A84.72,84.72,0,0,1,209.91,146.71ZM144,76a16,16,0,1,1-16-16A16,16,0,0,1,144,76Zm-44,24A16,16,0,1,1,84,84,16,16,0,0,1,100,100Zm0,56a16,16,0,1,1-16-16A16,16,0,0,1,100,156Zm88-56a16,16,0,1,1-16-16A16,16,0,0,1,188,100Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M224,127.17a96.48,96.48,0,0,1-2.39,22.18A24,24,0,0,1,198.21,168H152a24,24,0,0,0-24,24,24,24,0,0,1-32,22.61C58.73,201.44,32,169.81,32,128a96,96,0,0,1,95-96C179.84,31.47,223.55,74.35,224,127.17Z",opacity:"0.2"}),a.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89ZM84,168a12,12,0,1,1,12-12A12,12,0,0,1,84,168Zm0-56a12,12,0,1,1,12-12A12,12,0,0,1,84,112Zm44-24a12,12,0,1,1,12-12A12,12,0,0,1,128,88Zm44,24a12,12,0,1,1,12-12A12,12,0,0,1,172,112Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M199.37,55.31A101.32,101.32,0,0,0,128,26h-1A102,102,0,0,0,26,128c0,42.09,26.07,77.44,68,92.26A30.21,30.21,0,0,0,104.11,222,30.06,30.06,0,0,0,134,192a18,18,0,0,1,18-18h46.21a29.82,29.82,0,0,0,29.25-23.31A102.71,102.71,0,0,0,230,127.11,101.25,101.25,0,0,0,199.37,55.31ZM215.76,148a17.89,17.89,0,0,1-17.55,14H152a30,30,0,0,0-30,30,18,18,0,0,1-24,17C61,195.86,38,164.85,38,128a90,90,0,0,1,89.07-90H128a90.34,90.34,0,0,1,90,89.22A90.46,90.46,0,0,1,215.76,148ZM138,76a10,10,0,1,1-10-10A10,10,0,0,1,138,76ZM94,100A10,10,0,1,1,84,90,10,10,0,0,1,94,100Zm0,56a10,10,0,1,1-10-10A10,10,0,0,1,94,156Zm88-56a10,10,0,1,1-10-10A10,10,0,0,1,182,100Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M200.77,53.89A103.27,103.27,0,0,0,128,24h-1.07A104,104,0,0,0,24,128c0,43,26.58,79.06,69.36,94.17A32,32,0,0,0,136,192a16,16,0,0,1,16-16h46.21a31.81,31.81,0,0,0,31.2-24.88,104.43,104.43,0,0,0,2.59-24A103.28,103.28,0,0,0,200.77,53.89Zm13,93.71A15.89,15.89,0,0,1,198.21,160H152a32,32,0,0,0-32,32,16,16,0,0,1-21.31,15.07C62.49,194.3,40,164,40,128a88,88,0,0,1,87.09-88h.9a88.35,88.35,0,0,1,88,87.25A88.86,88.86,0,0,1,213.81,147.6ZM140,76a12,12,0,1,1-12-12A12,12,0,0,1,140,76ZM96,100A12,12,0,1,1,84,88,12,12,0,0,1,96,100Zm0,56a12,12,0,1,1-12-12A12,12,0,0,1,96,156Zm88-56a12,12,0,1,1-12-12A12,12,0,0,1,184,100Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M198,56.74A99.31,99.31,0,0,0,128,28h-1A100,100,0,0,0,28,128c0,41.22,25.55,75.85,66.69,90.38a28.34,28.34,0,0,0,9.42,1.63A28,28,0,0,0,132,192a20,20,0,0,1,20-20h46.21a27.84,27.84,0,0,0,27.3-21.76,100.37,100.37,0,0,0,2.49-23.1A99.26,99.26,0,0,0,198,56.74Zm19.74,91.72A19.89,19.89,0,0,1,198.21,164H152a28,28,0,0,0-28,28,20,20,0,0,1-26.64,18.83C59.51,197.46,36,165.72,36,128a92,92,0,0,1,91.05-92H128a92,92,0,0,1,89.72,112.46ZM136,76a8,8,0,1,1-8-8A8,8,0,0,1,136,76ZM92,100a8,8,0,1,1-8-8A8,8,0,0,1,92,100Zm0,56a8,8,0,1,1-8-8A8,8,0,0,1,92,156Zm88-56a8,8,0,1,1-8-8A8,8,0,0,1,180,100Z"}))]]),T=new Map([["bold",a.createElement(a.Fragment,null,a.createElement("path",{d:"M116,36V20a12,12,0,0,1,24,0V36a12,12,0,0,1-24,0Zm80,92a68,68,0,1,1-68-68A68.07,68.07,0,0,1,196,128Zm-24,0a44,44,0,1,0-44,44A44.05,44.05,0,0,0,172,128ZM51.51,68.49a12,12,0,1,0,17-17l-12-12a12,12,0,0,0-17,17Zm0,119-12,12a12,12,0,0,0,17,17l12-12a12,12,0,1,0-17-17ZM196,72a12,12,0,0,0,8.49-3.51l12-12a12,12,0,0,0-17-17l-12,12A12,12,0,0,0,196,72Zm8.49,115.51a12,12,0,0,0-17,17l12,12a12,12,0,0,0,17-17ZM48,128a12,12,0,0,0-12-12H20a12,12,0,0,0,0,24H36A12,12,0,0,0,48,128Zm80,80a12,12,0,0,0-12,12v16a12,12,0,0,0,24,0V220A12,12,0,0,0,128,208Zm108-92H220a12,12,0,0,0,0,24h16a12,12,0,0,0,0-24Z"}))],["duotone",a.createElement(a.Fragment,null,a.createElement("path",{d:"M184,128a56,56,0,1,1-56-56A56,56,0,0,1,184,128Z",opacity:"0.2"}),a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["fill",a.createElement(a.Fragment,null,a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm8,24a64,64,0,1,0,64,64A64.07,64.07,0,0,0,128,64ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["light",a.createElement(a.Fragment,null,a.createElement("path",{d:"M122,40V16a6,6,0,0,1,12,0V40a6,6,0,0,1-12,0Zm68,88a62,62,0,1,1-62-62A62.07,62.07,0,0,1,190,128Zm-12,0a50,50,0,1,0-50,50A50.06,50.06,0,0,0,178,128ZM59.76,68.24a6,6,0,1,0,8.48-8.48l-16-16a6,6,0,0,0-8.48,8.48Zm0,119.52-16,16a6,6,0,1,0,8.48,8.48l16-16a6,6,0,1,0-8.48-8.48ZM192,70a6,6,0,0,0,4.24-1.76l16-16a6,6,0,0,0-8.48-8.48l-16,16A6,6,0,0,0,192,70Zm4.24,117.76a6,6,0,0,0-8.48,8.48l16,16a6,6,0,0,0,8.48-8.48ZM46,128a6,6,0,0,0-6-6H16a6,6,0,0,0,0,12H40A6,6,0,0,0,46,128Zm82,82a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V216A6,6,0,0,0,128,210Zm112-88H216a6,6,0,0,0,0,12h24a6,6,0,0,0,0-12Z"}))],["regular",a.createElement(a.Fragment,null,a.createElement("path",{d:"M120,40V16a8,8,0,0,1,16,0V40a8,8,0,0,1-16,0Zm72,88a64,64,0,1,1-64-64A64.07,64.07,0,0,1,192,128Zm-16,0a48,48,0,1,0-48,48A48.05,48.05,0,0,0,176,128ZM58.34,69.66A8,8,0,0,0,69.66,58.34l-16-16A8,8,0,0,0,42.34,53.66Zm0,116.68-16,16a8,8,0,0,0,11.32,11.32l16-16a8,8,0,0,0-11.32-11.32ZM192,72a8,8,0,0,0,5.66-2.34l16-16a8,8,0,0,0-11.32-11.32l-16,16A8,8,0,0,0,192,72Zm5.66,114.34a8,8,0,0,0-11.32,11.32l16,16a8,8,0,0,0,11.32-11.32ZM48,128a8,8,0,0,0-8-8H16a8,8,0,0,0,0,16H40A8,8,0,0,0,48,128Zm80,80a8,8,0,0,0-8,8v24a8,8,0,0,0,16,0V216A8,8,0,0,0,128,208Zm112-88H216a8,8,0,0,0,0,16h24a8,8,0,0,0,0-16Z"}))],["thin",a.createElement(a.Fragment,null,a.createElement("path",{d:"M124,40V16a4,4,0,0,1,8,0V40a4,4,0,0,1-8,0Zm64,88a60,60,0,1,1-60-60A60.07,60.07,0,0,1,188,128Zm-8,0a52,52,0,1,0-52,52A52.06,52.06,0,0,0,180,128ZM61.17,66.83a4,4,0,0,0,5.66-5.66l-16-16a4,4,0,0,0-5.66,5.66Zm0,122.34-16,16a4,4,0,0,0,5.66,5.66l16-16a4,4,0,0,0-5.66-5.66ZM192,68a4,4,0,0,0,2.83-1.17l16-16a4,4,0,1,0-5.66-5.66l-16,16A4,4,0,0,0,192,68Zm2.83,121.17a4,4,0,0,0-5.66,5.66l16,16a4,4,0,0,0,5.66-5.66ZM40,124H16a4,4,0,0,0,0,8H40a4,4,0,0,0,0-8Zm88,88a4,4,0,0,0-4,4v24a4,4,0,0,0,8,0V216A4,4,0,0,0,128,212Zm112-88H216a4,4,0,0,0,0,8h24a4,4,0,0,0,0-8Z"}))]]),A=a.forwardRef((s,l)=>a.createElement(h,{ref:l,...s,weights:H}));A.displayName="MoonIcon";const F=A,Z=a.forwardRef((s,l)=>a.createElement(h,{ref:l,...s,weights:b}));Z.displayName="PaletteIcon";const V=Z,g=a.forwardRef((s,l)=>a.createElement(h,{ref:l,...s,weights:T}));g.displayName="SunIcon";const C=g,P=()=>{const{theme:s,toggleTheme:l}=p(x=>x),n="focus-ring-soft surface-base group flex items-start justify-between gap-3.5 px-4 py-3.5 text-left text-fg-default outline-none transition-colors hover:bg-hover-subtle",r="inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-[15px] border border-border-subtle bg-muted text-fg-secondary transition-colors group-hover:border-border-secondary/70 group-hover:text-fg-default",m="h-6 w-6",d="text-fg-tertiary",c="min-w-0 flex flex-col gap-0.5 pt-0.5";return e.jsx(M,{title:"Settings",description:"Manage appearance, integrations, and workspace tools",children:e.jsxs("div",{className:"flex flex-col gap-6",children:[e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx(t,{as:"p",variant:"label",weight:"medium",className:d,children:"Appearance"}),e.jsxs("button",{type:"button",className:n,onClick:l,children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:r,children:e.jsx(V,{className:m})}),e.jsxs("div",{className:c,children:[e.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Theme"}),e.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Switch between light and dark mode."})]})]}),e.jsxs("div",{className:"mt-0.5 flex shrink-0 items-center gap-2 text-fg-tertiary",children:[e.jsx(t,{as:"span",variant:"meta",weight:"medium",tone:"secondary",children:s==="dark"?"Dark":"Light"}),s==="dark"?e.jsx(F,{className:"h-4 w-4",weight:"fill"}):e.jsx(C,{className:"h-4 w-4",weight:"fill"})]})]})]}),e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx(t,{as:"p",variant:"label",weight:"medium",className:d,children:"Integrations"}),e.jsxs(i,{to:f,className:n,children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:r,children:e.jsx(N,{className:m})}),e.jsxs("div",{className:c,children:[e.jsx(t,{as:"div",variant:"body",weight:"medium",children:"MCP"}),e.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Manage AI integration access."})]})]}),e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]})]}),e.jsxs("section",{className:"flex flex-col gap-3",children:[e.jsx(t,{as:"p",variant:"label",weight:"medium",className:d,children:"Workspace"}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[e.jsxs(i,{to:u,search:{page:1},className:n,children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:r,children:e.jsx(w,{className:m})}),e.jsxs("div",{className:c,children:[e.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Trash"}),e.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Restore deleted notes."})]})]}),e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),e.jsxs(i,{to:v,search:{page:1},className:n,children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:r,children:e.jsx(y,{className:m})}),e.jsxs("div",{className:c,children:[e.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Images"}),e.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Upload and organize images."})]})]}),e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]}),e.jsxs(i,{to:j,search:{page:1},className:n,children:[e.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[e.jsx("span",{className:r,children:e.jsx(E,{className:m})}),e.jsxs("div",{className:c,children:[e.jsx(t,{as:"div",variant:"body",weight:"medium",children:"Placeholders"}),e.jsx(t,{as:"div",variant:"meta",tone:"secondary",children:"Manage template variables."})]})]}),e.jsx(o,{className:"mt-0.5 h-4 w-4 shrink-0 text-fg-tertiary transition-transform group-hover:translate-x-0.5 group-hover:text-fg-secondary"})]})]})]})]})})};export{P as default};
|