refactor: context description
This commit is contained in:
parent
95c91e1c4b
commit
21e70ac4e4
|
@ -27,7 +27,7 @@ const Expression = ({
|
|||
const Renderables = [];
|
||||
let opsCount = 0;
|
||||
// eslint-disable-next-line react/destructuring-assignment
|
||||
let description = context.constructor.descriptionFor(context);
|
||||
let description = context.describeChildren();
|
||||
const onChange = (event, value, localPath) => {
|
||||
const patches = [];
|
||||
const j = parseInt(relative(path, localPath).split('/')[1], 10);
|
||||
|
@ -339,7 +339,7 @@ Expression.propTypes = {
|
|||
constructor: PropTypes.shape({
|
||||
descriptionFor: PropTypes.func,
|
||||
}),
|
||||
describe: PropTypes.func,
|
||||
describeChildren: PropTypes.func,
|
||||
get: PropTypes.func,
|
||||
}).isRequired,
|
||||
value: PropTypes.shape({
|
||||
|
|
|
@ -25,7 +25,7 @@ const Invocation = ({
|
|||
childrenDescription={{
|
||||
'...': {label: '', type: 'undefined'},
|
||||
'[literal]': {label: '', type: 'undefined'},
|
||||
...context.describe().children,
|
||||
...context.describeChildren().children,
|
||||
'[key]': {label: '', type: 'undefined'},
|
||||
}}
|
||||
key={path}
|
||||
|
@ -104,7 +104,7 @@ Invocation.displayName = 'Invocation';
|
|||
|
||||
Invocation.propTypes = {
|
||||
context: PropTypes.shape({
|
||||
describe: PropTypes.func,
|
||||
describeChildren: PropTypes.func,
|
||||
}).isRequired,
|
||||
description: PropTypes.shape({
|
||||
args: PropTypes.arrayOf(
|
||||
|
|
|
@ -64,7 +64,7 @@ const Literal = ({
|
|||
setLiteralType(false);
|
||||
};
|
||||
// eslint-disable-next-line react/destructuring-assignment
|
||||
const contextDescription = context.describe();
|
||||
const contextDescription = context.describeChildren();
|
||||
const valueComponent = (path, type, {value}) => {
|
||||
switch (type) {
|
||||
case 'bool': {
|
||||
|
@ -266,7 +266,7 @@ Literal.displayName = 'Literal';
|
|||
|
||||
Literal.propTypes = {
|
||||
context: PropTypes.shape({
|
||||
describe: PropTypes.func,
|
||||
describeChildren: PropTypes.func,
|
||||
}).isRequired,
|
||||
type: PropTypes.string.isRequired,
|
||||
onChange: PropTypes.func.isRequired,
|
||||
|
|
Loading…
Reference in New Issue
Block a user