vinext 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rolldown/runtime.js +1 -1
- package/dist/build/action-owner-manifest.d.ts +3 -2
- package/dist/build/action-owner-manifest.js +18 -2
- package/dist/build/app-page-static-eligibility.d.ts +17 -1
- package/dist/build/app-page-static-eligibility.js +80 -13
- package/dist/build/clean-output.d.ts +2 -1
- package/dist/build/client-build-config.d.ts +13 -3
- package/dist/build/client-build-config.js +46 -9
- package/dist/build/client-reference-async.d.ts +48 -0
- package/dist/build/client-reference-async.js +123 -0
- package/dist/build/client-reference-chunks.d.ts +32 -0
- package/dist/build/client-reference-chunks.js +111 -0
- package/dist/build/client-reference-groups.d.ts +9 -1
- package/dist/build/client-reference-groups.js +40 -2
- package/dist/build/css-url-assets.d.ts +2 -1
- package/dist/build/google-fonts/fallback-metrics.d.ts +2 -1
- package/dist/build/google-fonts/find-font-files-in-css.d.ts +1 -0
- package/dist/build/google-fonts/find-font-files-in-css.js +17 -4
- package/dist/build/google-fonts/font-metadata.d.ts +2 -1
- package/dist/build/google-fonts/validate.d.ts +2 -1
- package/dist/build/inline-css.d.ts +2 -1
- package/dist/build/layout-classification.d.ts +2 -1
- package/dist/build/module-dependency-cache.d.ts +2 -1
- package/dist/build/next-client-runtime-manifests.d.ts +2 -1
- package/dist/build/precompress.d.ts +2 -1
- package/dist/build/precompress.js +1 -1
- package/dist/build/prerender-paths.d.ts +2 -1
- package/dist/build/prerender-phase.d.ts +2 -1
- package/dist/build/prerender-server-pool.js +1 -1
- package/dist/build/prerender.d.ts +3 -2
- package/dist/build/prerender.js +5 -4
- package/dist/build/report.d.ts +2 -1
- package/dist/build/route-classification-injector.d.ts +2 -1
- package/dist/build/route-classification-manifest.d.ts +2 -1
- package/dist/build/run-prerender.d.ts +2 -1
- package/dist/build/server-actions-encryption-key.d.ts +2 -1
- package/dist/build/ssr-manifest.js +25 -2
- package/dist/build/standalone.d.ts +2 -1
- package/dist/cache/cache-adapters-virtual.d.ts +2 -1
- package/dist/cache.js +1 -2
- package/dist/check.d.ts +2 -1
- package/dist/check.js +4 -0
- package/dist/cli-args.d.ts +2 -1
- package/dist/cli.js +2 -0
- package/dist/client/client-redirect-matcher.js +2 -1
- package/dist/client/client-redirects.d.ts +4 -3
- package/dist/client/client-redirects.js +2 -1
- package/dist/client/client-rewrites.d.ts +2 -1
- package/dist/client/dev-error-overlay-store.d.ts +2 -1
- package/dist/client/index.js +1 -2
- package/dist/client/instrumentation-client-state.js +5 -5
- package/dist/client/navigation-runtime.d.ts +3 -1
- package/dist/client/navigation-runtime.js +1 -1
- package/dist/client/pages-router-link-navigation.d.ts +2 -1
- package/dist/client/vinext-next-data.d.ts +25 -1
- package/dist/client/window-next.d.ts +2 -1
- package/dist/config/config-matchers.d.ts +12 -1
- package/dist/config/config-matchers.js +111 -16
- package/dist/config/dotenv.d.ts +2 -1
- package/dist/config/next-config.d.ts +13 -1
- package/dist/config/next-config.js +29 -4
- package/dist/config/tsconfig-paths.d.ts +2 -1
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/detector.js +23 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/index.js +2 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/lookup.js +25 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/bmp.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/cur.js +15 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/dds.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/gif.js +12 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/heif.js +55 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/icns.js +76 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ico.js +39 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/index.js +46 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/j2c.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jp2.js +21 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jpg.js +71 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl-stream.js +42 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/jxl.js +46 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/ktx.js +19 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/png.js +28 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/pnm.js +54 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/psd.js +11 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/svg.js +79 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tga.js +15 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/tiff.js +96 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/utils.js +53 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/types/webp.js +45 -0
- package/dist/deps/.pnpm/image-size@2.0.4/deps/image-size/dist/esm/utils/bit-reader.js +38 -0
- package/dist/deps/.pnpm/ua-parser-js@1.0.35/deps/ua-parser-js/src/ua-parser.js +2 -2
- package/dist/entries/app-browser-entry.d.ts +20 -5
- package/dist/entries/app-browser-entry.js +79 -6
- package/dist/entries/app-rsc-entry.d.ts +2 -1
- package/dist/entries/app-rsc-entry.js +42 -12
- package/dist/entries/app-rsc-manifest.d.ts +2 -1
- package/dist/entries/app-rsc-manifest.js +53 -0
- package/dist/entries/pages-entry-helpers.js +1 -2
- package/dist/entries/pages-server-entry.d.ts +2 -1
- package/dist/entries/pages-server-entry.js +1 -1
- package/dist/entries/runtime-entry-module.d.ts +1 -0
- package/dist/entries/runtime-entry-module.js +4 -1
- package/dist/image/image-adapters-virtual.d.ts +2 -1
- package/dist/index.js +102 -34
- package/dist/plugins/client-compile-hints.d.ts +30 -0
- package/dist/plugins/client-compile-hints.js +88 -0
- package/dist/plugins/client-reference-dedup.d.ts +2 -1
- package/dist/plugins/cloudflare-dev-module-urls.d.ts +2 -1
- package/dist/plugins/dynamic-preload-metadata.d.ts +3 -1
- package/dist/plugins/dynamic-preload-metadata.js +1 -1
- package/dist/plugins/environment.d.ts +2 -1
- package/dist/plugins/fonts.js +9 -12
- package/dist/plugins/ignore-dynamic-requests.d.ts +2 -1
- package/dist/plugins/import-meta-url.d.ts +2 -1
- package/dist/plugins/og-assets.d.ts +2 -1
- package/dist/plugins/og-assets.js +2 -3
- package/dist/plugins/optimize-imports.d.ts +2 -1
- package/dist/plugins/pages-node-externals.d.ts +2 -1
- package/dist/plugins/remove-console.d.ts +2 -1
- package/dist/plugins/require-condition-resolution.d.ts +2 -1
- package/dist/plugins/rsc-client-reference-loaders.d.ts +8 -0
- package/dist/plugins/rsc-client-reference-loaders.js +170 -68
- package/dist/plugins/rsc-client-shim-excludes.js +2 -0
- package/dist/plugins/sass.d.ts +2 -1
- package/dist/plugins/strip-server-exports.d.ts +2 -1
- package/dist/plugins/styled-jsx.d.ts +2 -1
- package/dist/plugins/transform-result.d.ts +2 -1
- package/dist/plugins/typeof-window.d.ts +2 -1
- package/dist/plugins/worker-image-imports.js +1 -1
- package/dist/plugins/worker-use-server.d.ts +2 -1
- package/dist/routing/app-route-graph.d.ts +40 -0
- package/dist/routing/app-route-graph.js +122 -50
- package/dist/routing/browser-route-manifest.d.ts +2 -1
- package/dist/routing/optimistic-route-trie.d.ts +2 -1
- package/dist/routing/route-matching.d.ts +2 -1
- package/dist/routing/route-pattern.d.ts +2 -1
- package/dist/server/accept-encoding.d.ts +2 -1
- package/dist/server/app-action-forwarding.d.ts +2 -1
- package/dist/server/app-bfcache-identity.d.ts +2 -1
- package/dist/server/app-browser-action-result.d.ts +2 -1
- package/dist/server/app-browser-client-reuse-manifest.d.ts +2 -1
- package/dist/server/app-browser-entry.js +30 -6
- package/dist/server/app-browser-error.d.ts +2 -1
- package/dist/server/app-browser-history-controller.d.ts +2 -1
- package/dist/server/app-browser-hydration.d.ts +2 -1
- package/dist/server/app-browser-interception-context.d.ts +2 -1
- package/dist/server/app-browser-navigation-controller.js +15 -10
- package/dist/server/app-browser-popstate.d.ts +2 -1
- package/dist/server/app-browser-rsc-redirect.d.ts +2 -1
- package/dist/server/app-browser-server-action-client.d.ts +2 -1
- package/dist/server/app-browser-state.js +1 -1
- package/dist/server/app-browser-stream.d.ts +2 -1
- package/dist/server/app-browser-visible-commit.d.ts +2 -1
- package/dist/server/app-client-reference-manifest.d.ts +31 -0
- package/dist/server/app-client-reference-manifest.js +46 -0
- package/dist/server/app-client-reference-preloader.d.ts +25 -5
- package/dist/server/app-client-reference-preloader.js +22 -7
- package/dist/server/app-elements-wire.d.ts +2 -1
- package/dist/server/app-elements.d.ts +2 -0
- package/dist/server/app-elements.js +3 -1
- package/dist/server/app-fallback-renderer.d.ts +9 -2
- package/dist/server/app-fallback-renderer.js +4 -1
- package/dist/server/app-history-state.d.ts +2 -1
- package/dist/server/app-inline-css-client.d.ts +2 -1
- package/dist/server/app-layout-param-observation.d.ts +2 -1
- package/dist/server/app-metadata-tracing.d.ts +2 -1
- package/dist/server/app-optimistic-routing.d.ts +18 -1
- package/dist/server/app-optimistic-routing.js +34 -1
- package/dist/server/app-page-boundary-render.d.ts +20 -2
- package/dist/server/app-page-boundary-render.js +221 -38
- package/dist/server/app-page-boundary.d.ts +34 -5
- package/dist/server/app-page-boundary.js +40 -7
- package/dist/server/app-page-cache-finalizer.d.ts +2 -1
- package/dist/server/app-page-cache-finalizer.js +1 -1
- package/dist/server/app-page-cache-render.d.ts +10 -2
- package/dist/server/app-page-cache-render.js +14 -2
- package/dist/server/app-page-cache.js +2 -2
- package/dist/server/app-page-dispatch.d.ts +34 -1
- package/dist/server/app-page-dispatch.js +163 -34
- package/dist/server/app-page-element-builder.d.ts +17 -1
- package/dist/server/app-page-element-builder.js +187 -66
- package/dist/server/app-page-execution.d.ts +28 -1
- package/dist/server/app-page-execution.js +114 -5
- package/dist/server/app-page-head.d.ts +95 -3
- package/dist/server/app-page-head.js +307 -152
- package/dist/server/app-page-http-access-fallback-metadata.d.ts +48 -2
- package/dist/server/app-page-http-access-fallback-metadata.js +76 -1
- package/dist/server/app-page-method.d.ts +2 -1
- package/dist/server/app-page-probe.d.ts +2 -1
- package/dist/server/app-page-render-identity.d.ts +2 -1
- package/dist/server/app-page-render.d.ts +7 -1
- package/dist/server/app-page-render.js +35 -10
- package/dist/server/app-page-request.d.ts +14 -1
- package/dist/server/app-page-request.js +1 -1
- package/dist/server/app-page-route-wiring.d.ts +52 -2
- package/dist/server/app-page-route-wiring.js +197 -47
- package/dist/server/app-page-rsc-render-status.d.ts +2 -1
- package/dist/server/app-page-search-params-observation.d.ts +7 -2
- package/dist/server/app-page-search-params-observation.js +8 -1
- package/dist/server/app-page-segment-plan.d.ts +2 -1
- package/dist/server/app-page-stream.d.ts +31 -1
- package/dist/server/app-page-stream.js +23 -4
- package/dist/server/app-pages-bridge.d.ts +2 -1
- package/dist/server/app-ppr-fallback-shell-render.d.ts +2 -1
- package/dist/server/app-ppr-fallback-shell.d.ts +2 -1
- package/dist/server/app-prerender-endpoints.d.ts +2 -1
- package/dist/server/app-prerender-static-params.d.ts +2 -1
- package/dist/server/app-render-dependency.d.ts +11 -1
- package/dist/server/app-render-dependency.js +26 -7
- package/dist/server/app-request-stage-independent-entry.d.ts +2 -1
- package/dist/server/app-response-stage-entry.d.ts +2 -1
- package/dist/server/app-route-handler-cache.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.d.ts +2 -1
- package/dist/server/app-route-handler-dispatch.js +1 -1
- package/dist/server/app-route-handler-execution.d.ts +2 -1
- package/dist/server/app-route-handler-response.d.ts +2 -1
- package/dist/server/app-route-handler-runtime.d.ts +2 -1
- package/dist/server/app-route-module-loader.d.ts +18 -1
- package/dist/server/app-route-module-loader.js +8 -0
- package/dist/server/app-route-tree-prefetch.d.ts +2 -1
- package/dist/server/app-rsc-error-handler.d.ts +2 -1
- package/dist/server/app-rsc-errors.d.ts +2 -1
- package/dist/server/app-rsc-handler.d.ts +2 -1
- package/dist/server/app-rsc-handler.js +6 -10
- package/dist/server/app-rsc-response-finalizer.d.ts +2 -1
- package/dist/server/app-rsc-route-matching.d.ts +38 -1
- package/dist/server/app-rsc-route-matching.js +24 -0
- package/dist/server/app-segment-config.d.ts +2 -1
- package/dist/server/app-segment-config.js +1 -14
- package/dist/server/app-server-action-execution.d.ts +2 -1
- package/dist/server/app-server-action-execution.js +3 -3
- package/dist/server/app-ssr-entry.d.ts +6 -0
- package/dist/server/app-ssr-entry.js +91 -44
- package/dist/server/app-ssr-error-meta.d.ts +2 -1
- package/dist/server/app-ssr-search-params-gate.d.ts +2 -1
- package/dist/server/app-ssr-stream.d.ts +22 -10
- package/dist/server/app-ssr-stream.js +299 -67
- package/dist/server/app-static-generation.d.ts +2 -1
- package/dist/server/app-streamed-client-references.d.ts +39 -0
- package/dist/server/app-streamed-client-references.js +156 -0
- package/dist/server/app-visited-response-cache.d.ts +2 -1
- package/dist/server/app-worker-stages.d.ts +2 -1
- package/dist/server/artifact-compatibility.d.ts +2 -1
- package/dist/server/bfcache-identity.d.ts +2 -1
- package/dist/server/cache-headers.d.ts +2 -1
- package/dist/server/cacheability-request.d.ts +2 -1
- package/dist/server/client-reuse-manifest.d.ts +2 -1
- package/dist/server/config-headers.d.ts +2 -1
- package/dist/server/csp.d.ts +2 -1
- package/dist/server/default-global-not-found-module.d.ts +2 -1
- package/dist/server/default-http-access-fallback-modules.d.ts +33 -0
- package/dist/server/default-http-access-fallback-modules.js +31 -0
- package/dist/server/defer-until-stream-consumed.d.ts +34 -0
- package/dist/server/defer-until-stream-consumed.js +154 -21
- package/dist/server/dev-lockfile.d.ts +32 -2
- package/dist/server/dev-lockfile.js +46 -2
- package/dist/server/dev-module-runner.d.ts +2 -1
- package/dist/server/dev-server.js +10 -3
- package/dist/server/fetch-handler.js +1 -2
- package/dist/server/file-based-metadata.d.ts +2 -1
- package/dist/server/framework-tracer.d.ts +2 -1
- package/dist/server/html.d.ts +1 -0
- package/dist/server/html.js +19 -1
- package/dist/server/http-conditional.d.ts +2 -1
- package/dist/server/http-error-responses.d.ts +2 -1
- package/dist/server/implicit-tags.d.ts +2 -1
- package/dist/server/metadata-route-build-data.d.ts +2 -1
- package/dist/server/metadata-route-build-data.js +1 -1
- package/dist/server/metadata-route-response.d.ts +2 -1
- package/dist/server/metadata-route-response.js +1 -1
- package/dist/server/metadata-routes.d.ts +2 -1
- package/dist/server/middleware-runtime.d.ts +2 -1
- package/dist/server/navigation-trace.d.ts +2 -1
- package/dist/server/next-error-digest.d.ts +2 -1
- package/dist/server/nitro-public-files-plugin.d.ts +2 -1
- package/dist/server/nitro-public-files.d.ts +2 -1
- package/dist/server/opentelemetry-api.d.ts +2 -1
- package/dist/server/operation-token.d.ts +2 -1
- package/dist/server/pages-api-route.d.ts +2 -1
- package/dist/server/pages-asset-tags.d.ts +2 -1
- package/dist/server/pages-body-parser-config.d.ts +2 -1
- package/dist/server/pages-client-assets.d.ts +4 -0
- package/dist/server/pages-data-route.d.ts +2 -1
- package/dist/server/pages-document-asset-props.d.ts +2 -1
- package/dist/server/pages-document-initial-props.d.ts +2 -1
- package/dist/server/pages-execution-tracing.d.ts +2 -1
- package/dist/server/pages-execution-tracing.js +1 -1
- package/dist/server/pages-get-initial-props.d.ts +2 -1
- package/dist/server/pages-page-data.d.ts +7 -1
- package/dist/server/pages-page-data.js +35 -12
- package/dist/server/pages-page-handler.d.ts +3 -2
- package/dist/server/pages-page-handler.js +16 -7
- package/dist/server/pages-page-method.d.ts +2 -1
- package/dist/server/pages-page-response.d.ts +2 -1
- package/dist/server/pages-preview.d.ts +2 -1
- package/dist/server/pages-readiness.d.ts +2 -1
- package/dist/server/pages-request-pipeline.d.ts +2 -1
- package/dist/server/pages-request-pipeline.js +4 -5
- package/dist/server/pages-request-stage-entry.d.ts +2 -1
- package/dist/server/pages-response-stage-entry.d.ts +2 -1
- package/dist/server/pages-route-data-kind.d.ts +2 -1
- package/dist/server/prerender-cache-life-header.d.ts +2 -1
- package/dist/server/prerender-route-params.d.ts +2 -1
- package/dist/server/prod-server.js +9 -3
- package/dist/server/request-log.d.ts +2 -1
- package/dist/server/request-tracing.d.ts +2 -1
- package/dist/server/request-tracing.js +1 -1
- package/dist/server/response-start-tracing.js +7 -29
- package/dist/server/rsc-render-stream.d.ts +4 -0
- package/dist/server/rsc-render-stream.js +25 -0
- package/dist/server/seed-cache.d.ts +2 -1
- package/dist/server/seed-cache.js +1 -1
- package/dist/server/static-file-cache.d.ts +2 -1
- package/dist/server/static-file-cache.js +1 -0
- package/dist/server/static-layout-client-reuse-proof.d.ts +2 -1
- package/dist/server/worker-revalidation-context.d.ts +2 -1
- package/dist/server/worker-stages.d.ts +2 -1
- package/dist/shims/app.d.ts +2 -1
- package/dist/shims/cache-callable-runtime.d.ts +2 -1
- package/dist/shims/cache-handler.d.ts +8 -3
- package/dist/shims/cache-handler.js +29 -9
- package/dist/shims/caught-not-found-boundaries.d.ts +15 -0
- package/dist/shims/caught-not-found-boundaries.js +48 -0
- package/dist/shims/cdn-purge-routes.d.ts +2 -1
- package/dist/shims/client-locale.js +2 -1
- package/dist/shims/client-page-root.d.ts +2 -1
- package/dist/shims/config.d.ts +2 -1
- package/dist/shims/default-forbidden.d.ts +4 -0
- package/dist/shims/default-forbidden.js +18 -0
- package/dist/shims/default-not-found.d.ts +0 -5
- package/dist/shims/default-not-found.js +5 -41
- package/dist/shims/default-unauthorized.d.ts +4 -0
- package/dist/shims/default-unauthorized.js +18 -0
- package/dist/shims/error-boundary.d.ts +39 -3
- package/dist/shims/error-boundary.js +31 -16
- package/dist/shims/font-google.js +1 -2
- package/dist/shims/font-utils.d.ts +3 -2
- package/dist/shims/font-utils.js +5 -3
- package/dist/shims/form.js +1 -1
- package/dist/shims/http-access-error-fallback.d.ts +7 -0
- package/dist/shims/http-access-error-fallback.js +47 -0
- package/dist/shims/image.d.ts +1 -22
- package/dist/shims/internal/app-prefetch-fetch-queue.d.ts +22 -2
- package/dist/shims/internal/app-prefetch-fetch-queue.js +71 -18
- package/dist/shims/internal/app-route-prefetch-policy.d.ts +14 -3
- package/dist/shims/internal/app-route-prefetch-policy.js +29 -4
- package/dist/shims/internal/cache-context-accessor.d.ts +2 -1
- package/dist/shims/internal/client-reference-loader.d.ts +7 -0
- package/dist/shims/internal/client-reference-loader.js +91 -0
- package/dist/shims/internal/cookie-serialize.d.ts +2 -1
- package/dist/shims/internal/cookies.js +1 -2
- package/dist/shims/internal/headers-state.d.ts +2 -0
- package/dist/shims/internal/headers-state.js +6 -1
- package/dist/shims/internal/hybrid-client-route-owner-direct.d.ts +2 -1
- package/dist/shims/internal/interpolate-as.d.ts +2 -1
- package/dist/shims/internal/pages-data-target.d.ts +2 -1
- package/dist/shims/internal/pages-data-url.d.ts +2 -1
- package/dist/shims/internal/thenable-well-known-properties.d.ts +2 -1
- package/dist/shims/link.js +195 -52
- package/dist/shims/metadata.d.ts +32 -11
- package/dist/shims/metadata.js +88 -26
- package/dist/shims/navigation-errors.d.ts +2 -1
- package/dist/shims/navigation.d.ts +22 -2
- package/dist/shims/navigation.js +74 -20
- package/dist/shims/pages-router-runtime.d.ts +2 -1
- package/dist/shims/ppr-fallback-shell.d.ts +2 -1
- package/dist/shims/router.js +14 -3
- package/dist/shims/unified-request-context.js +3 -3
- package/dist/typegen.d.ts +2 -1
- package/dist/utils/client-build-manifest.d.ts +4 -1
- package/dist/utils/client-build-manifest.js +9 -2
- package/dist/utils/client-entry-manifest.d.ts +13 -0
- package/dist/utils/client-entry-manifest.js +20 -1
- package/dist/utils/client-reference-chunks.d.ts +45 -0
- package/dist/utils/client-reference-chunks.js +30 -0
- package/dist/utils/client-runtime-metadata.d.ts +9 -1
- package/dist/utils/client-runtime-metadata.js +40 -9
- package/dist/utils/compare.d.ts +9 -0
- package/dist/utils/compare.js +15 -1
- package/dist/utils/lazy-chunks.d.ts +14 -0
- package/dist/utils/lazy-chunks.js +27 -1
- package/dist/utils/middleware-request-headers.d.ts +2 -1
- package/dist/utils/project.d.ts +2 -1
- package/dist/utils/project.js +9 -1
- package/dist/utils/query.d.ts +2 -1
- package/dist/utils/sorted-array.d.ts +2 -1
- package/dist/utils/vite-cli-invocation.d.ts +2 -1
- package/package.json +5 -5
- package/dist/deps/.pnpm/image-size@2.0.2/deps/image-size/dist/index.js +0 -808
- package/dist/server/default-not-found-module.d.ts +0 -19
- package/dist/server/default-not-found-module.js +0 -18
- package/dist/server/rsc-stream-hints.d.ts +0 -21
- package/dist/server/rsc-stream-hints.js +0 -227
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { readUInt16LE } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/ico.js
|
|
3
|
+
const TYPE_ICON = 1;
|
|
4
|
+
const SIZE_HEADER = 6;
|
|
5
|
+
const SIZE_IMAGE_ENTRY = 16;
|
|
6
|
+
function getSizeFromOffset(input, offset) {
|
|
7
|
+
const value = input[offset];
|
|
8
|
+
return value === 0 ? 256 : value;
|
|
9
|
+
}
|
|
10
|
+
function getImageSize(input, imageIndex) {
|
|
11
|
+
const offset = SIZE_HEADER + imageIndex * SIZE_IMAGE_ENTRY;
|
|
12
|
+
return {
|
|
13
|
+
height: getSizeFromOffset(input, offset + 1),
|
|
14
|
+
width: getSizeFromOffset(input, offset)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
const ICO = {
|
|
18
|
+
validate(input) {
|
|
19
|
+
const reserved = readUInt16LE(input, 0);
|
|
20
|
+
const imageCount = readUInt16LE(input, 4);
|
|
21
|
+
if (reserved !== 0 || imageCount === 0) return false;
|
|
22
|
+
return readUInt16LE(input, 2) === TYPE_ICON;
|
|
23
|
+
},
|
|
24
|
+
calculate(input) {
|
|
25
|
+
const nbImages = readUInt16LE(input, 4);
|
|
26
|
+
if (SIZE_HEADER + nbImages * SIZE_IMAGE_ENTRY > input.length) throw new TypeError("Invalid ICO");
|
|
27
|
+
const imageSize = getImageSize(input, 0);
|
|
28
|
+
if (nbImages === 1) return imageSize;
|
|
29
|
+
const images = [];
|
|
30
|
+
for (let imageIndex = 0; imageIndex < nbImages; imageIndex += 1) images.push(getImageSize(input, imageIndex));
|
|
31
|
+
return {
|
|
32
|
+
width: imageSize.width,
|
|
33
|
+
height: imageSize.height,
|
|
34
|
+
images
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
//#endregion
|
|
39
|
+
export { ICO };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { BMP } from "./bmp.js";
|
|
2
|
+
import { ICO } from "./ico.js";
|
|
3
|
+
import { CUR } from "./cur.js";
|
|
4
|
+
import { DDS } from "./dds.js";
|
|
5
|
+
import { GIF } from "./gif.js";
|
|
6
|
+
import { HEIF } from "./heif.js";
|
|
7
|
+
import { ICNS } from "./icns.js";
|
|
8
|
+
import { J2C } from "./j2c.js";
|
|
9
|
+
import { JP2 } from "./jp2.js";
|
|
10
|
+
import { JPG } from "./jpg.js";
|
|
11
|
+
import { JXLStream } from "./jxl-stream.js";
|
|
12
|
+
import { JXL } from "./jxl.js";
|
|
13
|
+
import { KTX } from "./ktx.js";
|
|
14
|
+
import { PNG } from "./png.js";
|
|
15
|
+
import { PNM } from "./pnm.js";
|
|
16
|
+
import { PSD } from "./psd.js";
|
|
17
|
+
import { SVG } from "./svg.js";
|
|
18
|
+
import { TGA } from "./tga.js";
|
|
19
|
+
import { TIFF } from "./tiff.js";
|
|
20
|
+
import { WEBP } from "./webp.js";
|
|
21
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/index.js
|
|
22
|
+
const typeHandlers = /* @__PURE__ */ new Map([
|
|
23
|
+
["bmp", BMP],
|
|
24
|
+
["cur", CUR],
|
|
25
|
+
["dds", DDS],
|
|
26
|
+
["gif", GIF],
|
|
27
|
+
["heif", HEIF],
|
|
28
|
+
["icns", ICNS],
|
|
29
|
+
["ico", ICO],
|
|
30
|
+
["j2c", J2C],
|
|
31
|
+
["jp2", JP2],
|
|
32
|
+
["jpg", JPG],
|
|
33
|
+
["jxl", JXL],
|
|
34
|
+
["jxl-stream", JXLStream],
|
|
35
|
+
["ktx", KTX],
|
|
36
|
+
["png", PNG],
|
|
37
|
+
["pnm", PNM],
|
|
38
|
+
["psd", PSD],
|
|
39
|
+
["svg", SVG],
|
|
40
|
+
["tga", TGA],
|
|
41
|
+
["tiff", TIFF],
|
|
42
|
+
["webp", WEBP]
|
|
43
|
+
]);
|
|
44
|
+
const types = Array.from(typeHandlers.keys());
|
|
45
|
+
//#endregion
|
|
46
|
+
export { typeHandlers, types };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { readUInt32BE } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/j2c.js
|
|
3
|
+
const J2C = {
|
|
4
|
+
validate: (input) => readUInt32BE(input, 0) === 4283432785,
|
|
5
|
+
calculate: (input) => ({
|
|
6
|
+
height: readUInt32BE(input, 12),
|
|
7
|
+
width: readUInt32BE(input, 8)
|
|
8
|
+
})
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { J2C };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { findBox, readUInt32BE, toUTF8String } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/jp2.js
|
|
3
|
+
const JP2 = {
|
|
4
|
+
validate(input) {
|
|
5
|
+
if (toUTF8String(input, 4, 8) !== "jP ") return false;
|
|
6
|
+
const ftypBox = findBox(input, "ftyp", 0);
|
|
7
|
+
if (!ftypBox) return false;
|
|
8
|
+
return toUTF8String(input, ftypBox.offset + 8, ftypBox.offset + 12) === "jp2 ";
|
|
9
|
+
},
|
|
10
|
+
calculate(input) {
|
|
11
|
+
const jp2hBox = findBox(input, "jp2h", 0);
|
|
12
|
+
const ihdrBox = jp2hBox && findBox(input, "ihdr", jp2hBox.offset + 8);
|
|
13
|
+
if (ihdrBox) return {
|
|
14
|
+
height: readUInt32BE(input, ihdrBox.offset + 8),
|
|
15
|
+
width: readUInt32BE(input, ihdrBox.offset + 12)
|
|
16
|
+
};
|
|
17
|
+
throw new TypeError("Unsupported JPEG 2000 format");
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { JP2 };
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { readUInt, readUInt16BE, toHexString } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/jpg.js
|
|
3
|
+
const EXIF_MARKER = "45786966";
|
|
4
|
+
const APP1_DATA_SIZE_BYTES = 2;
|
|
5
|
+
const EXIF_HEADER_BYTES = 6;
|
|
6
|
+
const BIG_ENDIAN_BYTE_ALIGN = "4d4d";
|
|
7
|
+
const LITTLE_ENDIAN_BYTE_ALIGN = "4949";
|
|
8
|
+
const IDF_ENTRY_BYTES = 12;
|
|
9
|
+
function isEXIF(input) {
|
|
10
|
+
return toHexString(input, 2, 6) === EXIF_MARKER;
|
|
11
|
+
}
|
|
12
|
+
function extractSize(input, index) {
|
|
13
|
+
return {
|
|
14
|
+
height: readUInt16BE(input, index),
|
|
15
|
+
width: readUInt16BE(input, index + 2)
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
function extractOrientation(exifBlock, isBigEndian) {
|
|
19
|
+
const idfDirectoryEntries = readUInt(exifBlock, 16, 14, isBigEndian);
|
|
20
|
+
for (let directoryEntryNumber = 0; directoryEntryNumber < idfDirectoryEntries; directoryEntryNumber++) {
|
|
21
|
+
const start = 16 + directoryEntryNumber * IDF_ENTRY_BYTES;
|
|
22
|
+
const end = start + IDF_ENTRY_BYTES;
|
|
23
|
+
if (start > exifBlock.length) return;
|
|
24
|
+
const block = exifBlock.slice(start, end);
|
|
25
|
+
if (readUInt(block, 16, 0, isBigEndian) === 274) {
|
|
26
|
+
if (readUInt(block, 16, 2, isBigEndian) !== 3) return;
|
|
27
|
+
if (readUInt(block, 32, 4, isBigEndian) !== 1) return;
|
|
28
|
+
return readUInt(block, 16, 8, isBigEndian);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function validateExifBlock(input, index) {
|
|
33
|
+
const exifBlock = input.slice(APP1_DATA_SIZE_BYTES, index);
|
|
34
|
+
const byteAlign = toHexString(exifBlock, EXIF_HEADER_BYTES, 8);
|
|
35
|
+
const isBigEndian = byteAlign === BIG_ENDIAN_BYTE_ALIGN;
|
|
36
|
+
if (isBigEndian || byteAlign === LITTLE_ENDIAN_BYTE_ALIGN) return extractOrientation(exifBlock, isBigEndian);
|
|
37
|
+
}
|
|
38
|
+
function validateInput(input, index) {
|
|
39
|
+
if (index > input.length) throw new TypeError("Corrupt JPG, exceeded buffer limits");
|
|
40
|
+
}
|
|
41
|
+
const JPG = {
|
|
42
|
+
validate: (input) => toHexString(input, 0, 2) === "ffd8",
|
|
43
|
+
calculate(_input) {
|
|
44
|
+
let input = _input.slice(4);
|
|
45
|
+
let orientation;
|
|
46
|
+
let next;
|
|
47
|
+
while (input.length) {
|
|
48
|
+
const i = readUInt16BE(input, 0);
|
|
49
|
+
validateInput(input, i);
|
|
50
|
+
if (input[i] !== 255) {
|
|
51
|
+
input = input.slice(1);
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (isEXIF(input)) orientation = validateExifBlock(input, i);
|
|
55
|
+
next = input[i + 1];
|
|
56
|
+
if (next === 192 || next === 193 || next === 194) {
|
|
57
|
+
const size = extractSize(input, i + 5);
|
|
58
|
+
if (!orientation) return size;
|
|
59
|
+
return {
|
|
60
|
+
height: size.height,
|
|
61
|
+
orientation,
|
|
62
|
+
width: size.width
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
input = input.slice(i + 2);
|
|
66
|
+
}
|
|
67
|
+
throw new TypeError("Invalid JPG, no size found");
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
export { JPG };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { toHexString } from "./utils.js";
|
|
2
|
+
import { BitReader } from "../utils/bit-reader.js";
|
|
3
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/jxl-stream.js
|
|
4
|
+
function calculateImageDimension(reader, isSmallImage) {
|
|
5
|
+
if (isSmallImage) return 8 * (1 + reader.getBits(5));
|
|
6
|
+
const extraBits = [
|
|
7
|
+
9,
|
|
8
|
+
13,
|
|
9
|
+
18,
|
|
10
|
+
30
|
|
11
|
+
][reader.getBits(2)];
|
|
12
|
+
return 1 + reader.getBits(extraBits);
|
|
13
|
+
}
|
|
14
|
+
function calculateImageWidth(reader, isSmallImage, widthMode, height) {
|
|
15
|
+
if (isSmallImage && widthMode === 0) return 8 * (1 + reader.getBits(5));
|
|
16
|
+
if (widthMode === 0) return calculateImageDimension(reader, false);
|
|
17
|
+
return Math.floor(height * [
|
|
18
|
+
1,
|
|
19
|
+
1.2,
|
|
20
|
+
4 / 3,
|
|
21
|
+
1.5,
|
|
22
|
+
16 / 9,
|
|
23
|
+
5 / 4,
|
|
24
|
+
2
|
|
25
|
+
][widthMode - 1]);
|
|
26
|
+
}
|
|
27
|
+
const JXLStream = {
|
|
28
|
+
validate: (input) => {
|
|
29
|
+
return toHexString(input, 0, 2) === "ff0a";
|
|
30
|
+
},
|
|
31
|
+
calculate(input) {
|
|
32
|
+
const reader = new BitReader(input, "little-endian");
|
|
33
|
+
const isSmallImage = reader.getBits(1) === 1;
|
|
34
|
+
const height = calculateImageDimension(reader, isSmallImage);
|
|
35
|
+
return {
|
|
36
|
+
width: calculateImageWidth(reader, isSmallImage, reader.getBits(3), height),
|
|
37
|
+
height
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { JXLStream };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { findBox, toUTF8String } from "./utils.js";
|
|
2
|
+
import { JXLStream } from "./jxl-stream.js";
|
|
3
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/jxl.js
|
|
4
|
+
function extractCodestream(input) {
|
|
5
|
+
const jxlcBox = findBox(input, "jxlc", 0);
|
|
6
|
+
if (jxlcBox) return input.slice(jxlcBox.offset + 8, jxlcBox.offset + jxlcBox.size);
|
|
7
|
+
const partialStreams = extractPartialStreams(input);
|
|
8
|
+
if (partialStreams.length > 0) return concatenateCodestreams(partialStreams);
|
|
9
|
+
}
|
|
10
|
+
function extractPartialStreams(input) {
|
|
11
|
+
const partialStreams = [];
|
|
12
|
+
let offset = 0;
|
|
13
|
+
while (offset < input.length) {
|
|
14
|
+
const jxlpBox = findBox(input, "jxlp", offset);
|
|
15
|
+
if (!jxlpBox) break;
|
|
16
|
+
if (jxlpBox.size < 12) throw new TypeError("Invalid JXL");
|
|
17
|
+
partialStreams.push(input.slice(jxlpBox.offset + 12, jxlpBox.offset + jxlpBox.size));
|
|
18
|
+
offset = jxlpBox.offset + jxlpBox.size;
|
|
19
|
+
}
|
|
20
|
+
return partialStreams;
|
|
21
|
+
}
|
|
22
|
+
function concatenateCodestreams(partialCodestreams) {
|
|
23
|
+
const totalLength = partialCodestreams.reduce((acc, curr) => acc + curr.length, 0);
|
|
24
|
+
const codestream = new Uint8Array(totalLength);
|
|
25
|
+
let position = 0;
|
|
26
|
+
for (const partial of partialCodestreams) {
|
|
27
|
+
codestream.set(partial, position);
|
|
28
|
+
position += partial.length;
|
|
29
|
+
}
|
|
30
|
+
return codestream;
|
|
31
|
+
}
|
|
32
|
+
const JXL = {
|
|
33
|
+
validate: (input) => {
|
|
34
|
+
if (toUTF8String(input, 4, 8) !== "JXL ") return false;
|
|
35
|
+
const ftypBox = findBox(input, "ftyp", 0);
|
|
36
|
+
if (!ftypBox) return false;
|
|
37
|
+
return toUTF8String(input, ftypBox.offset + 8, ftypBox.offset + 12) === "jxl ";
|
|
38
|
+
},
|
|
39
|
+
calculate(input) {
|
|
40
|
+
const codestream = extractCodestream(input);
|
|
41
|
+
if (codestream) return JXLStream.calculate(codestream);
|
|
42
|
+
throw new TypeError("Invalid JXL");
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { JXL };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { readUInt32LE, toUTF8String } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/ktx.js
|
|
3
|
+
const KTX = {
|
|
4
|
+
validate: (input) => {
|
|
5
|
+
const signature = toUTF8String(input, 1, 7);
|
|
6
|
+
return ["KTX 11", "KTX 20"].includes(signature);
|
|
7
|
+
},
|
|
8
|
+
calculate: (input) => {
|
|
9
|
+
const type = input[5] === 49 ? "ktx" : "ktx2";
|
|
10
|
+
const offset = type === "ktx" ? 36 : 20;
|
|
11
|
+
return {
|
|
12
|
+
height: readUInt32LE(input, offset + 4),
|
|
13
|
+
width: readUInt32LE(input, offset),
|
|
14
|
+
type
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { KTX };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { readUInt32BE, toUTF8String } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/png.js
|
|
3
|
+
const pngSignature = "PNG\r\n\n";
|
|
4
|
+
const pngImageHeaderChunkName = "IHDR";
|
|
5
|
+
const pngFriedChunkName = "CgBI";
|
|
6
|
+
const PNG = {
|
|
7
|
+
validate(input) {
|
|
8
|
+
if (pngSignature === toUTF8String(input, 1, 8)) {
|
|
9
|
+
let chunkName = toUTF8String(input, 12, 16);
|
|
10
|
+
if (chunkName === pngFriedChunkName) chunkName = toUTF8String(input, 28, 32);
|
|
11
|
+
if (chunkName !== pngImageHeaderChunkName) throw new TypeError("Invalid PNG");
|
|
12
|
+
return true;
|
|
13
|
+
}
|
|
14
|
+
return false;
|
|
15
|
+
},
|
|
16
|
+
calculate(input) {
|
|
17
|
+
if (toUTF8String(input, 12, 16) === pngFriedChunkName) return {
|
|
18
|
+
height: readUInt32BE(input, 36),
|
|
19
|
+
width: readUInt32BE(input, 32)
|
|
20
|
+
};
|
|
21
|
+
return {
|
|
22
|
+
height: readUInt32BE(input, 20),
|
|
23
|
+
width: readUInt32BE(input, 16)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
//#endregion
|
|
28
|
+
export { PNG };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { toUTF8String } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/pnm.js
|
|
3
|
+
const PNMTypes = {
|
|
4
|
+
P1: "pbm/ascii",
|
|
5
|
+
P2: "pgm/ascii",
|
|
6
|
+
P3: "ppm/ascii",
|
|
7
|
+
P4: "pbm",
|
|
8
|
+
P5: "pgm",
|
|
9
|
+
P6: "ppm",
|
|
10
|
+
P7: "pam",
|
|
11
|
+
PF: "pfm"
|
|
12
|
+
};
|
|
13
|
+
const handlers = {
|
|
14
|
+
default: (lines) => {
|
|
15
|
+
let dimensions = [];
|
|
16
|
+
while (lines.length > 0) {
|
|
17
|
+
const line = lines.shift();
|
|
18
|
+
if (line[0] === "#") continue;
|
|
19
|
+
dimensions = line.split(" ");
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
if (dimensions.length === 2) return {
|
|
23
|
+
height: Number.parseInt(dimensions[1], 10),
|
|
24
|
+
width: Number.parseInt(dimensions[0], 10)
|
|
25
|
+
};
|
|
26
|
+
throw new TypeError("Invalid PNM");
|
|
27
|
+
},
|
|
28
|
+
pam: (lines) => {
|
|
29
|
+
const size = {};
|
|
30
|
+
while (lines.length > 0) {
|
|
31
|
+
const line = lines.shift();
|
|
32
|
+
if (line.length > 16 || line.charCodeAt(0) > 128) continue;
|
|
33
|
+
const [key, value] = line.split(" ");
|
|
34
|
+
if (key && value) size[key.toLowerCase()] = Number.parseInt(value, 10);
|
|
35
|
+
if (size.height && size.width) break;
|
|
36
|
+
}
|
|
37
|
+
if (size.height && size.width) return {
|
|
38
|
+
height: size.height,
|
|
39
|
+
width: size.width
|
|
40
|
+
};
|
|
41
|
+
throw new TypeError("Invalid PAM");
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const PNM = {
|
|
45
|
+
validate: (input) => toUTF8String(input, 0, 2) in PNMTypes,
|
|
46
|
+
calculate(input) {
|
|
47
|
+
const signature = toUTF8String(input, 0, 2);
|
|
48
|
+
const type = PNMTypes[signature];
|
|
49
|
+
const lines = toUTF8String(input, 3).split(/[\r\n]+/);
|
|
50
|
+
return (handlers[type] || handlers.default)(lines);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { PNM };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { readUInt32BE, toUTF8String } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/psd.js
|
|
3
|
+
const PSD = {
|
|
4
|
+
validate: (input) => toUTF8String(input, 0, 4) === "8BPS",
|
|
5
|
+
calculate: (input) => ({
|
|
6
|
+
height: readUInt32BE(input, 14),
|
|
7
|
+
width: readUInt32BE(input, 18)
|
|
8
|
+
})
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { PSD };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { toUTF8String } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/svg.js
|
|
3
|
+
const svgReg = /<svg\s([^>"']|"[^"]*"|'[^']*')*>/;
|
|
4
|
+
const extractorRegExps = {
|
|
5
|
+
height: /\sheight=(['"])([^%]+?)\1/,
|
|
6
|
+
root: svgReg,
|
|
7
|
+
viewbox: /\sviewBox=(['"])(.+?)\1/i,
|
|
8
|
+
width: /\swidth=(['"])([^%]+?)\1/
|
|
9
|
+
};
|
|
10
|
+
const INCH_CM = 2.54;
|
|
11
|
+
const units = {
|
|
12
|
+
in: 96,
|
|
13
|
+
cm: 96 / INCH_CM,
|
|
14
|
+
em: 16,
|
|
15
|
+
ex: 8,
|
|
16
|
+
m: 96 / INCH_CM * 100,
|
|
17
|
+
mm: 96 / INCH_CM / 10,
|
|
18
|
+
pc: 96 / 72 / 12,
|
|
19
|
+
pt: 96 / 72,
|
|
20
|
+
px: 1
|
|
21
|
+
};
|
|
22
|
+
const unitsReg = new RegExp(`^([0-9.]+(?:e\\d+)?)(${Object.keys(units).join("|")})?$`);
|
|
23
|
+
function parseLength(len) {
|
|
24
|
+
const m = unitsReg.exec(len);
|
|
25
|
+
if (!m) return;
|
|
26
|
+
return Math.round(Number(m[1]) * (units[m[2]] || 1));
|
|
27
|
+
}
|
|
28
|
+
function parseViewbox(viewbox) {
|
|
29
|
+
const bounds = viewbox.split(" ");
|
|
30
|
+
return {
|
|
31
|
+
height: parseLength(bounds[3]),
|
|
32
|
+
width: parseLength(bounds[2])
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function parseAttributes(root) {
|
|
36
|
+
const width = root.match(extractorRegExps.width);
|
|
37
|
+
const height = root.match(extractorRegExps.height);
|
|
38
|
+
const viewbox = root.match(extractorRegExps.viewbox);
|
|
39
|
+
return {
|
|
40
|
+
height: height && parseLength(height[2]),
|
|
41
|
+
viewbox: viewbox && parseViewbox(viewbox[2]),
|
|
42
|
+
width: width && parseLength(width[2])
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function calculateByDimensions(attrs) {
|
|
46
|
+
return {
|
|
47
|
+
height: attrs.height,
|
|
48
|
+
width: attrs.width
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function calculateByViewbox(attrs, viewbox) {
|
|
52
|
+
const ratio = viewbox.width / viewbox.height;
|
|
53
|
+
if (attrs.width) return {
|
|
54
|
+
height: Math.floor(attrs.width / ratio),
|
|
55
|
+
width: attrs.width
|
|
56
|
+
};
|
|
57
|
+
if (attrs.height) return {
|
|
58
|
+
height: attrs.height,
|
|
59
|
+
width: Math.floor(attrs.height * ratio)
|
|
60
|
+
};
|
|
61
|
+
return {
|
|
62
|
+
height: viewbox.height,
|
|
63
|
+
width: viewbox.width
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const SVG = {
|
|
67
|
+
validate: (input) => svgReg.test(toUTF8String(input, 0, 1e3)),
|
|
68
|
+
calculate(input) {
|
|
69
|
+
const root = toUTF8String(input).match(extractorRegExps.root);
|
|
70
|
+
if (root) {
|
|
71
|
+
const attrs = parseAttributes(root[0]);
|
|
72
|
+
if (attrs.width && attrs.height) return calculateByDimensions(attrs);
|
|
73
|
+
if (attrs.viewbox) return calculateByViewbox(attrs, attrs.viewbox);
|
|
74
|
+
}
|
|
75
|
+
throw new TypeError("Invalid SVG");
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
export { SVG };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { readUInt16LE } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/tga.js
|
|
3
|
+
const TGA = {
|
|
4
|
+
validate(input) {
|
|
5
|
+
return readUInt16LE(input, 0) === 0 && readUInt16LE(input, 4) === 0;
|
|
6
|
+
},
|
|
7
|
+
calculate(input) {
|
|
8
|
+
return {
|
|
9
|
+
height: readUInt16LE(input, 14),
|
|
10
|
+
width: readUInt16LE(input, 12)
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { TGA };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { readUInt, readUInt64, toHexString, toUTF8String } from "./utils.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/tiff.js
|
|
3
|
+
const CONSTANTS = {
|
|
4
|
+
TAG: {
|
|
5
|
+
WIDTH: 256,
|
|
6
|
+
HEIGHT: 257,
|
|
7
|
+
COMPRESSION: 259
|
|
8
|
+
},
|
|
9
|
+
TYPE: {
|
|
10
|
+
SHORT: 3,
|
|
11
|
+
LONG: 4,
|
|
12
|
+
LONG8: 16
|
|
13
|
+
},
|
|
14
|
+
ENTRY_SIZE: {
|
|
15
|
+
STANDARD: 12,
|
|
16
|
+
BIG: 20
|
|
17
|
+
},
|
|
18
|
+
COUNT_SIZE: {
|
|
19
|
+
STANDARD: 2,
|
|
20
|
+
BIG: 8
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
function readIFD(input, { isBigEndian, isBigTiff }) {
|
|
24
|
+
const ifdOffset = isBigTiff ? Number(readUInt64(input, 8, isBigEndian)) : readUInt(input, 32, 4, isBigEndian);
|
|
25
|
+
const entryCountSize = isBigTiff ? CONSTANTS.COUNT_SIZE.BIG : CONSTANTS.COUNT_SIZE.STANDARD;
|
|
26
|
+
return input.slice(ifdOffset + entryCountSize);
|
|
27
|
+
}
|
|
28
|
+
function readTagValue(input, type, offset, isBigEndian) {
|
|
29
|
+
switch (type) {
|
|
30
|
+
case CONSTANTS.TYPE.SHORT: return readUInt(input, 16, offset, isBigEndian);
|
|
31
|
+
case CONSTANTS.TYPE.LONG: return readUInt(input, 32, offset, isBigEndian);
|
|
32
|
+
case CONSTANTS.TYPE.LONG8: {
|
|
33
|
+
const value = Number(readUInt64(input, offset, isBigEndian));
|
|
34
|
+
if (value > Number.MAX_SAFE_INTEGER) throw new TypeError("Value too large");
|
|
35
|
+
return value;
|
|
36
|
+
}
|
|
37
|
+
default: return 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function nextTag(input, isBigTiff) {
|
|
41
|
+
const entrySize = isBigTiff ? CONSTANTS.ENTRY_SIZE.BIG : CONSTANTS.ENTRY_SIZE.STANDARD;
|
|
42
|
+
if (input.length > entrySize) return input.slice(entrySize);
|
|
43
|
+
}
|
|
44
|
+
function extractTags(input, { isBigEndian, isBigTiff }) {
|
|
45
|
+
const tags = {};
|
|
46
|
+
let temp = input;
|
|
47
|
+
while (temp?.length) {
|
|
48
|
+
const code = readUInt(temp, 16, 0, isBigEndian);
|
|
49
|
+
const type = readUInt(temp, 16, 2, isBigEndian);
|
|
50
|
+
const length = isBigTiff ? Number(readUInt64(temp, 4, isBigEndian)) : readUInt(temp, 32, 4, isBigEndian);
|
|
51
|
+
if (code === 0) break;
|
|
52
|
+
if (length === 1 && (type === CONSTANTS.TYPE.SHORT || type === CONSTANTS.TYPE.LONG || isBigTiff && type === CONSTANTS.TYPE.LONG8)) tags[code] = readTagValue(temp, type, isBigTiff ? 12 : 8, isBigEndian);
|
|
53
|
+
temp = nextTag(temp, isBigTiff);
|
|
54
|
+
}
|
|
55
|
+
return tags;
|
|
56
|
+
}
|
|
57
|
+
function determineFormat(input) {
|
|
58
|
+
const signature = toUTF8String(input, 0, 2);
|
|
59
|
+
const version = readUInt(input, 16, 2, signature === "MM");
|
|
60
|
+
return {
|
|
61
|
+
isBigEndian: signature === "MM",
|
|
62
|
+
isBigTiff: version === 43
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
function validateBigTIFFHeader(input, isBigEndian) {
|
|
66
|
+
const byteSize = readUInt(input, 16, 4, isBigEndian);
|
|
67
|
+
const reserved = readUInt(input, 16, 6, isBigEndian);
|
|
68
|
+
if (byteSize !== 8 || reserved !== 0) throw new TypeError("Invalid BigTIFF header");
|
|
69
|
+
}
|
|
70
|
+
const signatures = /* @__PURE__ */ new Set([
|
|
71
|
+
"49492a00",
|
|
72
|
+
"4d4d002a",
|
|
73
|
+
"49492b00",
|
|
74
|
+
"4d4d002b"
|
|
75
|
+
]);
|
|
76
|
+
const TIFF = {
|
|
77
|
+
validate: (input) => {
|
|
78
|
+
const signature = toHexString(input, 0, 4);
|
|
79
|
+
return signatures.has(signature);
|
|
80
|
+
},
|
|
81
|
+
calculate(input) {
|
|
82
|
+
const format = determineFormat(input);
|
|
83
|
+
if (format.isBigTiff) validateBigTIFFHeader(input, format.isBigEndian);
|
|
84
|
+
const tags = extractTags(readIFD(input, format), format);
|
|
85
|
+
const info = {
|
|
86
|
+
height: tags[CONSTANTS.TAG.HEIGHT],
|
|
87
|
+
width: tags[CONSTANTS.TAG.WIDTH],
|
|
88
|
+
type: format.isBigTiff ? "bigtiff" : "tiff"
|
|
89
|
+
};
|
|
90
|
+
if (tags[CONSTANTS.TAG.COMPRESSION]) info.compression = tags[CONSTANTS.TAG.COMPRESSION];
|
|
91
|
+
if (!info.width || !info.height) throw new TypeError("Invalid Tiff. Missing tags");
|
|
92
|
+
return info;
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
//#endregion
|
|
96
|
+
export { TIFF };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
//#region ../../node_modules/.pnpm/image-size@2.0.4/node_modules/image-size/dist/esm/types/utils.js
|
|
2
|
+
const decoder = new TextDecoder();
|
|
3
|
+
const toUTF8String = (input, start = 0, end = input.length) => decoder.decode(input.slice(start, end));
|
|
4
|
+
const toHexString = (input, start = 0, end = input.length) => input.slice(start, end).reduce((memo, i) => memo + `0${i.toString(16)}`.slice(-2), "");
|
|
5
|
+
const getView = (input, offset) => new DataView(input.buffer, input.byteOffset + offset);
|
|
6
|
+
const readInt16LE = (input, offset = 0) => getView(input, offset).getInt16(0, true);
|
|
7
|
+
const readUInt16BE = (input, offset = 0) => getView(input, offset).getUint16(0, false);
|
|
8
|
+
const readUInt16LE = (input, offset = 0) => getView(input, offset).getUint16(0, true);
|
|
9
|
+
const readUInt24LE = (input, offset = 0) => {
|
|
10
|
+
const view = getView(input, offset);
|
|
11
|
+
return view.getUint16(0, true) + (view.getUint8(2) << 16);
|
|
12
|
+
};
|
|
13
|
+
const readInt32LE = (input, offset = 0) => getView(input, offset).getInt32(0, true);
|
|
14
|
+
const readUInt32BE = (input, offset = 0) => getView(input, offset).getUint32(0, false);
|
|
15
|
+
const readUInt32LE = (input, offset = 0) => getView(input, offset).getUint32(0, true);
|
|
16
|
+
const readUInt64 = (input, offset, isBigEndian) => getView(input, offset).getBigUint64(0, !isBigEndian);
|
|
17
|
+
const methods = {
|
|
18
|
+
readUInt16BE,
|
|
19
|
+
readUInt16LE,
|
|
20
|
+
readUInt32BE,
|
|
21
|
+
readUInt32LE
|
|
22
|
+
};
|
|
23
|
+
function readUInt(input, bits, offset = 0, isBigEndian = false) {
|
|
24
|
+
const methodName = `readUInt${bits}${isBigEndian ? "BE" : "LE"}`;
|
|
25
|
+
return methods[methodName](input, offset);
|
|
26
|
+
}
|
|
27
|
+
const BOX_HEADER_SIZE = 8;
|
|
28
|
+
function readBox(input, offset) {
|
|
29
|
+
if (input.length - offset < BOX_HEADER_SIZE) return void 0;
|
|
30
|
+
const boxSize = readUInt32BE(input, offset);
|
|
31
|
+
if (input.length - offset < boxSize) return void 0;
|
|
32
|
+
return {
|
|
33
|
+
name: toUTF8String(input, 4 + offset, 8 + offset),
|
|
34
|
+
offset,
|
|
35
|
+
size: boxSize
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function findBox(input, boxName, startOffset) {
|
|
39
|
+
let currentOffset = startOffset;
|
|
40
|
+
while (currentOffset < input.length) {
|
|
41
|
+
if (input.length - currentOffset < 4) break;
|
|
42
|
+
if (readUInt32BE(input, currentOffset) < BOX_HEADER_SIZE) {
|
|
43
|
+
currentOffset += BOX_HEADER_SIZE;
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
const box = readBox(input, currentOffset);
|
|
47
|
+
if (!box) break;
|
|
48
|
+
if (box.name === boxName) return box;
|
|
49
|
+
currentOffset += box.size;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
//#endregion
|
|
53
|
+
export { findBox, readInt16LE, readInt32LE, readUInt, readUInt16BE, readUInt16LE, readUInt24LE, readUInt32BE, readUInt32LE, readUInt64, toHexString, toUTF8String };
|