flow-lib-creomnia 1.0.2 → 1.0.4
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/lib/modules/common/types/index.d.ts +2 -0
- package/lib/modules/connection/components/ConnectionWithButton/index.js +4 -3
- package/lib/modules/connection/types/index.d.ts +3 -0
- package/lib/modules/flow/components/FlowSandbox/index.d.ts +2 -0
- package/lib/modules/flow/components/FlowSandbox/index.js +2 -2
- package/lib/modules/flow/components/NodesFlow/index.js +2 -2
- package/lib/modules/flow/types/index.d.ts +5 -0
- package/lib/modules/node/components/BaseNode/index.js +1 -1
- package/lib/modules/node/components/ChoiseNode/index.js +1 -1
- package/lib/modules/node/components/NodesMenu/index.d.ts +2 -0
- package/lib/modules/node/components/NodesMenu/index.js +14 -3
- package/lib/modules/node/components/NodesMenu/styled.d.ts +3 -0
- package/lib/modules/node/components/NodesMenu/styled.js +16 -5
- package/lib/modules/node/contexts/SettingsContext/index.js +1 -1
- package/lib/modules/node/enums/index.d.ts +4 -0
- package/lib/modules/node/enums/index.js +6 -1
- package/lib/modules/node/index.js +1 -1
- package/lib/modules/node/services/expandCoefficientServices.d.ts +1 -1
- package/lib/modules/node/types/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ exports.nodeHeightByType = {
|
|
|
23
23
|
[enums_1.NodeTypeEnum.HubNode]: config_1.Config.HUB_NODE_HEIGHT,
|
|
24
24
|
[enums_1.NodeTypeEnum.ParallelNode]: 0,
|
|
25
25
|
};
|
|
26
|
-
const ConnectionWithButton = ({ parentId, menuTabs, startPoint, endPoint, addNewNodeCallback, node, connectionIndex, curveType, isProcessed, childNodeId }) => {
|
|
26
|
+
const ConnectionWithButton = ({ parentId, menuTabs, startPoint, endPoint, addNewNodeCallback, node, connectionIndex, curveType, isProcessed, childNodeId, emptyMenuItemsComponent, searchPlaceholder }) => {
|
|
27
27
|
const popperRef = (0, react_1.useRef)();
|
|
28
28
|
const [anchorEl, setAnchorEl] = (0, react_1.useState)(false);
|
|
29
29
|
const [styles, setStyles] = (0, react_1.useState)({});
|
|
@@ -55,7 +55,8 @@ const ConnectionWithButton = ({ parentId, menuTabs, startPoint, endPoint, addNew
|
|
|
55
55
|
const left = rect?.left || 0;
|
|
56
56
|
const top = rect?.top || 0;
|
|
57
57
|
const style = {
|
|
58
|
-
transform: `translate(${left -
|
|
58
|
+
transform: `translate(${left - 400}px, ${top - 228}px)`,
|
|
59
|
+
overflow: 'visible',
|
|
59
60
|
};
|
|
60
61
|
setStyles(style);
|
|
61
62
|
setAnchorEl(true);
|
|
@@ -78,6 +79,6 @@ const ConnectionWithButton = ({ parentId, menuTabs, startPoint, endPoint, addNew
|
|
|
78
79
|
onClick: handleClick,
|
|
79
80
|
innerRef: popperRef
|
|
80
81
|
};
|
|
81
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AddButton_1.AddButton, { ...buttonProps }), (0, jsx_runtime_1.jsx)(AnimatedConnectionLine, { style: props }), (0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, { onClickAway: () => isOpen && handleClose(), mouseEvent: "onMouseDown", touchEvent: "onTouchStart", children: (0, jsx_runtime_1.jsx)(styled_1.StyledPopper, { placement: 'left', open: isOpen, sx: styles, modifiers: [{ name: 'arrow', enabled: true }], children: (0, jsx_runtime_1.jsx)(NodesMenu_1.default, { addNewNodeCallback: addNewNodeCallback, data: { parentId, connectionIndex }, menuTabs: menuTabs, onCloseMenu: handleClose }) }) })] }));
|
|
82
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AddButton_1.AddButton, { ...buttonProps }), (0, jsx_runtime_1.jsx)(AnimatedConnectionLine, { style: props }), (0, jsx_runtime_1.jsx)(material_1.ClickAwayListener, { onClickAway: () => isOpen && handleClose(), mouseEvent: "onMouseDown", touchEvent: "onTouchStart", children: (0, jsx_runtime_1.jsx)(styled_1.StyledPopper, { placement: 'left', open: isOpen, sx: styles, modifiers: [{ name: 'arrow', enabled: true }], children: (0, jsx_runtime_1.jsx)(NodesMenu_1.default, { addNewNodeCallback: addNewNodeCallback, data: { parentId, connectionIndex }, menuTabs: menuTabs, onCloseMenu: handleClose, emptyMenuItemsComponent: emptyMenuItemsComponent, searchPlaceholder: searchPlaceholder }) }) })] }));
|
|
82
83
|
};
|
|
83
84
|
exports.default = (0, react_1.memo)(ConnectionWithButton);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { MenuTabType, PointType } from '../../common/types';
|
|
2
3
|
import { AddNewNodeCallbackType } from '../../flow/types';
|
|
3
4
|
import { BaseDrawableNodeType, NodeType } from '../../node/types';
|
|
@@ -17,6 +18,8 @@ export type ConnectionPropsType = {
|
|
|
17
18
|
node: NodeType;
|
|
18
19
|
curveType?: ConnectionCurveEnum;
|
|
19
20
|
isProcessed: boolean;
|
|
21
|
+
emptyMenuItemsComponent?: JSX.Element;
|
|
22
|
+
searchPlaceholder?: string;
|
|
20
23
|
};
|
|
21
24
|
export type ConnectionDrawerType = {
|
|
22
25
|
type: string;
|
|
@@ -13,6 +13,8 @@ type PropsType = {
|
|
|
13
13
|
failedNodeId?: string;
|
|
14
14
|
failedNodeColor?: string;
|
|
15
15
|
onRedirect?: (flowId: string) => void;
|
|
16
|
+
emptyMenuItemsComponent?: JSX.Element;
|
|
17
|
+
searchPlaceholder?: string;
|
|
16
18
|
};
|
|
17
19
|
declare const FlowSandbox: FC<PropsType>;
|
|
18
20
|
export default FlowSandbox;
|
|
@@ -13,7 +13,7 @@ const Space_1 = __importDefault(require("../Space"));
|
|
|
13
13
|
const react_zoom_pan_pinch_1 = require("react-zoom-pan-pinch");
|
|
14
14
|
const components_1 = require("../../../common/components");
|
|
15
15
|
const FlowPosition_1 = require("../../context/FlowPosition");
|
|
16
|
-
const FlowSandbox = ({ nodeDrawers, connectionDrawers, containerRef, permissions, processedNodeIds, failedNodeId, failedNodeColor, onRedirect, onUpdateNodePosition }) => {
|
|
16
|
+
const FlowSandbox = ({ nodeDrawers, connectionDrawers, containerRef, permissions, processedNodeIds, failedNodeId, failedNodeColor, onRedirect, onUpdateNodePosition, emptyMenuItemsComponent, searchPlaceholder }) => {
|
|
17
17
|
const sandboxWidth = containerRef?.current?.offsetWidth || 0;
|
|
18
18
|
const [maxWidth, setMaxWidth] = (0, react_1.useState)(sandboxWidth);
|
|
19
19
|
const [minWidth, setMinWidth] = (0, react_1.useState)(0);
|
|
@@ -29,7 +29,7 @@ const FlowSandbox = ({ nodeDrawers, connectionDrawers, containerRef, permissions
|
|
|
29
29
|
const Connection = permissions.canCreate
|
|
30
30
|
? connection_1.moduleConnection.connections.connectionWithButton
|
|
31
31
|
: connection_1.moduleConnection.connections.baseConnection;
|
|
32
|
-
return ((0, jsx_runtime_1.jsx)(Connection, { ...connectionDrawer.connectionData, startPoint: {
|
|
32
|
+
return ((0, jsx_runtime_1.jsx)(Connection, { ...connectionDrawer.connectionData, emptyMenuItemsComponent: emptyMenuItemsComponent, searchPlaceholder: searchPlaceholder, startPoint: {
|
|
33
33
|
x: connectionDrawer.connectionData.startPoint.x - minWidth,
|
|
34
34
|
y: connectionDrawer.connectionData.startPoint.y,
|
|
35
35
|
}, endPoint: {
|
|
@@ -16,7 +16,7 @@ const FlowPosition_1 = require("../../context/FlowPosition");
|
|
|
16
16
|
const react_dnd_html5_backend_1 = require("react-dnd-html5-backend");
|
|
17
17
|
const react_dnd_1 = require("react-dnd");
|
|
18
18
|
const colors_1 = require("../../../../config/colors");
|
|
19
|
-
const NodesFlow = ({ theme, nodes, menuTabs, addNewNodeCallback, permissions, drawerProps, processedNodeIds, failedNodeId, failedNodeColor, onRedirect, onUpdateNodePosition }) => {
|
|
19
|
+
const NodesFlow = ({ theme, nodes, menuTabs, addNewNodeCallback, permissions, drawerProps, processedNodeIds, failedNodeId, failedNodeColor, onRedirect, onUpdateNodePosition, emptyMenuItemsComponent, searchPlaceholder, }) => {
|
|
20
20
|
const nodeDrawers = (0, react_1.useMemo)(() => {
|
|
21
21
|
const { startNodeList, nodeListWithEndNode } = nodeServices_1.nodeServices.createListOfStartNodesAndEndNodes(nodes);
|
|
22
22
|
const nodeListWithExpandCoefficients = expandCoefficientServices_1.expandCoefficientServices.calculateNodeExpandCoefficient(nodeListWithEndNode);
|
|
@@ -31,6 +31,6 @@ const NodesFlow = ({ theme, nodes, menuTabs, addNewNodeCallback, permissions, dr
|
|
|
31
31
|
addNewNodeCallback,
|
|
32
32
|
}), [nodeDrawers, menuTabs, addNewNodeCallback, processedNodeIds]);
|
|
33
33
|
const containerRef = (0, react_1.useRef)(null);
|
|
34
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: permissions.canRead && ((0, jsx_runtime_1.jsx)(ThemeContext_1.ThemeContextProvider, { themContextValue: theme, children: (0, jsx_runtime_1.jsx)(react_dnd_1.DndProvider, { backend: react_dnd_html5_backend_1.HTML5Backend, children: (0, jsx_runtime_1.jsx)(material_1.Box, { ref: containerRef, style: { height: "100%", width: "100%", background: theme?.palette.background.default || colors_1.Colors.DIRTY_WHITE }, children: (0, jsx_runtime_1.jsx)(SettingsContext_1.NodeSettingsProvider, { permissions: permissions, drawerProps: drawerProps, children: (0, jsx_runtime_1.jsx)(FlowPosition_1.FlowPositionProvider, { children: (0, jsx_runtime_1.jsx)(FlowSandbox_1.default, { permissions: permissions, connectionDrawers: connectionDrawers, nodeDrawers: nodeDrawers, containerRef: containerRef, processedNodeIds: processedNodeIds, failedNodeId: failedNodeId, failedNodeColor: failedNodeColor, onRedirect: onRedirect, onUpdateNodePosition: onUpdateNodePosition }) }) }) }) }) })) }));
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: permissions.canRead && ((0, jsx_runtime_1.jsx)(ThemeContext_1.ThemeContextProvider, { themContextValue: theme, children: (0, jsx_runtime_1.jsx)(react_dnd_1.DndProvider, { backend: react_dnd_html5_backend_1.HTML5Backend, children: (0, jsx_runtime_1.jsx)(material_1.Box, { ref: containerRef, style: { height: "100%", width: "100%", background: theme?.palette.background.default || colors_1.Colors.DIRTY_WHITE }, children: (0, jsx_runtime_1.jsx)(SettingsContext_1.NodeSettingsProvider, { permissions: permissions, drawerProps: drawerProps, children: (0, jsx_runtime_1.jsx)(FlowPosition_1.FlowPositionProvider, { children: (0, jsx_runtime_1.jsx)(FlowSandbox_1.default, { permissions: permissions, connectionDrawers: connectionDrawers, nodeDrawers: nodeDrawers, containerRef: containerRef, processedNodeIds: processedNodeIds, failedNodeId: failedNodeId, failedNodeColor: failedNodeColor, onRedirect: onRedirect, onUpdateNodePosition: onUpdateNodePosition, emptyMenuItemsComponent: emptyMenuItemsComponent, searchPlaceholder: searchPlaceholder }) }) }) }) }) })) }));
|
|
35
35
|
};
|
|
36
36
|
exports.default = NodesFlow;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { MenuTabType, Theme, UpdateNodePosition } from "../../common/types";
|
|
3
|
+
import { NodeMenuItemType } from "../../node/enums";
|
|
2
4
|
import { NodeType } from "../../node/types";
|
|
3
5
|
export type AddNewNodeCallbackType = (params: {
|
|
4
6
|
menuItemId: string;
|
|
5
7
|
parentId: string | undefined;
|
|
6
8
|
connectionIndex: number;
|
|
9
|
+
nodeType: NodeMenuItemType;
|
|
7
10
|
}) => void;
|
|
8
11
|
export type NodeFlowPropsType = {
|
|
9
12
|
nodes: NodeType[];
|
|
@@ -17,6 +20,8 @@ export type NodeFlowPropsType = {
|
|
|
17
20
|
onRedirect?: (flowId: string) => void;
|
|
18
21
|
onUpdateNodePosition: UpdateNodePosition;
|
|
19
22
|
theme: Theme;
|
|
23
|
+
emptyMenuItemsComponent?: JSX.Element;
|
|
24
|
+
searchPlaceholder?: string;
|
|
20
25
|
};
|
|
21
26
|
export type IDrawerProps = {
|
|
22
27
|
isOpen: boolean;
|
|
@@ -45,7 +45,7 @@ const BaseNode = ({ nodeData, isProcessed, isFailed, failedNodeColor, onRedirect
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
const component = (0, react_1.useRef)();
|
|
48
|
-
return ((0, jsx_runtime_1.jsx)(DragWrapper_1.DragWrapper, { onUpdatePosition: onUpdatePosition, nodeId: nodeData?.id || '', children: (0, jsx_runtime_1.jsx)(material_1.Box, { ref: component, children: (0, jsx_runtime_1.jsxs)(AnimatedContainer, { onClick: onNodeClick, style: props, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [(0, jsx_runtime_1.jsxs)(styled_1.IconWrapper, { children: [(0, jsx_runtime_1.jsx)(styled_1.IconBorder, {}), nodeData?.icon] }), (0, jsx_runtime_1.jsxs)(styled_1.ContentContainer, { children: [(0, jsx_runtime_1.jsxs)(styled_1.NameOfExtension, { children: ["Type: ", nodeData?.
|
|
48
|
+
return ((0, jsx_runtime_1.jsx)(DragWrapper_1.DragWrapper, { onUpdatePosition: onUpdatePosition, nodeId: nodeData?.id || '', children: (0, jsx_runtime_1.jsx)(material_1.Box, { ref: component, children: (0, jsx_runtime_1.jsxs)(AnimatedContainer, { onClick: onNodeClick, style: props, onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), children: [(0, jsx_runtime_1.jsxs)(styled_1.IconWrapper, { children: [(0, jsx_runtime_1.jsx)(styled_1.IconBorder, {}), nodeData?.icon] }), (0, jsx_runtime_1.jsxs)(styled_1.ContentContainer, { children: [(0, jsx_runtime_1.jsxs)(styled_1.NameOfExtension, { children: ["Type: ", nodeData?.nodeType || 'unknown'] }), (0, jsx_runtime_1.jsx)(styled_1.Name, { children: nodeData?.name })] }), nodeData?.childFlowId &&
|
|
49
49
|
(0, jsx_runtime_1.jsx)(styled_1.ChildFlowWrapper, { onClick: redirectToParentFlow, children: (0, jsx_runtime_1.jsx)("img", { src: flowIcon_svg_1.default }) })] }) }) }));
|
|
50
50
|
};
|
|
51
51
|
exports.default = BaseNode;
|
|
@@ -40,6 +40,6 @@ const ChoiceNode = ({ nodeData, isProcessed, isFailed, failedNodeColor }) => {
|
|
|
40
40
|
});
|
|
41
41
|
const ChoiceNodeImg = (0, react_1.useMemo)(() => (0, styled_1.createChoiceNodeImg)(), [color, node?.id, nodeData?.id]);
|
|
42
42
|
const AnimatedChoiceNodeImg = (0, web_1.animated)(ChoiceNodeImg);
|
|
43
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AnimatedChoiceNodeImg, { src: ChoiceNodeIcon_svg_1.default, style: props }), (0, jsx_runtime_1.jsx)(styled_1.Container, { onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onClick: onNodeClick, children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, children: (0, jsx_runtime_1.jsx)(styled_1.ArrowImg, { src: LeftArrowIcon_svg_1.default, alt: "leftArrow" }) }), (0, jsx_runtime_1.jsx)(styled_1.NameGreed, { flexGrow: 1, item: true, children: nodeData?.name || nodeData?.
|
|
43
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(AnimatedChoiceNodeImg, { src: ChoiceNodeIcon_svg_1.default, style: props }), (0, jsx_runtime_1.jsx)(styled_1.Container, { onMouseEnter: () => setIsHovered(true), onMouseLeave: () => setIsHovered(false), onClick: onNodeClick, children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, children: (0, jsx_runtime_1.jsx)(styled_1.ArrowImg, { src: LeftArrowIcon_svg_1.default, alt: "leftArrow" }) }), (0, jsx_runtime_1.jsx)(styled_1.NameGreed, { flexGrow: 1, item: true, children: nodeData?.name || nodeData?.nodeType }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, children: (0, jsx_runtime_1.jsx)(styled_1.ArrowImg, { src: RightArrowIcon_svg_1.default, alt: "RightArrow" }) })] }) })] }));
|
|
44
44
|
};
|
|
45
45
|
exports.default = ChoiceNode;
|
|
@@ -7,22 +7,33 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const styled_1 = require("./styled");
|
|
9
9
|
const Grid_1 = __importDefault(require("@mui/material/Grid"));
|
|
10
|
-
const NodesMenu = ({ addNewNodeCallback, menuTabs, data, onCloseMenu, }) => {
|
|
10
|
+
const NodesMenu = ({ addNewNodeCallback, menuTabs, data, onCloseMenu, emptyMenuItemsComponent, searchPlaceholder, }) => {
|
|
11
11
|
const [value, setValue] = (0, react_1.useState)(menuTabs?.[0].name);
|
|
12
|
+
const [searchQuery, setSearchQuery] = (0, react_1.useState)("");
|
|
12
13
|
const handleChange = (_, newValue) => {
|
|
13
14
|
setValue(newValue);
|
|
15
|
+
setSearchQuery("");
|
|
16
|
+
};
|
|
17
|
+
const handleSearchChange = (event) => {
|
|
18
|
+
setSearchQuery(event.target.value);
|
|
14
19
|
};
|
|
15
20
|
const tab = (0, react_1.useMemo)(() => menuTabs.reduce((tabContentByTabName, tab) => ({
|
|
16
21
|
...tabContentByTabName,
|
|
17
22
|
[tab.name]: tab.menuItems,
|
|
18
23
|
}), {}), [menuTabs]);
|
|
19
|
-
const onMenuItemClick = (nodeId) => {
|
|
24
|
+
const onMenuItemClick = (nodeId, nodeType) => {
|
|
20
25
|
addNewNodeCallback?.({
|
|
21
26
|
...data,
|
|
22
27
|
menuItemId: nodeId,
|
|
28
|
+
nodeType,
|
|
23
29
|
});
|
|
24
30
|
onCloseMenu();
|
|
25
31
|
};
|
|
26
|
-
|
|
32
|
+
const filteredItems = (0, react_1.useMemo)(() => {
|
|
33
|
+
return tab[value].filter((menuItem) => menuItem.name.toLowerCase().includes(searchQuery.toLowerCase()));
|
|
34
|
+
}, [searchQuery, value]);
|
|
35
|
+
return ((0, jsx_runtime_1.jsxs)(styled_1.MenuContainer, { children: [(0, jsx_runtime_1.jsxs)(Grid_1.default, { direction: "column", p: "0 0 10px 0", children: [(0, jsx_runtime_1.jsxs)(Grid_1.default, { alignItems: "center", container: true, p: "8px 8px 0 0", children: [(0, jsx_runtime_1.jsx)(Grid_1.default, { flexGrow: 1, item: true, children: (0, jsx_runtime_1.jsx)(styled_1.StyledTabs, { value: value, onChange: handleChange, textColor: "primary", indicatorColor: "primary", children: menuTabs.map((tab) => ((0, jsx_runtime_1.jsx)(styled_1.StyledTab, { value: tab.name, label: tab.name }, tab.name))) }) }), (0, jsx_runtime_1.jsx)(Grid_1.default, { item: true, children: (0, jsx_runtime_1.jsx)(styled_1.Close, { onClick: onCloseMenu }) })] }), (0, jsx_runtime_1.jsx)(styled_1.StyledTextField, { fullWidth: true, variant: "outlined", size: "small", placeholder: searchPlaceholder ? searchPlaceholder : "", value: searchQuery, onChange: handleSearchChange })] }), (0, jsx_runtime_1.jsx)(styled_1.ContentContainer, { children: filteredItems?.length > 0
|
|
36
|
+
? filteredItems.map((menuItem) => ((0, jsx_runtime_1.jsxs)(styled_1.MenuItem, { onClick: () => onMenuItemClick(menuItem.value, menuItem.type), children: [(0, jsx_runtime_1.jsx)(styled_1.IconWrapper, { children: menuItem.icon }), menuItem.name] }, menuItem.value)))
|
|
37
|
+
: emptyMenuItemsComponent && emptyMenuItemsComponent })] }));
|
|
27
38
|
};
|
|
28
39
|
exports.default = NodesMenu;
|
|
@@ -125,3 +125,6 @@ export declare const Close: import("@emotion/styled").StyledComponent<{
|
|
|
125
125
|
}, "color" | "fontSize" | "shapeRendering" | "children" | "viewBox" | "sx" | keyof import("@mui/material/OverridableComponent").CommonProps | "htmlColor" | "inheritViewBox" | "titleAccess"> & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {}>;
|
|
126
126
|
export declare const MenuItem: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
127
127
|
export declare const IconWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
128
|
+
export declare const StyledTextField: import("@emotion/styled").StyledComponent<{
|
|
129
|
+
variant?: import("@mui/material").TextFieldVariants | undefined;
|
|
130
|
+
} & Omit<import("@mui/material").StandardTextFieldProps | import("@mui/material").FilledTextFieldProps | import("@mui/material").OutlinedTextFieldProps, "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/system").Theme>, {}, {}>;
|
|
@@ -3,14 +3,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.IconWrapper = exports.MenuItem = exports.Close = exports.ContentContainer = exports.StyledTab = exports.StyledTabs = exports.TabContainer = exports.MenuContainer = void 0;
|
|
6
|
+
exports.StyledTextField = exports.IconWrapper = exports.MenuItem = exports.Close = exports.ContentContainer = exports.StyledTab = exports.StyledTabs = exports.TabContainer = exports.MenuContainer = void 0;
|
|
7
7
|
const system_1 = require("@mui/system");
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
9
|
const Close_1 = __importDefault(require("@mui/icons-material/Close"));
|
|
10
10
|
exports.MenuContainer = (0, system_1.styled)(material_1.Box)(({ theme }) => ({
|
|
11
|
-
width: "
|
|
12
|
-
height: "
|
|
13
|
-
borderRadius: "
|
|
11
|
+
width: "400px",
|
|
12
|
+
height: "515px",
|
|
13
|
+
borderRadius: "4px",
|
|
14
14
|
background: theme.palette.background.paper,
|
|
15
15
|
color: theme.palette.text.primary,
|
|
16
16
|
paddingBottom: "6px",
|
|
@@ -32,7 +32,7 @@ exports.StyledTab = (0, system_1.styled)(material_1.Tab) `
|
|
|
32
32
|
min-height: 40px;
|
|
33
33
|
`;
|
|
34
34
|
exports.ContentContainer = (0, system_1.styled)("div") `
|
|
35
|
-
height: 100
|
|
35
|
+
height: calc(100% - 120px);
|
|
36
36
|
overflow-y: scroll;
|
|
37
37
|
`;
|
|
38
38
|
exports.Close = (0, system_1.styled)(Close_1.default) `
|
|
@@ -67,3 +67,14 @@ exports.IconWrapper = (0, system_1.styled)("div") `
|
|
|
67
67
|
object-fit: contain;
|
|
68
68
|
overflow: hidden;
|
|
69
69
|
`;
|
|
70
|
+
exports.StyledTextField = (0, system_1.styled)(material_1.TextField) `
|
|
71
|
+
width: calc(100% - 32px);
|
|
72
|
+
margin: 10px 16px 0;
|
|
73
|
+
.MuiOutlinedInput-notchedOutline {
|
|
74
|
+
border-color: rgb(216, 219, 220)!important;
|
|
75
|
+
}
|
|
76
|
+
.MuiInputBase-input {
|
|
77
|
+
padding-top: 5px;
|
|
78
|
+
padding-bottom: 5px;
|
|
79
|
+
}
|
|
80
|
+
`;
|
|
@@ -42,6 +42,6 @@ const NodeSettingsProvider = ({ children, permissions: { canUpdate, canDelete },
|
|
|
42
42
|
node?.settings?.footer?.onDelete?.(node?.id);
|
|
43
43
|
handleClose();
|
|
44
44
|
};
|
|
45
|
-
return ((0, jsx_runtime_1.jsxs)(SettingsContext.Provider, { value: { node, setNode }, children: [children, canUpdate && ((0, jsx_runtime_1.jsx)(components_1.HorizontalDrawer, { open: isOpen, onClose: handleClose, HeaderContent: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(styled_1.IconWrapper, { children: [(0, jsx_runtime_1.jsx)(styled_1.IconBorder, {}), node?.icon] }), (0, jsx_runtime_1.jsx)(styled_1.NameContainer, { children: node?.
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)(SettingsContext.Provider, { value: { node, setNode }, children: [children, canUpdate && ((0, jsx_runtime_1.jsx)(components_1.HorizontalDrawer, { open: isOpen, onClose: handleClose, HeaderContent: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)(styled_1.IconWrapper, { children: [(0, jsx_runtime_1.jsx)(styled_1.IconBorder, {}), node?.icon] }), (0, jsx_runtime_1.jsx)(styled_1.NameContainer, { children: node?.nodeType || 'unknown' })] }), Content: (0, jsx_runtime_1.jsxs)(styled_1.SettingsContent, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, { display: 'flex', flexDirection: 'column', flexGrow: 1, children: node?.settings?.settingsForm }), node?.settings?.customFooter ?? ((0, jsx_runtime_1.jsxs)(styled_1.DefaultFooterContainer, { children: [!isNodeWithoutSave && ((0, jsx_runtime_1.jsx)(material_2.Button, { onClick: onSaveNode, variant: "contained", children: node?.settings?.footer?.saveText || "Save" })), (0, jsx_runtime_1.jsx)(material_1.Box, { flexGrow: 1, children: (0, jsx_runtime_1.jsx)(material_2.Button, { variant: "outlined", onClick: onCancel, children: node?.settings?.footer?.cancelText || "Cancel " }) }), canDelete && ((0, jsx_runtime_1.jsx)(material_2.Button, { onClick: onDeleteNode, color: "error", variant: "text", children: node?.settings?.footer?.deleteText || "Delete node" }))] }))] }) }))] }));
|
|
46
46
|
};
|
|
47
47
|
exports.NodeSettingsProvider = NodeSettingsProvider;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeTypeEnum = void 0;
|
|
3
|
+
exports.NodeMenuItemType = exports.NodeTypeEnum = void 0;
|
|
4
4
|
var NodeTypeEnum;
|
|
5
5
|
(function (NodeTypeEnum) {
|
|
6
6
|
NodeTypeEnum["BaseNode"] = "baseNode";
|
|
@@ -10,3 +10,8 @@ var NodeTypeEnum;
|
|
|
10
10
|
NodeTypeEnum["ChoiceNode"] = "choiceNode";
|
|
11
11
|
NodeTypeEnum["ParallelNode"] = "parallelNode";
|
|
12
12
|
})(NodeTypeEnum || (exports.NodeTypeEnum = NodeTypeEnum = {}));
|
|
13
|
+
var NodeMenuItemType;
|
|
14
|
+
(function (NodeMenuItemType) {
|
|
15
|
+
NodeMenuItemType["EXTENSION"] = "extension";
|
|
16
|
+
NodeMenuItemType["AI_AGENT"] = "ai-agent";
|
|
17
|
+
})(NodeMenuItemType || (exports.NodeMenuItemType = NodeMenuItemType = {}));
|
|
@@ -12,8 +12,8 @@ const ParallelNode_1 = __importDefault(require("./components/ParallelNode"));
|
|
|
12
12
|
const StartNode_1 = __importDefault(require("./components/StartNode"));
|
|
13
13
|
exports.nodeModule = {
|
|
14
14
|
nodes: {
|
|
15
|
-
baseNode: BaseNode_1.default,
|
|
16
15
|
startNode: StartNode_1.default,
|
|
16
|
+
baseNode: BaseNode_1.default,
|
|
17
17
|
endNode: EndNode_1.default,
|
|
18
18
|
hubNode: HubNode_1.default,
|
|
19
19
|
choiceNode: ChoiseNode_1.default,
|
|
@@ -5,7 +5,7 @@ declare class ExpandCoefficientServices {
|
|
|
5
5
|
expandCoefficient: number;
|
|
6
6
|
id: string;
|
|
7
7
|
name?: string | undefined;
|
|
8
|
-
|
|
8
|
+
nodeType?: string | undefined;
|
|
9
9
|
description?: string | undefined;
|
|
10
10
|
icon?: JSX.Element | undefined;
|
|
11
11
|
type: import("../enums").NodeTypeEnum;
|