@ahmedrowaihi/pdf-forge-preview 1.0.0-canary.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -0
- package/.next/app-path-routes-manifest.json +7 -0
- package/.next/build/chunks/[root-of-the-server]__12fb5caf._.js +233 -0
- package/.next/build/chunks/[root-of-the-server]__12fb5caf._.js.map +8 -0
- package/.next/build/chunks/[root-of-the-server]__242deb00._.js +500 -0
- package/.next/build/chunks/[root-of-the-server]__242deb00._.js.map +11 -0
- package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_ad9a1eec._.js +13 -0
- package/.next/build/chunks/[turbopack-node]_transforms_postcss_ts_ad9a1eec._.js.map +5 -0
- package/.next/build/chunks/[turbopack]_runtime.js +795 -0
- package/.next/build/chunks/[turbopack]_runtime.js.map +10 -0
- package/.next/build/chunks/node_modules__pnpm_806d01c0._.js +6758 -0
- package/.next/build/chunks/node_modules__pnpm_806d01c0._.js.map +47 -0
- package/.next/build/package.json +1 -0
- package/.next/build/postcss.js +6 -0
- package/.next/build/postcss.js.map +5 -0
- package/.next/build-manifest.json +20 -0
- package/.next/diagnostics/build-diagnostics.json +6 -0
- package/.next/diagnostics/framework.json +1 -0
- package/.next/export-marker.json +6 -0
- package/.next/fallback-build-manifest.json +12 -0
- package/.next/images-manifest.json +66 -0
- package/.next/next-minimal-server.js.nft.json +1 -0
- package/.next/next-server.js.nft.json +1 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +65 -0
- package/.next/required-server-files.js +163 -0
- package/.next/required-server-files.json +163 -0
- package/.next/routes-manifest.json +77 -0
- package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
- package/.next/server/app/_global-error/page/build-manifest.json +17 -0
- package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
- package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
- package/.next/server/app/_global-error/page.js +11 -0
- package/.next/server/app/_global-error/page.js.map +5 -0
- package/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/.next/server/app/_global-error/page_client-reference-manifest.js +2 -0
- package/.next/server/app/_global-error.html +2 -0
- package/.next/server/app/_global-error.meta +15 -0
- package/.next/server/app/_global-error.rsc +13 -0
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_full.segment.rsc +13 -0
- package/.next/server/app/_global-error.segments/_head.segment.rsc +6 -0
- package/.next/server/app/_global-error.segments/_index.segment.rsc +4 -0
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
- package/.next/server/app/_not-found/page/build-manifest.json +17 -0
- package/.next/server/app/_not-found/page/next-font-manifest.json +16 -0
- package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/_not-found/page/server-reference-manifest.json +20 -0
- package/.next/server/app/_not-found/page.js +14 -0
- package/.next/server/app/_not-found/page.js.map +5 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +2 -0
- package/.next/server/app/favicon.ico/route/app-paths-manifest.json +3 -0
- package/.next/server/app/favicon.ico/route/build-manifest.json +11 -0
- package/.next/server/app/favicon.ico/route.js +6 -0
- package/.next/server/app/favicon.ico/route.js.map +5 -0
- package/.next/server/app/favicon.ico/route.js.nft.json +1 -0
- package/.next/server/app/favicon.ico.body +0 -0
- package/.next/server/app/favicon.ico.meta +1 -0
- package/.next/server/app/page/app-paths-manifest.json +3 -0
- package/.next/server/app/page/build-manifest.json +17 -0
- package/.next/server/app/page/next-font-manifest.json +16 -0
- package/.next/server/app/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/page/server-reference-manifest.json +20 -0
- package/.next/server/app/page.js +17 -0
- package/.next/server/app/page.js.map +5 -0
- package/.next/server/app/page.js.nft.json +1 -0
- package/.next/server/app/page_client-reference-manifest.js +2 -0
- package/.next/server/app/preview/[...slug]/page/app-paths-manifest.json +3 -0
- package/.next/server/app/preview/[...slug]/page/build-manifest.json +17 -0
- package/.next/server/app/preview/[...slug]/page/next-font-manifest.json +16 -0
- package/.next/server/app/preview/[...slug]/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/preview/[...slug]/page/server-reference-manifest.json +65 -0
- package/.next/server/app/preview/[...slug]/page.js +19 -0
- package/.next/server/app/preview/[...slug]/page.js.map +5 -0
- package/.next/server/app/preview/[...slug]/page.js.nft.json +1 -0
- package/.next/server/app/preview/[...slug]/page_client-reference-manifest.js +2 -0
- package/.next/server/app-paths-manifest.json +7 -0
- package/.next/server/chunks/730ea_preview-server__next-internal_server_app_favicon_ico_route_actions_a71a8ae7.js +3 -0
- package/.next/server/chunks/730ea_preview-server__next-internal_server_app_favicon_ico_route_actions_a71a8ae7.js.map +1 -0
- package/.next/server/chunks/[externals]_next_dist_a6d89067._.js +3 -0
- package/.next/server/chunks/[externals]_next_dist_a6d89067._.js.map +1 -0
- package/.next/server/chunks/[root-of-the-server]__a62cd78d._.js +21 -0
- package/.next/server/chunks/[root-of-the-server]__a62cd78d._.js.map +1 -0
- package/.next/server/chunks/[turbopack]_runtime.js +795 -0
- package/.next/server/chunks/[turbopack]_runtime.js.map +10 -0
- package/.next/server/chunks/ssr/730ea_preview-server__next-internal_server_app__global-error_page_actions_986e2de5.js +3 -0
- package/.next/server/chunks/ssr/730ea_preview-server__next-internal_server_app__global-error_page_actions_986e2de5.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__025eaae9._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__025eaae9._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1536282c._.js +4 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1536282c._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__15cf9d36._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__15cf9d36._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__450f653e._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__450f653e._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__4874d0d7._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__4874d0d7._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__49771cdc._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__49771cdc._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__9ff74047._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__9ff74047._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__a9be37b1._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__a9be37b1._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__aeefe74e._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__aeefe74e._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__b13738d2._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__b13738d2._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__bb428c83._.js +4 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__bb428c83._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__c61333e3._.js +10 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__c61333e3._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__cb0c7b1a._.js +4 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__cb0c7b1a._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__dafcae4c._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__dafcae4c._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__e47d0c07._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__e47d0c07._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__ecac8617._.js +31 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__ecac8617._.js.map +1 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__fd4bda25._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__fd4bda25._.js.map +1 -0
- package/.next/server/chunks/ssr/[turbopack]_runtime.js +795 -0
- package/.next/server/chunks/ssr/[turbopack]_runtime.js.map +10 -0
- package/.next/server/chunks/ssr/_19494208._.js +19 -0
- package/.next/server/chunks/ssr/_19494208._.js.map +1 -0
- package/.next/server/chunks/ssr/_810f54e9._.js +4 -0
- package/.next/server/chunks/ssr/_810f54e9._.js.map +1 -0
- package/.next/server/chunks/ssr/_aa01e67e._.js +4 -0
- package/.next/server/chunks/ssr/_aa01e67e._.js.map +1 -0
- package/.next/server/chunks/ssr/_bf10718b._.js +4 -0
- package/.next/server/chunks/ssr/_bf10718b._.js.map +1 -0
- package/.next/server/chunks/ssr/_c57c12df._.js +4 -0
- package/.next/server/chunks/ssr/_c57c12df._.js.map +1 -0
- package/.next/server/chunks/ssr/_d9b57cb8._.js +5 -0
- package/.next/server/chunks/ssr/_d9b57cb8._.js.map +1 -0
- package/.next/server/chunks/ssr/_e2a766a8._.js +3 -0
- package/.next/server/chunks/ssr/_e2a766a8._.js.map +1 -0
- package/.next/server/chunks/ssr/_e2b86512._.js +8 -0
- package/.next/server/chunks/ssr/_e2b86512._.js.map +1 -0
- package/.next/server/chunks/ssr/_ee8ea3aa._.js +19 -0
- package/.next/server/chunks/ssr/_ee8ea3aa._.js.map +1 -0
- package/.next/server/chunks/ssr/e8449_next_dist_5870db32._.js +3 -0
- package/.next/server/chunks/ssr/e8449_next_dist_5870db32._.js.map +1 -0
- package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_forbidden_5542069c.js +3 -0
- package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_forbidden_5542069c.js.map +1 -0
- package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_global-error_d0870f3a.js +3 -0
- package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_global-error_d0870f3a.js.map +1 -0
- package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_unauthorized_4c01c8d5.js +3 -0
- package/.next/server/chunks/ssr/e8449_next_dist_client_components_builtin_unauthorized_4c01c8d5.js.map +1 -0
- package/.next/server/chunks/ssr/e8449_next_dist_client_components_d90ace34._.js +3 -0
- package/.next/server/chunks/ssr/e8449_next_dist_client_components_d90ace34._.js.map +1 -0
- package/.next/server/chunks/ssr/e8449_next_dist_esm_af7aafb8._.js +6 -0
- package/.next/server/chunks/ssr/e8449_next_dist_esm_af7aafb8._.js.map +1 -0
- package/.next/server/chunks/ssr/e8449_next_dist_esm_build_templates_app-page_f16f0848.js +4 -0
- package/.next/server/chunks/ssr/e8449_next_dist_esm_build_templates_app-page_f16f0848.js.map +1 -0
- package/.next/server/chunks/ssr/e8449_next_dist_f0d8a2cc._.js +4 -0
- package/.next/server/chunks/ssr/e8449_next_dist_f0d8a2cc._.js.map +1 -0
- package/.next/server/chunks/ssr/node_modules__pnpm_37510d96._.js +5 -0
- package/.next/server/chunks/ssr/node_modules__pnpm_37510d96._.js.map +1 -0
- package/.next/server/chunks/ssr/packages_preview-server_src_app_897ecf1c._.js +3 -0
- package/.next/server/chunks/ssr/packages_preview-server_src_app_897ecf1c._.js.map +1 -0
- package/.next/server/chunks/ssr/packages_preview-server_src_e17a2a9b._.js +3 -0
- package/.next/server/chunks/ssr/packages_preview-server_src_e17a2a9b._.js.map +1 -0
- package/.next/server/functions-config-manifest.json +4 -0
- package/.next/server/interception-route-rewrite-manifest.js +1 -0
- package/.next/server/middleware-build-manifest.js +21 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/next-font-manifest.js +1 -0
- package/.next/server/next-font-manifest.json +34 -0
- package/.next/server/pages/500.html +2 -0
- package/.next/server/pages-manifest.json +3 -0
- package/.next/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +80 -0
- package/.next/static/cdYIhKFtJ0GB-yJK5ywz_/_buildManifest.js +11 -0
- package/.next/static/cdYIhKFtJ0GB-yJK5ywz_/_clientMiddlewareManifest.json +1 -0
- package/.next/static/cdYIhKFtJ0GB-yJK5ywz_/_ssgManifest.js +1 -0
- package/.next/static/chunks/0464c7ff175ee6ff.js +1 -0
- package/.next/static/chunks/10468413db24762a.js +14 -0
- package/.next/static/chunks/2de338262e51ef94.js +3 -0
- package/.next/static/chunks/37adc260f85da877.js +1 -0
- package/.next/static/chunks/521eee9903bc4d1f.js +5 -0
- package/.next/static/chunks/6051bd38272cb442.js +14 -0
- package/.next/static/chunks/8d433d4b9d701456.js +1 -0
- package/.next/static/chunks/92ba72595aad9df6.js +1 -0
- package/.next/static/chunks/959ed978a6e89a66.js +1 -0
- package/.next/static/chunks/a6dad97d9634a72d.js +1 -0
- package/.next/static/chunks/a6dad97d9634a72d.js.map +1 -0
- package/.next/static/chunks/a6db6456c5b75734.js +1 -0
- package/.next/static/chunks/c3ece0a7e3e07076.js +1 -0
- package/.next/static/chunks/d1b29a74f6814a03.css +3 -0
- package/.next/static/chunks/f7ec22614fe1c1fe.js +1 -0
- package/.next/static/chunks/turbopack-e062a8e6d6034eb0.js +4 -0
- package/.next/static/media/1bffadaabf893a1e-s.7cd81963.woff2 +0 -0
- package/.next/static/media/2bbe8d2671613f1f-s.76dcb0b2.woff2 +0 -0
- package/.next/static/media/2c55a0e60120577a-s.2a48534a.woff2 +0 -0
- package/.next/static/media/5476f68d60460930-s.c995e352.woff2 +0 -0
- package/.next/static/media/83afe278b6a6bb3c-s.p.3a6ba036.woff2 +0 -0
- package/.next/static/media/9c72aa0f40e4eef8-s.18a48cbc.woff2 +0 -0
- package/.next/static/media/SFMonoBold-s.p.b90ec775.otf +0 -0
- package/.next/static/media/SFMonoHeavy-s.p.545fe93b.otf +0 -0
- package/.next/static/media/SFMonoLight-s.p.7c5363a6.otf +0 -0
- package/.next/static/media/SFMonoMedium-s.p.a4fc9904.otf +0 -0
- package/.next/static/media/SFMonoRegular-s.p.04ea7bf3.otf +0 -0
- package/.next/static/media/SFMonoSemibold-s.p.2d2ddb43.otf +0 -0
- package/.next/static/media/ad66f9afd8947f86-s.7a40eb73.woff2 +0 -0
- package/.next/static/media/favicon.678eb597.ico +0 -0
- package/.next/static/media/logo.22a370b0.png +0 -0
- package/.next/trace +1 -0
- package/.next/trace-build +1 -0
- package/.next/turbopack +0 -0
- package/.next/types/routes.d.ts +58 -0
- package/.next/types/validator.ts +70 -0
- package/CHANGELOG.md +12 -0
- package/LICENSE.md +8 -0
- package/index.mjs +17 -0
- package/jsx-runtime/jsx-dev-runtime.js +26 -0
- package/module-punycode.d.ts +3 -0
- package/next-env.d.ts +6 -0
- package/next.config.mjs +15 -0
- package/package.json +78 -0
- package/postcss.config.js +5 -0
- package/readme.md +33 -0
- package/scripts/build-preview-server.mts +25 -0
- package/scripts/dev.mts +57 -0
- package/scripts/seed.mts +36 -0
- package/src/actions/export-single-template.ts +74 -0
- package/src/actions/get-template-path-from-slug.ts +32 -0
- package/src/actions/get-templates-directory-metadata-action.ts +19 -0
- package/src/actions/render-template-by-path.tsx +313 -0
- package/src/actions/safe-action.ts +15 -0
- package/src/animated-icons-data/help.json +1082 -0
- package/src/animated-icons-data/link.json +1309 -0
- package/src/animated-icons-data/load.json +443 -0
- package/src/animated-icons-data/mail.json +1320 -0
- package/src/app/env.ts +14 -0
- package/src/app/favicon.ico +0 -0
- package/src/app/fonts/SFMono/SFMonoBold.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoBoldItalic.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoHeavy.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoHeavyItalic.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoLight.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoLightItalic.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoMedium.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoMediumItalic.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoRegular.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoRegularItalic.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoSemibold.otf +0 -0
- package/src/app/fonts/SFMono/SFMonoSemiboldItalic.otf +0 -0
- package/src/app/fonts.ts +39 -0
- package/src/app/globals.css +136 -0
- package/src/app/layout.tsx +46 -0
- package/src/app/logo.png +0 -0
- package/src/app/page.tsx +52 -0
- package/src/app/preview/[...slug]/download-button.tsx +138 -0
- package/src/app/preview/[...slug]/error-overlay.tsx +58 -0
- package/src/app/preview/[...slug]/page.tsx +90 -0
- package/src/app/preview/[...slug]/preview.tsx +249 -0
- package/src/app/preview/[...slug]/template-frame.tsx +68 -0
- package/src/components/button.tsx +101 -0
- package/src/components/code-container.tsx +169 -0
- package/src/components/code-snippet.tsx +9 -0
- package/src/components/code.tsx +185 -0
- package/src/components/heading.tsx +113 -0
- package/src/components/icons/icon-arrow-down.tsx +16 -0
- package/src/components/icons/icon-base.tsx +26 -0
- package/src/components/icons/icon-bug.tsx +19 -0
- package/src/components/icons/icon-button.tsx +23 -0
- package/src/components/icons/icon-check.tsx +19 -0
- package/src/components/icons/icon-clipboard.tsx +40 -0
- package/src/components/icons/icon-cloud-alert.tsx +18 -0
- package/src/components/icons/icon-cloud-check.tsx +17 -0
- package/src/components/icons/icon-download.tsx +19 -0
- package/src/components/icons/icon-file.tsx +19 -0
- package/src/components/icons/icon-folder-open.tsx +19 -0
- package/src/components/icons/icon-folder.tsx +18 -0
- package/src/components/icons/icon-hide-sidebar.tsx +23 -0
- package/src/components/icons/icon-image.tsx +19 -0
- package/src/components/icons/icon-info.tsx +18 -0
- package/src/components/icons/icon-link.tsx +14 -0
- package/src/components/icons/icon-loader.tsx +16 -0
- package/src/components/icons/icon-monitor.tsx +19 -0
- package/src/components/icons/icon-moon.tsx +16 -0
- package/src/components/icons/icon-phone.tsx +26 -0
- package/src/components/icons/icon-reload.tsx +18 -0
- package/src/components/icons/icon-source.tsx +19 -0
- package/src/components/icons/icon-stamp.tsx +14 -0
- package/src/components/icons/icon-sun.tsx +74 -0
- package/src/components/icons/icon-warning.tsx +31 -0
- package/src/components/index.ts +7 -0
- package/src/components/logo.tsx +41 -0
- package/src/components/resizable-wrapper.tsx +269 -0
- package/src/components/shell.tsx +95 -0
- package/src/components/sidebar/file-tree-directory-children.tsx +142 -0
- package/src/components/sidebar/file-tree-directory.tsx +92 -0
- package/src/components/sidebar/file-tree.tsx +31 -0
- package/src/components/sidebar/index.ts +1 -0
- package/src/components/sidebar/sidebar.tsx +46 -0
- package/src/components/text.tsx +99 -0
- package/src/components/toolbar/checking-results.tsx +150 -0
- package/src/components/toolbar/code-preview-line-link.tsx +39 -0
- package/src/components/toolbar/results-table.tsx +0 -0
- package/src/components/toolbar/results.tsx +52 -0
- package/src/components/toolbar/toolbar-button.tsx +52 -0
- package/src/components/toolbar/use-cached-state.ts +36 -0
- package/src/components/toolbar.tsx +182 -0
- package/src/components/tooltip-content.tsx +31 -0
- package/src/components/tooltip.tsx +19 -0
- package/src/components/topbar/active-view-toggle-group.tsx +86 -0
- package/src/components/topbar/emulated-dark-mode-toggle.tsx +58 -0
- package/src/components/topbar/view-size-controls.tsx +173 -0
- package/src/components/topbar.tsx +59 -0
- package/src/contexts/preview.tsx +91 -0
- package/src/contexts/templates.tsx +57 -0
- package/src/contexts/toolbar.tsx +22 -0
- package/src/hooks/use-clamped-state.ts +24 -0
- package/src/hooks/use-fragment-identifier.ts +14 -0
- package/src/hooks/use-hot-reload.ts +31 -0
- package/src/hooks/use-rendering-metadata.ts +37 -0
- package/src/hooks/use-template-rendering-result.ts +58 -0
- package/src/utils/cn.ts +6 -0
- package/src/utils/constants.ts +8 -0
- package/src/utils/contains-template.ts +52 -0
- package/src/utils/convert-stack-with-sourcemap.ts +79 -0
- package/src/utils/copy-text-to-clipboard.ts +7 -0
- package/src/utils/create-jsx-runtime.ts +47 -0
- package/src/utils/esbuild/escape-string-for-regex.ts +3 -0
- package/src/utils/esbuild/renderring-utilities-exporter.ts +64 -0
- package/src/utils/get-line-and-column-from-offset.ts +11 -0
- package/src/utils/get-template-component.ts +158 -0
- package/src/utils/get-templates-directory-metadata.ts +195 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/language-map.ts +7 -0
- package/src/utils/load-stream.ts +15 -0
- package/src/utils/register-spinner-autostopping.ts +28 -0
- package/src/utils/result.ts +49 -0
- package/src/utils/run-bundled-code.ts +86 -0
- package/src/utils/sanitize.ts +6 -0
- package/src/utils/sleep.ts +3 -0
- package/src/utils/snake-to-camel.ts +5 -0
- package/src/utils/static-node-modules-for-vm.ts +93 -0
- package/src/utils/style-text.ts +11 -0
- package/src/utils/types/as.ts +26 -0
- package/src/utils/types/error-object.ts +11 -0
- package/src/utils/types/hot-reload-change.ts +13 -0
- package/src/utils/types/template.ts +8 -0
- package/src/utils/unreachable.ts +8 -0
- package/templates/.gitkeep +0 -0
- package/tsconfig.json +47 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
2
|
+
import { AnimatePresence, LayoutGroup, motion } from 'framer-motion';
|
|
3
|
+
import Link from 'next/link';
|
|
4
|
+
import { useRouter, useSearchParams } from 'next/navigation';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { cn } from '../../utils';
|
|
7
|
+
import type { TemplatesDirectory } from '../../utils/get-templates-directory-metadata';
|
|
8
|
+
import { IconFile } from '../icons/icon-file';
|
|
9
|
+
import { FileTreeDirectory } from './file-tree-directory';
|
|
10
|
+
|
|
11
|
+
export const FileTreeDirectoryChildren = (props: {
|
|
12
|
+
templatesDirectoryMetadata: TemplatesDirectory;
|
|
13
|
+
currentTemplateOpenSlug?: string;
|
|
14
|
+
open: boolean;
|
|
15
|
+
isRoot?: boolean;
|
|
16
|
+
}) => {
|
|
17
|
+
const searchParams = useSearchParams();
|
|
18
|
+
const router = useRouter();
|
|
19
|
+
|
|
20
|
+
const id = React.useId();
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<AnimatePresence initial={false}>
|
|
24
|
+
{props.open ? (
|
|
25
|
+
<Collapsible.Content
|
|
26
|
+
asChild
|
|
27
|
+
className="relative overflow-y-hidden pl-1"
|
|
28
|
+
forceMount
|
|
29
|
+
>
|
|
30
|
+
<motion.div
|
|
31
|
+
animate={{ opacity: 1, height: 'auto' }}
|
|
32
|
+
exit={{ opacity: 0, height: 0 }}
|
|
33
|
+
initial={{ opacity: 0, height: 0 }}
|
|
34
|
+
>
|
|
35
|
+
{props.isRoot ? null : (
|
|
36
|
+
<div className="line absolute left-2.5 h-full w-px bg-slate-6" />
|
|
37
|
+
)}
|
|
38
|
+
<div className="flex flex-col truncate">
|
|
39
|
+
<LayoutGroup id={`sidebar-${id}`}>
|
|
40
|
+
{props.templatesDirectoryMetadata.subDirectories.map(
|
|
41
|
+
(subDirectory) => (
|
|
42
|
+
<FileTreeDirectory
|
|
43
|
+
className="p-0 data-[state=open]:mb-2"
|
|
44
|
+
currentTemplateOpenSlug={props.currentTemplateOpenSlug}
|
|
45
|
+
templatesDirectoryMetadata={subDirectory}
|
|
46
|
+
key={subDirectory.absolutePath}
|
|
47
|
+
/>
|
|
48
|
+
),
|
|
49
|
+
)}
|
|
50
|
+
{props.templatesDirectoryMetadata.templateFilenames.map(
|
|
51
|
+
(templateFilename, index) => {
|
|
52
|
+
const templateSlug = props.isRoot
|
|
53
|
+
? templateFilename
|
|
54
|
+
: `${props.templatesDirectoryMetadata.relativePath}/${templateFilename}`;
|
|
55
|
+
|
|
56
|
+
const removeExtensionFrom = (path: string) => {
|
|
57
|
+
if (
|
|
58
|
+
path.split('.').pop() === 'tsx' ||
|
|
59
|
+
path.split('.').pop() === 'jsx' ||
|
|
60
|
+
path.split('.').pop() === 'js'
|
|
61
|
+
) {
|
|
62
|
+
return path.split('.').slice(0, -1).join('.');
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return path;
|
|
66
|
+
};
|
|
67
|
+
const isCurrentPage = props.currentTemplateOpenSlug
|
|
68
|
+
? removeExtensionFrom(props.currentTemplateOpenSlug) ===
|
|
69
|
+
templateSlug
|
|
70
|
+
: false;
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<Link
|
|
74
|
+
href={{
|
|
75
|
+
pathname: `/preview/${templateSlug}`,
|
|
76
|
+
search: searchParams.toString(),
|
|
77
|
+
}}
|
|
78
|
+
onMouseOver={() => {
|
|
79
|
+
router.prefetch(
|
|
80
|
+
`/preview/${templateSlug}?${searchParams.toString()}`,
|
|
81
|
+
);
|
|
82
|
+
}}
|
|
83
|
+
key={templateSlug}
|
|
84
|
+
>
|
|
85
|
+
<motion.span
|
|
86
|
+
animate={{ x: 0, opacity: 1 }}
|
|
87
|
+
className={cn(
|
|
88
|
+
'relative flex h-8 w-full items-center text-start gap-2 rounded-md align-middle text-slate-11 text-sm transition-colors duration-100 ease-[cubic-bezier(.6,.12,.34,.96)]',
|
|
89
|
+
props.isRoot ? undefined : 'pl-3',
|
|
90
|
+
{
|
|
91
|
+
'text-cyan-11': isCurrentPage,
|
|
92
|
+
'hover:text-slate-12':
|
|
93
|
+
props.currentTemplateOpenSlug !== templateSlug,
|
|
94
|
+
},
|
|
95
|
+
)}
|
|
96
|
+
initial={{ x: -10 + -index * 1.5, opacity: 0 }}
|
|
97
|
+
transition={{
|
|
98
|
+
x: { delay: 0.03 * index, duration: 0.2 },
|
|
99
|
+
opacity: { delay: 0.03 * index, duration: 0.2 },
|
|
100
|
+
}}
|
|
101
|
+
>
|
|
102
|
+
{isCurrentPage ? (
|
|
103
|
+
<motion.span
|
|
104
|
+
animate={{ opacity: 1 }}
|
|
105
|
+
className="absolute inset-0 rounded-md bg-cyan-5 opacity-0 transition-all duration-200 ease-[cubic-bezier(.6,.12,.34,.96)]"
|
|
106
|
+
exit={{ opacity: 0 }}
|
|
107
|
+
initial={{ opacity: 0 }}
|
|
108
|
+
>
|
|
109
|
+
{props.isRoot ? null : (
|
|
110
|
+
<motion.div
|
|
111
|
+
className="absolute top-1 left-[0.4rem] inset-0 h-6 w-px rounded-xs bg-cyan-11"
|
|
112
|
+
layoutId="active-file"
|
|
113
|
+
transition={{
|
|
114
|
+
type: 'spring',
|
|
115
|
+
bounce: 0.2,
|
|
116
|
+
duration: 0.6,
|
|
117
|
+
}}
|
|
118
|
+
/>
|
|
119
|
+
)}
|
|
120
|
+
</motion.span>
|
|
121
|
+
) : null}
|
|
122
|
+
<IconFile
|
|
123
|
+
className="h-5 w-5"
|
|
124
|
+
height="20"
|
|
125
|
+
width="20"
|
|
126
|
+
/>
|
|
127
|
+
<span className="truncate w-[calc(100%-1.25rem)]">
|
|
128
|
+
{templateFilename}
|
|
129
|
+
</span>
|
|
130
|
+
</motion.span>
|
|
131
|
+
</Link>
|
|
132
|
+
);
|
|
133
|
+
},
|
|
134
|
+
)}
|
|
135
|
+
</LayoutGroup>
|
|
136
|
+
</div>
|
|
137
|
+
</motion.div>
|
|
138
|
+
</Collapsible.Content>
|
|
139
|
+
) : null}
|
|
140
|
+
</AnimatePresence>
|
|
141
|
+
);
|
|
142
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '../../utils';
|
|
5
|
+
import type { TemplatesDirectory } from '../../utils/get-templates-directory-metadata';
|
|
6
|
+
import { Heading } from '../heading';
|
|
7
|
+
import { IconArrowDown } from '../icons/icon-arrow-down';
|
|
8
|
+
import { IconFolder } from '../icons/icon-folder';
|
|
9
|
+
import { IconFolderOpen } from '../icons/icon-folder-open';
|
|
10
|
+
import { FileTreeDirectoryChildren } from './file-tree-directory-children';
|
|
11
|
+
|
|
12
|
+
interface SidebarDirectoryProps {
|
|
13
|
+
templatesDirectoryMetadata: TemplatesDirectory;
|
|
14
|
+
className?: string;
|
|
15
|
+
currentTemplateOpenSlug?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const persistedOpenDirectories = new Set<string>();
|
|
19
|
+
|
|
20
|
+
export const FileTreeDirectory = ({
|
|
21
|
+
templatesDirectoryMetadata: directoryMetadata,
|
|
22
|
+
className,
|
|
23
|
+
currentTemplateOpenSlug,
|
|
24
|
+
}: SidebarDirectoryProps) => {
|
|
25
|
+
const doesDirectoryContainCurrentTemplateOpen = currentTemplateOpenSlug
|
|
26
|
+
? currentTemplateOpenSlug.includes(directoryMetadata.relativePath)
|
|
27
|
+
: false;
|
|
28
|
+
|
|
29
|
+
const isEmpty =
|
|
30
|
+
directoryMetadata.templateFilenames.length === 0 &&
|
|
31
|
+
directoryMetadata.subDirectories.length === 0;
|
|
32
|
+
|
|
33
|
+
const [open, setOpen] = React.useState(
|
|
34
|
+
persistedOpenDirectories.has(directoryMetadata.absolutePath) ||
|
|
35
|
+
doesDirectoryContainCurrentTemplateOpen,
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Collapsible.Root
|
|
40
|
+
className={cn('group', className)}
|
|
41
|
+
onOpenChange={(isOpening) => {
|
|
42
|
+
if (isOpening) {
|
|
43
|
+
persistedOpenDirectories.add(directoryMetadata.absolutePath);
|
|
44
|
+
} else {
|
|
45
|
+
persistedOpenDirectories.delete(directoryMetadata.absolutePath);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
setOpen(isOpening);
|
|
49
|
+
}}
|
|
50
|
+
open={open}
|
|
51
|
+
>
|
|
52
|
+
<Collapsible.Trigger
|
|
53
|
+
className={cn(
|
|
54
|
+
'mt-1 mb-1.5 flex w-full items-center text-start justify-between gap-2 font-medium text-[14px]',
|
|
55
|
+
{
|
|
56
|
+
'cursor-pointer': !isEmpty,
|
|
57
|
+
},
|
|
58
|
+
)}
|
|
59
|
+
>
|
|
60
|
+
{open ? (
|
|
61
|
+
<IconFolderOpen className="w-[20px]" height="20" width="20" />
|
|
62
|
+
) : (
|
|
63
|
+
<IconFolder height="20" width="20" />
|
|
64
|
+
)}
|
|
65
|
+
<Heading
|
|
66
|
+
as="h3"
|
|
67
|
+
className="transition grow w-[calc(100%-40px)] truncate duration-200 ease-in-out hover:text-slate-12"
|
|
68
|
+
color="gray"
|
|
69
|
+
size="2"
|
|
70
|
+
weight="medium"
|
|
71
|
+
>
|
|
72
|
+
{directoryMetadata.directoryName}
|
|
73
|
+
</Heading>
|
|
74
|
+
{!isEmpty ? (
|
|
75
|
+
<IconArrowDown
|
|
76
|
+
width="20"
|
|
77
|
+
height="20"
|
|
78
|
+
className="ml-auto opacity-60 transition-transform data-[open=true]:rotate-180"
|
|
79
|
+
data-open={open}
|
|
80
|
+
/>
|
|
81
|
+
) : null}
|
|
82
|
+
</Collapsible.Trigger>
|
|
83
|
+
{!isEmpty ? (
|
|
84
|
+
<FileTreeDirectoryChildren
|
|
85
|
+
currentTemplateOpenSlug={currentTemplateOpenSlug}
|
|
86
|
+
templatesDirectoryMetadata={directoryMetadata}
|
|
87
|
+
open={open}
|
|
88
|
+
/>
|
|
89
|
+
) : null}
|
|
90
|
+
</Collapsible.Root>
|
|
91
|
+
);
|
|
92
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import type { TemplatesDirectory } from '../../utils/get-templates-directory-metadata';
|
|
4
|
+
import { FileTreeDirectoryChildren } from './file-tree-directory-children';
|
|
5
|
+
|
|
6
|
+
interface FileTreeProps {
|
|
7
|
+
currentTemplateOpenSlug: string | undefined;
|
|
8
|
+
templatesDirectoryMetadata: TemplatesDirectory;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const FileTree = ({
|
|
12
|
+
currentTemplateOpenSlug,
|
|
13
|
+
templatesDirectoryMetadata,
|
|
14
|
+
}: FileTreeProps) => {
|
|
15
|
+
return (
|
|
16
|
+
<div className="flex w-full h-full flex-col lg:w-full lg:min-w-58">
|
|
17
|
+
<nav className="flex grow flex-col p-4 pr-0 pl-0">
|
|
18
|
+
<Collapsible.Root open>
|
|
19
|
+
<React.Suspense>
|
|
20
|
+
<FileTreeDirectoryChildren
|
|
21
|
+
currentTemplateOpenSlug={currentTemplateOpenSlug}
|
|
22
|
+
templatesDirectoryMetadata={templatesDirectoryMetadata}
|
|
23
|
+
isRoot
|
|
24
|
+
open
|
|
25
|
+
/>
|
|
26
|
+
</React.Suspense>
|
|
27
|
+
</Collapsible.Root>
|
|
28
|
+
</nav>
|
|
29
|
+
</div>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './sidebar';
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
import { useTemplates } from '../../contexts/templates';
|
|
4
|
+
import { cn } from '../../utils';
|
|
5
|
+
import { Logo } from '../logo';
|
|
6
|
+
import { FileTree } from './file-tree';
|
|
7
|
+
|
|
8
|
+
interface SidebarProps {
|
|
9
|
+
className?: string;
|
|
10
|
+
currentTemplateOpenSlug?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const Sidebar = ({
|
|
14
|
+
className,
|
|
15
|
+
currentTemplateOpenSlug,
|
|
16
|
+
}: SidebarProps) => {
|
|
17
|
+
const { templatesDirectoryMetadata } = useTemplates();
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<aside
|
|
21
|
+
className={cn(
|
|
22
|
+
'overflow-hidden',
|
|
23
|
+
'lg:static lg:z-auto lg:max-h-screen lg:w-[16rem]',
|
|
24
|
+
className,
|
|
25
|
+
)}
|
|
26
|
+
>
|
|
27
|
+
<div className="flex w-full h-full overflow-hidden flex-col border-slate-6 border-r">
|
|
28
|
+
<div
|
|
29
|
+
className={clsx(
|
|
30
|
+
'hidden min-h-14 shrink items-center py-2 px-3 lg:flex border-b border-slate-4',
|
|
31
|
+
)}
|
|
32
|
+
>
|
|
33
|
+
<h2>
|
|
34
|
+
<Logo />
|
|
35
|
+
</h2>
|
|
36
|
+
</div>
|
|
37
|
+
<div className="relative grow w-full h-full overflow-y-auto overflow-x-hidden px-4 pb-3">
|
|
38
|
+
<FileTree
|
|
39
|
+
currentTemplateOpenSlug={currentTemplateOpenSlug}
|
|
40
|
+
templatesDirectoryMetadata={templatesDirectoryMetadata}
|
|
41
|
+
/>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
</aside>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as SlotPrimitive from '@radix-ui/react-slot';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { type As, cn, unreachable } from '../utils';
|
|
4
|
+
|
|
5
|
+
export type TextSize = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9';
|
|
6
|
+
export type TextColor = 'gray' | 'white';
|
|
7
|
+
export type TextTransform = 'uppercase' | 'lowercase' | 'capitalize';
|
|
8
|
+
export type TextWeight = 'normal' | 'medium';
|
|
9
|
+
|
|
10
|
+
interface TextOwnProps {
|
|
11
|
+
size?: TextSize;
|
|
12
|
+
color?: TextColor;
|
|
13
|
+
transform?: TextTransform;
|
|
14
|
+
weight?: TextWeight;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type TextProps = As<'span', 'div', 'p'> & TextOwnProps;
|
|
18
|
+
|
|
19
|
+
export const Text = React.forwardRef<HTMLSpanElement, Readonly<TextProps>>(
|
|
20
|
+
(
|
|
21
|
+
{
|
|
22
|
+
as: Tag = 'span',
|
|
23
|
+
size = '2',
|
|
24
|
+
color = 'gray',
|
|
25
|
+
transform,
|
|
26
|
+
weight = 'normal',
|
|
27
|
+
className,
|
|
28
|
+
children,
|
|
29
|
+
...props
|
|
30
|
+
},
|
|
31
|
+
forwardedRef,
|
|
32
|
+
) => (
|
|
33
|
+
<SlotPrimitive.Slot
|
|
34
|
+
className={cn(
|
|
35
|
+
className,
|
|
36
|
+
transform,
|
|
37
|
+
getSizesClassNames(size),
|
|
38
|
+
getColorClassNames(color),
|
|
39
|
+
getWeightClassNames(weight),
|
|
40
|
+
)}
|
|
41
|
+
ref={forwardedRef}
|
|
42
|
+
{...props}
|
|
43
|
+
>
|
|
44
|
+
<Tag>{children}</Tag>
|
|
45
|
+
</SlotPrimitive.Slot>
|
|
46
|
+
),
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
const getSizesClassNames = (size: TextSize | undefined) => {
|
|
50
|
+
switch (size) {
|
|
51
|
+
case '1':
|
|
52
|
+
return 'text-xs';
|
|
53
|
+
case undefined:
|
|
54
|
+
case '2':
|
|
55
|
+
return 'text-sm';
|
|
56
|
+
case '3':
|
|
57
|
+
return 'text-base';
|
|
58
|
+
case '4':
|
|
59
|
+
return 'text-lg';
|
|
60
|
+
case '5':
|
|
61
|
+
return ['text-17px', 'md:text-xl tracking-[-0.16px]'];
|
|
62
|
+
case '6':
|
|
63
|
+
return 'text-2xl tracking-[-0.288px]';
|
|
64
|
+
case '7':
|
|
65
|
+
return 'text-[28px] leading-[34px] tracking-[-0.416px]';
|
|
66
|
+
case '8':
|
|
67
|
+
return 'text-[35px] leading-[42px] tracking-[-0.64px]';
|
|
68
|
+
case '9':
|
|
69
|
+
return 'text-6xl leading-[73px] tracking-[-0.896px]';
|
|
70
|
+
default:
|
|
71
|
+
return unreachable(size);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const getColorClassNames = (color: TextColor | undefined) => {
|
|
76
|
+
switch (color) {
|
|
77
|
+
case 'white':
|
|
78
|
+
return 'text-slate-12';
|
|
79
|
+
case undefined:
|
|
80
|
+
case 'gray':
|
|
81
|
+
return 'text-slate-11';
|
|
82
|
+
default:
|
|
83
|
+
return unreachable(color);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const getWeightClassNames = (weight: TextWeight | undefined) => {
|
|
88
|
+
switch (weight) {
|
|
89
|
+
case undefined:
|
|
90
|
+
case 'normal':
|
|
91
|
+
return 'font-normal';
|
|
92
|
+
case 'medium':
|
|
93
|
+
return 'font-medium';
|
|
94
|
+
default:
|
|
95
|
+
return unreachable(weight);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
Text.displayName = 'Text';
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
2
|
+
import { AnimatePresence, motion, type Variants } from 'framer-motion';
|
|
3
|
+
import type { ComponentProps } from 'react';
|
|
4
|
+
import { cn } from '../../utils';
|
|
5
|
+
|
|
6
|
+
export type ResultStatus = 'error' | 'warning' | 'success';
|
|
7
|
+
|
|
8
|
+
const statusStyles = {
|
|
9
|
+
error: 'text-red-600 hover:bg-red-600/10',
|
|
10
|
+
warning: 'text-yellow-300 hover:bg-yellow-400/10',
|
|
11
|
+
success: 'text-green-600 hover:bg-green-600/10',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
interface ResultListProps {
|
|
15
|
+
status: ResultStatus;
|
|
16
|
+
label: React.ReactNode;
|
|
17
|
+
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
defaultOpen?: boolean;
|
|
20
|
+
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const ResultList = ({
|
|
25
|
+
status,
|
|
26
|
+
label,
|
|
27
|
+
|
|
28
|
+
disabled,
|
|
29
|
+
defaultOpen,
|
|
30
|
+
|
|
31
|
+
children,
|
|
32
|
+
}: ResultListProps) => {
|
|
33
|
+
return (
|
|
34
|
+
<Collapsible.Root className="group" defaultOpen={defaultOpen && !disabled}>
|
|
35
|
+
<Collapsible.Trigger
|
|
36
|
+
className={cn(
|
|
37
|
+
'group flex w-full items-center gap-1 rounded-sm p-2 transition-colors duration-200 ease-[cubic-bezier(.36,.66,.6,1)]',
|
|
38
|
+
statusStyles[status],
|
|
39
|
+
disabled && 'cursor-not-allowed opacity-70',
|
|
40
|
+
)}
|
|
41
|
+
disabled={disabled}
|
|
42
|
+
>
|
|
43
|
+
<span
|
|
44
|
+
className={cn(
|
|
45
|
+
'-mt-0.5 transition-transform duration-200 ease-[cubic-bezier(.36,.66,.6,1)]',
|
|
46
|
+
'rotate-0 group-data-[state=open]:rotate-90',
|
|
47
|
+
)}
|
|
48
|
+
>
|
|
49
|
+
<svg
|
|
50
|
+
fill="none"
|
|
51
|
+
height="15"
|
|
52
|
+
viewBox="0 0 15 15"
|
|
53
|
+
width="15"
|
|
54
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
55
|
+
>
|
|
56
|
+
<path
|
|
57
|
+
clipRule="evenodd"
|
|
58
|
+
d="M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z"
|
|
59
|
+
fill="currentColor"
|
|
60
|
+
fillRule="evenodd"
|
|
61
|
+
/>
|
|
62
|
+
</svg>
|
|
63
|
+
</span>
|
|
64
|
+
<div className="flex flex-1 items-center gap-1 font-bold text-[.625rem] uppercase tracking-wide">
|
|
65
|
+
{label}
|
|
66
|
+
</div>
|
|
67
|
+
</Collapsible.Trigger>
|
|
68
|
+
{children ? (
|
|
69
|
+
<Collapsible.Content>
|
|
70
|
+
<ol className="mt-2 mb-1 flex list-none flex-col gap-4">
|
|
71
|
+
{children}
|
|
72
|
+
</ol>
|
|
73
|
+
</Collapsible.Content>
|
|
74
|
+
) : null}
|
|
75
|
+
</Collapsible.Root>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
type ResultProps = {
|
|
80
|
+
status: ResultStatus;
|
|
81
|
+
} & ComponentProps<typeof motion.li>;
|
|
82
|
+
|
|
83
|
+
const resultAnimation: Variants = {
|
|
84
|
+
hidden: { opacity: 0, y: 10 },
|
|
85
|
+
visible: {
|
|
86
|
+
opacity: 1,
|
|
87
|
+
y: 0,
|
|
88
|
+
transition: { duration: 0.6, ease: 'easeOut', staggerChildren: 0.1 },
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const Result = ({ children, status, ...rest }: ResultProps) => {
|
|
93
|
+
return (
|
|
94
|
+
<AnimatePresence mode="wait">
|
|
95
|
+
<motion.li
|
|
96
|
+
data-status={status}
|
|
97
|
+
initial="hidden"
|
|
98
|
+
layout
|
|
99
|
+
variants={resultAnimation}
|
|
100
|
+
animate="visible"
|
|
101
|
+
{...rest}
|
|
102
|
+
className={cn(
|
|
103
|
+
'group/item relative w-full rounded-md p-2 pl-4 transition-colors duration-300 ease-out hover:bg-slate-5',
|
|
104
|
+
rest.className,
|
|
105
|
+
)}
|
|
106
|
+
>
|
|
107
|
+
{children}
|
|
108
|
+
</motion.li>
|
|
109
|
+
</AnimatePresence>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
const titleStatusAnimation: Variants = {
|
|
114
|
+
hidden: { opacity: 0, y: 5 },
|
|
115
|
+
visible: {
|
|
116
|
+
opacity: 1,
|
|
117
|
+
y: 0,
|
|
118
|
+
transition: { duration: 0.4, ease: 'easeOut' },
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
interface ResultStatusDescriptionProps {
|
|
123
|
+
children: React.ReactNode;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
Result.StatusDescription = ({ children }: ResultStatusDescriptionProps) => {
|
|
127
|
+
return (
|
|
128
|
+
<motion.div
|
|
129
|
+
className="mt-1 font-semibold text-[.625rem] uppercase"
|
|
130
|
+
variants={titleStatusAnimation}
|
|
131
|
+
>
|
|
132
|
+
{children}
|
|
133
|
+
</motion.div>
|
|
134
|
+
);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
interface ResultTitleProps {
|
|
138
|
+
children: React.ReactNode;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
Result.Title = ({ children }: ResultTitleProps) => {
|
|
142
|
+
return (
|
|
143
|
+
<motion.div
|
|
144
|
+
className="flex w-full items-center gap-2 text-xs group-data-[status=error]/item:text-red-400 group-data-[status=success]/item:text-green-400 group-data-[status=warning]/item:text-yellow-300 "
|
|
145
|
+
variants={titleStatusAnimation}
|
|
146
|
+
>
|
|
147
|
+
{children}
|
|
148
|
+
</motion.div>
|
|
149
|
+
);
|
|
150
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import Link from 'next/link';
|
|
2
|
+
import { useSearchParams } from 'next/navigation';
|
|
3
|
+
|
|
4
|
+
interface CodePreviewLineLinkProps {
|
|
5
|
+
line: number;
|
|
6
|
+
column: number;
|
|
7
|
+
|
|
8
|
+
type: 'react' | 'html';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const CodePreviewLineLink = ({
|
|
12
|
+
line,
|
|
13
|
+
type,
|
|
14
|
+
}: CodePreviewLineLinkProps) => {
|
|
15
|
+
const searchParams = useSearchParams();
|
|
16
|
+
|
|
17
|
+
const newSearchParams = new URLSearchParams(searchParams);
|
|
18
|
+
newSearchParams.set('view', 'source');
|
|
19
|
+
if (type === 'html') {
|
|
20
|
+
newSearchParams.set('lang', 'html');
|
|
21
|
+
} else if (type === 'react') {
|
|
22
|
+
newSearchParams.set('lang', 'tsx');
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const fragmentIdentifier = `#L${line}`;
|
|
26
|
+
|
|
27
|
+
return (
|
|
28
|
+
<Link
|
|
29
|
+
href={{
|
|
30
|
+
search: newSearchParams.toString(),
|
|
31
|
+
hash: fragmentIdentifier,
|
|
32
|
+
}}
|
|
33
|
+
scroll={false}
|
|
34
|
+
className="appearance-none underline mx-2"
|
|
35
|
+
>
|
|
36
|
+
L{line.toString().padStart(2, '0')}
|
|
37
|
+
</Link>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { cn } from '../../utils';
|
|
2
|
+
|
|
3
|
+
export const Results = ({
|
|
4
|
+
children,
|
|
5
|
+
className,
|
|
6
|
+
...props
|
|
7
|
+
}: React.ComponentProps<'table'>) => {
|
|
8
|
+
return (
|
|
9
|
+
<table
|
|
10
|
+
{...props}
|
|
11
|
+
className={cn(
|
|
12
|
+
'group relative w-full border-collapse text-left text-slate-10 text-sm',
|
|
13
|
+
className,
|
|
14
|
+
)}
|
|
15
|
+
>
|
|
16
|
+
<tbody>{children}</tbody>
|
|
17
|
+
</table>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
Results.Row = ({
|
|
22
|
+
children,
|
|
23
|
+
className,
|
|
24
|
+
...props
|
|
25
|
+
}: React.ComponentProps<'tr'>) => {
|
|
26
|
+
return (
|
|
27
|
+
<tr
|
|
28
|
+
className={cn(
|
|
29
|
+
'border-collapse align-bottom border-slate-6 border-b last:border-b-0',
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
>
|
|
34
|
+
{children}
|
|
35
|
+
</tr>
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
Results.Column = ({
|
|
40
|
+
children,
|
|
41
|
+
className,
|
|
42
|
+
...props
|
|
43
|
+
}: React.ComponentProps<'td'>) => {
|
|
44
|
+
return (
|
|
45
|
+
<td
|
|
46
|
+
className={cn('py-1.5 align-bottom font-regular', className)}
|
|
47
|
+
{...props}
|
|
48
|
+
>
|
|
49
|
+
{children}
|
|
50
|
+
</td>
|
|
51
|
+
);
|
|
52
|
+
};
|