Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,64 @@
}

/* end validation errors */

.dec-start-end-node {
Comment thread
kumaradityaraj marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to scope these styles under dec-root (you have done for dark mode)

position: relative;
display: flex;
justify-content: center;
align-items: center;
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated
}

.dec-start-node,
.dec-end-node {
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated
width: 72px;
height: 72px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
position: relative;
background: var(--color-background, white);
}
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated

.dec-start-node {
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated
border: 1px solid #aea6a6;
background-color: #f2f2f2;
}

.dec-end-node {
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated
border: 1px solid #aea6a6;
background-color: #e7e3e3;
}

.dec-end-node-inner {
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated
position: absolute;
inset: 6px;
border-radius: 50%;
border: 1px solid #aea6a6;
background-color: #e7e3e3;
pointer-events: none;
}

.dec-start-end-node.selected .dec-start-node {
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated
box-shadow: 0 0 0 4px rgba(209, 204, 204, 0.3);
}

.dec-start-end-node.selected .dec-end-node {
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated
box-shadow: 0 0 0 4px rgba(209, 204, 204, 0.3);
}

.dec-start-node:hover,
.dec-end-node:hover {
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated
box-shadow: 0 0 0 4px rgba(209, 204, 204, 0.3);
}
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated

.dec-root.dark .dec-start-node,
.dec-root.dark .dec-end-node,
.dec-root.dark .dec-end-node-inner {
@apply dec:border-slate-600
dec:bg-slate-800;
Comment thread
kumaradityaraj marked this conversation as resolved.
Outdated
}
}

/* custom edges */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,26 +182,18 @@ function TerminalNodeContent({ id, type }: { id: string; type: TerminalNodeType
);
}

// TODO: These props are just a placeholder
interface PlaceholderProps {
id: string;
data: BaseNodeData;
selected: boolean;
type: string;
}

// TODO: This content is just a placeholder
function PlaceholderContent({ id, data, selected, type }: PlaceholderProps) {
function StartEndNode({ id, data, selected, type }: NodeContentProps) {
Comment thread
kumaradityaraj marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesnt look like data prop is used? if not please remove

const isStart = type === GraphNodeType.Start;
return (
<div
className={`custom-node-container ${selected ? "selected" : ""}`}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also remove the css styles for the placeholder component

className={`dec-start-end-node ${selected ? "selected" : ""}`}
data-testid={`${type}-node-${id}`}
>
<RF.Handle type="target" position={RF.Position.Top} />
<div className="node-label-container" data-testid={`${type}-label-${id}`}>
{`${type}\n${data.label}`}
{!isStart && <RF.Handle type="target" position={RF.Position.Top} />}
<div className={isStart ? "dec-start-node" : "dec-end-node"}>
{!isStart && <div className="dec-end-node-inner" />}
</div>
<RF.Handle type="source" position={RF.Position.Bottom} />
{isStart && <RF.Handle type="source" position={RF.Position.Bottom} />}
Comment thread
kumaradityaraj marked this conversation as resolved.
</div>
Comment thread
kumaradityaraj marked this conversation as resolved.
Comment thread
kumaradityaraj marked this conversation as resolved.
);
}
Expand All @@ -210,14 +202,14 @@ function PlaceholderContent({ id, data, selected, type }: PlaceholderProps) {
export type StartNodeType = RF.Node<BaseNodeData, typeof GraphNodeType.Start>;
export function StartNode({ id, data, selected, type }: RF.NodeProps<StartNodeType>) {
// TODO: This component is just a placeholder
Comment thread
kumaradityaraj marked this conversation as resolved.
Comment thread
kumaradityaraj marked this conversation as resolved.
return <PlaceholderContent id={id} data={data} selected={selected} type={type} />;
return <StartEndNode id={id} data={data} selected={selected} type={type} />;
Comment on lines 204 to +205
}
Comment thread
kumaradityaraj marked this conversation as resolved.

/* end node */
export type EndNodeType = RF.Node<BaseNodeData, typeof GraphNodeType.End>;
export function EndNode({ id, data, selected, type }: RF.NodeProps<EndNodeType>) {
// TODO: This component is just a placeholder
Comment thread
kumaradityaraj marked this conversation as resolved.
Comment thread
kumaradityaraj marked this conversation as resolved.
return <PlaceholderContent id={id} data={data} selected={selected} type={type} />;
return <StartEndNode id={id} data={data} selected={selected} type={type} />;
Comment on lines 211 to +212
}

/* entry node */
Expand Down
5 changes: 4 additions & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading