@jfdevelops/react-layout 1.6.1 → 2.1.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.
- package/dist/create-config/create-defined-resource-layout.cjs +26 -14
- package/dist/create-config/create-defined-resource-layout.cjs.map +1 -1
- package/dist/create-config/create-defined-resource-layout.d.cts +12 -6
- package/dist/create-config/create-defined-resource-layout.d.cts.map +1 -1
- package/dist/create-config/create-defined-resource-layout.d.mts +12 -6
- package/dist/create-config/create-defined-resource-layout.d.mts.map +1 -1
- package/dist/create-config/create-defined-resource-layout.mjs +27 -15
- package/dist/create-config/create-defined-resource-layout.mjs.map +1 -1
- package/dist/create-config/define-layout.cjs +129 -58
- package/dist/create-config/define-layout.cjs.map +1 -1
- package/dist/create-config/define-layout.d.cts +9 -13
- package/dist/create-config/define-layout.d.cts.map +1 -1
- package/dist/create-config/define-layout.d.mts +9 -13
- package/dist/create-config/define-layout.d.mts.map +1 -1
- package/dist/create-config/define-layout.mjs +130 -59
- package/dist/create-config/define-layout.mjs.map +1 -1
- package/dist/create-config/for-resources/create-component.d.cts +62 -38
- package/dist/create-config/for-resources/create-component.d.cts.map +1 -1
- package/dist/create-config/for-resources/create-component.d.mts +62 -38
- package/dist/create-config/for-resources/create-component.d.mts.map +1 -1
- package/dist/create-config/for-resources/create-for-resources.cjs +88 -12
- package/dist/create-config/for-resources/create-for-resources.cjs.map +1 -1
- package/dist/create-config/for-resources/create-for-resources.mjs +88 -12
- package/dist/create-config/for-resources/create-for-resources.mjs.map +1 -1
- package/dist/create-config/for-resources/scoped-layout.d.cts +2 -2
- package/dist/create-config/for-resources/scoped-layout.d.cts.map +1 -1
- package/dist/create-config/for-resources/scoped-layout.d.mts +2 -2
- package/dist/create-config/for-resources/scoped-layout.d.mts.map +1 -1
- package/dist/create-config/for-resources/scoped-render.cjs +39 -4
- package/dist/create-config/for-resources/scoped-render.cjs.map +1 -1
- package/dist/create-config/for-resources/scoped-render.d.cts +8 -1
- package/dist/create-config/for-resources/scoped-render.d.cts.map +1 -1
- package/dist/create-config/for-resources/scoped-render.d.mts +8 -1
- package/dist/create-config/for-resources/scoped-render.d.mts.map +1 -1
- package/dist/create-config/for-resources/scoped-render.mjs +39 -4
- package/dist/create-config/for-resources/scoped-render.mjs.map +1 -1
- package/dist/create-config/index.d.cts +3 -2
- package/dist/create-config/index.d.mts +3 -2
- package/dist/create-config/layout-name.cjs +1 -1
- package/dist/create-config/layout-name.mjs +1 -1
- package/dist/create-config/lazy-resource-layout.cjs +70 -86
- package/dist/create-config/lazy-resource-layout.cjs.map +1 -1
- package/dist/create-config/lazy-resource-layout.d.cts +9 -31
- package/dist/create-config/lazy-resource-layout.d.cts.map +1 -1
- package/dist/create-config/lazy-resource-layout.d.mts +9 -31
- package/dist/create-config/lazy-resource-layout.d.mts.map +1 -1
- package/dist/create-config/lazy-resource-layout.mjs +70 -86
- package/dist/create-config/lazy-resource-layout.mjs.map +1 -1
- package/dist/create-config/preview.cjs +1 -1
- package/dist/create-config/preview.d.cts +2 -0
- package/dist/create-config/preview.d.cts.map +1 -1
- package/dist/create-config/preview.d.mts +2 -0
- package/dist/create-config/preview.d.mts.map +1 -1
- package/dist/create-config/preview.mjs +1 -1
- package/dist/create-config/render-state-context.cjs +24 -0
- package/dist/create-config/render-state-context.cjs.map +1 -0
- package/dist/create-config/render-state-context.mjs +22 -0
- package/dist/create-config/render-state-context.mjs.map +1 -0
- package/dist/create-config/render-state.cjs +58 -18
- package/dist/create-config/render-state.cjs.map +1 -1
- package/dist/create-config/render-state.d.cts +44 -21
- package/dist/create-config/render-state.d.cts.map +1 -1
- package/dist/create-config/render-state.d.mts +44 -21
- package/dist/create-config/render-state.d.mts.map +1 -1
- package/dist/create-config/render-state.mjs +55 -18
- package/dist/create-config/render-state.mjs.map +1 -1
- package/dist/create-config/state-composable.cjs +4 -2
- package/dist/create-config/state-composable.cjs.map +1 -1
- package/dist/create-config/state-composable.d.cts.map +1 -1
- package/dist/create-config/state-composable.d.mts.map +1 -1
- package/dist/create-config/state-composable.mjs +4 -2
- package/dist/create-config/state-composable.mjs.map +1 -1
- package/dist/errors/lazy-resource-error.cjs +37 -0
- package/dist/errors/lazy-resource-error.cjs.map +1 -0
- package/dist/errors/lazy-resource-error.d.cts +26 -0
- package/dist/errors/lazy-resource-error.d.cts.map +1 -0
- package/dist/errors/lazy-resource-error.d.mts +26 -0
- package/dist/errors/lazy-resource-error.d.mts.map +1 -0
- package/dist/errors/lazy-resource-error.mjs +35 -0
- package/dist/errors/lazy-resource-error.mjs.map +1 -0
- package/dist/errors/react-layout-error.cjs +1 -1
- package/dist/errors/react-layout-error.mjs +1 -1
- package/dist/errors/resource-state-error.cjs +4 -1
- package/dist/errors/resource-state-error.cjs.map +1 -1
- package/dist/errors/resource-state-error.d.cts +1 -0
- package/dist/errors/resource-state-error.d.cts.map +1 -1
- package/dist/errors/resource-state-error.d.mts +1 -0
- package/dist/errors/resource-state-error.d.mts.map +1 -1
- package/dist/errors/resource-state-error.mjs +4 -1
- package/dist/errors/resource-state-error.mjs.map +1 -1
- package/dist/index.cjs +6 -2
- package/dist/index.d.cts +9 -5
- package/dist/index.d.mts +9 -5
- package/dist/index.mjs +4 -3
- package/dist/lazy/create-lazy-loader.cjs +78 -0
- package/dist/lazy/create-lazy-loader.cjs.map +1 -0
- package/dist/lazy/create-lazy-loader.d.cts +19 -0
- package/dist/lazy/create-lazy-loader.d.cts.map +1 -0
- package/dist/lazy/create-lazy-loader.d.mts +19 -0
- package/dist/lazy/create-lazy-loader.d.mts.map +1 -0
- package/dist/lazy/create-lazy-loader.mjs +78 -0
- package/dist/lazy/create-lazy-loader.mjs.map +1 -0
- package/dist/lazy/create-render-state.cjs +59 -0
- package/dist/lazy/create-render-state.cjs.map +1 -0
- package/dist/lazy/create-render-state.d.cts +33 -0
- package/dist/lazy/create-render-state.d.cts.map +1 -0
- package/dist/lazy/create-render-state.d.mts +33 -0
- package/dist/lazy/create-render-state.d.mts.map +1 -0
- package/dist/lazy/create-render-state.mjs +59 -0
- package/dist/lazy/create-render-state.mjs.map +1 -0
- package/dist/lazy/fallback-props.cjs +9 -0
- package/dist/lazy/fallback-props.cjs.map +1 -0
- package/dist/lazy/fallback-props.mjs +9 -0
- package/dist/lazy/fallback-props.mjs.map +1 -0
- package/dist/lazy/inspection.cjs +51 -0
- package/dist/lazy/inspection.cjs.map +1 -0
- package/dist/lazy/inspection.d.cts +28 -0
- package/dist/lazy/inspection.d.cts.map +1 -0
- package/dist/lazy/inspection.d.mts +28 -0
- package/dist/lazy/inspection.d.mts.map +1 -0
- package/dist/lazy/inspection.mjs +50 -0
- package/dist/lazy/inspection.mjs.map +1 -0
- package/dist/lazy/lazy-boundary.cjs +63 -0
- package/dist/lazy/lazy-boundary.cjs.map +1 -0
- package/dist/lazy/lazy-boundary.mjs +63 -0
- package/dist/lazy/lazy-boundary.mjs.map +1 -0
- package/dist/lazy/scoped-content.cjs +87 -0
- package/dist/lazy/scoped-content.cjs.map +1 -0
- package/dist/lazy/scoped-content.d.cts +19 -0
- package/dist/lazy/scoped-content.d.cts.map +1 -0
- package/dist/lazy/scoped-content.d.mts +19 -0
- package/dist/lazy/scoped-content.d.mts.map +1 -0
- package/dist/lazy/scoped-content.mjs +86 -0
- package/dist/lazy/scoped-content.mjs.map +1 -0
- package/dist/lazy/types.cjs +10 -0
- package/dist/lazy/types.cjs.map +1 -0
- package/dist/lazy/types.d.cts +40 -0
- package/dist/lazy/types.d.cts.map +1 -0
- package/dist/lazy/types.d.mts +40 -0
- package/dist/lazy/types.d.mts.map +1 -0
- package/dist/lazy/types.mjs +8 -0
- package/dist/lazy/types.mjs.map +1 -0
- package/dist/props.cjs +4 -2
- package/dist/props.cjs.map +1 -1
- package/dist/props.d.cts +6 -50
- package/dist/props.d.cts.map +1 -1
- package/dist/props.d.mts +6 -50
- package/dist/props.d.mts.map +1 -1
- package/dist/props.mjs +5 -2
- package/dist/props.mjs.map +1 -1
- package/dist/resource.cjs.map +1 -1
- package/dist/resource.d.cts +1 -1
- package/dist/resource.d.cts.map +1 -1
- package/dist/resource.d.mts +1 -1
- package/dist/resource.d.mts.map +1 -1
- package/dist/resource.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-composable.cjs","names":["LayoutConfigurationError","capitalize"],"sources":["../../src/create-config/state-composable.ts"],"sourcesContent":["import {\n createContext,\n createElement,\n useContext,\n type ComponentType,\n type JSX,\n} from 'react';\nimport { LayoutConfigurationError } from '../errors';\nimport type { IncludedProps } from '../props';\nimport { capitalize } from '../utils/capitalize';\n\n/** Props selected here are inherited from the containing state's render props. */\nexport type StateComposableOptions<\n Props extends object,\n Include extends IncludedProps<Props> = {},\n> = {\n props?: {\n include?: Include & { [Key in Exclude<keyof Include, keyof Props>]: never };\n };\n};\n\ntype StateComposableCallProps<Props extends object, Carried extends keyof Props> =\n Omit<Props, Carried> & Partial<Pick<Props, Carried>>;\n\n/** Non-enumerable state helpers; class methods stay out of object-spread types. */\nexport declare class StateComposableHandle<Props extends object> {\n asComposable<const Include extends IncludedProps<Props> = {}>(\n options?: StateComposableOptions<Props, Include>,\n ): StateComposable<Props, keyof Include & keyof Props>;\n}\n\n/** A state component usable in a composables map, optionally inheriting props. */\nexport type StateComposable<\n Props extends object,\n Carried extends keyof Props = never,\n> = {\n (props: StateComposableCallProps<Props, Carried>): JSX.Element;\n displayName: string;\n props: StateComposableCallProps<Props, Carried>;\n asComposable: AsStateComposable<Props>;\n};\n\n/** Converts a state into a composable; unselected required props remain required. */\nexport type AsStateComposable<Props extends object> = <\n const Include extends IncludedProps<Props> = {},\n>(\n options?: StateComposableOptions<Props, Include>,\n) => StateComposable<Props, keyof Include & keyof Props>;\n\n/** @internal The definition is kept by identity so builder references need no registration. */\nexport type StateComposableSource = {\n input: unknown;\n name: string;\n /** Fallback state that must not recursively render this reference. */\n fallbackStateName?: string;\n};\n\nexport const stateReferenceSource = Symbol.for('@jfdevelops/react-layout/state-reference');\n\n/** @internal Shared by all states in one created resource layout. */\nexport type RenderStateScope = {\n states: Record<string, StateComposable<Record<string, unknown>>>;\n resolve: (source: StateComposableSource) => ComponentType<Record<string, unknown>>;\n};\n\n/** @internal Each rendered state supplies its own resolved values for carry-over. */\nexport const StateComposableContext = createContext<{\n scope: RenderStateScope;\n props: Record<string, unknown>;\n definitions: Record<string, unknown>;\n} | undefined>(undefined);\n\n/** @internal Defers state resolution until render, allowing forward references. */\nexport function createStateComposable(\n source: StateComposableSource,\n options: StateComposableOptions<Record<string, unknown>, IncludedProps<Record<string, unknown>>> & {\n normalizeIncludedKeys?: boolean;\n } = {},\n): StateComposable<Record<string, unknown>> {\n function StateReference(callProps: Record<string, unknown>) {\n const context = useContext(StateComposableContext);\n if (!context) {\n throw new LayoutConfigurationError(\n `Render state \"${source.name}\" must be used inside a resource layout`,\n );\n }\n const inherited = Object.fromEntries(\n Object.keys(options.props?.include ?? {}).map((key) => {\n const definition = context.definitions[key];\n return options.normalizeIncludedKeys && typeof definition === 'function' &&\n 'type' in definition && definition.type === 'JSX.Element' ? capitalize(key) : key;\n }).flatMap((key) =>\n Object.prototype.hasOwnProperty.call(context.props, key) && context.props[key] !== undefined\n ? [[key, context.props[key]]]\n : [],\n ),\n );\n return createElement(context.scope.resolve(source), {
|
|
1
|
+
{"version":3,"file":"state-composable.cjs","names":["RenderStateNameContext","LayoutConfigurationError","capitalize","ReferencedRenderStateContext"],"sources":["../../src/create-config/state-composable.ts"],"sourcesContent":["import { RenderStateNameContext, ReferencedRenderStateContext } from './render-state-context';\nimport {\n createContext,\n createElement,\n useContext,\n type ComponentType,\n type JSX,\n} from 'react';\nimport { LayoutConfigurationError } from '../errors';\nimport type { IncludedProps } from '../props';\nimport { capitalize } from '../utils/capitalize';\n\n/** Props selected here are inherited from the containing state's render props. */\nexport type StateComposableOptions<\n Props extends object,\n Include extends IncludedProps<Props> = {},\n> = {\n props?: {\n include?: Include & { [Key in Exclude<keyof Include, keyof Props>]: never };\n };\n};\n\ntype StateComposableCallProps<Props extends object, Carried extends keyof Props> =\n Omit<Props, Carried> & Partial<Pick<Props, Carried>>;\n\n/** Non-enumerable state helpers; class methods stay out of object-spread types. */\nexport declare class StateComposableHandle<Props extends object> {\n asComposable<const Include extends IncludedProps<Props> = {}>(\n options?: StateComposableOptions<Props, Include>,\n ): StateComposable<Props, keyof Include & keyof Props>;\n}\n\n/** A state component usable in a composables map, optionally inheriting props. */\nexport type StateComposable<\n Props extends object,\n Carried extends keyof Props = never,\n> = {\n (props: StateComposableCallProps<Props, Carried>): JSX.Element;\n displayName: string;\n props: StateComposableCallProps<Props, Carried>;\n asComposable: AsStateComposable<Props>;\n};\n\n/** Converts a state into a composable; unselected required props remain required. */\nexport type AsStateComposable<Props extends object> = <\n const Include extends IncludedProps<Props> = {},\n>(\n options?: StateComposableOptions<Props, Include>,\n) => StateComposable<Props, keyof Include & keyof Props>;\n\n/** @internal The definition is kept by identity so builder references need no registration. */\nexport type StateComposableSource = {\n input: unknown;\n name: string;\n /** Fallback state that must not recursively render this reference. */\n fallbackStateName?: string;\n};\n\nexport const stateReferenceSource = Symbol.for('@jfdevelops/react-layout/state-reference');\n\n/** @internal Shared by all states in one created resource layout. */\nexport type RenderStateScope = {\n states: Record<string, StateComposable<Record<string, unknown>>>;\n resolve: (source: StateComposableSource) => ComponentType<Record<string, unknown>>;\n};\n\n/** @internal Each rendered state supplies its own resolved values for carry-over. */\nexport const StateComposableContext = createContext<{\n scope: RenderStateScope;\n props: Record<string, unknown>;\n definitions: Record<string, unknown>;\n} | undefined>(undefined);\n\n/** @internal Defers state resolution until render, allowing forward references. */\nexport function createStateComposable(\n source: StateComposableSource,\n options: StateComposableOptions<Record<string, unknown>, IncludedProps<Record<string, unknown>>> & {\n normalizeIncludedKeys?: boolean;\n } = {},\n): StateComposable<Record<string, unknown>> {\n function StateReference(callProps: Record<string, unknown>) {\n const context = useContext(StateComposableContext);\n const state = useContext(RenderStateNameContext);\n if (!context) {\n throw new LayoutConfigurationError(\n `Render state \"${source.name}\" must be used inside a resource layout`,\n );\n }\n const inherited = Object.fromEntries(\n Object.keys(options.props?.include ?? {}).map((key) => {\n const definition = context.definitions[key];\n return options.normalizeIncludedKeys && typeof definition === 'function' &&\n 'type' in definition && definition.type === 'JSX.Element' ? capitalize(key) : key;\n }).flatMap((key) =>\n Object.prototype.hasOwnProperty.call(context.props, key) && context.props[key] !== undefined\n ? [[key, context.props[key]]]\n : [],\n ),\n );\n return createElement(ReferencedRenderStateContext.Provider, { value: state },\n createElement(context.scope.resolve(source), { ...inherited, ...callProps }),\n );\n }\n Object.defineProperty(StateReference, stateReferenceSource, { value: source });\n return withStateComposable(Object.assign(StateReference, {\n displayName: `State.${source.name}`,\n props: undefined as unknown as Record<string, unknown>,\n }), source) as StateComposable<Record<string, unknown>>;\n}\n\n/** @internal Keeps helper methods out of spreadable state maps. */\nexport function withStateComposable<Value extends object>(\n value: Value,\n source: StateComposableSource,\n): Value & { asComposable: AsStateComposable<Record<string, unknown>> } {\n if (Object.prototype.hasOwnProperty.call(value, 'asComposable')) {\n throw new LayoutConfigurationError(\n 'Render state name \"asComposable\" is reserved',\n );\n }\n Object.defineProperty(value, 'asComposable', {\n enumerable: false,\n value: (options?: StateComposableOptions<Record<string, unknown>, IncludedProps<Record<string, unknown>>>) =>\n createStateComposable(source, options),\n });\n return value as Value & { asComposable: AsStateComposable<Record<string, unknown>> };\n}\n\n/** @internal References are descriptors, so reading them never constructs a layout. */\nexport function createStateReferences(states: Record<string, unknown>) {\n return Object.fromEntries(Object.entries(states).map(([name, input]) => [\n name, createStateComposable({ input, name }),\n ]));\n}\n"],"mappings":";;;;;;AA0DA,MAAa,uBAAuB,OAAO,IAAI,0CAA0C;;AASzF,MAAa,kDAIE,MAAS;;AAGxB,SAAgB,sBACd,QACA,UAEI,CAAC,GACqC;CAC1C,SAAS,eAAe,WAAoC;EAC1D,MAAM,gCAAqB,sBAAsB;EACjD,MAAM,8BAAmBA,mDAAsB;EAC/C,IAAI,CAAC,SACH,MAAM,IAAIC,4DACR,iBAAiB,OAAO,KAAK,wCAC/B;EAEF,MAAM,YAAY,OAAO,YACvB,OAAO,KAAK,QAAQ,OAAO,WAAW,CAAC,CAAC,EAAE,KAAK,QAAQ;GACrD,MAAM,aAAa,QAAQ,YAAY;GACvC,OAAO,QAAQ,yBAAyB,OAAO,eAAe,cAC5D,UAAU,cAAc,WAAW,SAAS,gBAAgBC,8BAAW,GAAG,IAAI;EAClF,CAAC,EAAE,SAAS,QACV,OAAO,UAAU,eAAe,KAAK,QAAQ,OAAO,GAAG,KAAK,QAAQ,MAAM,SAAS,SAC/E,CAAC,CAAC,KAAK,QAAQ,MAAM,IAAI,CAAC,IAC1B,CAAC,CACP,CACF;EACA,gCAAqBC,0DAA6B,UAAU,EAAE,OAAO,MAAM,4BAC3D,QAAQ,MAAM,QAAQ,MAAM,GAAG;GAAE,GAAG;GAAW,GAAG;EAAU,CAAC,CAC7E;CACF;CACA,OAAO,eAAe,gBAAgB,sBAAsB,EAAE,OAAO,OAAO,CAAC;CAC7E,OAAO,oBAAoB,OAAO,OAAO,gBAAgB;EACvD,aAAa,SAAS,OAAO;EAC7B,OAAO;CACT,CAAC,GAAG,MAAM;AACZ;;AAGA,SAAgB,oBACd,OACA,QACsE;CACtE,IAAI,OAAO,UAAU,eAAe,KAAK,OAAO,cAAc,GAC5D,MAAM,IAAIF,4DACR,gDACF;CAEF,OAAO,eAAe,OAAO,gBAAgB;EAC3C,YAAY;EACZ,QAAQ,YACN,sBAAsB,QAAQ,OAAO;CACzC,CAAC;CACD,OAAO;AACT;;AAGA,SAAgB,sBAAsB,QAAiC;CACrE,OAAO,OAAO,YAAY,OAAO,QAAQ,MAAM,EAAE,KAAK,CAAC,MAAM,WAAW,CACtE,MAAM,sBAAsB;EAAE;EAAO;CAAK,CAAC,CAC7C,CAAC,CAAC;AACJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-composable.d.cts","names":[],"sources":["../../src/create-config/state-composable.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"state-composable.d.cts","names":[],"sources":["../../src/create-config/state-composable.ts"],"mappings":";;;;;KAaY,sBAAA,uCAEM,aAAA,CAAc,KAAA;EAE9B,KAAA;IACE,OAAA,GAAU,OAAA,aAAoB,OAAA,OAAc,OAAA,QAAe,KAAA;EAAA;AAAA;AAAA,KAI1D,wBAAA,6CAAqE,KAAA,IACxE,IAAA,CAAK,KAAA,EAAO,OAAA,IAAW,OAAA,CAAQ,IAAA,CAAK,KAAA,EAAO,OAAA;;cAGxB,qBAAA;EACnB,YAAA,uBAAmC,aAAA,CAAc,KAAA,QAC/C,OAAA,GAAU,sBAAA,CAAuB,KAAA,EAAO,OAAA,IACvC,eAAA,CAAgB,KAAA,QAAa,OAAA,SAAgB,KAAA;AAAA;;KAItC,eAAA,6CAEY,KAAA;EAAA,CAErB,KAAA,EAAO,wBAAA,CAAyB,KAAA,EAAO,OAAA,IAAW,GAAA,CAAI,OAAA;EACvD,WAAA;EACA,KAAA,EAAO,wBAAA,CAAyB,KAAA,EAAO,OAAA;EACvC,YAAA,EAAc,iBAAA,CAAkB,KAAA;AAAA;;KAItB,iBAAA,gDACY,aAAA,CAAc,KAAA,QAEpC,OAAA,GAAU,sBAAA,CAAuB,KAAA,EAAO,OAAA,MACrC,eAAA,CAAgB,KAAA,QAAa,OAAA,SAAgB,KAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-composable.d.mts","names":[],"sources":["../../src/create-config/state-composable.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"state-composable.d.mts","names":[],"sources":["../../src/create-config/state-composable.ts"],"mappings":";;;;;KAaY,sBAAA,uCAEM,aAAA,CAAc,KAAA;EAE9B,KAAA;IACE,OAAA,GAAU,OAAA,aAAoB,OAAA,OAAc,OAAA,QAAe,KAAA;EAAA;AAAA;AAAA,KAI1D,wBAAA,6CAAqE,KAAA,IACxE,IAAA,CAAK,KAAA,EAAO,OAAA,IAAW,OAAA,CAAQ,IAAA,CAAK,KAAA,EAAO,OAAA;;cAGxB,qBAAA;EACnB,YAAA,uBAAmC,aAAA,CAAc,KAAA,QAC/C,OAAA,GAAU,sBAAA,CAAuB,KAAA,EAAO,OAAA,IACvC,eAAA,CAAgB,KAAA,QAAa,OAAA,SAAgB,KAAA;AAAA;;KAItC,eAAA,6CAEY,KAAA;EAAA,CAErB,KAAA,EAAO,wBAAA,CAAyB,KAAA,EAAO,OAAA,IAAW,GAAA,CAAI,OAAA;EACvD,WAAA;EACA,KAAA,EAAO,wBAAA,CAAyB,KAAA,EAAO,OAAA;EACvC,YAAA,EAAc,iBAAA,CAAkB,KAAA;AAAA;;KAItB,iBAAA,gDACY,aAAA,CAAc,KAAA,QAEpC,OAAA,GAAU,sBAAA,CAAuB,KAAA,EAAO,OAAA,MACrC,eAAA,CAAgB,KAAA,QAAa,OAAA,SAAgB,KAAA"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReferencedRenderStateContext, RenderStateNameContext } from "./render-state-context.mjs";
|
|
1
2
|
import { LayoutConfigurationError } from "../errors/layout-configuration-error.mjs";
|
|
2
3
|
import { capitalize } from "../utils/capitalize.mjs";
|
|
3
4
|
import { createContext, createElement, useContext } from "react";
|
|
@@ -10,15 +11,16 @@ const StateComposableContext = createContext(void 0);
|
|
|
10
11
|
function createStateComposable(source, options = {}) {
|
|
11
12
|
function StateReference(callProps) {
|
|
12
13
|
const context = useContext(StateComposableContext);
|
|
14
|
+
const state = useContext(RenderStateNameContext);
|
|
13
15
|
if (!context) throw new LayoutConfigurationError(`Render state "${source.name}" must be used inside a resource layout`);
|
|
14
16
|
const inherited = Object.fromEntries(Object.keys(options.props?.include ?? {}).map((key) => {
|
|
15
17
|
const definition = context.definitions[key];
|
|
16
18
|
return options.normalizeIncludedKeys && typeof definition === "function" && "type" in definition && definition.type === "JSX.Element" ? capitalize(key) : key;
|
|
17
19
|
}).flatMap((key) => Object.prototype.hasOwnProperty.call(context.props, key) && context.props[key] !== void 0 ? [[key, context.props[key]]] : []));
|
|
18
|
-
return createElement(context.scope.resolve(source), {
|
|
20
|
+
return createElement(ReferencedRenderStateContext.Provider, { value: state }, createElement(context.scope.resolve(source), {
|
|
19
21
|
...inherited,
|
|
20
22
|
...callProps
|
|
21
|
-
});
|
|
23
|
+
}));
|
|
22
24
|
}
|
|
23
25
|
Object.defineProperty(StateReference, stateReferenceSource, { value: source });
|
|
24
26
|
return withStateComposable(Object.assign(StateReference, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state-composable.mjs","names":[],"sources":["../../src/create-config/state-composable.ts"],"sourcesContent":["import {\n createContext,\n createElement,\n useContext,\n type ComponentType,\n type JSX,\n} from 'react';\nimport { LayoutConfigurationError } from '../errors';\nimport type { IncludedProps } from '../props';\nimport { capitalize } from '../utils/capitalize';\n\n/** Props selected here are inherited from the containing state's render props. */\nexport type StateComposableOptions<\n Props extends object,\n Include extends IncludedProps<Props> = {},\n> = {\n props?: {\n include?: Include & { [Key in Exclude<keyof Include, keyof Props>]: never };\n };\n};\n\ntype StateComposableCallProps<Props extends object, Carried extends keyof Props> =\n Omit<Props, Carried> & Partial<Pick<Props, Carried>>;\n\n/** Non-enumerable state helpers; class methods stay out of object-spread types. */\nexport declare class StateComposableHandle<Props extends object> {\n asComposable<const Include extends IncludedProps<Props> = {}>(\n options?: StateComposableOptions<Props, Include>,\n ): StateComposable<Props, keyof Include & keyof Props>;\n}\n\n/** A state component usable in a composables map, optionally inheriting props. */\nexport type StateComposable<\n Props extends object,\n Carried extends keyof Props = never,\n> = {\n (props: StateComposableCallProps<Props, Carried>): JSX.Element;\n displayName: string;\n props: StateComposableCallProps<Props, Carried>;\n asComposable: AsStateComposable<Props>;\n};\n\n/** Converts a state into a composable; unselected required props remain required. */\nexport type AsStateComposable<Props extends object> = <\n const Include extends IncludedProps<Props> = {},\n>(\n options?: StateComposableOptions<Props, Include>,\n) => StateComposable<Props, keyof Include & keyof Props>;\n\n/** @internal The definition is kept by identity so builder references need no registration. */\nexport type StateComposableSource = {\n input: unknown;\n name: string;\n /** Fallback state that must not recursively render this reference. */\n fallbackStateName?: string;\n};\n\nexport const stateReferenceSource = Symbol.for('@jfdevelops/react-layout/state-reference');\n\n/** @internal Shared by all states in one created resource layout. */\nexport type RenderStateScope = {\n states: Record<string, StateComposable<Record<string, unknown>>>;\n resolve: (source: StateComposableSource) => ComponentType<Record<string, unknown>>;\n};\n\n/** @internal Each rendered state supplies its own resolved values for carry-over. */\nexport const StateComposableContext = createContext<{\n scope: RenderStateScope;\n props: Record<string, unknown>;\n definitions: Record<string, unknown>;\n} | undefined>(undefined);\n\n/** @internal Defers state resolution until render, allowing forward references. */\nexport function createStateComposable(\n source: StateComposableSource,\n options: StateComposableOptions<Record<string, unknown>, IncludedProps<Record<string, unknown>>> & {\n normalizeIncludedKeys?: boolean;\n } = {},\n): StateComposable<Record<string, unknown>> {\n function StateReference(callProps: Record<string, unknown>) {\n const context = useContext(StateComposableContext);\n if (!context) {\n throw new LayoutConfigurationError(\n `Render state \"${source.name}\" must be used inside a resource layout`,\n );\n }\n const inherited = Object.fromEntries(\n Object.keys(options.props?.include ?? {}).map((key) => {\n const definition = context.definitions[key];\n return options.normalizeIncludedKeys && typeof definition === 'function' &&\n 'type' in definition && definition.type === 'JSX.Element' ? capitalize(key) : key;\n }).flatMap((key) =>\n Object.prototype.hasOwnProperty.call(context.props, key) && context.props[key] !== undefined\n ? [[key, context.props[key]]]\n : [],\n ),\n );\n return createElement(context.scope.resolve(source), {
|
|
1
|
+
{"version":3,"file":"state-composable.mjs","names":[],"sources":["../../src/create-config/state-composable.ts"],"sourcesContent":["import { RenderStateNameContext, ReferencedRenderStateContext } from './render-state-context';\nimport {\n createContext,\n createElement,\n useContext,\n type ComponentType,\n type JSX,\n} from 'react';\nimport { LayoutConfigurationError } from '../errors';\nimport type { IncludedProps } from '../props';\nimport { capitalize } from '../utils/capitalize';\n\n/** Props selected here are inherited from the containing state's render props. */\nexport type StateComposableOptions<\n Props extends object,\n Include extends IncludedProps<Props> = {},\n> = {\n props?: {\n include?: Include & { [Key in Exclude<keyof Include, keyof Props>]: never };\n };\n};\n\ntype StateComposableCallProps<Props extends object, Carried extends keyof Props> =\n Omit<Props, Carried> & Partial<Pick<Props, Carried>>;\n\n/** Non-enumerable state helpers; class methods stay out of object-spread types. */\nexport declare class StateComposableHandle<Props extends object> {\n asComposable<const Include extends IncludedProps<Props> = {}>(\n options?: StateComposableOptions<Props, Include>,\n ): StateComposable<Props, keyof Include & keyof Props>;\n}\n\n/** A state component usable in a composables map, optionally inheriting props. */\nexport type StateComposable<\n Props extends object,\n Carried extends keyof Props = never,\n> = {\n (props: StateComposableCallProps<Props, Carried>): JSX.Element;\n displayName: string;\n props: StateComposableCallProps<Props, Carried>;\n asComposable: AsStateComposable<Props>;\n};\n\n/** Converts a state into a composable; unselected required props remain required. */\nexport type AsStateComposable<Props extends object> = <\n const Include extends IncludedProps<Props> = {},\n>(\n options?: StateComposableOptions<Props, Include>,\n) => StateComposable<Props, keyof Include & keyof Props>;\n\n/** @internal The definition is kept by identity so builder references need no registration. */\nexport type StateComposableSource = {\n input: unknown;\n name: string;\n /** Fallback state that must not recursively render this reference. */\n fallbackStateName?: string;\n};\n\nexport const stateReferenceSource = Symbol.for('@jfdevelops/react-layout/state-reference');\n\n/** @internal Shared by all states in one created resource layout. */\nexport type RenderStateScope = {\n states: Record<string, StateComposable<Record<string, unknown>>>;\n resolve: (source: StateComposableSource) => ComponentType<Record<string, unknown>>;\n};\n\n/** @internal Each rendered state supplies its own resolved values for carry-over. */\nexport const StateComposableContext = createContext<{\n scope: RenderStateScope;\n props: Record<string, unknown>;\n definitions: Record<string, unknown>;\n} | undefined>(undefined);\n\n/** @internal Defers state resolution until render, allowing forward references. */\nexport function createStateComposable(\n source: StateComposableSource,\n options: StateComposableOptions<Record<string, unknown>, IncludedProps<Record<string, unknown>>> & {\n normalizeIncludedKeys?: boolean;\n } = {},\n): StateComposable<Record<string, unknown>> {\n function StateReference(callProps: Record<string, unknown>) {\n const context = useContext(StateComposableContext);\n const state = useContext(RenderStateNameContext);\n if (!context) {\n throw new LayoutConfigurationError(\n `Render state \"${source.name}\" must be used inside a resource layout`,\n );\n }\n const inherited = Object.fromEntries(\n Object.keys(options.props?.include ?? {}).map((key) => {\n const definition = context.definitions[key];\n return options.normalizeIncludedKeys && typeof definition === 'function' &&\n 'type' in definition && definition.type === 'JSX.Element' ? capitalize(key) : key;\n }).flatMap((key) =>\n Object.prototype.hasOwnProperty.call(context.props, key) && context.props[key] !== undefined\n ? [[key, context.props[key]]]\n : [],\n ),\n );\n return createElement(ReferencedRenderStateContext.Provider, { value: state },\n createElement(context.scope.resolve(source), { ...inherited, ...callProps }),\n );\n }\n Object.defineProperty(StateReference, stateReferenceSource, { value: source });\n return withStateComposable(Object.assign(StateReference, {\n displayName: `State.${source.name}`,\n props: undefined as unknown as Record<string, unknown>,\n }), source) as StateComposable<Record<string, unknown>>;\n}\n\n/** @internal Keeps helper methods out of spreadable state maps. */\nexport function withStateComposable<Value extends object>(\n value: Value,\n source: StateComposableSource,\n): Value & { asComposable: AsStateComposable<Record<string, unknown>> } {\n if (Object.prototype.hasOwnProperty.call(value, 'asComposable')) {\n throw new LayoutConfigurationError(\n 'Render state name \"asComposable\" is reserved',\n );\n }\n Object.defineProperty(value, 'asComposable', {\n enumerable: false,\n value: (options?: StateComposableOptions<Record<string, unknown>, IncludedProps<Record<string, unknown>>>) =>\n createStateComposable(source, options),\n });\n return value as Value & { asComposable: AsStateComposable<Record<string, unknown>> };\n}\n\n/** @internal References are descriptors, so reading them never constructs a layout. */\nexport function createStateReferences(states: Record<string, unknown>) {\n return Object.fromEntries(Object.entries(states).map(([name, input]) => [\n name, createStateComposable({ input, name }),\n ]));\n}\n"],"mappings":";;;;;;AA0DA,MAAa,uBAAuB,OAAO,IAAI,0CAA0C;;AASzF,MAAa,yBAAyB,cAIvB,MAAS;;AAGxB,SAAgB,sBACd,QACA,UAEI,CAAC,GACqC;CAC1C,SAAS,eAAe,WAAoC;EAC1D,MAAM,UAAU,WAAW,sBAAsB;EACjD,MAAM,QAAQ,WAAW,sBAAsB;EAC/C,IAAI,CAAC,SACH,MAAM,IAAI,yBACR,iBAAiB,OAAO,KAAK,wCAC/B;EAEF,MAAM,YAAY,OAAO,YACvB,OAAO,KAAK,QAAQ,OAAO,WAAW,CAAC,CAAC,EAAE,KAAK,QAAQ;GACrD,MAAM,aAAa,QAAQ,YAAY;GACvC,OAAO,QAAQ,yBAAyB,OAAO,eAAe,cAC5D,UAAU,cAAc,WAAW,SAAS,gBAAgB,WAAW,GAAG,IAAI;EAClF,CAAC,EAAE,SAAS,QACV,OAAO,UAAU,eAAe,KAAK,QAAQ,OAAO,GAAG,KAAK,QAAQ,MAAM,SAAS,SAC/E,CAAC,CAAC,KAAK,QAAQ,MAAM,IAAI,CAAC,IAC1B,CAAC,CACP,CACF;EACA,OAAO,cAAc,6BAA6B,UAAU,EAAE,OAAO,MAAM,GACzE,cAAc,QAAQ,MAAM,QAAQ,MAAM,GAAG;GAAE,GAAG;GAAW,GAAG;EAAU,CAAC,CAC7E;CACF;CACA,OAAO,eAAe,gBAAgB,sBAAsB,EAAE,OAAO,OAAO,CAAC;CAC7E,OAAO,oBAAoB,OAAO,OAAO,gBAAgB;EACvD,aAAa,SAAS,OAAO;EAC7B,OAAO;CACT,CAAC,GAAG,MAAM;AACZ;;AAGA,SAAgB,oBACd,OACA,QACsE;CACtE,IAAI,OAAO,UAAU,eAAe,KAAK,OAAO,cAAc,GAC5D,MAAM,IAAI,yBACR,gDACF;CAEF,OAAO,eAAe,OAAO,gBAAgB;EAC3C,YAAY;EACZ,QAAQ,YACN,sBAAsB,QAAQ,OAAO;CACzC,CAAC;CACD,OAAO;AACT;;AAGA,SAAgB,sBAAsB,QAAiC;CACrE,OAAO,OAAO,YAAY,OAAO,QAAQ,MAAM,EAAE,KAAK,CAAC,MAAM,WAAW,CACtE,MAAM,sBAAsB;EAAE;EAAO;CAAK,CAAC,CAC7C,CAAC,CAAC;AACJ"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const require_layout_configuration_error = require('./layout-configuration-error.cjs');
|
|
2
|
+
const require_resource_state_error = require('./resource-state-error.cjs');
|
|
3
|
+
|
|
4
|
+
//#region src/errors/lazy-resource-error.ts
|
|
5
|
+
/** A lazy module must export exactly one matching layout, state, or component. */
|
|
6
|
+
var LazyResourceModuleShapeError = class extends require_layout_configuration_error.LayoutConfigurationError {
|
|
7
|
+
resource;
|
|
8
|
+
received;
|
|
9
|
+
code = "lazyResourceModuleShape";
|
|
10
|
+
constructor(resource, received) {
|
|
11
|
+
super(`Lazy module "${resource}" must export exactly one matching component or state; received ${received}`);
|
|
12
|
+
this.resource = resource;
|
|
13
|
+
this.received = received;
|
|
14
|
+
this.name = "LazyResourceModuleShapeError";
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
/** A compound state requested before loading does not exist in the module. */
|
|
18
|
+
var LazyResourceStateNotFoundError = class extends require_layout_configuration_error.LayoutConfigurationError {
|
|
19
|
+
resource;
|
|
20
|
+
state;
|
|
21
|
+
code = "lazyResourceStateNotFound";
|
|
22
|
+
constructor(resource, state) {
|
|
23
|
+
super(`Lazy resource "${resource}" does not define state "${state}"`);
|
|
24
|
+
this.resource = resource;
|
|
25
|
+
this.state = state;
|
|
26
|
+
this.name = "LazyResourceStateNotFoundError";
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function isLazyResourceError(error) {
|
|
30
|
+
return error instanceof require_resource_state_error.ResourceModuleLoadError || error instanceof LazyResourceModuleShapeError || error instanceof LazyResourceStateNotFoundError;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.LazyResourceModuleShapeError = LazyResourceModuleShapeError;
|
|
35
|
+
exports.LazyResourceStateNotFoundError = LazyResourceStateNotFoundError;
|
|
36
|
+
exports.isLazyResourceError = isLazyResourceError;
|
|
37
|
+
//# sourceMappingURL=lazy-resource-error.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-resource-error.cjs","names":["LayoutConfigurationError","ResourceModuleLoadError"],"sources":["../../src/errors/lazy-resource-error.ts"],"sourcesContent":["import { LayoutConfigurationError } from './layout-configuration-error';\nimport { ResourceModuleLoadError } from './resource-state-error';\n\n/** A lazy module must export exactly one matching layout, state, or component. */\nexport class LazyResourceModuleShapeError extends LayoutConfigurationError {\n override readonly code = 'lazyResourceModuleShape';\n\n constructor(\n readonly resource: string,\n readonly received: number,\n ) {\n super(\n `Lazy module \"${resource}\" must export exactly one matching component or state; received ${received}`,\n );\n this.name = 'LazyResourceModuleShapeError';\n }\n}\n\n/** A compound state requested before loading does not exist in the module. */\nexport class LazyResourceStateNotFoundError extends LayoutConfigurationError {\n override readonly code = 'lazyResourceStateNotFound';\n\n constructor(\n readonly resource: string,\n readonly state: string,\n ) {\n super(`Lazy resource \"${resource}\" does not define state \"${state}\"`);\n this.name = 'LazyResourceStateNotFoundError';\n }\n}\n\nexport type LazyResourceError =\n | ResourceModuleLoadError\n | LazyResourceModuleShapeError\n | LazyResourceStateNotFoundError;\n\nexport type LazyResourceErrorMap = {\n [Code in LazyResourceError['code']]: Extract<\n LazyResourceError,\n { code: Code }\n >;\n};\n\nexport function isLazyResourceError(\n error: unknown,\n): error is LazyResourceError {\n return (\n error instanceof ResourceModuleLoadError ||\n error instanceof LazyResourceModuleShapeError ||\n error instanceof LazyResourceStateNotFoundError\n );\n}\n"],"mappings":";;;;;AAIA,IAAa,+BAAb,cAAkDA,4DAAyB;CAI9D;CACA;CAJX,AAAkB,OAAO;CAEzB,YACE,AAAS,UACT,AAAS,UACT;EACA,MACE,gBAAgB,SAAS,kEAAkE,UAC7F;EALS;EACA;EAKT,KAAK,OAAO;CACd;AACF;;AAGA,IAAa,iCAAb,cAAoDA,4DAAyB;CAIhE;CACA;CAJX,AAAkB,OAAO;CAEzB,YACE,AAAS,UACT,AAAS,OACT;EACA,MAAM,kBAAkB,SAAS,2BAA2B,MAAM,EAAE;EAH3D;EACA;EAGT,KAAK,OAAO;CACd;AACF;AAcA,SAAgB,oBACd,OAC4B;CAC5B,OACE,iBAAiBC,wDACjB,iBAAiB,gCACjB,iBAAiB;AAErB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LayoutConfigurationError } from "./layout-configuration-error.cjs";
|
|
2
|
+
import { ResourceModuleLoadError } from "./resource-state-error.cjs";
|
|
3
|
+
|
|
4
|
+
//#region src/errors/lazy-resource-error.d.ts
|
|
5
|
+
/** A lazy module must export exactly one matching layout, state, or component. */
|
|
6
|
+
declare class LazyResourceModuleShapeError extends LayoutConfigurationError {
|
|
7
|
+
readonly resource: string;
|
|
8
|
+
readonly received: number;
|
|
9
|
+
readonly code = "lazyResourceModuleShape";
|
|
10
|
+
constructor(resource: string, received: number);
|
|
11
|
+
}
|
|
12
|
+
/** A compound state requested before loading does not exist in the module. */
|
|
13
|
+
declare class LazyResourceStateNotFoundError extends LayoutConfigurationError {
|
|
14
|
+
readonly resource: string;
|
|
15
|
+
readonly state: string;
|
|
16
|
+
readonly code = "lazyResourceStateNotFound";
|
|
17
|
+
constructor(resource: string, state: string);
|
|
18
|
+
}
|
|
19
|
+
type LazyResourceError = ResourceModuleLoadError | LazyResourceModuleShapeError | LazyResourceStateNotFoundError;
|
|
20
|
+
type LazyResourceErrorMap = { [Code in LazyResourceError['code']]: Extract<LazyResourceError, {
|
|
21
|
+
code: Code;
|
|
22
|
+
}> };
|
|
23
|
+
declare function isLazyResourceError(error: unknown): error is LazyResourceError;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { LazyResourceError, LazyResourceErrorMap, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, isLazyResourceError };
|
|
26
|
+
//# sourceMappingURL=lazy-resource-error.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-resource-error.d.cts","names":[],"sources":["../../src/errors/lazy-resource-error.ts"],"mappings":";;;;;cAIa,4BAAA,SAAqC,wBAAwB;EAAA,SAI7D,QAAA;EAAA,SACA,QAAA;EAAA,SAJO,IAAA;cAGP,QAAA,UACA,QAAA;AAAA;;cAUA,8BAAA,SAAuC,wBAAwB;EAAA,SAI/D,QAAA;EAAA,SACA,KAAA;EAAA,SAJO,IAAA;cAGP,QAAA,UACA,KAAA;AAAA;AAAA,KAOD,iBAAA,GACR,uBAAA,GACA,4BAAA,GACA,8BAAA;AAAA,KAEQ,oBAAA,cACD,iBAAA,WAA4B,OAAA,CACnC,iBAAA;EACE,IAAA,EAAM,IAAA;AAAA;AAAA,iBAII,mBAAA,CACd,KAAA,YACC,KAAA,IAAS,iBAAiB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { LayoutConfigurationError } from "./layout-configuration-error.mjs";
|
|
2
|
+
import { ResourceModuleLoadError } from "./resource-state-error.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/errors/lazy-resource-error.d.ts
|
|
5
|
+
/** A lazy module must export exactly one matching layout, state, or component. */
|
|
6
|
+
declare class LazyResourceModuleShapeError extends LayoutConfigurationError {
|
|
7
|
+
readonly resource: string;
|
|
8
|
+
readonly received: number;
|
|
9
|
+
readonly code = "lazyResourceModuleShape";
|
|
10
|
+
constructor(resource: string, received: number);
|
|
11
|
+
}
|
|
12
|
+
/** A compound state requested before loading does not exist in the module. */
|
|
13
|
+
declare class LazyResourceStateNotFoundError extends LayoutConfigurationError {
|
|
14
|
+
readonly resource: string;
|
|
15
|
+
readonly state: string;
|
|
16
|
+
readonly code = "lazyResourceStateNotFound";
|
|
17
|
+
constructor(resource: string, state: string);
|
|
18
|
+
}
|
|
19
|
+
type LazyResourceError = ResourceModuleLoadError | LazyResourceModuleShapeError | LazyResourceStateNotFoundError;
|
|
20
|
+
type LazyResourceErrorMap = { [Code in LazyResourceError['code']]: Extract<LazyResourceError, {
|
|
21
|
+
code: Code;
|
|
22
|
+
}> };
|
|
23
|
+
declare function isLazyResourceError(error: unknown): error is LazyResourceError;
|
|
24
|
+
//#endregion
|
|
25
|
+
export { LazyResourceError, LazyResourceErrorMap, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, isLazyResourceError };
|
|
26
|
+
//# sourceMappingURL=lazy-resource-error.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-resource-error.d.mts","names":[],"sources":["../../src/errors/lazy-resource-error.ts"],"mappings":";;;;;cAIa,4BAAA,SAAqC,wBAAwB;EAAA,SAI7D,QAAA;EAAA,SACA,QAAA;EAAA,SAJO,IAAA;cAGP,QAAA,UACA,QAAA;AAAA;;cAUA,8BAAA,SAAuC,wBAAwB;EAAA,SAI/D,QAAA;EAAA,SACA,KAAA;EAAA,SAJO,IAAA;cAGP,QAAA,UACA,KAAA;AAAA;AAAA,KAOD,iBAAA,GACR,uBAAA,GACA,4BAAA,GACA,8BAAA;AAAA,KAEQ,oBAAA,cACD,iBAAA,WAA4B,OAAA,CACnC,iBAAA;EACE,IAAA,EAAM,IAAA;AAAA;AAAA,iBAII,mBAAA,CACd,KAAA,YACC,KAAA,IAAS,iBAAiB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { LayoutConfigurationError } from "./layout-configuration-error.mjs";
|
|
2
|
+
import { ResourceModuleLoadError } from "./resource-state-error.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/errors/lazy-resource-error.ts
|
|
5
|
+
/** A lazy module must export exactly one matching layout, state, or component. */
|
|
6
|
+
var LazyResourceModuleShapeError = class extends LayoutConfigurationError {
|
|
7
|
+
resource;
|
|
8
|
+
received;
|
|
9
|
+
code = "lazyResourceModuleShape";
|
|
10
|
+
constructor(resource, received) {
|
|
11
|
+
super(`Lazy module "${resource}" must export exactly one matching component or state; received ${received}`);
|
|
12
|
+
this.resource = resource;
|
|
13
|
+
this.received = received;
|
|
14
|
+
this.name = "LazyResourceModuleShapeError";
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
/** A compound state requested before loading does not exist in the module. */
|
|
18
|
+
var LazyResourceStateNotFoundError = class extends LayoutConfigurationError {
|
|
19
|
+
resource;
|
|
20
|
+
state;
|
|
21
|
+
code = "lazyResourceStateNotFound";
|
|
22
|
+
constructor(resource, state) {
|
|
23
|
+
super(`Lazy resource "${resource}" does not define state "${state}"`);
|
|
24
|
+
this.resource = resource;
|
|
25
|
+
this.state = state;
|
|
26
|
+
this.name = "LazyResourceStateNotFoundError";
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
function isLazyResourceError(error) {
|
|
30
|
+
return error instanceof ResourceModuleLoadError || error instanceof LazyResourceModuleShapeError || error instanceof LazyResourceStateNotFoundError;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
export { LazyResourceModuleShapeError, LazyResourceStateNotFoundError, isLazyResourceError };
|
|
35
|
+
//# sourceMappingURL=lazy-resource-error.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lazy-resource-error.mjs","names":[],"sources":["../../src/errors/lazy-resource-error.ts"],"sourcesContent":["import { LayoutConfigurationError } from './layout-configuration-error';\nimport { ResourceModuleLoadError } from './resource-state-error';\n\n/** A lazy module must export exactly one matching layout, state, or component. */\nexport class LazyResourceModuleShapeError extends LayoutConfigurationError {\n override readonly code = 'lazyResourceModuleShape';\n\n constructor(\n readonly resource: string,\n readonly received: number,\n ) {\n super(\n `Lazy module \"${resource}\" must export exactly one matching component or state; received ${received}`,\n );\n this.name = 'LazyResourceModuleShapeError';\n }\n}\n\n/** A compound state requested before loading does not exist in the module. */\nexport class LazyResourceStateNotFoundError extends LayoutConfigurationError {\n override readonly code = 'lazyResourceStateNotFound';\n\n constructor(\n readonly resource: string,\n readonly state: string,\n ) {\n super(`Lazy resource \"${resource}\" does not define state \"${state}\"`);\n this.name = 'LazyResourceStateNotFoundError';\n }\n}\n\nexport type LazyResourceError =\n | ResourceModuleLoadError\n | LazyResourceModuleShapeError\n | LazyResourceStateNotFoundError;\n\nexport type LazyResourceErrorMap = {\n [Code in LazyResourceError['code']]: Extract<\n LazyResourceError,\n { code: Code }\n >;\n};\n\nexport function isLazyResourceError(\n error: unknown,\n): error is LazyResourceError {\n return (\n error instanceof ResourceModuleLoadError ||\n error instanceof LazyResourceModuleShapeError ||\n error instanceof LazyResourceStateNotFoundError\n );\n}\n"],"mappings":";;;;;AAIA,IAAa,+BAAb,cAAkD,yBAAyB;CAI9D;CACA;CAJX,AAAkB,OAAO;CAEzB,YACE,AAAS,UACT,AAAS,UACT;EACA,MACE,gBAAgB,SAAS,kEAAkE,UAC7F;EALS;EACA;EAKT,KAAK,OAAO;CACd;AACF;;AAGA,IAAa,iCAAb,cAAoD,yBAAyB;CAIhE;CACA;CAJX,AAAkB,OAAO;CAEzB,YACE,AAAS,UACT,AAAS,OACT;EACA,MAAM,kBAAkB,SAAS,2BAA2B,MAAM,EAAE;EAH3D;EACA;EAGT,KAAK,OAAO;CACd;AACF;AAcA,SAAgB,oBACd,OAC4B;CAC5B,OACE,iBAAiB,2BACjB,iBAAiB,gCACjB,iBAAiB;AAErB"}
|
|
@@ -3,10 +3,13 @@
|
|
|
3
3
|
/** Identifies a failed dynamic import for a resource layout or render state. */
|
|
4
4
|
var ResourceModuleLoadError = class extends Error {
|
|
5
5
|
resource;
|
|
6
|
+
cause;
|
|
6
7
|
code = "resourceModuleLoad";
|
|
7
8
|
constructor(resource, cause) {
|
|
8
|
-
|
|
9
|
+
const detail = cause instanceof Error ? `${cause.name}: ${cause.message}` : typeof cause === "string" ? cause : void 0;
|
|
10
|
+
super(`Unable to load resource module "${resource}"${detail ? `: ${detail}` : ""}`, { cause });
|
|
9
11
|
this.resource = resource;
|
|
12
|
+
this.cause = cause;
|
|
10
13
|
this.name = "ResourceModuleLoadError";
|
|
11
14
|
}
|
|
12
15
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-state-error.cjs","names":[],"sources":["../../src/errors/resource-state-error.ts"],"sourcesContent":["/** Identifies a failed dynamic import for a resource layout or render state. */\nexport class ResourceModuleLoadError extends Error {\n readonly code = 'resourceModuleLoad';\n\n constructor(\n readonly resource: string,\n cause: unknown,\n ) {\n super(`Unable to load resource module \"${resource}\"`, { cause });\n this.name = 'ResourceModuleLoadError';\n }\n}\n\n/** Wraps an exception thrown while rendering a named resource state. */\nexport class ResourceRenderError extends Error {\n readonly code = 'resourceRender';\n\n constructor(\n readonly resource: string,\n readonly state: string,\n cause: unknown,\n ) {\n super(`Unable to render resource \"${resource}\" state \"${state}\"`, {\n cause,\n });\n this.name = 'ResourceRenderError';\n }\n}\n\n/** Library errors that can trigger a configured resource `Error` state. */\nexport type ResourceStateError =\n | ResourceModuleLoadError\n | ResourceRenderError;\n"],"mappings":";;;AACA,IAAa,0BAAb,cAA6C,MAAM;CAItC;
|
|
1
|
+
{"version":3,"file":"resource-state-error.cjs","names":[],"sources":["../../src/errors/resource-state-error.ts"],"sourcesContent":["/** Identifies a failed dynamic import for a resource layout or render state. */\nexport class ResourceModuleLoadError extends Error {\n readonly code = 'resourceModuleLoad';\n\n constructor(\n readonly resource: string,\n override readonly cause: unknown,\n ) {\n const detail = cause instanceof Error\n ? `${cause.name}: ${cause.message}`\n : typeof cause === 'string' ? cause : undefined;\n super(`Unable to load resource module \"${resource}\"${detail ? `: ${detail}` : ''}`, { cause });\n this.name = 'ResourceModuleLoadError';\n }\n}\n\n/** Wraps an exception thrown while rendering a named resource state. */\nexport class ResourceRenderError extends Error {\n readonly code = 'resourceRender';\n\n constructor(\n readonly resource: string,\n readonly state: string,\n cause: unknown,\n ) {\n super(`Unable to render resource \"${resource}\" state \"${state}\"`, {\n cause,\n });\n this.name = 'ResourceRenderError';\n }\n}\n\n/** Library errors that can trigger a configured resource `Error` state. */\nexport type ResourceStateError =\n | ResourceModuleLoadError\n | ResourceRenderError;\n"],"mappings":";;;AACA,IAAa,0BAAb,cAA6C,MAAM;CAItC;CACS;CAJpB,AAAS,OAAO;CAEhB,YACE,AAAS,UACT,AAAkB,OAClB;EACA,MAAM,SAAS,iBAAiB,QAC5B,GAAG,MAAM,KAAK,IAAI,MAAM,YACxB,OAAO,UAAU,WAAW,QAAQ;EACxC,MAAM,mCAAmC,SAAS,GAAG,SAAS,KAAK,WAAW,MAAM,EAAE,MAAM,CAAC;EANpF;EACS;EAMlB,KAAK,OAAO;CACd;AACF;;AAGA,IAAa,sBAAb,cAAyC,MAAM;CAIlC;CACA;CAJX,AAAS,OAAO;CAEhB,YACE,AAAS,UACT,AAAS,OACT,OACA;EACA,MAAM,8BAA8B,SAAS,WAAW,MAAM,IAAI,EAChE,MACF,CAAC;EANQ;EACA;EAMT,KAAK,OAAO;CACd;AACF"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** Identifies a failed dynamic import for a resource layout or render state. */
|
|
3
3
|
declare class ResourceModuleLoadError extends Error {
|
|
4
4
|
readonly resource: string;
|
|
5
|
+
readonly cause: unknown;
|
|
5
6
|
readonly code = "resourceModuleLoad";
|
|
6
7
|
constructor(resource: string, cause: unknown);
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-state-error.d.cts","names":[],"sources":["../../src/errors/resource-state-error.ts"],"mappings":";;cACa,uBAAA,SAAgC,KAAK;EAAA,SAIrC,QAAA;EAAA,
|
|
1
|
+
{"version":3,"file":"resource-state-error.d.cts","names":[],"sources":["../../src/errors/resource-state-error.ts"],"mappings":";;cACa,uBAAA,SAAgC,KAAK;EAAA,SAIrC,QAAA;EAAA,SACS,KAAA;EAAA,SAJX,IAAA;cAGE,QAAA,UACS,KAAA;AAAA;;cAWT,mBAAA,SAA4B,KAAK;EAAA,SAIjC,QAAA;EAAA,SACA,KAAA;EAAA,SAJF,IAAA;cAGE,QAAA,UACA,KAAA,UACT,KAAA;AAAA;AANJ;AAAA,KAgBY,kBAAA,GACR,uBAAA,GACA,mBAAmB"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
/** Identifies a failed dynamic import for a resource layout or render state. */
|
|
3
3
|
declare class ResourceModuleLoadError extends Error {
|
|
4
4
|
readonly resource: string;
|
|
5
|
+
readonly cause: unknown;
|
|
5
6
|
readonly code = "resourceModuleLoad";
|
|
6
7
|
constructor(resource: string, cause: unknown);
|
|
7
8
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-state-error.d.mts","names":[],"sources":["../../src/errors/resource-state-error.ts"],"mappings":";;cACa,uBAAA,SAAgC,KAAK;EAAA,SAIrC,QAAA;EAAA,
|
|
1
|
+
{"version":3,"file":"resource-state-error.d.mts","names":[],"sources":["../../src/errors/resource-state-error.ts"],"mappings":";;cACa,uBAAA,SAAgC,KAAK;EAAA,SAIrC,QAAA;EAAA,SACS,KAAA;EAAA,SAJX,IAAA;cAGE,QAAA,UACS,KAAA;AAAA;;cAWT,mBAAA,SAA4B,KAAK;EAAA,SAIjC,QAAA;EAAA,SACA,KAAA;EAAA,SAJF,IAAA;cAGE,QAAA,UACA,KAAA,UACT,KAAA;AAAA;AANJ;AAAA,KAgBY,kBAAA,GACR,uBAAA,GACA,mBAAmB"}
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
/** Identifies a failed dynamic import for a resource layout or render state. */
|
|
3
3
|
var ResourceModuleLoadError = class extends Error {
|
|
4
4
|
resource;
|
|
5
|
+
cause;
|
|
5
6
|
code = "resourceModuleLoad";
|
|
6
7
|
constructor(resource, cause) {
|
|
7
|
-
|
|
8
|
+
const detail = cause instanceof Error ? `${cause.name}: ${cause.message}` : typeof cause === "string" ? cause : void 0;
|
|
9
|
+
super(`Unable to load resource module "${resource}"${detail ? `: ${detail}` : ""}`, { cause });
|
|
8
10
|
this.resource = resource;
|
|
11
|
+
this.cause = cause;
|
|
9
12
|
this.name = "ResourceModuleLoadError";
|
|
10
13
|
}
|
|
11
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource-state-error.mjs","names":[],"sources":["../../src/errors/resource-state-error.ts"],"sourcesContent":["/** Identifies a failed dynamic import for a resource layout or render state. */\nexport class ResourceModuleLoadError extends Error {\n readonly code = 'resourceModuleLoad';\n\n constructor(\n readonly resource: string,\n cause: unknown,\n ) {\n super(`Unable to load resource module \"${resource}\"`, { cause });\n this.name = 'ResourceModuleLoadError';\n }\n}\n\n/** Wraps an exception thrown while rendering a named resource state. */\nexport class ResourceRenderError extends Error {\n readonly code = 'resourceRender';\n\n constructor(\n readonly resource: string,\n readonly state: string,\n cause: unknown,\n ) {\n super(`Unable to render resource \"${resource}\" state \"${state}\"`, {\n cause,\n });\n this.name = 'ResourceRenderError';\n }\n}\n\n/** Library errors that can trigger a configured resource `Error` state. */\nexport type ResourceStateError =\n | ResourceModuleLoadError\n | ResourceRenderError;\n"],"mappings":";;AACA,IAAa,0BAAb,cAA6C,MAAM;CAItC;
|
|
1
|
+
{"version":3,"file":"resource-state-error.mjs","names":[],"sources":["../../src/errors/resource-state-error.ts"],"sourcesContent":["/** Identifies a failed dynamic import for a resource layout or render state. */\nexport class ResourceModuleLoadError extends Error {\n readonly code = 'resourceModuleLoad';\n\n constructor(\n readonly resource: string,\n override readonly cause: unknown,\n ) {\n const detail = cause instanceof Error\n ? `${cause.name}: ${cause.message}`\n : typeof cause === 'string' ? cause : undefined;\n super(`Unable to load resource module \"${resource}\"${detail ? `: ${detail}` : ''}`, { cause });\n this.name = 'ResourceModuleLoadError';\n }\n}\n\n/** Wraps an exception thrown while rendering a named resource state. */\nexport class ResourceRenderError extends Error {\n readonly code = 'resourceRender';\n\n constructor(\n readonly resource: string,\n readonly state: string,\n cause: unknown,\n ) {\n super(`Unable to render resource \"${resource}\" state \"${state}\"`, {\n cause,\n });\n this.name = 'ResourceRenderError';\n }\n}\n\n/** Library errors that can trigger a configured resource `Error` state. */\nexport type ResourceStateError =\n | ResourceModuleLoadError\n | ResourceRenderError;\n"],"mappings":";;AACA,IAAa,0BAAb,cAA6C,MAAM;CAItC;CACS;CAJpB,AAAS,OAAO;CAEhB,YACE,AAAS,UACT,AAAkB,OAClB;EACA,MAAM,SAAS,iBAAiB,QAC5B,GAAG,MAAM,KAAK,IAAI,MAAM,YACxB,OAAO,UAAU,WAAW,QAAQ;EACxC,MAAM,mCAAmC,SAAS,GAAG,SAAS,KAAK,WAAW,MAAM,EAAE,MAAM,CAAC;EANpF;EACS;EAMlB,KAAK,OAAO;CACd;AACF;;AAGA,IAAa,sBAAb,cAAyC,MAAM;CAIlC;CACA;CAJX,AAAS,OAAO;CAEhB,YACE,AAAS,UACT,AAAS,OACT,OACA;EACA,MAAM,8BAA8B,SAAS,WAAW,MAAM,IAAI,EAChE,MACF,CAAC;EANQ;EACA;EAMT,KAAK,OAAO;CACd;AACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
const require_react_layout_error = require('./errors/react-layout-error.cjs');
|
|
3
|
+
const require_layout_configuration_error = require('./errors/layout-configuration-error.cjs');
|
|
4
|
+
const require_resource_state_error = require('./errors/resource-state-error.cjs');
|
|
5
|
+
const require_lazy_resource_error = require('./errors/lazy-resource-error.cjs');
|
|
3
6
|
const require_invalid_config = require('./errors/invalid-config.cjs');
|
|
4
7
|
const require_invalid_path = require('./errors/invalid-path.cjs');
|
|
5
8
|
const require_invalid_resource = require('./errors/invalid-resource.cjs');
|
|
@@ -9,8 +12,6 @@ const require_invalid_part = require('./errors/invalid-part.cjs');
|
|
|
9
12
|
const require_invalid_part_type = require('./errors/invalid-part-type.cjs');
|
|
10
13
|
const require_missing_path_variable = require('./errors/missing-path-variable.cjs');
|
|
11
14
|
const require_missing_resource_provider = require('./errors/missing-resource-provider.cjs');
|
|
12
|
-
const require_layout_configuration_error = require('./errors/layout-configuration-error.cjs');
|
|
13
|
-
const require_resource_state_error = require('./errors/resource-state-error.cjs');
|
|
14
15
|
const require_preview = require('./create-config/preview.cjs');
|
|
15
16
|
const require_resource = require('./resource.cjs');
|
|
16
17
|
const require_utils = require('./utils.cjs');
|
|
@@ -34,6 +35,8 @@ Object.defineProperty(exports, 'LayoutComposablePresetProvider', {
|
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
37
|
exports.LayoutConfigurationError = require_layout_configuration_error.LayoutConfigurationError;
|
|
38
|
+
exports.LazyResourceModuleShapeError = require_lazy_resource_error.LazyResourceModuleShapeError;
|
|
39
|
+
exports.LazyResourceStateNotFoundError = require_lazy_resource_error.LazyResourceStateNotFoundError;
|
|
37
40
|
exports.MissingPathVariableError = require_missing_path_variable.MissingPathVariableError;
|
|
38
41
|
exports.MissingResourceProviderError = require_missing_resource_provider.MissingResourceProviderError;
|
|
39
42
|
Object.defineProperty(exports, 'PropError', {
|
|
@@ -85,6 +88,7 @@ Object.defineProperty(exports, 'defineComposableComponent', {
|
|
|
85
88
|
exports.defineLayoutName = require_layout_name.defineLayoutName;
|
|
86
89
|
exports.defineLayoutPreview = require_preview.defineLayoutPreview;
|
|
87
90
|
exports.defineResourceLayout = require_define_layout.defineResourceLayout;
|
|
91
|
+
exports.isLazyResourceError = require_lazy_resource_error.isLazyResourceError;
|
|
88
92
|
Object.defineProperty(exports, 'isPropDefinitionShape', {
|
|
89
93
|
enumerable: true,
|
|
90
94
|
get: function () {
|
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { LayoutConfigurationError, LayoutConfigurationErrorContext } from "./errors/layout-configuration-error.cjs";
|
|
2
|
+
import { ResourceModuleLoadError, ResourceRenderError, ResourceStateError } from "./errors/resource-state-error.cjs";
|
|
3
|
+
import { LazyResourceError, LazyResourceErrorMap, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, isLazyResourceError } from "./errors/lazy-resource-error.cjs";
|
|
4
|
+
import { CreateLazyErrorComponent, LazyErrorHandlers, LazyHandle, LazyOptions, LazyResourceErrorComponent, LazyResourceErrorProps, LazyResourceLoadingComponent, LazyResourceStates, LoadStatus } from "./lazy/types.cjs";
|
|
1
5
|
import { BaseComponent, MergeIntersection, Show, UnionToIntersection, pick } from "./utils.cjs";
|
|
2
6
|
import { LayoutResourceKey, NormalizeResource, NormalizeResources, NormalizedResourceDefinition, NormalizedResourceDefinitions, ResourceDefinition, ResourceDefinitionValue, ResourceEnum, ResourceLayoutComponentProps, ResourcePath, ResourceTree, normalizeResource, normalizeResourceDefinitions, normalizeResources, toResourceEnum } from "./resource.cjs";
|
|
3
7
|
import { InPropsDefinition, InPropsFunction, InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, PropsContextRender, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined } from "./props.cjs";
|
|
4
8
|
import { AsStateComposable, StateComposable, StateComposableOptions } from "./create-config/state-composable.cjs";
|
|
5
|
-
import { AnyRenderStateDefinition, CreateLayoutBuildingBlocks, CreateLayoutBuildingBlocksArguments, CreateLayoutBuildingBlocksResult, CreateRenderState, CreateRenderStateBuilderArguments, CreateRenderStateBuilderResult, CreateRenderStateFromState, DeferredRenderState, DefineLayoutComposables, LayoutComposablesDefinition, LazyRenderState, RenderStateCallProps, RenderStateCallback, RenderStateComposablesDefinition, RenderStateContext, RenderStateFragment, RenderStateName, RenderStateOverloads, RenderStateProps, RenderStateReferences, TypedRenderStateCallback } from "./create-config/render-state.cjs";
|
|
9
|
+
import { AnyRenderStateDefinition, BuiltinRenderStateName, CreateLayoutBuildingBlocks, CreateLayoutBuildingBlocksArguments, CreateLayoutBuildingBlocksResult, CreateRenderState, CreateRenderStateBuilderArguments, CreateRenderStateBuilderResult, CreateRenderStateFromState, DeferredRenderState, DefineLayoutComposables, LayoutComposablesDefinition, LazyRenderState, RenderStateCallProps, RenderStateCallback, RenderStateComposablesDefinition, RenderStateContext, RenderStateFragment, RenderStateName, RenderStateOverloads, RenderStateProps, RenderStateReferences, TypedRenderStateCallback } from "./create-config/render-state.cjs";
|
|
6
10
|
import { LayoutNameCallback, LayoutNameContext, LayoutNameFactory, LayoutNameInput, LayoutNameOptions, LayoutNamePartDefinitions, LayoutNamePartType, LayoutNamePartValues, LayoutNameParts, LayoutNameResolver, ResolvedLayoutName, defineLayoutName } from "./create-config/layout-name.cjs";
|
|
7
11
|
import { ParameterizedResourcePath, PathVariables } from "./create-config/paths/types.cjs";
|
|
8
12
|
import { CreateGetComponentForPath, GetComponentForPath, ResolvedPathValue } from "./create-config/for-paths/get-component-for-path.cjs";
|
|
@@ -10,8 +14,10 @@ import { ForPaths, ForPathsRenderContext, RenderedPathComponent, RenderedPathCom
|
|
|
10
14
|
import { IsSubResourceKey } from "./create-config/is-sub-resource-key.cjs";
|
|
11
15
|
import { ComponentTypes, CreateResourceConfigFn, CreateResourceConfigForResource, CreatedResourceConfig, ResourceConfigFragment } from "./create-config/get-component.cjs";
|
|
12
16
|
import { CreateResourceMap, CreateResourceMapFn } from "./create-config/create-resource-links.cjs";
|
|
17
|
+
import { ScopedComponentRenderFn } from "./lazy/scoped-content.cjs";
|
|
13
18
|
import { ContextualInlineRenderState, ContextualInlineRenderStates, CreateResourceLayoutWithLayoutOptions, CreateViewMapBuiltInRenderStatesOptions, CreateViewMapFunctionRenderOptions, CreateViewMapInlineRenderStatesOptions, CreateViewMapRenderStatesOptions, DefineResourceLayoutWithLayoutFn, DefineResourcesFn, DefinedResourceLayoutWithShell, LayoutRenderResourcesAccessor, LayoutResourcesAccessor, ResourceLayoutProvider, ResourceLayoutProviderProps, ResourceLayoutShellComponent, ResourceLayoutShellProps, ResourceSelection, ShellLayoutDefinition, ShellRenderContext, TypedBuiltInRenderStates, TypedInlineRenderState, defineResourceLayout } from "./create-config/define-layout.cjs";
|
|
14
|
-
import {
|
|
19
|
+
import { CreateLazyRenderState, LazyDefaultState } from "./lazy/create-render-state.cjs";
|
|
20
|
+
import { LazyResourceLayoutComponent, LazyResourceLayoutOptions } from "./create-config/lazy-resource-layout.cjs";
|
|
15
21
|
import { BoundDefineResourceLayout, CreateDefinedResourceLayoutOptions, CreateDefinedResourceLayoutResult, DefineLazyDefaults, DefinedResourceLayoutInput, NonEmptyResources, createDefinedResourceLayout } from "./create-config/create-defined-resource-layout.cjs";
|
|
16
22
|
import { ResourceLayoutShellPublisher } from "./create-config/shell-context.cjs";
|
|
17
23
|
import { LayoutPreviewProps, defineLayoutPreview } from "./create-config/preview.cjs";
|
|
@@ -25,8 +31,6 @@ import { InvalidPartContext, InvalidPartError } from "./errors/invalid-part.cjs"
|
|
|
25
31
|
import { InvalidPartTypeContext, InvalidPartTypeError } from "./errors/invalid-part-type.cjs";
|
|
26
32
|
import { MissingPathVariableContext, MissingPathVariableError } from "./errors/missing-path-variable.cjs";
|
|
27
33
|
import { MissingResourceProviderError } from "./errors/missing-resource-provider.cjs";
|
|
28
|
-
import { LayoutConfigurationError, LayoutConfigurationErrorContext } from "./errors/layout-configuration-error.cjs";
|
|
29
|
-
import { ResourceModuleLoadError, ResourceRenderError, ResourceStateError } from "./errors/resource-state-error.cjs";
|
|
30
34
|
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";
|
|
31
35
|
import { AnyBuiltPropDefinition, ExtractDefinitionValue, PropError, PropErrorOptions, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps, ResolvedBuiltPropShape, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
32
|
-
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type AnyRenderStateDefinition, type AsStateComposable, type BaseComponent, type BoundDefineResourceLayout, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type ContextualInlineRenderState, type ContextualInlineRenderStates, type CreateDefinedResourceLayoutOptions, type CreateDefinedResourceLayoutResult, type CreateGetComponentForPath, type CreateLayoutBuildingBlocks, type CreateLayoutBuildingBlocksArguments, type CreateLayoutBuildingBlocksResult, type CreateLayoutComposable, type CreateRenderState, type CreateRenderStateBuilderArguments, type CreateRenderStateBuilderResult, type CreateRenderStateFromState, type CreateResourceConfigFn, type CreateResourceConfigForResource, type CreateResourceLayoutWithLayoutOptions, type CreateResourceMap, type CreateResourceMapFn, type CreateViewMapBuiltInRenderStatesOptions, type CreateViewMapFunctionRenderOptions, type CreateViewMapInlineRenderStatesOptions, type CreateViewMapRenderStatesOptions, type CreatedResourceConfig, type DeferredRenderState, type DefineLayoutComposables, type DefineLazyDefaults, type DefineResourceLayoutWithLayoutFn, type DefineResourcesFn, type DefinedComposableComponentRecord, type DefinedResourceLayoutInput, type DefinedResourceLayoutWithShell, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedComponentPropDefinitions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPartContext, InvalidPartError, type InvalidPartTypeContext, InvalidPartTypeError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesDefinition, type LayoutComposablesFactory, LayoutConfigurationError, type LayoutConfigurationErrorContext, type LayoutNameCallback, type LayoutNameContext, type LayoutNameFactory, type LayoutNameInput, type LayoutNameOptions, type LayoutNamePartDefinitions, type LayoutNamePartType, type LayoutNamePartValues, type LayoutNameParts, type LayoutNameResolver, type LayoutPreviewProps, type LayoutRenderProps, type LayoutRenderResourcesAccessor, type LayoutResourceKey, type LayoutResourcesAccessor, type LazyRenderState, type LazyResourceErrorComponent, type LazyResourceLayoutComponent, type LazyResourceLayoutOptions, type LazyResourceLoadingComponent, type LazyResourceStates, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, MissingResourceProviderError, type NonEmptyResources, type NormalizeResource, type NormalizeResources, type NormalizedResourceDefinition, type NormalizedResourceDefinitions, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, ReactLayoutError, type RenderStateCallProps, type RenderStateCallback, type RenderStateComposablesDefinition, type RenderStateContext, type RenderStateFragment, type RenderStateName, type RenderStateOverloads, type RenderStateProps, type RenderStateReferences, 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 ResolvedLayoutName, type ResolvedPathValue, type ResourceConfigFragment, type ResourceDefinition, type ResourceDefinitionValue, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceLayoutProvider, type ResourceLayoutProviderProps, type ResourceLayoutShellComponent, type ResourceLayoutShellProps, type ResourceLayoutShellPublisher, ResourceModuleLoadError, type ResourcePath, ResourceRenderError, type ResourceSelection, type ResourceStateError, type ResourceTree, type ShellLayoutDefinition, type ShellRenderContext, type Show, type StateComposable, type StateComposableOptions, type TargetPathBuilder, type TypedBuiltInRenderStates, type TypedInlineRenderState, type TypedRenderStateCallback, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createDefinedResourceLayout, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineLayoutName, defineLayoutPreview, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResourceDefinitions, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
|
36
|
+
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type AnyRenderStateDefinition, type AsStateComposable, type BaseComponent, type BoundDefineResourceLayout, type BuiltinRenderStateName, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type ContextualInlineRenderState, type ContextualInlineRenderStates, type CreateDefinedResourceLayoutOptions, type CreateDefinedResourceLayoutResult, type CreateGetComponentForPath, type CreateLayoutBuildingBlocks, type CreateLayoutBuildingBlocksArguments, type CreateLayoutBuildingBlocksResult, type CreateLayoutComposable, type CreateLazyErrorComponent, type CreateLazyRenderState, type CreateRenderState, type CreateRenderStateBuilderArguments, type CreateRenderStateBuilderResult, type CreateRenderStateFromState, type CreateResourceConfigFn, type CreateResourceConfigForResource, type CreateResourceLayoutWithLayoutOptions, type CreateResourceMap, type CreateResourceMapFn, type CreateViewMapBuiltInRenderStatesOptions, type CreateViewMapFunctionRenderOptions, type CreateViewMapInlineRenderStatesOptions, type CreateViewMapRenderStatesOptions, type CreatedResourceConfig, type DeferredRenderState, type DefineLayoutComposables, type DefineLazyDefaults, type DefineResourceLayoutWithLayoutFn, type DefineResourcesFn, type DefinedComposableComponentRecord, type DefinedResourceLayoutInput, type DefinedResourceLayoutWithShell, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedComponentPropDefinitions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPartContext, InvalidPartError, type InvalidPartTypeContext, InvalidPartTypeError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesDefinition, type LayoutComposablesFactory, LayoutConfigurationError, type LayoutConfigurationErrorContext, type LayoutNameCallback, type LayoutNameContext, type LayoutNameFactory, type LayoutNameInput, type LayoutNameOptions, type LayoutNamePartDefinitions, type LayoutNamePartType, type LayoutNamePartValues, type LayoutNameParts, type LayoutNameResolver, type LayoutPreviewProps, type LayoutRenderProps, type LayoutRenderResourcesAccessor, type LayoutResourceKey, type LayoutResourcesAccessor, type LazyDefaultState, type LazyErrorHandlers, type LazyHandle, type LazyOptions, type LazyRenderState, type LazyResourceError, type LazyResourceErrorComponent, type LazyResourceErrorMap, type LazyResourceErrorProps, type LazyResourceLayoutComponent, type LazyResourceLayoutOptions, type LazyResourceLoadingComponent, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, type LazyResourceStates, type LoadStatus, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, MissingResourceProviderError, type NonEmptyResources, type NormalizeResource, type NormalizeResources, type NormalizedResourceDefinition, type NormalizedResourceDefinitions, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, ReactLayoutError, type RenderStateCallProps, type RenderStateCallback, type RenderStateComposablesDefinition, type RenderStateContext, type RenderStateFragment, type RenderStateName, type RenderStateOverloads, type RenderStateProps, type RenderStateReferences, 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 ResolvedLayoutName, type ResolvedPathValue, type ResourceConfigFragment, type ResourceDefinition, type ResourceDefinitionValue, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceLayoutProvider, type ResourceLayoutProviderProps, type ResourceLayoutShellComponent, type ResourceLayoutShellProps, type ResourceLayoutShellPublisher, ResourceModuleLoadError, type ResourcePath, ResourceRenderError, type ResourceSelection, type ResourceStateError, type ResourceTree, type ScopedComponentRenderFn, type ShellLayoutDefinition, type ShellRenderContext, type Show, type StateComposable, type StateComposableOptions, type TargetPathBuilder, type TypedBuiltInRenderStates, type TypedInlineRenderState, type TypedRenderStateCallback, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createDefinedResourceLayout, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineLayoutName, defineLayoutPreview, defineResourceLayout, isLazyResourceError, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResourceDefinitions, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { LayoutConfigurationError, LayoutConfigurationErrorContext } from "./errors/layout-configuration-error.mjs";
|
|
2
|
+
import { ResourceModuleLoadError, ResourceRenderError, ResourceStateError } from "./errors/resource-state-error.mjs";
|
|
3
|
+
import { LazyResourceError, LazyResourceErrorMap, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, isLazyResourceError } from "./errors/lazy-resource-error.mjs";
|
|
4
|
+
import { CreateLazyErrorComponent, LazyErrorHandlers, LazyHandle, LazyOptions, LazyResourceErrorComponent, LazyResourceErrorProps, LazyResourceLoadingComponent, LazyResourceStates, LoadStatus } from "./lazy/types.mjs";
|
|
1
5
|
import { BaseComponent, MergeIntersection, Show, UnionToIntersection, pick } from "./utils.mjs";
|
|
2
6
|
import { LayoutResourceKey, NormalizeResource, NormalizeResources, NormalizedResourceDefinition, NormalizedResourceDefinitions, ResourceDefinition, ResourceDefinitionValue, ResourceEnum, ResourceLayoutComponentProps, ResourcePath, ResourceTree, normalizeResource, normalizeResourceDefinitions, normalizeResources, toResourceEnum } from "./resource.mjs";
|
|
3
7
|
import { InPropsDefinition, InPropsFunction, InPropsObject, InPropsOptions, IncludedComponentPropDefinitions, IncludedPropBehavior, IncludedProps, InferredInProps, LayoutRenderProps, MergedLayoutInProps, PropsContextRender, PropsRenderDefinition, ResolvedIncludedComponentProps, ResolvedIncludedConfigProps, ResolvedIncludedProps, ResolvedIncludedPropsAsDefined } from "./props.mjs";
|
|
4
8
|
import { AsStateComposable, StateComposable, StateComposableOptions } from "./create-config/state-composable.mjs";
|
|
5
|
-
import { AnyRenderStateDefinition, CreateLayoutBuildingBlocks, CreateLayoutBuildingBlocksArguments, CreateLayoutBuildingBlocksResult, CreateRenderState, CreateRenderStateBuilderArguments, CreateRenderStateBuilderResult, CreateRenderStateFromState, DeferredRenderState, DefineLayoutComposables, LayoutComposablesDefinition, LazyRenderState, RenderStateCallProps, RenderStateCallback, RenderStateComposablesDefinition, RenderStateContext, RenderStateFragment, RenderStateName, RenderStateOverloads, RenderStateProps, RenderStateReferences, TypedRenderStateCallback } from "./create-config/render-state.mjs";
|
|
9
|
+
import { AnyRenderStateDefinition, BuiltinRenderStateName, CreateLayoutBuildingBlocks, CreateLayoutBuildingBlocksArguments, CreateLayoutBuildingBlocksResult, CreateRenderState, CreateRenderStateBuilderArguments, CreateRenderStateBuilderResult, CreateRenderStateFromState, DeferredRenderState, DefineLayoutComposables, LayoutComposablesDefinition, LazyRenderState, RenderStateCallProps, RenderStateCallback, RenderStateComposablesDefinition, RenderStateContext, RenderStateFragment, RenderStateName, RenderStateOverloads, RenderStateProps, RenderStateReferences, TypedRenderStateCallback } from "./create-config/render-state.mjs";
|
|
6
10
|
import { LayoutNameCallback, LayoutNameContext, LayoutNameFactory, LayoutNameInput, LayoutNameOptions, LayoutNamePartDefinitions, LayoutNamePartType, LayoutNamePartValues, LayoutNameParts, LayoutNameResolver, ResolvedLayoutName, defineLayoutName } from "./create-config/layout-name.mjs";
|
|
7
11
|
import { ParameterizedResourcePath, PathVariables } from "./create-config/paths/types.mjs";
|
|
8
12
|
import { CreateGetComponentForPath, GetComponentForPath, ResolvedPathValue } from "./create-config/for-paths/get-component-for-path.mjs";
|
|
@@ -10,8 +14,10 @@ import { ForPaths, ForPathsRenderContext, RenderedPathComponent, RenderedPathCom
|
|
|
10
14
|
import { IsSubResourceKey } from "./create-config/is-sub-resource-key.mjs";
|
|
11
15
|
import { ComponentTypes, CreateResourceConfigFn, CreateResourceConfigForResource, CreatedResourceConfig, ResourceConfigFragment } from "./create-config/get-component.mjs";
|
|
12
16
|
import { CreateResourceMap, CreateResourceMapFn } from "./create-config/create-resource-links.mjs";
|
|
17
|
+
import { ScopedComponentRenderFn } from "./lazy/scoped-content.mjs";
|
|
13
18
|
import { ContextualInlineRenderState, ContextualInlineRenderStates, CreateResourceLayoutWithLayoutOptions, CreateViewMapBuiltInRenderStatesOptions, CreateViewMapFunctionRenderOptions, CreateViewMapInlineRenderStatesOptions, CreateViewMapRenderStatesOptions, DefineResourceLayoutWithLayoutFn, DefineResourcesFn, DefinedResourceLayoutWithShell, LayoutRenderResourcesAccessor, LayoutResourcesAccessor, ResourceLayoutProvider, ResourceLayoutProviderProps, ResourceLayoutShellComponent, ResourceLayoutShellProps, ResourceSelection, ShellLayoutDefinition, ShellRenderContext, TypedBuiltInRenderStates, TypedInlineRenderState, defineResourceLayout } from "./create-config/define-layout.mjs";
|
|
14
|
-
import {
|
|
19
|
+
import { CreateLazyRenderState, LazyDefaultState } from "./lazy/create-render-state.mjs";
|
|
20
|
+
import { LazyResourceLayoutComponent, LazyResourceLayoutOptions } from "./create-config/lazy-resource-layout.mjs";
|
|
15
21
|
import { BoundDefineResourceLayout, CreateDefinedResourceLayoutOptions, CreateDefinedResourceLayoutResult, DefineLazyDefaults, DefinedResourceLayoutInput, NonEmptyResources, createDefinedResourceLayout } from "./create-config/create-defined-resource-layout.mjs";
|
|
16
22
|
import { ResourceLayoutShellPublisher } from "./create-config/shell-context.mjs";
|
|
17
23
|
import { LayoutPreviewProps, defineLayoutPreview } from "./create-config/preview.mjs";
|
|
@@ -25,8 +31,6 @@ import { InvalidPartContext, InvalidPartError } from "./errors/invalid-part.mjs"
|
|
|
25
31
|
import { InvalidPartTypeContext, InvalidPartTypeError } from "./errors/invalid-part-type.mjs";
|
|
26
32
|
import { MissingPathVariableContext, MissingPathVariableError } from "./errors/missing-path-variable.mjs";
|
|
27
33
|
import { MissingResourceProviderError } from "./errors/missing-resource-provider.mjs";
|
|
28
|
-
import { LayoutConfigurationError, LayoutConfigurationErrorContext } from "./errors/layout-configuration-error.mjs";
|
|
29
|
-
import { ResourceModuleLoadError, ResourceRenderError, ResourceStateError } from "./errors/resource-state-error.mjs";
|
|
30
34
|
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";
|
|
31
35
|
import { AnyBuiltPropDefinition, ExtractDefinitionValue, PropError, PropErrorOptions, ResolveLayoutProps, ResolveLayoutPropsAsDefined, ResolveProps, ResolvedBuiltPropShape, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
32
|
-
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type AnyRenderStateDefinition, type AsStateComposable, type BaseComponent, type BoundDefineResourceLayout, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type ContextualInlineRenderState, type ContextualInlineRenderStates, type CreateDefinedResourceLayoutOptions, type CreateDefinedResourceLayoutResult, type CreateGetComponentForPath, type CreateLayoutBuildingBlocks, type CreateLayoutBuildingBlocksArguments, type CreateLayoutBuildingBlocksResult, type CreateLayoutComposable, type CreateRenderState, type CreateRenderStateBuilderArguments, type CreateRenderStateBuilderResult, type CreateRenderStateFromState, type CreateResourceConfigFn, type CreateResourceConfigForResource, type CreateResourceLayoutWithLayoutOptions, type CreateResourceMap, type CreateResourceMapFn, type CreateViewMapBuiltInRenderStatesOptions, type CreateViewMapFunctionRenderOptions, type CreateViewMapInlineRenderStatesOptions, type CreateViewMapRenderStatesOptions, type CreatedResourceConfig, type DeferredRenderState, type DefineLayoutComposables, type DefineLazyDefaults, type DefineResourceLayoutWithLayoutFn, type DefineResourcesFn, type DefinedComposableComponentRecord, type DefinedResourceLayoutInput, type DefinedResourceLayoutWithShell, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedComponentPropDefinitions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPartContext, InvalidPartError, type InvalidPartTypeContext, InvalidPartTypeError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesDefinition, type LayoutComposablesFactory, LayoutConfigurationError, type LayoutConfigurationErrorContext, type LayoutNameCallback, type LayoutNameContext, type LayoutNameFactory, type LayoutNameInput, type LayoutNameOptions, type LayoutNamePartDefinitions, type LayoutNamePartType, type LayoutNamePartValues, type LayoutNameParts, type LayoutNameResolver, type LayoutPreviewProps, type LayoutRenderProps, type LayoutRenderResourcesAccessor, type LayoutResourceKey, type LayoutResourcesAccessor, type LazyRenderState, type LazyResourceErrorComponent, type LazyResourceLayoutComponent, type LazyResourceLayoutOptions, type LazyResourceLoadingComponent, type LazyResourceStates, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, MissingResourceProviderError, type NonEmptyResources, type NormalizeResource, type NormalizeResources, type NormalizedResourceDefinition, type NormalizedResourceDefinitions, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, ReactLayoutError, type RenderStateCallProps, type RenderStateCallback, type RenderStateComposablesDefinition, type RenderStateContext, type RenderStateFragment, type RenderStateName, type RenderStateOverloads, type RenderStateProps, type RenderStateReferences, 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 ResolvedLayoutName, type ResolvedPathValue, type ResourceConfigFragment, type ResourceDefinition, type ResourceDefinitionValue, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceLayoutProvider, type ResourceLayoutProviderProps, type ResourceLayoutShellComponent, type ResourceLayoutShellProps, type ResourceLayoutShellPublisher, ResourceModuleLoadError, type ResourcePath, ResourceRenderError, type ResourceSelection, type ResourceStateError, type ResourceTree, type ShellLayoutDefinition, type ShellRenderContext, type Show, type StateComposable, type StateComposableOptions, type TargetPathBuilder, type TypedBuiltInRenderStates, type TypedInlineRenderState, type TypedRenderStateCallback, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createDefinedResourceLayout, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineLayoutName, defineLayoutPreview, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResourceDefinitions, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
|
36
|
+
export { type AnyBuiltPropDefinition, type AnyComposableComponent, type AnyRenderStateDefinition, type AsStateComposable, type BaseComponent, type BoundDefineResourceLayout, type BuiltinRenderStateName, type ComponentTypes, type ComposableComponent, type ComposableComponentCallable, type ComposableComponents, type ComposableNameContext, type ComposablePresetComponent, type ComposablePresetComponentCallProps, type ComposablePresetMeta, type ComposablePresetProps, type ComposableResourceLayout, type ContextualInlineRenderState, type ContextualInlineRenderStates, type CreateDefinedResourceLayoutOptions, type CreateDefinedResourceLayoutResult, type CreateGetComponentForPath, type CreateLayoutBuildingBlocks, type CreateLayoutBuildingBlocksArguments, type CreateLayoutBuildingBlocksResult, type CreateLayoutComposable, type CreateLazyErrorComponent, type CreateLazyRenderState, type CreateRenderState, type CreateRenderStateBuilderArguments, type CreateRenderStateBuilderResult, type CreateRenderStateFromState, type CreateResourceConfigFn, type CreateResourceConfigForResource, type CreateResourceLayoutWithLayoutOptions, type CreateResourceMap, type CreateResourceMapFn, type CreateViewMapBuiltInRenderStatesOptions, type CreateViewMapFunctionRenderOptions, type CreateViewMapInlineRenderStatesOptions, type CreateViewMapRenderStatesOptions, type CreatedResourceConfig, type DeferredRenderState, type DefineLayoutComposables, type DefineLazyDefaults, type DefineResourceLayoutWithLayoutFn, type DefineResourcesFn, type DefinedComposableComponentRecord, type DefinedResourceLayoutInput, type DefinedResourceLayoutWithShell, type ExtractDefinitionValue, type ForPaths, type ForPathsRenderContext, type GetComponentForPath, type InPropsDefinition, type InPropsFunction, type InPropsObject, type InPropsOptions, type IncludedComponentPropDefinitions, type IncludedPropBehavior, type IncludedProps, type InferredInProps, type InvalidComponentContext, InvalidComponentError, type InvalidConfigContext, InvalidConfigError, type InvalidPartContext, InvalidPartError, type InvalidPartTypeContext, InvalidPartTypeError, type InvalidPathContext, InvalidPathError, type InvalidResourceContext, InvalidResourceError, type InvalidSubResourceContext, InvalidSubResourceError, type IsSubResourceKey, LayoutComposablePresetProvider, type LayoutComposablesDefinition, type LayoutComposablesFactory, LayoutConfigurationError, type LayoutConfigurationErrorContext, type LayoutNameCallback, type LayoutNameContext, type LayoutNameFactory, type LayoutNameInput, type LayoutNameOptions, type LayoutNamePartDefinitions, type LayoutNamePartType, type LayoutNamePartValues, type LayoutNameParts, type LayoutNameResolver, type LayoutPreviewProps, type LayoutRenderProps, type LayoutRenderResourcesAccessor, type LayoutResourceKey, type LayoutResourcesAccessor, type LazyDefaultState, type LazyErrorHandlers, type LazyHandle, type LazyOptions, type LazyRenderState, type LazyResourceError, type LazyResourceErrorComponent, type LazyResourceErrorMap, type LazyResourceErrorProps, type LazyResourceLayoutComponent, type LazyResourceLayoutOptions, type LazyResourceLoadingComponent, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, type LazyResourceStates, type LoadStatus, type MakeComposable, type MakeComposableOptions, type MergeIntersection, type MergePresetProps, type MergedLayoutInProps, type MissingPathVariableContext, MissingPathVariableError, MissingResourceProviderError, type NonEmptyResources, type NormalizeResource, type NormalizeResources, type NormalizedResourceDefinition, type NormalizedResourceDefinitions, type ParameterizedResourcePath, type PathVariables, type PresetPropsFromComposable, PropError, type PropErrorOptions, type PropsContextRender, type PropsRenderDefinition, ReactLayoutError, type RenderStateCallProps, type RenderStateCallback, type RenderStateComposablesDefinition, type RenderStateContext, type RenderStateFragment, type RenderStateName, type RenderStateOverloads, type RenderStateProps, type RenderStateReferences, 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 ResolvedLayoutName, type ResolvedPathValue, type ResourceConfigFragment, type ResourceDefinition, type ResourceDefinitionValue, type ResourceEnum, type ResourceLayoutComponentProps, type ResourceLayoutProvider, type ResourceLayoutProviderProps, type ResourceLayoutShellComponent, type ResourceLayoutShellProps, type ResourceLayoutShellPublisher, ResourceModuleLoadError, type ResourcePath, ResourceRenderError, type ResourceSelection, type ResourceStateError, type ResourceTree, type ScopedComponentRenderFn, type ShellLayoutDefinition, type ShellRenderContext, type Show, type StateComposable, type StateComposableOptions, type TargetPathBuilder, type TypedBuiltInRenderStates, type TypedInlineRenderState, type TypedRenderStateCallback, type UnionToIntersection, collectComposablePresetEntries, createComposableComponent, createDefinedResourceLayout, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineLayoutName, defineLayoutPreview, defineResourceLayout, isLazyResourceError, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResourceDefinitions, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { ReactLayoutError } from "./errors/react-layout-error.mjs";
|
|
2
|
+
import { LayoutConfigurationError } from "./errors/layout-configuration-error.mjs";
|
|
3
|
+
import { ResourceModuleLoadError, ResourceRenderError } from "./errors/resource-state-error.mjs";
|
|
4
|
+
import { LazyResourceModuleShapeError, LazyResourceStateNotFoundError, isLazyResourceError } from "./errors/lazy-resource-error.mjs";
|
|
2
5
|
import { InvalidConfigError } from "./errors/invalid-config.mjs";
|
|
3
6
|
import { InvalidPathError } from "./errors/invalid-path.mjs";
|
|
4
7
|
import { InvalidResourceError } from "./errors/invalid-resource.mjs";
|
|
@@ -8,8 +11,6 @@ import { InvalidPartError } from "./errors/invalid-part.mjs";
|
|
|
8
11
|
import { InvalidPartTypeError } from "./errors/invalid-part-type.mjs";
|
|
9
12
|
import { MissingPathVariableError } from "./errors/missing-path-variable.mjs";
|
|
10
13
|
import { MissingResourceProviderError } from "./errors/missing-resource-provider.mjs";
|
|
11
|
-
import { LayoutConfigurationError } from "./errors/layout-configuration-error.mjs";
|
|
12
|
-
import { ResourceModuleLoadError, ResourceRenderError } from "./errors/resource-state-error.mjs";
|
|
13
14
|
import { defineLayoutPreview } from "./create-config/preview.mjs";
|
|
14
15
|
import { normalizeResource, normalizeResourceDefinitions, normalizeResources, toResourceEnum } from "./resource.mjs";
|
|
15
16
|
import { pick } from "./utils.mjs";
|
|
@@ -19,4 +20,4 @@ import { defineLayoutName } from "./create-config/layout-name.mjs";
|
|
|
19
20
|
import { LayoutComposablePresetProvider, collectComposablePresetEntries, createComposableComponent, createLayoutComposableFactory, defineComposableComponent, makeComposable, resolveComposablePresetProps, resolveLayoutComposables } from "@jfdevelops/react-layout-composables";
|
|
20
21
|
import { PropError, createPrimitivePropBuilder, createProp, isPropDefinitionShape, resolvePropDefinitionValues, validateProps } from "@jfdevelops/react-layout-validator";
|
|
21
22
|
|
|
22
|
-
export { InvalidComponentError, InvalidConfigError, InvalidPartError, InvalidPartTypeError, InvalidPathError, InvalidResourceError, InvalidSubResourceError, LayoutComposablePresetProvider, LayoutConfigurationError, MissingPathVariableError, MissingResourceProviderError, PropError, ReactLayoutError, ResourceModuleLoadError, ResourceRenderError, collectComposablePresetEntries, createComposableComponent, createDefinedResourceLayout, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineLayoutName, defineLayoutPreview, defineResourceLayout, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResourceDefinitions, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|
|
23
|
+
export { InvalidComponentError, InvalidConfigError, InvalidPartError, InvalidPartTypeError, InvalidPathError, InvalidResourceError, InvalidSubResourceError, LayoutComposablePresetProvider, LayoutConfigurationError, LazyResourceModuleShapeError, LazyResourceStateNotFoundError, MissingPathVariableError, MissingResourceProviderError, PropError, ReactLayoutError, ResourceModuleLoadError, ResourceRenderError, collectComposablePresetEntries, createComposableComponent, createDefinedResourceLayout, createLayoutComposableFactory, createPrimitivePropBuilder, createProp, defineComposableComponent, defineLayoutName, defineLayoutPreview, defineResourceLayout, isLazyResourceError, isPropDefinitionShape, makeComposable, normalizeResource, normalizeResourceDefinitions, normalizeResources, pick, resolveComposablePresetProps, resolveLayoutComposables, resolvePropDefinitionValues, toResourceEnum, validateProps };
|