my-you-eye 0.3.0 → 0.3.1
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/COMPONENTS.md +3 -3
- package/components.json +13 -4
- package/dist/index.d.ts +13 -1
- package/dist/index.js +184 -76
- package/package.json +1 -1
package/COMPONENTS.md
CHANGED
|
@@ -16,9 +16,9 @@ import "my-you-eye/styles.css";
|
|
|
16
16
|
| Component | Variants | Demos |
|
|
17
17
|
|---|---|---|
|
|
18
18
|
| `Canvas` | — | Empty grid |
|
|
19
|
-
| `ConnectionLine` | variant: bezier / stepped / straight<br>state: connected | Path variants, Edge states |
|
|
19
|
+
| `ConnectionLine` | variant: bezier / stepped / straight<br>state: connected / highlighted / pending | Path variants, Edge states, Decorations (arrowheads + labels) |
|
|
20
20
|
| `Graph` | type: button | Pipeline editor (drag nodes, connect ports, delete selected) |
|
|
21
|
-
| `GraphNode` | variant: muted / selected | Variants |
|
|
21
|
+
| `GraphNode` | variant: muted / selected / simple | Variants, Simple variant, Free-form body |
|
|
22
22
|
| `Port` | state: connected / default / highlighted | States |
|
|
23
23
|
|
|
24
24
|
## data
|
|
@@ -38,7 +38,7 @@ import "my-you-eye/styles.css";
|
|
|
38
38
|
| `Avatar` | size: lg / md / sm | Sizes, Fallback variants, With image, With ring, With status dot |
|
|
39
39
|
| `Badge` | variant: danger / neutral / primary / success / warning<br>style: soft | Variants (solid), Variants (soft) |
|
|
40
40
|
| `Card` | variant: danger / default / elevated / ghost / outlined<br>size: sm | Variants, With footer actions |
|
|
41
|
-
| `CodeBlock` | variant: elevated | Bare (no header, no language), Language-only (badge overlay, no header bar), With header + language, Elevated, Line numbers, No wrap (horizontal scroll), Syntax highlighting (TS), Syntax highlighting (CSS / HTML / SQL / YAML / Python) |
|
|
41
|
+
| `CodeBlock` | variant: elevated | Bare (no header, no language), Language-only (badge overlay, no header bar), With header + language, Elevated, Line numbers, No wrap (horizontal scroll), Syntax highlighting (TS), Line highlights, Line highlights (implicit gutter), Multi-color highlights, Syntax highlighting (CSS / HTML / SQL / YAML / Python) |
|
|
42
42
|
| `EmptyState` | variant: secondary | Default, With icon and action |
|
|
43
43
|
| `Image` | — | Fit modes, Border radius, Aspect ratio, Styles, With caption |
|
|
44
44
|
| `Kbd` | — | Default, Combinations |
|
package/components.json
CHANGED
|
@@ -23,12 +23,15 @@
|
|
|
23
23
|
"straight"
|
|
24
24
|
],
|
|
25
25
|
"state": [
|
|
26
|
-
"connected"
|
|
26
|
+
"connected",
|
|
27
|
+
"highlighted",
|
|
28
|
+
"pending"
|
|
27
29
|
]
|
|
28
30
|
},
|
|
29
31
|
"demos": [
|
|
30
32
|
"Path variants",
|
|
31
|
-
"Edge states"
|
|
33
|
+
"Edge states",
|
|
34
|
+
"Decorations (arrowheads + labels)"
|
|
32
35
|
]
|
|
33
36
|
},
|
|
34
37
|
{
|
|
@@ -51,11 +54,14 @@
|
|
|
51
54
|
"props": {
|
|
52
55
|
"variant": [
|
|
53
56
|
"muted",
|
|
54
|
-
"selected"
|
|
57
|
+
"selected",
|
|
58
|
+
"simple"
|
|
55
59
|
]
|
|
56
60
|
},
|
|
57
61
|
"demos": [
|
|
58
|
-
"Variants"
|
|
62
|
+
"Variants",
|
|
63
|
+
"Simple variant",
|
|
64
|
+
"Free-form body"
|
|
59
65
|
]
|
|
60
66
|
},
|
|
61
67
|
{
|
|
@@ -248,6 +254,9 @@
|
|
|
248
254
|
"Line numbers",
|
|
249
255
|
"No wrap (horizontal scroll)",
|
|
250
256
|
"Syntax highlighting (TS)",
|
|
257
|
+
"Line highlights",
|
|
258
|
+
"Line highlights (implicit gutter)",
|
|
259
|
+
"Multi-color highlights",
|
|
251
260
|
"Syntax highlighting (CSS / HTML / SQL / YAML / Python)"
|
|
252
261
|
]
|
|
253
262
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -404,7 +404,7 @@ interface CanvasProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
404
404
|
declare const Canvas: react.ForwardRefExoticComponent<CanvasProps & react.RefAttributes<HTMLDivElement>>;
|
|
405
405
|
|
|
406
406
|
declare const graphNodeVariants: (props?: ({
|
|
407
|
-
variant?: "default" | "selected" | "muted" | null | undefined;
|
|
407
|
+
variant?: "default" | "selected" | "muted" | "simple" | null | undefined;
|
|
408
408
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
409
409
|
interface PortDef {
|
|
410
410
|
side: "left" | "right";
|
|
@@ -472,6 +472,10 @@ declare function TreeView({ data, variant, indent, defaultExpandedDepth, expande
|
|
|
472
472
|
declare const codeBlockVariants: (props?: ({
|
|
473
473
|
variant?: "default" | "elevated" | null | undefined;
|
|
474
474
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
475
|
+
interface CodeBlockHighlightGroup {
|
|
476
|
+
lines: number[];
|
|
477
|
+
color?: "primary" | "warning" | "success" | "danger";
|
|
478
|
+
}
|
|
475
479
|
interface CodeBlockProps extends HTMLAttributes<HTMLPreElement>, VariantProps<typeof codeBlockVariants> {
|
|
476
480
|
code: string;
|
|
477
481
|
language?: string;
|
|
@@ -480,6 +484,12 @@ interface CodeBlockProps extends HTMLAttributes<HTMLPreElement>, VariantProps<ty
|
|
|
480
484
|
showLineNumbers?: boolean;
|
|
481
485
|
/** Enable syntax highlighting for supported languages (js, ts, tsx, json, bash). */
|
|
482
486
|
highlight?: boolean;
|
|
487
|
+
/** 1-indexed line numbers to highlight. Implicitly enables line numbers. */
|
|
488
|
+
highlightLines?: number[];
|
|
489
|
+
/** Color for highlightLines (default "primary"). */
|
|
490
|
+
highlightColor?: CodeBlockHighlightGroup["color"];
|
|
491
|
+
/** Multi-color highlight groups. When provided, takes precedence over highlightLines. */
|
|
492
|
+
highlightGroups?: CodeBlockHighlightGroup[];
|
|
483
493
|
}
|
|
484
494
|
declare const CodeBlock: react.ForwardRefExoticComponent<CodeBlockProps & react.RefAttributes<HTMLPreElement>>;
|
|
485
495
|
|
|
@@ -624,6 +634,8 @@ interface ConnectionLineProps extends VariantProps<typeof lineVariants> {
|
|
|
624
634
|
x: number;
|
|
625
635
|
y: number;
|
|
626
636
|
};
|
|
637
|
+
arrowhead?: boolean;
|
|
638
|
+
label?: string;
|
|
627
639
|
className?: string;
|
|
628
640
|
}
|
|
629
641
|
declare const ConnectionLine: react.ForwardRefExoticComponent<ConnectionLineProps & react.RefAttributes<SVGSVGElement>>;
|
package/dist/index.js
CHANGED
|
@@ -2355,7 +2355,32 @@ function tokenize(code, language) {
|
|
|
2355
2355
|
if (!lang || !TOKENIZERS[lang]) return null;
|
|
2356
2356
|
return TOKENIZERS[lang](code);
|
|
2357
2357
|
}
|
|
2358
|
-
function
|
|
2358
|
+
function splitTokensByLine(tokens) {
|
|
2359
|
+
const result = [];
|
|
2360
|
+
let current = [];
|
|
2361
|
+
for (const t of tokens) {
|
|
2362
|
+
if (t.text === "\n") {
|
|
2363
|
+
result.push(current);
|
|
2364
|
+
current = [];
|
|
2365
|
+
continue;
|
|
2366
|
+
}
|
|
2367
|
+
if (t.text.includes("\n")) {
|
|
2368
|
+
const parts = t.text.split("\n");
|
|
2369
|
+
for (let i = 0; i < parts.length; i++) {
|
|
2370
|
+
if (i > 0) {
|
|
2371
|
+
result.push(current);
|
|
2372
|
+
current = [];
|
|
2373
|
+
}
|
|
2374
|
+
if (parts[i]) current.push({ text: parts[i], className: t.className });
|
|
2375
|
+
}
|
|
2376
|
+
} else {
|
|
2377
|
+
current.push(t);
|
|
2378
|
+
}
|
|
2379
|
+
}
|
|
2380
|
+
if (current.length > 0) result.push(current);
|
|
2381
|
+
return result;
|
|
2382
|
+
}
|
|
2383
|
+
function renderHighlightedLine(tokens) {
|
|
2359
2384
|
return /* @__PURE__ */ jsx45(Fragment, { children: tokens.map((t, i) => /* @__PURE__ */ jsx45("span", { className: t.className === "whitespace" ? void 0 : `hl-${t.className}`, children: t.text }, i)) });
|
|
2360
2385
|
}
|
|
2361
2386
|
|
|
@@ -2406,7 +2431,7 @@ function CopyButton({ copied, onCopy }) {
|
|
|
2406
2431
|
);
|
|
2407
2432
|
}
|
|
2408
2433
|
var CodeBlock = forwardRef42(
|
|
2409
|
-
({ className, variant, code, language, header, wrap = true, showLineNumbers = false, highlight = false, ...props }, ref) => {
|
|
2434
|
+
({ className, variant, code, language, header, wrap = true, showLineNumbers = false, highlight = false, highlightLines, highlightColor = "primary", highlightGroups, ...props }, ref) => {
|
|
2410
2435
|
const [copied, setCopied] = useState2(false);
|
|
2411
2436
|
const copy = useCallback3(() => {
|
|
2412
2437
|
navigator.clipboard.writeText(code).then(() => {
|
|
@@ -2416,14 +2441,34 @@ var CodeBlock = forwardRef42(
|
|
|
2416
2441
|
}, [code]);
|
|
2417
2442
|
const lines = useMemo(() => code.split("\n"), [code]);
|
|
2418
2443
|
const hasHeader = Boolean(header || language);
|
|
2444
|
+
const showGutter = showLineNumbers || highlightLines != null && highlightLines.length > 0 || highlightGroups != null && highlightGroups.length > 0;
|
|
2419
2445
|
const highlighted = useMemo(() => {
|
|
2420
2446
|
if (!highlight) return null;
|
|
2421
2447
|
return tokenize(code, language);
|
|
2422
2448
|
}, [code, language, highlight]);
|
|
2423
|
-
const
|
|
2424
|
-
|
|
2425
|
-
|
|
2449
|
+
const HIGHLIGHT_BG = {
|
|
2450
|
+
primary: "bg-primary/10",
|
|
2451
|
+
warning: "bg-warning/15",
|
|
2452
|
+
success: "bg-success/10",
|
|
2453
|
+
danger: "bg-danger/10"
|
|
2426
2454
|
};
|
|
2455
|
+
const lineColor = useMemo(() => {
|
|
2456
|
+
const map = /* @__PURE__ */ new Map();
|
|
2457
|
+
if (highlightGroups) {
|
|
2458
|
+
for (const g of highlightGroups) {
|
|
2459
|
+
const cls = HIGHLIGHT_BG[g.color ?? "primary"] ?? HIGHLIGHT_BG.primary;
|
|
2460
|
+
for (const ln of g.lines) map.set(ln, cls);
|
|
2461
|
+
}
|
|
2462
|
+
} else if (highlightLines) {
|
|
2463
|
+
const cls = HIGHLIGHT_BG[highlightColor ?? "primary"] ?? HIGHLIGHT_BG.primary;
|
|
2464
|
+
for (const ln of highlightLines) map.set(ln, cls);
|
|
2465
|
+
}
|
|
2466
|
+
return map;
|
|
2467
|
+
}, [highlightLines, highlightColor, highlightGroups]);
|
|
2468
|
+
const perLineTokens = useMemo(() => {
|
|
2469
|
+
if (!highlighted) return null;
|
|
2470
|
+
return splitTokensByLine(highlighted);
|
|
2471
|
+
}, [highlighted]);
|
|
2427
2472
|
return /* @__PURE__ */ jsxs19("div", { className: cn(codeBlockVariants({ variant }), className), children: [
|
|
2428
2473
|
hasHeader && /* @__PURE__ */ jsxs19("div", { className: "flex items-center justify-between gap-2 h-9 pl-panel pr-1.5 border-b border-border", children: [
|
|
2429
2474
|
/* @__PURE__ */ jsxs19("div", { className: "flex items-center gap-2 min-w-0", children: [
|
|
@@ -2437,25 +2482,36 @@ var CodeBlock = forwardRef42(
|
|
|
2437
2482
|
language && /* @__PURE__ */ jsx46("span", { className: "rounded-ui-sm bg-code-bg/80 px-1.5 py-0.5 font-mono text-xs uppercase tracking-wide text-code-muted border border-border/50 pointer-events-none", children: language }),
|
|
2438
2483
|
/* @__PURE__ */ jsx46(CopyButton, { copied, onCopy: copy })
|
|
2439
2484
|
] }) }),
|
|
2440
|
-
/* @__PURE__ */ jsxs19("div", { className: "flex flex-1 min-h-0", children: [
|
|
2441
|
-
|
|
2485
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex flex-1 min-h-0 overflow-x-auto", children: [
|
|
2486
|
+
showGutter && /* @__PURE__ */ jsx46(
|
|
2442
2487
|
"div",
|
|
2443
2488
|
{
|
|
2444
2489
|
"aria-hidden": true,
|
|
2445
|
-
className: "select-none shrink-0 py-panel
|
|
2446
|
-
children: lines.map((_, i) => /* @__PURE__ */ jsx46("div", { children: i + 1 }, i))
|
|
2490
|
+
className: "select-none shrink-0 py-panel text-right font-mono text-xs leading-relaxed text-code-muted border-r border-border",
|
|
2491
|
+
children: lines.map((_, i) => /* @__PURE__ */ jsx46("div", { className: cn("pl-compact-x pr-compact-x", lineColor.get(i + 1)), children: i + 1 }, i))
|
|
2447
2492
|
}
|
|
2448
2493
|
),
|
|
2449
|
-
/* @__PURE__ */ jsx46(
|
|
2494
|
+
perLineTokens ? /* @__PURE__ */ jsx46(
|
|
2450
2495
|
"pre",
|
|
2451
2496
|
{
|
|
2452
2497
|
ref,
|
|
2453
2498
|
className: cn(
|
|
2454
|
-
"flex-1 min-w-0
|
|
2499
|
+
"flex-1 min-w-0 py-panel font-mono text-xs leading-relaxed text-code-fg",
|
|
2455
2500
|
wrap && "whitespace-pre-wrap break-words"
|
|
2456
2501
|
),
|
|
2457
2502
|
...props,
|
|
2458
|
-
children: /* @__PURE__ */ jsx46("code", { children:
|
|
2503
|
+
children: /* @__PURE__ */ jsx46("code", { children: perLineTokens.map((lineTokens, i) => /* @__PURE__ */ jsx46("div", { className: cn("px-panel", lineColor.get(i + 1)), children: lineTokens.length > 0 ? renderHighlightedLine(lineTokens) : " " }, i)) })
|
|
2504
|
+
}
|
|
2505
|
+
) : /* @__PURE__ */ jsx46(
|
|
2506
|
+
"pre",
|
|
2507
|
+
{
|
|
2508
|
+
ref,
|
|
2509
|
+
className: cn(
|
|
2510
|
+
"flex-1 min-w-0 py-panel font-mono text-xs leading-relaxed text-code-fg",
|
|
2511
|
+
wrap && "whitespace-pre-wrap break-words"
|
|
2512
|
+
),
|
|
2513
|
+
...props,
|
|
2514
|
+
children: /* @__PURE__ */ jsx46("code", { children: lines.map((line, i) => /* @__PURE__ */ jsx46("div", { className: cn("px-panel", lineColor.get(i + 1)), children: line || " " }, i)) })
|
|
2459
2515
|
}
|
|
2460
2516
|
)
|
|
2461
2517
|
] })
|
|
@@ -3320,7 +3376,7 @@ import { cva as cva28 } from "class-variance-authority";
|
|
|
3320
3376
|
// src/ui/connection-line/ConnectionLine.tsx
|
|
3321
3377
|
import { forwardRef as forwardRef46, useMemo as useMemo3 } from "react";
|
|
3322
3378
|
import { cva as cva27 } from "class-variance-authority";
|
|
3323
|
-
import { jsx as jsx53 } from "react/jsx-runtime";
|
|
3379
|
+
import { jsx as jsx53, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
3324
3380
|
var lineVariants = cva27("fill-none", {
|
|
3325
3381
|
variants: {
|
|
3326
3382
|
variant: {
|
|
@@ -3355,10 +3411,31 @@ function generatePath(from, to, variant) {
|
|
|
3355
3411
|
}
|
|
3356
3412
|
}
|
|
3357
3413
|
}
|
|
3414
|
+
function getArrowAngle(from, to, variant) {
|
|
3415
|
+
switch (variant) {
|
|
3416
|
+
case "stepped": {
|
|
3417
|
+
const midX = (from.x + to.x) / 2;
|
|
3418
|
+
return to.x >= midX ? 0 : 180;
|
|
3419
|
+
}
|
|
3420
|
+
case "straight":
|
|
3421
|
+
return Math.atan2(to.y - from.y, to.x - from.x) * (180 / Math.PI);
|
|
3422
|
+
default:
|
|
3423
|
+
return 0;
|
|
3424
|
+
}
|
|
3425
|
+
}
|
|
3426
|
+
var ARROWHEAD_COLOR = {
|
|
3427
|
+
connected: "text-primary",
|
|
3428
|
+
highlighted: "text-primary",
|
|
3429
|
+
default: "text-muted",
|
|
3430
|
+
pending: "text-muted"
|
|
3431
|
+
};
|
|
3358
3432
|
var ConnectionLine = forwardRef46(
|
|
3359
|
-
function ConnectionLine2({ className, variant = "bezier", state = "connected", from, to }, ref) {
|
|
3433
|
+
function ConnectionLine2({ className, variant = "bezier", state = "connected", from, to, arrowhead, label }, ref) {
|
|
3360
3434
|
const d = useMemo3(() => generatePath(from, to, variant ?? "bezier"), [from, to, variant]);
|
|
3361
|
-
|
|
3435
|
+
const arrowAngle = useMemo3(() => getArrowAngle(from, to, variant ?? "bezier"), [from, to, variant]);
|
|
3436
|
+
const midX = (from.x + to.x) / 2;
|
|
3437
|
+
const midY = (from.y + to.y) / 2;
|
|
3438
|
+
return /* @__PURE__ */ jsxs24(
|
|
3362
3439
|
"svg",
|
|
3363
3440
|
{
|
|
3364
3441
|
ref,
|
|
@@ -3367,7 +3444,36 @@ var ConnectionLine = forwardRef46(
|
|
|
3367
3444
|
"absolute inset-0 w-full h-full pointer-events-none overflow-visible",
|
|
3368
3445
|
className
|
|
3369
3446
|
),
|
|
3370
|
-
children:
|
|
3447
|
+
children: [
|
|
3448
|
+
/* @__PURE__ */ jsx53("path", { d }),
|
|
3449
|
+
arrowhead && /* @__PURE__ */ jsx53(
|
|
3450
|
+
"polygon",
|
|
3451
|
+
{
|
|
3452
|
+
points: "0,-4 8,0 0,4",
|
|
3453
|
+
fill: "currentColor",
|
|
3454
|
+
className: ARROWHEAD_COLOR[state ?? "connected"],
|
|
3455
|
+
transform: `translate(${to.x},${to.y}) rotate(${arrowAngle})`
|
|
3456
|
+
}
|
|
3457
|
+
),
|
|
3458
|
+
label && /* @__PURE__ */ jsx53(
|
|
3459
|
+
"foreignObject",
|
|
3460
|
+
{
|
|
3461
|
+
x: midX - label.length * 3.5 - 6,
|
|
3462
|
+
y: midY - 10,
|
|
3463
|
+
width: label.length * 7 + 12,
|
|
3464
|
+
height: 20,
|
|
3465
|
+
className: "overflow-visible pointer-events-none",
|
|
3466
|
+
children: /* @__PURE__ */ jsx53(
|
|
3467
|
+
"span",
|
|
3468
|
+
{
|
|
3469
|
+
className: "inline-flex items-center rounded-sm px-1.5 py-0.5 text-xs text-fg font-mono bg-canvas-surface border border-border/60 shadow-sm whitespace-nowrap leading-none",
|
|
3470
|
+
style: { backdropFilter: "blur(2px)" },
|
|
3471
|
+
children: label
|
|
3472
|
+
}
|
|
3473
|
+
)
|
|
3474
|
+
}
|
|
3475
|
+
)
|
|
3476
|
+
]
|
|
3371
3477
|
}
|
|
3372
3478
|
);
|
|
3373
3479
|
}
|
|
@@ -3375,7 +3481,7 @@ var ConnectionLine = forwardRef46(
|
|
|
3375
3481
|
ConnectionLine.displayName = "ConnectionLine";
|
|
3376
3482
|
|
|
3377
3483
|
// src/ui/canvas/Edge.tsx
|
|
3378
|
-
import { jsx as jsx54, jsxs as
|
|
3484
|
+
import { jsx as jsx54, jsxs as jsxs25 } from "react/jsx-runtime";
|
|
3379
3485
|
var edgeVariants = cva28("fill-none", {
|
|
3380
3486
|
variants: {
|
|
3381
3487
|
state: {
|
|
@@ -3392,7 +3498,7 @@ var edgeVariants = cva28("fill-none", {
|
|
|
3392
3498
|
var HIT_STROKE = 12;
|
|
3393
3499
|
function Edge({ from, to, state, className, hitStrokeWidth = HIT_STROKE, onClick, onContextMenu, ...props }) {
|
|
3394
3500
|
const d = useMemo4(() => generatePath(from, to, "bezier"), [from, to]);
|
|
3395
|
-
return /* @__PURE__ */
|
|
3501
|
+
return /* @__PURE__ */ jsxs25("g", { onMouseDown: (e) => e.stopPropagation(), children: [
|
|
3396
3502
|
onClick || onContextMenu ? /* @__PURE__ */ jsx54(
|
|
3397
3503
|
"path",
|
|
3398
3504
|
{
|
|
@@ -3416,7 +3522,7 @@ import { cva as cva30 } from "class-variance-authority";
|
|
|
3416
3522
|
// src/ui/port/Port.tsx
|
|
3417
3523
|
import { forwardRef as forwardRef47 } from "react";
|
|
3418
3524
|
import { cva as cva29 } from "class-variance-authority";
|
|
3419
|
-
import { jsx as jsx55, jsxs as
|
|
3525
|
+
import { jsx as jsx55, jsxs as jsxs26 } from "react/jsx-runtime";
|
|
3420
3526
|
var portVariants = cva29(
|
|
3421
3527
|
"size-3 rounded-full border-2 bg-bg transition-colors",
|
|
3422
3528
|
{
|
|
@@ -3438,7 +3544,7 @@ var portVariants = cva29(
|
|
|
3438
3544
|
}
|
|
3439
3545
|
);
|
|
3440
3546
|
var Port = forwardRef47(
|
|
3441
|
-
({ className, side, state, label, ...props }, ref) => /* @__PURE__ */
|
|
3547
|
+
({ className, side, state, label, ...props }, ref) => /* @__PURE__ */ jsxs26("div", { ref, className: cn("relative flex items-center gap-2", side === "in" ? "flex-row" : "flex-row-reverse"), children: [
|
|
3442
3548
|
/* @__PURE__ */ jsx55("div", { className: cn(portVariants({ side, state }), className), ...props }),
|
|
3443
3549
|
label && /* @__PURE__ */ jsx55("span", { className: "text-xs text-muted", children: label })
|
|
3444
3550
|
] })
|
|
@@ -3446,7 +3552,7 @@ var Port = forwardRef47(
|
|
|
3446
3552
|
Port.displayName = "Port";
|
|
3447
3553
|
|
|
3448
3554
|
// src/ui/graph-node/GraphNode.tsx
|
|
3449
|
-
import { jsx as jsx56, jsxs as
|
|
3555
|
+
import { jsx as jsx56, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3450
3556
|
var ROW_PORT_Y_OFFSET = HEADER * GRID;
|
|
3451
3557
|
var graphNodeVariants = cva30(
|
|
3452
3558
|
// `bg-canvas-surface` (never `bg-surface`): nodes render an opaque,
|
|
@@ -3460,7 +3566,8 @@ var graphNodeVariants = cva30(
|
|
|
3460
3566
|
variant: {
|
|
3461
3567
|
default: "border-border",
|
|
3462
3568
|
selected: "border-primary ring-2 ring-primary/20",
|
|
3463
|
-
muted: "border-border opacity-dim"
|
|
3569
|
+
muted: "border-border opacity-dim",
|
|
3570
|
+
simple: "border-border"
|
|
3464
3571
|
}
|
|
3465
3572
|
},
|
|
3466
3573
|
defaultVariants: {
|
|
@@ -3470,9 +3577,10 @@ var graphNodeVariants = cva30(
|
|
|
3470
3577
|
);
|
|
3471
3578
|
var GraphNode = forwardRef48(
|
|
3472
3579
|
({ className, variant, x, y, header, accent, ports, footer, rows, children, style, ...props }, ref) => {
|
|
3580
|
+
const isSimple = variant === "simple";
|
|
3473
3581
|
const hasRows = rows && rows.length > 0;
|
|
3474
|
-
const height = hasRows ? nodeHeightPx(rows.length, !!footer) : void 0;
|
|
3475
|
-
return /* @__PURE__ */
|
|
3582
|
+
const height = hasRows ? nodeHeightPx(rows.length, !!footer && !isSimple) : void 0;
|
|
3583
|
+
return /* @__PURE__ */ jsxs27(
|
|
3476
3584
|
"div",
|
|
3477
3585
|
{
|
|
3478
3586
|
ref,
|
|
@@ -3480,16 +3588,16 @@ var GraphNode = forwardRef48(
|
|
|
3480
3588
|
style: { left: x, top: y, height, ...style },
|
|
3481
3589
|
...props,
|
|
3482
3590
|
children: [
|
|
3483
|
-
header && /* @__PURE__ */ jsx56("div", { className: cn("flex flex-col shrink-0", accent && "border-t-2 border-primary"), style: { height: HEADER * GRID }, children: /* @__PURE__ */ jsx56("div", { className: "flex items-center px-3 border-b border-border flex-1 min-h-0", children: /* @__PURE__ */
|
|
3484
|
-
/* @__PURE__ */
|
|
3591
|
+
header && /* @__PURE__ */ jsx56("div", { className: cn("flex flex-col shrink-0", accent && !isSimple && "border-t-2 border-primary"), style: { height: HEADER * GRID }, children: /* @__PURE__ */ jsx56("div", { className: "flex items-center px-3 border-b border-border flex-1 min-h-0", children: /* @__PURE__ */ jsxs27("div", { className: cn("flex items-center gap-inline flex-1 min-w-0", isSimple && "justify-center"), children: [
|
|
3592
|
+
!isSimple && /* @__PURE__ */ jsxs27("div", { className: "flex gap-0.5", children: [
|
|
3485
3593
|
/* @__PURE__ */ jsx56("span", { className: "size-1.5 rounded-full bg-danger" }),
|
|
3486
3594
|
/* @__PURE__ */ jsx56("span", { className: "size-1.5 rounded-full bg-warning" }),
|
|
3487
3595
|
/* @__PURE__ */ jsx56("span", { className: "size-1.5 rounded-full bg-success" })
|
|
3488
3596
|
] }),
|
|
3489
3597
|
/* @__PURE__ */ jsx56("span", { className: "text-xs font-semibold truncate", children: header })
|
|
3490
3598
|
] }) }) }),
|
|
3491
|
-
hasRows ? /* @__PURE__ */
|
|
3492
|
-
rows.map((row, i) => /* @__PURE__ */
|
|
3599
|
+
hasRows ? /* @__PURE__ */ jsxs27("div", { className: "flex-1 overflow-hidden relative", children: [
|
|
3600
|
+
rows.map((row, i) => /* @__PURE__ */ jsxs27(
|
|
3493
3601
|
"div",
|
|
3494
3602
|
{
|
|
3495
3603
|
className: "grid grid-cols-[minmax(0,1fr)_auto] gap-x-3 px-3 text-xs items-center border-b border-border/50 last:border-b-0 hover:bg-muted/10 transition-colors",
|
|
@@ -3501,7 +3609,7 @@ var GraphNode = forwardRef48(
|
|
|
3501
3609
|
},
|
|
3502
3610
|
i
|
|
3503
3611
|
)),
|
|
3504
|
-
/* @__PURE__ */ jsx56("div", { className: "absolute inset-0 pointer-events-none", children: rows.map((row, i) => /* @__PURE__ */
|
|
3612
|
+
!isSimple && /* @__PURE__ */ jsx56("div", { className: "absolute inset-0 pointer-events-none", children: rows.map((row, i) => /* @__PURE__ */ jsxs27("div", { children: [
|
|
3505
3613
|
row.portLeft && /* @__PURE__ */ jsx56(
|
|
3506
3614
|
"div",
|
|
3507
3615
|
{
|
|
@@ -3520,14 +3628,14 @@ var GraphNode = forwardRef48(
|
|
|
3520
3628
|
)
|
|
3521
3629
|
] }, `ports-${i}`)) })
|
|
3522
3630
|
] }) : children && /* @__PURE__ */ jsx56("div", { className: "px-3 py-2 text-xs flex-1", children }),
|
|
3523
|
-
ports && ports.length > 0 && !hasRows && /* @__PURE__ */ jsx56("div", { className: "absolute inset-0 pointer-events-none", children: ports.map((p, i) => {
|
|
3631
|
+
ports && ports.length > 0 && !hasRows && !isSimple && /* @__PURE__ */ jsx56("div", { className: "absolute inset-0 pointer-events-none", children: ports.map((p, i) => {
|
|
3524
3632
|
const leftPorts = ports.filter((x2) => x2.side === "left");
|
|
3525
3633
|
const rightPorts = ports.filter((x2) => x2.side === "right");
|
|
3526
3634
|
const isLeft = p.side === "left";
|
|
3527
3635
|
const idx = isLeft ? leftPorts.indexOf(p) : rightPorts.indexOf(p);
|
|
3528
3636
|
const total = isLeft ? leftPorts.length : rightPorts.length;
|
|
3529
3637
|
const yPos = (HEADER * GRID + GRID) / (total + 1) * (idx + 1);
|
|
3530
|
-
return /* @__PURE__ */
|
|
3638
|
+
return /* @__PURE__ */ jsxs27(
|
|
3531
3639
|
"div",
|
|
3532
3640
|
{
|
|
3533
3641
|
className: cn(
|
|
@@ -3543,7 +3651,7 @@ var GraphNode = forwardRef48(
|
|
|
3543
3651
|
i
|
|
3544
3652
|
);
|
|
3545
3653
|
}) }),
|
|
3546
|
-
footer && /* @__PURE__ */ jsx56(
|
|
3654
|
+
footer && !isSimple && /* @__PURE__ */ jsx56(
|
|
3547
3655
|
"div",
|
|
3548
3656
|
{
|
|
3549
3657
|
className: "px-3 border-t border-border text-xs text-muted flex items-center gap-1.5 shrink-0 bg-muted/5",
|
|
@@ -3568,7 +3676,7 @@ Typography.displayName = "Typography";
|
|
|
3568
3676
|
|
|
3569
3677
|
// src/ui/combobox/Combobox.tsx
|
|
3570
3678
|
import { forwardRef as forwardRef50, useState as useState7, useMemo as useMemo5, useRef as useRef6 } from "react";
|
|
3571
|
-
import { jsx as jsx58, jsxs as
|
|
3679
|
+
import { jsx as jsx58, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
3572
3680
|
var Combobox = forwardRef50(
|
|
3573
3681
|
function Combobox2({ options, value, onChange, placeholder = "Search...", emptyText = "No results found", className, disabled }, ref) {
|
|
3574
3682
|
const [open, setOpen] = useState7(false);
|
|
@@ -3579,11 +3687,11 @@ var Combobox = forwardRef50(
|
|
|
3579
3687
|
[options, query]
|
|
3580
3688
|
);
|
|
3581
3689
|
const selectedLabel = options.find((o) => o.value === value)?.label ?? "";
|
|
3582
|
-
return /* @__PURE__ */
|
|
3690
|
+
return /* @__PURE__ */ jsxs28(Root9, { open, onOpenChange: (v) => {
|
|
3583
3691
|
setOpen(v);
|
|
3584
3692
|
if (!v) setQuery("");
|
|
3585
3693
|
}, children: [
|
|
3586
|
-
/* @__PURE__ */ jsx58(Trigger5, { asChild: true, children: /* @__PURE__ */
|
|
3694
|
+
/* @__PURE__ */ jsx58(Trigger5, { asChild: true, children: /* @__PURE__ */ jsxs28(
|
|
3587
3695
|
"button",
|
|
3588
3696
|
{
|
|
3589
3697
|
ref,
|
|
@@ -3607,7 +3715,7 @@ var Combobox = forwardRef50(
|
|
|
3607
3715
|
]
|
|
3608
3716
|
}
|
|
3609
3717
|
) }),
|
|
3610
|
-
/* @__PURE__ */
|
|
3718
|
+
/* @__PURE__ */ jsxs28(
|
|
3611
3719
|
PopoverContent,
|
|
3612
3720
|
{
|
|
3613
3721
|
side: "bottom",
|
|
@@ -3652,7 +3760,7 @@ Combobox.displayName = "Combobox";
|
|
|
3652
3760
|
|
|
3653
3761
|
// src/ui/multi-select/MultiSelect.tsx
|
|
3654
3762
|
import { forwardRef as forwardRef51, useState as useState8, useMemo as useMemo6, useRef as useRef7 } from "react";
|
|
3655
|
-
import { Fragment as Fragment5, jsx as jsx59, jsxs as
|
|
3763
|
+
import { Fragment as Fragment5, jsx as jsx59, jsxs as jsxs29 } from "react/jsx-runtime";
|
|
3656
3764
|
var MultiSelect = forwardRef51(
|
|
3657
3765
|
function MultiSelect2({ options, value = [], onChange, placeholder = "Select...", emptyText = "No results found", className, disabled }, ref) {
|
|
3658
3766
|
const [open, setOpen] = useState8(false);
|
|
@@ -3667,7 +3775,7 @@ var MultiSelect = forwardRef51(
|
|
|
3667
3775
|
onChange?.(next);
|
|
3668
3776
|
};
|
|
3669
3777
|
const selectedLabels = options.filter((o) => value.includes(o.value));
|
|
3670
|
-
return /* @__PURE__ */
|
|
3778
|
+
return /* @__PURE__ */ jsxs29(Root9, { open, onOpenChange: (v) => {
|
|
3671
3779
|
setOpen(v);
|
|
3672
3780
|
if (!v) setQuery("");
|
|
3673
3781
|
}, children: [
|
|
@@ -3684,16 +3792,16 @@ var MultiSelect = forwardRef51(
|
|
|
3684
3792
|
selectedLabels.length === 0 && "text-muted",
|
|
3685
3793
|
className
|
|
3686
3794
|
),
|
|
3687
|
-
children: selectedLabels.length === 0 ? placeholder : selectedLabels.length <= 3 ? selectedLabels.map((opt) => /* @__PURE__ */ jsx59(Badge, { variant: "neutral", style: "soft", children: opt.label }, opt.value)) : /* @__PURE__ */
|
|
3795
|
+
children: selectedLabels.length === 0 ? placeholder : selectedLabels.length <= 3 ? selectedLabels.map((opt) => /* @__PURE__ */ jsx59(Badge, { variant: "neutral", style: "soft", children: opt.label }, opt.value)) : /* @__PURE__ */ jsxs29(Fragment5, { children: [
|
|
3688
3796
|
selectedLabels.slice(0, 2).map((opt) => /* @__PURE__ */ jsx59(Badge, { variant: "neutral", style: "soft", children: opt.label }, opt.value)),
|
|
3689
|
-
/* @__PURE__ */
|
|
3797
|
+
/* @__PURE__ */ jsxs29(Badge, { variant: "neutral", style: "soft", children: [
|
|
3690
3798
|
"+",
|
|
3691
3799
|
selectedLabels.length - 2
|
|
3692
3800
|
] })
|
|
3693
3801
|
] })
|
|
3694
3802
|
}
|
|
3695
3803
|
) }),
|
|
3696
|
-
/* @__PURE__ */
|
|
3804
|
+
/* @__PURE__ */ jsxs29(
|
|
3697
3805
|
PopoverContent,
|
|
3698
3806
|
{
|
|
3699
3807
|
side: "bottom",
|
|
@@ -3711,7 +3819,7 @@ var MultiSelect = forwardRef51(
|
|
|
3711
3819
|
className: "border-0 rounded-none ring-0 focus-visible:ring-0"
|
|
3712
3820
|
}
|
|
3713
3821
|
) }),
|
|
3714
|
-
/* @__PURE__ */ jsx59(ScrollArea, { className: "max-h-60", children: /* @__PURE__ */ jsx59("div", { className: "p-1", children: filtered.length === 0 ? /* @__PURE__ */ jsx59("p", { className: "px-2 py-4 text-sm text-muted text-center", children: emptyText }) : filtered.map((option) => /* @__PURE__ */
|
|
3822
|
+
/* @__PURE__ */ jsx59(ScrollArea, { className: "max-h-60", children: /* @__PURE__ */ jsx59("div", { className: "p-1", children: filtered.length === 0 ? /* @__PURE__ */ jsx59("p", { className: "px-2 py-4 text-sm text-muted text-center", children: emptyText }) : filtered.map((option) => /* @__PURE__ */ jsxs29(
|
|
3715
3823
|
"label",
|
|
3716
3824
|
{
|
|
3717
3825
|
className: cn(
|
|
@@ -3740,7 +3848,7 @@ MultiSelect.displayName = "MultiSelect";
|
|
|
3740
3848
|
|
|
3741
3849
|
// src/ui/command-palette/CommandPalette.tsx
|
|
3742
3850
|
import { forwardRef as forwardRef52, useState as useState9, useMemo as useMemo7, useRef as useRef8, useEffect as useEffect3, useCallback as useCallback8 } from "react";
|
|
3743
|
-
import { jsx as jsx60, jsxs as
|
|
3851
|
+
import { jsx as jsx60, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
3744
3852
|
var CommandPalette = forwardRef52(
|
|
3745
3853
|
function CommandPalette2({ open, onOpenChange, actions, onSelect, placeholder = "Search commands...", emptyText = "No results found", groups }, ref) {
|
|
3746
3854
|
const [query, setQuery] = useState9("");
|
|
@@ -3787,7 +3895,7 @@ var CommandPalette = forwardRef52(
|
|
|
3787
3895
|
[filtered, activeIdx, onSelect, onOpenChange]
|
|
3788
3896
|
);
|
|
3789
3897
|
const flatItems = groupedFiltered ? groupedFiltered.flatMap((g) => g.actions) : filtered;
|
|
3790
|
-
return /* @__PURE__ */ jsx60(Root6, { open, onOpenChange, children: /* @__PURE__ */ jsx60("div", { ref, children: /* @__PURE__ */
|
|
3898
|
+
return /* @__PURE__ */ jsx60(Root6, { open, onOpenChange, children: /* @__PURE__ */ jsx60("div", { ref, children: /* @__PURE__ */ jsxs30(DialogContent, { size: "lg", className: "p-0 overflow-hidden gap-0", children: [
|
|
3791
3899
|
/* @__PURE__ */ jsx60("div", { className: "border-b border-border", children: /* @__PURE__ */ jsx60(
|
|
3792
3900
|
"input",
|
|
3793
3901
|
{
|
|
@@ -3802,7 +3910,7 @@ var CommandPalette = forwardRef52(
|
|
|
3802
3910
|
className: "w-full bg-transparent px-4 py-3 text-sm outline-none placeholder:text-muted"
|
|
3803
3911
|
}
|
|
3804
3912
|
) }),
|
|
3805
|
-
/* @__PURE__ */ jsx60(ScrollArea, { className: "max-h-80", children: /* @__PURE__ */ jsx60("div", { className: "p-2", onKeyDown: handleKeyDown, children: flatItems.length === 0 ? /* @__PURE__ */ jsx60("p", { className: "px-2 py-8 text-sm text-muted text-center", children: emptyText }) : groupedFiltered ? groupedFiltered.map((group) => /* @__PURE__ */
|
|
3913
|
+
/* @__PURE__ */ jsx60(ScrollArea, { className: "max-h-80", children: /* @__PURE__ */ jsx60("div", { className: "p-2", onKeyDown: handleKeyDown, children: flatItems.length === 0 ? /* @__PURE__ */ jsx60("p", { className: "px-2 py-8 text-sm text-muted text-center", children: emptyText }) : groupedFiltered ? groupedFiltered.map((group) => /* @__PURE__ */ jsxs30("div", { children: [
|
|
3806
3914
|
/* @__PURE__ */ jsx60("p", { className: "px-2 py-1 text-xs font-semibold text-muted uppercase tracking-wider", children: group.label }),
|
|
3807
3915
|
group.actions.map((action) => {
|
|
3808
3916
|
const idx = flatItems.indexOf(action);
|
|
@@ -3843,7 +3951,7 @@ function CommandItem({
|
|
|
3843
3951
|
onSelect,
|
|
3844
3952
|
onMouseEnter
|
|
3845
3953
|
}) {
|
|
3846
|
-
return /* @__PURE__ */
|
|
3954
|
+
return /* @__PURE__ */ jsxs30(
|
|
3847
3955
|
"button",
|
|
3848
3956
|
{
|
|
3849
3957
|
type: "button",
|
|
@@ -3866,7 +3974,7 @@ function CommandItem({
|
|
|
3866
3974
|
import { forwardRef as forwardRef53 } from "react";
|
|
3867
3975
|
import { Root as Root13, Trigger as Trigger7, Portal as Portal6, Overlay as Overlay2, Content as Content7, Title as Title3, Description as Description3, Close as Close4 } from "@radix-ui/react-dialog";
|
|
3868
3976
|
import { cva as cva31 } from "class-variance-authority";
|
|
3869
|
-
import { jsx as jsx61, jsxs as
|
|
3977
|
+
import { jsx as jsx61, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
3870
3978
|
var drawerOverlay = "fixed inset-0 z-[var(--z-overlay)] bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out";
|
|
3871
3979
|
var drawerContentVariants = cva31(
|
|
3872
3980
|
"fixed z-[var(--z-overlay)] flex flex-col bg-surface-elevated shadow-lg transition-transform duration-[var(--duration-slow)] ease-[var(--ease-standard)]",
|
|
@@ -3889,9 +3997,9 @@ var drawerContentVariants = cva31(
|
|
|
3889
3997
|
}
|
|
3890
3998
|
);
|
|
3891
3999
|
var DrawerContent = forwardRef53(
|
|
3892
|
-
({ className, side, size, children, ...props }, ref) => /* @__PURE__ */
|
|
4000
|
+
({ className, side, size, children, ...props }, ref) => /* @__PURE__ */ jsxs31(Portal6, { children: [
|
|
3893
4001
|
/* @__PURE__ */ jsx61(Overlay2, { className: drawerOverlay }),
|
|
3894
|
-
/* @__PURE__ */
|
|
4002
|
+
/* @__PURE__ */ jsxs31(Content7, { ref, className: cn(drawerContentVariants({ side, size }), className), style: { backdropFilter: "blur(var(--backdrop-blur))" }, ...props, children: [
|
|
3895
4003
|
children,
|
|
3896
4004
|
/* @__PURE__ */ jsx61(Close4, { className: "absolute right-panel top-panel rounded-ui-sm opacity-70 hover:opacity-100", children: /* @__PURE__ */ jsx61("svg", { viewBox: "0 0 15 15", className: "size-4 fill-current", children: /* @__PURE__ */ jsx61("path", { d: "M2 2l11 11M13 2L2 13", stroke: "currentColor", strokeWidth: "1.5", fill: "none" }) }) })
|
|
3897
4005
|
] })
|
|
@@ -3922,7 +4030,7 @@ DrawerFooter.displayName = "DrawerFooter";
|
|
|
3922
4030
|
// src/ui/data-list/DataList.tsx
|
|
3923
4031
|
import { forwardRef as forwardRef54 } from "react";
|
|
3924
4032
|
import { cva as cva32 } from "class-variance-authority";
|
|
3925
|
-
import { jsx as jsx62, jsxs as
|
|
4033
|
+
import { jsx as jsx62, jsxs as jsxs32 } from "react/jsx-runtime";
|
|
3926
4034
|
var dataListVariants = cva32("overflow-hidden divide-y divide-border", {
|
|
3927
4035
|
variants: {
|
|
3928
4036
|
variant: {
|
|
@@ -3941,7 +4049,7 @@ var DataList = forwardRef54(
|
|
|
3941
4049
|
ref,
|
|
3942
4050
|
className: cn(dataListVariants({ variant }), className),
|
|
3943
4051
|
...props,
|
|
3944
|
-
children: items.map((item, i) => /* @__PURE__ */
|
|
4052
|
+
children: items.map((item, i) => /* @__PURE__ */ jsxs32(
|
|
3945
4053
|
"div",
|
|
3946
4054
|
{
|
|
3947
4055
|
className: cn(
|
|
@@ -3949,7 +4057,7 @@ var DataList = forwardRef54(
|
|
|
3949
4057
|
variant === "compact" ? "py-1 px-2" : "py-2 px-3"
|
|
3950
4058
|
),
|
|
3951
4059
|
children: [
|
|
3952
|
-
/* @__PURE__ */
|
|
4060
|
+
/* @__PURE__ */ jsxs32("dt", { className: "flex w-36 shrink-0 items-center gap-2 text-sm text-muted", children: [
|
|
3953
4061
|
item.icon && /* @__PURE__ */ jsx62("span", { className: "shrink-0", children: item.icon }),
|
|
3954
4062
|
item.label
|
|
3955
4063
|
] }),
|
|
@@ -3977,7 +4085,7 @@ DataList.displayName = "DataList";
|
|
|
3977
4085
|
// src/ui/patterns/data-table/DataTable.tsx
|
|
3978
4086
|
import { forwardRef as forwardRef55 } from "react";
|
|
3979
4087
|
import { cva as cva33 } from "class-variance-authority";
|
|
3980
|
-
import { jsx as jsx63, jsxs as
|
|
4088
|
+
import { jsx as jsx63, jsxs as jsxs33 } from "react/jsx-runtime";
|
|
3981
4089
|
var COLUMN_WIDTH_SCALE = {
|
|
3982
4090
|
xs: "8%",
|
|
3983
4091
|
sm: "12%",
|
|
@@ -4002,7 +4110,7 @@ var dataTableVariants = cva33("", {
|
|
|
4002
4110
|
}
|
|
4003
4111
|
});
|
|
4004
4112
|
var DataTable = forwardRef55(
|
|
4005
|
-
({ className, columns, rows, variant, density, stickyHeader, replacements, layout = "fixed", ...props }, ref) => /* @__PURE__ */ jsx63(ScrollArea, { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */
|
|
4113
|
+
({ className, columns, rows, variant, density, stickyHeader, replacements, layout = "fixed", ...props }, ref) => /* @__PURE__ */ jsx63(ScrollArea, { ref, className: cn("w-full", className), ...props, children: /* @__PURE__ */ jsxs33(
|
|
4006
4114
|
Table,
|
|
4007
4115
|
{
|
|
4008
4116
|
variant,
|
|
@@ -4031,10 +4139,10 @@ DataTable.displayName = "DataTable";
|
|
|
4031
4139
|
|
|
4032
4140
|
// src/ui/slider/Slider.tsx
|
|
4033
4141
|
import { forwardRef as forwardRef56 } from "react";
|
|
4034
|
-
import { jsx as jsx64, jsxs as
|
|
4142
|
+
import { jsx as jsx64, jsxs as jsxs34 } from "react/jsx-runtime";
|
|
4035
4143
|
var Slider = forwardRef56(
|
|
4036
|
-
({ className, label, showValue, value, min = 0, max = 100, step = 1, ...props }, ref) => /* @__PURE__ */
|
|
4037
|
-
(label || showValue) && /* @__PURE__ */
|
|
4144
|
+
({ className, label, showValue, value, min = 0, max = 100, step = 1, ...props }, ref) => /* @__PURE__ */ jsxs34("div", { className: cn("flex flex-col gap-1", className), children: [
|
|
4145
|
+
(label || showValue) && /* @__PURE__ */ jsxs34("div", { className: "flex items-center justify-between", children: [
|
|
4038
4146
|
label && /* @__PURE__ */ jsx64("span", { className: "text-sm text-fg", children: label }),
|
|
4039
4147
|
showValue && /* @__PURE__ */ jsx64("span", { className: "text-sm text-muted font-mono", children: String(value ?? 0) })
|
|
4040
4148
|
] }),
|
|
@@ -4057,7 +4165,7 @@ Slider.displayName = "Slider";
|
|
|
4057
4165
|
|
|
4058
4166
|
// src/ui/markdown/Markdown.tsx
|
|
4059
4167
|
import { useMemo as useMemo8 } from "react";
|
|
4060
|
-
import { Fragment as Fragment6, jsx as jsx65, jsxs as
|
|
4168
|
+
import { Fragment as Fragment6, jsx as jsx65, jsxs as jsxs35 } from "react/jsx-runtime";
|
|
4061
4169
|
function escapeHtml(text) {
|
|
4062
4170
|
return text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
4063
4171
|
}
|
|
@@ -4169,7 +4277,7 @@ function Markdown({ content, className, ...props }) {
|
|
|
4169
4277
|
case "code":
|
|
4170
4278
|
return /* @__PURE__ */ jsx65(CodeBlock, { code: block.code, language: block.language }, i);
|
|
4171
4279
|
case "table":
|
|
4172
|
-
return /* @__PURE__ */ jsx65("div", { className: "overflow-x-auto", children: /* @__PURE__ */
|
|
4280
|
+
return /* @__PURE__ */ jsx65("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxs35("table", { className: "w-full text-sm border-collapse", children: [
|
|
4173
4281
|
block.headers.length > 0 && /* @__PURE__ */ jsx65("thead", { children: /* @__PURE__ */ jsx65("tr", { children: block.headers.map((h, j) => /* @__PURE__ */ jsx65("th", { className: "border border-border px-3 py-2 text-left font-semibold text-fg text-xs uppercase tracking-wider", children: renderInline(h) }, j)) }) }),
|
|
4174
4282
|
/* @__PURE__ */ jsx65("tbody", { children: block.rows.map((row, j) => /* @__PURE__ */ jsx65("tr", { children: row.map((c, k) => /* @__PURE__ */ jsx65("td", { className: "border border-border px-3 py-1.5 text-fg", children: renderInline(c) }, k)) }, j)) })
|
|
4175
4283
|
] }) }, i);
|
|
@@ -4182,7 +4290,7 @@ function Markdown({ content, className, ...props }) {
|
|
|
4182
4290
|
// src/ui/file-drop/FileDrop.tsx
|
|
4183
4291
|
import { forwardRef as forwardRef57, useState as useState10, useRef as useRef9, useCallback as useCallback9 } from "react";
|
|
4184
4292
|
import { cva as cva34 } from "class-variance-authority";
|
|
4185
|
-
import { Fragment as Fragment7, jsx as jsx66, jsxs as
|
|
4293
|
+
import { Fragment as Fragment7, jsx as jsx66, jsxs as jsxs36 } from "react/jsx-runtime";
|
|
4186
4294
|
var fileDropVariants = cva34(
|
|
4187
4295
|
"relative flex flex-col items-center justify-center gap-2 rounded-ui border-2 border-dashed p-8 text-center transition-colors cursor-pointer",
|
|
4188
4296
|
{
|
|
@@ -4254,7 +4362,7 @@ var FileDrop = forwardRef57(
|
|
|
4254
4362
|
if (e.target.files) validateAndDrop(e.target.files);
|
|
4255
4363
|
}, [validateAndDrop]);
|
|
4256
4364
|
const state = disabled ? "default" : error ? "error" : success ? "success" : dragOver ? "dragging" : "default";
|
|
4257
|
-
return /* @__PURE__ */
|
|
4365
|
+
return /* @__PURE__ */ jsxs36(
|
|
4258
4366
|
"div",
|
|
4259
4367
|
{
|
|
4260
4368
|
ref,
|
|
@@ -4266,15 +4374,15 @@ var FileDrop = forwardRef57(
|
|
|
4266
4374
|
...props,
|
|
4267
4375
|
children: [
|
|
4268
4376
|
/* @__PURE__ */ jsx66("input", { ref: inputRef, type: "file", accept, multiple, className: "hidden", onChange: handleFileChange }),
|
|
4269
|
-
dragOver ? /* @__PURE__ */
|
|
4377
|
+
dragOver ? /* @__PURE__ */ jsxs36(Fragment7, { children: [
|
|
4270
4378
|
/* @__PURE__ */ jsx66("svg", { viewBox: "0 0 24 24", className: "size-8 text-primary fill-none stroke-current stroke-[1.5]", children: /* @__PURE__ */ jsx66("path", { d: "M12 4v12m0 0l-3-3m3 3l3-3M4 16v2a2 2 0 002 2h12a2 2 0 002-2v-2" }) }),
|
|
4271
4379
|
/* @__PURE__ */ jsx66("p", { className: "font-medium text-primary", children: "Drop files here" })
|
|
4272
|
-
] }) : /* @__PURE__ */
|
|
4380
|
+
] }) : /* @__PURE__ */ jsxs36(Fragment7, { children: [
|
|
4273
4381
|
/* @__PURE__ */ jsx66("svg", { viewBox: "0 0 24 24", className: "size-8 text-muted fill-none stroke-current stroke-[1.5]", children: /* @__PURE__ */ jsx66("path", { d: "M7 16a4 4 0 010-8 5 5 0 0110 0 4 4 0 010 8h-1M12 4v12m0 0l-3-3m3 3l3-3" }) }),
|
|
4274
4382
|
/* @__PURE__ */ jsx66("p", { className: "font-medium text-fg", children: error || success ? "" : "Drop files here or click to browse" }),
|
|
4275
4383
|
error && /* @__PURE__ */ jsx66("p", { className: "text-xs text-danger", children: error }),
|
|
4276
4384
|
success && /* @__PURE__ */ jsx66("p", { className: "text-xs text-success", children: "Files added" }),
|
|
4277
|
-
!error && !success && /* @__PURE__ */
|
|
4385
|
+
!error && !success && /* @__PURE__ */ jsxs36("p", { className: "text-xs text-muted", children: [
|
|
4278
4386
|
accept ? `Accepts: ${accept}` : "Any file type",
|
|
4279
4387
|
maxSize ? ` \xB7 Max ${(maxSize / 1024 / 1024).toFixed(0)}MB` : "",
|
|
4280
4388
|
multiple ? " \xB7 Multiple" : ""
|
|
@@ -4290,7 +4398,7 @@ FileDrop.displayName = "FileDrop";
|
|
|
4290
4398
|
// src/ui/image/Image.tsx
|
|
4291
4399
|
import { forwardRef as forwardRef58 } from "react";
|
|
4292
4400
|
import { cva as cva35 } from "class-variance-authority";
|
|
4293
|
-
import { jsx as jsx67, jsxs as
|
|
4401
|
+
import { jsx as jsx67, jsxs as jsxs37 } from "react/jsx-runtime";
|
|
4294
4402
|
var imageVariants = cva35("inline-block object-cover bg-secondary", {
|
|
4295
4403
|
variants: {
|
|
4296
4404
|
fit: {
|
|
@@ -4339,7 +4447,7 @@ var Image2 = forwardRef58(
|
|
|
4339
4447
|
}
|
|
4340
4448
|
);
|
|
4341
4449
|
if (caption) {
|
|
4342
|
-
return /* @__PURE__ */
|
|
4450
|
+
return /* @__PURE__ */ jsxs37("figure", { className: "inline-flex flex-col gap-1.5", children: [
|
|
4343
4451
|
img,
|
|
4344
4452
|
/* @__PURE__ */ jsx67("figcaption", { className: "text-xs text-muted text-center", children: caption })
|
|
4345
4453
|
] });
|
|
@@ -4409,7 +4517,7 @@ function PortHitZone({
|
|
|
4409
4517
|
}
|
|
4410
4518
|
|
|
4411
4519
|
// src/ui/patterns/graph/GraphNode.tsx
|
|
4412
|
-
import { jsx as jsx69, jsxs as
|
|
4520
|
+
import { jsx as jsx69, jsxs as jsxs38 } from "react/jsx-runtime";
|
|
4413
4521
|
function GraphNodeRenderer({
|
|
4414
4522
|
node,
|
|
4415
4523
|
isSelected,
|
|
@@ -4422,7 +4530,7 @@ function GraphNodeRenderer({
|
|
|
4422
4530
|
onSelect(node.id);
|
|
4423
4531
|
onDragStart(node.id, e.clientX, e.clientY, node.x, node.y);
|
|
4424
4532
|
}, [node.id, node.x, node.y, onSelect, onDragStart]);
|
|
4425
|
-
return /* @__PURE__ */
|
|
4533
|
+
return /* @__PURE__ */ jsxs38("div", { className: "absolute", style: { left: node.x, top: node.y, width: NODE_WIDTH }, onMouseDown: onDown, children: [
|
|
4426
4534
|
/* @__PURE__ */ jsx69(
|
|
4427
4535
|
GraphNode,
|
|
4428
4536
|
{
|
|
@@ -4443,7 +4551,7 @@ function GraphNodeRenderer({
|
|
|
4443
4551
|
}
|
|
4444
4552
|
|
|
4445
4553
|
// src/ui/patterns/graph/Graph.tsx
|
|
4446
|
-
import { jsx as jsx70, jsxs as
|
|
4554
|
+
import { jsx as jsx70, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
4447
4555
|
function graphReducer(state, action) {
|
|
4448
4556
|
switch (action.type) {
|
|
4449
4557
|
case "MOVE_NODE":
|
|
@@ -4582,7 +4690,7 @@ var Graph = ({
|
|
|
4582
4690
|
dispatch({ type: "SELECT_EDGE", id: edgeId });
|
|
4583
4691
|
}, []);
|
|
4584
4692
|
const { nodes, edges, selectedNodeIds, selectedEdgeIds, connecting, offset: offset2, zoom } = state;
|
|
4585
|
-
return /* @__PURE__ */
|
|
4693
|
+
return /* @__PURE__ */ jsxs39(
|
|
4586
4694
|
Canvas,
|
|
4587
4695
|
{
|
|
4588
4696
|
ref: containerRef,
|
|
@@ -4594,7 +4702,7 @@ var Graph = ({
|
|
|
4594
4702
|
onBackgroundClick: () => dispatch({ type: "DESELECT_ALL" }),
|
|
4595
4703
|
controls,
|
|
4596
4704
|
children: [
|
|
4597
|
-
/* @__PURE__ */
|
|
4705
|
+
/* @__PURE__ */ jsxs39("svg", { className: "absolute inset-0 overflow-visible w-full h-full pointer-events-none", children: [
|
|
4598
4706
|
edges.map((edge) => {
|
|
4599
4707
|
const fn = nodes.find((n) => n.id === edge.from.nodeId);
|
|
4600
4708
|
const tn = nodes.find((n) => n.id === edge.to.nodeId);
|
|
@@ -4789,7 +4897,7 @@ var LAYER_SVGS = {
|
|
|
4789
4897
|
};
|
|
4790
4898
|
|
|
4791
4899
|
// src/ui/patterns/textured-surface/TexturedSurface.tsx
|
|
4792
|
-
import { jsx as jsx71, jsxs as
|
|
4900
|
+
import { jsx as jsx71, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
4793
4901
|
var TEXTURE_STRENGTHS = {
|
|
4794
4902
|
"paper-grain": { subtle: 0.3, medium: 0.5, strong: 0.75 },
|
|
4795
4903
|
"frosted-glass": { subtle: 0.22, medium: 0.35, strong: 0.55 },
|
|
@@ -4882,7 +4990,7 @@ var TexturedSurface = forwardRef59(
|
|
|
4882
4990
|
if (conf) {
|
|
4883
4991
|
const tileLayers = conf.layers.filter((l) => l.tileSize);
|
|
4884
4992
|
const coverLayers = conf.layers.filter((l) => !l.tileSize);
|
|
4885
|
-
return /* @__PURE__ */
|
|
4993
|
+
return /* @__PURE__ */ jsxs40(
|
|
4886
4994
|
"div",
|
|
4887
4995
|
{
|
|
4888
4996
|
ref,
|
|
@@ -4949,7 +5057,7 @@ TexturedSurface.displayName = "TexturedSurface";
|
|
|
4949
5057
|
|
|
4950
5058
|
// src/ui/patterns/textured-surface/ParamTable.tsx
|
|
4951
5059
|
import { Fragment as Fragment8 } from "react";
|
|
4952
|
-
import { jsx as jsx72, jsxs as
|
|
5060
|
+
import { jsx as jsx72, jsxs as jsxs41 } from "react/jsx-runtime";
|
|
4953
5061
|
var LAYERS = ["page", "surface", "foreground"];
|
|
4954
5062
|
var STRENGTHS = ["subtle", "medium", "strong"];
|
|
4955
5063
|
var LAYER_LABELS = {
|
|
@@ -4958,10 +5066,10 @@ var LAYER_LABELS = {
|
|
|
4958
5066
|
foreground: "Foreground"
|
|
4959
5067
|
};
|
|
4960
5068
|
function ParamTable({ texture = "paper-grain" }) {
|
|
4961
|
-
return /* @__PURE__ */
|
|
5069
|
+
return /* @__PURE__ */ jsxs41("div", { className: "w-full grid grid-cols-[4rem_repeat(3,1fr)] gap-1 items-center", children: [
|
|
4962
5070
|
/* @__PURE__ */ jsx72("div", {}),
|
|
4963
5071
|
STRENGTHS.map((s) => /* @__PURE__ */ jsx72("div", { className: "text-center text-xs font-medium text-muted", children: s }, s)),
|
|
4964
|
-
LAYERS.map((layer) => /* @__PURE__ */
|
|
5072
|
+
LAYERS.map((layer) => /* @__PURE__ */ jsxs41(Fragment8, { children: [
|
|
4965
5073
|
/* @__PURE__ */ jsx72("div", { className: "text-xs font-medium text-muted self-center", children: LAYER_LABELS[layer] }),
|
|
4966
5074
|
STRENGTHS.map((strength) => /* @__PURE__ */ jsx72(
|
|
4967
5075
|
TexturedSurface,
|