fix: styles of border and copy
This commit is contained in:
@@ -49,9 +49,9 @@ export function BaseNode({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"bg-card text-card-foreground relative rounded-md border",
|
"bg-card text-card-foreground relative rounded-md border transition-[border-color,box-shadow] duration-200",
|
||||||
"hover:ring-1",
|
"hover:ring-1",
|
||||||
selected && "border-primary shadow-[0_0_0_2px_hsl(var(--primary)_/_0.4)]",
|
selected && "border-primary/70 shadow-[0_0_0_2px_hsl(var(--primary)_/_0.22)]",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
data-selected={selected}
|
data-selected={selected}
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ import { Input } from '../ui/input'
|
|||||||
import { Button } from '../ui/button'
|
import { Button } from '../ui/button'
|
||||||
import { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group'
|
import { ToggleGroup, ToggleGroupItem } from '../ui/toggle-group'
|
||||||
import { useTheme } from '../../lib/themeContext'
|
import { useTheme } from '../../lib/themeContext'
|
||||||
|
import { toast } from 'sonner'
|
||||||
|
|
||||||
export type RenderingNodeData = {
|
export type RenderingNodeData = {
|
||||||
viewportWidth?: number
|
viewportWidth?: number
|
||||||
@@ -759,7 +760,9 @@ function RenderingNodeComponent({ id, data, width, height, selected }: Props) {
|
|||||||
className="absolute top-2 right-2 z-10 h-7 w-7 shrink-0 rounded-md shadow-sm"
|
className="absolute top-2 right-2 z-10 h-7 w-7 shrink-0 rounded-md shadow-sm"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const text = resolvedContent ?? ''
|
const text = resolvedContent ?? ''
|
||||||
if (text) navigator.clipboard?.writeText(text).catch(() => {})
|
if (text) {
|
||||||
|
navigator.clipboard?.writeText(text).then(() => toast.success('Copied to clipboard')).catch(() => {})
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
disabled={!resolvedContent}
|
disabled={!resolvedContent}
|
||||||
title="Copy raw output"
|
title="Copy raw output"
|
||||||
|
|||||||
@@ -32,12 +32,12 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.react-flow__node:focus-visible>div:first-child {
|
.react-flow__node:focus-visible>div:first-child {
|
||||||
border-color: hsl(var(--primary));
|
border-color: hsl(var(--primary) / 0.7);
|
||||||
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.4);
|
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.22);
|
||||||
}
|
}
|
||||||
|
|
||||||
.dark .react-flow__node:focus-visible>div:first-child {
|
.dark .react-flow__node:focus-visible>div:first-child {
|
||||||
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.5);
|
box-shadow: 0 0 0 2px hsl(var(--primary) / 0.28);
|
||||||
}
|
}
|
||||||
|
|
||||||
.react-flow__node .react-flow__handle {
|
.react-flow__node .react-flow__handle {
|
||||||
|
|||||||
Reference in New Issue
Block a user