@railtownai/railtracks-visualizer 0.0.17 → 0.0.19
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/README.md +32 -0
- package/dist/cjs/index.js +594 -31
- package/dist/esm/index.js +595 -32
- package/dist/types/components/FileSelector.d.ts +5 -2
- package/dist/types/components/Timeline.d.ts +1 -1
- package/dist/types/components/Visualizer.d.ts +1 -1
- package/dist/types/components/icons/AnthropicIcon.d.ts +2 -1
- package/dist/types/components/icons/GoogleIcon.d.ts +2 -1
- package/dist/types/components/icons/OpenAIIcon.d.ts +2 -1
- package/dist/types/components/icons/index.d.ts +1 -1
- package/dist/types/components/ui/select.d.ts +8 -8
- package/dist/types/components/ui/sheet.d.ts +2 -5
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useTheme.d.ts +7 -0
- package/dist/types/lib/GlobalStyles.d.ts +2 -0
- package/dist/types/lib/ThemeProvider.d.ts +14 -0
- package/dist/types/lib/index.d.ts +3 -0
- package/dist/types/lib/theme.d.ts +65 -0
- package/dist/types/lib/utils.d.ts +32 -10
- package/package.json +3 -7
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { JsonFile } from "../hooks";
|
|
3
2
|
interface FileSelectorProps {
|
|
4
|
-
files:
|
|
3
|
+
files: {
|
|
4
|
+
name: string;
|
|
5
|
+
size?: number;
|
|
6
|
+
modified?: string;
|
|
7
|
+
}[];
|
|
5
8
|
currentFile: string | null;
|
|
6
9
|
onFileSelect: (filename: string) => void;
|
|
7
10
|
onRefresh: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { AgenticFlowVisualizerProps } from "./AgenticFlowVisualizer";
|
|
3
3
|
/**
|
|
4
|
-
* Visualizer component that wraps AgenticFlowVisualizer with ReactFlowProvider.
|
|
4
|
+
* Visualizer component that wraps AgenticFlowVisualizer with ReactFlowProvider and ThemeProvider.
|
|
5
5
|
* This is the main component that should be imported from the npm package.
|
|
6
6
|
*/
|
|
7
7
|
declare const Visualizer: React.FC<AgenticFlowVisualizerProps>;
|
|
@@ -3,11 +3,11 @@ import * as SelectPrimitive from "@radix-ui/react-select";
|
|
|
3
3
|
declare const Select: React.FC<SelectPrimitive.SelectProps>;
|
|
4
4
|
declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
5
5
|
declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
|
|
6
|
-
declare const
|
|
7
|
-
declare const
|
|
8
|
-
declare const
|
|
9
|
-
declare const
|
|
10
|
-
declare const
|
|
11
|
-
declare const
|
|
12
|
-
declare const
|
|
13
|
-
export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, SelectScrollUpButton, SelectScrollDownButton };
|
|
6
|
+
declare const SelectTriggerWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
declare const SelectScrollUpButtonWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollUpButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
declare const SelectScrollDownButtonWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectScrollDownButtonProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
declare const SelectContentWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
declare const SelectLabelWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
declare const SelectItemWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
declare const SelectSeparatorWithRef: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export { Select, SelectGroup, SelectValue, SelectTriggerWithRef as SelectTrigger, SelectContentWithRef as SelectContent, SelectLabelWithRef as SelectLabel, SelectItemWithRef as SelectItem, SelectSeparatorWithRef as SelectSeparator, SelectScrollUpButtonWithRef as SelectScrollUpButton, SelectScrollDownButtonWithRef as SelectScrollDownButton };
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3
|
-
import { type VariantProps } from "class-variance-authority";
|
|
4
3
|
declare const Sheet: React.FC<SheetPrimitive.DialogProps>;
|
|
5
4
|
declare const SheetTrigger: React.ForwardRefExoticComponent<SheetPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
5
|
declare const SheetClose: React.ForwardRefExoticComponent<SheetPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
6
|
declare const SheetPortal: React.FC<SheetPrimitive.DialogPortalProps>;
|
|
8
7
|
declare const SheetOverlay: React.ForwardRefExoticComponent<Omit<SheetPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
|
|
10
|
-
side?: "
|
|
11
|
-
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
12
|
-
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content>, VariantProps<typeof sheetVariants> {
|
|
8
|
+
interface SheetContentProps extends React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> {
|
|
9
|
+
side?: "top" | "bottom" | "left" | "right";
|
|
13
10
|
}
|
|
14
11
|
declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
12
|
declare const SheetHeader: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { useApi } from "./useApi";
|
|
2
2
|
export { useFlowData } from "./useFlowData";
|
|
3
|
+
export { useTheme } from "./useTheme";
|
|
3
4
|
export type { JsonFile, ApiError } from "./useApi";
|
|
4
5
|
export type { FlowDataState } from "./useFlowData";
|
|
5
6
|
export type { AgentRunNode } from "../dto/AgentRunNode";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { Theme } from "./theme";
|
|
3
|
+
interface ThemeContextType {
|
|
4
|
+
theme: Theme;
|
|
5
|
+
setTheme: (theme: Theme) => void;
|
|
6
|
+
}
|
|
7
|
+
interface ThemeProviderProps {
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
theme?: Theme;
|
|
10
|
+
}
|
|
11
|
+
export declare const ThemeProvider: React.FC<ThemeProviderProps>;
|
|
12
|
+
export declare const useTheme: () => ThemeContextType;
|
|
13
|
+
export declare const useThemeValue: () => Theme;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
export interface Theme {
|
|
2
|
+
colors: {
|
|
3
|
+
background: string;
|
|
4
|
+
foreground: string;
|
|
5
|
+
card: string;
|
|
6
|
+
cardForeground: string;
|
|
7
|
+
popover: string;
|
|
8
|
+
popoverForeground: string;
|
|
9
|
+
primary: string;
|
|
10
|
+
primaryForeground: string;
|
|
11
|
+
secondary: string;
|
|
12
|
+
secondaryForeground: string;
|
|
13
|
+
muted: string;
|
|
14
|
+
mutedForeground: string;
|
|
15
|
+
accent: string;
|
|
16
|
+
accentForeground: string;
|
|
17
|
+
destructive: string;
|
|
18
|
+
destructiveForeground: string;
|
|
19
|
+
border: string;
|
|
20
|
+
mutedBorder: string;
|
|
21
|
+
input: string;
|
|
22
|
+
ring: string;
|
|
23
|
+
};
|
|
24
|
+
spacing: {
|
|
25
|
+
xs: string;
|
|
26
|
+
sm: string;
|
|
27
|
+
md: string;
|
|
28
|
+
lg: string;
|
|
29
|
+
xl: string;
|
|
30
|
+
"2xl": string;
|
|
31
|
+
"3xl": string;
|
|
32
|
+
};
|
|
33
|
+
borderRadius: {
|
|
34
|
+
sm: string;
|
|
35
|
+
md: string;
|
|
36
|
+
lg: string;
|
|
37
|
+
xl: string;
|
|
38
|
+
};
|
|
39
|
+
fontSize: {
|
|
40
|
+
xs: string;
|
|
41
|
+
sm: string;
|
|
42
|
+
base: string;
|
|
43
|
+
lg: string;
|
|
44
|
+
xl: string;
|
|
45
|
+
};
|
|
46
|
+
fontWeight: {
|
|
47
|
+
normal: string;
|
|
48
|
+
medium: string;
|
|
49
|
+
semibold: string;
|
|
50
|
+
bold: string;
|
|
51
|
+
};
|
|
52
|
+
shadows: {
|
|
53
|
+
sm: string;
|
|
54
|
+
md: string;
|
|
55
|
+
lg: string;
|
|
56
|
+
};
|
|
57
|
+
transitions: {
|
|
58
|
+
fast: string;
|
|
59
|
+
normal: string;
|
|
60
|
+
slow: string;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
export declare const lightTheme: Theme;
|
|
64
|
+
export declare const darkTheme: Theme;
|
|
65
|
+
export declare const defaultTheme: Theme;
|
|
@@ -7,21 +7,43 @@ export declare function cn(...inputs: ClassValue[]): string;
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function toTitleCase(str: string): string;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Formats a currency value
|
|
11
|
+
* @param value - The value to format
|
|
12
|
+
* @returns The formatted currency string
|
|
13
|
+
*/
|
|
14
|
+
export declare function formatCurrency(value: number | null | undefined): string;
|
|
15
|
+
/**
|
|
16
|
+
* Formats latency in a human-readable format
|
|
17
|
+
* @param latencyMs - Latency in milliseconds
|
|
18
|
+
* @returns The formatted latency string
|
|
19
|
+
*/
|
|
20
|
+
export declare function formatLatency(latencyMs: number): string;
|
|
21
|
+
/**
|
|
22
|
+
* Truncates text to a specified length
|
|
11
23
|
* @param text - The text to truncate
|
|
12
|
-
* @param maxLength - The maximum length
|
|
24
|
+
* @param maxLength - The maximum length
|
|
13
25
|
* @returns The truncated text
|
|
14
26
|
*/
|
|
15
27
|
export declare function truncateText(text: string, maxLength: number): string;
|
|
16
28
|
/**
|
|
17
|
-
*
|
|
18
|
-
* @param
|
|
19
|
-
* @
|
|
29
|
+
* Styled-components utility for conditional styling
|
|
30
|
+
* @param condition - The condition to check
|
|
31
|
+
* @param trueStyle - The style to apply if condition is true
|
|
32
|
+
* @param falseStyle - The style to apply if condition is false (optional)
|
|
33
|
+
* @returns The appropriate style string
|
|
34
|
+
*/
|
|
35
|
+
export declare function conditionalStyle(condition: boolean, trueStyle: string, falseStyle?: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Styled-components utility for responsive spacing
|
|
38
|
+
* @param theme - The theme object
|
|
39
|
+
* @param size - The spacing size
|
|
40
|
+
* @returns The spacing value
|
|
20
41
|
*/
|
|
21
|
-
export declare function
|
|
42
|
+
export declare function getSpacing(theme: any, size: keyof typeof theme.spacing): string;
|
|
22
43
|
/**
|
|
23
|
-
*
|
|
24
|
-
* @param
|
|
25
|
-
* @
|
|
44
|
+
* Styled-components utility for responsive colors
|
|
45
|
+
* @param theme - The theme object
|
|
46
|
+
* @param colorKey - The color key
|
|
47
|
+
* @returns The color value
|
|
26
48
|
*/
|
|
27
|
-
export declare function
|
|
49
|
+
export declare function getColor(theme: any, colorKey: keyof typeof theme.colors): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@railtownai/railtracks-visualizer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.19",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Railtown AI",
|
|
6
6
|
"description": "A visualizer for RailTracks agentic flows",
|
|
@@ -50,8 +50,9 @@
|
|
|
50
50
|
"build:lib": "rollup -c",
|
|
51
51
|
"build:spa": "vite build",
|
|
52
52
|
"build:types": "tsc -p tsconfig.types.json",
|
|
53
|
+
"build:size": "npm pack --dry-run",
|
|
53
54
|
"build": "npm run build:types && npm run build:lib && npm run build:spa",
|
|
54
|
-
"clean": "rm -rf dist build",
|
|
55
|
+
"clean": "rm -rf dist build test-results .railtracks/ui/*",
|
|
55
56
|
"dev:spa": "vite build && rm -rf .railtracks/ui/* && cp -r build/* .railtracks/ui",
|
|
56
57
|
"lint:fix": "prettier --write \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
57
58
|
"lint": "prettier --check \"src/**/*.{js,jsx,ts,tsx,json,css,md}\"",
|
|
@@ -84,7 +85,6 @@
|
|
|
84
85
|
"@vitejs/plugin-react-swc": "3.10.2",
|
|
85
86
|
"@vitest/browser": "3.2.4",
|
|
86
87
|
"@vitest/coverage-v8": "3.2.4",
|
|
87
|
-
"autoprefixer": "10.4.21",
|
|
88
88
|
"class-variance-authority": "0.7.1",
|
|
89
89
|
"clsx": "2.1.1",
|
|
90
90
|
"cross-env": "^7.0.3",
|
|
@@ -92,14 +92,10 @@
|
|
|
92
92
|
"jsdom": "26.1.0",
|
|
93
93
|
"npm-check-updates": "18.0.1",
|
|
94
94
|
"playwright": "^1.55.0",
|
|
95
|
-
"postcss": "8.5.6",
|
|
96
95
|
"prettier": "3.6.2",
|
|
97
96
|
"rollup": "3.29.5",
|
|
98
97
|
"rollup-plugin-postcss": "4.0.2",
|
|
99
98
|
"storybook": "9.1.3",
|
|
100
|
-
"tailwind-merge": "3.3.1",
|
|
101
|
-
"tailwindcss": "3.4.17",
|
|
102
|
-
"tailwindcss-animate": "1.0.7",
|
|
103
99
|
"tslib": "2.8.1",
|
|
104
100
|
"typescript": "5.8.3",
|
|
105
101
|
"vite": "7.0.5",
|