@jfdevelops/react-layout 2.1.0 → 2.3.0

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.
Files changed (125) hide show
  1. package/dist/create-config/create-defined-resource-layout.cjs +6 -3
  2. package/dist/create-config/create-defined-resource-layout.cjs.map +1 -1
  3. package/dist/create-config/create-defined-resource-layout.d.cts +16 -13
  4. package/dist/create-config/create-defined-resource-layout.d.cts.map +1 -1
  5. package/dist/create-config/create-defined-resource-layout.d.mts +16 -13
  6. package/dist/create-config/create-defined-resource-layout.d.mts.map +1 -1
  7. package/dist/create-config/create-defined-resource-layout.mjs +6 -3
  8. package/dist/create-config/create-defined-resource-layout.mjs.map +1 -1
  9. package/dist/create-config/create-resource-links.cjs.map +1 -1
  10. package/dist/create-config/create-resource-links.d.cts +3 -1
  11. package/dist/create-config/create-resource-links.d.cts.map +1 -1
  12. package/dist/create-config/create-resource-links.d.mts +3 -1
  13. package/dist/create-config/create-resource-links.d.mts.map +1 -1
  14. package/dist/create-config/create-resource-links.mjs.map +1 -1
  15. package/dist/create-config/create-reusable.cjs +49 -0
  16. package/dist/create-config/create-reusable.cjs.map +1 -0
  17. package/dist/create-config/create-reusable.d.cts +41 -0
  18. package/dist/create-config/create-reusable.d.cts.map +1 -0
  19. package/dist/create-config/create-reusable.d.mts +41 -0
  20. package/dist/create-config/create-reusable.d.mts.map +1 -0
  21. package/dist/create-config/create-reusable.mjs +49 -0
  22. package/dist/create-config/create-reusable.mjs.map +1 -0
  23. package/dist/create-config/define-layout.cjs +19 -12
  24. package/dist/create-config/define-layout.cjs.map +1 -1
  25. package/dist/create-config/define-layout.d.cts +43 -42
  26. package/dist/create-config/define-layout.d.cts.map +1 -1
  27. package/dist/create-config/define-layout.d.mts +43 -42
  28. package/dist/create-config/define-layout.d.mts.map +1 -1
  29. package/dist/create-config/define-layout.mjs +22 -15
  30. package/dist/create-config/define-layout.mjs.map +1 -1
  31. package/dist/create-config/for-paths/builder.cjs +1 -0
  32. package/dist/create-config/for-paths/builder.cjs.map +1 -1
  33. package/dist/create-config/for-paths/builder.d.cts +5 -3
  34. package/dist/create-config/for-paths/builder.d.cts.map +1 -1
  35. package/dist/create-config/for-paths/builder.d.mts +5 -3
  36. package/dist/create-config/for-paths/builder.d.mts.map +1 -1
  37. package/dist/create-config/for-paths/builder.mjs +1 -0
  38. package/dist/create-config/for-paths/builder.mjs.map +1 -1
  39. package/dist/create-config/for-resource.cjs.map +1 -1
  40. package/dist/create-config/for-resource.d.cts +7 -6
  41. package/dist/create-config/for-resource.d.cts.map +1 -1
  42. package/dist/create-config/for-resource.d.mts +7 -6
  43. package/dist/create-config/for-resource.d.mts.map +1 -1
  44. package/dist/create-config/for-resource.mjs.map +1 -1
  45. package/dist/create-config/for-resources/create-component.d.cts +34 -33
  46. package/dist/create-config/for-resources/create-component.d.cts.map +1 -1
  47. package/dist/create-config/for-resources/create-component.d.mts +34 -33
  48. package/dist/create-config/for-resources/create-component.d.mts.map +1 -1
  49. package/dist/create-config/for-resources/create-for-resources.cjs +7 -6
  50. package/dist/create-config/for-resources/create-for-resources.cjs.map +1 -1
  51. package/dist/create-config/for-resources/create-for-resources.d.cts +2 -1
  52. package/dist/create-config/for-resources/create-for-resources.d.mts +2 -1
  53. package/dist/create-config/for-resources/create-for-resources.mjs +7 -6
  54. package/dist/create-config/for-resources/create-for-resources.mjs.map +1 -1
  55. package/dist/create-config/for-resources/scoped-layout.d.cts +5 -4
  56. package/dist/create-config/for-resources/scoped-layout.d.cts.map +1 -1
  57. package/dist/create-config/for-resources/scoped-layout.d.mts +5 -4
  58. package/dist/create-config/for-resources/scoped-layout.d.mts.map +1 -1
  59. package/dist/create-config/index.d.cts +1 -0
  60. package/dist/create-config/index.d.mts +1 -0
  61. package/dist/create-config/inspection.cjs +23 -1
  62. package/dist/create-config/inspection.cjs.map +1 -1
  63. package/dist/create-config/inspection.mjs +24 -3
  64. package/dist/create-config/inspection.mjs.map +1 -1
  65. package/dist/create-config/layout-name.cjs +1 -1
  66. package/dist/create-config/layout-name.mjs +1 -1
  67. package/dist/create-config/lazy-resource-layout.cjs +5 -5
  68. package/dist/create-config/lazy-resource-layout.cjs.map +1 -1
  69. package/dist/create-config/lazy-resource-layout.d.cts +2 -2
  70. package/dist/create-config/lazy-resource-layout.d.cts.map +1 -1
  71. package/dist/create-config/lazy-resource-layout.d.mts +2 -2
  72. package/dist/create-config/lazy-resource-layout.d.mts.map +1 -1
  73. package/dist/create-config/lazy-resource-layout.mjs +5 -5
  74. package/dist/create-config/lazy-resource-layout.mjs.map +1 -1
  75. package/dist/create-config/render-state.cjs +3 -2
  76. package/dist/create-config/render-state.cjs.map +1 -1
  77. package/dist/create-config/render-state.d.cts +27 -25
  78. package/dist/create-config/render-state.d.cts.map +1 -1
  79. package/dist/create-config/render-state.d.mts +27 -25
  80. package/dist/create-config/render-state.d.mts.map +1 -1
  81. package/dist/create-config/render-state.mjs +3 -2
  82. package/dist/create-config/render-state.mjs.map +1 -1
  83. package/dist/create-config/state-composable.cjs +1 -1
  84. package/dist/create-config/state-composable.mjs +1 -1
  85. package/dist/custom-props.cjs +15 -0
  86. package/dist/custom-props.cjs.map +1 -0
  87. package/dist/custom-props.d.cts +17 -0
  88. package/dist/custom-props.d.cts.map +1 -0
  89. package/dist/custom-props.d.mts +17 -0
  90. package/dist/custom-props.d.mts.map +1 -0
  91. package/dist/custom-props.mjs +15 -0
  92. package/dist/custom-props.mjs.map +1 -0
  93. package/dist/errors/react-layout-error.cjs +1 -1
  94. package/dist/errors/react-layout-error.mjs +1 -1
  95. package/dist/index.cjs +3 -3
  96. package/dist/index.d.cts +3 -1
  97. package/dist/index.d.mts +3 -1
  98. package/dist/index.mjs +3 -3
  99. package/dist/lazy/create-lazy-loader.cjs +30 -9
  100. package/dist/lazy/create-lazy-loader.cjs.map +1 -1
  101. package/dist/lazy/create-lazy-loader.mjs +31 -10
  102. package/dist/lazy/create-lazy-loader.mjs.map +1 -1
  103. package/dist/lazy/create-render-state.cjs.map +1 -1
  104. package/dist/lazy/create-render-state.d.cts +5 -5
  105. package/dist/lazy/create-render-state.d.cts.map +1 -1
  106. package/dist/lazy/create-render-state.d.mts +5 -5
  107. package/dist/lazy/create-render-state.d.mts.map +1 -1
  108. package/dist/lazy/create-render-state.mjs.map +1 -1
  109. package/dist/lazy/lazy-boundary.cjs +1 -1
  110. package/dist/lazy/lazy-boundary.mjs +1 -1
  111. package/dist/lazy/types.cjs.map +1 -1
  112. package/dist/lazy/types.d.cts +5 -4
  113. package/dist/lazy/types.d.cts.map +1 -1
  114. package/dist/lazy/types.d.mts +5 -4
  115. package/dist/lazy/types.d.mts.map +1 -1
  116. package/dist/lazy/types.mjs.map +1 -1
  117. package/dist/props.cjs.map +1 -1
  118. package/dist/props.d.cts +4 -3
  119. package/dist/props.d.cts.map +1 -1
  120. package/dist/props.d.mts +4 -3
  121. package/dist/props.d.mts.map +1 -1
  122. package/dist/props.mjs.map +1 -1
  123. package/dist/resource.d.cts +1 -1
  124. package/dist/resource.d.mts +1 -1
  125. package/package.json +5 -5
