@jfdevelops/react-layout 2.0.0 → 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 +10 -2
- package/dist/create-config/create-defined-resource-layout.cjs.map +1 -1
- package/dist/create-config/create-defined-resource-layout.d.cts +7 -5
- package/dist/create-config/create-defined-resource-layout.d.cts.map +1 -1
- package/dist/create-config/create-defined-resource-layout.d.mts +7 -5
- package/dist/create-config/create-defined-resource-layout.d.mts.map +1 -1
- package/dist/create-config/create-defined-resource-layout.mjs +10 -2
- package/dist/create-config/create-defined-resource-layout.mjs.map +1 -1
- package/dist/create-config/define-layout.cjs +63 -19
- package/dist/create-config/define-layout.cjs.map +1 -1
- package/dist/create-config/define-layout.d.cts +9 -8
- package/dist/create-config/define-layout.d.cts.map +1 -1
- package/dist/create-config/define-layout.d.mts +9 -8
- package/dist/create-config/define-layout.d.mts.map +1 -1
- package/dist/create-config/define-layout.mjs +63 -19
- package/dist/create-config/define-layout.mjs.map +1 -1
- package/dist/create-config/for-resources/create-component.d.cts +30 -24
- package/dist/create-config/for-resources/create-component.d.cts.map +1 -1
- package/dist/create-config/for-resources/create-component.d.mts +30 -24
- package/dist/create-config/for-resources/create-component.d.mts.map +1 -1
- package/dist/create-config/for-resources/create-for-resources.cjs +27 -6
- package/dist/create-config/for-resources/create-for-resources.cjs.map +1 -1
- package/dist/create-config/for-resources/create-for-resources.mjs +27 -6
- 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 +38 -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 +38 -4
- package/dist/create-config/for-resources/scoped-render.mjs.map +1 -1
- package/dist/create-config/index.d.cts +1 -1
- package/dist/create-config/index.d.mts +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 +1 -0
- package/dist/create-config/render-state.cjs.map +1 -1
- package/dist/create-config/render-state.d.cts +26 -15
- package/dist/create-config/render-state.d.cts.map +1 -1
- package/dist/create-config/render-state.d.mts +26 -15
- package/dist/create-config/render-state.d.mts.map +1 -1
- package/dist/create-config/render-state.mjs +1 -0
- 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/index.d.cts +3 -2
- package/dist/index.d.mts +3 -2
- 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/lazy-boundary.cjs +14 -6
- package/dist/lazy/lazy-boundary.cjs.map +1 -1
- package/dist/lazy/lazy-boundary.mjs +14 -6
- package/dist/lazy/lazy-boundary.mjs.map +1 -1
- package/dist/lazy/types.cjs.map +1 -1
- package/dist/lazy/types.d.cts +7 -6
- package/dist/lazy/types.d.cts.map +1 -1
- package/dist/lazy/types.d.mts +7 -6
- package/dist/lazy/types.d.mts.map +1 -1
- package/dist/lazy/types.mjs.map +1 -1
- package/package.json +3 -3
- package/dist/lazy/create-error-component.cjs +0 -17
- package/dist/lazy/create-error-component.cjs.map +0 -1
- package/dist/lazy/create-error-component.mjs +0 -16
- package/dist/lazy/create-error-component.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoped-layout.d.cts","names":[],"sources":["../../../src/create-config/for-resources/scoped-layout.ts"],"mappings":";;;;;;;;;;KA0CY,iCAAA,mBACQ,aAAA,CAAc,kBAAA,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,uBACC,kBAAA,CAAmB,SAAA,EAAW,OAAA,EAAS,WAAA,qBAC1C,aAAA,iDAED,uBAAA,CAAwB,SAAA,EAAW,SAAA,iBACtC,aAAA,IACZ,sBAAA,CAAuB,SAAA,EAAW,OAAA,EAAS,WAAA,EAAa,YAAA;EAC1D,QAAA,EAAU,QAAA;EACV,KAAA,GAAQ,KAAA;EACR,IAAA,GAAO,IAAA;AAAA;AAAA,KAGG,gCAAA,mBACQ,aAAA,CAAc,kBAAA,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,uBACC,kBAAA,CAAmB,SAAA,EAAW,OAAA,EAAS,WAAA,qBAC1C,aAAA,+BACE,aAAA,+EAGE,eAAA,wDAEL,uBAAA,CAAwB,SAAA,EAAW,SAAA,yBAC9B,0BAAA,CACpB,SAAA,EAAW,QAAA,EAAU,aAAA,iBAET,aAAA,mCACc,gBAAA,EAE5B,OAAA,EAAS,iCAAA,CACP,SAAA,EACA,OAAA,EACA,WAAA,EACA,YAAA,EACA,SAAA,EACA,IAAA,EACA,QAAA,EACA,KAAA;EACI,SAAA,GAAY,SAAA;AAAA,MACf,oBAAA,CAAqB,uBAAA,CACxB,IAAA,EACA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,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,uBACC,kBAAA,CAAmB,SAAA,EAAW,OAAA,EAAS,WAAA,qBAC1C,aAAA,+BACE,aAAA,+EAGE,eAAA,sCACpB,gCAAA,CACF,SAAA,EACA,OAAA,EACA,WAAA,EACA,YAAA,EACA,SAAA,EACA,WAAA,EACA,gBAAA,EACA,MAAA,EACA,aAAA;EApIqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQV;AAGb;;EAgLE,eAAA,EAAiB,qBAAA,CACf,SAAA,EACA,OAAA,EACA,WAAA,EACA,SAAA,EACA,WAAA,
|
|
1
|
+
{"version":3,"file":"scoped-layout.d.cts","names":[],"sources":["../../../src/create-config/for-resources/scoped-layout.ts"],"mappings":";;;;;;;;;;KA0CY,iCAAA,mBACQ,aAAA,CAAc,kBAAA,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,uBACC,kBAAA,CAAmB,SAAA,EAAW,OAAA,EAAS,WAAA,qBAC1C,aAAA,iDAED,uBAAA,CAAwB,SAAA,EAAW,SAAA,iBACtC,aAAA,IACZ,sBAAA,CAAuB,SAAA,EAAW,OAAA,EAAS,WAAA,EAAa,YAAA;EAC1D,QAAA,EAAU,QAAA;EACV,KAAA,GAAQ,KAAA;EACR,IAAA,GAAO,IAAA;AAAA;AAAA,KAGG,gCAAA,mBACQ,aAAA,CAAc,kBAAA,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,uBACC,kBAAA,CAAmB,SAAA,EAAW,OAAA,EAAS,WAAA,qBAC1C,aAAA,+BACE,aAAA,+EAGE,eAAA,wDAEL,uBAAA,CAAwB,SAAA,EAAW,SAAA,yBAC9B,0BAAA,CACpB,SAAA,EAAW,QAAA,EAAU,aAAA,iBAET,aAAA,mCACc,gBAAA,EAE5B,OAAA,EAAS,iCAAA,CACP,SAAA,EACA,OAAA,EACA,WAAA,EACA,YAAA,EACA,SAAA,EACA,IAAA,EAC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AA,EACA,YAAA,EACA,6BAAA,CAA8B,SAAA,EAAW,YAAA,EAAc,IAAA,GACvD,WAAA,EACA,gBAAA,EACA,MAAA,EACA,aAAA;EAnWA;;;;;;;;;;;;;EAAA,4DAqXwB,uBAAA,CAAwB,SAAA,EAAW,YAAA,GAE3D,OAAA,EAAS,SAAA,GACP,iCAAA,CAAkC,SAAA,EAAW,YAAA,IAC7C,OAAA,CACE,MAAA,CAAO,OAAA,cAAqB,iBAAA,CAAkB,SAAA,cAEhD,MAAA,CAAO,OAAA,OAAc,SAAA,EAAW,iBAAA,CAAkB,SAAA,aACnD,4BAAA,CACD,SAAA,EACA,OAAA,EACA,WAAA,EACA,YAAA,EACA,+BAAA,CAAgC,SAAA,GAChC,WAAA,EACA,gBAAA,EACA,MAAA,EACA,aAAA;AAAA"}
|
|
@@ -74,8 +74,8 @@ type ScopedCreateResourceLayoutFn<Resources extends ReadonlyArray<ResourceDefini
|
|
|
74
74
|
* shared component render function.
|
|
75
75
|
* @returns A component scoped to the selected resources.
|
|
76
76
|
*/
|
|
77
|
-
createComponent: ScopedCreateComponent<Resources, InProps, Composables, Arguments, CustomProps
|
|
78
|
-
createResourceComponents: ScopedCreateResourceComponents<Resources, InProps, Composables, Arguments, CustomProps, {}, {}
|
|
77
|
+
createComponent: ScopedCreateComponent<Resources, InProps, Composables, Arguments, CustomProps, 'default' | Extract<keyof States, string>>; /** Builds one reusable entry for the selected resources. */
|
|
78
|
+
createResourceComponents: ScopedCreateResourceComponents<Resources, InProps, Composables, Arguments, CustomProps, {}, {}, 'default' | Extract<keyof States, string>>;
|
|
79
79
|
forResource: ScopedCreateLayoutForResource<Resources, InProps, Composables, IncludeProps, Arguments, CustomProps, DefaultNamespace, States, DefaultNaming>;
|
|
80
80
|
/**
|
|
81
81
|
* Type-only property containing the target resource union. This property is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoped-layout.d.mts","names":[],"sources":["../../../src/create-config/for-resources/scoped-layout.ts"],"m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,WAAA,
|
|
1
|
+
{"version":3,"file":"scoped-layout.d.mts","names":[],"sources":["../../../src/create-config/for-resources/scoped-layout.ts"],"mappings":";;;;;;;;;;KA0CY,iCAAA,mBACQ,aAAA,CAAc,kBAAA,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,uBACC,kBAAA,CAAmB,SAAA,EAAW,OAAA,EAAS,WAAA,qBAC1C,aAAA,iDAED,uBAAA,CAAwB,SAAA,EAAW,SAAA,iBACtC,aAAA,IACZ,sBAAA,CAAuB,SAAA,EAAW,OAAA,EAAS,WAAA,EAAa,YAAA;EAC1D,QAAA,EAAU,QAAA;EACV,KAAA,GAAQ,KAAA;EACR,IAAA,GAAO,IAAA;AAAA;AAAA,KAGG,gCAAA,mBACQ,aAAA,CAAc,kBAAA,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,uBACC,kBAAA,CAAmB,SAAA,EAAW,OAAA,EAAS,WAAA,qBAC1C,aAAA,+BACE,aAAA,+EAGE,eAAA,wDAEL,uBAAA,CAAwB,SAAA,EAAW,SAAA,yBAC9B,0BAAA,CACpB,SAAA,EAAW,QAAA,EAAU,aAAA,iBAET,aAAA,mCACc,gBAAA,EAE5B,OAAA,EAAS,iCAAA,CACP,SAAA,EACA,OAAA,EACA,WAAA,EACA,YAAA,EACA,SAAA,EACA,IAAA,EACA,QAAA,EACA,KAAA;EACI,SAAA,GAAY,SAAA;AAAA,MACf,oBAAA,CAAqB,uBAAA,CACxB,IAAA,EACA,WAAA,EACA,WAAA,EACA,QAAA,EACA,8BAAA,CACE,mBAAA,CAAoB,SAAA,EAAW,OAAA,EAAS,WAAA,GACxC,YAAA,GAGF,MAAA,EACA,SAAA,EACA,OAAA,GACC,SAAA;AAAA,KAES,6BAAA,mBACQ,aAAA,CAAc,kBAAA,mBAChB,iBAAA,CAAkB,SAAA,uBACd,oBAAA,uBACC,kBAAA,CAAmB,SAAA,EAAW,OAAA,EAAS,WAAA,qBAC1C,aAAA,+BACE,aAAA,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AAA,EACA,WAAA,EACA,YAAA,EACA,+BAAA,CAAgC,SAAA,GAChC,WAAA,EACA,gBAAA,EACA,MAAA,EACA,aAAA;AAAA"}
|
|
@@ -20,7 +20,8 @@ const reservedScopedComponentNames = new Set([
|
|
|
20
20
|
"name",
|
|
21
21
|
"props",
|
|
22
22
|
"prototype",
|
|
23
|
-
"resource"
|
|
23
|
+
"resource",
|
|
24
|
+
"state"
|
|
24
25
|
]);
|
|
25
26
|
/**
|
|
26
27
|
* `$$typeof` tags for object component wrappers that `createElement` accepts
|
|
@@ -58,7 +59,7 @@ function resolveScopedRenderResult(result, props = {}) {
|
|
|
58
59
|
* Runtime counterpart of `ScopedComponentCompoundStaticKey` — keys that must
|
|
59
60
|
* not be treated as compound component statics on a scoped wrapper.
|
|
60
61
|
*/
|
|
61
|
-
const reservedScopedCompoundStaticKeys =
|
|
62
|
+
const reservedScopedCompoundStaticKeys = [
|
|
62
63
|
"apply",
|
|
63
64
|
"arguments",
|
|
64
65
|
"bind",
|
|
@@ -71,12 +72,45 @@ const reservedScopedCompoundStaticKeys = new Set([
|
|
|
71
72
|
"length",
|
|
72
73
|
"name",
|
|
73
74
|
"propTypes",
|
|
75
|
+
"PropTypes",
|
|
74
76
|
"prototype",
|
|
75
77
|
"toLocaleString",
|
|
76
78
|
"toString",
|
|
77
79
|
"valueOf",
|
|
78
80
|
"$$typeof"
|
|
79
|
-
]
|
|
81
|
+
];
|
|
82
|
+
const reservedCompoundKeys = new Set(reservedScopedCompoundStaticKeys);
|
|
83
|
+
const compoundInitials = [
|
|
84
|
+
"A",
|
|
85
|
+
"B",
|
|
86
|
+
"C",
|
|
87
|
+
"D",
|
|
88
|
+
"E",
|
|
89
|
+
"F",
|
|
90
|
+
"G",
|
|
91
|
+
"H",
|
|
92
|
+
"I",
|
|
93
|
+
"J",
|
|
94
|
+
"K",
|
|
95
|
+
"L",
|
|
96
|
+
"M",
|
|
97
|
+
"N",
|
|
98
|
+
"O",
|
|
99
|
+
"P",
|
|
100
|
+
"Q",
|
|
101
|
+
"R",
|
|
102
|
+
"S",
|
|
103
|
+
"T",
|
|
104
|
+
"U",
|
|
105
|
+
"V",
|
|
106
|
+
"W",
|
|
107
|
+
"X",
|
|
108
|
+
"Y",
|
|
109
|
+
"Z"
|
|
110
|
+
];
|
|
111
|
+
function isCompoundName(key) {
|
|
112
|
+
return compoundInitials.some((initial) => key.startsWith(initial));
|
|
113
|
+
}
|
|
80
114
|
/**
|
|
81
115
|
* Exposes compound statics (e.g. `DataTable.Loading`) on a scoped wrapper so
|
|
82
116
|
* runtime matches `ScopedComponentCompoundStatics`.
|
|
@@ -89,7 +123,7 @@ const reservedScopedCompoundStaticKeys = new Set([
|
|
|
89
123
|
*/
|
|
90
124
|
function withScopedCompoundStatics(wrapper, createCompoundStatic) {
|
|
91
125
|
return new Proxy(wrapper, { get(target, property, receiver) {
|
|
92
|
-
if (typeof property
|
|
126
|
+
if (typeof property !== "string" || !isCompoundName(property) || reservedCompoundKeys.has(property) || property in target) return Reflect.get(target, property, receiver);
|
|
93
127
|
const CompoundStatic = createCompoundStatic(property);
|
|
94
128
|
target[property] = CompoundStatic;
|
|
95
129
|
return CompoundStatic;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoped-render.cjs","names":[],"sources":["../../../src/create-config/for-resources/scoped-render.ts"],"sourcesContent":["import {\n createElement,\n isValidElement,\n type ComponentType,\n type JSX,\n type ReactNode,\n} from 'react';\n\n/**\n * Names a scoped component cannot use. Scoped components are attached to\n * function objects, so they collide with the component's own statics and with\n * non-writable `Function.prototype` properties. `__proto__` is reserved so\n * assignment cannot hit the prototype setter on a normal object.\n */\nexport const reservedScopedComponentNames = new Set([\n '__proto__',\n 'apply',\n 'arguments',\n 'bind',\n 'call',\n 'caller',\n 'displayName',\n 'length',\n 'makeComposable',\n 'name',\n 'props',\n 'prototype',\n 'resource',\n]);\n\n/**\n * Values a createComponent / scoped-component `render` may return.\n *\n * Alongside rendered nodes, a component type is allowed — the type constituent\n * of a React element — so factories like `createDataTable(columns)` can be\n * returned directly and mounted with the call-site props.\n *\n * At runtime, `resolveScopedRenderResult` distinguishes component types from\n * nodes (including portals). Getting that wrong mounts a portal via\n * `createElement` and blows up with an invalid-element-type error.\n */\n// Returned components declare their own props; a concrete props parameter would\n// be contravariant and reject the factories callers actually return.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- see above\nexport type ScopedRenderResult = ReactNode | ComponentType<any>;\n\n/**\n * `$$typeof` tags for object component wrappers that `createElement` accepts\n * as `type` (forwardRef, memo, lazy).\n *\n * Do not treat \"any object with `$$typeof`\" as a component: portals also have\n * `$$typeof` (`Symbol.for('react.portal')`) and `isValidElement(portal)` is\n * false, so a naive check would mis-classify them.\n */\nconst reactForwardRefType = Symbol.for('react.forward_ref');\nconst reactMemoType = Symbol.for('react.memo');\nconst reactLazyType = Symbol.for('react.lazy');\n\n/**\n * True when `value` can be passed as the `type` argument to `createElement`.\n *\n * Functions always qualify. Object wrappers qualify only for the forwardRef /\n * memo / lazy tags above — not portals or other React nodes that happen to\n * carry `$$typeof`.\n */\nexport function isRenderableComponentType(\n value: unknown,\n): value is ComponentType<Record<string, unknown>> {\n if (typeof value === 'function') {\n return true;\n }\n\n if (\n typeof value !== 'object' ||\n value === null ||\n Array.isArray(value) ||\n isValidElement(value) ||\n !('$$typeof' in value)\n ) {\n return false;\n }\n\n const typeTag = (value as { $$typeof: unknown }).$$typeof;\n\n return (\n typeTag === reactForwardRefType ||\n typeTag === reactMemoType ||\n typeTag === reactLazyType\n );\n}\n\n/**\n * If `render` returned a component type, mount it with `props`; otherwise\n * return the node as-is (elements, portals, null, etc.).\n */\nexport function resolveScopedRenderResult(\n result: ScopedRenderResult,\n props: Record<string, unknown> = {},\n): JSX.Element {\n if (isRenderableComponentType(result)) {\n return createElement(result, props);\n }\n\n return result as JSX.Element;\n}\n\n/**\n * Runtime counterpart of `ScopedComponentCompoundStaticKey` — keys that must\n * not be treated as compound component statics on a scoped wrapper.\n */\
|
|
1
|
+
{"version":3,"file":"scoped-render.cjs","names":[],"sources":["../../../src/create-config/for-resources/scoped-render.ts"],"sourcesContent":["import {\n createElement,\n isValidElement,\n type ComponentType,\n type JSX,\n type ReactNode,\n} from 'react';\n\n/**\n * Names a scoped component cannot use. Scoped components are attached to\n * function objects, so they collide with the component's own statics and with\n * non-writable `Function.prototype` properties. `__proto__` is reserved so\n * assignment cannot hit the prototype setter on a normal object.\n */\nexport const reservedScopedComponentNames = new Set([\n '__proto__',\n 'apply',\n 'arguments',\n 'bind',\n 'call',\n 'caller',\n 'displayName',\n 'length',\n 'makeComposable',\n 'name',\n 'props',\n 'prototype',\n 'resource',\n 'state',\n]);\n\n/**\n * Values a createComponent / scoped-component `render` may return.\n *\n * Alongside rendered nodes, a component type is allowed — the type constituent\n * of a React element — so factories like `createDataTable(columns)` can be\n * returned directly and mounted with the call-site props.\n *\n * At runtime, `resolveScopedRenderResult` distinguishes component types from\n * nodes (including portals). Getting that wrong mounts a portal via\n * `createElement` and blows up with an invalid-element-type error.\n */\n// Returned components declare their own props; a concrete props parameter would\n// be contravariant and reject the factories callers actually return.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- see above\nexport type ScopedRenderResult = ReactNode | ComponentType<any>;\n\n/**\n * `$$typeof` tags for object component wrappers that `createElement` accepts\n * as `type` (forwardRef, memo, lazy).\n *\n * Do not treat \"any object with `$$typeof`\" as a component: portals also have\n * `$$typeof` (`Symbol.for('react.portal')`) and `isValidElement(portal)` is\n * false, so a naive check would mis-classify them.\n */\nconst reactForwardRefType = Symbol.for('react.forward_ref');\nconst reactMemoType = Symbol.for('react.memo');\nconst reactLazyType = Symbol.for('react.lazy');\n\n/**\n * True when `value` can be passed as the `type` argument to `createElement`.\n *\n * Functions always qualify. Object wrappers qualify only for the forwardRef /\n * memo / lazy tags above — not portals or other React nodes that happen to\n * carry `$$typeof`.\n */\nexport function isRenderableComponentType(\n value: unknown,\n): value is ComponentType<Record<string, unknown>> {\n if (typeof value === 'function') {\n return true;\n }\n\n if (\n typeof value !== 'object' ||\n value === null ||\n Array.isArray(value) ||\n isValidElement(value) ||\n !('$$typeof' in value)\n ) {\n return false;\n }\n\n const typeTag = (value as { $$typeof: unknown }).$$typeof;\n\n return (\n typeTag === reactForwardRefType ||\n typeTag === reactMemoType ||\n typeTag === reactLazyType\n );\n}\n\n/**\n * If `render` returned a component type, mount it with `props`; otherwise\n * return the node as-is (elements, portals, null, etc.).\n */\nexport function resolveScopedRenderResult(\n result: ScopedRenderResult,\n props: Record<string, unknown> = {},\n): JSX.Element {\n if (isRenderableComponentType(result)) {\n return createElement(result, props);\n }\n\n return result as JSX.Element;\n}\n\n/**\n * Runtime counterpart of `ScopedComponentCompoundStaticKey` — keys that must\n * not be treated as compound component statics on a scoped wrapper.\n */\nexport const reservedScopedCompoundStaticKeys = [\n 'apply',\n 'arguments',\n 'bind',\n 'call',\n 'caller',\n 'childContextTypes',\n 'contextTypes',\n 'defaultProps',\n 'displayName',\n 'length',\n 'name',\n 'propTypes',\n 'PropTypes',\n 'prototype',\n 'toLocaleString',\n 'toString',\n 'valueOf',\n '$$typeof',\n] as const;\n\nconst reservedCompoundKeys = new Set<PropertyKey>(reservedScopedCompoundStaticKeys);\n\nconst compoundInitials = [\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n] as const;\n\nexport type ScopedCompoundName = `${typeof compoundInitials[number]}${string}`;\n\nfunction isCompoundName(key: string): key is ScopedCompoundName {\n return compoundInitials.some((initial) => key.startsWith(initial));\n}\n\ntype ScopedComponentWrapper = ((\n props?: Record<string, unknown>,\n) => JSX.Element) &\n Record<string, unknown>;\n\n/**\n * Exposes compound statics (e.g. `DataTable.Loading`) on a scoped wrapper so\n * runtime matches `ScopedComponentCompoundStatics`.\n *\n * Why a Proxy: JSX reads `components.DataTable.Loading` while building the\n * element tree — before `DataTable` itself renders — so statics cannot be\n * copied only after the first `render` call. Property access lazily creates a\n * stable wrapper component that re-runs the scoped `render` under context and\n * mounts the matching static from the returned component type.\n */\nexport function withScopedCompoundStatics(\n wrapper: (props?: Record<string, unknown>) => JSX.Element,\n createCompoundStatic: (\n staticName: string,\n ) => (ownProps?: Record<string, unknown>) => JSX.Element,\n): ScopedComponentWrapper {\n return new Proxy(wrapper as ScopedComponentWrapper, {\n get(target, property, receiver) {\n if (\n typeof property !== 'string' ||\n !isCompoundName(property) ||\n reservedCompoundKeys.has(property) ||\n property in target\n ) {\n return Reflect.get(target, property, receiver);\n }\n\n // Cache on the target so repeated `.Loading` access keeps one identity.\n const CompoundStatic = createCompoundStatic(property);\n target[property] = CompoundStatic;\n return CompoundStatic;\n },\n });\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,+BAA+B,IAAI,IAAI;CAClD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;;AA0BD,MAAM,sBAAsB,OAAO,IAAI,mBAAmB;AAC1D,MAAM,gBAAgB,OAAO,IAAI,YAAY;AAC7C,MAAM,gBAAgB,OAAO,IAAI,YAAY;;;;;;;;AAS7C,SAAgB,0BACd,OACiD;CACjD,IAAI,OAAO,UAAU,YACnB,OAAO;CAGT,IACE,OAAO,UAAU,YACjB,UAAU,QACV,MAAM,QAAQ,KAAK,+BACJ,KAAK,KACpB,EAAE,cAAc,QAEhB,OAAO;CAGT,MAAM,UAAW,MAAgC;CAEjD,OACE,YAAY,uBACZ,YAAY,iBACZ,YAAY;AAEhB;;;;;AAMA,SAAgB,0BACd,QACA,QAAiC,CAAC,GACrB;CACb,IAAI,0BAA0B,MAAM,GAClC,gCAAqB,QAAQ,KAAK;CAGpC,OAAO;AACT;;;;;AAMA,MAAa,mCAAmC;CAC9C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,uBAAuB,IAAI,IAAiB,gCAAgC;AAElF,MAAM,mBAAmB;CACvB;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAC5D;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;AAC9D;AAIA,SAAS,eAAe,KAAwC;CAC9D,OAAO,iBAAiB,MAAM,YAAY,IAAI,WAAW,OAAO,CAAC;AACnE;;;;;;;;;;;AAiBA,SAAgB,0BACd,SACA,sBAGwB;CACxB,OAAO,IAAI,MAAM,SAAmC,EAClD,IAAI,QAAQ,UAAU,UAAU;EAC9B,IACE,OAAO,aAAa,YACpB,CAAC,eAAe,QAAQ,KACxB,qBAAqB,IAAI,QAAQ,KACjC,YAAY,QAEZ,OAAO,QAAQ,IAAI,QAAQ,UAAU,QAAQ;EAI/C,MAAM,iBAAiB,qBAAqB,QAAQ;EACpD,OAAO,YAAY;EACnB,OAAO;CACT,EACF,CAAC;AACH"}
|
|
@@ -13,6 +13,13 @@ import { ComponentType, JSX, ReactNode } from "react";
|
|
|
13
13
|
* `createElement` and blows up with an invalid-element-type error.
|
|
14
14
|
*/
|
|
15
15
|
type ScopedRenderResult = ReactNode | ComponentType<any>;
|
|
16
|
+
/**
|
|
17
|
+
* Runtime counterpart of `ScopedComponentCompoundStaticKey` — keys that must
|
|
18
|
+
* not be treated as compound component statics on a scoped wrapper.
|
|
19
|
+
*/
|
|
20
|
+
declare const reservedScopedCompoundStaticKeys: readonly ["apply", "arguments", "bind", "call", "caller", "childContextTypes", "contextTypes", "defaultProps", "displayName", "length", "name", "propTypes", "PropTypes", "prototype", "toLocaleString", "toString", "valueOf", "$$typeof"];
|
|
21
|
+
declare const compoundInitials: readonly ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
|
|
22
|
+
type ScopedCompoundName = `${typeof compoundInitials[number]}${string}`;
|
|
16
23
|
//#endregion
|
|
17
|
-
export { ScopedRenderResult };
|
|
24
|
+
export { ScopedCompoundName, ScopedRenderResult, reservedScopedCompoundStaticKeys };
|
|
18
25
|
//# sourceMappingURL=scoped-render.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoped-render.d.cts","names":[],"sources":["../../../src/create-config/for-resources/scoped-render.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"scoped-render.d.cts","names":[],"sources":["../../../src/create-config/for-resources/scoped-render.ts"],"mappings":";;;AA+GA;;;;AAmBU;AAAC;;;;AAOD;AAEV;AA5BA,KAlEY,kBAAA,GAAqB,SAAA,GAAY,aAAa;;;;;cAkE7C,gCAAA;AAAA,cAuBP,gBAAA;AAAA,KAKM,kBAAA,aAA+B,gBAAgB"}
|
|
@@ -13,6 +13,13 @@ import { ComponentType, JSX, ReactNode } from "react";
|
|
|
13
13
|
* `createElement` and blows up with an invalid-element-type error.
|
|
14
14
|
*/
|
|
15
15
|
type ScopedRenderResult = ReactNode | ComponentType<any>;
|
|
16
|
+
/**
|
|
17
|
+
* Runtime counterpart of `ScopedComponentCompoundStaticKey` — keys that must
|
|
18
|
+
* not be treated as compound component statics on a scoped wrapper.
|
|
19
|
+
*/
|
|
20
|
+
declare const reservedScopedCompoundStaticKeys: readonly ["apply", "arguments", "bind", "call", "caller", "childContextTypes", "contextTypes", "defaultProps", "displayName", "length", "name", "propTypes", "PropTypes", "prototype", "toLocaleString", "toString", "valueOf", "$$typeof"];
|
|
21
|
+
declare const compoundInitials: readonly ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"];
|
|
22
|
+
type ScopedCompoundName = `${typeof compoundInitials[number]}${string}`;
|
|
16
23
|
//#endregion
|
|
17
|
-
export { ScopedRenderResult };
|
|
24
|
+
export { ScopedCompoundName, ScopedRenderResult, reservedScopedCompoundStaticKeys };
|
|
18
25
|
//# sourceMappingURL=scoped-render.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoped-render.d.mts","names":[],"sources":["../../../src/create-config/for-resources/scoped-render.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"scoped-render.d.mts","names":[],"sources":["../../../src/create-config/for-resources/scoped-render.ts"],"mappings":";;;AA+GA;;;;AAmBU;AAAC;;;;AAOD;AAEV;AA5BA,KAlEY,kBAAA,GAAqB,SAAA,GAAY,aAAa;;;;;cAkE7C,gCAAA;AAAA,cAuBP,gBAAA;AAAA,KAKM,kBAAA,aAA+B,gBAAgB"}
|
|
@@ -20,7 +20,8 @@ const reservedScopedComponentNames = new Set([
|
|
|
20
20
|
"name",
|
|
21
21
|
"props",
|
|
22
22
|
"prototype",
|
|
23
|
-
"resource"
|
|
23
|
+
"resource",
|
|
24
|
+
"state"
|
|
24
25
|
]);
|
|
25
26
|
/**
|
|
26
27
|
* `$$typeof` tags for object component wrappers that `createElement` accepts
|
|
@@ -58,7 +59,7 @@ function resolveScopedRenderResult(result, props = {}) {
|
|
|
58
59
|
* Runtime counterpart of `ScopedComponentCompoundStaticKey` — keys that must
|
|
59
60
|
* not be treated as compound component statics on a scoped wrapper.
|
|
60
61
|
*/
|
|
61
|
-
const reservedScopedCompoundStaticKeys =
|
|
62
|
+
const reservedScopedCompoundStaticKeys = [
|
|
62
63
|
"apply",
|
|
63
64
|
"arguments",
|
|
64
65
|
"bind",
|
|
@@ -71,12 +72,45 @@ const reservedScopedCompoundStaticKeys = new Set([
|
|
|
71
72
|
"length",
|
|
72
73
|
"name",
|
|
73
74
|
"propTypes",
|
|
75
|
+
"PropTypes",
|
|
74
76
|
"prototype",
|
|
75
77
|
"toLocaleString",
|
|
76
78
|
"toString",
|
|
77
79
|
"valueOf",
|
|
78
80
|
"$$typeof"
|
|
79
|
-
]
|
|
81
|
+
];
|
|
82
|
+
const reservedCompoundKeys = new Set(reservedScopedCompoundStaticKeys);
|
|
83
|
+
const compoundInitials = [
|
|
84
|
+
"A",
|
|
85
|
+
"B",
|
|
86
|
+
"C",
|
|
87
|
+
"D",
|
|
88
|
+
"E",
|
|
89
|
+
"F",
|
|
90
|
+
"G",
|
|
91
|
+
"H",
|
|
92
|
+
"I",
|
|
93
|
+
"J",
|
|
94
|
+
"K",
|
|
95
|
+
"L",
|
|
96
|
+
"M",
|
|
97
|
+
"N",
|
|
98
|
+
"O",
|
|
99
|
+
"P",
|
|
100
|
+
"Q",
|
|
101
|
+
"R",
|
|
102
|
+
"S",
|
|
103
|
+
"T",
|
|
104
|
+
"U",
|
|
105
|
+
"V",
|
|
106
|
+
"W",
|
|
107
|
+
"X",
|
|
108
|
+
"Y",
|
|
109
|
+
"Z"
|
|
110
|
+
];
|
|
111
|
+
function isCompoundName(key) {
|
|
112
|
+
return compoundInitials.some((initial) => key.startsWith(initial));
|
|
113
|
+
}
|
|
80
114
|
/**
|
|
81
115
|
* Exposes compound statics (e.g. `DataTable.Loading`) on a scoped wrapper so
|
|
82
116
|
* runtime matches `ScopedComponentCompoundStatics`.
|
|
@@ -89,7 +123,7 @@ const reservedScopedCompoundStaticKeys = new Set([
|
|
|
89
123
|
*/
|
|
90
124
|
function withScopedCompoundStatics(wrapper, createCompoundStatic) {
|
|
91
125
|
return new Proxy(wrapper, { get(target, property, receiver) {
|
|
92
|
-
if (typeof property
|
|
126
|
+
if (typeof property !== "string" || !isCompoundName(property) || reservedCompoundKeys.has(property) || property in target) return Reflect.get(target, property, receiver);
|
|
93
127
|
const CompoundStatic = createCompoundStatic(property);
|
|
94
128
|
target[property] = CompoundStatic;
|
|
95
129
|
return CompoundStatic;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoped-render.mjs","names":[],"sources":["../../../src/create-config/for-resources/scoped-render.ts"],"sourcesContent":["import {\n createElement,\n isValidElement,\n type ComponentType,\n type JSX,\n type ReactNode,\n} from 'react';\n\n/**\n * Names a scoped component cannot use. Scoped components are attached to\n * function objects, so they collide with the component's own statics and with\n * non-writable `Function.prototype` properties. `__proto__` is reserved so\n * assignment cannot hit the prototype setter on a normal object.\n */\nexport const reservedScopedComponentNames = new Set([\n '__proto__',\n 'apply',\n 'arguments',\n 'bind',\n 'call',\n 'caller',\n 'displayName',\n 'length',\n 'makeComposable',\n 'name',\n 'props',\n 'prototype',\n 'resource',\n]);\n\n/**\n * Values a createComponent / scoped-component `render` may return.\n *\n * Alongside rendered nodes, a component type is allowed — the type constituent\n * of a React element — so factories like `createDataTable(columns)` can be\n * returned directly and mounted with the call-site props.\n *\n * At runtime, `resolveScopedRenderResult` distinguishes component types from\n * nodes (including portals). Getting that wrong mounts a portal via\n * `createElement` and blows up with an invalid-element-type error.\n */\n// Returned components declare their own props; a concrete props parameter would\n// be contravariant and reject the factories callers actually return.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- see above\nexport type ScopedRenderResult = ReactNode | ComponentType<any>;\n\n/**\n * `$$typeof` tags for object component wrappers that `createElement` accepts\n * as `type` (forwardRef, memo, lazy).\n *\n * Do not treat \"any object with `$$typeof`\" as a component: portals also have\n * `$$typeof` (`Symbol.for('react.portal')`) and `isValidElement(portal)` is\n * false, so a naive check would mis-classify them.\n */\nconst reactForwardRefType = Symbol.for('react.forward_ref');\nconst reactMemoType = Symbol.for('react.memo');\nconst reactLazyType = Symbol.for('react.lazy');\n\n/**\n * True when `value` can be passed as the `type` argument to `createElement`.\n *\n * Functions always qualify. Object wrappers qualify only for the forwardRef /\n * memo / lazy tags above — not portals or other React nodes that happen to\n * carry `$$typeof`.\n */\nexport function isRenderableComponentType(\n value: unknown,\n): value is ComponentType<Record<string, unknown>> {\n if (typeof value === 'function') {\n return true;\n }\n\n if (\n typeof value !== 'object' ||\n value === null ||\n Array.isArray(value) ||\n isValidElement(value) ||\n !('$$typeof' in value)\n ) {\n return false;\n }\n\n const typeTag = (value as { $$typeof: unknown }).$$typeof;\n\n return (\n typeTag === reactForwardRefType ||\n typeTag === reactMemoType ||\n typeTag === reactLazyType\n );\n}\n\n/**\n * If `render` returned a component type, mount it with `props`; otherwise\n * return the node as-is (elements, portals, null, etc.).\n */\nexport function resolveScopedRenderResult(\n result: ScopedRenderResult,\n props: Record<string, unknown> = {},\n): JSX.Element {\n if (isRenderableComponentType(result)) {\n return createElement(result, props);\n }\n\n return result as JSX.Element;\n}\n\n/**\n * Runtime counterpart of `ScopedComponentCompoundStaticKey` — keys that must\n * not be treated as compound component statics on a scoped wrapper.\n */\
|
|
1
|
+
{"version":3,"file":"scoped-render.mjs","names":[],"sources":["../../../src/create-config/for-resources/scoped-render.ts"],"sourcesContent":["import {\n createElement,\n isValidElement,\n type ComponentType,\n type JSX,\n type ReactNode,\n} from 'react';\n\n/**\n * Names a scoped component cannot use. Scoped components are attached to\n * function objects, so they collide with the component's own statics and with\n * non-writable `Function.prototype` properties. `__proto__` is reserved so\n * assignment cannot hit the prototype setter on a normal object.\n */\nexport const reservedScopedComponentNames = new Set([\n '__proto__',\n 'apply',\n 'arguments',\n 'bind',\n 'call',\n 'caller',\n 'displayName',\n 'length',\n 'makeComposable',\n 'name',\n 'props',\n 'prototype',\n 'resource',\n 'state',\n]);\n\n/**\n * Values a createComponent / scoped-component `render` may return.\n *\n * Alongside rendered nodes, a component type is allowed — the type constituent\n * of a React element — so factories like `createDataTable(columns)` can be\n * returned directly and mounted with the call-site props.\n *\n * At runtime, `resolveScopedRenderResult` distinguishes component types from\n * nodes (including portals). Getting that wrong mounts a portal via\n * `createElement` and blows up with an invalid-element-type error.\n */\n// Returned components declare their own props; a concrete props parameter would\n// be contravariant and reject the factories callers actually return.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- see above\nexport type ScopedRenderResult = ReactNode | ComponentType<any>;\n\n/**\n * `$$typeof` tags for object component wrappers that `createElement` accepts\n * as `type` (forwardRef, memo, lazy).\n *\n * Do not treat \"any object with `$$typeof`\" as a component: portals also have\n * `$$typeof` (`Symbol.for('react.portal')`) and `isValidElement(portal)` is\n * false, so a naive check would mis-classify them.\n */\nconst reactForwardRefType = Symbol.for('react.forward_ref');\nconst reactMemoType = Symbol.for('react.memo');\nconst reactLazyType = Symbol.for('react.lazy');\n\n/**\n * True when `value` can be passed as the `type` argument to `createElement`.\n *\n * Functions always qualify. Object wrappers qualify only for the forwardRef /\n * memo / lazy tags above — not portals or other React nodes that happen to\n * carry `$$typeof`.\n */\nexport function isRenderableComponentType(\n value: unknown,\n): value is ComponentType<Record<string, unknown>> {\n if (typeof value === 'function') {\n return true;\n }\n\n if (\n typeof value !== 'object' ||\n value === null ||\n Array.isArray(value) ||\n isValidElement(value) ||\n !('$$typeof' in value)\n ) {\n return false;\n }\n\n const typeTag = (value as { $$typeof: unknown }).$$typeof;\n\n return (\n typeTag === reactForwardRefType ||\n typeTag === reactMemoType ||\n typeTag === reactLazyType\n );\n}\n\n/**\n * If `render` returned a component type, mount it with `props`; otherwise\n * return the node as-is (elements, portals, null, etc.).\n */\nexport function resolveScopedRenderResult(\n result: ScopedRenderResult,\n props: Record<string, unknown> = {},\n): JSX.Element {\n if (isRenderableComponentType(result)) {\n return createElement(result, props);\n }\n\n return result as JSX.Element;\n}\n\n/**\n * Runtime counterpart of `ScopedComponentCompoundStaticKey` — keys that must\n * not be treated as compound component statics on a scoped wrapper.\n */\nexport const reservedScopedCompoundStaticKeys = [\n 'apply',\n 'arguments',\n 'bind',\n 'call',\n 'caller',\n 'childContextTypes',\n 'contextTypes',\n 'defaultProps',\n 'displayName',\n 'length',\n 'name',\n 'propTypes',\n 'PropTypes',\n 'prototype',\n 'toLocaleString',\n 'toString',\n 'valueOf',\n '$$typeof',\n] as const;\n\nconst reservedCompoundKeys = new Set<PropertyKey>(reservedScopedCompoundStaticKeys);\n\nconst compoundInitials = [\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n] as const;\n\nexport type ScopedCompoundName = `${typeof compoundInitials[number]}${string}`;\n\nfunction isCompoundName(key: string): key is ScopedCompoundName {\n return compoundInitials.some((initial) => key.startsWith(initial));\n}\n\ntype ScopedComponentWrapper = ((\n props?: Record<string, unknown>,\n) => JSX.Element) &\n Record<string, unknown>;\n\n/**\n * Exposes compound statics (e.g. `DataTable.Loading`) on a scoped wrapper so\n * runtime matches `ScopedComponentCompoundStatics`.\n *\n * Why a Proxy: JSX reads `components.DataTable.Loading` while building the\n * element tree — before `DataTable` itself renders — so statics cannot be\n * copied only after the first `render` call. Property access lazily creates a\n * stable wrapper component that re-runs the scoped `render` under context and\n * mounts the matching static from the returned component type.\n */\nexport function withScopedCompoundStatics(\n wrapper: (props?: Record<string, unknown>) => JSX.Element,\n createCompoundStatic: (\n staticName: string,\n ) => (ownProps?: Record<string, unknown>) => JSX.Element,\n): ScopedComponentWrapper {\n return new Proxy(wrapper as ScopedComponentWrapper, {\n get(target, property, receiver) {\n if (\n typeof property !== 'string' ||\n !isCompoundName(property) ||\n reservedCompoundKeys.has(property) ||\n property in target\n ) {\n return Reflect.get(target, property, receiver);\n }\n\n // Cache on the target so repeated `.Loading` access keeps one identity.\n const CompoundStatic = createCompoundStatic(property);\n target[property] = CompoundStatic;\n return CompoundStatic;\n },\n });\n}\n"],"mappings":";;;;;;;;;AAcA,MAAa,+BAA+B,IAAI,IAAI;CAClD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;;AA0BD,MAAM,sBAAsB,OAAO,IAAI,mBAAmB;AAC1D,MAAM,gBAAgB,OAAO,IAAI,YAAY;AAC7C,MAAM,gBAAgB,OAAO,IAAI,YAAY;;;;;;;;AAS7C,SAAgB,0BACd,OACiD;CACjD,IAAI,OAAO,UAAU,YACnB,OAAO;CAGT,IACE,OAAO,UAAU,YACjB,UAAU,QACV,MAAM,QAAQ,KAAK,KACnB,eAAe,KAAK,KACpB,EAAE,cAAc,QAEhB,OAAO;CAGT,MAAM,UAAW,MAAgC;CAEjD,OACE,YAAY,uBACZ,YAAY,iBACZ,YAAY;AAEhB;;;;;AAMA,SAAgB,0BACd,QACA,QAAiC,CAAC,GACrB;CACb,IAAI,0BAA0B,MAAM,GAClC,OAAO,cAAc,QAAQ,KAAK;CAGpC,OAAO;AACT;;;;;AAMA,MAAa,mCAAmC;CAC9C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAEA,MAAM,uBAAuB,IAAI,IAAiB,gCAAgC;AAElF,MAAM,mBAAmB;CACvB;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAC5D;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;CAAK;AAC9D;AAIA,SAAS,eAAe,KAAwC;CAC9D,OAAO,iBAAiB,MAAM,YAAY,IAAI,WAAW,OAAO,CAAC;AACnE;;;;;;;;;;;AAiBA,SAAgB,0BACd,SACA,sBAGwB;CACxB,OAAO,IAAI,MAAM,SAAmC,EAClD,IAAI,QAAQ,UAAU,UAAU;EAC9B,IACE,OAAO,aAAa,YACpB,CAAC,eAAe,QAAQ,KACxB,qBAAqB,IAAI,QAAQ,KACjC,YAAY,QAEZ,OAAO,QAAQ,IAAI,QAAQ,UAAU,QAAQ;EAI/C,MAAM,iBAAiB,qBAAqB,QAAQ;EACpD,OAAO,YAAY;EACnB,OAAO;CACT,EACF,CAAC;AACH"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LazyResourceErrorComponent, LazyResourceLoadingComponent, LazyResourceStates } from "../lazy/types.cjs";
|
|
2
2
|
import { AsStateComposable, StateComposable, StateComposableOptions } from "./state-composable.cjs";
|
|
3
|
-
import { AnyRenderStateDefinition, CreateLayoutBuildingBlocks, CreateLayoutBuildingBlocksArguments, CreateLayoutBuildingBlocksResult, CreateRenderState, CreateRenderStateBuilderArguments, CreateRenderStateBuilderResult, CreateRenderStateFromState, DeferredRenderState, DefineLayoutComposables, LayoutComposablesDefinition, LazyRenderState, RenderStateCallProps, RenderStateCallback, RenderStateComposablesDefinition, RenderStateContext, RenderStateFragment, RenderStateName, RenderStateOverloads, RenderStateProps, RenderStateReferences, TypedRenderStateCallback } from "./render-state.cjs";
|
|
3
|
+
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 "./render-state.cjs";
|
|
4
4
|
import { BaseResourceConfigComponents, ResourceConfig, ResourceConfigComponentKey, ResourceConfigComponents, ResourceConfigInput, ResourceConfigMap, SharedResourceConfigOptions, SubResourceConfig, SubResourceConfigComponentsFor } from "./types.cjs";
|
|
5
5
|
import { ComponentPathVariable, ExtractPathVariables, PATH_VARIABLE_IDENTIFIER, PathHasVariables, PathVariable, ResourcePathVariable, SubResourcePathVariable } from "./paths/variables.cjs";
|
|
6
6
|
import { ConfigResourceKeys, ConfigSubResourceKeys, ParameterizedEntryPath, ParameterizedResourcePath, PathComponentKeys, PathResourceCandidates, PathSubResourceKeys, PathVariables, PathVariablesForResource, ResolveParameterizedPathValue, ResourceSubResourceKeys } from "./paths/types.cjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LazyResourceErrorComponent, LazyResourceLoadingComponent, LazyResourceStates } from "../lazy/types.mjs";
|
|
2
2
|
import { AsStateComposable, StateComposable, StateComposableOptions } from "./state-composable.mjs";
|
|
3
|
-
import { AnyRenderStateDefinition, CreateLayoutBuildingBlocks, CreateLayoutBuildingBlocksArguments, CreateLayoutBuildingBlocksResult, CreateRenderState, CreateRenderStateBuilderArguments, CreateRenderStateBuilderResult, CreateRenderStateFromState, DeferredRenderState, DefineLayoutComposables, LayoutComposablesDefinition, LazyRenderState, RenderStateCallProps, RenderStateCallback, RenderStateComposablesDefinition, RenderStateContext, RenderStateFragment, RenderStateName, RenderStateOverloads, RenderStateProps, RenderStateReferences, TypedRenderStateCallback } from "./render-state.mjs";
|
|
3
|
+
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 "./render-state.mjs";
|
|
4
4
|
import { BaseResourceConfigComponents, ResourceConfig, ResourceConfigComponentKey, ResourceConfigComponents, ResourceConfigInput, ResourceConfigMap, SharedResourceConfigOptions, SubResourceConfig, SubResourceConfigComponentsFor } from "./types.mjs";
|
|
5
5
|
import { ComponentPathVariable, ExtractPathVariables, PATH_VARIABLE_IDENTIFIER, PathHasVariables, PathVariable, ResourcePathVariable, SubResourcePathVariable } from "./paths/variables.mjs";
|
|
6
6
|
import { ConfigResourceKeys, ConfigSubResourceKeys, ParameterizedEntryPath, ParameterizedResourcePath, PathComponentKeys, PathResourceCandidates, PathSubResourceKeys, PathVariables, PathVariablesForResource, ResolveParameterizedPathValue, ResourceSubResourceKeys } from "./paths/types.mjs";
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
let react = require("react");
|
|
2
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
3
|
+
|
|
4
|
+
//#region src/create-config/render-state-context.tsx
|
|
5
|
+
/** Active state for descendants, including scoped components. */
|
|
6
|
+
const RenderStateNameContext = (0, react.createContext)("default");
|
|
7
|
+
/** Only state references carry the caller's name into another state's layout. */
|
|
8
|
+
const ReferencedRenderStateContext = (0, react.createContext)(void 0);
|
|
9
|
+
/** Automatic fallbacks start their own state instead of inheriting a reference. */
|
|
10
|
+
function RenderStateFallback({ state, children }) {
|
|
11
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ReferencedRenderStateContext.Provider, {
|
|
12
|
+
value: void 0,
|
|
13
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RenderStateNameContext.Provider, {
|
|
14
|
+
value: state,
|
|
15
|
+
children
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
exports.ReferencedRenderStateContext = ReferencedRenderStateContext;
|
|
22
|
+
exports.RenderStateFallback = RenderStateFallback;
|
|
23
|
+
exports.RenderStateNameContext = RenderStateNameContext;
|
|
24
|
+
//# sourceMappingURL=render-state-context.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-state-context.cjs","names":[],"sources":["../../src/create-config/render-state-context.tsx"],"sourcesContent":["import { createContext } from 'react';\n\n/** Active state for descendants, including scoped components. */\nexport const RenderStateNameContext = createContext<string>('default');\n\n/** Only state references carry the caller's name into another state's layout. */\nexport const ReferencedRenderStateContext = createContext<string | undefined>(\n undefined,\n);\n\n/** Automatic fallbacks start their own state instead of inheriting a reference. */\nexport function RenderStateFallback({\n state,\n children,\n}: {\n state: 'Loading' | 'Error';\n children: import('react').ReactNode;\n}) {\n return (\n <ReferencedRenderStateContext.Provider value={undefined}>\n <RenderStateNameContext.Provider value={state}>\n {children}\n </RenderStateNameContext.Provider>\n </ReferencedRenderStateContext.Provider>\n );\n}\n"],"mappings":";;;;;AAGA,MAAa,kDAA+C,SAAS;;AAGrE,MAAa,wDACX,MACF;;AAGA,SAAgB,oBAAoB,EAClC,OACA,YAIC;CACD,OACE,2CAAC,6BAA6B,UAA9B;EAAuC,OAAO;YAC5C,2CAAC,uBAAuB,UAAxB;GAAiC,OAAO;GACrC;EAC8B;CACI;AAE3C"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
|
|
4
|
+
//#region src/create-config/render-state-context.tsx
|
|
5
|
+
/** Active state for descendants, including scoped components. */
|
|
6
|
+
const RenderStateNameContext = createContext("default");
|
|
7
|
+
/** Only state references carry the caller's name into another state's layout. */
|
|
8
|
+
const ReferencedRenderStateContext = createContext(void 0);
|
|
9
|
+
/** Automatic fallbacks start their own state instead of inheriting a reference. */
|
|
10
|
+
function RenderStateFallback({ state, children }) {
|
|
11
|
+
return /* @__PURE__ */ jsx(ReferencedRenderStateContext.Provider, {
|
|
12
|
+
value: void 0,
|
|
13
|
+
children: /* @__PURE__ */ jsx(RenderStateNameContext.Provider, {
|
|
14
|
+
value: state,
|
|
15
|
+
children
|
|
16
|
+
})
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
//#endregion
|
|
21
|
+
export { ReferencedRenderStateContext, RenderStateFallback, RenderStateNameContext };
|
|
22
|
+
//# sourceMappingURL=render-state-context.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-state-context.mjs","names":[],"sources":["../../src/create-config/render-state-context.tsx"],"sourcesContent":["import { createContext } from 'react';\n\n/** Active state for descendants, including scoped components. */\nexport const RenderStateNameContext = createContext<string>('default');\n\n/** Only state references carry the caller's name into another state's layout. */\nexport const ReferencedRenderStateContext = createContext<string | undefined>(\n undefined,\n);\n\n/** Automatic fallbacks start their own state instead of inheriting a reference. */\nexport function RenderStateFallback({\n state,\n children,\n}: {\n state: 'Loading' | 'Error';\n children: import('react').ReactNode;\n}) {\n return (\n <ReferencedRenderStateContext.Provider value={undefined}>\n <RenderStateNameContext.Provider value={state}>\n {children}\n </RenderStateNameContext.Provider>\n </ReferencedRenderStateContext.Provider>\n );\n}\n"],"mappings":";;;;;AAGA,MAAa,yBAAyB,cAAsB,SAAS;;AAGrE,MAAa,+BAA+B,cAC1C,MACF;;AAGA,SAAgB,oBAAoB,EAClC,OACA,YAIC;CACD,OACE,oBAAC,6BAA6B,UAA9B;EAAuC,OAAO;YAC5C,oBAAC,uBAAuB,UAAxB;GAAiC,OAAO;GACrC;EAC8B;CACI;AAE3C"}
|
|
@@ -45,6 +45,7 @@ function createRenderStateBuilder(_arguments, environment) {
|
|
|
45
45
|
[_jfdevelops_react_layout_devtools_core.layoutDebug]: debug
|
|
46
46
|
} : definition);
|
|
47
47
|
}
|
|
48
|
+
createRenderState.forStates = (..._states) => createRenderState;
|
|
48
49
|
createRenderState.fromState = (input) => {
|
|
49
50
|
const entry = isLazyRenderState(input.ref) ? input.ref : Object.values(input.ref)[0];
|
|
50
51
|
if (isLazyRenderState(entry)) {
|