@cedarjs/router 5.0.6 → 5.0.7-next.219
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/Set.d.ts +8 -0
- package/dist/Set.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -1
- package/package.json +26 -68
- package/dist/cjs/ActivePageContext.d.ts +0 -15
- package/dist/cjs/ActivePageContext.d.ts.map +0 -1
- package/dist/cjs/ActivePageContext.js +0 -42
- package/dist/cjs/AuthenticatedRoute.d.ts +0 -11
- package/dist/cjs/AuthenticatedRoute.d.ts.map +0 -1
- package/dist/cjs/AuthenticatedRoute.js +0 -83
- package/dist/cjs/PageLoadingContext.d.ts +0 -14
- package/dist/cjs/PageLoadingContext.d.ts.map +0 -1
- package/dist/cjs/PageLoadingContext.js +0 -64
- package/dist/cjs/Route.d.ts +0 -32
- package/dist/cjs/Route.d.ts.map +0 -1
- package/dist/cjs/Route.js +0 -41
- package/dist/cjs/Set.d.ts +0 -58
- package/dist/cjs/Set.d.ts.map +0 -1
- package/dist/cjs/Set.js +0 -67
- package/dist/cjs/a11yUtils.d.ts +0 -14
- package/dist/cjs/a11yUtils.d.ts.map +0 -1
- package/dist/cjs/a11yUtils.js +0 -61
- package/dist/cjs/active-route-loader.d.ts +0 -12
- package/dist/cjs/active-route-loader.d.ts.map +0 -1
- package/dist/cjs/active-route-loader.js +0 -116
- package/dist/cjs/analyzeRoutes.d.ts +0 -44
- package/dist/cjs/analyzeRoutes.d.ts.map +0 -1
- package/dist/cjs/analyzeRoutes.js +0 -143
- package/dist/cjs/createNamedContext.d.ts +0 -3
- package/dist/cjs/createNamedContext.d.ts.map +0 -1
- package/dist/cjs/createNamedContext.js +0 -33
- package/dist/cjs/dummyComponent.d.ts +0 -3
- package/dist/cjs/dummyComponent.d.ts.map +0 -1
- package/dist/cjs/dummyComponent.js +0 -24
- package/dist/cjs/history.d.ts +0 -24
- package/dist/cjs/history.d.ts.map +0 -1
- package/dist/cjs/history.js +0 -145
- package/dist/cjs/index.d.ts +0 -35
- package/dist/cjs/index.d.ts.map +0 -1
- package/dist/cjs/index.js +0 -110
- package/dist/cjs/link.d.ts +0 -9
- package/dist/cjs/link.d.ts.map +0 -1
- package/dist/cjs/link.js +0 -62
- package/dist/cjs/location.d.ts +0 -28
- package/dist/cjs/location.d.ts.map +0 -1
- package/dist/cjs/location.js +0 -110
- package/dist/cjs/namedRoutes.d.ts +0 -3
- package/dist/cjs/namedRoutes.d.ts.map +0 -1
- package/dist/cjs/namedRoutes.js +0 -28
- package/dist/cjs/navLink.d.ts +0 -11
- package/dist/cjs/navLink.d.ts.map +0 -1
- package/dist/cjs/navLink.js +0 -70
- package/dist/cjs/package.json +0 -1
- package/dist/cjs/page.d.ts +0 -28
- package/dist/cjs/page.d.ts.map +0 -1
- package/dist/cjs/page.js +0 -42
- package/dist/cjs/params.d.ts +0 -13
- package/dist/cjs/params.d.ts.map +0 -1
- package/dist/cjs/params.js +0 -64
- package/dist/cjs/react-util.d.ts +0 -3
- package/dist/cjs/react-util.d.ts.map +0 -1
- package/dist/cjs/react-util.js +0 -37
- package/dist/cjs/redirect.d.ts +0 -12
- package/dist/cjs/redirect.d.ts.map +0 -1
- package/dist/cjs/redirect.js +0 -35
- package/dist/cjs/route-announcement.d.ts +0 -13
- package/dist/cjs/route-announcement.d.ts.map +0 -1
- package/dist/cjs/route-announcement.js +0 -61
- package/dist/cjs/route-focus.d.ts +0 -12
- package/dist/cjs/route-focus.d.ts.map +0 -1
- package/dist/cjs/route-focus.js +0 -36
- package/dist/cjs/route-validators.d.ts +0 -21
- package/dist/cjs/route-validators.d.ts.map +0 -1
- package/dist/cjs/route-validators.js +0 -71
- package/dist/cjs/routeParamsTypes.d.ts +0 -49
- package/dist/cjs/routeParamsTypes.d.ts.map +0 -1
- package/dist/cjs/routeParamsTypes.js +0 -16
- package/dist/cjs/router-context.d.ts +0 -23
- package/dist/cjs/router-context.d.ts.map +0 -1
- package/dist/cjs/router-context.js +0 -69
- package/dist/cjs/router.d.ts +0 -11
- package/dist/cjs/router.d.ts.map +0 -1
- package/dist/cjs/router.js +0 -207
- package/dist/cjs/rsc/ClientRouter.d.ts +0 -4
- package/dist/cjs/rsc/ClientRouter.d.ts.map +0 -1
- package/dist/cjs/rsc/ClientRouter.js +0 -90
- package/dist/cjs/rsc/RscCache.d.ts +0 -23
- package/dist/cjs/rsc/RscCache.d.ts.map +0 -1
- package/dist/cjs/rsc/RscCache.js +0 -110
- package/dist/cjs/rsc/RscRoutes.d.ts +0 -7
- package/dist/cjs/rsc/RscRoutes.d.ts.map +0 -1
- package/dist/cjs/rsc/RscRoutes.js +0 -124
- package/dist/cjs/rsc/ServerRouteLoader.d.ts +0 -12
- package/dist/cjs/rsc/ServerRouteLoader.d.ts.map +0 -1
- package/dist/cjs/rsc/ServerRouteLoader.js +0 -65
- package/dist/cjs/rsc/ServerRouter.d.ts +0 -11
- package/dist/cjs/rsc/ServerRouter.d.ts.map +0 -1
- package/dist/cjs/rsc/ServerRouter.js +0 -170
- package/dist/cjs/rsc/SsrRouter.d.ts +0 -4
- package/dist/cjs/rsc/SsrRouter.d.ts.map +0 -1
- package/dist/cjs/rsc/SsrRouter.js +0 -56
- package/dist/cjs/rsc/clientSsr.d.ts +0 -2
- package/dist/cjs/rsc/clientSsr.d.ts.map +0 -1
- package/dist/cjs/rsc/clientSsr.js +0 -114
- package/dist/cjs/rsc/rscCss.d.ts +0 -2
- package/dist/cjs/rsc/rscCss.d.ts.map +0 -1
- package/dist/cjs/rsc/rscCss.js +0 -94
- package/dist/cjs/rsc/ssrModuleMap.d.ts +0 -14
- package/dist/cjs/rsc/ssrModuleMap.d.ts.map +0 -1
- package/dist/cjs/rsc/ssrModuleMap.js +0 -49
- package/dist/cjs/rsc/utils.d.ts +0 -22
- package/dist/cjs/rsc/utils.d.ts.map +0 -1
- package/dist/cjs/rsc/utils.js +0 -68
- package/dist/cjs/rsc-link.d.ts +0 -6
- package/dist/cjs/rsc-link.d.ts.map +0 -1
- package/dist/cjs/rsc-link.js +0 -41
- package/dist/cjs/skipNav.d.ts +0 -81
- package/dist/cjs/skipNav.d.ts.map +0 -1
- package/dist/cjs/skipNav.js +0 -69
- package/dist/cjs/splash-page.d.ts +0 -12
- package/dist/cjs/splash-page.d.ts.map +0 -1
- package/dist/cjs/splash-page.js +0 -503
- package/dist/cjs/useBlocker.d.ts +0 -11
- package/dist/cjs/useBlocker.d.ts.map +0 -1
- package/dist/cjs/useBlocker.js +0 -65
- package/dist/cjs/useIsMounted.d.ts +0 -2
- package/dist/cjs/useIsMounted.d.ts.map +0 -1
- package/dist/cjs/useIsMounted.js +0 -37
- package/dist/cjs/useMatch.d.ts +0 -43
- package/dist/cjs/useMatch.d.ts.map +0 -1
- package/dist/cjs/useMatch.js +0 -72
- package/dist/cjs/useRouteName.d.ts +0 -3
- package/dist/cjs/useRouteName.d.ts.map +0 -1
- package/dist/cjs/useRouteName.js +0 -40
- package/dist/cjs/useRoutePaths.d.ts +0 -4
- package/dist/cjs/useRoutePaths.d.ts.map +0 -1
- package/dist/cjs/useRoutePaths.js +0 -50
- package/dist/cjs/util.d.ts +0 -121
- package/dist/cjs/util.d.ts.map +0 -1
- package/dist/cjs/util.js +0 -214
package/dist/cjs/page.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/page.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,eAAe,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK;QAAE,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;KAAE,CAAA;IAC7E,aAAa,EACT,KAAK,CAAC,mBAAmB,CAAC,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,GACvD,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAA;CACjC;AAED,wBAAgB,MAAM,CACpB,UAAU,EAAE,IAAI,GAAG,KAAK,CAAC,aAAa,GACrC,UAAU,IAAI,IAAI,CAEpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,UAAU,EAAE,IAAI,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,GAC9C,IAAI,CAaN;AAED,MAAM,MAAM,QAAQ,GAChB,IAAI,GACJ,KAAK,CAAC,aAAa,CAAC,GAAG,CAAC,GACxB,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,OAAO,CAAC,CAAA"}
|
package/dist/cjs/page.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var page_exports = {};
|
|
20
|
-
__export(page_exports, {
|
|
21
|
-
isSpec: () => isSpec,
|
|
22
|
-
normalizePage: () => normalizePage
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(page_exports);
|
|
25
|
-
function isSpec(specOrPage) {
|
|
26
|
-
return specOrPage.LazyComponent !== void 0;
|
|
27
|
-
}
|
|
28
|
-
function normalizePage(specOrPage) {
|
|
29
|
-
if (isSpec(specOrPage)) {
|
|
30
|
-
return specOrPage;
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
name: specOrPage.name,
|
|
34
|
-
prerenderLoader: () => ({ default: specOrPage }),
|
|
35
|
-
LazyComponent: specOrPage
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
isSpec,
|
|
41
|
-
normalizePage
|
|
42
|
-
});
|
package/dist/cjs/params.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface ParamsContextProps {
|
|
3
|
-
params: Record<string, string>;
|
|
4
|
-
}
|
|
5
|
-
export declare const ParamsContext: React.Context<ParamsContextProps | undefined>;
|
|
6
|
-
interface Props {
|
|
7
|
-
allParams?: Record<any, any>;
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare const ParamsProvider: React.FC<Props>;
|
|
11
|
-
export declare const useParams: () => Record<string, string>;
|
|
12
|
-
export {};
|
|
13
|
-
//# sourceMappingURL=params.d.ts.map
|
package/dist/cjs/params.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"params.d.ts","sourceRoot":"","sources":["../../src/params.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAA;AAIzC,MAAM,WAAW,kBAAkB;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B;AAED,eAAO,MAAM,aAAa,+CAAmD,CAAA;AAE7E,UAAU,KAAK;IACb,SAAS,CAAC,EAAE,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAC3B;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAY1C,CAAA;AAED,eAAO,MAAM,SAAS,8BAQrB,CAAA"}
|
package/dist/cjs/params.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var params_exports = {};
|
|
30
|
-
__export(params_exports, {
|
|
31
|
-
ParamsContext: () => ParamsContext,
|
|
32
|
-
ParamsProvider: () => ParamsProvider,
|
|
33
|
-
useParams: () => useParams
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(params_exports);
|
|
36
|
-
var import_react = __toESM(require("react"), 1);
|
|
37
|
-
var import_createNamedContext = require("./createNamedContext.js");
|
|
38
|
-
const ParamsContext = (0, import_createNamedContext.createNamedContext)("Params");
|
|
39
|
-
const ParamsProvider = ({ allParams, children }) => {
|
|
40
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
41
|
-
ParamsContext.Provider,
|
|
42
|
-
{
|
|
43
|
-
value: {
|
|
44
|
-
params: {
|
|
45
|
-
...allParams
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
children
|
|
50
|
-
);
|
|
51
|
-
};
|
|
52
|
-
const useParams = () => {
|
|
53
|
-
const paramsContext = (0, import_react.useContext)(ParamsContext);
|
|
54
|
-
if (paramsContext === void 0) {
|
|
55
|
-
throw new Error("useParams must be used within a ParamsProvider");
|
|
56
|
-
}
|
|
57
|
-
return paramsContext.params;
|
|
58
|
-
};
|
|
59
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
60
|
-
0 && (module.exports = {
|
|
61
|
-
ParamsContext,
|
|
62
|
-
ParamsProvider,
|
|
63
|
-
useParams
|
|
64
|
-
});
|
package/dist/cjs/react-util.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"react-util.d.ts","sourceRoot":"","sources":["../../src/react-util.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAGtC,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,GAAG,SAAS,EAAE,CAU3D"}
|
package/dist/cjs/react-util.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var react_util_exports = {};
|
|
20
|
-
__export(react_util_exports, {
|
|
21
|
-
flattenAll: () => flattenAll
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(react_util_exports);
|
|
24
|
-
var import_react = require("react");
|
|
25
|
-
function flattenAll(children) {
|
|
26
|
-
const childrenArray = import_react.Children.toArray(children);
|
|
27
|
-
return childrenArray.flatMap((child) => {
|
|
28
|
-
if ((0, import_react.isValidElement)(child) && child.props.children) {
|
|
29
|
-
return [child, ...flattenAll(child.props.children)];
|
|
30
|
-
}
|
|
31
|
-
return [child];
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
35
|
-
0 && (module.exports = {
|
|
36
|
-
flattenAll
|
|
37
|
-
});
|
package/dist/cjs/redirect.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { NavigateOptions } from './history.js';
|
|
2
|
-
interface RedirectProps {
|
|
3
|
-
/** The path to redirect to */
|
|
4
|
-
to: string;
|
|
5
|
-
options?: NavigateOptions;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* A declarative way to redirect to a route name
|
|
9
|
-
*/
|
|
10
|
-
export declare const Redirect: ({ to, options }: RedirectProps) => null;
|
|
11
|
-
export {};
|
|
12
|
-
//# sourceMappingURL=redirect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redirect.d.ts","sourceRoot":"","sources":["../../src/redirect.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAA;AAGnD,UAAU,aAAa;IACrB,8BAA8B;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,CAAC,EAAE,eAAe,CAAA;CAC1B;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,GAAI,iBAAiB,aAAa,SAMtD,CAAA"}
|
package/dist/cjs/redirect.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var redirect_exports = {};
|
|
20
|
-
__export(redirect_exports, {
|
|
21
|
-
Redirect: () => Redirect
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(redirect_exports);
|
|
24
|
-
var import_react = require("react");
|
|
25
|
-
var import_history = require("./history.js");
|
|
26
|
-
const Redirect = ({ to, options }) => {
|
|
27
|
-
(0, import_react.useEffect)(() => {
|
|
28
|
-
(0, import_history.navigate)(to, options);
|
|
29
|
-
}, [to, options]);
|
|
30
|
-
return null;
|
|
31
|
-
};
|
|
32
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
Redirect
|
|
35
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* this initial implementation borrows (heavily!) from madalyn's great work at gatsby:
|
|
4
|
-
* - issue: https://github.com/gatsbyjs/gatsby/issues/21059
|
|
5
|
-
* - PR: https://github.com/gatsbyjs/gatsby/pull/26376
|
|
6
|
-
*/
|
|
7
|
-
declare const RouteAnnouncement: React.FC<RouteAnnouncementProps>;
|
|
8
|
-
export interface RouteAnnouncementProps {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
visuallyHidden?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export default RouteAnnouncement;
|
|
13
|
-
//# sourceMappingURL=route-announcement.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-announcement.d.ts","sourceRoot":"","sources":["../../src/route-announcement.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;GAIG;AACH,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA0BvD,CAAA;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB;AAED,eAAe,iBAAiB,CAAA"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var route_announcement_exports = {};
|
|
30
|
-
__export(route_announcement_exports, {
|
|
31
|
-
default: () => route_announcement_default
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(route_announcement_exports);
|
|
34
|
-
var import_react = __toESM(require("react"), 1);
|
|
35
|
-
const RouteAnnouncement = ({
|
|
36
|
-
children,
|
|
37
|
-
visuallyHidden = false,
|
|
38
|
-
...props
|
|
39
|
-
}) => {
|
|
40
|
-
const hiddenStyle = {
|
|
41
|
-
position: `absolute`,
|
|
42
|
-
top: `0`,
|
|
43
|
-
width: `1`,
|
|
44
|
-
height: `1`,
|
|
45
|
-
padding: `0`,
|
|
46
|
-
overflow: `hidden`,
|
|
47
|
-
clip: `rect(0, 0, 0, 0)`,
|
|
48
|
-
whiteSpace: `nowrap`,
|
|
49
|
-
border: `0`
|
|
50
|
-
};
|
|
51
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
52
|
-
"div",
|
|
53
|
-
{
|
|
54
|
-
...props,
|
|
55
|
-
"data-redwood-route-announcement": true,
|
|
56
|
-
style: visuallyHidden ? hiddenStyle : {}
|
|
57
|
-
},
|
|
58
|
-
children
|
|
59
|
-
);
|
|
60
|
-
};
|
|
61
|
-
var route_announcement_default = RouteAnnouncement;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
/**
|
|
3
|
-
* this initial implementation borrows (heavily!) from madalyn's great work at gatsby:
|
|
4
|
-
* - issue: https://github.com/gatsbyjs/gatsby/issues/21059
|
|
5
|
-
* - PR: https://github.com/gatsbyjs/gatsby/pull/26376
|
|
6
|
-
*/
|
|
7
|
-
declare const RouteFocus: React.FC<RouteFocusProps>;
|
|
8
|
-
export interface RouteFocusProps {
|
|
9
|
-
children: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export default RouteFocus;
|
|
12
|
-
//# sourceMappingURL=route-focus.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-focus.d.ts","sourceRoot":"","sources":["../../src/route-focus.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB;;;;GAIG;AACH,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAIzC,CAAA;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,eAAe,UAAU,CAAA"}
|
package/dist/cjs/route-focus.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var route_focus_exports = {};
|
|
30
|
-
__export(route_focus_exports, {
|
|
31
|
-
default: () => route_focus_default
|
|
32
|
-
});
|
|
33
|
-
module.exports = __toCommonJS(route_focus_exports);
|
|
34
|
-
var import_react = __toESM(require("react"), 1);
|
|
35
|
-
const RouteFocus = ({ children, ...props }) => /* @__PURE__ */ import_react.default.createElement("div", { ...props, "data-redwood-route-focus": true }, children);
|
|
36
|
-
var route_focus_default = RouteFocus;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { ReactNode, ReactElement } from 'react';
|
|
2
|
-
import type { InternalRouteProps, NotFoundRouteProps, RedirectRouteProps, RouteProps } from './Route.js';
|
|
3
|
-
/**
|
|
4
|
-
* Narrows down the type of the Route element to RouteProps
|
|
5
|
-
*
|
|
6
|
-
* It means that it is not a notfound page or a redirected route
|
|
7
|
-
*/
|
|
8
|
-
export declare function isStandardRoute(node: ReactElement<InternalRouteProps>): node is ReactElement<RouteProps>;
|
|
9
|
-
/** Checks if a Route element is a Redirect Route */
|
|
10
|
-
export declare function isRedirectRoute(node: ReactElement<InternalRouteProps>): node is ReactElement<RedirectRouteProps>;
|
|
11
|
-
/** Checks if a Route element is a NotFound Route */
|
|
12
|
-
export declare function isNotFoundRoute(node: ReactElement<InternalRouteProps>): node is ReactElement<NotFoundRouteProps>;
|
|
13
|
-
/**
|
|
14
|
-
* Check that the Route element is ok
|
|
15
|
-
* and that it could be one of the following:
|
|
16
|
-
* <Route redirect .../> (redirect Route)
|
|
17
|
-
* <Route notfound .../> (notfound Route)
|
|
18
|
-
* <Route .../> (standard Route)
|
|
19
|
-
*/
|
|
20
|
-
export declare function isValidRoute(node: ReactNode): node is ReactElement<InternalRouteProps>;
|
|
21
|
-
//# sourceMappingURL=route-validators.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"route-validators.d.ts","sourceRoot":"","sources":["../../src/route-validators.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAA;AAGpD,OAAO,KAAK,EACV,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,UAAU,EACX,MAAM,YAAY,CAAA;AAanB;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,YAAY,CAAC,kBAAkB,CAAC,GACrC,IAAI,IAAI,YAAY,CAAC,UAAU,CAAC,CAElC;AAED,oDAAoD;AACpD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,YAAY,CAAC,kBAAkB,CAAC,GACrC,IAAI,IAAI,YAAY,CAAC,kBAAkB,CAAC,CAE1C;AAED,oDAAoD;AACpD,wBAAgB,eAAe,CAC7B,IAAI,EAAE,YAAY,CAAC,kBAAkB,CAAC,GACrC,IAAI,IAAI,YAAY,CAAC,kBAAkB,CAAC,CAE1C;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,GACd,IAAI,IAAI,YAAY,CAAC,kBAAkB,CAAC,CA8B1C"}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var route_validators_exports = {};
|
|
20
|
-
__export(route_validators_exports, {
|
|
21
|
-
isNotFoundRoute: () => isNotFoundRoute,
|
|
22
|
-
isRedirectRoute: () => isRedirectRoute,
|
|
23
|
-
isStandardRoute: () => isStandardRoute,
|
|
24
|
-
isValidRoute: () => isValidRoute
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(route_validators_exports);
|
|
27
|
-
var import_react = require("react");
|
|
28
|
-
var import_Route = require("./Route.js");
|
|
29
|
-
function isNodeTypeRoute(node) {
|
|
30
|
-
return (0, import_react.isValidElement)(node) && node.type === import_Route.Route;
|
|
31
|
-
}
|
|
32
|
-
function isString(value) {
|
|
33
|
-
return typeof value === "string";
|
|
34
|
-
}
|
|
35
|
-
function isStandardRoute(node) {
|
|
36
|
-
return !node.props.notfound && !node.props.redirect;
|
|
37
|
-
}
|
|
38
|
-
function isRedirectRoute(node) {
|
|
39
|
-
return !!node.props.redirect;
|
|
40
|
-
}
|
|
41
|
-
function isNotFoundRoute(node) {
|
|
42
|
-
return !!node.props.notfound;
|
|
43
|
-
}
|
|
44
|
-
function isValidRoute(node) {
|
|
45
|
-
const isValidRouteElement = isNodeTypeRoute(node);
|
|
46
|
-
if (isValidRouteElement) {
|
|
47
|
-
const notFoundOrRedirect = node.props.notfound || node.props.redirect;
|
|
48
|
-
const requiredKeys = [
|
|
49
|
-
!node.props.notfound && "path",
|
|
50
|
-
// redirects don't need an actual page, but notfound and standard do
|
|
51
|
-
!node.props.redirect && "page",
|
|
52
|
-
// Redirects can have names, but aren't required to
|
|
53
|
-
!notFoundOrRedirect && "name"
|
|
54
|
-
].filter(isString);
|
|
55
|
-
const missingKeys = requiredKeys.filter((key) => !(key in node.props));
|
|
56
|
-
if (missingKeys.length > 0) {
|
|
57
|
-
const stringToHelpIdentify = node.props.name || node.props.path ? `for "${node.props.name || node.props.path}" ` : "";
|
|
58
|
-
throw new Error(
|
|
59
|
-
`Route element ${stringToHelpIdentify}is missing required props: ` + missingKeys.join(", ")
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return isValidRouteElement;
|
|
64
|
-
}
|
|
65
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
-
0 && (module.exports = {
|
|
67
|
-
isNotFoundRoute,
|
|
68
|
-
isRedirectRoute,
|
|
69
|
-
isStandardRoute,
|
|
70
|
-
isValidRoute
|
|
71
|
-
});
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { A } from 'ts-toolbelt';
|
|
2
|
-
export type GenericParams = Record<string | number, string | number | boolean>;
|
|
3
|
-
export type QueryParams = GenericParams;
|
|
4
|
-
export type RouteParams<Route> = Route extends `${string}/${infer Rest}` ? A.Compute<ParsedParams<Rest>> : GenericParams;
|
|
5
|
-
export type ParamType<match> = match extends 'Int' ? number : match extends 'Boolean' ? boolean : match extends 'Float' ? number : string;
|
|
6
|
-
type ParamsFromGreedyMatch<TParam extends string, TMatch extends string, TRest extends string> = {
|
|
7
|
-
[ParamName in TParam as RemoveGlobDots<ParamName>]: string;
|
|
8
|
-
} & ParsedParams<`${TRest}:${TMatch}}`> & ParsedParams<`${TRest}`>;
|
|
9
|
-
type TypedParamInFront<TParam extends string, TMatch extends string, TRest extends string> = TParam extends `${infer Param2}}/${infer Rest2}` ? ParamsFromGreedyMatch<Param2, TMatch, Rest2> : // Otherwise its a regular match
|
|
10
|
-
{
|
|
11
|
-
[ParamName in TParam]: ParamType<TMatch>;
|
|
12
|
-
} & ParsedParams<`${TRest}`>;
|
|
13
|
-
type TypedParamAtEnd<TParam extends string, TMatch extends string> = TParam extends `${infer Param2}}/${infer Rest2}` ? {
|
|
14
|
-
[ParamName in Param2]: string;
|
|
15
|
-
} & ParsedParams<`${Rest2}:${TMatch}}`> : {
|
|
16
|
-
[ParamName in TParam]: ParamType<TMatch>;
|
|
17
|
-
};
|
|
18
|
-
type RemoveGlobDots<Param> = Param extends `${infer GlobParamName}...` ? GlobParamName : Param;
|
|
19
|
-
type MultiParamsWithoutType<TParam extends string, TRest extends string> = {
|
|
20
|
-
[ParamName in TParam as RemoveGlobDots<ParamName>]: string;
|
|
21
|
-
} & ParsedParams<`${TRest}`>;
|
|
22
|
-
type JustParamNoType<TParam extends string> = {
|
|
23
|
-
[ParamName in TParam as RemoveGlobDots<ParamName>]: string;
|
|
24
|
-
};
|
|
25
|
-
type ParsedParams<PartialRoute> = PartialRoute extends `${string}{${infer Param}:${infer Match}}${string}/${infer Rest}` ? TypedParamInFront<Param, Match, Rest> : PartialRoute extends `${string}{${infer Param}:${infer Match}}${string}` ? TypedParamAtEnd<Param, Match> : PartialRoute extends `${string}{${infer Param}}${string}/${infer Rest}` ? MultiParamsWithoutType<Param, Rest> : PartialRoute extends `${string}{${infer Param}}${string}` ? JustParamNoType<Param> : PartialRoute extends `${string}/${infer Rest}` ? ParsedParams<`${Rest}`> : GenericParams;
|
|
26
|
-
export {};
|
|
27
|
-
/**
|
|
28
|
-
* Translation in pseudocode without ternaries
|
|
29
|
-
*
|
|
30
|
-
if ('he{c:Int}lo/...rest') {
|
|
31
|
-
checkForGreedyMatch()
|
|
32
|
-
} else if ('he{c:Int}lo') {
|
|
33
|
-
typedParamAtEnd()
|
|
34
|
-
} else if ('he{c}yo/...rest') {
|
|
35
|
-
multipleParamsNoTypes()
|
|
36
|
-
} else if('he{d}yo') {
|
|
37
|
-
justParamNoType()
|
|
38
|
-
} else if ('bazinga/..rest') {
|
|
39
|
-
// Call itself
|
|
40
|
-
parseParamsRecursiveCall(rest)
|
|
41
|
-
} else{
|
|
42
|
-
// fallback, because it doesn't match any of the above
|
|
43
|
-
GenericParams
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
Its a bit odd, but the he{d}llo is a form we support in the router
|
|
47
|
-
// e.g. /signedUp/e{status:Boolean}y
|
|
48
|
-
**/
|
|
49
|
-
//# sourceMappingURL=routeParamsTypes.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"routeParamsTypes.d.ts","sourceRoot":"","sources":["../../src/routeParamsTypes.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
-
var routeParamsTypes_exports = {};
|
|
16
|
-
module.exports = __toCommonJS(routeParamsTypes_exports);
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { AuthContextInterface } from '@cedarjs/auth' with {
|
|
3
|
-
'resolution-mode': 'import'
|
|
4
|
-
};
|
|
5
|
-
import type { analyzeRoutes } from './analyzeRoutes.js';
|
|
6
|
-
import type { ParamType } from './util.js';
|
|
7
|
-
type UseAuth = () => AuthContextInterface<unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown, unknown>;
|
|
8
|
-
export interface RouterState {
|
|
9
|
-
paramTypes?: Record<string, ParamType>;
|
|
10
|
-
useAuth: UseAuth;
|
|
11
|
-
routes: ReturnType<typeof analyzeRoutes>;
|
|
12
|
-
activeRouteName?: string | undefined | null;
|
|
13
|
-
}
|
|
14
|
-
export interface RouterContextProviderProps extends Omit<RouterState, 'useAuth'> {
|
|
15
|
-
useAuth?: UseAuth;
|
|
16
|
-
routes: ReturnType<typeof analyzeRoutes>;
|
|
17
|
-
activeRouteName?: string | undefined | null;
|
|
18
|
-
children: React.ReactNode;
|
|
19
|
-
}
|
|
20
|
-
export declare const RouterContextProvider: React.FC<RouterContextProviderProps>;
|
|
21
|
-
export declare const useRouterState: () => RouterState;
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=router-context.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"router-context.d.ts","sourceRoot":"","sources":["../../src/router-context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6C,MAAM,OAAO,CAAA;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;IACxD,iBAAiB,EAAE,QAAQ;CAC5B,CAAA;AAGD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAE1C,KAAK,OAAO,GAAG,MAAM,oBAAoB,CACvC,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,CACR,CAAA;AAED,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACtC,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA;IACxC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;CAC5C;AAID,MAAM,WAAW,0BAA2B,SAAQ,IAAI,CACtD,WAAW,EACX,SAAS,CACV;IACC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA;IACxC,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;IAC3C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAC1B;AAED,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAsBtE,CAAA;AAED,eAAO,MAAM,cAAc,mBAU1B,CAAA"}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var router_context_exports = {};
|
|
30
|
-
__export(router_context_exports, {
|
|
31
|
-
RouterContextProvider: () => RouterContextProvider,
|
|
32
|
-
useRouterState: () => useRouterState
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(router_context_exports);
|
|
35
|
-
var import_react = __toESM(require("react"), 1);
|
|
36
|
-
var import_auth = require("@cedarjs/auth");
|
|
37
|
-
const RouterStateContext = (0, import_react.createContext)(void 0);
|
|
38
|
-
const RouterContextProvider = ({
|
|
39
|
-
useAuth,
|
|
40
|
-
paramTypes,
|
|
41
|
-
routes,
|
|
42
|
-
activeRouteName,
|
|
43
|
-
children
|
|
44
|
-
}) => {
|
|
45
|
-
const state = (0, import_react.useMemo)(
|
|
46
|
-
() => ({
|
|
47
|
-
useAuth: useAuth || import_auth.useNoAuth,
|
|
48
|
-
paramTypes,
|
|
49
|
-
routes,
|
|
50
|
-
activeRouteName
|
|
51
|
-
}),
|
|
52
|
-
[useAuth, paramTypes, routes, activeRouteName]
|
|
53
|
-
);
|
|
54
|
-
return /* @__PURE__ */ import_react.default.createElement(RouterStateContext.Provider, { value: state }, children);
|
|
55
|
-
};
|
|
56
|
-
const useRouterState = () => {
|
|
57
|
-
const context = (0, import_react.useContext)(RouterStateContext);
|
|
58
|
-
if (context === void 0) {
|
|
59
|
-
throw new Error(
|
|
60
|
-
"useRouterState must be used within a RouterContextProvider"
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
return context;
|
|
64
|
-
};
|
|
65
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
-
0 && (module.exports = {
|
|
67
|
-
RouterContextProvider,
|
|
68
|
-
useRouterState
|
|
69
|
-
});
|
package/dist/cjs/router.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import type { RouterContextProviderProps } from './router-context.js';
|
|
4
|
-
import type { TrailingSlashesTypes } from './util.js';
|
|
5
|
-
export interface RouterProps extends Omit<RouterContextProviderProps, 'routes' | 'activeRouteName'> {
|
|
6
|
-
trailingSlashes?: TrailingSlashesTypes;
|
|
7
|
-
pageLoadingDelay?: number;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
}
|
|
10
|
-
export declare const Router: React.FC<RouterProps>;
|
|
11
|
-
//# sourceMappingURL=router.d.ts.map
|
package/dist/cjs/router.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/router.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAwB,MAAM,OAAO,CAAA;AAY5C,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qBAAqB,CAAA;AAIrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAA;AAErD,MAAM,WAAW,WAAY,SAAQ,IAAI,CACvC,0BAA0B,EAC1B,QAAQ,GAAG,iBAAiB,CAC7B;IACC,eAAe,CAAC,EAAE,oBAAoB,CAAA;IACtC,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAoBxC,CAAA"}
|