fixed up styling for choose
This commit is contained in:
1 parent
084a3585d0
commit
0c5ef76f4b
11 files changed
+283
-61
No files matched your search
@@ -12,3 +12,14 @@
|
|||||||
left: 50%;
|
left: 50%;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.dag-graphboard rect.react-flow__edge-textbg {
|
||||||
|
fill: var(--mui-background-paper);
|
||||||
|
stroke: var(--mui-text-primary);
|
||||||
|
stroke-width: 0.25px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dag-graphboard text.react-flow__edge-text {
|
||||||
|
fill: var(--mui-text-primary);
|
||||||
|
}
|
||||||
@@ -58,7 +58,7 @@ export const DAGGraphBoardInner: FC<DAGGraphBoardProps> = ({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
// this hack avoids breakage on when zooming
|
// this hack avoids breakage on when zooming
|
||||||
const prefix = Math.floor((((zoom - 0.5) / (2 - 0.5)) * 10) / 3);
|
const prefix = Math.floor(zoom / (2.5 / 3));
|
||||||
const elements = {
|
const elements = {
|
||||||
nodes: state.data.elements.nodes.map((n) => ({
|
nodes: state.data.elements.nodes.map((n) => ({
|
||||||
...n,
|
...n,
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export const CIRCLE_SIZE = 40 as const;
|
|||||||
export const DEFAULT_DIMS: DAGDims = {
|
export const DEFAULT_DIMS: DAGDims = {
|
||||||
trigger: {
|
trigger: {
|
||||||
height: NODE_HEIGHT * 3,
|
height: NODE_HEIGHT * 3,
|
||||||
width: NODE_WIDTH * 4.5,
|
width: NODE_WIDTH * 1.5,
|
||||||
},
|
},
|
||||||
node: {
|
node: {
|
||||||
height: NODE_HEIGHT,
|
height: NODE_HEIGHT,
|
||||||
@@ -15,7 +15,7 @@ export const DEFAULT_DIMS: DAGDims = {
|
|||||||
},
|
},
|
||||||
condition: {
|
condition: {
|
||||||
height: NODE_HEIGHT * 3,
|
height: NODE_HEIGHT * 3,
|
||||||
width: NODE_WIDTH * 4.5,
|
width: NODE_WIDTH * 1.5,
|
||||||
},
|
},
|
||||||
circle: {
|
circle: {
|
||||||
height: CIRCLE_SIZE,
|
height: CIRCLE_SIZE,
|
||||||
|
|||||||
@@ -22,6 +22,46 @@ export const moveAlong = (
|
|||||||
return !dims.flipped ? moveOnX : moveOnY;
|
return !dims.flipped ? moveOnX : moveOnY;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const moveAlongOnce = (
|
||||||
|
by: keyof DAGEntities,
|
||||||
|
startPoint: XYPosition,
|
||||||
|
dims: DAGDims,
|
||||||
|
reversed: boolean = false
|
||||||
|
): XYPosition => {
|
||||||
|
const moveOnY = {
|
||||||
|
y: startPoint.y + dims[by].height * (dims.distanceFactor.node - 1),
|
||||||
|
x: startPoint.x,
|
||||||
|
};
|
||||||
|
const moveOnX = {
|
||||||
|
x: startPoint.x + dims[by].width * (dims.distanceFactor.node - 1),
|
||||||
|
y: startPoint.y,
|
||||||
|
};
|
||||||
|
if (reversed) {
|
||||||
|
return dims.flipped ? moveOnX : moveOnY;
|
||||||
|
}
|
||||||
|
return !dims.flipped ? moveOnX : moveOnY;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const moveAlongRelativeTo = (
|
||||||
|
offsetPos: XYPosition,
|
||||||
|
relatedPos: XYPosition,
|
||||||
|
dims: DAGDims,
|
||||||
|
incrementBy: keyof DAGEntities = "condition"
|
||||||
|
) =>
|
||||||
|
dims.flipped
|
||||||
|
? {
|
||||||
|
x:
|
||||||
|
relatedPos.x +
|
||||||
|
(dims.distanceFactor.node - 1) * dims[incrementBy].width,
|
||||||
|
y: offsetPos.y,
|
||||||
|
}
|
||||||
|
: {
|
||||||
|
y:
|
||||||
|
relatedPos.y +
|
||||||
|
(dims.distanceFactor.node - 1) * dims[incrementBy].height,
|
||||||
|
x: offsetPos.x,
|
||||||
|
};
|
||||||
|
|
||||||
export const moveFromTo = (
|
export const moveFromTo = (
|
||||||
from: keyof DAGEntities,
|
from: keyof DAGEntities,
|
||||||
to: keyof DAGEntities,
|
to: keyof DAGEntities,
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ export const makeTriggerNodes: ElementMaker<AutomationTrigger> = (
|
|||||||
state.addNode(
|
state.addNode(
|
||||||
CollectionNodeMaker.makeElement({ id: nodeId, position }, dims, {
|
CollectionNodeMaker.makeElement({ id: nodeId, position }, dims, {
|
||||||
...dims.trigger,
|
...dims.trigger,
|
||||||
color: "red",
|
collectionType: "trigger",
|
||||||
onAddNode: () => stateUpdater.basic.trigger.addNode(null),
|
onAddNode: () => stateUpdater.basic.trigger.addNode(null),
|
||||||
nodes: nodes.map((node, index) => ({
|
nodes: nodes.map((node, index) => ({
|
||||||
enabled: node.enabled ?? true,
|
enabled: node.enabled ?? true,
|
||||||
@@ -117,7 +117,7 @@ export const makeConditionNodes: ElementMaker<AutomationCondition> = (
|
|||||||
state.addNode(
|
state.addNode(
|
||||||
CollectionNodeMaker.makeElement({ id: nodeId, position }, dims, {
|
CollectionNodeMaker.makeElement({ id: nodeId, position }, dims, {
|
||||||
...dims.condition,
|
...dims.condition,
|
||||||
color: "blue",
|
collectionType: "condition",
|
||||||
hasInput: !!lastNodeId,
|
hasInput: !!lastNodeId,
|
||||||
onAddNode: () => stateUpdater.basic.condition.addNode(null),
|
onAddNode: () => stateUpdater.basic.condition.addNode(null),
|
||||||
nodes: nodes.map((node, index) => ({
|
nodes: nodes.map((node, index) => ({
|
||||||
@@ -127,6 +127,7 @@ export const makeConditionNodes: ElementMaker<AutomationCondition> = (
|
|||||||
})),
|
})),
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
console.log("pre", { lastNodeId, stateLast: state.lastNodeId });
|
||||||
if (lastNodeId && state.lastNodeId) {
|
if (lastNodeId && state.lastNodeId) {
|
||||||
state.addEdge(lastNodeId, state.lastNodeId, true);
|
state.addEdge(lastNodeId, state.lastNodeId, true);
|
||||||
}
|
}
|
||||||
@@ -227,25 +228,19 @@ export const makeChooseeNodes: ElementMaker<ChooseAction> = (nodes, args) => {
|
|||||||
) => {
|
) => {
|
||||||
let pos = offsetPos;
|
let pos = offsetPos;
|
||||||
let lastNodeId = args.lastNodeId;
|
let lastNodeId = args.lastNodeId;
|
||||||
// if (condition !== null) {
|
if (condition !== null) {
|
||||||
// const conditionState = makeConditionNodes(condition, {
|
const conditionState = makeConditionNodes(condition, {
|
||||||
// ...args,
|
...args,
|
||||||
// position: pos,
|
position: pos,
|
||||||
// lastNodeId,
|
lastNodeId,
|
||||||
// nodeIndex: index,
|
nodeIndex: index,
|
||||||
// nodeId: `${args.nodeId}-choose-${index}-condition`,
|
nodeId: `${args.nodeId}-choose-${nodeIndex}-${index}-condition`,
|
||||||
// });
|
});
|
||||||
// // pos.y = conditionState.bbox[1].y;
|
conditionState.data.edges[0].label = `Condition #${index}`;
|
||||||
// state.extend(conditionState);
|
state.extend(conditionState);
|
||||||
// if (lastNodeId && conditionState.data.nodes.length > 0) {
|
pos = distance.moveFromTo("condition", "node", pos, args.dims);
|
||||||
// state.addEdge(lastNodeId, conditionState.data.nodes[0].id, true);
|
lastNodeId = conditionState.lastNodeId;
|
||||||
// }
|
}
|
||||||
// lastNodeId = conditionState.lastNodeId ?? lastNodeId;
|
|
||||||
// pos = {
|
|
||||||
// y: conditionState.bbox[1].y,
|
|
||||||
// x: pos.x,
|
|
||||||
// };
|
|
||||||
// }
|
|
||||||
const output = makeSequenceNodes(sequence, {
|
const output = makeSequenceNodes(sequence, {
|
||||||
...args,
|
...args,
|
||||||
position: pos,
|
position: pos,
|
||||||
@@ -254,21 +249,19 @@ export const makeChooseeNodes: ElementMaker<ChooseAction> = (nodes, args) => {
|
|||||||
nodeId: `${args.nodeId}-choose-${index}-sequence`,
|
nodeId: `${args.nodeId}-choose-${index}-sequence`,
|
||||||
});
|
});
|
||||||
if (lastNodeId && output.data.nodes.length > 0) {
|
if (lastNodeId && output.data.nodes.length > 0) {
|
||||||
state.addEdge(lastNodeId, output.data.nodes[0].id, true);
|
state.addEdge(
|
||||||
|
lastNodeId,
|
||||||
|
output.data.nodes[0].id,
|
||||||
|
true,
|
||||||
|
condition === null ? "else" : undefined
|
||||||
|
);
|
||||||
}
|
}
|
||||||
offsetPos = args.dims.flipped
|
offsetPos = distance.moveAlongRelativeTo(
|
||||||
? {
|
offsetPos,
|
||||||
x:
|
output.bbox[1],
|
||||||
output.bbox[1].x +
|
args.dims,
|
||||||
(args.dims.distanceFactor.node - 1) * args.dims.node.width,
|
condition === null ? "node" : "condition"
|
||||||
y: offsetPos.y,
|
);
|
||||||
}
|
|
||||||
: {
|
|
||||||
y:
|
|
||||||
output.bbox[1].y +
|
|
||||||
(args.dims.distanceFactor.node - 1) * args.dims.node.height,
|
|
||||||
x: offsetPos.x,
|
|
||||||
};
|
|
||||||
state.extend(output);
|
state.extend(output);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -49,11 +49,17 @@ export class DAGElementsState {
|
|||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
public addEdge(from: string, to: string, animated: boolean = false) {
|
public addEdge(
|
||||||
|
from: string,
|
||||||
|
to: string,
|
||||||
|
animated: boolean = false,
|
||||||
|
label: string | undefined = undefined
|
||||||
|
) {
|
||||||
this.data.edges.push({
|
this.data.edges.push({
|
||||||
id: `${from}->${to}`,
|
id: `${from}->${to}`,
|
||||||
source: from,
|
source: from,
|
||||||
target: to,
|
target: to,
|
||||||
|
label,
|
||||||
animated,
|
animated,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
.collection-nodes--wrap {
|
.collection-nodes--wrap {
|
||||||
--padding: 1.5em;
|
--padding-left: 1.5em;
|
||||||
--child-height: calc(var(--node-height) - 2*var(--padding));
|
--padding-right: 3em;
|
||||||
--child-width: calc(var(--node-width) - 2*var(--padding));
|
--padding-top: 2.25em;
|
||||||
|
--padding-bottom: 0.25em;
|
||||||
|
--child-height: calc(var(--node-height) - var(--padding-top) - var(--padding-bottom));
|
||||||
|
--child-width: calc(var(--node-width) - var(--padding-left) - var(--padding-right));
|
||||||
|
|
||||||
min-width: var(--node-width);
|
min-width: var(--node-width);
|
||||||
min-height: var(--node-height);
|
min-height: var(--node-height);
|
||||||
@@ -18,20 +21,34 @@
|
|||||||
|
|
||||||
.collection-nodes {
|
.collection-nodes {
|
||||||
position: relative;
|
position: relative;
|
||||||
display: flex;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
flex-direction: row;
|
|
||||||
align-items: center;
|
|
||||||
gap: 0em 1em;
|
|
||||||
max-width: var(--child-width);
|
|
||||||
max-height: var(--child-height);
|
|
||||||
|
|
||||||
border-color: var(--node-color);
|
border-color: var(--node-color);
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-width: 1px;
|
border-width: 1px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
|
|
||||||
|
max-width: max-content;
|
||||||
|
max-height: max-content;
|
||||||
|
padding-right: var(--padding-right);
|
||||||
|
}
|
||||||
|
|
||||||
|
.collection-nodes--inner {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
gap: 0 1em;
|
||||||
|
max-width: var(--child-width);
|
||||||
|
max-height: var(--child-height);
|
||||||
|
min-height: calc(var(--child-height) / 4);
|
||||||
|
min-width: var(--child-width);
|
||||||
|
|
||||||
|
padding-left: var(--padding-left);
|
||||||
|
padding-top: var(--padding-top);
|
||||||
|
padding-bottom: var(--padding-bottom);
|
||||||
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
padding: var(--padding);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.collection-nodes .react-flow__handle {
|
.collection-nodes .react-flow__handle {
|
||||||
@@ -44,3 +61,15 @@
|
|||||||
right: 0.25em;
|
right: 0.25em;
|
||||||
font-size: 0.5em;
|
font-size: 0.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.collection-nodes .add {
|
||||||
|
position: absolute;
|
||||||
|
bottom: calc(50% - var(--padding-bottom));
|
||||||
|
right: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.collection-nodes--title {
|
||||||
|
position: absolute;
|
||||||
|
top: 0.5em;
|
||||||
|
left: calc(var(--child-width)/2);
|
||||||
|
}
|
||||||
@@ -7,6 +7,7 @@ import { SequenceNodeElement } from "../SequenceNode/SequenceNodeElement";
|
|||||||
import { CollectionNodeProps } from "./types";
|
import { CollectionNodeProps } from "./types";
|
||||||
import { Handle, Position } from "react-flow-renderer";
|
import { Handle, Position } from "react-flow-renderer";
|
||||||
import { useSequenceNodeColor } from "../SequenceNode/util";
|
import { useSequenceNodeColor } from "../SequenceNode/util";
|
||||||
|
import { prettyName } from "utils/formatting";
|
||||||
|
|
||||||
export const CollectionNode: FC<CollectionNodeProps> = ({
|
export const CollectionNode: FC<CollectionNodeProps> = ({
|
||||||
onAddNode,
|
onAddNode,
|
||||||
@@ -17,6 +18,7 @@ export const CollectionNode: FC<CollectionNodeProps> = ({
|
|||||||
flipped,
|
flipped,
|
||||||
color,
|
color,
|
||||||
hasInput = false,
|
hasInput = false,
|
||||||
|
collectionType,
|
||||||
}) => {
|
}) => {
|
||||||
const nodeColor = useSequenceNodeColor(color);
|
const nodeColor = useSequenceNodeColor(color);
|
||||||
|
|
||||||
@@ -32,22 +34,29 @@ export const CollectionNode: FC<CollectionNodeProps> = ({
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className="collection-nodes">
|
<div className="collection-nodes">
|
||||||
{nodes.map((n, i) => (
|
<span className="collection-nodes--title">
|
||||||
<SequenceNodeElement
|
{prettyName(collectionType)}s
|
||||||
{...n}
|
</span>
|
||||||
{...sequenceNode}
|
<div className="collection-nodes--inner">
|
||||||
key={i}
|
{nodes.map((n, i) => (
|
||||||
color={color}
|
<SequenceNodeElement
|
||||||
flipped={flipped}
|
{...n}
|
||||||
/>
|
{...sequenceNode}
|
||||||
))}
|
key={i}
|
||||||
<ButtonIcon icon={<Add />} onClick={onAddNode} />
|
color={color}
|
||||||
|
flipped={flipped}
|
||||||
|
/>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
<ButtonIcon className="add" icon={<Add />} onClick={onAddNode} />
|
||||||
<Handle
|
<Handle
|
||||||
|
key="source"
|
||||||
type="source"
|
type="source"
|
||||||
position={flipped ? Position.Bottom : Position.Right}
|
position={flipped ? Position.Bottom : Position.Right}
|
||||||
/>
|
/>
|
||||||
{hasInput && (
|
{hasInput && (
|
||||||
<Handle
|
<Handle
|
||||||
|
key="target"
|
||||||
type="target"
|
type="target"
|
||||||
position={flipped ? Position.Top : Position.Left}
|
position={flipped ? Position.Top : Position.Left}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -0,0 +1,126 @@
|
|||||||
|
import React, { FC } from "react";
|
||||||
|
import { ComponentMeta, ComponentStory } from "@storybook/react";
|
||||||
|
import { Page } from "components/Page";
|
||||||
|
import { CollectionNode } from "./CollectionNode";
|
||||||
|
import { DAGGraphBoard } from "components/DAGGraph/board";
|
||||||
|
import { CollectionNodeMaker } from "./index";
|
||||||
|
import { DEFAULT_DIMS } from "components/DAGGraph/elements/constants";
|
||||||
|
|
||||||
|
const Demo: FC<{
|
||||||
|
height: number;
|
||||||
|
width: number;
|
||||||
|
totalChildNodes: number;
|
||||||
|
onAddNode: () => void;
|
||||||
|
enabledChild: boolean;
|
||||||
|
}> = (args) => {
|
||||||
|
return (
|
||||||
|
<Page>
|
||||||
|
<DAGGraphBoard
|
||||||
|
closeModal={() => {}}
|
||||||
|
state={{
|
||||||
|
ready: true,
|
||||||
|
data: {
|
||||||
|
elements: {
|
||||||
|
edges: [],
|
||||||
|
nodes: ["trogger", "sequence", "condition"].map(
|
||||||
|
(collectionType: any, i: number) =>
|
||||||
|
CollectionNodeMaker.makeElement(
|
||||||
|
{
|
||||||
|
id: collectionType,
|
||||||
|
position: {
|
||||||
|
x: 50 + args.width * (i % 3 === 0 ? 1 : 0),
|
||||||
|
y: 50 + args.height * ((i + 1) % 2 === 0 ? 1 : 0),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
DEFAULT_DIMS,
|
||||||
|
{
|
||||||
|
hasInput: false,
|
||||||
|
onAddNode: args.onAddNode,
|
||||||
|
width: args.width,
|
||||||
|
height: args.height,
|
||||||
|
nodes: [
|
||||||
|
{
|
||||||
|
enabled: args.enabledChild,
|
||||||
|
label: collectionType,
|
||||||
|
},
|
||||||
|
...Array.from(Array(args.totalChildNodes)).map(
|
||||||
|
(_, i) => ({
|
||||||
|
enabled: true,
|
||||||
|
label: `Dummy Node #${i + 1}`,
|
||||||
|
})
|
||||||
|
),
|
||||||
|
],
|
||||||
|
collectionType,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
title: "DAGGraph/Nodes/Collection",
|
||||||
|
component: Demo,
|
||||||
|
parameters: { actions: { argTypesRegex: "^on.*" } },
|
||||||
|
args: {
|
||||||
|
...DEFAULT_DIMS.condition,
|
||||||
|
totalChildNodes: 1,
|
||||||
|
enabledChild: true,
|
||||||
|
},
|
||||||
|
} as ComponentMeta<typeof Demo>;
|
||||||
|
|
||||||
|
export const Colors: ComponentStory<typeof Demo> = (args) => <Demo {...args} />;
|
||||||
|
|
||||||
|
export const Empty: ComponentStory<typeof Demo> = (args) => {
|
||||||
|
return (
|
||||||
|
<Page>
|
||||||
|
<DAGGraphBoard
|
||||||
|
closeModal={() => {}}
|
||||||
|
state={{
|
||||||
|
ready: true,
|
||||||
|
data: {
|
||||||
|
elements: {
|
||||||
|
edges: [],
|
||||||
|
nodes: [
|
||||||
|
CollectionNodeMaker.makeElement(
|
||||||
|
{
|
||||||
|
id: "only-one",
|
||||||
|
position: {
|
||||||
|
x: 50,
|
||||||
|
y: 50,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
DEFAULT_DIMS,
|
||||||
|
{
|
||||||
|
hasInput: false,
|
||||||
|
onAddNode: args.onAddNode,
|
||||||
|
width: args.width,
|
||||||
|
height: args.height,
|
||||||
|
nodes: [
|
||||||
|
...Array.from(Array(args.totalChildNodes)).map(
|
||||||
|
(_, i) => ({
|
||||||
|
enabled: true,
|
||||||
|
label: `Dummy Node #${i + 1}`,
|
||||||
|
})
|
||||||
|
),
|
||||||
|
],
|
||||||
|
collectionType: "condition",
|
||||||
|
}
|
||||||
|
),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Page>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
Empty.args = {
|
||||||
|
...Empty.args,
|
||||||
|
totalChildNodes: 0,
|
||||||
|
};
|
||||||
@@ -1,12 +1,18 @@
|
|||||||
import { NodeManager } from "components/DAGGraph/nodes/NodeManager";
|
import { NodeManager } from "components/DAGGraph/nodes/NodeManager";
|
||||||
import { CollectionNode } from "./CollectionNode";
|
import { CollectionNode } from "./CollectionNode";
|
||||||
import { CollectionNodeDataProps } from "./types";
|
import { CollectionNodeDataProps } from "./types";
|
||||||
|
import { SequenceNodeColor } from "../SequenceNode/types";
|
||||||
|
|
||||||
export const CollectionNodeMaker = NodeManager.register(
|
export const CollectionNodeMaker = NodeManager.register(
|
||||||
"CollectionNode",
|
"CollectionNode",
|
||||||
CollectionNode,
|
CollectionNode,
|
||||||
(pre: CollectionNodeDataProps, { node, flipped }) => ({
|
(pre: CollectionNodeDataProps, { node, flipped }) => ({
|
||||||
...pre,
|
...pre,
|
||||||
|
color: (pre.collectionType === "condition"
|
||||||
|
? "blue"
|
||||||
|
: pre.collectionType === "sequence"
|
||||||
|
? "green"
|
||||||
|
: "red") as SequenceNodeColor,
|
||||||
sequenceNode: node,
|
sequenceNode: node,
|
||||||
flipped,
|
flipped,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { Size } from "components/DAGGraph/elements/types";
|
import { Size } from "components/DAGGraph/elements/types";
|
||||||
import { ReactNode } from "react";
|
import { ReactNode } from "react";
|
||||||
import { SequenceNodeActions, SequenceNodeColor } from "../SequenceNode/types";
|
import { SequenceNodeActions, SequenceNodeColor } from "../SequenceNode/types";
|
||||||
|
import { AutomationActionData } from "types/automations";
|
||||||
|
|
||||||
export type CollectionNodeChildProps = Partial<SequenceNodeActions> & {
|
export type CollectionNodeChildProps = Partial<SequenceNodeActions> & {
|
||||||
enabled: boolean;
|
enabled: boolean;
|
||||||
@@ -9,11 +10,12 @@ export type CollectionNodeChildProps = Partial<SequenceNodeActions> & {
|
|||||||
export type CollectionNodeDataProps = Size & {
|
export type CollectionNodeDataProps = Size & {
|
||||||
nodes: CollectionNodeChildProps[];
|
nodes: CollectionNodeChildProps[];
|
||||||
onAddNode: () => void;
|
onAddNode: () => void;
|
||||||
color: SequenceNodeColor;
|
|
||||||
hasInput?: boolean;
|
hasInput?: boolean;
|
||||||
|
collectionType: keyof AutomationActionData;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type CollectionNodeProps = CollectionNodeDataProps & {
|
export type CollectionNodeProps = CollectionNodeDataProps & {
|
||||||
sequenceNode: Size;
|
sequenceNode: Size;
|
||||||
flipped: boolean;
|
flipped: boolean;
|
||||||
|
color: SequenceNodeColor;
|
||||||
};
|
};
|
||||||
Reference in new issue
Block a user