vite-hub 0.4.1 → 0.5.1
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 +38 -14
- package/dist/_internal/runtime/browser-errors.d.ts +12 -4
- package/dist/_internal/runtime/browser-errors.js +69 -27
- package/dist/_internal/runtime/redirects.d.ts +1 -2
- package/dist/_internal/runtime/redirects.js +2 -3
- package/dist/_internal/runtime/request-policy.d.ts +11 -2
- package/dist/_internal/runtime/request-policy.js +25 -6
- package/dist/_internal/runtime/security.d.ts +1 -2
- package/dist/_internal/runtime/security.js +16 -3
- package/dist/{access-BDST818p.js → access-BBHk9b5P.js} +30 -20
- package/dist/{access-policy-DjBKLo3c.js → access-policy-BM48XstY.js} +5 -6
- package/dist/{access-policy-CGXhO3Ee.d.ts → access-policy-CUbJLvlR.d.ts} +4 -8
- package/dist/{account-BnOAU055.d.ts → account-CoAO1F8G.d.ts} +9 -7
- package/dist/agent/invocations/postgres.d.ts +1 -0
- package/dist/agent/invocations/postgres.js +2 -0
- package/dist/{agent-invocations.post-CcPvfA0n.js → agent-invocations.post-BAC1aHnG.js} +16 -18
- package/dist/agents-BClUWOj7.js +1 -0
- package/dist/{agents-BDeazoAW.js → agents-Cz_uhhov.js} +4 -5
- package/dist/{agents-C94A4N9u.d.ts → agents-Gyw4VKPt.d.ts} +0 -2
- package/dist/auth/server.js +1 -2
- package/dist/{auth-BZOy7obk.d.ts → auth-CeKxL2xp.d.ts} +4 -8
- package/dist/{auth-operations-GcQk0O0X.js → auth-operations-arLIY2_2.js} +1 -2
- package/dist/{auth-types-CyqhWvYF.d.ts → auth-types-B4mq4YhK.d.ts} +1 -4
- package/dist/bin.js +34 -23
- package/dist/blob/nuxt-image.js +1 -2
- package/dist/{blob-CFLwMsjH.d.ts → blob-_TtxDb-t.d.ts} +1 -3
- package/dist/{blob-CpvlM8jp.js → blob-eH6j0AQj.js} +5 -6
- package/dist/browser-error-limits-B0yS95zt.js +24 -0
- package/dist/cache/operations.d.ts +2 -4
- package/dist/cache/operations.js +3 -4
- package/dist/cache.d.ts +1 -3
- package/dist/cache.js +2 -3
- package/dist/choices/testing.d.ts +1 -0
- package/dist/choices/testing.js +2 -0
- package/dist/{cli-config-wxKjF2Y0.js → cli-config-BX8H4ZCo.js} +12 -5
- package/dist/cli-config-DgpmE_7z.js +1 -0
- package/dist/cloudflare-app-types.d.ts +18 -0
- package/dist/{cloudflare-env-lookup-DKXdr4P_.js → cloudflare-env-lookup-DcN7pGlv.js} +1 -2
- package/dist/cms.js +1 -2
- package/dist/console/auth-types.d.ts +1 -1
- package/dist/console/auth.d.ts +1 -3
- package/dist/console/auth.js +2 -3
- package/dist/console/runtime/auth-operations.d.ts +1 -3
- package/dist/console/runtime/auth-operations.js +1 -2
- package/dist/console/runtime/client/account-views.d.ts +1 -3
- package/dist/console/runtime/client/account-views.js +1 -2
- package/dist/console/runtime/client/account.d.ts +1 -1
- package/dist/console/runtime/client/account.js +36 -48
- package/dist/console/runtime/client/add-primitive.ts +2 -2
- package/dist/console/runtime/client/appearance.d.ts +1 -2
- package/dist/console/runtime/client/appearance.js +1 -2
- package/dist/console/runtime/client/blob-media.d.ts +2 -4
- package/dist/console/runtime/client/blob-media.js +5 -6
- package/dist/console/runtime/client/comment-thread.d.ts +1 -3
- package/dist/console/runtime/client/comment-thread.js +11 -5
- package/dist/console/runtime/client/content-heads.d.ts +1 -2
- package/dist/console/runtime/client/content-heads.js +2 -3
- package/dist/console/runtime/client/documents.d.ts +2 -2
- package/dist/console/runtime/client/documents.js +1 -2
- package/dist/console/runtime/client/editor.d.ts +3 -5
- package/dist/console/runtime/client/editor.js +1 -2
- package/dist/console/runtime/client/env-groups.d.ts +1 -3
- package/dist/console/runtime/client/env-groups.js +1 -2
- package/dist/console/runtime/client/env-status.d.ts +1 -3
- package/dist/console/runtime/client/env-status.js +1 -2
- package/dist/console/runtime/client/format.d.ts +1 -3
- package/dist/console/runtime/client/format.js +1 -2
- package/dist/console/runtime/client/invocation-deletion.d.ts +1 -2
- package/dist/console/runtime/client/invocation-deletion.js +1 -2
- package/dist/console/runtime/client/invocation.d.ts +1 -2
- package/dist/console/runtime/client/invocation.js +4 -5
- package/dist/console/runtime/client/live.d.ts +2 -4
- package/dist/console/runtime/client/live.js +1 -2
- package/dist/console/runtime/client/mcp-client.d.ts +6 -4
- package/dist/console/runtime/client/mcp-client.js +12 -5
- package/dist/console/runtime/client/media-library.d.ts +1 -1
- package/dist/console/runtime/client/media-library.js +1 -2
- package/dist/console/runtime/client/media-uploads.d.ts +2 -4
- package/dist/console/runtime/client/media-uploads.js +2 -3
- package/dist/console/runtime/client/media.d.ts +1 -1
- package/dist/console/runtime/client/media.js +1 -2
- package/dist/console/runtime/client/operation-view.d.ts +2 -4
- package/dist/console/runtime/client/operation-view.js +4 -5
- package/dist/console/runtime/client/presence.d.ts +2 -4
- package/dist/console/runtime/client/presence.js +1 -2
- package/dist/console/runtime/client/preview.d.ts +1 -3
- package/dist/console/runtime/client/preview.js +1 -2
- package/dist/console/runtime/client/problem.d.ts +2 -4
- package/dist/console/runtime/client/problem.js +3 -4
- package/dist/console/runtime/client/project-link.d.ts +2 -2
- package/dist/console/runtime/client/project-link.js +1 -2
- package/dist/console/runtime/client/project-session.d.ts +19 -10
- package/dist/console/runtime/client/project-session.js +1 -723
- package/dist/console/runtime/client/project.d.ts +1 -3
- package/dist/console/runtime/client/project.js +1 -2
- package/dist/console/runtime/client/projects.d.ts +1 -1
- package/dist/console/runtime/client/projects.js +1 -2
- package/dist/console/runtime/client/publish.d.ts +2 -4
- package/dist/console/runtime/client/publish.js +1 -2
- package/dist/console/runtime/client/rate-limit.d.ts +1 -3
- package/dist/console/runtime/client/rate-limit.js +3 -4
- package/dist/console/runtime/client/read-only.d.ts +2 -4
- package/dist/console/runtime/client/read-only.js +2 -3
- package/dist/console/runtime/client/request.d.ts +2 -70
- package/dist/console/runtime/client/request.js +1 -2
- package/dist/console/runtime/client/route-query.d.ts +4 -5
- package/dist/console/runtime/client/route-query.js +1 -2
- package/dist/console/runtime/client/schedule-run.d.ts +1 -3
- package/dist/console/runtime/client/schedule-run.js +3 -4
- package/dist/console/runtime/client/schema-form.d.ts +1 -1
- package/dist/console/runtime/client/schema-form.js +1 -2
- package/dist/console/runtime/client/sections.d.ts +1 -1
- package/dist/console/runtime/client/sections.js +1 -2
- package/dist/console/runtime/client/site-access.d.ts +41 -10
- package/dist/console/runtime/client/site-access.js +157 -28
- package/dist/console/runtime/client/stored.d.ts +1 -3
- package/dist/console/runtime/client/stored.js +1 -2
- package/dist/console/runtime/client/ticket.d.ts +1 -1
- package/dist/console/runtime/client/ticket.js +1 -2
- package/dist/console/runtime/client/toast.d.ts +1 -3
- package/dist/console/runtime/client/toast.js +1 -2
- package/dist/console/runtime/client/workflow.d.ts +1 -3
- package/dist/console/runtime/client/workflow.js +3 -4
- package/dist/console/runtime/components/console-account-api-keys.vue +4 -4
- package/dist/console/runtime/components/console-account-home.vue +230 -51
- package/dist/console/runtime/components/console-account-link.vue +8 -5
- package/dist/console/runtime/components/console-account-setup.vue +10 -7
- package/dist/console/runtime/components/console-account-shell.vue +13 -19
- package/dist/console/runtime/components/console-account-unlink.vue +2 -3
- package/dist/console/runtime/components/console-app-settings.vue +8 -2
- package/dist/console/runtime/components/console-app.vue +1 -10
- package/dist/console/runtime/components/console-auth-activity.vue +2 -2
- package/dist/console/runtime/components/console-auth-chart.vue +1 -1
- package/dist/console/runtime/components/console-auth-overview.vue +1 -1
- package/dist/console/runtime/components/console-auth.vue +4 -4
- package/dist/console/runtime/components/console-comment-thread.vue +1 -1
- package/dist/console/runtime/components/console-definitions.vue +4 -4
- package/dist/console/runtime/components/console-document-dashboard.vue +2 -2
- package/dist/console/runtime/components/console-document-list.vue +2 -2
- package/dist/console/runtime/components/console-document-settings.vue +1 -1
- package/dist/console/runtime/components/console-env.vue +3 -3
- package/dist/console/runtime/components/console-home.vue +220 -311
- package/dist/console/runtime/components/console-hosted-comments-embed.vue +106 -0
- package/dist/console/runtime/components/console-loading.vue +1 -1
- package/dist/console/runtime/components/console-mcp-callback.vue +6 -1
- package/dist/console/runtime/components/console-mcp-connection.vue +3 -3
- package/dist/console/runtime/components/console-mcp-items.vue +4 -17
- package/dist/console/runtime/components/console-media-browser.vue +20 -30
- package/dist/console/runtime/components/console-media-crops.vue +3 -2
- package/dist/console/runtime/components/console-media-uploads.vue +11 -7
- package/dist/console/runtime/components/console-page-toolbar.vue +5 -10
- package/dist/console/runtime/components/console-schema-list.vue +85 -31
- package/dist/console/runtime/components/console-search-palette.vue +14 -5
- package/dist/console/runtime/components/console-section.vue +2 -1
- package/dist/console/runtime/components/console-session-inspector.vue +5 -0
- package/dist/console/runtime/components/console-session.css +8 -2
- package/dist/console/runtime/components/console-settings-value.vue +4 -5
- package/dist/console/runtime/components/console-sidebar.vue +9 -8
- package/dist/console/runtime/components/console-site.vue +36 -15
- package/dist/console/runtime/components/console-stat-grid.vue +3 -2
- package/dist/console/runtime/components/console-toaster.vue +3 -2
- package/dist/console/runtime/components/console-usage-chart.vue +1 -1
- package/dist/console/runtime/components/console-usage.vue +36 -18
- package/dist/console/runtime/components/invocation/internal/brand-icons.ts +10 -0
- package/dist/console/runtime/components/invocation/internal/invocation-brand.ts +6 -2
- package/dist/console/runtime/components/invocation/invocation.css +4 -27
- package/dist/console/runtime/console-route.d.ts +1 -3
- package/dist/console/runtime/console-route.js +1 -2
- package/dist/console/runtime/definitions.d.ts +1 -1
- package/dist/console/runtime/definitions.js +1 -2
- package/dist/console/runtime/diagnostics.ts +8 -1
- package/dist/console/runtime/mcp-client.d.ts +1 -1
- package/dist/console/runtime/mcp-client.js +1 -2
- package/dist/console/runtime/page/loader.js +45 -52
- package/dist/console/runtime/page-tool/account.js +26 -0
- package/dist/console/runtime/page-tool/page-tool.js +2 -3
- package/dist/console/runtime/public/skills/index.json +1 -1
- package/dist/console/runtime/public/skills/vitehub/SKILL.md +50 -7
- package/dist/console/runtime/public/skills/vitehub/agents/openai.yaml +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/primitives/channels.md +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/primitives/email.md +1 -1
- package/dist/console/runtime/public/skills/vitehub/references/project-shapes.md +1 -1
- package/dist/console/runtime/rpc.d.ts +1 -1
- package/dist/console/runtime/rpc.js +1 -2
- package/dist/console/runtime/sections.d.ts +1 -1
- package/dist/console/runtime/sections.js +1 -2
- package/dist/console/runtime/server/access-policy.d.ts +1 -1
- package/dist/console/runtime/server/access-policy.js +1 -2
- package/dist/console/runtime/server/agents.get.d.ts +2 -3
- package/dist/console/runtime/server/agents.get.js +3 -4
- package/dist/console/runtime/server/auth.d.ts +1 -1
- package/dist/console/runtime/server/auth.js +4 -5
- package/dist/console/runtime/server/blob.d.ts +1 -1
- package/dist/console/runtime/server/blob.js +1 -2
- package/dist/console/runtime/server/channel-replay.d.ts +3 -5
- package/dist/console/runtime/server/channel-replay.js +7 -7
- package/dist/console/runtime/server/database.d.ts +1 -1
- package/dist/console/runtime/server/database.get.d.ts +2 -3
- package/dist/console/runtime/server/database.get.js +4 -5
- package/dist/console/runtime/server/database.js +1 -2
- package/dist/console/runtime/server/definitions.d.ts +1 -1
- package/dist/console/runtime/server/definitions.get.d.ts +4 -6
- package/dist/console/runtime/server/definitions.get.js +5 -6
- package/dist/console/runtime/server/definitions.js +1 -2
- package/dist/console/runtime/server/development.d.ts +1 -1
- package/dist/console/runtime/server/development.js +1 -2
- package/dist/console/runtime/server/documents.d.ts +1 -1
- package/dist/console/runtime/server/documents.js +2 -2
- package/dist/console/runtime/server/env.d.ts +1 -3
- package/dist/console/runtime/server/env.get.d.ts +2 -4
- package/dist/console/runtime/server/env.get.js +7 -8
- package/dist/console/runtime/server/env.js +1 -2
- package/dist/console/runtime/server/invocation-capabilities.get.d.ts +1 -3
- package/dist/console/runtime/server/invocation-capabilities.get.js +4 -5
- package/dist/console/runtime/server/invocation-workspace.get.d.ts +3 -5
- package/dist/console/runtime/server/invocation-workspace.get.js +6 -7
- package/dist/console/runtime/server/invocation.get.d.ts +3 -5
- package/dist/console/runtime/server/invocation.get.js +8 -9
- package/dist/console/runtime/server/invocations.get.d.ts +1 -2
- package/dist/console/runtime/server/invocations.get.js +5 -6
- package/dist/console/runtime/server/logs.get.d.ts +3 -5
- package/dist/console/runtime/server/logs.get.js +7 -8
- package/dist/console/runtime/server/mcp-client-operations.d.ts +2 -4
- package/dist/console/runtime/server/mcp-client-operations.js +5 -7
- package/dist/console/runtime/server/operation-contributions.d.ts +1 -1
- package/dist/console/runtime/server/operation-contributions.js +1 -2
- package/dist/console/runtime/server/page-auth.d.ts +2 -4
- package/dist/console/runtime/server/page-auth.js +1 -2
- package/dist/console/runtime/server/page-tool.d.ts +1 -1
- package/dist/console/runtime/server/page-tool.js +12 -7
- package/dist/console/runtime/server/page-tools-route.d.ts +2 -0
- package/dist/console/runtime/server/page-tools-route.js +4 -0
- package/dist/console/runtime/server/rpc.d.ts +3 -5
- package/dist/console/runtime/server/rpc.js +12 -13
- package/dist/console/runtime/server/runtime.d.ts +1 -1
- package/dist/console/runtime/server/runtime.js +1 -2
- package/dist/console/runtime/server/search.get.d.ts +1 -3
- package/dist/console/runtime/server/search.get.js +3 -5
- package/dist/console/runtime/server/sections.d.ts +5 -5
- package/dist/console/runtime/server/sections.get.d.ts +1 -1
- package/dist/console/runtime/server/sections.get.js +8 -9
- package/dist/console/runtime/server/sections.js +6 -6
- package/dist/console/runtime/server/setup.d.ts +5 -5
- package/dist/console/runtime/server/setup.js +5 -5
- package/dist/console/runtime/server/site-entry.d.ts +1 -3
- package/dist/console/runtime/server/site-entry.js +15 -10
- package/dist/console/runtime/server/site-session.d.ts +12 -22
- package/dist/console/runtime/server/site-session.js +1 -2
- package/dist/console/runtime/server/status.get.d.ts +2 -4
- package/dist/console/runtime/server/status.get.js +6 -7
- package/dist/console/runtime/server/tickets.d.ts +1 -1
- package/dist/console/runtime/server/tickets.js +1 -2
- package/dist/console/runtime/server/usage.get.d.ts +2 -4
- package/dist/console/runtime/server/usage.get.js +8 -9
- package/dist/console/runtime/server/workspace-files.get.d.ts +3 -5
- package/dist/console/runtime/server/workspace-files.get.js +4 -5
- package/dist/console/runtime/site-access.d.ts +1 -1
- package/dist/console/runtime/site-access.js +1 -2
- package/dist/console/runtime/skills.d.ts +1 -3
- package/dist/console/runtime/skills.js +1 -2
- package/dist/console/server.d.ts +7 -11
- package/dist/console/server.js +8 -8
- package/dist/console/ui.d.ts +0 -10
- package/dist/console/ui.js +32 -28
- package/dist/console-lazy-views-VEjcbL4Q.js +1 -0
- package/dist/{console-route-CBuqZ4wO.js → console-route-DbdnLkkF.js} +3 -4
- package/dist/console.d.ts +1 -3
- package/dist/console.js +1 -2
- package/dist/{database-DyPVMjp_.d.ts → database-CPjZ3L0g.d.ts} +1 -3
- package/dist/{database-BdOBjPkS.js → database-CrgBUdIx.js} +3 -4
- package/dist/definition-catalog-1xPPtzOx.js +137 -0
- package/dist/definition-catalog-M5ua7JRS.js +1 -0
- package/dist/{definitions-BW6SvmMM.js → definitions-BFYqXchw.js} +1 -2
- package/dist/{definitions-DB4LbZ7T.d.ts → definitions-ChvMnA1L.d.ts} +0 -2
- package/dist/{definitions-Dbgxfz3I.d.ts → definitions-DRkgHKmk.d.ts} +1 -3
- package/dist/{definitions-CNq_Shkh.js → definitions-M7i2p8SR.js} +5 -6
- package/dist/deployment-CURATxjG.js +229 -0
- package/dist/deployment-l7RuKdEp.js +1 -0
- package/dist/{dev-peer-am78OsHH.js → dev-peer-DBq-isgi.js} +7 -6
- package/dist/{development-zLxOp-AO.js → development-DD567hhJ.js} +2 -3
- package/dist/{development-W5EwONyL.d.ts → development-I40mfD7B.d.ts} +1 -3
- package/dist/{diagnostics-9U_fYxMy.js → diagnostics-B2cqlCSz.js} +3 -3
- package/dist/{diagnostics-CjGiniKb.d.ts → diagnostics-BXxPggRw.d.ts} +1 -3
- package/dist/docs/nuxt.js +1 -2
- package/dist/doctor.d.ts +0 -6
- package/dist/doctor.js +15078 -2377
- package/dist/{documents-CjJTCrY8.js → documents-BOYwZ5g4.js} +7 -8
- package/dist/{documents-qrHHqlNU.js → documents-Ck_iub9w.js} +4 -5
- package/dist/{documents-BASIRZ91.d.ts → documents-DxK0tdjA.d.ts} +3 -5
- package/dist/{documents-CboVhYFz.d.ts → documents-LtkKCxtu.d.ts} +4 -8
- package/dist/durability/operations.d.ts +2 -4
- package/dist/durability/operations.js +3 -4
- package/dist/email/vue.d.ts +1 -0
- package/dist/email/vue.js +2 -0
- package/dist/{entries-Bj-jPs_J.js → entries-UFs9n1MB.js} +2 -3
- package/dist/{env-Dg1I_DWr.js → env-D-wtSupz.js} +2 -3
- package/dist/{error-diagnostics-Bm3JKYjz.js → error-diagnostics-CBtvqI30.js} +33 -22
- package/dist/{operation-definition-a5keEpCd.js → error-diagnostics-kKXseq8d.js} +11 -169
- package/dist/error-diagnostics.ts +33 -23
- package/dist/{optional-owners-BNA2OX6z.js → features-BXRKlmtN.js} +57 -345
- package/dist/features-CD5i5I8V.js +1 -0
- package/dist/{format-BOYlanIZ.js → format-Df-bS4Ly.js} +1 -2
- package/dist/gateways/testing.d.ts +1 -0
- package/dist/gateways/testing.js +2 -0
- package/dist/github-login-W-vaahWP.js +6 -0
- package/dist/{host-CkL0jjBq.js → host-DeNPYIeV.js} +1 -2
- package/dist/{http-error-Bs6e8_-8.js → http-error-BorAxJYM.js} +1 -2
- package/dist/index.d.ts +2 -8
- package/dist/index.js +5 -6
- package/dist/inspect-CWwAuL-B.js +47 -0
- package/dist/internal/agent-invocations-libsql.js +1 -2
- package/dist/internal/disabled-redis-driver.d.ts +1 -3
- package/dist/internal/disabled-redis-driver.js +2 -3
- package/dist/internal/disabled-upstash-driver.d.ts +1 -3
- package/dist/internal/disabled-upstash-driver.js +2 -3
- package/dist/internal/test-loader.d.ts +1 -3
- package/dist/internal/test-loader.js +2 -3
- package/dist/internal/test-server.js +2 -3
- package/dist/{internal-BreyUsQ6.js → internal-0C_CC601.js} +1 -2
- package/dist/{internal-CO4OqqaS.d.ts → internal-CKocv79I.d.ts} +3 -7
- package/dist/{invariant-DolT9EEx.js → invariant-Dj2R1eMr.js} +1 -2
- package/dist/{invocation-page-undo-DIZ-s3xT.js → invocation-page-undo-BEi-rO0Q.js} +5 -6
- package/dist/{invocations-CK_-G540.js → invocations-8NThe8Bx.js} +5 -6
- package/dist/{limits-BUlwWYQE.js → limits-BLo31qDR.js} +1 -2
- package/dist/logs/client.d.ts +19 -0
- package/dist/logs/client.js +11 -0
- package/dist/logs/host.d.ts +2 -4
- package/dist/logs/host.js +1 -2
- package/dist/logs/memory.d.ts +1 -1
- package/dist/logs/memory.js +1 -2
- package/dist/logs/source.d.ts +1 -1
- package/dist/logs/source.js +1 -2
- package/dist/logs.d.ts +2 -2
- package/dist/logs.js +2 -2
- package/dist/{mcp-client-CTbTbn7d.js → mcp-client-Bkh-khvr.js} +1 -2
- package/dist/{mcp-client-By4zk0vU.js → mcp-client-DiObFpDS.js} +35 -22
- package/dist/{mcp-client-C_sEmyQw.d.ts → mcp-client-Q2XbUXuP.d.ts} +1 -4
- package/dist/{media-uKX4Wy-c.d.ts → media-C79RB1oH.d.ts} +0 -2
- package/dist/{media-BHpQ-4jw.js → media-CAKz9yrp.js} +8 -9
- package/dist/{media-library-NaOMBKWS.js → media-library-BDX89xXA.js} +5 -6
- package/dist/{media-library-D9ThbXqs.d.ts → media-library-DxGu6w9z.d.ts} +0 -2
- package/dist/{memory-DTmq-Z6x.js → memory-D3EJS_Bp.js} +21 -10
- package/dist/{memory-2bbl4hcV.d.ts → memory-GK5ZGWrp.d.ts} +1 -3
- package/dist/nuxt-server-auto-imports-4aT5BD4u.js +74 -0
- package/dist/{nuxt-server-imports-DH60Z7LA.js → nuxt-server-imports-BdJqiVhT.js} +10 -18
- package/dist/nuxt.d.ts +1 -3
- package/dist/nuxt.js +339 -189
- package/dist/{object-D8pRdprI.js → object-DRSmpe04.js} +1 -2
- package/dist/{operation-contributions-DpkO_iSU.d.ts → operation-contributions-BCcQVlGb.d.ts} +1 -3
- package/dist/{operation-contributions-BdS0z3tx.js → operation-contributions-D10pjkJF.js} +4 -5
- package/dist/operation-definition-DTpNvLd8.js +164 -0
- package/dist/{operation-registry-BogGwk_I.js → operation-registry-DfQbL7vE.js} +1 -2
- package/dist/{operation-rpc-DI9txNxK.js → operation-rpc-BMdfapja.js} +3 -4
- package/dist/{operations-EOdyctDc.js → operations-CD_mu_Ww.js} +86 -9
- package/dist/operations-D7ENc68Y.js +1 -0
- package/dist/{operations-B0689BG1.d.ts → operations-DgFhA1WE.d.ts} +8 -6
- package/dist/{operations-CWP9dF3i.js → operations-vRLiH7dh.js} +35 -46
- package/dist/optional-owners-DAfShdgV.js +353 -0
- package/dist/out-Cw5Tvr92.js +20989 -0
- package/dist/{owned-paths-BnjT0FhU.js → owned-paths-MjjDftBn.js} +1 -2
- package/dist/page/pill.iife.js +25 -27
- package/dist/{page-tool-CRCK1RHV.d.ts → page-tool-BUnUbuSy.d.ts} +6 -7
- package/dist/{page-tools-BkSSBFoi.js → page-tools-BQzwuAHD.js} +28 -12
- package/dist/{page-tools-sw4I-Nqx.d.ts → page-tools-UwsfvH-B.d.ts} +2 -4
- package/dist/{page-tools-shared-D3fFoEV2.js → page-tools-shared-hJcG_xk8.js} +8 -5
- package/dist/{inspect-CDw7e0vK.js → pathe.M-eThtNZ-D4EC7Wue.js} +2 -31
- package/dist/{plugins-BqAtIEX2.d.ts → plugins-BpiTVULl.d.ts} +252 -262
- package/dist/{plugins-B-DpgDPB.js → plugins-H6-MQrsn.js} +3483 -797
- package/dist/presets/workspace.js +1 -2
- package/dist/project-BxyyclTE.js +58 -0
- package/dist/{project-CufkVP1u.d.ts → project-DKBIHOf4.d.ts} +16 -4
- package/dist/{project-DlWTGB7h.js → project-DRC67Uiu.js} +1 -2
- package/dist/{project-link-D-6UefhA.js → project-link-CeS0T8Pr.js} +57 -9
- package/dist/{project-link-BuOzBH9f.d.ts → project-link-isfdRO3Q.d.ts} +42 -6
- package/dist/{project-root-v6ba4tn7.js → project-root-mAVQGZTX.js} +1 -2
- package/dist/project-session--GN7MduT.js +764 -0
- package/dist/{projects-CAcXztf4.js → projects-BRp0iseV.js} +1 -2
- package/dist/{projects-Ddvl9EJp.d.ts → projects-mgPxrKZr.d.ts} +0 -2
- package/dist/{registry-zw6aE2N9.js → registry-B8JE5NY-.js} +1 -2
- package/dist/{registry-CDKLACCZ.js → registry-CnPC-gNu.js} +1 -2
- package/dist/{request-D7h3SQ92.d.ts → request-BC_krbEr.d.ts} +2 -4
- package/dist/request-CJCPyu2B.d.ts +70 -0
- package/dist/{request-DbFfYmCu.js → request-CQ8TkHLh.js} +4 -5
- package/dist/{request-DE8w_cSM.js → request-Cl68STwT.js} +7 -8
- package/dist/request-origin-pzWr9UUu.js +37 -0
- package/dist/rolldown-runtime-DegdyBIC.js +25 -0
- package/dist/{route-query-CRVWXIrc.js → route-query-BWVl6ZO6.js} +4 -5
- package/dist/{rpc-DIUA61pv.js → rpc-D3tsx5lZ.js} +1 -2
- package/dist/{rpc-7nlHSv3y.d.ts → rpc-oijgKQtD.d.ts} +0 -2
- package/dist/{runtime-YLWfdrtO.js → runtime-CAbuQGMP.js} +3 -4
- package/dist/{runtime-DQuHg7OO.js → runtime-CRJsqVTa.js} +2 -3
- package/dist/{runtime-B_btezs1.d.ts → runtime-Cf8R1Ztr.d.ts} +0 -2
- package/dist/{runtime-DxfJOfCd.js → runtime-CyPZMiyK.js} +2 -3
- package/dist/{runtime-OsEDfbM9.js → runtime-F0CTqBFx.js} +5 -6
- package/dist/{runtime-feature-guard-B64MMW9I.js → runtime-feature-guard-DpUn4Oxc.js} +91 -10
- package/dist/scan-module-B1A24jqP.js +1 -0
- package/dist/{scan-module-Df58L_6T.js → scan-module-BfZvDBxb.js} +2 -4
- package/dist/{schema-form-C-fy3xaU.d.ts → schema-form-Bl79Bdm-.d.ts} +0 -2
- package/dist/{secret-Dy5uqvq9.js → secret-D2KL_o2h.js} +2 -3
- package/dist/{sections-Do7X4Nwt.d.ts → sections-0qrBvGbf.d.ts} +0 -4
- package/dist/{sections-C83x0slv.js → sections-BNTdIEJw.js} +2 -3
- package/dist/{sections-BogiCmtz.d.ts → sections-BTfWK14a.d.ts} +4 -6
- package/dist/{sections-DumoLKQN.js → sections-BiCOk9qP.js} +1 -2
- package/dist/sections-DAtgYMVz.d.ts +8 -0
- package/dist/{sections-et20h8w3.js → sections-HLxb9MrG.js} +14 -7
- package/dist/{sections.get-COiLcQ0P.d.ts → sections.get-CGmtYmfu.d.ts} +2 -4
- package/dist/seo/runtime.d.ts +2 -5
- package/dist/seo/runtime.js +3 -5
- package/dist/{seo-CtLywyRx.d.ts → seo-CgW5uI9L.d.ts} +0 -2
- package/dist/seo.d.ts +1 -1
- package/dist/seo.js +1 -2
- package/dist/{server-BRJE4t-W.js → server-DsOEa4_A.js} +5 -5
- package/dist/{setup-ZbA1by7W.d.ts → setup-Ca7jtBLS.d.ts} +8 -7
- package/dist/{setup-C-5nB7aY.js → setup-DQz_i-ee.js} +16 -5
- package/dist/{site-access-BmE8HGxs.js → site-access-1JIQjY11.js} +16 -16
- package/dist/{site-access-DxfdOel1.d.ts → site-access-CUXIbbbR.d.ts} +0 -2
- package/dist/{site-access-BycrwM2v.js → site-access-CmaZ-oaL.js} +1 -2
- package/dist/site-access-Cvmjb6aw.js +1 -0
- package/dist/{site-session-odJq1dYa.js → site-session-D36fr7Wf.js} +65 -40
- package/dist/skills/operations.d.ts +1 -5
- package/dist/skills/operations.js +4 -5
- package/dist/skills/vitehub/SKILL.md +142 -0
- package/dist/skills/vitehub/agents/openai.yaml +4 -0
- package/dist/skills/vitehub/references/agent-definitions.md +36 -0
- package/dist/skills/vitehub/references/bundle.md +57 -0
- package/dist/skills/vitehub/references/capabilities-authority.md +30 -0
- package/dist/skills/vitehub/references/channels-triggers.md +27 -0
- package/dist/skills/vitehub/references/framework-composition.md +29 -0
- package/dist/skills/vitehub/references/preview-contract.md +44 -0
- package/dist/skills/vitehub/references/primitives/auth.md +14 -0
- package/dist/skills/vitehub/references/primitives/blob.md +13 -0
- package/dist/skills/vitehub/references/primitives/browser.md +17 -0
- package/dist/skills/vitehub/references/primitives/cache.md +13 -0
- package/dist/skills/vitehub/references/primitives/channels.md +11 -0
- package/dist/skills/vitehub/references/primitives/connections.md +14 -0
- package/dist/skills/vitehub/references/primitives/content.md +13 -0
- package/dist/skills/vitehub/references/primitives/database.md +15 -0
- package/dist/skills/vitehub/references/primitives/email.md +11 -0
- package/dist/skills/vitehub/references/primitives/env.md +13 -0
- package/dist/skills/vitehub/references/primitives/kv.md +13 -0
- package/dist/skills/vitehub/references/primitives/markdown-template.md +13 -0
- package/dist/skills/vitehub/references/primitives/queue.md +14 -0
- package/dist/skills/vitehub/references/primitives/rate-limit.md +11 -0
- package/dist/skills/vitehub/references/primitives/realtime.md +19 -0
- package/dist/skills/vitehub/references/primitives/sandbox-task.md +11 -0
- package/dist/skills/vitehub/references/primitives/sandbox.md +13 -0
- package/dist/skills/vitehub/references/primitives/schedule.md +11 -0
- package/dist/skills/vitehub/references/primitives/shell.md +11 -0
- package/dist/skills/vitehub/references/primitives/source.md +11 -0
- package/dist/skills/vitehub/references/primitives/workflow.md +11 -0
- package/dist/skills/vitehub/references/primitives/workspace.md +11 -0
- package/dist/skills/vitehub/references/project-patterns.md +19 -0
- package/dist/skills/vitehub/references/project-shapes.md +81 -0
- package/dist/skills/vitehub/references/proof-recovery.md +31 -0
- package/dist/skills/vitehub/references/sandboxes-hosts.md +26 -0
- package/dist/skills/vitehub/references/schedules-workflows-invocations.md +28 -0
- package/dist/skills/vitehub/references/server-primitives.md +39 -0
- package/dist/skills/vitehub/references/workspaces-sources-access.md +26 -0
- package/dist/{skills-DdpSMiCI.js → skills-C1MaGEbO.js} +1 -2
- package/dist/skills.d.ts +1 -2
- package/dist/{skills.get-Bl8cBe8u.js → skills.get-DAooGWy5.js} +3 -4
- package/dist/skills.js +1 -2
- package/dist/{source-D4wWtoHh.js → source-DYFndd0W.js} +2 -3
- package/dist/{source-S-LChQvw.d.ts → source-DemBtwla.d.ts} +0 -2
- package/dist/{stored-Dhv2qsQv.js → stored-J3TetMKf.js} +1 -2
- package/dist/task/operations.d.ts +1 -5
- package/dist/task/operations.js +3 -4
- package/dist/test/register.js +2 -3
- package/dist/test.d.ts +0 -4
- package/dist/test.js +1 -2
- package/dist/{ticket-Pr_8ZtXW.d.ts → ticket-BFWwevWN.d.ts} +0 -2
- package/dist/{ticket-Cudn1dq3.js → ticket-BwsnryuU.js} +2 -3
- package/dist/{tickets-C_0Fhc00.js → tickets-Cj9_y3gw.js} +14 -16
- package/dist/ui/motion/core.d.ts +1 -0
- package/dist/ui/motion/core.js +2 -0
- package/dist/ui/motion.d.ts +1 -0
- package/dist/ui/motion.js +2 -0
- package/dist/ui/vite.js +1 -2
- package/dist/{usage-CoQXs5nW.d.ts → usage-BduF04ks.d.ts} +0 -2
- package/dist/{usage-B4taNt4a.js → usage-ZV3TBMzE.js} +6 -5
- package/dist/{usage-index-BsGAFzyq.js → usage-index-CR_xTrXO.js} +3 -4
- package/dist/{version-DNmSsk5r.js → version-CAhBr673.js} +59 -21
- package/dist/{vite-stage-mmtwQIMA.js → vite-stage-Dmo4RgnK.js} +32 -8
- package/dist/{vue-router-C68IU1jM.d.ts → vue-router-plZJLlpm.d.ts} +120 -182
- package/dist/workspace/blob-database/postgres.d.ts +1 -0
- package/dist/workspace/blob-database/postgres.js +2 -0
- package/dist/{workspace-history-CraoERnc.js → workspace-history-B52xib2J.js} +3 -4
- package/dist/{workspace-history-CeVwBB6Q.d.ts → workspace-history-WuxgLsi4.d.ts} +0 -2
- package/package.json +190 -149
- package/dist/agents-BoWau_ei.js +0 -2
- package/dist/cli-config-UAGTmuFa.js +0 -2
- package/dist/console/runtime/server/page-session.d.ts +0 -2
- package/dist/console/runtime/server/page-session.js +0 -5
- package/dist/console-lazy-views-DXnIkdyd.js +0 -2
- package/dist/operations-CAQmIxGK.js +0 -2
- package/dist/project-C4N_Zcjl.js +0 -30
- package/dist/request-origin-Bq7mDQG9.js +0 -23
- package/dist/scan-module-D_3X08mj.js +0 -2
- package/dist/sections-CyrXbbkG.d.ts +0 -10
- package/dist/site-access-BbJUe5QI.js +0 -2
- /package/dist/{agent/channels.d.ts → channels/adapters.d.ts} +0 -0
- /package/dist/{agent/channels.js → channels/adapters.js} +0 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { CodeBlock, CodeBlockActions, CodeBlockContent, CodeBlockCopyButton, CodeBlockHeader, CodeBlockTitle } from "@vite-hub/ui";
|
|
3
|
+
import { computed, ref } from "vue";
|
|
4
|
+
|
|
5
|
+
import { canManageConsoleProjects, useConsoleProjects } from "../client/project-session";
|
|
6
|
+
import { grantSummary, inviteHostedCommentsGuest, readHostedCommentsAccess, revokeHostedCommentsAccess } from "../client/site-access";
|
|
7
|
+
import { useConsoleToast } from "../client/toast";
|
|
8
|
+
|
|
9
|
+
const props = defineProps<{ projectId: string }>();
|
|
10
|
+
const { account, pageOrigin } = useConsoleProjects();
|
|
11
|
+
const manage = computed(() => account.value ? canManageConsoleProjects(account.value) : false);
|
|
12
|
+
const toast = useConsoleToast();
|
|
13
|
+
const code = computed(() => `<script type="module" src="${pageOrigin}/hosted-comments.js" data-vitehub-comments="${props.projectId}"><${"/script"}>`);
|
|
14
|
+
const access = ref<Awaited<ReturnType<typeof readHostedCommentsAccess>>>();
|
|
15
|
+
const name = ref("");
|
|
16
|
+
const permission = ref("write");
|
|
17
|
+
const days = ref("7");
|
|
18
|
+
const busy = ref(false);
|
|
19
|
+
const problem = ref("");
|
|
20
|
+
const inviteUrl = ref("");
|
|
21
|
+
const permissions = [
|
|
22
|
+
{ label: "Read comments", value: "read" },
|
|
23
|
+
{ label: "Write comments", value: "write" },
|
|
24
|
+
{ label: "Write and resolve", value: "resolve" },
|
|
25
|
+
];
|
|
26
|
+
const lifetimes = [{ label: "1 day", value: "1" }, { label: "7 days", value: "7" }, { label: "30 days", value: "30" }];
|
|
27
|
+
|
|
28
|
+
async function run(action?: () => Promise<void>): Promise<void> {
|
|
29
|
+
if (busy.value) return;
|
|
30
|
+
busy.value = true;
|
|
31
|
+
problem.value = "";
|
|
32
|
+
try {
|
|
33
|
+
await action?.();
|
|
34
|
+
access.value = await readHostedCommentsAccess(props.projectId);
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
problem.value = error instanceof Error ? error.message : "The Console did not answer. Try again.";
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
busy.value = false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async function invite(): Promise<void> {
|
|
45
|
+
await run(async () => {
|
|
46
|
+
const roles = permission.value === "resolve" ? ["comments-write", "comments-resolve"] : [`comments-${permission.value}`];
|
|
47
|
+
const answer = await inviteHostedCommentsGuest(props.projectId, { name: name.value.trim(), grants: roles, expiresInDays: Number(days.value) });
|
|
48
|
+
inviteUrl.value = answer.url;
|
|
49
|
+
name.value = "";
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function opened(event: Event): void {
|
|
54
|
+
if (event.currentTarget instanceof HTMLDetailsElement && event.currentTarget.open) void run();
|
|
55
|
+
}
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<template>
|
|
59
|
+
<div class="grid gap-3">
|
|
60
|
+
<p class="text-sm text-pretty text-muted">Add this script to the registered page and the pages you want to review. The registered page completes sign-in.</p>
|
|
61
|
+
<CodeBlock size="sm">
|
|
62
|
+
<CodeBlockHeader>
|
|
63
|
+
<CodeBlockTitle>Hosted Comments script</CodeBlockTitle>
|
|
64
|
+
<CodeBlockActions>
|
|
65
|
+
<CodeBlockCopyButton :value="code" aria-label="Copy the Hosted Comments script" color="neutral" @error="toast.error('The browser blocked the clipboard. Select the script and copy it.')" />
|
|
66
|
+
</CodeBlockActions>
|
|
67
|
+
</CodeBlockHeader>
|
|
68
|
+
<CodeBlockContent wrap class="break-all text-[13px] text-highlighted">{{ code }}</CodeBlockContent>
|
|
69
|
+
</CodeBlock>
|
|
70
|
+
<details class="grid gap-3" @toggle="opened">
|
|
71
|
+
<summary class="cursor-pointer text-sm font-medium text-highlighted">Guest access</summary>
|
|
72
|
+
<p v-if="!manage" class="mt-3 text-sm text-muted">Owners and admins of the team invite and remove guests.</p>
|
|
73
|
+
<form v-else class="mt-3 grid gap-3" @submit.prevent="invite">
|
|
74
|
+
<div class="flex flex-wrap items-end gap-2">
|
|
75
|
+
<UFormField label="Guest name" required>
|
|
76
|
+
<UInput v-model="name" maxlength="64" required />
|
|
77
|
+
</UFormField>
|
|
78
|
+
<UFormField label="Permission">
|
|
79
|
+
<USelect v-model="permission" :items="permissions" />
|
|
80
|
+
</UFormField>
|
|
81
|
+
<UFormField label="Expires in">
|
|
82
|
+
<USelect v-model="days" :items="lifetimes" />
|
|
83
|
+
</UFormField>
|
|
84
|
+
<UButton label="Create invite" type="submit" :disabled="busy || !name.trim()" />
|
|
85
|
+
</div>
|
|
86
|
+
<p v-if="problem" class="text-sm text-error" role="alert">{{ problem }}</p>
|
|
87
|
+
<div v-if="inviteUrl" class="flex items-end gap-2">
|
|
88
|
+
<UFormField class="min-w-0 flex-1" label="One-time invite link">
|
|
89
|
+
<UInput class="w-full" :model-value="inviteUrl" readonly />
|
|
90
|
+
</UFormField>
|
|
91
|
+
<CodeBlockCopyButton :value="inviteUrl" aria-label="Copy invite link" color="neutral" />
|
|
92
|
+
</div>
|
|
93
|
+
</form>
|
|
94
|
+
<ul v-if="access" class="mt-3 divide-y divide-default">
|
|
95
|
+
<li v-for="item in access.invites" :key="item.id" class="flex items-center justify-between gap-2 py-2 text-sm">
|
|
96
|
+
<span>{{ item.name }} · Open invite · {{ grantSummary("guest", item.grants, access.grants) }}</span>
|
|
97
|
+
<UButton v-if="manage" label="Revoke" :aria-label="`Revoke the invite for ${item.name}`" color="neutral" variant="ghost" size="xs" :disabled="busy" @click="run(() => revokeHostedCommentsAccess(projectId, 'invites', item.id))" />
|
|
98
|
+
</li>
|
|
99
|
+
<li v-for="item in access.sessions" :key="item.id" class="flex items-center justify-between gap-2 py-2 text-sm">
|
|
100
|
+
<span>{{ item.person.name }} · {{ item.device }} · {{ grantSummary("guest", item.grants, access.grants) }}</span>
|
|
101
|
+
<UButton v-if="manage" label="Revoke" :aria-label="`Revoke access for ${item.person.name}`" color="neutral" variant="ghost" size="xs" :disabled="busy" @click="run(() => revokeHostedCommentsAccess(projectId, 'sessions', item.id))" />
|
|
102
|
+
</li>
|
|
103
|
+
</ul>
|
|
104
|
+
</details>
|
|
105
|
+
</div>
|
|
106
|
+
</template>
|
|
@@ -4,7 +4,7 @@ withDefaults(defineProps<{ label?: string }>(), { label: "Opening Console…" })
|
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<template>
|
|
7
|
-
<div class="
|
|
7
|
+
<div class="vitehub-console-page grid content-start gap-6">
|
|
8
8
|
<p role="status" class="flex items-center gap-2 text-sm text-muted">
|
|
9
9
|
<Icon
|
|
10
10
|
name="i-lucide-loader-circle"
|
|
@@ -3,6 +3,7 @@ import { onMounted, ref } from "vue";
|
|
|
3
3
|
import { useRoute, useRouter } from "vue-router";
|
|
4
4
|
|
|
5
5
|
import { consoleMcpAccount, requestConsoleMcp } from "../client/mcp-client";
|
|
6
|
+
import { openAccountProject, useConsoleProjects } from "../client/project-session";
|
|
6
7
|
import { useConsoleToast } from "../client/toast";
|
|
7
8
|
import ConsoleSearch from "./console-search.vue";
|
|
8
9
|
import ConsoleState from "./console-state.vue";
|
|
@@ -11,7 +12,8 @@ import Icon from "./console-icon.vue";
|
|
|
11
12
|
/**
|
|
12
13
|
* Where an authorization server sends the browser after an MCP sign-in. The page hands the code to the server, which
|
|
13
14
|
* exchanges it with the PKCE verifier that never left the server, then opens the new connection. The code leaves the
|
|
14
|
-
* address bar as soon as the page has read it.
|
|
15
|
+
* address bar as soon as the page has read it. The server finishes the sign-in on the project in its state, so when
|
|
16
|
+
* another tab opened another project since, the page opens that project after the sign-in.
|
|
15
17
|
*/
|
|
16
18
|
const props = defineProps<{
|
|
17
19
|
agentsBase: string;
|
|
@@ -25,6 +27,7 @@ const route = useRoute();
|
|
|
25
27
|
const router = useRouter();
|
|
26
28
|
const toast = useConsoleToast();
|
|
27
29
|
const error = ref<unknown>();
|
|
30
|
+
const projects = useConsoleProjects();
|
|
28
31
|
|
|
29
32
|
function query(name: string): string | undefined {
|
|
30
33
|
const value = route.query[name];
|
|
@@ -44,6 +47,8 @@ onMounted(async () => {
|
|
|
44
47
|
await router.replace({ name: "vitehub-console-mcp-client-callback" });
|
|
45
48
|
try {
|
|
46
49
|
const connection = await requestConsoleMcp("mcp-client.complete", Object.fromEntries(Object.entries(input).filter(([, value]) => value !== undefined)));
|
|
50
|
+
const project = input.state.includes(".") ? input.state.slice(0, input.state.indexOf(".")) : undefined;
|
|
51
|
+
if (projects.mode === "account" && project && project !== projects.current.value?.id) return openAccountProject(project);
|
|
47
52
|
toast.show({ title: `Connected as ${consoleMcpAccount(connection).primary}` });
|
|
48
53
|
await router.replace({ name: "vitehub-console-mcp-client", query: { connection: connection.id } });
|
|
49
54
|
}
|
|
@@ -156,7 +156,7 @@ async function disconnect(): Promise<void> {
|
|
|
156
156
|
</ConsolePageHeader>
|
|
157
157
|
|
|
158
158
|
<section class="shrink-0 border-b border-default" aria-label="Connection">
|
|
159
|
-
<div class="
|
|
159
|
+
<div class="vitehub-console-page grid grid-cols-1 gap-4">
|
|
160
160
|
<div class="flex min-w-0 items-center gap-3">
|
|
161
161
|
<UAvatar :src="connection.identity?.picture" :alt="account.primary" :text="consoleInitials(account.primary)" size="lg" />
|
|
162
162
|
<div class="min-w-0 flex-1">
|
|
@@ -182,7 +182,7 @@ async function disconnect(): Promise<void> {
|
|
|
182
182
|
scroller makes room for it and overlaps the bottom border: the two are one line. -->
|
|
183
183
|
<div class="shrink-0 border-b border-default">
|
|
184
184
|
<div class="-mb-px overflow-x-auto pb-px">
|
|
185
|
-
<div class="
|
|
185
|
+
<div class="max-w-[78rem] px-2 sm:px-4">
|
|
186
186
|
<UTabs v-model="activeTab" :items="tabs" :content="false" aria-label="Connection views" class="w-max min-w-full" />
|
|
187
187
|
</div>
|
|
188
188
|
</div>
|
|
@@ -199,7 +199,7 @@ async function disconnect(): Promise<void> {
|
|
|
199
199
|
@failed="emit('changed')"
|
|
200
200
|
/>
|
|
201
201
|
<div v-else class="min-h-0 flex-1 overflow-y-auto">
|
|
202
|
-
<div class="
|
|
202
|
+
<div class="vitehub-console-page grid grid-cols-1 gap-6 [&>*]:max-w-3xl">
|
|
203
203
|
<ConsoleSection v-if="connection.server?.instructions" :level="3" title="Instructions">
|
|
204
204
|
<p class="vitehub-mcp-text max-w-[75ch]">{{ connection.server.instructions }}</p>
|
|
205
205
|
</ConsoleSection>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { consoleInitials } from "../client/format";
|
|
3
3
|
import { computed, onBeforeUnmount, ref, watch } from "vue";
|
|
4
|
-
import { viteHubErrorDiagnostics } from "../../../error-diagnostics";
|
|
5
4
|
|
|
6
5
|
import { consoleMcpAccount, consoleMcpPromptSchema, consoleMcpToolHints, requestConsoleMcp } from "../client/mcp-client";
|
|
7
6
|
import ConsoleMcpContent from "./console-mcp-content.vue";
|
|
@@ -47,7 +46,6 @@ const templateUri = ref("");
|
|
|
47
46
|
const runAs = ref<string[]>([props.connection.id]);
|
|
48
47
|
const results = ref<Record<string, Result>>({});
|
|
49
48
|
let request: AbortController | undefined;
|
|
50
|
-
const maximumListPages = 1_000;
|
|
51
49
|
|
|
52
50
|
const nouns = { prompts: "prompts", resources: "resources", tools: "tools" } as const;
|
|
53
51
|
const action = computed(() => ({ prompts: "Get prompt", resources: "Read", tools: "Run" })[props.kind]);
|
|
@@ -92,20 +90,9 @@ async function load(): Promise<void> {
|
|
|
92
90
|
error.value = undefined;
|
|
93
91
|
try {
|
|
94
92
|
const pages = async (kind: ConsoleMcpListKind) => {
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
for (let page = 0; page < maximumListPages && !controller.signal.aborted; page++) {
|
|
99
|
-
const response = await requestConsoleMcp("mcp-client.items", { id: props.connection.id, kind, ...(cursor ? { cursor } : {}) }, controller.signal);
|
|
100
|
-
all.push(...response.items);
|
|
101
|
-
emit("connection", response.connection);
|
|
102
|
-
cursor = response.nextCursor;
|
|
103
|
-
if (!cursor) break;
|
|
104
|
-
if (cursors.has(cursor)) throw viteHubErrorDiagnostics.VITE_HUB_CONSOLE_MCP_LIST_INCOMPLETE({ reason: "repeated-cursor" });
|
|
105
|
-
cursors.add(cursor);
|
|
106
|
-
if (page + 1 === maximumListPages) throw viteHubErrorDiagnostics.VITE_HUB_CONSOLE_MCP_LIST_INCOMPLETE({ reason: "too-many-pages" });
|
|
107
|
-
}
|
|
108
|
-
return all;
|
|
93
|
+
const response = await requestConsoleMcp("mcp-client.items", { id: props.connection.id, kind }, controller.signal);
|
|
94
|
+
emit("connection", response.connection);
|
|
95
|
+
return response.items;
|
|
109
96
|
};
|
|
110
97
|
// Both lists use one grant. Finish one before the other can rotate its refresh token.
|
|
111
98
|
const list = await pages(props.kind);
|
|
@@ -257,7 +244,7 @@ onBeforeUnmount(() => request?.abort());
|
|
|
257
244
|
@keydown.meta.enter.prevent="run"
|
|
258
245
|
@keydown.ctrl.enter.prevent="run"
|
|
259
246
|
>
|
|
260
|
-
<div class="
|
|
247
|
+
<div class="vitehub-console-page grid gap-6">
|
|
261
248
|
<header class="grid gap-2">
|
|
262
249
|
<UButton class="-ms-2 w-fit lg:hidden" icon="i-lucide-arrow-left" size="xs" variant="ghost" :label="`All ${nouns[kind]}`" @click="selected = undefined" />
|
|
263
250
|
<div class="flex flex-wrap items-center gap-2">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { createDropField, type DropField } from "@vite-hub/ui/motion";
|
|
2
3
|
import { computed, onBeforeUnmount, onMounted, ref, shallowRef, watch } from "vue";
|
|
3
4
|
|
|
4
5
|
import { consoleErrorMessage } from "../client/documents";
|
|
@@ -290,7 +291,8 @@ const uploads = useConsoleMediaUploads(() => props.client, (result) => {
|
|
|
290
291
|
}
|
|
291
292
|
});
|
|
292
293
|
const fileInput = ref<HTMLInputElement>();
|
|
293
|
-
const
|
|
294
|
+
const browser = ref<HTMLElement>();
|
|
295
|
+
const dropSurface = ref<HTMLElement>();
|
|
294
296
|
|
|
295
297
|
async function upload(files: readonly File[]): Promise<ConsoleMediaUploadResult[]> {
|
|
296
298
|
if (!files.length) return [];
|
|
@@ -318,29 +320,16 @@ function hasFiles(event: DragEvent): boolean {
|
|
|
318
320
|
return [...event.dataTransfer?.types ?? []].includes("Files");
|
|
319
321
|
}
|
|
320
322
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
function dragleave(event: DragEvent): void {
|
|
334
|
-
if (!hasFiles(event)) return;
|
|
335
|
-
dragDepth.value = Math.max(0, dragDepth.value - 1);
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
function drop(event: DragEvent): void {
|
|
339
|
-
if (!hasFiles(event)) return;
|
|
340
|
-
event.preventDefault();
|
|
341
|
-
dragDepth.value = 0;
|
|
342
|
-
void upload([...event.dataTransfer?.files ?? []]);
|
|
343
|
-
}
|
|
323
|
+
let dropField: DropField | undefined;
|
|
324
|
+
onMounted(() => {
|
|
325
|
+
if (!browser.value || !dropSurface.value) return;
|
|
326
|
+
dropField = createDropField(browser.value, {
|
|
327
|
+
accepts: event => hasFiles(event) && canWrite.value,
|
|
328
|
+
onFiles: files => void upload(files),
|
|
329
|
+
surface: dropSurface.value,
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
onBeforeUnmount(() => dropField?.destroy());
|
|
344
333
|
|
|
345
334
|
// Folders
|
|
346
335
|
|
|
@@ -527,11 +516,8 @@ defineExpose({
|
|
|
527
516
|
|
|
528
517
|
<template>
|
|
529
518
|
<div
|
|
519
|
+
ref="browser"
|
|
530
520
|
class="vitehub-media-browser relative flex min-h-0 flex-1 flex-col"
|
|
531
|
-
@dragenter="dragenter"
|
|
532
|
-
@dragover="dragover"
|
|
533
|
-
@dragleave="dragleave"
|
|
534
|
-
@drop="drop"
|
|
535
521
|
@keydown="keydown"
|
|
536
522
|
>
|
|
537
523
|
<ConsolePageToolbar>
|
|
@@ -717,7 +703,7 @@ defineExpose({
|
|
|
717
703
|
</UTooltip>
|
|
718
704
|
</div>
|
|
719
705
|
|
|
720
|
-
<div
|
|
706
|
+
<div ref="dropSurface" class="vitehub-media-drop" aria-hidden="true">
|
|
721
707
|
<div class="flex flex-col items-center gap-2 text-center">
|
|
722
708
|
<Icon name="i-lucide-upload" class="size-6 text-highlighted" />
|
|
723
709
|
<p class="text-sm font-medium text-highlighted">Drop to upload to {{ folderLabel(folder) }}</p>
|
|
@@ -940,8 +926,12 @@ defineExpose({
|
|
|
940
926
|
z-index: 15;
|
|
941
927
|
}
|
|
942
928
|
|
|
943
|
-
|
|
929
|
+
.vitehub-media-browser:not([data-over]) > .vitehub-media-drop {
|
|
930
|
+
display: none;
|
|
931
|
+
}
|
|
932
|
+
|
|
944
933
|
.vitehub-media-drop {
|
|
934
|
+
--vh-drop-dot: var(--ui-text-highlighted);
|
|
945
935
|
align-items: center;
|
|
946
936
|
background: color-mix(in oklab, var(--background) 85%, transparent);
|
|
947
937
|
border: 1px dashed var(--foreground);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { MotionList } from "@vite-hub/ui";
|
|
2
3
|
import { computed, ref } from "vue";
|
|
3
4
|
|
|
4
5
|
import { consoleErrorMessage } from "../client/documents";
|
|
@@ -96,7 +97,7 @@ async function remove(name: string): Promise<void> {
|
|
|
96
97
|
<UEmpty v-if="!crops.length && !adding" variant="naked" size="xs" icon="i-lucide-crop" title="No crops yet">
|
|
97
98
|
<template #description><ConsoleCodeText text="Add one for each layout that needs its own framing, such as `mobile` at 4:5." /></template>
|
|
98
99
|
</UEmpty>
|
|
99
|
-
<
|
|
100
|
+
<MotionList v-if="crops.length" tag="ul" class="divide-y divide-default rounded-lg border border-default">
|
|
100
101
|
<li v-for="crop in crops" :key="crop.name" class="flex items-center gap-3 p-2">
|
|
101
102
|
<div class="h-14 shrink-0 overflow-hidden rounded-md bg-elevated" :style="{ aspectRatio: String(crop.ratio), background: file.color }">
|
|
102
103
|
<img
|
|
@@ -148,7 +149,7 @@ async function remove(name: string): Promise<void> {
|
|
|
148
149
|
/>
|
|
149
150
|
</UDropdownMenu>
|
|
150
151
|
</li>
|
|
151
|
-
</
|
|
152
|
+
</MotionList>
|
|
152
153
|
|
|
153
154
|
<form v-if="adding" class="grid gap-2 rounded-lg border border-default p-2" @submit.prevent="add">
|
|
154
155
|
<div class="grid grid-cols-[minmax(0,1fr)_auto] gap-2">
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { MotionList, Progress } from "@vite-hub/ui";
|
|
2
3
|
import { computed } from "vue";
|
|
3
4
|
|
|
4
5
|
import { consoleBytes } from "../client/format";
|
|
5
6
|
|
|
6
|
-
import type { ConsoleMediaUploads } from "../client/media-uploads";
|
|
7
|
+
import type { ConsoleMediaUploadEntry, ConsoleMediaUploads } from "../client/media-uploads";
|
|
7
8
|
import Icon from "./console-icon.vue";
|
|
8
9
|
|
|
9
10
|
/**
|
|
@@ -15,6 +16,11 @@ const props = defineProps<{ uploads: ConsoleMediaUploads }>();
|
|
|
15
16
|
const entries = computed(() => props.uploads.entries.value);
|
|
16
17
|
const done = computed(() => entries.value.filter(entry => entry.state === "done").length);
|
|
17
18
|
const failed = computed(() => entries.value.filter(entry => entry.state === "failed").length);
|
|
19
|
+
function barValue(entry: ConsoleMediaUploadEntry): number | null | undefined {
|
|
20
|
+
if (entry.state === "queued") return undefined;
|
|
21
|
+
if (entry.state === "uploading") return entry.progress >= 1 ? null : entry.progress;
|
|
22
|
+
return 1;
|
|
23
|
+
}
|
|
18
24
|
const title = computed(() => {
|
|
19
25
|
const pending = props.uploads.pending.value;
|
|
20
26
|
if (pending) return `Uploading ${pending} ${pending === 1 ? "file" : "files"}`;
|
|
@@ -29,11 +35,11 @@ const title = computed(() => {
|
|
|
29
35
|
<p class="min-w-0 flex-1 truncate text-[13px] font-medium text-highlighted" aria-live="polite">{{ title }}</p>
|
|
30
36
|
<UButton v-if="!uploads.pending.value" variant="ghost" size="xs" icon="i-lucide-x" aria-label="Close uploads" @click="uploads.clear()" />
|
|
31
37
|
</header>
|
|
32
|
-
<ul class="max-h-64 overflow-y-auto py-1">
|
|
38
|
+
<MotionList tag="ul" class="max-h-64 overflow-y-auto py-1">
|
|
33
39
|
<li v-for="entry in entries" :key="entry.id" class="grid gap-1 px-3 py-1.5">
|
|
34
40
|
<div class="flex min-w-0 items-center gap-2">
|
|
35
41
|
<Icon
|
|
36
|
-
:name="entry.state === 'done' ? 'i-lucide-
|
|
42
|
+
:name="entry.state === 'done' ? 'i-lucide-file' : entry.state === 'failed' ? 'i-lucide-circle-alert' : 'i-lucide-loader-circle'"
|
|
37
43
|
class="size-3.5 shrink-0"
|
|
38
44
|
:class="entry.state === 'failed' ? 'text-error' : entry.state === 'done' ? 'text-muted' : 'animate-spin text-dimmed'"
|
|
39
45
|
aria-hidden="true"
|
|
@@ -48,13 +54,11 @@ const title = computed(() => {
|
|
|
48
54
|
<UButton variant="ghost" size="xs" icon="i-lucide-x" :aria-label="`Dismiss ${entry.file.name}`" @click="uploads.dismiss(entry.id)" />
|
|
49
55
|
</template>
|
|
50
56
|
</div>
|
|
51
|
-
<
|
|
52
|
-
<div class="h-full bg-inverted transition-[width] duration-150 ease-out" :style="{ width: `${Math.round(entry.progress * 100)}%` }" />
|
|
53
|
-
</div>
|
|
57
|
+
<Progress v-if="entry.state !== 'failed'" :value="barValue(entry)" :done="entry.state === 'done'" :label="`Upload ${entry.file.name}`" />
|
|
54
58
|
<p v-if="entry.state === 'failed'" class="ps-5.5 text-xs text-error">{{ entry.error }}</p>
|
|
55
59
|
<p v-else-if="entry.result?.duplicate" class="ps-5.5 text-xs text-muted">Already in the library as <span class="font-mono">{{ entry.result.file.pathname }}</span></p>
|
|
56
60
|
</li>
|
|
57
|
-
</
|
|
61
|
+
</MotionList>
|
|
58
62
|
</section>
|
|
59
63
|
</template>
|
|
60
64
|
|
|
@@ -7,24 +7,19 @@
|
|
|
7
7
|
* slot rests the strip on the row's bottom border, so the tab line and the border are one line. On a phone the `tabs`
|
|
8
8
|
* strip takes its own line under the controls, so it still rests on the border when the controls wrap.
|
|
9
9
|
*
|
|
10
|
-
* A page
|
|
10
|
+
* A page whose content uses the page width (`vitehub-console-page`) passes `width="page"`, so the controls start on the
|
|
11
|
+
* content's edge. Without it, the row takes the full width, as full-width pages such as Database do.
|
|
11
12
|
*/
|
|
12
13
|
const props = defineProps<{
|
|
13
|
-
width?: "
|
|
14
|
+
width?: "page";
|
|
14
15
|
}>();
|
|
15
|
-
|
|
16
|
-
const widths = {
|
|
17
|
-
"4xl": "max-w-4xl px-4 sm:px-6",
|
|
18
|
-
"5xl": "max-w-5xl px-4 sm:px-6",
|
|
19
|
-
"6xl": "max-w-6xl px-4 sm:px-6",
|
|
20
|
-
} as const;
|
|
21
16
|
</script>
|
|
22
17
|
|
|
23
18
|
<template>
|
|
24
19
|
<div class="flex shrink-0 border-b border-default">
|
|
25
20
|
<div
|
|
26
|
-
class="
|
|
27
|
-
:class="props.width ?
|
|
21
|
+
class="flex w-full flex-wrap gap-x-3"
|
|
22
|
+
:class="props.width ? 'max-w-[78rem] px-4 sm:px-6' : 'px-3 sm:px-4'"
|
|
28
23
|
>
|
|
29
24
|
<!-- The 1px padding keeps the active tab's line inside the scroller, and the negative margin lays it on the border. -->
|
|
30
25
|
<div v-if="$slots.tabs" class="order-last -mb-px w-full min-w-0 self-end overflow-x-auto pb-px sm:order-none sm:w-auto">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { HoldToDelete, MotionList } from "@vite-hub/ui";
|
|
2
3
|
import { computed, nextTick, ref, watch } from "vue";
|
|
3
4
|
|
|
4
5
|
import { consoleItemTitle, consoleSchemaItemValue } from "../client/schema-form";
|
|
@@ -10,6 +11,9 @@ import Icon from "./console-icon.vue";
|
|
|
10
11
|
* The items of a list field, such as the links of a navigation menu. An item that is an object is one row with its
|
|
11
12
|
* title and detail, and opens in place to show its fields. Any other item is one row with its control. Each row can
|
|
12
13
|
* move up, move down, or be removed, and Add appends a new item. The item controls come from the `item` slot.
|
|
14
|
+
*
|
|
15
|
+
* Rows move with the list mover of @vite-hub/ui. Remove is a hold: the row's content leaves toward the trash, the row
|
|
16
|
+
* shows Undo for a few seconds. The value changes at once, so form actions see the removal.
|
|
13
17
|
*/
|
|
14
18
|
const props = defineProps<{
|
|
15
19
|
disabled?: boolean;
|
|
@@ -33,13 +37,25 @@ const noun = computed(() => props.field.item.label.toLowerCase());
|
|
|
33
37
|
// Stable keys for the rows, so an open item stays open when it moves. Values have no ids of their own.
|
|
34
38
|
let nextKey = 0;
|
|
35
39
|
const keys = ref<number[]>([]);
|
|
40
|
+
const pending = ref(new Map<number, unknown>());
|
|
41
|
+
const activeKeys = computed(() => keys.value.filter(key => !pending.value.has(key)));
|
|
36
42
|
watch(() => items.value.length, (length) => {
|
|
37
|
-
if (
|
|
43
|
+
if (activeKeys.value.length === length) return;
|
|
44
|
+
keys.value = Array.from({ length }, () => nextKey++);
|
|
45
|
+
pending.value.clear();
|
|
38
46
|
}, { immediate: true });
|
|
39
47
|
const open = ref(new Set<number>());
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
const rows = ref<Record<number, HTMLElement | null>>({});
|
|
49
|
+
const displayRows = computed(() => {
|
|
50
|
+
let index = 0;
|
|
51
|
+
return keys.value.map((key) => {
|
|
52
|
+
if (pending.value.has(key)) return { key, index, value: pending.value.get(key), removed: true };
|
|
53
|
+
return { key, index, value: items.value[index++], removed: false };
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
function itemId(key: number): string {
|
|
58
|
+
return `${props.inputId}-${key}`;
|
|
43
59
|
}
|
|
44
60
|
|
|
45
61
|
function title(value: unknown, index: number): { detail?: string, title: string } {
|
|
@@ -52,7 +68,9 @@ function write(next: unknown[], nextKeys: number[]): void {
|
|
|
52
68
|
model.value = next;
|
|
53
69
|
}
|
|
54
70
|
|
|
55
|
-
function update(
|
|
71
|
+
function update(key: number, value: unknown): void {
|
|
72
|
+
const index = activeKeys.value.indexOf(key);
|
|
73
|
+
if (index === -1) return;
|
|
56
74
|
const next = [...items.value];
|
|
57
75
|
next[index] = value;
|
|
58
76
|
model.value = next;
|
|
@@ -76,21 +94,42 @@ function move(index: number, offset: -1 | 1): void {
|
|
|
76
94
|
if (target < 0 || target >= items.value.length) return;
|
|
77
95
|
const next = [...items.value];
|
|
78
96
|
const nextKeys = [...keys.value];
|
|
97
|
+
const key = activeKeys.value[index]!;
|
|
98
|
+
const targetKey = activeKeys.value[target]!;
|
|
99
|
+
const from = nextKeys.indexOf(key);
|
|
100
|
+
const to = nextKeys.indexOf(targetKey);
|
|
79
101
|
[next[index], next[target]] = [next[target], next[index]];
|
|
80
|
-
[nextKeys[
|
|
102
|
+
[nextKeys[from], nextKeys[to]] = [targetKey, key];
|
|
81
103
|
write(next, nextKeys);
|
|
82
104
|
// Keep focus on the same button of the moved row, so several moves need no pointer.
|
|
83
|
-
void focus(() => document.getElementById(`${itemId(
|
|
105
|
+
void focus(() => document.getElementById(`${itemId(key)}-${offset < 0 ? "up" : "down"}`));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
function remove(key: number): void {
|
|
109
|
+
const index = activeKeys.value.indexOf(key);
|
|
110
|
+
if (index === -1) return;
|
|
111
|
+
pending.value.set(key, items.value[index]);
|
|
112
|
+
model.value = items.value.filter((_, position) => position !== index);
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function undo(key: number): void {
|
|
116
|
+
if (!pending.value.has(key)) return;
|
|
117
|
+
const next = [...items.value];
|
|
118
|
+
const value = pending.value.get(key);
|
|
119
|
+
pending.value.delete(key);
|
|
120
|
+
next.splice(activeKeys.value.indexOf(key), 0, value);
|
|
121
|
+
model.value = next;
|
|
84
122
|
}
|
|
85
123
|
|
|
86
|
-
function
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
124
|
+
function dismiss(key: number): void {
|
|
125
|
+
if (!pending.value.has(key)) return;
|
|
126
|
+
const index = displayRows.value.find(row => row.key === key)?.index ?? 0;
|
|
127
|
+
keys.value = keys.value.filter(candidate => candidate !== key);
|
|
128
|
+
pending.value.delete(key);
|
|
129
|
+
open.value.delete(key);
|
|
130
|
+
if (document.activeElement?.id !== `${itemId(key)}-remove`) return;
|
|
131
|
+
const next = activeKeys.value[index] ?? activeKeys.value.at(-1);
|
|
132
|
+
void focus(() => document.getElementById(next === undefined ? `${props.inputId}-add` : `${itemId(next)}-remove`));
|
|
94
133
|
}
|
|
95
134
|
|
|
96
135
|
async function add(): Promise<void> {
|
|
@@ -102,8 +141,7 @@ async function add(): Promise<void> {
|
|
|
102
141
|
await focus(() => document.getElementById(objectItems.value ? `${props.inputId}-${key}-fields` : `${props.inputId}-${key}`)?.querySelector<HTMLElement>(selector));
|
|
103
142
|
}
|
|
104
143
|
|
|
105
|
-
function toggle(
|
|
106
|
-
const key = keys.value[index]!;
|
|
144
|
+
function toggle(key: number): void {
|
|
107
145
|
const next = new Set(open.value);
|
|
108
146
|
if (next.has(key)) next.delete(key);
|
|
109
147
|
else next.add(key);
|
|
@@ -114,36 +152,52 @@ function toggle(index: number): void {
|
|
|
114
152
|
|
|
115
153
|
<template>
|
|
116
154
|
<div class="grid grid-cols-1 ms-3 border-s border-default ps-[calc(0.75rem-1px)]">
|
|
117
|
-
<ol class="grid grid-cols-1" :aria-label="field.label">
|
|
118
|
-
<li v-for="
|
|
119
|
-
<
|
|
155
|
+
<MotionList tag="ol" class="grid grid-cols-1" :aria-label="field.label">
|
|
156
|
+
<li v-for="{ key, index, value, removed } in displayRows" :id="itemId(key)" :key="key" class="group/item relative grid grid-cols-1">
|
|
157
|
+
<p v-if="removed" class="flex h-8 min-w-0 items-center px-1.5 text-sm text-dimmed">
|
|
158
|
+
<span class="truncate">Removed {{ title(value, index).title }}</span>
|
|
159
|
+
</p>
|
|
160
|
+
<div v-else :ref="(element) => { rows[key] = element as HTMLElement | null }" class="flex min-h-8 items-start gap-1" :class="disabled ? '' : 'pe-7'">
|
|
120
161
|
<!-- A field value, not an action: it reads in the type of the ghost fields of the form, which UButton does not. -->
|
|
121
162
|
<button
|
|
122
163
|
v-if="objectItems"
|
|
123
164
|
type="button"
|
|
124
165
|
class="flex h-8 min-w-0 flex-1 items-center gap-2 rounded-md px-1.5 text-left text-sm hover:bg-elevated pointer-coarse:text-base"
|
|
125
|
-
:aria-expanded="open.has(
|
|
126
|
-
:aria-controls="`${itemId(
|
|
127
|
-
@click="toggle(
|
|
166
|
+
:aria-expanded="open.has(key)"
|
|
167
|
+
:aria-controls="`${itemId(key)}-fields`"
|
|
168
|
+
@click="toggle(key)"
|
|
128
169
|
>
|
|
129
|
-
<Icon name="i-lucide-chevron-right" class="size-3.5 shrink-0 text-dimmed" :class="open.has(
|
|
170
|
+
<Icon name="i-lucide-chevron-right" class="size-3.5 shrink-0 text-dimmed" :class="open.has(key) ? 'rotate-90' : ''" aria-hidden="true" />
|
|
130
171
|
<span class="truncate text-highlighted">{{ title(value, index).title }}</span>
|
|
131
172
|
<span v-if="title(value, index).detail" class="min-w-0 truncate text-dimmed">{{ title(value, index).detail }}</span>
|
|
132
173
|
</button>
|
|
133
174
|
<div v-else class="min-w-0 flex-1">
|
|
134
|
-
<slot name="item" :id="itemId(
|
|
175
|
+
<slot name="item" :id="itemId(key)" :depth="depth + 1" :index="index" :value="value" :update="(next: unknown) => update(key, next)" />
|
|
135
176
|
</div>
|
|
136
177
|
<div v-if="!disabled" class="flex h-8 shrink-0 items-center opacity-0 group-hover/item:opacity-100 group-focus-within/item:opacity-100 max-sm:opacity-100">
|
|
137
|
-
<UButton :id="`${itemId(
|
|
138
|
-
<UButton :id="`${itemId(
|
|
139
|
-
<UButton :id="`${itemId(index)}-remove`" icon="i-lucide-x" size="xs" variant="ghost" :aria-label="`Remove ${title(value, index).title}`" @click="remove(index)" />
|
|
178
|
+
<UButton :id="`${itemId(key)}-up`" icon="i-lucide-arrow-up" size="xs" variant="ghost" :disabled="index === 0" :aria-label="`Move ${title(value, index).title} up`" @click="move(index, -1)" />
|
|
179
|
+
<UButton :id="`${itemId(key)}-down`" icon="i-lucide-arrow-down" size="xs" variant="ghost" :disabled="index === items.length - 1" :aria-label="`Move ${title(value, index).title} down`" @click="move(index, 1)" />
|
|
140
180
|
</div>
|
|
141
181
|
</div>
|
|
142
|
-
|
|
143
|
-
|
|
182
|
+
<!-- One button for remove and Undo, so it keeps its state while the row waits for the Undo window. -->
|
|
183
|
+
<HoldToDelete
|
|
184
|
+
v-if="!disabled"
|
|
185
|
+
:id="`${itemId(key)}-remove`"
|
|
186
|
+
label=""
|
|
187
|
+
class="absolute end-0 top-0.5"
|
|
188
|
+
:class="removed ? '' : 'opacity-0 group-hover/item:opacity-100 group-focus-within/item:opacity-100 focus-visible:opacity-100 max-sm:opacity-100'"
|
|
189
|
+
:aria-label="removed ? `Undo removing ${title(value, index).title}` : `Hold to remove ${title(value, index).title}`"
|
|
190
|
+
:item="() => rows[key]"
|
|
191
|
+
:commit="() => dismiss(key)"
|
|
192
|
+
:confirm="() => true"
|
|
193
|
+
@delete="remove(key)"
|
|
194
|
+
@undo="undo(key)"
|
|
195
|
+
/>
|
|
196
|
+
<div v-if="objectItems && open.has(key) && !removed" :id="`${itemId(key)}-fields`" class="grid grid-cols-1 ms-3 border-s border-default ps-[calc(0.75rem-1px)]">
|
|
197
|
+
<slot name="item" :id="itemId(key)" :depth="depth + 2" :index="index" :value="value" :update="(next: unknown) => update(key, next)" />
|
|
144
198
|
</div>
|
|
145
199
|
</li>
|
|
146
|
-
</
|
|
200
|
+
</MotionList>
|
|
147
201
|
<UButton
|
|
148
202
|
v-if="!disabled"
|
|
149
203
|
:id="`${inputId}-add`"
|