-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a6655b
commit a0bd943
Showing
13 changed files
with
386 additions
and
167 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { BaseEdge, getSmoothStepPath, type EdgeProps } from "@xyflow/react"; | ||
|
||
export default function CustomEdge(props: EdgeProps) { | ||
const [edgePath] = getSmoothStepPath({ ...props, borderRadius: 100 }); | ||
|
||
return ( | ||
<> | ||
<BaseEdge path={edgePath} /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import { Handle, Node, NodeProps, Position } from "@xyflow/react"; | ||
import { Endpoint } from "../../service/api/types"; | ||
import { DataList } from "@radix-ui/themes"; | ||
import EndpointNodeContentDialog from "./EndpointNodeContentDialog"; | ||
import MethodBadge from "../MethodBadge"; | ||
import GroupBadge from "../GroupBadge"; | ||
|
||
export default function EndpointNode( | ||
props: NodeProps< | ||
Node<{ | ||
busy: boolean; | ||
endpoint: Endpoint; | ||
onChangeGroup: (group: string) => void; | ||
groupColor?: string; | ||
}> | ||
>, | ||
) { | ||
return ( | ||
<> | ||
<div className="backdrop-blur-sm bg-[#FFFFFF1A] rounded-xl border border-border-dark overflow-hidden"> | ||
<Handle | ||
type="target" | ||
position={Position.Top} | ||
className="border border-gray-dark" | ||
/> | ||
<div | ||
className="h-[5px]" | ||
style={{ backgroundColor: props.data.groupColor }} | ||
/> | ||
<div className="bg-background-dark px-5 py-1 flex justify-between items-center"> | ||
<div>Action</div> | ||
<EndpointNodeContentDialog | ||
busy={props.data.busy} | ||
endpoint={props.data.endpoint} | ||
onChangeGroup={props.data.onChangeGroup} | ||
/> | ||
</div> | ||
<div className="px-5 py-3"> | ||
<DataList.Root> | ||
<DataList.Item> | ||
<DataList.Label className="text-white">Method</DataList.Label> | ||
<DataList.Value> | ||
<MethodBadge method={props.data.endpoint.method} /> | ||
</DataList.Value> | ||
</DataList.Item> | ||
<DataList.Item> | ||
<DataList.Label className="text-white">Path</DataList.Label> | ||
<DataList.Value> | ||
<div className="text-white">{props.data.endpoint.path}</div> | ||
</DataList.Value> | ||
</DataList.Item> | ||
{props.data.endpoint.group && ( | ||
<DataList.Item> | ||
<DataList.Label className="text-white">Group</DataList.Label> | ||
<DataList.Value> | ||
<GroupBadge name={props.data.endpoint.group} /> | ||
</DataList.Value> | ||
</DataList.Item> | ||
)} | ||
</DataList.Root> | ||
</div> | ||
</div> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Handle, Node, NodeProps, Position } from "@xyflow/react"; | ||
|
||
export default function GroupNode(props: NodeProps<Node<{ path: string }>>) { | ||
return ( | ||
<> | ||
<div className="backdrop-blur-sm bg-[#FFFFFF1A] rounded-xl border border-border-dark"> | ||
<Handle | ||
type="target" | ||
position={Position.Top} | ||
className="border border-gray-dark" | ||
/> | ||
<div className="text-center font-bold p-5">/{props.data.path}</div> | ||
<Handle | ||
type="source" | ||
position={Position.Bottom} | ||
className="border border-gray-dark" | ||
/> | ||
</div> | ||
</> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
import { Badge } from "@radix-ui/themes"; | ||
|
||
export default function GroupBadge(props: { name: string }) { | ||
return ( | ||
<Badge color="gray" variant="solid" radius="none" size="1"> | ||
<div className="px-2 py-1 bg-[#FFFFFF1A] rounded-lg text-text-dark border border-primary-dark"> | ||
{props.name} | ||
</Badge> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
/* DO NOT USE @tai/lwind base */ | ||
@tailwind base; | ||
@tailwind components; | ||
@tailwind utilities; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
import { Button } from "@radix-ui/themes"; | ||
|
||
export default function DefaultLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return ( | ||
<div className="flex flex-col min-h-screen"> | ||
<div className="px-5 bg-[#6C5CE7] flex items-center justify-between drop-shadow-lg"> | ||
<div className="flex flex-col min-h-screen bg-background-dark text-text-dark"> | ||
<div className="px-5 flex items-center gap-5"> | ||
<a | ||
className="flex items-center gap-1" | ||
className="flex items-center gap-1 text-gray-dark no-underline " | ||
href="https://nanoapi.io" | ||
target="_blank" | ||
> | ||
<img src="/logo.png" alt="logo" className="w-20 h-20" /> | ||
<span className="text-3xl text-white">NanoAPI</span> | ||
<span className="text-3xl">NanoAPI</span> | ||
</a> | ||
<a href="https://nanoapi.io/docs" target="_blank"> | ||
<Button color="plum">Documentation</Button> | ||
<a | ||
href="https://nanoapi.io/docs" | ||
target="_blank" | ||
className="text-gray-dark no-underline hover:underline" | ||
> | ||
Documentation | ||
</a> | ||
<a | ||
href="https://nanoapi.io/docs/faqs" | ||
target="_blank" | ||
className="text-gray-dark no-underline hover:underline" | ||
> | ||
Help | ||
</a> | ||
</div> | ||
<div className="flex-grow bg-[#F5F5F5] px-5 py-3">{children}</div> | ||
<div className="flex-grow px-5">{children}</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.