kennel 0.2.1 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -5
- package/dist/cli/dispatch.js +9 -0
- package/dist/cli/src/automations/notifications.d.ts +40 -0
- package/dist/cli/src/automations/notifications.js +220 -0
- package/dist/cli/src/cli/dispatch.d.ts +1 -0
- package/dist/cli/src/cli/dispatch.js +125 -0
- package/dist/cli/src/cli/usage.d.ts +1 -0
- package/dist/cli/src/cli/usage.js +25 -0
- package/dist/cli/src/core/api-client.d.ts +13 -0
- package/dist/cli/src/core/api-client.js +1 -0
- package/dist/cli/src/core/command.d.ts +1 -0
- package/dist/cli/src/core/command.js +69 -0
- package/dist/cli/src/core/core-folders.d.ts +1 -0
- package/dist/cli/src/core/core-folders.js +42 -0
- package/dist/cli/src/core/init.d.ts +1 -0
- package/dist/cli/src/core/init.js +141 -0
- package/dist/cli/src/core/runtime.d.ts +14 -0
- package/dist/cli/src/core/runtime.js +1 -0
- package/dist/cli/src/deploy/cloudflare.d.ts +6 -0
- package/dist/cli/src/deploy/cloudflare.js +100 -0
- package/dist/cli/src/deploy/environment.d.ts +2 -0
- package/dist/cli/src/deploy/environment.js +47 -0
- package/dist/cli/src/deploy/smoke-tests.d.ts +4 -0
- package/dist/cli/src/deploy/smoke-tests.js +92 -0
- package/dist/cli/src/deploy/trigger-dev.d.ts +2 -0
- package/dist/cli/src/deploy/trigger-dev.js +255 -0
- package/dist/cli/src/deploy/vercel.d.ts +3 -0
- package/dist/cli/src/deploy/vercel.js +67 -0
- package/dist/cli/src/main.d.ts +1 -0
- package/dist/cli/src/main.js +9 -0
- package/dist/cli/src/mcp/agent-tools.d.ts +8 -0
- package/dist/cli/src/mcp/agent-tools.js +247 -0
- package/dist/cli/src/mcp/config.d.ts +25 -0
- package/dist/cli/src/mcp/config.js +185 -0
- package/dist/cli/src/mcp/function-source.d.ts +7 -0
- package/dist/cli/src/mcp/function-source.js +42 -0
- package/dist/cli/src/mcp/generate.d.ts +1 -0
- package/dist/cli/src/mcp/generate.js +47 -0
- package/dist/cli/src/mcp/install-page.d.ts +12 -0
- package/dist/cli/src/mcp/install-page.js +5 -0
- package/dist/cli/src/notifications/email-worker.d.ts +8 -0
- package/dist/cli/src/notifications/email-worker.js +137 -0
- package/dist/cli/src/package/mcp-data.d.ts +1 -0
- package/dist/cli/src/package/mcp-data.js +1 -0
- package/dist/cli/src/package/mcp-email-worker.d.ts +1 -0
- package/dist/cli/src/package/mcp-email-worker.js +1 -0
- package/dist/cli/src/package/mcp-http.d.ts +1 -0
- package/dist/cli/src/package/mcp-http.js +1 -0
- package/dist/cli/src/package/mcp-stdio.d.ts +1 -0
- package/dist/cli/src/package/mcp-stdio.js +1 -0
- package/dist/cli/src/package/mcp.d.ts +1 -0
- package/dist/cli/src/package/mcp.js +1 -0
- package/dist/cli/src/package/preview.d.ts +9 -0
- package/dist/cli/src/package/preview.js +1 -0
- package/dist/cli/src/plugins/external.d.ts +36 -0
- package/dist/cli/src/plugins/external.js +503 -0
- package/dist/cli/src/publish/cloudflare-init.d.ts +12 -0
- package/dist/cli/src/publish/cloudflare-init.js +101 -0
- package/dist/cli/src/publish/config.d.ts +28 -0
- package/dist/cli/src/publish/config.js +178 -0
- package/dist/cli/src/publish/options.d.ts +13 -0
- package/dist/cli/src/publish/options.js +78 -0
- package/dist/cli/src/publish/vercel-init.d.ts +9 -0
- package/dist/cli/src/publish/vercel-init.js +52 -0
- package/dist/cli/src/shared/json.d.ts +4 -0
- package/dist/cli/src/shared/json.js +56 -0
- package/dist/cli/src/shared/object.d.ts +2 -0
- package/dist/cli/src/shared/object.js +3 -0
- package/dist/cli/src/shared/package-manager.d.ts +11 -0
- package/dist/cli/src/shared/package-manager.js +39 -0
- package/dist/cli/src/shared/path.d.ts +4 -0
- package/dist/cli/src/shared/path.js +40 -0
- package/dist/cli/src/shared/process.d.ts +7 -0
- package/dist/cli/src/shared/process.js +12 -0
- package/dist/cli/src/shared/project-config.d.ts +2 -0
- package/dist/cli/src/shared/project-config.js +26 -0
- package/dist/cli/src/site/dev.d.ts +10 -0
- package/dist/cli/src/site/dev.js +126 -0
- package/dist/cli/src/site/extension.d.ts +8 -0
- package/dist/cli/src/site/extension.js +113 -0
- package/dist/cli/src/site/folder-icons.d.ts +46 -0
- package/dist/cli/src/site/folder-icons.js +86 -0
- package/dist/cli/src/site/hot-viewer.d.ts +2 -0
- package/dist/cli/src/site/hot-viewer.js +231 -0
- package/dist/cli/src/site/kinds.d.ts +1 -0
- package/dist/cli/src/site/kinds.js +1 -0
- package/dist/cli/src/site/mail.d.ts +1 -0
- package/dist/cli/src/site/mail.js +10 -0
- package/dist/cli/src/site/renderers.d.ts +61 -0
- package/dist/cli/src/site/renderers.js +219 -0
- package/dist/cli/src/site/server-plugins.d.ts +54 -0
- package/dist/cli/src/site/server-plugins.js +1 -0
- package/dist/cli/src/site/viewer.d.ts +36 -0
- package/dist/cli/src/site/viewer.js +352 -0
- package/dist/cli/src/site/vitepress.d.ts +1 -0
- package/dist/cli/src/site/vitepress.js +1 -0
- package/dist/cli/usage.js +1 -0
- package/dist/core/api-client.js +75 -44
- package/dist/core/command.js +6 -3
- package/dist/core/core-folders.js +38280 -33
- package/dist/core/init.js +59 -4
- package/dist/core/runtime.js +57163 -41853
- package/dist/package/preview.js +40589 -17894
- package/dist/plugins/external.d.ts +36 -0
- package/dist/plugins/external.js +503 -0
- package/dist/site/server-plugins.js +394 -59
- package/dist/site/viewer.js +18 -5
- package/kernel/apps/web/.env.example +11 -0
- package/kernel/apps/web/components.json +20 -0
- package/kernel/apps/web/eslint.config.mjs +60 -0
- package/kernel/apps/web/index.html +17 -0
- package/kernel/apps/web/package.json +79 -0
- package/kernel/apps/web/public/favicon.svg +6 -0
- package/kernel/apps/web/public/providers/claude.svg +1 -0
- package/kernel/apps/web/public/providers/codex.svg +1 -0
- package/kernel/apps/web/public/providers/cursor.svg +1 -0
- package/kernel/apps/web/public/providers/opencode.svg +1 -0
- package/kernel/apps/web/public/providers/pi.svg +1 -0
- package/kernel/apps/web/server/acp/index.ts +1 -0
- package/kernel/apps/web/server/acp/live-agent-connection.ts +1 -0
- package/kernel/apps/web/server/acp/process-manager.ts +1 -0
- package/kernel/apps/web/server/acp/registry.ts +1 -0
- package/kernel/apps/web/server/acp/sdk.ts +1 -0
- package/kernel/apps/web/server/acp/transport.ts +1 -0
- package/kernel/apps/web/server/acp/types.ts +1 -0
- package/kernel/apps/web/server/acp-live-plugin.ts +30 -0
- package/kernel/apps/web/server/api/document-edit.ts +1 -0
- package/kernel/apps/web/server/api/open-path.ts +1 -0
- package/kernel/apps/web/server/core-plugin.ts +49 -0
- package/kernel/apps/web/server/folder-favicon.ts +1 -0
- package/kernel/apps/web/server/folder-icons.ts +1 -0
- package/kernel/apps/web/server/folder-metadata-plugin.ts +31 -0
- package/kernel/apps/web/server/plugins.ts +1 -0
- package/kernel/apps/web/server/preview-kinds.ts +1 -0
- package/kernel/apps/web/src/ai-input.tsx +62 -0
- package/kernel/apps/web/src/annotations.tsx +430 -0
- package/kernel/apps/web/src/api/client.ts +3 -0
- package/kernel/apps/web/src/api/errors.ts +1 -0
- package/kernel/apps/web/src/api/events.ts +42 -0
- package/kernel/apps/web/src/app.css +332 -0
- package/kernel/apps/web/src/app.tsx +667 -0
- package/kernel/apps/web/src/ask-draft.ts +164 -0
- package/kernel/apps/web/src/ask-tray.tsx +256 -0
- package/kernel/apps/web/src/comment-editor.tsx +93 -0
- package/kernel/apps/web/src/comment-form.tsx +162 -0
- package/kernel/apps/web/src/copy-path.ts +18 -0
- package/kernel/apps/web/src/deferred-ask-tray.tsx +20 -0
- package/kernel/apps/web/src/document-url.ts +46 -0
- package/kernel/apps/web/src/documents-url.ts +23 -0
- package/kernel/apps/web/src/dropped-folder.ts +64 -0
- package/kernel/apps/web/src/external-plugins.ts +3 -0
- package/kernel/apps/web/src/file-viewer.tsx +171 -0
- package/kernel/apps/web/src/folder-filter-icons.tsx +39 -0
- package/kernel/apps/web/src/folder-metadata.ts +76 -0
- package/kernel/apps/web/src/folder-plugin-view.tsx +87 -0
- package/kernel/apps/web/src/folder-query-cache.ts +66 -0
- package/kernel/apps/web/src/host-adapters.ts +209 -0
- package/kernel/apps/web/src/host-bridge.ts +214 -0
- package/kernel/apps/web/src/lib/entity-folder.ts +2 -0
- package/kernel/apps/web/src/linked-session-header.tsx +43 -0
- package/kernel/apps/web/src/live-session-controls.tsx +326 -0
- package/kernel/apps/web/src/local-source.ts +32 -0
- package/kernel/apps/web/src/main.tsx +24 -0
- package/kernel/apps/web/src/markdown-page.tsx +444 -0
- package/kernel/apps/web/src/notes-page.tsx +103 -0
- package/kernel/apps/web/src/plugins.ts +53 -0
- package/kernel/apps/web/src/project-search-dialog.tsx +257 -0
- package/kernel/apps/web/src/project-search.ts +18 -0
- package/kernel/apps/web/src/query-client.ts +4 -0
- package/kernel/apps/web/src/rehype-source-lines.ts +22 -0
- package/kernel/apps/web/src/routes/document.tsx +1 -0
- package/kernel/apps/web/src/routes/entities.tsx +277 -0
- package/kernel/apps/web/src/routes/search.tsx +60 -0
- package/kernel/apps/web/src/selection-context.ts +68 -0
- package/kernel/apps/web/src/selection-input.tsx +58 -0
- package/kernel/apps/web/src/selection-popup.tsx +155 -0
- package/kernel/apps/web/src/session-transcript-page.tsx +152 -0
- package/kernel/apps/web/src/use-annotations.ts +162 -0
- package/kernel/apps/web/src/use-ask-ai.ts +26 -0
- package/kernel/apps/web/src/use-ask-draft.ts +27 -0
- package/kernel/apps/web/src/use-document.ts +37 -0
- package/kernel/apps/web/src/use-folder-notes.ts +49 -0
- package/kernel/apps/web/src/use-linked-session.ts +33 -0
- package/kernel/apps/web/src/view-context.tsx +69 -0
- package/kernel/apps/web/src/view-header.tsx +66 -0
- package/kernel/apps/web/src/viewer-capabilities.ts +33 -0
- package/kernel/apps/web/src/viewer-route.ts +1 -0
- package/kernel/apps/web/src/viewport-height.ts +33 -0
- package/kernel/apps/web/tsconfig.json +24 -0
- package/kernel/apps/web/vite.config.ts +252 -0
- package/kernel/packages/agents/eslint.config.js +10 -0
- package/kernel/packages/agents/package.json +75 -0
- package/kernel/packages/agents/src/agent-card.tsx +334 -0
- package/kernel/packages/agents/src/client.tsx +13 -0
- package/kernel/packages/agents/src/index.ts +18 -0
- package/kernel/packages/agents/src/manifest.ts +7 -0
- package/kernel/packages/agents/src/node.ts +447 -0
- package/kernel/packages/agents/src/profiles.ts +137 -0
- package/kernel/packages/agents/src/resolve.ts +69 -0
- package/kernel/packages/agents/src/server.ts +60 -0
- package/kernel/packages/agents/src/types.ts +82 -0
- package/kernel/packages/agents/src/viewer.tsx +370 -0
- package/kernel/packages/agents/test/profiles.test.mjs +88 -0
- package/kernel/packages/agents/test/resolve.test.mjs +729 -0
- package/kernel/packages/agents/tsconfig.json +17 -0
- package/kernel/packages/api/README.md +73 -0
- package/kernel/packages/api/openapi.json +3368 -0
- package/kernel/packages/api/package.json +41 -0
- package/kernel/packages/api/src/client/errors.ts +1 -0
- package/kernel/packages/api/src/client/index.ts +2 -0
- package/kernel/packages/api/src/contracts/schemas.ts +277 -0
- package/kernel/packages/api/src/contracts.ts +20 -0
- package/kernel/packages/api/src/index.ts +34 -0
- package/kernel/packages/api/src/server/acp/index.ts +35 -0
- package/kernel/packages/api/src/server/acp/live-agent-connection.ts +44 -0
- package/kernel/packages/api/src/server/acp/process-manager.ts +291 -0
- package/kernel/packages/api/src/server/acp/registry.ts +140 -0
- package/kernel/packages/api/src/server/acp/sdk.ts +15 -0
- package/kernel/packages/api/src/server/acp/transport.ts +115 -0
- package/kernel/packages/api/src/server/acp/types.ts +89 -0
- package/kernel/packages/api/src/server/acp-live-plugin.ts +423 -0
- package/kernel/packages/api/src/server/api/create-agent-file.ts +46 -0
- package/kernel/packages/api/src/server/api/document-edit.ts +125 -0
- package/kernel/packages/api/src/server/api/open-path.ts +40 -0
- package/kernel/packages/api/src/server/contracts.ts +85 -0
- package/kernel/packages/api/src/server/entity-folder.ts +353 -0
- package/kernel/packages/api/src/server/folder-favicon.ts +17 -0
- package/kernel/packages/api/src/server/folder-icons.ts +113 -0
- package/kernel/packages/api/src/server/folder-metadata-plugin.ts +1758 -0
- package/kernel/packages/api/src/server/host.ts +21 -0
- package/kernel/packages/api/src/server/index.ts +197 -0
- package/kernel/packages/api/src/server/linked-folder-discovery.ts +158 -0
- package/kernel/packages/api/src/server/plugins.ts +205 -0
- package/kernel/packages/api/src/server/project-discovery.ts +69 -0
- package/kernel/packages/api/src/server/watcher.ts +46 -0
- package/kernel/packages/api/src/shared/selection.ts +16 -0
- package/kernel/packages/api/src/shared/viewer-route.ts +200 -0
- package/kernel/packages/api/test/agents-loading.test.ts +94 -0
- package/kernel/packages/api/test/core.test.ts +364 -0
- package/kernel/packages/api/test/entity-folder.test.ts +131 -0
- package/kernel/packages/api/test/linked-folder-discovery.test.ts +78 -0
- package/kernel/packages/api/test/media-endpoint.test.ts +83 -0
- package/kernel/packages/api/test/partial-loading.test.ts +43 -0
- package/kernel/packages/api/test/project-discovery.test.ts +44 -0
- package/kernel/packages/api/tsconfig.json +11 -0
- package/kernel/packages/api-client/README.md +72 -0
- package/kernel/packages/api-client/package.json +26 -0
- package/kernel/packages/api-client/scripts/generate.ts +68 -0
- package/kernel/packages/api-client/src/errors.ts +59 -0
- package/kernel/packages/api-client/src/generated.d.ts +1248 -0
- package/kernel/packages/api-client/src/index.ts +206 -0
- package/kernel/packages/api-client/src/responses.ts +19 -0
- package/kernel/packages/api-client/test/client.test.ts +143 -0
- package/kernel/packages/api-client/tsconfig.json +12 -0
- package/kernel/packages/folder-plugin/eslint.config.js +10 -0
- package/kernel/packages/folder-plugin/package.json +50 -0
- package/kernel/packages/folder-plugin/src/client.ts +73 -0
- package/kernel/packages/folder-plugin/src/endpoint.ts +273 -0
- package/kernel/packages/folder-plugin/src/index.ts +15 -0
- package/kernel/packages/folder-plugin/src/server.ts +78 -0
- package/kernel/packages/folder-plugin/src/subpath.ts +34 -0
- package/kernel/packages/folder-plugin/src/types.ts +86 -0
- package/kernel/packages/folder-plugin/src/validation.ts +56 -0
- package/kernel/packages/folder-plugin/test/contract.test.mjs +133 -0
- package/kernel/packages/folder-plugin/tsconfig.json +17 -0
- package/kernel/packages/kinds/package.json +24 -0
- package/kernel/packages/kinds/src/kinds.ts +172 -0
- package/kernel/packages/markdown/README.md +40 -0
- package/kernel/packages/markdown/explorer.css +1 -0
- package/kernel/packages/markdown/package.json +30 -0
- package/kernel/packages/markdown/src/documents.ts +1 -0
- package/kernel/packages/markdown/src/explorer.ts +1 -0
- package/kernel/packages/markdown/src/index.ts +2 -0
- package/kernel/packages/markdown/src/metadata.ts +63 -0
- package/kernel/packages/markdown/src/node.ts +1 -0
- package/kernel/packages/markdown/styles.css +1 -0
- package/kernel/packages/notes/SKILL.md +19 -0
- package/kernel/packages/notes/eslint.config.js +10 -0
- package/kernel/packages/notes/package.json +72 -0
- package/kernel/packages/notes/src/client.tsx +12 -0
- package/kernel/packages/notes/src/data/ai-input.ts +58 -0
- package/kernel/packages/notes/src/data/api.ts +40 -0
- package/kernel/packages/notes/src/data/parse.ts +15 -0
- package/kernel/packages/notes/src/data/routing.ts +33 -0
- package/kernel/packages/notes/src/data/use-folder-notes.ts +49 -0
- package/kernel/packages/notes/src/index.ts +2 -0
- package/kernel/packages/notes/src/manifest.ts +6 -0
- package/kernel/packages/notes/src/pages/notes-page.tsx +79 -0
- package/kernel/packages/notes/src/pages/single-note-page.tsx +57 -0
- package/kernel/packages/notes/src/server.ts +88 -0
- package/kernel/packages/notes/src/ui/ai-composer-controls.tsx +70 -0
- package/kernel/packages/notes/src/ui/folder-notes-list.tsx +140 -0
- package/kernel/packages/notes/tsconfig.json +16 -0
- package/kernel/packages/schemas/ICON-POLICY.md +43 -0
- package/kernel/packages/schemas/SKILL.md +185 -0
- package/kernel/packages/schemas/eslint.config.js +10 -0
- package/kernel/packages/schemas/package.json +81 -0
- package/kernel/packages/schemas/src/client.tsx +137 -0
- package/kernel/packages/schemas/src/data/config-file.ts +37 -0
- package/kernel/packages/schemas/src/data/contract.ts +174 -0
- package/kernel/packages/schemas/src/data/favicon.ts +218 -0
- package/kernel/packages/schemas/src/data/fields.ts +96 -0
- package/kernel/packages/schemas/src/data/icon-image.ts +53 -0
- package/kernel/packages/schemas/src/data/icon.ts +97 -0
- package/kernel/packages/schemas/src/data/load.ts +161 -0
- package/kernel/packages/schemas/src/data/params.ts +103 -0
- package/kernel/packages/schemas/src/data/query.ts +33 -0
- package/kernel/packages/schemas/src/data/sort.ts +50 -0
- package/kernel/packages/schemas/src/data/workspace.ts +101 -0
- package/kernel/packages/schemas/src/index.ts +22 -0
- package/kernel/packages/schemas/src/manifest.ts +4 -0
- package/kernel/packages/schemas/src/node.ts +384 -0
- package/kernel/packages/schemas/src/pages/collection.tsx +252 -0
- package/kernel/packages/schemas/src/server.ts +208 -0
- package/kernel/packages/schemas/src/ui/schema-entity-list.tsx +124 -0
- package/kernel/packages/schemas/src/ui/schema-filters.tsx +186 -0
- package/kernel/packages/schemas/src/ui/schema-search.tsx +35 -0
- package/kernel/packages/schemas/src/ui/use-query-param-filter-setting.tsx +15 -0
- package/kernel/packages/schemas/test/contract.test.mjs +26 -0
- package/kernel/packages/schemas/test/fields.test.mjs +187 -0
- package/kernel/packages/schemas/test/load.test.mjs +12 -0
- package/kernel/packages/schemas/test/node.test.mjs +412 -0
- package/kernel/packages/schemas/test/query.test.mjs +134 -0
- package/kernel/packages/schemas/test/workspace.test.mjs +86 -0
- package/kernel/packages/schemas/tsconfig.json +17 -0
- package/kernel/packages/session-finding/package.json +33 -0
- package/kernel/packages/session-finding/src/index.ts +120 -0
- package/kernel/packages/session-finding/test/list-sessions.test.mjs +139 -0
- package/kernel/packages/session-finding/tsconfig.json +12 -0
- package/kernel/packages/ui/LICENSE +21 -0
- package/kernel/packages/ui/components.json +20 -0
- package/kernel/packages/ui/eslint.config.js +8 -0
- package/kernel/packages/ui/package.json +106 -0
- package/kernel/packages/ui/src/chat/file-link.ts +178 -0
- package/kernel/packages/ui/src/chat/index.ts +18 -0
- package/kernel/packages/ui/src/chat/transcript.tsx +348 -0
- package/kernel/packages/ui/src/chat/turns.ts +76 -0
- package/kernel/packages/ui/src/chat/types.ts +23 -0
- package/kernel/packages/ui/src/chat/use-overflowing.ts +56 -0
- package/kernel/packages/ui/src/components/accordion.tsx +74 -0
- package/kernel/packages/ui/src/components/alert-dialog.tsx +164 -0
- package/kernel/packages/ui/src/components/alert.tsx +68 -0
- package/kernel/packages/ui/src/components/app-breadcrumbs.tsx +170 -0
- package/kernel/packages/ui/src/components/app-header.tsx +125 -0
- package/kernel/packages/ui/src/components/app-options.tsx +87 -0
- package/kernel/packages/ui/src/components/app-view-header.tsx +34 -0
- package/kernel/packages/ui/src/components/aspect-ratio.tsx +11 -0
- package/kernel/packages/ui/src/components/avatar.tsx +53 -0
- package/kernel/packages/ui/src/components/badge.tsx +47 -0
- package/kernel/packages/ui/src/components/base-dialog.tsx +3 -0
- package/kernel/packages/ui/src/components/base-tabs.tsx +63 -0
- package/kernel/packages/ui/src/components/breadcrumb.tsx +110 -0
- package/kernel/packages/ui/src/components/button-group.tsx +86 -0
- package/kernel/packages/ui/src/components/button.tsx +65 -0
- package/kernel/packages/ui/src/components/calendar.tsx +240 -0
- package/kernel/packages/ui/src/components/card.tsx +95 -0
- package/kernel/packages/ui/src/components/carousel.tsx +240 -0
- package/kernel/packages/ui/src/components/chart.tsx +375 -0
- package/kernel/packages/ui/src/components/checkbox.tsx +39 -0
- package/kernel/packages/ui/src/components/collapsible.tsx +33 -0
- package/kernel/packages/ui/src/components/collection-icon.tsx +28 -0
- package/kernel/packages/ui/src/components/command.tsx +205 -0
- package/kernel/packages/ui/src/components/content-issues.tsx +63 -0
- package/kernel/packages/ui/src/components/context-menu.tsx +298 -0
- package/kernel/packages/ui/src/components/copy-context.tsx +134 -0
- package/kernel/packages/ui/src/components/dialog.tsx +157 -0
- package/kernel/packages/ui/src/components/drawer.tsx +162 -0
- package/kernel/packages/ui/src/components/dropdown-menu.tsx +303 -0
- package/kernel/packages/ui/src/components/empty.tsx +108 -0
- package/kernel/packages/ui/src/components/field.tsx +260 -0
- package/kernel/packages/ui/src/components/file-preview.tsx +152 -0
- package/kernel/packages/ui/src/components/file-renderer.tsx +466 -0
- package/kernel/packages/ui/src/components/filter-chip-panel.tsx +157 -0
- package/kernel/packages/ui/src/components/filter-select.tsx +127 -0
- package/kernel/packages/ui/src/components/folder-activity.tsx +646 -0
- package/kernel/packages/ui/src/components/folder-file-list.tsx +58 -0
- package/kernel/packages/ui/src/components/folder-filter-bar.tsx +191 -0
- package/kernel/packages/ui/src/components/folder-image.tsx +18 -0
- package/kernel/packages/ui/src/components/folder-landing.tsx +70 -0
- package/kernel/packages/ui/src/components/folder-list.tsx +140 -0
- package/kernel/packages/ui/src/components/folder-metadata.tsx +107 -0
- package/kernel/packages/ui/src/components/folder-mobile-bar.tsx +60 -0
- package/kernel/packages/ui/src/components/folder-project-list.tsx +133 -0
- package/kernel/packages/ui/src/components/folder-session-list.tsx +113 -0
- package/kernel/packages/ui/src/components/folder-session-page.tsx +126 -0
- package/kernel/packages/ui/src/components/folder-sidebar.tsx +52 -0
- package/kernel/packages/ui/src/components/folder-skill-list.tsx +62 -0
- package/kernel/packages/ui/src/components/folder-tabs.tsx +156 -0
- package/kernel/packages/ui/src/components/form.tsx +167 -0
- package/kernel/packages/ui/src/components/hover-card.tsx +52 -0
- package/kernel/packages/ui/src/components/icons.tsx +34 -0
- package/kernel/packages/ui/src/components/input-group.tsx +184 -0
- package/kernel/packages/ui/src/components/input-otp.tsx +90 -0
- package/kernel/packages/ui/src/components/input.tsx +29 -0
- package/kernel/packages/ui/src/components/item.tsx +195 -0
- package/kernel/packages/ui/src/components/kbd.tsx +32 -0
- package/kernel/packages/ui/src/components/label.tsx +27 -0
- package/kernel/packages/ui/src/components/link.tsx +45 -0
- package/kernel/packages/ui/src/components/live-tool-call.tsx +193 -0
- package/kernel/packages/ui/src/components/menubar.tsx +323 -0
- package/kernel/packages/ui/src/components/navigation-menu.tsx +210 -0
- package/kernel/packages/ui/src/components/note-card.tsx +149 -0
- package/kernel/packages/ui/src/components/pagination.tsx +128 -0
- package/kernel/packages/ui/src/components/popover.tsx +56 -0
- package/kernel/packages/ui/src/components/progress.tsx +31 -0
- package/kernel/packages/ui/src/components/radio-group.tsx +54 -0
- package/kernel/packages/ui/src/components/scroll-area.tsx +61 -0
- package/kernel/packages/ui/src/components/select.tsx +219 -0
- package/kernel/packages/ui/src/components/separator.tsx +30 -0
- package/kernel/packages/ui/src/components/session-icon.tsx +124 -0
- package/kernel/packages/ui/src/components/sheet.tsx +157 -0
- package/kernel/packages/ui/src/components/sidebar.tsx +789 -0
- package/kernel/packages/ui/src/components/skeleton.tsx +13 -0
- package/kernel/packages/ui/src/components/slider.tsx +73 -0
- package/kernel/packages/ui/src/components/sonner.tsx +41 -0
- package/kernel/packages/ui/src/components/spinner.tsx +16 -0
- package/kernel/packages/ui/src/components/switch.tsx +40 -0
- package/kernel/packages/ui/src/components/table.tsx +120 -0
- package/kernel/packages/ui/src/components/tabs.tsx +78 -0
- package/kernel/packages/ui/src/components/textarea.tsx +25 -0
- package/kernel/packages/ui/src/components/toggle-group.tsx +87 -0
- package/kernel/packages/ui/src/components/toggle.tsx +48 -0
- package/kernel/packages/ui/src/components/tooltip.tsx +71 -0
- package/kernel/packages/ui/src/components/viewer-options.tsx +166 -0
- package/kernel/packages/ui/src/hooks/use-folder-filter.ts +103 -0
- package/kernel/packages/ui/src/hooks/use-mobile.ts +19 -0
- package/kernel/packages/ui/src/index.ts +13 -0
- package/kernel/packages/ui/src/lib/document-extensions.ts +83 -0
- package/kernel/packages/ui/src/lib/folder-activity.ts +143 -0
- package/kernel/packages/ui/src/lib/folder-filter.ts +284 -0
- package/kernel/packages/ui/src/lib/live-tool-call.tsx +109 -0
- package/kernel/packages/ui/src/lib/media-urls.ts +176 -0
- package/kernel/packages/ui/src/lib/obsidian-links.ts +120 -0
- package/kernel/packages/ui/src/lib/source-components.tsx +65 -0
- package/kernel/packages/ui/src/lib/utils.tsx +7 -0
- package/kernel/packages/ui/src/pages/entity-detail-page.tsx +82 -0
- package/kernel/packages/ui/src/pages/entity-list-page.tsx +50 -0
- package/kernel/packages/ui/src/pages/entity-page.tsx +69 -0
- package/kernel/packages/ui/src/styles/folder-activity.css +2151 -0
- package/kernel/packages/ui/test/copy-context.test.mjs +48 -0
- package/kernel/packages/ui/test/folder-filter.test.mjs +484 -0
- package/kernel/packages/ui/tsconfig.json +15 -0
- package/kernel/plugins/calendar/SKILL.md +173 -0
- package/kernel/plugins/calendar/eslint.config.js +10 -0
- package/kernel/plugins/calendar/package.json +73 -0
- package/kernel/plugins/calendar/schema.json +137 -0
- package/kernel/plugins/calendar/src/calendar.tsx +328 -0
- package/kernel/plugins/calendar/src/client.tsx +139 -0
- package/kernel/plugins/calendar/src/context.ts +48 -0
- package/kernel/plugins/calendar/src/copy-button.tsx +66 -0
- package/kernel/plugins/calendar/src/event-dialog.tsx +270 -0
- package/kernel/plugins/calendar/src/index.ts +4 -0
- package/kernel/plugins/calendar/src/manifest.ts +7 -0
- package/kernel/plugins/calendar/src/parse.ts +610 -0
- package/kernel/plugins/calendar/src/server.ts +160 -0
- package/kernel/plugins/calendar/src/utils.ts +80 -0
- package/kernel/plugins/calendar/src/views.tsx +418 -0
- package/kernel/plugins/calendar/test/context.test.mjs +60 -0
- package/kernel/plugins/calendar/test/package.test.mjs +43 -0
- package/kernel/plugins/calendar/test/parse.test.mjs +392 -0
- package/kernel/plugins/calendar/test/server.test.mjs +126 -0
- package/kernel/plugins/calendar/tsconfig.json +17 -0
- package/kernel/plugins/mail/SKILL.md +97 -0
- package/kernel/plugins/mail/eslint.config.js +10 -0
- package/kernel/plugins/mail/package.json +79 -0
- package/kernel/plugins/mail/src/api.ts +359 -0
- package/kernel/plugins/mail/src/bun-ffi.d.ts +14 -0
- package/kernel/plugins/mail/src/client.tsx +14 -0
- package/kernel/plugins/mail/src/flock.ts +137 -0
- package/kernel/plugins/mail/src/folders.ts +37 -0
- package/kernel/plugins/mail/src/history.ts +485 -0
- package/kernel/plugins/mail/src/index.ts +3 -0
- package/kernel/plugins/mail/src/mail-card.tsx +123 -0
- package/kernel/plugins/mail/src/mail-conversation.tsx +153 -0
- package/kernel/plugins/mail/src/mail-detail-page.tsx +467 -0
- package/kernel/plugins/mail/src/mail-hooks.ts +252 -0
- package/kernel/plugins/mail/src/mail-page.tsx +109 -0
- package/kernel/plugins/mail/src/mail-request.ts +78 -0
- package/kernel/plugins/mail/src/mail-send-box.tsx +175 -0
- package/kernel/plugins/mail/src/mailos.ts +723 -0
- package/kernel/plugins/mail/src/manifest.ts +7 -0
- package/kernel/plugins/mail/src/node.ts +171 -0
- package/kernel/plugins/mail/src/parse.ts +139 -0
- package/kernel/plugins/mail/src/server.ts +125 -0
- package/kernel/plugins/mail/src/types.ts +10 -0
- package/kernel/plugins/mail/src/viewer.tsx +147 -0
- package/kernel/plugins/mail/test/flock.test.mjs +156 -0
- package/kernel/plugins/mail/test/folders.test.mjs +138 -0
- package/kernel/plugins/mail/test/history.test.mjs +460 -0
- package/kernel/plugins/mail/test/mailos.test.mjs +752 -0
- package/kernel/plugins/mail/test/node.test.mjs +207 -0
- package/kernel/plugins/mail/test/package.test.mjs +54 -0
- package/kernel/plugins/mail/test/parse.test.mjs +32 -0
- package/kernel/plugins/mail/test/server.test.mjs +116 -0
- package/kernel/plugins/mail/test/viewer.test.mjs +192 -0
- package/kernel/plugins/mail/tsconfig.json +17 -0
- package/kernel/plugins/projects/SKILL.md +73 -0
- package/kernel/plugins/projects/eslint.config.js +10 -0
- package/kernel/plugins/projects/package.json +70 -0
- package/kernel/plugins/projects/src/client.tsx +17 -0
- package/kernel/plugins/projects/src/data/model.ts +129 -0
- package/kernel/plugins/projects/src/index.ts +17 -0
- package/kernel/plugins/projects/src/manifest.ts +7 -0
- package/kernel/plugins/projects/src/project-context.ts +41 -0
- package/kernel/plugins/projects/src/server.ts +276 -0
- package/kernel/plugins/projects/src/ui/project-card.tsx +61 -0
- package/kernel/plugins/projects/src/ui/projects-page.tsx +102 -0
- package/kernel/plugins/projects/test/package.test.mjs +51 -0
- package/kernel/plugins/projects/tsconfig.json +17 -0
- package/kernel/plugins/tasks/SKILL.md +341 -0
- package/kernel/plugins/tasks/eslint.config.js +10 -0
- package/kernel/plugins/tasks/package.json +74 -0
- package/kernel/plugins/tasks/schema.json +939 -0
- package/kernel/plugins/tasks/src/api.ts +212 -0
- package/kernel/plugins/tasks/src/client.tsx +23 -0
- package/kernel/plugins/tasks/src/data/parse.ts +544 -0
- package/kernel/plugins/tasks/src/data/task-id.ts +56 -0
- package/kernel/plugins/tasks/src/data/todo-model.ts +795 -0
- package/kernel/plugins/tasks/src/index.ts +34 -0
- package/kernel/plugins/tasks/src/manifest.ts +7 -0
- package/kernel/plugins/tasks/src/pages/task-detail.tsx +48 -0
- package/kernel/plugins/tasks/src/pages/task-list.tsx +88 -0
- package/kernel/plugins/tasks/src/server.ts +447 -0
- package/kernel/plugins/tasks/src/styles.css +9 -0
- package/kernel/plugins/tasks/src/ui/compact-todo-list.tsx +372 -0
- package/kernel/plugins/tasks/src/ui/error-details.tsx +78 -0
- package/kernel/plugins/tasks/src/ui/task-page.tsx +392 -0
- package/kernel/plugins/tasks/src/ui/todo-agent-filter.tsx +36 -0
- package/kernel/plugins/tasks/src/ui/todo-filter-bar.tsx +66 -0
- package/kernel/plugins/tasks/src/ui/todo-item.tsx +494 -0
- package/kernel/plugins/tasks/src/ui/todo-status-filter.tsx +60 -0
- package/kernel/plugins/tasks/src/ui/todo-tag-filter.tsx +48 -0
- package/kernel/plugins/tasks/src/ui/todo-warnings.tsx +106 -0
- package/kernel/plugins/tasks/test/api.test.mjs +99 -0
- package/kernel/plugins/tasks/test/folder-sources.test.mjs +46 -0
- package/kernel/plugins/tasks/test/package.test.mjs +54 -0
- package/kernel/plugins/tasks/test/parse.test.mjs +225 -0
- package/kernel/plugins/tasks/test/server.test.mjs +386 -0
- package/kernel/plugins/tasks/tsconfig.json +17 -0
- package/node_modules/@agentclientprotocol/sdk/LICENSE +191 -0
- package/node_modules/@agentclientprotocol/sdk/README.md +70 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.d.ts +1835 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js +1885 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js +5036 -0
- package/node_modules/@agentclientprotocol/sdk/dist/acp.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.d.ts +82 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.js +428 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js +470 -0
- package/node_modules/@agentclientprotocol/sdk/dist/connection.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.d.ts +26 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js +96 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js +77 -0
- package/node_modules/@agentclientprotocol/sdk/dist/cookie-store.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js +232 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/agent.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/client.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js +132 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/client.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.d.ts +9 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js +221 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/dual-version-agent.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js +86 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-client.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js +112 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/http-server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js +88 -0
- package/node_modules/@agentclientprotocol/sdk/dist/examples/ws-client.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.d.ts +33 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js +435 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js +1380 -0
- package/node_modules/@agentclientprotocol/sdk/dist/http-stream.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.d.ts +603 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js +1064 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js +851 -0
- package/node_modules/@agentclientprotocol/sdk/dist/jsonrpc.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.d.ts +22 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js +64 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js +45 -0
- package/node_modules/@agentclientprotocol/sdk/dist/line-buffer.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.d.ts +17 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js +426 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js +499 -0
- package/node_modules/@agentclientprotocol/sdk/dist/node-adapter.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.d.ts +37 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js +474 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js +535 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol-router.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.d.ts +11 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.js +57 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js +73 -0
- package/node_modules/@agentclientprotocol/sdk/dist/protocol.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.d.ts +199 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js +211 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/guards.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.d.ts +51 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js +52 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/index.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.d.ts +6118 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js +3 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/types.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.d.ts +14160 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js +3066 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema/zod.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.d.ts +30 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js +98 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js +93 -0
- package/node_modules/@agentclientprotocol/sdk/dist/schema-deserialize.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js +261 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-permission.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js +490 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-session-sse.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.d.ts +2 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js +104 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js +52 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-sse.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js +946 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server-websocket-upgrade.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.d.ts +81 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.js +380 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.test.js +1082 -0
- package/node_modules/@agentclientprotocol/sdk/dist/server.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.d.ts +4 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.js +91 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js +126 -0
- package/node_modules/@agentclientprotocol/sdk/dist/sse.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.d.ts +35 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.js +106 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js +206 -0
- package/node_modules/@agentclientprotocol/sdk/dist/stream.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.d.ts +8 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js +51 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/streams.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.d.ts +24 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js +163 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-agent.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.d.ts +9 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js +74 -0
- package/node_modules/@agentclientprotocol/sdk/dist/test-support/test-http-server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.d.ts +806 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js +1183 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js +512 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/acp.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.d.ts +954 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js +1035 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/guards.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.d.ts +42 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js +43 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/index.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.d.ts +6146 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js +3 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/types.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.d.ts +30552 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js +3204 -0
- package/node_modules/@agentclientprotocol/sdk/dist/v2/schema/zod.gen.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-server.d.ts +14 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js +358 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-server.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.d.ts +54 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js +246 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js +833 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-stream.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.d.ts +13 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js +78 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.d.ts +1 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js +42 -0
- package/node_modules/@agentclientprotocol/sdk/dist/ws-utils.test.js.map +1 -0
- package/node_modules/@agentclientprotocol/sdk/package.json +105 -0
- package/node_modules/@agentclientprotocol/sdk/schema/schema.json +8819 -0
- package/node_modules/@agentclientprotocol/sdk/schema/v2/schema.unstable.json +10098 -0
- package/package.json +52 -6
- package/web/assets/{abnfDiagram-VRR7QNED-Nfq-O04D.js → abnfDiagram-VRR7QNED-Bgfb1nEB.js} +1 -1
- package/web/assets/app-DoGr2Zi7.js +2 -0
- package/web/assets/app-options-D-RJiQ-X.js +25 -0
- package/web/assets/app-view-header-BLvLq02T.js +1 -0
- package/web/assets/arc-Dk_KI36B.js +1 -0
- package/web/assets/{architectureDiagram-ZJ3FMSHR-qhRwPNcQ.js → architectureDiagram-ZJ3FMSHR-NR_KhRCf.js} +1 -1
- package/web/assets/ask-tray-TzeTcO6-.js +14 -0
- package/web/assets/{blockDiagram-677ZJIJ3-C56P3bGu.js → blockDiagram-677ZJIJ3-CkLkwx9C.js} +1 -1
- package/web/assets/button-C6arH7zt.js +1 -0
- package/web/assets/{c4Diagram-LMCZKHZV-Ey1M72zD.js → c4Diagram-LMCZKHZV-CFCUH8e_.js} +1 -1
- package/web/assets/channel-uMEjV8qc.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-a6isk9VU.js → chunk-2Q5K7J3B-B_BPLWsW.js} +1 -1
- package/web/assets/{chunk-32BRIVSS-uy4kdSLL.js → chunk-32BRIVSS-B1VB1hOy.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-oj2sBFd7.js → chunk-5VM5RSS4-KFcYr8Co.js} +1 -1
- package/web/assets/{chunk-EX3LRPZG-Bzl1ukAi.js → chunk-EX3LRPZG-CpBX3kuK.js} +3 -3
- package/web/assets/{chunk-JWPE2WC7-sUph7I_t.js → chunk-JWPE2WC7-BPSl40wG.js} +1 -1
- package/web/assets/{chunk-MOJQB5TN-C0ERSuVK.js → chunk-MOJQB5TN-D2RcYmoU.js} +1 -1
- package/web/assets/{chunk-RYQCIY6F-Dyw1Hfwp.js → chunk-RYQCIY6F-m7Gyn-t3.js} +1 -1
- package/web/assets/{chunk-V7JOEXUC-DnSz22rb.js → chunk-V7JOEXUC-TDvdopxS.js} +1 -1
- package/web/assets/{chunk-VR4S4FIN-Bp2SNel7.js → chunk-VR4S4FIN-DZTsG51a.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-Dqtar746.js → chunk-XXDRQBXY-Dp0--RE2.js} +1 -1
- package/web/assets/classDiagram-OUVF2IWQ-fbZocVor.js +1 -0
- package/web/assets/classDiagram-v2-EOCWNBFH-fbZocVor.js +1 -0
- package/web/assets/client-C6Nxdfif.js +2 -0
- package/web/assets/client-CXYfBko5.js +17 -0
- package/web/assets/client-CoKtOq-X.js +7 -0
- package/web/assets/client-DyRQz5RU.js +53 -0
- package/web/assets/client-OY6HUzuD.js +98 -0
- package/web/assets/client-YOYWZIFi.js +34 -0
- package/web/assets/client-j2kQmxsO.js +22 -0
- package/web/assets/command-BugZBGXE.js +38 -0
- package/web/assets/copy-context-C0Uqsp-3.js +1 -0
- package/web/assets/{cose-bilkent-JH36ORCC-Dx1VqMjj.js → cose-bilkent-JH36ORCC-CPu3PI8h.js} +1 -1
- package/web/assets/{cynefin-VYW2F7L2-SjhCWmIV.js → cynefin-VYW2F7L2-DWxftYAm.js} +1 -1
- package/web/assets/{cynefinDiagram-TSTJHNR4-Dvqz2594.js → cynefinDiagram-TSTJHNR4-DsmN2V-p.js} +1 -1
- package/web/assets/{dagre-VKFMJZFB-Ju2m2qXt.js → dagre-VKFMJZFB-COEbApyY.js} +1 -1
- package/web/assets/{diagram-FQU43EPY-DsHKTt0k.js → diagram-FQU43EPY-0O9WGWKB.js} +1 -1
- package/web/assets/{diagram-G47NLZAW-DWHAcLkJ.js → diagram-G47NLZAW-CutEdMVh.js} +1 -1
- package/web/assets/{diagram-NH7WQ7WH-uUMz46ZD.js → diagram-NH7WQ7WH-C9KZc3B2.js} +1 -1
- package/web/assets/{diagram-OA4YK3LP-BRjVzjdp.js → diagram-OA4YK3LP-D8kkPXbY.js} +1 -1
- package/web/assets/{diagram-WEI45ONY-Cb-FhBpQ.js → diagram-WEI45ONY-_YqiTaGP.js} +1 -1
- package/web/assets/document-Dgt5eZFj.js +19 -0
- package/web/assets/{ebnfDiagram-CCIWWBDH-IhhxX3IB.js → ebnfDiagram-CCIWWBDH-JO-zQh6g.js} +1 -1
- package/web/assets/{entities-DUnx74kH.js → entities-C3wz7FCx.js} +12 -12
- package/web/assets/{erDiagram-Q63AITRT-D1frgeWf.js → erDiagram-Q63AITRT-9UjQwJ4P.js} +1 -1
- package/web/assets/file-viewer-DZJ8nYnl.js +1 -0
- package/web/assets/{flowDiagram-23GEKE2U-BiPPM-FY.js → flowDiagram-23GEKE2U-Ca08tnYM.js} +5 -5
- package/web/assets/folder-image-BfGgxo7i.js +1 -0
- package/web/assets/folder-landing-qUKBCnG-.js +54 -0
- package/web/assets/folder-list-BfFjv7rR.js +1 -0
- package/web/assets/folder-metadata-DCw8xzHk.js +2 -0
- package/web/assets/folder-mobile-bar-Ubz4babf.js +1 -0
- package/web/assets/folder-plugin-view-DsWR1zmQ.js +6 -0
- package/web/assets/{ganttDiagram-NO4QXBWP-CmEOlHD7.js → ganttDiagram-NO4QXBWP-KnHzX5W3.js} +1 -1
- package/web/assets/{gitGraphDiagram-IHSO6WYX-tTjcpZpU.js → gitGraphDiagram-IHSO6WYX-Cm8woNtK.js} +1 -1
- package/web/assets/index-BaRnbYRw.js +1 -0
- package/web/assets/index-BexmLxIP.css +1 -0
- package/web/assets/index-Bp9DidgD.js +1 -0
- package/web/assets/{index-eL1k96k8.js → index-CCXE8zc9.js} +1 -1
- package/web/assets/index-CNyy98F8.js +2 -0
- package/web/assets/{index-DmrKjrlM.js → index-CXhBn-ar.js} +1 -1
- package/web/assets/index-DDirZMgx.js +1 -0
- package/web/assets/{infoDiagram-FWYZ7A6U-Ok2sdbc1.js → infoDiagram-FWYZ7A6U-yyqmUtIb.js} +1 -1
- package/web/assets/{ishikawaDiagram-FXEZZL3T-kPnM5psX.js → ishikawaDiagram-FXEZZL3T-BfvR_Zy4.js} +4 -4
- package/web/assets/{journeyDiagram-5HDEW3XC-BkoT0-45.js → journeyDiagram-5HDEW3XC-BKuw06HM.js} +1 -1
- package/web/assets/{kanban-definition-HUTT4EX6-xnm_eFoU.js → kanban-definition-HUTT4EX6-n0010rmQ.js} +8 -8
- package/web/assets/{linear-CLZpgLH-.js → linear-C0d0lT8O.js} +1 -1
- package/web/assets/linked-session-header-BkEweU0Z.js +3 -0
- package/web/assets/{markdown-njUwQKsR.js → markdown-Bw9RgUGR.js} +9 -9
- package/web/assets/{mermaid.core-Bvxj3RoN.js → mermaid.core-BDVbShyO.js} +6 -6
- package/web/assets/metadata-KV0dpp4G.js +1 -0
- package/web/assets/{mindmap-definition-LN4V7U3C-42Uoox79.js → mindmap-definition-LN4V7U3C--_0ks3GF.js} +1 -1
- package/web/assets/note-card-DBfX6gW1.js +6 -0
- package/web/assets/{pegDiagram-2B236MQR-B-GZCw3w.js → pegDiagram-2B236MQR-CBoNIpKR.js} +1 -1
- package/web/assets/{pieDiagram-ENE6RG2P-DRmmssIB.js → pieDiagram-ENE6RG2P-MA5tkYh5.js} +3 -3
- package/web/assets/popover-DBD7FF-W.js +9 -0
- package/web/assets/{project-search-dialog-B730oZ1S.js → project-search-dialog-DM1IkSZu.js} +6 -6
- package/web/assets/{quadrantDiagram-ABIIQ3AL-BfhVQ7V9.js → quadrantDiagram-ABIIQ3AL-CWT1ryqF.js} +1 -1
- package/web/assets/{railroadDiagram-RFXS5EU6-DxKx7XRp.js → railroadDiagram-RFXS5EU6-ZiLB5FGi.js} +1 -1
- package/web/assets/{react-DZzLHL-l.js → react-B9jn2M18.js} +2 -2
- package/web/assets/{requirementDiagram-TGXJPOKE-NUzj9fw1.js → requirementDiagram-TGXJPOKE-CQq9uneq.js} +1 -1
- package/web/assets/{sankeyDiagram-HTMAVEWB-Cy9OMnl-.js → sankeyDiagram-HTMAVEWB-qDG-0JqI.js} +1 -1
- package/web/assets/search-DNrQA5fF.js +2 -0
- package/web/assets/select-D8cqNgcp.js +30 -0
- package/web/assets/selection-popup-DmtTeRs2.js +7 -0
- package/web/assets/{sequenceDiagram-DBY2YBRQ-CBNE9mzn.js → sequenceDiagram-DBY2YBRQ-CiApurLO.js} +1 -1
- package/web/assets/{sizeCapture-X5ZJPWSS-S4HhfX0n.js → sizeCapture-X5ZJPWSS-DZSR5QXm.js} +1 -1
- package/web/assets/stateDiagram-2N3HPSRC-CjJJR9_z.js +1 -0
- package/web/assets/stateDiagram-v2-6OUMAXLB-BpeGSCu9.js +1 -0
- package/web/assets/{swimlanes-5IMT3BWC-DJ2aLWal.js → swimlanes-5IMT3BWC-CKmo1sg6.js} +2 -2
- package/web/assets/swimlanesDiagram-G3AALYLV-D9RjLKb9.js +8 -0
- package/web/assets/tanstack-YzX_Mi37.js +3 -0
- package/web/assets/{timeline-definition-FHXFAJF6-vFDUVPCX.js → timeline-definition-FHXFAJF6-D-NMwS3y.js} +1 -1
- package/web/assets/{use-folder-filter-BbTUlXgG.js → use-folder-filter-LQyXns5Q.js} +1 -1
- package/web/assets/{utils-CwHGE3BB.js → utils-DCaHk0Gm.js} +1 -1
- package/web/assets/{vennDiagram-L72KCM5P-AsnhK2zW.js → vennDiagram-L72KCM5P-CfL6LBWw.js} +1 -1
- package/web/assets/view-context-gyDl_p2V.js +229 -0
- package/web/assets/viewer-capabilities-Bpp8Uvcg.js +1 -0
- package/web/assets/{wardleyDiagram-EHGQE667-Cj1wFbNV.js → wardleyDiagram-EHGQE667-DgldMxaj.js} +1 -1
- package/web/assets/{xychartDiagram-FW5EYKEG-Bbvnutsm.js → xychartDiagram-FW5EYKEG-CIoAIFX8.js} +1 -1
- package/web/favicon.svg +6 -0
- package/web/index.html +5 -4
- package/web/assets/app-CPSmsokP.js +0 -2
- package/web/assets/app-options-XEWvevsz.js +0 -25
- package/web/assets/app-view-header-BKZ90ToF.js +0 -1
- package/web/assets/arc-DbpbZvCt.js +0 -1
- package/web/assets/arrow-left-CFeHb-Z1.js +0 -1
- package/web/assets/ask-tray-D2YHtbPj.js +0 -14
- package/web/assets/button-BJ7z-ZA7.js +0 -1
- package/web/assets/calendar-days-DWh2XMO2.js +0 -1
- package/web/assets/channel-dSRp_qTo.js +0 -1
- package/web/assets/chevron-down-C5oRtqbX.js +0 -1
- package/web/assets/chevron-right-CsPtvh8C.js +0 -1
- package/web/assets/chevron-up-DjpU6Pyv.js +0 -1
- package/web/assets/classDiagram-OUVF2IWQ-B7B2zLzM.js +0 -1
- package/web/assets/classDiagram-v2-EOCWNBFH-B7B2zLzM.js +0 -1
- package/web/assets/client-CAudjYV9.js +0 -34
- package/web/assets/client-Dn9-_Gm_.js +0 -14
- package/web/assets/client-Dxrf2tyq.js +0 -102
- package/web/assets/client-aFI2M4pE.js +0 -53
- package/web/assets/collection-icon-TbOVyORG.js +0 -1
- package/web/assets/collection-page-Du6FKkuU.js +0 -10
- package/web/assets/command-C_g5E1Wx.js +0 -38
- package/web/assets/copy-Ikmr6Iq2.js +0 -1
- package/web/assets/copy-context-Cl1TE2PJ.js +0 -1
- package/web/assets/document-DcjNSJCk.js +0 -2
- package/web/assets/external-link-BXmSXqqF.js +0 -1
- package/web/assets/file-renderer-BRZTrYx8.js +0 -19
- package/web/assets/file-text-CiiSsCDq.js +0 -1
- package/web/assets/file-viewer-C1wAeVDK.js +0 -1
- package/web/assets/folder-image-AXBrHUcU.js +0 -1
- package/web/assets/folder-landing-BhRg7hwn.js +0 -54
- package/web/assets/folder-list-rIdszVde.js +0 -1
- package/web/assets/folder-metadata-puTC5QqJ.js +0 -2
- package/web/assets/folder-mobile-bar-DjjRQo3T.js +0 -1
- package/web/assets/folder-plugin-view-BU_kzR8j.js +0 -6
- package/web/assets/index-DS2Wmd9I.css +0 -1
- package/web/assets/index-DgqzSeIR.js +0 -1
- package/web/assets/index-DnlTDqaa.js +0 -1
- package/web/assets/index-DztTMDFz.js +0 -2
- package/web/assets/index-kY75qc96.js +0 -1
- package/web/assets/index-p38i_yyY.js +0 -1
- package/web/assets/link-2-BWKA6t--.js +0 -1
- package/web/assets/link-DC_1Z6Yy.js +0 -11
- package/web/assets/linked-session-header-DJYWZ_-q.js +0 -3
- package/web/assets/mail-2rCdIFul.js +0 -1
- package/web/assets/markdown-title-dncAYYiP.js +0 -131
- package/web/assets/notes-page-DIW6rgJp.js +0 -10
- package/web/assets/pencil-8cobiSSq.js +0 -1
- package/web/assets/plus-BHV2wJr7.js +0 -1
- package/web/assets/popover-Cmmgj-MJ.js +0 -9
- package/web/assets/search-CvlYUkN6.js +0 -2
- package/web/assets/select-1SvaKQsS.js +0 -30
- package/web/assets/selection-popup-ntjycEVh.js +0 -7
- package/web/assets/sparkles-CBhGREdc.js +0 -1
- package/web/assets/stateDiagram-2N3HPSRC-BEw1Mheu.js +0 -1
- package/web/assets/stateDiagram-v2-6OUMAXLB-BHtjl1iD.js +0 -1
- package/web/assets/swimlanesDiagram-G3AALYLV-Z362aroZ.js +0 -8
- package/web/assets/tanstack-CD46mJkU.js +0 -1
- package/web/assets/view-context-D-fh9AbH.js +0 -81
- package/web/assets/viewer-capabilities-CROIaoqh.js +0 -1
- package/web/assets/x-BUeE--I4.js +0 -1
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import{r as j,j as t}from"./react-DZzLHL-l.js";import{b as F}from"./link-DC_1Z6Yy.js";import{C as P}from"./copy-context-Cl1TE2PJ.js";import{c as v,o as q,t as w,L as E,C as B}from"./view-context-D-fh9AbH.js";import{F as O}from"./file-text-CiiSsCDq.js";import{u as N,c as A,h as R}from"./tanstack-CD46mJkU.js";import{e as D}from"./index-DztTMDFz.js";import{a as K,m as U}from"./folder-plugin-view-BU_kzR8j.js";import{M as Q}from"./mail-2rCdIFul.js";import{F as J}from"./index-p38i_yyY.js";import{A as V}from"./arrow-left-CFeHb-Z1.js";import{E as G}from"./external-link-BXmSXqqF.js";import{X as H}from"./x-BUeE--I4.js";import{f as X,u as W}from"./use-folder-filter-BbTUlXgG.js";import"./markdown-njUwQKsR.js";import"./button-BJ7z-ZA7.js";import"./utils-CwHGE3BB.js";import"./copy-Ikmr6Iq2.js";import"./command-C_g5E1Wx.js";import"./index-eL1k96k8.js";import"./index-kY75qc96.js";import"./popover-Cmmgj-MJ.js";import"./folder-image-AXBrHUcU.js";import"./viewer-capabilities-CROIaoqh.js";const Y=[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]],Z=v("archive",Y);const I=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],ee=v("circle-x",I);const te=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],k=v("refresh-cw",te);const se=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],M=v("send",se);const ne=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ae=v("trash-2",ne),re=new Set([".avif",".bmp",".gif",".jpeg",".jpg",".pdf",".png",".webp"]),ie=new Set([".avif",".bmp",".gif",".jpeg",".jpg",".png",".webp"]);function oe(e){const s=e.lastIndexOf(".");return s<0?"":e.slice(s).toLowerCase()}function _(e){const s=e.lastIndexOf("/"),r=s>0?e.slice(0,s):"/",a=e.slice(s+1);return`/api/raw?${new URLSearchParams({path:r,file:a})}`}function le(e){q(e).catch(s=>w.error(s instanceof Error?s.message:"Could not open the default app."))}function ce({path:e}){const[s,r]=j.useState(!1),a=oe(e),n=e.slice(e.lastIndexOf("/")+1),i=re.has(a)&&!s,o=ie.has(a);return t.jsxs("figure",{className:`m-0 flex w-44 shrink-0 flex-col overflow-hidden rounded-lg
|
|
2
|
-
border border-[#e7ebe7] bg-white shadow-[0_1px_2px_rgb(31_41_55/0.05)]`,children:[t.jsx("a",{"aria-label":`Preview ${n}`,className:"block h-28 bg-[#f3f5f2] transition-colors hover:bg-[#e9ede8]",href:i?_(e):void 0,target:"_blank",rel:"noreferrer",onClick:i?void 0:l=>{l.preventDefault()},children:i?o?t.jsx("img",{alt:`Preview of ${n}`,className:"size-full object-contain",onError:()=>r(!0),src:_(e)}):t.jsx("iframe",{className:"pointer-events-none size-full border-0",src:`${_(e)}#page=1&toolbar=0`,title:`Preview of ${n}`}):t.jsx("span",{className:"flex size-full items-center justify-center",children:t.jsx(O,{"aria-hidden":"true",className:"size-8 text-[#8a968b]"})})}),t.jsxs("figcaption",{className:`flex min-w-0 items-center gap-2 border-t border-[#e7ebe7]
|
|
3
|
-
px-2 py-1.5`,children:[t.jsx("span",{className:"min-w-0 flex-1 truncate text-xs text-[#2f382f]",title:n,children:n}),t.jsx("button",{className:`shrink-0 cursor-pointer rounded-md border border-[#dde1dc]
|
|
4
|
-
bg-white px-2 py-0.5 text-xs text-[#4a554b] hover:bg-[#f3f5f2]`,type:"button",onClick:()=>le(e),children:"Open"})]})]})}class z extends Error{status;constructor(s,r){super(r),this.name="MailRequestFailure",this.status=s}}function de(e){try{const s=JSON.parse(e);if(s.error?.message)return s.error.message}catch{}return e.trim()||"Mail request failed."}async function b(e,s={}){const r=new URLSearchParams;for(const[u,c]of Object.entries(s.search??{}))c!==void 0&&r.set(u,c);const a=r.toString(),n=`${e}${a?`?${a}`:""}`,i={};let o;s.body!==void 0&&(i["content-type"]="application/json",o=JSON.stringify(s.body));const l=await fetch(n,{body:o,headers:i,method:s.method??"GET",signal:s.signal}),d=await l.text();if(!l.ok)throw new z(l.status,de(d));if(!l.headers.get("content-type")?.includes("application/json"))throw new z(l.status,"The server returned a non-JSON response.");return JSON.parse(d)}function h(e){return e instanceof z||e instanceof Error?e.message:"Mail request failed."}function C(e){return{path:e??""}}function g(e){return["folder",e?D(e):"none","mail"]}function me(e){return N({enabled:!!e,gcTime:5*6e4,queryFn:({signal:s})=>b("/api/mail",{search:C(e),signal:s}),queryKey:[...g(e)],staleTime:15e3})}function ue(e,s){return N({enabled:!!(e&&s),gcTime:5*6e4,queryFn:({signal:r})=>b("/api/mail/item",{search:{...C(e),id:s??""},signal:r}),queryKey:[...g(e),s??""],retry:!1,staleTime:15e3})}function xe(e,s,r){return N({enabled:!!(r&&s),gcTime:5*6e4,queryFn:({signal:a})=>b("/api/mail/from",{search:{...C(e),id:s??""},signal:a}),queryKey:[...g(e),s??"","from"],retry:!1,staleTime:15e3})}function fe(e,s,r){return N({enabled:!!(r&&s),gcTime:5*6e4,queryFn:({signal:a})=>b("/api/mail/conversation",{search:{...C(e),id:s??""},signal:a}),queryKey:[...g(e),s??"","conversation"],retry:!1,staleTime:5*6e4})}function pe(e){const s=A();return R({mutationFn:r=>b("/api/mail/action",{body:r,method:"POST"}),onSuccess:()=>{s.invalidateQueries({queryKey:[...g(e)]})}})}function he(e){const s=A();return R({mutationFn:r=>b("/api/mail/send",{body:{path:e??"",...r},method:"POST"}),onSuccess:()=>{s.invalidateQueries({queryKey:[...g(e)]})}})}function be(e){if(!e.enabled)return{variant:"hidden"};if(e.isPending&&!e.data)return{variant:"loading"};if(e.error&&!e.data)return{variant:"error",message:e.error instanceof Error?e.error.message:"Could not load the conversation."};switch(e.data?.outcome){case"empty":return{variant:"empty"};case"ok":return e.data.items.length?{variant:"ok"}:{variant:"empty"};case"partial":return{variant:"partial",missing:e.data.missing.length};case"not-found":return{variant:"not-found"};case"timeout":return{variant:"timeout"};default:return{variant:"hidden"}}}function S(e,s){return t.jsxs("p",{className:"m-0 flex flex-wrap items-center gap-2 text-sm text-[#6c7a6d]",children:[t.jsx("span",{className:"break-words",children:e}),t.jsxs("button",{type:"button",className:`inline-flex items-center gap-1.5 rounded-md border
|
|
5
|
-
border-[#dde1dc] bg-white px-2.5 py-1 text-[0.82rem] text-[#4a554b]
|
|
6
|
-
hover:bg-[#f3f5f2]`,onClick:s,children:[t.jsx(k,{className:"size-3.5"}),"Retry"]})]})}function ge({items:e}){return t.jsx("ol",{className:"m-0 grid list-none gap-0 p-0",children:e.map((s,r)=>t.jsxs("li",{className:r===0?"px-4 py-4":"border-t border-[#e7ebe7] px-4 py-4",children:[t.jsxs("div",{className:"mb-2 grid gap-1",children:[t.jsx("p",{className:"m-0 font-semibold break-words text-[#233025]",children:s.subject??"(no subject)"}),t.jsxs("p",{className:"m-0 text-[0.82rem] text-[#6c7a6d]",children:[s.from??"Unknown sender",s.date?` · ${s.date}`:""]})]}),t.jsx("div",{className:"prose prose-neutral max-w-none",children:t.jsx(F,{value:s.body})})]},s.id))})}function je({enabled:e,folder:s,mailId:r}){const a=fe(s,r,e),n=be({data:a.data,enabled:e,error:a.error,isPending:a.isPending}),i=()=>{a.refetch()};if(n.variant==="hidden"||n.variant==="empty")return null;if(n.variant==="loading")return t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:"Loading conversation…"});if(n.variant==="error")return t.jsxs("p",{className:"m-0 flex flex-wrap items-center gap-2 text-sm text-[#9c3a3a]",children:[t.jsxs("span",{className:"break-words",children:["Could not load the conversation. ",h(a.error)]}),t.jsx(ve,{onRetry:i})]});const o=a.data?.items??[];return t.jsxs("section",{className:`overflow-hidden rounded-xl border border-[#e7ebe7] bg-white
|
|
7
|
-
shadow-[0_1px_2px_rgb(31_41_55/0.05)]`,children:[t.jsx("header",{className:"border-b border-[#e7ebe7] bg-[#fbfcfb] px-4 py-3",children:t.jsx("h2",{className:`m-0 text-[0.75rem] font-medium tracking-wide text-[#6c7a6d]
|
|
8
|
-
uppercase`,children:"Previous conversation"})}),o.length?t.jsx(ge,{items:o}):null,t.jsxs("footer",{className:"border-t border-[#e7ebe7] bg-[#fbfcfb] px-4 py-3",children:[n.variant==="partial"?S(`Some earlier messages could not be loaded (${n.missing}).`,i):null,n.variant==="not-found"?S("Earlier messages could not be found.",i):null,n.variant==="timeout"?S("Loading earlier messages timed out.",i):null,n.variant==="ok"&&o.length?t.jsx("p",{className:"m-0 text-[0.82rem] text-[#6c7a6d]",children:"Thread loaded from references."}):null]})]})}function ve({onRetry:e}){return t.jsxs("button",{type:"button",className:`inline-flex items-center gap-1.5 rounded-md border
|
|
9
|
-
border-[#dde1dc] bg-white px-2.5 py-1 text-[0.82rem] text-[#4a554b]
|
|
10
|
-
hover:bg-[#f3f5f2]`,onClick:e,children:[t.jsx(k,{className:"size-3.5"}),"Retry"]})}function ye({folder:e,mailId:s,status:r}){const[a,n]=j.useState("idle"),[i,o]=j.useState(null),[l,d]=j.useState(null),u=he(e);j.useEffect(()=>{n("idle"),o(null),d(null)},[s]);const c=u.isPending||a==="previewing"||a==="sending";async function y(){if(!(!s||c)){d(null),n("previewing");try{const x=await u.mutateAsync({dryRun:!0,id:s});if(!("revision"in x))throw new Error("MailOS did not return a revision.");o(x),n("confirm")}catch(x){d(h(x)),n("failed")}}}async function m(){if(!(!s||!i||c)){d(null),n("sending");try{await u.mutateAsync({dryRun:!1,id:s,revision:i.revision}),n("sent")}catch(x){d(h(x)),n("failed")}}}return t.jsxs("div",{className:`rounded-xl border border-[#e7ebe7] bg-white px-4 py-3
|
|
11
|
-
shadow-[0_1px_2px_rgb(31_41_55/0.05)]`,children:[a==="idle"?t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[t.jsxs("button",{type:"button",className:`inline-flex w-fit items-center gap-2 rounded-md
|
|
12
|
-
bg-[#395641] px-3 py-1.5 text-sm text-white hover:bg-[#2f4b38]
|
|
13
|
-
disabled:pointer-events-none disabled:opacity-50`,onClick:()=>{y()},disabled:r==="sent"||c,children:[t.jsx(M,{className:"size-4"}),r==="sent"?"Already sent":"Send"]}),t.jsx("span",{className:"text-[0.82rem] text-[#6c7a6d]",children:"Will preview for confirmation before delivering."})]}):null,a==="previewing"||a==="sending"?t.jsxs("p",{className:"m-0 flex items-center gap-2 text-sm text-[#4a554b]",children:[t.jsx(E,{className:"size-4 animate-spin"}),a==="previewing"?"Previewing…":"Sending…"]}):null,a==="confirm"&&i?t.jsxs("div",{className:"grid gap-3",children:[t.jsx("p",{className:"m-0 text-sm text-[#4a554b]",children:"Ready to send this draft to its recipients."}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs("button",{type:"button",className:`inline-flex w-fit items-center gap-2 rounded-md
|
|
14
|
-
bg-[#395641] px-3 py-1.5 text-sm text-white hover:bg-[#2f4b38]
|
|
15
|
-
disabled:pointer-events-none disabled:opacity-50`,onClick:()=>{m()},disabled:c,children:[t.jsx(M,{className:"size-4"}),"Send now"]}),t.jsx("button",{type:"button",className:`w-fit rounded-md border border-[#dde1dc] bg-white px-3
|
|
16
|
-
py-1.5 text-sm text-[#4a554b] hover:bg-[#f3f5f2]
|
|
17
|
-
disabled:pointer-events-none disabled:opacity-50`,onClick:()=>{n("idle"),o(null)},disabled:c,children:"Cancel"})]}),t.jsxs("details",{className:"text-[0.82rem] text-[#6c7a6d]",children:[t.jsx("summary",{className:"cursor-pointer",children:"Preview output"}),t.jsx("pre",{className:`mt-2 max-h-48 overflow-auto rounded-md bg-[#f3f5f2] p-2
|
|
18
|
-
text-[0.75rem] whitespace-pre-wrap text-[#4a554b]`,children:i.output})]})]}):null,a==="sent"?t.jsxs("p",{className:"m-0 flex items-center gap-2 text-sm text-[#2f5b3a]",children:[t.jsx(B,{className:"size-4"}),"Sent."]}):null,a==="failed"?t.jsxs("div",{className:"grid gap-3",children:[t.jsxs("p",{className:"m-0 flex items-center gap-2 text-sm text-[#9c3a3a]",children:[t.jsx(ee,{className:"size-4 shrink-0"}),t.jsx("span",{className:"break-words",children:l})]}),t.jsxs("button",{type:"button",className:`inline-flex w-fit items-center gap-2 rounded-md border
|
|
19
|
-
border-[#dde1dc] bg-white px-3 py-1.5 text-sm text-[#4a554b]
|
|
20
|
-
hover:bg-[#f3f5f2]`,onClick:()=>{y()},children:[t.jsx(M,{className:"size-4"}),"Try again"]})]}):null]})}function we(e){if(!e)return"—";const s=Date.parse(e);if(Number.isNaN(s))return e;const r=Date.now()-s,a=Math.round(r/6e4);if(a<1)return"just now";if(a<60)return`${a}m ago`;const n=Math.round(a/60);return n<48?`${n}h ago`:`${Math.round(n/24)}d ago`}function Ne({actions:e,folderLabel:s,href:r,item:a}){const n=a.to.length?{label:"To",items:a.to}:a.cc.length?{label:"CC",items:a.cc}:a.bcc.length?{label:"BCC",items:a.bcc}:null,i=a.to[0]??"",o=/<([^<>]+)>/.exec(i)?.[1]??i,l=/^[^\s@<>]+@([a-z0-9.-]+\.[a-z]{2,})$/i.exec(o.trim())?.[1]?.toLowerCase();return t.jsxs("li",{className:"relative min-w-0",children:[t.jsxs("a",{className:`grid grid-cols-[2rem_minmax(0,1fr)] items-start gap-3
|
|
21
|
-
rounded-xl border border-[#e7ebe7] bg-white px-3.5 py-2.5 pr-10
|
|
22
|
-
text-[#2f382f] no-underline shadow-[0_1px_2px_rgb(31_41_55/0.05)]
|
|
23
|
-
hover:bg-[#fafbfa] focus-visible:outline-2
|
|
24
|
-
focus-visible:outline-offset-1 focus-visible:outline-[#56725e]`,href:r,children:[t.jsxs("span",{"aria-hidden":"true",className:`relative flex size-8 items-center justify-center rounded-md
|
|
25
|
-
bg-[#f3f5f2] text-[#6c7a6d]`,children:[t.jsx(Q,{className:"size-4"}),l?t.jsx("img",{alt:"",className:"absolute size-6 rounded-sm bg-[#f3f5f2] object-contain",height:24,loading:"lazy",onError:d=>{d.currentTarget.style.display="none"},referrerPolicy:"no-referrer",src:`https://www.google.com/s2/favicons?domain=${encodeURIComponent(l)}&sz=32`,width:24},l):null]}),t.jsxs("div",{className:"grid min-w-0 gap-1",children:[t.jsx("span",{className:"line-clamp-2 min-w-0 font-semibold break-words",children:a.subject??"(no subject)"}),t.jsxs("div",{className:"flex items-start gap-2",children:[t.jsx("span",{className:`shrink-0 text-[0.75rem] whitespace-nowrap
|
|
26
|
-
text-[#6c7a6d]`,children:we(a.updatedAt??a.createdAt)}),n?t.jsxs("span",{className:"min-w-0 truncate text-[0.82rem] text-[#4a554b]",children:[n.label,": ",n.items[0],n.items.length>1?` +${n.items.length-1}`:""]}):t.jsx("span",{className:"text-[0.82rem] text-[#6c7a6d]",children:"No recipients"})]}),s?t.jsxs("span",{className:"flex min-w-0 items-center gap-1 text-xs text-[#6c7a6d]",title:a.folder??void 0,children:[t.jsx(J,{"aria-hidden":"true",className:"size-3 shrink-0"}),t.jsx("span",{className:"truncate",children:s})]}):null,a.excerpt?t.jsx("p",{className:"m-0 min-w-0 truncate text-[0.82rem] text-[#6c7a6d]",children:a.excerpt}):null]})]}),e?t.jsx("div",{className:"absolute top-2 right-2",children:e(a)}):null]})}const T=(e,s)=>["You are helping with an email draft. Use the context below to understand the message and what it needs next.","","Instructions for the LLM:","- Treat the subject as the draft's objective.","- Use recipients, tags and body (or the owning draft file) as the authoritative message context.","- If information is missing, state the exact missing input or recipient needed.","- Return: 1) current status, 2) what the message needs next, 3) suggested edits or reply if asked.","","Mail context:",`- Subject: ${e.subject??"(no subject)"}`,e.from?`- From: ${e.from}`:null,e.to?.length?`- To: ${e.to.join(", ")}`:null,e.cc?.length?`- Cc: ${e.cc.join(", ")}`:null,e.bcc?.length?`- Bcc: ${e.bcc.join(", ")}`:null,e.attachments?.length?`- Attachments: ${e.attachments.join(", ")}`:null,`- Status: ${e.status??"unknown"}`,e.folder?`- Folder: ${e.folder}`:null,e.tags?.length?`- Tags: ${e.tags.map(r=>`#${r}`).join(" ")}`:null,`- Draft file: ${e.filePath}`,s?"":null,s?"Draft body:":null,s??null,!s&&e.excerpt?"":null,!s&&e.excerpt?"Draft excerpt:":null,!s&&e.excerpt?e.excerpt:null].filter(r=>r!=null).join(`
|
|
27
|
-
`);function ke({choices:e,onSelect:s,selected:r,total:a}){return t.jsx(K,{allLabel:"All folders",ariaLabel:"Filter drafts by folder",choices:e,onSelect:s,selected:r,total:a})}function Ce({actions:e,folderLabel:s,mailHref:r,items:a}){return t.jsx("ol",{className:"m-0 grid list-none grid-cols-1 gap-2 p-0",children:a.map(n=>t.jsx(Ne,{actions:e,folderLabel:s?.(n.folder),href:r(n.id),item:n},n.id))})}function Me(e){if(!e)return"—";const s=Date.parse(e);return Number.isNaN(s)?e:new Date(s).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"})}function p({label:e,value:s}){return t.jsxs("div",{className:"grid grid-cols-[88px_1fr] items-start gap-x-3 gap-y-1",children:[t.jsx("span",{className:`pt-0.5 text-[0.75rem] font-medium tracking-wide
|
|
28
|
-
text-[#6c7a6d] uppercase`,children:e}),t.jsx("span",{className:"min-w-0 text-sm break-words",children:s})]})}function $({items:e,max:s}){if(!e.length)return t.jsx("span",{className:"text-[#6c7a6d]",children:"—"});const r=s?e.slice(0,s):e,a=s&&e.length>s?e.length-s:0,n="rounded-md bg-[#f3f5f2] px-2 py-1 text-[0.85rem] text-[#2f382f]";return t.jsxs("span",{className:"flex min-w-0 flex-wrap gap-1",children:[r.map(i=>t.jsx("span",{className:n,title:i,children:t.jsx("span",{className:"break-all",children:i})},i)),a?t.jsxs("span",{className:n,title:`${a} more recipients`,children:["+",a]}):null]})}function _e({paths:e,pending:s,onRemove:r}){return t.jsx("span",{className:"flex min-w-0 flex-wrap gap-2",children:e.map(a=>{const n=a.slice(a.lastIndexOf("/")+1);return t.jsxs("span",{className:"relative",children:[t.jsx(ce,{path:a}),r?t.jsx("button",{type:"button","aria-label":`Remove ${n} from this draft`,title:`Remove ${n} from this draft}`,className:`absolute top-1.5 right-1.5 z-10 flex size-6
|
|
29
|
-
cursor-pointer items-center justify-center rounded-full border
|
|
30
|
-
border-[#e5c4c4] bg-white text-[#9c3a3a] shadow-xs
|
|
31
|
-
hover:bg-[#fbf3f3] disabled:pointer-events-none
|
|
32
|
-
disabled:opacity-50`,onClick:()=>r(a),disabled:s,children:t.jsx(H,{className:"size-3.5"})}):null]},a)})})}function Se({mail:e,error:s,preview:r,refreshing:a,onRefresh:n,onArchive:i,onDelete:o,actionPending:l,onOpenPath:d,onRemoveAttachment:u}){return t.jsxs("div",{className:"grid min-w-0 grid-cols-1 gap-4",children:[t.jsxs("header",{className:"flex flex-wrap items-start justify-between gap-3",children:[t.jsxs("div",{className:"min-w-0",children:[t.jsx("h1",{className:"m-0 text-2xl font-semibold break-words text-[#233025]",children:e.subject??"(no subject)"}),t.jsxs("p",{className:"m-0 mt-1 text-sm text-[#6c7a6d]",children:["Updated:"," ",e.updatedAt??e.createdAt?t.jsx("time",{dateTime:e.updatedAt??e.createdAt??void 0,title:e.updatedAt??e.createdAt??void 0,children:Me(e.updatedAt??e.createdAt)}):"—"]})]}),t.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:[t.jsx(P,{className:`border bg-white text-[#4a554b] shadow-xs
|
|
33
|
-
hover:bg-[#f3f5f2]`,context:()=>T(e,r?.body??e.body),label:`Copy full context for ${e.subject??"this draft"}`,size:"sm",variant:"ghost"}),t.jsx(P,{className:`border bg-white text-[#4a554b] shadow-xs
|
|
34
|
-
hover:bg-[#f3f5f2]`,context:e.filePath,label:"Copy draft path",size:"sm",variant:"ghost"}),t.jsxs("button",{type:"button",className:`inline-flex items-center gap-2 rounded-md border px-3
|
|
35
|
-
py-1.5 text-sm`,onClick:n,disabled:a,children:[t.jsx(k,{className:a?"size-4 animate-spin":"size-4"}),"Refresh"]}),d?t.jsxs("button",{type:"button",className:`inline-flex cursor-pointer items-center gap-2
|
|
36
|
-
rounded-md border px-3 py-1.5 text-sm`,onClick:()=>{d(e.filePath)},children:[t.jsx(G,{className:"size-4"}),"Open"]}):null,i&&e.status!=="sent"?t.jsxs("button",{type:"button",className:`inline-flex items-center gap-2 rounded-md border px-3
|
|
37
|
-
py-1.5 text-sm disabled:pointer-events-none disabled:opacity-50`,onClick:i,disabled:l,children:[t.jsx(Z,{className:"size-4"}),"Archive"]}):null,o?t.jsxs("button",{type:"button",className:`inline-flex items-center gap-2 rounded-md border
|
|
38
|
-
border-[#e5c4c4] px-3 py-1.5 text-sm text-[#9c3a3a]
|
|
39
|
-
hover:bg-[#fbf3f3] disabled:pointer-events-none
|
|
40
|
-
disabled:opacity-50`,onClick:o,disabled:l,children:[t.jsx(ae,{className:"size-4"}),"Delete"]}):null]})]}),t.jsxs("div",{className:`grid grid-cols-1 gap-3 rounded-xl border border-[#e7ebe7]
|
|
41
|
-
bg-white px-4 py-4 shadow-[0_1px_2px_rgb(31_41_55/0.05)]`,children:[e.from?t.jsx(p,{label:"From",value:e.from}):null,e.subject?t.jsx(p,{label:"Subject",value:e.subject}):null,t.jsx(p,{label:"To",value:t.jsx($,{items:e.to})}),t.jsx(p,{label:"CC",value:t.jsx($,{items:e.cc})}),t.jsx(p,{label:"BCC",value:t.jsx($,{items:e.bcc})}),e.noSignature?t.jsx(p,{label:"Signature",value:"none"}):null,e.attachments.length?t.jsx(p,{label:"Attachments",value:t.jsx(_e,{paths:e.attachments,pending:l,onRemove:u})}):null]}),s?t.jsx("p",{className:"m-0 text-sm text-[#9c3a3a]",children:s}):null,r?t.jsx("article",{className:`overflow-hidden rounded-xl border border-[#e7ebe7] bg-white
|
|
42
|
-
shadow-[0_1px_2px_rgb(31_41_55/0.05)]`,children:t.jsx("section",{className:"px-4 py-4",children:!r.body.trim()&&!r.signature?t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:"(empty body)"}):t.jsx("div",{className:"prose prose-neutral max-w-none",children:t.jsx(F,{value:[r.body,r.signature].filter(Boolean).join(`
|
|
43
|
-
|
|
44
|
-
`)})})})}):null]})}function $e({folder:e,subpath:s,listHref:r,hostActions:a}){const n=ue(e,s),i=pe(e);async function o(){if(m)try{await i.mutateAsync({action:"archive",id:s,path:e??"",revision:m.revision}),n.refetch()}catch(f){w.error(h(f))}}async function l(f){if(m&&window.confirm(`Remove "${f}" from this draft? The file is kept on disk.`))try{await i.mutateAsync({action:"remove-attachment",id:s,path:e??"",revision:m.revision,attachment:f}),n.refetch()}catch(L){w.error(h(L))}}async function d(){if(m&&window.confirm("Delete this draft? It will be moved to draft history first."))try{await i.mutateAsync({action:"delete",id:s,path:e??"",revision:m.revision}),window.location.assign(r)}catch(f){w.error(h(f))}}const u=!!(n.data?.mail&&!n.data.mail.from),c=xe(e,s,u),y=n.data?.mail?.from??(c.data?.name&&c.data?.from?`${c.data.name} <${c.data.from}>`:c.data?.from??null),m=n.data?.mail?{...n.data.mail,from:y}:void 0,x=!!(n.data?.mail&&(n.data.mail.inReplyTo??n.data.mail.references.length>0));return!e||!s?t.jsxs("div",{className:`mx-auto grid w-full max-w-3xl min-w-0 grid-cols-1 gap-4 px-4
|
|
45
|
-
py-5`,children:[t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:"Select a mail from the list."}),t.jsx("a",{className:`w-fit cursor-pointer rounded-md border border-[#dde1dc]
|
|
46
|
-
bg-white px-3 py-1.5 text-[0.85rem] text-[#4a554b]
|
|
47
|
-
hover:bg-[#f3f5f2]`,href:r,children:"Back"})]}):t.jsxs("div",{className:`mx-auto grid w-full max-w-3xl min-w-0 grid-cols-1 gap-4 px-4
|
|
48
|
-
py-5`,children:[t.jsxs("a",{className:`inline-flex w-fit items-center gap-2 rounded-md border
|
|
49
|
-
border-[#dde1dc] bg-white px-3 py-1.5 text-sm text-[#4a554b]
|
|
50
|
-
no-underline hover:bg-[#f3f5f2]`,href:r,children:[t.jsx(V,{className:"size-4"}),"Back to Mail"]}),n.isPending?t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:"Loading…"}):null,n.error&&!n.data?.mail?t.jsx("p",{className:"m-0 text-sm text-[#9c3a3a]",children:"Could not load mail preview."}):null,m?t.jsx(Se,{mail:m,preview:n.error?void 0:n.data?.preview,error:n.error?"Could not load mail preview.":n.data?.preview?void 0:"Could not load mail preview.",refreshing:n.isFetching,onRefresh:()=>{n.refetch()},onArchive:m.status==="sent"?void 0:()=>{o()},onDelete:()=>{d()},actionPending:i.isPending,onOpenPath:a?.openPath,onRemoveAttachment:f=>{l(f)}}):null,t.jsx(je,{enabled:x,folder:e,mailId:s}),m?t.jsx(ye,{folder:e,mailId:s,status:m.status}):null,!n.isPending&&!n.error&&!n.data?.mail?t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:"Mail not found."}):null]})}function Pe(e,s){return X(e,s)}function ze({folder:e,href:s}){const r=me(e),a=r.data?.items??[],n=!!r.data?.items.length,{choices:i,effectiveSelected:o,setSelected:l,total:d,visibleItems:u}=W(a,{getFolder:c=>c.folder,rootFolder:e??""});return e?t.jsxs("div",{className:`mx-auto grid w-full max-w-3xl min-w-0 grid-cols-1 gap-4 px-4
|
|
51
|
-
py-5`,children:[t.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[t.jsx("h1",{className:"m-0 text-2xl font-semibold text-[#233025]",children:"Mail"}),t.jsxs("button",{type:"button",className:`inline-flex items-center gap-2 rounded-md border px-3
|
|
52
|
-
py-1.5 text-sm disabled:pointer-events-none disabled:opacity-50`,onClick:()=>{r.refetch()},disabled:r.isFetching,children:[t.jsx(k,{className:r.isFetching?"size-4 animate-spin":"size-4"}),"Refresh"]})]}),n?t.jsx(ke,{choices:i,onSelect:l,selected:o,total:d}):null,r.isPending?t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:"Loading…"}):null,r.error?t.jsx("p",{className:"m-0 text-sm text-[#9c3a3a]",children:h(r.error)}):null,!r.isPending&&!r.error&&!r.data?.items.length?t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:"No mail found."}):null,n?u.length?t.jsx(Ce,{actions:c=>t.jsx(P,{className:"text-[#6c7a6d] hover:text-[#2f382f]",context:()=>T(c),label:`Copy context for ${c.subject??"this draft"}`}),folderLabel:c=>Pe(c,e),items:u,mailHref:s}):t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:"No drafts in this folder."}):null]}):t.jsx("div",{className:`mx-auto grid w-full max-w-3xl min-w-0 grid-cols-1 gap-4 px-4
|
|
53
|
-
py-5`,children:t.jsx("p",{className:"m-0 text-sm text-[#6c7a6d]",children:"Open mail from a folder."})})}function Fe(e){return e.subpath?t.jsx($e,{...e}):t.jsx(ze,{...e})}const nt={...U,component:Fe};export{Fe as MailPlugin,nt as mailClient};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./view-context-D-fh9AbH.js";import{j as a}from"./react-DZzLHL-l.js";import{C as i}from"./calendar-days-DWh2XMO2.js";import{F as s}from"./file-text-CiiSsCDq.js";import{F as o}from"./index-p38i_yyY.js";const r=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],d=e("briefcase",r);const y=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],n=e("building-2",y);const p=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],_=e("ellipsis",p);const h=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],k=e("rocket",h);const l=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],f=e("users",l);function g({name:c}){const t=c==="rocket"?k:c==="calendar-days"?i:c==="building-2"?n:c==="users"?f:c==="briefcase"?d:c==="file-text"?s:o;return a.jsx(t,{"aria-hidden":"true"})}export{g as C,_ as E};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{j as e,r as p}from"./react-DZzLHL-l.js";import{a as j,c as b,u as v}from"./tanstack-CD46mJkU.js";import{s as x,a as y}from"./view-context-D-fh9AbH.js";import{B as w}from"./button-BJ7z-ZA7.js";import{C as h,E as C}from"./collection-icon-TbOVyORG.js";import{F as N}from"./folder-list-rIdszVde.js";import{c as S}from"./utils-CwHGE3BB.js";import{P as $,a as E,b as F}from"./popover-Cmmgj-MJ.js";import{S as I,a as L,b as A,c as P,d as f}from"./select-1SvaKQsS.js";import{p as q,f as R}from"./index-DztTMDFz.js";import"./markdown-njUwQKsR.js";import"./calendar-days-DWh2XMO2.js";import"./file-text-CiiSsCDq.js";import"./index-p38i_yyY.js";import"./index-eL1k96k8.js";import"./link-DC_1Z6Yy.js";import"./external-link-BXmSXqqF.js";import"./chevron-down-C5oRtqbX.js";import"./chevron-up-DjpU6Pyv.js";import"./index-DnlTDqaa.js";import"./index-DmrKjrlM.js";import"./index-DgqzSeIR.js";function k({className:t,type:n,...a}){return e.jsx("input",{type:n,"data-slot":"input",className:S(`file:text-foreground placeholder:text-muted-foreground
|
|
2
|
-
selection:bg-primary selection:text-primary-foreground dark:bg-input/30
|
|
3
|
-
border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3
|
|
4
|
-
py-1 text-base shadow-xs transition-[color,box-shadow] outline-none
|
|
5
|
-
file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm
|
|
6
|
-
file:font-medium disabled:pointer-events-none
|
|
7
|
-
disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,`focus-visible:border-ring focus-visible:ring-ring/50
|
|
8
|
-
focus-visible:ring-[3px]`,`aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40
|
|
9
|
-
aria-invalid:border-destructive`,t),...a})}function m(t){return t==null?"":Array.isArray(t)?t.map(m).join(", "):typeof t=="object"?JSON.stringify(t):String(t)}function B(t,n,a=""){const o=a.trim().toLocaleLowerCase();return t.records.filter(i=>(!o||`${i.title} ${Object.values(i.fields).map(m).join(" ")}`.toLocaleLowerCase().includes(o))&&t.ui.filters.every(s=>!n[s]||m(i.fields[s])===n[s])).sort((i,s)=>s.modifiedAt-i.modifiedAt||i.title.localeCompare(s.title)||i.id.localeCompare(s.id))}function Q({collection:t,folder:n,refreshing:a=!1}){const[o,i]=p.useState(""),[s,c]=p.useState({}),u=B(t,s,o);return e.jsxs("section",{className:"landing-section","aria-label":t.title,children:[e.jsxs("header",{children:[e.jsxs("h2",{children:[e.jsx(h,{name:t.icon}),t.title]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:t.count}),e.jsxs($,{children:[e.jsx(E,{asChild:!0,children:e.jsx(w,{variant:"ghost",size:"icon","aria-label":"Collection options",children:e.jsx(C,{"aria-hidden":"true"})})}),e.jsxs(F,{align:"end",className:"w-80 max-w-[calc(100vw-2rem)]","aria-label":"Collection options",children:[e.jsxs("p",{className:"text-muted-foreground text-xs",role:"status",children:[a?"Refreshing metadata…":`Indexed ${new Date(t.indexedAt).toLocaleString()}`,t.state==="error"?" · Index has errors":""]}),e.jsxs("div",{className:"flex flex-wrap items-end gap-3 py-3",children:[e.jsx(k,{className:"max-w-sm","aria-label":"Search collection",placeholder:"Search records…",value:o,onChange:r=>i(r.target.value)}),t.ui.filters.map(r=>{const d=[...new Set(t.records.map(l=>m(l.fields[r])).filter(Boolean))].sort();return e.jsxs("label",{className:"grid gap-1 text-sm",children:[r,e.jsxs(I,{value:s[r]?`value:${s[r]}`:"all",onValueChange:l=>c(g=>({...g,[r]:l==="all"?"":l.slice(6)})),children:[e.jsx(L,{"aria-label":`Filter ${r}`,children:e.jsx(A,{})}),e.jsxs(P,{children:[e.jsx(f,{value:"all",children:"All"}),d.map(l=>e.jsx(f,{value:`value:${l}`,children:l},l))]})]})]},r)})]})]})]})]})]}),t.diagnostics.length?e.jsx("ul",{role:"alert",className:"text-destructive text-sm",children:t.diagnostics.map((r,d)=>e.jsx("li",{children:r.message},d))}):null,e.jsx(N,{className:"landing-collection-records",items:u,empty:e.jsx("p",{className:"landing-empty",children:t.count?"No matching records.":"No records match this collection’s document patterns."}),getKey:r=>r.id,getHref:r=>`${R(n,r.path.slice(n.length+1))}?collection=${encodeURIComponent(t.id)}`,renderItem:r=>e.jsxs(e.Fragment,{children:[e.jsx(h,{name:t.icon}),e.jsxs("span",{children:[e.jsx("strong",{children:r.title}),e.jsx("small",{children:t.ui.secondaryField?m(r.fields[t.ui.secondaryField]):r.relativePath}),r.validationErrors.length?e.jsxs("small",{className:"text-destructive",title:r.validationErrors.map(d=>`${d.path}: ${d.message}`).join(`
|
|
10
|
-
`),children:[r.validationErrors.length," metadata issues"]}):null]})]})})]})}function ne(){const t=j(),n=`${window.location.origin}${t.href}`,{folder:a,collectionId:o}=q(n),i=b();p.useEffect(()=>{const c=()=>{i.invalidateQueries({queryKey:["collection",a]})},u=x("kennel:metadata-changed",c),r=x("kennel:workspace-changed",c);return()=>{u(),r()}},[i,a]);const s=v({queryKey:["collection",a,o],enabled:!!(a&&o),queryFn:({signal:c})=>y.metadata(n,"collections",{id:o,signal:c})});return s.error?e.jsxs("p",{role:"alert",children:["Could not load collection: ",s.error.message]}):s.data?e.jsx(Q,{folder:s.data.folder,collection:s.data.collection,refreshing:s.isFetching},`${a}:${o}`):e.jsx("p",{role:"status",children:"Loading collection…"})}export{ne as CollectionPage,Q as CollectionView};
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import{r as s,j as m,i as Ke,c as gt,t as ht}from"./react-DZzLHL-l.js";import{R as Et,h as yt}from"./index-eL1k96k8.js";import{c as M}from"./utils-CwHGE3BB.js";import{X as bt}from"./x-BUeE--I4.js";import{D as xt,a as Ct,b as Dt,c as wt,d as Rt,e as St,f as Nt,g as Pt,S as It}from"./index-kY75qc96.js";var Ae=1,Ot=.9,At=.8,_t=.17,me=.1,pe=.999,kt=.9999,Tt=.99,Mt=/[\\\/_+.#"@\[\(\{&]/,Ft=/[\\\/_+.#"@\[\(\{&]/g,jt=/[\s-]/,Be=/[\s-]/g;function ye(e,t,n,o,r,a,c){if(a===t.length)return r===e.length?Ae:Tt;var i=`${r},${a}`;if(c[i]!==void 0)return c[i];for(var f=o.charAt(a),l=n.indexOf(f,r),d=0,p,y,h,R;l>=0;)p=ye(e,t,n,o,l+1,a+1,c),p>d&&(l===r?p*=Ae:Mt.test(e.charAt(l-1))?(p*=At,h=e.slice(r,l-1).match(Ft),h&&r>0&&(p*=Math.pow(pe,h.length))):jt.test(e.charAt(l-1))?(p*=Ot,R=e.slice(r,l-1).match(Be),R&&r>0&&(p*=Math.pow(pe,R.length))):(p*=_t,r>0&&(p*=Math.pow(pe,l-r))),e.charAt(l)!==t.charAt(a)&&(p*=kt)),(p<me&&n.charAt(l-1)===o.charAt(a+1)||o.charAt(a+1)===o.charAt(a)&&n.charAt(l-1)!==o.charAt(a))&&(y=ye(e,t,n,o,l+1,a+2,c),y*me>p&&(p=y*me)),p>d&&(d=p),l=n.indexOf(f,l+1);return c[i]=d,d}function _e(e){return e.toLowerCase().replace(Be," ")}function Lt(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,ye(e,t,_e(e),_e(t),0,0,{})}function W(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function ke(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function B(...e){return t=>{let n=!1;const o=e.map(r=>{const a=ke(r,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let r=0;r<o.length;r++){const a=o[r];typeof a=="function"?a():ke(e[r],null)}}}}function H(...e){return s.useCallback(B(...e),e)}function $t(e,t){const n=s.createContext(t),o=a=>{const{children:c,...i}=a,f=s.useMemo(()=>i,Object.values(i));return m.jsx(n.Provider,{value:f,children:c})};o.displayName=e+"Provider";function r(a){const c=s.useContext(n);if(c)return c;if(t!==void 0)return t;throw new Error(`\`${a}\` must be used within \`${e}\``)}return[o,r]}function Wt(e,t=[]){let n=[];function o(a,c){const i=s.createContext(c),f=n.length;n=[...n,c];const l=p=>{const{scope:y,children:h,...R}=p,x=y?.[e]?.[f]||i,S=s.useMemo(()=>R,Object.values(R));return m.jsx(x.Provider,{value:S,children:h})};l.displayName=a+"Provider";function d(p,y){const h=y?.[e]?.[f]||i,R=s.useContext(h);if(R)return R;if(c!==void 0)return c;throw new Error(`\`${p}\` must be used within \`${a}\``)}return[l,d]}const r=()=>{const a=n.map(c=>s.createContext(c));return function(i){const f=i?.[e]||a;return s.useMemo(()=>({[`__scope${e}`]:{...i,[e]:f}}),[i,f])}};return r.scopeName=e,[o,Ut(r,...t)]}function Ut(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(a){const c=o.reduce((i,{useScope:f,scopeName:l})=>{const p=f(a)[`__scope${l}`];return{...i,...p}},{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:c}),[c])}};return n.scopeName=t.scopeName,n}var ee=globalThis?.document?s.useLayoutEffect:()=>{},Kt=Ke[" useId ".trim().toString()]||(()=>{}),Bt=0;function j(e){const[t,n]=s.useState(Kt());return ee(()=>{n(o=>o??String(Bt++))},[e]),t?`radix-${t}`:""}var Vt=Ke[" useInsertionEffect ".trim().toString()]||ee;function zt({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[r,a,c]=Ht({defaultProp:t,onChange:n}),i=e!==void 0,f=i?e:r;{const d=s.useRef(e!==void 0);s.useEffect(()=>{const p=d.current;p!==i&&console.warn(`${o} is changing from ${p?"controlled":"uncontrolled"} to ${i?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),d.current=i},[i,o])}const l=s.useCallback(d=>{if(i){const p=Gt(d)?d(e):d;p!==e&&c.current?.(p)}else a(d)},[i,e,a,c]);return[f,l]}function Ht({defaultProp:e,onChange:t}){const[n,o]=s.useState(e),r=s.useRef(n),a=s.useRef(t);return Vt(()=>{a.current=t},[t]),s.useEffect(()=>{r.current!==n&&(a.current?.(n),r.current=n)},[n,r]),[n,o,a]}function Gt(e){return typeof e=="function"}function Ve(e){const t=qt(e),n=s.forwardRef((o,r)=>{const{children:a,...c}=o,i=s.Children.toArray(a),f=i.find(Yt);if(f){const l=f.props.children,d=i.map(p=>p===f?s.Children.count(l)>1?s.Children.only(null):s.isValidElement(l)?l.props.children:null:p);return m.jsx(t,{...c,ref:r,children:s.isValidElement(l)?s.cloneElement(l,void 0,d):null})}return m.jsx(t,{...c,ref:r,children:a})});return n.displayName=`${e}.Slot`,n}function qt(e){const t=s.forwardRef((n,o)=>{const{children:r,...a}=n;if(s.isValidElement(r)){const c=Jt(r),i=Zt(a,r.props);return r.type!==s.Fragment&&(i.ref=o?B(o,c):c),s.cloneElement(r,i)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Xt=Symbol("radix.slottable");function Yt(e){return s.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Xt}function Zt(e,t){const n={...t};for(const o in t){const r=e[o],a=t[o];/^on[A-Z]/.test(o)?r&&a?n[o]=(...i)=>{const f=a(...i);return r(...i),f}:r&&(n[o]=r):o==="style"?n[o]={...r,...a}:o==="className"&&(n[o]=[r,a].filter(Boolean).join(" "))}return{...e,...n}}function Jt(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var Qt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],I=Qt.reduce((e,t)=>{const n=Ve(`Primitive.${t}`),o=s.forwardRef((r,a)=>{const{asChild:c,...i}=r,f=c?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),m.jsx(f,{...i,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function en(e,t){e&>.flushSync(()=>e.dispatchEvent(t))}function te(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...n)=>t.current?.(...n),[])}function tn(e,t=globalThis?.document){const n=te(e);s.useEffect(()=>{const o=r=>{r.key==="Escape"&&n(r)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var nn="DismissableLayer",be="dismissableLayer.update",rn="dismissableLayer.pointerDownOutside",on="dismissableLayer.focusOutside",Te,ze=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),He=s.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:r,onFocusOutside:a,onInteractOutside:c,onDismiss:i,...f}=e,l=s.useContext(ze),[d,p]=s.useState(null),y=d?.ownerDocument??globalThis?.document,[,h]=s.useState({}),R=H(t,E=>p(E)),x=Array.from(l.layers),[S]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),N=x.indexOf(S),k=d?x.indexOf(d):-1,A=l.layersWithOutsidePointerEventsDisabled.size>0,P=k>=N,T=ln(E=>{const L=E.target,Z=[...l.branches].some(K=>K.contains(L));!P||Z||(r?.(E),c?.(E),E.defaultPrevented||i?.())},y),D=cn(E=>{const L=E.target;[...l.branches].some(K=>K.contains(L))||(a?.(E),c?.(E),E.defaultPrevented||i?.())},y);return tn(E=>{k===l.layers.size-1&&(o?.(E),!E.defaultPrevented&&i&&(E.preventDefault(),i()))},y),s.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Te=y.body.style.pointerEvents,y.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),Me(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(y.body.style.pointerEvents=Te)}},[d,y,n,l]),s.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),Me())},[d,l]),s.useEffect(()=>{const E=()=>h({});return document.addEventListener(be,E),()=>document.removeEventListener(be,E)},[]),m.jsx(I.div,{...f,ref:R,style:{pointerEvents:A?P?"auto":"none":void 0,...e.style},onFocusCapture:W(e.onFocusCapture,D.onFocusCapture),onBlurCapture:W(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:W(e.onPointerDownCapture,T.onPointerDownCapture)})});He.displayName=nn;var sn="DismissableLayerBranch",an=s.forwardRef((e,t)=>{const n=s.useContext(ze),o=s.useRef(null),r=H(t,o);return s.useEffect(()=>{const a=o.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),m.jsx(I.div,{...e,ref:r})});an.displayName=sn;function ln(e,t=globalThis?.document){const n=te(e),o=s.useRef(!1),r=s.useRef(()=>{});return s.useEffect(()=>{const a=i=>{if(i.target&&!o.current){let f=function(){Ge(rn,n,l,{discrete:!0})};const l={originalEvent:i};i.pointerType==="touch"?(t.removeEventListener("click",r.current),r.current=f,t.addEventListener("click",r.current,{once:!0})):f()}else t.removeEventListener("click",r.current);o.current=!1},c=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(c),t.removeEventListener("pointerdown",a),t.removeEventListener("click",r.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function cn(e,t=globalThis?.document){const n=te(e),o=s.useRef(!1);return s.useEffect(()=>{const r=a=>{a.target&&!o.current&&Ge(on,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",r),()=>t.removeEventListener("focusin",r)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Me(){const e=new CustomEvent(be);document.dispatchEvent(e)}function Ge(e,t,n,{discrete:o}){const r=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&r.addEventListener(e,t,{once:!0}),o?en(r,a):r.dispatchEvent(a)}var ve="focusScope.autoFocusOnMount",ge="focusScope.autoFocusOnUnmount",Fe={bubbles:!1,cancelable:!0},un="FocusScope",qe=s.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:r,onUnmountAutoFocus:a,...c}=e,[i,f]=s.useState(null),l=te(r),d=te(a),p=s.useRef(null),y=H(t,x=>f(x)),h=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let x=function(A){if(h.paused||!i)return;const P=A.target;i.contains(P)?p.current=P:$(p.current,{select:!0})},S=function(A){if(h.paused||!i)return;const P=A.relatedTarget;P!==null&&(i.contains(P)||$(p.current,{select:!0}))},N=function(A){if(document.activeElement===document.body)for(const T of A)T.removedNodes.length>0&&$(i)};document.addEventListener("focusin",x),document.addEventListener("focusout",S);const k=new MutationObserver(N);return i&&k.observe(i,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",x),document.removeEventListener("focusout",S),k.disconnect()}}},[o,i,h.paused]),s.useEffect(()=>{if(i){Le.add(h);const x=document.activeElement;if(!i.contains(x)){const N=new CustomEvent(ve,Fe);i.addEventListener(ve,l),i.dispatchEvent(N),N.defaultPrevented||(dn(gn(Xe(i)),{select:!0}),document.activeElement===x&&$(i))}return()=>{i.removeEventListener(ve,l),setTimeout(()=>{const N=new CustomEvent(ge,Fe);i.addEventListener(ge,d),i.dispatchEvent(N),N.defaultPrevented||$(x??document.body,{select:!0}),i.removeEventListener(ge,d),Le.remove(h)},0)}}},[i,l,d,h]);const R=s.useCallback(x=>{if(!n&&!o||h.paused)return;const S=x.key==="Tab"&&!x.altKey&&!x.ctrlKey&&!x.metaKey,N=document.activeElement;if(S&&N){const k=x.currentTarget,[A,P]=fn(k);A&&P?!x.shiftKey&&N===P?(x.preventDefault(),n&&$(A,{select:!0})):x.shiftKey&&N===A&&(x.preventDefault(),n&&$(P,{select:!0})):N===k&&x.preventDefault()}},[n,o,h.paused]);return m.jsx(I.div,{tabIndex:-1,...c,ref:y,onKeyDown:R})});qe.displayName=un;function dn(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if($(o,{select:t}),document.activeElement!==n)return}function fn(e){const t=Xe(e),n=je(t,e),o=je(t.reverse(),e);return[n,o]}function Xe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const r=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||r?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function je(e,t){for(const n of e)if(!mn(n,{upTo:t}))return n}function mn(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function pn(e){return e instanceof HTMLInputElement&&"select"in e}function $(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&pn(e)&&t&&e.select()}}var Le=vn();function vn(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=$e(e,t),e.unshift(t)},remove(t){e=$e(e,t),e[0]?.resume()}}}function $e(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function gn(e){return e.filter(t=>t.tagName!=="A")}var hn="Portal",Ye=s.forwardRef((e,t)=>{const{container:n,...o}=e,[r,a]=s.useState(!1);ee(()=>a(!0),[]);const c=n||r&&globalThis?.document?.body;return c?ht.createPortal(m.jsx(I.div,{...o,ref:t}),c):null});Ye.displayName=hn;function En(e,t){return s.useReducer((n,o)=>t[n][o]??n,e)}var ae=e=>{const{present:t,children:n}=e,o=yn(t),r=typeof n=="function"?n({present:o.isPresent}):s.Children.only(n),a=H(o.ref,bn(r));return typeof n=="function"||o.isPresent?s.cloneElement(r,{ref:a}):null};ae.displayName="Presence";function yn(e){const[t,n]=s.useState(),o=s.useRef(null),r=s.useRef(e),a=s.useRef("none"),c=e?"mounted":"unmounted",[i,f]=En(c,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const l=oe(o.current);a.current=i==="mounted"?l:"none"},[i]),ee(()=>{const l=o.current,d=r.current;if(d!==e){const y=a.current,h=oe(l);e?f("MOUNT"):h==="none"||l?.display==="none"?f("UNMOUNT"):f(d&&y!==h?"ANIMATION_OUT":"UNMOUNT"),r.current=e}},[e,f]),ee(()=>{if(t){let l;const d=t.ownerDocument.defaultView??window,p=h=>{const x=oe(o.current).includes(CSS.escape(h.animationName));if(h.target===t&&x&&(f("ANIMATION_END"),!r.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",l=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},y=h=>{h.target===t&&(a.current=oe(o.current))};return t.addEventListener("animationstart",y),t.addEventListener("animationcancel",p),t.addEventListener("animationend",p),()=>{d.clearTimeout(l),t.removeEventListener("animationstart",y),t.removeEventListener("animationcancel",p),t.removeEventListener("animationend",p)}}else f("ANIMATION_END")},[t,f]),{isPresent:["mounted","unmountSuspended"].includes(i),ref:s.useCallback(l=>{o.current=l?getComputedStyle(l):null,n(l)},[])}}function oe(e){return e?.animationName||"none"}function bn(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var he=0;function xn(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??We()),document.body.insertAdjacentElement("beforeend",e[1]??We()),he++,()=>{he===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),he--}},[])}function We(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var ie="Dialog",[Ze]=Wt(ie),[Cn,F]=Ze(ie),Je=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:r,onOpenChange:a,modal:c=!0}=e,i=s.useRef(null),f=s.useRef(null),[l,d]=zt({prop:o,defaultProp:r??!1,onChange:a,caller:ie});return m.jsx(Cn,{scope:t,triggerRef:i,contentRef:f,contentId:j(),titleId:j(),descriptionId:j(),open:l,onOpenChange:d,onOpenToggle:s.useCallback(()=>d(p=>!p),[d]),modal:c,children:n})};Je.displayName=ie;var Qe="DialogTrigger",Dn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=F(Qe,n),a=H(t,r.triggerRef);return m.jsx(I.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":we(r.open),...o,ref:a,onClick:W(e.onClick,r.onOpenToggle)})});Dn.displayName=Qe;var Ce="DialogPortal",[wn,et]=Ze(Ce,{forceMount:void 0}),tt=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:r}=e,a=F(Ce,t);return m.jsx(wn,{scope:t,forceMount:n,children:s.Children.map(o,c=>m.jsx(ae,{present:n||a.open,children:m.jsx(Ye,{asChild:!0,container:r,children:c})}))})};tt.displayName=Ce;var se="DialogOverlay",nt=s.forwardRef((e,t)=>{const n=et(se,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=F(se,e.__scopeDialog);return a.modal?m.jsx(ae,{present:o||a.open,children:m.jsx(Sn,{...r,ref:t})}):null});nt.displayName=se;var Rn=Ve("DialogOverlay.RemoveScroll"),Sn=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=F(se,n);return m.jsx(Et,{as:Rn,allowPinchZoom:!0,shards:[r.contentRef],children:m.jsx(I.div,{"data-state":we(r.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),V="DialogContent",rt=s.forwardRef((e,t)=>{const n=et(V,e.__scopeDialog),{forceMount:o=n.forceMount,...r}=e,a=F(V,e.__scopeDialog);return m.jsx(ae,{present:o||a.open,children:a.modal?m.jsx(Nn,{...r,ref:t}):m.jsx(Pn,{...r,ref:t})})});rt.displayName=V;var Nn=s.forwardRef((e,t)=>{const n=F(V,e.__scopeDialog),o=s.useRef(null),r=H(t,n.contentRef,o);return s.useEffect(()=>{const a=o.current;if(a)return yt(a)},[]),m.jsx(ot,{...e,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(e.onCloseAutoFocus,a=>{a.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:W(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,i=c.button===0&&c.ctrlKey===!0;(c.button===2||i)&&a.preventDefault()}),onFocusOutside:W(e.onFocusOutside,a=>a.preventDefault())})}),Pn=s.forwardRef((e,t)=>{const n=F(V,e.__scopeDialog),o=s.useRef(!1),r=s.useRef(!1);return m.jsx(ot,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(o.current||n.triggerRef.current?.focus(),a.preventDefault()),o.current=!1,r.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(o.current=!0,a.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const c=a.target;n.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&r.current&&a.preventDefault()}})}),ot=s.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:r,onCloseAutoFocus:a,...c}=e,i=F(V,n),f=s.useRef(null),l=H(t,f);return xn(),m.jsxs(m.Fragment,{children:[m.jsx(qe,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:r,onUnmountAutoFocus:a,children:m.jsx(He,{role:"dialog",id:i.contentId,"aria-describedby":i.descriptionId,"aria-labelledby":i.titleId,"data-state":we(i.open),...c,ref:l,onDismiss:()=>i.onOpenChange(!1)})}),m.jsxs(m.Fragment,{children:[m.jsx(_n,{titleId:i.titleId}),m.jsx(Tn,{contentRef:f,descriptionId:i.descriptionId})]})]})}),De="DialogTitle",In=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=F(De,n);return m.jsx(I.h2,{id:r.titleId,...o,ref:t})});In.displayName=De;var st="DialogDescription",On=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=F(st,n);return m.jsx(I.p,{id:r.descriptionId,...o,ref:t})});On.displayName=st;var at="DialogClose",An=s.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,r=F(at,n);return m.jsx(I.button,{type:"button",...o,ref:t,onClick:W(e.onClick,()=>r.onOpenChange(!1))})});An.displayName=at;function we(e){return e?"open":"closed"}var it="DialogTitleWarning",[mr,lt]=$t(it,{contentName:V,titleName:De,docsSlug:"dialog"}),_n=({titleId:e})=>{const t=lt(it),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
2
|
-
|
|
3
|
-
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
4
|
-
|
|
5
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},kn="DialogDescriptionWarning",Tn=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${lt(kn).contentName}}.`;return s.useEffect(()=>{const r=e.current?.getAttribute("aria-describedby");t&&r&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Mn=Je,Fn=tt,jn=nt,Ln=rt,Q='[cmdk-group=""]',Ee='[cmdk-group-items=""]',$n='[cmdk-group-heading=""]',ct='[cmdk-item=""]',Ue=`${ct}:not([aria-disabled="true"])`,xe="cmdk-item-select",q="data-value",Wn=(e,t,n)=>Lt(e,t,n),ut=s.createContext(void 0),ne=()=>s.useContext(ut),dt=s.createContext(void 0),Re=()=>s.useContext(dt),ft=s.createContext(void 0),mt=s.forwardRef((e,t)=>{let n=X(()=>{var u,g;return{search:"",value:(g=(u=e.value)!=null?u:e.defaultValue)!=null?g:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),o=X(()=>new Set),r=X(()=>new Map),a=X(()=>new Map),c=X(()=>new Set),i=pt(e),{label:f,children:l,value:d,onValueChange:p,filter:y,shouldFilter:h,loop:R,disablePointerSelection:x=!1,vimBindings:S=!0,...N}=e,k=j(),A=j(),P=j(),T=s.useRef(null),D=Zn();z(()=>{if(d!==void 0){let u=d.trim();n.current.value=u,E.emit()}},[d]),z(()=>{D(6,Se)},[]);let E=s.useMemo(()=>({subscribe:u=>(c.current.add(u),()=>c.current.delete(u)),snapshot:()=>n.current,setState:(u,g,b)=>{var v,C,w,_;if(!Object.is(n.current[u],g)){if(n.current[u]=g,u==="search")ue(),K(),D(1,ce);else if(u==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let O=document.getElementById(P);O?O.focus():(v=document.getElementById(k))==null||v.focus()}if(D(7,()=>{var O;n.current.selectedItemId=(O=G())==null?void 0:O.id,E.emit()}),b||D(5,Se),((C=i.current)==null?void 0:C.value)!==void 0){let O=g??"";(_=(w=i.current).onValueChange)==null||_.call(w,O);return}}E.emit()}},emit:()=>{c.current.forEach(u=>u())}}),[]),L=s.useMemo(()=>({value:(u,g,b)=>{var v;g!==((v=a.current.get(u))==null?void 0:v.value)&&(a.current.set(u,{value:g,keywords:b}),n.current.filtered.items.set(u,Z(g,b)),D(2,()=>{K(),E.emit()}))},item:(u,g)=>(o.current.add(u),g&&(r.current.has(g)?r.current.get(g).add(u):r.current.set(g,new Set([u]))),D(3,()=>{ue(),K(),n.current.value||ce(),E.emit()}),()=>{a.current.delete(u),o.current.delete(u),n.current.filtered.items.delete(u);let b=G();D(4,()=>{ue(),b?.getAttribute("id")===u&&ce(),E.emit()})}),group:u=>(r.current.has(u)||r.current.set(u,new Set),()=>{a.current.delete(u),r.current.delete(u)}),filter:()=>i.current.shouldFilter,label:f||e["aria-label"],getDisablePointerSelection:()=>i.current.disablePointerSelection,listId:k,inputId:P,labelId:A,listInnerRef:T}),[]);function Z(u,g){var b,v;let C=(v=(b=i.current)==null?void 0:b.filter)!=null?v:Wn;return u?C(u,n.current.search,g):0}function K(){if(!n.current.search||i.current.shouldFilter===!1)return;let u=n.current.filtered.items,g=[];n.current.filtered.groups.forEach(v=>{let C=r.current.get(v),w=0;C.forEach(_=>{let O=u.get(_);w=Math.max(O,w)}),g.push([v,w])});let b=T.current;J().sort((v,C)=>{var w,_;let O=v.getAttribute("id"),re=C.getAttribute("id");return((w=u.get(re))!=null?w:0)-((_=u.get(O))!=null?_:0)}).forEach(v=>{let C=v.closest(Ee);C?C.appendChild(v.parentElement===C?v:v.closest(`${Ee} > *`)):b.appendChild(v.parentElement===b?v:v.closest(`${Ee} > *`))}),g.sort((v,C)=>C[1]-v[1]).forEach(v=>{var C;let w=(C=T.current)==null?void 0:C.querySelector(`${Q}[${q}="${encodeURIComponent(v[0])}"]`);w?.parentElement.appendChild(w)})}function ce(){let u=J().find(b=>b.getAttribute("aria-disabled")!=="true"),g=u?.getAttribute(q);E.setState("value",g||void 0)}function ue(){var u,g,b,v;if(!n.current.search||i.current.shouldFilter===!1){n.current.filtered.count=o.current.size;return}n.current.filtered.groups=new Set;let C=0;for(let w of o.current){let _=(g=(u=a.current.get(w))==null?void 0:u.value)!=null?g:"",O=(v=(b=a.current.get(w))==null?void 0:b.keywords)!=null?v:[],re=Z(_,O);n.current.filtered.items.set(w,re),re>0&&C++}for(let[w,_]of r.current)for(let O of _)if(n.current.filtered.items.get(O)>0){n.current.filtered.groups.add(w);break}n.current.filtered.count=C}function Se(){var u,g,b;let v=G();v&&(((u=v.parentElement)==null?void 0:u.firstChild)===v&&((b=(g=v.closest(Q))==null?void 0:g.querySelector($n))==null||b.scrollIntoView({block:"nearest"})),v.scrollIntoView({block:"nearest"}))}function G(){var u;return(u=T.current)==null?void 0:u.querySelector(`${ct}[aria-selected="true"]`)}function J(){var u;return Array.from(((u=T.current)==null?void 0:u.querySelectorAll(Ue))||[])}function de(u){let g=J()[u];g&&E.setState("value",g.getAttribute(q))}function fe(u){var g;let b=G(),v=J(),C=v.findIndex(_=>_===b),w=v[C+u];(g=i.current)!=null&&g.loop&&(w=C+u<0?v[v.length-1]:C+u===v.length?v[0]:v[C+u]),w&&E.setState("value",w.getAttribute(q))}function Ne(u){let g=G(),b=g?.closest(Q),v;for(;b&&!v;)b=u>0?Xn(b,Q):Yn(b,Q),v=b?.querySelector(Ue);v?E.setState("value",v.getAttribute(q)):fe(u)}let Pe=()=>de(J().length-1),Ie=u=>{u.preventDefault(),u.metaKey?Pe():u.altKey?Ne(1):fe(1)},Oe=u=>{u.preventDefault(),u.metaKey?de(0):u.altKey?Ne(-1):fe(-1)};return s.createElement(I.div,{ref:t,tabIndex:-1,...N,"cmdk-root":"",onKeyDown:u=>{var g;(g=N.onKeyDown)==null||g.call(N,u);let b=u.nativeEvent.isComposing||u.keyCode===229;if(!(u.defaultPrevented||b))switch(u.key){case"n":case"j":{S&&u.ctrlKey&&Ie(u);break}case"ArrowDown":{Ie(u);break}case"p":case"k":{S&&u.ctrlKey&&Oe(u);break}case"ArrowUp":{Oe(u);break}case"Home":{u.preventDefault(),de(0);break}case"End":{u.preventDefault(),Pe();break}case"Enter":{u.preventDefault();let v=G();if(v){let C=new Event(xe);v.dispatchEvent(C)}}}}},s.createElement("label",{"cmdk-label":"",htmlFor:L.inputId,id:L.labelId,style:Qn},f),le(e,u=>s.createElement(dt.Provider,{value:E},s.createElement(ut.Provider,{value:L},u))))}),Un=s.forwardRef((e,t)=>{var n,o;let r=j(),a=s.useRef(null),c=s.useContext(ft),i=ne(),f=pt(e),l=(o=(n=f.current)==null?void 0:n.forceMount)!=null?o:c?.forceMount;z(()=>{if(!l)return i.item(r,c?.id)},[l]);let d=vt(r,a,[e.value,e.children,a],e.keywords),p=Re(),y=U(D=>D.value&&D.value===d.current),h=U(D=>l||i.filter()===!1?!0:D.search?D.filtered.items.get(r)>0:!0);s.useEffect(()=>{let D=a.current;if(!(!D||e.disabled))return D.addEventListener(xe,R),()=>D.removeEventListener(xe,R)},[h,e.onSelect,e.disabled]);function R(){var D,E;x(),(E=(D=f.current).onSelect)==null||E.call(D,d.current)}function x(){p.setState("value",d.current,!0)}if(!h)return null;let{disabled:S,value:N,onSelect:k,forceMount:A,keywords:P,...T}=e;return s.createElement(I.div,{ref:B(a,t),...T,id:r,"cmdk-item":"",role:"option","aria-disabled":!!S,"aria-selected":!!y,"data-disabled":!!S,"data-selected":!!y,onPointerMove:S||i.getDisablePointerSelection()?void 0:x,onClick:S?void 0:R},e.children)}),Kn=s.forwardRef((e,t)=>{let{heading:n,children:o,forceMount:r,...a}=e,c=j(),i=s.useRef(null),f=s.useRef(null),l=j(),d=ne(),p=U(h=>r||d.filter()===!1?!0:h.search?h.filtered.groups.has(c):!0);z(()=>d.group(c),[]),vt(c,i,[e.value,e.heading,f]);let y=s.useMemo(()=>({id:c,forceMount:r}),[r]);return s.createElement(I.div,{ref:B(i,t),...a,"cmdk-group":"",role:"presentation",hidden:p?void 0:!0},n&&s.createElement("div",{ref:f,"cmdk-group-heading":"","aria-hidden":!0,id:l},n),le(e,h=>s.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?l:void 0},s.createElement(ft.Provider,{value:y},h))))}),Bn=s.forwardRef((e,t)=>{let{alwaysRender:n,...o}=e,r=s.useRef(null),a=U(c=>!c.search);return!n&&!a?null:s.createElement(I.div,{ref:B(r,t),...o,"cmdk-separator":"",role:"separator"})}),Vn=s.forwardRef((e,t)=>{let{onValueChange:n,...o}=e,r=e.value!=null,a=Re(),c=U(l=>l.search),i=U(l=>l.selectedItemId),f=ne();return s.useEffect(()=>{e.value!=null&&a.setState("search",e.value)},[e.value]),s.createElement(I.input,{ref:t,...o,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":f.listId,"aria-labelledby":f.labelId,"aria-activedescendant":i,id:f.inputId,type:"text",value:r?e.value:c,onChange:l=>{r||a.setState("search",l.target.value),n?.(l.target.value)}})}),zn=s.forwardRef((e,t)=>{let{children:n,label:o="Suggestions",...r}=e,a=s.useRef(null),c=s.useRef(null),i=U(l=>l.selectedItemId),f=ne();return s.useEffect(()=>{if(c.current&&a.current){let l=c.current,d=a.current,p,y=new ResizeObserver(()=>{p=requestAnimationFrame(()=>{let h=l.offsetHeight;d.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return y.observe(l),()=>{cancelAnimationFrame(p),y.unobserve(l)}}},[]),s.createElement(I.div,{ref:B(a,t),...r,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":i,"aria-label":o,id:f.listId},le(e,l=>s.createElement("div",{ref:B(c,f.listInnerRef),"cmdk-list-sizer":""},l)))}),Hn=s.forwardRef((e,t)=>{let{open:n,onOpenChange:o,overlayClassName:r,contentClassName:a,container:c,...i}=e;return s.createElement(Mn,{open:n,onOpenChange:o},s.createElement(Fn,{container:c},s.createElement(jn,{"cmdk-overlay":"",className:r}),s.createElement(Ln,{"aria-label":e.label,"cmdk-dialog":"",className:a},s.createElement(mt,{ref:t,...i}))))}),Gn=s.forwardRef((e,t)=>U(n=>n.filtered.count===0)?s.createElement(I.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),qn=s.forwardRef((e,t)=>{let{progress:n,children:o,label:r="Loading...",...a}=e;return s.createElement(I.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r},le(e,c=>s.createElement("div",{"aria-hidden":!0},c)))}),Y=Object.assign(mt,{List:zn,Item:Un,Input:Vn,Group:Kn,Separator:Bn,Dialog:Hn,Empty:Gn,Loading:qn});function Xn(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function Yn(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function pt(e){let t=s.useRef(e);return z(()=>{t.current=e}),t}var z=typeof window>"u"?s.useEffect:s.useLayoutEffect;function X(e){let t=s.useRef();return t.current===void 0&&(t.current=e()),t}function U(e){let t=Re(),n=()=>e(t.snapshot());return s.useSyncExternalStore(t.subscribe,n,n)}function vt(e,t,n,o=[]){let r=s.useRef(),a=ne();return z(()=>{var c;let i=(()=>{var l;for(let d of n){if(typeof d=="string")return d.trim();if(typeof d=="object"&&"current"in d)return d.current?(l=d.current.textContent)==null?void 0:l.trim():r.current}})(),f=o.map(l=>l.trim());a.value(e,i,f),(c=t.current)==null||c.setAttribute(q,i),r.current=i}),r}var Zn=()=>{let[e,t]=s.useState(),n=X(()=>new Map);return z(()=>{n.current.forEach(o=>o()),n.current=new Map},[e]),(o,r)=>{n.current.set(o,r),t({})}};function Jn(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function le({asChild:e,children:t},n){return e&&s.isValidElement(t)?s.cloneElement(Jn(t),{ref:t.ref},n(t.props.children)):n(t)}var Qn={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function er({...e}){return m.jsx(xt,{"data-slot":"dialog",...e})}function pr({...e}){return m.jsx(Pt,{"data-slot":"dialog-trigger",...e})}function tr({...e}){return m.jsx(St,{"data-slot":"dialog-portal",...e})}function nr({className:e,...t}){return m.jsx(Nt,{"data-slot":"dialog-overlay",className:M(`data-[state=open]:animate-in data-[state=closed]:animate-out
|
|
6
|
-
data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0
|
|
7
|
-
z-50 bg-black/50`,e),...t})}function rr({className:e,children:t,showCloseButton:n=!0,...o}){return m.jsxs(tr,{"data-slot":"dialog-portal",children:[m.jsx(nr,{}),m.jsxs(wt,{"data-slot":"dialog-content",className:M(`bg-background data-[state=open]:animate-in
|
|
8
|
-
data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
9
|
-
data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95
|
|
10
|
-
data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid
|
|
11
|
-
w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%]
|
|
12
|
-
gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none
|
|
13
|
-
sm:max-w-lg`,e),...o,children:[t,n&&m.jsxs(Rt,{"data-slot":"dialog-close",className:`ring-offset-background focus:ring-ring
|
|
14
|
-
data-[state=open]:bg-accent
|
|
15
|
-
data-[state=open]:text-muted-foreground absolute top-4 right-4
|
|
16
|
-
rounded-xs opacity-70 transition-opacity hover:opacity-100
|
|
17
|
-
focus:ring-2 focus:ring-offset-2 focus:outline-hidden
|
|
18
|
-
disabled:pointer-events-none [&_svg]:pointer-events-none
|
|
19
|
-
[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[m.jsx(bt,{}),m.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function or({className:e,...t}){return m.jsx("div",{"data-slot":"dialog-header",className:M("flex flex-col gap-2 text-center sm:text-left",e),...t})}function sr({className:e,...t}){return m.jsx(Ct,{"data-slot":"dialog-title",className:M("text-lg leading-none font-semibold",e),...t})}function ar({className:e,...t}){return m.jsx(Dt,{"data-slot":"dialog-description",className:M("text-muted-foreground text-sm",e),...t})}function ir({className:e,...t}){return m.jsx(Y,{"data-slot":"command",className:M(`bg-popover text-popover-foreground flex h-full w-full flex-col
|
|
20
|
-
overflow-hidden rounded-md`,e),...t})}function vr({title:e="Command Palette",description:t="Search for a command to run...",children:n,className:o,showCloseButton:r=!0,...a}){return m.jsxs(er,{...a,children:[m.jsxs(or,{className:"sr-only",children:[m.jsx(sr,{children:e}),m.jsx(ar,{children:t})]}),m.jsx(rr,{className:M("overflow-hidden p-0",o),showCloseButton:r,children:m.jsx(ir,{className:`[&_[cmdk-group-heading]]:text-muted-foreground
|
|
21
|
-
**:data-[slot=command-input-wrapper]:h-12
|
|
22
|
-
[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium
|
|
23
|
-
[&_[cmdk-group]]:px-2
|
|
24
|
-
[&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0
|
|
25
|
-
[&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5
|
|
26
|
-
[&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3
|
|
27
|
-
[&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5`,children:n})})]})}function gr({className:e,...t}){return m.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[m.jsx(It,{className:"size-4 shrink-0 opacity-50"}),m.jsx(Y.Input,{"data-slot":"command-input",className:M(`placeholder:text-muted-foreground flex h-10 w-full rounded-md
|
|
28
|
-
bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed
|
|
29
|
-
disabled:opacity-50`,e),...t})]})}function hr({className:e,...t}){return m.jsx(Y.List,{"data-slot":"command-list",className:M("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...t})}function Er({...e}){return m.jsx(Y.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function yr({className:e,...t}){return m.jsx(Y.Group,{"data-slot":"command-group",className:M(`text-foreground [&_[cmdk-group-heading]]:text-muted-foreground
|
|
30
|
-
overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2
|
|
31
|
-
[&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs
|
|
32
|
-
[&_[cmdk-group-heading]]:font-medium`,e),...t})}function br({className:e,...t}){return m.jsx(Y.Item,{"data-slot":"command-item",className:M(`data-[selected=true]:bg-accent
|
|
33
|
-
data-[selected=true]:text-accent-foreground
|
|
34
|
-
[&_svg:not([class*='text-'])]:text-muted-foreground relative flex
|
|
35
|
-
cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm
|
|
36
|
-
outline-hidden select-none data-[disabled=true]:pointer-events-none
|
|
37
|
-
data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none
|
|
38
|
-
[&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...t})}export{vr as C,er as D,gr as a,hr as b,Er as c,yr as d,br as e,ir as f,pr as g,rr as h,or as i,sr as j,ar as k};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c}from"./view-context-D-fh9AbH.js";const e=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],t=c("copy",e);export{t as C};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as u,r as c}from"./react-DZzLHL-l.js";import{B as y,C as f}from"./button-BJ7z-ZA7.js";import{t as d}from"./view-context-D-fh9AbH.js";import{C}from"./copy-Ikmr6Iq2.js";const x=async e=>{if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.left="-9999px",t.style.top="0",document.body.appendChild(t),t.select();try{return document.execCommand("copy")}finally{document.body.removeChild(t)}},w=(e,t={})=>{const{copiedMs:o=1400}=t,[i,a]=c.useState(!1),s=c.useRef(void 0);c.useEffect(()=>()=>window.clearTimeout(s.current),[]);const n=c.useCallback(async()=>{const p=typeof e=="function"?await e():e,r=await x(p);return window.clearTimeout(s.current),a(r),r&&(s.current=window.setTimeout(()=>a(!1),o)),r},[e,o]);return{copied:i,copy:n}};function v({className:e,context:t,label:o="Copy context",notify:i=!0,onCopied:a,onFailed:s,size:n="icon-xs",variant:p="ghost"}){const{copied:r,copy:l}=w(t);return u.jsx(y,{type:"button",variant:p,size:n,className:e,"aria-label":o,title:o,onClick:()=>{l().then(m=>{m?(i&&d.success("Copied"),a?.()):(i&&d.error("Could not copy"),s?.())})},children:r?u.jsx(f,{className:"size-3.5 text-emerald-600"}):u.jsx(C,{className:"size-3.5"})})}export{v as C,x as c};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/file-renderer-BRZTrYx8.js","assets/index-DztTMDFz.js","assets/react-DZzLHL-l.js","assets/markdown-njUwQKsR.js","assets/index-DS2Wmd9I.css","assets/link-DC_1Z6Yy.js","assets/ask-tray-D2YHtbPj.js","assets/button-BJ7z-ZA7.js","assets/view-context-D-fh9AbH.js","assets/tanstack-CD46mJkU.js","assets/utils-CwHGE3BB.js","assets/chevron-down-C5oRtqbX.js","assets/chevron-up-DjpU6Pyv.js","assets/x-BUeE--I4.js","assets/copy-Ikmr6Iq2.js","assets/linked-session-header-DJYWZ_-q.js","assets/folder-activity-Cv1X2ezj.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{p as B,a as te,f as oe,b as g,c as V,_}from"./index-DztTMDFz.js";import{j as t,r as d}from"./react-DZzLHL-l.js";import{u as re,Q as ie}from"./tanstack-CD46mJkU.js";import{j as ae,r as se,c as f,t as h,a as ce,e as le,q as de,T as ue,u as pe,b as me,V as he,l as fe,o as we}from"./view-context-D-fh9AbH.js";import{V as ke}from"./app-options-XEWvevsz.js";import{m as ye}from"./markdown-title-dncAYYiP.js";import{A as ge}from"./app-view-header-BKZ90ToF.js";import{F as U}from"./file-text-CiiSsCDq.js";import{u as xe}from"./viewer-capabilities-CROIaoqh.js";import{A as be}from"./arrow-left-CFeHb-Z1.js";import{X as ve}from"./x-BUeE--I4.js";import{F as je,S as Ae}from"./sparkles-CBhGREdc.js";import{P as Se}from"./pencil-8cobiSSq.js";import"./markdown-njUwQKsR.js";import"./copy-context-Cl1TE2PJ.js";import"./button-BJ7z-ZA7.js";import"./utils-CwHGE3BB.js";import"./copy-Ikmr6Iq2.js";import"./index-eL1k96k8.js";import"./index-DmrKjrlM.js";import"./index-p38i_yyY.js";import"./collection-icon-TbOVyORG.js";import"./calendar-days-DWh2XMO2.js";import"./folder-image-AXBrHUcU.js";import"./popover-Cmmgj-MJ.js";import"./chevron-down-C5oRtqbX.js";async function _e(n,e){if(!e.ok)throw await ae(e);if(!e.headers.get("content-type")?.includes("application/json"))throw new Error("The server returned a non-JSON response.");return n.parse(await e.json())}const Re=n=>_e(se.document.response,n);const Ee=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Le=f("arrow-right",Ee);const Pe=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],qe=f("download",Pe);const Te=[["path",{d:"m9 11-6 6v3h9l3-3",key:"1a3l36"}],["path",{d:"m22 12-4.6 4.6a2 2 0 0 1-2.8 0l-5.2-5.2a2 2 0 0 1 0-2.8L14 4",key:"14a9rk"}]],Ce=f("highlighter",Te);const De=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]],Oe=f("link",De);const $e=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],N=f("share-2",$e);function S(n){const e=()=>h.success("Copied to clipboard"),r=()=>{const i=document.createElement("textarea");i.value=n,i.style.cssText="position:fixed;opacity:0",document.body.append(i),i.select();const c=document.execCommand("copy");if(i.remove(),!c)return h.error("Could not copy path");e()};if(!navigator.clipboard)return r();navigator.clipboard.writeText(n).then(e,r)}function W(n){return new URL(n,window.location.origin).searchParams}async function He(n,e){return ce.document(n,e)}function Me(n){if(n.rawUrl)return`${n.rawUrl}${n.rawUrl.includes("?")?"&":"?"}download=1`;if(n.root){const e=new URL("/api/raw",window.location.origin);return e.searchParams.set("path",n.root),e.searchParams.set("file",n.path),e.searchParams.set("download","1"),`${e.pathname}${e.search}`}}function F(n){try{const e=new URL(n);return e.username||e.password||e.protocol!=="https:"&&e.protocol!=="http:"||e.protocol==="http:"&&e.hostname!=="localhost"&&!e.hostname.startsWith("127.")&&e.hostname!=="[::1]"?void 0:e.origin}catch{return}}function Ve(n,e,r){const{panel:i}=B(n);if(!i)return[];const l=new URL(n,"http://127.0.0.1").searchParams.get("host");if(l!==null){const o=F(l);return o?[o]:[]}const p=new Set;for(const o of[e,r]){const m=o?F(o):void 0;m&&p.add(m)}return[...p]}function Ne(n,e){return e.includes(n)}function Fe(n){if(!n||typeof n!="object")return;const e=n;if(e.type==="kennel:close")return{type:"kennel:close"};if(e.type==="kennel:resize")return{type:"kennel:resize"};if(e.type==="kennel:request"&&(e.request==="state"||e.request==="selection"))return{type:"kennel:request",request:e.request}}function Ie(n,e,r){return n===e||n===r}function ze(n){const e=i=>{if(!Ne(i.origin,n.allowedOrigins))return;const c=n.windowRef();if(!c||!Ie(i.source,c.parent,c.opener))return;const l=Fe(i.data);if(l)switch(l.type){case"kennel:close":n.onClose?.();break;case"kennel:resize":n.onResize?.();break;case"kennel:request":n.onRequest?.(l.request);break}},r=n.windowRef();return r?.addEventListener("message",e),n.post({type:"kennel:ready",payload:Q()}),()=>{r?.removeEventListener("message",e)}}function Q(){const n=document.documentElement.scrollWidth||document.documentElement.clientWidth;return{height:document.documentElement.scrollHeight||document.documentElement.clientHeight,url:window.location.href,width:n}}function I(n,e){return{...Q(),...n?{path:n}:{},...e?{title:e}:{}}}function z(n,e){return{text:window.getSelection()?.toString().trim()??"",url:window.location.href,...n?{path:n}:{},...e?{title:e}:{}}}function Be(n){n({type:"kennel:closed"}),window.close()}function Ue({href:n,folder:e,path:r,source:i}){const c=W(n).get("watch")==="1";return re({gcTime:30*6e4,queryKey:["document",e?te(e):"dropped",r],queryFn:async()=>{if(e?.startsWith("/"))return He(n,r);const l=await i.read(),p=l.documents.find(o=>o.path===r);if(!p)throw new Error("Document not found.");return Re(Response.json({...p,root:l.root}))},refetchInterval:c?1500:void 0,staleTime:15e3})}function We(n){const e=le(),r=new URLSearchParams(window.location.search).get("collection");return t.jsx(ge,{folder:e.folder,name:e.document?.title,icon:e.kind==="document"?t.jsx(U,{"aria-hidden":"true"}):void 0,workspace:e.workspace,folderHref:i=>g(i,"notes"),collectionHref:e.folder?i=>V(e.folder,i):void 0,homeHref:e.folder?g(e.folder,"notes"):void 0,page:e.folder&&e.document?{title:e.document.title,href:oe(e.folder,e.document.path)}:void 0,...n,accessory:t.jsxs(t.Fragment,{children:[e.folder&&r?t.jsx("a",{className:"text-sm underline",href:V(e.folder,r),children:"Back to collection"}):null,n.accessory]}),children:e.workspaceError?t.jsx("small",{role:"status",children:"Folder path unavailable."}):null})}const Qe=d.lazy(async()=>({default:(await _(async()=>{const{FileRenderer:n}=await import("./file-renderer-BRZTrYx8.js").then(e=>e.f);return{FileRenderer:n}},__vite__mapDeps([0,1,2,3,4,5]))).FileRenderer})),Ke=d.lazy(async()=>({default:(await _(async()=>{const{AskTray:n}=await import("./ask-tray-D2YHtbPj.js");return{AskTray:n}},__vite__mapDeps([6,2,3,7,8,1,4,9,10,11,12,13,14]))).AskTray})),Je=d.lazy(async()=>({default:(await _(async()=>{const{LinkedSessionHeader:n}=await import("./linked-session-header-DJYWZ_-q.js");return{LinkedSessionHeader:n}},__vite__mapDeps([15,2,3,16,9]))).LinkedSessionHeader}));function Xe({path:n,folder:e,session:r,embedded:i=!1,panel:c=!1}){const l=Ue({href:window.location.href,folder:e,path:n,source:fe}),p=W(window.location.href).get("watch")==="1",o=l.data,m=d.useMemo(()=>o?.kind==="markdown"?ye(o.content):{body:o?.content??"",entries:[],lineOffset:0,title:void 0},[o]),u=d.useMemo(()=>({path:n,title:m.title??n.split("/").at(-1)??n}),[n,m.title]),{enabled:x,setEnabled:R}=pe(),{draft:E}=me(e??""),[L,P]=d.useState(!1),[K,b]=d.useState(!1),v=xe().data,j=!!e?.startsWith("/"),q=v?.hostActions==="local",T=v?.acp===!0,A=T&&j&&!!(o&&o.kind!=="html"&&o.content),C=o?.root?`${o.root.replace(/\/+$/,"")}/${o.path}`:n,J=()=>{const a=window.location.href,s=()=>S(a);if(!navigator.share){s();return}navigator.share({title:u.title,text:`${u.title} — Kennel preview`,url:a}).catch(k=>{k instanceof DOMException&&k.name==="AbortError"||s()})},X=()=>{const a=o?Me(o):void 0;if(!a||!o){h.error("This preview cannot be downloaded");return}const s=window.document.createElement("a");s.href=a,s.download=o.path.split("/").at(-1)??"download",window.document.body.append(s),s.click(),s.remove()},D=A&&o?.kind==="markdown"?{kind:"checkbox",id:"selection",label:"AI text selection",icon:t.jsx(Ce,{"aria-hidden":"true"}),description:"Select text to ask about it",checked:x,run:a=>{R(a),b(!1)}}:null,G=A?[{kind:"separator"},{kind:"label",label:"AI"},{kind:"item",id:"ask",label:"Ask AI…",icon:t.jsx(Ae,{"aria-hidden":"true"}),description:"Ask about this document",run:()=>{P(!0),b(!1)}},...D?[D]:[],{kind:"separator"}]:[],O=v?.download!==!1?{kind:"item",id:"download",label:"Download",icon:t.jsx(qe,{"aria-hidden":"true"}),disabled:!o,disabledReason:"This preview cannot be downloaded",run:X}:null,$=q&&e?{kind:"item",id:"folder",label:"Open containing folder",icon:t.jsx(je,{"aria-hidden":"true"}),run:()=>{const a=n.includes("/")?`${e}/${n.slice(0,n.lastIndexOf("/"))}`:e;window.location.assign(g(a,"notes"))}}:null,H=q&&j&&o?.kind==="markdown"?{kind:"item",id:"open-default",label:"Open in default app",icon:t.jsx(Se,{"aria-hidden":"true"}),run:()=>{we(C).catch(a=>h.error(a instanceof Error?a.message:"Could not open file."))}}:null,Y=[{kind:"label",label:"File"},{kind:"item",id:"copy",label:"Copy file path",icon:t.jsx(U,{"aria-hidden":"true"}),disabled:!o,disabledReason:"Loading file…",run:()=>S(C)},...$?[$]:[],...H?[H]:[],...O?[O]:[],...G,{kind:"label",label:"Navigate"},{kind:"item",id:"back",label:"Back",icon:t.jsx(be,{"aria-hidden":"true"}),run:()=>window.history.back()},{kind:"item",id:"forward",label:"Forward",icon:t.jsx(Le,{"aria-hidden":"true"}),run:()=>window.history.forward()},{kind:"separator"},{kind:"label",label:"Share"},{kind:"item",id:"share",label:"Share preview…",icon:t.jsx(N,{"aria-hidden":"true"}),run:J},{kind:"item",id:"copy-link",label:"Copy link",icon:t.jsx(Oe,{"aria-hidden":"true"}),run:()=>S(window.location.href)},{kind:"separator"},{kind:"item",id:"close",label:"Close preview",icon:t.jsx(ve,{"aria-hidden":"true"}),variant:"destructive",run:()=>window.location.assign(e?g(e,"notes"):"/")}],Z=j&&!K&&(L||x||E.comments.length>0||E.attachments.length>0),w=d.useRef(null);d.useEffect(()=>{if(!c){w.current=null;return}const a=Ve(window.location.href,window.document.referrer,window.opener?.origin);if(!a.length){h.error("Chat panel bridge has no trusted host origin");return}const s=y=>{for(const M of[window.parent,window.opener])if(M)try{M.postMessage(y,a[0])}catch{}},k=ze({allowedOrigins:a,post:s,windowRef:()=>window,onClose:()=>Be(s),onResize:()=>s({type:"kennel:state",payload:I(o?.path,u.title)}),onRequest:y=>{y==="selection"?s({type:"kennel:selection",payload:z(o?.path,u.title)}):y==="state"&&s({type:"kennel:state",payload:I(o?.path,u.title)})}}),ne=()=>{s({type:"kennel:selection",payload:z(o?.path,u.title)})};return w.current=ne,()=>{k(),w.current=null}},[o,c,u.title]);const ee=i||c;return t.jsx(he,{kind:"document",folder:e,document:u,children:t.jsxs("section",{className:"markdown-page","data-embedded":ee?"true":void 0,"data-panel":c?"true":void 0,children:[t.jsx(We,{options:t.jsx(ke,{actions:Y}),accessory:c?t.jsx("button",{type:"button",className:"app-options-trigger","aria-label":"Send selection to chat",title:"Send selection to chat",onClick:()=>w.current?.(),children:t.jsx(N,{"aria-hidden":"true"})}):null}),r?t.jsx(d.Suspense,{fallback:null,children:t.jsx(Je,{session:r})}):null,p?t.jsxs("div",{className:"pop-live",role:"status",children:[t.jsx("span",{"aria-hidden":"true",children:"●"})," Live — refreshing on save"]}):null,l.error?t.jsx("p",{role:"alert",className:"p-6",children:l.error.message}):o?t.jsx(d.Suspense,{fallback:t.jsx("p",{role:"status",className:"p-6",children:"Loading renderer…"}),children:t.jsx(Qe,{document:o,metadata:m,folder:e,session:r,selection:x&&T})}):t.jsx("p",{role:"status",className:"p-6",children:"Loading file…"}),Z&&e?t.jsx(d.Suspense,{fallback:t.jsx("p",{role:"status",children:"Loading AI composer…"}),children:t.jsx(Ke,{folder:e,open:L,onClose:()=>{P(!1),b(!0),R(!1)},note:A&&o?{path:o.path,content:o.content}:void 0})}):null]})})}function Sn(){const n=B(window.location.href);return n.document?t.jsxs(ie,{client:de,children:[t.jsx(Xe,{path:n.document,folder:n.folder,session:n.session,embedded:n.embedded,panel:n.panel},`${n.folder}:${n.document}`),t.jsx(ue,{})]}):null}export{Sn as DocumentPage};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as a}from"./view-context-D-fh9AbH.js";const e=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],n=a("external-link",e);export{n as E};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/selection-popup-ntjycEVh.js","assets/react-DZzLHL-l.js","assets/markdown-njUwQKsR.js","assets/button-BJ7z-ZA7.js","assets/view-context-D-fh9AbH.js","assets/index-DztTMDFz.js","assets/index-DS2Wmd9I.css","assets/tanstack-CD46mJkU.js","assets/utils-CwHGE3BB.js","assets/plus-BHV2wJr7.js","assets/link-DC_1Z6Yy.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{_ as y,f as R}from"./index-DztTMDFz.js";import{r as f,j as s}from"./react-DZzLHL-l.js";import{B as C,L as p}from"./link-DC_1Z6Yy.js";const b=[];function L(){return b.flatMap(e=>e.renderers??[])}function O(){return Object.assign({},...b.map(e=>e.markdownComponents??{}))}function _(e){return e.slice(e.lastIndexOf(".")).toLowerCase()}function E(e){return L().find(t=>{const n=t.kinds?.includes(e.kind)??!1,r=t.extensions?.includes(_(e.path))??!1;return n||r})}const x=/\.(?:aac|avif|bmp|flac|gif|ico|jpeg|jpg|m4a|m4v|mov|mp3|mp4|oga|ogg|ogv|opus|png|svg|wav|webm|webp)$/i,A=/^(?:[a-z][a-z0-9+.-]*:|\/\/|[#~])/i;function h(e,t){const n=new URL("/api/media","http://localhost");return n.searchParams.set("path",e),n.searchParams.set("file",t),`${n.pathname}${n.search}`}function U(e){const t=e.lastIndexOf("/");return t<0?"":e.slice(0,t+1)}function m(e){return e.split(/[\\/]+/).filter(t=>t&&t!==".")}function j(e,t){const n=m(e);return t.length<n.length?!1:n.every((r,i)=>r.toLowerCase()===t[i]?.toLowerCase())}function v(e,t){return t.slice(m(e).length).join("/")}function D(e,t){if(!t)return;const n=m(t);return j(e,n)&&v(e,n)||void 0}function I(e,t,n){const r=`${e.replace(/[\\/]+$/,"")}/${U(t)}`,i=m(`${r}${n}`),o=[];for(const a of i){if(a===".."){if(!o.length)return;o.pop();continue}o.push(a)}if(j(e,o))return v(e,o)||void 0}function M(e){if(e.startsWith("/@fs/"))try{return decodeURIComponent(e.slice(4))}catch{return}}function S(e,t){return n=>{const r=n.trim().replaceAll("\\","/");if(!r)return;const i=M(r);if(i!==void 0){const l=D(e,i);return!l||!x.test(l)?void 0:h(e,l)}if(A.test(r))return;const o=r.split(/[?#]/)[0]??"";if(!x.test(o))return;const a=I(e,t,r);return a?h(e,a):void 0}}function P(e,t){let n=e.replaceAll(/(\s(?:src|poster)\s*=\s*)("([^"]*)"|'([^']*)')/gi,(r,i,o,a,l)=>{const c=t(a??l??"");return c?`${i}"${c}"`:r});return n=n.replaceAll(/\]\(([^()\s]+)(?:\s+"[^"]*")?\)/g,(r,i)=>{const o=t(i);return o?`](${o})`:r}),n}function z(e,t,n){if(!t||!n)return e;const r=S(t,n);let i=!1;return e.split(`
|
|
3
|
-
`).map(o=>/^\s*```/.test(o)?(i=!i,o):i?o:P(o,r)).join(`
|
|
4
|
-
`)}const F=/\.(?:md|markdown|mdown|mdx)$/i,B=/^(?:\/|[a-z][a-z0-9+.-]*:)/i;function T(e){const t=e.lastIndexOf("/");return t<0?"":e.slice(0,t+1)}function W(e){return e.replaceAll(/([\\\[\]])/g,"\\$1")}function H(e){const t=e.trim().replaceAll("\\","/");if(!(!t||B.test(t)))return F.test(t)?t:`${t}.md`}function q(e){return e.toLowerCase().replaceAll(/[^\w\s-]/g,"").trim().replaceAll(/\s+/g,"-").replaceAll(/-+/g,"-").replaceAll(/^-|-$/g,"")}function w(e){const t=e.split("|",2)[0]??"",[n="",r]=t.trim().split("#",2);if(!(!n&&!r))return{...r?.trim()?{heading:r.trim()}:{},...n.trim()?{reference:n.trim()}:{}}}function K(e){let t=!1;return e.split(`
|
|
5
|
-
`).map(n=>/^\s*```/.test(n)?(t=!t,n):t?n:n.replaceAll(new RegExp("(?<![!\\\\])\\[\\[([^\\]\\n]+)\\]\\]","g"),(r,i)=>{const o=w(i);if(!o)return r;const a=i.includes("|")?i.slice(i.indexOf("|")+1).trim():o.heading?o.reference?`${o.reference}#${o.heading}`:o.heading:o.reference??i;return`[${W(a)}](/_obsidian-link/${encodeURIComponent(i)})`})).join(`
|
|
6
|
-
`)}function k(e,t,n){const r=H(e);if(!r)return;const o=n&&!/^\.\.?\//.test(r)&&r.includes("/")?r:`${T(t)}${r}`,a=[];for(const l of o.split("/"))if(!(!l||l==="."))if(l===".."){if(!a.length)return;a.pop()}else a.push(l);return a.join("/")}function V(e,t){const n=w(e);if(!n)return;if(!n.reference)return n;const r=k(n.reference,t,!0);return r?{...n,reference:r}:void 0}function Y(e,t){const n=/^([^?#]+\.(?:md|markdown|mdown|mdx))(?:#(.*))?$/i.exec(e);if(!n)return;const r=k(n[1],t,!1);if(r)return{...n[2]?{heading:n[2]}:{},reference:r}}function g(e,t){const i=(e instanceof Element?e:e.parentElement)?.closest(`[data-line-${t}]`)?.getAttribute(`data-line-${t}`);return i?Number(i):void 0}function ue(e){const t=g(e.startContainer,"start"),n=g(e.endContainer,"end");if(!(!t||!n))return{start:t,end:n}}function J(e,t){return({node:n,...r})=>f.createElement(e,{...r,"data-line-start":n?.position?n.position.start.line+t:void 0,"data-line-end":n?.position?n.position.end.line+t:void 0})}function G(e){return Object.fromEntries(["p","li","blockquote","td","th"].map(n=>[n,J(n,e)]))}const Q=f.lazy(async()=>({default:(await y(()=>import("./selection-popup-ntjycEVh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))).SelectionPopup}));function X(e,t,n){const r=t?R(t,e):`?file=${encodeURIComponent(e)}`;return n?`${r}${r.includes("?")?"&":"?"}session=${encodeURIComponent(n)}`:r}function $({currentDocument:e,folder:t,href:n,session:r,...i}){const o="/_obsidian-link/";let a;if(n?.startsWith(o))try{a=decodeURIComponent(n.slice(o.length))}catch{a=void 0}const l=a?V(a,e):n?Y(n,e):void 0;if(!l)return s.jsx(p,{href:n,...i});const c=l.heading?q(l.heading):"",d=l.reference?X(l.reference,t,r):"";return s.jsx(p,{href:c?`${d}#${c}`:d||void 0,...i})}function Z({document:e}){const t=e.path.split("/").at(-1)??e.path;return s.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-4 p-6",children:[s.jsx("img",{alt:t,className:`max-h-[min(70vh,70dvh)] max-w-full rounded-lg border
|
|
7
|
-
border-[#e7ebe7] object-contain`,src:e.rawUrl}),s.jsx("small",{className:"text-[0.8rem] text-[#6c7a6d]",children:t})]})}function ee(e){return e.slice(e.lastIndexOf(".")+1).toLowerCase()}function te({value:e}){return Array.isArray(e)?s.jsx("span",{className:"flex flex-wrap gap-1.5",children:e.map((t,n)=>s.jsx("span",{className:"rounded-full bg-[#e7ebe7] px-2 py-0.5 text-[0.8rem]",children:String(t)},`${n}-${String(t)}`))}):typeof e=="boolean"?e?"Yes":"No":typeof e=="object"&&e?JSON.stringify(e):String(e??"")}function ne({entries:e}){return s.jsxs("details",{className:"mb-5 rounded-lg border border-[#e7ebe7] bg-[#fafbfa] px-4 py-3",open:!0,children:[s.jsxs("summary",{className:"flex cursor-pointer items-center gap-2 font-semibold",children:[s.jsx("span",{children:"Document details"}),s.jsxs("small",{className:"text-[0.8rem] font-normal text-[#6c7a6d]",children:[e.length," fields"]})]}),s.jsx("dl",{className:"mt-3 grid gap-2",children:e.map(([t,n])=>s.jsxs("div",{className:`grid grid-cols-[140px_1fr] items-start gap-3
|
|
8
|
-
max-[767px]:grid-cols-1`,children:[s.jsx("dt",{className:"text-[0.8rem] font-semibold text-[#5a6b5c] capitalize",children:t.replaceAll(/[-_]/g," ")}),s.jsx("dd",{className:"m-0 text-[0.85rem] text-[#2f382f]",children:s.jsx(te,{value:n})})]},t))})]})}function re({document:e}){return s.jsx("pre",{className:`m-0 overflow-auto rounded-lg bg-[#f8f9f8] p-4 text-[0.85rem]
|
|
9
|
-
leading-[1.6]`,"data-code-language":ee(e.path),children:s.jsx("code",{children:e.content})})}function se(e,t){const n=[];let r=[],i="",o=!1;for(let a=0;a<e.length;a+=1){const l=e[a];if(o){if(l==='"'&&e[a+1]==='"'){i+='"',a+=1;continue}if(l==='"'){o=!1;continue}i+=l;continue}if(l==='"'&&i===""){o=!0;continue}if(l===t){r.push(i),i="";continue}if(l===`
|
|
10
|
-
`||l==="\r"){l==="\r"&&e[a+1]===`
|
|
11
|
-
`&&(a+=1),r.push(i),r.some(c=>c!=="")&&n.push(r),r=[],i="";continue}i+=l}return r.push(i),r.some(a=>a!=="")&&n.push(r),n}function ie({document:e}){const t=e.path.toLowerCase().endsWith(".tsv")?" ":",",n=f.useMemo(()=>se(e.content,t),[e.content,t]),r=n[0]??[],i=n.length>1?n.slice(1):[];return s.jsx("div",{className:"overflow-auto p-4",children:s.jsxs("table",{className:"w-full border-collapse text-left text-[0.85rem]",children:[s.jsx("thead",{children:s.jsx("tr",{children:r.map((o,a)=>s.jsx("th",{className:`border-b border-[#e7ebe7] bg-[#fafbfa] px-3 py-2
|
|
12
|
-
font-semibold text-[#435447]`,children:o},a))})}),s.jsx("tbody",{children:i.map((o,a)=>s.jsx("tr",{className:"odd:bg-white",children:o.map((l,c)=>s.jsx("td",{className:"border-b border-[#eef1ec] px-3 py-2 text-[#2f382f]",children:l},c))},a))})]})})}function oe(e){const t=e.search(/\r?\n\r?\n/),n=t===-1?e:e.slice(0,t),r=t===-1?"":e.slice(t+(e.startsWith(`\r
|
|
13
|
-
\r
|
|
14
|
-
`,t)?4:2)),i=new Map;let o;for(const a of n.split(/\r?\n/)){if(/^[\t ]/.test(a)&&o){i.set(o,`${i.get(o)} ${a.trim()}`);continue}const l=/^([^:\s]+):\s*(.*)$/.exec(a);l&&(o=(l[1]??"").toLowerCase(),i.set(o,(l[2]??"").trim()))}return{body:r,headers:i}}function ae({document:e}){const{body:t,headers:n}=f.useMemo(()=>oe(e.content),[e.content]),r=n.get("subject")??e.path.split("/").at(-1)??e.path,i=n.get("from")??"Unknown sender",o=n.get("to")??"Unknown recipient",a=n.get("date")??"Unknown date",l=t.includes("<html")||t.includes("<!DOCTYPE html"),c=[["From",i],["To",o],["Date",a]];return s.jsxs("article",{className:"min-h-0",children:[s.jsxs("div",{className:"border-b border-[#e7ebe7] bg-[#fafbfa] px-6 py-5",children:[s.jsx("h2",{className:"m-0 mb-3 text-lg font-semibold text-[#2f382f]",children:r}),s.jsx("dl",{className:"m-0 grid gap-1",children:c.map(([d,u])=>s.jsxs("div",{className:"grid grid-cols-[70px_1fr] gap-3 text-[0.8rem]",children:[s.jsx("dt",{className:"font-semibold text-[#5a6b5c]",children:d}),s.jsx("dd",{className:"m-0 text-[#2f382f]",children:u})]},d))})]}),l?s.jsx("iframe",{className:"h-[min(60vh,60dvh)] w-full",sandbox:"",srcDoc:t,title:r}):s.jsx("pre",{className:`m-0 overflow-auto p-6 text-[0.85rem] leading-[1.6]
|
|
15
|
-
whitespace-pre-wrap text-[#2f382f]`,children:t})]})}function le({document:e}){const t=e.path.split("/").at(-1)??e.path,n=e.rawUrl?`${e.rawUrl}${e.rawUrl.includes("?")?"&":"?"}download=1`:void 0;return s.jsxs("div",{className:`flex h-full flex-col items-center justify-center gap-4 p-6
|
|
16
|
-
text-center`,children:[s.jsx("p",{className:"m-0 text-[0.9rem] text-[#6c7a6d]",children:"Kennel cannot render this file type inline."}),n?s.jsxs("a",{className:`rounded-lg border border-[#d8ddd4] bg-white px-4 py-2
|
|
17
|
-
text-[0.85rem] font-semibold text-[#24543a]`,href:n,children:["Download ",t]}):s.jsx("small",{className:"text-[0.8rem] text-[#6c7a6d]",children:t})]})}function ce({document:e,metadata:t,folder:n,session:r,selection:i=!1}){const o=f.useMemo(()=>({...G(t.lineOffset),...O(),a:N=>s.jsx($,{...N,currentDocument:e.path,folder:n,session:r})}),[t.lineOffset,e.path,n,r]),a=n??e.root??"",l=a?`${a.replace(/\/+$/,"")}/${e.path}`:void 0,c=e.kind==="markdown"?s.jsx(C,{components:o,headingCopyPath:l,mode:"markdown",value:z(K(t.body),a,e.path)}):null,d=f.useMemo(()=>E(e),[e]),u=e.kind==="markdown"&&i&&n?.startsWith("/")?s.jsx(f.Suspense,{fallback:c,children:s.jsx(Q,{path:e.path,folder:n,content:e.content,children:c},`${n}:${e.path}`)}):d?s.jsx(d.component,{document:e}):e.kind==="markdown"?c:e.kind==="html"?s.jsx("iframe",{className:`h-full min-h-[min(60vh,60dvh)] w-full rounded-lg border
|
|
18
|
-
border-[#e7ebe7]`,sandbox:"",srcDoc:e.content,title:e.path}):e.kind==="text"?s.jsx("pre",{className:`m-0 overflow-auto rounded-lg bg-[#f8f9f8] p-4 text-[0.85rem]
|
|
19
|
-
leading-[1.6]`,children:e.content}):e.kind==="code"?s.jsx(re,{document:e}):e.kind==="image"?s.jsx(Z,{document:e}):e.kind==="table"?s.jsx(ie,{document:e}):e.kind==="eml"?s.jsx(ae,{document:e}):s.jsx(le,{document:e});return s.jsxs("article",{className:"min-h-0 flex-1 overflow-auto px-6 py-5",style:{paddingBottom:"calc(var(--ask-tray-height, 0px) + 20px)"},children:[t.entries.length?s.jsx(ne,{entries:t.entries}):null,u]})}const pe=Object.freeze(Object.defineProperty({__proto__:null,FileRenderer:ce,ObsidianLink:$},Symbol.toStringTag,{value:"Module"}));export{pe as f,ue as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{c as e}from"./view-context-D-fh9AbH.js";const a=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],o=e("file-text",a);export{o as F};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as c,j as t}from"./react-DZzLHL-l.js";import{B as l}from"./link-DC_1Z6Yy.js";import{m}from"./markdown-title-dncAYYiP.js";import{C as p}from"./chevron-down-C5oRtqbX.js";import"./markdown-njUwQKsR.js";import"./index-DztTMDFz.js";import"./view-context-D-fh9AbH.js";import"./tanstack-CD46mJkU.js";const u=e=>{const r=e.split("/").at(-1).replace(/\.(?:html?|markdown|md|text|txt)$/i,"").replaceAll(/[-_]/g," ").replace(/^\d{4} \d{2} \d{2} /,"");return`${r.charAt(0).toUpperCase()}${r.slice(1)}`},h=(e,r)=>{const n=e.split("/").slice(0,-1).join("/"),s=`https://barkdown.local/${n?`${n}/`:""}`;return new URL(r,s).pathname.slice(1)};function x({value:e}){return Array.isArray(e)?t.jsx("span",{className:"flex flex-wrap gap-1.5",children:e.map((r,n)=>t.jsx("span",{children:String(r)},`${n}-${String(r)}`))}):typeof e=="boolean"?e?"Yes":"No":typeof e=="object"&&e?JSON.stringify(e):String(e??"")}function f({entries:e}){return t.jsxs("details",{className:"frontmatter",open:!0,children:[t.jsxs("summary",{children:[t.jsx("span",{children:"Document details"}),t.jsxs("small",{children:[e.length," fields"]}),t.jsx(p,{"aria-hidden":"true"})]}),t.jsx("dl",{children:e.map(([r,n])=>t.jsxs("div",{children:[t.jsx("dt",{children:r.replaceAll(/[-_]/g," ")}),t.jsx("dd",{children:t.jsx(x,{value:n})})]},r))})]})}function j({dataset:e,path:r}){const n=c.useMemo(()=>r?e.documents.find(o=>o.path===r):e.documents.find(o=>o.path.toLowerCase()==="readme.md")??e.documents[0],[e,r]);if(!n)return t.jsx("p",{className:"barkdown-document-empty",children:"No document found."});const s=n.kind==="markdown"?m(n.content):{body:n.content,entries:[]};return t.jsxs("article",{className:n.kind==="html"?"document is-html":"document",tabIndex:-1,children:[s.entries.length?t.jsx(f,{entries:s.entries}):null,n.kind==="html"?t.jsx("iframe",{className:"html-document",sandbox:"",srcDoc:n.content,title:u(n.path)}):n.kind==="markdown"?t.jsx(l,{headingCopyPath:e.root?`${e.root.replace(/\/+$/,"")}/${n.path}`:void 0,mode:"markdown",value:s.body,htmlEmbed:o=>{const a=h(n.path,o);return e.documents.find(d=>d.kind==="html"&&d.path===a)?.content}}):t.jsx("pre",{className:"text-document",children:n.content})]})}function E({path:e,source:r}){const[n,s]=c.useState(),[o,a]=c.useState("");return c.useEffect(()=>{let i=!0;return r.read().then(d=>{i&&(s(d),a(""))}).catch(d=>{i&&a(d instanceof Error?d.message:"Could not load file.")}),()=>{i=!1}},[r]),t.jsx("div",{className:"fixed inset-0 z-30 overflow-auto bg-white","data-file-viewer":"",children:t.jsx("div",{className:"mx-auto max-w-[900px] px-6 py-8",children:o?t.jsx("p",{className:"barkdown-document-error",children:o}):n?t.jsx(j,{dataset:n,path:e}):t.jsx("p",{className:"barkdown-document-loading",children:"Loading file…"})})})}export{E as FileViewer};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as d,j as e}from"./react-DZzLHL-l.js";import{F as o}from"./index-p38i_yyY.js";function u({icon:r}){const[t,s]=d.useState(),a=r?r.url??`data:${r.mediaType};base64,${r.data}`:void 0;return!a||t===a?e.jsx(o,{"aria-hidden":"true"}):e.jsx("img",{alt:"","aria-hidden":"true",onError:()=>s(a),src:a})}export{u as F};
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import{r as l,j as e,T as Re,v as Ie,w as Me,x as Oe,S as Le,y as De,z as Fe,A as ze,B as $e}from"./react-DZzLHL-l.js";import{c as Be,B as q}from"./button-BJ7z-ZA7.js";import{F as He}from"./folder-metadata-puTC5QqJ.js";import{u as Q,d as Ke,c as m,S as Z}from"./utils-CwHGE3BB.js";import{P as ee,c as Ge,i as Ve,g as qe,b as _,a as te,d as Ue,u as We,D as Xe}from"./index-eL1k96k8.js";import{X as Ye}from"./x-BUeE--I4.js";import{D as Je,c as Qe,d as Ze,a as et,b as tt,e as at,f as nt,S as rt}from"./index-kY75qc96.js";import{c as ae,R as st,A as ot,a as it,C as lt,F as ne}from"./index-p38i_yyY.js";import{R as ct}from"./index-DgqzSeIR.js";import{c as z}from"./view-context-D-fh9AbH.js";import{F as K,S as L}from"./sparkles-CBhGREdc.js";import{A as re,f as se}from"./app-options-XEWvevsz.js";import{C as dt}from"./collection-icon-TbOVyORG.js";import{F as oe,o as ie}from"./folder-list-rIdszVde.js";import{r as ut}from"./folder-activity-Cv1X2ezj.js";import{F as I}from"./file-text-CiiSsCDq.js";import{F as le}from"./folder-image-AXBrHUcU.js";import{C as ce}from"./chevron-right-CsPtvh8C.js";import{M as pt}from"./mail-2rCdIFul.js";import"./markdown-njUwQKsR.js";import"./index-DztTMDFz.js";import"./tanstack-CD46mJkU.js";import"./copy-context-Cl1TE2PJ.js";import"./copy-Ikmr6Iq2.js";import"./index-DmrKjrlM.js";import"./calendar-days-DWh2XMO2.js";import"./link-DC_1Z6Yy.js";import"./external-link-BXmSXqqF.js";const ht=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],ft=z("bot",ht);const xt=[["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M17 14h-6",key:"bkmgh3"}],["path",{d:"M13 18H7",key:"bb0bb7"}],["path",{d:"M7 14h.01",key:"1qa3f1"}],["path",{d:"M17 18h.01",key:"1bdyru"}]],gt=z("calendar-range",xt);const bt=[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]],mt=z("list-todo",bt);const jt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],vt=z("panel-left",jt);var yt=Object.defineProperty,de=(t,a)=>yt(t,"name",{value:a,configurable:!0}),Y="horizontal",wt=["horizontal","vertical"],kt=l.forwardRef(de(function(a,r){const{decorative:n,orientation:s=Y,...o}=a,i=ue(s)?s:Y,d=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return e.jsx(ee.div,{"data-orientation":i,...d,...o,ref:r})},"Separator"));function ue(t){return wt.includes(t)}de(ue,"isValidOrientation");var Tt=kt,Nt=Object.defineProperty,w=(t,a)=>Nt(t,"name",{value:a,configurable:!0}),[U,fn]=Ge("Tooltip",[ae]),$=ae(),Ct="TooltipProvider",St=700,G="tooltip.open",[Pt,W]=U(Ct),_t=w(t=>{const{__scopeTooltip:a,delayDuration:r=St,skipDelayDuration:n=300,disableHoverableContent:s=!1,children:o}=t,i=l.useRef(!0),p=l.useRef(!1),d=l.useRef(0);return l.useEffect(()=>{const u=d.current;return()=>window.clearTimeout(u)},[]),e.jsx(Pt,{scope:a,isOpenDelayedRef:i,delayDuration:r,onOpen:l.useCallback(()=>{n<=0||(window.clearTimeout(d.current),i.current=!1)},[n]),onClose:l.useCallback(()=>{n<=0||(window.clearTimeout(d.current),d.current=window.setTimeout(()=>i.current=!0,n))},[n]),isPointerInTransitRef:p,onPointerInTransitChange:l.useCallback(u=>{p.current=u},[]),disableHoverableContent:s,children:o})},"TooltipProvider"),V="Tooltip",[Et,O]=U(V),At=w(t=>{const{__scopeTooltip:a,children:r,open:n,defaultOpen:s,onOpenChange:o,disableHoverableContent:i,delayDuration:p}=t,d=W(V,t.__scopeTooltip),u=$(a),[x,j]=l.useState(null),[h,b]=l.useState(void 0),f=Ve(),g=l.useRef(0),k=i??d.disableHoverableContent,v=p??d.delayDuration,y=l.useRef(!1),[N,T]=qe({prop:n,defaultProp:s??!1,onChange:w(c=>{c?(d.onOpen(),document.dispatchEvent(new CustomEvent(G))):d.onClose(),o?.(c)},"onChange"),caller:V}),E=l.useMemo(()=>N?y.current?"delayed-open":"instant-open":"closed",[N]),C=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,y.current=!1,T(!0)},[T]),P=l.useCallback(()=>{window.clearTimeout(g.current),g.current=0,T(!1)},[T]),A=l.useCallback(()=>{window.clearTimeout(g.current),g.current=window.setTimeout(()=>{y.current=!0,T(!0),g.current=0},v)},[v,T]);l.useEffect(()=>()=>{g.current&&(window.clearTimeout(g.current),g.current=0)},[]);const R=h??f;return e.jsx(st,{...u,children:e.jsx(Et,{scope:a,contentId:R,setContentId:b,open:N,stateAttribute:E,trigger:x,onTriggerChange:j,onTriggerEnter:l.useCallback(()=>{d.isOpenDelayedRef.current?A():C()},[d.isOpenDelayedRef,A,C]),onTriggerLeave:l.useCallback(()=>{k?P():(window.clearTimeout(g.current),g.current=0)},[P,k]),onOpen:C,onClose:P,disableHoverableContent:k,children:r})})},"Tooltip"),J="TooltipTrigger",Rt=l.forwardRef(w(function(a,r){const{__scopeTooltip:n,...s}=a,o=O(J,n),i=W(J,n),p=$(n),d=l.useRef(null),u=Q(r,d,o.onTriggerChange),x=l.useRef(!1),j=l.useRef(!1),h=l.useCallback(()=>x.current=!1,[]);return l.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),e.jsx(ot,{asChild:!0,...p,children:e.jsx(ee.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...s,ref:u,onPointerMove:_(a.onPointerMove,b=>{b.pointerType!=="touch"&&!j.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),j.current=!0)}),onPointerLeave:_(a.onPointerLeave,()=>{o.onTriggerLeave(),j.current=!1}),onPointerDown:_(a.onPointerDown,()=>{o.open&&o.onClose(),x.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:_(a.onFocus,()=>{x.current||o.onOpen()}),onBlur:_(a.onBlur,o.onClose),onClick:_(a.onClick,o.onClose)})})},"TooltipTrigger")),pe="TooltipPortal",[It,Mt]=U(pe,{forceMount:void 0}),Ot=w(t=>{const{__scopeTooltip:a,forceMount:r,children:n,container:s}=t,o=O(pe,a);return e.jsx(It,{scope:a,forceMount:r,children:e.jsx(te,{present:r||o.open,children:e.jsx(Ue,{asChild:!0,container:s,children:n})})})},"TooltipPortal"),M="TooltipContent",Lt=l.forwardRef(w(function(a,r){const n=Mt(M,a.__scopeTooltip),{forceMount:s=n.forceMount,side:o="top",...i}=a,p=O(M,a.__scopeTooltip);return e.jsx(te,{present:s||p.open,children:p.disableHoverableContent?e.jsx(he,{side:o,...i,ref:r}):e.jsx(Dt,{side:o,...i,ref:r})})},"TooltipContent")),Dt=l.forwardRef(w(function(a,r){const n=O(M,a.__scopeTooltip),s=W(M,a.__scopeTooltip),o=l.useRef(null),i=Q(r,o),[p,d]=l.useState(null),{trigger:u,onClose:x}=n,j=o.current,{onPointerInTransitChange:h}=s,b=l.useCallback(()=>{d(null),h(!1)},[h]),f=l.useCallback((g,k)=>{const v=g.currentTarget,y={x:g.clientX,y:g.clientY},N=fe(y,v.getBoundingClientRect()),T=xe(y,N),E=ge(k.getBoundingClientRect()),C=me([...T,...E]);d(C),h(!0)},[h]);return l.useEffect(()=>()=>b(),[b]),l.useEffect(()=>{if(u&&j){const g=w(v=>f(v,j),"handleTriggerLeave"),k=w(v=>f(v,u),"handleContentLeave");return u.addEventListener("pointerleave",g),j.addEventListener("pointerleave",k),()=>{u.removeEventListener("pointerleave",g),j.removeEventListener("pointerleave",k)}}},[u,j,f,b]),l.useEffect(()=>{if(p){const g=w(k=>{const v=k.target,y={x:k.clientX,y:k.clientY},N=u?.contains(v)||j?.contains(v),T=!be(y,p);N?b():T&&(b(),x())},"handleTrackPointerGrace");return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[u,j,p,x,b]),e.jsx(he,{...a,ref:i})},"TooltipContentHoverable")),Ft=Ke("TooltipContent"),he=l.forwardRef(w(function(a,r){const{__scopeTooltip:n,children:s,"aria-label":o,id:i,onEscapeKeyDown:p,onPointerDownOutside:d,...u}=a,x=O(M,n),j=$(n),{onClose:h}=x;l.useEffect(()=>(document.addEventListener(G,h),()=>document.removeEventListener(G,h)),[h]),l.useEffect(()=>{if(x.trigger){const f=w(g=>{g.target instanceof Node&&g.target.contains(x.trigger)&&h()},"handleScroll");return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[x.trigger,h]);const{setContentId:b}=x;return We(()=>(b(i),()=>{b(void 0)}),[i,b]),e.jsx(Xe,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:p,onPointerDownOutside:d,onFocusOutside:f=>f.preventDefault(),onDismiss:h,children:e.jsxs(lt,{"data-state":x.stateAttribute,role:o?void 0:"tooltip",id:o?void 0:x.contentId,...j,...u,ref:r,style:{...u.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[e.jsx(Ft,{children:s}),o?e.jsx(ct,{id:x.contentId,role:"tooltip",children:o}):null]})})},"TooltipContentImpl")),zt=l.forwardRef(w(function(a,r){const{__scopeTooltip:n,...s}=a,o=$(n);return e.jsx(it,{...o,...s,ref:r})},"TooltipArrow"));function fe(t,a){const r=Math.abs(a.top-t.y),n=Math.abs(a.bottom-t.y),s=Math.abs(a.right-t.x),o=Math.abs(a.left-t.x);switch(Math.min(r,n,s,o)){case o:return"left";case s:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}w(fe,"getExitSideFromRect");function xe(t,a,r=5){const n=[];switch(a){case"top":n.push({x:t.x-r,y:t.y+r},{x:t.x+r,y:t.y+r});break;case"bottom":n.push({x:t.x-r,y:t.y-r},{x:t.x+r,y:t.y-r});break;case"left":n.push({x:t.x+r,y:t.y-r},{x:t.x+r,y:t.y+r});break;case"right":n.push({x:t.x-r,y:t.y-r},{x:t.x-r,y:t.y+r});break}return n}w(xe,"getPaddedExitPoints");function ge(t){const{top:a,right:r,bottom:n,left:s}=t;return[{x:s,y:a},{x:r,y:a},{x:r,y:n},{x:s,y:n}]}w(ge,"getPointsFromRect");function be(t,a){const{x:r,y:n}=t;let s=!1;for(let o=0,i=a.length-1;o<a.length;i=o++){const p=a[o],d=a[i],u=p.x,x=p.y,j=d.x,h=d.y;x>n!=h>n&&r<(j-u)*(n-x)/(h-x)+u&&(s=!s)}return s}w(be,"isPointInPolygon");function me(t){const a=t.slice();return a.sort((r,n)=>r.x<n.x?-1:r.x>n.x?1:r.y<n.y?-1:r.y>n.y?1:0),je(a)}w(me,"getHull");function je(t){if(t.length<=1)return t.slice();const a=[];for(let n=0;n<t.length;n++){const s=t[n];for(;a.length>=2;){const o=a[a.length-1],i=a[a.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))a.pop();else break}a.push(s)}a.pop();const r=[];for(let n=t.length-1;n>=0;n--){const s=t[n];for(;r.length>=2;){const o=r[r.length-1],i=r[r.length-2];if((o.x-i.x)*(s.y-i.y)>=(o.y-i.y)*(s.x-i.x))r.pop();else break}r.push(s)}return r.pop(),a.length===1&&r.length===1&&a[0].x===r[0].x&&a[0].y===r[0].y?a:a.concat(r)}w(je,"getHullPresorted");var $t=_t,Bt=At,Ht=Rt,Kt=Ot,Gt=Lt,Vt=zt;function qt({className:t,...a}){return e.jsx("kbd",{"data-slot":"kbd",className:m(`bg-muted text-muted-foreground pointer-events-none inline-flex h-5
|
|
2
|
-
w-fit min-w-5 items-center justify-center gap-1 rounded-sm px-1
|
|
3
|
-
font-sans text-xs font-medium select-none`,"[&_svg:not([class*='size-'])]:size-3",`[[data-slot=tooltip-content]_&]:bg-background/20
|
|
4
|
-
[[data-slot=tooltip-content]_&]:text-background
|
|
5
|
-
dark:[[data-slot=tooltip-content]_&]:bg-background/10`,t),...a})}function Ut({className:t,orientation:a="horizontal",decorative:r=!0,...n}){return e.jsx(Tt,{"data-slot":"separator",decorative:r,orientation:a,className:m(`bg-border shrink-0 data-[orientation=horizontal]:h-px
|
|
6
|
-
data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full
|
|
7
|
-
data-[orientation=vertical]:w-px`,t),...n})}function Wt({...t}){return e.jsx(Je,{"data-slot":"sheet",...t})}function Xt({...t}){return e.jsx(at,{"data-slot":"sheet-portal",...t})}function Yt({className:t,...a}){return e.jsx(nt,{"data-slot":"sheet-overlay",className:m(`data-[state=open]:animate-in data-[state=closed]:animate-out
|
|
8
|
-
data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0
|
|
9
|
-
z-50 bg-black/50`,t),...a})}function Jt({className:t,children:a,side:r="right",...n}){return e.jsxs(Xt,{children:[e.jsx(Yt,{}),e.jsxs(Qe,{"data-slot":"sheet-content",className:m(`bg-background data-[state=open]:animate-in
|
|
10
|
-
data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4
|
|
11
|
-
shadow-lg transition ease-in-out data-[state=closed]:duration-300
|
|
12
|
-
data-[state=open]:duration-500`,r==="right"&&`data-[state=closed]:slide-out-to-right
|
|
13
|
-
data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4
|
|
14
|
-
border-l sm:max-w-sm`,r==="left"&&`data-[state=closed]:slide-out-to-left
|
|
15
|
-
data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4
|
|
16
|
-
border-r sm:max-w-sm`,r==="top"&&`data-[state=closed]:slide-out-to-top
|
|
17
|
-
data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b`,r==="bottom"&&`data-[state=closed]:slide-out-to-bottom
|
|
18
|
-
data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto
|
|
19
|
-
border-t`,t),...n,children:[a,e.jsxs(Ze,{className:`ring-offset-background focus:ring-ring
|
|
20
|
-
data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs
|
|
21
|
-
opacity-70 transition-opacity hover:opacity-100 focus:ring-2
|
|
22
|
-
focus:ring-offset-2 focus:outline-hidden
|
|
23
|
-
disabled:pointer-events-none`,children:[e.jsx(Ye,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function Qt({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:m("flex flex-col gap-1.5 p-4",t),...a})}function Zt({className:t,...a}){return e.jsx(et,{"data-slot":"sheet-title",className:m("text-foreground font-semibold",t),...a})}function ea({className:t,...a}){return e.jsx(tt,{"data-slot":"sheet-description",className:m("text-muted-foreground text-sm",t),...a})}function S({className:t,...a}){return e.jsx("div",{"data-slot":"skeleton",className:m("bg-accent animate-pulse rounded-md",t),...a})}function ve({delayDuration:t=0,...a}){return e.jsx($t,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function ta({...t}){return e.jsx(ve,{children:e.jsx(Bt,{"data-slot":"tooltip",...t})})}function aa({...t}){return e.jsx(Ht,{"data-slot":"tooltip-trigger",...t})}function na({className:t,sideOffset:a=0,children:r,...n}){return e.jsx(Kt,{children:e.jsxs(Gt,{"data-slot":"tooltip-content",sideOffset:a,className:m(`bg-foreground text-background animate-in fade-in-0 zoom-in-95
|
|
24
|
-
data-[state=closed]:animate-out data-[state=closed]:fade-out-0
|
|
25
|
-
data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2
|
|
26
|
-
data-[side=left]:slide-in-from-right-2
|
|
27
|
-
data-[side=right]:slide-in-from-left-2
|
|
28
|
-
data-[side=top]:slide-in-from-bottom-2 z-50 w-fit
|
|
29
|
-
origin-(--radix-tooltip-content-transform-origin) rounded-md px-3
|
|
30
|
-
py-1.5 text-xs text-balance`,t),...n,children:[r,e.jsx(Vt,{className:`bg-foreground fill-foreground z-50 size-2.5
|
|
31
|
-
translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]`})]})})}const B=768;function ra(){const[t,a]=l.useState(void 0);return l.useEffect(()=>{const r=window.matchMedia(`(max-width: ${B-1}px)`),n=()=>{a(window.innerWidth<B)};return r.addEventListener("change",n),a(window.innerWidth<B),()=>r.removeEventListener("change",n)},[]),!!t}const sa="sidebar_state",oa=3600*24*7,ia="16rem",la="18rem",ca="3rem",da="b",ye=l.createContext(null);function X(){const t=l.useContext(ye);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function we({defaultOpen:t=!0,open:a,onOpenChange:r,className:n,style:s,children:o,...i}){const p=ra(),[d,u]=l.useState(!1),[x,j]=l.useState(t),h=a??x,b=l.useCallback(v=>{const y=typeof v=="function"?v(h):v;r?r(y):j(y),document.cookie=`${sa}=${y}; path=/; max-age=${oa}`},[r,h]),f=l.useCallback(()=>p?u(v=>!v):b(v=>!v),[p,b,u]);l.useEffect(()=>{const v=y=>{y.key===da&&(y.metaKey||y.ctrlKey)&&(y.preventDefault(),f())};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[f]);const g=h?"expanded":"collapsed",k=l.useMemo(()=>({state:g,open:h,setOpen:b,isMobile:p,openMobile:d,setOpenMobile:u,toggleSidebar:f}),[g,h,b,p,d,u,f]);return e.jsx(ye.Provider,{value:k,children:e.jsx(ve,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":ia,"--sidebar-width-icon":ca,...s},className:m(`group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex
|
|
32
|
-
min-h-svh w-full`,n),...i,children:o})})})}function ua({side:t="left",variant:a="sidebar",collapsible:r="offcanvas",className:n,children:s,...o}){const{isMobile:i,state:p,openMobile:d,setOpenMobile:u}=X();return r==="none"?e.jsx("div",{"data-slot":"sidebar",className:m(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width)
|
|
33
|
-
flex-col`,n),...o,children:s}):i?e.jsx(Wt,{open:d,onOpenChange:u,...o,children:e.jsxs(Jt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:`bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0
|
|
34
|
-
[&>button]:hidden`,style:{"--sidebar-width":la},side:t,children:[e.jsxs(Qt,{className:"sr-only",children:[e.jsx(Zt,{children:"Sidebar"}),e.jsx(ea,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:s})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":p,"data-collapsible":p==="collapsed"?r:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:m(`relative w-(--sidebar-width) bg-transparent transition-[width]
|
|
35
|
-
duration-200 ease-linear`,"group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:m(`fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width)
|
|
36
|
-
transition-[left,right,width] duration-200 ease-linear md:flex`,t==="left"?`left-0
|
|
37
|
-
group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0
|
|
38
|
-
group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,a==="floating"||a==="inset"?`p-2
|
|
39
|
-
group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)
|
|
40
|
-
group-data-[side=left]:border-r group-data-[side=right]:border-l`,n),...o,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:`bg-sidebar
|
|
41
|
-
group-data-[variant=floating]:border-sidebar-border flex h-full
|
|
42
|
-
w-full flex-col group-data-[variant=floating]:rounded-lg
|
|
43
|
-
group-data-[variant=floating]:border
|
|
44
|
-
group-data-[variant=floating]:shadow-sm`,children:s})})]})}function ke({className:t,onClick:a,...r}){const{toggleSidebar:n,open:s,openMobile:o,isMobile:i}=X(),p=i?o:s,d=p?"Hide sidebar":"Show sidebar";return e.jsxs(q,{"data-sidebar":"trigger","aria-expanded":p,"aria-label":d,title:d,"data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:m("size-7",t),onClick:u=>{a?.(u),n()},...r,children:[e.jsx(vt,{}),e.jsx("span",{className:"sr-only",children:d})]})}function Te({className:t,asChild:a=!1,...r}){const n=a?Z:"main";return e.jsx(n,{"data-slot":"sidebar-inset",className:m("bg-background relative flex w-full flex-1 flex-col",`md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0
|
|
45
|
-
md:peer-data-[variant=inset]:rounded-xl
|
|
46
|
-
md:peer-data-[variant=inset]:shadow-sm
|
|
47
|
-
md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,t),...r})}function pa({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:m("flex flex-col gap-2 p-2",t),...a})}function ha({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:m("flex flex-col gap-2 p-2",t),...a})}function fa({className:t,...a}){return e.jsx(Ut,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:m("bg-sidebar-border mx-2 w-auto",t),...a})}function xa({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:m(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto
|
|
48
|
-
group-data-[collapsible=icon]:overflow-hidden`,t),...a})}function ga({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:m("relative flex w-full min-w-0 flex-col p-2",t),...a})}function ba({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:m("w-full text-sm",t),...a})}function ma({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:m("flex w-full min-w-0 flex-col gap-1",t),...a})}function D({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:m("group/menu-item relative",t),...a})}const ja=Be("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function Ne({asChild:t=!1,isActive:a=!1,variant:r="default",size:n="default",tooltip:s,className:o,...i}){const p=t?Z:"button",{isMobile:d,state:u}=X(),x=e.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":n,"data-active":a,className:m(ja({variant:r,size:n}),o),...i});return s?(typeof s=="string"&&(s={children:s}),e.jsxs(ta,{children:[e.jsx(aa,{asChild:!0,children:x}),e.jsx(na,{side:"right",align:"center",hidden:u!=="collapsed"||d,...s})]})):x}function va({onFindProject:t}){return t?e.jsxs("button",{className:"landing-sidebar-search",type:"button",onClick:t,children:[e.jsx(rt,{"aria-hidden":"true"}),e.jsx("span",{children:"Find"}),e.jsx(qt,{children:"K"})]}):null}function ya({folder:t,folderHref:a,workspace:r}){if(!r||r.breadcrumbs.length<=1)return null;const n=[...r.breadcrumbs].reverse();return e.jsx("nav",{"aria-label":"Folder breadcrumbs",className:"landing-breadcrumbs",children:n.map((s,o)=>e.jsxs("span",{children:[o>0?e.jsx("span",{"aria-hidden":"true",children:" / "}):null,s.path===t?e.jsx("span",{"aria-current":"page",children:s.title}):e.jsx("a",{href:a(s.path),children:s.title})]},s.path))})}function Ce({children:t,folder:a,folderHref:r,icon:n,onFindProject:s,onOpenFolder:o,workspace:i}){return e.jsxs(ua,{className:"landing-schema-sidebar",collapsible:"offcanvas",variant:"floating",children:[e.jsxs(pa,{className:"landing-sidebar-header",children:[e.jsxs("p",{className:"landing-sidebar-eyebrow",children:["Folder ",e.jsx("span",{children:"Local"})]}),e.jsx(He,{icon:n,path:a,showPath:!0}),i&&r?e.jsx(ya,{folder:a??"",folderHref:r,workspace:i}):null,e.jsx(va,{onFindProject:s})]}),e.jsx(xa,{children:e.jsx(ga,{children:e.jsx(ba,{children:e.jsx(ma,{children:t})})})}),e.jsx(fa,{}),e.jsx(ha,{className:"landing-sidebar-footer",children:e.jsxs(q,{type:"button",onClick:o,children:[e.jsx(K,{"aria-hidden":"true"}),"Open folder"]})})]})}function wa({documentHref:t,files:a,onOpenPath:r}){return e.jsx(oe,{className:"landing-files",empty:e.jsx("p",{className:"landing-empty",children:"No Markdown files were found."}),getHref:n=>t(n.relativePath),getKey:n=>n.relativePath,getOpenAction:r?n=>{const s=n.openHref?ie(n.openHref):void 0;s&&r(s)}:void 0,getOpenHref:n=>n.openHref,getOpenLabel:n=>`Open ${n.name}`,items:a,renderItem:n=>e.jsxs(e.Fragment,{children:[e.jsx(I,{"aria-hidden":"true"}),e.jsxs("span",{children:[e.jsx("strong",{children:n.name}),e.jsxs("small",{children:[e.jsx("time",{dateTime:new Date(n.activityAt).toISOString(),children:ut(n.activityAt)}),e.jsx("span",{children:" | "}),e.jsx("span",{children:n.relativePath})]})]})]})})}function Se(t){return[...t.values()].sort((a,r)=>a.name.localeCompare(r.name))}function ka(t){const a={children:new Map};for(const r of t){if(!r.relativePath)continue;const n=r.relativePath.split(/[\\/]/).filter(Boolean);let s=a;for(const[o,i]of n.entries()){const p=n.slice(0,o+1).join("/"),d=s.children.get(i)??{children:new Map,name:i,path:p};s.children.set(i,d),s=d}s.project=r}return Se(a.children)}function Pe({assets:t,depth:a,folderHref:r,node:n}){const s=e.jsxs(e.Fragment,{children:[e.jsx("span",{className:"landing-project-icon",children:e.jsx(le,{icon:n.project?.iconAssetKey?t[n.project.iconAssetKey]:void 0})}),e.jsx("span",{children:n.project?.name??n.name}),n.project?e.jsx(ce,{"aria-hidden":"true"}):null]});return e.jsxs("li",{children:[n.project?e.jsx("a",{className:"landing-project-row is-project",href:r(n.project.worktree),style:{paddingLeft:`${a*24+10}px`},children:s}):e.jsx("div",{className:"landing-project-row",style:{paddingLeft:`${a*24+10}px`},children:s}),n.children.size?e.jsx("ul",{children:Se(n.children).map(o=>e.jsx(Pe,{assets:t,depth:a+1,folderHref:r,node:o},o.path))}):null]})}function Ta({assets:t,folderHref:a,projects:r}){return e.jsx("ul",{className:"landing-projects",children:ka(r).map(n=>e.jsx(Pe,{assets:t,depth:0,folderHref:a,node:n},n.path))})}function Na(t){return t==="local"?"(local)":"global"}function Ca({onOpenPath:t,skills:a}){return e.jsx(oe,{className:"landing-skills",empty:e.jsx("p",{className:"landing-empty",children:"No skills were found."}),filteredEmpty:e.jsx("p",{className:"landing-empty",children:"No skills match this filter."}),filters:[{key:"local",label:"Local",predicate:r=>r.source==="local"},{key:"global",label:"Global",predicate:r=>r.source==="global"}],getKey:r=>`${r.source}:${r.relativePath}`,getOpenAction:t?r=>{const n=r.openHref?ie(r.openHref):void 0;n&&t(n)}:void 0,getOpenHref:r=>r.openHref,getOpenLabel:r=>`Open ${r.name}`,items:a,renderItem:r=>e.jsxs(e.Fragment,{children:[e.jsx("strong",{children:r.name}),e.jsx("span",{children:r.description}),e.jsx("small",{children:Na(r.source)})]})})}function Sa({className:t,...a}){return e.jsx(Re,{"data-slot":"tabs",className:m("flex flex-col",t),...a})}function Pa({className:t,...a}){return e.jsx(Ie,{"data-slot":"tabs-list",className:m("inline-flex w-fit items-center",t),...a})}function _a({className:t,...a}){return e.jsx(Me,{"data-slot":"tabs-tab",className:m("inline-flex items-center justify-center gap-1.5 whitespace-nowrap",t),...a})}function Ea({className:t,...a}){return e.jsx(Oe,{"data-slot":"tabs-indicator",className:m("bg-foreground",t),...a})}function Aa({className:t,children:a,...r}){return e.jsxs(Le,{"data-slot":"scroll-area",className:m("relative",t),...r,children:[e.jsx(De,{"data-slot":"scroll-area-viewport",className:`focus-visible:ring-ring/50 size-full rounded-[inherit]
|
|
49
|
-
transition-[color,box-shadow] outline-none focus-visible:ring-[3px]
|
|
50
|
-
focus-visible:outline-1`,children:a}),e.jsx(_e,{}),e.jsx(Fe,{})]})}function _e({className:t,orientation:a="vertical",...r}){return e.jsx(ze,{"data-slot":"scroll-area-scrollbar","data-orientation":a,orientation:a,className:m(`flex touch-none p-px transition-colors select-none
|
|
51
|
-
data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t
|
|
52
|
-
data-horizontal:border-t-transparent data-vertical:h-full
|
|
53
|
-
data-vertical:w-2.5 data-vertical:border-l
|
|
54
|
-
data-vertical:border-l-transparent`,t),...r,children:e.jsx($e,{"data-slot":"scroll-area-thumb",className:"bg-border relative flex-1 rounded-full"})})}function Ra({ariaLabel:t,isSelected:a,items:r}){const n=r.find(s=>a?.(s)??!1)?.key??null;return e.jsx(Sa,{className:"landing-tabnav",value:n,children:e.jsxs(Pa,{"aria-label":t,activateOnFocus:!1,className:"landing-tabnav-list",children:[r.map(s=>e.jsxs(_a,{className:"landing-tabnav-tab",nativeButton:!1,render:e.jsx("a",{"aria-label":`Show ${s.label}`,href:s.href,title:s.label}),value:s.key,children:[s.icon,e.jsx("span",{className:"landing-template-label",children:s.label}),s.error?e.jsx("small",{"aria-label":s.error,className:"text-[#9c3a3a]",title:s.error,children:"!"}):null]},s.key)),e.jsx(Ea,{className:"landing-tabnav-indicator"})]})})}function Ia({ariaLabel:t,isSelected:a,items:r}){return e.jsxs(Aa,{className:"landing-template-tabs-scroll",children:[e.jsx("div",{"aria-label":t,className:"landing-template-tabs",role:"tablist",children:r.map(n=>e.jsx(q,{asChild:!0,className:"landing-template-tab",variant:a?.(n)?"secondary":"ghost",children:e.jsxs("a",{"aria-label":`Show ${n.label}`,"aria-selected":a?.(n)??!1,href:n.href,role:"tab",title:n.label,children:[e.jsx("span",{className:"landing-template-story-icon",children:n.icon}),e.jsx("span",{className:"landing-template-label",children:n.label}),n.error?e.jsx("small",{"aria-label":n.error,className:"text-[#9c3a3a]",title:n.error,children:"!"}):null]})},n.key))}),e.jsx(_e,{className:"landing-template-tabs-scrollbar",orientation:"horizontal"})]})}function Ee({ariaLabel:t="Schema views",renderer:a="tabs",className:r,...n}){return e.jsx("div",{className:m("folder-tabs",r),"data-renderer":a,children:a==="story"?e.jsx(Ia,{ariaLabel:t,...n}):e.jsx(Ra,{ariaLabel:t,...n})})}function F(t){return t==="calendar"?e.jsx(gt,{"aria-hidden":"true"}):t==="tasks"?e.jsx(mt,{"aria-hidden":"true"}):t==="mail"?e.jsx(pt,{"aria-hidden":"true"}):t==="agents"?e.jsx(ft,{"aria-hidden":"true"}):e.jsx(ne,{"aria-hidden":"true"})}function H({children:t,count:a,href:r,icon:n,title:s}){return e.jsxs("section",{className:"landing-section",children:[e.jsxs("header",{children:[e.jsx("h2",{children:r?e.jsxs("a",{href:r,children:[n,s,e.jsx(ce,{"aria-hidden":"true"})]}):e.jsxs(e.Fragment,{children:[n,s]})}),e.jsx("span",{children:a})]}),t]})}function Ma({active:t,children:a,href:r,icon:n}){return e.jsx(D,{children:e.jsx(Ne,{asChild:!0,"aria-current":t?"page":void 0,isActive:t,children:e.jsxs("a",{href:r,children:[n,e.jsx("span",{children:a})]})})})}function Oa({error:t}){return e.jsx("div",{className:"folder-discovery-error",role:"alert",children:e.jsx("p",{children:t})})}function La(){return e.jsx("ul",{className:"landing-list landing-skeleton-list","aria-hidden":"true",children:Array.from({length:8},(t,a)=>e.jsx("li",{children:e.jsxs("div",{children:[e.jsx(S,{className:"landing-skeleton-icon"}),e.jsxs("span",{children:[e.jsx(S,{className:"landing-skeleton-line is-title"}),e.jsx(S,{className:"landing-skeleton-line is-meta"})]}),e.jsx(S,{className:"landing-skeleton-line is-time"}),e.jsx(S,{className:"landing-skeleton-chevron"})]})},a))})}function Da({children:t,error:a,folder:r,onFindProject:n,onOpenFolder:s,pluginHref:o,view:i,tab:p,tabHref:d}){const u=p??"files",x=!!i,j=u==="skills"?"Skills":"Notes",h=[{href:d("files"),icon:e.jsx(I,{"aria-hidden":"true"}),key:"files",label:"Notes"},{href:o("tasks"),icon:F("tasks"),key:"plugin:tasks",label:"Tasks"},{href:d("skills"),icon:e.jsx(L,{"aria-hidden":"true"}),key:"skills",label:"Skills"}];i&&i.pluginId!=="tasks"&&h.push({href:o(i.pluginId),icon:F(i.pluginId),key:`plugin:${i.pluginId}`,label:i.pluginId});const b=t?e.jsxs("div",{className:"landing-sections",children:[a?e.jsx(Oa,{error:a}):null,t]}):a?e.jsxs("section",{className:"landing-section landing-loading-section",children:[e.jsx("header",{children:e.jsxs("h2",{children:[e.jsx(K,{"aria-hidden":"true"}),"Folder"]})}),e.jsxs("div",{className:"landing-loading-error",children:[e.jsx("h1",{children:"Folder activity is unavailable"}),e.jsx("p",{children:a})]})]}):e.jsxs("section",{className:"landing-section landing-loading-section",children:[e.jsxs("header",{children:[e.jsxs("h2",{children:[u==="skills"?e.jsx(L,{"aria-hidden":"true"}):e.jsx(I,{"aria-hidden":"true"}),j]}),e.jsx(S,{className:"landing-skeleton-count"})]}),e.jsx(La,{})]});return e.jsxs("main",{className:"folder-landing","aria-busy":!a&&!x,children:[e.jsx(Ee,{ariaLabel:"Loading folder sections",isSelected:i?f=>f.key===`plugin:${i.pluginId}`:f=>u===f.key,items:h}),e.jsxs(we,{className:"landing-sidebar-shell",defaultOpen:!1,style:{"--sidebar-width":"17rem"},children:[e.jsxs(Ce,{folder:r,icon:e.jsx(K,{"aria-hidden":"true"}),onFindProject:n,...s?{onOpenFolder:s}:{},children:[h.map(f=>e.jsx(Ma,{active:i?f.key===`plugin:${i.pluginId}`:u===f.key,href:f.href,icon:f.icon,children:f.label},f.key)),e.jsx(D,{className:"landing-sidebar-skeleton-item",children:e.jsx(S,{className:"landing-skeleton-menu"})}),e.jsx(D,{className:"landing-sidebar-skeleton-item",children:e.jsx(S,{className:"landing-skeleton-menu is-short"})})]}),e.jsx(Te,{asChild:!0,className:"landing-sidebar-inset",children:e.jsxs("div",{children:[e.jsxs("div",{className:"landing-inset-toolbar",children:[e.jsx(ke,{className:"landing-sidebar-toggle"}),e.jsx(re,{actions:se({folderPath:r,onOpenFolder:s})})]}),b]})})]})]})}function Fa({children:t,collectionHref:a,collectionId:r,data:n,documentHref:s,error:o,folder:i,folderHref:p,onFindProject:d,onOpenFolder:u,onOpenPath:x,pluginHref:j,view:h,tab:b,tabHref:f}){const g=n?.skills?.items??[],k=n?.plugins?.items??[],v=n?.workspace?.schemas??[];if(!n)return e.jsx(Da,{children:t,error:o,folder:i,onFindProject:d,onOpenFolder:u,tab:b,tabHref:f,pluginHref:j,view:h});const y=n.projects.items.filter(c=>c.relativePath),N=n.files.items.filter(c=>!c.folder).slice(0,5),T=b==="skills",E=!!h,C=!b&&!h&&!r,P=[{count:n.files.items.length,href:f("files"),icon:e.jsx(I,{"aria-hidden":"true"}),key:"files",label:"Notes"},{count:k.find(c=>c.id==="tasks")?.count??0,error:k.find(c=>c.id==="tasks")?.error,href:j("tasks"),icon:F("tasks"),key:"plugin:tasks",label:"Tasks",view:{id:"tasks",type:"plugin"}},{count:g.length,href:f("skills"),icon:e.jsx(L,{"aria-hidden":"true"}),key:"skills",label:"Skills",view:{skills:!0,type:"skills"}},...k.filter(c=>c.id!=="tasks").map(c=>({count:c.count??0,error:c.error,href:j(c.id),icon:F(c.id),key:`plugin:${c.id}`,label:c.label,view:{id:c.id,type:"plugin"}})),...v.map(c=>({count:c.count??0,error:c.diagnostics?.length?c.diagnostics.map(Ae=>Ae.message).join("; "):void 0,href:a&&c.id?a(c.id):p(c.folder),icon:e.jsx(dt,{name:c.icon}),key:`folder:${c.folder}`,label:c.navLabel??c.title,view:{type:"folder",id:c.id}}))],A=t??e.jsxs("div",{className:"landing-sections",children:[T?e.jsx(H,{count:g.length,icon:e.jsx(L,{"aria-hidden":"true"}),title:"Skills",children:e.jsx(Ca,{onOpenPath:x,skills:g})}):null,b==="projects"&&y.length?e.jsx(H,{count:y.length,href:b?void 0:f("projects"),icon:e.jsx(ne,{"aria-hidden":"true"}),title:"Projects",children:e.jsx(Ta,{assets:n.assets,folderHref:p,projects:n.projects.items})}):null,C?e.jsx(H,{count:n.files.items.length,href:f("files"),icon:e.jsx(I,{"aria-hidden":"true"}),title:"Notes",children:e.jsx(wa,{documentHref:s,files:N,onOpenPath:x})}):null]}),R=c=>c.view?.type==="folder"?!!(r&&c.view.id===r):c.view?.type==="plugin"?E&&c.view.id===h?.pluginId:c.view?.type==="skills"?T:b==="files"||C;return e.jsx("main",{className:"folder-landing",children:P.length>1?e.jsxs(e.Fragment,{children:[e.jsx(Ee,{items:P,isSelected:R}),e.jsxs(we,{className:"landing-sidebar-shell",defaultOpen:!1,style:{"--sidebar-width":"17rem"},children:[e.jsx(Ce,{folder:n.folder,folderHref:p,icon:e.jsx(le,{icon:n.iconAssetKey?n.assets[n.iconAssetKey]:void 0}),onFindProject:d,workspace:n.workspace,...u?{onOpenFolder:u}:{},children:P.map(c=>e.jsx(D,{children:e.jsx(Ne,{asChild:!0,"aria-current":R(c)?"page":void 0,isActive:R(c),children:e.jsxs("a",{href:c.href,title:c.error??void 0,children:[c.icon,e.jsx("span",{children:c.label}),c.error?e.jsx("span",{className:"text-[#9c3a3a]",children:"!"}):null]})})},c.key))}),e.jsx(Te,{asChild:!0,className:"landing-sidebar-inset",children:e.jsxs("div",{children:[e.jsxs("div",{className:"landing-inset-toolbar",children:[e.jsx(ke,{className:"landing-sidebar-toggle"}),e.jsx(re,{actions:se({folderPath:n.folder,onOpenFolder:u})})]}),A]})})]})]}):A})}function xn({children:t,collectionHref:a,collectionId:r,data:n,documentHref:s,error:o,folder:i,folderHref:p,onFindProject:d,onOpenFolder:u,onOpenPath:x,pluginHref:j,tab:h,tabHref:b,view:f}){return e.jsx(Fa,{children:t,collectionHref:a,collectionId:r,data:n,documentHref:s,error:o,folder:i,folderHref:p,onFindProject:d,onOpenFolder:u,onOpenPath:x,pluginHref:j,tab:h,tabHref:b,view:f})}export{xn as FolderLanding};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as L,j as l}from"./react-DZzLHL-l.js";import{u as w}from"./link-DC_1Z6Yy.js";import{E as x}from"./external-link-BXmSXqqF.js";function H(s){try{return new URL(s,"http://127.0.0.1").searchParams.get("path")??void 0}catch{return}}function P({className:s,empty:r,filteredEmpty:j=r,filters:t=[],getClassName:g,getHref:f,getKey:b,getOpenAction:o,getOpenHref:k,getOpenLabel:y,items:e,renderActions:v,renderItem:N}){const[c,m]=L.useState("all"),F=w(),i=t.find(n=>n.key===c),d=i?e.filter(i.predicate):e;return e.length?l.jsxs(l.Fragment,{children:[t.length?l.jsx("div",{className:"landing-list-filters",children:[{count:e.length,key:"all",label:"All"},...t.map(n=>({count:e.filter(n.predicate).length,key:n.key,label:n.label}))].map(n=>l.jsxs("button",{"aria-pressed":c===n.key,onClick:()=>m(n.key),type:"button",children:[n.label,l.jsx("small",{children:n.count})]},n.key))}):null,d.length?l.jsx("ul",{className:`landing-list ${s}`,children:d.map(n=>{const h=f?.(n),u=k?.(n),p=N(n),a=y?.(n)??"Open item";return l.jsxs("li",{className:g?.(n),children:[h?l.jsx(F,{className:"landing-list-row",href:h,children:p}):l.jsx("div",{className:"landing-list-row",children:p}),u?o?l.jsx("button",{className:"landing-list-open",type:"button","aria-label":a,title:a,onClick:()=>o(n),children:l.jsx(x,{"aria-hidden":"true"})}):l.jsx("a",{className:"landing-list-open",href:u,"aria-label":a,title:a,children:l.jsx(x,{"aria-hidden":"true"})}):null,v?.(n)]},b(n))})}):l.jsx(l.Fragment,{children:j})]}):l.jsx(l.Fragment,{children:r})}export{P as F,H as o};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{r as m,j as t}from"./react-DZzLHL-l.js";import{c as i}from"./utils-CwHGE3BB.js";import{F as f}from"./index-p38i_yyY.js";import{C as p}from"./button-BJ7z-ZA7.js";function u(r){return r?.replace(/[\\/]+$/,"").split(/[\\/]/).at(-1)??"Folder"}async function x(r){if(navigator.clipboard?.writeText){await navigator.clipboard.writeText(r);return}const e=document.createElement("textarea");e.value=r,e.setAttribute("readonly",""),e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),e.remove()}function h({className:r,icon:e,path:a,name:o=u(a),showPath:s=!1}){const[c,n]=m.useState(!1),d=async()=>{if(a)try{await x(a),n(!0),window.setTimeout(()=>n(!1),1500)}catch{}},l=t.jsxs(t.Fragment,{children:[t.jsx("span",{"aria-hidden":"true",className:"folder-metadata-icon",children:e??t.jsx(f,{className:"size-3.5"})}),t.jsx("span",{className:"folder-metadata-name",children:o}),a&&s?t.jsx("small",{className:"folder-metadata-path",title:a,children:a}):null,c?t.jsx(p,{"aria-hidden":"true",className:"folder-metadata-copied"}):null]});return a?t.jsx("button",{"aria-label":`Copy ${o} folder path to the clipboard`,className:i(`folder-metadata inline-flex max-w-full min-w-0 cursor-pointer
|
|
2
|
-
items-center gap-1.5 bg-transparent p-0 text-left font-normal`,r),title:a,type:"button",onClick:()=>{d()},children:l}):t.jsx("div",{className:i("folder-metadata inline-flex max-w-full min-w-0 items-center gap-1.5",r),children:l})}export{h as F,u as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as r}from"./react-DZzLHL-l.js";import{f as l}from"./app-options-XEWvevsz.js";import{A as d}from"./app-view-header-BKZ90ToF.js";import{F as x}from"./folder-image-AXBrHUcU.js";import"./markdown-njUwQKsR.js";import"./copy-context-Cl1TE2PJ.js";import"./button-BJ7z-ZA7.js";import"./view-context-D-fh9AbH.js";import"./index-DztTMDFz.js";import"./tanstack-CD46mJkU.js";import"./utils-CwHGE3BB.js";import"./copy-Ikmr6Iq2.js";import"./index-eL1k96k8.js";import"./index-DmrKjrlM.js";import"./index-p38i_yyY.js";import"./collection-icon-TbOVyORG.js";import"./calendar-days-DWh2XMO2.js";import"./file-text-CiiSsCDq.js";import"./popover-Cmmgj-MJ.js";import"./chevron-down-C5oRtqbX.js";function y({backHref:i,backLabel:m="Back",canOpen:t,folder:o,homeHref:p,icon:e,name:a,onOpen:s,onOpenFolder:n,rightAction:c,...f}){return r.jsxs(r.Fragment,{children:[r.jsx(d,{...f,className:"mobile-view-header",folder:o,homeHref:p,name:a,icon:r.jsx(x,{icon:e}),actions:l({backHref:i,backLabel:m,canBrowse:t,folderPath:o,onBrowse:s,onOpenFolder:n})}),c]})}export{y as FolderMobileBar};
|