feat: support scopes for dynamic field entries
This commit is contained in:
@@ -7,6 +7,7 @@ export const EditorContext = React.createContext({
|
||||
|
||||
export const EditorProvider = (props) => {
|
||||
const { children, value } = props;
|
||||
|
||||
return (
|
||||
<EditorContext.Provider value={value}>{children}</EditorContext.Provider>
|
||||
);
|
||||
@@ -14,5 +15,7 @@ export const EditorProvider = (props) => {
|
||||
|
||||
EditorProvider.propTypes = {
|
||||
children: PropTypes.node.isRequired,
|
||||
value: PropTypes.shape({ readOnly: PropTypes.bool.isRequired }).isRequired,
|
||||
value: PropTypes.shape({
|
||||
readOnly: PropTypes.bool.isRequired,
|
||||
}).isRequired,
|
||||
};
|
||||
|
||||
19
packages/web/src/contexts/FieldEntry.jsx
Normal file
19
packages/web/src/contexts/FieldEntry.jsx
Normal file
@@ -0,0 +1,19 @@
|
||||
import * as React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
export const FieldEntryContext = React.createContext({});
|
||||
|
||||
export const FieldEntryProvider = (props) => {
|
||||
const { children, value } = props;
|
||||
|
||||
return (
|
||||
<FieldEntryContext.Provider value={value}>
|
||||
{children}
|
||||
</FieldEntryContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
FieldEntryProvider.propTypes = {
|
||||
children: PropTypes.node.isRequired,
|
||||
value: PropTypes.object,
|
||||
};
|
||||
@@ -6,6 +6,7 @@ export const StepExecutionsContext = React.createContext([]);
|
||||
|
||||
export const StepExecutionsProvider = (props) => {
|
||||
const { children, value } = props;
|
||||
|
||||
return (
|
||||
<StepExecutionsContext.Provider value={value}>
|
||||
{children}
|
||||
|
||||
Reference in New Issue
Block a user