@contember/react-multipass-rendering 1.3.0-alpha.7 → 1.3.0-alpha.9
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/development/ChildrenAnalyzer.cjs +3 -3
- package/dist/development/ChildrenAnalyzer.cjs.map +1 -1
- package/dist/development/ChildrenAnalyzer.js +3 -3
- package/dist/development/ChildrenAnalyzer.js.map +1 -1
- package/dist/development/helpers/wrapError.cjs.map +1 -1
- package/dist/development/helpers/wrapError.js.map +1 -1
- package/dist/development/nodeSpecs/BranchNode.cjs +3 -3
- package/dist/development/nodeSpecs/BranchNode.cjs.map +1 -1
- package/dist/development/nodeSpecs/BranchNode.js +3 -3
- package/dist/development/nodeSpecs/BranchNode.js.map +1 -1
- package/dist/production/ChildrenAnalyzer.cjs +3 -3
- package/dist/production/ChildrenAnalyzer.cjs.map +1 -1
- package/dist/production/ChildrenAnalyzer.js +3 -3
- package/dist/production/ChildrenAnalyzer.js.map +1 -1
- package/dist/production/helpers/wrapError.cjs.map +1 -1
- package/dist/production/helpers/wrapError.js.map +1 -1
- package/dist/production/nodeSpecs/BranchNode.cjs +3 -3
- package/dist/production/nodeSpecs/BranchNode.cjs.map +1 -1
- package/dist/production/nodeSpecs/BranchNode.js +3 -3
- package/dist/production/nodeSpecs/BranchNode.js.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -10,7 +10,7 @@ const utilities = require("@contember/utilities");
|
|
|
10
10
|
const ChildrenAnalyzerError = require("./ChildrenAnalyzerError.cjs");
|
|
11
11
|
const wrapError = require("./helpers/wrapError.cjs");
|
|
12
12
|
const getErrorMessage = require("./helpers/getErrorMessage.cjs");
|
|
13
|
-
const _ChildrenAnalyzer = class {
|
|
13
|
+
const _ChildrenAnalyzer = class _ChildrenAnalyzer {
|
|
14
14
|
constructor(leaves, decider = [], options = {}) {
|
|
15
15
|
__publicField(this, "leaves");
|
|
16
16
|
__publicField(this, "branchNodes");
|
|
@@ -157,8 +157,7 @@ const _ChildrenAnalyzer = class {
|
|
|
157
157
|
return processedChildren;
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
|
-
|
|
161
|
-
__publicField(ChildrenAnalyzer, "defaultOptions", {
|
|
160
|
+
__publicField(_ChildrenAnalyzer, "defaultOptions", {
|
|
162
161
|
ignoreRenderProps: true,
|
|
163
162
|
renderPropsErrorMessage: "Render props (functions as React component children) are not supported.",
|
|
164
163
|
ignoreUnhandledNodes: true,
|
|
@@ -166,5 +165,6 @@ __publicField(ChildrenAnalyzer, "defaultOptions", {
|
|
|
166
165
|
staticContextFactoryName: "getStaticContext",
|
|
167
166
|
staticRenderFactoryName: "staticRender"
|
|
168
167
|
});
|
|
168
|
+
let ChildrenAnalyzer = _ChildrenAnalyzer;
|
|
169
169
|
exports.ChildrenAnalyzer = ChildrenAnalyzer;
|
|
170
170
|
//# sourceMappingURL=ChildrenAnalyzer.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChildrenAnalyzer.cjs","sources":["../../src/ChildrenAnalyzer.ts"],"sourcesContent":["import { assertNever } from '@contember/utilities'\nimport type { ElementType, ReactElement, ReactNode } from 'react'\nimport type { BranchNodeList } from './BranchNodeList'\nimport { ChildrenAnalyzerError } from './ChildrenAnalyzerError'\nimport type { ChildrenAnalyzerOptions } from './ChildrenAnalyzerOptions'\nimport type { LeafList } from './LeafList'\nimport { getErrorMessage } from './helpers'\nimport { wrapError } from './helpers/wrapError'\nimport type {\n\tDeclarationSiteNodeRepresentationFactory,\n\tRawNodeRepresentation,\n\tStaticContextFactory,\n\tSyntheticChildrenFactory,\n\tUnconstrainedLeafRepresentationFactory,\n\tValidFactoryName,\n} from './nodeSpecs'\n\nexport class ChildrenAnalyzer<\n\tAllLeavesRepresentation = any,\n\tAllBranchNodesRepresentation = never,\n\tStaticContext = undefined,\n> {\n\tprivate static defaultOptions: ChildrenAnalyzerOptions = {\n\t\tignoreRenderProps: true,\n\t\trenderPropsErrorMessage: 'Render props (functions as React component children) are not supported.',\n\n\t\tignoreUnhandledNodes: true,\n\t\tunhandledNodeErrorMessage: 'Encountered an unknown child.',\n\n\t\tstaticContextFactoryName: 'getStaticContext',\n\t\tstaticRenderFactoryName: 'staticRender',\n\t}\n\n\tprivate readonly leaves: LeafList<AllLeavesRepresentation, StaticContext>\n\tprivate readonly branchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>\n\tprivate readonly options: ChildrenAnalyzerOptions<StaticContext>\n\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tbranchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tdecider:\n\t\t\t| Partial<ChildrenAnalyzerOptions>\n\t\t\t| BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext> = [],\n\t\toptions: Partial<ChildrenAnalyzerOptions> = {},\n\t) {\n\t\tthis.leaves = leaves\n\n\t\tif (Array.isArray(decider)) {\n\t\t\tthis.branchNodes = decider\n\t\t} else {\n\t\t\tthis.branchNodes = []\n\t\t\toptions = decider\n\t\t}\n\t\tthis.options = { ...ChildrenAnalyzer.defaultOptions, ...options }\n\t}\n\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tinitialStaticContext: StaticContext,\n\t): Array<AllLeavesRepresentation | AllBranchNodesRepresentation> {\n\t\tconst processed = this.processNode(children, initialStaticContext, [])\n\n\t\tconst rawResult: Array<AllLeavesRepresentation | AllBranchNodesRepresentation | undefined> = Array.isArray(\n\t\t\tprocessed,\n\t\t)\n\t\t\t? processed\n\t\t\t: [processed]\n\n\t\treturn rawResult.filter(\n\t\t\t(item): item is AllLeavesRepresentation | AllBranchNodesRepresentation => item !== undefined,\n\t\t)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tstaticContext: StaticContext,\n\t\tcomponentPath: ReactElement[],\n\t): RawNodeRepresentation<AllLeavesRepresentation, AllBranchNodesRepresentation> {\n\t\tif (!node || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tconst specification = leaf.specification\n\t\t\t\tif (specification.type === 'useSite') {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (node === false || node === undefined || node === null) {\n\t\t\t\t// This adds seamless support for conditionals and such.\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (!this.options.ignoreUnhandledNodes) {\n\t\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t\t}\n\t\t\treturn undefined\n\t\t}\n\n\t\tif (typeof node === 'function') {\n\t\t\tif (this.options.ignoreRenderProps) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.renderPropsErrorMessage, node, staticContext))\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\tlet mapped: Array<AllLeavesRepresentation | AllBranchNodesRepresentation> = []\n\n\t\t\tfor (const subNode of node) {\n\t\t\t\tconst processed = this.processNode(subNode, staticContext, componentPath)\n\n\t\t\t\tif (processed !== undefined) {\n\t\t\t\t\tif (Array.isArray(processed)) {\n\t\t\t\t\t\tmapped = mapped.concat(processed)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapped.push(processed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn mapped\n\t\t}\n\n\t\tlet children: ReactNode = undefined\n\n\t\tif (!('type' in node)) {\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\tchildren = node.props.children\n\n\t\tif (typeof node.type === 'symbol') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\t// if (typeof node.type === 'string') {\n\t\t// \t// Typically a host component\n\t\t// \tif (!this.options.ignoreUnhandledNodes) {\n\t\t// \t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t// \t}\n\t\t// \treturn this.processNode(children, staticContext)\n\t\t// }\n\n\t\t// Component, PureComponent, FunctionComponent\n\n\t\tconst treeNode = node.type as ElementType &\n\t\t\t{\n\t\t\t\t[staticMethod in ValidFactoryName]:\n\t\t\t\t| StaticContextFactory<any, StaticContext>\n\t\t\t\t| SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\t| UnconstrainedLeafRepresentationFactory<any, AllLeavesRepresentation, StaticContext>\n\t\t\t\t| DeclarationSiteNodeRepresentationFactory<any, unknown, AllBranchNodesRepresentation, StaticContext>\n\t\t\t}\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (typeof treeNode !== 'string') {\n\t\t\tif (this.options.staticContextFactoryName in treeNode) {\n\t\t\t\tconst staticContextFactory = treeNode[this.options.staticContextFactoryName] as StaticContextFactory<\n\t\t\t\t\tany,\n\t\t\t\t\tStaticContext\n\t\t\t\t>\n\t\t\t\ttry {\n\t\t\t\t\tstaticContext = staticContextFactory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticContextFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.options.staticRenderFactoryName in treeNode) {\n\t\t\t\tconst factory = treeNode[this.options.staticRenderFactoryName] as SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\ttry {\n\t\t\t\t\tchildren = factory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticRenderFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const leaf of this.leaves) {\n\t\t\tconst specification = leaf.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as UnconstrainedLeafRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tconst processedChildren = this.processNode(children, staticContext, componentPath)\n\n\t\tfor (const branchNode of this.branchNodes) {\n\t\t\tconst specification = branchNode.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName, childrenRepresentationReducer } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as DeclarationSiteNodeRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tunknown,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, childrenRepresentationReducer(processedChildren), staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { factory, ComponentType } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn factory(node, processedChildren, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!this.options.ignoreUnhandledNodes &&\n\t\t\t!(typeof treeNode !== 'string' && this.options.staticRenderFactoryName in treeNode)\n\t\t) {\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t}\n\n\t\treturn processedChildren\n\t}\n}\n"],"names":["ChildrenAnalyzerError","getErrorMessage","wrapError","assertNever"],"mappings":";;;;;;;;;;;;AAiBO,MAAM,oBAAN,MAIL;AAAA,EAyBM,YACN,QACA,UAE0F,CAAA,GAC1F,UAA4C,CAAA,GAC3C;AAnBe;AACA;AACA;AAkBhB,SAAK,SAAS;AAEV,QAAA,MAAM,QAAQ,OAAO,GAAG;AAC3B,WAAK,cAAc;AAAA,IAAA,OACb;AACN,WAAK,cAAc;AACT,gBAAA;AAAA,IACX;AACA,SAAK,UAAU,EAAE,GAAG,kBAAiB,gBAAgB,GAAG;EACzD;A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M,aAAa,CAAC;AAAA,IAC7G;AAEO,WAAA;AAAA,EACR;AACD;AAlPO,IAAM,mBAAN;AAKN,cALY,kBAKG,kBAA0C;AAAA,EACxD,mBAAmB;AAAA,EACnB,yBAAyB;AAAA,EAEzB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAE3B,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA;;"}
|
|
1
|
+
{"version":3,"file":"ChildrenAnalyzer.cjs","sources":["../../src/ChildrenAnalyzer.ts"],"sourcesContent":["import { assertNever } from '@contember/utilities'\nimport type { ElementType, ReactElement, ReactNode } from 'react'\nimport type { BranchNodeList } from './BranchNodeList'\nimport { ChildrenAnalyzerError } from './ChildrenAnalyzerError'\nimport type { ChildrenAnalyzerOptions } from './ChildrenAnalyzerOptions'\nimport type { LeafList } from './LeafList'\nimport { getErrorMessage } from './helpers'\nimport { wrapError } from './helpers/wrapError'\nimport type {\n\tDeclarationSiteNodeRepresentationFactory,\n\tRawNodeRepresentation,\n\tStaticContextFactory,\n\tSyntheticChildrenFactory,\n\tUnconstrainedLeafRepresentationFactory,\n\tValidFactoryName,\n} from './nodeSpecs'\n\nexport class ChildrenAnalyzer<\n\tAllLeavesRepresentation = any,\n\tAllBranchNodesRepresentation = never,\n\tStaticContext = undefined,\n> {\n\tprivate static defaultOptions: ChildrenAnalyzerOptions = {\n\t\tignoreRenderProps: true,\n\t\trenderPropsErrorMessage: 'Render props (functions as React component children) are not supported.',\n\n\t\tignoreUnhandledNodes: true,\n\t\tunhandledNodeErrorMessage: 'Encountered an unknown child.',\n\n\t\tstaticContextFactoryName: 'getStaticContext',\n\t\tstaticRenderFactoryName: 'staticRender',\n\t}\n\n\tprivate readonly leaves: LeafList<AllLeavesRepresentation, StaticContext>\n\tprivate readonly branchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>\n\tprivate readonly options: ChildrenAnalyzerOptions<StaticContext>\n\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tbranchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tdecider:\n\t\t\t| Partial<ChildrenAnalyzerOptions>\n\t\t\t| BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext> = [],\n\t\toptions: Partial<ChildrenAnalyzerOptions> = {},\n\t) {\n\t\tthis.leaves = leaves\n\n\t\tif (Array.isArray(decider)) {\n\t\t\tthis.branchNodes = decider\n\t\t} else {\n\t\t\tthis.branchNodes = []\n\t\t\toptions = decider\n\t\t}\n\t\tthis.options = { ...ChildrenAnalyzer.defaultOptions, ...options }\n\t}\n\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tinitialStaticContext: StaticContext,\n\t): Array<AllLeavesRepresentation | AllBranchNodesRepresentation> {\n\t\tconst processed = this.processNode(children, initialStaticContext, [])\n\n\t\tconst rawResult: Array<AllLeavesRepresentation | AllBranchNodesRepresentation | undefined> = Array.isArray(\n\t\t\tprocessed,\n\t\t)\n\t\t\t? processed\n\t\t\t: [processed]\n\n\t\treturn rawResult.filter(\n\t\t\t(item): item is AllLeavesRepresentation | AllBranchNodesRepresentation => item !== undefined,\n\t\t)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tstaticContext: StaticContext,\n\t\tcomponentPath: ReactElement[],\n\t): RawNodeRepresentation<AllLeavesRepresentation, AllBranchNodesRepresentation> {\n\t\tif (!node || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tconst specification = leaf.specification\n\t\t\t\tif (specification.type === 'useSite') {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (node === false || node === undefined || node === null) {\n\t\t\t\t// This adds seamless support for conditionals and such.\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (!this.options.ignoreUnhandledNodes) {\n\t\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t\t}\n\t\t\treturn undefined\n\t\t}\n\n\t\tif (typeof node === 'function') {\n\t\t\tif (this.options.ignoreRenderProps) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.renderPropsErrorMessage, node, staticContext))\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\tlet mapped: Array<AllLeavesRepresentation | AllBranchNodesRepresentation> = []\n\n\t\t\tfor (const subNode of node) {\n\t\t\t\tconst processed = this.processNode(subNode, staticContext, componentPath)\n\n\t\t\t\tif (processed !== undefined) {\n\t\t\t\t\tif (Array.isArray(processed)) {\n\t\t\t\t\t\tmapped = mapped.concat(processed)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapped.push(processed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn mapped\n\t\t}\n\n\t\tlet children: ReactNode = undefined\n\n\t\tif (!('type' in node)) {\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\tchildren = node.props.children\n\n\t\tif (typeof node.type === 'symbol') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\t// if (typeof node.type === 'string') {\n\t\t// \t// Typically a host component\n\t\t// \tif (!this.options.ignoreUnhandledNodes) {\n\t\t// \t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t// \t}\n\t\t// \treturn this.processNode(children, staticContext)\n\t\t// }\n\n\t\t// Component, PureComponent, FunctionComponent\n\n\t\tconst treeNode = node.type as ElementType &\n\t\t\t{\n\t\t\t\t[staticMethod in ValidFactoryName]:\n\t\t\t\t| StaticContextFactory<any, StaticContext>\n\t\t\t\t| SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\t| UnconstrainedLeafRepresentationFactory<any, AllLeavesRepresentation, StaticContext>\n\t\t\t\t| DeclarationSiteNodeRepresentationFactory<any, unknown, AllBranchNodesRepresentation, StaticContext>\n\t\t\t}\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (typeof treeNode !== 'string') {\n\t\t\tif (this.options.staticContextFactoryName in treeNode) {\n\t\t\t\tconst staticContextFactory = treeNode[this.options.staticContextFactoryName] as StaticContextFactory<\n\t\t\t\t\tany,\n\t\t\t\t\tStaticContext\n\t\t\t\t>\n\t\t\t\ttry {\n\t\t\t\t\tstaticContext = staticContextFactory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticContextFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.options.staticRenderFactoryName in treeNode) {\n\t\t\t\tconst factory = treeNode[this.options.staticRenderFactoryName] as SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\ttry {\n\t\t\t\t\tchildren = factory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticRenderFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const leaf of this.leaves) {\n\t\t\tconst specification = leaf.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as UnconstrainedLeafRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tconst processedChildren = this.processNode(children, staticContext, componentPath)\n\n\t\tfor (const branchNode of this.branchNodes) {\n\t\t\tconst specification = branchNode.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName, childrenRepresentationReducer } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as DeclarationSiteNodeRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tunknown,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, childrenRepresentationReducer(processedChildren), staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { factory, ComponentType } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn factory(node, processedChildren, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!this.options.ignoreUnhandledNodes &&\n\t\t\t!(typeof treeNode !== 'string' && this.options.staticRenderFactoryName in treeNode)\n\t\t) {\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t}\n\n\t\treturn processedChildren\n\t}\n}\n"],"names":["ChildrenAnalyzerError","getErrorMessage","wrapError","assertNever"],"mappings":";;;;;;;;;;;;AAiBO,MAAM,oBAAN,MAAM,kBAIX;AAAA,EAyBM,YACN,QACA,UAE0F,CAAA,GAC1F,UAA4C,CAAA,GAC3C;AAnBe;AACA;AACA;AAkBhB,SAAK,SAAS;AAEV,QAAA,MAAM,QAAQ,OAAO,GAAG;AAC3B,WAAK,cAAc;AAAA,IAAA,OACb;AACN,WAAK,cAAc;AACT,gBAAA;AAAA,IACX;AACA,SAAK,UAAU,EAAE,GAAG,kBAAiB,gBAAgB,GAAG;EACzD;AAAA,EAEO,gBACN,UACA,sBACgE;AAChE,UAAM,YAAY,KAAK,YAAY,UAAU,sBAAsB,CAAA,CAAE;AAErE,UAAM,YAAuF,MAAM;AAAA,MAClG;AAAA,IAAA,IAEE,YACA,CAAC,SAAS;AAEb,WAAO,UAAU;AAAA,MAChB,CAAC,SAAyE,SAAS;AAAA,IAAA;AAAA,EAErF;AAAA,EAEQ,YACP,MACA,eACA,eAC+E;AAC3E,QAAA,CAAC,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY,OAAO,SAAS,WAAW;AACpF,iBAAA,QAAQ,KAAK,Q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from "./helpers/wrapError.js";
|
|
10
10
|
import { getErrorMessage } from "./helpers/getErrorMessage.js";
|
|
11
|
-
const _ChildrenAnalyzer = class {
|
|
11
|
+
const _ChildrenAnalyzer = class _ChildrenAnalyzer {
|
|
12
12
|
constructor(leaves, decider = [], options = {}) {
|
|
13
13
|
__publicField(this, "leaves");
|
|
14
14
|
__publicField(this, "branchNodes");
|
|
@@ -155,8 +155,7 @@ const _ChildrenAnalyzer = class {
|
|
|
155
155
|
return processedChildren;
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
|
-
|
|
159
|
-
__publicField(ChildrenAnalyzer, "defaultOptions", {
|
|
158
|
+
__publicField(_ChildrenAnalyzer, "defaultOptions", {
|
|
160
159
|
ignoreRenderProps: true,
|
|
161
160
|
renderPropsErrorMessage: "Render props (functions as React component children) are not supported.",
|
|
162
161
|
ignoreUnhandledNodes: true,
|
|
@@ -164,6 +163,7 @@ __publicField(ChildrenAnalyzer, "defaultOptions", {
|
|
|
164
163
|
staticContextFactoryName: "getStaticContext",
|
|
165
164
|
staticRenderFactoryName: "staticRender"
|
|
166
165
|
});
|
|
166
|
+
let ChildrenAnalyzer = _ChildrenAnalyzer;
|
|
167
167
|
export {
|
|
168
168
|
ChildrenAnalyzer
|
|
169
169
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChildrenAnalyzer.js","sources":["../../src/ChildrenAnalyzer.ts"],"sourcesContent":["import { assertNever } from '@contember/utilities'\nimport type { ElementType, ReactElement, ReactNode } from 'react'\nimport type { BranchNodeList } from './BranchNodeList'\nimport { ChildrenAnalyzerError } from './ChildrenAnalyzerError'\nimport type { ChildrenAnalyzerOptions } from './ChildrenAnalyzerOptions'\nimport type { LeafList } from './LeafList'\nimport { getErrorMessage } from './helpers'\nimport { wrapError } from './helpers/wrapError'\nimport type {\n\tDeclarationSiteNodeRepresentationFactory,\n\tRawNodeRepresentation,\n\tStaticContextFactory,\n\tSyntheticChildrenFactory,\n\tUnconstrainedLeafRepresentationFactory,\n\tValidFactoryName,\n} from './nodeSpecs'\n\nexport class ChildrenAnalyzer<\n\tAllLeavesRepresentation = any,\n\tAllBranchNodesRepresentation = never,\n\tStaticContext = undefined,\n> {\n\tprivate static defaultOptions: ChildrenAnalyzerOptions = {\n\t\tignoreRenderProps: true,\n\t\trenderPropsErrorMessage: 'Render props (functions as React component children) are not supported.',\n\n\t\tignoreUnhandledNodes: true,\n\t\tunhandledNodeErrorMessage: 'Encountered an unknown child.',\n\n\t\tstaticContextFactoryName: 'getStaticContext',\n\t\tstaticRenderFactoryName: 'staticRender',\n\t}\n\n\tprivate readonly leaves: LeafList<AllLeavesRepresentation, StaticContext>\n\tprivate readonly branchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>\n\tprivate readonly options: ChildrenAnalyzerOptions<StaticContext>\n\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tbranchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tdecider:\n\t\t\t| Partial<ChildrenAnalyzerOptions>\n\t\t\t| BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext> = [],\n\t\toptions: Partial<ChildrenAnalyzerOptions> = {},\n\t) {\n\t\tthis.leaves = leaves\n\n\t\tif (Array.isArray(decider)) {\n\t\t\tthis.branchNodes = decider\n\t\t} else {\n\t\t\tthis.branchNodes = []\n\t\t\toptions = decider\n\t\t}\n\t\tthis.options = { ...ChildrenAnalyzer.defaultOptions, ...options }\n\t}\n\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tinitialStaticContext: StaticContext,\n\t): Array<AllLeavesRepresentation | AllBranchNodesRepresentation> {\n\t\tconst processed = this.processNode(children, initialStaticContext, [])\n\n\t\tconst rawResult: Array<AllLeavesRepresentation | AllBranchNodesRepresentation | undefined> = Array.isArray(\n\t\t\tprocessed,\n\t\t)\n\t\t\t? processed\n\t\t\t: [processed]\n\n\t\treturn rawResult.filter(\n\t\t\t(item): item is AllLeavesRepresentation | AllBranchNodesRepresentation => item !== undefined,\n\t\t)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tstaticContext: StaticContext,\n\t\tcomponentPath: ReactElement[],\n\t): RawNodeRepresentation<AllLeavesRepresentation, AllBranchNodesRepresentation> {\n\t\tif (!node || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tconst specification = leaf.specification\n\t\t\t\tif (specification.type === 'useSite') {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (node === false || node === undefined || node === null) {\n\t\t\t\t// This adds seamless support for conditionals and such.\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (!this.options.ignoreUnhandledNodes) {\n\t\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t\t}\n\t\t\treturn undefined\n\t\t}\n\n\t\tif (typeof node === 'function') {\n\t\t\tif (this.options.ignoreRenderProps) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.renderPropsErrorMessage, node, staticContext))\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\tlet mapped: Array<AllLeavesRepresentation | AllBranchNodesRepresentation> = []\n\n\t\t\tfor (const subNode of node) {\n\t\t\t\tconst processed = this.processNode(subNode, staticContext, componentPath)\n\n\t\t\t\tif (processed !== undefined) {\n\t\t\t\t\tif (Array.isArray(processed)) {\n\t\t\t\t\t\tmapped = mapped.concat(processed)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapped.push(processed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn mapped\n\t\t}\n\n\t\tlet children: ReactNode = undefined\n\n\t\tif (!('type' in node)) {\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\tchildren = node.props.children\n\n\t\tif (typeof node.type === 'symbol') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\t// if (typeof node.type === 'string') {\n\t\t// \t// Typically a host component\n\t\t// \tif (!this.options.ignoreUnhandledNodes) {\n\t\t// \t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t// \t}\n\t\t// \treturn this.processNode(children, staticContext)\n\t\t// }\n\n\t\t// Component, PureComponent, FunctionComponent\n\n\t\tconst treeNode = node.type as ElementType &\n\t\t\t{\n\t\t\t\t[staticMethod in ValidFactoryName]:\n\t\t\t\t| StaticContextFactory<any, StaticContext>\n\t\t\t\t| SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\t| UnconstrainedLeafRepresentationFactory<any, AllLeavesRepresentation, StaticContext>\n\t\t\t\t| DeclarationSiteNodeRepresentationFactory<any, unknown, AllBranchNodesRepresentation, StaticContext>\n\t\t\t}\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (typeof treeNode !== 'string') {\n\t\t\tif (this.options.staticContextFactoryName in treeNode) {\n\t\t\t\tconst staticContextFactory = treeNode[this.options.staticContextFactoryName] as StaticContextFactory<\n\t\t\t\t\tany,\n\t\t\t\t\tStaticContext\n\t\t\t\t>\n\t\t\t\ttry {\n\t\t\t\t\tstaticContext = staticContextFactory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticContextFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.options.staticRenderFactoryName in treeNode) {\n\t\t\t\tconst factory = treeNode[this.options.staticRenderFactoryName] as SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\ttry {\n\t\t\t\t\tchildren = factory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticRenderFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const leaf of this.leaves) {\n\t\t\tconst specification = leaf.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as UnconstrainedLeafRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tconst processedChildren = this.processNode(children, staticContext, componentPath)\n\n\t\tfor (const branchNode of this.branchNodes) {\n\t\t\tconst specification = branchNode.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName, childrenRepresentationReducer } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as DeclarationSiteNodeRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tunknown,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, childrenRepresentationReducer(processedChildren), staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { factory, ComponentType } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn factory(node, processedChildren, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!this.options.ignoreUnhandledNodes &&\n\t\t\t!(typeof treeNode !== 'string' && this.options.staticRenderFactoryName in treeNode)\n\t\t) {\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t}\n\n\t\treturn processedChildren\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;AAiBO,MAAM,oBAAN,MAIL;AAAA,EAyBM,YACN,QACA,UAE0F,CAAA,GAC1F,UAA4C,CAAA,GAC3C;AAnBe;AACA;AACA;AAkBhB,SAAK,SAAS;AAEV,QAAA,MAAM,QAAQ,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AA,IAAI,sBAAsB,gBAAgB,KAAK,QAAQ,2BAA2B,MAAM,aAAa,CAAC;AAAA,IAC7G;AAEO,WAAA;AAAA,EACR;AACD;AAlPO,IAAM,mBAAN;AAKN,cALY,kBAKG,kBAA0C;AAAA,EACxD,mBAAmB;AAAA,EACnB,yBAAyB;AAAA,EAEzB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAE3B,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA;"}
|
|
1
|
+
{"version":3,"file":"ChildrenAnalyzer.js","sources":["../../src/ChildrenAnalyzer.ts"],"sourcesContent":["import { assertNever } from '@contember/utilities'\nimport type { ElementType, ReactElement, ReactNode } from 'react'\nimport type { BranchNodeList } from './BranchNodeList'\nimport { ChildrenAnalyzerError } from './ChildrenAnalyzerError'\nimport type { ChildrenAnalyzerOptions } from './ChildrenAnalyzerOptions'\nimport type { LeafList } from './LeafList'\nimport { getErrorMessage } from './helpers'\nimport { wrapError } from './helpers/wrapError'\nimport type {\n\tDeclarationSiteNodeRepresentationFactory,\n\tRawNodeRepresentation,\n\tStaticContextFactory,\n\tSyntheticChildrenFactory,\n\tUnconstrainedLeafRepresentationFactory,\n\tValidFactoryName,\n} from './nodeSpecs'\n\nexport class ChildrenAnalyzer<\n\tAllLeavesRepresentation = any,\n\tAllBranchNodesRepresentation = never,\n\tStaticContext = undefined,\n> {\n\tprivate static defaultOptions: ChildrenAnalyzerOptions = {\n\t\tignoreRenderProps: true,\n\t\trenderPropsErrorMessage: 'Render props (functions as React component children) are not supported.',\n\n\t\tignoreUnhandledNodes: true,\n\t\tunhandledNodeErrorMessage: 'Encountered an unknown child.',\n\n\t\tstaticContextFactoryName: 'getStaticContext',\n\t\tstaticRenderFactoryName: 'staticRender',\n\t}\n\n\tprivate readonly leaves: LeafList<AllLeavesRepresentation, StaticContext>\n\tprivate readonly branchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>\n\tprivate readonly options: ChildrenAnalyzerOptions<StaticContext>\n\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tbranchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tdecider:\n\t\t\t| Partial<ChildrenAnalyzerOptions>\n\t\t\t| BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext> = [],\n\t\toptions: Partial<ChildrenAnalyzerOptions> = {},\n\t) {\n\t\tthis.leaves = leaves\n\n\t\tif (Array.isArray(decider)) {\n\t\t\tthis.branchNodes = decider\n\t\t} else {\n\t\t\tthis.branchNodes = []\n\t\t\toptions = decider\n\t\t}\n\t\tthis.options = { ...ChildrenAnalyzer.defaultOptions, ...options }\n\t}\n\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tinitialStaticContext: StaticContext,\n\t): Array<AllLeavesRepresentation | AllBranchNodesRepresentation> {\n\t\tconst processed = this.processNode(children, initialStaticContext, [])\n\n\t\tconst rawResult: Array<AllLeavesRepresentation | AllBranchNodesRepresentation | undefined> = Array.isArray(\n\t\t\tprocessed,\n\t\t)\n\t\t\t? processed\n\t\t\t: [processed]\n\n\t\treturn rawResult.filter(\n\t\t\t(item): item is AllLeavesRepresentation | AllBranchNodesRepresentation => item !== undefined,\n\t\t)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tstaticContext: StaticContext,\n\t\tcomponentPath: ReactElement[],\n\t): RawNodeRepresentation<AllLeavesRepresentation, AllBranchNodesRepresentation> {\n\t\tif (!node || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tconst specification = leaf.specification\n\t\t\t\tif (specification.type === 'useSite') {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (node === false || node === undefined || node === null) {\n\t\t\t\t// This adds seamless support for conditionals and such.\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (!this.options.ignoreUnhandledNodes) {\n\t\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t\t}\n\t\t\treturn undefined\n\t\t}\n\n\t\tif (typeof node === 'function') {\n\t\t\tif (this.options.ignoreRenderProps) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.renderPropsErrorMessage, node, staticContext))\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\tlet mapped: Array<AllLeavesRepresentation | AllBranchNodesRepresentation> = []\n\n\t\t\tfor (const subNode of node) {\n\t\t\t\tconst processed = this.processNode(subNode, staticContext, componentPath)\n\n\t\t\t\tif (processed !== undefined) {\n\t\t\t\t\tif (Array.isArray(processed)) {\n\t\t\t\t\t\tmapped = mapped.concat(processed)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapped.push(processed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn mapped\n\t\t}\n\n\t\tlet children: ReactNode = undefined\n\n\t\tif (!('type' in node)) {\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\tchildren = node.props.children\n\n\t\tif (typeof node.type === 'symbol') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\t// if (typeof node.type === 'string') {\n\t\t// \t// Typically a host component\n\t\t// \tif (!this.options.ignoreUnhandledNodes) {\n\t\t// \t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t// \t}\n\t\t// \treturn this.processNode(children, staticContext)\n\t\t// }\n\n\t\t// Component, PureComponent, FunctionComponent\n\n\t\tconst treeNode = node.type as ElementType &\n\t\t\t{\n\t\t\t\t[staticMethod in ValidFactoryName]:\n\t\t\t\t| StaticContextFactory<any, StaticContext>\n\t\t\t\t| SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\t| UnconstrainedLeafRepresentationFactory<any, AllLeavesRepresentation, StaticContext>\n\t\t\t\t| DeclarationSiteNodeRepresentationFactory<any, unknown, AllBranchNodesRepresentation, StaticContext>\n\t\t\t}\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (typeof treeNode !== 'string') {\n\t\t\tif (this.options.staticContextFactoryName in treeNode) {\n\t\t\t\tconst staticContextFactory = treeNode[this.options.staticContextFactoryName] as StaticContextFactory<\n\t\t\t\t\tany,\n\t\t\t\t\tStaticContext\n\t\t\t\t>\n\t\t\t\ttry {\n\t\t\t\t\tstaticContext = staticContextFactory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticContextFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.options.staticRenderFactoryName in treeNode) {\n\t\t\t\tconst factory = treeNode[this.options.staticRenderFactoryName] as SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\ttry {\n\t\t\t\t\tchildren = factory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticRenderFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const leaf of this.leaves) {\n\t\t\tconst specification = leaf.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as UnconstrainedLeafRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tconst processedChildren = this.processNode(children, staticContext, componentPath)\n\n\t\tfor (const branchNode of this.branchNodes) {\n\t\t\tconst specification = branchNode.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName, childrenRepresentationReducer } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as DeclarationSiteNodeRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tunknown,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, childrenRepresentationReducer(processedChildren), staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { factory, ComponentType } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn factory(node, processedChildren, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!this.options.ignoreUnhandledNodes &&\n\t\t\t!(typeof treeNode !== 'string' && this.options.staticRenderFactoryName in treeNode)\n\t\t) {\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t}\n\n\t\treturn processedChildren\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;AAiBO,MAAM,oBAAN,MAAM,kBAIX;AAAA,EAyBM,YACN,QACA,UAE0F,CAAA,GAC1F,UAA4C,CAAA,GAC3C;AAnBe;AACA;AACA;AAkBhB,SAAK,SAAS;AAEV,QAAA,MAAM,QAAQ,OAAO,GAAG;AAC3B,WAAK,cAAc;AAAA,IAAA,OACb;AACN,WAAK,cAAc;AACT,gBAAA;AAAA,IACX;AACA,SAAK,UAAU,EAAE,GAAG,kBAAiB,gBAAgB,GAAG;EACzD;AAAA,EAEO,gBACN,UACA,sBACgE;AAChE,UAAM,YAAY,KAAK,YAAY,UAAU,sBAAsB,CAAA,CAAE;AAErE,UAAM,YAAuF,MAAM;AAAA,MAClG;AAAA,IAAA,IAEE,YACA,CAAC,SAAS;AAEb,WAAO,UAAU;AAAA,MAChB,CAAC,SAAyE,SAAS;AAAA,IAAA;AAAA,EAErF;AAAA,EAEQ,YACP,MACA,eACA,eAC+E;AAC3E,QAAA,CAAC,QAAQ,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY,OAAO,SAAS,WAAW;AACpF,iBAAA,QAAQ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7D,cAAI,OAAO,aAAa,YAAY,qBAAqB,UAAU;AAClE,gBAAI,sBAAsB,UAAa,CAAC,WAAW,QAAQ,qBAAqB;AAC/E,oBAAM,IAAI,sBAAsB,WAAW,QAAQ,0BAA0B;AAAA,YAC9E;AACM,kBAAA,UAAU,SAAS,iBAAiB;AAM1C,mBAAO,QAAQ,KAAK,OAAO,8BAA8B,iBAAiB,GAAG,aAAa;AAAA,UAC3F;AACA;AAAA,QACD;AAAA,QACA,KAAK,WAAW;AACT,gBAAA,EAAE,SAAS,cAAkB,IAAA;AACnC,cAAI,kBAAkB,UAAa,KAAK,SAAS,eAAe;AAC/D,gBAAI,sBAAsB,UAAa,CAAC,WAAW,QAAQ,qBAAqB;AAC/E,oBAAM,IAAI,sBAAsB,WAAW,QAAQ,0BAA0B;AAAA,YAC9E;AACO,mBAAA,QAAQ,MAAM,mBAAmB,aAAa;AAAA,UACtD;AACA;AAAA,QACD;AAAA,QACA;AACC,iBAAO,YAAY,aAAa;AAAA,MAClC;AAAA,IACD;AAGC,QAAA,CAAC,KAAK,QAAQ,wBACd,EAAE,OAAO,aAAa,YAAY,KAAK,QAAQ,2BAA2B,WACzE;AACK,YAAA,IAAI,sBAAsB,gBAAgB,KAAK,QAAQ,2BAA2B,MAAM,aAAa,CAAC;AAAA,IAC7G;AAEO,WAAA;AAAA,EACR;AACD;AA7OC,cALY,mBAKG,kBAA0C;AAAA,EACxD,mBAAmB;AAAA,EACnB,yBAAyB;AAAA,EAEzB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAE3B,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA;AAbpB,IAAM,mBAAN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapError.cjs","sources":["../../../src/helpers/wrapError.ts"],"sourcesContent":["import React, { ReactElement } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\n\nexport const wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value","ChildrenAnalyzerError"],"mappings":";;;;AAGO,MAAM,YAAY,CAAC,GAAY,sBAA8B,YAAoB,SAAgC;AACnH,MAAA,EAAE,aAAa,QAAQ;AACpB,UAAA;AAAA,EACP;AAEA,QAAM,gBAAgB,KAAK,IAAI,CAAC,IAAI,UAAU;AAC7C,UAAM,EAAE,UAAU,GAAG,MAAA,IAAU,GAAG;AAC5B,UAAA,aAAa,CAACA,WAAe;AAClC,UAAI,SAAS;AACb,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQA,MAAK,GAAG;AACjD,YAAI,UAAU,QAAW;AACxB;AAAA,QACD;AACI,YAAA;AACH,gBAAM,eAAe,KAAK;AAAA,YAAU;AAAA,YAAO,CAACC,MAAKC,WAAU;AACrD,kBAAA,OAAOA,WAAU,YAAY;AACzB,uBAAA;AAAA,cACR;AACI,kBAAA,MAAM,eAAeA,MAAK,GAAG;AACzB,uBAAA;AAAA,cACR;AACOA,qBAAAA;AAAAA,YACR;AAAA,UAAA;
|
|
1
|
+
{"version":3,"file":"wrapError.cjs","sources":["../../../src/helpers/wrapError.ts"],"sourcesContent":["import React, { ReactElement } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\n\nexport const wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value","ChildrenAnalyzerError"],"mappings":";;;;AAGO,MAAM,YAAY,CAAC,GAAY,sBAA8B,YAAoB,SAAgC;AACnH,MAAA,EAAE,aAAa,QAAQ;AACpB,UAAA;AAAA,EACP;AAEA,QAAM,gBAAgB,KAAK,IAAI,CAAC,IAAI,UAAU;AAC7C,UAAM,EAAE,UAAU,GAAG,MAAA,IAAU,GAAG;AAC5B,UAAA,aAAa,CAACA,WAAe;AAClC,UAAI,SAAS;AACb,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQA,MAAK,GAAG;AACjD,YAAI,UAAU,QAAW;AACxB;AAAA,QACD;AACI,YAAA;AACH,gBAAM,eAAe,KAAK;AAAA,YAAU;AAAA,YAAO,CAACC,MAAKC,WAAU;AACrD,kBAAA,OAAOA,WAAU,YAAY;AACzB,uBAAA;AAAA,cACR;AACI,kBAAA,MAAM,eAAeA,MAAK,GAAG;AACzB,uBAAA;AAAA,cACR;AACOA,qBAAAA;AAAAA,YACR;AAAA,UAAA;AAES,oBAAA,IAAI,GAAG,IAAI,YAAY;AAAA,QAAA,QAC1B;AACP,oBAAU,IAAI,GAAG;AAAA,QAClB;AAAA,MACD;AACO,aAAA;AAAA,IAAA;AAEF,UAAA,gBAAgB,OAAO,GAAG,SAAS,YAAY,iBAAiB,GAAG,OAAQ,GAAG,KAAa,cAAc;AACzG,UAAA,eAAe,WAAW,KAAK;AAC/B,UAAA,SAAS,KAAK,OAAO,KAAK;AAChC,WAAO,GAAG,MAAM,IAAI,iBAAiB,KAAK,GAAG,YAAY;AAAA,EAAA,CACzD;AACD,QAAM,eAAe,iCAAiC,oBAAoB,OAAO,UAAU;AAAA,EAAM,EAAE,WAAW,eAAe;AAEvH,QAAA,IAAIC,4CAAsB,cAAc;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EAAoB,cAAc,KAAK,IAAI,CAAC;AAAA,EAAA,CACrD;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapError.js","sources":["../../../src/helpers/wrapError.ts"],"sourcesContent":["import React, { ReactElement } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\n\nexport const wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value"],"mappings":";;AAGO,MAAM,YAAY,CAAC,GAAY,sBAA8B,YAAoB,SAAgC;AACnH,MAAA,EAAE,aAAa,QAAQ;AACpB,UAAA;AAAA,EACP;AAEA,QAAM,gBAAgB,KAAK,IAAI,CAAC,IAAI,UAAU;AAC7C,UAAM,EAAE,UAAU,GAAG,MAAA,IAAU,GAAG;AAC5B,UAAA,aAAa,CAACA,WAAe;AAClC,UAAI,SAAS;AACb,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQA,MAAK,GAAG;AACjD,YAAI,UAAU,QAAW;AACxB;AAAA,QACD;AACI,YAAA;AACH,gBAAM,eAAe,KAAK;AAAA,YAAU;AAAA,YAAO,CAACC,MAAKC,WAAU;AACrD,kBAAA,OAAOA,WAAU,YAAY;AACzB,uBAAA;AAAA,cACR;AACI,kBAAA,MAAM,eAAeA,MAAK,GAAG;AACzB,uBAAA;AAAA,cACR;AACOA,qBAAAA;AAAAA,YACR;AAAA,UAAA;
|
|
1
|
+
{"version":3,"file":"wrapError.js","sources":["../../../src/helpers/wrapError.ts"],"sourcesContent":["import React, { ReactElement } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\n\nexport const wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value"],"mappings":";;AAGO,MAAM,YAAY,CAAC,GAAY,sBAA8B,YAAoB,SAAgC;AACnH,MAAA,EAAE,aAAa,QAAQ;AACpB,UAAA;AAAA,EACP;AAEA,QAAM,gBAAgB,KAAK,IAAI,CAAC,IAAI,UAAU;AAC7C,UAAM,EAAE,UAAU,GAAG,MAAA,IAAU,GAAG;AAC5B,UAAA,aAAa,CAACA,WAAe;AAClC,UAAI,SAAS;AACb,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQA,MAAK,GAAG;AACjD,YAAI,UAAU,QAAW;AACxB;AAAA,QACD;AACI,YAAA;AACH,gBAAM,eAAe,KAAK;AAAA,YAAU;AAAA,YAAO,CAACC,MAAKC,WAAU;AACrD,kBAAA,OAAOA,WAAU,YAAY;AACzB,uBAAA;AAAA,cACR;AACI,kBAAA,MAAM,eAAeA,MAAK,GAAG;AACzB,uBAAA;AAAA,cACR;AACOA,qBAAAA;AAAAA,YACR;AAAA,UAAA;AAES,oBAAA,IAAI,GAAG,IAAI,YAAY;AAAA,QAAA,QAC1B;AACP,oBAAU,IAAI,GAAG;AAAA,QAClB;AAAA,MACD;AACO,aAAA;AAAA,IAAA;AAEF,UAAA,gBAAgB,OAAO,GAAG,SAAS,YAAY,iBAAiB,GAAG,OAAQ,GAAG,KAAa,cAAc;AACzG,UAAA,eAAe,WAAW,KAAK;AAC/B,UAAA,SAAS,KAAK,OAAO,KAAK;AAChC,WAAO,GAAG,MAAM,IAAI,iBAAiB,KAAK,GAAG,YAAY;AAAA,EAAA,CACzD;AACD,QAAM,eAAe,iCAAiC,oBAAoB,OAAO,UAAU;AAAA,EAAM,EAAE,WAAW,eAAe;AAEvH,QAAA,IAAI,sBAAsB,cAAc;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EAAoB,cAAc,KAAK,IAAI,CAAC;AAAA,EAAA,CACrD;AACF;"}
|
|
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
9
|
const ChildrenAnalyzerError = require("../ChildrenAnalyzerError.cjs");
|
|
10
|
-
const _BranchNode = class {
|
|
10
|
+
const _BranchNode = class _BranchNode {
|
|
11
11
|
constructor(factory, componentOrReducer, options) {
|
|
12
12
|
__publicField(this, "specification");
|
|
13
13
|
__publicField(this, "options");
|
|
@@ -32,10 +32,10 @@ const _BranchNode = class {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
|
|
36
|
-
__publicField(BranchNode, "defaultOptions", {
|
|
35
|
+
__publicField(_BranchNode, "defaultOptions", {
|
|
37
36
|
childrenAreOptional: false,
|
|
38
37
|
childrenAbsentErrorMessage: "Component must have children!"
|
|
39
38
|
});
|
|
39
|
+
let BranchNode = _BranchNode;
|
|
40
40
|
exports.BranchNode = BranchNode;
|
|
41
41
|
//# sourceMappingURL=BranchNode.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchNode.cjs","sources":["../../../src/nodeSpecs/BranchNode.ts"],"sourcesContent":["import type { ElementType } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\nimport type { BranchNodeOptions } from './BranchNodeOptions'\nimport type { ChildrenRepresentationReducer, UseSiteBranchNodeRepresentationFactory, ValidFactoryName } from './types'\n\nclass BranchNode<\n\tProps extends {} = {},\n\tStaticContext = undefined,\n\tFactoryMethodName extends ValidFactoryName = string,\n\tChildrenRepresentation = any,\n\tReducedChildrenRepresentation = any,\n\tRepresentation = any,\n> {\n\tprivate static defaultOptions: BranchNodeOptions = {\n\t\tchildrenAreOptional: false,\n\t\tchildrenAbsentErrorMessage: 'Component must have children!',\n\t}\n\n\tpublic readonly specification: BranchNode.Specification<\n\t\tProps,\n\t\tStaticContext,\n\t\tFactoryMethodName,\n\t\tChildrenRepresentation,\n\t\tReducedChildrenRepresentation,\n\t\tRepresentation\n\t>\n\n\tpublic readonly options: BranchNodeOptions\n\n\tpublic constructor(\n\t\tfactoryMethodName: FactoryMethodName,\n\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tuseSiteFactory: UseSiteBranchNodeRepresentationFactory<\n\t\t\tProps,\n\t\t\tChildrenRepresentation,\n\t\t\tRepresentation,\n\t\t\tStaticContext\n\t\t>,\n\t\tComponentType?: ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tfactory:\n\t\t\t| FactoryMethodName\n\t\t\t| UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>,\n\t\tcomponentOrReducer?:\n\t\t\t| ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>\n\t\t\t| ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t) {\n\t\tif (typeof factory !== 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'declarationSite',\n\t\t\t\tfactoryMethodName: factory,\n\t\t\t\tchildrenRepresentationReducer: componentOrReducer as ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>,\n\t\t\t}\n\t\t} else if (typeof factory === 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'useSite',\n\t\t\t\tfactory,\n\t\t\t\tComponentType: componentOrReducer as ElementType<Props>,\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new ChildrenAnalyzerError('Invalid arguments')\n\t\t}\n\t\tthis.options = {\n\t\t\t...BranchNode.defaultOptions,\n\t\t\t...options,\n\t\t}\n\t}\n}\n\nnamespace BranchNode {\n\texport type Specification<\n\t\tProps extends {} = {},\n\t\tStaticContext = any,\n\t\tFactoryMethodName extends ValidFactoryName = string,\n\t\tChildrenRepresentation = any,\n\t\tReducedChildrenRepresentation = any,\n\t\tRepresentation = any,\n\t> =\n\t\t| {\n\t\t\t\ttype: 'declarationSite'\n\t\t\t\tfactoryMethodName: FactoryMethodName\n\t\t\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>\n\t\t }\n\t\t| {\n\t\t\t\ttype: 'useSite'\n\t\t\t\tfactory: UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>\n\t\t\t\tComponentType?: ElementType<Props>\n\t\t }\n}\n\nexport { BranchNode }\n"],"names":["ChildrenAnalyzerError"],"mappings":";;;;;;;;;AAKA,MAAM,cAAN,
|
|
1
|
+
{"version":3,"file":"BranchNode.cjs","sources":["../../../src/nodeSpecs/BranchNode.ts"],"sourcesContent":["import type { ElementType } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\nimport type { BranchNodeOptions } from './BranchNodeOptions'\nimport type { ChildrenRepresentationReducer, UseSiteBranchNodeRepresentationFactory, ValidFactoryName } from './types'\n\nclass BranchNode<\n\tProps extends {} = {},\n\tStaticContext = undefined,\n\tFactoryMethodName extends ValidFactoryName = string,\n\tChildrenRepresentation = any,\n\tReducedChildrenRepresentation = any,\n\tRepresentation = any,\n> {\n\tprivate static defaultOptions: BranchNodeOptions = {\n\t\tchildrenAreOptional: false,\n\t\tchildrenAbsentErrorMessage: 'Component must have children!',\n\t}\n\n\tpublic readonly specification: BranchNode.Specification<\n\t\tProps,\n\t\tStaticContext,\n\t\tFactoryMethodName,\n\t\tChildrenRepresentation,\n\t\tReducedChildrenRepresentation,\n\t\tRepresentation\n\t>\n\n\tpublic readonly options: BranchNodeOptions\n\n\tpublic constructor(\n\t\tfactoryMethodName: FactoryMethodName,\n\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tuseSiteFactory: UseSiteBranchNodeRepresentationFactory<\n\t\t\tProps,\n\t\t\tChildrenRepresentation,\n\t\t\tRepresentation,\n\t\t\tStaticContext\n\t\t>,\n\t\tComponentType?: ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tfactory:\n\t\t\t| FactoryMethodName\n\t\t\t| UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>,\n\t\tcomponentOrReducer?:\n\t\t\t| ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>\n\t\t\t| ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t) {\n\t\tif (typeof factory !== 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'declarationSite',\n\t\t\t\tfactoryMethodName: factory,\n\t\t\t\tchildrenRepresentationReducer: componentOrReducer as ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>,\n\t\t\t}\n\t\t} else if (typeof factory === 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'useSite',\n\t\t\t\tfactory,\n\t\t\t\tComponentType: componentOrReducer as ElementType<Props>,\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new ChildrenAnalyzerError('Invalid arguments')\n\t\t}\n\t\tthis.options = {\n\t\t\t...BranchNode.defaultOptions,\n\t\t\t...options,\n\t\t}\n\t}\n}\n\nnamespace BranchNode {\n\texport type Specification<\n\t\tProps extends {} = {},\n\t\tStaticContext = any,\n\t\tFactoryMethodName extends ValidFactoryName = string,\n\t\tChildrenRepresentation = any,\n\t\tReducedChildrenRepresentation = any,\n\t\tRepresentation = any,\n\t> =\n\t\t| {\n\t\t\t\ttype: 'declarationSite'\n\t\t\t\tfactoryMethodName: FactoryMethodName\n\t\t\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>\n\t\t }\n\t\t| {\n\t\t\t\ttype: 'useSite'\n\t\t\t\tfactory: UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>\n\t\t\t\tComponentType?: ElementType<Props>\n\t\t }\n}\n\nexport { BranchNode }\n"],"names":["ChildrenAnalyzerError"],"mappings":";;;;;;;;;AAKA,MAAM,cAAN,MAAM,YAOJ;AAAA,EAgCM,YACN,SAGA,oBAGA,SACC;AAlCc;AASA;AA0BX,QAAA,OAAO,YAAY,YAAY;AAClC,WAAK,gBAAgB;AAAA,QACpB,MAAM;AAAA,QACN,mBAAmB;AAAA,QACnB,+BAA+B;AAAA,MAAA;AAAA,IAIhC,WACU,OAAO,YAAY,YAAY;AACzC,WAAK,gBAAgB;AAAA,QACpB,MAAM;AAAA,QACN;AAAA,QACA,eAAe;AAAA,MAAA;AAAA,IAChB,OACM;AACA,YAAA,IAAIA,sBAAAA,sBAAsB,mBAAmB;AAAA,IACpD;AACA,SAAK,UAAU;AAAA,MACd,GAAG,YAAW;AAAA,MACd,GAAG;AAAA,IAAA;AAAA,EAEL;AACD;AA/DC,cARK,aAQU,kBAAoC;AAAA,EAClD,qBAAqB;AAAA,EACrB,4BAA4B;AAAA;AAV9B,IAAM,aAAN;;"}
|
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
import { ChildrenAnalyzerError } from "../ChildrenAnalyzerError.js";
|
|
8
|
-
const _BranchNode = class {
|
|
8
|
+
const _BranchNode = class _BranchNode {
|
|
9
9
|
constructor(factory, componentOrReducer, options) {
|
|
10
10
|
__publicField(this, "specification");
|
|
11
11
|
__publicField(this, "options");
|
|
@@ -30,11 +30,11 @@ const _BranchNode = class {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
__publicField(BranchNode, "defaultOptions", {
|
|
33
|
+
__publicField(_BranchNode, "defaultOptions", {
|
|
35
34
|
childrenAreOptional: false,
|
|
36
35
|
childrenAbsentErrorMessage: "Component must have children!"
|
|
37
36
|
});
|
|
37
|
+
let BranchNode = _BranchNode;
|
|
38
38
|
export {
|
|
39
39
|
BranchNode
|
|
40
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchNode.js","sources":["../../../src/nodeSpecs/BranchNode.ts"],"sourcesContent":["import type { ElementType } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\nimport type { BranchNodeOptions } from './BranchNodeOptions'\nimport type { ChildrenRepresentationReducer, UseSiteBranchNodeRepresentationFactory, ValidFactoryName } from './types'\n\nclass BranchNode<\n\tProps extends {} = {},\n\tStaticContext = undefined,\n\tFactoryMethodName extends ValidFactoryName = string,\n\tChildrenRepresentation = any,\n\tReducedChildrenRepresentation = any,\n\tRepresentation = any,\n> {\n\tprivate static defaultOptions: BranchNodeOptions = {\n\t\tchildrenAreOptional: false,\n\t\tchildrenAbsentErrorMessage: 'Component must have children!',\n\t}\n\n\tpublic readonly specification: BranchNode.Specification<\n\t\tProps,\n\t\tStaticContext,\n\t\tFactoryMethodName,\n\t\tChildrenRepresentation,\n\t\tReducedChildrenRepresentation,\n\t\tRepresentation\n\t>\n\n\tpublic readonly options: BranchNodeOptions\n\n\tpublic constructor(\n\t\tfactoryMethodName: FactoryMethodName,\n\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tuseSiteFactory: UseSiteBranchNodeRepresentationFactory<\n\t\t\tProps,\n\t\t\tChildrenRepresentation,\n\t\t\tRepresentation,\n\t\t\tStaticContext\n\t\t>,\n\t\tComponentType?: ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tfactory:\n\t\t\t| FactoryMethodName\n\t\t\t| UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>,\n\t\tcomponentOrReducer?:\n\t\t\t| ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>\n\t\t\t| ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t) {\n\t\tif (typeof factory !== 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'declarationSite',\n\t\t\t\tfactoryMethodName: factory,\n\t\t\t\tchildrenRepresentationReducer: componentOrReducer as ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>,\n\t\t\t}\n\t\t} else if (typeof factory === 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'useSite',\n\t\t\t\tfactory,\n\t\t\t\tComponentType: componentOrReducer as ElementType<Props>,\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new ChildrenAnalyzerError('Invalid arguments')\n\t\t}\n\t\tthis.options = {\n\t\t\t...BranchNode.defaultOptions,\n\t\t\t...options,\n\t\t}\n\t}\n}\n\nnamespace BranchNode {\n\texport type Specification<\n\t\tProps extends {} = {},\n\t\tStaticContext = any,\n\t\tFactoryMethodName extends ValidFactoryName = string,\n\t\tChildrenRepresentation = any,\n\t\tReducedChildrenRepresentation = any,\n\t\tRepresentation = any,\n\t> =\n\t\t| {\n\t\t\t\ttype: 'declarationSite'\n\t\t\t\tfactoryMethodName: FactoryMethodName\n\t\t\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>\n\t\t }\n\t\t| {\n\t\t\t\ttype: 'useSite'\n\t\t\t\tfactory: UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>\n\t\t\t\tComponentType?: ElementType<Props>\n\t\t }\n}\n\nexport { BranchNode }\n"],"names":[],"mappings":";;;;;;;AAKA,MAAM,cAAN,
|
|
1
|
+
{"version":3,"file":"BranchNode.js","sources":["../../../src/nodeSpecs/BranchNode.ts"],"sourcesContent":["import type { ElementType } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\nimport type { BranchNodeOptions } from './BranchNodeOptions'\nimport type { ChildrenRepresentationReducer, UseSiteBranchNodeRepresentationFactory, ValidFactoryName } from './types'\n\nclass BranchNode<\n\tProps extends {} = {},\n\tStaticContext = undefined,\n\tFactoryMethodName extends ValidFactoryName = string,\n\tChildrenRepresentation = any,\n\tReducedChildrenRepresentation = any,\n\tRepresentation = any,\n> {\n\tprivate static defaultOptions: BranchNodeOptions = {\n\t\tchildrenAreOptional: false,\n\t\tchildrenAbsentErrorMessage: 'Component must have children!',\n\t}\n\n\tpublic readonly specification: BranchNode.Specification<\n\t\tProps,\n\t\tStaticContext,\n\t\tFactoryMethodName,\n\t\tChildrenRepresentation,\n\t\tReducedChildrenRepresentation,\n\t\tRepresentation\n\t>\n\n\tpublic readonly options: BranchNodeOptions\n\n\tpublic constructor(\n\t\tfactoryMethodName: FactoryMethodName,\n\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tuseSiteFactory: UseSiteBranchNodeRepresentationFactory<\n\t\t\tProps,\n\t\t\tChildrenRepresentation,\n\t\t\tRepresentation,\n\t\t\tStaticContext\n\t\t>,\n\t\tComponentType?: ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tfactory:\n\t\t\t| FactoryMethodName\n\t\t\t| UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>,\n\t\tcomponentOrReducer?:\n\t\t\t| ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>\n\t\t\t| ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t) {\n\t\tif (typeof factory !== 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'declarationSite',\n\t\t\t\tfactoryMethodName: factory,\n\t\t\t\tchildrenRepresentationReducer: componentOrReducer as ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>,\n\t\t\t}\n\t\t} else if (typeof factory === 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'useSite',\n\t\t\t\tfactory,\n\t\t\t\tComponentType: componentOrReducer as ElementType<Props>,\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new ChildrenAnalyzerError('Invalid arguments')\n\t\t}\n\t\tthis.options = {\n\t\t\t...BranchNode.defaultOptions,\n\t\t\t...options,\n\t\t}\n\t}\n}\n\nnamespace BranchNode {\n\texport type Specification<\n\t\tProps extends {} = {},\n\t\tStaticContext = any,\n\t\tFactoryMethodName extends ValidFactoryName = string,\n\t\tChildrenRepresentation = any,\n\t\tReducedChildrenRepresentation = any,\n\t\tRepresentation = any,\n\t> =\n\t\t| {\n\t\t\t\ttype: 'declarationSite'\n\t\t\t\tfactoryMethodName: FactoryMethodName\n\t\t\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>\n\t\t }\n\t\t| {\n\t\t\t\ttype: 'useSite'\n\t\t\t\tfactory: UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>\n\t\t\t\tComponentType?: ElementType<Props>\n\t\t }\n}\n\nexport { BranchNode }\n"],"names":[],"mappings":";;;;;;;AAKA,MAAM,cAAN,MAAM,YAOJ;AAAA,EAgCM,YACN,SAGA,oBAGA,SACC;AAlCc;AASA;AA0BX,QAAA,OAAO,YAAY,YAAY;AAClC,WAAK,gBAAgB;AAAA,QACpB,MAAM;AAAA,QACN,mBAAmB;AAAA,QACnB,+BAA+B;AAAA,MAAA;AAAA,IAIhC,WACU,OAAO,YAAY,YAAY;AACzC,WAAK,gBAAgB;AAAA,QACpB,MAAM;AAAA,QACN;AAAA,QACA,eAAe;AAAA,MAAA;AAAA,IAChB,OACM;AACA,YAAA,IAAI,sBAAsB,mBAAmB;AAAA,IACpD;AACA,SAAK,UAAU;AAAA,MACd,GAAG,YAAW;AAAA,MACd,GAAG;AAAA,IAAA;AAAA,EAEL;AACD;AA/DC,cARK,aAQU,kBAAoC;AAAA,EAClD,qBAAqB;AAAA,EACrB,4BAA4B;AAAA;AAV9B,IAAM,aAAN;"}
|
|
@@ -10,7 +10,7 @@ const utilities = require("@contember/utilities");
|
|
|
10
10
|
const ChildrenAnalyzerError = require("./ChildrenAnalyzerError.cjs");
|
|
11
11
|
const wrapError = require("./helpers/wrapError.cjs");
|
|
12
12
|
const getErrorMessage = require("./helpers/getErrorMessage.cjs");
|
|
13
|
-
const _ChildrenAnalyzer = class {
|
|
13
|
+
const _ChildrenAnalyzer = class _ChildrenAnalyzer {
|
|
14
14
|
constructor(leaves, decider = [], options = {}) {
|
|
15
15
|
__publicField(this, "leaves");
|
|
16
16
|
__publicField(this, "branchNodes");
|
|
@@ -157,8 +157,7 @@ const _ChildrenAnalyzer = class {
|
|
|
157
157
|
return processedChildren;
|
|
158
158
|
}
|
|
159
159
|
};
|
|
160
|
-
|
|
161
|
-
__publicField(ChildrenAnalyzer, "defaultOptions", {
|
|
160
|
+
__publicField(_ChildrenAnalyzer, "defaultOptions", {
|
|
162
161
|
ignoreRenderProps: true,
|
|
163
162
|
renderPropsErrorMessage: "Render props (functions as React component children) are not supported.",
|
|
164
163
|
ignoreUnhandledNodes: true,
|
|
@@ -166,5 +165,6 @@ __publicField(ChildrenAnalyzer, "defaultOptions", {
|
|
|
166
165
|
staticContextFactoryName: "getStaticContext",
|
|
167
166
|
staticRenderFactoryName: "staticRender"
|
|
168
167
|
});
|
|
168
|
+
let ChildrenAnalyzer = _ChildrenAnalyzer;
|
|
169
169
|
exports.ChildrenAnalyzer = ChildrenAnalyzer;
|
|
170
170
|
//# sourceMappingURL=ChildrenAnalyzer.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChildrenAnalyzer.cjs","sources":["../../src/ChildrenAnalyzer.ts"],"sourcesContent":["import { assertNever } from '@contember/utilities'\nimport type { ElementType, ReactElement, ReactNode } from 'react'\nimport type { BranchNodeList } from './BranchNodeList'\nimport { ChildrenAnalyzerError } from './ChildrenAnalyzerError'\nimport type { ChildrenAnalyzerOptions } from './ChildrenAnalyzerOptions'\nimport type { LeafList } from './LeafList'\nimport { getErrorMessage } from './helpers'\nimport { wrapError } from './helpers/wrapError'\nimport type {\n\tDeclarationSiteNodeRepresentationFactory,\n\tRawNodeRepresentation,\n\tStaticContextFactory,\n\tSyntheticChildrenFactory,\n\tUnconstrainedLeafRepresentationFactory,\n\tValidFactoryName,\n} from './nodeSpecs'\n\nexport class ChildrenAnalyzer<\n\tAllLeavesRepresentation = any,\n\tAllBranchNodesRepresentation = never,\n\tStaticContext = undefined,\n> {\n\tprivate static defaultOptions: ChildrenAnalyzerOptions = {\n\t\tignoreRenderProps: true,\n\t\trenderPropsErrorMessage: 'Render props (functions as React component children) are not supported.',\n\n\t\tignoreUnhandledNodes: true,\n\t\tunhandledNodeErrorMessage: 'Encountered an unknown child.',\n\n\t\tstaticContextFactoryName: 'getStaticContext',\n\t\tstaticRenderFactoryName: 'staticRender',\n\t}\n\n\tprivate readonly leaves: LeafList<AllLeavesRepresentation, StaticContext>\n\tprivate readonly branchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>\n\tprivate readonly options: ChildrenAnalyzerOptions<StaticContext>\n\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tbranchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tdecider:\n\t\t\t| Partial<ChildrenAnalyzerOptions>\n\t\t\t| BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext> = [],\n\t\toptions: Partial<ChildrenAnalyzerOptions> = {},\n\t) {\n\t\tthis.leaves = leaves\n\n\t\tif (Array.isArray(decider)) {\n\t\t\tthis.branchNodes = decider\n\t\t} else {\n\t\t\tthis.branchNodes = []\n\t\t\toptions = decider\n\t\t}\n\t\tthis.options = { ...ChildrenAnalyzer.defaultOptions, ...options }\n\t}\n\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tinitialStaticContext: StaticContext,\n\t): Array<AllLeavesRepresentation | AllBranchNodesRepresentation> {\n\t\tconst processed = this.processNode(children, initialStaticContext, [])\n\n\t\tconst rawResult: Array<AllLeavesRepresentation | AllBranchNodesRepresentation | undefined> = Array.isArray(\n\t\t\tprocessed,\n\t\t)\n\t\t\t? processed\n\t\t\t: [processed]\n\n\t\treturn rawResult.filter(\n\t\t\t(item): item is AllLeavesRepresentation | AllBranchNodesRepresentation => item !== undefined,\n\t\t)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tstaticContext: StaticContext,\n\t\tcomponentPath: ReactElement[],\n\t): RawNodeRepresentation<AllLeavesRepresentation, AllBranchNodesRepresentation> {\n\t\tif (!node || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tconst specification = leaf.specification\n\t\t\t\tif (specification.type === 'useSite') {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (node === false || node === undefined || node === null) {\n\t\t\t\t// This adds seamless support for conditionals and such.\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (!this.options.ignoreUnhandledNodes) {\n\t\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t\t}\n\t\t\treturn undefined\n\t\t}\n\n\t\tif (typeof node === 'function') {\n\t\t\tif (this.options.ignoreRenderProps) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.renderPropsErrorMessage, node, staticContext))\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\tlet mapped: Array<AllLeavesRepresentation | AllBranchNodesRepresentation> = []\n\n\t\t\tfor (const subNode of node) {\n\t\t\t\tconst processed = this.processNode(subNode, staticContext, componentPath)\n\n\t\t\t\tif (processed !== undefined) {\n\t\t\t\t\tif (Array.isArray(processed)) {\n\t\t\t\t\t\tmapped = mapped.concat(processed)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapped.push(processed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn mapped\n\t\t}\n\n\t\tlet children: ReactNode = undefined\n\n\t\tif (!('type' in node)) {\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\tchildren = node.props.children\n\n\t\tif (typeof node.type === 'symbol') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\t// if (typeof node.type === 'string') {\n\t\t// \t// Typically a host component\n\t\t// \tif (!this.options.ignoreUnhandledNodes) {\n\t\t// \t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t// \t}\n\t\t// \treturn this.processNode(children, staticContext)\n\t\t// }\n\n\t\t// Component, PureComponent, FunctionComponent\n\n\t\tconst treeNode = node.type as ElementType &\n\t\t\t{\n\t\t\t\t[staticMethod in ValidFactoryName]:\n\t\t\t\t| StaticContextFactory<any, StaticContext>\n\t\t\t\t| SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\t| UnconstrainedLeafRepresentationFactory<any, AllLeavesRepresentation, StaticContext>\n\t\t\t\t| DeclarationSiteNodeRepresentationFactory<any, unknown, AllBranchNodesRepresentation, StaticContext>\n\t\t\t}\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (typeof treeNode !== 'string') {\n\t\t\tif (this.options.staticContextFactoryName in treeNode) {\n\t\t\t\tconst staticContextFactory = treeNode[this.options.staticContextFactoryName] as StaticContextFactory<\n\t\t\t\t\tany,\n\t\t\t\t\tStaticContext\n\t\t\t\t>\n\t\t\t\ttry {\n\t\t\t\t\tstaticContext = staticContextFactory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticContextFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.options.staticRenderFactoryName in treeNode) {\n\t\t\t\tconst factory = treeNode[this.options.staticRenderFactoryName] as SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\ttry {\n\t\t\t\t\tchildren = factory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticRenderFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const leaf of this.leaves) {\n\t\t\tconst specification = leaf.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as UnconstrainedLeafRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tconst processedChildren = this.processNode(children, staticContext, componentPath)\n\n\t\tfor (const branchNode of this.branchNodes) {\n\t\t\tconst specification = branchNode.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName, childrenRepresentationReducer } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as DeclarationSiteNodeRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tunknown,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, childrenRepresentationReducer(processedChildren), staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { factory, ComponentType } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn factory(node, processedChildren, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!this.options.ignoreUnhandledNodes &&\n\t\t\t!(typeof treeNode !== 'string' && this.options.staticRenderFactoryName in treeNode)\n\t\t) {\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t}\n\n\t\treturn processedChildren\n\t}\n}\n"],"names":["ChildrenAnalyzerError","getErrorMessage","wrapError","assertNever"],"mappings":";;;;;;;;;;;;AAiBO,MAAM,oBAAN,MAIL;AAAA,EAyBM,YACN,QACA,UAE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A;AAAA,QACD;AAAA,QACA;AACC,iBAAOG,UAAAA,YAAY,aAAa;AAAA,MAClC;AAAA,IACD;AAGC,QAAA,CAAC,KAAK,QAAQ,wBACd,EAAE,OAAO,aAAa,YAAY,KAAK,QAAQ,2BAA2B,WACzE;AACK,YAAA,IAAIH,sBAAAA,sBAAsBC,gBAAAA,gBAAgB,KAAK,QAAQ,2BAA2B,MAAM,aAAa,CAAC;AAAA,IAC7G;AAEO,WAAA;AAAA,EACR;AACD;AAlPO,IAAM,mBAAN;AAKN,cALY,kBAKG,kBAA0C;AAAA,EACxD,mBAAmB;AAAA,EACnB,yBAAyB;AAAA,EAEzB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAE3B,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA;;"}
|
|
1
|
+
{"version":3,"file":"ChildrenAnalyzer.cjs","sources":["../../src/ChildrenAnalyzer.ts"],"sourcesContent":["import { assertNever } from '@contember/utilities'\nimport type { ElementType, ReactElement, ReactNode } from 'react'\nimport type { BranchNodeList } from './BranchNodeList'\nimport { ChildrenAnalyzerError } from './ChildrenAnalyzerError'\nimport type { ChildrenAnalyzerOptions } from './ChildrenAnalyzerOptions'\nimport type { LeafList } from './LeafList'\nimport { getErrorMessage } from './helpers'\nimport { wrapError } from './helpers/wrapError'\nimport type {\n\tDeclarationSiteNodeRepresentationFactory,\n\tRawNodeRepresentation,\n\tStaticContextFactory,\n\tSyntheticChildrenFactory,\n\tUnconstrainedLeafRepresentationFactory,\n\tValidFactoryName,\n} from './nodeSpecs'\n\nexport class ChildrenAnalyzer<\n\tAllLeavesRepresentation = any,\n\tAllBranchNodesRepresentation = never,\n\tStaticContext = undefined,\n> {\n\tprivate static defaultOptions: ChildrenAnalyzerOptions = {\n\t\tignoreRenderProps: true,\n\t\trenderPropsErrorMessage: 'Render props (functions as React component children) are not supported.',\n\n\t\tignoreUnhandledNodes: true,\n\t\tunhandledNodeErrorMessage: 'Encountered an unknown child.',\n\n\t\tstaticContextFactoryName: 'getStaticContext',\n\t\tstaticRenderFactoryName: 'staticRender',\n\t}\n\n\tprivate readonly leaves: LeafList<AllLeavesRepresentation, StaticContext>\n\tprivate readonly branchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>\n\tprivate readonly options: ChildrenAnalyzerOptions<StaticContext>\n\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tbranchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tdecider:\n\t\t\t| Partial<ChildrenAnalyzerOptions>\n\t\t\t| BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext> = [],\n\t\toptions: Partial<ChildrenAnalyzerOptions> = {},\n\t) {\n\t\tthis.leaves = leaves\n\n\t\tif (Array.isArray(decider)) {\n\t\t\tthis.branchNodes = decider\n\t\t} else {\n\t\t\tthis.branchNodes = []\n\t\t\toptions = decider\n\t\t}\n\t\tthis.options = { ...ChildrenAnalyzer.defaultOptions, ...options }\n\t}\n\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tinitialStaticContext: StaticContext,\n\t): Array<AllLeavesRepresentation | AllBranchNodesRepresentation> {\n\t\tconst processed = this.processNode(children, initialStaticContext, [])\n\n\t\tconst rawResult: Array<AllLeavesRepresentation | AllBranchNodesRepresentation | undefined> = Array.isArray(\n\t\t\tprocessed,\n\t\t)\n\t\t\t? processed\n\t\t\t: [processed]\n\n\t\treturn rawResult.filter(\n\t\t\t(item): item is AllLeavesRepresentation | AllBranchNodesRepresentation => item !== undefined,\n\t\t)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tstaticContext: StaticContext,\n\t\tcomponentPath: ReactElement[],\n\t): RawNodeRepresentation<AllLeavesRepresentation, AllBranchNodesRepresentation> {\n\t\tif (!node || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tconst specification = leaf.specification\n\t\t\t\tif (specification.type === 'useSite') {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (node === false || node === undefined || node === null) {\n\t\t\t\t// This adds seamless support for conditionals and such.\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (!this.options.ignoreUnhandledNodes) {\n\t\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t\t}\n\t\t\treturn undefined\n\t\t}\n\n\t\tif (typeof node === 'function') {\n\t\t\tif (this.options.ignoreRenderProps) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.renderPropsErrorMessage, node, staticContext))\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\tlet mapped: Array<AllLeavesRepresentation | AllBranchNodesRepresentation> = []\n\n\t\t\tfor (const subNode of node) {\n\t\t\t\tconst processed = this.processNode(subNode, staticContext, componentPath)\n\n\t\t\t\tif (processed !== undefined) {\n\t\t\t\t\tif (Array.isArray(processed)) {\n\t\t\t\t\t\tmapped = mapped.concat(processed)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapped.push(processed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn mapped\n\t\t}\n\n\t\tlet children: ReactNode = undefined\n\n\t\tif (!('type' in node)) {\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\tchildren = node.props.children\n\n\t\tif (typeof node.type === 'symbol') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\t// if (typeof node.type === 'string') {\n\t\t// \t// Typically a host component\n\t\t// \tif (!this.options.ignoreUnhandledNodes) {\n\t\t// \t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t// \t}\n\t\t// \treturn this.processNode(children, staticContext)\n\t\t// }\n\n\t\t// Component, PureComponent, FunctionComponent\n\n\t\tconst treeNode = node.type as ElementType &\n\t\t\t{\n\t\t\t\t[staticMethod in ValidFactoryName]:\n\t\t\t\t| StaticContextFactory<any, StaticContext>\n\t\t\t\t| SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\t| UnconstrainedLeafRepresentationFactory<any, AllLeavesRepresentation, StaticContext>\n\t\t\t\t| DeclarationSiteNodeRepresentationFactory<any, unknown, AllBranchNodesRepresentation, StaticContext>\n\t\t\t}\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (typeof treeNode !== 'string') {\n\t\t\tif (this.options.staticContextFactoryName in treeNode) {\n\t\t\t\tconst staticContextFactory = treeNode[this.options.staticContextFactoryName] as StaticContextFactory<\n\t\t\t\t\tany,\n\t\t\t\t\tStaticContext\n\t\t\t\t>\n\t\t\t\ttry {\n\t\t\t\t\tstaticContext = staticContextFactory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticContextFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.options.staticRenderFactoryName in treeNode) {\n\t\t\t\tconst factory = treeNode[this.options.staticRenderFactoryName] as SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\ttry {\n\t\t\t\t\tchildren = factory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticRenderFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const leaf of this.leaves) {\n\t\t\tconst specification = leaf.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as UnconstrainedLeafRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tconst processedChildren = this.processNode(children, staticContext, componentPath)\n\n\t\tfor (const branchNode of this.branchNodes) {\n\t\t\tconst specification = branchNode.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName, childrenRepresentationReducer } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as DeclarationSiteNodeRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tunknown,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, childrenRepresentationReducer(processedChildren), staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { factory, ComponentType } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn factory(node, processedChildren, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!this.options.ignoreUnhandledNodes &&\n\t\t\t!(typeof treeNode !== 'string' && this.options.staticRenderFactoryName in treeNode)\n\t\t) {\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t}\n\n\t\treturn processedChildren\n\t}\n}\n"],"names":["ChildrenAnalyzerError","getErrorMessage","wrapError","assertNever"],"mappings":";;;;;;;;;;;;AAiBO,MAAM,oBAAN,MAAM,kBAIX;AAAA,EAyBM,YACN,QACA,UAE0F,CAAA,GAC1F,UAA4C,CAAA,GAC3C;AAnBe;AACA;AACA;AAkBhB,SAAK,SAAS;AAEV,QAAA,MAAM,QAAQ,OAAO,GAAG;AAC3B,WAAK,cAAc;AAAA,IAAA,OACb;AACN,WAAK,cAAc;AACT,gBAAA;AAAA,IACX;AACA,SAAK,UAAU,EAAE,GAAG,kBAAiB,gBAAgB,GAAG;EACzD;AAAA,EAEO,gBACN,UACA,sBACgE;AAChE,UAAM,YAAY,KAAK,YAAY,UAAU,sBAAsB,CAAA,CAAE;AAErE,UAAM,YAAuF,MAAM;AAAA,MAClG;AAAA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yBAAyB;AAAA,EAEzB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAE3B,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA;AAbpB,IAAM,mBAAN;;"}
|
|
@@ -8,7 +8,7 @@ import { assertNever } from "@contember/utilities";
|
|
|
8
8
|
import { ChildrenAnalyzerError } from "./ChildrenAnalyzerError.js";
|
|
9
9
|
import { wrapError } from "./helpers/wrapError.js";
|
|
10
10
|
import { getErrorMessage } from "./helpers/getErrorMessage.js";
|
|
11
|
-
const _ChildrenAnalyzer = class {
|
|
11
|
+
const _ChildrenAnalyzer = class _ChildrenAnalyzer {
|
|
12
12
|
constructor(leaves, decider = [], options = {}) {
|
|
13
13
|
__publicField(this, "leaves");
|
|
14
14
|
__publicField(this, "branchNodes");
|
|
@@ -155,8 +155,7 @@ const _ChildrenAnalyzer = class {
|
|
|
155
155
|
return processedChildren;
|
|
156
156
|
}
|
|
157
157
|
};
|
|
158
|
-
|
|
159
|
-
__publicField(ChildrenAnalyzer, "defaultOptions", {
|
|
158
|
+
__publicField(_ChildrenAnalyzer, "defaultOptions", {
|
|
160
159
|
ignoreRenderProps: true,
|
|
161
160
|
renderPropsErrorMessage: "Render props (functions as React component children) are not supported.",
|
|
162
161
|
ignoreUnhandledNodes: true,
|
|
@@ -164,6 +163,7 @@ __publicField(ChildrenAnalyzer, "defaultOptions", {
|
|
|
164
163
|
staticContextFactoryName: "getStaticContext",
|
|
165
164
|
staticRenderFactoryName: "staticRender"
|
|
166
165
|
});
|
|
166
|
+
let ChildrenAnalyzer = _ChildrenAnalyzer;
|
|
167
167
|
export {
|
|
168
168
|
ChildrenAnalyzer
|
|
169
169
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChildrenAnalyzer.js","sources":["../../src/ChildrenAnalyzer.ts"],"sourcesContent":["import { assertNever } from '@contember/utilities'\nimport type { ElementType, ReactElement, ReactNode } from 'react'\nimport type { BranchNodeList } from './BranchNodeList'\nimport { ChildrenAnalyzerError } from './ChildrenAnalyzerError'\nimport type { ChildrenAnalyzerOptions } from './ChildrenAnalyzerOptions'\nimport type { LeafList } from './LeafList'\nimport { getErrorMessage } from './helpers'\nimport { wrapError } from './helpers/wrapError'\nimport type {\n\tDeclarationSiteNodeRepresentationFactory,\n\tRawNodeRepresentation,\n\tStaticContextFactory,\n\tSyntheticChildrenFactory,\n\tUnconstrainedLeafRepresentationFactory,\n\tValidFactoryName,\n} from './nodeSpecs'\n\nexport class ChildrenAnalyzer<\n\tAllLeavesRepresentation = any,\n\tAllBranchNodesRepresentation = never,\n\tStaticContext = undefined,\n> {\n\tprivate static defaultOptions: ChildrenAnalyzerOptions = {\n\t\tignoreRenderProps: true,\n\t\trenderPropsErrorMessage: 'Render props (functions as React component children) are not supported.',\n\n\t\tignoreUnhandledNodes: true,\n\t\tunhandledNodeErrorMessage: 'Encountered an unknown child.',\n\n\t\tstaticContextFactoryName: 'getStaticContext',\n\t\tstaticRenderFactoryName: 'staticRender',\n\t}\n\n\tprivate readonly leaves: LeafList<AllLeavesRepresentation, StaticContext>\n\tprivate readonly branchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>\n\tprivate readonly options: ChildrenAnalyzerOptions<StaticContext>\n\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tbranchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tdecider:\n\t\t\t| Partial<ChildrenAnalyzerOptions>\n\t\t\t| BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext> = [],\n\t\toptions: Partial<ChildrenAnalyzerOptions> = {},\n\t) {\n\t\tthis.leaves = leaves\n\n\t\tif (Array.isArray(decider)) {\n\t\t\tthis.branchNodes = decider\n\t\t} else {\n\t\t\tthis.branchNodes = []\n\t\t\toptions = decider\n\t\t}\n\t\tthis.options = { ...ChildrenAnalyzer.defaultOptions, ...options }\n\t}\n\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tinitialStaticContext: StaticContext,\n\t): Array<AllLeavesRepresentation | AllBranchNodesRepresentation> {\n\t\tconst processed = this.processNode(children, initialStaticContext, [])\n\n\t\tconst rawResult: Array<AllLeavesRepresentation | AllBranchNodesRepresentation | undefined> = Array.isArray(\n\t\t\tprocessed,\n\t\t)\n\t\t\t? processed\n\t\t\t: [processed]\n\n\t\treturn rawResult.filter(\n\t\t\t(item): item is AllLeavesRepresentation | AllBranchNodesRepresentation => item !== undefined,\n\t\t)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tstaticContext: StaticContext,\n\t\tcomponentPath: ReactElement[],\n\t): RawNodeRepresentation<AllLeavesRepresentation, AllBranchNodesRepresentation> {\n\t\tif (!node || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tconst specification = leaf.specification\n\t\t\t\tif (specification.type === 'useSite') {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (node === false || node === undefined || node === null) {\n\t\t\t\t// This adds seamless support for conditionals and such.\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (!this.options.ignoreUnhandledNodes) {\n\t\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t\t}\n\t\t\treturn undefined\n\t\t}\n\n\t\tif (typeof node === 'function') {\n\t\t\tif (this.options.ignoreRenderProps) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.renderPropsErrorMessage, node, staticContext))\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\tlet mapped: Array<AllLeavesRepresentation | AllBranchNodesRepresentation> = []\n\n\t\t\tfor (const subNode of node) {\n\t\t\t\tconst processed = this.processNode(subNode, staticContext, componentPath)\n\n\t\t\t\tif (processed !== undefined) {\n\t\t\t\t\tif (Array.isArray(processed)) {\n\t\t\t\t\t\tmapped = mapped.concat(processed)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapped.push(processed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn mapped\n\t\t}\n\n\t\tlet children: ReactNode = undefined\n\n\t\tif (!('type' in node)) {\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\tchildren = node.props.children\n\n\t\tif (typeof node.type === 'symbol') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\t// if (typeof node.type === 'string') {\n\t\t// \t// Typically a host component\n\t\t// \tif (!this.options.ignoreUnhandledNodes) {\n\t\t// \t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t// \t}\n\t\t// \treturn this.processNode(children, staticContext)\n\t\t// }\n\n\t\t// Component, PureComponent, FunctionComponent\n\n\t\tconst treeNode = node.type as ElementType &\n\t\t\t{\n\t\t\t\t[staticMethod in ValidFactoryName]:\n\t\t\t\t| StaticContextFactory<any, StaticContext>\n\t\t\t\t| SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\t| UnconstrainedLeafRepresentationFactory<any, AllLeavesRepresentation, StaticContext>\n\t\t\t\t| DeclarationSiteNodeRepresentationFactory<any, unknown, AllBranchNodesRepresentation, StaticContext>\n\t\t\t}\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (typeof treeNode !== 'string') {\n\t\t\tif (this.options.staticContextFactoryName in treeNode) {\n\t\t\t\tconst staticContextFactory = treeNode[this.options.staticContextFactoryName] as StaticContextFactory<\n\t\t\t\t\tany,\n\t\t\t\t\tStaticContext\n\t\t\t\t>\n\t\t\t\ttry {\n\t\t\t\t\tstaticContext = staticContextFactory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticContextFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.options.staticRenderFactoryName in treeNode) {\n\t\t\t\tconst factory = treeNode[this.options.staticRenderFactoryName] as SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\ttry {\n\t\t\t\t\tchildren = factory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticRenderFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const leaf of this.leaves) {\n\t\t\tconst specification = leaf.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as UnconstrainedLeafRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tconst processedChildren = this.processNode(children, staticContext, componentPath)\n\n\t\tfor (const branchNode of this.branchNodes) {\n\t\t\tconst specification = branchNode.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName, childrenRepresentationReducer } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as DeclarationSiteNodeRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tunknown,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, childrenRepresentationReducer(processedChildren), staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { factory, ComponentType } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn factory(node, processedChildren, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!this.options.ignoreUnhandledNodes &&\n\t\t\t!(typeof treeNode !== 'string' && this.options.staticRenderFactoryName in treeNode)\n\t\t) {\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this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Q,0BAA0B;AAAA,YAC9E;AACO,mBAAA,QAAQ,MAAM,mBAAmB,aAAa;AAAA,UACtD;AACA;AAAA,QACD;AAAA,QACA;AACC,iBAAO,YAAY,aAAa;AAAA,MAClC;AAAA,IACD;AAGC,QAAA,CAAC,KAAK,QAAQ,wBACd,EAAE,OAAO,aAAa,YAAY,KAAK,QAAQ,2BAA2B,WACzE;AACK,YAAA,IAAI,sBAAsB,gBAAgB,KAAK,QAAQ,2BAA2B,MAAM,aAAa,CAAC;AAAA,IAC7G;AAEO,WAAA;AAAA,EACR;AACD;AAlPO,IAAM,mBAAN;AAKN,cALY,kBAKG,kBAA0C;AAAA,EACxD,mBAAmB;AAAA,EACnB,yBAAyB;AAAA,EAEzB,sBAAsB;AAAA,EACtB,2BAA2B;AAAA,EAE3B,0BAA0B;AAAA,EAC1B,yBAAyB;AAAA;"}
|
|
1
|
+
{"version":3,"file":"ChildrenAnalyzer.js","sources":["../../src/ChildrenAnalyzer.ts"],"sourcesContent":["import { assertNever } from '@contember/utilities'\nimport type { ElementType, ReactElement, ReactNode } from 'react'\nimport type { BranchNodeList } from './BranchNodeList'\nimport { ChildrenAnalyzerError } from './ChildrenAnalyzerError'\nimport type { ChildrenAnalyzerOptions } from './ChildrenAnalyzerOptions'\nimport type { LeafList } from './LeafList'\nimport { getErrorMessage } from './helpers'\nimport { wrapError } from './helpers/wrapError'\nimport type {\n\tDeclarationSiteNodeRepresentationFactory,\n\tRawNodeRepresentation,\n\tStaticContextFactory,\n\tSyntheticChildrenFactory,\n\tUnconstrainedLeafRepresentationFactory,\n\tValidFactoryName,\n} from './nodeSpecs'\n\nexport class ChildrenAnalyzer<\n\tAllLeavesRepresentation = any,\n\tAllBranchNodesRepresentation = never,\n\tStaticContext = undefined,\n> {\n\tprivate static defaultOptions: ChildrenAnalyzerOptions = {\n\t\tignoreRenderProps: true,\n\t\trenderPropsErrorMessage: 'Render props (functions as React component children) are not supported.',\n\n\t\tignoreUnhandledNodes: true,\n\t\tunhandledNodeErrorMessage: 'Encountered an unknown child.',\n\n\t\tstaticContextFactoryName: 'getStaticContext',\n\t\tstaticRenderFactoryName: 'staticRender',\n\t}\n\n\tprivate readonly leaves: LeafList<AllLeavesRepresentation, StaticContext>\n\tprivate readonly branchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>\n\tprivate readonly options: ChildrenAnalyzerOptions<StaticContext>\n\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tbranchNodes: BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext>,\n\t\toptions?: Partial<ChildrenAnalyzerOptions>,\n\t)\n\tpublic constructor(\n\t\tleaves: LeafList<AllLeavesRepresentation, StaticContext>,\n\t\tdecider:\n\t\t\t| Partial<ChildrenAnalyzerOptions>\n\t\t\t| BranchNodeList<AllLeavesRepresentation, AllBranchNodesRepresentation, StaticContext> = [],\n\t\toptions: Partial<ChildrenAnalyzerOptions> = {},\n\t) {\n\t\tthis.leaves = leaves\n\n\t\tif (Array.isArray(decider)) {\n\t\t\tthis.branchNodes = decider\n\t\t} else {\n\t\t\tthis.branchNodes = []\n\t\t\toptions = decider\n\t\t}\n\t\tthis.options = { ...ChildrenAnalyzer.defaultOptions, ...options }\n\t}\n\n\tpublic processChildren(\n\t\tchildren: ReactNode,\n\t\tinitialStaticContext: StaticContext,\n\t): Array<AllLeavesRepresentation | AllBranchNodesRepresentation> {\n\t\tconst processed = this.processNode(children, initialStaticContext, [])\n\n\t\tconst rawResult: Array<AllLeavesRepresentation | AllBranchNodesRepresentation | undefined> = Array.isArray(\n\t\t\tprocessed,\n\t\t)\n\t\t\t? processed\n\t\t\t: [processed]\n\n\t\treturn rawResult.filter(\n\t\t\t(item): item is AllLeavesRepresentation | AllBranchNodesRepresentation => item !== undefined,\n\t\t)\n\t}\n\n\tprivate processNode(\n\t\tnode: ReactNode,\n\t\tstaticContext: StaticContext,\n\t\tcomponentPath: ReactElement[],\n\t): RawNodeRepresentation<AllLeavesRepresentation, AllBranchNodesRepresentation> {\n\t\tif (!node || typeof node === 'string' || typeof node === 'number' || typeof node === 'boolean') {\n\t\t\tfor (const leaf of this.leaves) {\n\t\t\t\tconst specification = leaf.specification\n\t\t\t\tif (specification.type === 'useSite') {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (node === false || node === undefined || node === null) {\n\t\t\t\t// This adds seamless support for conditionals and such.\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tif (!this.options.ignoreUnhandledNodes) {\n\t\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t\t}\n\t\t\treturn undefined\n\t\t}\n\n\t\tif (typeof node === 'function') {\n\t\t\tif (this.options.ignoreRenderProps) {\n\t\t\t\treturn undefined\n\t\t\t}\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.renderPropsErrorMessage, node, staticContext))\n\t\t}\n\n\t\tif (Array.isArray(node)) {\n\t\t\tlet mapped: Array<AllLeavesRepresentation | AllBranchNodesRepresentation> = []\n\n\t\t\tfor (const subNode of node) {\n\t\t\t\tconst processed = this.processNode(subNode, staticContext, componentPath)\n\n\t\t\t\tif (processed !== undefined) {\n\t\t\t\t\tif (Array.isArray(processed)) {\n\t\t\t\t\t\tmapped = mapped.concat(processed)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmapped.push(processed)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn mapped\n\t\t}\n\n\t\tlet children: ReactNode = undefined\n\n\t\tif (!('type' in node)) {\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\tchildren = node.props.children\n\n\t\tif (typeof node.type === 'symbol') {\n\t\t\t// Fragment, Portal or other non-component\n\t\t\treturn this.processNode(children, staticContext, componentPath)\n\t\t}\n\t\t// if (typeof node.type === 'string') {\n\t\t// \t// Typically a host component\n\t\t// \tif (!this.options.ignoreUnhandledNodes) {\n\t\t// \t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t// \t}\n\t\t// \treturn this.processNode(children, staticContext)\n\t\t// }\n\n\t\t// Component, PureComponent, FunctionComponent\n\n\t\tconst treeNode = node.type as ElementType &\n\t\t\t{\n\t\t\t\t[staticMethod in ValidFactoryName]:\n\t\t\t\t| StaticContextFactory<any, StaticContext>\n\t\t\t\t| SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\t| UnconstrainedLeafRepresentationFactory<any, AllLeavesRepresentation, StaticContext>\n\t\t\t\t| DeclarationSiteNodeRepresentationFactory<any, unknown, AllBranchNodesRepresentation, StaticContext>\n\t\t\t}\n\n\t\tcomponentPath = [...componentPath, node]\n\t\tif (typeof treeNode !== 'string') {\n\t\t\tif (this.options.staticContextFactoryName in treeNode) {\n\t\t\t\tconst staticContextFactory = treeNode[this.options.staticContextFactoryName] as StaticContextFactory<\n\t\t\t\t\tany,\n\t\t\t\t\tStaticContext\n\t\t\t\t>\n\t\t\t\ttry {\n\t\t\t\t\tstaticContext = staticContextFactory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticContextFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.options.staticRenderFactoryName in treeNode) {\n\t\t\t\tconst factory = treeNode[this.options.staticRenderFactoryName] as SyntheticChildrenFactory<any, StaticContext>\n\t\t\t\ttry {\n\t\t\t\t\tchildren = factory(node.props, staticContext)\n\t\t\t\t} catch (e) {\n\t\t\t\t\twrapError(e, treeNode.displayName ?? '???', this.options.staticRenderFactoryName, componentPath)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (const leaf of this.leaves) {\n\t\t\tconst specification = leaf.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as UnconstrainedLeafRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { ComponentType, factory } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\treturn factory(node, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tconst processedChildren = this.processNode(children, staticContext, componentPath)\n\n\t\tfor (const branchNode of this.branchNodes) {\n\t\t\tconst specification = branchNode.specification\n\t\t\tswitch (specification.type) {\n\t\t\t\tcase 'declarationSite': {\n\t\t\t\t\tconst { factoryMethodName, childrenRepresentationReducer } = specification\n\n\t\t\t\t\tif (typeof treeNode !== 'string' && factoryMethodName in treeNode) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst factory = treeNode[factoryMethodName] as DeclarationSiteNodeRepresentationFactory<\n\t\t\t\t\t\t\tany,\n\t\t\t\t\t\t\tunknown,\n\t\t\t\t\t\t\tAllBranchNodesRepresentation | AllLeavesRepresentation,\n\t\t\t\t\t\t\tStaticContext\n\t\t\t\t\t\t>\n\t\t\t\t\t\treturn factory(node.props, childrenRepresentationReducer(processedChildren), staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tcase 'useSite': {\n\t\t\t\t\tconst { factory, ComponentType } = specification\n\t\t\t\t\tif (ComponentType === undefined || node.type === ComponentType) {\n\t\t\t\t\t\tif (processedChildren === undefined && !branchNode.options.childrenAreOptional) {\n\t\t\t\t\t\t\tthrow new ChildrenAnalyzerError(branchNode.options.childrenAbsentErrorMessage)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn factory(node, processedChildren, staticContext)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t\tdefault:\n\t\t\t\t\treturn assertNever(specification)\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\t!this.options.ignoreUnhandledNodes &&\n\t\t\t!(typeof treeNode !== 'string' && this.options.staticRenderFactoryName in treeNode)\n\t\t) {\n\t\t\tthrow new ChildrenAnalyzerError(getErrorMessage(this.options.unhandledNodeErrorMessage, node, staticContext))\n\t\t}\n\n\t\treturn processedChildren\n\t}\n}\n"],"names":[],"mappings":";;;;;;;;;;AAiBO,MAAM,oBAAN,MAAM,kBAIX;AAAA,EAyBM,YACN,QACA,UAE0F,CAAA,GAC1F,UAA4C,CAAA,GAC3C;AAnBe;AACA;AACA;AAkBhB,SAAK,SAAS;AAEV,QAAA,MAAM,QAAQ,OAAO,GAAG;AAC3B,WAAK,cAAc;AAAA,IAAA,OACb;AACN,WAAK,cAAc;AACT,gBAAA;AAAA,IACX;AACA,SAAK,UAAU,EAAE,GAAG,kBAAiB,gBAAgB,GAAG;EACzD;AAAA,EAEO,gBACN,UACA,sBACgE;AAChE,UAAM,YAAY,KAAK,YAAY,UAAU,sBAAsB,CAAA,CAAE;AAErE,UAAM,YAAuF,MAAM;AAAA,MA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BAAyB;AAAA;AAbpB,IAAM,mBAAN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapError.cjs","sources":["../../../src/helpers/wrapError.ts"],"sourcesContent":["import React, { ReactElement } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\n\nexport const wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value","ChildrenAnalyzerError"],"mappings":";;;;AAGO,MAAM,YAAY,CAAC,GAAY,sBAA8B,YAAoB,SAAgC;AACnH,MAAA,EAAE,aAAa,QAAQ;AACpB,UAAA;AAAA,EACP;AAEA,QAAM,gBAAgB,KAAK,IAAI,CAAC,IAAI,UAAU;AAC7C,UAAM,EAAE,UAAU,GAAG,MAAA,IAAU,GAAG;AAC5B,UAAA,aAAa,CAACA,WAAe;AAClC,UAAI,SAAS;AACb,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQA,MAAK,GAAG;AACjD,YAAI,UAAU,QAAW;AACxB;AAAA,QACD;AACI,YAAA;AACH,gBAAM,eAAe,KAAK;AAAA,YAAU;AAAA,YAAO,CAACC,MAAKC,WAAU;AACrD,kBAAA,OAAOA,WAAU,YAAY;AACzB,uBAAA;AAAA,cACR;AACI,kBAAA,MAAM,eAAeA,MAAK,GAAG;AACzB,uBAAA;AAAA,cACR;AACOA,qBAAAA;AAAAA,YACR;AAAA,UAAA;
|
|
1
|
+
{"version":3,"file":"wrapError.cjs","sources":["../../../src/helpers/wrapError.ts"],"sourcesContent":["import React, { ReactElement } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\n\nexport const wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value","ChildrenAnalyzerError"],"mappings":";;;;AAGO,MAAM,YAAY,CAAC,GAAY,sBAA8B,YAAoB,SAAgC;AACnH,MAAA,EAAE,aAAa,QAAQ;AACpB,UAAA;AAAA,EACP;AAEA,QAAM,gBAAgB,KAAK,IAAI,CAAC,IAAI,UAAU;AAC7C,UAAM,EAAE,UAAU,GAAG,MAAA,IAAU,GAAG;AAC5B,UAAA,aAAa,CAACA,WAAe;AAClC,UAAI,SAAS;AACb,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQA,MAAK,GAAG;AACjD,YAAI,UAAU,QAAW;AACxB;AAAA,QACD;AACI,YAAA;AACH,gBAAM,eAAe,KAAK;AAAA,YAAU;AAAA,YAAO,CAACC,MAAKC,WAAU;AACrD,kBAAA,OAAOA,WAAU,YAAY;AACzB,uBAAA;AAAA,cACR;AACI,kBAAA,MAAM,eAAeA,MAAK,GAAG;AACzB,uBAAA;AAAA,cACR;AACOA,qBAAAA;AAAAA,YACR;AAAA,UAAA;AAES,oBAAA,IAAI,GAAG,IAAI,YAAY;AAAA,QAAA,QAC1B;AACP,oBAAU,IAAI,GAAG;AAAA,QAClB;AAAA,MACD;AACO,aAAA;AAAA,IAAA;AAEF,UAAA,gBAAgB,OAAO,GAAG,SAAS,YAAY,iBAAiB,GAAG,OAAQ,GAAG,KAAa,cAAc;AACzG,UAAA,eAAe,WAAW,KAAK;AAC/B,UAAA,SAAS,KAAK,OAAO,KAAK;AAChC,WAAO,GAAG,MAAM,IAAI,iBAAiB,KAAK,GAAG,YAAY;AAAA,EAAA,CACzD;AACD,QAAM,eAAe,iCAAiC,oBAAoB,OAAO,UAAU;AAAA,EAAM,EAAE,WAAW,eAAe;AAEvH,QAAA,IAAIC,4CAAsB,cAAc;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EAAoB,cAAc,KAAK,IAAI,CAAC;AAAA,EAAA,CACrD;AACF;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapError.js","sources":["../../../src/helpers/wrapError.ts"],"sourcesContent":["import React, { ReactElement } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\n\nexport const wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value"],"mappings":";;AAGO,MAAM,YAAY,CAAC,GAAY,sBAA8B,YAAoB,SAAgC;AACnH,MAAA,EAAE,aAAa,QAAQ;AACpB,UAAA;AAAA,EACP;AAEA,QAAM,gBAAgB,KAAK,IAAI,CAAC,IAAI,UAAU;AAC7C,UAAM,EAAE,UAAU,GAAG,MAAA,IAAU,GAAG;AAC5B,UAAA,aAAa,CAACA,WAAe;AAClC,UAAI,SAAS;AACb,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQA,MAAK,GAAG;AACjD,YAAI,UAAU,QAAW;AACxB;AAAA,QACD;AACI,YAAA;AACH,gBAAM,eAAe,KAAK;AAAA,YAAU;AAAA,YAAO,CAACC,MAAKC,WAAU;AACrD,kBAAA,OAAOA,WAAU,YAAY;AACzB,uBAAA;AAAA,cACR;AACI,kBAAA,MAAM,eAAeA,MAAK,GAAG;AACzB,uBAAA;AAAA,cACR;AACOA,qBAAAA;AAAAA,YACR;AAAA,UAAA;
|
|
1
|
+
{"version":3,"file":"wrapError.js","sources":["../../../src/helpers/wrapError.ts"],"sourcesContent":["import React, { ReactElement } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\n\nexport const wrapError = (e: unknown, currentComponentName: string, methodName: string, path: ReactElement[]): never => {\n\tif (!(e instanceof Error)) {\n\t\tthrow e\n\t}\n\n\tconst componentPath = path.map((it, index) => {\n\t\tconst { children, ...props } = it.props\n\t\tconst printProps = (props: any) => {\n\t\t\tlet result = ''\n\t\t\tfor (const [key, value] of Object.entries(props)) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tconst valuePrinted = JSON.stringify(value, (key, value) => {\n\t\t\t\t\t\t\tif (typeof value === 'function') {\n\t\t\t\t\t\t\t\treturn '(function)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (React.isValidElement(value)) {\n\t\t\t\t\t\t\t\treturn '(react element)'\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t},\n\t\t\t\t\t)\n\t\t\t\t\tresult += ` ${key}=${valuePrinted}`\n\t\t\t\t} catch {\n\t\t\t\t\tresult += ` ${key}=(failed to print a value)`\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result\n\t\t}\n\t\tconst componentName = typeof it.type === 'object' && 'displayName' in it.type ? (it.type as any).displayName : null\n\t\tconst propsPrinted = printProps(props)\n\t\tconst indent = ' '.repeat(index)\n\t\treturn `${indent}<${componentName ?? '???'}${propsPrinted}>`\n\t})\n\tconst errorMessage = `Error during static render of ${currentComponentName} in ${methodName}:\\n${e.message || 'unknown error'}`\n\n\tthrow new ChildrenAnalyzerError(errorMessage, {\n\t\tcause: e,\n\t\tdetails: `Component path:\\n${componentPath.join('\\n')}`,\n\t})\n}\n"],"names":["props","key","value"],"mappings":";;AAGO,MAAM,YAAY,CAAC,GAAY,sBAA8B,YAAoB,SAAgC;AACnH,MAAA,EAAE,aAAa,QAAQ;AACpB,UAAA;AAAA,EACP;AAEA,QAAM,gBAAgB,KAAK,IAAI,CAAC,IAAI,UAAU;AAC7C,UAAM,EAAE,UAAU,GAAG,MAAA,IAAU,GAAG;AAC5B,UAAA,aAAa,CAACA,WAAe;AAClC,UAAI,SAAS;AACb,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQA,MAAK,GAAG;AACjD,YAAI,UAAU,QAAW;AACxB;AAAA,QACD;AACI,YAAA;AACH,gBAAM,eAAe,KAAK;AAAA,YAAU;AAAA,YAAO,CAACC,MAAKC,WAAU;AACrD,kBAAA,OAAOA,WAAU,YAAY;AACzB,uBAAA;AAAA,cACR;AACI,kBAAA,MAAM,eAAeA,MAAK,GAAG;AACzB,uBAAA;AAAA,cACR;AACOA,qBAAAA;AAAAA,YACR;AAAA,UAAA;AAES,oBAAA,IAAI,GAAG,IAAI,YAAY;AAAA,QAAA,QAC1B;AACP,oBAAU,IAAI,GAAG;AAAA,QAClB;AAAA,MACD;AACO,aAAA;AAAA,IAAA;AAEF,UAAA,gBAAgB,OAAO,GAAG,SAAS,YAAY,iBAAiB,GAAG,OAAQ,GAAG,KAAa,cAAc;AACzG,UAAA,eAAe,WAAW,KAAK;AAC/B,UAAA,SAAS,KAAK,OAAO,KAAK;AAChC,WAAO,GAAG,MAAM,IAAI,iBAAiB,KAAK,GAAG,YAAY;AAAA,EAAA,CACzD;AACD,QAAM,eAAe,iCAAiC,oBAAoB,OAAO,UAAU;AAAA,EAAM,EAAE,WAAW,eAAe;AAEvH,QAAA,IAAI,sBAAsB,cAAc;AAAA,IAC7C,OAAO;AAAA,IACP,SAAS;AAAA,EAAoB,cAAc,KAAK,IAAI,CAAC;AAAA,EAAA,CACrD;AACF;"}
|
|
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => {
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
9
9
|
const ChildrenAnalyzerError = require("../ChildrenAnalyzerError.cjs");
|
|
10
|
-
const _BranchNode = class {
|
|
10
|
+
const _BranchNode = class _BranchNode {
|
|
11
11
|
constructor(factory, componentOrReducer, options) {
|
|
12
12
|
__publicField(this, "specification");
|
|
13
13
|
__publicField(this, "options");
|
|
@@ -32,10 +32,10 @@ const _BranchNode = class {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
|
|
36
|
-
__publicField(BranchNode, "defaultOptions", {
|
|
35
|
+
__publicField(_BranchNode, "defaultOptions", {
|
|
37
36
|
childrenAreOptional: false,
|
|
38
37
|
childrenAbsentErrorMessage: "Component must have children!"
|
|
39
38
|
});
|
|
39
|
+
let BranchNode = _BranchNode;
|
|
40
40
|
exports.BranchNode = BranchNode;
|
|
41
41
|
//# sourceMappingURL=BranchNode.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchNode.cjs","sources":["../../../src/nodeSpecs/BranchNode.ts"],"sourcesContent":["import type { ElementType } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\nimport type { BranchNodeOptions } from './BranchNodeOptions'\nimport type { ChildrenRepresentationReducer, UseSiteBranchNodeRepresentationFactory, ValidFactoryName } from './types'\n\nclass BranchNode<\n\tProps extends {} = {},\n\tStaticContext = undefined,\n\tFactoryMethodName extends ValidFactoryName = string,\n\tChildrenRepresentation = any,\n\tReducedChildrenRepresentation = any,\n\tRepresentation = any,\n> {\n\tprivate static defaultOptions: BranchNodeOptions = {\n\t\tchildrenAreOptional: false,\n\t\tchildrenAbsentErrorMessage: 'Component must have children!',\n\t}\n\n\tpublic readonly specification: BranchNode.Specification<\n\t\tProps,\n\t\tStaticContext,\n\t\tFactoryMethodName,\n\t\tChildrenRepresentation,\n\t\tReducedChildrenRepresentation,\n\t\tRepresentation\n\t>\n\n\tpublic readonly options: BranchNodeOptions\n\n\tpublic constructor(\n\t\tfactoryMethodName: FactoryMethodName,\n\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tuseSiteFactory: UseSiteBranchNodeRepresentationFactory<\n\t\t\tProps,\n\t\t\tChildrenRepresentation,\n\t\t\tRepresentation,\n\t\t\tStaticContext\n\t\t>,\n\t\tComponentType?: ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tfactory:\n\t\t\t| FactoryMethodName\n\t\t\t| UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>,\n\t\tcomponentOrReducer?:\n\t\t\t| ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>\n\t\t\t| ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t) {\n\t\tif (typeof factory !== 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'declarationSite',\n\t\t\t\tfactoryMethodName: factory,\n\t\t\t\tchildrenRepresentationReducer: componentOrReducer as ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>,\n\t\t\t}\n\t\t} else if (typeof factory === 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'useSite',\n\t\t\t\tfactory,\n\t\t\t\tComponentType: componentOrReducer as ElementType<Props>,\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new ChildrenAnalyzerError('Invalid arguments')\n\t\t}\n\t\tthis.options = {\n\t\t\t...BranchNode.defaultOptions,\n\t\t\t...options,\n\t\t}\n\t}\n}\n\nnamespace BranchNode {\n\texport type Specification<\n\t\tProps extends {} = {},\n\t\tStaticContext = any,\n\t\tFactoryMethodName extends ValidFactoryName = string,\n\t\tChildrenRepresentation = any,\n\t\tReducedChildrenRepresentation = any,\n\t\tRepresentation = any,\n\t> =\n\t\t| {\n\t\t\t\ttype: 'declarationSite'\n\t\t\t\tfactoryMethodName: FactoryMethodName\n\t\t\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>\n\t\t }\n\t\t| {\n\t\t\t\ttype: 'useSite'\n\t\t\t\tfactory: UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>\n\t\t\t\tComponentType?: ElementType<Props>\n\t\t }\n}\n\nexport { BranchNode }\n"],"names":["ChildrenAnalyzerError"],"mappings":";;;;;;;;;AAKA,MAAM,cAAN,
|
|
1
|
+
{"version":3,"file":"BranchNode.cjs","sources":["../../../src/nodeSpecs/BranchNode.ts"],"sourcesContent":["import type { ElementType } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\nimport type { BranchNodeOptions } from './BranchNodeOptions'\nimport type { ChildrenRepresentationReducer, UseSiteBranchNodeRepresentationFactory, ValidFactoryName } from './types'\n\nclass BranchNode<\n\tProps extends {} = {},\n\tStaticContext = undefined,\n\tFactoryMethodName extends ValidFactoryName = string,\n\tChildrenRepresentation = any,\n\tReducedChildrenRepresentation = any,\n\tRepresentation = any,\n> {\n\tprivate static defaultOptions: BranchNodeOptions = {\n\t\tchildrenAreOptional: false,\n\t\tchildrenAbsentErrorMessage: 'Component must have children!',\n\t}\n\n\tpublic readonly specification: BranchNode.Specification<\n\t\tProps,\n\t\tStaticContext,\n\t\tFactoryMethodName,\n\t\tChildrenRepresentation,\n\t\tReducedChildrenRepresentation,\n\t\tRepresentation\n\t>\n\n\tpublic readonly options: BranchNodeOptions\n\n\tpublic constructor(\n\t\tfactoryMethodName: FactoryMethodName,\n\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tuseSiteFactory: UseSiteBranchNodeRepresentationFactory<\n\t\t\tProps,\n\t\t\tChildrenRepresentation,\n\t\t\tRepresentation,\n\t\t\tStaticContext\n\t\t>,\n\t\tComponentType?: ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tfactory:\n\t\t\t| FactoryMethodName\n\t\t\t| UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>,\n\t\tcomponentOrReducer?:\n\t\t\t| ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>\n\t\t\t| ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t) {\n\t\tif (typeof factory !== 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'declarationSite',\n\t\t\t\tfactoryMethodName: factory,\n\t\t\t\tchildrenRepresentationReducer: componentOrReducer as ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>,\n\t\t\t}\n\t\t} else if (typeof factory === 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'useSite',\n\t\t\t\tfactory,\n\t\t\t\tComponentType: componentOrReducer as ElementType<Props>,\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new ChildrenAnalyzerError('Invalid arguments')\n\t\t}\n\t\tthis.options = {\n\t\t\t...BranchNode.defaultOptions,\n\t\t\t...options,\n\t\t}\n\t}\n}\n\nnamespace BranchNode {\n\texport type Specification<\n\t\tProps extends {} = {},\n\t\tStaticContext = any,\n\t\tFactoryMethodName extends ValidFactoryName = string,\n\t\tChildrenRepresentation = any,\n\t\tReducedChildrenRepresentation = any,\n\t\tRepresentation = any,\n\t> =\n\t\t| {\n\t\t\t\ttype: 'declarationSite'\n\t\t\t\tfactoryMethodName: FactoryMethodName\n\t\t\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>\n\t\t }\n\t\t| {\n\t\t\t\ttype: 'useSite'\n\t\t\t\tfactory: UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>\n\t\t\t\tComponentType?: ElementType<Props>\n\t\t }\n}\n\nexport { BranchNode }\n"],"names":["ChildrenAnalyzerError"],"mappings":";;;;;;;;;AAKA,MAAM,cAAN,MAAM,YAOJ;AAAA,EAgCM,YACN,SAGA,oBAGA,SACC;AAlCc;AASA;AA0BX,QAAA,OAAO,YAAY,YAAY;AAClC,WAAK,gBAAgB;AAAA,QACpB,MAAM;AAAA,QACN,mBAAmB;AAAA,QACnB,+BAA+B;AAAA,MAAA;AAAA,IAIhC,WACU,OAAO,YAAY,YAAY;AACzC,WAAK,gBAAgB;AAAA,QACpB,MAAM;AAAA,QACN;AAAA,QACA,eAAe;AAAA,MAAA;AAAA,IAChB,OACM;AACA,YAAA,IAAIA,sBAAAA,sBAAsB,mBAAmB;AAAA,IACpD;AACA,SAAK,UAAU;AAAA,MACd,GAAG,YAAW;AAAA,MACd,GAAG;AAAA,IAAA;AAAA,EAEL;AACD;AA/DC,cARK,aAQU,kBAAoC;AAAA,EAClD,qBAAqB;AAAA,EACrB,4BAA4B;AAAA;AAV9B,IAAM,aAAN;;"}
|
|
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
|
|
|
5
5
|
return value;
|
|
6
6
|
};
|
|
7
7
|
import { ChildrenAnalyzerError } from "../ChildrenAnalyzerError.js";
|
|
8
|
-
const _BranchNode = class {
|
|
8
|
+
const _BranchNode = class _BranchNode {
|
|
9
9
|
constructor(factory, componentOrReducer, options) {
|
|
10
10
|
__publicField(this, "specification");
|
|
11
11
|
__publicField(this, "options");
|
|
@@ -30,11 +30,11 @@ const _BranchNode = class {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
|
-
|
|
34
|
-
__publicField(BranchNode, "defaultOptions", {
|
|
33
|
+
__publicField(_BranchNode, "defaultOptions", {
|
|
35
34
|
childrenAreOptional: false,
|
|
36
35
|
childrenAbsentErrorMessage: "Component must have children!"
|
|
37
36
|
});
|
|
37
|
+
let BranchNode = _BranchNode;
|
|
38
38
|
export {
|
|
39
39
|
BranchNode
|
|
40
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BranchNode.js","sources":["../../../src/nodeSpecs/BranchNode.ts"],"sourcesContent":["import type { ElementType } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\nimport type { BranchNodeOptions } from './BranchNodeOptions'\nimport type { ChildrenRepresentationReducer, UseSiteBranchNodeRepresentationFactory, ValidFactoryName } from './types'\n\nclass BranchNode<\n\tProps extends {} = {},\n\tStaticContext = undefined,\n\tFactoryMethodName extends ValidFactoryName = string,\n\tChildrenRepresentation = any,\n\tReducedChildrenRepresentation = any,\n\tRepresentation = any,\n> {\n\tprivate static defaultOptions: BranchNodeOptions = {\n\t\tchildrenAreOptional: false,\n\t\tchildrenAbsentErrorMessage: 'Component must have children!',\n\t}\n\n\tpublic readonly specification: BranchNode.Specification<\n\t\tProps,\n\t\tStaticContext,\n\t\tFactoryMethodName,\n\t\tChildrenRepresentation,\n\t\tReducedChildrenRepresentation,\n\t\tRepresentation\n\t>\n\n\tpublic readonly options: BranchNodeOptions\n\n\tpublic constructor(\n\t\tfactoryMethodName: FactoryMethodName,\n\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tuseSiteFactory: UseSiteBranchNodeRepresentationFactory<\n\t\t\tProps,\n\t\t\tChildrenRepresentation,\n\t\t\tRepresentation,\n\t\t\tStaticContext\n\t\t>,\n\t\tComponentType?: ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tfactory:\n\t\t\t| FactoryMethodName\n\t\t\t| UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>,\n\t\tcomponentOrReducer?:\n\t\t\t| ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>\n\t\t\t| ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t) {\n\t\tif (typeof factory !== 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'declarationSite',\n\t\t\t\tfactoryMethodName: factory,\n\t\t\t\tchildrenRepresentationReducer: componentOrReducer as ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>,\n\t\t\t}\n\t\t} else if (typeof factory === 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'useSite',\n\t\t\t\tfactory,\n\t\t\t\tComponentType: componentOrReducer as ElementType<Props>,\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new ChildrenAnalyzerError('Invalid arguments')\n\t\t}\n\t\tthis.options = {\n\t\t\t...BranchNode.defaultOptions,\n\t\t\t...options,\n\t\t}\n\t}\n}\n\nnamespace BranchNode {\n\texport type Specification<\n\t\tProps extends {} = {},\n\t\tStaticContext = any,\n\t\tFactoryMethodName extends ValidFactoryName = string,\n\t\tChildrenRepresentation = any,\n\t\tReducedChildrenRepresentation = any,\n\t\tRepresentation = any,\n\t> =\n\t\t| {\n\t\t\t\ttype: 'declarationSite'\n\t\t\t\tfactoryMethodName: FactoryMethodName\n\t\t\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>\n\t\t }\n\t\t| {\n\t\t\t\ttype: 'useSite'\n\t\t\t\tfactory: UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>\n\t\t\t\tComponentType?: ElementType<Props>\n\t\t }\n}\n\nexport { BranchNode }\n"],"names":[],"mappings":";;;;;;;AAKA,MAAM,cAAN,
|
|
1
|
+
{"version":3,"file":"BranchNode.js","sources":["../../../src/nodeSpecs/BranchNode.ts"],"sourcesContent":["import type { ElementType } from 'react'\nimport { ChildrenAnalyzerError } from '../ChildrenAnalyzerError'\nimport type { BranchNodeOptions } from './BranchNodeOptions'\nimport type { ChildrenRepresentationReducer, UseSiteBranchNodeRepresentationFactory, ValidFactoryName } from './types'\n\nclass BranchNode<\n\tProps extends {} = {},\n\tStaticContext = undefined,\n\tFactoryMethodName extends ValidFactoryName = string,\n\tChildrenRepresentation = any,\n\tReducedChildrenRepresentation = any,\n\tRepresentation = any,\n> {\n\tprivate static defaultOptions: BranchNodeOptions = {\n\t\tchildrenAreOptional: false,\n\t\tchildrenAbsentErrorMessage: 'Component must have children!',\n\t}\n\n\tpublic readonly specification: BranchNode.Specification<\n\t\tProps,\n\t\tStaticContext,\n\t\tFactoryMethodName,\n\t\tChildrenRepresentation,\n\t\tReducedChildrenRepresentation,\n\t\tRepresentation\n\t>\n\n\tpublic readonly options: BranchNodeOptions\n\n\tpublic constructor(\n\t\tfactoryMethodName: FactoryMethodName,\n\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tuseSiteFactory: UseSiteBranchNodeRepresentationFactory<\n\t\t\tProps,\n\t\t\tChildrenRepresentation,\n\t\t\tRepresentation,\n\t\t\tStaticContext\n\t\t>,\n\t\tComponentType?: ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t)\n\tpublic constructor(\n\t\tfactory:\n\t\t\t| FactoryMethodName\n\t\t\t| UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>,\n\t\tcomponentOrReducer?:\n\t\t\t| ChildrenRepresentationReducer<ChildrenRepresentation, ReducedChildrenRepresentation>\n\t\t\t| ElementType<Props>,\n\t\toptions?: Partial<BranchNodeOptions>,\n\t) {\n\t\tif (typeof factory !== 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'declarationSite',\n\t\t\t\tfactoryMethodName: factory,\n\t\t\t\tchildrenRepresentationReducer: componentOrReducer as ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>,\n\t\t\t}\n\t\t} else if (typeof factory === 'function') {\n\t\t\tthis.specification = {\n\t\t\t\ttype: 'useSite',\n\t\t\t\tfactory,\n\t\t\t\tComponentType: componentOrReducer as ElementType<Props>,\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new ChildrenAnalyzerError('Invalid arguments')\n\t\t}\n\t\tthis.options = {\n\t\t\t...BranchNode.defaultOptions,\n\t\t\t...options,\n\t\t}\n\t}\n}\n\nnamespace BranchNode {\n\texport type Specification<\n\t\tProps extends {} = {},\n\t\tStaticContext = any,\n\t\tFactoryMethodName extends ValidFactoryName = string,\n\t\tChildrenRepresentation = any,\n\t\tReducedChildrenRepresentation = any,\n\t\tRepresentation = any,\n\t> =\n\t\t| {\n\t\t\t\ttype: 'declarationSite'\n\t\t\t\tfactoryMethodName: FactoryMethodName\n\t\t\t\tchildrenRepresentationReducer: ChildrenRepresentationReducer<\n\t\t\t\t\tChildrenRepresentation,\n\t\t\t\t\tReducedChildrenRepresentation\n\t\t\t\t>\n\t\t }\n\t\t| {\n\t\t\t\ttype: 'useSite'\n\t\t\t\tfactory: UseSiteBranchNodeRepresentationFactory<Props, ChildrenRepresentation, Representation, StaticContext>\n\t\t\t\tComponentType?: ElementType<Props>\n\t\t }\n}\n\nexport { BranchNode }\n"],"names":[],"mappings":";;;;;;;AAKA,MAAM,cAAN,MAAM,YAOJ;AAAA,EAgCM,YACN,SAGA,oBAGA,SACC;AAlCc;AASA;AA0BX,QAAA,OAAO,YAAY,YAAY;AAClC,WAAK,gBAAgB;AAAA,QACpB,MAAM;AAAA,QACN,mBAAmB;AAAA,QACnB,+BAA+B;AAAA,MAAA;AAAA,IAIhC,WACU,OAAO,YAAY,YAAY;AACzC,WAAK,gBAAgB;AAAA,QACpB,MAAM;AAAA,QACN;AAAA,QACA,eAAe;AAAA,MAAA;AAAA,IAChB,OACM;AACA,YAAA,IAAI,sBAAsB,mBAAmB;AAAA,IACpD;AACA,SAAK,UAAU;AAAA,MACd,GAAG,YAAW;AAAA,MACd,GAAG;AAAA,IAAA;AAAA,EAEL;AACD;AA/DC,cARK,aAQU,kBAAoC;AAAA,EAClD,qBAAqB;AAAA,EACrB,4BAA4B;AAAA;AAV9B,IAAM,aAAN;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/@types/react/ts5.0/global.d.ts","../../../../node_modules/@types/react/node_modules/csstype/index.d.ts","../../../../node_modules/@types/prop-types/index.d.ts","../../../../node_modules/@types/scheduler/tracing.d.ts","../../../../node_modules/@types/react/ts5.0/index.d.ts","../../../../node_modules/@types/react/ts5.0/jsx-runtime.d.ts","../../src/nodeSpecs/types/ChildrenRepresentationReducer.ts","../../src/nodeSpecs/types/ConstrainedLeafRepresentationFactory.ts","../../src/nodeSpecs/types/DeclarationSiteNodeRepresentationFactory.ts","../../src/nodeSpecs/types/RepresentationFactorySite.ts","../../src/nodeSpecs/types/StaticContextFactory.ts","../../src/nodeSpecs/types/SyntheticChildrenFactory.ts","../../src/nodeSpecs/types/UnconstrainedLeafRepresentationFactory.ts","../../src/nodeSpecs/types/UseSiteBranchNodeRepresentationFactory.ts","../../src/nodeSpecs/types/ValidFactoryName.ts","../../src/nodeSpecs/types/index.ts","../../src/ChildrenAnalyzerError.ts","../../src/nodeSpecs/BranchNodeOptions.ts","../../src/nodeSpecs/BranchNode.ts","../../src/nodeSpecs/Leaf.ts","../../src/nodeSpecs/RawNodeRepresentation.ts","../../src/nodeSpecs/index.ts","../../src/BranchNodeList.ts","../../../utilities/dist/types/assert-types/AssertionError.d.ts","../../../../node_modules/type-fest/source/primitive.d.ts","../../../../node_modules/type-fest/source/typed-array.d.ts","../../../../node_modules/type-fest/source/basic.d.ts","../../../../node_modules/type-fest/source/observable-like.d.ts","../../../../node_modules/type-fest/source/empty-object.d.ts","../../../../node_modules/type-fest/source/is-equal.d.ts","../../../../node_modules/type-fest/source/except.d.ts","../../../../node_modules/type-fest/source/tagged-union.d.ts","../../../../node_modules/type-fest/source/simplify.d.ts","../../../../node_modules/type-fest/source/writable.d.ts","../../../../node_modules/type-fest/source/trim.d.ts","../../../../node_modules/type-fest/source/is-any.d.ts","../../../../node_modules/type-fest/source/internal.d.ts","../../../../node_modules/type-fest/source/writable-deep.d.ts","../../../../node_modules/type-fest/source/omit-index-signature.d.ts","../../../../node_modules/type-fest/source/pick-index-signature.d.ts","../../../../node_modules/type-fest/source/enforce-optional.d.ts","../../../../node_modules/type-fest/source/merge.d.ts","../../../../node_modules/type-fest/source/conditional-simplify.d.ts","../../../../node_modules/type-fest/source/merge-deep.d.ts","../../../../node_modules/type-fest/source/merge-exclusive.d.ts","../../../../node_modules/type-fest/source/require-at-least-one.d.ts","../../../../node_modules/type-fest/source/require-exactly-one.d.ts","../../../../node_modules/type-fest/source/require-all-or-none.d.ts","../../../../node_modules/type-fest/source/partial-deep.d.ts","../../../../node_modules/type-fest/source/required-deep.d.ts","../../../../node_modules/type-fest/source/partial-on-undefined-deep.d.ts","../../../../node_modules/type-fest/source/readonly-deep.d.ts","../../../../node_modules/type-fest/source/literal-union.d.ts","../../../../node_modules/type-fest/source/promisable.d.ts","../../../../node_modules/type-fest/source/opaque.d.ts","../../../../node_modules/type-fest/source/invariant-of.d.ts","../../../../node_modules/type-fest/source/set-optional.d.ts","../../../../node_modules/type-fest/source/set-readonly.d.ts","../../../../node_modules/type-fest/source/set-required.d.ts","../../../../node_modules/type-fest/source/set-non-nullable.d.ts","../../../../node_modules/type-fest/source/value-of.d.ts","../../../../node_modules/type-fest/source/async-return-type.d.ts","../../../../node_modules/type-fest/source/conditional-keys.d.ts","../../../../node_modules/type-fest/source/conditional-except.d.ts","../../../../node_modules/type-fest/source/conditional-pick.d.ts","../../../../node_modules/type-fest/source/conditional-pick-deep.d.ts","../../../../node_modules/type-fest/source/union-to-intersection.d.ts","../../../../node_modules/type-fest/source/stringified.d.ts","../../../../node_modules/type-fest/source/fixed-length-array.d.ts","../../../../node_modules/type-fest/source/multidimensional-array.d.ts","../../../../node_modules/type-fest/source/multidimensional-readonly-array.d.ts","../../../../node_modules/type-fest/source/iterable-element.d.ts","../../../../node_modules/type-fest/source/entry.d.ts","../../../../node_modules/type-fest/source/entries.d.ts","../../../../node_modules/type-fest/source/is-unknown.d.ts","../../../../node_modules/type-fest/source/set-return-type.d.ts","../../../../node_modules/type-fest/source/asyncify.d.ts","../../../../node_modules/type-fest/source/numeric.d.ts","../../../../node_modules/type-fest/source/jsonify.d.ts","../../../../node_modules/type-fest/source/jsonifiable.d.ts","../../../../node_modules/type-fest/source/schema.d.ts","../../../../node_modules/type-fest/source/literal-to-primitive.d.ts","../../../../node_modules/type-fest/source/literal-to-primitive-deep.d.ts","../../../../node_modules/type-fest/source/string-key-of.d.ts","../../../../node_modules/type-fest/source/exact.d.ts","../../../../node_modules/type-fest/source/readonly-tuple.d.ts","../../../../node_modules/type-fest/source/optional-keys-of.d.ts","../../../../node_modules/type-fest/source/override-properties.d.ts","../../../../node_modules/type-fest/source/has-optional-keys.d.ts","../../../../node_modules/type-fest/source/required-keys-of.d.ts","../../../../node_modules/type-fest/source/has-required-keys.d.ts","../../../../node_modules/type-fest/source/readonly-keys-of.d.ts","../../../../node_modules/type-fest/source/writable-keys-of.d.ts","../../../../node_modules/type-fest/source/spread.d.ts","../../../../node_modules/type-fest/source/tuple-to-union.d.ts","../../../../node_modules/type-fest/source/is-never.d.ts","../../../../node_modules/type-fest/source/is-literal.d.ts","../../../../node_modules/type-fest/source/if-any.d.ts","../../../../node_modules/type-fest/source/if-never.d.ts","../../../../node_modules/type-fest/source/if-unknown.d.ts","../../../../node_modules/type-fest/source/split-words.d.ts","../../../../node_modules/type-fest/source/camel-case.d.ts","../../../../node_modules/type-fest/source/camel-cased-properties.d.ts","../../../../node_modules/type-fest/source/camel-cased-properties-deep.d.ts","../../../../node_modules/type-fest/source/delimiter-case.d.ts","../../../../node_modules/type-fest/source/kebab-case.d.ts","../../../../node_modules/type-fest/source/delimiter-cased-properties.d.ts","../../../../node_modules/type-fest/source/kebab-cased-properties.d.ts","../../../../node_modules/type-fest/source/delimiter-cased-properties-deep.d.ts","../../../../node_modules/type-fest/source/kebab-cased-properties-deep.d.ts","../../../../node_modules/type-fest/source/pascal-case.d.ts","../../../../node_modules/type-fest/source/pascal-cased-properties.d.ts","../../../../node_modules/type-fest/source/pascal-cased-properties-deep.d.ts","../../../../node_modules/type-fest/source/snake-case.d.ts","../../../../node_modules/type-fest/source/snake-cased-properties.d.ts","../../../../node_modules/type-fest/source/snake-cased-properties-deep.d.ts","../../../../node_modules/type-fest/source/includes.d.ts","../../../../node_modules/type-fest/source/screaming-snake-case.d.ts","../../../../node_modules/type-fest/source/join.d.ts","../../../../node_modules/type-fest/source/split.d.ts","../../../../node_modules/type-fest/source/replace.d.ts","../../../../node_modules/type-fest/source/get.d.ts","../../../../node_modules/type-fest/source/last-array-element.d.ts","../../../../node_modules/type-fest/source/global-this.d.ts","../../../../node_modules/type-fest/source/package-json.d.ts","../../../../node_modules/type-fest/source/tsconfig-json.d.ts","../../../../node_modules/type-fest/index.d.ts","../../../utilities/dist/types/assert-types/types.d.ts","../../../utilities/dist/types/assert-types/Predicates.d.ts","../../../utilities/dist/types/assert-types/assert.d.ts","../../../utilities/dist/types/assert-types/assertNever.d.ts","../../../utilities/dist/types/assert-types/index.d.ts","../../../utilities/dist/types/class-name/types.d.ts","../../../utilities/dist/types/class-name/colorSchemeClassName.d.ts","../../../utilities/dist/types/class-name/constants.d.ts","../../../utilities/dist/types/class-name/deduplicateClassName.d.ts","../../../utilities/dist/types/class-name/filterThemedClassName.d.ts","../../../utilities/dist/types/class-name/flatClassNameList.d.ts","../../../utilities/dist/types/class-name/listClassName.d.ts","../../../utilities/dist/types/class-name/stateClassName.d.ts","../../../utilities/dist/types/class-name/themeClassName.d.ts","../../../utilities/dist/types/class-name/index.d.ts","../../../utilities/dist/types/css-utilities/px.d.ts","../../../utilities/dist/types/css-utilities/index.d.ts","../../../utilities/dist/types/data-utilities/dateToStringWithoutTimezone.d.ts","../../../utilities/dist/types/data-utilities/index.d.ts","../../../utilities/dist/types/deprecate/types.d.ts","../../../utilities/dist/types/deprecate/deprecate.d.ts","../../../utilities/dist/types/deprecate/fallback.d.ts","../../../utilities/dist/types/deprecate/index.d.ts","../../../utilities/dist/types/dom/dataAttribute.d.ts","../../../utilities/dist/types/dom/getElementDimensions.d.ts","../../../utilities/dist/types/dom/getMatchingParentElement.d.ts","../../../utilities/dist/types/dom/getSizeFromResizeObserverEntry.d.ts","../../../utilities/dist/types/dom/isScrollable.d.ts","../../../utilities/dist/types/dom/parseTransformMatrix.d.ts","../../../utilities/dist/types/dom/shouldCancelStart.d.ts","../../../utilities/dist/types/dom/stateDataAttributes.d.ts","../../../utilities/dist/types/dom/svgSizeProps.d.ts","../../../utilities/dist/types/dom/index.d.ts","../../../utilities/dist/types/functional/extend.d.ts","../../../utilities/dist/types/functional/omit.d.ts","../../../utilities/dist/types/functional/pick.d.ts","../../../utilities/dist/types/functional/range.d.ts","../../../utilities/dist/types/functional/setHasOneOf.d.ts","../../../utilities/dist/types/functional/index.d.ts","../../../utilities/dist/types/string-utilities/capitalize.d.ts","../../../utilities/dist/types/string-utilities/kebabCase.d.ts","../../../utilities/dist/types/string-utilities/trimString.d.ts","../../../utilities/dist/types/string-utilities/index.d.ts","../../../utilities/dist/types/types/Any.d.ts","../../../utilities/dist/types/types/DeepPartial.d.ts","../../../utilities/dist/types/types/Try.d.ts","../../../utilities/dist/types/types/Narrow.d.ts","../../../utilities/dist/types/types/NonNullableRequired.d.ts","../../../utilities/dist/types/types/NonOptional.d.ts","../../../utilities/dist/types/types/ObjectKeyValue.d.ts","../../../utilities/dist/types/types/PolymorphicRefs.d.ts","../../../utilities/dist/types/types/Primitive.d.ts","../../../utilities/dist/types/types/RequiredDeepPlainObject.d.ts","../../../utilities/dist/types/types/TypeofStringLiteral.d.ts","../../../utilities/dist/types/types/index.d.ts","../../../utilities/dist/types/index.d.ts","../../src/ErrorMessageFactory.ts","../../src/ChildrenAnalyzerOptions.ts","../../src/LeafList.ts","../../src/helpers/getErrorMessage.ts","../../src/helpers/index.ts","../../src/helpers/wrapError.ts","../../src/ChildrenAnalyzer.ts","../../src/index.ts","../../../../node_modules/vite/types/hmrPayload.d.ts","../../../../node_modules/vite/types/customEvent.d.ts","../../../../node_modules/vite/types/hot.d.ts","../../../../node_modules/vite/types/importGlob.d.ts","../../../../node_modules/vite/types/importMeta.d.ts","../../../../node_modules/vite/client.d.ts"],"fileInfos":[{"version":"6a6b471e7e43e15ef6f8fe617a22ce4ecb0e34efa6c3dfcfe7cebd392bcca9d2","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","dc48272d7c333ccf58034c0026162576b7d50ea0e69c3b9292f803fc20720fd5","27147504487dc1159369da4f4da8a26406364624fa9bc3db632f7d94a5bae2c3","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","f4e736d6c8d69ae5b3ab0ddfcaa3dc365c3e76909d6660af5b4e979b3934ac20","eeeb3aca31fbadef8b82502484499dfd1757204799a6f5b33116201c810676ec",{"version":"fcd3ecc9f764f06f4d5c467677f4f117f6abf49dee6716283aa204ff1162498b","affectsGlobalScope":true},{"version":"9a60b92bca4c1257db03b349d58e63e4868cfc0d1c8d0ba60c2dbc63f4e6c9f6","affectsGlobalScope":true},{"version":"f296963760430fb65b4e5d91f0ed770a91c6e77455bacf8fa23a1501654ede0e","affectsGlobalScope":true},{"version":"5114a95689b63f96b957e00216bc04baf9e1a1782aa4d8ee7e5e9acbf768e301","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"ab22100fdd0d24cfc2cc59d0a00fc8cf449830d9c4030dc54390a46bd562e929","affectsGlobalScope":true},{"version":"f7bd636ae3a4623c503359ada74510c4005df5b36de7f23e1db8a5c543fd176b","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"0c20f4d2358eb679e4ae8a4432bdd96c857a2960fd6800b21ec4008ec59d60ea","affectsGlobalScope":true},{"version":"36ae84ccc0633f7c0787bc6108386c8b773e95d3b052d9464a99cd9b8795fbec","affectsGlobalScope":true},{"version":"82d0d8e269b9eeac02c3bd1c9e884e85d483fcb2cd168bccd6bc54df663da031","affectsGlobalScope":true},{"version":"b8deab98702588840be73d67f02412a2d45a417a3c097b2e96f7f3a42ac483d1","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"376d554d042fb409cb55b5cbaf0b2b4b7e669619493c5d18d5fa8bd67273f82a","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"c4138a3dd7cd6cf1f363ca0f905554e8d81b45844feea17786cdf1626cb8ea06","affectsGlobalScope":true},{"version":"6ff3e2452b055d8f0ec026511c6582b55d935675af67cdb67dd1dc671e8065df","affectsGlobalScope":true},{"version":"03de17b810f426a2f47396b0b99b53a82c1b60e9cba7a7edda47f9bb077882f4","affectsGlobalScope":true},{"version":"8184c6ddf48f0c98429326b428478ecc6143c27f79b79e85740f17e6feb090f1","affectsGlobalScope":true},{"version":"261c4d2cf86ac5a89ad3fb3fafed74cbb6f2f7c1d139b0540933df567d64a6ca","affectsGlobalScope":true},{"version":"6af1425e9973f4924fca986636ac19a0cf9909a7e0d9d3009c349e6244e957b6","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"15a630d6817718a2ddd7088c4f83e4673fde19fa992d2eae2cf51132a302a5d3","affectsGlobalScope":true},{"version":"b7e9f95a7387e3f66be0ed6db43600c49cec33a3900437ce2fd350d9b7cb16f2","affectsGlobalScope":true},{"version":"01e0ee7e1f661acedb08b51f8a9b7d7f959e9cdb6441360f06522cc3aea1bf2e","affectsGlobalScope":true},{"version":"ac17a97f816d53d9dd79b0d235e1c0ed54a8cc6a0677e9a3d61efb480b2a3e4e","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"9cc66b0513ad41cb5f5372cca86ef83a0d37d1c1017580b7dace3ea5661836df","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"709efdae0cb5df5f49376cde61daacc95cdd44ae4671da13a540da5088bf3f30","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"61ed9b6d07af959e745fb11f9593ecd743b279418cc8a99448ea3cd5f3b3eb22","affectsGlobalScope":true},{"version":"038a2f66a34ee7a9c2fbc3584c8ab43dff2995f8c68e3f566f4c300d2175e31e","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"f5c92f2c27b06c1a41b88f6db8299205aee52c2a2943f7ed29bd585977f254e8","affectsGlobalScope":true},{"version":"b7feb7967c6c6003e11f49efa8f5de989484e0a6ba2e5a6c41b55f8b8bd85dba","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"b9ea5778ff8b50d7c04c9890170db34c26a5358cccba36844fe319f50a43a61a","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"25de46552b782d43cb7284df22fe2a265de387cf0248b747a7a1b647d81861f6","affectsGlobalScope":true},{"version":"307c8b7ebbd7f23a92b73a4c6c0a697beca05b06b036c23a34553e5fe65e4fdc","affectsGlobalScope":true},{"version":"189c0703923150aa30673fa3de411346d727cc44a11c75d05d7cf9ef095daa22","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"49a253ec027e56c55c7450a0c331cfe96212b3d1cc215b1710ba94a083404cf3","affectsGlobalScope":true},"1c29793071152b207c01ea1954e343be9a44d85234447b2b236acae9e709a383","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"278fe30e638dad09488d130287c728f99f61cb315ed86b70c36040e4311f9cf5","affectsGlobalScope":true},"af7fd2870746deed40e130fc0a3966de74e8f52a97ec114d0fbb35876ab05ca9",{"version":"a9c21d8c1022cf7c134e33b95bd38d792b1353749e4312b8bf184baf1c6e6186","signature":"476e595a4d19de9f46348c8beebbf708978ab592862917cfa284780b00b82013"},{"version":"a2d99deb45290e2ad3be8e8db687f498eaa5f857ddc0f081045911d2408d6f65","signature":"bcdb41180dc8b3bb7766cb0157b00608cf6fcc39569ec1c87245b27a32168944"},{"version":"2c4b09e2886389ac8a6fb4a763de72b30fd22b29ad194bd7a7b966f409e2d20c","signature":"aefa16b954029ecc8800e851c52942c6b0d1b19b4b8cf179ceb2eeed40250339"},{"version":"f46736b4c4956a380050bbe5fc4dc914bfc70e7561cd6a6889d0854bbad6c053","signature":"e2396536f60d5fb378182b2cf695c4fe0f44b98a65cb11de7aa540640a49f32f"},{"version":"cfb7cbd7db2fb7f997b2cf652191042e72e322b9c04c161cfd8b74f759ab6ab5","signature":"29e86258bae9032d4a41ae819636bd2c5f2b2aef9d02000341debb0c45d88ab1"},{"version":"09128331d23e062378d0354e5b9cf8da6ff27dd61d1942966d730b1f22e80e7f","signature":"95092929201ee7ed4cfe82827a3f2628cab74e9f725f68a31ffaf897c197051a"},{"version":"b5c303499a3c43d8170ed36dc7b3f233524ff3e99f8f3319960165537b387ce8","signature":"3c8a5b67937216b02b9a21cf8614b56b2679bf6725f64d51e89b53ca72f4fd80"},{"version":"867982da569cd55c28d3c2178a67e32d2ad58002b815f623a3049aa39a3a6c5c","signature":"a985c9f8618c0c7ed35b85798f017ab899078b29b54786d0ada07045804dc20b"},{"version":"da33c798c79471b84e7325268e2b07d5659dab29e44e222cec3a4261d75c11a8","signature":"003ac502c8f5df7f026e2b1afaeb386e58433d4ef6d7c2ea5e74197084aea9d6"},{"version":"457190a697618a8153922ff3142e8a306a6db160b92acee3de08206a4b3659f5","signature":"ac2f98183ecd3fbae9b7af51efeefe3bcaa2acf6f150fe776afe73444b3a7d43"},{"version":"e4b30974841000a2f00e89ac2cfa8a063766e69131e31ee521267af0bab4cfd5","signature":"ec33c9ae91ebe33329992a166653817225f9ebc08835c8bac7270a6be763d55c"},{"version":"81d8157c53cd3457cefeee525e509da21a28e61e131d6c23cdb99570d4f171c0","signature":"d519308aedac3bb98d355832e80d9d988570ef945649255bcc0988b91a6157d6"},{"version":"7327aedbd450b22a519aff0b7e4f93553463b578136415764de7727ebddf2d44","signature":"2c1c6fe63c4985cfb439f248eca2fba14446a21c3c7afc254c85c492ceb7174a"},{"version":"cdfa71e29fc4507f0beabef37debe8e361ac525d5b22b0c02588855dea59a948","signature":"4a744a8145a44cb9a0df124bc8b86c448fa9bf8f176ac8e9c5777cae919b0bad"},{"version":"a24a9885385ca27603b8bdf0f7b19ea2f045cb7e38a85458a7c7908c0cd9b111","signature":"ec0c9bf6132e535c80f3cca0800e105bb651543ea1ff3f80530dbb9f94e76d7b"},{"version":"bd48adca38f6d32cec918e4dffe5e5b4a71cfe27dd2e26fb5dd07b23fd7ed1f7","signature":"2b8997bd989157a95291c8106ae6d8851d1400176d68a56e88b1ae1da3467682"},{"version":"795a8d3c1116f076ad63ca53a0e9cc9e37e9a8b3fa87078fdc9cead9819aa9c2","signature":"e01e3584196282a6e4802e10b3f01c67582a4b499f6fce5e72b3c05ca842547e"},"f341c93fefe964ea97c5106e3d93c4271bb3951a06a34e08da704c6faf871380","cd51ceafea7762ad639afb3ca5b68e1e4ffeaacaa402d7ef2cae17016e29e098","1b8357b3fef5be61b5de6d6a4805a534d68fe3e040c11f1944e27d4aec85936a","5141a3f0cc1bf2b0e8dee747e88a2b4ce0e9d1a4a019334f3b317f00764576c6",{"version":"4f24c2781b21b6cd65eede543669327d68a8cf0c6d9cf106a1146b164a7c8ef9","affectsGlobalScope":true},"86b484bcf6344a27a9ee19dd5cef1a5afbbd96aeb07708cc6d8b43d7dfa8466c","15ab3db8aa099e50e8e6edd5719b05dd8abf2c75f56dc3895432d92ec3f6cd6b","6ff14b0a89cb61cef9424434ee740f91b239c09272c02031db85d388b84b7442","5d6f919e1966d45ea297c2478c1985d213e41e2f9a6789964cdb53669e3f7a6f","884eaf5bcae2539fd5e7219561315c02e6d5cb452df236b7d6a08e961ec11dad","d274da8ba27079a593a7de4fbe82f3aab664724bf4f1b080e977f6e745e690e1","8504003e88870caa5474ab8bd270f318d0985ba7ede4ee30fe37646768b5362a","1cf99fe49768500d01d873870085c68caa2b311fd40c1b05e831de0306f5f257","2fb375811303a0852f21a9472a6c76b7d69c3b241861dee4784b8bf7b5a794b1","5a1e787f0f10f53e574e347c0f4904a743dc93d8989a08b308b7b29365e5964f","4502caaa3fff6c9766bfc145b1b586ef26d53e5f104271db046122b8eef57fd1","382f061a24f63ef8bfb1f7a748e1a2568ea62fb91ed1328901a6cf5ad129d61c","952c4a8d2338e19ef26c1c0758815b1de6c082a485f88368f5bece1e555f39d4","bfa7e8a9830bf5f390b4ccb4286b32239e6ddc4dca515aac187705a478de86ed","ef4c9ef3ec432ccbf6508f8aa12fbb8b7f4d535c8b484258a3888476de2c6c36","dee75c873b20a13839a8ce9ea9d32696682c6db4b1e9f4fb6bc431ed31b0fb8a","f981ffdbd651f67db134479a5352dac96648ca195f981284e79dc0a1dbc53fd5","865f3db83300a1303349cc49ed80943775a858e0596e7e5a052cc65ac03b10bb","a1c85a61ff2b66291676ab84ae03c1b1ff7139ffde1942173f6aee8dc4ee357b","a24c4fe21d5b13a9ecbbb39b5e22f5d4c6fe5feebb074865ba2de273381a73ae","48a9a38d31f33ba5a969cc7028907691e01c26d5341c558b051d27ef302602e9","0c658045146923a90b8fae427978ce3f7787f6a865a7f92717969fda90e6ecfb","2169cdcb2e85ec18274590018fc1a12b8fe02708813692d9a1531695c17d3198","231b86b94836e8b22b04812f9bb1cbc564923f39549269da0266516b91854b36","da2aa652d2bf03cc042e2ff31e4194f4f18f042b8344dcb2568f761daaf7869f","03ed68319c97cd4ce8f1c4ded110d9b40b8a283c3242b9fe934ccfa834e45572","de2b56099545de410af72a7e430ead88894e43e4f959de29663d4d0ba464944d","eec9e706eef30b4f1c6ff674738d3fca572829b7fa1715f37742863dabb3d2f2","b0cefbc19466a38f5883079f0845babcb856637f7d4f3f594b746d39b74390f7","16219e7997bfc39ed9e0bb5f068646c0cdc15de5658d1263e2b44adf0a94ebef","4ccedab1527b8bf338730810280cce9f7caf450f1e9e2a6cbabaa880d80d4cf9","1f0ee5ddb64540632c6f9a5b63e242b06e49dd6472f3f5bd7dfeb96d12543e15","18b86125c67d99150f54225df07349ddd07acde086b55f3eeac1c34c81e424d8","2d3f23c577a913d0f396184f31998507e18c8712bc74303a433cf47f94fd7e07","4d397c276bd0d41f8a5a0d67a674d5cf3f79b79b0f4df13a0fbefdf0e88f0519","aa79b64f5b3690c66892f292e63dfe3e84eb678a886df86521f67c109d57a0c5","a692e092c3b9860c9554698d84baf308ba51fc8f32ddd6646e01a287810b16c6","3c2e543e5913aca16ba24e406cebbf84bac298f79c249ea255016fabaf8be744","0b9bcc98884f81d8adda2c5d2ebb0361c7a53af6713e72138c4457e6016ff708","1848ebe5252ccb5ca1ca4ff52114516bdbbc7512589d6d0839beeea768bfb400","31073e7d0e51f33b1456ff2ab7f06546c95e24e11c29d5b39a634bc51f86d914","f60149e188145ebf3e6edf735576a2c26e805ac575bfdfa839a27929175e0855","31d18349ccfc45ce4f82990c71aed8901272a8edc9c6d1b2d330aabf36f50aec","a90339d50728b60f761127fe75192e632aa07055712a377acd8d20bb5d61e80c","37569cc8f21262ca62ec9d3aa8eb5740f96e1f325fad3d6aa00a19403bd27b96","fa18c6fe108031717db1ada404c14dc75b8b38c54daa3bb3af4c4999861ca653","3146e973c617598b8e2866b811fdfcafe71e162e907d717758d2412ba9b72c28","a653bd49c09224150d558481f93c4f2a86f9a282747abd39bd2854207d91ceba","efa00be58e65b88ea17c1eafd3efe3bc02ea403be1ee858f128ed79e7b880bd4","f5f716848e9b1e873519aa6408c35ac70c1ec471c460497842f28644dd906cb1","55d3747b2a8949561a78f7327647e54418ab3746f7dced6cfe75d76f2b051aa8","cd8aa48c26b3de057cfd76706c0cff88ace0f23f548b8dee974088497780e5ae","abf140fdc3db44c2cac9415426544d8c2a89e73f13f7838376b2b6d36d74a582","e79e530a8216ee171b4aca8fc7b99bd37f5e84555cba57dc3de4cd57580ff21a","ceb2c0bc630cca2d0fdd48b0f48915d1e768785efaabf50e31c8399926fee5b1","f351eaa598ba2046e3078e5480a7533be7051e4db9212bb40f4eeb84279aa24d","c63a0620a7fa59bbcac4ae218d477fdeafac72b689fede1e3acbbb1b8d90f36c","4ce53edb8fb1d2f8b2f6814084b773cdf5846f49bf5a426fbe4029327bda95bf","1edc9192dfc277c60b92525cdfa1980e1bfd161ae77286c96777d10db36be73c","421703860812c1dc29f83893f89434c855e09354c49012ff63b70c21243d997e","0a0bf0cb43af5e0ac1703b48325ebc18ad86f6bf796bdbe96a429c0e95ca4486","75a7db3b7ddf0ca49651629bb665e0294fda8d19ba04fddc8a14d32bb35eb248","eb31477c87de3309cbe4e9984fa74a052f31581edb89103f8590f01874b4e271","22fcfd509683e3edfaf0150c255f6afdf437fec04f033f56b43d66fe392e2ad3","3d5d9aa6266ea07199ce0a1e1f9268a56579526fad4b511949ddb9f974644202","587ce54f0e8ad1eea0c9174d6f274fb859648cebb2b8535c7adb3975aee74c21","1502a23e43fd7e9976a83195dc4eaf54acaff044687e0988a3bd4f19fc26b02b","f9b229aaa696a31f6566b290305f99e5471340b0a041d5ae9bd291f69d96a618","6592ae1f1eec2e4cd4db11033b6936c8d9e009ddc48c164e46ef101a0dfc2c70","d9c6f10eebf03d123396d4fee1efbe88bc967a47655ec040ffe7e94271a34fc7","0f2c77683296ca2d0e0bee84f8aa944a05df23bc4c5b5fef31dda757e75f660f","309586820e31406ed70bb03ea8bca88b7ec15215e82d0aa85392da25d0b68630","11e4e2be18385fa1b4ffa0244c6c626f767058f445bbc66f1c7155cc8e1ec5b4","f47280c45ddbc8aa4909396e1d8b526f64dfad4a845aec2356a6c1dc7b6fe722","7b7f39411329342a28ea19a4ca3aa4c7f7d888c9f01a411b05e4126280026ea6","7f89aebd8a6aa9ff7dfc72d12352478f1db227e2d79d5b5f9d8a59cf1b5c6b48","7d936e6db7d5d73c02471a8e872739f1ddbacf213c159e97d1d94cca315ea3f2","a86492d82baf906c071536e8de073e601eaa5deed138c2d9c42d471d72395d7e","789110b95e963c99ace4e9ad8b60901201ddc4cab59f32bde5458c1359a4d887","92eb8a98444729aa61be5e6e489602363d763da27d1bcfdf89356c1d360484da","074343ca788a38f572d8bdb0985956c0ad1a4d8ca8b6ef8c1a19a0e11cf09db0","d729b8b400507b9b51ff40d11e012379dbf0acd6e2f66bf596a3bc59444d9bf1","fc3ee92b81a6188a545cba5c15dc7c5d38ee0aaca3d8adc29af419d9bdb1fdb9","7d05ac926705ce932b6e41e5e273333b380d08b6a036ad0c8b01139586b34548","0bc13111c65ef1373c84c86c039416127579469828f0e01e03ffe00fb8fd6785","c00b402135ef36fb09d59519e34d03445fd6541c09e68b189abb64151f211b12","e08e58ac493a27b29ceee80da90bb31ec64341b520907d480df6244cdbec01f8","c0fe2b1135ca803efa203408c953e1e12645b8065e1a4c1336ad8bb11ea1101b","d82c245bfb76da44dd573948eca299ff75759b9714f8410468d2d055145a4b64","25b1108faedaf2043a97a76218240b1b537459bbca5ae9e2207c236c40dcfdef","c65a41b9185521fb1d98111fd30fa4b3a5020c0e9cd8bb8c691d5536c8688156","5a4d0b09de173c391d5d50064fc20166becc194248b1ce738e8a56af5196d28c","0e0b8353d6d7f7cc3344adbabf3866e64f2f2813b23477254ba51f69e8fdf0eb","008ed9b6d1fdb68f9d98e6fd238d99be77e738892c3a1c6cf8b7616de4f8b114","08f95bee0619072d2c49854434af3e53d94e7e762fc082b49cea59e77db06905","9e5c7463fc0259a38938c9afbdeda92e802cff87560277fd3e385ad24663f214","8d59c3a0e8eacafde3525d8fab814d635e73f8f2264f461283a1ee829a67d33a","2ab9b3b4938022c0078d38ce47fe7863e259d855f04fd5a92fb8af6649b57632","0440373172ecd0dd335030c842f51641d57a5f9c0a268efd738dfc21fd4f1439","2e27a8a2f3bb8d4da37f638bbd7013839cd41da081533fd79e390e963c30f42a","b2116cfe6a3d3830d30d8a66bdf3a78834338da2309ae1b8e86e62b39b559a82","684fa42e4c7c6505105e948825329b720a388b7bf7624bfe2f51087a15d04445","a95c25e1f9146dd90f7cb36c7e306a25a67bdef1eaae7319a60d2f9d3ff66804","a98b93132fb74f455547d25af7e524e942504d265c037e235aaa38718083958f","c77947067d5990ff247a610324a574e9adc251936cf287f3f6d2272d54de999f","c224814a2c86c21524cdf0bbb337a9f58b159f89d75c0e8d394c45b65b2c5145","ec62de242997d09b8ddcc19c5353ffbd4bedd8d148e59c14e046f63d0bd2b9e3","854e693935e706cde39ec782c3d16ba2d76923d71accba703d21c71bba284184","1b96794ba93e4008349185cda5ea725819a1a0f345cbb4c8ae6bc7d9e2758af9","49e29f37de0379778b35430743f3b2ec0934b5029ed22f7111d1a72edd86266d","0fbd308cd3436e453033babe3dea47ac92a96df652584aa1081ce382e7d54ada","274246a7f510feca0d9e6bd72b690620ffe470f184b7d71fa3fa0c79861917d3","3f596b44c02d019c2bce2ff83cf78010aa67ed38927d1c6be99a46e3299e175e","f82e5b3fc7c2116cde88f5c59f5369ed0d9bc8c96d1e33962c1eb573d4571f6c","afd44534064f3d94cd248096074344857d9e8aaa787eb209b155002f76b44271","f3c9d693e0597f6b1b5dd49bd0beaaa237bd491508991ea3c72b47d3c7d20fdb","747fcc330a861fdf770761870d94e1db8847c86cf82ee332ed4fdf506fa81ae7","b0511508476b9bf80ad623b1c7aa0b4c336eda1788c385973dc282d53ff7aed8","624e76b41eb76400df5e0cbacc5f7091e6bd0518e0f9f4ac4a047794b2c189f9","f14113b17b6a1863dd58e49e0bc504f21d51da969bc1fc4af1a07b3684f0de25","706a81603484affbd78a91330a0f94c1fff2006688a6bc0ca81b6586e6878c94","395dab864d640bdfecbf29bcd55447b0c868e239791bf242b0856c41f07c8112","1c84b348bb07619f2123fddd01c20184c6212540909bd98fdc450f7d4e234717","8bb29538074d6a78d49562f391bbe4a2b9b5ae028734d83e6601fe2741db7f6e","7bd62fc2cefeeb76bf935279de114a8f509d70232badea6f02c5235b8efd08a7","cc9bdde4319a73448db9e4dd8dc256d04f0060b90383b4563c3a32a3b67780d5","2a5d65d9ef97588e66e1eb9ba088e3bcd8fad77f56319a34f206f042716d5f98","53870be174a4233e5ceb0b0f7d7b298eb5896f45782236f65cfce1e971e13a02","a4f90adab6e997a1a70c61ebe2080fc895e5c7cc6f4f125ada537f6eaa5eb780","f08668998295cdfe38a1db2bcd024341362cb20159dd8baa498064e560d0254b","dfe644b96a0786c3ed103bffe7331349022c647802d40030067cf71c9ce79bb5","db6966cb875d06430a60563866ad7f248837dd0275264096add4934cf8b0562b","30145879995c539f1f19d84786abeb2ef5079fcbd11d27e38a9d49cc1f32333e","9ecd8f32f134677d4134ee1178bedab19a51f1cb2ac468da4043f81c14ebd3ac","7c9ea735d5a29405896bf2e56d9f3afe0f5d1576736c54c4d5d879f08976d4db","203243c89d2ba33af45ffb13b75cbc6df13f49e937ff8b13bda460a68c19aa3c","f4d6688e7084a99a025d570c620544d5235668cf2fe90acc8b5b311729c83816","6cc7cb1396ecd019a7486e541205d582513bb53d0ff8b060427d8543df969507","7a8119cc3d41a3adfa818800df5899f1bf3cc68eed005e44a85c218dbcf3889a","0c6ae7360c8f7de225172914d960a5947b0a8f5e9e0a045a5f03c870fc98b1f5","1ea04e06101a73c7896a461675bd5a429b121c5cb6de24c94332ff102d145a98","59e4242640eddb3fb1d9387cd2b28bd2a3d11372651300b63992874bcacf0fb6","93fe340b2ae9309f9ed943ce36d41b0781e03de0e35eee6eae41d92b0b1898ee","d6339e78331aef24260e77249cc452ab8487ed3308a7bdc06135e7b465587127","b182b44845c33c2c049c56bbc090c182f8a39e55362b266fdc6871299567a597","ef41df1dbd2813e7421cab4402af2777d761664e666df0e727ed431a34be8c83","e1e25bc3db37f4722303072a8f02c3d9408d7c226e2f070f45dc21a7c0214be7","c921746b36842e21243970c5ed44b488e842afe99843da3cb7f197242f4f2c9e","325430df8b9df3d182ab9edfa79b6f772eced949949620db3f2cef29091b24ed","27f63235b9872e2c451142a8d2d421106e58db76185dc5de6ddc7cd1c8412924","db32c611feafb74c561d1c3329a4a3349b5d3df6a61612d650624b33dc6fcb7f","682c72441f9dc0350ee787e76c83feed7e154f1a3cf228543cd24dde7d53167e","cdc3f517e952eab05c5aeaaf469ecce852112e5cd68dce7deed75136e7091d3c","49b92ef77067a7e85ae36e5c9d5e9c1f699ef755363c67c1cb581ba846e9eb22","99d80b0e37fbf427e82cb22d22f4515c7345ac25830913748bf6d3dfd0674bc3",{"version":"d1c97f31e1d15d00eb424d8328cef49991ef84cc1415e714bc13c5432a9f2075","signature":"9989b29890b4991902c6e00d35ac47cd5d58ece81841c196e6b2410532ee1044"},{"version":"6901ceca3adc070f8e77e6e6eff53f44aed701cc191faa75bcf821e8bb6c03d6","signature":"4ef5e4999e4ba505b9067a73b3a9976ad85a5b924fc3442e1dd8a25dcdc08269"},{"version":"4e7afa7c39db022e830595e3651298ab1971a1495c5ea18b84e6eb6410fe0f6f","signature":"bc1d7ea9f0ea72a21057f80678e97c3f566d20c46b3541a601022a6f7f687340"},{"version":"d71ec1da745c53611f1b05cd8041e5f3d54764bf6dcecf97b2b2b38438540873","signature":"b297960be66224fd76bfde7bd766b088925c078c614f372a09f71e43f786cfaa"},{"version":"6fd0fb51989798e07e6c10b02d0a72fa3145856d3f38ef8bd193a104c534c9f4","signature":"bc357378e04884500ad2f6a3636329a539ec6ffe27f53d79e48a9afa4e307840"},{"version":"0824ca5fd22451f71eaf191d84b6c615fda92ca9f809dc4448109a285fbad977","signature":"d862f114953bcdafaa15f4e06ec6bd5d9d6a9a8b1e156442537277ca99d669c3"},{"version":"832e0dc1b98dbe2e3166121d4d7bfb2f3f6db8d86be41223bbfe5b5d3dc8ccce","signature":"bf4aab488f9439a4747dd85d2f7e626fe74949feee5d003e84189001471dbe1a"},{"version":"2d6b75242f3e60cbe3976167258cc323e0d1e39353f870c4037b35d075a3a75f","signature":"5b4e64ff6293018f7ff8339962af83025fb9df590afdf8dba5fb57fbb0b5a08d"},"bcb6ea18f23dae2c48459d7b86d3adccd6898f824fcbf9da08b935f559896580","0aa7220845f5f3902fe043f646f9d9218bd7dd6c4046e8471580866ea6b03aa2","4d5fb5d6b35f731b2ae4d9d7c592d48e91d6de531dd130628edf4eba16add893","739c2c46edc112421fc023c24b4898b1f413f792bb6a02b40ba182c648e56c2f",{"version":"df93bb67d5ae7be3d599323de42e12cb8da59f0b490c3186ae91d493632b5e36","affectsGlobalScope":true},{"version":"f8b8b34c4f7651c9f7b126af8affda4139a0499e62e74f0f8dc2be36e9f14b59","affectsGlobalScope":true}],"root":[[68,84],[245,252]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"module":99,"noEmitOnError":true,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7,"useDefineForClassFields":true},"fileIdsList":[[62,63,64,65],[66],[86,87,88,89,90,91,92,93,94,95,96,97,99,100,101,103,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187],[137],[162],[163],[92,124],[91,104,116,125],[124],[98],[166],[94],[134],[91,98,116],[91],[98,145,181],[148],[151],[97],[157],[136],[86,94,96,97],[116],[86,98,139,157],[88],[87,88,90,97,98,139],[170],[168],[100,143],[86],[98,100,101,102,103,104],[100,101,102],[91,98],[103],[88,114],[98,103],[172],[92],[166,175,178],[92,94],[92,94,151],[95,98],[257],[253],[254],[255,256],[67,83],[66,67,78,83,84,244,246,247,249,250],[67],[67,245],[66,67],[66,67,245],[67,248],[66,67,78],[67,78,83,246,251],[66,67,77,78,79],[66,67,77],[67,77,79,80,81,82],[67,68,69,70,71,72,73,74,75,76],[189],[85,189,190,191,192],[188],[188,194],[194],[194,195,196,197,198,199,200,201,202],[204],[206],[208],[208,209,210],[212,213,214,215,216,217,218,219,220],[222,223,224,225,226],[193,203,205,207,211,221,227,231,243],[228,229,230],[234],[188,232,233,234,235,236,237,238,239,240,241,242],[83],[66,84,246,247],[245],[66,245],[248],[78,83,246,251],[66,77,79],[66,77],[77,79,80,81,82],[68,69,70,71,72,73,74,75,76]],"referencedMap":[[66,1],[67,2],[188,3],[138,4],[163,5],[165,6],[164,6],[125,7],[127,8],[126,9],[166,10],[170,11],[168,11],[102,12],[135,13],[146,14],[92,15],[183,16],[150,17],[152,18],[159,19],[160,20],[161,21],[178,15],[98,22],[117,23],[158,24],[136,10],[141,25],[140,26],[167,11],[171,27],[169,28],[144,29],[114,30],[105,31],[103,32],[131,33],[132,33],[149,34],[186,35],[110,10],[112,36],[172,6],[174,37],[173,37],[113,10],[153,15],[107,38],[111,10],[179,39],[118,40],[119,40],[120,40],[137,21],[175,11],[177,27],[176,28],[162,10],[155,41],[96,10],[99,42],[154,15],[95,40],[258,43],[254,44],[255,45],[257,46],[84,47],[251,48],[78,49],[246,50],[245,51],[247,47],[248,52],[249,53],[250,54],[252,55],[80,56],[79,49],[81,57],[82,49],[83,58],[68,49],[69,51],[70,49],[71,49],[72,49],[73,51],[74,51],[75,51],[76,49],[77,59],[190,60],[191,60],[193,61],[189,62],[195,63],[198,64],[199,64],[203,65],[200,64],[201,64],[202,63],[194,62],[205,66],[207,67],[209,68],[211,69],[221,70],[227,71],[244,72],[231,73],[235,74],[243,75]],"exportedModulesMap":[[66,1],[67,2],[188,3],[138,4],[163,5],[165,6],[164,6],[125,7],[127,8],[126,9],[166,10],[170,11],[168,11],[102,12],[135,13],[146,14],[92,15],[183,16],[150,17],[152,18],[159,19],[160,20],[161,21],[178,15],[98,22],[117,23],[158,24],[136,10],[141,25],[140,26],[167,11],[171,27],[169,28],[144,29],[114,30],[105,31],[103,32],[131,33],[132,33],[149,34],[186,35],[110,10],[112,36],[172,6],[174,37],[173,37],[113,10],[153,15],[107,38],[111,10],[179,39],[118,40],[119,40],[120,40],[137,21],[175,11],[177,27],[176,28],[162,10],[155,41],[96,10],[99,42],[154,15],[95,40],[258,43],[254,44],[255,45],[257,46],[84,76],[251,77],[246,78],[245,2],[247,76],[248,79],[249,80],[250,2],[252,81],[80,82],[81,83],[83,84],[69,2],[73,2],[74,2],[75,2],[77,85],[190,60],[191,60],[193,61],[189,62],[195,63],[198,64],[199,64],[203,65],[200,64],[201,64],[202,63],[194,62],[205,66],[207,67],[209,68],[211,69],[221,70],[227,71],[244,72],[231,73],[235,74],[243,75]],"semanticDiagnosticsPerFile":[64,63,62,66,67,65,188,123,138,88,163,165,164,125,124,127,126,104,166,170,168,90,102,135,134,146,92,130,183,185,150,152,159,160,161,178,98,117,97,91,158,157,136,133,180,141,140,167,171,169,184,144,143,114,105,106,103,131,132,139,89,100,116,148,149,186,110,112,172,174,173,101,86,115,113,153,147,182,109,107,108,111,151,142,179,121,118,119,120,137,94,175,177,176,162,181,155,145,129,93,96,187,156,87,128,122,99,154,95,60,61,12,13,15,14,2,16,17,18,19,20,21,22,23,3,4,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,58,10,1,11,59,258,254,253,255,256,257,84,251,78,246,245,247,248,249,250,252,80,79,81,82,83,68,69,70,71,72,73,74,75,76,77,85,190,191,192,193,189,195,196,197,198,199,203,200,201,202,194,205,204,206,207,209,210,211,208,212,213,214,215,221,216,217,218,219,220,222,227,223,224,225,226,244,228,231,229,230,232,233,235,236,237,238,239,240,241,234,242,243],"latestChangedDtsFile":"./index.d.ts"},"version":"5.0.4"}
|
|
1
|
+
{"program":{"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/@types/react/global.d.ts","../../../../node_modules/csstype/index.d.ts","../../../../node_modules/@types/prop-types/index.d.ts","../../../../node_modules/@types/scheduler/tracing.d.ts","../../../../node_modules/@types/react/index.d.ts","../../../../node_modules/@types/react/jsx-runtime.d.ts","../../src/nodeSpecs/types/ChildrenRepresentationReducer.ts","../../src/nodeSpecs/types/ConstrainedLeafRepresentationFactory.ts","../../src/nodeSpecs/types/DeclarationSiteNodeRepresentationFactory.ts","../../src/nodeSpecs/types/RepresentationFactorySite.ts","../../src/nodeSpecs/types/StaticContextFactory.ts","../../src/nodeSpecs/types/SyntheticChildrenFactory.ts","../../src/nodeSpecs/types/UnconstrainedLeafRepresentationFactory.ts","../../src/nodeSpecs/types/UseSiteBranchNodeRepresentationFactory.ts","../../src/nodeSpecs/types/ValidFactoryName.ts","../../src/nodeSpecs/types/index.ts","../../src/ChildrenAnalyzerError.ts","../../src/nodeSpecs/BranchNodeOptions.ts","../../src/nodeSpecs/BranchNode.ts","../../src/nodeSpecs/Leaf.ts","../../src/nodeSpecs/RawNodeRepresentation.ts","../../src/nodeSpecs/index.ts","../../src/BranchNodeList.ts","../../../utilities/dist/types/assert-types/AssertionError.d.ts","../../../utilities/dist/types/assert-types/Predicates.d.ts","../../../utilities/dist/types/assert-types/types.d.ts","../../../utilities/dist/types/assert-types/assert.d.ts","../../../utilities/dist/types/assert-types/assertNever.d.ts","../../../utilities/dist/types/assert-types/index.d.ts","../../../utilities/dist/types/class-name/colorSchemeClassName.d.ts","../../../utilities/dist/types/class-name/constants.d.ts","../../../utilities/dist/types/class-name/deduplicateClassName.d.ts","../../../utilities/dist/types/class-name/types.d.ts","../../../utilities/dist/types/class-name/filterThemedClassName.d.ts","../../../utilities/dist/types/class-name/flatClassNameList.d.ts","../../../utilities/dist/types/class-name/listClassName.d.ts","../../../utilities/dist/types/class-name/themeClassName.d.ts","../../../utilities/dist/types/class-name/index.d.ts","../../../utilities/dist/types/css-utilities/px.d.ts","../../../utilities/dist/types/css-utilities/index.d.ts","../../../utilities/dist/types/data-utilities/dateToStringWithoutTimezone.d.ts","../../../utilities/dist/types/data-utilities/index.d.ts","../../../utilities/dist/types/deprecate/types.d.ts","../../../utilities/dist/types/deprecate/deprecate.d.ts","../../../utilities/dist/types/deprecate/index.d.ts","../../../utilities/dist/types/dom/dataAttribute.d.ts","../../../utilities/dist/types/dom/getElementDimensions.d.ts","../../../utilities/dist/types/dom/getSizeFromResizeObserverEntry.d.ts","../../../utilities/dist/types/dom/shouldCancelStart.d.ts","../../../utilities/dist/types/dom/stateDataAttributes.d.ts","../../../utilities/dist/types/dom/svgSizeProps.d.ts","../../../utilities/dist/types/dom/index.d.ts","../../../utilities/dist/types/functional/omit.d.ts","../../../utilities/dist/types/functional/pick.d.ts","../../../utilities/dist/types/functional/range.d.ts","../../../utilities/dist/types/functional/index.d.ts","../../../utilities/dist/types/string-utilities/kebabCase.d.ts","../../../utilities/dist/types/string-utilities/index.d.ts","../../../utilities/dist/types/types/Narrow.d.ts","../../../utilities/dist/types/types/NonOptional.d.ts","../../../utilities/dist/types/types/PolymorphicRefs.d.ts","../../../utilities/dist/types/types/index.d.ts","../../../utilities/dist/types/index.d.ts","../../src/ErrorMessageFactory.ts","../../src/ChildrenAnalyzerOptions.ts","../../src/LeafList.ts","../../src/helpers/getErrorMessage.ts","../../src/helpers/index.ts","../../src/helpers/wrapError.ts","../../src/ChildrenAnalyzer.ts","../../src/index.ts","../../../../node_modules/vite/types/hmrPayload.d.ts","../../../../node_modules/vite/types/customEvent.d.ts","../../../../node_modules/vite/types/hot.d.ts","../../../../node_modules/vite/types/importGlob.d.ts","../../../../node_modules/vite/types/importMeta.d.ts","../../../../node_modules/vite/client.d.ts"],"fileInfos":[{"version":"f33e5332b24c3773e930e212cbb8b6867c8ba3ec4492064ea78e55a524d57450","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","26f2f787e82c4222710f3b676b4d83eb5ad0a72fa7b746f03449e7a026ce5073","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b","bed7b7ba0eb5a160b69af72814b4dde371968e40b6c5e73d3a9f7bee407d158c",{"version":"21e41a76098aa7a191028256e52a726baafd45a925ea5cf0222eb430c96c1d83","affectsGlobalScope":true},{"version":"35299ae4a62086698444a5aaee27fc7aa377c68cbb90b441c9ace246ffd05c97","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"e0275cd0e42990dc3a16f0b7c8bca3efe87f1c8ad404f80c6db1c7c0b828c59f","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"acae90d417bee324b1372813b5a00829d31c7eb670d299cd7f8f9a648ac05688","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"62a4966981264d1f04c44eb0f4b5bdc3d81c1a54725608861e44755aa24ad6a5","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"86a34c7a13de9cabc43161348f663624b56871ed80986e41d214932ddd8d6719","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"4350e5922fecd4bedda2964d69c213a1436349d0b8d260dd902795f5b94dc74b","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"0bd5e7096c7bc02bf70b2cc017fc45ef489cb19bd2f32a71af39ff5787f1b56a","affectsGlobalScope":true},"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","6a386ff939f180ae8ef064699d8b7b6e62bc2731a62d7fbf5e02589383838dea","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"369b91cb44fdb8a8fa15de2bd6c28a7abfe6cc16d483ea42291cc7b1efff88d4","affectsGlobalScope":true},"2879a055439b6c0c0132a1467120a0f85b56b5d735c973ad235acd958b1b5345",{"version":"a9c21d8c1022cf7c134e33b95bd38d792b1353749e4312b8bf184baf1c6e6186","signature":"476e595a4d19de9f46348c8beebbf708978ab592862917cfa284780b00b82013"},{"version":"a2d99deb45290e2ad3be8e8db687f498eaa5f857ddc0f081045911d2408d6f65","signature":"bcdb41180dc8b3bb7766cb0157b00608cf6fcc39569ec1c87245b27a32168944"},{"version":"2c4b09e2886389ac8a6fb4a763de72b30fd22b29ad194bd7a7b966f409e2d20c","signature":"aefa16b954029ecc8800e851c52942c6b0d1b19b4b8cf179ceb2eeed40250339"},{"version":"f46736b4c4956a380050bbe5fc4dc914bfc70e7561cd6a6889d0854bbad6c053","signature":"e2396536f60d5fb378182b2cf695c4fe0f44b98a65cb11de7aa540640a49f32f"},{"version":"cfb7cbd7db2fb7f997b2cf652191042e72e322b9c04c161cfd8b74f759ab6ab5","signature":"29e86258bae9032d4a41ae819636bd2c5f2b2aef9d02000341debb0c45d88ab1"},{"version":"09128331d23e062378d0354e5b9cf8da6ff27dd61d1942966d730b1f22e80e7f","signature":"95092929201ee7ed4cfe82827a3f2628cab74e9f725f68a31ffaf897c197051a"},{"version":"b5c303499a3c43d8170ed36dc7b3f233524ff3e99f8f3319960165537b387ce8","signature":"3c8a5b67937216b02b9a21cf8614b56b2679bf6725f64d51e89b53ca72f4fd80"},{"version":"867982da569cd55c28d3c2178a67e32d2ad58002b815f623a3049aa39a3a6c5c","signature":"a985c9f8618c0c7ed35b85798f017ab899078b29b54786d0ada07045804dc20b"},{"version":"da33c798c79471b84e7325268e2b07d5659dab29e44e222cec3a4261d75c11a8","signature":"003ac502c8f5df7f026e2b1afaeb386e58433d4ef6d7c2ea5e74197084aea9d6"},{"version":"457190a697618a8153922ff3142e8a306a6db160b92acee3de08206a4b3659f5","signature":"ac2f98183ecd3fbae9b7af51efeefe3bcaa2acf6f150fe776afe73444b3a7d43"},{"version":"e4b30974841000a2f00e89ac2cfa8a063766e69131e31ee521267af0bab4cfd5","signature":"ec33c9ae91ebe33329992a166653817225f9ebc08835c8bac7270a6be763d55c"},{"version":"81d8157c53cd3457cefeee525e509da21a28e61e131d6c23cdb99570d4f171c0","signature":"d519308aedac3bb98d355832e80d9d988570ef945649255bcc0988b91a6157d6"},{"version":"7327aedbd450b22a519aff0b7e4f93553463b578136415764de7727ebddf2d44","signature":"2c1c6fe63c4985cfb439f248eca2fba14446a21c3c7afc254c85c492ceb7174a"},{"version":"cdfa71e29fc4507f0beabef37debe8e361ac525d5b22b0c02588855dea59a948","signature":"4a744a8145a44cb9a0df124bc8b86c448fa9bf8f176ac8e9c5777cae919b0bad"},{"version":"a24a9885385ca27603b8bdf0f7b19ea2f045cb7e38a85458a7c7908c0cd9b111","signature":"ec0c9bf6132e535c80f3cca0800e105bb651543ea1ff3f80530dbb9f94e76d7b"},{"version":"bd48adca38f6d32cec918e4dffe5e5b4a71cfe27dd2e26fb5dd07b23fd7ed1f7","signature":"2b8997bd989157a95291c8106ae6d8851d1400176d68a56e88b1ae1da3467682"},{"version":"795a8d3c1116f076ad63ca53a0e9cc9e37e9a8b3fa87078fdc9cead9819aa9c2","signature":"e01e3584196282a6e4802e10b3f01c67582a4b499f6fce5e72b3c05ca842547e"},"f341c93fefe964ea97c5106e3d93c4271bb3951a06a34e08da704c6faf871380","e6cd10db13b47959e26122d816abc1d1c01bb53137ad620f73f8076dd963b652","c55bf39638366450edc9cb028ae72bd2c915e4bbc740dbf27a4d7dde00cf55d6","684fa42e4c7c6505105e948825329b720a388b7bf7624bfe2f51087a15d04445","a95c25e1f9146dd90f7cb36c7e306a25a67bdef1eaae7319a60d2f9d3ff66804","a98b93132fb74f455547d25af7e524e942504d265c037e235aaa38718083958f","821551b351ab0ff99fd29f7274f75cf937ae0ceaf7fed6120a1ee99e3e9a11c7","ec62de242997d09b8ddcc19c5353ffbd4bedd8d148e59c14e046f63d0bd2b9e3","854e693935e706cde39ec782c3d16ba2d76923d71accba703d21c71bba284184","8b1601671a8548877ad1647096eb08c1029cd2fff4e9db56306e5ead226ded24","9620c5bfd94afaac87bf94e5ae1efdc27d83ebb2103bcd5b19098fbd0a8b348c","49e29f37de0379778b35430743f3b2ec0934b5029ed22f7111d1a72edd86266d","0fbd308cd3436e453033babe3dea47ac92a96df652584aa1081ce382e7d54ada","9fdffc1da152e99dc75c341dc7daeffc6cfeb4d38e373762d97057d7eac515e5","feaa8ee29c586363e0884decde60df17b24143c04258b6cffe9b13696566c768","11dffd4e2a87837317cbb9e53560b5fa7fedecdfe3750e5bdc9def88c7bef662","f3c9d693e0597f6b1b5dd49bd0beaaa237bd491508991ea3c72b47d3c7d20fdb","747fcc330a861fdf770761870d94e1db8847c86cf82ee332ed4fdf506fa81ae7","b0511508476b9bf80ad623b1c7aa0b4c336eda1788c385973dc282d53ff7aed8","624e76b41eb76400df5e0cbacc5f7091e6bd0518e0f9f4ac4a047794b2c189f9","f14113b17b6a1863dd58e49e0bc504f21d51da969bc1fc4af1a07b3684f0de25","1762533296e00297d454534bdb27ddae5f6b69fef679295094cb0afb4e9a526a","1c84b348bb07619f2123fddd01c20184c6212540909bd98fdc450f7d4e234717","8bb29538074d6a78d49562f391bbe4a2b9b5ae028734d83e6601fe2741db7f6e","cc9bdde4319a73448db9e4dd8dc256d04f0060b90383b4563c3a32a3b67780d5","a4f90adab6e997a1a70c61ebe2080fc895e5c7cc6f4f125ada537f6eaa5eb780","f08668998295cdfe38a1db2bcd024341362cb20159dd8baa498064e560d0254b","dfe644b96a0786c3ed103bffe7331349022c647802d40030067cf71c9ce79bb5","f438b724a11131ee7a6f4501b159dee3a03ba689517d54cdbd2bebb5d6b66106","9ecd8f32f134677d4134ee1178bedab19a51f1cb2ac468da4043f81c14ebd3ac","7c9ea735d5a29405896bf2e56d9f3afe0f5d1576736c54c4d5d879f08976d4db","203243c89d2ba33af45ffb13b75cbc6df13f49e937ff8b13bda460a68c19aa3c","ff0302b8dd06ec92107a56f081b7c7d3753bdb35a942a1c753f943553b0f00ae","0c6ae7360c8f7de225172914d960a5947b0a8f5e9e0a045a5f03c870fc98b1f5","5efac8d930c281e4cbbea8c1165a60d020bd549f9997e541bb3e59eb84d5af61","2530e26913543800e9f329fcaefbffe2904036d62aef1cf97e9738f070295ee7","c921746b36842e21243970c5ed44b488e842afe99843da3cb7f197242f4f2c9e","4b030016676aa17add8651d5f461d37a95ad981d417e5a4ae3c359ae24d3da10","8ff0f77ed5b2af3b7d4a5a1bb31398fc7873db8784d97d021cce13ac1323b8d1","99d80b0e37fbf427e82cb22d22f4515c7345ac25830913748bf6d3dfd0674bc3",{"version":"d1c97f31e1d15d00eb424d8328cef49991ef84cc1415e714bc13c5432a9f2075","signature":"9989b29890b4991902c6e00d35ac47cd5d58ece81841c196e6b2410532ee1044"},{"version":"6901ceca3adc070f8e77e6e6eff53f44aed701cc191faa75bcf821e8bb6c03d6","signature":"4ef5e4999e4ba505b9067a73b3a9976ad85a5b924fc3442e1dd8a25dcdc08269"},{"version":"4e7afa7c39db022e830595e3651298ab1971a1495c5ea18b84e6eb6410fe0f6f","signature":"bc1d7ea9f0ea72a21057f80678e97c3f566d20c46b3541a601022a6f7f687340"},{"version":"d71ec1da745c53611f1b05cd8041e5f3d54764bf6dcecf97b2b2b38438540873","signature":"b297960be66224fd76bfde7bd766b088925c078c614f372a09f71e43f786cfaa"},{"version":"6fd0fb51989798e07e6c10b02d0a72fa3145856d3f38ef8bd193a104c534c9f4","signature":"bc357378e04884500ad2f6a3636329a539ec6ffe27f53d79e48a9afa4e307840"},{"version":"0824ca5fd22451f71eaf191d84b6c615fda92ca9f809dc4448109a285fbad977","signature":"d862f114953bcdafaa15f4e06ec6bd5d9d6a9a8b1e156442537277ca99d669c3"},{"version":"832e0dc1b98dbe2e3166121d4d7bfb2f3f6db8d86be41223bbfe5b5d3dc8ccce","signature":"bf4aab488f9439a4747dd85d2f7e626fe74949feee5d003e84189001471dbe1a"},{"version":"2d6b75242f3e60cbe3976167258cc323e0d1e39353f870c4037b35d075a3a75f","signature":"5b4e64ff6293018f7ff8339962af83025fb9df590afdf8dba5fb57fbb0b5a08d"},"bcb6ea18f23dae2c48459d7b86d3adccd6898f824fcbf9da08b935f559896580","1363ba7d52f2353d0c4306d0ecdaf171bf4509c0148842f9fd8d3986c098a2eb","cbe726263ae9a7bf32352380f7e8ab66ee25b3457137e316929269c19e18a2be","21092de52736dc30f478fe5f1e88ad1b545ce4b276062999302aa65b30a6787a",{"version":"4025a454b1ca489b179ee8c684bdd70ff8c1967e382076ade53e7e4653e1daec","affectsGlobalScope":true},{"version":"84d68135178bf014e5cdc27e88c9148fc22f82e1a733dc6e1869a5263e58d5db","affectsGlobalScope":true}],"root":[[72,88],[129,136]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"module":99,"noEmitOnError":true,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7,"useDefineForClassFields":true},"fileIdsList":[[66,67,68,69],[70],[141],[137],[138],[139,140],[71,87],[70,71,82,87,88,128,130,131,133,134],[71],[71,129],[70,71],[70,71,129],[71,132],[70,71,82],[71,82,87,130,135],[70,71,81,82,83],[70,71,81],[71,81,83,84,85,86],[71,72,73,74,75,76,77,78,79,80],[91],[89,90,91,92,93],[98],[95,96,97,98,99,100,101,102],[104],[106],[108],[108,109],[111,112,113,114,115,116],[118,119,120],[94,103,105,107,110,117,121,123,127],[122],[124,125,126],[87],[70,88,130,131],[129],[70,129],[132],[82,87,130,135],[70,81,83],[70,81],[81,83,84,85,86],[72,73,74,75,76,77,78,79,80]],"referencedMap":[[70,1],[71,2],[142,3],[138,4],[139,5],[141,6],[88,7],[135,8],[82,9],[130,10],[129,11],[131,7],[132,12],[133,13],[134,14],[136,15],[84,16],[83,9],[85,17],[86,9],[87,18],[72,9],[73,11],[74,9],[75,9],[76,9],[77,11],[78,11],[79,11],[80,9],[81,19],[92,20],[94,21],[99,22],[100,22],[103,23],[101,22],[105,24],[107,25],[109,26],[110,27],[117,28],[121,29],[128,30],[123,31],[126,2],[127,32]],"exportedModulesMap":[[70,1],[71,2],[142,3],[138,4],[139,5],[141,6],[88,33],[135,34],[130,35],[129,2],[131,33],[132,36],[133,37],[134,2],[136,38],[84,39],[85,40],[87,41],[73,2],[77,2],[78,2],[79,2],[81,42],[92,20],[94,21],[99,22],[100,22],[103,23],[101,22],[105,24],[107,25],[109,26],[110,27],[117,28],[121,29],[128,30],[123,31],[126,2],[127,32]],"semanticDiagnosticsPerFile":[68,66,70,71,69,67,64,65,12,13,15,14,2,16,17,18,19,20,21,22,23,3,4,24,28,25,26,27,29,30,31,5,32,33,34,35,6,39,36,37,38,40,7,41,46,47,42,43,44,45,8,51,48,49,50,52,9,53,54,55,58,56,57,59,60,10,1,11,63,62,61,142,138,137,139,140,141,88,135,82,130,129,131,132,133,134,136,84,83,85,86,87,72,73,74,75,76,77,78,79,80,81,89,90,92,93,94,91,95,96,97,99,100,103,101,102,98,105,104,106,107,109,110,108,111,112,113,117,114,115,116,121,118,119,120,128,123,122,124,125,126,127],"latestChangedDtsFile":"./index.d.ts"},"version":"5.3.3"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/react-multipass-rendering",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "1.3.0-alpha.
|
|
4
|
+
"version": "1.3.0-alpha.9",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/production/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"test": "vitest"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@contember/utilities": "1.3.0-alpha.
|
|
38
|
+
"@contember/utilities": "1.3.0-alpha.9"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "^17 || ^18"
|