math-main-components 0.0.195 → 0.0.197
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/components/Accordeon/Accordeon.d.ts +4 -1
- package/dist/components/Accordeon/Accordeon.stories.d.ts +13 -0
- package/dist/components/Button/Button.d.ts +3 -3
- package/dist/components/Button/Button.stories.d.ts +13 -0
- package/dist/components/{AuthButton/AuthButton.d.ts → Button2/Button2.d.ts} +2 -2
- package/dist/components/Button2/Button2.stories.d.ts +13 -0
- package/dist/components/Button2/index.d.ts +1 -0
- package/dist/components/CardButton/CardButton.d.ts +3 -3
- package/dist/components/CardButton/CardButton.stories.d.ts +13 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +13 -0
- package/dist/components/ChooseRole/ChooseRole.d.ts +3 -4
- package/dist/components/ChooseRole/ChooseRole.stories.d.ts +13 -0
- package/dist/components/ChooseRole/index.d.ts +1 -1
- package/dist/components/CopyCode/CopyCode.d.ts +3 -4
- package/dist/components/CopyCode/CopyCode.stories.d.ts +13 -0
- package/dist/components/EmptyCard/EmptyCard.stories.d.ts +13 -0
- package/dist/components/FormButton/FormButton.d.ts +4 -4
- package/dist/components/FormButton/FormButton.stories.d.ts +13 -0
- package/dist/components/FormText/FormText.stories.d.ts +13 -0
- package/dist/components/ForwardButton/ForwardButton.stories.d.ts +13 -0
- package/dist/functions/url.d.ts +3 -0
- package/dist/index.cjs.js +46 -48
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +43 -47
- package/dist/styles/font.scss +5 -0
- package/dist/styles/material-symbols.scss +24 -0
- package/dist/styles/theme-colors.scss +164 -0
- package/dist/styles/theme-styles.scss +8 -0
- package/package.json +18 -3
- package/dist/_virtual/_interop_require_default.cjs.js +0 -3
- package/dist/_virtual/_interop_require_wildcard.cjs.js +0 -3
- package/dist/_virtual/add-base-path.js +0 -3
- package/dist/_virtual/add-locale.js +0 -3
- package/dist/_virtual/add-locale2.js +0 -3
- package/dist/_virtual/add-path-prefix.js +0 -3
- package/dist/_virtual/add-path-suffix.js +0 -3
- package/dist/_virtual/app-paths.js +0 -3
- package/dist/_virtual/app-router-context.shared-runtime.js +0 -3
- package/dist/_virtual/app-router-headers.js +0 -3
- package/dist/_virtual/bloom-filter.js +0 -3
- package/dist/_virtual/compare-states.js +0 -3
- package/dist/_virtual/denormalize-page-path.js +0 -3
- package/dist/_virtual/detect-domain-locale.js +0 -3
- package/dist/_virtual/detect-domain-locale2.js +0 -3
- package/dist/_virtual/ensure-leading-slash.js +0 -3
- package/dist/_virtual/escape-regexp.js +0 -3
- package/dist/_virtual/format-next-pathname-info.js +0 -3
- package/dist/_virtual/format-url.js +0 -3
- package/dist/_virtual/get-asset-path-from-route.js +0 -3
- package/dist/_virtual/get-cookie-parser.js +0 -3
- package/dist/_virtual/get-domain-locale.js +0 -3
- package/dist/_virtual/get-next-pathname-info.js +0 -3
- package/dist/_virtual/handle-smooth-scroll.js +0 -3
- package/dist/_virtual/has-base-path.js +0 -3
- package/dist/_virtual/head-manager-context.shared-runtime.js +0 -3
- package/dist/_virtual/head-manager.js +0 -3
- package/dist/_virtual/index.js +0 -3
- package/dist/_virtual/index2.js +0 -3
- package/dist/_virtual/index3.js +0 -3
- package/dist/_virtual/index4.js +0 -3
- package/dist/_virtual/index5.js +0 -3
- package/dist/_virtual/interception-routes.js +0 -3
- package/dist/_virtual/interpolate-as.js +0 -3
- package/dist/_virtual/is-api-route.js +0 -3
- package/dist/_virtual/is-bot.js +0 -3
- package/dist/_virtual/is-dynamic.js +0 -3
- package/dist/_virtual/is-error.js +0 -3
- package/dist/_virtual/is-local-url.js +0 -3
- package/dist/_virtual/is-plain-object.js +0 -3
- package/dist/_virtual/link.js +0 -3
- package/dist/_virtual/link2.js +0 -3
- package/dist/_virtual/mitt.js +0 -3
- package/dist/_virtual/normalize-locale-path.js +0 -3
- package/dist/_virtual/normalize-locale-path2.js +0 -3
- package/dist/_virtual/normalize-path-sep.js +0 -3
- package/dist/_virtual/normalize-trailing-slash.js +0 -3
- package/dist/_virtual/omit.js +0 -3
- package/dist/_virtual/parse-path.js +0 -3
- package/dist/_virtual/parse-relative-url.js +0 -3
- package/dist/_virtual/parse-url.js +0 -3
- package/dist/_virtual/path-has-prefix.js +0 -3
- package/dist/_virtual/path-match.js +0 -3
- package/dist/_virtual/prepare-destination.js +0 -3
- package/dist/_virtual/querystring.js +0 -3
- package/dist/_virtual/react-is.development.js +0 -3
- package/dist/_virtual/react-is.production.min.js +0 -3
- package/dist/_virtual/remove-base-path.js +0 -3
- package/dist/_virtual/remove-locale.js +0 -3
- package/dist/_virtual/remove-path-prefix.js +0 -3
- package/dist/_virtual/remove-trailing-slash.js +0 -3
- package/dist/_virtual/request-idle-callback.js +0 -3
- package/dist/_virtual/resolve-href.js +0 -3
- package/dist/_virtual/resolve-rewrites.js +0 -3
- package/dist/_virtual/route-loader.js +0 -3
- package/dist/_virtual/route-matcher.js +0 -3
- package/dist/_virtual/route-regex.js +0 -3
- package/dist/_virtual/router-context.shared-runtime.js +0 -3
- package/dist/_virtual/router-reducer-types.js +0 -3
- package/dist/_virtual/router.js +0 -3
- package/dist/_virtual/router2.js +0 -3
- package/dist/_virtual/router3.js +0 -3
- package/dist/_virtual/script.js +0 -3
- package/dist/_virtual/segment.js +0 -3
- package/dist/_virtual/sorted-routes.js +0 -3
- package/dist/_virtual/trusted-types.js +0 -3
- package/dist/_virtual/use-intersection.js +0 -3
- package/dist/_virtual/utils.js +0 -3
- package/dist/_virtual/with-router.js +0 -3
- package/dist/components/Accordeon/Accordeon.types.d.ts +0 -4
- package/dist/components/AuthButton/index.d.ts +0 -1
- package/dist/components/Dialog/Dialog.types.d.ts +0 -7
- package/dist/components/PrimaryButton/PrimaryButton.d.ts +0 -8
- package/dist/components/PrimaryButton/index.d.ts +0 -1
- package/dist/components/SvgIcon/SvgIcon.types.d.ts +0 -8
- package/dist/components/index.d.ts +0 -31
- package/dist/components/useDimensions.d.ts +0 -4
- package/dist/components/useOrientation.d.ts +0 -3
- package/dist/components/useScroll.d.ts +0 -4
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_default.cjs.js +0 -7
- package/dist/node_modules/@swc/helpers/cjs/_interop_require_wildcard.cjs.js +0 -48
- package/dist/node_modules/clsx/dist/clsx.m.js +0 -3
- package/dist/node_modules/external-svg-loader/dist/svg-loader.min.js +0 -1
- package/dist/node_modules/next/dist/client/add-base-path.js +0 -38
- package/dist/node_modules/next/dist/client/add-locale.js +0 -42
- package/dist/node_modules/next/dist/client/components/app-router-headers.js +0 -78
- package/dist/node_modules/next/dist/client/components/router-reducer/router-reducer-types.js +0 -69
- package/dist/node_modules/next/dist/client/detect-domain-locale.js +0 -39
- package/dist/node_modules/next/dist/client/get-domain-locale.js +0 -51
- package/dist/node_modules/next/dist/client/has-base-path.js +0 -36
- package/dist/node_modules/next/dist/client/head-manager.js +0 -212
- package/dist/node_modules/next/dist/client/link.js +0 -431
- package/dist/node_modules/next/dist/client/normalize-locale-path.js +0 -40
- package/dist/node_modules/next/dist/client/normalize-trailing-slash.js +0 -50
- package/dist/node_modules/next/dist/client/remove-base-path.js +0 -45
- package/dist/node_modules/next/dist/client/remove-locale.js +0 -41
- package/dist/node_modules/next/dist/client/request-idle-callback.js +0 -52
- package/dist/node_modules/next/dist/client/resolve-href.js +0 -99
- package/dist/node_modules/next/dist/client/route-loader.js +0 -327
- package/dist/node_modules/next/dist/client/router.js +0 -202
- package/dist/node_modules/next/dist/client/script.js +0 -353
- package/dist/node_modules/next/dist/client/trusted-types.js +0 -54
- package/dist/node_modules/next/dist/client/use-intersection.js +0 -129
- package/dist/node_modules/next/dist/client/with-router.js +0 -52
- package/dist/node_modules/next/dist/compiled/cookie/index.js +0 -18
- package/dist/node_modules/next/dist/compiled/gzip-size/index.js +0 -15
- package/dist/node_modules/next/dist/compiled/path-to-regexp/index.js +0 -416
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.development.js +0 -230
- package/dist/node_modules/next/dist/compiled/react-is/cjs/react-is.production.min.js +0 -26
- package/dist/node_modules/next/dist/compiled/react-is/index.js +0 -21
- package/dist/node_modules/next/dist/lib/is-api-route.js +0 -27
- package/dist/node_modules/next/dist/lib/is-error.js +0 -53
- package/dist/node_modules/next/dist/server/api-utils/get-cookie-parser.js +0 -35
- package/dist/node_modules/next/dist/server/future/helpers/interception-routes.js +0 -97
- package/dist/node_modules/next/dist/shared/lib/app-router-context.shared-runtime.js +0 -63
- package/dist/node_modules/next/dist/shared/lib/bloom-filter.js +0 -96
- package/dist/node_modules/next/dist/shared/lib/escape-regexp.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/head-manager-context.shared-runtime.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/i18n/detect-domain-locale.js +0 -38
- package/dist/node_modules/next/dist/shared/lib/i18n/normalize-locale-path.js +0 -42
- package/dist/node_modules/next/dist/shared/lib/is-plain-object.js +0 -50
- package/dist/node_modules/next/dist/shared/lib/mitt.js +0 -57
- package/dist/node_modules/next/dist/shared/lib/page-path/denormalize-page-path.js +0 -32
- package/dist/node_modules/next/dist/shared/lib/page-path/ensure-leading-slash.js +0 -32
- package/dist/node_modules/next/dist/shared/lib/page-path/normalize-path-sep.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/router.js +0 -1771
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-locale.js +0 -42
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-prefix.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/utils/add-path-suffix.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/utils/app-paths.js +0 -61
- package/dist/node_modules/next/dist/shared/lib/router/utils/compare-states.js +0 -46
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-next-pathname-info.js +0 -43
- package/dist/node_modules/next/dist/shared/lib/router/utils/format-url.js +0 -99
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-asset-path-from-route.js +0 -29
- package/dist/node_modules/next/dist/shared/lib/router/utils/get-next-pathname-info.js +0 -69
- package/dist/node_modules/next/dist/shared/lib/router/utils/handle-smooth-scroll.js +0 -49
- package/dist/node_modules/next/dist/shared/lib/router/utils/index.js +0 -36
- package/dist/node_modules/next/dist/shared/lib/router/utils/interpolate-as.js +0 -67
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-bot.js +0 -27
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-dynamic.js +0 -28
- package/dist/node_modules/next/dist/shared/lib/router/utils/is-local-url.js +0 -40
- package/dist/node_modules/next/dist/shared/lib/router/utils/omit.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-path.js +0 -47
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-relative-url.js +0 -43
- package/dist/node_modules/next/dist/shared/lib/router/utils/parse-url.js +0 -44
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-has-prefix.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/router/utils/path-match.js +0 -62
- package/dist/node_modules/next/dist/shared/lib/router/utils/prepare-destination.js +0 -245
- package/dist/node_modules/next/dist/shared/lib/router/utils/querystring.js +0 -80
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-path-prefix.js +0 -52
- package/dist/node_modules/next/dist/shared/lib/router/utils/remove-trailing-slash.js +0 -35
- package/dist/node_modules/next/dist/shared/lib/router/utils/resolve-rewrites.js +0 -136
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-matcher.js +0 -53
- package/dist/node_modules/next/dist/shared/lib/router/utils/route-regex.js +0 -200
- package/dist/node_modules/next/dist/shared/lib/router/utils/sorted-routes.js +0 -182
- package/dist/node_modules/next/dist/shared/lib/router-context.shared-runtime.js +0 -33
- package/dist/node_modules/next/dist/shared/lib/segment.js +0 -28
- package/dist/node_modules/next/dist/shared/lib/utils.js +0 -196
- package/dist/node_modules/next/link.js +0 -7
- package/dist/node_modules/next/router.js +0 -6
- package/dist/node_modules/react-toastify/dist/react-toastify.esm.mjs.js +0 -7
- package/dist/node_modules/style-inject/dist/style-inject.es.js +0 -28
- package/dist/services/prisma.service.d.ts +0 -2
- package/dist/src/components/Accordeon/Accordeon.js +0 -14
- package/dist/src/components/Accordeon/styles.module.scss.js +0 -7
- package/dist/src/components/AuthButton/styles.module.scss.js +0 -4
- package/dist/src/components/CardButton/styles.module.scss.js +0 -4
- package/dist/src/components/Checkbox/styles.module.scss.js +0 -4
- package/dist/src/components/ChooseRole/styles.module.scss.js +0 -4
- package/dist/src/components/CopyCode/styles.module.scss.js +0 -4
- package/dist/src/components/Dialog/Dialog.js +0 -14
- package/dist/src/components/Dialog/styles.module.scss.js +0 -7
- package/dist/src/components/FormButton/styles.module.scss.js +0 -4
- package/dist/src/components/FormText/styles.module.scss.js +0 -4
- package/dist/src/components/ForwardButton/styles.module.scss.js +0 -4
- package/dist/src/components/Gap/Gap.js +0 -7
- package/dist/src/components/InputMail/styles.module.scss.js +0 -4
- package/dist/src/components/InputNames/styles.module.scss.js +0 -4
- package/dist/src/components/InputNumber/styles.module.scss.js +0 -4
- package/dist/src/components/InputPassword/styles.module.scss.js +0 -4
- package/dist/src/components/InputPin/styles.module.scss.js +0 -4
- package/dist/src/components/InputText/styles.module.scss.js +0 -4
- package/dist/src/components/OptionField/styles.module.scss.js +0 -4
- package/dist/src/components/OptionFieldHorizontal/styles.module.scss.js +0 -4
- package/dist/src/components/PrimaryButton/styles.module.scss.js +0 -4
- package/dist/src/components/ProgressBar/styles.module.scss.js +0 -4
- package/dist/src/components/RadioButtons/styles.module.scss.js +0 -4
- package/dist/src/components/RedirectButton/styles.module.scss.js +0 -4
- package/dist/src/components/SearchChips/styles.module.scss.js +0 -4
- package/dist/src/components/Searchbar/styles.module.scss.js +0 -4
- package/dist/src/components/Slider/styles.module.scss.js +0 -4
- package/dist/src/components/StepBack/styles.module.scss.js +0 -4
- package/dist/src/components/SvgIcon/SvgIcon.js +0 -9
- package/dist/src/components/Table/Table.js +0 -12
- package/dist/src/components/Table/styles.module.scss.js +0 -4
- package/dist/src/components/TextWithIcon/styles.module.scss.js +0 -4
- package/dist/src/components/UsageCard/styles.module.scss.js +0 -4
- package/dist/src/index.js +0 -36
- package/dist/types/Concept.d.ts +0 -7
- package/dist/types/Content.d.ts +0 -15
- package/dist/types/CourseAnnouncement.d.ts +0 -13
- package/dist/types/CourseAnnouncementAsset.d.ts +0 -22
- package/dist/types/CourseAnnouncementAssset.d.ts +0 -21
- package/dist/types/CourseMessage.d.ts +0 -13
- package/dist/types/CourseParticipant.d.ts +0 -9
- package/dist/types/CoursePin.d.ts +0 -8
- package/dist/types/File.d.ts +0 -13
- package/dist/types/HelpData.d.ts +0 -8
- package/dist/types/News.d.ts +0 -13
- package/dist/types/OrganizationMember.d.ts +0 -12
- package/dist/types/Page.d.ts +0 -8
- package/dist/types/ProductFeature.d.ts +0 -8
- package/dist/types/ProductLimit.d.ts +0 -8
- package/dist/types/PublicUser.d.ts +0 -7
- package/dist/types/index.d.ts +0 -2
- package/dist/types/marketing/BenefitForIndividuals.d.ts +0 -9
- package/dist/types/marketing/BenefitForSchools.d.ts +0 -9
- package/dist/types/marketing/Page.d.ts +0 -8
- package/dist/types/marketing/WebsiteData.d.ts +0 -23
@@ -1,35 +0,0 @@
|
|
1
|
-
import { __exports as removeTrailingSlash } from '../../../../../../../_virtual/remove-trailing-slash.js';
|
2
|
-
|
3
|
-
/**
|
4
|
-
* Removes the trailing slash for a given route or page path. Preserves the
|
5
|
-
* root page. Examples:
|
6
|
-
* - `/foo/bar/` -> `/foo/bar`
|
7
|
-
* - `/foo/bar` -> `/foo/bar`
|
8
|
-
* - `/` -> `/`
|
9
|
-
*/
|
10
|
-
|
11
|
-
var hasRequiredRemoveTrailingSlash;
|
12
|
-
|
13
|
-
function requireRemoveTrailingSlash () {
|
14
|
-
if (hasRequiredRemoveTrailingSlash) return removeTrailingSlash;
|
15
|
-
hasRequiredRemoveTrailingSlash = 1;
|
16
|
-
(function (exports) {
|
17
|
-
Object.defineProperty(exports, "__esModule", {
|
18
|
-
value: true
|
19
|
-
});
|
20
|
-
Object.defineProperty(exports, "removeTrailingSlash", {
|
21
|
-
enumerable: true,
|
22
|
-
get: function() {
|
23
|
-
return removeTrailingSlash;
|
24
|
-
}
|
25
|
-
});
|
26
|
-
function removeTrailingSlash(route) {
|
27
|
-
return route.replace(/\/$/, "") || "/";
|
28
|
-
}
|
29
|
-
|
30
|
-
|
31
|
-
} (removeTrailingSlash));
|
32
|
-
return removeTrailingSlash;
|
33
|
-
}
|
34
|
-
|
35
|
-
export { requireRemoveTrailingSlash as __require };
|
@@ -1,136 +0,0 @@
|
|
1
|
-
import { __exports as resolveRewrites } from '../../../../../../../_virtual/resolve-rewrites.js';
|
2
|
-
import { __require as requirePathMatch } from './path-match.js';
|
3
|
-
import { __require as requirePrepareDestination } from './prepare-destination.js';
|
4
|
-
import { __require as requireRemoveTrailingSlash } from './remove-trailing-slash.js';
|
5
|
-
import { __require as requireNormalizeLocalePath } from '../../i18n/normalize-locale-path.js';
|
6
|
-
import { __require as requireRemoveBasePath } from '../../../../client/remove-base-path.js';
|
7
|
-
import { __require as requireParseRelativeUrl } from './parse-relative-url.js';
|
8
|
-
|
9
|
-
var hasRequiredResolveRewrites;
|
10
|
-
|
11
|
-
function requireResolveRewrites () {
|
12
|
-
if (hasRequiredResolveRewrites) return resolveRewrites;
|
13
|
-
hasRequiredResolveRewrites = 1;
|
14
|
-
(function (exports) {
|
15
|
-
Object.defineProperty(exports, "__esModule", {
|
16
|
-
value: true
|
17
|
-
});
|
18
|
-
Object.defineProperty(exports, "default", {
|
19
|
-
enumerable: true,
|
20
|
-
get: function() {
|
21
|
-
return resolveRewrites;
|
22
|
-
}
|
23
|
-
});
|
24
|
-
const _pathmatch = requirePathMatch();
|
25
|
-
const _preparedestination = requirePrepareDestination();
|
26
|
-
const _removetrailingslash = requireRemoveTrailingSlash();
|
27
|
-
const _normalizelocalepath = requireNormalizeLocalePath();
|
28
|
-
const _removebasepath = requireRemoveBasePath();
|
29
|
-
const _parserelativeurl = requireParseRelativeUrl();
|
30
|
-
function resolveRewrites(asPath, pages, rewrites, query, resolveHref, locales) {
|
31
|
-
let matchedPage = false;
|
32
|
-
let externalDest = false;
|
33
|
-
let parsedAs = (0, _parserelativeurl.parseRelativeUrl)(asPath);
|
34
|
-
let fsPathname = (0, _removetrailingslash.removeTrailingSlash)((0, _normalizelocalepath.normalizeLocalePath)((0, _removebasepath.removeBasePath)(parsedAs.pathname), locales).pathname);
|
35
|
-
let resolvedHref;
|
36
|
-
const handleRewrite = (rewrite)=>{
|
37
|
-
const matcher = (0, _pathmatch.getPathMatch)(rewrite.source + (process.env.__NEXT_TRAILING_SLASH ? "(/)?" : ""), {
|
38
|
-
removeUnnamedParams: true,
|
39
|
-
strict: true
|
40
|
-
});
|
41
|
-
let params = matcher(parsedAs.pathname);
|
42
|
-
if ((rewrite.has || rewrite.missing) && params) {
|
43
|
-
const hasParams = (0, _preparedestination.matchHas)({
|
44
|
-
headers: {
|
45
|
-
host: document.location.hostname,
|
46
|
-
"user-agent": navigator.userAgent
|
47
|
-
},
|
48
|
-
cookies: document.cookie.split("; ").reduce((acc, item)=>{
|
49
|
-
const [key, ...value] = item.split("=");
|
50
|
-
acc[key] = value.join("=");
|
51
|
-
return acc;
|
52
|
-
}, {})
|
53
|
-
}, parsedAs.query, rewrite.has, rewrite.missing);
|
54
|
-
if (hasParams) {
|
55
|
-
Object.assign(params, hasParams);
|
56
|
-
} else {
|
57
|
-
params = false;
|
58
|
-
}
|
59
|
-
}
|
60
|
-
if (params) {
|
61
|
-
if (!rewrite.destination) {
|
62
|
-
// this is a proxied rewrite which isn't handled on the client
|
63
|
-
externalDest = true;
|
64
|
-
return true;
|
65
|
-
}
|
66
|
-
const destRes = (0, _preparedestination.prepareDestination)({
|
67
|
-
appendParamsToQuery: true,
|
68
|
-
destination: rewrite.destination,
|
69
|
-
params: params,
|
70
|
-
query: query
|
71
|
-
});
|
72
|
-
parsedAs = destRes.parsedDestination;
|
73
|
-
asPath = destRes.newUrl;
|
74
|
-
Object.assign(query, destRes.parsedDestination.query);
|
75
|
-
fsPathname = (0, _removetrailingslash.removeTrailingSlash)((0, _normalizelocalepath.normalizeLocalePath)((0, _removebasepath.removeBasePath)(asPath), locales).pathname);
|
76
|
-
if (pages.includes(fsPathname)) {
|
77
|
-
// check if we now match a page as this means we are done
|
78
|
-
// resolving the rewrites
|
79
|
-
matchedPage = true;
|
80
|
-
resolvedHref = fsPathname;
|
81
|
-
return true;
|
82
|
-
}
|
83
|
-
// check if we match a dynamic-route, if so we break the rewrites chain
|
84
|
-
resolvedHref = resolveHref(fsPathname);
|
85
|
-
if (resolvedHref !== asPath && pages.includes(resolvedHref)) {
|
86
|
-
matchedPage = true;
|
87
|
-
return true;
|
88
|
-
}
|
89
|
-
}
|
90
|
-
};
|
91
|
-
let finished = false;
|
92
|
-
for(let i = 0; i < rewrites.beforeFiles.length; i++){
|
93
|
-
// we don't end after match in beforeFiles to allow
|
94
|
-
// continuing through all beforeFiles rewrites
|
95
|
-
handleRewrite(rewrites.beforeFiles[i]);
|
96
|
-
}
|
97
|
-
matchedPage = pages.includes(fsPathname);
|
98
|
-
if (!matchedPage) {
|
99
|
-
if (!finished) {
|
100
|
-
for(let i = 0; i < rewrites.afterFiles.length; i++){
|
101
|
-
if (handleRewrite(rewrites.afterFiles[i])) {
|
102
|
-
finished = true;
|
103
|
-
break;
|
104
|
-
}
|
105
|
-
}
|
106
|
-
}
|
107
|
-
// check dynamic route before processing fallback rewrites
|
108
|
-
if (!finished) {
|
109
|
-
resolvedHref = resolveHref(fsPathname);
|
110
|
-
matchedPage = pages.includes(resolvedHref);
|
111
|
-
finished = matchedPage;
|
112
|
-
}
|
113
|
-
if (!finished) {
|
114
|
-
for(let i = 0; i < rewrites.fallback.length; i++){
|
115
|
-
if (handleRewrite(rewrites.fallback[i])) {
|
116
|
-
finished = true;
|
117
|
-
break;
|
118
|
-
}
|
119
|
-
}
|
120
|
-
}
|
121
|
-
}
|
122
|
-
return {
|
123
|
-
asPath,
|
124
|
-
parsedAs,
|
125
|
-
matchedPage,
|
126
|
-
resolvedHref,
|
127
|
-
externalDest
|
128
|
-
};
|
129
|
-
}
|
130
|
-
|
131
|
-
|
132
|
-
} (resolveRewrites));
|
133
|
-
return resolveRewrites;
|
134
|
-
}
|
135
|
-
|
136
|
-
export { requireResolveRewrites as __require };
|
@@ -1,53 +0,0 @@
|
|
1
|
-
import { __exports as routeMatcher } from '../../../../../../../_virtual/route-matcher.js';
|
2
|
-
import { __require as requireUtils } from '../../utils.js';
|
3
|
-
|
4
|
-
var hasRequiredRouteMatcher;
|
5
|
-
|
6
|
-
function requireRouteMatcher () {
|
7
|
-
if (hasRequiredRouteMatcher) return routeMatcher;
|
8
|
-
hasRequiredRouteMatcher = 1;
|
9
|
-
(function (exports) {
|
10
|
-
Object.defineProperty(exports, "__esModule", {
|
11
|
-
value: true
|
12
|
-
});
|
13
|
-
Object.defineProperty(exports, "getRouteMatcher", {
|
14
|
-
enumerable: true,
|
15
|
-
get: function() {
|
16
|
-
return getRouteMatcher;
|
17
|
-
}
|
18
|
-
});
|
19
|
-
const _utils = requireUtils();
|
20
|
-
function getRouteMatcher(param) {
|
21
|
-
let { re, groups } = param;
|
22
|
-
return (pathname)=>{
|
23
|
-
const routeMatch = re.exec(pathname);
|
24
|
-
if (!routeMatch) {
|
25
|
-
return false;
|
26
|
-
}
|
27
|
-
const decode = (param)=>{
|
28
|
-
try {
|
29
|
-
return decodeURIComponent(param);
|
30
|
-
} catch (_) {
|
31
|
-
throw new _utils.DecodeError("failed to decode param");
|
32
|
-
}
|
33
|
-
};
|
34
|
-
const params = {};
|
35
|
-
Object.keys(groups).forEach((slugName)=>{
|
36
|
-
const g = groups[slugName];
|
37
|
-
const m = routeMatch[g.pos];
|
38
|
-
if (m !== undefined) {
|
39
|
-
params[slugName] = ~m.indexOf("/") ? m.split("/").map((entry)=>decode(entry)) : g.repeat ? [
|
40
|
-
decode(m)
|
41
|
-
] : decode(m);
|
42
|
-
}
|
43
|
-
});
|
44
|
-
return params;
|
45
|
-
};
|
46
|
-
}
|
47
|
-
|
48
|
-
|
49
|
-
} (routeMatcher));
|
50
|
-
return routeMatcher;
|
51
|
-
}
|
52
|
-
|
53
|
-
export { requireRouteMatcher as __require };
|
@@ -1,200 +0,0 @@
|
|
1
|
-
import { __exports as routeRegex } from '../../../../../../../_virtual/route-regex.js';
|
2
|
-
import { __require as requireInterceptionRoutes } from '../../../../server/future/helpers/interception-routes.js';
|
3
|
-
import { __require as requireEscapeRegexp } from '../../escape-regexp.js';
|
4
|
-
import { __require as requireRemoveTrailingSlash } from './remove-trailing-slash.js';
|
5
|
-
|
6
|
-
var hasRequiredRouteRegex;
|
7
|
-
|
8
|
-
function requireRouteRegex () {
|
9
|
-
if (hasRequiredRouteRegex) return routeRegex;
|
10
|
-
hasRequiredRouteRegex = 1;
|
11
|
-
(function (exports) {
|
12
|
-
Object.defineProperty(exports, "__esModule", {
|
13
|
-
value: true
|
14
|
-
});
|
15
|
-
function _export(target, all) {
|
16
|
-
for(var name in all)Object.defineProperty(target, name, {
|
17
|
-
enumerable: true,
|
18
|
-
get: all[name]
|
19
|
-
});
|
20
|
-
}
|
21
|
-
_export(exports, {
|
22
|
-
getRouteRegex: function() {
|
23
|
-
return getRouteRegex;
|
24
|
-
},
|
25
|
-
getNamedRouteRegex: function() {
|
26
|
-
return getNamedRouteRegex;
|
27
|
-
},
|
28
|
-
getNamedMiddlewareRegex: function() {
|
29
|
-
return getNamedMiddlewareRegex;
|
30
|
-
}
|
31
|
-
});
|
32
|
-
const _interceptionroutes = requireInterceptionRoutes();
|
33
|
-
const _escaperegexp = requireEscapeRegexp();
|
34
|
-
const _removetrailingslash = requireRemoveTrailingSlash();
|
35
|
-
const NEXT_QUERY_PARAM_PREFIX = "nxtP";
|
36
|
-
const NEXT_INTERCEPTION_MARKER_PREFIX = "nxtI";
|
37
|
-
/**
|
38
|
-
* Parses a given parameter from a route to a data structure that can be used
|
39
|
-
* to generate the parametrized route. Examples:
|
40
|
-
* - `[...slug]` -> `{ key: 'slug', repeat: true, optional: true }`
|
41
|
-
* - `...slug` -> `{ key: 'slug', repeat: true, optional: false }`
|
42
|
-
* - `[foo]` -> `{ key: 'foo', repeat: false, optional: true }`
|
43
|
-
* - `bar` -> `{ key: 'bar', repeat: false, optional: false }`
|
44
|
-
*/ function parseParameter(param) {
|
45
|
-
const optional = param.startsWith("[") && param.endsWith("]");
|
46
|
-
if (optional) {
|
47
|
-
param = param.slice(1, -1);
|
48
|
-
}
|
49
|
-
const repeat = param.startsWith("...");
|
50
|
-
if (repeat) {
|
51
|
-
param = param.slice(3);
|
52
|
-
}
|
53
|
-
return {
|
54
|
-
key: param,
|
55
|
-
repeat,
|
56
|
-
optional
|
57
|
-
};
|
58
|
-
}
|
59
|
-
function getParametrizedRoute(route) {
|
60
|
-
const segments = (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split("/");
|
61
|
-
const groups = {};
|
62
|
-
let groupIndex = 1;
|
63
|
-
return {
|
64
|
-
parameterizedRoute: segments.map((segment)=>{
|
65
|
-
const markerMatch = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.find((m)=>segment.startsWith(m));
|
66
|
-
const paramMatches = segment.match(/\[((?:\[.*\])|.+)\]/) // Check for parameters
|
67
|
-
;
|
68
|
-
if (markerMatch && paramMatches) {
|
69
|
-
const { key, optional, repeat } = parseParameter(paramMatches[1]);
|
70
|
-
groups[key] = {
|
71
|
-
pos: groupIndex++,
|
72
|
-
repeat,
|
73
|
-
optional
|
74
|
-
};
|
75
|
-
return "/" + (0, _escaperegexp.escapeStringRegexp)(markerMatch) + "([^/]+?)";
|
76
|
-
} else if (paramMatches) {
|
77
|
-
const { key, repeat, optional } = parseParameter(paramMatches[1]);
|
78
|
-
groups[key] = {
|
79
|
-
pos: groupIndex++,
|
80
|
-
repeat,
|
81
|
-
optional
|
82
|
-
};
|
83
|
-
return repeat ? optional ? "(?:/(.+?))?" : "/(.+?)" : "/([^/]+?)";
|
84
|
-
} else {
|
85
|
-
return "/" + (0, _escaperegexp.escapeStringRegexp)(segment);
|
86
|
-
}
|
87
|
-
}).join(""),
|
88
|
-
groups
|
89
|
-
};
|
90
|
-
}
|
91
|
-
function getRouteRegex(normalizedRoute) {
|
92
|
-
const { parameterizedRoute, groups } = getParametrizedRoute(normalizedRoute);
|
93
|
-
return {
|
94
|
-
re: new RegExp("^" + parameterizedRoute + "(?:/)?$"),
|
95
|
-
groups: groups
|
96
|
-
};
|
97
|
-
}
|
98
|
-
/**
|
99
|
-
* Builds a function to generate a minimal routeKey using only a-z and minimal
|
100
|
-
* number of characters.
|
101
|
-
*/ function buildGetSafeRouteKey() {
|
102
|
-
let i = 0;
|
103
|
-
return ()=>{
|
104
|
-
let routeKey = "";
|
105
|
-
let j = ++i;
|
106
|
-
while(j > 0){
|
107
|
-
routeKey += String.fromCharCode(97 + (j - 1) % 26);
|
108
|
-
j = Math.floor((j - 1) / 26);
|
109
|
-
}
|
110
|
-
return routeKey;
|
111
|
-
};
|
112
|
-
}
|
113
|
-
function getSafeKeyFromSegment(param) {
|
114
|
-
let { getSafeRouteKey, segment, routeKeys, keyPrefix } = param;
|
115
|
-
const { key, optional, repeat } = parseParameter(segment);
|
116
|
-
// replace any non-word characters since they can break
|
117
|
-
// the named regex
|
118
|
-
let cleanedKey = key.replace(/\W/g, "");
|
119
|
-
if (keyPrefix) {
|
120
|
-
cleanedKey = "" + keyPrefix + cleanedKey;
|
121
|
-
}
|
122
|
-
let invalidKey = false;
|
123
|
-
// check if the key is still invalid and fallback to using a known
|
124
|
-
// safe key
|
125
|
-
if (cleanedKey.length === 0 || cleanedKey.length > 30) {
|
126
|
-
invalidKey = true;
|
127
|
-
}
|
128
|
-
if (!isNaN(parseInt(cleanedKey.slice(0, 1)))) {
|
129
|
-
invalidKey = true;
|
130
|
-
}
|
131
|
-
if (invalidKey) {
|
132
|
-
cleanedKey = getSafeRouteKey();
|
133
|
-
}
|
134
|
-
if (keyPrefix) {
|
135
|
-
routeKeys[cleanedKey] = "" + keyPrefix + key;
|
136
|
-
} else {
|
137
|
-
routeKeys[cleanedKey] = "" + key;
|
138
|
-
}
|
139
|
-
return repeat ? optional ? "(?:/(?<" + cleanedKey + ">.+?))?" : "/(?<" + cleanedKey + ">.+?)" : "/(?<" + cleanedKey + ">[^/]+?)";
|
140
|
-
}
|
141
|
-
function getNamedParametrizedRoute(route, prefixRouteKeys) {
|
142
|
-
const segments = (0, _removetrailingslash.removeTrailingSlash)(route).slice(1).split("/");
|
143
|
-
const getSafeRouteKey = buildGetSafeRouteKey();
|
144
|
-
const routeKeys = {};
|
145
|
-
return {
|
146
|
-
namedParameterizedRoute: segments.map((segment)=>{
|
147
|
-
const hasInterceptionMarker = _interceptionroutes.INTERCEPTION_ROUTE_MARKERS.some((m)=>segment.startsWith(m));
|
148
|
-
const paramMatches = segment.match(/\[((?:\[.*\])|.+)\]/) // Check for parameters
|
149
|
-
;
|
150
|
-
if (hasInterceptionMarker && paramMatches) {
|
151
|
-
return getSafeKeyFromSegment({
|
152
|
-
getSafeRouteKey,
|
153
|
-
segment: paramMatches[1],
|
154
|
-
routeKeys,
|
155
|
-
keyPrefix: prefixRouteKeys ? NEXT_INTERCEPTION_MARKER_PREFIX : undefined
|
156
|
-
});
|
157
|
-
} else if (paramMatches) {
|
158
|
-
return getSafeKeyFromSegment({
|
159
|
-
getSafeRouteKey,
|
160
|
-
segment: paramMatches[1],
|
161
|
-
routeKeys,
|
162
|
-
keyPrefix: prefixRouteKeys ? NEXT_QUERY_PARAM_PREFIX : undefined
|
163
|
-
});
|
164
|
-
} else {
|
165
|
-
return "/" + (0, _escaperegexp.escapeStringRegexp)(segment);
|
166
|
-
}
|
167
|
-
}).join(""),
|
168
|
-
routeKeys
|
169
|
-
};
|
170
|
-
}
|
171
|
-
function getNamedRouteRegex(normalizedRoute, prefixRouteKey) {
|
172
|
-
const result = getNamedParametrizedRoute(normalizedRoute, prefixRouteKey);
|
173
|
-
return {
|
174
|
-
...getRouteRegex(normalizedRoute),
|
175
|
-
namedRegex: "^" + result.namedParameterizedRoute + "(?:/)?$",
|
176
|
-
routeKeys: result.routeKeys
|
177
|
-
};
|
178
|
-
}
|
179
|
-
function getNamedMiddlewareRegex(normalizedRoute, options) {
|
180
|
-
const { parameterizedRoute } = getParametrizedRoute(normalizedRoute);
|
181
|
-
const { catchAll = true } = options;
|
182
|
-
if (parameterizedRoute === "/") {
|
183
|
-
let catchAllRegex = catchAll ? ".*" : "";
|
184
|
-
return {
|
185
|
-
namedRegex: "^/" + catchAllRegex + "$"
|
186
|
-
};
|
187
|
-
}
|
188
|
-
const { namedParameterizedRoute } = getNamedParametrizedRoute(normalizedRoute, false);
|
189
|
-
let catchAllGroupedRegex = catchAll ? "(?:(/.*)?)" : "";
|
190
|
-
return {
|
191
|
-
namedRegex: "^" + namedParameterizedRoute + catchAllGroupedRegex + "$"
|
192
|
-
};
|
193
|
-
}
|
194
|
-
|
195
|
-
|
196
|
-
} (routeRegex));
|
197
|
-
return routeRegex;
|
198
|
-
}
|
199
|
-
|
200
|
-
export { requireRouteRegex as __require };
|
@@ -1,182 +0,0 @@
|
|
1
|
-
import { __exports as sortedRoutes } from '../../../../../../../_virtual/sorted-routes.js';
|
2
|
-
|
3
|
-
var hasRequiredSortedRoutes;
|
4
|
-
|
5
|
-
function requireSortedRoutes () {
|
6
|
-
if (hasRequiredSortedRoutes) return sortedRoutes;
|
7
|
-
hasRequiredSortedRoutes = 1;
|
8
|
-
(function (exports) {
|
9
|
-
Object.defineProperty(exports, "__esModule", {
|
10
|
-
value: true
|
11
|
-
});
|
12
|
-
Object.defineProperty(exports, "getSortedRoutes", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function() {
|
15
|
-
return getSortedRoutes;
|
16
|
-
}
|
17
|
-
});
|
18
|
-
class UrlNode {
|
19
|
-
insert(urlPath) {
|
20
|
-
this._insert(urlPath.split("/").filter(Boolean), [], false);
|
21
|
-
}
|
22
|
-
smoosh() {
|
23
|
-
return this._smoosh();
|
24
|
-
}
|
25
|
-
_smoosh(prefix) {
|
26
|
-
if (prefix === void 0) prefix = "/";
|
27
|
-
const childrenPaths = [
|
28
|
-
...this.children.keys()
|
29
|
-
].sort();
|
30
|
-
if (this.slugName !== null) {
|
31
|
-
childrenPaths.splice(childrenPaths.indexOf("[]"), 1);
|
32
|
-
}
|
33
|
-
if (this.restSlugName !== null) {
|
34
|
-
childrenPaths.splice(childrenPaths.indexOf("[...]"), 1);
|
35
|
-
}
|
36
|
-
if (this.optionalRestSlugName !== null) {
|
37
|
-
childrenPaths.splice(childrenPaths.indexOf("[[...]]"), 1);
|
38
|
-
}
|
39
|
-
const routes = childrenPaths.map((c)=>this.children.get(c)._smoosh("" + prefix + c + "/")).reduce((prev, curr)=>[
|
40
|
-
...prev,
|
41
|
-
...curr
|
42
|
-
], []);
|
43
|
-
if (this.slugName !== null) {
|
44
|
-
routes.push(...this.children.get("[]")._smoosh(prefix + "[" + this.slugName + "]/"));
|
45
|
-
}
|
46
|
-
if (!this.placeholder) {
|
47
|
-
const r = prefix === "/" ? "/" : prefix.slice(0, -1);
|
48
|
-
if (this.optionalRestSlugName != null) {
|
49
|
-
throw new Error('You cannot define a route with the same specificity as a optional catch-all route ("' + r + '" and "' + r + "[[..." + this.optionalRestSlugName + ']]").');
|
50
|
-
}
|
51
|
-
routes.unshift(r);
|
52
|
-
}
|
53
|
-
if (this.restSlugName !== null) {
|
54
|
-
routes.push(...this.children.get("[...]")._smoosh(prefix + "[..." + this.restSlugName + "]/"));
|
55
|
-
}
|
56
|
-
if (this.optionalRestSlugName !== null) {
|
57
|
-
routes.push(...this.children.get("[[...]]")._smoosh(prefix + "[[..." + this.optionalRestSlugName + "]]/"));
|
58
|
-
}
|
59
|
-
return routes;
|
60
|
-
}
|
61
|
-
_insert(urlPaths, slugNames, isCatchAll) {
|
62
|
-
if (urlPaths.length === 0) {
|
63
|
-
this.placeholder = false;
|
64
|
-
return;
|
65
|
-
}
|
66
|
-
if (isCatchAll) {
|
67
|
-
throw new Error("Catch-all must be the last part of the URL.");
|
68
|
-
}
|
69
|
-
// The next segment in the urlPaths list
|
70
|
-
let nextSegment = urlPaths[0];
|
71
|
-
// Check if the segment matches `[something]`
|
72
|
-
if (nextSegment.startsWith("[") && nextSegment.endsWith("]")) {
|
73
|
-
// Strip `[` and `]`, leaving only `something`
|
74
|
-
let segmentName = nextSegment.slice(1, -1);
|
75
|
-
let isOptional = false;
|
76
|
-
if (segmentName.startsWith("[") && segmentName.endsWith("]")) {
|
77
|
-
// Strip optional `[` and `]`, leaving only `something`
|
78
|
-
segmentName = segmentName.slice(1, -1);
|
79
|
-
isOptional = true;
|
80
|
-
}
|
81
|
-
if (segmentName.startsWith("...")) {
|
82
|
-
// Strip `...`, leaving only `something`
|
83
|
-
segmentName = segmentName.substring(3);
|
84
|
-
isCatchAll = true;
|
85
|
-
}
|
86
|
-
if (segmentName.startsWith("[") || segmentName.endsWith("]")) {
|
87
|
-
throw new Error("Segment names may not start or end with extra brackets ('" + segmentName + "').");
|
88
|
-
}
|
89
|
-
if (segmentName.startsWith(".")) {
|
90
|
-
throw new Error("Segment names may not start with erroneous periods ('" + segmentName + "').");
|
91
|
-
}
|
92
|
-
function handleSlug(previousSlug, nextSlug) {
|
93
|
-
if (previousSlug !== null) {
|
94
|
-
// If the specific segment already has a slug but the slug is not `something`
|
95
|
-
// This prevents collisions like:
|
96
|
-
// pages/[post]/index.js
|
97
|
-
// pages/[id]/index.js
|
98
|
-
// Because currently multiple dynamic params on the same segment level are not supported
|
99
|
-
if (previousSlug !== nextSlug) {
|
100
|
-
// TODO: This error seems to be confusing for users, needs an error link, the description can be based on above comment.
|
101
|
-
throw new Error("You cannot use different slug names for the same dynamic path ('" + previousSlug + "' !== '" + nextSlug + "').");
|
102
|
-
}
|
103
|
-
}
|
104
|
-
slugNames.forEach((slug)=>{
|
105
|
-
if (slug === nextSlug) {
|
106
|
-
throw new Error('You cannot have the same slug name "' + nextSlug + '" repeat within a single dynamic path');
|
107
|
-
}
|
108
|
-
if (slug.replace(/\W/g, "") === nextSegment.replace(/\W/g, "")) {
|
109
|
-
throw new Error('You cannot have the slug names "' + slug + '" and "' + nextSlug + '" differ only by non-word symbols within a single dynamic path');
|
110
|
-
}
|
111
|
-
});
|
112
|
-
slugNames.push(nextSlug);
|
113
|
-
}
|
114
|
-
if (isCatchAll) {
|
115
|
-
if (isOptional) {
|
116
|
-
if (this.restSlugName != null) {
|
117
|
-
throw new Error('You cannot use both an required and optional catch-all route at the same level ("[...' + this.restSlugName + ']" and "' + urlPaths[0] + '" ).');
|
118
|
-
}
|
119
|
-
handleSlug(this.optionalRestSlugName, segmentName);
|
120
|
-
// slugName is kept as it can only be one particular slugName
|
121
|
-
this.optionalRestSlugName = segmentName;
|
122
|
-
// nextSegment is overwritten to [[...]] so that it can later be sorted specifically
|
123
|
-
nextSegment = "[[...]]";
|
124
|
-
} else {
|
125
|
-
if (this.optionalRestSlugName != null) {
|
126
|
-
throw new Error('You cannot use both an optional and required catch-all route at the same level ("[[...' + this.optionalRestSlugName + ']]" and "' + urlPaths[0] + '").');
|
127
|
-
}
|
128
|
-
handleSlug(this.restSlugName, segmentName);
|
129
|
-
// slugName is kept as it can only be one particular slugName
|
130
|
-
this.restSlugName = segmentName;
|
131
|
-
// nextSegment is overwritten to [...] so that it can later be sorted specifically
|
132
|
-
nextSegment = "[...]";
|
133
|
-
}
|
134
|
-
} else {
|
135
|
-
if (isOptional) {
|
136
|
-
throw new Error('Optional route parameters are not yet supported ("' + urlPaths[0] + '").');
|
137
|
-
}
|
138
|
-
handleSlug(this.slugName, segmentName);
|
139
|
-
// slugName is kept as it can only be one particular slugName
|
140
|
-
this.slugName = segmentName;
|
141
|
-
// nextSegment is overwritten to [] so that it can later be sorted specifically
|
142
|
-
nextSegment = "[]";
|
143
|
-
}
|
144
|
-
}
|
145
|
-
// If this UrlNode doesn't have the nextSegment yet we create a new child UrlNode
|
146
|
-
if (!this.children.has(nextSegment)) {
|
147
|
-
this.children.set(nextSegment, new UrlNode());
|
148
|
-
}
|
149
|
-
this.children.get(nextSegment)._insert(urlPaths.slice(1), slugNames, isCatchAll);
|
150
|
-
}
|
151
|
-
constructor(){
|
152
|
-
this.placeholder = true;
|
153
|
-
this.children = new Map();
|
154
|
-
this.slugName = null;
|
155
|
-
this.restSlugName = null;
|
156
|
-
this.optionalRestSlugName = null;
|
157
|
-
}
|
158
|
-
}
|
159
|
-
function getSortedRoutes(normalizedPages) {
|
160
|
-
// First the UrlNode is created, and every UrlNode can have only 1 dynamic segment
|
161
|
-
// Eg you can't have pages/[post]/abc.js and pages/[hello]/something-else.js
|
162
|
-
// Only 1 dynamic segment per nesting level
|
163
|
-
// So in the case that is test/integration/dynamic-routing it'll be this:
|
164
|
-
// pages/[post]/comments.js
|
165
|
-
// pages/blog/[post]/comment/[id].js
|
166
|
-
// Both are fine because `pages/[post]` and `pages/blog` are on the same level
|
167
|
-
// So in this case `UrlNode` created here has `this.slugName === 'post'`
|
168
|
-
// And since your PR passed through `slugName` as an array basically it'd including it in too many possibilities
|
169
|
-
// Instead what has to be passed through is the upwards path's dynamic names
|
170
|
-
const root = new UrlNode();
|
171
|
-
// Here the `root` gets injected multiple paths, and insert will break them up into sublevels
|
172
|
-
normalizedPages.forEach((pagePath)=>root.insert(pagePath));
|
173
|
-
// Smoosh will then sort those sublevels up to the point where you get the correct route definition priority
|
174
|
-
return root.smoosh();
|
175
|
-
}
|
176
|
-
|
177
|
-
|
178
|
-
} (sortedRoutes));
|
179
|
-
return sortedRoutes;
|
180
|
-
}
|
181
|
-
|
182
|
-
export { requireSortedRoutes as __require };
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import { __exports as routerContext_sharedRuntime } from '../../../../../_virtual/router-context.shared-runtime.js';
|
2
|
-
import '../../../../@swc/helpers/cjs/_interop_require_default.cjs.js';
|
3
|
-
import React from 'react';
|
4
|
-
import { __exports as _interop_require_default } from '../../../../../_virtual/_interop_require_default.cjs.js';
|
5
|
-
|
6
|
-
var hasRequiredRouterContext_sharedRuntime;
|
7
|
-
|
8
|
-
function requireRouterContext_sharedRuntime () {
|
9
|
-
if (hasRequiredRouterContext_sharedRuntime) return routerContext_sharedRuntime;
|
10
|
-
hasRequiredRouterContext_sharedRuntime = 1;
|
11
|
-
(function (exports) {
|
12
|
-
Object.defineProperty(exports, "__esModule", {
|
13
|
-
value: true
|
14
|
-
});
|
15
|
-
Object.defineProperty(exports, "RouterContext", {
|
16
|
-
enumerable: true,
|
17
|
-
get: function() {
|
18
|
-
return RouterContext;
|
19
|
-
}
|
20
|
-
});
|
21
|
-
const _interop_require_default$1 = _interop_require_default;
|
22
|
-
const _react = /*#__PURE__*/ _interop_require_default$1._(React);
|
23
|
-
const RouterContext = _react.default.createContext(null);
|
24
|
-
if (process.env.NODE_ENV !== "production") {
|
25
|
-
RouterContext.displayName = "RouterContext";
|
26
|
-
}
|
27
|
-
|
28
|
-
|
29
|
-
} (routerContext_sharedRuntime));
|
30
|
-
return routerContext_sharedRuntime;
|
31
|
-
}
|
32
|
-
|
33
|
-
export { requireRouterContext_sharedRuntime as __require };
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import { __exports as segment } from '../../../../../_virtual/segment.js';
|
2
|
-
|
3
|
-
var hasRequiredSegment;
|
4
|
-
|
5
|
-
function requireSegment () {
|
6
|
-
if (hasRequiredSegment) return segment;
|
7
|
-
hasRequiredSegment = 1;
|
8
|
-
(function (exports) {
|
9
|
-
Object.defineProperty(exports, "__esModule", {
|
10
|
-
value: true
|
11
|
-
});
|
12
|
-
Object.defineProperty(exports, "isGroupSegment", {
|
13
|
-
enumerable: true,
|
14
|
-
get: function() {
|
15
|
-
return isGroupSegment;
|
16
|
-
}
|
17
|
-
});
|
18
|
-
function isGroupSegment(segment) {
|
19
|
-
// Use array[0] for performant purpose
|
20
|
-
return segment[0] === "(" && segment.endsWith(")");
|
21
|
-
}
|
22
|
-
|
23
|
-
|
24
|
-
} (segment));
|
25
|
-
return segment;
|
26
|
-
}
|
27
|
-
|
28
|
-
export { requireSegment as __require };
|