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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../internal/src/owned-paths.ts
|
|
2
2
|
/** Every Blob path that ViteHub writes for itself starts with this prefix. */
|
|
3
3
|
const vitehubOwnedPrefix = "_vitehub/";
|
|
4
4
|
/**
|
|
@@ -11,5 +11,4 @@ function isVitehubOwnedPath(pathname) {
|
|
|
11
11
|
else if (part && part !== ".") parts.push(part);
|
|
12
12
|
return parts[0]?.toLowerCase() === vitehubOwnedPrefix.slice(0, -1);
|
|
13
13
|
}
|
|
14
|
-
//#endregion
|
|
15
14
|
export { vitehubOwnedPrefix as n, isVitehubOwnedPath as t };
|
package/dist/page/pill.iife.js
CHANGED
|
@@ -1,33 +1,31 @@
|
|
|
1
|
-
var ViteHubPagePill=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let t=`button{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:var(--vitehub-pill-justify,center);gap:4px;min-width:28px;height:28px;padding:0 8px;border-radius:8px;font:inherit;white-space:nowrap;color:var(--vitehub-pill-text);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition-property:background-color,color,scale;transition-duration:150ms;transition-timing-function:cubic-bezier(.23,1,.32,1)}
|
|
1
|
+
var ViteHubPagePill=(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let t=/* @__PURE__ */ new Set,n,r=!1;function i(){return n?.matches??!1}function a(){let e=i();if(e!==r){r=e;for(let n of t)n(e)}}function o(){n||typeof matchMedia!=`function`||(n=matchMedia(`(prefers-reduced-motion: reduce)`),n.addEventListener?.(`change`,a),r=i())}function s(){return o(),i()}function c(e){return o(),t.add(e),()=>t.delete(e)}let l={snappy:{stiffness:520,damping:34},soft:{stiffness:380,damping:20}},u=/* @__PURE__ */ new Map,d=/* @__PURE__ */ new Set,f=0,p=!1,m=0,h=0;function g(){return 1}function _(e){let t=Math.min(.032,h?(e-h)/1e3:.016)/1;h=e;let n=Array.from(u),r=Array.from(d);for(let[e,r]of n)if(u.get(e)===r){if(e.tween){let n=e.tween;n.elapsed+=t;let r=Math.min(1,n.elapsed/n.duration),i=1-(1-r)**3,a=n.from+(e.target-n.from)*i;e.velocity=(a-e.value)/(t||1),e.value=a,r>=1&&v(e)}else{let{stiffness:n,damping:r}=e.preset,i=t/6;for(let t=0;t<6;t++){let t=-n*(e.value-e.target)-r*e.velocity;e.velocity+=t*i,e.value+=e.velocity*i}Math.abs(e.velocity)<.002&&Math.abs(e.value-e.target)<5e-4&&v(e)}e.frame(e.value,e.velocity)}for(let e of r)d.has(e)&&e(t)===!1&&d.delete(e);u.size||d.size?m=requestAnimationFrame(_):(m=0,h=0)}function v(e){e.value=e.target,e.velocity=0,e.tween=void 0,u.delete(e)}function y(e){u.set(e,++f),m||=requestAnimationFrame(_)}function b(e){let t=t=>e(t);return d.add(t),m||=requestAnimationFrame(_),()=>{d.delete(t)}}function x(e){if(!e)return;let t=Array.from(u);for(let[e,n]of t)u.get(e)!==n||e.tween||(v(e),e.frame(e.value,0))}function S(e,t,n=l.snappy){let r={value:e,velocity:0,target:e,preset:n,tween:void 0,frame:t},i={get value(){return r.value},get velocity(){return r.velocity},get target(){return r.target},get active(){return u.has(r)},to(e,t={}){if(t.preset&&(r.preset=t.preset),t.tween===void 0&&s())return i.set(e);t.tween===void 0&&!p&&(p=!0,c(x)),r.target=e,t.velocity!==void 0&&(r.velocity+=t.velocity),r.tween=t.tween===void 0?void 0:{from:r.value,elapsed:0,duration:t.tween},y(r)},set(e){r.value=r.target=e,r.velocity=0,r.tween=void 0,u.delete(r),t(e,0)},stop(){r.velocity=0,r.tween=void 0,u.delete(r)}};return i}function C(e){let t=e;for(;t;){if(t.closest(`[data-motion="none"]`))return!0;let e=t.getRootNode();t=e instanceof ShadowRoot?e.host:null}return!1}let w=[`aria-checked`,`aria-selected`,`aria-pressed`,`aria-expanded`,`aria-valuenow`,`aria-valuetext`,`data-state`,`data-checked`,`data-open`,`open`,`data-leaving`],T=/* @__PURE__ */ new Map,E=/* @__PURE__ */ new Set,D=Symbol.for(`vite-hub.motion.layer`),O;function ee(){let e=Reflect.get(globalThis,D);if(e&&e!==O&&typeof e==`object`&&`define`in e&&`install`in e)return e}function te(e){O=e,Reflect.get(globalThis,D)||Reflect.set(globalThis,D,e)}function ne(e){let t=[...T.values()];T.clear();for(let n of t)n.removeFromShared=e.define(n.effect,n.isReduced)}function k(e,t=s){let n={effect:e,isReduced:t};T.set(e.name,n);for(let e of E)e();return()=>{if(n.removeFromShared)return n.removeFromShared();if(T.get(e.name)===n){T.delete(e.name);for(let e of E)e()}}}function A(){return[...T.values()].map(e=>e.effect)}function j(){return[...T.values()]}function re(e){return E.add(e),()=>E.delete(e)}function M(e,t){for(let[n,r]of Object.entries(t))r?e.style.setProperty(n,r):e.style.removeProperty(n)}let N=/* @__PURE__ */ new Map,P,F=/* @__PURE__ */ new Map,I,L=[],ie=Symbol.for(`vite-hub.motion.effect-presses`),ae=e=>{let t=Reflect.get(e,ie);if(t)return t;let n=/* @__PURE__ */ new Map;return Reflect.set(e,ie,n),n},R=/* @__PURE__ */ new Set;function z(e,t){if(R.has(t))return!1;try{return e.matches(t)}catch{return R.add(t),!1}}function oe(e){let t=e;for(;;){for(let e of N.keys())if(e instanceof Element&&e.contains(t))return!0;let e=t.getRootNode();if((e instanceof Document||e instanceof ShadowRoot)&&N.has(e))return!0;if(!(e instanceof ShadowRoot))return!1;t=e.host}}function se(e,t){let n=-1;e.forEach((e,t)=>{e instanceof Element&&e.matches(`[data-motion="none"]`)&&(n=t)});let r=e.findIndex(e=>e instanceof HTMLElement&&z(e,t));return r===-1||r<=n||!oe(e[r])?void 0:e[r]}function B(e,t,n){V(e,!0);let r=ae(t),i=[];for(let{effect:a,isReduced:o}of j()){if(!a.press||o())continue;let s=se(n,a.selector);if(!s||e===`key`&&s!==n[0])continue;let c=r.get(s);if(c?.has(a.name))continue;let l=a.press(s,t);if(!l)continue;c?c.add(a.name):r.set(s,/* @__PURE__ */ new Set([a.name]));let u={element:s,press:l};e!==`key`&&!l.move&&(u.leave=()=>H(e,u,!0),s.addEventListener(`pointerleave`,u.leave,{once:!0})),i.push(u)}i.length&&(F.set(e,i),i.some(e=>e.press.move)&&document.addEventListener(`pointermove`,G,{capture:!0,passive:!0}))}function V(e,t=!1){let n=F.get(e);if(n){F.delete(e);for(let{element:e,press:r,leave:i}of n)i&&e.removeEventListener(`pointerleave`,i),t&&r.cancel?r.cancel():r.release();U()}}function H(e,t,n=!1){let r=F.get(e),i=r?.indexOf(t)??-1;r&&i!==-1&&(t.leave&&t.element.removeEventListener(`pointerleave`,t.leave),r.splice(i,1),r.length||F.delete(e),n&&t.press.cancel?t.press.cancel():t.press.release(),U())}function U(){[...F.values()].some(e=>e.some(e=>e.press.move))||document.removeEventListener(`pointermove`,G,{capture:!0})}function ce(e){if(e.button!==0)return;let t=e.composedPath();e.isPrimary&&(I={event:e,path:t}),B(e.pointerId,e,t)}function W(e){I?.event.pointerId===e.pointerId&&(I=void 0),V(e.pointerId,e.type===`pointercancel`)}function G(e){for(let{press:t}of F.get(e.pointerId)??[])t.move?.(e)}function K(e){if(e.repeat||e.key!==` `&&e.key!==`Enter`)return;let t=e.composedPath();e.key===` `&&t[0]instanceof Element&&t[0].matches(`a[href], [role=link]`)||B(`key`,e,t)}function le(e){(e.key===` `||e.key===`Enter`)&&V(`key`)}function ue(e,t){let n=t.filter(e=>e.content);if(!n.length)return;let r=/* @__PURE__ */ new Map;for(let t of e){if(t.type===`attributes`)continue;let e=t.type===`characterData`?t.target.parentElement:t.target;if(!(e instanceof HTMLElement||e instanceof SVGElement))continue;let n=r.get(e);n||(n={added:[],removed:[],oldText:void 0,texts:/* @__PURE__ */ new Map},r.set(e,n)),t.type===`characterData`?n.texts.has(t.target)||n.texts.set(t.target,t.oldValue):(n.added.push(...t.addedNodes),n.removed.push(...t.removedNodes))}for(let[e,t]of r){if(!e.isConnected)continue;let r=t.added.filter(e=>!t.removed.includes(e)),i=t.removed.filter(e=>!t.added.includes(e)),a=t.texts,o,s=[...e.childNodes];i.length&&s.every(e=>r.includes(e))?o=i.map(e=>e.textContent??``).join(``):a.size===1&&s.length===1&&a.has(s[0])&&(o=a.get(s[0])??``);for(let t of n)z(e,t.selector)&&!C(e)&&t.content(e,{added:r,removed:i,oldText:o})}}function de(e){if(!I||!e.matches(`[role=separator][data-panel-resize-handle-id]`))return;let t=j().find(({effect:e})=>e.name===`divider`);if(!t||t.isReduced())return;let{event:n,path:r}=I,i=F.get(n.pointerId)??[],a=i.find(t=>t.splitter&&t.element===e);if(e.getAttribute(`data-resize-handle-active`)!==`pointer`){a&&H(n.pointerId,a);return}if(a||!r.includes(e.getRootNode())||!oe(e)||C(e))return;let o=t.effect.press?.(e,n);o&&(i.push({element:e,press:o,splitter:!0}),F.set(n.pointerId,i),document.addEventListener(`pointermove`,G,{capture:!0,passive:!0}))}function fe(e){let t=[...new Set(e)],n=A(),r=/* @__PURE__ */ new Map;ue(t,n);for(let e of t)if(e.type!==`characterData`){if(e.type===`attributes`){let t=e.target;if(!(t instanceof HTMLElement))continue;if(e.attributeName===`data-resize-handle-active`){de(t);continue}let i=e.attributeName,a=t.getAttribute(i);if(a===e.oldValue)continue;let o=r.get(t);o||r.set(t,o=/* @__PURE__ */ new Map);let s=o.get(i);if(s||o.set(i,s=/* @__PURE__ */ new Set),s.has(e.oldValue))continue;s.add(e.oldValue);for(let r of n)r.state&&z(t,r.selector)&&!C(t)&&r.state(t,{attribute:i,oldValue:e.oldValue,value:a})}else for(let t of e.addedNodes)if(t instanceof HTMLElement&&t.isConnected)for(let e of n){if(!e.enter)continue;let n=z(t,e.selector);if(R.has(e.selector))continue;let r=[...n?[t]:[],...t.querySelectorAll(e.selector)];for(let t of r)C(t)||e.enter(t)}}}function q(e,t){let n=A().some(e=>e.content);t.observe(e,{attributes:!0,attributeFilter:[...w,...A().some(e=>e.name===`divider`)?[`data-resize-handle-active`]:[]],attributeOldValue:!0,childList:n||A().some(e=>e.enter),characterData:n,characterDataOldValue:n,subtree:!0})}function pe(e,t){let n=A();for(let[e,r]of t)n.includes(e)||(r(),t.delete(e));for(let r of n)r.watch&&!t.has(r)&&t.set(r,r.watch(e))}function me(){let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,ce,e),document.addEventListener(`pointerup`,W,e),document.addEventListener(`pointercancel`,W,e),document.addEventListener(`keydown`,K,e),document.addEventListener(`keyup`,le,e),L=[()=>{document.removeEventListener(`pointerdown`,ce,e),document.removeEventListener(`pointerup`,W,e),document.removeEventListener(`pointercancel`,W,e),document.removeEventListener(`keydown`,K,e),document.removeEventListener(`keyup`,le,e),I=void 0;for(let e of F.keys())V(e,!0)},c(e=>{if(e){I=void 0;for(let e of F.keys())V(e,!0)}})]}function he(e,t){if(typeof document>`u`)return()=>{};let n=ee();return n?(ne(n),n.install(e,t.effects,s)):(te(ge),_e(e,t.effects))}let ge={define:k,install:_e};function _e(e,t,n=s){let r=new Set(A().map(e=>e.name));for(let e of t)r.has(e.name)||k(e,n);if(!P){me();let e=new MutationObserver((e,t)=>fe(e.concat(t.takeRecords())));P=e,L.push(re(()=>{for(let[t,{watchers:n}]of N)q(t,e),pe(t,n)}))}let i=N.get(e);if(i)i.installs++;else{let t=/* @__PURE__ */ new Map;q(e,P),N.set(e,{installs:1,watchers:t}),pe(e,t)}let a=!1;return()=>{if(a)return;a=!0;let t=N.get(e);if(!t||--t.installs>0)return;N.delete(e);let n=P,r=n.takeRecords();n.disconnect();for(let e of t.watchers.values())e();if(N.size){for(let e of N.keys())q(e,n);r.length&&queueMicrotask(()=>{if(P!==n)return;let e=[...N.keys()];fe(r.filter(t=>e.some(e=>e.contains(t.target))))})}else{P=void 0;for(let e of L)e();L=[]}}}function ve(e,t,n,r){let i=(e,t,n)=>3*t*e*(1-e)**2+3*n*e**2*(1-e)+e**3;return a=>{if(a<=0||a>=1)return a<=0?0:1;let o=0,s=1,c=a;for(let t=0;t<24;t++)i(c,e,n)<a?o=c:s=c,c=(o+s)/2;return i(c,t,r)}}let ye=e=>e;function be(e,t,n,r,i){let a=(n.delay??0)/1e3,o=n.duration/1e3,c=n.ease??ye,l=s(),u=0;return{stop:b(n=>{u+=n;let d=!l&&s()||u>=a+o?1:o>0?Math.max(0,(u-a)/o):0;return r(e+(t-e)*c(d)),d<1||(i?.(),!1)})}}function xe(e,t,n=ye,r=0){let i=()=>{},a=new Promise(e=>i=e),o=be(0,1,{duration:e*1e3,delay:r*1e3,ease:n},t,()=>i(!0));return{done:a,stop:()=>{o.stop(),i(!1)}}}let Se={stiffness:900,damping:40},Ce={stiffness:380,damping:14},we=`:is(button, a[href], summary, input:is([type=button], [type=submit], [type=reset], [type=checkbox], [type=radio]), ${[`button`,`link`,`tab`,`radio`,`menuitem`,`menuitemradio`,`menuitemcheckbox`,`option`,`checkbox`].map(e=>`[role=${e}]`).join(`, `)}):not(:disabled, [aria-disabled="true"], [role=switch])`,Te=/* @__PURE__ */ new WeakMap,Ee=e=>e>=40?.03:e>=32?.04:.05;function De(e){let t=e.dataset.motionPressTarget?e.closest(e.dataset.motionPressTarget):null;if(t instanceof HTMLElement)return{target:t,amount:Ee(t.offsetHeight)};let n=e.firstElementChild;return e.childElementCount===1&&!e.textContent?.trim()&&(n instanceof HTMLElement||n instanceof SVGElement)&&n.matches(`svg, img, .iconify, [data-slot=icon], [data-slot$=Icon], [data-slot=swap-icon]`)?{target:n,amount:.15}:{target:e,amount:Ee(e.offsetHeight)}}function Oe(e){let t=e.transitionDuration.split(`,`);return e.transitionProperty.split(`,`).some((e,n)=>/^\s*(?:scale|all)\s*$/.test(e)&&Number.parseFloat(t[n%t.length])>0)}function ke(e,t,n){let{left:r,right:i,top:a,bottom:o,width:s,height:c}=e;return Math.min(t.clientX-r,i-t.clientX)<=s*n||Math.min(t.clientY-a,o-t.clientY)<=c*n}let Ae={name:`press`,selector:we,press(e,t){let{target:n,amount:r}=De(e),i=getComputedStyle(n);if(Oe(i)||i.display===`contents`||i.display===`inline`&&n===e&&!(e instanceof HTMLInputElement))return;let a;if(n===e&&`pointerId`in t&&(a=e.getBoundingClientRect(),ke(a,t,r)))return;let o=Te.get(n);if(!o){let e={amount:r,spring:S(0,t=>{M(n,{scale:t?String(1-e.amount*t):null})},Se)};o=e,Te.set(n,o)}o.amount=r;let{spring:s}=o;s.to(1,{preset:Se});let c=!1,l=()=>{c||(c=!0,s.set(0))};return{move:a?e=>{ke(a,e,r)&&l()}:void 0,release:()=>{c||s.to(0,{preset:Ce})},cancel:l}}};function je(e){let t=e.cloneNode(!0);t.inert=!0,t.setAttribute(`aria-hidden`,`true`);for(let e of[t,...t.querySelectorAll(`[id], [name], [form], input, button, select, textarea, fieldset`)])e.removeAttribute(`id`),e.removeAttribute(`name`),e.removeAttribute(`form`),e.matches(`input, button, select, textarea, fieldset`)&&e.setAttribute(`disabled`,``);return t}let Me={stiffness:380,damping:26},Ne={stiffness:260,damping:28},Pe=.9,Fe=ve(.5,0,.75,0),Ie=`data-motion-ghost`,J=e=>({x:e.left+e.width/2,y:e.top+e.height/2});function Y(e){return e.bottom>0&&e.right>0&&e.top<innerHeight&&e.left<innerWidth&&e.width+e.height>0}function Le(e){return[...e.children].filter(e=>e instanceof HTMLElement&&!e.hasAttribute(Ie))}function Re(e,t={}){let n=t.items??Le,r=/* @__PURE__ */ new Map,i=/* @__PURE__ */ new Set,a=/* @__PURE__ */ new Map,o=!1;function c(e){if(!e)return{x:0,y:0};let t=1-e.grow.value;return{x:e.x.value+e.from.x*t,y:e.y.value+e.from.y*t}}function u(e,t){let{x:n,y:i,grow:a,from:s}=t;if(!n.active&&!i.active&&!a.active&&n.value===0&&i.value===0&&a.value===1){M(e,{translate:null,scale:null,opacity:null}),o||r.delete(e);return}let{x:l,y:u}=c(t),d=s.scale+(1-s.scale)*a.value;M(e,{translate:l||u?`${l.toFixed(2)}px ${u.toFixed(2)}px`:null,scale:d===1?null:d.toFixed(4),opacity:a.value>=1?null:Math.max(0,Math.min(1,a.value)).toFixed(3)})}function d(e){let t=r.get(e);if(t)return t;let n=()=>t&&u(e,t);return t={x:S(0,n,l.snappy),y:S(0,n,l.snappy),grow:S(1,n,Me),from:{x:0,y:0,scale:1}},r.set(e,t),t}function f(e){let t=r.get(e);t&&(r.delete(e),t.x.stop(),t.y.stop(),t.grow.stop(),M(e,{translate:null,scale:null,opacity:null}))}function p(e,t){let n=e.velocity;e.set(t),e.to(0,{preset:l.snappy,velocity:n})}function m(t,n,r){if(!Y(n))return;let a=e.getBoundingClientRect();getComputedStyle(e).position===`static`&&(e.style.position=`relative`);let o=je(t);o.setAttribute(Ie,``),Object.assign(o.style,{boxSizing:`border-box`,height:`${n.height}px`,left:`${n.left-a.left-e.clientLeft+e.scrollLeft}px`,margin:`0`,pointerEvents:`none`,position:`absolute`,top:`${n.top-a.top-e.clientTop+e.scrollTop}px`,width:`${n.width}px`}),M(o,{translate:null,scale:null,opacity:null,filter:null}),e.append(o);let c={element:o,stop:()=>{}},l=()=>{c.stop(),o.remove(),i.delete(c)};if(i.add(c),s()){let e=xe(.15,e=>M(o,{opacity:(1-e).toFixed(3)}));c.stop=e.stop,e.done.then(l);return}if(r){let e=J(r.getBoundingClientRect()),t=J(n),i=xe(.32,n=>{M(o,{translate:`${((e.x-t.x)*n).toFixed(2)}px ${((e.y-t.y)*n).toFixed(2)}px`,scale:(1-.8*n).toFixed(4),opacity:(1-n).toFixed(3),filter:n>0?`blur(${(3*n).toFixed(2)}px)`:null})},Fe);c.stop=i.stop,i.done.then(l);return}let u=S(1,e=>{M(o,{scale:(Pe+.09999999999999998*e).toFixed(4),opacity:Math.max(0,e).toFixed(3)}),e<.02&&l()},Ne);c.stop=()=>u.stop(),u.to(0)}return{measure(){a=/* @__PURE__ */ new Map;for(let t of n(e)){let e=t.getBoundingClientRect();if(!e.width&&!e.height)continue;let n=J(e),i=c(r.get(t));a.set(t,{x:n.x-i.x,y:n.y-i.y,rect:e})}},play(i={}){let l=a;a=/* @__PURE__ */ new Map;let u=C(e),h=n(e),g=new Set(h),_=h.map(e=>{let t=e.getBoundingClientRect(),n=c(r.get(e)),i=J(t);return{element:e,rect:t,layout:{x:i.x-n.x,y:i.y-n.y}}}),v=_.map(({element:e})=>{if(!l.has(e)&&i.origin)return(typeof i.origin==`function`?i.origin(e):i.origin)?.getBoundingClientRect()});for(let[e,{rect:n}]of l)g.has(e)||(f(e),u||t.movesOnly||e.hasAttribute(`data-motion-leaving`)||m(e,n,i.target));o=!0,_.forEach(({element:e,rect:n,layout:r},i)=>{if(u)return f(e);let a=l.get(e);if(a){let t=a.x-r.x,i=a.y-r.y;if(Math.abs(t)<.5&&Math.abs(i)<.5)return;if(!Y(a.rect)&&!Y(n))return f(e);let o=d(e);p(o.x,o.x.value+t),p(o.y,o.y.value+i);return}if(!Y(n)||t.movesOnly)return;let o=d(e),c=v[i];if(s())o.from={x:0,y:0,scale:1};else if(c){let e=J(c),t=Math.min(1,Math.max(.2,Math.min(c.width/(n.width||1),c.height/(n.height||1))));o.from={x:e.x-r.x,y:e.y-r.y,scale:t}}else o.from={x:0,y:0,scale:Pe};o.grow.set(0),o.grow.to(1,s()?{tween:.15}:{preset:Me})}),o=!1},destroy(){for(let e of r.keys())f(e);for(let e of i)e.stop(),e.element.remove();i.clear(),a=/* @__PURE__ */ new Map}}}let ze=`button{all:unset;box-sizing:border-box;display:inline-flex;align-items:center;justify-content:var(--vitehub-pill-justify,center);gap:4px;min-width:28px;height:28px;padding:0 8px;border-radius:8px;font:inherit;white-space:nowrap;color:var(--vitehub-pill-text);cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition-property:background-color,color;transition-duration:150ms;transition-timing-function:cubic-bezier(.23,1,.32,1)}
|
|
2
2
|
@media(hover:hover){button:where(:not(:disabled):hover){background:var(--vitehub-pill-hover);color:var(--vitehub-pill-strong)}}
|
|
3
|
-
button:where(:not(:disabled):active){scale:.96}
|
|
4
3
|
button[aria-pressed=true],button[aria-expanded=true]{background:var(--vitehub-pill-on);color:var(--vitehub-pill-on-text)}
|
|
5
4
|
:host([aria-busy=true]) button,button[aria-busy=true]{background:var(--vitehub-pill-on);color:var(--vitehub-pill-on-text);cursor:progress}
|
|
6
5
|
button:focus-visible{outline:2px solid var(--vitehub-pill-on);outline-offset:1px}
|
|
7
6
|
button svg{width:14px;height:14px;flex:none}
|
|
8
7
|
@media(any-pointer:coarse){button{min-width:44px;height:44px}}
|
|
9
|
-
@media(prefers-reduced-motion:reduce){button{transition:none}}`,
|
|
10
|
-
:host([collapsed]){--margin:2px;--vitehub-pill-
|
|
11
|
-
:host(:is([edge=top],[edge=bottom])){left:${
|
|
12
|
-
:host(:is([edge=left],[edge=right])){top:${
|
|
8
|
+
@media(prefers-reduced-motion:reduce){button{transition:none}}`,Be={effects:[Ae]},Ve=[[`0px`,`6px`],[`6px`,`0px`],[`calc(100% - 6px)`,`0px`],[`100%`,`6px`],[`100%`,`50%`],[`100%`,`50%`],[`100%`,`calc(100% - 6px)`],[`calc(100% - 6px)`,`100%`],[`6px`,`100%`],[`0px`,`calc(100% - 6px)`],[`0px`,`50%`],[`0px`,`50%`]],He=e=>e.map(([e,t])=>[`calc(50% + var(--vitehub-hex-w) * ${e})`,`calc(50% + var(--vitehub-hex-h) * ${t})`]),Ue=He([[-.28,-.453],[-.208,-.5],[.208,-.5],[.28,-.453],[.488,-.047],[.488,.047],[.28,.453],[.208,.5],[-.208,.5],[-.28,.453],[-.488,.047],[-.488,-.047]]),We=He([[-.5,-.5],[-.5,-.5],[.5,-.5],[.5,-.5],[.5,0],[.5,0],[.5,.5],[.5,.5],[-.5,.5],[-.5,.5],[-.5,0],[-.5,0]]),X=e=>`polygon(${e.map(([e,t])=>`${e} ${t}`).join(`,`)})`;function Ge(e,t,n){let r=(1-n).toFixed(4),i=n.toFixed(4);return X(e.map(([e,n],a)=>[`calc(${e} * ${r} + ${t[a][0]} * ${i})`,`calc(${n} * ${r} + ${t[a][1]} * ${i})`]))}let Ke=X(Ve),qe=X(Ue),Je=X(We),Z=e=>`calc(var(--start) + ${e} / 2 + (100% - var(--start) - var(--end) - ${e}) * var(--at) / 100)`,Ye=`:host{all:initial;position:fixed;z-index:2147483001;pointer-events:none;filter:drop-shadow(0 8px 24px rgb(0 0 0/25%));color-scheme:dark;font:500 12px/1 ui-sans-serif,system-ui,sans-serif;color:#d4d4d4;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--vitehub-pill-text:#d4d4d4;--vitehub-pill-strong:#fafafa;--vitehub-pill-muted:#a3a3a3;--vitehub-pill-hover:rgb(255 255 255/8%);--vitehub-pill-on:#fafafa;--vitehub-pill-on-text:#0a0a0a;--vitehub-pill-line:rgb(255 255 255/12%);--vitehub-pill-surface:#111;--vitehub-pill-flow:row;--vitehub-hex-h:24px;--vitehub-hex-w:calc(var(--vitehub-hex-h) * 10 / 9);--vitehub-pill-fade:opacity 160ms ease-out 80ms,visibility 0s;--vitehub-pill-fade-end:opacity 160ms ease-out 120ms,visibility 0s;--at:50;--margin:16px;--safe-top:env(safe-area-inset-top,0px);--safe-right:env(safe-area-inset-right,0px);--safe-bottom:env(safe-area-inset-bottom,0px);--safe-left:env(safe-area-inset-left,0px)}
|
|
9
|
+
:host([collapsed]){--margin:2px;--vitehub-pill-fade:opacity 80ms ease-out,visibility 0s 80ms;--vitehub-pill-fade-end:opacity 40ms ease-out,visibility 0s 40ms}
|
|
10
|
+
:host(:is([edge=top],[edge=bottom])){left:${Z(`0px`)};--start:max(var(--margin),var(--safe-left));--end:max(var(--margin),var(--safe-right));--x:calc(var(--at) * -1%)}
|
|
11
|
+
:host(:is([edge=left],[edge=right])){top:${Z(`0px`)};--start:max(var(--margin),var(--safe-top));--end:max(var(--margin),var(--safe-bottom));--y:calc(var(--at) * -1%);--vitehub-pill-flow:column;--vitehub-pill-justify:flex-start}
|
|
13
12
|
:host([edge=bottom]){bottom:max(16px,var(--safe-bottom))}
|
|
14
13
|
:host([edge=top]){top:max(16px,var(--safe-top))}
|
|
15
14
|
:host([edge=right]){right:max(16px,var(--safe-right))}
|
|
16
15
|
:host([edge=left]){left:max(16px,var(--safe-left))}
|
|
17
|
-
:host([collapsed]:is([edge=top],[edge=bottom])){left:${
|
|
18
|
-
:host([collapsed]:is([edge=left],[edge=right])){top:${
|
|
16
|
+
:host([collapsed]:is([edge=top],[edge=bottom])){left:${Z(`var(--vitehub-hex-w)`)};--x:-50%}
|
|
17
|
+
:host([collapsed]:is([edge=left],[edge=right])){top:${Z(`var(--vitehub-hex-h)`)};--y:-50%}
|
|
19
18
|
:host([collapsed][edge=bottom]){bottom:calc(max(2px,var(--safe-bottom)) + var(--vitehub-hex-h) / 2);--y:50%}
|
|
20
19
|
:host([collapsed][edge=top]){top:calc(max(2px,var(--safe-top)) + var(--vitehub-hex-h) / 2);--y:-50%}
|
|
21
20
|
:host([collapsed][edge=right]){right:calc(max(2px,var(--safe-right)) + var(--vitehub-hex-w) / 2);--x:50%}
|
|
22
21
|
:host([collapsed][edge=left]){left:calc(max(2px,var(--safe-left)) + var(--vitehub-hex-w) / 2);--x:-50%}
|
|
23
|
-
:host{translate
|
|
22
|
+
:host{transform:translate(var(--x,0),var(--y,0))}
|
|
24
23
|
:host([dragging]){transition:none;cursor:grabbing;user-select:none;-webkit-user-select:none}
|
|
25
|
-
div{position:relative;box-sizing:border-box;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;scrollbar-width:none;display:flex;flex-direction:var(--vitehub-pill-flow);align-items:center;gap:8px;padding:4px;border:1px solid var(--vitehub-pill-line);border-radius:12px;background:rgb(17 17 17/92%);pointer-events:auto;clip-path
|
|
24
|
+
div{position:relative;box-sizing:border-box;max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto;scrollbar-width:none;display:flex;flex-direction:var(--vitehub-pill-flow);align-items:center;gap:8px;padding:4px;border:1px solid var(--vitehub-pill-line);border-radius:12px;background:rgb(17 17 17/92%);pointer-events:auto;clip-path:${Ke};transition:background-color 150ms ease-out}
|
|
26
25
|
:host(:is([edge=left],[edge=right])) div{display:grid;grid-template-columns:auto 1fr;align-items:stretch;gap:8px 2px}
|
|
27
|
-
:host([collapsed]) div{clip-path:${
|
|
26
|
+
:host([collapsed]) div{clip-path:${qe}}
|
|
28
27
|
@media(hover:hover){:host([collapsed]) div:hover{background:rgb(38 38 38/94%)}}
|
|
29
|
-
:host([
|
|
30
|
-
:host([dragging]) div{transition:none;scale:none}
|
|
28
|
+
:host([dragging]) div{transition:none}
|
|
31
29
|
::slotted(*){flex-shrink:0;display:flex;flex-direction:var(--vitehub-pill-flow);align-items:center;gap:2px;transition:var(--vitehub-pill-fade)}
|
|
32
30
|
:host(:is([edge=left],[edge=right])) ::slotted(*){grid-column:1/-1;align-items:stretch}
|
|
33
31
|
::slotted([hidden]){display:none!important}
|
|
@@ -45,26 +43,26 @@ div{position:relative;box-sizing:border-box;max-width:calc(100vw - 32px);max-hei
|
|
|
45
43
|
:host([edge=top]) ::slotted([slot=tab]){border-top:0;border-radius:0 0 10px 10px}
|
|
46
44
|
:host([edge=left]) ::slotted([slot=tab]){border-left:0;border-radius:0 10px 10px 0}
|
|
47
45
|
:host([edge=right]) ::slotted([slot=tab]){border-right:0;border-radius:10px 0 0 10px}
|
|
48
|
-
${
|
|
46
|
+
${ze}
|
|
49
47
|
button{flex-shrink:0;padding:0;justify-content:center}
|
|
50
|
-
.exit{position:sticky;right:0;bottom:0;transition:background-color 150ms,color 150ms,
|
|
48
|
+
.exit{position:sticky;right:0;bottom:0;transition:background-color 150ms,color 150ms,var(--vitehub-pill-fade-end)}
|
|
51
49
|
:host(:is([edge=left],[edge=right])) .mark{justify-self:start}
|
|
52
50
|
:host(:is([edge=left],[edge=right])) .exit{grid-area:1/2;justify-self:end;top:0;bottom:auto}
|
|
53
51
|
.mark{position:sticky;left:0;top:0;z-index:1;cursor:grab}
|
|
54
52
|
:host([dragging]) .mark{cursor:grabbing}
|
|
55
53
|
.mark,.mark[aria-expanded=true]{background:none;color:var(--vitehub-pill-strong)}
|
|
56
54
|
@media(hover:hover){.mark:hover{background:var(--vitehub-pill-hover)}}
|
|
57
|
-
.mark svg{width:16px;height:16px;transition:opacity 160ms ease-out 120ms
|
|
58
|
-
:host([collapsed]) .mark svg{opacity:0;scale
|
|
59
|
-
:host([collapsed]) .mark:is(:hover,:active){background:none
|
|
60
|
-
:host([collapsed]) .mark{translate
|
|
55
|
+
.mark svg{width:16px;height:16px;transition:opacity 160ms ease-out 120ms}
|
|
56
|
+
:host([collapsed]) .mark svg{opacity:0;transform:scale(.6);transition-duration:40ms;transition-delay:0s}
|
|
57
|
+
:host([collapsed]) .mark:is(:hover,:active){background:none}
|
|
58
|
+
:host([collapsed]) .mark{transform:translate(var(--vitehub-mark-x,0),var(--vitehub-mark-y,0))}
|
|
61
59
|
:host([collapsed]) .mark::before{content:"";position:absolute;inset:-8px}
|
|
62
|
-
:host([fold=mark]){transition
|
|
60
|
+
:host([fold=mark]){transition:filter 240ms ease-out}
|
|
63
61
|
:host([fold=mark][collapsed]){filter:drop-shadow(0 1px 2px rgb(0 0 0/25%))}
|
|
64
|
-
:host([fold=mark]:not([dragging])) div{transition:
|
|
65
|
-
:host([fold=mark][collapsed]) div,:host([fold=mark][collapsed]) div:hover{clip-path:${
|
|
66
|
-
:host([fold=mark]) .mark{transition
|
|
67
|
-
:host([fold=mark]) .mark svg{transition:
|
|
68
|
-
:host([fold=mark][collapsed]) .mark svg{opacity:1;scale
|
|
69
|
-
@media(any-pointer:coarse){:host{--vitehub-hex-h:40px}:host([fold=mark][collapsed]) .mark svg{scale
|
|
70
|
-
@media(prefers-reduced-motion:reduce){:host,div,::slotted(*),.exit,.mark svg,:host([
|
|
62
|
+
:host([fold=mark]:not([dragging])) div{transition:background-color 120ms ease-out,border-color 120ms ease-out}
|
|
63
|
+
:host([fold=mark][collapsed]) div,:host([fold=mark][collapsed]) div:hover{clip-path:${Je};background-color:transparent;border-color:transparent}
|
|
64
|
+
:host([fold=mark]) .mark{transition:background-color 150ms ease-out,color 150ms ease-out}
|
|
65
|
+
:host([fold=mark]) .mark svg{transition:none}
|
|
66
|
+
:host([fold=mark][collapsed]) .mark svg{opacity:1;transform:scale(1.5)}
|
|
67
|
+
@media(any-pointer:coarse){:host{--vitehub-hex-h:40px}:host([fold=mark][collapsed]) .mark svg{transform:scale(2.5)}}
|
|
68
|
+
@media(prefers-reduced-motion:reduce){:host,div,::slotted(*),.exit,.mark svg,:host([fold=mark]) :is(div,.mark){transition:none}}`;function Q(e,t,n){let r=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(let[t,i]of Object.entries({viewBox:e,"aria-hidden":`true`,...n}))r.setAttribute(t,i);let i=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return i.setAttribute(`d`,t),r.append(i),r}let Xe=[`top`,`right`,`bottom`,`left`];function Ze(e){return Xe.some(t=>t===e)}function Qe(e){let t=typeof e==`object`&&e?Reflect.get(e,`edge`):void 0,n=typeof e==`object`&&e?Reflect.get(e,`at`):void 0;return Ze(t)&&typeof n==`number`&&n>=0&&n<=100?{edge:t,at:n}:void 0}function $e(e){try{return Qe(JSON.parse(localStorage.getItem(e)??`null`))}catch{return}}function et(e,t,n,r){let i=Math.min(70,r/4),a=Math.atan2(t-r/2,e-n/2),o=Math.atan2(i-r/2,-n/2),s=Math.atan2(i-r/2,n/2),c=Math.atan2(r/2-i,n/2),l=Math.atan2(r/2-i,-n/2);return a>=o&&a<=s?`top`:a>s&&a<c?`right`:a>=c&&a<=l?`bottom`:`left`}function tt(e,t,n,r,i){let a=i-n-r-t,o=a>0?Math.min(100,Math.max(0,(e-n-t/2)/a*100)):50;return o<2?0:o>98?100:Math.abs(o-50)<3?50:Math.round(o*10)/10}let nt=/* @__PURE__ */ new WeakMap;function rt(e){let t=e?getComputedStyle(e).transform:`none`,n=/^matrix\(([^,]+)/.exec(t)?.[1];return n&&Number.parseFloat(n)||1}function it(e,t,n,r,i){let a=()=>e.getAttribute(`fold`)===`mark`?We:Ue,o=()=>n.querySelector(`svg`),c={x:0,y:0},u=1,d=!1,f,p=[],m=()=>{if(!d&&!h.active&&!_.active&&!v.active){M(t,{"clip-path":null}),M(e,{translate:null}),M(n,{translate:null});let r=o();r&&M(r,{scale:null});for(let e of p)e();p=[],i();return}let r=e.hasAttribute(`collapsed`),s=h.value;M(t,{"clip-path":Ge(Ve,a(),s)}),M(e,{translate:`${_.value.toFixed(2)}px ${v.value.toFixed(2)}px`});let l=r?c:{x:0,y:0};M(n,{translate:`${(c.x*s-l.x).toFixed(2)}px ${(c.y*s-l.y).toFixed(2)}px`});let f=o();f&&M(f,{scale:((1+(u-1)*s)/(r?u:1)).toFixed(4)})},h=S(0,m,l.snappy),_=S(0,m,l.snappy),v=S(0,m,l.snappy),y=()=>{let e=t.getBoundingClientRect();return{x:e.left+e.width/2-_.value,y:e.top+e.height/2-v.value}},b=()=>{c={x:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-x`))||0,y:Number.parseFloat(n.style.getPropertyValue(`--vitehub-mark-y`))||0},e.hasAttribute(`collapsed`)&&(u=rt(o()))};return{get moving(){return d||h.active||_.active||v.active},move(t,n=0){r();let i=new Promise(e=>p.push(e)),a=y(),o=e.hasAttribute(`collapsed`);b(),t(),b();let c=y(),u=e.hasAttribute(`collapsed`);clearTimeout(f),d=!0;for(let[e,t]of[[_,a.x-c.x+_.value],[v,a.y-c.y+v.value]]){let n=e.velocity;e.set(t),n&&e.to(t,{velocity:n})}h.active||h.set(+!!o);let m=()=>{d=!1,_.to(0,{preset:l.snappy}),v.to(0,{preset:l.snappy}),h.to(+!!u,{preset:l.snappy})};return n>0&&!s()?f=setTimeout(m,n*g()):m(),i}}}function at(e){let{signal:t}=e,n=document.createElement(e.name);n.style.viewTransitionName=e.name,e.fold===`mark`&&n.setAttribute(`fold`,`mark`);let r=n.attachShadow({mode:`open`}),i=document.createElement(`style`);i.textContent=Ye;let a=document.createElement(`div`);a.setAttribute(`role`,`toolbar`),a.setAttribute(`aria-label`,e.label);let o=document.createElement(`button`);o.className=`mark`,o.append(e.mark);let s=e.initial?.collapsed===!0,c=t=>{t&&a.scrollTo(0,0),n.toggleAttribute(`collapsed`,t),t&&e.fold!==`mark`?o.dataset.motionPressTarget=`[role=toolbar]`:delete o.dataset.motionPressTarget,o.setAttribute(`aria-expanded`,String(!t)),o.setAttribute(`aria-label`,`${t?`Show`:`Hide`} ${e.label}`),o.title=`${o.getAttribute(`aria-label`)}. Drag to move.`},u=()=>e.markOnly?.active()===!0,d=e.markOnly?.opened===!0,f=()=>u()?!d:ct(e.storage.collapsed)??s;c(f()),o.addEventListener(`click`,()=>{if(b())return;let t=!n.hasAttribute(`collapsed`);if(E.move(()=>{c(t),y(g)},t?40:0),u())d=!t;else try{t===s?localStorage.removeItem(e.storage.collapsed):localStorage.setItem(e.storage.collapsed,t?`1`:`0`)}catch{}});let p=e.exit,m;p&&(m=document.createElement(`button`),m.className=`exit`,m.setAttribute(`aria-label`,p.label),m.title=p.label,m.append(Q(`0 0 24 24`,`M18 6 6 18M6 6l12 12`,{width:`15`,height:`15`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`})),p.menu||m.addEventListener(`click`,e=>p.press(e.detail===0))),a.append(o,...m?[m]:[]);let h=document.createElement(`slot`);h.name=`tab`,h.className=`tabs`,r.append(i,h,a),m&&p?.menu&&r.append(...p.menu(m));for(let t of e.slots){let e=document.createElement(`slot`);e.name=t,a.insertBefore(e,m??null)}let g=$e(e.storage.dock)??e.initial?.dock??{edge:`bottom`,at:50},_=g,v=()=>g.edge===`left`||g.edge===`right`,y=t=>{g=t,_=u()&&!n.hasAttribute(`dragging`)&&t.edge===`bottom`?{edge:`bottom`,at:t.at<50?0:100}:t,n.setAttribute(`edge`,_.edge),n.style.setProperty(`--at`,String(_.at));let r=n.hasAttribute(`collapsed`),i=r?v()?$(n).width:$(n).height:v()?a.offsetWidth:a.offsetHeight;e.onPlace?.({..._,collapsed:r,thickness:i}),o.style.setProperty(`--vitehub-mark-x`,`${a.clientWidth/2-o.offsetLeft-o.offsetWidth/2}px`),o.style.setProperty(`--vitehub-mark-y`,`${a.clientHeight/2-o.offsetTop-o.offsetHeight/2}px`)},b=st({host:n,handle:o,dock:()=>g,shape:e=>{let t=n.hasAttribute(`collapsed`),r=t?e?n.offsetHeight:n.offsetWidth:e?a.offsetHeight:a.offsetWidth;return{size:r,lead:t?r/2:e?o.offsetTop+o.offsetHeight/2:o.offsetLeft+o.offsetWidth/2,part:t?e?$(n).height:$(n).width:r,margin:t?2:16}},place:y,drop:()=>{E.move(()=>y(g));try{localStorage.setItem(e.storage.dock,JSON.stringify({edge:g.edge,at:g.at}))}catch{}},signal:t}),x=Re(a,{items:()=>[o,...[...n.children].filter(e=>e instanceof HTMLElement&&e.slot!==`tab`),...m?[m]:[]],movesOnly:!0}),C={width:0,height:0},w={top:0,right:0,bottom:0,left:0},T=S(0,(e,t)=>{M(a,{"clip-path":t===0&&e===0?null:`inset(${[w.top,w.right,w.bottom,w.left].map(t=>`${(t*e).toFixed(2)}px`).join(` `)} round 12px)`})},l.snappy),E=it(n,a,o,()=>T.stop(),()=>x.measure());nt.set(n,E);let D=[he(n,Be),he(r,Be)];if(t.aborted){for(let e of D)e();return n}let O=new ResizeObserver(()=>{let e=C;if(C={width:a.offsetWidth,height:a.offsetHeight},y(g),n.hasAttribute(`collapsed`)||n.hasAttribute(`dragging`)||E.moving)return;if(!e.width)return x.measure();x.play(),x.measure();let t={x:C.width-e.width,y:C.height-e.height},r={x:v()?_.edge===`right`?t.x:0:t.x*_.at/100,y:v()?t.y*_.at/100:_.edge===`bottom`?t.y:0};w={top:Math.max(0,r.y),right:Math.max(0,t.x-r.x),bottom:Math.max(0,t.y-r.y),left:Math.max(0,r.x)},(w.top||w.right||w.bottom||w.left)&&(T.set(1),T.to(0,{preset:l.snappy}))});return t.addEventListener(`abort`,()=>{n.remove(),O.disconnect(),T.stop(),x.destroy();for(let e of D)e()},{once:!0}),(e.parent??document.documentElement).append(n),y(g),t.aborted||(O.observe(a),e.markOnly?.watch(()=>{d=!1;let e=n.contains(document.activeElement),t=f();E.move(()=>{c(t),y(g)},t&&!n.hasAttribute(`collapsed`)?40:0),e&&n.hasAttribute(`collapsed`)&&o.focus({preventScroll:!0})},t)),n}async function ot(e){if(e.inert=!0,e.hasAttribute(`collapsed`)||matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let t=e.shadowRoot?.querySelector(`div`),n=nt.get(e);if(!t?.offsetWidth||!n){e.setAttribute(`collapsed`,``);return}Object.assign(t.style,{width:`${t.offsetWidth}px`,height:`${t.offsetHeight}px`});let r=n.move(()=>e.setAttribute(`collapsed`,``),40);await Promise.race([r,new Promise(e=>setTimeout(e,600*g()))])}function st(e){let{host:t,handle:n}=e,r,i=!1;return n.style.touchAction=`none`,n.addEventListener(`pointerdown`,a=>{if(a.button!==0||r!==void 0)return;r=a.pointerId,i=!1;let o=n.getBoundingClientRect(),s={x:a.clientX-o.left-o.width/2,y:a.clientY-o.top-o.height/2};n.setPointerCapture(a.pointerId);let c=n=>{if(n.pointerId!==a.pointerId||!i&&Math.hypot(n.clientX-a.clientX,n.clientY-a.clientY)<4)return;i=!0,t.setAttribute(`dragging`,``);let r=document.documentElement.clientWidth,o=document.documentElement.clientHeight,c=n.clientX-s.x,l=n.clientY-s.y,u=et(c,l,r,o);u!==e.dock().edge&&e.place({edge:u,at:e.dock().at});let d=u===`left`||u===`right`,{size:f,lead:p,part:m,margin:h}=e.shape(d),g=(d?l:c)-p+f/2,_=getComputedStyle(t),v=Math.max(h,Number.parseFloat(_.getPropertyValue(d?`--safe-top`:`--safe-left`))||0),y=Math.max(h,Number.parseFloat(_.getPropertyValue(d?`--safe-bottom`:`--safe-right`))||0);e.place({edge:u,at:tt(g,m,v,y,d?o:r)})};n.addEventListener(`pointermove`,c);let l=o=>{o.pointerId===a.pointerId&&(n.removeEventListener(`pointermove`,c),n.removeEventListener(`lostpointercapture`,l),r=void 0,i&&(t.removeAttribute(`dragging`),e.drop(),setTimeout(()=>{i=!1})))};n.addEventListener(`lostpointercapture`,l)},{signal:e.signal}),()=>i}function $(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--vitehub-hex-h`))||24;return{width:t*10/9,height:t}}function ct(e){try{let t=localStorage.getItem(e);return t===`1`||t!==`0`&&void 0}catch{return}}return e.closeViteHubPagePill=ot,e.mountViteHubPagePill=at,e.readViteHubPageDock=Qe,e.viteHubPagePillStyles=Ye,e.viteHubPageSvgIcon=Q,e.viteHubPillButtonStyles=ze,e})({});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { l as ConsoleUser } from "./auth-types-
|
|
2
|
-
import { n as ViteHubSiteVisitorReader } from "./page-tools-
|
|
3
|
-
//#region ../internal/src/runtime/page-tools-shared.d.ts
|
|
1
|
+
import { l as ConsoleUser } from "./auth-types-B4mq4YhK.js";
|
|
2
|
+
import { n as ViteHubSiteVisitorReader } from "./page-tools-UwsfvH-B.js";
|
|
4
3
|
/**
|
|
5
4
|
* The person who is signed in to the app, as the session route returns it. The pill shows them with a menu that signs
|
|
6
5
|
* them out. The route sends it only to a signed-in visitor who gets at least one tool.
|
|
@@ -15,9 +14,9 @@ interface ViteHubPageAccount {
|
|
|
15
14
|
via?: "console";
|
|
16
15
|
/** The path that ends the app session with a `POST`, such as `/api/auth/sign-out`. It ends no other session. */
|
|
17
16
|
signOut: string;
|
|
17
|
+
/** A guest of Site access, whose one-time invite cannot sign them in again, so the exit button never signs them out. */
|
|
18
|
+
guest?: true;
|
|
18
19
|
}
|
|
19
|
-
//#endregion
|
|
20
|
-
//#region src/console/runtime/server/page-tool.d.ts
|
|
21
20
|
/** The person of a page request, and whether they get the Console link without `authorize`. */
|
|
22
21
|
interface ConsolePageUser {
|
|
23
22
|
user: ConsoleUser;
|
|
@@ -61,8 +60,8 @@ declare function consolePageAccount({ user, signOut }: ConsolePageUser): ViteHub
|
|
|
61
60
|
/**
|
|
62
61
|
* Registers the **Console** link in the page tools pill, and installs the page tools, so an app with the Console and no
|
|
63
62
|
* Comments gets them too. With Auth, it also registers the account of the pill: the signed-in user and a sign-out of
|
|
64
|
-
* the app. Generated Console output calls this with the app base.
|
|
63
|
+
* the app. Generated Console output calls this with the app base. A build serves the page tools only on the origins of
|
|
64
|
+
* `vitehub({ publicUrl })`, when it is set. A development server serves them on every origin.
|
|
65
65
|
*/
|
|
66
66
|
declare function installConsolePageTool(nitroApp: unknown, options: ConsolePageToolOptions): void;
|
|
67
|
-
//#endregion
|
|
68
67
|
export { installConsolePageTool as a, consolePageToolAllowed as i, ConsolePageUser as n, consolePageAccount as r, ConsolePageToolOptions as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as viteHubPageToolsHintCookie, c as viteHubPageToolsLoader, f as viteHubPageToolsWanted, l as viteHubPageToolsMarker, m as withViteHubBase, n as viteHubBasePath, o as viteHubPageToolsInlineScript, r as viteHubPageSessionPath,
|
|
2
|
-
import { t as forwardedRequestOrigin } from "./request-origin-
|
|
3
|
-
|
|
1
|
+
import { a as viteHubPageToolsHintCookie, c as viteHubPageToolsLoader, f as viteHubPageToolsWanted, l as viteHubPageToolsMarker, m as withViteHubBase, n as viteHubBasePath, o as viteHubPageToolsInlineScript, r as viteHubPageSessionPath, t as readViteHubPageAccount } from "./page-tools-shared-hJcG_xk8.js";
|
|
2
|
+
import { n as matchesPublicOrigin, t as forwardedRequestOrigin } from "./request-origin-pzWr9UUu.js";
|
|
3
|
+
// ../internal/src/runtime/page-tools-html.ts
|
|
4
4
|
/** The effective script-element directive is shared by HTTP and HTML meta policies. */
|
|
5
5
|
function scriptPolicyNonce(policy) {
|
|
6
6
|
const directives = policy.split(";").map((part) => part.trim());
|
|
@@ -28,7 +28,7 @@ function isGeneratedCheck(inline) {
|
|
|
28
28
|
try {
|
|
29
29
|
const path = JSON.parse(inline.slice(at + 7, -1));
|
|
30
30
|
const nonce = tagNonce(inline);
|
|
31
|
-
return typeof path === "string" && path.endsWith("/_vitehub/page/assets/loader.js?v=
|
|
31
|
+
return typeof path === "string" && path.endsWith("/_vitehub/page/assets/loader.js?v=22") && viteHubPageToolsInlineScript(path.slice(0, -36), nonce) === `${inline}<\/script>`;
|
|
32
32
|
} catch {
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
@@ -142,7 +142,7 @@ function pageToolsHtmlTransform(loader) {
|
|
|
142
142
|
}
|
|
143
143
|
if (!closing && name && /^(script|style|textarea|title|xmp|iframe|noembed|noframes|noscript|plaintext)$/.test(name)) {
|
|
144
144
|
rawText = name;
|
|
145
|
-
if (!templates && token.replace(/ nonce="[\w+/=-]+"/, "") ===
|
|
145
|
+
if (!templates && token.replace(/ nonce="[\w+/=-]+"/, "") === "<script type=\"module\" data-vitehub-page-tools>") {
|
|
146
146
|
inline = token;
|
|
147
147
|
present = true;
|
|
148
148
|
continue;
|
|
@@ -161,8 +161,7 @@ function pageToolsHtmlTransform(loader) {
|
|
|
161
161
|
}
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
|
|
165
|
-
//#region ../internal/src/runtime/page-tools.ts
|
|
164
|
+
// ../internal/src/runtime/page-tools.ts
|
|
166
165
|
const stateKey = Symbol.for("vitehub.page-tools");
|
|
167
166
|
const scope = globalThis;
|
|
168
167
|
function state() {
|
|
@@ -228,6 +227,10 @@ function viteHubPageGrants() {
|
|
|
228
227
|
function installViteHubSiteVisitor(reader) {
|
|
229
228
|
state().siteVisitor = reader;
|
|
230
229
|
}
|
|
230
|
+
/** Whether the app serves its page tools on the origin of the request. Every origin counts for an app without `origins`. */
|
|
231
|
+
function servesOrigin(nitroApp, request) {
|
|
232
|
+
return matchesPublicOrigin(request, state().origins?.get(nitroApp) ?? []);
|
|
233
|
+
}
|
|
231
234
|
/** The path of a URL below the app base. A path outside the base stays as it is. */
|
|
232
235
|
function pathBelow(base, pathname) {
|
|
233
236
|
return base && (pathname === base || pathname.startsWith(`${base}/`)) ? pathname.slice(base.length) || "/" : pathname;
|
|
@@ -245,6 +248,7 @@ function isPagePath(url, base) {
|
|
|
245
248
|
function pageAddition(nitroApp, request, base) {
|
|
246
249
|
const url = new URL(request.url);
|
|
247
250
|
if ((state().tools.get(nitroApp)?.size ?? 0) === 0 || !isPagePath(url, base)) return void 0;
|
|
251
|
+
if (!request.headers.has("x-nitro-prerender") && !servesOrigin(nitroApp, request)) return void 0;
|
|
248
252
|
return viteHubPageToolsWanted(url.search, request.headers.get("cookie") ?? "") ? "loader" : "bootstrap";
|
|
249
253
|
}
|
|
250
254
|
function loaderTag(base, nonce) {
|
|
@@ -262,12 +266,13 @@ function sessionResponse(value, init = {}) {
|
|
|
262
266
|
});
|
|
263
267
|
}
|
|
264
268
|
/**
|
|
265
|
-
* Answers `GET <base>/_vitehub/page/
|
|
269
|
+
* Answers `GET <base>/_vitehub/page/tools`: the tools whose `allowed` check passes for this visitor, in registration
|
|
266
270
|
* order. The app base is the part of the request path before the session path, as the Console finds its own base, and
|
|
267
271
|
* each tool `script` path gets it. When at least one tool is allowed, the answer also has the `account` of a signed-in
|
|
268
272
|
* visitor, from the reader of `registerViteHubPageAccount()`. An anonymous visitor never gets one. It sets the hint cookie to `1` when at least one tool is allowed, and to `0` when
|
|
269
273
|
* none is, so a signed-in person without access does not ask again on each page. A tool whose check throws is not
|
|
270
|
-
* allowed. Requests from other sites get 403 and run no check.
|
|
274
|
+
* allowed. Requests from other sites get 403 and run no check. An origin that the app does not serve its page tools on
|
|
275
|
+
* gets 404.
|
|
271
276
|
*/
|
|
272
277
|
async function respondViteHubPageSession(nitroApp, request) {
|
|
273
278
|
if (request.method !== "GET" && request.method !== "HEAD") return sessionResponse({ error: {
|
|
@@ -279,6 +284,10 @@ async function respondViteHubPageSession(nitroApp, request) {
|
|
|
279
284
|
code: "VITEHUB_PAGE_TOOLS_CROSS_ORIGIN",
|
|
280
285
|
why: "The page tools session answers the site's own pages only."
|
|
281
286
|
} }, { status: 403 });
|
|
287
|
+
if (!servesOrigin(nitroApp, request)) return sessionResponse({ error: {
|
|
288
|
+
code: "VITEHUB_PAGE_TOOLS_ORIGIN",
|
|
289
|
+
why: "The page tools answer only on the public URL of the app."
|
|
290
|
+
} }, { status: 404 });
|
|
282
291
|
const registered = [...state().tools.get(nitroApp)?.values() ?? []];
|
|
283
292
|
const checks = await Promise.all(registered.map(async (tool) => {
|
|
284
293
|
try {
|
|
@@ -303,8 +312,8 @@ async function respondViteHubPageSession(nitroApp, request) {
|
|
|
303
312
|
} : { tools }, { cookie: viteHubPageToolsHintCookie(tools.length > 0) });
|
|
304
313
|
}
|
|
305
314
|
/**
|
|
306
|
-
* The route of `GET /_vitehub/page/
|
|
307
|
-
* app in `
|
|
315
|
+
* The route of `GET /_vitehub/page/tools`: a Fetchable (https://fetchable.org). `installViteHubPageTools()` binds
|
|
316
|
+
* each Request to its app in Nitro's `request` hook, so the route finds the tools of that app.
|
|
308
317
|
*/
|
|
309
318
|
const viteHubPageSessionHandler = { async fetch(request) {
|
|
310
319
|
const nitroApp = state().apps.get(request);
|
|
@@ -416,13 +425,21 @@ function transformPage(response, tag, personal) {
|
|
|
416
425
|
* static assets, still shows the pill. Call it from each owner's Nitro plugin: it installs once per app, whatever the
|
|
417
426
|
* number of calls. It reads that app's registry and configured base on each request, so plugin order does not matter.
|
|
418
427
|
* It wraps `nitroApp.fetch`, the Web entry that every preset and the prerenderer call. The tag uses `options.base`.
|
|
428
|
+
* It binds each request to the app in Nitro's `request` hook too, since another wrapper of `fetch` may pass a copy of
|
|
429
|
+
* the request inward, such as the `security` policy of `vite-hub` on Node.js.
|
|
419
430
|
*/
|
|
420
431
|
function installViteHubPageTools(nitroApp, options = {}) {
|
|
421
432
|
if (nitroApp === null || typeof nitroApp !== "object") return;
|
|
422
433
|
const { installed, bases } = state();
|
|
423
434
|
if (options.base !== void 0) bases.set(nitroApp, viteHubBasePath(options.base));
|
|
435
|
+
if (options.origins !== void 0) (state().origins ??= /* @__PURE__ */ new WeakMap()).set(nitroApp, options.origins);
|
|
424
436
|
if (installed.has(nitroApp)) return;
|
|
425
437
|
installed.add(nitroApp);
|
|
438
|
+
const hooks = Reflect.get(nitroApp, "hooks");
|
|
439
|
+
const hook = hooks && typeof hooks === "object" ? Reflect.get(hooks, "hook") : void 0;
|
|
440
|
+
if (hook instanceof Function) Reflect.apply(hook, hooks, ["request", (event) => {
|
|
441
|
+
if (event?.req instanceof Request) state().apps.set(event.req, nitroApp);
|
|
442
|
+
}]);
|
|
426
443
|
const fetch = Reflect.get(nitroApp, "fetch");
|
|
427
444
|
if (fetch instanceof Function) {
|
|
428
445
|
Reflect.set(nitroApp, "fetch", async (request, ...rest) => {
|
|
@@ -440,5 +457,4 @@ function installViteHubPageTools(nitroApp, options = {}) {
|
|
|
440
457
|
return;
|
|
441
458
|
}
|
|
442
459
|
}
|
|
443
|
-
//#endregion
|
|
444
460
|
export { viteHubPageGrants as a, registerViteHubPageTool as i, installViteHubSiteVisitor as n, viteHubPageSessionHandler as o, registerViteHubPageAccount as r, viteHubPageToolAllows as s, installViteHubPageTools as t };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
//#region ../internal/src/runtime/page-tools.d.ts
|
|
2
1
|
/**
|
|
3
2
|
* A person that Site access in the Console signed in to an app without ViteHub Auth: a Console member, or a guest, with
|
|
4
3
|
* their roles, such as `console` and `comments-write`. The Console seals them in the `vitehub_site` cookie.
|
|
@@ -13,11 +12,10 @@ interface ViteHubSiteVisitor {
|
|
|
13
12
|
/** Reads the Site access person of a request. It returns undefined without a valid, unrevoked cookie. */
|
|
14
13
|
type ViteHubSiteVisitorReader = (request: Request) => Promise<ViteHubSiteVisitor | undefined>;
|
|
15
14
|
/**
|
|
16
|
-
* The route of `GET /_vitehub/page/
|
|
17
|
-
* app in `
|
|
15
|
+
* The route of `GET /_vitehub/page/tools`: a Fetchable (https://fetchable.org). `installViteHubPageTools()` binds
|
|
16
|
+
* each Request to its app in Nitro's `request` hook, so the route finds the tools of that app.
|
|
18
17
|
*/
|
|
19
18
|
declare const viteHubPageSessionHandler: {
|
|
20
19
|
fetch(request: Request): Promise<Response>;
|
|
21
20
|
};
|
|
22
|
-
//#endregion
|
|
23
21
|
export { ViteHubSiteVisitorReader as n, viteHubPageSessionHandler as r, ViteHubSiteVisitor as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../internal/src/runtime/page-tools-shared.ts
|
|
2
2
|
/**
|
|
3
3
|
* The names and the session answer that the page tools server and the browser loader share. It has no DOM and no Node
|
|
4
4
|
* code, so both sides import it.
|
|
@@ -52,13 +52,16 @@ function viteHubPageToolsWanted(search, cookie) {
|
|
|
52
52
|
* any path under a public asset prefix that has no file, and gives the whole prefix the asset cache headers.
|
|
53
53
|
*/
|
|
54
54
|
const viteHubPageToolsAssets = "/_vitehub/page/assets";
|
|
55
|
-
/**
|
|
56
|
-
|
|
55
|
+
/**
|
|
56
|
+
* The route of the visitor check. It is public, and each tool checks the visitor itself. Its path has no auth word,
|
|
57
|
+
* such as `session`, because Vite Doctor takes a handler on such a path for an auth route without a guard.
|
|
58
|
+
*/
|
|
59
|
+
const viteHubPageSessionPath = "/_vitehub/page/tools";
|
|
57
60
|
/**
|
|
58
61
|
* The URL of the loader script, below the app base. Its version query changes when the loader changes, so caches keep
|
|
59
62
|
* it 5 minutes.
|
|
60
63
|
*/
|
|
61
|
-
const viteHubPageToolsLoader = "/_vitehub/page/assets/loader.js?v=
|
|
64
|
+
const viteHubPageToolsLoader = "/_vitehub/page/assets/loader.js?v=22";
|
|
62
65
|
/** The attribute of the script that loads the page tools. A page that has it does not get a second one. */
|
|
63
66
|
const viteHubPageToolsMarker = "data-vitehub-page-tools";
|
|
64
67
|
/** The bootstrap's opening tag, so the server can recognize the generated bootstrap when it replaces it. */
|
|
@@ -116,7 +119,7 @@ function readViteHubPageAccount(value) {
|
|
|
116
119
|
const image = text(Reflect.get(value, "image"));
|
|
117
120
|
if (image && /^https?:\/\//i.test(image)) account.image = image;
|
|
118
121
|
if (Reflect.get(value, "via") === "console") account.via = "console";
|
|
122
|
+
if (Reflect.get(value, "guest") === true) account.guest = true;
|
|
119
123
|
return account;
|
|
120
124
|
}
|
|
121
|
-
//#endregion
|
|
122
125
|
export { viteHubPageToolsHintCookie as a, viteHubPageToolsLoader as c, viteHubPageToolsResetCookie as d, viteHubPageToolsWanted as f, viteHubPageToolsAssets as i, viteHubPageToolsMarker as l, withViteHubBase as m, viteHubBasePath as n, viteHubPageToolsInlineScript as o, viteHubSessionMarkerCookie as p, viteHubPageSessionPath as r, viteHubPageToolsInlineStart as s, readViteHubPageAccount as t, viteHubPageToolsQuery as u };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// ../../node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.mjs
|
|
2
2
|
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
3
3
|
function normalizeWindowsPath(input = "") {
|
|
4
4
|
if (!input) return input;
|
|
@@ -95,33 +95,4 @@ const dirname = function(p) {
|
|
|
95
95
|
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) segments[0] += "/";
|
|
96
96
|
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
97
97
|
};
|
|
98
|
-
|
|
99
|
-
//#region ../internal/src/inspect.ts
|
|
100
|
-
function relativeDefinitionFile(projectRoot, file) {
|
|
101
|
-
return relative(projectRoot, file).replaceAll("\\", "/");
|
|
102
|
-
}
|
|
103
|
-
/** Summarizes Definitions that have no owner-specific fields. */
|
|
104
|
-
function summarizeDefinitions(projectRoot, definitions, fallbackSource) {
|
|
105
|
-
return definitions.map((definition) => ({
|
|
106
|
-
fields: [],
|
|
107
|
-
file: relativeDefinitionFile(projectRoot, definition.handler),
|
|
108
|
-
name: definition.name,
|
|
109
|
-
source: definition.source || fallbackSource
|
|
110
|
-
}));
|
|
111
|
-
}
|
|
112
|
-
const redactedInspectionValue = "[redacted]";
|
|
113
|
-
const secretKeyPattern = /secret|token|passw(?:or)?d|credential|api[-_\s]?key|private[-_\s]?key|authorization|cookie|signature|dsn|connection[-_\s]?string/i;
|
|
114
|
-
const embeddedUrlCredentialPattern = /\b([a-z][a-z0-9+.-]*:\/\/)[^/\s?#]*@/gi;
|
|
115
|
-
const embeddedCookiePattern = /\b([\w-]*cookie[\w-]*["']?\s*[:=]\s*)(?:"(?:\\[^\r\n]|[^"\\\r\n])*"(?:\s*;\s*[\w.-]+\s*=[^;\r\n]*)*|'(?:\\[^\r\n]|[^'\\\r\n])*'(?:\s*;\s*[\w.-]+\s*=[^;\r\n]*)*|[^\r\n]+?(?=\s*(?:;\s*[^;=\r\n/]+\s*(?:\r?\n|$)|&|\r?\n|$)))/gi;
|
|
116
|
-
const embeddedBearerPattern = /\bbearer\s+[^\s,;]+/gi;
|
|
117
|
-
const embeddedAuthorizationPattern = new RegExp(String.raw`\b([\w-]*authorization[\w-]*["']?\s*[:=]\s*)(?!\[redacted\](?=$|[\s,;}&]))(?:"(?:\\[^\r\n]|[^"\\\r\n])*"|'(?:\\[^\r\n]|[^'\\\r\n])*'|[^\r\n]+?(?=\s*(?:[,;])?\s*(?:${secretKeyPattern.source})[\w-]*\s*[:=]|\s+rejected\b|$))`, "gi");
|
|
118
|
-
const embeddedSecretAssignmentPattern = new RegExp(String.raw`\b([\w-]*(?:${secretKeyPattern.source})[\w-]*["']?\s*[:=]\s*)(?!\[redacted\](?=$|[\s,;}&]))(?:"(?:\\[^\r\n]|[^"\\\r\n])*"|'(?:\\[^\r\n]|[^'\\\r\n])*'|[^\s,;&#&]+)`, "gi");
|
|
119
|
-
/**
|
|
120
|
-
* Removes credentials inside free text, for example an error message. URL credentials, bearer tokens, and
|
|
121
|
-
* `name=value` pairs with a secret name are replaced with `[redacted]`.
|
|
122
|
-
*/
|
|
123
|
-
function redactInspectionText(value) {
|
|
124
|
-
return value.replace(embeddedUrlCredentialPattern, `$1${redactedInspectionValue}@`).replace(embeddedAuthorizationPattern, `$1${redactedInspectionValue}`).replace(embeddedCookiePattern, `$1${redactedInspectionValue}`).replace(embeddedBearerPattern, `Bearer ${redactedInspectionValue}`).replace(embeddedSecretAssignmentPattern, `$1${redactedInspectionValue}`);
|
|
125
|
-
}
|
|
126
|
-
//#endregion
|
|
127
|
-
export { resolve as a, relative as i, summarizeDefinitions as n, dirname as r, redactInspectionText as t };
|
|
98
|
+
export { relative as n, resolve as r, dirname as t };
|