@contember/react-multipass-rendering
Advanced tools
Comparing version 1.0.0-rc.22 to 1.0.0-rc.23
const assertNever = (_) => { | ||
throw new Error(); | ||
}; | ||
export { assertNever }; | ||
//# sourceMappingURL=assertNever.js.map |
@@ -1,18 +0,15 @@ | ||
import { assertNever } from './assertNever.js'; | ||
import { ChildrenAnalyzerError } from './ChildrenAnalyzerError.js'; | ||
import { getErrorMessage } from './helpers/getErrorMessage.js'; | ||
class ChildrenAnalyzer { | ||
static defaultOptions = { | ||
ignoreRenderProps: true, | ||
renderPropsErrorMessage: "Render props (functions as React component children) are not supported.", | ||
ignoreUnhandledNodes: true, | ||
unhandledNodeErrorMessage: "Encountered an unknown child.", | ||
staticContextFactoryName: "getStaticContext", | ||
staticRenderFactoryName: "staticRender" | ||
}; | ||
leaves; | ||
branchNodes; | ||
options; | ||
var __defProp = Object.defineProperty; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __publicField = (obj, key, value) => { | ||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
import { assertNever } from "./assertNever.js"; | ||
import { ChildrenAnalyzerError } from "./ChildrenAnalyzerError.js"; | ||
import { getErrorMessage } from "./helpers/getErrorMessage.js"; | ||
const _ChildrenAnalyzer = class { | ||
constructor(leaves, decider = [], options = {}) { | ||
__publicField(this, "leaves"); | ||
__publicField(this, "branchNodes"); | ||
__publicField(this, "options"); | ||
this.leaves = leaves; | ||
@@ -25,3 +22,3 @@ if (Array.isArray(decider)) { | ||
} | ||
this.options = { ...ChildrenAnalyzer.defaultOptions, ...options }; | ||
this.options = { ..._ChildrenAnalyzer.defaultOptions, ...options }; | ||
} | ||
@@ -147,5 +144,13 @@ processChildren(children, initialStaticContext) { | ||
} | ||
} | ||
}; | ||
let ChildrenAnalyzer = _ChildrenAnalyzer; | ||
__publicField(ChildrenAnalyzer, "defaultOptions", { | ||
ignoreRenderProps: true, | ||
renderPropsErrorMessage: "Render props (functions as React component children) are not supported.", | ||
ignoreUnhandledNodes: true, | ||
unhandledNodeErrorMessage: "Encountered an unknown child.", | ||
staticContextFactoryName: "getStaticContext", | ||
staticRenderFactoryName: "staticRender" | ||
}); | ||
export { ChildrenAnalyzer }; | ||
//# sourceMappingURL=ChildrenAnalyzer.js.map |
class ChildrenAnalyzerError extends Error { | ||
} | ||
export { ChildrenAnalyzerError }; | ||
//# sourceMappingURL=ChildrenAnalyzerError.js.map |
const getErrorMessage = (factory, node, staticContext) => { | ||
return typeof factory === "string" ? factory : factory(node, staticContext); | ||
}; | ||
export { getErrorMessage }; | ||
//# sourceMappingURL=getErrorMessage.js.map |
@@ -1,5 +0,5 @@ | ||
export { ChildrenAnalyzer } from './ChildrenAnalyzer.js'; | ||
export { ChildrenAnalyzerError } from './ChildrenAnalyzerError.js'; | ||
export { BranchNode } from './nodeSpecs/BranchNode.js'; | ||
export { Leaf } from './nodeSpecs/Leaf.js'; | ||
export { ChildrenAnalyzer } from "./ChildrenAnalyzer.js"; | ||
export { ChildrenAnalyzerError } from "./ChildrenAnalyzerError.js"; | ||
export { BranchNode } from "./nodeSpecs/BranchNode.js"; | ||
export { Leaf } from "./nodeSpecs/Leaf.js"; | ||
//# sourceMappingURL=index.js.map |
@@ -1,11 +0,12 @@ | ||
import { ChildrenAnalyzerError } from '../ChildrenAnalyzerError.js'; | ||
class BranchNode { | ||
static defaultOptions = { | ||
childrenAreOptional: false, | ||
childrenAbsentErrorMessage: "Component must have children!" | ||
}; | ||
specification; | ||
options; | ||
var __defProp = Object.defineProperty; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __publicField = (obj, key, value) => { | ||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
import { ChildrenAnalyzerError } from "../ChildrenAnalyzerError.js"; | ||
const _BranchNode = class { | ||
constructor(factory, componentOrReducer, options) { | ||
__publicField(this, "specification"); | ||
__publicField(this, "options"); | ||
if (typeof factory !== "function") { | ||
@@ -27,9 +28,13 @@ this.specification = { | ||
this.options = { | ||
...BranchNode.defaultOptions, | ||
..._BranchNode.defaultOptions, | ||
...options | ||
}; | ||
} | ||
} | ||
}; | ||
let BranchNode = _BranchNode; | ||
__publicField(BranchNode, "defaultOptions", { | ||
childrenAreOptional: false, | ||
childrenAbsentErrorMessage: "Component must have children!" | ||
}); | ||
export { BranchNode }; | ||
//# sourceMappingURL=BranchNode.js.map |
@@ -0,4 +1,10 @@ | ||
var __defProp = Object.defineProperty; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __publicField = (obj, key, value) => { | ||
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); | ||
return value; | ||
}; | ||
class Leaf { | ||
specification; | ||
constructor(factory, ComponentType) { | ||
__publicField(this, "specification"); | ||
if (typeof factory === "function") { | ||
@@ -18,4 +24,3 @@ this.specification = { | ||
} | ||
export { Leaf }; | ||
//# sourceMappingURL=Leaf.js.map |
{ | ||
"name": "@contember/react-multipass-rendering", | ||
"license": "Apache-2.0", | ||
"version": "1.0.0-rc.22", | ||
"version": "1.0.0-rc.23", | ||
"type": "module", | ||
@@ -24,5 +24,2 @@ "sideEffects": false, | ||
}, | ||
"devDependencies": { | ||
"tslib": "1.10.0" | ||
}, | ||
"scripts": { | ||
@@ -29,0 +26,0 @@ "build": "vite build --mode development && vite build --mode production", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
157002
0
1082