@tensor_1/react 2.17.0 → 2.18.0

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/dist/index.d.cts CHANGED
@@ -1905,13 +1905,21 @@ interface RelationshipGraphNode {
1905
1905
  description?: string;
1906
1906
  x?: number;
1907
1907
  y?: number;
1908
+ /** Layered layout: the node's column. Omitted → BFS distance from the root along source→target. */
1909
+ depth?: number;
1908
1910
  }
1911
+ /** Where an edge's arrowhead sits: at the target (default), at the source, or nowhere. */
1912
+ type RelationshipGraphArrow = 'forward' | 'backward' | 'none';
1909
1913
  interface RelationshipGraphEdge {
1910
1914
  id: string;
1911
1915
  source: string;
1912
1916
  target: string;
1913
1917
  type?: string;
1914
1918
  label?: string;
1919
+ /** Layered layout: arrowhead placement (default `forward`). */
1920
+ arrow?: RelationshipGraphArrow;
1921
+ /** Layered layout: always draw this edge's label, whatever the label policy. */
1922
+ emphasis?: boolean;
1915
1923
  }
1916
1924
  interface PositionedRelationshipNode extends RelationshipGraphNode {
1917
1925
  x: number;
@@ -1927,11 +1935,157 @@ declare function boundRelationshipGraph(nodes: RelationshipGraphNode[], edges: R
1927
1935
  declare function relationshipNeighbors(nodeId: string, edges: RelationshipGraphEdge[]): string[];
1928
1936
  declare function layoutRelationshipGraph(nodes: RelationshipGraphNode[], edges: RelationshipGraphEdge[], rootId?: string): PositionedRelationshipNode[];
1929
1937
  declare function traverseRelationshipNode(nodes: RelationshipGraphNode[], currentId: string | undefined, direction: -1 | 1): string | undefined;
1938
+ type LayeredEdgeKind = 'forward' | 'lateral' | 'cycle';
1939
+ interface LayeredLayoutOptions {
1940
+ rootId?: string;
1941
+ /** Minimum sibling group size that collapses into a cluster. Default 6; 0 disables. */
1942
+ clusterThreshold?: number;
1943
+ expandedClusterIds?: ReadonlySet<string>;
1944
+ density?: 'compact' | 'standard';
1945
+ }
1946
+ interface RelationshipGraphCluster {
1947
+ id: string;
1948
+ parentId: string;
1949
+ depth: number;
1950
+ type?: string;
1951
+ edgeType?: string;
1952
+ edgeLabel?: string;
1953
+ members: RelationshipGraphNode[];
1954
+ }
1955
+ interface LayeredItem {
1956
+ /** Node id, or cluster id for a collapsed cluster. */
1957
+ id: string;
1958
+ kind: 'node' | 'cluster';
1959
+ node?: RelationshipGraphNode;
1960
+ cluster?: RelationshipGraphCluster;
1961
+ depth: number;
1962
+ /** Position within its column (0-based, top to bottom). */
1963
+ index: number;
1964
+ x: number;
1965
+ y: number;
1966
+ width: number;
1967
+ height: number;
1968
+ /** Forward parents / children as item ids, in column order. */
1969
+ parents: string[];
1970
+ children: string[];
1971
+ /** Set on the first member of an expanded cluster: the group its collapse control belongs to. */
1972
+ expandedGroup?: RelationshipGraphCluster;
1973
+ /** True when a lateral or cycle edge touches this node. */
1974
+ inCycle: boolean;
1975
+ /** Edges (any kind) touching this item. */
1976
+ degree: number;
1977
+ }
1978
+ interface RoutedEdge {
1979
+ id: string;
1980
+ /** Item ids (a cluster id when the edge enters a collapsed cluster). */
1981
+ source: string;
1982
+ target: string;
1983
+ kind: LayeredEdgeKind;
1984
+ /** Original edge ids drawn by this path (several for a cluster). */
1985
+ edgeIds: string[];
1986
+ type?: string;
1987
+ label?: string;
1988
+ arrow: RelationshipGraphArrow;
1989
+ emphasis: boolean;
1990
+ path: string;
1991
+ labelX: number;
1992
+ labelY: number;
1993
+ /** Arrowhead tip and the direction it points in (radians, 0 = pointing right). */
1994
+ arrowX: number;
1995
+ arrowY: number;
1996
+ arrowAngle: number;
1997
+ /** Label policy `auto` shows this label without interaction. */
1998
+ autoLabel: boolean;
1999
+ /** The label wrapped to fit the column gap (at most two lines). */
2000
+ labelLines: string[];
2001
+ }
2002
+ interface LayeredColumn {
2003
+ depth: number;
2004
+ x: number;
2005
+ /** Underlying nodes in the column, cluster members included. */
2006
+ count: number;
2007
+ }
2008
+ interface LayeredLayout {
2009
+ rootId: string | undefined;
2010
+ items: LayeredItem[];
2011
+ edges: RoutedEdge[];
2012
+ clusters: RelationshipGraphCluster[];
2013
+ columns: LayeredColumn[];
2014
+ /** Node id → id of the item that currently draws it (itself, or its cluster). */
2015
+ itemOf: Record<string, string>;
2016
+ width: number;
2017
+ height: number;
2018
+ nodeWidth: number;
2019
+ nodeHeight: number;
2020
+ headerHeight: number;
2021
+ }
2022
+ /** Word-wrap a label into at most two lines that fit `width`; overlong words end in an ellipsis. */
2023
+ declare function wrapEdgeLabel(label: string, width: number): string[];
2024
+ interface LayeredEdgeClassification {
2025
+ depthById: Map<string, number>;
2026
+ kindById: Map<string, LayeredEdgeKind>;
2027
+ }
2028
+ /**
2029
+ * Column (depth) for every node and a kind for every drawable edge.
2030
+ * Supplied `node.depth` wins; otherwise BFS from the root along source→target.
2031
+ * Nodes the BFS cannot reach go to a trailing column. Self-loops and edges with
2032
+ * a missing endpoint get no kind and are not drawn.
2033
+ */
2034
+ declare function classifyLayeredEdges(nodes: RelationshipGraphNode[], edges: RelationshipGraphEdge[], rootId?: string | undefined): LayeredEdgeClassification;
2035
+ declare function clusterIdFor(parentId: string, type: string | undefined, edgeType: string | undefined): string;
2036
+ /** Layered, clustered, crossing-reduced layout for `RelationshipGraph layout="layered"`. */
2037
+ declare function layoutLayeredGraph(nodes: RelationshipGraphNode[], edges: RelationshipGraphEdge[], options?: LayeredLayoutOptions): LayeredLayout;
2038
+ type LayeredNavigationKey = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'Home' | 'End';
2039
+ /** Keyboard traversal over a layered layout: ←/→ along forward edges, ↑/↓ within a column. */
2040
+ declare function layeredNeighbor(layout: LayeredLayout, currentId: string | undefined, key: LayeredNavigationKey): string | undefined;
1930
2041
 
1931
2042
  interface RelationshipGraphLegendItem {
1932
2043
  id: string;
1933
2044
  label: string;
1934
2045
  }
2046
+ /** Every visible or announced string. Pass translations; English defaults fill the gaps. */
2047
+ interface RelationshipGraphLabels {
2048
+ graph: string;
2049
+ controls: string;
2050
+ list: string;
2051
+ listHeading: string;
2052
+ legend: string;
2053
+ panLeft: string;
2054
+ panRight: string;
2055
+ panUp: string;
2056
+ panDown: string;
2057
+ left: string;
2058
+ right: string;
2059
+ up: string;
2060
+ down: string;
2061
+ zoomIn: string;
2062
+ zoomOut: string;
2063
+ fit: string;
2064
+ reset: string;
2065
+ zoomLevel: (percent: number) => string;
2066
+ bounded: (shown: number, omitted: number) => string;
2067
+ graphSummary: (nodes: number, edges: number) => string;
2068
+ relationship: string;
2069
+ conflict: string;
2070
+ connectedTo: (names: string) => string;
2071
+ noConnections: string;
2072
+ expandNeighbors: string;
2073
+ openDetails: string;
2074
+ /** Layered column header, e.g. "2 hops · 14". */
2075
+ column: (depth: number, count: number) => string;
2076
+ cluster: (count: number, type: string | undefined, edgeLabel: string | undefined) => string;
2077
+ expandCluster: string;
2078
+ collapseCluster: (count: number, type: string | undefined) => string;
2079
+ cycle: string;
2080
+ relationships: (count: number) => string;
2081
+ roleDescription: string;
2082
+ keyboardHint: string;
2083
+ loading: string;
2084
+ retry: string;
2085
+ emptyTitle: string;
2086
+ emptyHint: string;
2087
+ }
2088
+ declare const DEFAULT_RELATIONSHIP_GRAPH_LABELS: RelationshipGraphLabels;
1935
2089
  interface RelationshipGraphProps {
1936
2090
  nodes: RelationshipGraphNode[];
1937
2091
  edges: RelationshipGraphEdge[];
@@ -1939,6 +2093,7 @@ interface RelationshipGraphProps {
1939
2093
  onSelect?: (node: RelationshipGraphNode) => void;
1940
2094
  onExpandNeighbors?: (node: RelationshipGraphNode) => void;
1941
2095
  onOpenDetails?: (node: RelationshipGraphNode) => void;
2096
+ /** Node budget. Default 40 (radial) or 400 (layered). */
1942
2097
  maxNodes?: number;
1943
2098
  density?: 'compact' | 'standard';
1944
2099
  highlightedNodeIds?: ReadonlySet<string>;
@@ -1950,9 +2105,39 @@ interface RelationshipGraphProps {
1950
2105
  error?: string;
1951
2106
  onRetry?: () => void;
1952
2107
  className?: string;
2108
+ /** `radial` (default) rings around the selection; `layered` reads left to right by distance from `rootId`. */
2109
+ layout?: 'radial' | 'layered';
2110
+ /** Layered: the column-0 node (default: the first node). */
2111
+ rootId?: string;
2112
+ labels?: Partial<RelationshipGraphLabels>;
2113
+ /** Layered: node body. Whatever it shows must also be in `nodeAriaLabel`. */
2114
+ renderNode?: (node: RelationshipGraphNode, state: {
2115
+ selected: boolean;
2116
+ dimmed: boolean;
2117
+ }) => ReactNode;
2118
+ /** Layered: full accessible name for a node. */
2119
+ nodeAriaLabel?: (node: RelationshipGraphNode) => string;
2120
+ /** Layered: cluster body. Whatever it shows must also be in the cluster's accessible name. */
2121
+ renderCluster?: (cluster: RelationshipGraphCluster) => ReactNode;
2122
+ /** Layered: minimum leaf-sibling group that collapses into a cluster. Default 6; 0 disables. */
2123
+ clusterThreshold?: number;
2124
+ /** Layered: controlled set of expanded cluster ids. */
2125
+ expandedClusterIds?: ReadonlySet<string>;
2126
+ onToggleCluster?: (clusterId: string, expanded: boolean) => void;
2127
+ /** Layered: nodes drawn muted (state must also be stated in text by the consumer). */
2128
+ dimmedNodeIds?: ReadonlySet<string>;
2129
+ /** Layered: when edge labels show. `auto` = emphasised edges, small fan-outs, and edges of the active node. */
2130
+ edgeLabels?: 'auto' | 'always' | 'never';
2131
+ /** Render the built-in equivalent list. Set false ONLY when an equivalent list is rendered in the same region. */
2132
+ showList?: boolean;
2133
+ /** Layered: CSS length for the viewport height. */
2134
+ height?: string;
2135
+ /** Layered: controlled roving focus. */
2136
+ focusId?: string;
2137
+ onFocusChange?: (id: string) => void;
1953
2138
  }
1954
2139
  /** Bounded, deterministic SVG relationship view with an equivalent accessible list. */
1955
- declare function RelationshipGraph({ nodes, edges, selectedId, onSelect, onExpandNeighbors, onOpenDetails, maxNodes, density, highlightedNodeIds, conflictedNodeIds, highlightedEdgeIds, conflictedEdgeIds, legend, loading, error, onRetry, className, }: RelationshipGraphProps): react.JSX.Element;
2140
+ declare function RelationshipGraph(props: RelationshipGraphProps): react.JSX.Element;
1956
2141
 
1957
2142
  interface MatchReviewField {
1958
2143
  id: string;
@@ -2137,4 +2322,4 @@ declare function hsvToHex(value: HsvColor): string;
2137
2322
  declare function contrastRatio(background: string, foreground: string): number | undefined;
2138
2323
  declare function meetsContrast(background: string, foreground: string, minimum?: number): boolean;
2139
2324
 
2140
- export { type AccessStateProps, Alert, type AlertProps, type AlertTone, type Align, AppShell, type AppShellProps, type AppliedBrandProfileSnapshot, type AsyncOperationState, AsyncOperationStatus, type AsyncOperationStatusProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type BoundedRelationshipGraph, type BrandProfile, BrandProfileEditor, type BrandProfileEditorProps, type BrandProfileLogo, type BrandProfileTypography, BrandProfiles, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BuilderCanvas, type BuilderCanvasItem, type BuilderCanvasProps, type BuilderPaletteItem, BulkBar, type BulkBarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type CalendarDay, Card, CardLink, type CardLinkProps, type CardProps, CellStrong, CellSub, Checkbox, type CheckboxProps, CollapsibleSection, type CollapsibleSectionProps, ColorPicker, type ColorPickerProps, type ColumnFilter, Combobox, type ComboboxOption, type ComboboxProps, CommandGroup, type CommandGroupProps, CommandItem, type CommandItemProps, CommandPalette, type CommandPaletteProps, Comment, type CommentProps, Comments, type CommentsProps, Composer, ComposerBar, type ComposerBarProps, type ComposerProps, ConfirmDialog, type ConfirmDialogProps, ContentList, ContentListItem, type ContentListItemProps, type ContentListProps, DateRangePicker, type DateRangePickerProps, type DateRangeValue, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListItem, type DescriptionListProps, DetailLayout, type DetailLayoutProps, DetailPage, type DetailPageMetric, type DetailPageProps, type DetailPageTab, type DiffEntry, type DiffKind, type DiffResolution, type DiffSummary, DiffViewer, type DiffViewerProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, EventRow, type EventRowProps, ExpandToggle, type ExpandToggleProps, FeaturedRundown, FeaturedRundownItem, type FeaturedRundownItemProps, type FeaturedRundownProps, FeaturedStage, type FeaturedStageProps, Field, type FieldProps, type FilterKind, type FilterOp, type FilterOption, FilterPopover, type FilterPopoverProps, FilteredEmptyState, type FlatNode, Flow, FlowNode, type FlowNodeProps, type FlowNodeState, type FlowProps, type FlowVariant, ForbiddenState, Highlighted, type HighlightedProps, type HsvColor, Inbox, InboxDetail, type InboxDetailProps, InboxItem, type InboxItemProps, InboxList, type InboxListProps, type InboxProps, Input, InputGroup, type InputGroupProps, type InputProps, type JsonPrimitive, type JsonValue, Kanban, KanbanCard, type KanbanCardProps, KanbanColumn, type KanbanColumnProps, type KanbanMoveDirection, type KanbanProps, Label, type LabelProps, LicensePositionBar, type LicensePositionBarProps, List, ListItem, type ListItemProps, type ListProps, LoadingState, type LoadingStateProps, Mark, type MarkProps, type MatchBulkResult, MatchReview, type MatchReviewAction, type MatchReviewCandidate, type MatchReviewField, type MatchReviewProps, Meter, type MeterProps, type MeterTone, MetricInput, type MetricInputProps, Modal, type ModalProps, type NavFavouriteItem, NavFavourites, type NavFavouritesLabels, type NavFavouritesProps, NavGroup, type NavGroupProps, NavItem, type NavItemProps, NewsLead, type NewsLeadProps, NotFoundState, Note, type NoteProps, type NoteTone, NoticeQueue, type NoticeQueueProps, PageHeader, type PageHeaderProps, PageIntro, type PageIntroProps, Pagination, type PaginationProps, Peek, type PeekProps, type PillTone, type PillTreatment, Pipeline, type PipelineProps, PipelineStage, type PipelineStageProps, type PipelineStageState, type Placement, Popover, type PopoverProps, type PositionOptions, type PositionResult, type PositionedRelationshipNode, type Primitive, Progress, type ProgressProps, PromptDialog, type PromptDialogProps, Prose, type ProseProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type Rect, type RelatedLinkItem, RelatedLinks, type RelatedLinksProps, RelationshipGraph, type RelationshipGraphEdge, type RelationshipGraphLegendItem, type RelationshipGraphNode, type RelationshipGraphProps, RelativeTime, type RelativeTimeFormatContext, type RelativeTimeProps, type RelativeTimeUnit, type RelativeTimeValue, ResourceGrid, type ResourceGridProps, type RgbColor, type Row, RowAction, type RowActionProps, RowActions, type RowActionsProps, type RuleAction, type RuleActionDefinition, RuleBuilder, type RuleBuilderProps, type RuleCondition, type RuleDefinition, type RuleFieldDefinition, type RuleGroup, type RuleOperatorDefinition, type RuleValidationIssue, type RuleValueEditorProps, type SavedViewItem, SavedViewMenu, type SavedViewMenuProps, SchedulingCalendar, type SchedulingCalendarEntry, type SchedulingCalendarOverlay, type SchedulingCalendarProps, type SchedulingCalendarView, type SchedulingEntryState, type SchedulingOverlayKind, SectionHead, type SectionHeadProps, type Segment, Segmented, SegmentedOption, type SegmentedOptionProps, type SegmentedProps, Select, type SelectAllState, type SelectProps, type ShellNav, type Side, Sidebar, type SidebarProps, SidebarSection, type SidebarSectionProps, type Size, Skeleton, type SkeletonProps, type SortDir, type SortDirection, type SortKey, Spinner, type SpinnerProps, StarButton, type StarButtonProps, Stat, StatLine, type StatLineItem, type StatLineProps, type StatProps, type StatTrend, type StateVariant, StatusPill, type StatusPillProps, StatusRow, type StatusRowProps, SubNavItem, type SubNavItemProps, Switch, type SwitchProps, Tab, TabPanel, type TabPanelProps, type TabProps, Table, type TableDensity, type TableProps, TableWrap, type TableWrapProps, Tabs, type TabsProps, Td, type TdProps, Textarea, type TextareaProps, Th, type ThProps, Timeline, TimelineItem, type TimelineItemProps, type TimelineProps, Toast, type ToastProps, type ToastTone, Toaster, type ToasterProps, ToggleRow, type ToggleRowProps, Tooltip, type TooltipProps, Tr, type TrProps, Tree, type TreeLike, type TreeNavAction, type TreeNodeData, type TreeNodeProps, type TreeProps, type UseAnchoredPositionOptions, type UseTableOptions, type UseTableResult, type UseVirtualRowsOptions, type UseVirtualRowsResult, UserChip, type UserChipProps, ViewMenu, type ViewMenuColumn, type ViewMenuProps, type ViewState, type VirtualWindow, type ZonedDateSpan, addCalendarDays, addCalendarMonths, appendRuleNode, applyBrandProfile, applyFilters, boundRelationshipGraph, buildMonthGrid, buildThreeWayDiff, clampMetricValue, clampWidth, computePosition, contrastRatio, cx, enumerateDateSpan, filterComboboxOptions, findRuleNodeDepth, flattenTree, hexToRgb, highlightSegments, hsvToHex, hsvToRgb, isDateInRange, isDateUnavailable, isRuleGroup, layoutRelationshipGraph, mapRuleGroup, matchFilter, meetsContrast, mergePinned, moveRuleNode, multiSort, nextSortDir, normalizeHex, parseDateValue, parseMetricValue, parseView, relationshipNeighbors, relativeTimeValue, removeRuleNode, reorder, restoreBrandProfile, rgbToHex, rgbToHsv, ruleDepth, searchRows, selectAllState, selectRangeDate, serializeView, shouldVirtualize, startOfMonth, stepMetricValue, summarizeDiff, summarizeRule, toDateKey, toggleId, togglePage, toggleSort, traverseRelationshipNode, treeNav, useAnchoredPosition, useDialog, useTable, useVirtualRows, validateRuleDefinition, virtualWindow, zonedDateKey, zonedDateSpan };
2325
+ export { type AccessStateProps, Alert, type AlertProps, type AlertTone, type Align, AppShell, type AppShellProps, type AppliedBrandProfileSnapshot, type AsyncOperationState, AsyncOperationStatus, type AsyncOperationStatusProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, type BoundedRelationshipGraph, type BrandProfile, BrandProfileEditor, type BrandProfileEditorProps, type BrandProfileLogo, type BrandProfileTypography, BrandProfiles, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BuilderCanvas, type BuilderCanvasItem, type BuilderCanvasProps, type BuilderPaletteItem, BulkBar, type BulkBarProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type CalendarDay, Card, CardLink, type CardLinkProps, type CardProps, CellStrong, CellSub, Checkbox, type CheckboxProps, CollapsibleSection, type CollapsibleSectionProps, ColorPicker, type ColorPickerProps, type ColumnFilter, Combobox, type ComboboxOption, type ComboboxProps, CommandGroup, type CommandGroupProps, CommandItem, type CommandItemProps, CommandPalette, type CommandPaletteProps, Comment, type CommentProps, Comments, type CommentsProps, Composer, ComposerBar, type ComposerBarProps, type ComposerProps, ConfirmDialog, type ConfirmDialogProps, ContentList, ContentListItem, type ContentListItemProps, type ContentListProps, DEFAULT_RELATIONSHIP_GRAPH_LABELS, DateRangePicker, type DateRangePickerProps, type DateRangeValue, DescriptionItem, type DescriptionItemProps, DescriptionList, type DescriptionListItem, type DescriptionListProps, DetailLayout, type DetailLayoutProps, DetailPage, type DetailPageMetric, type DetailPageProps, type DetailPageTab, type DiffEntry, type DiffKind, type DiffResolution, type DiffSummary, DiffViewer, type DiffViewerProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, ErrorState, type ErrorStateProps, EventRow, type EventRowProps, ExpandToggle, type ExpandToggleProps, FeaturedRundown, FeaturedRundownItem, type FeaturedRundownItemProps, type FeaturedRundownProps, FeaturedStage, type FeaturedStageProps, Field, type FieldProps, type FilterKind, type FilterOp, type FilterOption, FilterPopover, type FilterPopoverProps, FilteredEmptyState, type FlatNode, Flow, FlowNode, type FlowNodeProps, type FlowNodeState, type FlowProps, type FlowVariant, ForbiddenState, Highlighted, type HighlightedProps, type HsvColor, Inbox, InboxDetail, type InboxDetailProps, InboxItem, type InboxItemProps, InboxList, type InboxListProps, type InboxProps, Input, InputGroup, type InputGroupProps, type InputProps, type JsonPrimitive, type JsonValue, Kanban, KanbanCard, type KanbanCardProps, KanbanColumn, type KanbanColumnProps, type KanbanMoveDirection, type KanbanProps, Label, type LabelProps, type LayeredColumn, type LayeredEdgeClassification, type LayeredEdgeKind, type LayeredItem, type LayeredLayout, type LayeredLayoutOptions, type LayeredNavigationKey, LicensePositionBar, type LicensePositionBarProps, List, ListItem, type ListItemProps, type ListProps, LoadingState, type LoadingStateProps, Mark, type MarkProps, type MatchBulkResult, MatchReview, type MatchReviewAction, type MatchReviewCandidate, type MatchReviewField, type MatchReviewProps, Meter, type MeterProps, type MeterTone, MetricInput, type MetricInputProps, Modal, type ModalProps, type NavFavouriteItem, NavFavourites, type NavFavouritesLabels, type NavFavouritesProps, NavGroup, type NavGroupProps, NavItem, type NavItemProps, NewsLead, type NewsLeadProps, NotFoundState, Note, type NoteProps, type NoteTone, NoticeQueue, type NoticeQueueProps, PageHeader, type PageHeaderProps, PageIntro, type PageIntroProps, Pagination, type PaginationProps, Peek, type PeekProps, type PillTone, type PillTreatment, Pipeline, type PipelineProps, PipelineStage, type PipelineStageProps, type PipelineStageState, type Placement, Popover, type PopoverProps, type PositionOptions, type PositionResult, type PositionedRelationshipNode, type Primitive, Progress, type ProgressProps, PromptDialog, type PromptDialogProps, Prose, type ProseProps, Radio, RadioGroup, type RadioGroupProps, type RadioProps, type Rect, type RelatedLinkItem, RelatedLinks, type RelatedLinksProps, RelationshipGraph, type RelationshipGraphArrow, type RelationshipGraphCluster, type RelationshipGraphEdge, type RelationshipGraphLabels, type RelationshipGraphLegendItem, type RelationshipGraphNode, type RelationshipGraphProps, RelativeTime, type RelativeTimeFormatContext, type RelativeTimeProps, type RelativeTimeUnit, type RelativeTimeValue, ResourceGrid, type ResourceGridProps, type RgbColor, type RoutedEdge, type Row, RowAction, type RowActionProps, RowActions, type RowActionsProps, type RuleAction, type RuleActionDefinition, RuleBuilder, type RuleBuilderProps, type RuleCondition, type RuleDefinition, type RuleFieldDefinition, type RuleGroup, type RuleOperatorDefinition, type RuleValidationIssue, type RuleValueEditorProps, type SavedViewItem, SavedViewMenu, type SavedViewMenuProps, SchedulingCalendar, type SchedulingCalendarEntry, type SchedulingCalendarOverlay, type SchedulingCalendarProps, type SchedulingCalendarView, type SchedulingEntryState, type SchedulingOverlayKind, SectionHead, type SectionHeadProps, type Segment, Segmented, SegmentedOption, type SegmentedOptionProps, type SegmentedProps, Select, type SelectAllState, type SelectProps, type ShellNav, type Side, Sidebar, type SidebarProps, SidebarSection, type SidebarSectionProps, type Size, Skeleton, type SkeletonProps, type SortDir, type SortDirection, type SortKey, Spinner, type SpinnerProps, StarButton, type StarButtonProps, Stat, StatLine, type StatLineItem, type StatLineProps, type StatProps, type StatTrend, type StateVariant, StatusPill, type StatusPillProps, StatusRow, type StatusRowProps, SubNavItem, type SubNavItemProps, Switch, type SwitchProps, Tab, TabPanel, type TabPanelProps, type TabProps, Table, type TableDensity, type TableProps, TableWrap, type TableWrapProps, Tabs, type TabsProps, Td, type TdProps, Textarea, type TextareaProps, Th, type ThProps, Timeline, TimelineItem, type TimelineItemProps, type TimelineProps, Toast, type ToastProps, type ToastTone, Toaster, type ToasterProps, ToggleRow, type ToggleRowProps, Tooltip, type TooltipProps, Tr, type TrProps, Tree, type TreeLike, type TreeNavAction, type TreeNodeData, type TreeNodeProps, type TreeProps, type UseAnchoredPositionOptions, type UseTableOptions, type UseTableResult, type UseVirtualRowsOptions, type UseVirtualRowsResult, UserChip, type UserChipProps, ViewMenu, type ViewMenuColumn, type ViewMenuProps, type ViewState, type VirtualWindow, type ZonedDateSpan, addCalendarDays, addCalendarMonths, appendRuleNode, applyBrandProfile, applyFilters, boundRelationshipGraph, buildMonthGrid, buildThreeWayDiff, clampMetricValue, clampWidth, classifyLayeredEdges, clusterIdFor, computePosition, contrastRatio, cx, enumerateDateSpan, filterComboboxOptions, findRuleNodeDepth, flattenTree, hexToRgb, highlightSegments, hsvToHex, hsvToRgb, isDateInRange, isDateUnavailable, isRuleGroup, layeredNeighbor, layoutLayeredGraph, layoutRelationshipGraph, mapRuleGroup, matchFilter, meetsContrast, mergePinned, moveRuleNode, multiSort, nextSortDir, normalizeHex, parseDateValue, parseMetricValue, parseView, relationshipNeighbors, relativeTimeValue, removeRuleNode, reorder, restoreBrandProfile, rgbToHex, rgbToHsv, ruleDepth, searchRows, selectAllState, selectRangeDate, serializeView, shouldVirtualize, startOfMonth, stepMetricValue, summarizeDiff, summarizeRule, toDateKey, toggleId, togglePage, toggleSort, traverseRelationshipNode, treeNav, useAnchoredPosition, useDialog, useTable, useVirtualRows, validateRuleDefinition, virtualWindow, wrapEdgeLabel, zonedDateKey, zonedDateSpan };
package/dist/index.d.ts CHANGED
@@ -72,8 +72,8 @@ export { BuilderCanvas, BuilderCanvasItem, BuilderCanvasProps, BuilderPaletteIte
72
72
  export { SchedulingCalendar, SchedulingCalendarEntry, SchedulingCalendarOverlay, SchedulingCalendarProps, SchedulingCalendarView, SchedulingEntryState, SchedulingOverlayKind } from './components/SchedulingCalendar.js';
73
73
  export { DateRangePicker, DateRangePickerProps } from './components/DateRangePicker.js';
74
74
  export { CalendarDay, DateRangeValue, ZonedDateSpan, addCalendarDays, addCalendarMonths, buildMonthGrid, enumerateDateSpan, isDateInRange, isDateUnavailable, selectRangeDate, startOfMonth, toDateKey, zonedDateKey, zonedDateSpan } from './calendar-model.js';
75
- export { RelationshipGraph, RelationshipGraphLegendItem, RelationshipGraphProps } from './components/RelationshipGraph.js';
76
- export { BoundedRelationshipGraph, PositionedRelationshipNode, RelationshipGraphEdge, RelationshipGraphNode, boundRelationshipGraph, layoutRelationshipGraph, relationshipNeighbors, traverseRelationshipNode } from './relationship-graph-model.js';
75
+ export { DEFAULT_RELATIONSHIP_GRAPH_LABELS, RelationshipGraph, RelationshipGraphLabels, RelationshipGraphLegendItem, RelationshipGraphProps } from './components/RelationshipGraph.js';
76
+ export { BoundedRelationshipGraph, LayeredColumn, LayeredEdgeClassification, LayeredEdgeKind, LayeredItem, LayeredLayout, LayeredLayoutOptions, LayeredNavigationKey, PositionedRelationshipNode, RelationshipGraphArrow, RelationshipGraphCluster, RelationshipGraphEdge, RelationshipGraphNode, RoutedEdge, boundRelationshipGraph, classifyLayeredEdges, clusterIdFor, layeredNeighbor, layoutLayeredGraph, layoutRelationshipGraph, relationshipNeighbors, traverseRelationshipNode, wrapEdgeLabel } from './relationship-graph-model.js';
77
77
  export { MatchBulkResult, MatchReview, MatchReviewAction, MatchReviewCandidate, MatchReviewField, MatchReviewProps } from './components/MatchReview.js';
78
78
  export { MetricInput, MetricInputProps } from './components/MetricInput.js';
79
79
  export { clampMetricValue, parseMetricValue, stepMetricValue } from './metric-model.js';
package/dist/index.js CHANGED
@@ -121,8 +121,8 @@ import {
121
121
  zonedDateKey,
122
122
  zonedDateSpan
123
123
  } from "./calendar-model.js";
124
- import { RelationshipGraph } from "./components/RelationshipGraph.js";
125
- import { boundRelationshipGraph, layoutRelationshipGraph, relationshipNeighbors, traverseRelationshipNode } from "./relationship-graph-model.js";
124
+ import { RelationshipGraph, DEFAULT_RELATIONSHIP_GRAPH_LABELS } from "./components/RelationshipGraph.js";
125
+ import { boundRelationshipGraph, layoutRelationshipGraph, relationshipNeighbors, traverseRelationshipNode, classifyLayeredEdges, clusterIdFor, layeredNeighbor, layoutLayeredGraph, wrapEdgeLabel } from "./relationship-graph-model.js";
126
126
  import { MatchReview } from "./components/MatchReview.js";
127
127
  import { MetricInput } from "./components/MetricInput.js";
128
128
  import { clampMetricValue, parseMetricValue, stepMetricValue } from "./metric-model.js";
@@ -163,6 +163,7 @@ export {
163
163
  ConfirmDialog,
164
164
  ContentList,
165
165
  ContentListItem,
166
+ DEFAULT_RELATIONSHIP_GRAPH_LABELS,
166
167
  DateRangePicker,
167
168
  DescriptionItem,
168
169
  DescriptionList,
@@ -272,6 +273,8 @@ export {
272
273
  buildMonthGrid,
273
274
  buildThreeWayDiff,
274
275
  clampMetricValue,
276
+ classifyLayeredEdges,
277
+ clusterIdFor,
275
278
  computePosition,
276
279
  contrastRatio,
277
280
  cx,
@@ -285,6 +288,8 @@ export {
285
288
  isDateInRange,
286
289
  isDateUnavailable,
287
290
  isRuleGroup,
291
+ layeredNeighbor,
292
+ layoutLayeredGraph,
288
293
  layoutRelationshipGraph,
289
294
  mapRuleGroup,
290
295
  meetsContrast,
@@ -312,6 +317,7 @@ export {
312
317
  useTable,
313
318
  useVirtualRows,
314
319
  validateRuleDefinition,
320
+ wrapEdgeLabel,
315
321
  zonedDateKey,
316
322
  zonedDateSpan
317
323
  };
@@ -5,13 +5,21 @@ interface RelationshipGraphNode {
5
5
  description?: string;
6
6
  x?: number;
7
7
  y?: number;
8
+ /** Layered layout: the node's column. Omitted → BFS distance from the root along source→target. */
9
+ depth?: number;
8
10
  }
11
+ /** Where an edge's arrowhead sits: at the target (default), at the source, or nowhere. */
12
+ type RelationshipGraphArrow = 'forward' | 'backward' | 'none';
9
13
  interface RelationshipGraphEdge {
10
14
  id: string;
11
15
  source: string;
12
16
  target: string;
13
17
  type?: string;
14
18
  label?: string;
19
+ /** Layered layout: arrowhead placement (default `forward`). */
20
+ arrow?: RelationshipGraphArrow;
21
+ /** Layered layout: always draw this edge's label, whatever the label policy. */
22
+ emphasis?: boolean;
15
23
  }
16
24
  interface PositionedRelationshipNode extends RelationshipGraphNode {
17
25
  x: number;
@@ -27,5 +35,108 @@ declare function boundRelationshipGraph(nodes: RelationshipGraphNode[], edges: R
27
35
  declare function relationshipNeighbors(nodeId: string, edges: RelationshipGraphEdge[]): string[];
28
36
  declare function layoutRelationshipGraph(nodes: RelationshipGraphNode[], edges: RelationshipGraphEdge[], rootId?: string): PositionedRelationshipNode[];
29
37
  declare function traverseRelationshipNode(nodes: RelationshipGraphNode[], currentId: string | undefined, direction: -1 | 1): string | undefined;
38
+ type LayeredEdgeKind = 'forward' | 'lateral' | 'cycle';
39
+ interface LayeredLayoutOptions {
40
+ rootId?: string;
41
+ /** Minimum sibling group size that collapses into a cluster. Default 6; 0 disables. */
42
+ clusterThreshold?: number;
43
+ expandedClusterIds?: ReadonlySet<string>;
44
+ density?: 'compact' | 'standard';
45
+ }
46
+ interface RelationshipGraphCluster {
47
+ id: string;
48
+ parentId: string;
49
+ depth: number;
50
+ type?: string;
51
+ edgeType?: string;
52
+ edgeLabel?: string;
53
+ members: RelationshipGraphNode[];
54
+ }
55
+ interface LayeredItem {
56
+ /** Node id, or cluster id for a collapsed cluster. */
57
+ id: string;
58
+ kind: 'node' | 'cluster';
59
+ node?: RelationshipGraphNode;
60
+ cluster?: RelationshipGraphCluster;
61
+ depth: number;
62
+ /** Position within its column (0-based, top to bottom). */
63
+ index: number;
64
+ x: number;
65
+ y: number;
66
+ width: number;
67
+ height: number;
68
+ /** Forward parents / children as item ids, in column order. */
69
+ parents: string[];
70
+ children: string[];
71
+ /** Set on the first member of an expanded cluster: the group its collapse control belongs to. */
72
+ expandedGroup?: RelationshipGraphCluster;
73
+ /** True when a lateral or cycle edge touches this node. */
74
+ inCycle: boolean;
75
+ /** Edges (any kind) touching this item. */
76
+ degree: number;
77
+ }
78
+ interface RoutedEdge {
79
+ id: string;
80
+ /** Item ids (a cluster id when the edge enters a collapsed cluster). */
81
+ source: string;
82
+ target: string;
83
+ kind: LayeredEdgeKind;
84
+ /** Original edge ids drawn by this path (several for a cluster). */
85
+ edgeIds: string[];
86
+ type?: string;
87
+ label?: string;
88
+ arrow: RelationshipGraphArrow;
89
+ emphasis: boolean;
90
+ path: string;
91
+ labelX: number;
92
+ labelY: number;
93
+ /** Arrowhead tip and the direction it points in (radians, 0 = pointing right). */
94
+ arrowX: number;
95
+ arrowY: number;
96
+ arrowAngle: number;
97
+ /** Label policy `auto` shows this label without interaction. */
98
+ autoLabel: boolean;
99
+ /** The label wrapped to fit the column gap (at most two lines). */
100
+ labelLines: string[];
101
+ }
102
+ interface LayeredColumn {
103
+ depth: number;
104
+ x: number;
105
+ /** Underlying nodes in the column, cluster members included. */
106
+ count: number;
107
+ }
108
+ interface LayeredLayout {
109
+ rootId: string | undefined;
110
+ items: LayeredItem[];
111
+ edges: RoutedEdge[];
112
+ clusters: RelationshipGraphCluster[];
113
+ columns: LayeredColumn[];
114
+ /** Node id → id of the item that currently draws it (itself, or its cluster). */
115
+ itemOf: Record<string, string>;
116
+ width: number;
117
+ height: number;
118
+ nodeWidth: number;
119
+ nodeHeight: number;
120
+ headerHeight: number;
121
+ }
122
+ /** Word-wrap a label into at most two lines that fit `width`; overlong words end in an ellipsis. */
123
+ declare function wrapEdgeLabel(label: string, width: number): string[];
124
+ interface LayeredEdgeClassification {
125
+ depthById: Map<string, number>;
126
+ kindById: Map<string, LayeredEdgeKind>;
127
+ }
128
+ /**
129
+ * Column (depth) for every node and a kind for every drawable edge.
130
+ * Supplied `node.depth` wins; otherwise BFS from the root along source→target.
131
+ * Nodes the BFS cannot reach go to a trailing column. Self-loops and edges with
132
+ * a missing endpoint get no kind and are not drawn.
133
+ */
134
+ declare function classifyLayeredEdges(nodes: RelationshipGraphNode[], edges: RelationshipGraphEdge[], rootId?: string | undefined): LayeredEdgeClassification;
135
+ declare function clusterIdFor(parentId: string, type: string | undefined, edgeType: string | undefined): string;
136
+ /** Layered, clustered, crossing-reduced layout for `RelationshipGraph layout="layered"`. */
137
+ declare function layoutLayeredGraph(nodes: RelationshipGraphNode[], edges: RelationshipGraphEdge[], options?: LayeredLayoutOptions): LayeredLayout;
138
+ type LayeredNavigationKey = 'ArrowUp' | 'ArrowDown' | 'ArrowLeft' | 'ArrowRight' | 'Home' | 'End';
139
+ /** Keyboard traversal over a layered layout: ←/→ along forward edges, ↑/↓ within a column. */
140
+ declare function layeredNeighbor(layout: LayeredLayout, currentId: string | undefined, key: LayeredNavigationKey): string | undefined;
30
141
 
31
- export { type BoundedRelationshipGraph, type PositionedRelationshipNode, type RelationshipGraphEdge, type RelationshipGraphNode, boundRelationshipGraph, layoutRelationshipGraph, relationshipNeighbors, traverseRelationshipNode };
142
+ export { type BoundedRelationshipGraph, type LayeredColumn, type LayeredEdgeClassification, type LayeredEdgeKind, type LayeredItem, type LayeredLayout, type LayeredLayoutOptions, type LayeredNavigationKey, type PositionedRelationshipNode, type RelationshipGraphArrow, type RelationshipGraphCluster, type RelationshipGraphEdge, type RelationshipGraphNode, type RoutedEdge, boundRelationshipGraph, classifyLayeredEdges, clusterIdFor, layeredNeighbor, layoutLayeredGraph, layoutRelationshipGraph, relationshipNeighbors, traverseRelationshipNode, wrapEdgeLabel };