next 15.2.0-canary.65 → 15.2.0-canary.66
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.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +5 -1
- package/dist/bin/next.map +1 -1
- package/dist/build/entries.d.ts +1 -0
- package/dist/build/entries.js +12 -1
- package/dist/build/entries.js.map +1 -1
- package/dist/build/index.js +3 -3
- package/dist/build/index.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack/config/blocks/base.js +3 -1
- package/dist/build/webpack/config/blocks/base.js.map +1 -1
- package/dist/build/webpack/config/blocks/css/index.js +3 -1
- package/dist/build/webpack/config/blocks/css/index.js.map +1 -1
- package/dist/build/webpack/config/blocks/css/loaders/client.js +3 -1
- package/dist/build/webpack/config/blocks/css/loaders/client.js.map +1 -1
- package/dist/build/webpack/loaders/next-flight-client-entry-loader.js +4 -0
- package/dist/build/webpack/loaders/next-flight-client-entry-loader.js.map +1 -1
- package/dist/build/webpack/loaders/next-flight-client-module-loader.js +7 -1
- package/dist/build/webpack/loaders/next-flight-client-module-loader.js.map +1 -1
- package/dist/build/webpack/loaders/next-flight-loader/index.js +8 -2
- package/dist/build/webpack/loaders/next-flight-loader/index.js.map +1 -1
- package/dist/build/webpack/loaders/utils.js +1 -1
- package/dist/build/webpack/loaders/utils.js.map +1 -1
- package/dist/build/webpack/plugins/build-manifest-plugin.d.ts +1 -1
- package/dist/build/webpack/plugins/build-manifest-plugin.js +13 -4
- package/dist/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/flight-client-entry-plugin.d.ts +1 -1
- package/dist/build/webpack/plugins/flight-client-entry-plugin.js +28 -18
- package/dist/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/flight-manifest-plugin.js +3 -3
- package/dist/build/webpack/plugins/flight-manifest-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/middleware-plugin.js +6 -3
- package/dist/build/webpack/plugins/middleware-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js +11 -1
- package/dist/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
- package/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +1 -1
- package/dist/build/webpack/plugins/nextjs-require-cache-hot-reloader.js.map +1 -1
- package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.d.ts +36 -0
- package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js +97 -0
- package/dist/build/webpack/plugins/rspack-flight-client-entry-plugin.js.map +1 -0
- package/dist/build/webpack/plugins/rspack-profiling-plugin.d.ts +9 -0
- package/dist/build/webpack/plugins/rspack-profiling-plugin.js +62 -0
- package/dist/build/webpack/plugins/rspack-profiling-plugin.js.map +1 -0
- package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +2 -1
- package/dist/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js.map +1 -1
- package/dist/build/webpack/utils.js +6 -2
- package/dist/build/webpack/utils.js.map +1 -1
- package/dist/build/webpack-config.js +37 -5
- package/dist/build/webpack-config.js.map +1 -1
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/app-dir/link.js +2 -0
- package/dist/client/app-dir/link.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js +34 -26
- package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.d.ts +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.js +41 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/font-styles.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/geist-latin-ext.woff2 +0 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/geist-latin.woff2 +0 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2 +0 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin.woff2 +0 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.d.ts +2 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js +72 -0
- package/dist/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js +16 -8
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js +3 -3
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +2 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.d.ts +2 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js +82 -31
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js +20 -21
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.d.ts +8 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js +80 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.d.ts +9 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js +158 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.d.ts +8 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js +212 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.d.ts +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js +28 -6
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +3 -3
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js +4 -4
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js +9 -9
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js +4 -4
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js +15 -10
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js +3 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.d.ts +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js +7 -7
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js +5 -5
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.d.ts +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js +4 -12
- package/dist/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js +3 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.d.ts +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js +34 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js.map +1 -0
- package/dist/client/components/react-dev-overlay/_experimental/internal/styles/base.js +2 -2
- package/dist/client/components/react-dev-overlay/_experimental/internal/styles/base.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js +7 -1
- package/dist/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js.map +1 -1
- package/dist/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js +6 -2
- package/dist/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js.map +1 -1
- package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js +2 -2
- package/dist/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js +4 -4
- package/dist/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/middleware-response.d.ts +9 -0
- package/dist/client/components/react-dev-overlay/server/middleware-response.js +46 -0
- package/dist/client/components/react-dev-overlay/server/middleware-response.js.map +1 -0
- package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js +13 -12
- package/dist/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/middleware-webpack.js +12 -11
- package/dist/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
- package/dist/client/components/react-dev-overlay/server/shared.d.ts +0 -7
- package/dist/client/components/react-dev-overlay/server/shared.js +1 -51
- package/dist/client/components/react-dev-overlay/server/shared.js.map +1 -1
- package/dist/client/components/react-dev-overlay/shared.d.ts +1 -0
- package/dist/client/components/react-dev-overlay/shared.js +2 -0
- package/dist/client/components/react-dev-overlay/shared.js.map +1 -1
- package/dist/client/index.js +2 -3
- package/dist/client/index.js.map +1 -1
- package/dist/client/link.js.map +1 -1
- package/dist/compiled/@next/font/dist/google/fetch-css-from-google-fonts.js +8 -44
- package/dist/compiled/@next/font/dist/google/fetch-font-file.d.ts +2 -1
- package/dist/compiled/@next/font/dist/google/fetch-font-file.js +6 -20
- package/dist/compiled/@next/font/dist/google/fetch-resource.d.ts +6 -0
- package/dist/compiled/@next/font/dist/google/fetch-resource.js +46 -0
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js +3 -3
- package/dist/compiled/next-server/app-page-experimental.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/app-page.runtime.dev.js +3 -3
- package/dist/compiled/next-server/app-page.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +2 -2
- package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
- package/dist/compiled/node-fetch/index.js +1 -1
- package/dist/compiled/sass-loader/cjs.js +1 -1
- package/dist/compiled/webpack/webpack.js +23 -1
- package/dist/esm/build/entries.js +9 -2
- package/dist/esm/build/entries.js.map +1 -1
- package/dist/esm/build/index.js +3 -3
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack/config/blocks/base.js +3 -1
- package/dist/esm/build/webpack/config/blocks/base.js.map +1 -1
- package/dist/esm/build/webpack/config/blocks/css/index.js +3 -1
- package/dist/esm/build/webpack/config/blocks/css/index.js.map +1 -1
- package/dist/esm/build/webpack/config/blocks/css/loaders/client.js +3 -1
- package/dist/esm/build/webpack/config/blocks/css/loaders/client.js.map +1 -1
- package/dist/esm/build/webpack/loaders/next-flight-client-entry-loader.js +4 -0
- package/dist/esm/build/webpack/loaders/next-flight-client-entry-loader.js.map +1 -1
- package/dist/esm/build/webpack/loaders/next-flight-client-module-loader.js +7 -1
- package/dist/esm/build/webpack/loaders/next-flight-client-module-loader.js.map +1 -1
- package/dist/esm/build/webpack/loaders/next-flight-loader/index.js +8 -2
- package/dist/esm/build/webpack/loaders/next-flight-loader/index.js.map +1 -1
- package/dist/esm/build/webpack/loaders/utils.js +1 -1
- package/dist/esm/build/webpack/loaders/utils.js.map +1 -1
- package/dist/esm/build/webpack/plugins/build-manifest-plugin.js +14 -5
- package/dist/esm/build/webpack/plugins/build-manifest-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js +28 -18
- package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/flight-manifest-plugin.js +3 -3
- package/dist/esm/build/webpack/plugins/flight-manifest-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/middleware-plugin.js +6 -3
- package/dist/esm/build/webpack/plugins/middleware-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js +11 -1
- package/dist/esm/build/webpack/plugins/next-trace-entrypoints-plugin.js.map +1 -1
- package/dist/esm/build/webpack/plugins/nextjs-require-cache-hot-reloader.js +1 -1
- package/dist/esm/build/webpack/plugins/nextjs-require-cache-hot-reloader.js.map +1 -1
- package/dist/esm/build/webpack/plugins/rspack-flight-client-entry-plugin.js +87 -0
- package/dist/esm/build/webpack/plugins/rspack-flight-client-entry-plugin.js.map +1 -0
- package/dist/esm/build/webpack/plugins/rspack-profiling-plugin.js +40 -0
- package/dist/esm/build/webpack/plugins/rspack-profiling-plugin.js.map +1 -0
- package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js +2 -1
- package/dist/esm/build/webpack/plugins/wellknown-errors-plugin/parseNextAppLoaderError.js.map +1 -1
- package/dist/esm/build/webpack/utils.js +6 -2
- package/dist/esm/build/webpack/utils.js.map +1 -1
- package/dist/esm/build/webpack-config.js +37 -5
- package/dist/esm/build/webpack-config.js.map +1 -1
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/app-dir/link.js +2 -0
- package/dist/esm/client/app-dir/link.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js +34 -26
- package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/font-styles.js +25 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/font-styles.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-latin-ext.woff2 +0 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-latin.woff2 +0 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2 +0 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/geist-mono-latin.woff2 +0 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js +54 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js +16 -8
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/code-frame/code-frame.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js +3 -3
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/copy-button/index.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js +2 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/dialog.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/dialog/styles.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js +83 -31
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js +13 -14
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-indicator.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js +52 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/dev-tools-info.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js +130 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/route-info.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js +184 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/dev-tools-info/turbopack-info.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js +28 -6
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/dev-tools-indicator/internal/next-logo.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-message/error-message.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js +3 -3
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay/error-overlay.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js +4 -4
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-layout/error-overlay-layout.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js +2 -2
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-nav/error-overlay-nav.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js +9 -9
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js +4 -4
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/errors/error-overlay-pagination/error-overlay-pagination.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js +15 -10
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/terminal/terminal.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js +3 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/components/toast/toast.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js +7 -7
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js +5 -5
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/errors.stories.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/component-stack-pseudo-html.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js +4 -12
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/container/runtime-error/render-error.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js +3 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/collapse-icon.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js +18 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/icons/stop-icon.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/base.js +2 -2
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/base.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js +7 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/internal/styles/component-styles.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js +6 -2
- package/dist/esm/client/components/react-dev-overlay/_experimental/pages/react-dev-overlay.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/hydration-diff/diff-view.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js +4 -4
- package/dist/esm/client/components/react-dev-overlay/server/get-next-error-feedback-middleware.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/middleware-response.js +30 -0
- package/dist/esm/client/components/react-dev-overlay/server/middleware-response.js.map +1 -0
- package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js +14 -13
- package/dist/esm/client/components/react-dev-overlay/server/middleware-turbopack.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js +13 -12
- package/dist/esm/client/components/react-dev-overlay/server/middleware-webpack.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/server/shared.js +0 -26
- package/dist/esm/client/components/react-dev-overlay/server/shared.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/shared.js +2 -0
- package/dist/esm/client/components/react-dev-overlay/shared.js.map +1 -1
- package/dist/esm/client/index.js +2 -3
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/client/link.js.map +1 -1
- package/dist/esm/server/base-server.js +15 -15
- package/dist/esm/server/base-server.js.map +1 -1
- package/dist/esm/server/config-shared.js.map +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +4 -2
- package/dist/esm/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +4 -2
- package/dist/esm/server/dev/hot-reloader-webpack.js.map +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/get-rspack.js +32 -0
- package/dist/esm/shared/lib/get-rspack.js.map +1 -0
- package/dist/server/base-server.js +15 -15
- package/dist/server/base-server.js.map +1 -1
- package/dist/server/config-shared.d.ts +3 -3
- package/dist/server/config-shared.js.map +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +4 -2
- package/dist/server/dev/hot-reloader-turbopack.js.map +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +4 -2
- package/dist/server/dev/hot-reloader-webpack.js.map +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/get-rspack.d.ts +2 -0
- package/dist/shared/lib/get-rspack.js +54 -0
- package/dist/shared/lib/get-rspack.js.map +1 -0
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/dist/trace/trace-uploader.js +1 -2
- package/dist/trace/trace-uploader.js.map +1 -1
- package/package.json +15 -15
- package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.d.ts +0 -3
- package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.js +0 -43
- package/dist/client/components/react-dev-overlay/internal/icons/CollapseIcon.js.map +0 -1
- package/dist/esm/client/components/react-dev-overlay/internal/icons/CollapseIcon.js +0 -27
- package/dist/esm/client/components/react-dev-overlay/internal/icons/CollapseIcon.js.map +0 -1
@@ -44,6 +44,8 @@ const observer = typeof IntersectionObserver === 'function' ? new IntersectionOb
|
|
44
44
|
rootMargin: '200px'
|
45
45
|
}) : null;
|
46
46
|
function mountLinkInstance(element, href, router, kind) {
|
47
|
+
// element can be falsy which can break WeakMap and observing
|
48
|
+
if (!element) return;
|
47
49
|
let prefetchUrl = null;
|
48
50
|
try {
|
49
51
|
prefetchUrl = (0, _approuter.createPrefetchURL)(href);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/client/app-dir/link.tsx"],"sourcesContent":["'use client'\n\nimport type { NextRouter } from '../../shared/lib/router/router'\n\nimport React from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport { PrefetchKind } from '../components/router-reducer/router-reducer-types'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { warnOnce } from '../../shared/lib/utils/warn-once'\nimport {\n type PrefetchTask,\n schedulePrefetchTask as scheduleSegmentPrefetchTask,\n cancelPrefetchTask,\n bumpPrefetchTask,\n PrefetchPriority,\n} from '../components/segment-cache/scheduler'\nimport { getCurrentAppRouterState } from '../../shared/lib/router/action-queue'\nimport { createCacheKey } from '../components/segment-cache/cache-key'\nimport { createPrefetchURL } from '../components/app-router'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `null` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | null\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior, requiring an `<a>` tag to wrap the child content\n * if the child is a string or number.\n *\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when the webpack plugin runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\ntype LinkInstance = {\n router: AppRouterInstance\n kind: PrefetchKind.AUTO | PrefetchKind.FULL\n prefetchHref: string\n\n isVisible: boolean\n wasHoveredOrTouched: boolean\n\n // The most recently initiated prefetch task. It may or may not have\n // already completed. The same prefetch task object can be reused across\n // multiple prefetches of the same link.\n prefetchTask: PrefetchTask | null\n}\n\n// TODO: This is currently a WeakMap because it doesn't need to be enumerable,\n// but eventually we'll want to be able to re-prefetch all the currently\n// visible links, e.g. after a revalidation or refresh.\nconst links:\n | WeakMap<HTMLAnchorElement | SVGAElement, LinkInstance>\n | Map<Element, LinkInstance> =\n typeof WeakMap === 'function' ? new WeakMap() : new Map()\n\n// A single IntersectionObserver instance shared by all <Link> components.\nconst observer: IntersectionObserver | null =\n typeof IntersectionObserver === 'function'\n ? new IntersectionObserver(handleIntersect, {\n rootMargin: '200px',\n })\n : null\n\nfunction mountLinkInstance(\n element: HTMLAnchorElement | SVGAElement,\n href: string,\n router: AppRouterInstance,\n kind: PrefetchKind.AUTO | PrefetchKind.FULL\n) {\n let prefetchUrl: URL | null = null\n try {\n prefetchUrl = createPrefetchURL(href)\n if (prefetchUrl === null) {\n // We only track the link if it's prefetchable. For example, this excludes\n // links to external URLs.\n return\n }\n } catch {\n // createPrefetchURL sometimes throws an error if an invalid URL is\n // provided, though I'm not sure if it's actually necessary.\n // TODO: Consider removing the throw from the inner function, or change it\n // to reportError. Or maybe the error isn't even necessary for automatic\n // prefetches, just navigations.\n const reportErrorFn =\n typeof reportError === 'function' ? reportError : console.error\n reportErrorFn(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n return\n }\n\n const instance: LinkInstance = {\n prefetchHref: prefetchUrl.href,\n router,\n kind,\n isVisible: false,\n wasHoveredOrTouched: false,\n prefetchTask: null,\n }\n const existingInstance = links.get(element)\n if (existingInstance !== undefined) {\n // This shouldn't happen because each <Link> component should have its own\n // anchor tag instance, but it's defensive coding to avoid a memory leak in\n // case there's a logical error somewhere else.\n unmountLinkInstance(element)\n }\n links.set(element, instance)\n if (observer !== null) {\n observer.observe(element)\n }\n}\n\nexport function unmountLinkInstance(element: HTMLAnchorElement | SVGAElement) {\n const instance = links.get(element)\n if (instance !== undefined) {\n links.delete(element)\n const prefetchTask = instance.prefetchTask\n if (prefetchTask !== null) {\n cancelPrefetchTask(prefetchTask)\n }\n }\n if (observer !== null) {\n observer.unobserve(element)\n }\n}\n\nfunction handleIntersect(entries: Array<IntersectionObserverEntry>) {\n for (const entry of entries) {\n // Some extremely old browsers or polyfills don't reliably support\n // isIntersecting so we check intersectionRatio instead. (Do we care? Not\n // really. But whatever this is fine.)\n const isVisible = entry.intersectionRatio > 0\n onLinkVisibilityChanged(entry.target as HTMLAnchorElement, isVisible)\n }\n}\n\nfunction onLinkVisibilityChanged(\n element: HTMLAnchorElement | SVGAElement,\n isVisible: boolean\n) {\n if (process.env.NODE_ENV !== 'production') {\n // Prefetching on viewport is disabled in development for performance\n // reasons, because it requires compiling the target page.\n // TODO: Investigate re-enabling this.\n return\n }\n\n const instance = links.get(element)\n if (instance === undefined) {\n return\n }\n\n instance.isVisible = isVisible\n rescheduleLinkPrefetch(instance)\n}\n\nfunction onNavigationIntent(element: HTMLAnchorElement | SVGAElement) {\n const instance = links.get(element)\n if (instance === undefined) {\n return\n }\n // Prefetch the link on hover/touchstart.\n if (instance !== undefined) {\n instance.wasHoveredOrTouched = true\n rescheduleLinkPrefetch(instance)\n }\n}\n\nfunction rescheduleLinkPrefetch(instance: LinkInstance) {\n const existingPrefetchTask = instance.prefetchTask\n\n if (!instance.isVisible) {\n // Cancel any in-progress prefetch task. (If it already finished then this\n // is a no-op.)\n if (existingPrefetchTask !== null) {\n cancelPrefetchTask(existingPrefetchTask)\n }\n // We don't need to reset the prefetchTask to null upon cancellation; an\n // old task object can be rescheduled with bumpPrefetchTask. This is a\n // micro-optimization but also makes the code simpler (don't need to\n // worry about whether an old task object is stale).\n return\n }\n\n if (!process.env.__NEXT_CLIENT_SEGMENT_CACHE) {\n // The old prefetch implementation does not have different priority levels.\n // Just schedule a new prefetch task.\n prefetchWithOldCacheImplementation(instance)\n return\n }\n\n // In the Segment Cache implementation, we assign a higher priority level to\n // links that were at one point hovered or touched. Since the queue is last-\n // in-first-out, the highest priority Link is whichever one was hovered last.\n //\n // We also increase the relative priority of links whenever they re-enter the\n // viewport, as if they were being scheduled for the first time.\n const priority = instance.wasHoveredOrTouched\n ? PrefetchPriority.Intent\n : PrefetchPriority.Default\n if (existingPrefetchTask === null) {\n // Initiate a prefetch task.\n const appRouterState = getCurrentAppRouterState()\n if (appRouterState !== null) {\n const nextUrl = appRouterState.nextUrl\n const treeAtTimeOfPrefetch = appRouterState.tree\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n instance.kind === PrefetchKind.FULL,\n priority\n )\n }\n } else {\n // We already have an old task object that we can reschedule. This is\n // effectively the same as canceling the old task and creating a new one.\n bumpPrefetchTask(existingPrefetchTask, priority)\n }\n}\n\nfunction prefetchWithOldCacheImplementation(instance: LinkInstance) {\n // This is the path used when the Segment Cache is not enabled.\n if (typeof window === 'undefined') {\n return\n }\n\n const doPrefetch = async () => {\n // note that `appRouter.prefetch()` is currently sync,\n // so we have to wrap this call in an async function to be able to catch() errors below.\n return instance.router.prefetch(instance.prefetchHref, {\n kind: instance.kind,\n })\n }\n\n // Prefetch the page if asked (only in the client)\n // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n doPrefetch().catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n // rethrow to show invalid URL errors\n throw err\n }\n })\n}\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n router: NextRouter | AppRouterInstance,\n href: string,\n as: string,\n replace?: boolean,\n shallow?: boolean,\n scroll?: boolean\n): void {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n\n if (isAnchorNodeName && isModifiedEvent(e)) {\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n const navigate = () => {\n // If the router is an NextRouter instance it will have `beforePopState`\n const routerScroll = scroll ?? true\n if ('beforePopState' in router) {\n router[replace ? 'replace' : 'push'](href, as, {\n shallow,\n scroll: routerScroll,\n })\n } else {\n router[replace ? 'replace' : 'push'](as || href, {\n scroll: routerScroll,\n })\n }\n }\n\n React.startTransition(navigate)\n}\n\ntype LinkPropsReal = React.PropsWithChildren<\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof LinkProps> &\n LinkProps\n>\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nconst Link = React.forwardRef<HTMLAnchorElement, LinkPropsReal>(\n function LinkComponent(props, forwardedRef) {\n let children: React.ReactNode\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n /**\n * The possible states for prefetch are:\n * - null: this is the default \"auto\" mode, where we will prefetch partially if the link is in the viewport\n * - true: we will prefetch if the link is visible and prefetch the full page, not just partially\n * - false: we will not prefetch if in the viewport at all\n */\n const appPrefetchKind =\n prefetchProp === null ? PrefetchKind.AUTO : PrefetchKind.FULL\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'prefetch' ||\n key === 'legacyBehavior'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = key\n }\n })\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof hrefProp === 'string') {\n href = hrefProp\n } else if (\n typeof hrefProp === 'object' &&\n typeof hrefProp.pathname === 'string'\n ) {\n href = hrefProp.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n const { href, as } = React.useMemo(() => {\n const resolvedHref = formatStringOrUrl(hrefProp)\n return {\n href: resolvedHref,\n as: asProp ? formatStringOrUrl(asProp) : resolvedHref,\n }\n }, [hrefProp, asProp])\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (prefetchEnabled && router !== null) {\n mountLinkInstance(element, href, router, appPrefetchKind)\n }\n return () => {\n unmountLinkInstance(element)\n }\n },\n [prefetchEnabled, href, router, appPrefetchKind]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n\n if (e.defaultPrevented) {\n return\n }\n\n linkClicked(e, router, href, as, replace, shallow, scroll)\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n onNavigationIntent(e.currentTarget as HTMLAnchorElement | SVGAElement)\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n\n if (!prefetchEnabled) {\n return\n }\n\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement\n )\n },\n }\n\n // If child is an <a> tag and doesn't have a href attribute, or if the 'passHref' property is\n // defined, we specify the current 'href', so that repetition is not needed by the user.\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(as)) {\n childProps.href = as\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(as)\n }\n\n return legacyBehavior ? (\n React.cloneElement(child, childProps)\n ) : (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n)\n\nexport default Link\n"],"names":["unmountLinkInstance","links","WeakMap","Map","observer","IntersectionObserver","handleIntersect","rootMargin","mountLinkInstance","element","href","router","kind","prefetchUrl","createPrefetchURL","reportErrorFn","reportError","console","error","instance","prefetchHref","isVisible","wasHoveredOrTouched","prefetchTask","existingInstance","get","undefined","set","observe","delete","cancelPrefetchTask","unobserve","entries","entry","intersectionRatio","onLinkVisibilityChanged","target","process","env","NODE_ENV","rescheduleLinkPrefetch","onNavigationIntent","existingPrefetchTask","__NEXT_CLIENT_SEGMENT_CACHE","prefetchWithOldCacheImplementation","priority","PrefetchPriority","Intent","Default","appRouterState","getCurrentAppRouterState","nextUrl","treeAtTimeOfPrefetch","tree","cacheKey","createCacheKey","scheduleSegmentPrefetchTask","PrefetchKind","FULL","bumpPrefetchTask","window","doPrefetch","prefetch","catch","err","isModifiedEvent","event","eventTarget","currentTarget","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","as","replace","shallow","scroll","nodeName","isAnchorNodeName","toUpperCase","preventDefault","navigate","routerScroll","React","startTransition","formatStringOrUrl","urlObjOrString","formatUrl","Link","forwardRef","LinkComponent","props","forwardedRef","children","hrefProp","asProp","childrenProp","prefetchProp","passHref","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","restProps","a","useContext","AppRouterContext","prefetchEnabled","appPrefetchKind","AUTO","createPropError","args","Error","key","expected","actual","requiredPropsGuard","requiredProps","Object","keys","forEach","_","optionalPropsGuard","optionalProps","valType","locale","warnOnce","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","useMemo","resolvedHref","child","warn","Children","only","type","childRef","ref","observeLinkVisibilityOnMount","useCallback","mergedRef","useMergedRef","childProps","defaultPrevented","__NEXT_LINK_NO_TOUCH_START","isAbsoluteUrl","addBasePath","cloneElement"],"mappings":"AAAA;;;;;;;;;;;;;;;;IA41BA,OAAmB;eAAnB;;IA1jBgBA,mBAAmB;eAAnBA;;;;;gEA9RE;2BAEQ;+CACO;oCAEJ;8BACA;uBACC;6BACF;0BACH;2BAOlB;6BACkC;0BACV;2BACG;AA0MlC,8EAA8E;AAC9E,wEAAwE;AACxE,uDAAuD;AACvD,MAAMC,QAGJ,OAAOC,YAAY,aAAa,IAAIA,YAAY,IAAIC;AAEtD,0EAA0E;AAC1E,MAAMC,WACJ,OAAOC,yBAAyB,aAC5B,IAAIA,qBAAqBC,iBAAiB;IACxCC,YAAY;AACd,KACA;AAEN,SAASC,kBACPC,OAAwC,EACxCC,IAAY,EACZC,MAAyB,EACzBC,IAA2C;IAE3C,IAAIC,cAA0B;IAC9B,IAAI;QACFA,cAAcC,IAAAA,4BAAiB,EAACJ;QAChC,IAAIG,gBAAgB,MAAM;YACxB,0EAA0E;YAC1E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C,kBACAkC,MAAM/C,KAAK,IACX,OAAO+C,MAAM/C,KAAK,CAACW,YAAY,KAAK,YACpC;gBACAoC,MAAM/C,KAAK,CAACW,YAAY,CAAC9B;YAC3B;YAEA,IAAI,CAAClE,QAAQ;gBACX;YACF;YAEA,IAAI,CAACuG,iBAAiB;gBACpB;YACF;YAEAzE,mBACEoC,EAAET,aAAa;QAEnB;IACN;IAEA,6FAA6F;IAC7F,wFAAwF;IACxF,2EAA2E;IAC3E,IAAIyF,IAAAA,oBAAa,EAAC/E,KAAK;QACrB4E,WAAWhJ,IAAI,GAAGoE;IACpB,OAAO,IACL,CAAC+B,kBACDN,YACCwC,MAAMI,IAAI,KAAK,OAAO,CAAE,CAAA,UAAUJ,MAAM/C,KAAK,AAAD,GAC7C;QACA0D,WAAWhJ,IAAI,GAAGoJ,IAAAA,wBAAW,EAAChF;IAChC;IAEA,OAAO+B,+BACLrB,cAAK,CAACuE,YAAY,CAAChB,OAAOW,4BAE1B,qBAAC3C;QAAG,GAAGD,SAAS;QAAG,GAAG4C,UAAU;kBAC7BxD;;AAGP;MAGF,WAAeL"}
|
1
|
+
{"version":3,"sources":["../../../src/client/app-dir/link.tsx"],"sourcesContent":["'use client'\n\nimport type { NextRouter } from '../../shared/lib/router/router'\n\nimport React from 'react'\nimport type { UrlObject } from 'url'\nimport { formatUrl } from '../../shared/lib/router/utils/format-url'\nimport { AppRouterContext } from '../../shared/lib/app-router-context.shared-runtime'\nimport type { AppRouterInstance } from '../../shared/lib/app-router-context.shared-runtime'\nimport { PrefetchKind } from '../components/router-reducer/router-reducer-types'\nimport { useMergedRef } from '../use-merged-ref'\nimport { isAbsoluteUrl } from '../../shared/lib/utils'\nimport { addBasePath } from '../add-base-path'\nimport { warnOnce } from '../../shared/lib/utils/warn-once'\nimport {\n type PrefetchTask,\n schedulePrefetchTask as scheduleSegmentPrefetchTask,\n cancelPrefetchTask,\n bumpPrefetchTask,\n PrefetchPriority,\n} from '../components/segment-cache/scheduler'\nimport { getCurrentAppRouterState } from '../../shared/lib/router/action-queue'\nimport { createCacheKey } from '../components/segment-cache/cache-key'\nimport { createPrefetchURL } from '../components/app-router'\n\ntype Url = string | UrlObject\ntype RequiredKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? never : K\n}[keyof T]\ntype OptionalKeys<T> = {\n [K in keyof T]-?: {} extends Pick<T, K> ? K : never\n}[keyof T]\n\ntype InternalLinkProps = {\n /**\n * **Required**. The path or URL to navigate to. It can also be an object (similar to `URL`).\n *\n * @example\n * ```tsx\n * // Navigate to /dashboard:\n * <Link href=\"/dashboard\">Dashboard</Link>\n *\n * // Navigate to /about?name=test:\n * <Link href={{ pathname: '/about', query: { name: 'test' } }}>\n * About\n * </Link>\n * ```\n *\n * @remarks\n * - For external URLs, use a fully qualified URL such as `https://...`.\n * - In the App Router, dynamic routes must not include bracketed segments in `href`.\n */\n href: Url\n\n /**\n * @deprecated v10.0.0: `href` props pointing to a dynamic route are\n * automatically resolved and no longer require the `as` prop.\n */\n as?: Url\n\n /**\n * Replace the current `history` state instead of adding a new URL into the stack.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/about\" replace>\n * About (replaces the history state)\n * </Link>\n * ```\n */\n replace?: boolean\n\n /**\n * Whether to override the default scroll behavior. If `true`, Next.js attempts to maintain\n * the scroll position if the newly navigated page is still visible. If not, it scrolls to the top.\n *\n * If `false`, Next.js will not modify the scroll behavior at all.\n *\n * @defaultValue `true`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" scroll={false}>\n * No auto scroll\n * </Link>\n * ```\n */\n scroll?: boolean\n\n /**\n * Update the path of the current page without rerunning data fetching methods\n * like `getStaticProps`, `getServerSideProps`, or `getInitialProps`.\n *\n * @remarks\n * `shallow` only applies to the Pages Router. For the App Router, see the\n * [following documentation](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#using-the-native-history-api).\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/blog\" shallow>\n * Shallow navigation\n * </Link>\n * ```\n */\n shallow?: boolean\n\n /**\n * Forces `Link` to pass its `href` to the child component. Useful if the child is a custom\n * component that wraps an `<a>` tag, or if you're using certain styling libraries.\n *\n * @defaultValue `false`\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" passHref>\n * <MyStyledAnchor>Dashboard</MyStyledAnchor>\n * </Link>\n * ```\n */\n passHref?: boolean\n\n /**\n * Prefetch the page in the background.\n * Any `<Link />` that is in the viewport (initially or through scroll) will be prefetched.\n * Prefetch can be disabled by passing `prefetch={false}`.\n *\n * @remarks\n * Prefetching is only enabled in production.\n *\n * - In the **App Router**:\n * - `null` (default): Prefetch behavior depends on static vs dynamic routes:\n * - Static routes: fully prefetched\n * - Dynamic routes: partial prefetch to the nearest segment with a `loading.js`\n * - `true`: Always prefetch the full route and data.\n * - `false`: Disable prefetching on both viewport and hover.\n * - In the **Pages Router**:\n * - `true` (default): Prefetches the route and data in the background on viewport or hover.\n * - `false`: Prefetch only on hover, not on viewport.\n *\n * @defaultValue `true` (Pages Router) or `null` (App Router)\n *\n * @example\n * ```tsx\n * <Link href=\"/dashboard\" prefetch={false}>\n * Dashboard\n * </Link>\n * ```\n */\n prefetch?: boolean | null\n\n /**\n * The active locale is automatically prepended in the Pages Router. `locale` allows for providing\n * a different locale, or can be set to `false` to opt out of automatic locale behavior.\n *\n * @remarks\n * Note: locale only applies in the Pages Router and is ignored in the App Router.\n *\n * @example\n * ```tsx\n * // Use the 'fr' locale:\n * <Link href=\"/about\" locale=\"fr\">\n * About (French)\n * </Link>\n *\n * // Disable locale prefix:\n * <Link href=\"/about\" locale={false}>\n * About (no locale prefix)\n * </Link>\n * ```\n */\n locale?: string | false\n\n /**\n * Enable legacy link behavior, requiring an `<a>` tag to wrap the child content\n * if the child is a string or number.\n *\n * @defaultValue `false`\n * @see https://github.com/vercel/next.js/commit/489e65ed98544e69b0afd7e0cfc3f9f6c2b803b7\n */\n legacyBehavior?: boolean\n\n /**\n * Optional event handler for when the mouse pointer is moved onto the `<Link>`.\n */\n onMouseEnter?: React.MouseEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is touched.\n */\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n\n /**\n * Optional event handler for when the `<Link>` is clicked.\n */\n onClick?: React.MouseEventHandler<HTMLAnchorElement>\n}\n\n// TODO-APP: Include the full set of Anchor props\n// adding this to the publicly exported type currently breaks existing apps\n\n// `RouteInferType` is a stub here to avoid breaking `typedRoutes` when the type\n// isn't generated yet. It will be replaced when the webpack plugin runs.\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport type LinkProps<RouteInferType = any> = InternalLinkProps\ntype LinkPropsRequired = RequiredKeys<LinkProps>\ntype LinkPropsOptional = OptionalKeys<Omit<InternalLinkProps, 'locale'>>\n\ntype LinkInstance = {\n router: AppRouterInstance\n kind: PrefetchKind.AUTO | PrefetchKind.FULL\n prefetchHref: string\n\n isVisible: boolean\n wasHoveredOrTouched: boolean\n\n // The most recently initiated prefetch task. It may or may not have\n // already completed. The same prefetch task object can be reused across\n // multiple prefetches of the same link.\n prefetchTask: PrefetchTask | null\n}\n\n// TODO: This is currently a WeakMap because it doesn't need to be enumerable,\n// but eventually we'll want to be able to re-prefetch all the currently\n// visible links, e.g. after a revalidation or refresh.\nconst links:\n | WeakMap<HTMLAnchorElement | SVGAElement, LinkInstance>\n | Map<Element, LinkInstance> =\n typeof WeakMap === 'function' ? new WeakMap() : new Map()\n\n// A single IntersectionObserver instance shared by all <Link> components.\nconst observer: IntersectionObserver | null =\n typeof IntersectionObserver === 'function'\n ? new IntersectionObserver(handleIntersect, {\n rootMargin: '200px',\n })\n : null\n\nfunction mountLinkInstance(\n element: HTMLAnchorElement | SVGAElement,\n href: string,\n router: AppRouterInstance,\n kind: PrefetchKind.AUTO | PrefetchKind.FULL\n) {\n // element can be falsy which can break WeakMap and observing\n if (!element) return\n\n let prefetchUrl: URL | null = null\n try {\n prefetchUrl = createPrefetchURL(href)\n if (prefetchUrl === null) {\n // We only track the link if it's prefetchable. For example, this excludes\n // links to external URLs.\n return\n }\n } catch {\n // createPrefetchURL sometimes throws an error if an invalid URL is\n // provided, though I'm not sure if it's actually necessary.\n // TODO: Consider removing the throw from the inner function, or change it\n // to reportError. Or maybe the error isn't even necessary for automatic\n // prefetches, just navigations.\n const reportErrorFn =\n typeof reportError === 'function' ? reportError : console.error\n reportErrorFn(\n `Cannot prefetch '${href}' because it cannot be converted to a URL.`\n )\n return\n }\n\n const instance: LinkInstance = {\n prefetchHref: prefetchUrl.href,\n router,\n kind,\n isVisible: false,\n wasHoveredOrTouched: false,\n prefetchTask: null,\n }\n const existingInstance = links.get(element)\n if (existingInstance !== undefined) {\n // This shouldn't happen because each <Link> component should have its own\n // anchor tag instance, but it's defensive coding to avoid a memory leak in\n // case there's a logical error somewhere else.\n unmountLinkInstance(element)\n }\n links.set(element, instance)\n if (observer !== null) {\n observer.observe(element)\n }\n}\n\nexport function unmountLinkInstance(element: HTMLAnchorElement | SVGAElement) {\n const instance = links.get(element)\n if (instance !== undefined) {\n links.delete(element)\n const prefetchTask = instance.prefetchTask\n if (prefetchTask !== null) {\n cancelPrefetchTask(prefetchTask)\n }\n }\n if (observer !== null) {\n observer.unobserve(element)\n }\n}\n\nfunction handleIntersect(entries: Array<IntersectionObserverEntry>) {\n for (const entry of entries) {\n // Some extremely old browsers or polyfills don't reliably support\n // isIntersecting so we check intersectionRatio instead. (Do we care? Not\n // really. But whatever this is fine.)\n const isVisible = entry.intersectionRatio > 0\n onLinkVisibilityChanged(entry.target as HTMLAnchorElement, isVisible)\n }\n}\n\nfunction onLinkVisibilityChanged(\n element: HTMLAnchorElement | SVGAElement,\n isVisible: boolean\n) {\n if (process.env.NODE_ENV !== 'production') {\n // Prefetching on viewport is disabled in development for performance\n // reasons, because it requires compiling the target page.\n // TODO: Investigate re-enabling this.\n return\n }\n\n const instance = links.get(element)\n if (instance === undefined) {\n return\n }\n\n instance.isVisible = isVisible\n rescheduleLinkPrefetch(instance)\n}\n\nfunction onNavigationIntent(element: HTMLAnchorElement | SVGAElement) {\n const instance = links.get(element)\n if (instance === undefined) {\n return\n }\n // Prefetch the link on hover/touchstart.\n if (instance !== undefined) {\n instance.wasHoveredOrTouched = true\n rescheduleLinkPrefetch(instance)\n }\n}\n\nfunction rescheduleLinkPrefetch(instance: LinkInstance) {\n const existingPrefetchTask = instance.prefetchTask\n\n if (!instance.isVisible) {\n // Cancel any in-progress prefetch task. (If it already finished then this\n // is a no-op.)\n if (existingPrefetchTask !== null) {\n cancelPrefetchTask(existingPrefetchTask)\n }\n // We don't need to reset the prefetchTask to null upon cancellation; an\n // old task object can be rescheduled with bumpPrefetchTask. This is a\n // micro-optimization but also makes the code simpler (don't need to\n // worry about whether an old task object is stale).\n return\n }\n\n if (!process.env.__NEXT_CLIENT_SEGMENT_CACHE) {\n // The old prefetch implementation does not have different priority levels.\n // Just schedule a new prefetch task.\n prefetchWithOldCacheImplementation(instance)\n return\n }\n\n // In the Segment Cache implementation, we assign a higher priority level to\n // links that were at one point hovered or touched. Since the queue is last-\n // in-first-out, the highest priority Link is whichever one was hovered last.\n //\n // We also increase the relative priority of links whenever they re-enter the\n // viewport, as if they were being scheduled for the first time.\n const priority = instance.wasHoveredOrTouched\n ? PrefetchPriority.Intent\n : PrefetchPriority.Default\n if (existingPrefetchTask === null) {\n // Initiate a prefetch task.\n const appRouterState = getCurrentAppRouterState()\n if (appRouterState !== null) {\n const nextUrl = appRouterState.nextUrl\n const treeAtTimeOfPrefetch = appRouterState.tree\n const cacheKey = createCacheKey(instance.prefetchHref, nextUrl)\n instance.prefetchTask = scheduleSegmentPrefetchTask(\n cacheKey,\n treeAtTimeOfPrefetch,\n instance.kind === PrefetchKind.FULL,\n priority\n )\n }\n } else {\n // We already have an old task object that we can reschedule. This is\n // effectively the same as canceling the old task and creating a new one.\n bumpPrefetchTask(existingPrefetchTask, priority)\n }\n}\n\nfunction prefetchWithOldCacheImplementation(instance: LinkInstance) {\n // This is the path used when the Segment Cache is not enabled.\n if (typeof window === 'undefined') {\n return\n }\n\n const doPrefetch = async () => {\n // note that `appRouter.prefetch()` is currently sync,\n // so we have to wrap this call in an async function to be able to catch() errors below.\n return instance.router.prefetch(instance.prefetchHref, {\n kind: instance.kind,\n })\n }\n\n // Prefetch the page if asked (only in the client)\n // We need to handle a prefetch error here since we may be\n // loading with priority which can reject but we don't\n // want to force navigation since this is only a prefetch\n doPrefetch().catch((err) => {\n if (process.env.NODE_ENV !== 'production') {\n // rethrow to show invalid URL errors\n throw err\n }\n })\n}\n\nfunction isModifiedEvent(event: React.MouseEvent): boolean {\n const eventTarget = event.currentTarget as HTMLAnchorElement | SVGAElement\n const target = eventTarget.getAttribute('target')\n return (\n (target && target !== '_self') ||\n event.metaKey ||\n event.ctrlKey ||\n event.shiftKey ||\n event.altKey || // triggers resource download\n (event.nativeEvent && event.nativeEvent.which === 2)\n )\n}\n\nfunction linkClicked(\n e: React.MouseEvent,\n router: NextRouter | AppRouterInstance,\n href: string,\n as: string,\n replace?: boolean,\n shallow?: boolean,\n scroll?: boolean\n): void {\n const { nodeName } = e.currentTarget\n\n // anchors inside an svg have a lowercase nodeName\n const isAnchorNodeName = nodeName.toUpperCase() === 'A'\n\n if (isAnchorNodeName && isModifiedEvent(e)) {\n // ignore click for browser’s default behavior\n return\n }\n\n e.preventDefault()\n\n const navigate = () => {\n // If the router is an NextRouter instance it will have `beforePopState`\n const routerScroll = scroll ?? true\n if ('beforePopState' in router) {\n router[replace ? 'replace' : 'push'](href, as, {\n shallow,\n scroll: routerScroll,\n })\n } else {\n router[replace ? 'replace' : 'push'](as || href, {\n scroll: routerScroll,\n })\n }\n }\n\n React.startTransition(navigate)\n}\n\ntype LinkPropsReal = React.PropsWithChildren<\n Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, keyof LinkProps> &\n LinkProps\n>\n\nfunction formatStringOrUrl(urlObjOrString: UrlObject | string): string {\n if (typeof urlObjOrString === 'string') {\n return urlObjOrString\n }\n\n return formatUrl(urlObjOrString)\n}\n\n/**\n * A React component that extends the HTML `<a>` element to provide\n * [prefetching](https://nextjs.org/docs/app/building-your-application/routing/linking-and-navigating#2-prefetching)\n * and client-side navigation. This is the primary way to navigate between routes in Next.js.\n *\n * @remarks\n * - Prefetching is only enabled in production.\n *\n * @see https://nextjs.org/docs/app/api-reference/components/link\n */\nconst Link = React.forwardRef<HTMLAnchorElement, LinkPropsReal>(\n function LinkComponent(props, forwardedRef) {\n let children: React.ReactNode\n\n const {\n href: hrefProp,\n as: asProp,\n children: childrenProp,\n prefetch: prefetchProp = null,\n passHref,\n replace,\n shallow,\n scroll,\n onClick,\n onMouseEnter: onMouseEnterProp,\n onTouchStart: onTouchStartProp,\n legacyBehavior = false,\n ...restProps\n } = props\n\n children = childrenProp\n\n if (\n legacyBehavior &&\n (typeof children === 'string' || typeof children === 'number')\n ) {\n children = <a>{children}</a>\n }\n\n const router = React.useContext(AppRouterContext)\n\n const prefetchEnabled = prefetchProp !== false\n /**\n * The possible states for prefetch are:\n * - null: this is the default \"auto\" mode, where we will prefetch partially if the link is in the viewport\n * - true: we will prefetch if the link is visible and prefetch the full page, not just partially\n * - false: we will not prefetch if in the viewport at all\n */\n const appPrefetchKind =\n prefetchProp === null ? PrefetchKind.AUTO : PrefetchKind.FULL\n\n if (process.env.NODE_ENV !== 'production') {\n function createPropError(args: {\n key: string\n expected: string\n actual: string\n }) {\n return new Error(\n `Failed prop type: The prop \\`${args.key}\\` expects a ${args.expected} in \\`<Link>\\`, but got \\`${args.actual}\\` instead.` +\n (typeof window !== 'undefined'\n ? \"\\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n\n // TypeScript trick for type-guarding:\n const requiredPropsGuard: Record<LinkPropsRequired, true> = {\n href: true,\n } as const\n const requiredProps: LinkPropsRequired[] = Object.keys(\n requiredPropsGuard\n ) as LinkPropsRequired[]\n requiredProps.forEach((key: LinkPropsRequired) => {\n if (key === 'href') {\n if (\n props[key] == null ||\n (typeof props[key] !== 'string' && typeof props[key] !== 'object')\n ) {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: props[key] === null ? 'null' : typeof props[key],\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = key\n }\n })\n\n // TypeScript trick for type-guarding:\n const optionalPropsGuard: Record<LinkPropsOptional, true> = {\n as: true,\n replace: true,\n scroll: true,\n shallow: true,\n passHref: true,\n prefetch: true,\n onClick: true,\n onMouseEnter: true,\n onTouchStart: true,\n legacyBehavior: true,\n } as const\n const optionalProps: LinkPropsOptional[] = Object.keys(\n optionalPropsGuard\n ) as LinkPropsOptional[]\n optionalProps.forEach((key: LinkPropsOptional) => {\n const valType = typeof props[key]\n\n if (key === 'as') {\n if (props[key] && valType !== 'string' && valType !== 'object') {\n throw createPropError({\n key,\n expected: '`string` or `object`',\n actual: valType,\n })\n }\n } else if (\n key === 'onClick' ||\n key === 'onMouseEnter' ||\n key === 'onTouchStart'\n ) {\n if (props[key] && valType !== 'function') {\n throw createPropError({\n key,\n expected: '`function`',\n actual: valType,\n })\n }\n } else if (\n key === 'replace' ||\n key === 'scroll' ||\n key === 'shallow' ||\n key === 'passHref' ||\n key === 'prefetch' ||\n key === 'legacyBehavior'\n ) {\n if (props[key] != null && valType !== 'boolean') {\n throw createPropError({\n key,\n expected: '`boolean`',\n actual: valType,\n })\n }\n } else {\n // TypeScript trick for type-guarding:\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = key\n }\n })\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (props.locale) {\n warnOnce(\n 'The `locale` prop is not supported in `next/link` while using the `app` router. Read more about app router internalization: https://nextjs.org/docs/app/building-your-application/routing/internationalization'\n )\n }\n if (!asProp) {\n let href: string | undefined\n if (typeof hrefProp === 'string') {\n href = hrefProp\n } else if (\n typeof hrefProp === 'object' &&\n typeof hrefProp.pathname === 'string'\n ) {\n href = hrefProp.pathname\n }\n\n if (href) {\n const hasDynamicSegment = href\n .split('/')\n .some((segment) => segment.startsWith('[') && segment.endsWith(']'))\n\n if (hasDynamicSegment) {\n throw new Error(\n `Dynamic href \\`${href}\\` found in <Link> while using the \\`/app\\` router, this is not supported. Read more: https://nextjs.org/docs/messages/app-dir-dynamic-href`\n )\n }\n }\n }\n }\n\n const { href, as } = React.useMemo(() => {\n const resolvedHref = formatStringOrUrl(hrefProp)\n return {\n href: resolvedHref,\n as: asProp ? formatStringOrUrl(asProp) : resolvedHref,\n }\n }, [hrefProp, asProp])\n\n // This will return the first child, if multiple are provided it will throw an error\n let child: any\n if (legacyBehavior) {\n if (process.env.NODE_ENV === 'development') {\n if (onClick) {\n console.warn(\n `\"onClick\" was passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onClick be set on the child of next/link`\n )\n }\n if (onMouseEnterProp) {\n console.warn(\n `\"onMouseEnter\" was passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but \"legacyBehavior\" was set. The legacy behavior requires onMouseEnter be set on the child of next/link`\n )\n }\n try {\n child = React.Children.only(children)\n } catch (err) {\n if (!children) {\n throw new Error(\n `No children were passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but one child is required https://nextjs.org/docs/messages/link-no-children`\n )\n }\n throw new Error(\n `Multiple children were passed to <Link> with \\`href\\` of \\`${hrefProp}\\` but only one child is supported https://nextjs.org/docs/messages/link-multiple-children` +\n (typeof window !== 'undefined'\n ? \" \\nOpen your browser's console to view the Component stack trace.\"\n : '')\n )\n }\n } else {\n child = React.Children.only(children)\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if ((children as any)?.type === 'a') {\n throw new Error(\n 'Invalid <Link> with <a> child. Please remove <a> or use <Link legacyBehavior>.\\nLearn more: https://nextjs.org/docs/messages/invalid-new-link-with-extra-anchor'\n )\n }\n }\n }\n\n const childRef: any = legacyBehavior\n ? child && typeof child === 'object' && child.ref\n : forwardedRef\n\n // Use a callback ref to attach an IntersectionObserver to the anchor tag on\n // mount. In the future we will also use this to keep track of all the\n // currently mounted <Link> instances, e.g. so we can re-prefetch them after\n // a revalidation or refresh.\n const observeLinkVisibilityOnMount = React.useCallback(\n (element: HTMLAnchorElement | SVGAElement) => {\n if (prefetchEnabled && router !== null) {\n mountLinkInstance(element, href, router, appPrefetchKind)\n }\n return () => {\n unmountLinkInstance(element)\n }\n },\n [prefetchEnabled, href, router, appPrefetchKind]\n )\n\n const mergedRef = useMergedRef(observeLinkVisibilityOnMount, childRef)\n\n const childProps: {\n onTouchStart?: React.TouchEventHandler<HTMLAnchorElement>\n onMouseEnter: React.MouseEventHandler<HTMLAnchorElement>\n onClick: React.MouseEventHandler<HTMLAnchorElement>\n href?: string\n ref?: any\n } = {\n ref: mergedRef,\n onClick(e) {\n if (process.env.NODE_ENV !== 'production') {\n if (!e) {\n throw new Error(\n `Component rendered inside next/link has to pass click event to \"onClick\" prop.`\n )\n }\n }\n\n if (!legacyBehavior && typeof onClick === 'function') {\n onClick(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onClick === 'function'\n ) {\n child.props.onClick(e)\n }\n\n if (!router) {\n return\n }\n\n if (e.defaultPrevented) {\n return\n }\n\n linkClicked(e, router, href, as, replace, shallow, scroll)\n },\n onMouseEnter(e) {\n if (!legacyBehavior && typeof onMouseEnterProp === 'function') {\n onMouseEnterProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onMouseEnter === 'function'\n ) {\n child.props.onMouseEnter(e)\n }\n\n if (!router) {\n return\n }\n\n if (!prefetchEnabled || process.env.NODE_ENV === 'development') {\n return\n }\n\n onNavigationIntent(e.currentTarget as HTMLAnchorElement | SVGAElement)\n },\n onTouchStart: process.env.__NEXT_LINK_NO_TOUCH_START\n ? undefined\n : function onTouchStart(e) {\n if (!legacyBehavior && typeof onTouchStartProp === 'function') {\n onTouchStartProp(e)\n }\n\n if (\n legacyBehavior &&\n child.props &&\n typeof child.props.onTouchStart === 'function'\n ) {\n child.props.onTouchStart(e)\n }\n\n if (!router) {\n return\n }\n\n if (!prefetchEnabled) {\n return\n }\n\n onNavigationIntent(\n e.currentTarget as HTMLAnchorElement | SVGAElement\n )\n },\n }\n\n // If child is an <a> tag and doesn't have a href attribute, or if the 'passHref' property is\n // defined, we specify the current 'href', so that repetition is not needed by the user.\n // If the url is absolute, we can bypass the logic to prepend the basePath.\n if (isAbsoluteUrl(as)) {\n childProps.href = as\n } else if (\n !legacyBehavior ||\n passHref ||\n (child.type === 'a' && !('href' in child.props))\n ) {\n childProps.href = addBasePath(as)\n }\n\n return legacyBehavior ? (\n React.cloneElement(child, childProps)\n ) : (\n <a {...restProps} {...childProps}>\n {children}\n </a>\n )\n }\n)\n\nexport default Link\n"],"names":["unmountLinkInstance","links","WeakMap","Map","observer","IntersectionObserver","handleIntersect","rootMargin","mountLinkInstance","element","href","router","kind","prefetchUrl","createPrefetchURL","reportErrorFn","reportError","console","error","instance","prefetchHref","isVisible","wasHoveredOrTouched","prefetchTask","existingInstance","get","undefined","set","observe","delete","cancelPrefetchTask","unobserve","entries","entry","intersectionRatio","onLinkVisibilityChanged","target","process","env","NODE_ENV","rescheduleLinkPrefetch","onNavigationIntent","existingPrefetchTask","__NEXT_CLIENT_SEGMENT_CACHE","prefetchWithOldCacheImplementation","priority","PrefetchPriority","Intent","Default","appRouterState","getCurrentAppRouterState","nextUrl","treeAtTimeOfPrefetch","tree","cacheKey","createCacheKey","scheduleSegmentPrefetchTask","PrefetchKind","FULL","bumpPrefetchTask","window","doPrefetch","prefetch","catch","err","isModifiedEvent","event","eventTarget","currentTarget","getAttribute","metaKey","ctrlKey","shiftKey","altKey","nativeEvent","which","linkClicked","e","as","replace","shallow","scroll","nodeName","isAnchorNodeName","toUpperCase","preventDefault","navigate","routerScroll","React","startTransition","formatStringOrUrl","urlObjOrString","formatUrl","Link","forwardRef","LinkComponent","props","forwardedRef","children","hrefProp","asProp","childrenProp","prefetchProp","passHref","onClick","onMouseEnter","onMouseEnterProp","onTouchStart","onTouchStartProp","legacyBehavior","restProps","a","useContext","AppRouterContext","prefetchEnabled","appPrefetchKind","AUTO","createPropError","args","Error","key","expected","actual","requiredPropsGuard","requiredProps","Object","keys","forEach","_","optionalPropsGuard","optionalProps","valType","locale","warnOnce","pathname","hasDynamicSegment","split","some","segment","startsWith","endsWith","useMemo","resolvedHref","child","warn","Children","only","type","childRef","ref","observeLinkVisibilityOnMount","useCallback","mergedRef","useMergedRef","childProps","defaultPrevented","__NEXT_LINK_NO_TOUCH_START","isAbsoluteUrl","addBasePath","cloneElement"],"mappings":"AAAA;;;;;;;;;;;;;;;;IA+1BA,OAAmB;eAAnB;;IA1jBgBA,mBAAmB;eAAnBA;;;;;gEAjSE;2BAEQ;+CACO;oCAEJ;8BACA;uBACC;6BACF;0BACH;2BAOlB;6BACkC;0BACV;2BACG;AA0MlC,8EAA8E;AAC9E,wEAAwE;AACxE,uDAAuD;AACvD,MAAMC,QAGJ,OAAOC,YAAY,aAAa,IAAIA,YAAY,IAAIC;AAEtD,0EAA0E;AAC1E,MAAMC,WACJ,OAAOC,yBAAyB,aAC5B,IAAIA,qBAAqBC,iBAAiB;IACxCC,YAAY;AACd,KACA;AAEN,SAASC,kBACPC,OAAwC,EACxCC,IAAY,EACZC,MAAyB,EACzBC,IAA2C;IAE3C,6DAA6D;IAC7D,IAAI,CAACH,SAAS;IAEd,IAAII,cAA0B;IAC9B,IAAI;QACFA,cAAcC,IAAAA,4BAAiB,EAACJ;QAChC,IAAIG,gBAAgB,MAAM;YACxB,0EAA0E;YAC1E,0BAA0B;YAC1B;QACF;IACF,EAAE,UAAM;QACN,mEAAmE;QACnE,4DAA4D;QAC5D,0EAA0E;QAC1E,wEAAwE;QACxE,gCAAgC;QAChC,MAAME,gBACJ,OAAOC,gBAAgB,aAAaA,cAAcC,QAAQC,KAAK;QACjEH,cACE,AAAC,sBAAmBL,OAAK;QAE3B;IACF;IAEA,MAAMS,WAAyB;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IACN;IAEA,6FAA6F;IAC7F,wFAAwF;IACxF,2EAA2E;IAC3E,IAAIyF,IAAAA,oBAAa,EAAC/E,KAAK;QACrB4E,WAAWhJ,IAAI,GAAGoE;IACpB,OAAO,IACL,CAAC+B,kBACDN,YACCwC,MAAMI,IAAI,KAAK,OAAO,CAAE,CAAA,UAAUJ,MAAM/C,KAAK,AAAD,GAC7C;QACA0D,WAAWhJ,IAAI,GAAGoJ,IAAAA,wBAAW,EAAChF;IAChC;IAEA,OAAO+B,+BACLrB,cAAK,CAACuE,YAAY,CAAChB,OAAOW,4BAE1B,qBAAC3C;QAAG,GAAGD,SAAS;QAAG,GAAG4C,UAAU;kBAC7BxD;;AAGP;MAGF,WAAeL"}
|
@@ -19,36 +19,44 @@ const _colors = require("../internal/styles/colors");
|
|
19
19
|
const _erroroverlay = require("../internal/components/errors/error-overlay/error-overlay");
|
20
20
|
const _devtoolsindicator = require("../internal/components/errors/dev-tools-indicator/dev-tools-indicator");
|
21
21
|
const _rendererror = require("../internal/container/runtime-error/render-error");
|
22
|
+
const _fontstyles = require("../font/font-styles");
|
22
23
|
function ReactDevOverlay(param) {
|
23
24
|
let { state, globalError, children } = param;
|
24
25
|
const [isErrorOverlayOpen, setIsErrorOverlayOpen] = (0, _react.useState)(false);
|
25
|
-
const devOverlay = /*#__PURE__*/ (0, _jsxruntime.jsxs)(
|
26
|
+
const devOverlay = /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
26
27
|
children: [
|
27
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
28
|
-
/*#__PURE__*/ (0, _jsxruntime.
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
children:
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
28
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_fontstyles.FontStyles, {}),
|
29
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_shadowportal.ShadowPortal, {
|
30
|
+
children: [
|
31
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_cssreset.CssReset, {}),
|
32
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_base.Base, {}),
|
33
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_colors.Colors, {}),
|
34
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_componentstyles.ComponentStyles, {}),
|
35
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_rendererror.RenderError, {
|
36
|
+
state: state,
|
37
|
+
isAppDir: true,
|
38
|
+
children: (param)=>{
|
39
|
+
let { runtimeErrors, totalErrorCount } = param;
|
40
|
+
const isBuildError = runtimeErrors.length === 0;
|
41
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
42
|
+
children: [
|
43
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_devtoolsindicator.DevToolsIndicator, {
|
44
|
+
state: state,
|
45
|
+
errorCount: totalErrorCount,
|
46
|
+
isBuildError: isBuildError,
|
47
|
+
setIsErrorOverlayOpen: setIsErrorOverlayOpen
|
48
|
+
}),
|
49
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_erroroverlay.ErrorOverlay, {
|
50
|
+
state: state,
|
51
|
+
runtimeErrors: runtimeErrors,
|
52
|
+
isErrorOverlayOpen: isErrorOverlayOpen,
|
53
|
+
setIsErrorOverlayOpen: setIsErrorOverlayOpen
|
54
|
+
})
|
55
|
+
]
|
56
|
+
});
|
57
|
+
}
|
58
|
+
})
|
59
|
+
]
|
52
60
|
})
|
53
61
|
]
|
54
62
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.tsx"],"sourcesContent":["import type { OverlayState } from '../../shared'\nimport type { GlobalErrorComponent } from '../../../error-boundary'\n\nimport { useState } from 'react'\nimport { DevOverlayErrorBoundary } from './error-boundary'\nimport { ShadowPortal } from '../internal/components/shadow-portal'\nimport { Base } from '../internal/styles/base'\nimport { ComponentStyles } from '../internal/styles/component-styles'\nimport { CssReset } from '../internal/styles/css-reset'\nimport { Colors } from '../internal/styles/colors'\nimport { ErrorOverlay } from '../internal/components/errors/error-overlay/error-overlay'\nimport { DevToolsIndicator } from '../internal/components/errors/dev-tools-indicator/dev-tools-indicator'\nimport { RenderError } from '../internal/container/runtime-error/render-error'\n\nexport default function ReactDevOverlay({\n state,\n globalError,\n children,\n}: {\n state: OverlayState\n globalError: [GlobalErrorComponent, React.ReactNode]\n children: React.ReactNode\n}) {\n const [isErrorOverlayOpen, setIsErrorOverlayOpen] = useState(false)\n\n const devOverlay = (\n <ShadowPortal>\n
|
1
|
+
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.tsx"],"sourcesContent":["import type { OverlayState } from '../../shared'\nimport type { GlobalErrorComponent } from '../../../error-boundary'\n\nimport { useState } from 'react'\nimport { DevOverlayErrorBoundary } from './error-boundary'\nimport { ShadowPortal } from '../internal/components/shadow-portal'\nimport { Base } from '../internal/styles/base'\nimport { ComponentStyles } from '../internal/styles/component-styles'\nimport { CssReset } from '../internal/styles/css-reset'\nimport { Colors } from '../internal/styles/colors'\nimport { ErrorOverlay } from '../internal/components/errors/error-overlay/error-overlay'\nimport { DevToolsIndicator } from '../internal/components/errors/dev-tools-indicator/dev-tools-indicator'\nimport { RenderError } from '../internal/container/runtime-error/render-error'\n\nimport { FontStyles } from '../font/font-styles'\n\nexport default function ReactDevOverlay({\n state,\n globalError,\n children,\n}: {\n state: OverlayState\n globalError: [GlobalErrorComponent, React.ReactNode]\n children: React.ReactNode\n}) {\n const [isErrorOverlayOpen, setIsErrorOverlayOpen] = useState(false)\n\n const devOverlay = (\n <>\n {/* Fonts can only be loaded outside the Shadow DOM. */}\n <FontStyles />\n <ShadowPortal>\n <CssReset />\n <Base />\n <Colors />\n <ComponentStyles />\n\n <RenderError state={state} isAppDir={true}>\n {({ runtimeErrors, totalErrorCount }) => {\n const isBuildError = runtimeErrors.length === 0\n return (\n <>\n <DevToolsIndicator\n state={state}\n errorCount={totalErrorCount}\n isBuildError={isBuildError}\n setIsErrorOverlayOpen={setIsErrorOverlayOpen}\n />\n\n <ErrorOverlay\n state={state}\n runtimeErrors={runtimeErrors}\n isErrorOverlayOpen={isErrorOverlayOpen}\n setIsErrorOverlayOpen={setIsErrorOverlayOpen}\n />\n </>\n )\n }}\n </RenderError>\n </ShadowPortal>\n </>\n )\n\n return (\n <DevOverlayErrorBoundary\n devOverlay={devOverlay}\n globalError={globalError}\n onError={setIsErrorOverlayOpen}\n >\n {children}\n </DevOverlayErrorBoundary>\n )\n}\n"],"names":["ReactDevOverlay","state","globalError","children","isErrorOverlayOpen","setIsErrorOverlayOpen","useState","devOverlay","FontStyles","ShadowPortal","CssReset","Base","Colors","ComponentStyles","RenderError","isAppDir","runtimeErrors","totalErrorCount","isBuildError","length","DevToolsIndicator","errorCount","ErrorOverlay","DevOverlayErrorBoundary","onError"],"mappings":";;;;+BAgBA;;;eAAwBA;;;;uBAbC;+BACe;8BACX;sBACR;iCACW;0BACP;wBACF;8BACM;mCACK;6BACN;4BAED;AAEZ,SAASA,gBAAgB,KAQvC;IARuC,IAAA,EACtCC,KAAK,EACLC,WAAW,EACXC,QAAQ,EAKT,GARuC;IAStC,MAAM,CAACC,oBAAoBC,sBAAsB,GAAGC,IAAAA,eAAQ,EAAC;IAE7D,MAAMC,2BACJ;;0BAEE,qBAACC,sBAAU;0BACX,sBAACC,0BAAY;;kCACX,qBAACC,kBAAQ;kCACT,qBAACC,UAAI;kCACL,qBAACC,cAAM;kCACP,qBAACC,gCAAe;kCAEhB,qBAACC,wBAAW;wBAACb,OAAOA;wBAAOc,UAAU;kCAClC;gCAAC,EAAEC,aAAa,EAAEC,eAAe,EAAE;4BAClC,MAAMC,eAAeF,cAAcG,MAAM,KAAK;4BAC9C,qBACE;;kDACE,qBAACC,oCAAiB;wCAChBnB,OAAOA;wCACPoB,YAAYJ;wCACZC,cAAcA;wCACdb,uBAAuBA;;kDAGzB,qBAACiB,0BAAY;wCACXrB,OAAOA;wCACPe,eAAeA;wCACfZ,oBAAoBA;wCACpBC,uBAAuBA;;;;wBAI/B;;;;;;IAMR,qBACE,qBAACkB,sCAAuB;QACtBhB,YAAYA;QACZL,aAAaA;QACbsB,SAASnB;kBAERF;;AAGP"}
|
package/dist/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react'\nimport type { OverlayState } from '../../shared'\n\nimport ReactDevOverlay from './react-dev-overlay'\nimport { ACTION_UNHANDLED_ERROR } from '../../shared'\n\n// @ts-expect-error\nimport imgApp from './app.png'\n\nconst meta: Meta<typeof ReactDevOverlay> = {\n component: ReactDevOverlay,\n parameters: {\n layout: 'fullscreen',\n },\n}\n\nexport default meta\ntype Story = StoryObj<typeof ReactDevOverlay>\n\nconst state: OverlayState = {\n nextId: 0,\n buildError: null,\n errors: [\n {\n id: 1,\n event: {\n type: ACTION_UNHANDLED_ERROR,\n reason: Object.assign(new Error('First error message'), {\n __NEXT_ERROR_CODE: 'E001',\n }),\n componentStackFrames: [\n {\n file: 'app/page.tsx',\n component: 'Home',\n lineNumber: 10,\n column: 5,\n canOpenInEditor: true,\n },\n ],\n frames: [\n {\n file: 'app/page.tsx',\n methodName: 'Home',\n arguments: [],\n lineNumber: 10,\n column: 5,\n },\n ],\n },\n },\n {\n id: 2,\n event: {\n type: ACTION_UNHANDLED_ERROR,\n reason: Object.assign(new Error('Second error message'), {\n __NEXT_ERROR_CODE: 'E002',\n }),\n frames: [],\n },\n },\n {\n id: 3,\n event: {\n type: ACTION_UNHANDLED_ERROR,\n reason: Object.assign(new Error('Third error message'), {\n __NEXT_ERROR_CODE: 'E003',\n }),\n frames: [],\n },\n },\n ],\n refreshState: { type: 'idle' },\n rootLayoutMissingTags: [],\n notFound: false,\n staticIndicator: false,\n debugInfo: { devtoolsFrontendUrl: undefined },\n versionInfo: {\n installed: '14.2.0',\n staleness: 'fresh',\n },\n}\n\nexport const Default: Story = {\n args: {\n state,\n children: (\n <div>\n <img\n src={imgApp}\n style={{\n width: '100%',\n height: '100%',\n objectFit: 'contain',\n }}\n />\n </div>\n ),\n },\n}\n"],"names":["Default","meta","component","ReactDevOverlay","parameters","layout","state","nextId","buildError","errors","id","event","type","ACTION_UNHANDLED_ERROR","reason","Object","assign","Error","__NEXT_ERROR_CODE","componentStackFrames","file","lineNumber","column","canOpenInEditor","frames","methodName","arguments","refreshState","rootLayoutMissingTags","notFound","staticIndicator","debugInfo","devtoolsFrontendUrl","undefined","versionInfo","installed","staleness","args","children","div","img","src","imgApp","style","width","height","objectFit"],"mappings":";;;;;;;;;;;;;;;
|
1
|
+
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/_experimental/app/react-dev-overlay.stories.tsx"],"sourcesContent":["import type { Meta, StoryObj } from '@storybook/react'\nimport type { OverlayState } from '../../shared'\n\nimport ReactDevOverlay from './react-dev-overlay'\nimport { ACTION_UNHANDLED_ERROR } from '../../shared'\n\n// @ts-expect-error\nimport imgApp from './app.png'\n\nconst meta: Meta<typeof ReactDevOverlay> = {\n component: ReactDevOverlay,\n parameters: {\n layout: 'fullscreen',\n },\n}\n\nexport default meta\ntype Story = StoryObj<typeof ReactDevOverlay>\n\nconst state: OverlayState = {\n nextId: 0,\n buildError: null,\n disableDevIndicator: false,\n errors: [\n {\n id: 1,\n event: {\n type: ACTION_UNHANDLED_ERROR,\n reason: Object.assign(new Error('First error message'), {\n __NEXT_ERROR_CODE: 'E001',\n }),\n componentStackFrames: [\n {\n file: 'app/page.tsx',\n component: 'Home',\n lineNumber: 10,\n column: 5,\n canOpenInEditor: true,\n },\n ],\n frames: [\n {\n file: 'app/page.tsx',\n methodName: 'Home',\n arguments: [],\n lineNumber: 10,\n column: 5,\n },\n ],\n },\n },\n {\n id: 2,\n event: {\n type: ACTION_UNHANDLED_ERROR,\n reason: Object.assign(new Error('Second error message'), {\n __NEXT_ERROR_CODE: 'E002',\n }),\n frames: [],\n },\n },\n {\n id: 3,\n event: {\n type: ACTION_UNHANDLED_ERROR,\n reason: Object.assign(new Error('Third error message'), {\n __NEXT_ERROR_CODE: 'E003',\n }),\n frames: [],\n },\n },\n ],\n refreshState: { type: 'idle' },\n rootLayoutMissingTags: [],\n notFound: false,\n staticIndicator: false,\n debugInfo: { devtoolsFrontendUrl: undefined },\n versionInfo: {\n installed: '14.2.0',\n staleness: 'fresh',\n },\n}\n\nexport const Default: Story = {\n args: {\n state,\n children: (\n <div>\n <img\n src={imgApp}\n style={{\n width: '100%',\n height: '100%',\n objectFit: 'contain',\n }}\n />\n </div>\n ),\n },\n}\n"],"names":["Default","meta","component","ReactDevOverlay","parameters","layout","state","nextId","buildError","disableDevIndicator","errors","id","event","type","ACTION_UNHANDLED_ERROR","reason","Object","assign","Error","__NEXT_ERROR_CODE","componentStackFrames","file","lineNumber","column","canOpenInEditor","frames","methodName","arguments","refreshState","rootLayoutMissingTags","notFound","staticIndicator","debugInfo","devtoolsFrontendUrl","undefined","versionInfo","installed","staleness","args","children","div","img","src","imgApp","style","width","height","objectFit"],"mappings":";;;;;;;;;;;;;;;IAmFaA,OAAO;eAAPA;;IAnEb,OAAmB;eAAnB;;;;;0EAb4B;wBACW;iEAGpB;AAEnB,MAAMC,OAAqC;IACzCC,WAAWC,wBAAe;IAC1BC,YAAY;QACVC,QAAQ;IACV;AACF;MAEA,WAAeJ;AAGf,MAAMK,QAAsB;IAC1BC,QAAQ;IACRC,YAAY;IACZC,qBAAqB;IACrBC,QAAQ;QACN;YACEC,IAAI;YACJC,OAAO;gBACLC,MAAMC,8BAAsB;gBAC5BC,QAAQC,OAAOC,MAAM,CAAC,IAAIC,MAAM,wBAAwB;oBACtDC,mBAAmB;gBACrB;gBACAC,sBAAsB;oBACpB;wBACEC,MAAM;wBACNnB,WAAW;wBACXoB,YAAY;wBACZC,QAAQ;wBACRC,iBAAiB;oBACnB;iBACD;gBACDC,QAAQ;oBACN;wBACEJ,MAAM;wBACNK,YAAY;wBACZC,WAAW,EAAE;wBACbL,YAAY;wBACZC,QAAQ;oBACV;iBACD;YACH;QACF;QACA;YACEZ,IAAI;YACJC,OAAO;gBACLC,MAAMC,8BAAsB;gBAC5BC,QAAQC,OAAOC,MAAM,CAAC,IAAIC,MAAM,yBAAyB;oBACvDC,mBAAmB;gBACrB;gBACAM,QAAQ,EAAE;YACZ;QACF;QACA;YACEd,IAAI;YACJC,OAAO;gBACLC,MAAMC,8BAAsB;gBAC5BC,QAAQC,OAAOC,MAAM,CAAC,IAAIC,MAAM,wBAAwB;oBACtDC,mBAAmB;gBACrB;gBACAM,QAAQ,EAAE;YACZ;QACF;KACD;IACDG,cAAc;QAAEf,MAAM;IAAO;IAC7BgB,uBAAuB,EAAE;IACzBC,UAAU;IACVC,iBAAiB;IACjBC,WAAW;QAAEC,qBAAqBC;IAAU;IAC5CC,aAAa;QACXC,WAAW;QACXC,WAAW;IACb;AACF;AAEO,MAAMrC,UAAiB;IAC5BsC,MAAM;QACJhC;QACAiC,wBACE,qBAACC;sBACC,cAAA,qBAACC;gBACCC,KAAKC,eAAM;gBACXC,OAAO;oBACLC,OAAO;oBACPC,QAAQ;oBACRC,WAAW;gBACb;;;IAIR;AACF"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const FontStyles: () => null;
|
@@ -0,0 +1,41 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "FontStyles", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return FontStyles;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _tagged_template_literal_loose = require("@swc/helpers/_/_tagged_template_literal_loose");
|
12
|
+
const _nooptemplate = require("../internal/helpers/noop-template");
|
13
|
+
const _react = require("react");
|
14
|
+
function _templateObject() {
|
15
|
+
const data = _tagged_template_literal_loose._([
|
16
|
+
"\n /* latin-ext */\n @font-face {\n font-family: 'Geist';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-latin-ext.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,\n U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,\n U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin-ext */\n @font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-mono-latin-ext.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,\n U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,\n U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'Geist';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-latin.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,\n U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,\n U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin */\n @font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-mono-latin.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,\n U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,\n U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n "
|
17
|
+
]);
|
18
|
+
_templateObject = function() {
|
19
|
+
return data;
|
20
|
+
};
|
21
|
+
return data;
|
22
|
+
}
|
23
|
+
const FontStyles = ()=>{
|
24
|
+
(0, _react.useInsertionEffect)(()=>{
|
25
|
+
const style = document.createElement('style');
|
26
|
+
style.textContent = (0, _nooptemplate.noop)(_templateObject());
|
27
|
+
document.head.appendChild(style);
|
28
|
+
return ()=>{
|
29
|
+
document.head.removeChild(style);
|
30
|
+
};
|
31
|
+
}, []);
|
32
|
+
return null;
|
33
|
+
};
|
34
|
+
|
35
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
36
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
37
|
+
Object.assign(exports.default, exports);
|
38
|
+
module.exports = exports.default;
|
39
|
+
}
|
40
|
+
|
41
|
+
//# sourceMappingURL=font-styles.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/_experimental/font/font-styles.tsx"],"sourcesContent":["import { noop as css } from '../internal/helpers/noop-template'\nimport { useInsertionEffect } from 'react'\n\nexport const FontStyles = () => {\n useInsertionEffect(() => {\n const style = document.createElement('style')\n style.textContent = css`\n /* latin-ext */\n @font-face {\n font-family: 'Geist';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-latin-ext.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,\n U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,\n U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin-ext */\n @font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-mono-latin-ext.woff2) format('woff2');\n unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7,\n U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F,\n U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F,\n U+A720-A7FF;\n }\n /* latin */\n @font-face {\n font-family: 'Geist';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-latin.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,\n U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,\n U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n /* latin */\n @font-face {\n font-family: 'Geist Mono';\n font-style: normal;\n font-weight: 400 600;\n font-display: swap;\n src: url(/__nextjs_font/geist-mono-latin.woff2) format('woff2');\n unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6,\n U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122,\n U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;\n }\n `\n document.head.appendChild(style)\n\n return () => {\n document.head.removeChild(style)\n }\n }, [])\n\n return null\n}\n"],"names":["FontStyles","useInsertionEffect","style","document","createElement","textContent","css","head","appendChild","removeChild"],"mappings":";;;;+BAGaA;;;eAAAA;;;;8BAHe;uBACO;;;;;;;;;;AAE5B,MAAMA,aAAa;IACxBC,IAAAA,yBAAkB,EAAC;QACjB,MAAMC,QAAQC,SAASC,aAAa,CAAC;QACrCF,MAAMG,WAAW,OAAGC,kBAAG;QAgDvBH,SAASI,IAAI,CAACC,WAAW,CAACN;QAE1B,OAAO;YACLC,SAASI,IAAI,CAACE,WAAW,CAACP;QAC5B;IACF,GAAG,EAAE;IAEL,OAAO;AACT"}
|
Binary file
|
Binary file
|
package/dist/client/components/react-dev-overlay/_experimental/font/geist-mono-latin-ext.woff2
ADDED
Binary file
|
Binary file
|
@@ -0,0 +1,72 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
3
|
+
value: true
|
4
|
+
});
|
5
|
+
Object.defineProperty(exports, "getDevOverlayFontMiddleware", {
|
6
|
+
enumerable: true,
|
7
|
+
get: function() {
|
8
|
+
return getDevOverlayFontMiddleware;
|
9
|
+
}
|
10
|
+
});
|
11
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
12
|
+
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
13
|
+
const _path = /*#__PURE__*/ _interop_require_default._(require("path"));
|
14
|
+
const _promises = /*#__PURE__*/ _interop_require_wildcard._(require("fs/promises"));
|
15
|
+
const _fs = require("fs");
|
16
|
+
const _log = /*#__PURE__*/ _interop_require_wildcard._(require("../../../../../build/output/log"));
|
17
|
+
const _middlewareresponse = require("../../server/middleware-response");
|
18
|
+
const FONT_PREFIX = '/__nextjs_font/';
|
19
|
+
const VALID_FONTS = [
|
20
|
+
'geist-latin-ext.woff2',
|
21
|
+
'geist-mono-latin-ext.woff2',
|
22
|
+
'geist-latin.woff2',
|
23
|
+
'geist-mono-latin.woff2'
|
24
|
+
];
|
25
|
+
const FONT_HEADERS = {
|
26
|
+
'Content-Type': 'font/woff2',
|
27
|
+
'Cache-Control': 'public, max-age=31536000, immutable'
|
28
|
+
};
|
29
|
+
function getDevOverlayFontMiddleware() {
|
30
|
+
return async function devOverlayFontMiddleware(req, res, next) {
|
31
|
+
try {
|
32
|
+
const { pathname } = new URL("http://n" + req.url);
|
33
|
+
if (!pathname.startsWith(FONT_PREFIX)) {
|
34
|
+
return next();
|
35
|
+
}
|
36
|
+
const fontFile = pathname.replace(FONT_PREFIX, '');
|
37
|
+
if (!VALID_FONTS.includes(fontFile)) {
|
38
|
+
return _middlewareresponse.middlewareResponse.notFound(res);
|
39
|
+
}
|
40
|
+
const fontPath = _path.default.resolve(__dirname, fontFile);
|
41
|
+
const fileExists = await checkFileExists(fontPath);
|
42
|
+
if (!fileExists) {
|
43
|
+
return _middlewareresponse.middlewareResponse.notFound(res);
|
44
|
+
}
|
45
|
+
const fontData = await _promises.readFile(fontPath);
|
46
|
+
Object.entries(FONT_HEADERS).forEach((param)=>{
|
47
|
+
let [key, value] = param;
|
48
|
+
res.setHeader(key, value);
|
49
|
+
});
|
50
|
+
res.end(fontData);
|
51
|
+
} catch (err) {
|
52
|
+
_log.error('Failed to serve font:', err instanceof Error ? err.message : err);
|
53
|
+
return _middlewareresponse.middlewareResponse.internalServerError(res);
|
54
|
+
}
|
55
|
+
};
|
56
|
+
}
|
57
|
+
async function checkFileExists(filePath) {
|
58
|
+
try {
|
59
|
+
await _promises.access(filePath, _fs.constants.F_OK);
|
60
|
+
return true;
|
61
|
+
} catch (e) {
|
62
|
+
return false;
|
63
|
+
}
|
64
|
+
}
|
65
|
+
|
66
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
67
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
68
|
+
Object.assign(exports.default, exports);
|
69
|
+
module.exports = exports.default;
|
70
|
+
}
|
71
|
+
|
72
|
+
//# sourceMappingURL=get-dev-overlay-font-middleware.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/client/components/react-dev-overlay/_experimental/font/get-dev-overlay-font-middleware.ts"],"sourcesContent":["import type { ServerResponse, IncomingMessage } from 'http'\nimport path from 'path'\nimport * as fs from 'fs/promises'\nimport { constants } from 'fs'\nimport * as Log from '../../../../../build/output/log'\nimport { middlewareResponse } from '../../server/middleware-response'\n\nconst FONT_PREFIX = '/__nextjs_font/'\n\nconst VALID_FONTS = [\n 'geist-latin-ext.woff2',\n 'geist-mono-latin-ext.woff2',\n 'geist-latin.woff2',\n 'geist-mono-latin.woff2',\n]\n\nconst FONT_HEADERS = {\n 'Content-Type': 'font/woff2',\n 'Cache-Control': 'public, max-age=31536000, immutable',\n} as const\n\nexport function getDevOverlayFontMiddleware() {\n return async function devOverlayFontMiddleware(\n req: IncomingMessage,\n res: ServerResponse,\n next: () => void\n ): Promise<void> {\n try {\n const { pathname } = new URL(`http://n${req.url}`)\n\n if (!pathname.startsWith(FONT_PREFIX)) {\n return next()\n }\n\n const fontFile = pathname.replace(FONT_PREFIX, '')\n if (!VALID_FONTS.includes(fontFile)) {\n return middlewareResponse.notFound(res)\n }\n\n const fontPath = path.resolve(__dirname, fontFile)\n const fileExists = await checkFileExists(fontPath)\n\n if (!fileExists) {\n return middlewareResponse.notFound(res)\n }\n\n const fontData = await fs.readFile(fontPath)\n Object.entries(FONT_HEADERS).forEach(([key, value]) => {\n res.setHeader(key, value)\n })\n res.end(fontData)\n } catch (err) {\n Log.error(\n 'Failed to serve font:',\n err instanceof Error ? err.message : err\n )\n return middlewareResponse.internalServerError(res)\n }\n }\n}\n\nasync function checkFileExists(filePath: string): Promise<boolean> {\n try {\n await fs.access(filePath, constants.F_OK)\n return true\n } catch {\n return false\n }\n}\n"],"names":["getDevOverlayFontMiddleware","FONT_PREFIX","VALID_FONTS","FONT_HEADERS","devOverlayFontMiddleware","req","res","next","pathname","URL","url","startsWith","fontFile","replace","includes","middlewareResponse","notFound","fontPath","path","resolve","__dirname","fileExists","checkFileExists","fontData","fs","readFile","Object","entries","forEach","key","value","setHeader","end","err","Log","error","Error","message","internalServerError","filePath","access","constants","F_OK"],"mappings":";;;;+BAqBgBA;;;eAAAA;;;;;+DApBC;oEACG;oBACM;+DACL;oCACc;AAEnC,MAAMC,cAAc;AAEpB,MAAMC,cAAc;IAClB;IACA;IACA;IACA;CACD;AAED,MAAMC,eAAe;IACnB,gBAAgB;IAChB,iBAAiB;AACnB;AAEO,SAASH;IACd,OAAO,eAAeI,yBACpBC,GAAoB,EACpBC,GAAmB,EACnBC,IAAgB;QAEhB,IAAI;YACF,MAAM,EAAEC,QAAQ,EAAE,GAAG,IAAIC,IAAI,AAAC,aAAUJ,IAAIK,GAAG;YAE/C,IAAI,CAACF,SAASG,UAAU,CAACV,cAAc;gBACrC,OAAOM;YACT;YAEA,MAAMK,WAAWJ,SAASK,OAAO,CAACZ,aAAa;YAC/C,IAAI,CAACC,YAAYY,QAAQ,CAACF,WAAW;gBACnC,OAAOG,sCAAkB,CAACC,QAAQ,CAACV;YACrC;YAEA,MAAMW,WAAWC,aAAI,CAACC,OAAO,CAACC,WAAWR;YACzC,MAAMS,aAAa,MAAMC,gBAAgBL;YAEzC,IAAI,CAACI,YAAY;gBACf,OAAON,sCAAkB,CAACC,QAAQ,CAACV;YACrC;YAEA,MAAMiB,WAAW,MAAMC,UAAGC,QAAQ,CAACR;YACnCS,OAAOC,OAAO,CAACxB,cAAcyB,OAAO,CAAC;oBAAC,CAACC,KAAKC,MAAM;gBAChDxB,IAAIyB,SAAS,CAACF,KAAKC;YACrB;YACAxB,IAAI0B,GAAG,CAACT;QACV,EAAE,OAAOU,KAAK;YACZC,KAAIC,KAAK,CACP,yBACAF,eAAeG,QAAQH,IAAII,OAAO,GAAGJ;YAEvC,OAAOlB,sCAAkB,CAACuB,mBAAmB,CAAChC;QAChD;IACF;AACF;AAEA,eAAegB,gBAAgBiB,QAAgB;IAC7C,IAAI;QACF,MAAMf,UAAGgB,MAAM,CAACD,UAAUE,aAAS,CAACC,IAAI;QACxC,OAAO;IACT,EAAE,UAAM;QACN,OAAO;IACT;AACF"}
|
@@ -34,7 +34,7 @@ const _external = require("../../icons/external");
|
|
34
34
|
const _file = require("../../icons/file");
|
35
35
|
function _templateObject() {
|
36
36
|
const data = _tagged_template_literal_loose._([
|
37
|
-
"\n [data-nextjs-codeframe] {\n background-color: var(--color-background-200);\n overflow: hidden;\n color: var(--color-gray-1000);\n text-overflow: ellipsis;\n border: 1px solid var(--color-gray-400);\n border-radius: 8px;\n font-family: var(--font-stack-monospace);\n font-size: 12px;\n line-height: 16px;\n margin: var(--size-2) 0;\n }\n\n .code-frame-link,\n .code-frame-pre {\n padding: 12px;\n }\n\n .code-frame-pre {\n white-space: pre-wrap;\n }\n\n .code-frame-header {\n width: 100%;\n cursor: pointer;\n transition: background 100ms ease-out;\n border-radius: 8px 8px 0 0;\n border-bottom: 1px solid var(--color-gray-400);\n\n &:focus-visible {\n outline: var(--focus-ring);\n outline-offset: -2px;\n }\n\n &:hover {\n background: var(--color-gray-100);\n }\n }\n\n
|
37
|
+
"\n [data-nextjs-codeframe] {\n background-color: var(--color-background-200);\n overflow: hidden;\n color: var(--color-gray-1000);\n text-overflow: ellipsis;\n border: 1px solid var(--color-gray-400);\n border-radius: 8px;\n font-family: var(--font-stack-monospace);\n font-size: 12px;\n line-height: 16px;\n margin: var(--size-2) 0;\n }\n\n .code-frame-link,\n .code-frame-pre {\n padding: 12px;\n }\n\n .code-frame-link svg {\n flex-shrink: 0;\n }\n\n .code-frame-link [data-text] {\n display: inline-flex;\n text-align: left;\n margin: auto 6px;\n }\n\n .code-frame-pre {\n white-space: pre-wrap;\n }\n\n .code-frame-header {\n width: 100%;\n cursor: pointer;\n transition: background 100ms ease-out;\n border-radius: 8px 8px 0 0;\n border-bottom: 1px solid var(--color-gray-400);\n\n &:focus-visible {\n outline: var(--focus-ring);\n outline-offset: -2px;\n }\n\n &:hover {\n background: var(--color-gray-100);\n }\n }\n\n [data-nextjs-codeframe]::selection,\n [data-nextjs-codeframe] *::selection {\n background-color: var(--color-ansi-selection);\n }\n\n [data-nextjs-codeframe] * {\n color: inherit;\n background-color: transparent;\n font-family: var(--font-stack-monospace);\n }\n\n [data-nextjs-codeframe] > * {\n margin: 0;\n }\n\n .code-frame-link {\n display: flex;\n margin: 0;\n outline: 0;\n }\n .code-frame-link [data-icon='right'] {\n margin-left: auto;\n }\n\n [data-nextjs-codeframe] div > pre {\n overflow: hidden;\n display: inline-block;\n }\n\n [data-nextjs-codeframe] svg {\n color: var(--color-gray-900);\n }\n"
|
38
38
|
]);
|
39
39
|
_templateObject = function() {
|
40
40
|
return data;
|
@@ -84,12 +84,16 @@ function CodeFrame(param) {
|
|
84
84
|
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("p", {
|
85
85
|
className: "code-frame-link",
|
86
86
|
children: [
|
87
|
-
/*#__PURE__*/ (0, _jsxruntime.
|
87
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
88
88
|
className: "code-frame-icon",
|
89
|
+
"data-icon": "left",
|
90
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_file.FileIcon, {
|
91
|
+
lang: fileExtension
|
92
|
+
})
|
93
|
+
}),
|
94
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)("span", {
|
95
|
+
"data-text": true,
|
89
96
|
children: [
|
90
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_file.FileIcon, {
|
91
|
-
lang: fileExtension
|
92
|
-
}),
|
93
97
|
(0, _stackframe.getFrameSource)(stackFrame),
|
94
98
|
" @",
|
95
99
|
' ',
|
@@ -98,9 +102,13 @@ function CodeFrame(param) {
|
|
98
102
|
})
|
99
103
|
]
|
100
104
|
}),
|
101
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(
|
102
|
-
|
103
|
-
|
105
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
106
|
+
className: "code-frame-icon",
|
107
|
+
"data-icon": "right",
|
108
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_external.ExternalIcon, {
|
109
|
+
width: 16,
|
110
|
+
height: 16
|
111
|
+
})
|
104
112
|
})
|
105
113
|
]
|
106
114
|
})
|