d1s 0.2.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 +7 -0
- package/dist/.next/.next/BUILD_ID +1 -0
- package/dist/.next/.next/app-build-manifest.json +109 -0
- package/dist/.next/.next/app-path-routes-manifest.json +1 -0
- package/dist/.next/.next/build-manifest.json +33 -0
- package/dist/.next/.next/cache/.rscinfo +1 -0
- package/dist/.next/.next/cache/.tsbuildinfo +1 -0
- package/dist/.next/.next/cache/webpack/client-production/0.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/1.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/2.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/index.pack +0 -0
- package/dist/.next/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/dist/.next/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/dist/.next/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/0.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/1.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/index.pack +0 -0
- package/dist/.next/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/dist/.next/.next/diagnostics/build-diagnostics.json +6 -0
- package/dist/.next/.next/diagnostics/framework.json +1 -0
- package/dist/.next/.next/export-marker.json +1 -0
- package/dist/.next/.next/images-manifest.json +1 -0
- package/dist/.next/.next/next-minimal-server.js.nft.json +1 -0
- package/dist/.next/.next/next-server.js.nft.json +1 -0
- package/dist/.next/.next/package.json +1 -0
- package/dist/.next/.next/prerender-manifest.json +1 -0
- package/dist/.next/.next/react-loadable-manifest.json +1 -0
- package/dist/.next/.next/required-server-files.json +1 -0
- package/dist/.next/.next/routes-manifest.json +1 -0
- package/dist/.next/.next/server/app/_not-found/page.js +1 -0
- package/dist/.next/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/dist/.next/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/_not-found.html +1 -0
- package/dist/.next/.next/server/app/_not-found.meta +8 -0
- package/dist/.next/.next/server/app/_not-found.rsc +16 -0
- package/dist/.next/.next/server/app/api/cloudflare/route.js +1 -0
- package/dist/.next/.next/server/app/api/cloudflare/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/cloudflare/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/databases/route.js +1 -0
- package/dist/.next/.next/server/app/api/databases/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/databases/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/migrations/sync/route.js +12 -0
- package/dist/.next/.next/server/app/api/migrations/sync/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/migrations/sync/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/migrations/sync-files/route.js +1 -0
- package/dist/.next/.next/server/app/api/migrations/sync-files/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/migrations/sync-files/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/pull-remote/confirm/route.js +1 -0
- package/dist/.next/.next/server/app/api/pull-remote/confirm/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/pull-remote/confirm/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/pull-remote/preview/route.js +1 -0
- package/dist/.next/.next/server/app/api/pull-remote/preview/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/pull-remote/preview/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/push-remote/confirm/route.js +14 -0
- package/dist/.next/.next/server/app/api/push-remote/confirm/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/push-remote/confirm/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/push-remote/preview/route.js +14 -0
- package/dist/.next/.next/server/app/api/push-remote/preview/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/push-remote/preview/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/query/route.js +8 -0
- package/dist/.next/.next/server/app/api/query/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/query/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/tables/[name]/route.js +5 -0
- package/dist/.next/.next/server/app/api/tables/[name]/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/tables/[name]/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/api/tables/route.js +7 -0
- package/dist/.next/.next/server/app/api/tables/route.js.nft.json +1 -0
- package/dist/.next/.next/server/app/api/tables/route_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app/index.html +3 -0
- package/dist/.next/.next/server/app/index.meta +7 -0
- package/dist/.next/.next/server/app/index.rsc +20 -0
- package/dist/.next/.next/server/app/page.js +58 -0
- package/dist/.next/.next/server/app/page.js.nft.json +1 -0
- package/dist/.next/.next/server/app/page_client-reference-manifest.js +1 -0
- package/dist/.next/.next/server/app-paths-manifest.json +15 -0
- package/dist/.next/.next/server/chunks/336.js +1 -0
- package/dist/.next/.next/server/chunks/627.js +6 -0
- package/dist/.next/.next/server/chunks/638.js +13 -0
- package/dist/.next/.next/server/chunks/801.js +55 -0
- package/dist/.next/.next/server/chunks/973.js +2 -0
- package/dist/.next/.next/server/chunks/992.js +3 -0
- package/dist/.next/.next/server/functions-config-manifest.json +1 -0
- package/dist/.next/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/dist/.next/.next/server/middleware-build-manifest.js +1 -0
- package/dist/.next/.next/server/middleware-manifest.json +6 -0
- package/dist/.next/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/dist/.next/.next/server/next-font-manifest.js +1 -0
- package/dist/.next/.next/server/next-font-manifest.json +1 -0
- package/dist/.next/.next/server/pages/404.html +1 -0
- package/dist/.next/.next/server/pages/500.html +1 -0
- package/dist/.next/.next/server/pages/_app.js +1 -0
- package/dist/.next/.next/server/pages/_app.js.nft.json +1 -0
- package/dist/.next/.next/server/pages/_document.js +1 -0
- package/dist/.next/.next/server/pages/_document.js.nft.json +1 -0
- package/dist/.next/.next/server/pages/_error.js +1 -0
- package/dist/.next/.next/server/pages/_error.js.nft.json +1 -0
- package/dist/.next/.next/server/pages-manifest.json +1 -0
- package/dist/.next/.next/server/server-reference-manifest.js +1 -0
- package/dist/.next/.next/server/server-reference-manifest.json +1 -0
- package/dist/.next/.next/server/webpack-runtime.js +1 -0
- package/dist/.next/.next/static/ODMSSwVqLoDcBgbFHUjr8/_buildManifest.js +1 -0
- package/dist/.next/.next/static/ODMSSwVqLoDcBgbFHUjr8/_ssgManifest.js +1 -0
- package/dist/.next/.next/static/chunks/422-6fa3c14fc64ad67b.js +1 -0
- package/dist/.next/.next/static/chunks/4bd1b696-8c908eb707f85a27.js +1 -0
- package/dist/.next/.next/static/chunks/517-3b698a5d3da06ff7.js +2 -0
- package/dist/.next/.next/static/chunks/692-ede418e1d28a1394.js +1 -0
- package/dist/.next/.next/static/chunks/735-c9144179c6bd7d06.js +1 -0
- package/dist/.next/.next/static/chunks/92-c4466e0f1ca8a3a8.js +1 -0
- package/dist/.next/.next/static/chunks/app/_not-found/page-b786c3dd79ad15a5.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/cloudflare/route-3458d78022185d7f.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/databases/route-64255424877a9f72.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/migrations/sync/route-03766b3afcf043ba.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/migrations/sync-files/route-02fa291c8000dadf.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/pull-remote/confirm/route-7e05bb8920127abe.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/pull-remote/preview/route-0fa15f783e8a306c.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/push-remote/confirm/route-96691f1880e4ed14.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/push-remote/preview/route-a798679c67374552.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/query/route-e90d0030a5083e20.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/tables/[name]/route-1efe63e73b480e58.js +1 -0
- package/dist/.next/.next/static/chunks/app/api/tables/route-3772b4f480c4b4a4.js +1 -0
- package/dist/.next/.next/static/chunks/app/layout-8360fab69b848283.js +1 -0
- package/dist/.next/.next/static/chunks/app/page-75081ac7a88cb706.js +1 -0
- package/dist/.next/.next/static/chunks/framework-d29117d969504448.js +1 -0
- package/dist/.next/.next/static/chunks/main-8d0ab17774ffa031.js +1 -0
- package/dist/.next/.next/static/chunks/main-app-d36cdfb402b40f13.js +1 -0
- package/dist/.next/.next/static/chunks/pages/_app-d23763e3e6c904ff.js +1 -0
- package/dist/.next/.next/static/chunks/pages/_error-9b7125ad1a1e68fa.js +1 -0
- package/dist/.next/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/.next/.next/static/chunks/webpack-c76ac1e586b2802a.js +1 -0
- package/dist/.next/.next/static/css/c51a7ef325e30c16.css +3 -0
- package/dist/.next/.next/static/media/569ce4b8f30dc480-s.p.woff2 +0 -0
- package/dist/.next/.next/static/media/747892c23ea88013-s.woff2 +0 -0
- package/dist/.next/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
- package/dist/.next/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
- package/dist/.next/.next/trace +3 -0
- package/dist/.next/.next/types/app/api/cloudflare/route.ts +347 -0
- package/dist/.next/.next/types/app/api/databases/route.ts +347 -0
- package/dist/.next/.next/types/app/api/migrations/sync/route.ts +347 -0
- package/dist/.next/.next/types/app/api/migrations/sync-files/route.ts +347 -0
- package/dist/.next/.next/types/app/api/pull-remote/confirm/route.ts +347 -0
- package/dist/.next/.next/types/app/api/pull-remote/preview/route.ts +347 -0
- package/dist/.next/.next/types/app/api/push-remote/confirm/route.ts +347 -0
- package/dist/.next/.next/types/app/api/push-remote/preview/route.ts +347 -0
- package/dist/.next/.next/types/app/api/query/route.ts +347 -0
- package/dist/.next/.next/types/app/api/tables/[name]/route.ts +347 -0
- package/dist/.next/.next/types/app/api/tables/route.ts +347 -0
- package/dist/.next/.next/types/app/page.ts +84 -0
- package/dist/.next/.next/types/cache-life.d.ts +141 -0
- package/dist/.next/.next/types/package.json +1 -0
- package/dist/.next/BUILD_ID +1 -0
- package/dist/.next/app-build-manifest.json +109 -0
- package/dist/.next/app-path-routes-manifest.json +1 -0
- package/dist/.next/build-manifest.json +33 -0
- package/dist/.next/cache/.rscinfo +1 -0
- package/dist/.next/cache/.tsbuildinfo +1 -0
- package/dist/.next/cache/webpack/client-production/0.pack +0 -0
- package/dist/.next/cache/webpack/client-production/index.pack +0 -0
- package/dist/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/dist/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/dist/.next/cache/webpack/server-production/0.pack +0 -0
- package/dist/.next/cache/webpack/server-production/index.pack +0 -0
- package/dist/.next/diagnostics/build-diagnostics.json +6 -0
- package/dist/.next/diagnostics/framework.json +1 -0
- package/dist/.next/export-marker.json +1 -0
- package/dist/.next/images-manifest.json +1 -0
- package/dist/.next/next-minimal-server.js.nft.json +1 -0
- package/dist/.next/next-server.js.nft.json +1 -0
- package/dist/.next/package.json +1 -0
- package/dist/.next/prerender-manifest.json +1 -0
- package/dist/.next/react-loadable-manifest.json +1 -0
- package/dist/.next/required-server-files.json +1 -0
- package/dist/.next/routes-manifest.json +1 -0
- package/dist/.next/server/app/_not-found/page.js +1 -0
- package/dist/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/dist/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/_not-found.html +1 -0
- package/dist/.next/server/app/_not-found.meta +8 -0
- package/dist/.next/server/app/_not-found.rsc +16 -0
- package/dist/.next/server/app/api/cloudflare/route.js +1 -0
- package/dist/.next/server/app/api/cloudflare/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/cloudflare/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/databases/route.js +1 -0
- package/dist/.next/server/app/api/databases/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/databases/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/migrations/sync/route.js +12 -0
- package/dist/.next/server/app/api/migrations/sync/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/migrations/sync/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/migrations/sync-files/route.js +1 -0
- package/dist/.next/server/app/api/migrations/sync-files/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/migrations/sync-files/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/pull-remote/confirm/route.js +1 -0
- package/dist/.next/server/app/api/pull-remote/confirm/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/pull-remote/confirm/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/pull-remote/preview/route.js +1 -0
- package/dist/.next/server/app/api/pull-remote/preview/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/pull-remote/preview/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/push-remote/confirm/route.js +14 -0
- package/dist/.next/server/app/api/push-remote/confirm/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/push-remote/confirm/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/push-remote/preview/route.js +14 -0
- package/dist/.next/server/app/api/push-remote/preview/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/push-remote/preview/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/query/route.js +8 -0
- package/dist/.next/server/app/api/query/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/query/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/tables/[name]/route.js +5 -0
- package/dist/.next/server/app/api/tables/[name]/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/tables/[name]/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/api/tables/route.js +7 -0
- package/dist/.next/server/app/api/tables/route.js.nft.json +1 -0
- package/dist/.next/server/app/api/tables/route_client-reference-manifest.js +1 -0
- package/dist/.next/server/app/index.html +3 -0
- package/dist/.next/server/app/index.meta +7 -0
- package/dist/.next/server/app/index.rsc +20 -0
- package/dist/.next/server/app/page.js +58 -0
- package/dist/.next/server/app/page.js.nft.json +1 -0
- package/dist/.next/server/app/page_client-reference-manifest.js +1 -0
- package/dist/.next/server/app-paths-manifest.json +15 -0
- package/dist/.next/server/chunks/336.js +1 -0
- package/dist/.next/server/chunks/627.js +6 -0
- package/dist/.next/server/chunks/638.js +13 -0
- package/dist/.next/server/chunks/801.js +55 -0
- package/dist/.next/server/chunks/973.js +2 -0
- package/dist/.next/server/chunks/992.js +3 -0
- package/dist/.next/server/functions-config-manifest.json +1 -0
- package/dist/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/dist/.next/server/middleware-build-manifest.js +1 -0
- package/dist/.next/server/middleware-manifest.json +6 -0
- package/dist/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/dist/.next/server/next-font-manifest.js +1 -0
- package/dist/.next/server/next-font-manifest.json +1 -0
- package/dist/.next/server/pages/404.html +1 -0
- package/dist/.next/server/pages/500.html +1 -0
- package/dist/.next/server/pages/_app.js +1 -0
- package/dist/.next/server/pages/_app.js.nft.json +1 -0
- package/dist/.next/server/pages/_document.js +1 -0
- package/dist/.next/server/pages/_document.js.nft.json +1 -0
- package/dist/.next/server/pages/_error.js +1 -0
- package/dist/.next/server/pages/_error.js.nft.json +1 -0
- package/dist/.next/server/pages-manifest.json +1 -0
- package/dist/.next/server/server-reference-manifest.js +1 -0
- package/dist/.next/server/server-reference-manifest.json +1 -0
- package/dist/.next/server/webpack-runtime.js +1 -0
- package/dist/.next/static/OmPVuV0d1lrcjSBQzxkdH/_buildManifest.js +1 -0
- package/dist/.next/static/OmPVuV0d1lrcjSBQzxkdH/_ssgManifest.js +1 -0
- package/dist/.next/static/chunks/422-6fa3c14fc64ad67b.js +1 -0
- package/dist/.next/static/chunks/4bd1b696-8c908eb707f85a27.js +1 -0
- package/dist/.next/static/chunks/517-3b698a5d3da06ff7.js +2 -0
- package/dist/.next/static/chunks/692-ede418e1d28a1394.js +1 -0
- package/dist/.next/static/chunks/735-c9144179c6bd7d06.js +1 -0
- package/dist/.next/static/chunks/92-c4466e0f1ca8a3a8.js +1 -0
- package/dist/.next/static/chunks/app/_not-found/page-b786c3dd79ad15a5.js +1 -0
- package/dist/.next/static/chunks/app/api/cloudflare/route-3458d78022185d7f.js +1 -0
- package/dist/.next/static/chunks/app/api/databases/route-64255424877a9f72.js +1 -0
- package/dist/.next/static/chunks/app/api/migrations/sync/route-03766b3afcf043ba.js +1 -0
- package/dist/.next/static/chunks/app/api/migrations/sync-files/route-02fa291c8000dadf.js +1 -0
- package/dist/.next/static/chunks/app/api/pull-remote/confirm/route-7e05bb8920127abe.js +1 -0
- package/dist/.next/static/chunks/app/api/pull-remote/preview/route-0fa15f783e8a306c.js +1 -0
- package/dist/.next/static/chunks/app/api/push-remote/confirm/route-96691f1880e4ed14.js +1 -0
- package/dist/.next/static/chunks/app/api/push-remote/preview/route-a798679c67374552.js +1 -0
- package/dist/.next/static/chunks/app/api/query/route-e90d0030a5083e20.js +1 -0
- package/dist/.next/static/chunks/app/api/tables/[name]/route-1efe63e73b480e58.js +1 -0
- package/dist/.next/static/chunks/app/api/tables/route-3772b4f480c4b4a4.js +1 -0
- package/dist/.next/static/chunks/app/layout-8360fab69b848283.js +1 -0
- package/dist/.next/static/chunks/app/page-75081ac7a88cb706.js +1 -0
- package/dist/.next/static/chunks/framework-d29117d969504448.js +1 -0
- package/dist/.next/static/chunks/main-8d0ab17774ffa031.js +1 -0
- package/dist/.next/static/chunks/main-app-d36cdfb402b40f13.js +1 -0
- package/dist/.next/static/chunks/pages/_app-d23763e3e6c904ff.js +1 -0
- package/dist/.next/static/chunks/pages/_error-9b7125ad1a1e68fa.js +1 -0
- package/dist/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/dist/.next/static/chunks/webpack-c76ac1e586b2802a.js +1 -0
- package/dist/.next/static/css/c51a7ef325e30c16.css +3 -0
- package/dist/.next/static/media/569ce4b8f30dc480-s.p.woff2 +0 -0
- package/dist/.next/static/media/747892c23ea88013-s.woff2 +0 -0
- package/dist/.next/static/media/93f479601ee12b01-s.p.woff2 +0 -0
- package/dist/.next/static/media/ba015fad6dcf6784-s.woff2 +0 -0
- package/dist/.next/trace +13 -0
- package/dist/.next/types/app/api/cloudflare/route.ts +347 -0
- package/dist/.next/types/app/api/databases/route.ts +347 -0
- package/dist/.next/types/app/api/migrations/sync/route.ts +347 -0
- package/dist/.next/types/app/api/migrations/sync-files/route.ts +347 -0
- package/dist/.next/types/app/api/pull-remote/confirm/route.ts +347 -0
- package/dist/.next/types/app/api/pull-remote/preview/route.ts +347 -0
- package/dist/.next/types/app/api/push-remote/confirm/route.ts +347 -0
- package/dist/.next/types/app/api/push-remote/preview/route.ts +347 -0
- package/dist/.next/types/app/api/query/route.ts +347 -0
- package/dist/.next/types/app/api/tables/[name]/route.ts +347 -0
- package/dist/.next/types/app/api/tables/route.ts +347 -0
- package/dist/.next/types/app/page.ts +84 -0
- package/dist/.next/types/cache-life.d.ts +141 -0
- package/dist/.next/types/package.json +1 -0
- package/dist/app/api/cloudflare/route.js +146 -0
- package/dist/app/api/databases/route.js +72 -0
- package/dist/app/api/migrations/sync/route.js +172 -0
- package/dist/app/api/migrations/sync-files/route.js +172 -0
- package/dist/app/api/pull-remote/confirm/route.js +277 -0
- package/dist/app/api/pull-remote/preview/route.js +143 -0
- package/dist/app/api/push-remote/confirm/route.js +196 -0
- package/dist/app/api/push-remote/preview/route.js +178 -0
- package/dist/app/api/query/route.js +160 -0
- package/dist/app/api/tables/[name]/route.js +173 -0
- package/dist/app/api/tables/route.js +174 -0
- package/dist/app/app/api/cloudflare/route.js +146 -0
- package/dist/app/app/api/databases/route.js +72 -0
- package/dist/app/app/api/migrations/sync/route.js +172 -0
- package/dist/app/app/api/migrations/sync-files/route.js +172 -0
- package/dist/app/app/api/pull-remote/confirm/route.js +277 -0
- package/dist/app/app/api/pull-remote/preview/route.js +143 -0
- package/dist/app/app/api/push-remote/confirm/route.js +196 -0
- package/dist/app/app/api/push-remote/preview/route.js +178 -0
- package/dist/app/app/api/query/route.js +160 -0
- package/dist/app/app/api/tables/[name]/route.js +173 -0
- package/dist/app/app/api/tables/route.js +174 -0
- package/dist/app/app/globals.css +93 -0
- package/dist/app/app/layout.jsx +35 -0
- package/dist/app/app/page.jsx +37 -0
- package/dist/app/globals.css +93 -0
- package/dist/app/layout.jsx +35 -0
- package/dist/app/page.jsx +37 -0
- package/dist/d1-studio.js +344 -0
- package/dist/lib/database-queue.js +33 -0
- package/dist/lib/error.js +20 -0
- package/dist/lib/find-wrangler-config.js +67 -0
- package/dist/lib/license.js +99 -0
- package/dist/lib/migrations.js +415 -0
- package/dist/lib/parse-sql-error.js +200 -0
- package/dist/lib/request-deduplication.js +24 -0
- package/dist/lib/schema-operations.js +103 -0
- package/dist/lib/sql-error-types.js +14 -0
- package/dist/lib/sql-operations.js +557 -0
- package/dist/lib/utils.js +6 -0
- package/next.config.mjs +18 -0
- package/package.json +97 -0
- package/postcss.config.mjs +8 -0
- package/scripts/studio.js +344 -0
- package/scripts/test.js +168 -0
- package/src/app/api/cloudflare/route.js +146 -0
- package/src/app/api/databases/route.js +72 -0
- package/src/app/api/migrations/sync/route.js +172 -0
- package/src/app/api/migrations/sync-files/route.js +172 -0
- package/src/app/api/pull-remote/confirm/route.js +277 -0
- package/src/app/api/pull-remote/preview/route.js +143 -0
- package/src/app/api/push-remote/confirm/route.js +196 -0
- package/src/app/api/push-remote/preview/route.js +178 -0
- package/src/app/api/query/route.js +160 -0
- package/src/app/api/tables/[name]/route.js +173 -0
- package/src/app/api/tables/route.js +174 -0
- package/src/app/globals.css +93 -0
- package/src/app/layout.jsx +35 -0
- package/src/app/page.jsx +37 -0
- package/src/components/cloudflare-credentials-modal.jsx +94 -0
- package/src/components/column-selector.jsx +133 -0
- package/src/components/column-sorting.jsx +65 -0
- package/src/components/delete-records-dialog.jsx +64 -0
- package/src/components/download-button.jsx +205 -0
- package/src/components/edit-error-alert.jsx +30 -0
- package/src/components/editable-cell.jsx +163 -0
- package/src/components/editable-row.jsx +169 -0
- package/src/components/environment-handler.jsx +278 -0
- package/src/components/environment-select.jsx +59 -0
- package/src/components/pull-preview-toast.jsx +188 -0
- package/src/components/push-error-alert.jsx +72 -0
- package/src/components/push-preview-toast.jsx +183 -0
- package/src/components/query-results.jsx +112 -0
- package/src/components/refresh-button.jsx +61 -0
- package/src/components/resize-columns.jsx +101 -0
- package/src/components/sidebar.jsx +236 -0
- package/src/components/sql-editor.jsx +411 -0
- package/src/components/sql-error-display.jsx +167 -0
- package/src/components/sync-migrations-button.jsx +87 -0
- package/src/components/table-error-dialog.jsx +65 -0
- package/src/components/table-toolbar.jsx +285 -0
- package/src/components/table-view.jsx +843 -0
- package/src/components/ui/alert.jsx +47 -0
- package/src/components/ui/button.jsx +48 -0
- package/src/components/ui/card.jsx +50 -0
- package/src/components/ui/checkbox.jsx +24 -0
- package/src/components/ui/collapsible.jsx +11 -0
- package/src/components/ui/dialog.jsx +96 -0
- package/src/components/ui/dropdown-menu.jsx +158 -0
- package/src/components/ui/input.jsx +19 -0
- package/src/components/ui/scroll-area.jsx +40 -0
- package/src/components/ui/select.jsx +121 -0
- package/src/components/ui/separator.jsx +25 -0
- package/src/components/ui/sheet.jsx +109 -0
- package/src/components/ui/sidebar.jsx +620 -0
- package/src/components/ui/skeleton.jsx +14 -0
- package/src/components/ui/table.jsx +86 -0
- package/src/components/ui/tabs.jsx +43 -0
- package/src/components/ui/toast.jsx +86 -0
- package/src/components/ui/toaster.jsx +35 -0
- package/src/components/ui/tooltip.jsx +28 -0
- package/src/context/database-context.js +510 -0
- package/src/hooks/use-mobile.jsx +19 -0
- package/src/hooks/use-sql-error.ts +23 -0
- package/src/hooks/use-toast.js +155 -0
- package/src/lib/database-queue.js +33 -0
- package/src/lib/error.js +20 -0
- package/src/lib/find-wrangler-config.js +67 -0
- package/src/lib/license.js +99 -0
- package/src/lib/migrations.js +415 -0
- package/src/lib/parse-sql-error.js +200 -0
- package/src/lib/request-deduplication.js +24 -0
- package/src/lib/schema-operations.js +103 -0
- package/src/lib/sql-error-types.js +14 -0
- package/src/lib/sql-operations.js +557 -0
- package/src/lib/utils.js +6 -0
|
@@ -0,0 +1,620 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as React from "react"
|
|
3
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
import { PanelLeft } from "lucide-react"
|
|
6
|
+
|
|
7
|
+
import { useIsMobile } from "@/hooks/use-mobile"
|
|
8
|
+
import { cn } from "@/lib/utils"
|
|
9
|
+
import { Button } from "@/components/ui/button"
|
|
10
|
+
import { Input } from "@/components/ui/input"
|
|
11
|
+
import { Separator } from "@/components/ui/separator"
|
|
12
|
+
import { Sheet, SheetContent } from "@/components/ui/sheet"
|
|
13
|
+
import { Skeleton } from "@/components/ui/skeleton"
|
|
14
|
+
import {
|
|
15
|
+
Tooltip,
|
|
16
|
+
TooltipContent,
|
|
17
|
+
TooltipProvider,
|
|
18
|
+
TooltipTrigger,
|
|
19
|
+
} from "@/components/ui/tooltip"
|
|
20
|
+
|
|
21
|
+
const SIDEBAR_COOKIE_NAME = "sidebar:state"
|
|
22
|
+
const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
|
|
23
|
+
const SIDEBAR_WIDTH = "16rem"
|
|
24
|
+
const SIDEBAR_WIDTH_MOBILE = "18rem"
|
|
25
|
+
const SIDEBAR_WIDTH_ICON = "3rem"
|
|
26
|
+
const SIDEBAR_KEYBOARD_SHORTCUT = "b"
|
|
27
|
+
|
|
28
|
+
const SidebarContext = React.createContext(null)
|
|
29
|
+
|
|
30
|
+
function useSidebar() {
|
|
31
|
+
const context = React.useContext(SidebarContext)
|
|
32
|
+
if (!context) {
|
|
33
|
+
throw new Error("useSidebar must be used within a SidebarProvider.")
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return context
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const SidebarProvider = React.forwardRef((
|
|
40
|
+
{
|
|
41
|
+
defaultOpen = true,
|
|
42
|
+
open: openProp,
|
|
43
|
+
onOpenChange: setOpenProp,
|
|
44
|
+
className,
|
|
45
|
+
style,
|
|
46
|
+
children,
|
|
47
|
+
...props
|
|
48
|
+
},
|
|
49
|
+
ref
|
|
50
|
+
) => {
|
|
51
|
+
const isMobile = useIsMobile()
|
|
52
|
+
const [openMobile, setOpenMobile] = React.useState(false)
|
|
53
|
+
|
|
54
|
+
// This is the internal state of the sidebar.
|
|
55
|
+
// We use openProp and setOpenProp for control from outside the component.
|
|
56
|
+
const [_open, _setOpen] = React.useState(defaultOpen)
|
|
57
|
+
const open = openProp ?? _open
|
|
58
|
+
const setOpen = React.useCallback((value) => {
|
|
59
|
+
const openState = typeof value === "function" ? value(open) : value
|
|
60
|
+
if (setOpenProp) {
|
|
61
|
+
setOpenProp(openState)
|
|
62
|
+
} else {
|
|
63
|
+
_setOpen(openState)
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// This sets the cookie to keep the sidebar state.
|
|
67
|
+
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`
|
|
68
|
+
}, [setOpenProp, open])
|
|
69
|
+
|
|
70
|
+
// Helper to toggle the sidebar.
|
|
71
|
+
const toggleSidebar = React.useCallback(() => {
|
|
72
|
+
return isMobile
|
|
73
|
+
? setOpenMobile((open) => !open)
|
|
74
|
+
: setOpen((open) => !open);
|
|
75
|
+
}, [isMobile, setOpen, setOpenMobile])
|
|
76
|
+
|
|
77
|
+
// Adds a keyboard shortcut to toggle the sidebar.
|
|
78
|
+
React.useEffect(() => {
|
|
79
|
+
const handleKeyDown = (event) => {
|
|
80
|
+
if (
|
|
81
|
+
event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
|
|
82
|
+
(event.metaKey || event.ctrlKey)
|
|
83
|
+
) {
|
|
84
|
+
event.preventDefault()
|
|
85
|
+
toggleSidebar()
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
window.addEventListener("keydown", handleKeyDown)
|
|
90
|
+
return () => window.removeEventListener("keydown", handleKeyDown);
|
|
91
|
+
}, [toggleSidebar])
|
|
92
|
+
|
|
93
|
+
// We add a state so that we can do data-state="expanded" or "collapsed".
|
|
94
|
+
// This makes it easier to style the sidebar with Tailwind classes.
|
|
95
|
+
const state = open ? "expanded" : "collapsed"
|
|
96
|
+
|
|
97
|
+
const contextValue = React.useMemo(() => ({
|
|
98
|
+
state,
|
|
99
|
+
open,
|
|
100
|
+
setOpen,
|
|
101
|
+
isMobile,
|
|
102
|
+
openMobile,
|
|
103
|
+
setOpenMobile,
|
|
104
|
+
toggleSidebar,
|
|
105
|
+
}), [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar])
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
(<SidebarContext.Provider value={contextValue}>
|
|
109
|
+
<TooltipProvider delayDuration={0}>
|
|
110
|
+
<div
|
|
111
|
+
style={
|
|
112
|
+
{
|
|
113
|
+
"--sidebar-width": SIDEBAR_WIDTH,
|
|
114
|
+
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
115
|
+
...style
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
className={cn(
|
|
119
|
+
"group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",
|
|
120
|
+
className
|
|
121
|
+
)}
|
|
122
|
+
ref={ref}
|
|
123
|
+
{...props}>
|
|
124
|
+
{children}
|
|
125
|
+
</div>
|
|
126
|
+
</TooltipProvider>
|
|
127
|
+
</SidebarContext.Provider>)
|
|
128
|
+
);
|
|
129
|
+
})
|
|
130
|
+
SidebarProvider.displayName = "SidebarProvider"
|
|
131
|
+
|
|
132
|
+
const Sidebar = React.forwardRef((
|
|
133
|
+
{
|
|
134
|
+
side = "left",
|
|
135
|
+
variant = "sidebar",
|
|
136
|
+
collapsible = "offcanvas",
|
|
137
|
+
className,
|
|
138
|
+
children,
|
|
139
|
+
...props
|
|
140
|
+
},
|
|
141
|
+
ref
|
|
142
|
+
) => {
|
|
143
|
+
const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
|
|
144
|
+
|
|
145
|
+
if (collapsible === "none") {
|
|
146
|
+
return (
|
|
147
|
+
(<div
|
|
148
|
+
className={cn(
|
|
149
|
+
"flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",
|
|
150
|
+
className
|
|
151
|
+
)}
|
|
152
|
+
ref={ref}
|
|
153
|
+
{...props}>
|
|
154
|
+
{children}
|
|
155
|
+
</div>)
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
if (isMobile) {
|
|
160
|
+
return (
|
|
161
|
+
(<Sheet open={openMobile} onOpenChange={setOpenMobile} {...props}>
|
|
162
|
+
<SheetContent
|
|
163
|
+
data-sidebar="sidebar"
|
|
164
|
+
data-mobile="true"
|
|
165
|
+
className="w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden"
|
|
166
|
+
style={
|
|
167
|
+
{
|
|
168
|
+
"--sidebar-width": SIDEBAR_WIDTH_MOBILE
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
side={side}>
|
|
172
|
+
<div className="flex h-full w-full flex-col">{children}</div>
|
|
173
|
+
</SheetContent>
|
|
174
|
+
</Sheet>)
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return (
|
|
179
|
+
(<div
|
|
180
|
+
ref={ref}
|
|
181
|
+
className="group peer hidden text-sidebar-foreground md:block"
|
|
182
|
+
data-state={state}
|
|
183
|
+
data-collapsible={state === "collapsed" ? collapsible : ""}
|
|
184
|
+
data-variant={variant}
|
|
185
|
+
data-side={side}>
|
|
186
|
+
{/* This is what handles the sidebar gap on desktop */}
|
|
187
|
+
<div
|
|
188
|
+
className={cn(
|
|
189
|
+
"relative h-svh w-[--sidebar-width] bg-transparent transition-[width] duration-200 ease-linear",
|
|
190
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
191
|
+
"group-data-[side=right]:rotate-180",
|
|
192
|
+
variant === "floating" || variant === "inset"
|
|
193
|
+
? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]"
|
|
194
|
+
: "group-data-[collapsible=icon]:w-[--sidebar-width-icon]"
|
|
195
|
+
)} />
|
|
196
|
+
<div
|
|
197
|
+
className={cn(
|
|
198
|
+
"fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] duration-200 ease-linear md:flex",
|
|
199
|
+
side === "left"
|
|
200
|
+
? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]"
|
|
201
|
+
: "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",
|
|
202
|
+
// Adjust the padding for floating and inset variants.
|
|
203
|
+
variant === "floating" || variant === "inset"
|
|
204
|
+
? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]"
|
|
205
|
+
: "group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",
|
|
206
|
+
className
|
|
207
|
+
)}
|
|
208
|
+
{...props}>
|
|
209
|
+
<div
|
|
210
|
+
data-sidebar="sidebar"
|
|
211
|
+
className="flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow">
|
|
212
|
+
{children}
|
|
213
|
+
</div>
|
|
214
|
+
</div>
|
|
215
|
+
</div>)
|
|
216
|
+
);
|
|
217
|
+
})
|
|
218
|
+
Sidebar.displayName = "Sidebar"
|
|
219
|
+
|
|
220
|
+
const SidebarTrigger = React.forwardRef(({ className, onClick, ...props }, ref) => {
|
|
221
|
+
const { toggleSidebar } = useSidebar()
|
|
222
|
+
|
|
223
|
+
return (
|
|
224
|
+
(<Button
|
|
225
|
+
ref={ref}
|
|
226
|
+
data-sidebar="trigger"
|
|
227
|
+
variant="ghost"
|
|
228
|
+
size="icon"
|
|
229
|
+
className={cn("h-7 w-7", className)}
|
|
230
|
+
onClick={(event) => {
|
|
231
|
+
onClick?.(event)
|
|
232
|
+
toggleSidebar()
|
|
233
|
+
}}
|
|
234
|
+
{...props}>
|
|
235
|
+
<PanelLeft />
|
|
236
|
+
<span className="sr-only">Toggle Sidebar</span>
|
|
237
|
+
</Button>)
|
|
238
|
+
);
|
|
239
|
+
})
|
|
240
|
+
SidebarTrigger.displayName = "SidebarTrigger"
|
|
241
|
+
|
|
242
|
+
const SidebarRail = React.forwardRef(({ className, ...props }, ref) => {
|
|
243
|
+
const { toggleSidebar } = useSidebar()
|
|
244
|
+
|
|
245
|
+
return (
|
|
246
|
+
(<button
|
|
247
|
+
ref={ref}
|
|
248
|
+
data-sidebar="rail"
|
|
249
|
+
aria-label="Toggle Sidebar"
|
|
250
|
+
tabIndex={-1}
|
|
251
|
+
onClick={toggleSidebar}
|
|
252
|
+
title="Toggle Sidebar"
|
|
253
|
+
className={cn(
|
|
254
|
+
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
|
|
255
|
+
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
|
256
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
257
|
+
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar",
|
|
258
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
259
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
260
|
+
className
|
|
261
|
+
)}
|
|
262
|
+
{...props} />)
|
|
263
|
+
);
|
|
264
|
+
})
|
|
265
|
+
SidebarRail.displayName = "SidebarRail"
|
|
266
|
+
|
|
267
|
+
const SidebarInset = React.forwardRef(({ className, ...props }, ref) => {
|
|
268
|
+
return (
|
|
269
|
+
(<main
|
|
270
|
+
ref={ref}
|
|
271
|
+
className={cn(
|
|
272
|
+
"relative flex min-h-svh flex-1 flex-col bg-background",
|
|
273
|
+
"peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",
|
|
274
|
+
className
|
|
275
|
+
)}
|
|
276
|
+
{...props} />)
|
|
277
|
+
);
|
|
278
|
+
})
|
|
279
|
+
SidebarInset.displayName = "SidebarInset"
|
|
280
|
+
|
|
281
|
+
const SidebarInput = React.forwardRef(({ className, ...props }, ref) => {
|
|
282
|
+
return (
|
|
283
|
+
(<Input
|
|
284
|
+
ref={ref}
|
|
285
|
+
data-sidebar="input"
|
|
286
|
+
className={cn(
|
|
287
|
+
"h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",
|
|
288
|
+
className
|
|
289
|
+
)}
|
|
290
|
+
{...props} />)
|
|
291
|
+
);
|
|
292
|
+
})
|
|
293
|
+
SidebarInput.displayName = "SidebarInput"
|
|
294
|
+
|
|
295
|
+
const SidebarHeader = React.forwardRef(({ className, ...props }, ref) => {
|
|
296
|
+
return (
|
|
297
|
+
(<div
|
|
298
|
+
ref={ref}
|
|
299
|
+
data-sidebar="header"
|
|
300
|
+
className={cn("flex flex-col gap-2 p-2", className)}
|
|
301
|
+
{...props} />)
|
|
302
|
+
);
|
|
303
|
+
})
|
|
304
|
+
SidebarHeader.displayName = "SidebarHeader"
|
|
305
|
+
|
|
306
|
+
const SidebarFooter = React.forwardRef(({ className, ...props }, ref) => {
|
|
307
|
+
return (
|
|
308
|
+
(<div
|
|
309
|
+
ref={ref}
|
|
310
|
+
data-sidebar="footer"
|
|
311
|
+
className={cn("flex flex-col gap-2 p-2", className)}
|
|
312
|
+
{...props} />)
|
|
313
|
+
);
|
|
314
|
+
})
|
|
315
|
+
SidebarFooter.displayName = "SidebarFooter"
|
|
316
|
+
|
|
317
|
+
const SidebarSeparator = React.forwardRef(({ className, ...props }, ref) => {
|
|
318
|
+
return (
|
|
319
|
+
(<Separator
|
|
320
|
+
ref={ref}
|
|
321
|
+
data-sidebar="separator"
|
|
322
|
+
className={cn("mx-2 w-auto bg-sidebar-border", className)}
|
|
323
|
+
{...props} />)
|
|
324
|
+
);
|
|
325
|
+
})
|
|
326
|
+
SidebarSeparator.displayName = "SidebarSeparator"
|
|
327
|
+
|
|
328
|
+
const SidebarContent = React.forwardRef(({ className, ...props }, ref) => {
|
|
329
|
+
return (
|
|
330
|
+
(<div
|
|
331
|
+
ref={ref}
|
|
332
|
+
data-sidebar="content"
|
|
333
|
+
className={cn(
|
|
334
|
+
"flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
335
|
+
className
|
|
336
|
+
)}
|
|
337
|
+
{...props} />)
|
|
338
|
+
);
|
|
339
|
+
})
|
|
340
|
+
SidebarContent.displayName = "SidebarContent"
|
|
341
|
+
|
|
342
|
+
const SidebarGroup = React.forwardRef(({ className, ...props }, ref) => {
|
|
343
|
+
return (
|
|
344
|
+
(<div
|
|
345
|
+
ref={ref}
|
|
346
|
+
data-sidebar="group"
|
|
347
|
+
className={cn("relative flex w-full min-w-0 flex-col p-2", className)}
|
|
348
|
+
{...props} />)
|
|
349
|
+
);
|
|
350
|
+
})
|
|
351
|
+
SidebarGroup.displayName = "SidebarGroup"
|
|
352
|
+
|
|
353
|
+
const SidebarGroupLabel = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
354
|
+
const Comp = asChild ? Slot : "div"
|
|
355
|
+
|
|
356
|
+
return (
|
|
357
|
+
(<Comp
|
|
358
|
+
ref={ref}
|
|
359
|
+
data-sidebar="group-label"
|
|
360
|
+
className={cn(
|
|
361
|
+
"flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
362
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
363
|
+
className
|
|
364
|
+
)}
|
|
365
|
+
{...props} />)
|
|
366
|
+
);
|
|
367
|
+
})
|
|
368
|
+
SidebarGroupLabel.displayName = "SidebarGroupLabel"
|
|
369
|
+
|
|
370
|
+
const SidebarGroupAction = React.forwardRef(({ className, asChild = false, ...props }, ref) => {
|
|
371
|
+
const Comp = asChild ? Slot : "button"
|
|
372
|
+
|
|
373
|
+
return (
|
|
374
|
+
(<Comp
|
|
375
|
+
ref={ref}
|
|
376
|
+
data-sidebar="group-action"
|
|
377
|
+
className={cn(
|
|
378
|
+
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
379
|
+
// Increases the hit area of the button on mobile.
|
|
380
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
381
|
+
"group-data-[collapsible=icon]:hidden",
|
|
382
|
+
className
|
|
383
|
+
)}
|
|
384
|
+
{...props} />)
|
|
385
|
+
);
|
|
386
|
+
})
|
|
387
|
+
SidebarGroupAction.displayName = "SidebarGroupAction"
|
|
388
|
+
|
|
389
|
+
const SidebarGroupContent = React.forwardRef(({ className, ...props }, ref) => (
|
|
390
|
+
<div
|
|
391
|
+
ref={ref}
|
|
392
|
+
data-sidebar="group-content"
|
|
393
|
+
className={cn("w-full text-sm", className)}
|
|
394
|
+
{...props} />
|
|
395
|
+
))
|
|
396
|
+
SidebarGroupContent.displayName = "SidebarGroupContent"
|
|
397
|
+
|
|
398
|
+
const SidebarMenu = React.forwardRef(({ className, ...props }, ref) => (
|
|
399
|
+
<ul
|
|
400
|
+
ref={ref}
|
|
401
|
+
data-sidebar="menu"
|
|
402
|
+
className={cn("flex w-full min-w-0 flex-col gap-1", className)}
|
|
403
|
+
{...props} />
|
|
404
|
+
))
|
|
405
|
+
SidebarMenu.displayName = "SidebarMenu"
|
|
406
|
+
|
|
407
|
+
const SidebarMenuItem = React.forwardRef(({ className, ...props }, ref) => (
|
|
408
|
+
<li
|
|
409
|
+
ref={ref}
|
|
410
|
+
data-sidebar="menu-item"
|
|
411
|
+
className={cn("group/menu-item relative", className)}
|
|
412
|
+
{...props} />
|
|
413
|
+
))
|
|
414
|
+
SidebarMenuItem.displayName = "SidebarMenuItem"
|
|
415
|
+
|
|
416
|
+
const sidebarMenuButtonVariants = cva(
|
|
417
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
418
|
+
{
|
|
419
|
+
variants: {
|
|
420
|
+
variant: {
|
|
421
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
422
|
+
outline:
|
|
423
|
+
"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]",
|
|
424
|
+
},
|
|
425
|
+
size: {
|
|
426
|
+
default: "h-8 text-sm",
|
|
427
|
+
sm: "h-7 text-xs",
|
|
428
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:!p-0",
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
defaultVariants: {
|
|
432
|
+
variant: "default",
|
|
433
|
+
size: "default",
|
|
434
|
+
},
|
|
435
|
+
}
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
const SidebarMenuButton = React.forwardRef((
|
|
439
|
+
{
|
|
440
|
+
asChild = false,
|
|
441
|
+
isActive = false,
|
|
442
|
+
variant = "default",
|
|
443
|
+
size = "default",
|
|
444
|
+
tooltip,
|
|
445
|
+
className,
|
|
446
|
+
...props
|
|
447
|
+
},
|
|
448
|
+
ref
|
|
449
|
+
) => {
|
|
450
|
+
const Comp = asChild ? Slot : "button"
|
|
451
|
+
const { isMobile, state } = useSidebar()
|
|
452
|
+
|
|
453
|
+
const button = (
|
|
454
|
+
<Comp
|
|
455
|
+
ref={ref}
|
|
456
|
+
data-sidebar="menu-button"
|
|
457
|
+
data-size={size}
|
|
458
|
+
data-active={isActive}
|
|
459
|
+
className={cn(sidebarMenuButtonVariants({ variant, size }), className)}
|
|
460
|
+
{...props} />
|
|
461
|
+
)
|
|
462
|
+
|
|
463
|
+
if (!tooltip) {
|
|
464
|
+
return button
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
if (typeof tooltip === "string") {
|
|
468
|
+
tooltip = {
|
|
469
|
+
children: tooltip,
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
return (
|
|
474
|
+
(<Tooltip>
|
|
475
|
+
<TooltipTrigger asChild>{button}</TooltipTrigger>
|
|
476
|
+
<TooltipContent
|
|
477
|
+
side="right"
|
|
478
|
+
align="center"
|
|
479
|
+
hidden={state !== "collapsed" || isMobile}
|
|
480
|
+
{...tooltip} />
|
|
481
|
+
</Tooltip>)
|
|
482
|
+
);
|
|
483
|
+
})
|
|
484
|
+
SidebarMenuButton.displayName = "SidebarMenuButton"
|
|
485
|
+
|
|
486
|
+
const SidebarMenuAction = React.forwardRef(({ className, asChild = false, showOnHover = false, ...props }, ref) => {
|
|
487
|
+
const Comp = asChild ? Slot : "button"
|
|
488
|
+
|
|
489
|
+
return (
|
|
490
|
+
(<Comp
|
|
491
|
+
ref={ref}
|
|
492
|
+
data-sidebar="menu-action"
|
|
493
|
+
className={cn(
|
|
494
|
+
"absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0",
|
|
495
|
+
// Increases the hit area of the button on mobile.
|
|
496
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
497
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
498
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
499
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
500
|
+
"group-data-[collapsible=icon]:hidden",
|
|
501
|
+
showOnHover &&
|
|
502
|
+
"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",
|
|
503
|
+
className
|
|
504
|
+
)}
|
|
505
|
+
{...props} />)
|
|
506
|
+
);
|
|
507
|
+
})
|
|
508
|
+
SidebarMenuAction.displayName = "SidebarMenuAction"
|
|
509
|
+
|
|
510
|
+
const SidebarMenuBadge = React.forwardRef(({ className, ...props }, ref) => (
|
|
511
|
+
<div
|
|
512
|
+
ref={ref}
|
|
513
|
+
data-sidebar="menu-badge"
|
|
514
|
+
className={cn(
|
|
515
|
+
"pointer-events-none absolute right-1 flex h-5 min-w-5 select-none items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground",
|
|
516
|
+
"peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground",
|
|
517
|
+
"peer-data-[size=sm]/menu-button:top-1",
|
|
518
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
519
|
+
"peer-data-[size=lg]/menu-button:top-2.5",
|
|
520
|
+
"group-data-[collapsible=icon]:hidden",
|
|
521
|
+
className
|
|
522
|
+
)}
|
|
523
|
+
{...props} />
|
|
524
|
+
))
|
|
525
|
+
SidebarMenuBadge.displayName = "SidebarMenuBadge"
|
|
526
|
+
|
|
527
|
+
const SidebarMenuSkeleton = React.forwardRef(({ className, showIcon = false, ...props }, ref) => {
|
|
528
|
+
// Random width between 50 to 90%.
|
|
529
|
+
const width = React.useMemo(() => {
|
|
530
|
+
return `${Math.floor(Math.random() * 40) + 50}%`;
|
|
531
|
+
}, [])
|
|
532
|
+
|
|
533
|
+
return (
|
|
534
|
+
(<div
|
|
535
|
+
ref={ref}
|
|
536
|
+
data-sidebar="menu-skeleton"
|
|
537
|
+
className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
|
|
538
|
+
{...props}>
|
|
539
|
+
{showIcon && (
|
|
540
|
+
<Skeleton className="size-4 rounded-md" data-sidebar="menu-skeleton-icon" />
|
|
541
|
+
)}
|
|
542
|
+
<Skeleton
|
|
543
|
+
className="h-4 max-w-[--skeleton-width] flex-1"
|
|
544
|
+
data-sidebar="menu-skeleton-text"
|
|
545
|
+
style={
|
|
546
|
+
{
|
|
547
|
+
"--skeleton-width": width
|
|
548
|
+
}
|
|
549
|
+
} />
|
|
550
|
+
</div>)
|
|
551
|
+
);
|
|
552
|
+
})
|
|
553
|
+
SidebarMenuSkeleton.displayName = "SidebarMenuSkeleton"
|
|
554
|
+
|
|
555
|
+
const SidebarMenuSub = React.forwardRef(({ className, ...props }, ref) => (
|
|
556
|
+
<ul
|
|
557
|
+
ref={ref}
|
|
558
|
+
data-sidebar="menu-sub"
|
|
559
|
+
className={cn(
|
|
560
|
+
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5",
|
|
561
|
+
"group-data-[collapsible=icon]:hidden",
|
|
562
|
+
className
|
|
563
|
+
)}
|
|
564
|
+
{...props} />
|
|
565
|
+
))
|
|
566
|
+
SidebarMenuSub.displayName = "SidebarMenuSub"
|
|
567
|
+
|
|
568
|
+
const SidebarMenuSubItem = React.forwardRef(({ ...props }, ref) => <li ref={ref} {...props} />)
|
|
569
|
+
SidebarMenuSubItem.displayName = "SidebarMenuSubItem"
|
|
570
|
+
|
|
571
|
+
const SidebarMenuSubButton = React.forwardRef(
|
|
572
|
+
({ asChild = false, size = "md", isActive, className, ...props }, ref) => {
|
|
573
|
+
const Comp = asChild ? Slot : "a"
|
|
574
|
+
|
|
575
|
+
return (
|
|
576
|
+
(<Comp
|
|
577
|
+
ref={ref}
|
|
578
|
+
data-sidebar="menu-sub-button"
|
|
579
|
+
data-size={size}
|
|
580
|
+
data-active={isActive}
|
|
581
|
+
className={cn(
|
|
582
|
+
"flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
|
|
583
|
+
"data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",
|
|
584
|
+
size === "sm" && "text-xs",
|
|
585
|
+
size === "md" && "text-sm",
|
|
586
|
+
"group-data-[collapsible=icon]:hidden",
|
|
587
|
+
className
|
|
588
|
+
)}
|
|
589
|
+
{...props} />)
|
|
590
|
+
);
|
|
591
|
+
}
|
|
592
|
+
)
|
|
593
|
+
SidebarMenuSubButton.displayName = "SidebarMenuSubButton"
|
|
594
|
+
|
|
595
|
+
export {
|
|
596
|
+
Sidebar,
|
|
597
|
+
SidebarContent,
|
|
598
|
+
SidebarFooter,
|
|
599
|
+
SidebarGroup,
|
|
600
|
+
SidebarGroupAction,
|
|
601
|
+
SidebarGroupContent,
|
|
602
|
+
SidebarGroupLabel,
|
|
603
|
+
SidebarHeader,
|
|
604
|
+
SidebarInput,
|
|
605
|
+
SidebarInset,
|
|
606
|
+
SidebarMenu,
|
|
607
|
+
SidebarMenuAction,
|
|
608
|
+
SidebarMenuBadge,
|
|
609
|
+
SidebarMenuButton,
|
|
610
|
+
SidebarMenuItem,
|
|
611
|
+
SidebarMenuSkeleton,
|
|
612
|
+
SidebarMenuSub,
|
|
613
|
+
SidebarMenuSubButton,
|
|
614
|
+
SidebarMenuSubItem,
|
|
615
|
+
SidebarProvider,
|
|
616
|
+
SidebarRail,
|
|
617
|
+
SidebarSeparator,
|
|
618
|
+
SidebarTrigger,
|
|
619
|
+
useSidebar,
|
|
620
|
+
}
|