@@ -1,4 +1,5 @@
1
1
  import { LazyResourceError, LazyResourceErrorMap } from "../errors/lazy-resource-error.cjs";
2
+ import { WithChildren } from "@jfdevelops/react-layout-composables";
2
3
  import { ComponentType, ReactNode } from "react";
3
4
  import { LoadStatus, LoadStatus as LoadStatus$1 } from "@jfdevelops/react-layout-devtools-core";
4
5
 
@@ -26,14 +27,14 @@ type LazyResourceStates<Resource = string> = {
26
27
  Loading?: LazyResourceLoadingComponent<Resource>;
27
28
  };
28
29
  type ErrorHandlerContext<Context> = [Context] extends [never] ? [] : [context: Context];
29
- type LazyErrorHandlers<Resource, Custom extends object = {}, Context = never> = { [Code in LazyResourceError['code']]?: (props: Custom & Omit<LazyResourceErrorProps<Resource>, 'error'> & {
30
+ type LazyErrorHandlers<Resource, Custom extends object = {}, Context = never> = { [Code in LazyResourceError['code']]?: (props: WithChildren<Custom> & Omit<LazyResourceErrorProps<Resource>, 'error'> & {
30
31
  error: LazyResourceErrorMap[Code];
31
32
  }, ...context: ErrorHandlerContext<Context>) => ReactNode } & {
32
- fallback?: (props: Custom & LazyResourceErrorProps<Resource>, ...context: ErrorHandlerContext<Context>) => ReactNode;
33
+ fallback?: (props: WithChildren<Custom> & LazyResourceErrorProps<Resource>, ...context: ErrorHandlerContext<Context>) => ReactNode;
33
34
  };
34
35
  type CreateLazyErrorComponent<Resource, Context = never> = {
35
- <Custom extends object = {}>(render: (props: Custom & LazyResourceErrorProps<Resource>, ...context: ErrorHandlerContext<Context>) => ReactNode): ComponentType<Custom & LazyResourceErrorProps<Resource>>;
36
- <Custom extends object = {}>(handlers: LazyErrorHandlers<Resource, Custom, Context>): ComponentType<Custom & LazyResourceErrorProps<Resource>>;
36
+ <Custom extends object = {}>(render: (props: WithChildren<Custom> & LazyResourceErrorProps<Resource>, ...context: ErrorHandlerContext<Context>) => ReactNode): ComponentType<WithChildren<Custom> & LazyResourceErrorProps<Resource>>;
37
+ <Custom extends object = {}>(handlers: LazyErrorHandlers<Resource, Custom, Context>): ComponentType<WithChildren<Custom> & LazyResourceErrorProps<Resource>>;
37
38
  };
38
39
  //#endregion
39
40
  export { CreateLazyErrorComponent, LazyErrorHandlers, LazyHandle, LazyOptions, LazyResourceErrorComponent, LazyResourceErrorProps, LazyResourceLoadingComponent, LazyResourceStates, type LoadStatus$1 as LoadStatus };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.cts","names":[],"sources":["../../src/lazy/types.ts"],"mappings":";;;;;;KAUY,WAAA,gBACK,MAAA,oBAA0B,MAAA;EAEzC,IAAA,QAAY,OAAA,CAAQ,MAAA;EACpB,QAAA,GAAW,SAAA;AAAA;AAAA,KAGD,UAAA;EACV,OAAA,IAAW,OAAA;EAAA,SACF,MAAA,EAAQ,UAAU;AAAA;AAAA,KAGjB,sBAAA;EACV,KAAA,EAAO,iBAAA;EACP,KAAA;EACA,QAAA,EAAU,QAAQ;AAAA;AAAA,KAGR,0BAAA,sBAA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AAAA,KAGR,0BAAA,sBAAgD,aAAA,CAC1D,sBAAA,CAAuB,QAAA;AAAA,KAEb,4BAAA,sBAAkD,aAAa;EACzE,QAAA,EAAU,QAAA;AAAA;AAAA,KAEA,kBAAA;EACV,KAAA,GAAQ,0BAAA,CAA2B,QAAA;EACnC,OAAA,GAAU,4BAAA,CAA6B,QAAA;AAAA;AAAA,KAGpC,mBAAA,aAAgC,OAAA,0BAEhC,OAAA,EAAS,OAAO;AAAA,KAET,iBAAA,qEAKD,iBAAA,aACP,KAAA,EAAO,YAAA,CAAa,MAAA,IAClB,IAAA,CAAK,sBAAA,CAAuB,QAAA;EAC1B,KAAA,EAAO,oBAAA,CAAqB,IAAA;AAAA,MAE7B,OAAA,EAAS,mBAAA,CAAoB,OAAA,MAC7B,SAAA;EAEL,QAAA,IACE,KAAA,EAAO,YAAA,CAAa,MAAA,IAAU,sBAAA,CAAuB,QAAA,MAClD,OAAA,EAAS,mBAAA,CAAoB,OAAA,MAC7B,SAAA;AAAA;AAAA,KAGK,wBAAA;EAAA,6BAER,MAAA,GACE,KAAA,EAAO,YAAA,CAAa,MAAA,IAAU,sBAAA,CAAuB,QAAA,MAClD,OAAA,EAAS,mBAAA,CAAoB,OAAA,MAC7B,SAAA,GACJ,aAAA,CAAc,YAAA,CAAa,MAAA,IAAU,sBAAA,CAAuB,QAAA;EAAA,6BAE7D,QAAA,EAAU,iBAAA,CAAkB,QAAA,EAAU,MAAA,EAAQ,OAAA,IAC7C,aAAA,CAAc,YAAA,CAAa,MAAA,IAAU,sBAAA,CAAuB,QAAA;AAAA"}
@@ -1,4 +1,5 @@
1
1
  import { LazyResourceError, LazyResourceErrorMap } from "../errors/lazy-resource-error.mjs";
2
+ import { WithChildren } from "@jfdevelops/react-layout-composables";
2
3
  import { ComponentType, ReactNode } from "react";
3
4
  import { LoadStatus, LoadStatus as LoadStatus$1 } from "@jfdevelops/react-layout-devtools-core";
4
5
 
@@ -26,14 +27,14 @@ type LazyResourceStates<Resource = string> = {
26
27
  Loading?: LazyResourceLoadingComponent<Resource>;
27
28
  };
28
29
  type ErrorHandlerContext<Context> = [Context] extends [never] ? [] : [context: Context];
29
- type LazyErrorHandlers<Resource, Custom extends object = {}, Context = never> = { [Code in LazyResourceError['code']]?: (props: Custom & Omit<LazyResourceErrorProps<Resource>, 'error'> & {
30
+ type LazyErrorHandlers<Resource, Custom extends object = {}, Context = never> = { [Code in LazyResourceError['code']]?: (props: WithChildren<Custom> & Omit<LazyResourceErrorProps<Resource>, 'error'> & {
30
31
  error: LazyResourceErrorMap[Code];
31
32
  }, ...context: ErrorHandlerContext<Context>) => ReactNode } & {
32
- fallback?: (props: Custom & LazyResourceErrorProps<Resource>, ...context: ErrorHandlerContext<Context>) => ReactNode;
33
+ fallback?: (props: WithChildren<Custom> & LazyResourceErrorProps<Resource>, ...context: ErrorHandlerContext<Context>) => ReactNode;
33
34
  };
34
35
  type CreateLazyErrorComponent<Resource, Context = never> = {
35
- <Custom extends object = {}>(render: (props: Custom & LazyResourceErrorProps<Resource>, ...context: ErrorHandlerContext<Context>) => ReactNode): ComponentType<Custom & LazyResourceErrorProps<Resource>>;
36
- <Custom extends object = {}>(handlers: LazyErrorHandlers<Resource, Custom, Context>): ComponentType<Custom & LazyResourceErrorProps<Resource>>;
36
+ <Custom extends object = {}>(render: (props: WithChildren<Custom> & LazyResourceErrorProps<Resource>, ...context: ErrorHandlerContext<Context>) => ReactNode): ComponentType<WithChildren<Custom> & LazyResourceErrorProps<Resource>>;
37
+ <Custom extends object = {}>(handlers: LazyErrorHandlers<Resource, Custom, Context>): ComponentType<WithChildren<Custom> & LazyResourceErrorProps<Resource>>;
37
38
  };
38
39
  //#endregion
39
40
  export { CreateLazyErrorComponent, LazyErrorHandlers, LazyHandle, LazyOptions, LazyResourceErrorComponent, LazyResourceErrorProps, LazyResourceLoadingComponent, LazyResourceStates, type LoadStatus$1 as LoadStatus };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.mts","names":[],"sources":["../../src/l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,aAAA,CAAc,YAAA,CAAa,MAAA,IAAU,sBAAA,CAAuB,QAAA;AAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":[],"sources":["../../src/lazy/types.ts"],"sourcesContent":["import type { ComponentType, ReactNode } from 'react';\nimport type { LoadStatus } from '@jfdevelops/react-layout-devtools-core';\nimport type {\n LazyResourceError,\n LazyResourceErrorMap,\n} from '../errors/lazy-resource-error';\n\nexport type { LoadStatus } from '@jfdevelops/react-layout-devtools-core';\n\n/** Options shared by lazy layouts, render states, and scoped content. */\nexport type LazyOptions<\n Module extends Record<string, unknown> = Record<string, unknown>,\n> = {\n load: () => Promise<Module>;\n fallback?: ReactNode;\n};\n\nexport type LazyHandle = {\n preload(): Promise<void>;\n readonly status: LoadStatus;\n};\n\nexport type LazyResourceErrorProps<Resource = string> = {\n error: LazyResourceError;\n retry: () => void;\n resource: Resource;\n};\n\nexport type LazyResourceErrorComponent<Resource = string> = ComponentType<\n LazyResourceErrorProps<Resource>\n>;\nexport type LazyResourceLoadingComponent<Resource = string> = ComponentType<{\n resource: Resource;\n}>;\nexport type LazyResourceStates<Resource = string> = {\n Error?: LazyResourceErrorComponent<Resource>;\n Loading?: LazyResourceLoadingComponent<Resource>;\n};\n\ntype ErrorHandlerContext<Context> = [Context] extends [never]\n ? []\n : [context: Context];\n\nexport type LazyErrorHandlers<\n Resource,\n Custom extends object = {},\n Context = never,\n> = {\n [Code in LazyResourceError['code']]?: (\n props: Custom &\n Omit<LazyResourceErrorProps<Resource>, 'error'> & {\n error: LazyResourceErrorMap[Code];\n },\n ...context: ErrorHandlerContext<Context>\n ) => ReactNode;\n} & {\n fallback?: (\n props: Custom & LazyResourceErrorProps<Resource>,\n ...context: ErrorHandlerContext<Context>\n ) => ReactNode;\n};\n\nexport type CreateLazyErrorComponent<Resource, Context = never> = {\n <Custom extends object = {}>(\n render: (\n props: Custom & LazyResourceErrorProps<Resource>,\n ...context: ErrorHandlerContext<Context>\n ) => ReactNode,\n ): ComponentType<Custom & LazyResourceErrorProps<Resource>>;\n <Custom extends object = {}>(\n handlers: LazyErrorHandlers<Resource, Custom, Context>,\n ): ComponentType<Custom & LazyResourceErrorProps<Resource>>;\n};\n\n/** Internal factory defaults propagated to layouts without publishing metadata. */\nexport const lazyDefaultsSymbol = Symbol('lazyDefaults');\n\nexport const lazyStatesSymbol = Symbol('lazyStates');\n"],"mappings":";;AA2EA,MAAa,qBAAqB,OAAO,cAAc;AAEvD,MAAa,mBAAmB,OAAO,YAAY"}
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../src/lazy/types.ts"],"sourcesContent":["import type { WithChildren } from '@jfdevelops/react-layout-composables';\nimport type { ComponentType, ReactNode } from 'react';\nimport type { LoadStatus } from '@jfdevelops/react-layout-devtools-core';\nimport type {\n LazyResourceError,\n LazyResourceErrorMap,\n} from '../errors/lazy-resource-error';\n\nexport type { LoadStatus } from '@jfdevelops/react-layout-devtools-core';\n\n/** Options shared by lazy layouts, render states, and scoped content. */\nexport type LazyOptions<\n Module extends Record<string, unknown> = Record<string, unknown>,\n> = {\n load: () => Promise<Module>;\n fallback?: ReactNode;\n};\n\nexport type LazyHandle = {\n preload(): Promise<void>;\n readonly status: LoadStatus;\n};\n\nexport type LazyResourceErrorProps<Resource = string> = {\n error: LazyResourceError;\n retry: () => void;\n resource: Resource;\n};\n\nexport type LazyResourceErrorComponent<Resource = string> = ComponentType<\n LazyResourceErrorProps<Resource>\n>;\nexport type LazyResourceLoadingComponent<Resource = string> = ComponentType<{\n resource: Resource;\n}>;\nexport type LazyResourceStates<Resource = string> = {\n Error?: LazyResourceErrorComponent<Resource>;\n Loading?: LazyResourceLoadingComponent<Resource>;\n};\n\ntype ErrorHandlerContext<Context> = [Context] extends [never]\n ? []\n : [context: Context];\n\nexport type LazyErrorHandlers<\n Resource,\n Custom extends object = {},\n Context = never,\n> = {\n [Code in LazyResourceError['code']]?: (\n props: WithChildren<Custom> &\n Omit<LazyResourceErrorProps<Resource>, 'error'> & {\n error: LazyResourceErrorMap[Code];\n },\n ...context: ErrorHandlerContext<Context>\n ) => ReactNode;\n} & {\n fallback?: (\n props: WithChildren<Custom> & LazyResourceErrorProps<Resource>,\n ...context: ErrorHandlerContext<Context>\n ) => ReactNode;\n};\n\nexport type CreateLazyErrorComponent<Resource, Context = never> = {\n <Custom extends object = {}>(\n render: (\n props: WithChildren<Custom> & LazyResourceErrorProps<Resource>,\n ...context: ErrorHandlerContext<Context>\n ) => ReactNode,\n ): ComponentType<WithChildren<Custom> & LazyResourceErrorProps<Resource>>;\n <Custom extends object = {}>(\n handlers: LazyErrorHandlers<Resource, Custom, Context>,\n ): ComponentType<WithChildren<Custom> & LazyResourceErrorProps<Resource>>;\n};\n\n/** Internal factory defaults propagated to layouts without publishing metadata. */\nexport const lazyDefaultsSymbol = Symbol('lazyDefaults');\n\nexport const lazyStatesSymbol = Symbol('lazyStates');\n"],"mappings":";;AA4EA,MAAa,qBAAqB,OAAO,cAAc;AAEvD,MAAa,mBAAmB,OAAO,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"props.cjs","names":["LayoutConfigurationError"],"sources":["../src/props.ts"],"sourcesContent":["import { LayoutConfigurationError } from './errors';\nimport type {\n ComposableComponents,\n MergePresetProps,\n} from '@jfdevelops/react-layout-composables';\nimport type { InPropsObject } from '@jfdevelops/react-layout-composables';\nimport {\n EnumWrappedProp,\n LiteralWrappedProp,\n ResolveLayoutProps,\n ResolveLayoutPropsAsDefined,\n ResolveProps,\n} from '@jfdevelops/react-layout-validator';\nimport { ResourceDefinition, ResourceEnum } from './resource';\nimport { Show } from './utils';\n\nexport type { InPropsObject };\n\n/**\n * Two-argument `render(props, context)` used by createComponent and scoped\n * resource components. `Context` is sibling components (scoped) or the\n * resource render context (top-level).\n */\nexport type PropsContextRender<RenderProps, Context, Result = unknown> = (\n props: RenderProps,\n context: Context,\n) => Result;\n\n/**\n * Shared `{ props?, render }` shape used by createComponent, scoped\n * components, and anywhere else a value declares props and a two-arg render.\n *\n * @typeParam Props - Declared on the entry (`props`). Often an\n * {@link InPropsObject}, or a layout include/custom bag.\n * @typeParam RenderProps - First argument to `render` (defaults to\n * {@link ResolveProps}<Props> when Props is an {@link InPropsObject})\n * @typeParam Result - `render` return type\n * @typeParam Context - Second argument to `render`\n */\nexport interface PropsRenderDefinition<\n Props = InPropsObject,\n RenderProps = Props extends InPropsObject ? ResolveProps<Props> : unknown,\n Result = unknown,\n Context = unknown,\n> {\n props?: Props;\n render: PropsContextRender<RenderProps, Context, Result>;\n}\n\nexport type InPropsOptions<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Name extends string,\n> = {\n name: LiteralWrappedProp<Name, 'string', 'required'>;\n resource: EnumWrappedProp<ResourceEnum<Resources>, 'string', 'required'>;\n};\nexport type InPropsFunction<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = <Name extends string>(\n props: Show<InPropsOptions<Resources, Name>>,\n) => InPropsObject;\nexport type InPropsDefinition<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = InPropsObject | InPropsFunction<Resources>;\nexport type InferredInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n> = Options extends InPropsFunction<Resources> ? ReturnType<Options> : Options;\nexport type MergedLayoutInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents,\n> =\n InferredInProps<Resources, Options> extends InPropsObject\n ? InferredInProps<Resources, Options> & MergePresetProps<Composables>\n : never;\nexport type RequiredVariant = true | 'required';\n/**\n * @typeParam RequiredVariant How the required props are selected. In application code,\n * it will always be `true`, but internally we need to support `'required'` as well.\n */\ntype PropsType<Variant extends RequiredVariant = true> = Variant | 'optional';\ntype InternalPropsType = PropsType<'required'>;\ntype IncludedPropSource = 'component' | 'config';\n/** Controls whether an included prop is required and where it is supplied. */\nexport type IncludedPropBehavior = {\n required: boolean;\n suppliedVia: IncludedPropSource;\n};\n\ntype IncludedPropType = PropsType | IncludedPropBehavior;\n/**\n * A map of props to include in the layout.\n */\nexport type IncludedProps<T extends object> = {\n [K in keyof T & string]?: IncludedPropType;\n};\n\ntype PropsKeys<Props extends InPropsObject, T> = T & keyof Props;\nexport type IncludedPropVisibility<Value> = Value extends { required: boolean }\n ? Value['required'] extends true\n ? 'required'\n : 'optional'\n : Value extends true | 'required'\n ? 'required'\n : Value extends 'optional'\n ? 'optional'\n : never;\nexport type IncludedPropSupplySource<Value> = Value extends {\n suppliedVia: IncludedPropSource;\n}\n ? Value['suppliedVia']\n : never;\n/**\n * Internal representation of the supported include behavior.\n */\nexport type NormalizedIncludedPropBehavior<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? {\n visibility: IncludedPropVisibility<Value>;\n passthrough: IncludedPropSupplySource<Value>;\n }\n : Value;\n\nexport type IncludedPropPassthrough<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? IncludedPropSupplySource<Value> extends 'component'\n ? IncludedPropVisibility<Value> extends 'optional'\n ? 'component' | 'config'\n : 'component'\n : IncludedPropSupplySource<Value>\n : Value extends true | 'required'\n ? 'config'\n : Value extends 'optional'\n ? 'component' | 'config'\n : never;\n\ntype GetPropsKey<\n IncludeProps extends object,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = {\n [Key in keyof IncludeProps]: IncludedPropVisibility<\n IncludeProps[Key]\n > extends Visibility\n ? Passthrough extends 'render'\n ? Key\n : Passthrough extends IncludedPropPassthrough<IncludeProps[Key]>\n ? Key\n : never\n : never;\n}[keyof IncludeProps];\ntype SelectedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = Pick<\n Props,\n PropsKeys<Props, GetPropsKey<IncludeProps, Visibility, Passthrough>>\n>;\n\ntype OptionalPropDefinition<Definition> = Definition extends {\n optional(): infer OptionalDefinition;\n}\n ? OptionalDefinition\n : Definition;\n\n/** Raw validator definitions accepted by a generated component call. */\nexport type IncludedComponentPropDefinitions<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = SelectedIncludedProps<Props, IncludeProps, 'required', 'component'> & {\n [Key in keyof SelectedIncludedProps<\n Props,\n IncludeProps,\n 'optional',\n 'component'\n >]: OptionalPropDefinition<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>[Key]\n >;\n};\n\nexport type ResolvedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'required'>> &\n Partial<\n ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'optional'>>\n >;\n\nexport type ResolvedIncludedConfigProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'config'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'config'>\n >\n >;\n\nexport type ResolvedIncludedComponentProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'component'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>\n >\n >;\n\n/**\n * Like {@link ResolvedIncludedProps}, but keeps included prop keys exactly as\n * declared (no `JSX.Element` capitalization).\n */\nexport type ResolvedIncludedPropsAsDefined<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'required'>\n> &\n Partial<\n ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'optional'>\n >\n >;\nexport type LayoutRenderProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents = {},\n IncludeProps extends IncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>\n > = {},\n CustomProps extends InPropsObject = {},\n> = Show<\n ResolveProps<CustomProps> &\n ResolvedIncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>,\n IncludeProps\n >\n>;\n\nexport function getIncludedPropBehavior(value: unknown): {\n visibility: 'required' | 'optional';\n passthrough: 'component' | 'config';\n} | null {\n if (value === null || typeof value !== 'object') {\n return null;\n }\n\n if ('visibility' in value || 'passthrough' in value) {\n throw new LayoutConfigurationError(\n 'Include properties visibility and passthrough were removed; use required and suppliedVia.',\n );\n }\n\n const required =\n 'required' in value && typeof value.required === 'boolean'\n ? value.required\n : undefined;\n const suppliedVia = 'suppliedVia' in value ? value.suppliedVia : undefined;\n\n if (\n required === undefined ||\n (suppliedVia !== 'component' && suppliedVia !== 'config')\n ) {\n return null;\n }\n\n return {\n visibility: required ? 'required' : 'optional',\n passthrough: suppliedVia,\n };\n}\n"],"mappings":";;;AAwPA,SAAgB,wBAAwB,OAG/B;CACP,IAAI,UAAU,QAAQ,OAAO,UAAU,UACrC,OAAO;CAGT,IAAI,gBAAgB,SAAS,iBAAiB,OAC5C,MAAM,IAAIA,4DACR,2FACF;CAGF,MAAM,WACJ,cAAc,SAAS,OAAO,MAAM,aAAa,YAC7C,MAAM,WACN;CACN,MAAM,cAAc,iBAAiB,QAAQ,MAAM,cAAc;CAEjE,IACE,aAAa,UACZ,gBAAgB,eAAe,gBAAgB,UAEhD,OAAO;CAGT,OAAO;EACL,YAAY,WAAW,aAAa;EACpC,aAAa;CACf;AACF"}
1
+ {"version":3,"file":"props.cjs","names":["LayoutConfigurationError"],"sources":["../src/props.ts"],"sourcesContent":["import type { WithChildren } from '@jfdevelops/react-layout-composables';\nimport type { CustomPropsObject, ResolveRenderProps } from './custom-props';\nimport { LayoutConfigurationError } from './errors';\nimport type {\n ComposableComponents,\n MergePresetProps,\n} from '@jfdevelops/react-layout-composables';\nimport type { InPropsObject } from '@jfdevelops/react-layout-composables';\nimport {\n EnumWrappedProp,\n LiteralWrappedProp,\n ResolveLayoutProps,\n ResolveLayoutPropsAsDefined,\n ResolveProps,\n} from '@jfdevelops/react-layout-validator';\nimport { ResourceDefinition, ResourceEnum } from './resource';\nimport { Show } from './utils';\n\nexport type { InPropsObject };\n\n/**\n * Two-argument `render(props, context)` used by createComponent and scoped\n * resource components. `Context` is sibling components (scoped) or the\n * resource render context (top-level).\n */\nexport type PropsContextRender<RenderProps, Context, Result = unknown> = (\n props: WithChildren<RenderProps>,\n context: Context,\n) => Result;\n\n/**\n * Shared `{ props?, render }` shape used by createComponent, scoped\n * components, and anywhere else a value declares props and a two-arg render.\n *\n * @typeParam Props - Declared on the entry (`props`). Often an\n * {@link InPropsObject}, or a layout include/custom bag.\n * @typeParam RenderProps - First argument to `render` (defaults to\n * {@link ResolveProps}<Props> when Props is an {@link InPropsObject})\n * @typeParam Result - `render` return type\n * @typeParam Context - Second argument to `render`\n */\nexport interface PropsRenderDefinition<\n Props = InPropsObject,\n RenderProps = Props extends InPropsObject ? ResolveProps<Props> : unknown,\n Result = unknown,\n Context = unknown,\n> {\n props?: Props;\n render: PropsContextRender<RenderProps, Context, Result>;\n}\n\nexport type InPropsOptions<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Name extends string,\n> = {\n name: LiteralWrappedProp<Name, 'string', 'required'>;\n resource: EnumWrappedProp<ResourceEnum<Resources>, 'string', 'required'>;\n};\nexport type InPropsFunction<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = <Name extends string>(\n props: Show<InPropsOptions<Resources, Name>>,\n) => InPropsObject;\nexport type InPropsDefinition<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = InPropsObject | InPropsFunction<Resources>;\nexport type InferredInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n> = Options extends InPropsFunction<Resources> ? ReturnType<Options> : Options;\nexport type MergedLayoutInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents,\n> =\n InferredInProps<Resources, Options> extends InPropsObject\n ? InferredInProps<Resources, Options> & MergePresetProps<Composables>\n : never;\nexport type RequiredVariant = true | 'required';\n/**\n * @typeParam RequiredVariant How the required props are selected. In application code,\n * it will always be `true`, but internally we need to support `'required'` as well.\n */\ntype PropsType<Variant extends RequiredVariant = true> = Variant | 'optional';\ntype InternalPropsType = PropsType<'required'>;\ntype IncludedPropSource = 'component' | 'config';\n/** Controls whether an included prop is required and where it is supplied. */\nexport type IncludedPropBehavior = {\n required: boolean;\n suppliedVia: IncludedPropSource;\n};\n\ntype IncludedPropType = PropsType | IncludedPropBehavior;\n/**\n * A map of props to include in the layout.\n */\nexport type IncludedProps<T extends object> = {\n [K in keyof T & string]?: IncludedPropType;\n};\n\ntype PropsKeys<Props extends InPropsObject, T> = T & keyof Props;\nexport type IncludedPropVisibility<Value> = Value extends { required: boolean }\n ? Value['required'] extends true\n ? 'required'\n : 'optional'\n : Value extends true | 'required'\n ? 'required'\n : Value extends 'optional'\n ? 'optional'\n : never;\nexport type IncludedPropSupplySource<Value> = Value extends {\n suppliedVia: IncludedPropSource;\n}\n ? Value['suppliedVia']\n : never;\n/**\n * Internal representation of the supported include behavior.\n */\nexport type NormalizedIncludedPropBehavior<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? {\n visibility: IncludedPropVisibility<Value>;\n passthrough: IncludedPropSupplySource<Value>;\n }\n : Value;\n\nexport type IncludedPropPassthrough<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? IncludedPropSupplySource<Value> extends 'component'\n ? IncludedPropVisibility<Value> extends 'optional'\n ? 'component' | 'config'\n : 'component'\n : IncludedPropSupplySource<Value>\n : Value extends true | 'required'\n ? 'config'\n : Value extends 'optional'\n ? 'component' | 'config'\n : never;\n\ntype GetPropsKey<\n IncludeProps extends object,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = {\n [Key in keyof IncludeProps]: IncludedPropVisibility<\n IncludeProps[Key]\n > extends Visibility\n ? Passthrough extends 'render'\n ? Key\n : Passthrough extends IncludedPropPassthrough<IncludeProps[Key]>\n ? Key\n : never\n : never;\n}[keyof IncludeProps];\ntype SelectedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = Pick<\n Props,\n PropsKeys<Props, GetPropsKey<IncludeProps, Visibility, Passthrough>>\n>;\n\ntype OptionalPropDefinition<Definition> = Definition extends {\n optional(): infer OptionalDefinition;\n}\n ? OptionalDefinition\n : Definition;\n\n/** Raw validator definitions accepted by a generated component call. */\nexport type IncludedComponentPropDefinitions<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = SelectedIncludedProps<Props, IncludeProps, 'required', 'component'> & {\n [Key in keyof SelectedIncludedProps<\n Props,\n IncludeProps,\n 'optional',\n 'component'\n >]: OptionalPropDefinition<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>[Key]\n >;\n};\n\nexport type ResolvedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'required'>> &\n Partial<\n ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'optional'>>\n >;\n\nexport type ResolvedIncludedConfigProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'config'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'config'>\n >\n >;\n\nexport type ResolvedIncludedComponentProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'component'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>\n >\n >;\n\n/**\n * Like {@link ResolvedIncludedProps}, but keeps included prop keys exactly as\n * declared (no `JSX.Element` capitalization).\n */\nexport type ResolvedIncludedPropsAsDefined<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'required'>\n> &\n Partial<\n ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'optional'>\n >\n >;\nexport type LayoutRenderProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents = {},\n IncludeProps extends IncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>\n > = {},\n CustomProps extends CustomPropsObject = {},\n> = Show<\n ResolveRenderProps<CustomProps> &\n ResolvedIncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>,\n IncludeProps\n >\n>;\n\nexport function getIncludedPropBehavior(value: unknown): {\n visibility: 'required' | 'optional';\n passthrough: 'component' | 'config';\n} | null {\n if (value === null || typeof value !== 'object') {\n return null;\n }\n\n if ('visibility' in value || 'passthrough' in value) {\n throw new LayoutConfigurationError(\n 'Include properties visibility and passthrough were removed; use required and suppliedVia.',\n );\n }\n\n const required =\n 'required' in value && typeof value.required === 'boolean'\n ? value.required\n : undefined;\n const suppliedVia = 'suppliedVia' in value ? value.suppliedVia : undefined;\n\n if (\n required === undefined ||\n (suppliedVia !== 'component' && suppliedVia !== 'config')\n ) {\n return null;\n }\n\n return {\n visibility: required ? 'required' : 'optional',\n passthrough: suppliedVia,\n };\n}\n"],"mappings":";;;AA0PA,SAAgB,wBAAwB,OAG/B;CACP,IAAI,UAAU,QAAQ,OAAO,UAAU,UACrC,OAAO;CAGT,IAAI,gBAAgB,SAAS,iBAAiB,OAC5C,MAAM,IAAIA,4DACR,2FACF;CAGF,MAAM,WACJ,cAAc,SAAS,OAAO,MAAM,aAAa,YAC7C,MAAM,WACN;CACN,MAAM,cAAc,iBAAiB,QAAQ,MAAM,cAAc;CAEjE,IACE,aAAa,UACZ,gBAAgB,eAAe,gBAAgB,UAEhD,OAAO;CAGT,OAAO;EACL,YAAY,WAAW,aAAa;EACpC,aAAa;CACf;AACF"}
package/dist/props.d.cts CHANGED
@@ -1,6 +1,7 @@
1
+ import { CustomPropsObject, ResolveRenderProps } from "./custom-props.cjs";
1
2
  import { Show } from "./utils.cjs";
2
3
  import { ResourceDefinition, ResourceEnum } from "./resource.cjs";
3
- import { ComposableComponents, InPropsObject, MergePresetProps } from "@jfdevelops/react-layout-composables";
4
+ import { ComposableComponents, InPropsObject, MergePresetProps, WithChildren } from "@jfdevelops/react-layout-composables";
4
5
  import { EnumWrappedProp, LiteralWrappedProp, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps } from "@jfdevelops/react-layout-validator";
5
6
 
6
7
  //#region src/props.d.ts
@@ -9,7 +10,7 @@ import { EnumWrappedProp, LiteralWrappedProp, ResolveLayoutProps, ResolveLayoutP
9
10
  * resource components. `Context` is sibling components (scoped) or the
10
11
  * resource render context (top-level).
11
12
  */
12
- type PropsContextRender<RenderProps, Context, Result = unknown> = (props: RenderProps, context: Context) => Result;
13
+ type PropsContextRender<RenderProps, Context, Result = unknown> = (props: WithChildren<RenderProps>, context: Context) => Result;
13
14
  /**
14
15
  * Shared `{ props?, render }` shape used by createComponent, scoped
15
16
  * components, and anywhere else a value declares props and a two-arg render.
@@ -89,7 +90,7 @@ type ResolvedIncludedComponentProps<Props extends InPropsObject, IncludeProps ex
89
90
  * declared (no `JSX.Element` capitalization).
90
91
  */
91
92
  type ResolvedIncludedPropsAsDefined<Props extends InPropsObject, IncludeProps extends IncludedProps<Props>> = ResolveLayoutPropsAsDefined<SelectedIncludedProps<Props, IncludeProps, 'required'>> & Partial<ResolveLayoutPropsAsDefined<SelectedIncludedProps<Props, IncludeProps, 'optional'>>>;
92
- type LayoutRenderProps<Resources extends ReadonlyArray<ResourceDefinition>, Options extends InPropsDefinition<Resources>, Composables extends ComposableComponents = {}, IncludeProps extends IncludedProps<MergedLayoutInProps<Resources, Options, Composables>> = {}, CustomProps extends InPropsObject = {}> = Show<ResolveProps<CustomProps> & ResolvedIncludedProps<MergedLayoutInProps<Resources, Options, Composables>, IncludeProps>>;
93
+ type LayoutRenderProps<Resources extends ReadonlyArray<ResourceDefinition>, Options extends InPropsDefinition<Resources>, Composables extends ComposableComponents = {}, IncludeProps extends IncludedProps<MergedLayoutInProps<Resources, Options, Composables>> = {}, CustomProps extends CustomPropsObject = {}> = Show<ResolveRenderProps<CustomProps> & ResolvedIncludedProps<MergedLayoutInProps<Resources, Options, Composables>, IncludeProps>>;
93
94
  //#endregion
94
95
  export { InPropsDefinition, InPropsFunction, type InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, NormalizedIncludedPropBehavior, PropsContextRender, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined };
95
96
  //# sourceMappingURL=props.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.cts","names":[],"sources":["../src/props.ts"],"mappings":";;;;;;AAuBA;;;;;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,m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,OAAA,CACE,2BAAA,CACE,qBAAA,CAAsB,KAAA,EAAO,YAAA;AAAA,KAGvB,iBAAA,mBACQ,aAAA,CAAc,kBAAA,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,4BACC,aAAA,CACnB,mBAAA,CAAoB,SAAA,EAAW,OAAA,EAAS,WAAA,6BAEtB,iBAAA,SAClB,IAAA,CACF,kBAAA,CAAmB,WAAA,IACjB,qBAAA,CACE,mBAAA,CAAoB,SAAA,EAAW,OAAA,EAAS,WAAA,GACxC,YAAA"}
package/dist/props.d.mts CHANGED
@@ -1,6 +1,7 @@
1
+ import { CustomPropsObject, ResolveRenderProps } from "./custom-props.mjs";
1
2
  import { Show } from "./utils.mjs";
2
3
  import { ResourceDefinition, ResourceEnum } from "./resource.mjs";
3
- import { ComposableComponents, InPropsObject, MergePresetProps } from "@jfdevelops/react-layout-composables";
4
+ import { ComposableComponents, InPropsObject, MergePresetProps, WithChildren } from "@jfdevelops/react-layout-composables";
4
5
  import { EnumWrappedProp, LiteralWrappedProp, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps } from "@jfdevelops/react-layout-validator";
5
6
 
6
7
  //#region src/props.d.ts
@@ -9,7 +10,7 @@ import { EnumWrappedProp, LiteralWrappedProp, ResolveLayoutProps, ResolveLayoutP
9
10
  * resource components. `Context` is sibling components (scoped) or the
10
11
  * resource render context (top-level).
11
12
  */
12
- type PropsContextRender<RenderProps, Context, Result = unknown> = (props: RenderProps, context: Context) => Result;
13
+ type PropsContextRender<RenderProps, Context, Result = unknown> = (props: WithChildren<RenderProps>, context: Context) => Result;
13
14
  /**
14
15
  * Shared `{ props?, render }` shape used by createComponent, scoped
15
16
  * components, and anywhere else a value declares props and a two-arg render.
@@ -89,7 +90,7 @@ type ResolvedIncludedComponentProps<Props extends InPropsObject, IncludeProps ex
89
90
  * declared (no `JSX.Element` capitalization).
90
91
  */
91
92
  type ResolvedIncludedPropsAsDefined<Props extends InPropsObject, IncludeProps extends IncludedProps<Props>> = ResolveLayoutPropsAsDefined<SelectedIncludedProps<Props, IncludeProps, 'required'>> & Partial<ResolveLayoutPropsAsDefined<SelectedIncludedProps<Props, IncludeProps, 'optional'>>>;
92
- type LayoutRenderProps<Resources extends ReadonlyArray<ResourceDefinition>, Options extends InPropsDefinition<Resources>, Composables extends ComposableComponents = {}, IncludeProps extends IncludedProps<MergedLayoutInProps<Resources, Options, Composables>> = {}, CustomProps extends InPropsObject = {}> = Show<ResolveProps<CustomProps> & ResolvedIncludedProps<MergedLayoutInProps<Resources, Options, Composables>, IncludeProps>>;
93
+ type LayoutRenderProps<Resources extends ReadonlyArray<ResourceDefinition>, Options extends InPropsDefinition<Resources>, Composables extends ComposableComponents = {}, IncludeProps extends IncludedProps<MergedLayoutInProps<Resources, Options, Composables>> = {}, CustomProps extends CustomPropsObject = {}> = Show<ResolveRenderProps<CustomProps> & ResolvedIncludedProps<MergedLayoutInProps<Resources, Options, Composables>, IncludeProps>>;
93
94
  //#endregion
94
95
  export { InPropsDefinition, InPropsFunction, type InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, NormalizedIncludedPropBehavior, PropsContextRender, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined };
95
96
  //# sourceMappingURL=props.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.mts","names":[],"sources":["../src/props.ts"],"mappings":";;;;;;AAuBA;;;;;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,K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AAA,CACE,qBAAA,CAAsB,KAAA,EAAO,YAAA;;;;;KAQvB,8BAAA,eACI,aAAA,uBACO,aAAA,CAAc,KAAA,KACjC,2BAAA,CACF,qBAAA,CAAsB,KAAA,EAAO,YAAA,iBAE7B,OAAA,CACE,2BAAA,CACE,qBAAA,CAAsB,KAAA,EAAO,YAAA;AAAA,KAGvB,iBAAA,mBACQ,aAAA,CAAc,kBAAA,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,4BACC,aAAA,CACnB,mBAAA,CAAoB,SAAA,EAAW,OAAA,EAAS,WAAA,6BAEtB,iBAAA,SAClB,IAAA,CACF,kBAAA,CAAmB,WAAA,IACjB,qBAAA,CACE,mBAAA,CAAoB,SAAA,EAAW,OAAA,EAAS,WAAA,GACxC,YAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"props.mjs","names":[],"sources":["../src/props.ts"],"sourcesContent":["import { LayoutConfigurationError } from './errors';\nimport type {\n ComposableComponents,\n MergePresetProps,\n} from '@jfdevelops/react-layout-composables';\nimport type { InPropsObject } from '@jfdevelops/react-layout-composables';\nimport {\n EnumWrappedProp,\n LiteralWrappedProp,\n ResolveLayoutProps,\n ResolveLayoutPropsAsDefined,\n ResolveProps,\n} from '@jfdevelops/react-layout-validator';\nimport { ResourceDefinition, ResourceEnum } from './resource';\nimport { Show } from './utils';\n\nexport type { InPropsObject };\n\n/**\n * Two-argument `render(props, context)` used by createComponent and scoped\n * resource components. `Context` is sibling components (scoped) or the\n * resource render context (top-level).\n */\nexport type PropsContextRender<RenderProps, Context, Result = unknown> = (\n props: RenderProps,\n context: Context,\n) => Result;\n\n/**\n * Shared `{ props?, render }` shape used by createComponent, scoped\n * components, and anywhere else a value declares props and a two-arg render.\n *\n * @typeParam Props - Declared on the entry (`props`). Often an\n * {@link InPropsObject}, or a layout include/custom bag.\n * @typeParam RenderProps - First argument to `render` (defaults to\n * {@link ResolveProps}<Props> when Props is an {@link InPropsObject})\n * @typeParam Result - `render` return type\n * @typeParam Context - Second argument to `render`\n */\nexport interface PropsRenderDefinition<\n Props = InPropsObject,\n RenderProps = Props extends InPropsObject ? ResolveProps<Props> : unknown,\n Result = unknown,\n Context = unknown,\n> {\n props?: Props;\n render: PropsContextRender<RenderProps, Context, Result>;\n}\n\nexport type InPropsOptions<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Name extends string,\n> = {\n name: LiteralWrappedProp<Name, 'string', 'required'>;\n resource: EnumWrappedProp<ResourceEnum<Resources>, 'string', 'required'>;\n};\nexport type InPropsFunction<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = <Name extends string>(\n props: Show<InPropsOptions<Resources, Name>>,\n) => InPropsObject;\nexport type InPropsDefinition<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = InPropsObject | InPropsFunction<Resources>;\nexport type InferredInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n> = Options extends InPropsFunction<Resources> ? ReturnType<Options> : Options;\nexport type MergedLayoutInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents,\n> =\n InferredInProps<Resources, Options> extends InPropsObject\n ? InferredInProps<Resources, Options> & MergePresetProps<Composables>\n : never;\nexport type RequiredVariant = true | 'required';\n/**\n * @typeParam RequiredVariant How the required props are selected. In application code,\n * it will always be `true`, but internally we need to support `'required'` as well.\n */\ntype PropsType<Variant extends RequiredVariant = true> = Variant | 'optional';\ntype InternalPropsType = PropsType<'required'>;\ntype IncludedPropSource = 'component' | 'config';\n/** Controls whether an included prop is required and where it is supplied. */\nexport type IncludedPropBehavior = {\n required: boolean;\n suppliedVia: IncludedPropSource;\n};\n\ntype IncludedPropType = PropsType | IncludedPropBehavior;\n/**\n * A map of props to include in the layout.\n */\nexport type IncludedProps<T extends object> = {\n [K in keyof T & string]?: IncludedPropType;\n};\n\ntype PropsKeys<Props extends InPropsObject, T> = T & keyof Props;\nexport type IncludedPropVisibility<Value> = Value extends { required: boolean }\n ? Value['required'] extends true\n ? 'required'\n : 'optional'\n : Value extends true | 'required'\n ? 'required'\n : Value extends 'optional'\n ? 'optional'\n : never;\nexport type IncludedPropSupplySource<Value> = Value extends {\n suppliedVia: IncludedPropSource;\n}\n ? Value['suppliedVia']\n : never;\n/**\n * Internal representation of the supported include behavior.\n */\nexport type NormalizedIncludedPropBehavior<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? {\n visibility: IncludedPropVisibility<Value>;\n passthrough: IncludedPropSupplySource<Value>;\n }\n : Value;\n\nexport type IncludedPropPassthrough<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? IncludedPropSupplySource<Value> extends 'component'\n ? IncludedPropVisibility<Value> extends 'optional'\n ? 'component' | 'config'\n : 'component'\n : IncludedPropSupplySource<Value>\n : Value extends true | 'required'\n ? 'config'\n : Value extends 'optional'\n ? 'component' | 'config'\n : never;\n\ntype GetPropsKey<\n IncludeProps extends object,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = {\n [Key in keyof IncludeProps]: IncludedPropVisibility<\n IncludeProps[Key]\n > extends Visibility\n ? Passthrough extends 'render'\n ? Key\n : Passthrough extends IncludedPropPassthrough<IncludeProps[Key]>\n ? Key\n : never\n : never;\n}[keyof IncludeProps];\ntype SelectedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = Pick<\n Props,\n PropsKeys<Props, GetPropsKey<IncludeProps, Visibility, Passthrough>>\n>;\n\ntype OptionalPropDefinition<Definition> = Definition extends {\n optional(): infer OptionalDefinition;\n}\n ? OptionalDefinition\n : Definition;\n\n/** Raw validator definitions accepted by a generated component call. */\nexport type IncludedComponentPropDefinitions<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = SelectedIncludedProps<Props, IncludeProps, 'required', 'component'> & {\n [Key in keyof SelectedIncludedProps<\n Props,\n IncludeProps,\n 'optional',\n 'component'\n >]: OptionalPropDefinition<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>[Key]\n >;\n};\n\nexport type ResolvedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'required'>> &\n Partial<\n ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'optional'>>\n >;\n\nexport type ResolvedIncludedConfigProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'config'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'config'>\n >\n >;\n\nexport type ResolvedIncludedComponentProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'component'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>\n >\n >;\n\n/**\n * Like {@link ResolvedIncludedProps}, but keeps included prop keys exactly as\n * declared (no `JSX.Element` capitalization).\n */\nexport type ResolvedIncludedPropsAsDefined<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'required'>\n> &\n Partial<\n ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'optional'>\n >\n >;\nexport type LayoutRenderProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents = {},\n IncludeProps extends IncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>\n > = {},\n CustomProps extends InPropsObject = {},\n> = Show<\n ResolveProps<CustomProps> &\n ResolvedIncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>,\n IncludeProps\n >\n>;\n\nexport function getIncludedPropBehavior(value: unknown): {\n visibility: 'required' | 'optional';\n passthrough: 'component' | 'config';\n} | null {\n if (value === null || typeof value !== 'object') {\n return null;\n }\n\n if ('visibility' in value || 'passthrough' in value) {\n throw new LayoutConfigurationError(\n 'Include properties visibility and passthrough were removed; use required and suppliedVia.',\n );\n }\n\n const required =\n 'required' in value && typeof value.required === 'boolean'\n ? value.required\n : undefined;\n const suppliedVia = 'suppliedVia' in value ? value.suppliedVia : undefined;\n\n if (\n required === undefined ||\n (suppliedVia !== 'component' && suppliedVia !== 'config')\n ) {\n return null;\n }\n\n return {\n visibility: required ? 'required' : 'optional',\n passthrough: suppliedVia,\n };\n}\n"],"mappings":";;;AAwPA,SAAgB,wBAAwB,OAG/B;CACP,IAAI,UAAU,QAAQ,OAAO,UAAU,UACrC,OAAO;CAGT,IAAI,gBAAgB,SAAS,iBAAiB,OAC5C,MAAM,IAAI,yBACR,2FACF;CAGF,MAAM,WACJ,cAAc,SAAS,OAAO,MAAM,aAAa,YAC7C,MAAM,WACN;CACN,MAAM,cAAc,iBAAiB,QAAQ,MAAM,cAAc;CAEjE,IACE,aAAa,UACZ,gBAAgB,eAAe,gBAAgB,UAEhD,OAAO;CAGT,OAAO;EACL,YAAY,WAAW,aAAa;EACpC,aAAa;CACf;AACF"}
1
+ {"version":3,"file":"props.mjs","names":[],"sources":["../src/props.ts"],"sourcesContent":["import type { WithChildren } from '@jfdevelops/react-layout-composables';\nimport type { CustomPropsObject, ResolveRenderProps } from './custom-props';\nimport { LayoutConfigurationError } from './errors';\nimport type {\n ComposableComponents,\n MergePresetProps,\n} from '@jfdevelops/react-layout-composables';\nimport type { InPropsObject } from '@jfdevelops/react-layout-composables';\nimport {\n EnumWrappedProp,\n LiteralWrappedProp,\n ResolveLayoutProps,\n ResolveLayoutPropsAsDefined,\n ResolveProps,\n} from '@jfdevelops/react-layout-validator';\nimport { ResourceDefinition, ResourceEnum } from './resource';\nimport { Show } from './utils';\n\nexport type { InPropsObject };\n\n/**\n * Two-argument `render(props, context)` used by createComponent and scoped\n * resource components. `Context` is sibling components (scoped) or the\n * resource render context (top-level).\n */\nexport type PropsContextRender<RenderProps, Context, Result = unknown> = (\n props: WithChildren<RenderProps>,\n context: Context,\n) => Result;\n\n/**\n * Shared `{ props?, render }` shape used by createComponent, scoped\n * components, and anywhere else a value declares props and a two-arg render.\n *\n * @typeParam Props - Declared on the entry (`props`). Often an\n * {@link InPropsObject}, or a layout include/custom bag.\n * @typeParam RenderProps - First argument to `render` (defaults to\n * {@link ResolveProps}<Props> when Props is an {@link InPropsObject})\n * @typeParam Result - `render` return type\n * @typeParam Context - Second argument to `render`\n */\nexport interface PropsRenderDefinition<\n Props = InPropsObject,\n RenderProps = Props extends InPropsObject ? ResolveProps<Props> : unknown,\n Result = unknown,\n Context = unknown,\n> {\n props?: Props;\n render: PropsContextRender<RenderProps, Context, Result>;\n}\n\nexport type InPropsOptions<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Name extends string,\n> = {\n name: LiteralWrappedProp<Name, 'string', 'required'>;\n resource: EnumWrappedProp<ResourceEnum<Resources>, 'string', 'required'>;\n};\nexport type InPropsFunction<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = <Name extends string>(\n props: Show<InPropsOptions<Resources, Name>>,\n) => InPropsObject;\nexport type InPropsDefinition<\n Resources extends ReadonlyArray<ResourceDefinition>,\n> = InPropsObject | InPropsFunction<Resources>;\nexport type InferredInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n> = Options extends InPropsFunction<Resources> ? ReturnType<Options> : Options;\nexport type MergedLayoutInProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents,\n> =\n InferredInProps<Resources, Options> extends InPropsObject\n ? InferredInProps<Resources, Options> & MergePresetProps<Composables>\n : never;\nexport type RequiredVariant = true | 'required';\n/**\n * @typeParam RequiredVariant How the required props are selected. In application code,\n * it will always be `true`, but internally we need to support `'required'` as well.\n */\ntype PropsType<Variant extends RequiredVariant = true> = Variant | 'optional';\ntype InternalPropsType = PropsType<'required'>;\ntype IncludedPropSource = 'component' | 'config';\n/** Controls whether an included prop is required and where it is supplied. */\nexport type IncludedPropBehavior = {\n required: boolean;\n suppliedVia: IncludedPropSource;\n};\n\ntype IncludedPropType = PropsType | IncludedPropBehavior;\n/**\n * A map of props to include in the layout.\n */\nexport type IncludedProps<T extends object> = {\n [K in keyof T & string]?: IncludedPropType;\n};\n\ntype PropsKeys<Props extends InPropsObject, T> = T & keyof Props;\nexport type IncludedPropVisibility<Value> = Value extends { required: boolean }\n ? Value['required'] extends true\n ? 'required'\n : 'optional'\n : Value extends true | 'required'\n ? 'required'\n : Value extends 'optional'\n ? 'optional'\n : never;\nexport type IncludedPropSupplySource<Value> = Value extends {\n suppliedVia: IncludedPropSource;\n}\n ? Value['suppliedVia']\n : never;\n/**\n * Internal representation of the supported include behavior.\n */\nexport type NormalizedIncludedPropBehavior<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? {\n visibility: IncludedPropVisibility<Value>;\n passthrough: IncludedPropSupplySource<Value>;\n }\n : Value;\n\nexport type IncludedPropPassthrough<Value> = Value extends\n | { required: boolean }\n | { suppliedVia: IncludedPropSource }\n ? IncludedPropSupplySource<Value> extends 'component'\n ? IncludedPropVisibility<Value> extends 'optional'\n ? 'component' | 'config'\n : 'component'\n : IncludedPropSupplySource<Value>\n : Value extends true | 'required'\n ? 'config'\n : Value extends 'optional'\n ? 'component' | 'config'\n : never;\n\ntype GetPropsKey<\n IncludeProps extends object,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = {\n [Key in keyof IncludeProps]: IncludedPropVisibility<\n IncludeProps[Key]\n > extends Visibility\n ? Passthrough extends 'render'\n ? Key\n : Passthrough extends IncludedPropPassthrough<IncludeProps[Key]>\n ? Key\n : never\n : never;\n}[keyof IncludeProps];\ntype SelectedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n Visibility extends InternalPropsType,\n Passthrough extends IncludedPropSource | 'render' = 'render',\n> = Pick<\n Props,\n PropsKeys<Props, GetPropsKey<IncludeProps, Visibility, Passthrough>>\n>;\n\ntype OptionalPropDefinition<Definition> = Definition extends {\n optional(): infer OptionalDefinition;\n}\n ? OptionalDefinition\n : Definition;\n\n/** Raw validator definitions accepted by a generated component call. */\nexport type IncludedComponentPropDefinitions<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = SelectedIncludedProps<Props, IncludeProps, 'required', 'component'> & {\n [Key in keyof SelectedIncludedProps<\n Props,\n IncludeProps,\n 'optional',\n 'component'\n >]: OptionalPropDefinition<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>[Key]\n >;\n};\n\nexport type ResolvedIncludedProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'required'>> &\n Partial<\n ResolveLayoutProps<SelectedIncludedProps<Props, IncludeProps, 'optional'>>\n >;\n\nexport type ResolvedIncludedConfigProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'config'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'config'>\n >\n >;\n\nexport type ResolvedIncludedComponentProps<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'required', 'component'>\n> &\n Partial<\n ResolveLayoutProps<\n SelectedIncludedProps<Props, IncludeProps, 'optional', 'component'>\n >\n >;\n\n/**\n * Like {@link ResolvedIncludedProps}, but keeps included prop keys exactly as\n * declared (no `JSX.Element` capitalization).\n */\nexport type ResolvedIncludedPropsAsDefined<\n Props extends InPropsObject,\n IncludeProps extends IncludedProps<Props>,\n> = ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'required'>\n> &\n Partial<\n ResolveLayoutPropsAsDefined<\n SelectedIncludedProps<Props, IncludeProps, 'optional'>\n >\n >;\nexport type LayoutRenderProps<\n Resources extends ReadonlyArray<ResourceDefinition>,\n Options extends InPropsDefinition<Resources>,\n Composables extends ComposableComponents = {},\n IncludeProps extends IncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>\n > = {},\n CustomProps extends CustomPropsObject = {},\n> = Show<\n ResolveRenderProps<CustomProps> &\n ResolvedIncludedProps<\n MergedLayoutInProps<Resources, Options, Composables>,\n IncludeProps\n >\n>;\n\nexport function getIncludedPropBehavior(value: unknown): {\n visibility: 'required' | 'optional';\n passthrough: 'component' | 'config';\n} | null {\n if (value === null || typeof value !== 'object') {\n return null;\n }\n\n if ('visibility' in value || 'passthrough' in value) {\n throw new LayoutConfigurationError(\n 'Include properties visibility and passthrough were removed; use required and suppliedVia.',\n );\n }\n\n const required =\n 'required' in value && typeof value.required === 'boolean'\n ? value.required\n : undefined;\n const suppliedVia = 'suppliedVia' in value ? value.suppliedVia : undefined;\n\n if (\n required === undefined ||\n (suppliedVia !== 'component' && suppliedVia !== 'config')\n ) {\n return null;\n }\n\n return {\n visibility: required ? 'required' : 'optional',\n passthrough: suppliedVia,\n };\n}\n"],"mappings":";;;AA0PA,SAAgB,wBAAwB,OAG/B;CACP,IAAI,UAAU,QAAQ,OAAO,UAAU,UACrC,OAAO;CAGT,IAAI,gBAAgB,SAAS,iBAAiB,OAC5C,MAAM,IAAI,yBACR,2FACF;CAGF,MAAM,WACJ,cAAc,SAAS,OAAO,MAAM,aAAa,YAC7C,MAAM,WACN;CACN,MAAM,cAAc,iBAAiB,QAAQ,MAAM,cAAc;CAEjE,IACE,aAAa,UACZ,gBAAgB,eAAe,gBAAgB,UAEhD,OAAO;CAGT,OAAO;EACL,YAAY,WAAW,aAAa;EACpC,aAAa;CACf;AACF"}
@@ -1,6 +1,6 @@
1
1
  import { MergeIntersection, UnionToIntersection } from "./utils.cjs";
2
- import { ReactNode } from "react";
3
2
  import { NonEmptyReadonlyArray } from "@jfdevelops/react-layout-validator";
3
+ import { ReactNode } from "react";
4
4
 
5
5
  //#region src/resource.d.ts
6
6
  type ResourceDefinition = string | {
@@ -1,6 +1,6 @@
1
1
  import { MergeIntersection, UnionToIntersection } from "./utils.mjs";
2
- import { ReactNode } from "react";
3
2
  import { NonEmptyReadonlyArray } from "@jfdevelops/react-layout-validator";
3
+ import { ReactNode } from "react";
4
4
 
5
5
  //#region src/resource.d.ts
6
6
  type ResourceDefinition = string | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jfdevelops/react-layout",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "description": "A React library for creating layout components.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,9 +29,9 @@
29
29
  "dependencies": {
30
30
  "@jfdevelops/create-error": "0.2.0",
31
31
  "arktype": "2.2.8",
32
- "@jfdevelops/react-layout-composables": "0.3.1",
33
- "@jfdevelops/react-layout-devtools-core": "0.3.0",
34
- "@jfdevelops/react-layout-validator": "0.3.1"
32
+ "@jfdevelops/react-layout-composables": "0.5.0",
33
+ "@jfdevelops/react-layout-validator": "0.4.0",
34
+ "@jfdevelops/react-layout-devtools-core": "0.4.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "react": ">=18",
@@ -59,7 +59,7 @@
59
59
  "unrun": "0.3.0",
60
60
  "vite": "8.0.10",
61
61
  "vitest": "4.1.5",
62
- "@jfdevelops/react-layout-composable-breadcrumb": "0.2.10"
62
+ "@jfdevelops/react-layout-composable-breadcrumb": "0.2.12"
63
63
  },
64
64
  "scripts": {
65
65
  "dev": "portless react-layout vite",