@jfdevelops/react-layout 0.17.5 → 0.18.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/create-config/component-keys.cjs +44 -0
- package/dist/create-config/component-keys.cjs.map +1 -0
- package/dist/create-config/component-keys.mjs +39 -0
- package/dist/create-config/component-keys.mjs.map +1 -0
- package/dist/create-config/define-layout.cjs +16 -1
- package/dist/create-config/define-layout.cjs.map +1 -1
- package/dist/create-config/define-layout.d.cts +5 -3
- package/dist/create-config/define-layout.d.cts.map +1 -1
- package/dist/create-config/define-layout.d.mts +5 -3
- package/dist/create-config/define-layout.d.mts.map +1 -1
- package/dist/create-config/define-layout.mjs +16 -1
- package/dist/create-config/define-layout.mjs.map +1 -1
- package/dist/create-config/for-paths/builder.cjs +192 -0
- package/dist/create-config/for-paths/builder.cjs.map +1 -0
- package/dist/create-config/for-paths/builder.d.cts +77 -0
- package/dist/create-config/for-paths/builder.d.cts.map +1 -0
- package/dist/create-config/for-paths/builder.d.mts +77 -0
- package/dist/create-config/for-paths/builder.d.mts.map +1 -0
- package/dist/create-config/for-paths/builder.mjs +192 -0
- package/dist/create-config/for-paths/builder.mjs.map +1 -0
- package/dist/create-config/for-paths/get-component-for-path.cjs +55 -0
- package/dist/create-config/for-paths/get-component-for-path.cjs.map +1 -0
- package/dist/create-config/for-paths/get-component-for-path.d.cts +55 -0
- package/dist/create-config/for-paths/get-component-for-path.d.cts.map +1 -0
- package/dist/create-config/for-paths/get-component-for-path.d.mts +55 -0
- package/dist/create-config/for-paths/get-component-for-path.d.mts.map +1 -0
- package/dist/create-config/for-paths/get-component-for-path.mjs +55 -0
- package/dist/create-config/for-paths/get-component-for-path.mjs.map +1 -0
- package/dist/create-config/for-paths/index.d.cts +2 -0
- package/dist/create-config/for-paths/index.d.mts +2 -0
- package/dist/create-config/get-component.cjs +60 -11
- package/dist/create-config/get-component.cjs.map +1 -1
- package/dist/create-config/get-component.d.cts +75 -6
- package/dist/create-config/get-component.d.cts.map +1 -1
- package/dist/create-config/get-component.d.mts +75 -6
- package/dist/create-config/get-component.d.mts.map +1 -1
- package/dist/create-config/get-component.mjs +61 -11
- package/dist/create-config/get-component.mjs.map +1 -1
- package/dist/create-config/index.d.cts +6 -1
- package/dist/create-config/index.d.mts +6 -1
- package/dist/create-config/is-sub-resource-key.cjs +15 -0
- package/dist/create-config/is-sub-resource-key.cjs.map +1 -0
- package/dist/create-config/is-sub-resource-key.d.cts +30 -0
- package/dist/create-config/is-sub-resource-key.d.cts.map +1 -0
- package/dist/create-config/is-sub-resource-key.d.mts +30 -0
- package/dist/create-config/is-sub-resource-key.d.mts.map +1 -0
- package/dist/create-config/is-sub-resource-key.mjs +15 -0
- package/dist/create-config/is-sub-resource-key.mjs.map +1 -0
- package/dist/create-config/paths/generate.cjs +77 -0
- package/dist/create-config/paths/generate.cjs.map +1 -0
- package/dist/create-config/paths/generate.mjs +77 -0
- package/dist/create-config/paths/generate.mjs.map +1 -0
- package/dist/create-config/paths/index.d.cts +2 -0
- package/dist/create-config/paths/index.d.mts +2 -0
- package/dist/create-config/paths/introspect.cjs +123 -0
- package/dist/create-config/paths/introspect.cjs.map +1 -0
- package/dist/create-config/paths/introspect.mjs +118 -0
- package/dist/create-config/paths/introspect.mjs.map +1 -0
- package/dist/create-config/paths/resolve.cjs +130 -0
- package/dist/create-config/paths/resolve.cjs.map +1 -0
- package/dist/create-config/paths/resolve.mjs +129 -0
- package/dist/create-config/paths/resolve.mjs.map +1 -0
- package/dist/create-config/paths/types.d.cts +104 -0
- package/dist/create-config/paths/types.d.cts.map +1 -0
- package/dist/create-config/paths/types.d.mts +104 -0
- package/dist/create-config/paths/types.d.mts.map +1 -0
- package/dist/create-config/paths/variables.cjs +32 -0
- package/dist/create-config/paths/variables.cjs.map +1 -0
- package/dist/create-config/paths/variables.d.cts +32 -0
- package/dist/create-config/paths/variables.d.cts.map +1 -0
- package/dist/create-config/paths/variables.d.mts +32 -0
- package/dist/create-config/paths/variables.d.mts.map +1 -0
- package/dist/create-config/paths/variables.mjs +29 -0
- package/dist/create-config/paths/variables.mjs.map +1 -0
- package/dist/create-config/types.d.cts +28 -8
- package/dist/create-config/types.d.cts.map +1 -1
- package/dist/create-config/types.d.mts +28 -8
- package/dist/create-config/types.d.mts.map +1 -1
- package/dist/errors/invalid-component.cjs +21 -0
- package/dist/errors/invalid-component.cjs.map +1 -0
- package/dist/errors/invalid-component.d.cts +18 -0
- package/dist/errors/invalid-component.d.cts.map +1 -0
- package/dist/errors/invalid-component.d.mts +18 -0
- package/dist/errors/invalid-component.d.mts.map +1 -0
- package/dist/errors/invalid-component.mjs +21 -0
- package/dist/errors/invalid-component.mjs.map +1 -0
- package/dist/errors/invalid-config.cjs +13 -0
- package/dist/errors/invalid-config.cjs.map +1 -0
- package/dist/errors/invalid-config.d.cts +15 -0
- package/dist/errors/invalid-config.d.cts.map +1 -0
- package/dist/errors/invalid-config.d.mts +15 -0
- package/dist/errors/invalid-config.d.mts.map +1 -0
- package/dist/errors/invalid-config.mjs +13 -0
- package/dist/errors/invalid-config.mjs.map +1 -0
- package/dist/errors/invalid-path.cjs +18 -0
- package/dist/errors/invalid-path.cjs.map +1 -0
- package/dist/errors/invalid-path.d.cts +16 -0
- package/dist/errors/invalid-path.d.cts.map +1 -0
- package/dist/errors/invalid-path.d.mts +16 -0
- package/dist/errors/invalid-path.d.mts.map +1 -0
- package/dist/errors/invalid-path.mjs +18 -0
- package/dist/errors/invalid-path.mjs.map +1 -0
- package/dist/errors/invalid-resource.cjs +18 -0
- package/dist/errors/invalid-resource.cjs.map +1 -0
- package/dist/errors/invalid-resource.d.cts +16 -0
- package/dist/errors/invalid-resource.d.cts.map +1 -0
- package/dist/errors/invalid-resource.d.mts +16 -0
- package/dist/errors/invalid-resource.d.mts.map +1 -0
- package/dist/errors/invalid-resource.mjs +18 -0
- package/dist/errors/invalid-resource.mjs.map +1 -0
- package/dist/errors/invalid-sub-resource.cjs +18 -0
- package/dist/errors/invalid-sub-resource.cjs.map +1 -0
- package/dist/errors/invalid-sub-resource.d.cts +17 -0
- package/dist/errors/invalid-sub-resource.d.cts.map +1 -0
- package/dist/errors/invalid-sub-resource.d.mts +17 -0
- package/dist/errors/invalid-sub-resource.d.mts.map +1 -0
- package/dist/errors/invalid-sub-resource.mjs +18 -0
- package/dist/errors/invalid-sub-resource.mjs.map +1 -0
- package/dist/errors/missing-path-variable.cjs +18 -0
- package/dist/errors/missing-path-variable.cjs.map +1 -0
- package/dist/errors/missing-path-variable.d.cts +16 -0
- package/dist/errors/missing-path-variable.d.cts.map +1 -0
- package/dist/errors/missing-path-variable.d.mts +16 -0
- package/dist/errors/missing-path-variable.d.mts.map +1 -0
- package/dist/errors/missing-path-variable.mjs +18 -0
- package/dist/errors/missing-path-variable.mjs.map +1 -0
- package/dist/errors/react-layout-error.cjs +56 -0
- package/dist/errors/react-layout-error.cjs.map +1 -0
- package/dist/errors/react-layout-error.d.cts +46 -0
- package/dist/errors/react-layout-error.d.cts.map +1 -0
- package/dist/errors/react-layout-error.d.mts +46 -0
- package/dist/errors/react-layout-error.d.mts.map +1 -0
- package/dist/errors/react-layout-error.mjs +54 -0
- package/dist/errors/react-layout-error.mjs.map +1 -0
- package/dist/index.cjs +15 -0
- package/dist/index.d.cts +13 -1
- package/dist/index.d.mts +13 -1
- package/dist/index.mjs +8 -1
- package/dist/props.d.cts +1 -1
- package/dist/props.d.cts.map +1 -1
- package/dist/props.d.mts +1 -1
- package/dist/props.d.mts.map +1 -1
- package/dist/resource.cjs.map +1 -1
- package/dist/resource.d.cts +2 -2
- package/dist/resource.d.cts.map +1 -1
- package/dist/resource.d.mts +2 -2
- package/dist/resource.d.mts.map +1 -1
- package/dist/resource.mjs.map +1 -1
- package/dist/utils.d.cts +2 -1
- package/dist/utils.d.cts.map +1 -1
- package/dist/utils.d.mts +2 -1
- package/dist/utils.d.mts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid-sub-resource.cjs","names":["createReactLayoutError"],"sources":["../../src/errors/invalid-sub-resource.ts"],"sourcesContent":["import {\n createReactLayoutError,\n type ReactLayoutErrorContext,\n} from './react-layout-error';\n\nconst scope = 'subResource' as const;\n\n/** Context describing an unavailable sub-resource and its owning resource. */\nexport interface InvalidSubResourceContext\n extends ReactLayoutErrorContext<typeof scope> {\n subResource: unknown;\n resource?: string;\n validSubResources?: readonly string[];\n reason?: string;\n}\n\n/** Thrown when a requested sub-resource is invalid or unavailable. */\nexport class InvalidSubResourceError extends createReactLayoutError(\n { code: 'invalidSubResource', scope },\n)(\n (\n scope,\n {\n subResource,\n resource,\n validSubResources,\n reason,\n }: InvalidSubResourceContext,\n ) => {\n const quotedSubResource =\n JSON.stringify(subResource) ?? `\"${String(subResource)}\"`;\n const resourceMessage = resource ? ` for resource \"${resource}\"` : '';\n const reasonMessage = reason ? ` ${reason}` : '';\n const validSubResourcesMessage =\n validSubResources && validSubResources.length > 0\n ? ` Available sub-resources are ${new Intl.ListFormat('en', {\n style: 'long',\n type: 'disjunction',\n }).format(validSubResources)}.`\n : '';\n\n return `[${scope}]: Sub-resource ${quotedSubResource}${resourceMessage} is not available.${reasonMessage}${validSubResourcesMessage}`;\n },\n) {}\n"],"mappings":";;;AAKA,MAAM,QAAQ;;AAYd,IAAa,0BAAb,cAA6CA,kDAC3C;CAAE,MAAM;CAAsB;AAAM,CACtC,GAEI,OACA,EACE,aACA,UACA,mBACA,aAEC;CAaH,OAAO,IAAI,MAAM,kBAXf,KAAK,UAAU,WAAW,KAAK,IAAI,OAAO,WAAW,EAAE,KACjC,WAAW,kBAAkB,SAAS,KAAK,GAUI,oBATjD,SAAS,IAAI,WAAW,KAE5C,qBAAqB,kBAAkB,SAAS,IAC5C,gCAAgC,IAAI,KAAK,WAAW,MAAM;EACxD,OAAO;EACP,MAAM;CACR,CAAC,EAAE,OAAO,iBAAiB,EAAE,KAC7B;AAGR,CACF,EAAE,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CreatedReactLayoutError, ReactLayoutErrorContext } from "./react-layout-error.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/invalid-sub-resource.d.ts
|
|
4
|
+
declare const scope: "subResource";
|
|
5
|
+
/** Context describing an unavailable sub-resource and its owning resource. */
|
|
6
|
+
interface InvalidSubResourceContext extends ReactLayoutErrorContext<typeof scope> {
|
|
7
|
+
subResource: unknown;
|
|
8
|
+
resource?: string;
|
|
9
|
+
validSubResources?: readonly string[];
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const InvalidSubResourceError_base: CreatedReactLayoutError<"invalidSubResource", "subResource", InvalidSubResourceContext>;
|
|
13
|
+
/** Thrown when a requested sub-resource is invalid or unavailable. */
|
|
14
|
+
declare class InvalidSubResourceError extends InvalidSubResourceError_base {}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { InvalidSubResourceContext, InvalidSubResourceError };
|
|
17
|
+
//# sourceMappingURL=invalid-sub-resource.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid-sub-resource.d.cts","names":[],"sources":["../../src/errors/invalid-sub-resource.ts"],"mappings":";;;cAKM,KAAA;;UAGW,yBAAA,SACP,uBAAuB,QAAQ,KAAA;EACvC,WAAA;EACA,QAAA;EACA,iBAAA;EACA,MAAA;AAAA;AAAA,cACD,4BAAA;;cAGY,uBAAA,SAAgC,4BA0B5C"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { CreatedReactLayoutError, ReactLayoutErrorContext } from "./react-layout-error.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/invalid-sub-resource.d.ts
|
|
4
|
+
declare const scope: "subResource";
|
|
5
|
+
/** Context describing an unavailable sub-resource and its owning resource. */
|
|
6
|
+
interface InvalidSubResourceContext extends ReactLayoutErrorContext<typeof scope> {
|
|
7
|
+
subResource: unknown;
|
|
8
|
+
resource?: string;
|
|
9
|
+
validSubResources?: readonly string[];
|
|
10
|
+
reason?: string;
|
|
11
|
+
}
|
|
12
|
+
declare const InvalidSubResourceError_base: CreatedReactLayoutError<"invalidSubResource", "subResource", InvalidSubResourceContext>;
|
|
13
|
+
/** Thrown when a requested sub-resource is invalid or unavailable. */
|
|
14
|
+
declare class InvalidSubResourceError extends InvalidSubResourceError_base {}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { InvalidSubResourceContext, InvalidSubResourceError };
|
|
17
|
+
//# sourceMappingURL=invalid-sub-resource.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid-sub-resource.d.mts","names":[],"sources":["../../src/errors/invalid-sub-resource.ts"],"mappings":";;;cAKM,KAAA;;UAGW,yBAAA,SACP,uBAAuB,QAAQ,KAAA;EACvC,WAAA;EACA,QAAA;EACA,iBAAA;EACA,MAAA;AAAA;AAAA,cACD,4BAAA;;cAGY,uBAAA,SAAgC,4BA0B5C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createReactLayoutError } from "./react-layout-error.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/invalid-sub-resource.ts
|
|
4
|
+
const scope = "subResource";
|
|
5
|
+
/** Thrown when a requested sub-resource is invalid or unavailable. */
|
|
6
|
+
var InvalidSubResourceError = class extends createReactLayoutError({
|
|
7
|
+
code: "invalidSubResource",
|
|
8
|
+
scope
|
|
9
|
+
})((scope, { subResource, resource, validSubResources, reason }) => {
|
|
10
|
+
return `[${scope}]: Sub-resource ${JSON.stringify(subResource) ?? `"${String(subResource)}"`}${resource ? ` for resource "${resource}"` : ""} is not available.${reason ? ` ${reason}` : ""}${validSubResources && validSubResources.length > 0 ? ` Available sub-resources are ${new Intl.ListFormat("en", {
|
|
11
|
+
style: "long",
|
|
12
|
+
type: "disjunction"
|
|
13
|
+
}).format(validSubResources)}.` : ""}`;
|
|
14
|
+
}) {};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { InvalidSubResourceError };
|
|
18
|
+
//# sourceMappingURL=invalid-sub-resource.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"invalid-sub-resource.mjs","names":[],"sources":["../../src/errors/invalid-sub-resource.ts"],"sourcesContent":["import {\n createReactLayoutError,\n type ReactLayoutErrorContext,\n} from './react-layout-error';\n\nconst scope = 'subResource' as const;\n\n/** Context describing an unavailable sub-resource and its owning resource. */\nexport interface InvalidSubResourceContext\n extends ReactLayoutErrorContext<typeof scope> {\n subResource: unknown;\n resource?: string;\n validSubResources?: readonly string[];\n reason?: string;\n}\n\n/** Thrown when a requested sub-resource is invalid or unavailable. */\nexport class InvalidSubResourceError extends createReactLayoutError(\n { code: 'invalidSubResource', scope },\n)(\n (\n scope,\n {\n subResource,\n resource,\n validSubResources,\n reason,\n }: InvalidSubResourceContext,\n ) => {\n const quotedSubResource =\n JSON.stringify(subResource) ?? `\"${String(subResource)}\"`;\n const resourceMessage = resource ? ` for resource \"${resource}\"` : '';\n const reasonMessage = reason ? ` ${reason}` : '';\n const validSubResourcesMessage =\n validSubResources && validSubResources.length > 0\n ? ` Available sub-resources are ${new Intl.ListFormat('en', {\n style: 'long',\n type: 'disjunction',\n }).format(validSubResources)}.`\n : '';\n\n return `[${scope}]: Sub-resource ${quotedSubResource}${resourceMessage} is not available.${reasonMessage}${validSubResourcesMessage}`;\n },\n) {}\n"],"mappings":";;;AAKA,MAAM,QAAQ;;AAYd,IAAa,0BAAb,cAA6C,uBAC3C;CAAE,MAAM;CAAsB;AAAM,CACtC,GAEI,OACA,EACE,aACA,UACA,mBACA,aAEC;CAaH,OAAO,IAAI,MAAM,kBAXf,KAAK,UAAU,WAAW,KAAK,IAAI,OAAO,WAAW,EAAE,KACjC,WAAW,kBAAkB,SAAS,KAAK,GAUI,oBATjD,SAAS,IAAI,WAAW,KAE5C,qBAAqB,kBAAkB,SAAS,IAC5C,gCAAgC,IAAI,KAAK,WAAW,MAAM;EACxD,OAAO;EACP,MAAM;CACR,CAAC,EAAE,OAAO,iBAAiB,EAAE,KAC7B;AAGR,CACF,EAAE,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_react_layout_error = require('./react-layout-error.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/errors/missing-path-variable.ts
|
|
4
|
+
const scope = "pathVariable";
|
|
5
|
+
/** Thrown when a required layout path variable was not provided. */
|
|
6
|
+
var MissingPathVariableError = class extends require_react_layout_error.createReactLayoutError({
|
|
7
|
+
code: "missingPathVariable",
|
|
8
|
+
scope
|
|
9
|
+
})((scope, { variable, path, providedVariables }) => {
|
|
10
|
+
return `[${scope}]: Path "${path}" requires $${variable}.${providedVariables && providedVariables.length > 0 ? ` Provided variables were ${new Intl.ListFormat("en", {
|
|
11
|
+
style: "long",
|
|
12
|
+
type: "disjunction"
|
|
13
|
+
}).format(providedVariables.map((provided) => `$${provided}`))}.` : " No path variables were provided."}`;
|
|
14
|
+
}) {};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
exports.MissingPathVariableError = MissingPathVariableError;
|
|
18
|
+
//# sourceMappingURL=missing-path-variable.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing-path-variable.cjs","names":["createReactLayoutError"],"sources":["../../src/errors/missing-path-variable.ts"],"sourcesContent":["import {\n createReactLayoutError,\n type ReactLayoutErrorContext,\n} from './react-layout-error';\n\nconst scope = 'pathVariable' as const;\n\n/** Context describing a variable required to resolve a layout path. */\nexport interface MissingPathVariableContext\n extends ReactLayoutErrorContext<typeof scope> {\n variable: string;\n path: string;\n providedVariables?: readonly string[];\n}\n\n/** Thrown when a required layout path variable was not provided. */\nexport class MissingPathVariableError extends createReactLayoutError(\n { code: 'missingPathVariable', scope },\n)(\n (\n scope,\n { variable, path, providedVariables }: MissingPathVariableContext,\n ) => {\n const providedMessage =\n providedVariables && providedVariables.length > 0\n ? ` Provided variables were ${new Intl.ListFormat('en', {\n style: 'long',\n type: 'disjunction',\n }).format(providedVariables.map((provided) => `$${provided}`))}.`\n : ' No path variables were provided.';\n\n return `[${scope}]: Path \"${path}\" requires $${variable}.${providedMessage}`;\n },\n) {}\n"],"mappings":";;;AAKA,MAAM,QAAQ;;AAWd,IAAa,2BAAb,cAA8CA,kDAC5C;CAAE,MAAM;CAAuB;AAAM,CACvC,GAEI,OACA,EAAE,UAAU,MAAM,wBACf;CASH,OAAO,IAAI,MAAM,WAAW,KAAK,cAAc,SAAS,GAPtD,qBAAqB,kBAAkB,SAAS,IAC5C,4BAA4B,IAAI,KAAK,WAAW,MAAM;EACpD,OAAO;EACP,MAAM;CACR,CAAC,EAAE,OAAO,kBAAkB,KAAK,aAAa,IAAI,UAAU,CAAC,EAAE,KAC/D;AAGR,CACF,EAAE,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CreatedReactLayoutError, ReactLayoutErrorContext } from "./react-layout-error.cjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/missing-path-variable.d.ts
|
|
4
|
+
declare const scope: "pathVariable";
|
|
5
|
+
/** Context describing a variable required to resolve a layout path. */
|
|
6
|
+
interface MissingPathVariableContext extends ReactLayoutErrorContext<typeof scope> {
|
|
7
|
+
variable: string;
|
|
8
|
+
path: string;
|
|
9
|
+
providedVariables?: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
declare const MissingPathVariableError_base: CreatedReactLayoutError<"missingPathVariable", "pathVariable", MissingPathVariableContext>;
|
|
12
|
+
/** Thrown when a required layout path variable was not provided. */
|
|
13
|
+
declare class MissingPathVariableError extends MissingPathVariableError_base {}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MissingPathVariableContext, MissingPathVariableError };
|
|
16
|
+
//# sourceMappingURL=missing-path-variable.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing-path-variable.d.cts","names":[],"sources":["../../src/errors/missing-path-variable.ts"],"mappings":";;;cAKM,KAAA;;UAGW,0BAAA,SACP,uBAAuB,QAAQ,KAAA;EACvC,QAAA;EACA,IAAA;EACA,iBAAA;AAAA;AAAA,cACD,6BAAA;;cAGY,wBAAA,SAAiC,6BAiB7C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CreatedReactLayoutError, ReactLayoutErrorContext } from "./react-layout-error.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/missing-path-variable.d.ts
|
|
4
|
+
declare const scope: "pathVariable";
|
|
5
|
+
/** Context describing a variable required to resolve a layout path. */
|
|
6
|
+
interface MissingPathVariableContext extends ReactLayoutErrorContext<typeof scope> {
|
|
7
|
+
variable: string;
|
|
8
|
+
path: string;
|
|
9
|
+
providedVariables?: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
declare const MissingPathVariableError_base: CreatedReactLayoutError<"missingPathVariable", "pathVariable", MissingPathVariableContext>;
|
|
12
|
+
/** Thrown when a required layout path variable was not provided. */
|
|
13
|
+
declare class MissingPathVariableError extends MissingPathVariableError_base {}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { MissingPathVariableContext, MissingPathVariableError };
|
|
16
|
+
//# sourceMappingURL=missing-path-variable.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing-path-variable.d.mts","names":[],"sources":["../../src/errors/missing-path-variable.ts"],"mappings":";;;cAKM,KAAA;;UAGW,0BAAA,SACP,uBAAuB,QAAQ,KAAA;EACvC,QAAA;EACA,IAAA;EACA,iBAAA;AAAA;AAAA,cACD,6BAAA;;cAGY,wBAAA,SAAiC,6BAiB7C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { createReactLayoutError } from "./react-layout-error.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/errors/missing-path-variable.ts
|
|
4
|
+
const scope = "pathVariable";
|
|
5
|
+
/** Thrown when a required layout path variable was not provided. */
|
|
6
|
+
var MissingPathVariableError = class extends createReactLayoutError({
|
|
7
|
+
code: "missingPathVariable",
|
|
8
|
+
scope
|
|
9
|
+
})((scope, { variable, path, providedVariables }) => {
|
|
10
|
+
return `[${scope}]: Path "${path}" requires $${variable}.${providedVariables && providedVariables.length > 0 ? ` Provided variables were ${new Intl.ListFormat("en", {
|
|
11
|
+
style: "long",
|
|
12
|
+
type: "disjunction"
|
|
13
|
+
}).format(providedVariables.map((provided) => `$${provided}`))}.` : " No path variables were provided."}`;
|
|
14
|
+
}) {};
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { MissingPathVariableError };
|
|
18
|
+
//# sourceMappingURL=missing-path-variable.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"missing-path-variable.mjs","names":[],"sources":["../../src/errors/missing-path-variable.ts"],"sourcesContent":["import {\n createReactLayoutError,\n type ReactLayoutErrorContext,\n} from './react-layout-error';\n\nconst scope = 'pathVariable' as const;\n\n/** Context describing a variable required to resolve a layout path. */\nexport interface MissingPathVariableContext\n extends ReactLayoutErrorContext<typeof scope> {\n variable: string;\n path: string;\n providedVariables?: readonly string[];\n}\n\n/** Thrown when a required layout path variable was not provided. */\nexport class MissingPathVariableError extends createReactLayoutError(\n { code: 'missingPathVariable', scope },\n)(\n (\n scope,\n { variable, path, providedVariables }: MissingPathVariableContext,\n ) => {\n const providedMessage =\n providedVariables && providedVariables.length > 0\n ? ` Provided variables were ${new Intl.ListFormat('en', {\n style: 'long',\n type: 'disjunction',\n }).format(providedVariables.map((provided) => `$${provided}`))}.`\n : ' No path variables were provided.';\n\n return `[${scope}]: Path \"${path}\" requires $${variable}.${providedMessage}`;\n },\n) {}\n"],"mappings":";;;AAKA,MAAM,QAAQ;;AAWd,IAAa,2BAAb,cAA8C,uBAC5C;CAAE,MAAM;CAAuB;AAAM,CACvC,GAEI,OACA,EAAE,UAAU,MAAM,wBACf;CASH,OAAO,IAAI,MAAM,WAAW,KAAK,cAAc,SAAS,GAPtD,qBAAqB,kBAAkB,SAAS,IAC5C,4BAA4B,IAAI,KAAK,WAAW,MAAM;EACpD,OAAO;EACP,MAAM;CACR,CAAC,EAAE,OAAO,kBAAkB,KAAK,aAAa,IAAI,UAAU,CAAC,EAAE,KAC/D;AAGR,CACF,EAAE,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/errors/react-layout-error.ts
|
|
3
|
+
function makeJsonSafe(value) {
|
|
4
|
+
if (value === void 0) return null;
|
|
5
|
+
if (Array.isArray(value)) return value.map(makeJsonSafe);
|
|
6
|
+
if (value && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([key, nestedValue]) => [key, makeJsonSafe(nestedValue)]));
|
|
7
|
+
return value;
|
|
8
|
+
}
|
|
9
|
+
/** Base data class for errors thrown by React Layout. */
|
|
10
|
+
var ReactLayoutError = class extends Error {
|
|
11
|
+
scope;
|
|
12
|
+
context;
|
|
13
|
+
static invariant(condition, context) {
|
|
14
|
+
if (!condition) throw new this(typeof context === "function" ? context() : context);
|
|
15
|
+
}
|
|
16
|
+
constructor(context) {
|
|
17
|
+
super();
|
|
18
|
+
this.name = new.target.name;
|
|
19
|
+
this.scope = context.scope;
|
|
20
|
+
this.context = context;
|
|
21
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
22
|
+
}
|
|
23
|
+
toJSON() {
|
|
24
|
+
return {
|
|
25
|
+
name: this.name,
|
|
26
|
+
code: this.code,
|
|
27
|
+
scope: this.scope,
|
|
28
|
+
message: this.message,
|
|
29
|
+
context: makeJsonSafe(this.context)
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
/** Creates a context-only React Layout error class with a default renderer. */
|
|
34
|
+
function createReactLayoutError(options) {
|
|
35
|
+
return function createErrorWithRenderer(defaultRenderer) {
|
|
36
|
+
return class ReactLayoutErrorWithCode extends ReactLayoutError {
|
|
37
|
+
code = options.code;
|
|
38
|
+
constructor(context) {
|
|
39
|
+
const resolvedContext = {
|
|
40
|
+
...context,
|
|
41
|
+
scope: options.scope
|
|
42
|
+
};
|
|
43
|
+
super(resolvedContext);
|
|
44
|
+
this.message = this.renderMessage();
|
|
45
|
+
}
|
|
46
|
+
renderMessage(renderer) {
|
|
47
|
+
return (renderer ?? defaultRenderer)(this.scope, this.context);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
exports.ReactLayoutError = ReactLayoutError;
|
|
55
|
+
exports.createReactLayoutError = createReactLayoutError;
|
|
56
|
+
//# sourceMappingURL=react-layout-error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-layout-error.cjs","names":[],"sources":["../../src/errors/react-layout-error.ts"],"sourcesContent":["/** Options used to assign a stable code and scope to a React Layout error. */\nexport type CreateReactLayoutErrorOptions<\n Code extends string = string,\n Scope extends string = string,\n> = {\n code: Code;\n scope: Scope;\n};\n\n/** Shared context carried by every React Layout error. */\nexport interface ReactLayoutErrorContext<Scope extends string>\n extends Record<string, unknown> {\n scope: Scope;\n}\n\n/** Renders an error message from its scope and structured context. */\nexport type ErrorMessageRenderer<\n Scope extends string,\n Context extends ReactLayoutErrorContext<Scope>,\n> = (scope: Scope, context: Context) => string;\n\n/** Constructor and invariant API returned by the React Layout error factory. */\nexport interface CreatedReactLayoutError<\n Code extends string,\n Scope extends string,\n Context extends ReactLayoutErrorContext<Scope>,\n> {\n invariant: <Condition>(\n condition: Condition,\n context: Omit<Context, 'scope'> | (() => Omit<Context, 'scope'>),\n ) => asserts condition;\n new (context: Omit<Context, 'scope'>): ReactLayoutError<\n Code,\n Scope,\n Context\n > & {\n readonly code: Code;\n readonly scope: Scope;\n renderMessage(renderer?: ErrorMessageRenderer<Scope, Context>): string;\n };\n}\n\n/** Adds a default renderer to a React Layout error definition. */\nexport interface ReactLayoutErrorRendererFactory<\n Code extends string,\n Scope extends string,\n> {\n <Context extends ReactLayoutErrorContext<Scope>>(\n defaultRenderer: ErrorMessageRenderer<Scope, Context>,\n ): CreatedReactLayoutError<Code, Scope, Context>;\n}\n\nfunction makeJsonSafe(value: unknown): unknown {\n if (value === undefined) {\n return null;\n }\n\n if (Array.isArray(value)) {\n return value.map(makeJsonSafe);\n }\n\n if (value && typeof value === 'object') {\n return Object.fromEntries(\n Object.entries(value).map(([key, nestedValue]) => [\n key,\n makeJsonSafe(nestedValue),\n ]),\n );\n }\n\n return value;\n}\n\n/** Base data class for errors thrown by React Layout. */\nexport abstract class ReactLayoutError<\n Code extends string = string,\n Scope extends string = string,\n Context extends ReactLayoutErrorContext<Scope> =\n ReactLayoutErrorContext<Scope>,\n> extends Error {\n abstract readonly code: Code;\n readonly scope: Scope;\n readonly context: Context;\n\n static invariant<\n Condition,\n Context extends Record<string, unknown>,\n >(\n this: new (context: Context) => Error,\n condition: Condition,\n context: Context | (() => Context),\n ): asserts condition {\n if (!condition) {\n throw new this(typeof context === 'function' ? context() : context);\n }\n }\n\n constructor(context: Context) {\n super();\n this.name = new.target.name;\n this.scope = context.scope;\n this.context = context;\n\n Object.setPrototypeOf(this, new.target.prototype);\n }\n\n abstract renderMessage(\n renderer?: ErrorMessageRenderer<Scope, Context>,\n ): string;\n\n toJSON() {\n return {\n name: this.name,\n code: this.code,\n scope: this.scope,\n message: this.message,\n context: makeJsonSafe(this.context),\n };\n }\n}\n\n/** Creates a context-only React Layout error class with a default renderer. */\nexport function createReactLayoutError<\n const Options extends CreateReactLayoutErrorOptions,\n>(\n options: Options,\n): ReactLayoutErrorRendererFactory<Options['code'], Options['scope']> {\n return function createErrorWithRenderer<\n Context extends ReactLayoutErrorContext<Options['scope']>,\n >(defaultRenderer: ErrorMessageRenderer<Options['scope'], Context>) {\n return class ReactLayoutErrorWithCode extends ReactLayoutError<\n Options['code'],\n Options['scope'],\n Context\n > {\n readonly code = options.code;\n\n constructor(context: Omit<Context, 'scope'>) {\n const resolvedContext = {\n ...context,\n scope: options.scope,\n } as Context;\n\n super(resolvedContext);\n this.message = this.renderMessage();\n }\n\n renderMessage(\n renderer?: ErrorMessageRenderer<Options['scope'], Context>,\n ) {\n return (renderer ?? defaultRenderer)(this.scope, this.context);\n }\n };\n };\n}\n"],"mappings":";;AAoDA,SAAS,aAAa,OAAyB;CAC7C,IAAI,UAAU,QACZ,OAAO;CAGT,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,MAAM,IAAI,YAAY;CAG/B,IAAI,SAAS,OAAO,UAAU,UAC5B,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,EAAE,KAAK,CAAC,KAAK,iBAAiB,CAChD,KACA,aAAa,WAAW,CAC1B,CAAC,CACH;CAGF,OAAO;AACT;;AAGA,IAAsB,mBAAtB,cAKU,MAAM;CAEd,AAAS;CACT,AAAS;CAET,OAAO,UAKL,WACA,SACmB;EACnB,IAAI,CAAC,WACH,MAAM,IAAI,KAAK,OAAO,YAAY,aAAa,QAAQ,IAAI,OAAO;CAEtE;CAEA,YAAY,SAAkB;EAC5B,MAAM;EACN,KAAK,OAAO,IAAI,OAAO;EACvB,KAAK,QAAQ,QAAQ;EACrB,KAAK,UAAU;EAEf,OAAO,eAAe,MAAM,IAAI,OAAO,SAAS;CAClD;CAMA,SAAS;EACP,OAAO;GACL,MAAM,KAAK;GACX,MAAM,KAAK;GACX,OAAO,KAAK;GACZ,SAAS,KAAK;GACd,SAAS,aAAa,KAAK,OAAO;EACpC;CACF;AACF;;AAGA,SAAgB,uBAGd,SACoE;CACpE,OAAO,SAAS,wBAEd,iBAAkE;EAClE,OAAO,MAAM,iCAAiC,iBAI5C;GACA,AAAS,OAAO,QAAQ;GAExB,YAAY,SAAiC;IAC3C,MAAM,kBAAkB;KACtB,GAAG;KACH,OAAO,QAAQ;IACjB;IAEA,MAAM,eAAe;IACrB,KAAK,UAAU,KAAK,cAAc;GACpC;GAEA,cACE,UACA;IACA,QAAQ,YAAY,iBAAiB,KAAK,OAAO,KAAK,OAAO;GAC/D;EACF;CACF;AACF"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/errors/react-layout-error.d.ts
|
|
2
|
+
/** Options used to assign a stable code and scope to a React Layout error. */
|
|
3
|
+
type CreateReactLayoutErrorOptions<Code extends string = string, Scope extends string = string> = {
|
|
4
|
+
code: Code;
|
|
5
|
+
scope: Scope;
|
|
6
|
+
};
|
|
7
|
+
/** Shared context carried by every React Layout error. */
|
|
8
|
+
interface ReactLayoutErrorContext<Scope extends string> extends Record<string, unknown> {
|
|
9
|
+
scope: Scope;
|
|
10
|
+
}
|
|
11
|
+
/** Renders an error message from its scope and structured context. */
|
|
12
|
+
type ErrorMessageRenderer<Scope extends string, Context extends ReactLayoutErrorContext<Scope>> = (scope: Scope, context: Context) => string;
|
|
13
|
+
/** Constructor and invariant API returned by the React Layout error factory. */
|
|
14
|
+
interface CreatedReactLayoutError<Code extends string, Scope extends string, Context extends ReactLayoutErrorContext<Scope>> {
|
|
15
|
+
invariant: <Condition>(condition: Condition, context: Omit<Context, 'scope'> | (() => Omit<Context, 'scope'>)) => asserts condition;
|
|
16
|
+
new (context: Omit<Context, 'scope'>): ReactLayoutError<Code, Scope, Context> & {
|
|
17
|
+
readonly code: Code;
|
|
18
|
+
readonly scope: Scope;
|
|
19
|
+
renderMessage(renderer?: ErrorMessageRenderer<Scope, Context>): string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** Adds a default renderer to a React Layout error definition. */
|
|
23
|
+
interface ReactLayoutErrorRendererFactory<Code extends string, Scope extends string> {
|
|
24
|
+
<Context extends ReactLayoutErrorContext<Scope>>(defaultRenderer: ErrorMessageRenderer<Scope, Context>): CreatedReactLayoutError<Code, Scope, Context>;
|
|
25
|
+
}
|
|
26
|
+
/** Base data class for errors thrown by React Layout. */
|
|
27
|
+
declare abstract class ReactLayoutError<Code extends string = string, Scope extends string = string, Context extends ReactLayoutErrorContext<Scope> = ReactLayoutErrorContext<Scope>> extends Error {
|
|
28
|
+
abstract readonly code: Code;
|
|
29
|
+
readonly scope: Scope;
|
|
30
|
+
readonly context: Context;
|
|
31
|
+
static invariant<Condition, Context extends Record<string, unknown>>(this: new (context: Context) => Error, condition: Condition, context: Context | (() => Context)): asserts condition;
|
|
32
|
+
constructor(context: Context);
|
|
33
|
+
abstract renderMessage(renderer?: ErrorMessageRenderer<Scope, Context>): string;
|
|
34
|
+
toJSON(): {
|
|
35
|
+
name: string;
|
|
36
|
+
code: Code;
|
|
37
|
+
scope: Scope;
|
|
38
|
+
message: string;
|
|
39
|
+
context: unknown;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** Creates a context-only React Layout error class with a default renderer. */
|
|
43
|
+
declare function createReactLayoutError<const Options extends CreateReactLayoutErrorOptions>(options: Options): ReactLayoutErrorRendererFactory<Options['code'], Options['scope']>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { CreateReactLayoutErrorOptions, CreatedReactLayoutError, ErrorMessageRenderer, ReactLayoutError, ReactLayoutErrorContext, ReactLayoutErrorRendererFactory, createReactLayoutError };
|
|
46
|
+
//# sourceMappingURL=react-layout-error.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-layout-error.d.cts","names":[],"sources":["../../src/errors/react-layout-error.ts"],"mappings":";;KACY,6BAAA;EAIV,IAAA,EAAM,IAAA;EACN,KAAA,EAAO,KAAK;AAAA;;UAIG,uBAAA,+BACP,MAAM;EACd,KAAA,EAAO,KAAA;AAAA;;KAIG,oBAAA,uCAEM,uBAAA,CAAwB,KAAA,MACrC,KAAA,EAAO,KAAA,EAAO,OAAA,EAAS,OAAA;;UAGX,uBAAA,4DAGC,uBAAA,CAAwB,KAAA;EAExC,SAAA,cACE,SAAA,EAAW,SAAA,EACX,OAAA,EAAS,IAAA,CAAK,OAAA,oBAA2B,IAAA,CAAK,OAAA,wBACnC,SAAA;EAAA,KACR,OAAA,EAAS,IAAA,CAAK,OAAA,aAAoB,gBAAA,CACrC,IAAA,EACA,KAAA,EACA,OAAA;IAAA,SAES,IAAA,EAAM,IAAA;IAAA,SACN,KAAA,EAAO,KAAA;IAChB,aAAA,CAAc,QAAA,GAAW,oBAAA,CAAqB,KAAA,EAAO,OAAA;EAAA;AAAA;;UAKxC,+BAAA;EAAA,iBAIE,uBAAA,CAAwB,KAAA,GACvC,eAAA,EAAiB,oBAAA,CAAqB,KAAA,EAAO,OAAA,IAC5C,uBAAA,CAAwB,IAAA,EAAM,KAAA,EAAO,OAAA;AAAA;;uBAyBpB,gBAAA,8EAGJ,uBAAA,CAAwB,KAAA,IACtC,uBAAA,CAAwB,KAAA,WAClB,KAAA;EAAA,kBACU,IAAA,EAAM,IAAA;EAAA,SACf,KAAA,EAAO,KAAA;EAAA,SACP,OAAA,EAAS,OAAA;EAAA,OAEX,SAAA,4BAEW,MAAA,mBAEhB,IAAA,OAAW,OAAA,EAAS,OAAA,KAAY,KAAA,EAChC,SAAA,EAAW,SAAA,EACX,OAAA,EAAS,OAAA,UAAiB,OAAA,YACjB,SAAA;cAMC,OAAA,EAAS,OAAA;EAAA,SASZ,aAAA,CACP,QAAA,GAAW,oBAAA,CAAqB,KAAA,EAAO,OAAA;EAGzC,MAAA;;;;;;;;;iBAYc,sBAAA,uBACQ,6BAAA,EAEtB,OAAA,EAAS,OAAA,GACR,+BAAA,CAAgC,OAAA,UAAiB,OAAA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/errors/react-layout-error.d.ts
|
|
2
|
+
/** Options used to assign a stable code and scope to a React Layout error. */
|
|
3
|
+
type CreateReactLayoutErrorOptions<Code extends string = string, Scope extends string = string> = {
|
|
4
|
+
code: Code;
|
|
5
|
+
scope: Scope;
|
|
6
|
+
};
|
|
7
|
+
/** Shared context carried by every React Layout error. */
|
|
8
|
+
interface ReactLayoutErrorContext<Scope extends string> extends Record<string, unknown> {
|
|
9
|
+
scope: Scope;
|
|
10
|
+
}
|
|
11
|
+
/** Renders an error message from its scope and structured context. */
|
|
12
|
+
type ErrorMessageRenderer<Scope extends string, Context extends ReactLayoutErrorContext<Scope>> = (scope: Scope, context: Context) => string;
|
|
13
|
+
/** Constructor and invariant API returned by the React Layout error factory. */
|
|
14
|
+
interface CreatedReactLayoutError<Code extends string, Scope extends string, Context extends ReactLayoutErrorContext<Scope>> {
|
|
15
|
+
invariant: <Condition>(condition: Condition, context: Omit<Context, 'scope'> | (() => Omit<Context, 'scope'>)) => asserts condition;
|
|
16
|
+
new (context: Omit<Context, 'scope'>): ReactLayoutError<Code, Scope, Context> & {
|
|
17
|
+
readonly code: Code;
|
|
18
|
+
readonly scope: Scope;
|
|
19
|
+
renderMessage(renderer?: ErrorMessageRenderer<Scope, Context>): string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/** Adds a default renderer to a React Layout error definition. */
|
|
23
|
+
interface ReactLayoutErrorRendererFactory<Code extends string, Scope extends string> {
|
|
24
|
+
<Context extends ReactLayoutErrorContext<Scope>>(defaultRenderer: ErrorMessageRenderer<Scope, Context>): CreatedReactLayoutError<Code, Scope, Context>;
|
|
25
|
+
}
|
|
26
|
+
/** Base data class for errors thrown by React Layout. */
|
|
27
|
+
declare abstract class ReactLayoutError<Code extends string = string, Scope extends string = string, Context extends ReactLayoutErrorContext<Scope> = ReactLayoutErrorContext<Scope>> extends Error {
|
|
28
|
+
abstract readonly code: Code;
|
|
29
|
+
readonly scope: Scope;
|
|
30
|
+
readonly context: Context;
|
|
31
|
+
static invariant<Condition, Context extends Record<string, unknown>>(this: new (context: Context) => Error, condition: Condition, context: Context | (() => Context)): asserts condition;
|
|
32
|
+
constructor(context: Context);
|
|
33
|
+
abstract renderMessage(renderer?: ErrorMessageRenderer<Scope, Context>): string;
|
|
34
|
+
toJSON(): {
|
|
35
|
+
name: string;
|
|
36
|
+
code: Code;
|
|
37
|
+
scope: Scope;
|
|
38
|
+
message: string;
|
|
39
|
+
context: unknown;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
/** Creates a context-only React Layout error class with a default renderer. */
|
|
43
|
+
declare function createReactLayoutError<const Options extends CreateReactLayoutErrorOptions>(options: Options): ReactLayoutErrorRendererFactory<Options['code'], Options['scope']>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { CreateReactLayoutErrorOptions, CreatedReactLayoutError, ErrorMessageRenderer, ReactLayoutError, ReactLayoutErrorContext, ReactLayoutErrorRendererFactory, createReactLayoutError };
|
|
46
|
+
//# sourceMappingURL=react-layout-error.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-layout-error.d.mts","names":[],"sources":["../../src/errors/react-layout-error.ts"],"mappings":";;KACY,6BAAA;EAIV,IAAA,EAAM,IAAA;EACN,KAAA,EAAO,KAAK;AAAA;;UAIG,uBAAA,+BACP,MAAM;EACd,KAAA,EAAO,KAAA;AAAA;;KAIG,oBAAA,uCAEM,uBAAA,CAAwB,KAAA,MACrC,KAAA,EAAO,KAAA,EAAO,OAAA,EAAS,OAAA;;UAGX,uBAAA,4DAGC,uBAAA,CAAwB,KAAA;EAExC,SAAA,cACE,SAAA,EAAW,SAAA,EACX,OAAA,EAAS,IAAA,CAAK,OAAA,oBAA2B,IAAA,CAAK,OAAA,wBACnC,SAAA;EAAA,KACR,OAAA,EAAS,IAAA,CAAK,OAAA,aAAoB,gBAAA,CACrC,IAAA,EACA,KAAA,EACA,OAAA;IAAA,SAES,IAAA,EAAM,IAAA;IAAA,SACN,KAAA,EAAO,KAAA;IAChB,aAAA,CAAc,QAAA,GAAW,oBAAA,CAAqB,KAAA,EAAO,OAAA;EAAA;AAAA;;UAKxC,+BAAA;EAAA,iBAIE,uBAAA,CAAwB,KAAA,GACvC,eAAA,EAAiB,oBAAA,CAAqB,KAAA,EAAO,OAAA,IAC5C,uBAAA,CAAwB,IAAA,EAAM,KAAA,EAAO,OAAA;AAAA;;uBAyBpB,gBAAA,8EAGJ,uBAAA,CAAwB,KAAA,IACtC,uBAAA,CAAwB,KAAA,WAClB,KAAA;EAAA,kBACU,IAAA,EAAM,IAAA;EAAA,SACf,KAAA,EAAO,KAAA;EAAA,SACP,OAAA,EAAS,OAAA;EAAA,OAEX,SAAA,4BAEW,MAAA,mBAEhB,IAAA,OAAW,OAAA,EAAS,OAAA,KAAY,KAAA,EAChC,SAAA,EAAW,SAAA,EACX,OAAA,EAAS,OAAA,UAAiB,OAAA,YACjB,SAAA;cAMC,OAAA,EAAS,OAAA;EAAA,SASZ,aAAA,CACP,QAAA,GAAW,oBAAA,CAAqB,KAAA,EAAO,OAAA;EAGzC,MAAA;;;;;;;;;iBAYc,sBAAA,uBACQ,6BAAA,EAEtB,OAAA,EAAS,OAAA,GACR,+BAAA,CAAgC,OAAA,UAAiB,OAAA"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//#region src/errors/react-layout-error.ts
|
|
2
|
+
function makeJsonSafe(value) {
|
|
3
|
+
if (value === void 0) return null;
|
|
4
|
+
if (Array.isArray(value)) return value.map(makeJsonSafe);
|
|
5
|
+
if (value && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([key, nestedValue]) => [key, makeJsonSafe(nestedValue)]));
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
/** Base data class for errors thrown by React Layout. */
|
|
9
|
+
var ReactLayoutError = class extends Error {
|
|
10
|
+
scope;
|
|
11
|
+
context;
|
|
12
|
+
static invariant(condition, context) {
|
|
13
|
+
if (!condition) throw new this(typeof context === "function" ? context() : context);
|
|
14
|
+
}
|
|
15
|
+
constructor(context) {
|
|
16
|
+
super();
|
|
17
|
+
this.name = new.target.name;
|
|
18
|
+
this.scope = context.scope;
|
|
19
|
+
this.context = context;
|
|
20
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
21
|
+
}
|
|
22
|
+
toJSON() {
|
|
23
|
+
return {
|
|
24
|
+
name: this.name,
|
|
25
|
+
code: this.code,
|
|
26
|
+
scope: this.scope,
|
|
27
|
+
message: this.message,
|
|
28
|
+
context: makeJsonSafe(this.context)
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/** Creates a context-only React Layout error class with a default renderer. */
|
|
33
|
+
function createReactLayoutError(options) {
|
|
34
|
+
return function createErrorWithRenderer(defaultRenderer) {
|
|
35
|
+
return class ReactLayoutErrorWithCode extends ReactLayoutError {
|
|
36
|
+
code = options.code;
|
|
37
|
+
constructor(context) {
|
|
38
|
+
const resolvedContext = {
|
|
39
|
+
...context,
|
|
40
|
+
scope: options.scope
|
|
41
|
+
};
|
|
42
|
+
super(resolvedContext);
|
|
43
|
+
this.message = this.renderMessage();
|
|
44
|
+
}
|
|
45
|
+
renderMessage(renderer) {
|
|
46
|
+
return (renderer ?? defaultRenderer)(this.scope, this.context);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
export { ReactLayoutError, createReactLayoutError };
|
|
54
|
+
//# sourceMappingURL=react-layout-error.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react-layout-error.mjs","names":[],"sources":["../../src/errors/react-layout-error.ts"],"sourcesContent":["/** Options used to assign a stable code and scope to a React Layout error. */\nexport type CreateReactLayoutErrorOptions<\n Code extends string = string,\n Scope extends string = string,\n> = {\n code: Code;\n scope: Scope;\n};\n\n/** Shared context carried by every React Layout error. */\nexport interface ReactLayoutErrorContext<Scope extends string>\n extends Record<string, unknown> {\n scope: Scope;\n}\n\n/** Renders an error message from its scope and structured context. */\nexport type ErrorMessageRenderer<\n Scope extends string,\n Context extends ReactLayoutErrorContext<Scope>,\n> = (scope: Scope, context: Context) => string;\n\n/** Constructor and invariant API returned by the React Layout error factory. */\nexport interface CreatedReactLayoutError<\n Code extends string,\n Scope extends string,\n Context extends ReactLayoutErrorContext<Scope>,\n> {\n invariant: <Condition>(\n condition: Condition,\n context: Omit<Context, 'scope'> | (() => Omit<Context, 'scope'>),\n ) => asserts condition;\n new (context: Omit<Context, 'scope'>): ReactLayoutError<\n Code,\n Scope,\n Context\n > & {\n readonly code: Code;\n readonly scope: Scope;\n renderMessage(renderer?: ErrorMessageRenderer<Scope, Context>): string;\n };\n}\n\n/** Adds a default renderer to a React Layout error definition. */\nexport interface ReactLayoutErrorRendererFactory<\n Code extends string,\n Scope extends string,\n> {\n <Context extends ReactLayoutErrorContext<Scope>>(\n defaultRenderer: ErrorMessageRenderer<Scope, Context>,\n ): CreatedReactLayoutError<Code, Scope, Context>;\n}\n\nfunction makeJsonSafe(value: unknown): unknown {\n if (value === undefined) {\n return null;\n }\n\n if (Array.isArray(value)) {\n return value.map(makeJsonSafe);\n }\n\n if (value && typeof value === 'object') {\n return Object.fromEntries(\n Object.entries(value).map(([key, nestedValue]) => [\n key,\n makeJsonSafe(nestedValue),\n ]),\n );\n }\n\n return value;\n}\n\n/** Base data class for errors thrown by React Layout. */\nexport abstract class ReactLayoutError<\n Code extends string = string,\n Scope extends string = string,\n Context extends ReactLayoutErrorContext<Scope> =\n ReactLayoutErrorContext<Scope>,\n> extends Error {\n abstract readonly code: Code;\n readonly scope: Scope;\n readonly context: Context;\n\n static invariant<\n Condition,\n Context extends Record<string, unknown>,\n >(\n this: new (context: Context) => Error,\n condition: Condition,\n context: Context | (() => Context),\n ): asserts condition {\n if (!condition) {\n throw new this(typeof context === 'function' ? context() : context);\n }\n }\n\n constructor(context: Context) {\n super();\n this.name = new.target.name;\n this.scope = context.scope;\n this.context = context;\n\n Object.setPrototypeOf(this, new.target.prototype);\n }\n\n abstract renderMessage(\n renderer?: ErrorMessageRenderer<Scope, Context>,\n ): string;\n\n toJSON() {\n return {\n name: this.name,\n code: this.code,\n scope: this.scope,\n message: this.message,\n context: makeJsonSafe(this.context),\n };\n }\n}\n\n/** Creates a context-only React Layout error class with a default renderer. */\nexport function createReactLayoutError<\n const Options extends CreateReactLayoutErrorOptions,\n>(\n options: Options,\n): ReactLayoutErrorRendererFactory<Options['code'], Options['scope']> {\n return function createErrorWithRenderer<\n Context extends ReactLayoutErrorContext<Options['scope']>,\n >(defaultRenderer: ErrorMessageRenderer<Options['scope'], Context>) {\n return class ReactLayoutErrorWithCode extends ReactLayoutError<\n Options['code'],\n Options['scope'],\n Context\n > {\n readonly code = options.code;\n\n constructor(context: Omit<Context, 'scope'>) {\n const resolvedContext = {\n ...context,\n scope: options.scope,\n } as Context;\n\n super(resolvedContext);\n this.message = this.renderMessage();\n }\n\n renderMessage(\n renderer?: ErrorMessageRenderer<Options['scope'], Context>,\n ) {\n return (renderer ?? defaultRenderer)(this.scope, this.context);\n }\n };\n };\n}\n"],"mappings":";AAoDA,SAAS,aAAa,OAAyB;CAC7C,IAAI,UAAU,QACZ,OAAO;CAGT,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,MAAM,IAAI,YAAY;CAG/B,IAAI,SAAS,OAAO,UAAU,UAC5B,OAAO,OAAO,YACZ,OAAO,QAAQ,KAAK,EAAE,KAAK,CAAC,KAAK,iBAAiB,CAChD,KACA,aAAa,WAAW,CAC1B,CAAC,CACH;CAGF,OAAO;AACT;;AAGA,IAAsB,mBAAtB,cAKU,MAAM;CAEd,AAAS;CACT,AAAS;CAET,OAAO,UAKL,WACA,SACmB;EACnB,IAAI,CAAC,WACH,MAAM,IAAI,KAAK,OAAO,YAAY,aAAa,QAAQ,IAAI,OAAO;CAEtE;CAEA,YAAY,SAAkB;EAC5B,MAAM;EACN,KAAK,OAAO,IAAI,OAAO;EACvB,KAAK,QAAQ,QAAQ;EACrB,KAAK,UAAU;EAEf,OAAO,eAAe,MAAM,IAAI,OAAO,SAAS;CAClD;CAMA,SAAS;EACP,OAAO;GACL,MAAM,KAAK;GACX,MAAM,KAAK;GACX,OAAO,KAAK;GACZ,SAAS,KAAK;GACd,SAAS,aAAa,KAAK,OAAO;EACpC;CACF;AACF;;AAGA,SAAgB,uBAGd,SACoE;CACpE,OAAO,SAAS,wBAEd,iBAAkE;EAClE,OAAO,MAAM,iCAAiC,iBAI5C;GACA,AAAS,OAAO,QAAQ;GAExB,YAAY,SAAiC;IAC3C,MAAM,kBAAkB;KACtB,GAAG;KACH,OAAO,QAAQ;IACjB;IAEA,MAAM,eAAe;IACrB,KAAK,UAAU,KAAK,cAAc;GACpC;GAEA,cACE,UACA;IACA,QAAQ,YAAY,iBAAiB,KAAK,OAAO,KAAK,OAAO;GAC/D;EACF;CACF;AACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_resource = require('./resource.cjs');
|
|
3
3
|
const require_utils = require('./utils.cjs');
|
|
4
|
+
const require_react_layout_error = require('./errors/react-layout-error.cjs');
|
|
5
|
+
const require_invalid_config = require('./errors/invalid-config.cjs');
|
|
6
|
+
const require_invalid_path = require('./errors/invalid-path.cjs');
|
|
7
|
+
const require_invalid_resource = require('./errors/invalid-resource.cjs');
|
|
8
|
+
const require_invalid_sub_resource = require('./errors/invalid-sub-resource.cjs');
|
|
9
|
+
const require_invalid_component = require('./errors/invalid-component.cjs');
|
|
10
|
+
const require_missing_path_variable = require('./errors/missing-path-variable.cjs');
|
|
4
11
|
const require_define_layout = require('./create-config/define-layout.cjs');
|
|
5
12
|
let _jfdevelops_react_layout_composables = require("@jfdevelops/react-layout-composables");
|
|
6
13
|
let _jfdevelops_react_layout_validator = require("@jfdevelops/react-layout-validator");
|
|
7
14
|
|
|
15
|
+
exports.InvalidComponentError = require_invalid_component.InvalidComponentError;
|
|
16
|
+
exports.InvalidConfigError = require_invalid_config.InvalidConfigError;
|
|
17
|
+
exports.InvalidPathError = require_invalid_path.InvalidPathError;
|
|
18
|
+
exports.InvalidResourceError = require_invalid_resource.InvalidResourceError;
|
|
19
|
+
exports.InvalidSubResourceError = require_invalid_sub_resource.InvalidSubResourceError;
|
|
8
20
|
Object.defineProperty(exports, 'LayoutComposablePresetProvider', {
|
|
9
21
|
enumerable: true,
|
|
10
22
|
get: function () {
|
|
11
23
|
return _jfdevelops_react_layout_composables.LayoutComposablePresetProvider;
|
|
12
24
|
}
|
|
13
25
|
});
|
|
26
|
+
exports.MissingPathVariableError = require_missing_path_variable.MissingPathVariableError;
|
|
14
27
|
Object.defineProperty(exports, 'PropError', {
|
|
15
28
|
enumerable: true,
|
|
16
29
|
get: function () {
|
|
17
30
|
return _jfdevelops_react_layout_validator.PropError;
|
|
18
31
|
}
|
|
19
32
|
});
|
|
33
|
+
exports.ReactLayoutError = require_react_layout_error.ReactLayoutError;
|
|
20
34
|
Object.defineProperty(exports, 'collectComposablePresetEntries', {
|
|
21
35
|
enumerable: true,
|
|
22
36
|
get: function () {
|
|
@@ -47,6 +61,7 @@ Object.defineProperty(exports, 'createProp', {
|
|
|
47
61
|
return _jfdevelops_react_layout_validator.createProp;
|
|
48
62
|
}
|
|
49
63
|
});
|
|
64
|
+
exports.createReactLayoutError = require_react_layout_error.createReactLayoutError;
|
|
50
65
|
Object.defineProperty(exports, 'defineComposableComponent', {
|
|
51
66
|
enumerable: true,
|
|
52
67
|
get: function () {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { BaseComponent, MergeIntersection, Show, UnionToIntersection, pick } from "./utils.cjs";
|
|
2
2
|
import { LayoutResourceKey, NormalizeResource, NormalizeResources, ResourceDefinition, ResourceEnum, ResourceLayoutComponentProps, ResourceTree, normalizeResource, normalizeResources, toResourceEnum } from "./resource.cjs";
|
|
3
3
|
import { InPropsDefinition, InPropsFunction, InPropsObject, InPropsOptions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, PropsContextRender, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined } from "./props.cjs";
|
|
4
|
+
import { ParameterizedResourcePath, PathVariables } from "./create-config/paths/types.cjs";
|
|
5
|
+
import { CreateGetComponentForPath, GetComponentForPath, ResolvedPathValue } from "./create-config/for-paths/get-component-for-path.cjs";
|
|
6
|
+
import { ForPaths, ForPathsRenderContext, RenderedPathComponent, RenderedPathComponentHOF, TargetPathBuilder } from "./create-config/for-paths/builder.cjs";
|
|
7
|
+
import { IsSubResourceKey } from "./create-config/is-sub-resource-key.cjs";
|
|
8
|
+
import { ComponentTypes, CreatedResourceConfig } from "./create-config/get-component.cjs";
|
|
4
9
|
import { defineResourceLayout } from "./create-config/define-layout.cjs";
|
|
10
|
+
import { CreateReactLayoutErrorOptions, CreatedReactLayoutError, ErrorMessageRenderer, ReactLayoutError, ReactLayoutErrorContext, ReactLayoutErrorRendererFactory, createReactLayoutError } from "./errors/react-layout-error.cjs";
|
|
11
|
+
import { InvalidConfigContext, InvalidConfigError } from "./errors/invalid-config.cjs";
|
|
12
|
+
import { InvalidPathContext, InvalidPathError } from "./errors/invalid-path.cjs";
|
|
13
|
+
import { InvalidResourceContext, InvalidResourceError } from "./errors/invalid-resource.cjs";
|
|
14
|
+
import { InvalidSubResourceContext, InvalidSubResourceError } from "./errors/invalid-sub-resource.cjs";
|
|
15
|
+
import { InvalidComponentContext, InvalidComponentError } from "./errors/invalid-component.cjs";
|
|
16
|
+
import { MissingPathVariableContext, MissingPathVariableError } from "./errors/missing-path-variable.cjs";
|
|
5
17
|
import { AnyComposableComponent, ComposableComponent, ComposableComponentCallable, ComposableComponents, ComposableNameContext, ComposablePresetComponent, ComposablePresetComponentCallProps, ComposablePresetMeta, ComposablePresetProps, ComposableResourceLayout, CreateLayoutComposable, DefinedComposableComponentRecord, LayoutComposablePresetProvider, LayoutComposablesFactory, MakeComposable, MakeComposableOptions, MergePresetProps, PresetPropsFromComposable, RequiredPresetLayoutProps, RequiredPresetRenderProps, ResolveLayoutComposables, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, defineComposableComponent, makeComposable, resolveComposablePresetProps, resolveLayoutComposables } from "@jfdevelops/react-layout-composables";
|
|
6
18
|
import { AnyBuiltPropDefinition, ExtractDefinitionValue, PropError, PropErrorOptions, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps, ResolvedBuiltPropShape, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
7
|
-
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type BaseComponent, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type CreateLayoutComposable, type DefinedComposableComponentRecord, type ExtractDefinitionValue, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, LayoutComposablePresetProvider, type LayoutComposablesFactory, type LayoutRenderProps, type LayoutResourceKey, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type NormalizeResource, type NormalizeResources, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, type RequiredPresetLayoutProps, type RequiredPresetRenderProps, type ResolveLayoutComposables, type ResolveLayoutProps, type ResolveLayoutPropsAsDefined, type ResolveProps, type ResolvedBuiltPropShape, type ResolvedIncludedComponentProps, type ResolvedIncludedConfigProps, type ResolvedIncludedProps, type ResolvedIncludedPropsAsDefined, type ResourceDefinition, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceTree, type Show, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
|
19
|
+
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type BaseComponent, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type CreateGetComponentForPath, type CreateLayoutComposable, type CreateReactLayoutErrorOptions, type CreatedReactLayoutError, type CreatedResourceConfig, type DefinedComposableComponentRecord, type ErrorMessageRenderer, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesFactory, type LayoutRenderProps, type LayoutResourceKey, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, type NormalizeResource, type NormalizeResources, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, ReactLayoutError, type ReactLayoutErrorContext, type ReactLayoutErrorRendererFactory, type RenderedPathComponent, type RenderedPathComponentHOF, type RequiredPresetLayoutProps, type RequiredPresetRenderProps, type ResolveLayoutComposables, type ResolveLayoutProps, type ResolveLayoutPropsAsDefined, type ResolveProps, type ResolvedBuiltPropShape, type ResolvedIncludedComponentProps, type ResolvedIncludedConfigProps, type ResolvedIncludedProps, type ResolvedIncludedPropsAsDefined, type ResolvedPathValue, type ResourceDefinition, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceTree, type Show, type TargetPathBuilder, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, createReactLayoutError, defineComposableComponent, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { BaseComponent, MergeIntersection, Show, UnionToIntersection, pick } from "./utils.mjs";
|
|
2
2
|
import { LayoutResourceKey, NormalizeResource, NormalizeResources, ResourceDefinition, ResourceEnum, ResourceLayoutComponentProps, ResourceTree, normalizeResource, normalizeResources, toResourceEnum } from "./resource.mjs";
|
|
3
3
|
import { InPropsDefinition, InPropsFunction, InPropsObject, InPropsOptions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, PropsContextRender, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined } from "./props.mjs";
|
|
4
|
+
import { ParameterizedResourcePath, PathVariables } from "./create-config/paths/types.mjs";
|
|
5
|
+
import { CreateGetComponentForPath, GetComponentForPath, ResolvedPathValue } from "./create-config/for-paths/get-component-for-path.mjs";
|
|
6
|
+
import { ForPaths, ForPathsRenderContext, RenderedPathComponent, RenderedPathComponentHOF, TargetPathBuilder } from "./create-config/for-paths/builder.mjs";
|
|
7
|
+
import { IsSubResourceKey } from "./create-config/is-sub-resource-key.mjs";
|
|
8
|
+
import { ComponentTypes, CreatedResourceConfig } from "./create-config/get-component.mjs";
|
|
4
9
|
import { defineResourceLayout } from "./create-config/define-layout.mjs";
|
|
10
|
+
import { CreateReactLayoutErrorOptions, CreatedReactLayoutError, ErrorMessageRenderer, ReactLayoutError, ReactLayoutErrorContext, ReactLayoutErrorRendererFactory, createReactLayoutError } from "./errors/react-layout-error.mjs";
|
|
11
|
+
import { InvalidConfigContext, InvalidConfigError } from "./errors/invalid-config.mjs";
|
|
12
|
+
import { InvalidPathContext, InvalidPathError } from "./errors/invalid-path.mjs";
|
|
13
|
+
import { InvalidResourceContext, InvalidResourceError } from "./errors/invalid-resource.mjs";
|
|
14
|
+
import { InvalidSubResourceContext, InvalidSubResourceError } from "./errors/invalid-sub-resource.mjs";
|
|
15
|
+
import { InvalidComponentContext, InvalidComponentError } from "./errors/invalid-component.mjs";
|
|
16
|
+
import { MissingPathVariableContext, MissingPathVariableError } from "./errors/missing-path-variable.mjs";
|
|
5
17
|
import { AnyComposableComponent, ComposableComponent, ComposableComponentCallable, ComposableComponents, ComposableNameContext, ComposablePresetComponent, ComposablePresetComponentCallProps, ComposablePresetMeta, ComposablePresetProps, ComposableResourceLayout, CreateLayoutComposable, DefinedComposableComponentRecord, LayoutComposablePresetProvider, LayoutComposablesFactory, MakeComposable, MakeComposableOptions, MergePresetProps, PresetPropsFromComposable, RequiredPresetLayoutProps, RequiredPresetRenderProps, ResolveLayoutComposables, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, defineComposableComponent, makeComposable, resolveComposablePresetProps, resolveLayoutComposables } from "@jfdevelops/react-layout-composables";
|
|
6
18
|
import { AnyBuiltPropDefinition, ExtractDefinitionValue, PropError, PropErrorOptions, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps, ResolvedBuiltPropShape, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
7
|
-
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type BaseComponent, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type CreateLayoutComposable, type DefinedComposableComponentRecord, type ExtractDefinitionValue, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, LayoutComposablePresetProvider, type LayoutComposablesFactory, type LayoutRenderProps, type LayoutResourceKey, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type NormalizeResource, type NormalizeResources, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, type RequiredPresetLayoutProps, type RequiredPresetRenderProps, type ResolveLayoutComposables, type ResolveLayoutProps, type ResolveLayoutPropsAsDefined, type ResolveProps, type ResolvedBuiltPropShape, type ResolvedIncludedComponentProps, type ResolvedIncludedConfigProps, type ResolvedIncludedProps, type ResolvedIncludedPropsAsDefined, type ResourceDefinition, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceTree, type Show, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
|
19
|
+
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type BaseComponent, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type CreateGetComponentForPath, type CreateLayoutComposable, type CreateReactLayoutErrorOptions, type CreatedReactLayoutError, type CreatedResourceConfig, type DefinedComposableComponentRecord, type ErrorMessageRenderer, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesFactory, type LayoutRenderProps, type LayoutResourceKey, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, type NormalizeResource, type NormalizeResources, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, ReactLayoutError, type ReactLayoutErrorContext, type ReactLayoutErrorRendererFactory, type RenderedPathComponent, type RenderedPathComponentHOF, type RequiredPresetLayoutProps, type RequiredPresetRenderProps, type ResolveLayoutComposables, type ResolveLayoutProps, type ResolveLayoutPropsAsDefined, type ResolveProps, type ResolvedBuiltPropShape, type ResolvedIncludedComponentProps, type ResolvedIncludedConfigProps, type ResolvedIncludedProps, type ResolvedIncludedPropsAsDefined, type ResolvedPathValue, type ResourceDefinition, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceTree, type Show, type TargetPathBuilder, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, createReactLayoutError, defineComposableComponent, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { normalizeResource, normalizeResources, toResourceEnum } from "./resource.mjs";
|
|
2
2
|
import { pick } from "./utils.mjs";
|
|
3
|
+
import { ReactLayoutError, createReactLayoutError } from "./errors/react-layout-error.mjs";
|
|
4
|
+
import { InvalidConfigError } from "./errors/invalid-config.mjs";
|
|
5
|
+
import { InvalidPathError } from "./errors/invalid-path.mjs";
|
|
6
|
+
import { InvalidResourceError } from "./errors/invalid-resource.mjs";
|
|
7
|
+
import { InvalidSubResourceError } from "./errors/invalid-sub-resource.mjs";
|
|
8
|
+
import { InvalidComponentError } from "./errors/invalid-component.mjs";
|
|
9
|
+
import { MissingPathVariableError } from "./errors/missing-path-variable.mjs";
|
|
3
10
|
import { defineResourceLayout } from "./create-config/define-layout.mjs";
|
|
4
11
|
import { LayoutComposablePresetProvider, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, defineComposableComponent, makeComposable, resolveComposablePresetProps, resolveLayoutComposables } from "@jfdevelops/react-layout-composables";
|
|
5
12
|
import { PropError, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
6
13
|
|
|
7
|
-
export { LayoutComposablePresetProvider, PropError, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
|
14
|
+
export { InvalidComponentError, InvalidConfigError, InvalidPathError, InvalidResourceError, InvalidSubResourceError, LayoutComposablePresetProvider, MissingPathVariableError, PropError, ReactLayoutError, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, createReactLayoutError, defineComposableComponent, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
package/dist/props.d.cts
CHANGED
|
@@ -52,7 +52,7 @@ type IncludedPropType = PropsType | IncludedPropBehavior;
|
|
|
52
52
|
type IncludedProps<T extends object> = { [K in keyof T & string]?: IncludedPropType };
|
|
53
53
|
type PropsKeys<Props extends InPropsObject, T> = T & keyof Props;
|
|
54
54
|
type IncludedPropVisibility<Value> = Value extends IncludedPropBehavior ? Value['visibility'] : Value extends true | 'required' ? 'required' : Value extends 'optional' ? 'optional' : never;
|
|
55
|
-
type IncludedPropPassthrough<Value> = Value extends IncludedPropBehavior ? Value['passthrough'] : Value extends true | 'required' ? 'config' : Value extends 'optional' ? 'component' | 'config' : never;
|
|
55
|
+
type IncludedPropPassthrough<Value> = Value extends IncludedPropBehavior ? Value['passthrough'] extends 'component' ? Value['visibility'] extends 'optional' ? 'component' | 'config' : 'component' : Value['passthrough'] : Value extends true | 'required' ? 'config' : Value extends 'optional' ? 'component' | 'config' : never;
|
|
56
56
|
type GetPropsKey<IncludeProps extends object, Visibility extends InternalPropsType, Passthrough extends IncludedPropBehavior['passthrough'] | 'render' = 'render'> = { [Key in keyof IncludeProps]: IncludedPropVisibility<IncludeProps[Key]> extends Visibility ? Passthrough extends 'render' ? Key : Passthrough extends IncludedPropPassthrough<IncludeProps[Key]> ? Key : never : never }[keyof IncludeProps];
|
|
57
57
|
type SelectedIncludedProps<Props extends InPropsObject, IncludeProps extends IncludedProps<Props>, Visibility extends InternalPropsType, Passthrough extends IncludedPropBehavior['passthrough'] | 'render' = 'render'> = Pick<Props, PropsKeys<Props, GetPropsKey<IncludeProps, Visibility, Passthrough>>>;
|
|
58
58
|
type ResolvedIncludedProps<Props extends InPropsObject, IncludeProps extends IncludedProps<Props>> = ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'required'>> & Partial<ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'optional'>>>;
|
package/dist/props.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.cts","names":[],"sources":["../src/props.ts"],"mappings":";;;;;;AAsBA;;;;;AAAA,KAAY,kBAAA,4CACV,KAAA,EAAO,WAAA,EACP,OAAA,EAAS,OAAA,KACN,MAAA;;;;;;;;;;;;UAaY,qBAAA,SACP,aAAA,iBACM,KAAA,SAAc,aAAA,GAAgB,YAAA,CAAa,KAAA;EAIzD,KAAA,GAAQ,KAAA;EACR,MAAA,EAAQ,kBAAA,CAAmB,WAAA,EAAa,OAAA,EAAS,MAAA;AAAA;AAAA,KAGvC,cAAA,mBACQ,aAAA,CAAc,kBAAA;EAGhC,IAAA,EAAM,kBAAA,CAAmB,IAAA;EACzB,QAAA,EAAU,eAAA,CAAgB,YAAA,CAAa,SAAA;AAAA;AAAA,KAE7B,eAAA,mBACQ,aAAA,CAAc,kBAAA,2BAEhC,KAAA,EAAO,IAAA,CAAK,cAAA,CAAe,SAAA,EAAW,IAAA,OACnC,aAAA;AAAA,KACO,iBAAA,mBACQ,aAAA,CAAc,kBAAA,KAC9B,aAAA,GAAgB,eAAA,CAAgB,SAAA;AAAA,KACx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ropBehavior;
|
|
|
52
52
|
type IncludedProps<T extends object> = { [K in keyof T & string]?: IncludedPropType };
|
|
53
53
|
type PropsKeys<Props extends InPropsObject, T> = T & keyof Props;
|
|
54
54
|
type IncludedPropVisibility<Value> = Value extends IncludedPropBehavior ? Value['visibility'] : Value extends true | 'required' ? 'required' : Value extends 'optional' ? 'optional' : never;
|
|
55
|
-
type IncludedPropPassthrough<Value> = Value extends IncludedPropBehavior ? Value['passthrough'] : Value extends true | 'required' ? 'config' : Value extends 'optional' ? 'component' | 'config' : never;
|
|
55
|
+
type IncludedPropPassthrough<Value> = Value extends IncludedPropBehavior ? Value['passthrough'] extends 'component' ? Value['visibility'] extends 'optional' ? 'component' | 'config' : 'component' : Value['passthrough'] : Value extends true | 'required' ? 'config' : Value extends 'optional' ? 'component' | 'config' : never;
|
|
56
56
|
type GetPropsKey<IncludeProps extends object, Visibility extends InternalPropsType, Passthrough extends IncludedPropBehavior['passthrough'] | 'render' = 'render'> = { [Key in keyof IncludeProps]: IncludedPropVisibility<IncludeProps[Key]> extends Visibility ? Passthrough extends 'render' ? Key : Passthrough extends IncludedPropPassthrough<IncludeProps[Key]> ? Key : never : never }[keyof IncludeProps];
|
|
57
57
|
type SelectedIncludedProps<Props extends InPropsObject, IncludeProps extends IncludedProps<Props>, Visibility extends InternalPropsType, Passthrough extends IncludedPropBehavior['passthrough'] | 'render' = 'render'> = Pick<Props, PropsKeys<Props, GetPropsKey<IncludeProps, Visibility, Passthrough>>>;
|
|
58
58
|
type ResolvedIncludedProps<Props extends InPropsObject, IncludeProps extends IncludedProps<Props>> = ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'required'>> & Partial<ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'optional'>>>;
|
package/dist/props.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.mts","names":[],"sources":["../src/props.ts"],"mappings":";;;;;;AAsBA;;;;;AAAA,KAAY,kBAAA,4CAC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