lkd-web-kit 0.7.9 → 0.7.11
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/___vite-browser-external.cjs +12 -0
- package/dist/_virtual/___vite-browser-external.js +6 -0
- package/dist/_virtual/__vite-browser-external.cjs +5 -0
- package/dist/_virtual/__vite-browser-external.js +3 -0
- package/dist/_virtual/_commonjsHelpers.cjs +34 -0
- package/dist/_virtual/_commonjsHelpers.js +30 -0
- package/dist/_virtual/_interop_require_default.cjs +7 -0
- package/dist/_virtual/_interop_require_default.js +3 -0
- package/dist/_virtual/_interop_require_wildcard.cjs +7 -0
- package/dist/_virtual/_interop_require_wildcard.js +3 -0
- package/dist/_virtual/add-base-path.cjs +7 -0
- package/dist/_virtual/add-base-path.js +3 -0
- package/dist/_virtual/add-locale.cjs +7 -0
- package/dist/_virtual/add-locale.js +3 -0
- package/dist/_virtual/add-locale2.cjs +7 -0
- package/dist/_virtual/add-locale2.js +3 -0
- package/dist/_virtual/add-path-prefix.cjs +7 -0
- package/dist/_virtual/add-path-prefix.js +3 -0
- package/dist/_virtual/add-path-suffix.cjs +7 -0
- package/dist/_virtual/add-path-suffix.js +3 -0
- package/dist/_virtual/app-paths.cjs +7 -0
- package/dist/_virtual/app-paths.js +3 -0
- package/dist/_virtual/bloom-filter.cjs +7 -0
- package/dist/_virtual/bloom-filter.js +3 -0
- package/dist/_virtual/compare-states.cjs +7 -0
- package/dist/_virtual/compare-states.js +3 -0
- package/dist/_virtual/constants.cjs +7 -0
- package/dist/_virtual/constants.js +3 -0
- package/dist/_virtual/denormalize-page-path.cjs +7 -0
- package/dist/_virtual/denormalize-page-path.js +3 -0
- package/dist/_virtual/deployment-id.cjs +7 -0
- package/dist/_virtual/deployment-id.js +3 -0
- package/dist/_virtual/detect-domain-locale.cjs +7 -0
- package/dist/_virtual/detect-domain-locale.js +3 -0
- package/dist/_virtual/detect-domain-locale2.cjs +7 -0
- package/dist/_virtual/detect-domain-locale2.js +3 -0
- package/dist/_virtual/disable-smooth-scroll.cjs +7 -0
- package/dist/_virtual/disable-smooth-scroll.js +3 -0
- package/dist/_virtual/encode-uri-path.cjs +7 -0
- package/dist/_virtual/encode-uri-path.js +3 -0
- package/dist/_virtual/ensure-leading-slash.cjs +7 -0
- package/dist/_virtual/ensure-leading-slash.js +3 -0
- package/dist/_virtual/escape-regexp.cjs +7 -0
- package/dist/_virtual/escape-regexp.js +3 -0
- package/dist/_virtual/format-next-pathname-info.cjs +7 -0
- package/dist/_virtual/format-next-pathname-info.js +3 -0
- package/dist/_virtual/format-url.cjs +7 -0
- package/dist/_virtual/format-url.js +3 -0
- package/dist/_virtual/get-asset-path-from-route.cjs +7 -0
- package/dist/_virtual/get-asset-path-from-route.js +3 -0
- package/dist/_virtual/get-cookie-parser.cjs +7 -0
- package/dist/_virtual/get-cookie-parser.js +3 -0
- package/dist/_virtual/get-dynamic-param.cjs +7 -0
- package/dist/_virtual/get-dynamic-param.js +3 -0
- package/dist/_virtual/get-next-pathname-info.cjs +7 -0
- package/dist/_virtual/get-next-pathname-info.js +3 -0
- package/dist/_virtual/get-segment-param.cjs +7 -0
- package/dist/_virtual/get-segment-param.js +3 -0
- package/dist/_virtual/has-base-path.cjs +7 -0
- package/dist/_virtual/has-base-path.js +3 -0
- package/dist/_virtual/head-manager-context.shared-runtime.cjs +7 -0
- package/dist/_virtual/head-manager-context.shared-runtime.js +3 -0
- package/dist/_virtual/html-bots.cjs +7 -0
- package/dist/_virtual/html-bots.js +3 -0
- package/dist/_virtual/index.cjs +7 -0
- package/dist/_virtual/index.js +3 -0
- package/dist/_virtual/index2.cjs +7 -0
- package/dist/_virtual/index2.js +3 -0
- package/dist/_virtual/index3.cjs +7 -0
- package/dist/_virtual/index3.js +3 -0
- package/dist/_virtual/index4.cjs +7 -0
- package/dist/_virtual/index4.js +3 -0
- package/dist/_virtual/index5.cjs +7 -0
- package/dist/_virtual/index5.js +3 -0
- package/dist/_virtual/interception-routes.cjs +7 -0
- package/dist/_virtual/interception-routes.js +3 -0
- package/dist/_virtual/interpolate-as.cjs +7 -0
- package/dist/_virtual/interpolate-as.js +3 -0
- package/dist/_virtual/invariant-error.cjs +7 -0
- package/dist/_virtual/invariant-error.js +3 -0
- package/dist/_virtual/is-api-route.cjs +7 -0
- package/dist/_virtual/is-api-route.js +3 -0
- package/dist/_virtual/is-bot.cjs +7 -0
- package/dist/_virtual/is-bot.js +3 -0
- package/dist/_virtual/is-dynamic.cjs +7 -0
- package/dist/_virtual/is-dynamic.js +3 -0
- package/dist/_virtual/is-error.cjs +7 -0
- package/dist/_virtual/is-error.js +3 -0
- package/dist/_virtual/is-local-url.cjs +7 -0
- package/dist/_virtual/is-local-url.js +3 -0
- package/dist/_virtual/is-plain-object.cjs +7 -0
- package/dist/_virtual/is-plain-object.js +3 -0
- package/dist/_virtual/mitt.cjs +7 -0
- package/dist/_virtual/mitt.js +3 -0
- package/dist/_virtual/normalize-locale-path.cjs +7 -0
- package/dist/_virtual/normalize-locale-path.js +3 -0
- package/dist/_virtual/normalize-path-sep.cjs +7 -0
- package/dist/_virtual/normalize-path-sep.js +3 -0
- package/dist/_virtual/normalize-trailing-slash.cjs +7 -0
- package/dist/_virtual/normalize-trailing-slash.js +3 -0
- package/dist/_virtual/omit.cjs +7 -0
- package/dist/_virtual/omit.js +3 -0
- package/dist/_virtual/parse-loader-tree.cjs +7 -0
- package/dist/_virtual/parse-loader-tree.js +3 -0
- package/dist/_virtual/parse-path.cjs +7 -0
- package/dist/_virtual/parse-path.js +3 -0
- package/dist/_virtual/parse-relative-url.cjs +7 -0
- package/dist/_virtual/parse-relative-url.js +3 -0
- package/dist/_virtual/parse-url.cjs +7 -0
- package/dist/_virtual/parse-url.js +3 -0
- package/dist/_virtual/path-has-prefix.cjs +7 -0
- package/dist/_virtual/path-has-prefix.js +3 -0
- package/dist/_virtual/path-match.cjs +7 -0
- package/dist/_virtual/path-match.js +3 -0
- package/dist/_virtual/prepare-destination.cjs +7 -0
- package/dist/_virtual/prepare-destination.js +3 -0
- package/dist/_virtual/querystring.cjs +7 -0
- package/dist/_virtual/querystring.js +3 -0
- package/dist/_virtual/react-is.development.cjs +7 -0
- package/dist/_virtual/react-is.development.js +3 -0
- package/dist/_virtual/react-is.production.cjs +7 -0
- package/dist/_virtual/react-is.production.js +3 -0
- package/dist/_virtual/remove-base-path.cjs +7 -0
- package/dist/_virtual/remove-base-path.js +3 -0
- package/dist/_virtual/remove-locale.cjs +7 -0
- package/dist/_virtual/remove-locale.js +3 -0
- package/dist/_virtual/remove-path-prefix.cjs +7 -0
- package/dist/_virtual/remove-path-prefix.js +3 -0
- package/dist/_virtual/remove-trailing-slash.cjs +7 -0
- package/dist/_virtual/remove-trailing-slash.js +3 -0
- package/dist/_virtual/request-idle-callback.cjs +7 -0
- package/dist/_virtual/request-idle-callback.js +3 -0
- package/dist/_virtual/resolve-href.cjs +7 -0
- package/dist/_virtual/resolve-href.js +3 -0
- package/dist/_virtual/resolve-rewrites.cjs +7 -0
- package/dist/_virtual/resolve-rewrites.js +3 -0
- package/dist/_virtual/route-loader.cjs +7 -0
- package/dist/_virtual/route-loader.js +3 -0
- package/dist/_virtual/route-match-utils.cjs +7 -0
- package/dist/_virtual/route-match-utils.js +3 -0
- package/dist/_virtual/route-matcher.cjs +7 -0
- package/dist/_virtual/route-matcher.js +3 -0
- package/dist/_virtual/route-pattern-normalizer.cjs +7 -0
- package/dist/_virtual/route-pattern-normalizer.js +3 -0
- package/dist/_virtual/route-regex.cjs +7 -0
- package/dist/_virtual/route-regex.js +3 -0
- package/dist/_virtual/router-context.shared-runtime.cjs +7 -0
- package/dist/_virtual/router-context.shared-runtime.js +3 -0
- package/dist/_virtual/router.cjs +9 -0
- package/dist/_virtual/router.js +5 -0
- package/dist/_virtual/router2.cjs +7 -0
- package/dist/_virtual/router2.js +3 -0
- package/dist/_virtual/router3.cjs +7 -0
- package/dist/_virtual/router3.js +3 -0
- package/dist/_virtual/script.cjs +7 -0
- package/dist/_virtual/script.js +3 -0
- package/dist/_virtual/segment.cjs +7 -0
- package/dist/_virtual/segment.js +3 -0
- package/dist/_virtual/set-attributes-from-props.cjs +7 -0
- package/dist/_virtual/set-attributes-from-props.js +3 -0
- package/dist/_virtual/sorted-routes.cjs +7 -0
- package/dist/_virtual/sorted-routes.js +3 -0
- package/dist/_virtual/trusted-types.cjs +7 -0
- package/dist/_virtual/trusted-types.js +3 -0
- package/dist/_virtual/utils.cjs +7 -0
- package/dist/_virtual/utils.js +3 -0
- package/dist/_virtual/warn-once.cjs +7 -0
- package/dist/_virtual/warn-once.js +3 -0
- package/dist/_virtual/with-router.cjs +7 -0
- package/dist/_virtual/with-router.js +3 -0
- package/dist/components/EmptyState/index.cjs +5 -5
- package/dist/components/Icon.cjs +2 -2
- package/dist/components/InfinityLoader/index.cjs +25 -8
- package/dist/components/InfinityLoader/index.js +21 -4
- package/dist/components/MyCheckboxGroup/index.cjs +2 -2
- package/dist/components/MyDateInput/index.cjs +3 -3
- package/dist/components/MyDatePickerInput/CalendarIcon.cjs +7 -7
- package/dist/components/MyDatePickerInput/index.cjs +3 -3
- package/dist/components/MyDateTimePicker/index.cjs +3 -3
- package/dist/components/MyMonthPickerInput/index.cjs +3 -3
- package/dist/components/MyMultiSelect/index.cjs +2 -2
- package/dist/components/MyNotifications/index.cjs +2 -2
- package/dist/components/MyNumberInput/index.cjs +2 -2
- package/dist/components/MyRadioGroup/index.cjs +2 -2
- package/dist/components/MySelect/index.cjs +2 -2
- package/dist/components/MyTextInput/index.cjs +2 -2
- package/dist/components/MyTextarea/index.cjs +2 -2
- package/dist/components/MyTimeInput/index.cjs +2 -2
- package/dist/components/NavItems.cjs +4 -4
- package/dist/components/SelectInfinity/index.cjs +8 -8
- package/dist/contexts/NavigationHistoryContext/hook.cjs +47 -0
- package/dist/contexts/NavigationHistoryContext/hook.js +42 -0
- package/dist/contexts/NavigationHistoryContext/index.cjs +15 -47
- package/dist/contexts/NavigationHistoryContext/index.js +17 -48
- package/dist/contexts/PageDataContext/index.cjs +2 -2
- package/dist/form/Form.cjs +2 -2
- package/dist/form/FormButtonSubmit.cjs +2 -2
- package/dist/form/base/FormCheckbox.cjs +2 -2
- package/dist/form/base/FormCheckboxGroup.cjs +2 -2
- package/dist/form/base/FormDateInput.cjs +2 -2
- package/dist/form/base/FormDatePickerInput.cjs +2 -2
- package/dist/form/base/FormDateTimePicker.cjs +2 -2
- package/dist/form/base/FormMonthPickerInput.cjs +2 -2
- package/dist/form/base/FormMultiSelect.cjs +2 -2
- package/dist/form/base/FormNumberInput.cjs +2 -2
- package/dist/form/base/FormRadioGroup.cjs +2 -2
- package/dist/form/base/FormSelect.cjs +2 -2
- package/dist/form/base/FormSelectInfinity.cjs +2 -2
- package/dist/form/base/FormTextInput.cjs +2 -2
- package/dist/form/base/FormTextarea.cjs +2 -2
- package/dist/form/base/FormTimeInput.cjs +2 -2
- package/dist/hocs/withController.cjs +3 -3
- package/dist/hocs/withModalManager.cjs +2 -2
- package/dist/index.cjs +3 -2
- package/dist/index.d.ts +0 -8
- package/dist/index.js +2 -1
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_default.cjs +20 -0
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_default.js +16 -0
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs +52 -0
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_wildcard.js +48 -0
- package/dist/node_modules/@tanstack/react-virtual/dist/esm/index.cjs +2 -2
- package/dist/node_modules/next/dist/build/deployment-id.cjs +34 -0
- package/dist/node_modules/next/dist/build/deployment-id.js +30 -0
- package/dist/node_modules/next/dist/client/add-base-path.cjs +42 -0
- package/dist/node_modules/next/dist/client/add-base-path.js +38 -0
- package/dist/node_modules/next/dist/client/add-locale.cjs +43 -0
- package/dist/node_modules/next/dist/client/add-locale.js +39 -0
- package/dist/node_modules/next/dist/client/detect-domain-locale.cjs +40 -0
- package/dist/node_modules/next/dist/client/detect-domain-locale.js +36 -0
- package/dist/node_modules/next/dist/client/has-base-path.cjs +40 -0
- package/dist/node_modules/next/dist/client/has-base-path.js +36 -0
- package/dist/node_modules/next/dist/client/normalize-trailing-slash.cjs +54 -0
- package/dist/node_modules/next/dist/client/normalize-trailing-slash.js +50 -0
- package/dist/node_modules/next/dist/client/remove-base-path.cjs +49 -0
- package/dist/node_modules/next/dist/client/remove-base-path.js +45 -0
- package/dist/node_modules/next/dist/client/remove-locale.cjs +45 -0
- package/dist/node_modules/next/dist/client/remove-locale.js +41 -0
- package/dist/node_modules/next/dist/client/request-idle-callback.cjs +56 -0
- package/dist/node_modules/next/dist/client/request-idle-callback.js +52 -0
- package/dist/node_modules/next/dist/client/resolve-href.cjs +132 -0
- package/dist/node_modules/next/dist/client/resolve-href.js +128 -0
- package/dist/node_modules/next/dist/client/route-loader.cjs +363 -0
- package/dist/node_modules/next/dist/client/route-loader.js +359 -0
- package/dist/node_modules/next/dist/client/router.cjs +201 -0
- package/dist/node_modules/next/dist/client/router.js +197 -0
- package/dist/node_modules/next/dist/client/script.cjs +366 -0
- package/dist/node_modules/next/dist/client/script.js +362 -0
- package/dist/node_modules/next/dist/client/set-attributes-from-props.cjs +81 -0
- package/dist/node_modules/next/dist/client/set-attributes-from-props.js +77 -0
- package/dist/node_modules/next/dist/client/trusted-types.cjs +56 -0
- package/dist/node_modules/next/dist/client/trusted-types.js +52 -0
- package/dist/node_modules/next/dist/client/with-router.cjs +54 -0
- package/dist/node_modules/next/dist/client/with-router.js +50 -0
- package/dist/node_modules/next/dist/compiled/cookie/index.cjs +22 -0
- package/dist/node_modules/next/dist/compiled/cookie/index.js +18 -0
- package/dist/node_modules/next/dist/compiled/gzip-size/index.cjs +17 -0
- package/dist/node_modules/next/dist/compiled/gzip-size/index.js +13 -0
- package/dist/node_modules/next/dist/compiled/path-to-regexp/index.cjs +16 -0
- package/dist/node_modules/next/dist/compiled/path-to-regexp/index.js +12 -0
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.development.cjs +147 -0
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.development.js +143 -0
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.production.cjs +144 -0
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.production.js +140 -0
- package/dist/node_modules/next/dist/compiled/react-is/index.cjs +23 -0
- package/dist/node_modules/next/dist/compiled/react-is/index.js +19 -0
- package/dist/node_modules/next/dist/lib/constants.cjs +365 -0
- package/dist/node_modules/next/dist/lib/constants.js +361 -0
- package/dist/node_modules/next/dist/lib/is-api-route.cjs +31 -0
- package/dist/node_modules/next/dist/lib/is-api-route.js +27 -0
- package/dist/node_modules/next/dist/lib/is-error.cjs +91 -0
- package/dist/node_modules/next/dist/lib/is-error.js +87 -0
- package/dist/node_modules/next/dist/lib/route-pattern-normalizer.cjs +115 -0
- package/dist/node_modules/next/dist/lib/route-pattern-normalizer.js +111 -0
- package/dist/node_modules/next/dist/server/api-utils/get-cookie-parser.cjs +39 -0
- package/dist/node_modules/next/dist/server/api-utils/get-cookie-parser.js +35 -0
- package/dist/node_modules/next/dist/shared/lib/bloom-filter.cjs +101 -0
- package/dist/node_modules/next/dist/shared/lib/bloom-filter.js +97 -0
- package/dist/node_modules/next/dist/shared/lib/encode-uri-path.cjs +31 -0
- package/dist/node_modules/next/dist/shared/lib/encode-uri-path.js +27 -0
- package/dist/node_modules/next/dist/shared/lib/escape-regexp.cjs +37 -0
- package/dist/node_modules/next/dist/shared/lib/escape-regexp.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.cjs +36 -0
- package/dist/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js +32 -0
- package/dist/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.cjs +41 -0
- package/dist/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +37 -0
- package/dist/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.cjs +70 -0
- package/dist/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +66 -0
- package/dist/node_modules/next/dist/shared/lib/invariant-error.cjs +34 -0
- package/dist/node_modules/next/dist/shared/lib/invariant-error.js +30 -0
- package/dist/node_modules/next/dist/shared/lib/is-plain-object.cjs +54 -0
- package/dist/node_modules/next/dist/shared/lib/is-plain-object.js +50 -0
- package/dist/node_modules/next/dist/shared/lib/mitt.cjs +58 -0
- package/dist/node_modules/next/dist/shared/lib/mitt.js +54 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.cjs +36 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js +32 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.cjs +36 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +32 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.cjs +37 -0
- package/dist/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/router/router.cjs +1814 -0
- package/dist/node_modules/next/dist/shared/lib/router/router.js +1810 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-locale.cjs +46 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-locale.js +42 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.cjs +37 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.cjs +37 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.cjs +65 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.js +61 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/compare-states.cjs +50 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/compare-states.js +46 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/disable-smooth-scroll.cjs +60 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/disable-smooth-scroll.js +56 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.cjs +47 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js +43 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-url.cjs +103 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-url.js +99 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.cjs +32 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js +28 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.cjs +208 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-dynamic-param.js +204 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.cjs +71 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js +67 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-segment-param.cjs +94 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-segment-param.js +90 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/html-bots.cjs +29 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/html-bots.js +25 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/index.cjs +43 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/index.js +39 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/interception-routes.cjs +119 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/interception-routes.js +115 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/interpolate-as.cjs +71 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/interpolate-as.js +67 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-bot.cjs +68 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-bot.js +64 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-dynamic.cjs +43 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +39 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-local-url.cjs +44 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-local-url.js +40 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/omit.cjs +37 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/omit.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.cjs +46 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-loader-tree.js +42 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-path.cjs +51 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-path.js +47 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.cjs +54 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js +50 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-url.cjs +50 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-url.js +46 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.cjs +37 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +33 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-match.cjs +66 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-match.js +62 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/prepare-destination.cjs +303 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +299 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/querystring.cjs +90 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/querystring.js +86 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.cjs +56 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js +52 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.cjs +39 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +35 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/resolve-rewrites.cjs +140 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/resolve-rewrites.js +136 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-match-utils.cjs +127 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-match-utils.js +123 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-matcher.cjs +63 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +59 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-regex.cjs +272 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-regex.js +268 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.cjs +256 -0
- package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +252 -0
- package/dist/node_modules/next/dist/shared/lib/router-context.shared-runtime.cjs +36 -0
- package/dist/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +32 -0
- package/dist/node_modules/next/dist/shared/lib/segment.cjs +103 -0
- package/dist/node_modules/next/dist/shared/lib/segment.js +99 -0
- package/dist/node_modules/next/dist/shared/lib/utils/warn-once.cjs +38 -0
- package/dist/node_modules/next/dist/shared/lib/utils/warn-once.js +34 -0
- package/dist/node_modules/next/dist/shared/lib/utils.cjs +204 -0
- package/dist/node_modules/next/dist/shared/lib/utils.js +200 -0
- package/dist/node_modules/next/router.cjs +17 -0
- package/dist/node_modules/next/router.js +13 -0
- package/package.json +6 -6
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const removeLocale = require('../../../../_virtual/remove-locale.cjs');
|
|
6
|
+
const parsePath = require('../shared/lib/router/utils/parse-path.cjs');
|
|
7
|
+
|
|
8
|
+
var hasRequiredRemoveLocale;
|
|
9
|
+
|
|
10
|
+
function requireRemoveLocale () {
|
|
11
|
+
if (hasRequiredRemoveLocale) return removeLocale.__module.exports;
|
|
12
|
+
hasRequiredRemoveLocale = 1;
|
|
13
|
+
(function (module, exports) {
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "removeLocale", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return removeLocale;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const _parsepath = parsePath.__require();
|
|
24
|
+
function removeLocale(path, locale) {
|
|
25
|
+
if (process.env.__NEXT_I18N_SUPPORT) {
|
|
26
|
+
const { pathname } = (0, _parsepath.parsePath)(path);
|
|
27
|
+
const pathLower = pathname.toLowerCase();
|
|
28
|
+
const localeLower = locale?.toLowerCase();
|
|
29
|
+
return locale && (pathLower.startsWith(`/${localeLower}/`) || pathLower === `/${localeLower}`) ? `${pathname.length === locale.length + 1 ? `/` : ``}${path.slice(locale.length + 1)}` : path;
|
|
30
|
+
}
|
|
31
|
+
return path;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
35
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
36
|
+
Object.assign(exports.default, exports);
|
|
37
|
+
module.exports = exports.default;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
} (removeLocale.__module, removeLocale.__module.exports));
|
|
42
|
+
return removeLocale.__module.exports;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
exports.__require = requireRemoveLocale;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { __module as removeLocale } from '../../../../_virtual/remove-locale.js';
|
|
2
|
+
import { __require as requireParsePath } from '../shared/lib/router/utils/parse-path.js';
|
|
3
|
+
|
|
4
|
+
var hasRequiredRemoveLocale;
|
|
5
|
+
|
|
6
|
+
function requireRemoveLocale () {
|
|
7
|
+
if (hasRequiredRemoveLocale) return removeLocale.exports;
|
|
8
|
+
hasRequiredRemoveLocale = 1;
|
|
9
|
+
(function (module, exports) {
|
|
10
|
+
Object.defineProperty(exports, "__esModule", {
|
|
11
|
+
value: true
|
|
12
|
+
});
|
|
13
|
+
Object.defineProperty(exports, "removeLocale", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function() {
|
|
16
|
+
return removeLocale;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _parsepath = requireParsePath();
|
|
20
|
+
function removeLocale(path, locale) {
|
|
21
|
+
if (process.env.__NEXT_I18N_SUPPORT) {
|
|
22
|
+
const { pathname } = (0, _parsepath.parsePath)(path);
|
|
23
|
+
const pathLower = pathname.toLowerCase();
|
|
24
|
+
const localeLower = locale?.toLowerCase();
|
|
25
|
+
return locale && (pathLower.startsWith(`/${localeLower}/`) || pathLower === `/${localeLower}`) ? `${pathname.length === locale.length + 1 ? `/` : ``}${path.slice(locale.length + 1)}` : path;
|
|
26
|
+
}
|
|
27
|
+
return path;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
31
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
32
|
+
Object.assign(exports.default, exports);
|
|
33
|
+
module.exports = exports.default;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
} (removeLocale, removeLocale.exports));
|
|
38
|
+
return removeLocale.exports;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { requireRemoveLocale as __require };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const requestIdleCallback = require('../../../../_virtual/request-idle-callback.cjs');
|
|
6
|
+
|
|
7
|
+
var hasRequiredRequestIdleCallback;
|
|
8
|
+
|
|
9
|
+
function requireRequestIdleCallback () {
|
|
10
|
+
if (hasRequiredRequestIdleCallback) return requestIdleCallback.__module.exports;
|
|
11
|
+
hasRequiredRequestIdleCallback = 1;
|
|
12
|
+
(function (module, exports) {
|
|
13
|
+
Object.defineProperty(exports, "__esModule", {
|
|
14
|
+
value: true
|
|
15
|
+
});
|
|
16
|
+
function _export(target, all) {
|
|
17
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: all[name]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
_export(exports, {
|
|
23
|
+
cancelIdleCallback: function() {
|
|
24
|
+
return cancelIdleCallback;
|
|
25
|
+
},
|
|
26
|
+
requestIdleCallback: function() {
|
|
27
|
+
return requestIdleCallback;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
const requestIdleCallback = typeof self !== 'undefined' && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
|
|
31
|
+
let start = Date.now();
|
|
32
|
+
return self.setTimeout(function() {
|
|
33
|
+
cb({
|
|
34
|
+
didTimeout: false,
|
|
35
|
+
timeRemaining: function() {
|
|
36
|
+
return Math.max(0, 50 - (Date.now() - start));
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}, 1);
|
|
40
|
+
};
|
|
41
|
+
const cancelIdleCallback = typeof self !== 'undefined' && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
|
|
42
|
+
return clearTimeout(id);
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
46
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
47
|
+
Object.assign(exports.default, exports);
|
|
48
|
+
module.exports = exports.default;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
} (requestIdleCallback.__module, requestIdleCallback.__module.exports));
|
|
53
|
+
return requestIdleCallback.__module.exports;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
exports.__require = requireRequestIdleCallback;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { __module as requestIdleCallback } from '../../../../_virtual/request-idle-callback.js';
|
|
2
|
+
|
|
3
|
+
var hasRequiredRequestIdleCallback;
|
|
4
|
+
|
|
5
|
+
function requireRequestIdleCallback () {
|
|
6
|
+
if (hasRequiredRequestIdleCallback) return requestIdleCallback.exports;
|
|
7
|
+
hasRequiredRequestIdleCallback = 1;
|
|
8
|
+
(function (module, exports) {
|
|
9
|
+
Object.defineProperty(exports, "__esModule", {
|
|
10
|
+
value: true
|
|
11
|
+
});
|
|
12
|
+
function _export(target, all) {
|
|
13
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: all[name]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
_export(exports, {
|
|
19
|
+
cancelIdleCallback: function() {
|
|
20
|
+
return cancelIdleCallback;
|
|
21
|
+
},
|
|
22
|
+
requestIdleCallback: function() {
|
|
23
|
+
return requestIdleCallback;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const requestIdleCallback = typeof self !== 'undefined' && self.requestIdleCallback && self.requestIdleCallback.bind(window) || function(cb) {
|
|
27
|
+
let start = Date.now();
|
|
28
|
+
return self.setTimeout(function() {
|
|
29
|
+
cb({
|
|
30
|
+
didTimeout: false,
|
|
31
|
+
timeRemaining: function() {
|
|
32
|
+
return Math.max(0, 50 - (Date.now() - start));
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}, 1);
|
|
36
|
+
};
|
|
37
|
+
const cancelIdleCallback = typeof self !== 'undefined' && self.cancelIdleCallback && self.cancelIdleCallback.bind(window) || function(id) {
|
|
38
|
+
return clearTimeout(id);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
42
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
43
|
+
Object.assign(exports.default, exports);
|
|
44
|
+
module.exports = exports.default;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
} (requestIdleCallback, requestIdleCallback.exports));
|
|
49
|
+
return requestIdleCallback.exports;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { requireRequestIdleCallback as __require };
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
|
|
5
|
+
const resolveHref = require('../../../../_virtual/resolve-href.cjs');
|
|
6
|
+
const querystring = require('../shared/lib/router/utils/querystring.cjs');
|
|
7
|
+
const formatUrl = require('../shared/lib/router/utils/format-url.cjs');
|
|
8
|
+
const omit = require('../shared/lib/router/utils/omit.cjs');
|
|
9
|
+
const utils = require('../shared/lib/utils.cjs');
|
|
10
|
+
const normalizeTrailingSlash = require('./normalize-trailing-slash.cjs');
|
|
11
|
+
const isLocalUrl = require('../shared/lib/router/utils/is-local-url.cjs');
|
|
12
|
+
const index = require('../shared/lib/router/utils/index.cjs');
|
|
13
|
+
const interpolateAs = require('../shared/lib/router/utils/interpolate-as.cjs');
|
|
14
|
+
const routeRegex = require('../shared/lib/router/utils/route-regex.cjs');
|
|
15
|
+
const routeMatcher = require('../shared/lib/router/utils/route-matcher.cjs');
|
|
16
|
+
|
|
17
|
+
var hasRequiredResolveHref;
|
|
18
|
+
|
|
19
|
+
function requireResolveHref () {
|
|
20
|
+
if (hasRequiredResolveHref) return resolveHref.__module.exports;
|
|
21
|
+
hasRequiredResolveHref = 1;
|
|
22
|
+
(function (module, exports) {
|
|
23
|
+
Object.defineProperty(exports, "__esModule", {
|
|
24
|
+
value: true
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "resolveHref", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function() {
|
|
29
|
+
return resolveHref;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
const _querystring = querystring.__require();
|
|
33
|
+
const _formaturl = formatUrl.__require();
|
|
34
|
+
const _omit = omit.__require();
|
|
35
|
+
const _utils = utils.__require();
|
|
36
|
+
const _normalizetrailingslash = normalizeTrailingSlash.__require();
|
|
37
|
+
const _islocalurl = isLocalUrl.__require();
|
|
38
|
+
const _utils1 = index.__require();
|
|
39
|
+
const _interpolateas = interpolateAs.__require();
|
|
40
|
+
const _routeregex = routeRegex.__require();
|
|
41
|
+
const _routematcher = routeMatcher.__require();
|
|
42
|
+
function resolveHref(router, href, resolveAs) {
|
|
43
|
+
// we use a dummy base url for relative urls
|
|
44
|
+
let base;
|
|
45
|
+
let urlAsString = typeof href === 'string' ? href : (0, _formaturl.formatWithValidation)(href);
|
|
46
|
+
// repeated slashes and backslashes in the URL are considered
|
|
47
|
+
// invalid and will never match a Next.js page/file
|
|
48
|
+
// https://www.rfc-editor.org/rfc/rfc3986.html#section-3.1
|
|
49
|
+
const urlProtoMatch = urlAsString.match(/^[a-z][a-z0-9+.-]*:\/\//i);
|
|
50
|
+
const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
|
|
51
|
+
const urlParts = urlAsStringNoProto.split('?', 1);
|
|
52
|
+
if ((urlParts[0] || '').match(/(\/\/|\\)/)) {
|
|
53
|
+
console.error(`Invalid href '${urlAsString}' passed to next/router in page: '${router.pathname}'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.`);
|
|
54
|
+
const normalizedUrl = (0, _utils.normalizeRepeatedSlashes)(urlAsStringNoProto);
|
|
55
|
+
urlAsString = (urlProtoMatch ? urlProtoMatch[0] : '') + normalizedUrl;
|
|
56
|
+
}
|
|
57
|
+
// Return because it cannot be routed by the Next.js router
|
|
58
|
+
if (!(0, _islocalurl.isLocalURL)(urlAsString)) {
|
|
59
|
+
return resolveAs ? [
|
|
60
|
+
urlAsString
|
|
61
|
+
] : urlAsString;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
let baseBase = urlAsString.startsWith('#') ? router.asPath : router.pathname;
|
|
65
|
+
// If the provided href is only a query string, it is safer to use the asPath
|
|
66
|
+
// considering rewrites.
|
|
67
|
+
if (urlAsString.startsWith('?')) {
|
|
68
|
+
baseBase = router.asPath;
|
|
69
|
+
// However, if is a dynamic route, we need to use the pathname to preserve the
|
|
70
|
+
// query interpolation and rewrites (router.pathname will look like "/[slug]").
|
|
71
|
+
if ((0, _utils1.isDynamicRoute)(router.pathname)) {
|
|
72
|
+
baseBase = router.pathname;
|
|
73
|
+
const routeRegex = (0, _routeregex.getRouteRegex)(router.pathname);
|
|
74
|
+
const match = (0, _routematcher.getRouteMatcher)(routeRegex)(router.asPath);
|
|
75
|
+
// For dynamic routes, if asPath doesn't match the pathname regex, it is a rewritten path.
|
|
76
|
+
// In this case, should use asPath to preserve the current URL.
|
|
77
|
+
if (!match) {
|
|
78
|
+
baseBase = router.asPath;
|
|
79
|
+
}
|
|
80
|
+
// Note: There is an edge case where the pathname is dynamic, and also a rewrite path to the same segment.
|
|
81
|
+
// E.g. in "/[slug]" path, rewrite "/foo" -> "/bar"
|
|
82
|
+
// In this case, it will be treated as a non-rewritten path and possibly interpolate the query string.
|
|
83
|
+
// E.g., "/any?slug=foo" will become the content of "/foo", not rewritten as "/bar"
|
|
84
|
+
// This is currently a trade-off of not resolving rewrite paths on every Router/Link call,
|
|
85
|
+
// but using a lighter route regex pattern check.
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
base = new URL(baseBase, 'http://n');
|
|
89
|
+
} catch (_) {
|
|
90
|
+
// fallback to / for invalid asPath values e.g. //
|
|
91
|
+
base = new URL('/', 'http://n');
|
|
92
|
+
}
|
|
93
|
+
try {
|
|
94
|
+
const finalUrl = new URL(urlAsString, base);
|
|
95
|
+
finalUrl.pathname = (0, _normalizetrailingslash.normalizePathTrailingSlash)(finalUrl.pathname);
|
|
96
|
+
let interpolatedAs = '';
|
|
97
|
+
if ((0, _utils1.isDynamicRoute)(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
|
|
98
|
+
const query = (0, _querystring.searchParamsToUrlQuery)(finalUrl.searchParams);
|
|
99
|
+
const { result, params } = (0, _interpolateas.interpolateAs)(finalUrl.pathname, finalUrl.pathname, query);
|
|
100
|
+
if (result) {
|
|
101
|
+
interpolatedAs = (0, _formaturl.formatWithValidation)({
|
|
102
|
+
pathname: result,
|
|
103
|
+
hash: finalUrl.hash,
|
|
104
|
+
query: (0, _omit.omit)(query, params)
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// if the origin didn't change, it means we received a relative href
|
|
109
|
+
const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
|
|
110
|
+
return resolveAs ? [
|
|
111
|
+
resolvedHref,
|
|
112
|
+
interpolatedAs || resolvedHref
|
|
113
|
+
] : resolvedHref;
|
|
114
|
+
} catch (_) {
|
|
115
|
+
return resolveAs ? [
|
|
116
|
+
urlAsString
|
|
117
|
+
] : urlAsString;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
122
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
123
|
+
Object.assign(exports.default, exports);
|
|
124
|
+
module.exports = exports.default;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
} (resolveHref.__module, resolveHref.__module.exports));
|
|
129
|
+
return resolveHref.__module.exports;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
exports.__require = requireResolveHref;
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { __module as resolveHref } from '../../../../_virtual/resolve-href.js';
|
|
2
|
+
import { __require as requireQuerystring } from '../shared/lib/router/utils/querystring.js';
|
|
3
|
+
import { __require as requireFormatUrl } from '../shared/lib/router/utils/format-url.js';
|
|
4
|
+
import { __require as requireOmit } from '../shared/lib/router/utils/omit.js';
|
|
5
|
+
import { __require as requireUtils } from '../shared/lib/utils.js';
|
|
6
|
+
import { __require as requireNormalizeTrailingSlash } from './normalize-trailing-slash.js';
|
|
7
|
+
import { __require as requireIsLocalUrl } from '../shared/lib/router/utils/is-local-url.js';
|
|
8
|
+
import { __require as requireUtils$1 } from '../shared/lib/router/utils/index.js';
|
|
9
|
+
import { __require as requireInterpolateAs } from '../shared/lib/router/utils/interpolate-as.js';
|
|
10
|
+
import { __require as requireRouteRegex } from '../shared/lib/router/utils/route-regex.js';
|
|
11
|
+
import { __require as requireRouteMatcher } from '../shared/lib/router/utils/route-matcher.js';
|
|
12
|
+
|
|
13
|
+
var hasRequiredResolveHref;
|
|
14
|
+
|
|
15
|
+
function requireResolveHref () {
|
|
16
|
+
if (hasRequiredResolveHref) return resolveHref.exports;
|
|
17
|
+
hasRequiredResolveHref = 1;
|
|
18
|
+
(function (module, exports) {
|
|
19
|
+
Object.defineProperty(exports, "__esModule", {
|
|
20
|
+
value: true
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "resolveHref", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function() {
|
|
25
|
+
return resolveHref;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const _querystring = requireQuerystring();
|
|
29
|
+
const _formaturl = requireFormatUrl();
|
|
30
|
+
const _omit = requireOmit();
|
|
31
|
+
const _utils = requireUtils();
|
|
32
|
+
const _normalizetrailingslash = requireNormalizeTrailingSlash();
|
|
33
|
+
const _islocalurl = requireIsLocalUrl();
|
|
34
|
+
const _utils1 = requireUtils$1();
|
|
35
|
+
const _interpolateas = requireInterpolateAs();
|
|
36
|
+
const _routeregex = requireRouteRegex();
|
|
37
|
+
const _routematcher = requireRouteMatcher();
|
|
38
|
+
function resolveHref(router, href, resolveAs) {
|
|
39
|
+
// we use a dummy base url for relative urls
|
|
40
|
+
let base;
|
|
41
|
+
let urlAsString = typeof href === 'string' ? href : (0, _formaturl.formatWithValidation)(href);
|
|
42
|
+
// repeated slashes and backslashes in the URL are considered
|
|
43
|
+
// invalid and will never match a Next.js page/file
|
|
44
|
+
// https://www.rfc-editor.org/rfc/rfc3986.html#section-3.1
|
|
45
|
+
const urlProtoMatch = urlAsString.match(/^[a-z][a-z0-9+.-]*:\/\//i);
|
|
46
|
+
const urlAsStringNoProto = urlProtoMatch ? urlAsString.slice(urlProtoMatch[0].length) : urlAsString;
|
|
47
|
+
const urlParts = urlAsStringNoProto.split('?', 1);
|
|
48
|
+
if ((urlParts[0] || '').match(/(\/\/|\\)/)) {
|
|
49
|
+
console.error(`Invalid href '${urlAsString}' passed to next/router in page: '${router.pathname}'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.`);
|
|
50
|
+
const normalizedUrl = (0, _utils.normalizeRepeatedSlashes)(urlAsStringNoProto);
|
|
51
|
+
urlAsString = (urlProtoMatch ? urlProtoMatch[0] : '') + normalizedUrl;
|
|
52
|
+
}
|
|
53
|
+
// Return because it cannot be routed by the Next.js router
|
|
54
|
+
if (!(0, _islocalurl.isLocalURL)(urlAsString)) {
|
|
55
|
+
return resolveAs ? [
|
|
56
|
+
urlAsString
|
|
57
|
+
] : urlAsString;
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
let baseBase = urlAsString.startsWith('#') ? router.asPath : router.pathname;
|
|
61
|
+
// If the provided href is only a query string, it is safer to use the asPath
|
|
62
|
+
// considering rewrites.
|
|
63
|
+
if (urlAsString.startsWith('?')) {
|
|
64
|
+
baseBase = router.asPath;
|
|
65
|
+
// However, if is a dynamic route, we need to use the pathname to preserve the
|
|
66
|
+
// query interpolation and rewrites (router.pathname will look like "/[slug]").
|
|
67
|
+
if ((0, _utils1.isDynamicRoute)(router.pathname)) {
|
|
68
|
+
baseBase = router.pathname;
|
|
69
|
+
const routeRegex = (0, _routeregex.getRouteRegex)(router.pathname);
|
|
70
|
+
const match = (0, _routematcher.getRouteMatcher)(routeRegex)(router.asPath);
|
|
71
|
+
// For dynamic routes, if asPath doesn't match the pathname regex, it is a rewritten path.
|
|
72
|
+
// In this case, should use asPath to preserve the current URL.
|
|
73
|
+
if (!match) {
|
|
74
|
+
baseBase = router.asPath;
|
|
75
|
+
}
|
|
76
|
+
// Note: There is an edge case where the pathname is dynamic, and also a rewrite path to the same segment.
|
|
77
|
+
// E.g. in "/[slug]" path, rewrite "/foo" -> "/bar"
|
|
78
|
+
// In this case, it will be treated as a non-rewritten path and possibly interpolate the query string.
|
|
79
|
+
// E.g., "/any?slug=foo" will become the content of "/foo", not rewritten as "/bar"
|
|
80
|
+
// This is currently a trade-off of not resolving rewrite paths on every Router/Link call,
|
|
81
|
+
// but using a lighter route regex pattern check.
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
base = new URL(baseBase, 'http://n');
|
|
85
|
+
} catch (_) {
|
|
86
|
+
// fallback to / for invalid asPath values e.g. //
|
|
87
|
+
base = new URL('/', 'http://n');
|
|
88
|
+
}
|
|
89
|
+
try {
|
|
90
|
+
const finalUrl = new URL(urlAsString, base);
|
|
91
|
+
finalUrl.pathname = (0, _normalizetrailingslash.normalizePathTrailingSlash)(finalUrl.pathname);
|
|
92
|
+
let interpolatedAs = '';
|
|
93
|
+
if ((0, _utils1.isDynamicRoute)(finalUrl.pathname) && finalUrl.searchParams && resolveAs) {
|
|
94
|
+
const query = (0, _querystring.searchParamsToUrlQuery)(finalUrl.searchParams);
|
|
95
|
+
const { result, params } = (0, _interpolateas.interpolateAs)(finalUrl.pathname, finalUrl.pathname, query);
|
|
96
|
+
if (result) {
|
|
97
|
+
interpolatedAs = (0, _formaturl.formatWithValidation)({
|
|
98
|
+
pathname: result,
|
|
99
|
+
hash: finalUrl.hash,
|
|
100
|
+
query: (0, _omit.omit)(query, params)
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
// if the origin didn't change, it means we received a relative href
|
|
105
|
+
const resolvedHref = finalUrl.origin === base.origin ? finalUrl.href.slice(finalUrl.origin.length) : finalUrl.href;
|
|
106
|
+
return resolveAs ? [
|
|
107
|
+
resolvedHref,
|
|
108
|
+
interpolatedAs || resolvedHref
|
|
109
|
+
] : resolvedHref;
|
|
110
|
+
} catch (_) {
|
|
111
|
+
return resolveAs ? [
|
|
112
|
+
urlAsString
|
|
113
|
+
] : urlAsString;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
|
118
|
+
Object.defineProperty(exports.default, '__esModule', { value: true });
|
|
119
|
+
Object.assign(exports.default, exports);
|
|
120
|
+
module.exports = exports.default;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
} (resolveHref, resolveHref.exports));
|
|
125
|
+
return resolveHref.exports;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export { requireResolveHref as __require };
|