@mp70/react-networks 0.5.0-alpha.0 → 0.5.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/README.md +81 -20
- package/dist/index.css +45 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +383 -156
- package/dist/index.d.ts +383 -156
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React$1, { Component, ReactNode, ErrorInfo } from 'react';
|
|
1
|
+
import React$1, { Component, ReactNode, ErrorInfo, CSSProperties } from 'react';
|
|
2
|
+
import * as reactflow from 'reactflow';
|
|
2
3
|
import { Node, NodeTypes, EdgeTypes, Connection, Edge, ConnectionMode, ReactFlowInstance, Viewport, FitViewOptions, NodeProps, EdgeProps } from 'reactflow';
|
|
3
4
|
|
|
4
5
|
type FibreFlowCableKind = 'simple' | 'tube';
|
|
@@ -65,7 +66,7 @@ interface NetBoxDeviceTransformOptions {
|
|
|
65
66
|
includeInterfacePorts?: boolean;
|
|
66
67
|
/** Include per-port position metadata when provided */
|
|
67
68
|
includePortPositions?: boolean;
|
|
68
|
-
/** Optional mapper for full control over interface
|
|
69
|
+
/** Optional mapper for full control over interface-to-port mapping */
|
|
69
70
|
mapInterfaceToPort?: (args: {
|
|
70
71
|
device: NetBoxDevice;
|
|
71
72
|
iface: NetBoxInterface;
|
|
@@ -78,6 +79,7 @@ interface NetBoxDevice {
|
|
|
78
79
|
device_type: {
|
|
79
80
|
id: number;
|
|
80
81
|
model: string;
|
|
82
|
+
u_height?: number;
|
|
81
83
|
manufacturer: {
|
|
82
84
|
name: string;
|
|
83
85
|
};
|
|
@@ -239,7 +241,7 @@ declare enum Width {
|
|
|
239
241
|
* Port type enumeration
|
|
240
242
|
* @public
|
|
241
243
|
*/
|
|
242
|
-
type PortType = 'ethernet' | 'fiber' | 'console' | 'mgmt' | 'usb' | 'power_ac' | 'power_c13' | 'power_c19';
|
|
244
|
+
type PortType = 'ethernet' | 'rj45' | 'fiber' | 'console' | 'mgmt' | 'usb' | 'power_ac' | 'power_c13' | 'power_c19';
|
|
243
245
|
/**
|
|
244
246
|
* Cable types used for connected network ports.
|
|
245
247
|
* @public
|
|
@@ -296,6 +298,10 @@ interface PortPosition {
|
|
|
296
298
|
xPercent?: number;
|
|
297
299
|
/** Absolute Y position as percentage (0-100) */
|
|
298
300
|
yPercent?: number;
|
|
301
|
+
/** Authored port width as a percentage of the rendered image frame */
|
|
302
|
+
widthPercent?: number;
|
|
303
|
+
/** Authored port height as a percentage of the rendered image frame */
|
|
304
|
+
heightPercent?: number;
|
|
299
305
|
}
|
|
300
306
|
/**
|
|
301
307
|
* Recommended simple port input for device and PDU rendering.
|
|
@@ -309,9 +315,11 @@ interface DevicePort {
|
|
|
309
315
|
/** Display label for the port */
|
|
310
316
|
label: string;
|
|
311
317
|
/** Front/rear device face. `back` is accepted as an alias for `rear`. */
|
|
312
|
-
face?:
|
|
318
|
+
face?: DeviceFace | 'back';
|
|
313
319
|
/** Optional block/group name (for example `Network Ports`, `QSFP28`, `Power Ports`) */
|
|
314
320
|
group?: string;
|
|
321
|
+
/** Optional source/detected family label used for visual kind inference */
|
|
322
|
+
sourceTypeLabel?: string;
|
|
315
323
|
/** Whether the port is currently connected */
|
|
316
324
|
connected?: boolean;
|
|
317
325
|
/** Type of port for styling and validation */
|
|
@@ -336,6 +344,8 @@ interface Port {
|
|
|
336
344
|
id?: string;
|
|
337
345
|
/** Display label for the port */
|
|
338
346
|
label: string;
|
|
347
|
+
/** Optional source/detected family label used for visual kind inference */
|
|
348
|
+
sourceTypeLabel?: string;
|
|
339
349
|
/** Whether the port is currently connected */
|
|
340
350
|
connected: boolean;
|
|
341
351
|
/** Type of port for styling and validation */
|
|
@@ -370,10 +380,21 @@ type NetworkNodeType = 'rack' | 'switch' | 'router' | 'server' | 'fiber' | 'patc
|
|
|
370
380
|
*/
|
|
371
381
|
type DeviceStatus = 'active' | 'inactive' | 'maintenance';
|
|
372
382
|
/**
|
|
373
|
-
* Device
|
|
383
|
+
* Device face orientations
|
|
374
384
|
* @public
|
|
375
385
|
*/
|
|
376
|
-
type
|
|
386
|
+
type DeviceFace = 'front' | 'rear';
|
|
387
|
+
type DiagramPortHandleRef = {
|
|
388
|
+
nodeId: string;
|
|
389
|
+
handleId: string;
|
|
390
|
+
};
|
|
391
|
+
type DiagramPortClickPayload = {
|
|
392
|
+
nodeId: string;
|
|
393
|
+
handleId: string;
|
|
394
|
+
groupName: string;
|
|
395
|
+
portLabel: string;
|
|
396
|
+
face: DeviceFace;
|
|
397
|
+
};
|
|
377
398
|
/**
|
|
378
399
|
* Rack rendering layout modes.
|
|
379
400
|
* @public
|
|
@@ -404,12 +425,14 @@ interface NetworkNodeDataBase extends DeviceImageOptions {
|
|
|
404
425
|
label: string;
|
|
405
426
|
/** Current status of the node/device */
|
|
406
427
|
status?: DeviceStatus | string;
|
|
407
|
-
/** Simple flat port input. Use `portGroups` / `rearPortGroups` for explicit grouped control. */
|
|
408
|
-
ports?: DevicePort[] | number;
|
|
428
|
+
/** Simple flat port input or grouped port blocks. Use `portGroups` / `rearPortGroups` for explicit grouped control. */
|
|
429
|
+
ports?: DevicePort[] | PortBlock[] | number;
|
|
409
430
|
/** Advanced grouped front port input */
|
|
410
431
|
portGroups?: PortBlock[];
|
|
411
432
|
/** Advanced grouped rear port input */
|
|
412
433
|
rearPortGroups?: PortBlock[];
|
|
434
|
+
/** Grouped rear port blocks (rack JSON alias for `rearPortGroups`) */
|
|
435
|
+
rearPorts?: PortBlock[];
|
|
413
436
|
/** List of connected node IDs */
|
|
414
437
|
connections?: string[];
|
|
415
438
|
/** NetBox integration ID */
|
|
@@ -426,10 +449,8 @@ interface NetworkNodeDataBase extends DeviceImageOptions {
|
|
|
426
449
|
uPosition?: number;
|
|
427
450
|
/** Whether this node is currently mounted inside a rack container */
|
|
428
451
|
isRackMounted?: boolean;
|
|
429
|
-
/**
|
|
430
|
-
|
|
431
|
-
/** Rack face orientation */
|
|
432
|
-
face?: DeviceView;
|
|
452
|
+
/** Front/rear orientation for devices and rack faces */
|
|
453
|
+
face?: DeviceFace;
|
|
433
454
|
/** Rack rendering layout mode */
|
|
434
455
|
rackLayout?: RackLayoutMode;
|
|
435
456
|
/** Gap in pixels between front and rear faces in split-face mode */
|
|
@@ -438,13 +459,18 @@ interface NetworkNodeDataBase extends DeviceImageOptions {
|
|
|
438
459
|
mountMode?: RackMountMode;
|
|
439
460
|
/** Device type specification */
|
|
440
461
|
deviceType?: string;
|
|
462
|
+
/**
|
|
463
|
+
* When false, device elevation renders as a status-colored block without front/rear photos.
|
|
464
|
+
* Defaults to true (show photos when URLs exist).
|
|
465
|
+
*/
|
|
466
|
+
showDeviceImages?: boolean;
|
|
441
467
|
/** Device manufacturer */
|
|
442
468
|
manufacturer?: string;
|
|
443
469
|
/** Device role in network */
|
|
444
470
|
role?: string;
|
|
445
471
|
/** Device width configuration */
|
|
446
472
|
width?: Width | number;
|
|
447
|
-
/** Power port side for rear
|
|
473
|
+
/** Power port side for rear face */
|
|
448
474
|
powerSide?: PowerSide;
|
|
449
475
|
/** Vertical PDU height in centimeters */
|
|
450
476
|
heightCm?: number;
|
|
@@ -552,7 +578,7 @@ interface NetworkNodeDataBase extends DeviceImageOptions {
|
|
|
552
578
|
height?: number;
|
|
553
579
|
headerHeight?: number;
|
|
554
580
|
/** Optional precomputed map for handle-to-face resolution */
|
|
555
|
-
handleSideMap?: Record<string,
|
|
581
|
+
handleSideMap?: Record<string, DeviceFace>;
|
|
556
582
|
/** Additional extension metadata */
|
|
557
583
|
metadata?: Record<string, unknown>;
|
|
558
584
|
}
|
|
@@ -568,7 +594,7 @@ interface RackNodeData extends NetworkNodeDataBase {
|
|
|
568
594
|
* @public
|
|
569
595
|
*/
|
|
570
596
|
interface DeviceNodeData extends NetworkNodeDataBase {
|
|
571
|
-
ports?: DevicePort[] | number;
|
|
597
|
+
ports?: DevicePort[] | PortBlock[] | number;
|
|
572
598
|
}
|
|
573
599
|
/**
|
|
574
600
|
* Fibre flow cable node data.
|
|
@@ -714,7 +740,9 @@ type NetworkEdge<TData extends NetworkEdgeData = NetworkEdgeData> = {
|
|
|
714
740
|
data?: TData;
|
|
715
741
|
};
|
|
716
742
|
/**
|
|
717
|
-
*
|
|
743
|
+
* Canonical persisted/editor document schema independent from React Flow handle ids.
|
|
744
|
+
* Prefer this model for saving diagrams, syncing external systems, and controlled
|
|
745
|
+
* document-mode usage via `document` / `onDocumentChange`.
|
|
718
746
|
* @public
|
|
719
747
|
*/
|
|
720
748
|
interface DiagramDocument {
|
|
@@ -758,7 +786,7 @@ interface DiagramNodePlacement {
|
|
|
758
786
|
interface DiagramEndpoint {
|
|
759
787
|
id: string;
|
|
760
788
|
label: string;
|
|
761
|
-
face?:
|
|
789
|
+
face?: DeviceFace | 'internal';
|
|
762
790
|
group?: string;
|
|
763
791
|
role?: 'network' | 'power' | 'fiber' | 'tube' | 'splice' | 'coupler' | 'splitter' | 'cable' | 'generic';
|
|
764
792
|
medium?: 'ethernet' | 'fiber' | 'power' | 'tube' | 'generic';
|
|
@@ -774,8 +802,7 @@ interface DiagramEndpoint {
|
|
|
774
802
|
*/
|
|
775
803
|
interface DiagramNodeRender {
|
|
776
804
|
status?: DeviceStatus | string;
|
|
777
|
-
|
|
778
|
-
face?: DeviceView;
|
|
805
|
+
face?: DeviceFace;
|
|
779
806
|
width?: Width | number;
|
|
780
807
|
widthPx?: number;
|
|
781
808
|
height?: number;
|
|
@@ -844,9 +871,8 @@ interface DiagramEdge {
|
|
|
844
871
|
*/
|
|
845
872
|
interface DiagramUiState {
|
|
846
873
|
nodeState?: Record<string, {
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
handleSideMap?: Record<string, DeviceView>;
|
|
874
|
+
face?: DeviceFace;
|
|
875
|
+
handleSideMap?: Record<string, DeviceFace>;
|
|
850
876
|
}>;
|
|
851
877
|
metadata?: Record<string, unknown>;
|
|
852
878
|
}
|
|
@@ -905,15 +931,17 @@ interface RackDevice extends DeviceImageOptions {
|
|
|
905
931
|
mountMode?: RackMountMode;
|
|
906
932
|
/** Device role in network */
|
|
907
933
|
role?: string;
|
|
908
|
-
/** Recommended simple port input
|
|
909
|
-
ports?: DevicePort[];
|
|
934
|
+
/** Recommended simple port input (flat `DevicePort[]` or grouped `PortBlock[]`). */
|
|
935
|
+
ports?: DevicePort[] | PortBlock[];
|
|
910
936
|
/** Current status of the device */
|
|
911
937
|
status?: DeviceStatus | string;
|
|
912
938
|
/** Advanced grouped front port input */
|
|
913
939
|
portGroups?: PortBlock[];
|
|
914
940
|
/** Advanced grouped rear port input */
|
|
915
941
|
rearPortGroups?: PortBlock[];
|
|
916
|
-
/**
|
|
942
|
+
/** Grouped rear port blocks (rack JSON alias for `rearPortGroups`) */
|
|
943
|
+
rearPorts?: PortBlock[];
|
|
944
|
+
/** Power port side for rear face */
|
|
917
945
|
powerSide?: PowerSide;
|
|
918
946
|
/** Connected device IDs */
|
|
919
947
|
connections?: string[];
|
|
@@ -1081,36 +1109,43 @@ interface NetworkDiagramFlowMethods {
|
|
|
1081
1109
|
getEdges: () => NetworkEdge[];
|
|
1082
1110
|
fitView: (options?: NetworkDiagramFitViewOptions) => void;
|
|
1083
1111
|
}
|
|
1112
|
+
/**
|
|
1113
|
+
* Store state shape used by `NetworkDiagramStoreApi`.
|
|
1114
|
+
* @public
|
|
1115
|
+
*/
|
|
1116
|
+
interface NetworkDiagramStoreState {
|
|
1117
|
+
nodes: NetworkNode[];
|
|
1118
|
+
edges: NetworkEdge[];
|
|
1119
|
+
debug?: boolean;
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Store connection validation parameters.
|
|
1123
|
+
* @public
|
|
1124
|
+
*/
|
|
1125
|
+
interface NetworkDiagramValidateConnectionParams {
|
|
1126
|
+
source: string | null;
|
|
1127
|
+
target: string | null;
|
|
1128
|
+
sourceHandle?: string | null;
|
|
1129
|
+
targetHandle?: string | null;
|
|
1130
|
+
}
|
|
1131
|
+
/**
|
|
1132
|
+
* Store connection validation result.
|
|
1133
|
+
* @public
|
|
1134
|
+
*/
|
|
1135
|
+
interface NetworkDiagramValidationResult {
|
|
1136
|
+
valid: boolean;
|
|
1137
|
+
reason?: string;
|
|
1138
|
+
}
|
|
1084
1139
|
/**
|
|
1085
1140
|
* Store contract accepted by `NetworkDiagram`.
|
|
1086
1141
|
* @public
|
|
1087
1142
|
*/
|
|
1088
1143
|
interface NetworkDiagramStoreApi {
|
|
1089
|
-
getState: () =>
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
debug?: boolean;
|
|
1093
|
-
};
|
|
1094
|
-
setState: (partial: Partial<{
|
|
1095
|
-
nodes: NetworkNode[];
|
|
1096
|
-
edges: NetworkEdge[];
|
|
1097
|
-
debug?: boolean;
|
|
1098
|
-
}>) => void;
|
|
1099
|
-
subscribe: (listener: (state: {
|
|
1100
|
-
nodes: NetworkNode[];
|
|
1101
|
-
edges: NetworkEdge[];
|
|
1102
|
-
debug?: boolean;
|
|
1103
|
-
}) => void) => () => void;
|
|
1144
|
+
getState: () => NetworkDiagramStoreState;
|
|
1145
|
+
setState: (partial: Partial<NetworkDiagramStoreState>) => void;
|
|
1146
|
+
subscribe: (listener: (state: NetworkDiagramStoreState) => void) => () => void;
|
|
1104
1147
|
selectEdgeZIndex: (edge: NetworkEdge) => number;
|
|
1105
|
-
validateConnection: (params:
|
|
1106
|
-
source: string | null;
|
|
1107
|
-
target: string | null;
|
|
1108
|
-
sourceHandle?: string | null;
|
|
1109
|
-
targetHandle?: string | null;
|
|
1110
|
-
}) => {
|
|
1111
|
-
valid: boolean;
|
|
1112
|
-
reason?: string;
|
|
1113
|
-
};
|
|
1148
|
+
validateConnection: (params: NetworkDiagramValidateConnectionParams) => NetworkDiagramValidationResult;
|
|
1114
1149
|
selectNodeById: (id: string) => NetworkNode | undefined;
|
|
1115
1150
|
selectConnectedEdges: (nodeId: string) => NetworkEdge[];
|
|
1116
1151
|
}
|
|
@@ -1157,10 +1192,10 @@ interface NetworkDiagramProps {
|
|
|
1157
1192
|
isValidConnection?: (connection: Connection) => boolean;
|
|
1158
1193
|
/** Optional connection mode override */
|
|
1159
1194
|
connectionMode?: ConnectionMode;
|
|
1160
|
-
/** Callback when device
|
|
1161
|
-
|
|
1195
|
+
/** Callback when a device face changes */
|
|
1196
|
+
onFaceChange?: (nodeId: string, face: DeviceFace) => void;
|
|
1162
1197
|
/** Callback when rack face changes */
|
|
1163
|
-
onRackFaceChange?: (rackId: string, face:
|
|
1198
|
+
onRackFaceChange?: (rackId: string, face: DeviceFace) => void;
|
|
1164
1199
|
/** CSS class name */
|
|
1165
1200
|
className?: string;
|
|
1166
1201
|
/** Inline styles */
|
|
@@ -1191,16 +1226,33 @@ interface NetworkDiagramProps {
|
|
|
1191
1226
|
interaction?: NetworkDiagramInteractionOptions;
|
|
1192
1227
|
/** Configuration for the floating action panel shown on selected rack/device nodes. */
|
|
1193
1228
|
actionPanel?: NetworkDiagramActionPanelOptions;
|
|
1194
|
-
/** Enable connecting edges by clicking on handles. When true, increases handle sizes for better touch targets. Default is true. */
|
|
1195
|
-
connectOnClick?: boolean;
|
|
1196
|
-
/** Disable panning on drag. Default is false. */
|
|
1197
|
-
panOnDrag?: boolean;
|
|
1198
|
-
/** Disable panning on scroll. Default is true. */
|
|
1199
|
-
panOnScroll?: boolean;
|
|
1200
|
-
/** Disable zooming on scroll. Default is true. */
|
|
1201
|
-
zoomOnScroll?: boolean;
|
|
1202
1229
|
/** Optional fitView options passed to React Flow */
|
|
1203
1230
|
fitViewOptions?: FitViewOptions;
|
|
1231
|
+
/**
|
|
1232
|
+
* Let React Flow render only viewport-visible nodes and edges.
|
|
1233
|
+
* Defaults to true, matching the library's existing large-diagram behavior.
|
|
1234
|
+
*/
|
|
1235
|
+
onlyRenderVisibleElements?: boolean;
|
|
1236
|
+
/** Node IDs to keep at full opacity when diagram focus dimming is enabled */
|
|
1237
|
+
highlightedNodeIds?: string[];
|
|
1238
|
+
/** Edge IDs to keep at full opacity when diagram focus dimming is enabled */
|
|
1239
|
+
highlightedEdgeIds?: string[];
|
|
1240
|
+
/**
|
|
1241
|
+
* When true, non-highlighted nodes and edges are dimmed while focus IDs are set.
|
|
1242
|
+
* Edges connected to highlighted nodes remain in focus unless
|
|
1243
|
+
* `connectEdgesToHighlightedNodes` is false.
|
|
1244
|
+
*/
|
|
1245
|
+
dimUnhighlighted?: boolean;
|
|
1246
|
+
/** Opacity for dimmed nodes/edges (0-1). Defaults to 0.25 */
|
|
1247
|
+
dimOpacity?: number;
|
|
1248
|
+
/** When false, only explicit highlightedEdgeIds stay bright during focus. */
|
|
1249
|
+
connectEdgesToHighlightedNodes?: boolean;
|
|
1250
|
+
/** When false, devices render without rack photos. Status border still uses `getStatusColor`. Default true. */
|
|
1251
|
+
showDeviceImages?: boolean;
|
|
1252
|
+
/** Port handles kept highlighted during diagram trace/focus. */
|
|
1253
|
+
highlightedPortHandles?: DiagramPortHandleRef[];
|
|
1254
|
+
/** Fired when a port handle is clicked (typically in read-only trace mode). */
|
|
1255
|
+
onPortClick?: (payload: DiagramPortClickPayload) => void;
|
|
1204
1256
|
}
|
|
1205
1257
|
|
|
1206
1258
|
declare const NetworkDiagram: React$1.FC<NetworkDiagramProps>;
|
|
@@ -1213,7 +1265,7 @@ interface DiagramErrorBoundaryProps {
|
|
|
1213
1265
|
/** Optional callback when an error is caught (e.g. for logging) */
|
|
1214
1266
|
onError?: (error: Error, errorInfo: ErrorInfo) => void;
|
|
1215
1267
|
}
|
|
1216
|
-
interface
|
|
1268
|
+
interface DiagramErrorBoundaryState {
|
|
1217
1269
|
error: Error | null;
|
|
1218
1270
|
}
|
|
1219
1271
|
/**
|
|
@@ -1236,104 +1288,45 @@ interface State {
|
|
|
1236
1288
|
* </DiagramErrorBoundary>
|
|
1237
1289
|
* ```
|
|
1238
1290
|
*/
|
|
1239
|
-
declare class DiagramErrorBoundary extends Component<DiagramErrorBoundaryProps,
|
|
1240
|
-
state:
|
|
1241
|
-
static getDerivedStateFromError(error: Error):
|
|
1291
|
+
declare class DiagramErrorBoundary extends Component<DiagramErrorBoundaryProps, DiagramErrorBoundaryState> {
|
|
1292
|
+
state: DiagramErrorBoundaryState;
|
|
1293
|
+
static getDerivedStateFromError(error: Error): DiagramErrorBoundaryState;
|
|
1242
1294
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
|
1243
1295
|
reset: () => void;
|
|
1244
1296
|
render(): ReactNode;
|
|
1245
1297
|
}
|
|
1246
1298
|
|
|
1247
1299
|
interface RackNodeProps extends NodeProps<NetworkNode['data']> {
|
|
1248
|
-
|
|
1300
|
+
onFaceChange?: (nodeId: string, face: 'front' | 'rear') => void;
|
|
1249
1301
|
onRackFaceChange?: (rackId: string, face: 'front' | 'rear') => void;
|
|
1250
1302
|
isDragOver?: boolean;
|
|
1251
1303
|
}
|
|
1252
|
-
/**
|
|
1253
|
-
|
|
1254
|
-
*
|
|
1255
|
-
* Displays a 19" rack with configurable height, front/rear view switching,
|
|
1256
|
-
* and support for mounting devices at specific U positions.
|
|
1257
|
-
*
|
|
1258
|
-
* @example
|
|
1259
|
-
* ```tsx
|
|
1260
|
-
* {
|
|
1261
|
-
* id: 'rack-1',
|
|
1262
|
-
* type: 'rack',
|
|
1263
|
-
* position: { x: 100, y: 100 },
|
|
1264
|
-
* data: {
|
|
1265
|
-
* label: 'Main Rack',
|
|
1266
|
-
* uHeight: 42,
|
|
1267
|
-
* status: 'active'
|
|
1268
|
-
* }
|
|
1269
|
-
* }
|
|
1270
|
-
* ```
|
|
1271
|
-
*
|
|
1272
|
-
* @public
|
|
1273
|
-
*/
|
|
1274
|
-
declare const RackNode: React$1.FC<RackNodeProps>;
|
|
1304
|
+
/** Memoized; uses useStoreApi (not useReactFlow) so rack chrome does not re-render on every node move. */
|
|
1305
|
+
declare const RackNode: React$1.NamedExoticComponent<RackNodeProps>;
|
|
1275
1306
|
|
|
1276
1307
|
declare const FiberNode: React$1.FC<NodeProps<NetworkNode['data']>>;
|
|
1277
1308
|
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
* sourceHandle: 'fiber-1',
|
|
1291
|
-
* targetHandle: 'fiber-2',
|
|
1292
|
-
* type: 'fiber',
|
|
1293
|
-
* data: {
|
|
1294
|
-
* kind: 'fiber',
|
|
1295
|
-
* ribbonFiberIds: [1, 2, 3, 4, 5, 6] // For ribbon mode
|
|
1296
|
-
* }
|
|
1297
|
-
* }
|
|
1298
|
-
* ```
|
|
1299
|
-
*
|
|
1300
|
-
* @public
|
|
1301
|
-
*/
|
|
1302
|
-
declare const FiberEdge: React$1.FC<EdgeProps<NetworkEdge['data']> & {
|
|
1309
|
+
declare const FiberEdge: React$1.NamedExoticComponent<Pick<reactflow.Edge<NetworkEdgeData | undefined>, "id" | "data" | "source" | "target" | "style" | "selected" | "animated"> & Pick<reactflow.WrapEdgeProps<any>, "sourcePosition" | "targetPosition" | "interactionWidth" | "sourceX" | "sourceY" | "targetX" | "targetY" | "sourceHandleId" | "targetHandleId"> & {
|
|
1310
|
+
label?: string | React$1.ReactNode;
|
|
1311
|
+
labelStyle?: React$1.CSSProperties;
|
|
1312
|
+
labelShowBg?: boolean;
|
|
1313
|
+
labelBgStyle?: React$1.CSSProperties;
|
|
1314
|
+
labelBgPadding?: [number, number];
|
|
1315
|
+
labelBgBorderRadius?: number;
|
|
1316
|
+
} & {
|
|
1317
|
+
markerStart?: string;
|
|
1318
|
+
markerEnd?: string;
|
|
1319
|
+
pathOptions?: any;
|
|
1320
|
+
} & {
|
|
1303
1321
|
className?: string;
|
|
1304
1322
|
}>;
|
|
1305
1323
|
|
|
1306
|
-
declare const PowerEdge: React$1.
|
|
1324
|
+
declare const PowerEdge: React$1.NamedExoticComponent<EdgeProps>;
|
|
1307
1325
|
|
|
1308
|
-
/**
|
|
1309
|
-
|
|
1310
|
-
*
|
|
1311
|
-
* Represents a device that can be placed in a rack. Supports port configuration,
|
|
1312
|
-
* U positioning, front/rear views, and various device types (servers, switches, routers, etc.).
|
|
1313
|
-
*
|
|
1314
|
-
* @example
|
|
1315
|
-
* ```tsx
|
|
1316
|
-
* {
|
|
1317
|
-
* id: 'server-1',
|
|
1318
|
-
* type: 'device',
|
|
1319
|
-
* position: { x: 120, y: 150 },
|
|
1320
|
-
* parentId: 'rack-1',
|
|
1321
|
-
* data: {
|
|
1322
|
-
* label: 'Web Server',
|
|
1323
|
-
* deviceType: 'server',
|
|
1324
|
-
* uPosition: 1,
|
|
1325
|
-
* ports: [
|
|
1326
|
-
* { id: 'eth0', label: 'eth0', group: 'Network Ports', connected: true, type: 'ethernet' }
|
|
1327
|
-
* ]
|
|
1328
|
-
* }
|
|
1329
|
-
* }
|
|
1330
|
-
* ```
|
|
1331
|
-
*
|
|
1332
|
-
* @public
|
|
1333
|
-
*/
|
|
1334
|
-
declare const DeviceNode: React$1.FC<NodeProps<NetworkNode['data']>>;
|
|
1326
|
+
/** Memoized to avoid re-rendering rack devices when unrelated nodes move (React Flow perf guide). */
|
|
1327
|
+
declare const DeviceNode: React$1.NamedExoticComponent<NodeProps<NetworkNodeDataBase | RackNodeData | DeviceNodeData | FibreFlowCableNodeData | FibreFlowClosureNodeData>>;
|
|
1335
1328
|
|
|
1336
|
-
declare const VerticalPDU: React$1.
|
|
1329
|
+
declare const VerticalPDU: React$1.NamedExoticComponent<NodeProps<NetworkNodeDataBase | RackNodeData | DeviceNodeData | FibreFlowCableNodeData | FibreFlowClosureNodeData>>;
|
|
1337
1330
|
|
|
1338
1331
|
declare const SpliceNode: React$1.FC<NodeProps<NetworkNode['data']>>;
|
|
1339
1332
|
|
|
@@ -1400,9 +1393,7 @@ interface FibreFlowMapProps {
|
|
|
1400
1393
|
className?: string;
|
|
1401
1394
|
style?: React$1.CSSProperties;
|
|
1402
1395
|
readOnly?: boolean;
|
|
1403
|
-
|
|
1404
|
-
panOnScroll?: boolean;
|
|
1405
|
-
zoomOnScroll?: boolean;
|
|
1396
|
+
interaction?: NetworkDiagramInteractionOptions;
|
|
1406
1397
|
}
|
|
1407
1398
|
declare const FibreFlowMap: React$1.FC<FibreFlowMapProps>;
|
|
1408
1399
|
|
|
@@ -1543,6 +1534,14 @@ declare const inventoryToNetworkDiagram: (data: {
|
|
|
1543
1534
|
nodes: NetworkNode[];
|
|
1544
1535
|
edges: NetworkEdge[];
|
|
1545
1536
|
};
|
|
1537
|
+
/**
|
|
1538
|
+
* Convert inventory data directly into the canonical DiagramDocument model.
|
|
1539
|
+
*/
|
|
1540
|
+
declare const inventoryToDiagramDocument: (data: {
|
|
1541
|
+
racks: InventoryRackDTO[];
|
|
1542
|
+
devices: InventoryDeviceDTO[];
|
|
1543
|
+
cables: InventoryCableDTO[];
|
|
1544
|
+
}) => DiagramDocument;
|
|
1546
1545
|
/**
|
|
1547
1546
|
* Generate simple layout positions for nodes array
|
|
1548
1547
|
*/
|
|
@@ -1571,6 +1570,14 @@ declare const netboxToNetworkDiagram: (data: {
|
|
|
1571
1570
|
nodes: NetworkNode[];
|
|
1572
1571
|
edges: NetworkEdge[];
|
|
1573
1572
|
};
|
|
1573
|
+
/**
|
|
1574
|
+
* Convert NetBox data directly into the canonical DiagramDocument model.
|
|
1575
|
+
*/
|
|
1576
|
+
declare const netboxToDiagramDocument: (data: {
|
|
1577
|
+
racks: NetBoxRack[];
|
|
1578
|
+
devices: NetBoxDevice[];
|
|
1579
|
+
cables: NetBoxCable[];
|
|
1580
|
+
}, options?: NetBoxDeviceTransformOptions) => DiagramDocument;
|
|
1574
1581
|
/**
|
|
1575
1582
|
* Calculate U position for devices in a rack
|
|
1576
1583
|
*/
|
|
@@ -2088,18 +2095,186 @@ declare function addSpliceToTray(trays: SpliceTrayConfig[], trayId: string, spli
|
|
|
2088
2095
|
*/
|
|
2089
2096
|
declare function removeSpliceFromTray(trays: SpliceTrayConfig[], trayId: string, spliceId: string): SpliceTrayConfig[];
|
|
2090
2097
|
|
|
2091
|
-
|
|
2098
|
+
/**
|
|
2099
|
+
* Normalize flat `DevicePort[]` input into explicit front/rear grouped blocks.
|
|
2100
|
+
* This is the bridge between the recommended simple port schema and the
|
|
2101
|
+
* lower-level grouped renderer input.
|
|
2102
|
+
* @public
|
|
2103
|
+
*/
|
|
2104
|
+
declare function buildPortBlocksFromPorts(devicePorts: DevicePort[]): {
|
|
2092
2105
|
ports: PortBlock[];
|
|
2093
2106
|
rearPorts: PortBlock[];
|
|
2094
2107
|
};
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2108
|
+
/**
|
|
2109
|
+
* Resolve the grouped front/rear port blocks from either supported input form:
|
|
2110
|
+
* flat `ports: DevicePort[]` or explicit `portGroups` / `rearPortGroups`.
|
|
2111
|
+
* @public
|
|
2112
|
+
*/
|
|
2113
|
+
type ResolvedPortBlockInput = Pick<NetworkNode['data'], 'ports' | 'portGroups' | 'rearPortGroups'> & {
|
|
2114
|
+
rearPorts?: PortBlock[];
|
|
2115
|
+
};
|
|
2116
|
+
declare function getResolvedPortBlocks(data: ResolvedPortBlockInput | undefined): {
|
|
2117
|
+
ports: PortBlock[];
|
|
2118
|
+
rearPorts: PortBlock[];
|
|
2119
|
+
};
|
|
2120
|
+
/**
|
|
2121
|
+
* Resolve the front-facing grouped port blocks for a node/device data object.
|
|
2122
|
+
* @public
|
|
2123
|
+
*/
|
|
2124
|
+
declare function getFrontPortBlocks(data: Pick<NetworkNode['data'], 'ports' | 'portGroups' | 'rearPortGroups'> | undefined): PortBlock[];
|
|
2125
|
+
/**
|
|
2126
|
+
* Resolve the rear-facing grouped port blocks for a node/device data object.
|
|
2127
|
+
* @public
|
|
2128
|
+
*/
|
|
2129
|
+
declare function getRearPortBlocks(data: Pick<NetworkNode['data'], 'ports' | 'portGroups' | 'rearPortGroups'> | undefined): PortBlock[];
|
|
2130
|
+
/**
|
|
2131
|
+
* Determine whether a node/device data object resolves to any front ports.
|
|
2132
|
+
* @public
|
|
2133
|
+
*/
|
|
2134
|
+
declare function hasFrontPorts(data: Pick<NetworkNode['data'], 'ports' | 'portGroups' | 'rearPortGroups'> | undefined): boolean;
|
|
2135
|
+
/**
|
|
2136
|
+
* Determine whether a node/device data object resolves to any rear ports.
|
|
2137
|
+
* @public
|
|
2138
|
+
*/
|
|
2139
|
+
declare function hasRearPorts(data: Pick<NetworkNode['data'], 'ports' | 'portGroups' | 'rearPortGroups'> | undefined): boolean;
|
|
2140
|
+
/**
|
|
2141
|
+
* Choose the default device face based on the resolved front/rear port data.
|
|
2142
|
+
* @public
|
|
2143
|
+
*/
|
|
2144
|
+
declare function getDefaultDeviceFace(data: Pick<NetworkNode['data'], 'ports' | 'portGroups' | 'rearPortGroups'> | undefined): DeviceFace;
|
|
2145
|
+
|
|
2146
|
+
/**
|
|
2147
|
+
* Normalize source/target directional suffixes used for bidirectional handles.
|
|
2148
|
+
* Example: `Rear Ports-1-target` -\> `Rear Ports-1`.
|
|
2149
|
+
*/
|
|
2150
|
+
declare function normalizeDirectionalHandleId(handleId: string | null | undefined): string;
|
|
2151
|
+
/**
|
|
2152
|
+
* Normalize rendered handle ids back to their canonical endpoint id.
|
|
2153
|
+
* This removes both directional suffixes and split-face rear aliases.
|
|
2154
|
+
*/
|
|
2155
|
+
declare function normalizeHandleId(handleId: string | null | undefined): string;
|
|
2156
|
+
/**
|
|
2157
|
+
* Returns true when a port type is considered power-related.
|
|
2158
|
+
*/
|
|
2159
|
+
declare function isPowerPortType(portType: string | undefined): boolean;
|
|
2160
|
+
/**
|
|
2161
|
+
* Build a stable handle id for a port.
|
|
2162
|
+
* Power ports use the label directly to preserve legacy ids.
|
|
2163
|
+
*/
|
|
2164
|
+
declare function buildPortHandleId(portBlockName: string, port: Pick<Port, 'label' | 'id'> & {
|
|
2165
|
+
type?: string;
|
|
2166
|
+
}): string;
|
|
2167
|
+
/**
|
|
2168
|
+
* Heuristic for whether a handle id represents a power endpoint.
|
|
2169
|
+
*/
|
|
2170
|
+
declare function looksLikePowerHandleId(handleId: string): boolean;
|
|
2171
|
+
|
|
2172
|
+
/**
|
|
2173
|
+
* Resolve the effective device face for a flat port input.
|
|
2174
|
+
* @public
|
|
2175
|
+
*/
|
|
2176
|
+
declare function resolveDevicePortFace(port: Pick<DevicePort, 'face' | 'type'>): DeviceFace;
|
|
2177
|
+
/** @deprecated Use {@link resolveDevicePortFace}. */
|
|
2178
|
+
declare const resolveReactNetworksPortFace: typeof resolveDevicePortFace;
|
|
2179
|
+
/**
|
|
2180
|
+
* Resolve the effective port group name for a flat port input.
|
|
2181
|
+
* @public
|
|
2182
|
+
*/
|
|
2183
|
+
declare function resolveDevicePortGroup(port: Pick<DevicePort, 'face' | 'group' | 'type'>): string;
|
|
2184
|
+
/** @deprecated Use {@link resolveDevicePortGroup}. */
|
|
2185
|
+
declare const resolveReactNetworksPortGroup: typeof resolveDevicePortGroup;
|
|
2186
|
+
/**
|
|
2187
|
+
* Normalize unknown port array input into canonical flat {@link DevicePort} entries.
|
|
2188
|
+
* @public
|
|
2189
|
+
*/
|
|
2190
|
+
declare function normalizeDevicePorts(value: unknown): DevicePort[] | undefined;
|
|
2191
|
+
/** @deprecated Use {@link normalizeDevicePorts}. */
|
|
2192
|
+
declare const normalizeReactNetworksPorts: typeof normalizeDevicePorts;
|
|
2193
|
+
/**
|
|
2194
|
+
* Resolve flat device ports from node data supporting flat or grouped port input.
|
|
2195
|
+
* @public
|
|
2196
|
+
*/
|
|
2197
|
+
declare function resolveNodeDevicePorts(value: unknown): DevicePort[] | undefined;
|
|
2198
|
+
/** @deprecated Use {@link resolveNodeDevicePorts}. */
|
|
2199
|
+
declare const resolveReactNetworksNodePorts: typeof resolveNodeDevicePorts;
|
|
2200
|
+
/**
|
|
2201
|
+
* Flatten grouped port blocks into canonical flat {@link DevicePort} entries.
|
|
2202
|
+
* @public
|
|
2203
|
+
*/
|
|
2204
|
+
declare function flattenDevicePortsFromGroups({ portGroups, rearPortGroups, }: {
|
|
2205
|
+
portGroups?: PortBlock[];
|
|
2206
|
+
rearPortGroups?: PortBlock[];
|
|
2207
|
+
}): DevicePort[];
|
|
2208
|
+
/** @deprecated Use {@link flattenDevicePortsFromGroups}. */
|
|
2209
|
+
declare const flattenReactNetworksPortGroups: typeof flattenDevicePortsFromGroups;
|
|
2210
|
+
/**
|
|
2211
|
+
* Build grouped port blocks from flat device port input.
|
|
2212
|
+
* @public
|
|
2213
|
+
*/
|
|
2214
|
+
declare function buildDevicePortGroupsFromPorts(ports: DevicePort[] | undefined): {
|
|
2215
|
+
portGroups: PortBlock[];
|
|
2216
|
+
rearPortGroups: PortBlock[];
|
|
2217
|
+
};
|
|
2218
|
+
/** @deprecated Use {@link buildDevicePortGroupsFromPorts}. */
|
|
2219
|
+
declare const buildReactNetworksPortGroupsFromPorts: typeof buildDevicePortGroupsFromPorts;
|
|
2220
|
+
interface ListPossiblePortHandleIdsOptions {
|
|
2221
|
+
deviceType?: string;
|
|
2222
|
+
face?: DeviceFace;
|
|
2223
|
+
}
|
|
2224
|
+
/**
|
|
2225
|
+
* List handle ids that may exist on a rendered node for a port.
|
|
2226
|
+
* @public
|
|
2227
|
+
*/
|
|
2228
|
+
declare function listPossiblePortHandleIds(portBlockName: string, port: Pick<Port, 'id' | 'label' | 'type'>, options?: ListPossiblePortHandleIdsOptions): string[];
|
|
2229
|
+
/**
|
|
2230
|
+
* Validate that a handle id exists on node data after grouping resolution.
|
|
2231
|
+
* @public
|
|
2232
|
+
*/
|
|
2233
|
+
declare function validatePortHandleOnNodeData(nodeData: Pick<NetworkNodeDataBase, 'ports' | 'portGroups' | 'rearPortGroups'> | undefined, handle: string, options?: {
|
|
2234
|
+
deviceType?: string;
|
|
2235
|
+
sanitizeHandle?: (value: string) => string;
|
|
2236
|
+
}): boolean;
|
|
2237
|
+
/**
|
|
2238
|
+
* Convert flat ports to grouped blocks using the same rules as renderers.
|
|
2239
|
+
* @public
|
|
2240
|
+
*/
|
|
2241
|
+
declare function resolveDevicePortBlocksFromFlatPorts(ports: DevicePort[]): {
|
|
2242
|
+
portGroups: PortBlock[];
|
|
2243
|
+
rearPortGroups: PortBlock[];
|
|
2244
|
+
};
|
|
2245
|
+
|
|
2246
|
+
declare const parseSemanticPortPosition: (value: string) => PortPosition | undefined;
|
|
2247
|
+
declare const normalizePortPositionInput: (value: unknown) => PortPosition | undefined;
|
|
2248
|
+
|
|
2249
|
+
type PathLayoutDirection = 'horizontal' | 'vertical';
|
|
2250
|
+
interface PathLayoutStepInput {
|
|
2251
|
+
id: string;
|
|
2252
|
+
type?: NetworkNode['type'];
|
|
2253
|
+
data?: NetworkNode['data'];
|
|
2254
|
+
}
|
|
2255
|
+
interface PathLayoutEdgeInput {
|
|
2256
|
+
id: string;
|
|
2257
|
+
source: string;
|
|
2258
|
+
target: string;
|
|
2259
|
+
type?: NetworkEdge['type'];
|
|
2260
|
+
data?: NetworkEdge['data'];
|
|
2261
|
+
}
|
|
2262
|
+
interface BuildPathLayoutOptions {
|
|
2263
|
+
direction?: PathLayoutDirection;
|
|
2264
|
+
spacing?: number;
|
|
2265
|
+
origin?: {
|
|
2266
|
+
x: number;
|
|
2267
|
+
y: number;
|
|
2268
|
+
};
|
|
2269
|
+
}
|
|
2270
|
+
/**
|
|
2271
|
+
* Lay out a sequential path of nodes and connecting edges with deterministic spacing.
|
|
2272
|
+
* @public
|
|
2273
|
+
*/
|
|
2274
|
+
declare function buildPathLayoutGraph(steps: PathLayoutStepInput[], edges: PathLayoutEdgeInput[], options?: BuildPathLayoutOptions): {
|
|
2275
|
+
nodes: NetworkNode[];
|
|
2276
|
+
edges: NetworkEdge[];
|
|
2277
|
+
};
|
|
2103
2278
|
|
|
2104
2279
|
interface NetworkGraphSnapshot {
|
|
2105
2280
|
nodes: NetworkNode[];
|
|
@@ -2111,7 +2286,7 @@ declare function diagramDocumentToNetworkGraph(document: DiagramDocument): Netwo
|
|
|
2111
2286
|
type EndpointConnectionKind = 'power' | 'network' | 'unknown';
|
|
2112
2287
|
interface EndpointMetadata {
|
|
2113
2288
|
normalizedHandle: string;
|
|
2114
|
-
face?:
|
|
2289
|
+
face?: DeviceFace;
|
|
2115
2290
|
kind: EndpointConnectionKind;
|
|
2116
2291
|
compatibility: string[];
|
|
2117
2292
|
}
|
|
@@ -2125,6 +2300,23 @@ declare function resolveEndpointCompatibilityKeys(input: {
|
|
|
2125
2300
|
}): string[];
|
|
2126
2301
|
declare function getEndpointMetadata(node?: NetworkNode, handle?: string | null): EndpointMetadata;
|
|
2127
2302
|
|
|
2303
|
+
type PortVisualKind = 'generic' | 'rj45' | 'sfp' | 'qsfp' | 'osfp' | 'console' | 'usb' | 'power_c13' | 'power_c19' | 'power_ac';
|
|
2304
|
+
interface PortVisualInput {
|
|
2305
|
+
type?: PortType | string;
|
|
2306
|
+
label?: string;
|
|
2307
|
+
id?: string;
|
|
2308
|
+
group?: string;
|
|
2309
|
+
sourceTypeLabel?: string;
|
|
2310
|
+
connectorType?: string;
|
|
2311
|
+
}
|
|
2312
|
+
interface PortVisualDimensions {
|
|
2313
|
+
width: number;
|
|
2314
|
+
height: number;
|
|
2315
|
+
borderRadius: string;
|
|
2316
|
+
}
|
|
2317
|
+
declare function resolvePortVisualKind(input: PortVisualInput): PortVisualKind;
|
|
2318
|
+
declare function getStandardPortVisualDimensions(inputOrKind: PortVisualInput | PortVisualKind): PortVisualDimensions | undefined;
|
|
2319
|
+
|
|
2128
2320
|
/**
|
|
2129
2321
|
* Power connector utilities for consistent styling across devices and PDUs
|
|
2130
2322
|
*/
|
|
@@ -2291,6 +2483,41 @@ interface ReplaceEdgeOptions {
|
|
|
2291
2483
|
*/
|
|
2292
2484
|
declare function replaceEdge(options: ReplaceEdgeOptions): Edge[] | null;
|
|
2293
2485
|
|
|
2486
|
+
interface DiagramFocusOptions {
|
|
2487
|
+
highlightedNodeIds?: readonly string[];
|
|
2488
|
+
highlightedEdgeIds?: readonly string[];
|
|
2489
|
+
dimUnhighlighted?: boolean;
|
|
2490
|
+
dimOpacity?: number;
|
|
2491
|
+
/** When false, only explicit highlightedEdgeIds stay bright (not every edge on a highlighted node). */
|
|
2492
|
+
connectEdgesToHighlightedNodes?: boolean;
|
|
2493
|
+
}
|
|
2494
|
+
declare const DEFAULT_DIAGRAM_DIM_OPACITY = 0.25;
|
|
2495
|
+
declare function hasDiagramFocus(options: DiagramFocusOptions): boolean;
|
|
2496
|
+
declare function isNodeInDiagramFocus(nodeId: string, options: DiagramFocusOptions): boolean;
|
|
2497
|
+
declare function isEdgeInDiagramFocus(edgeId: string, edge: Pick<NetworkEdge, 'source' | 'target'>, options: DiagramFocusOptions): boolean;
|
|
2498
|
+
type RuntimeNode = NetworkNode & {
|
|
2499
|
+
style?: CSSProperties;
|
|
2500
|
+
};
|
|
2501
|
+
type RuntimeEdge = NetworkEdge & {
|
|
2502
|
+
style?: CSSProperties;
|
|
2503
|
+
};
|
|
2504
|
+
declare function applyDiagramFocusToNodes<TNode extends RuntimeNode>(nodes: TNode[], options: DiagramFocusOptions): TNode[];
|
|
2505
|
+
declare function applyDiagramFocusToEdges<TEdge extends RuntimeEdge>(edges: TEdge[], options: DiagramFocusOptions): TEdge[];
|
|
2506
|
+
|
|
2507
|
+
declare function isDeviceDiagramNode(node: NetworkNode): boolean;
|
|
2508
|
+
declare function applyDeviceDisplayToNodes(nodes: NetworkNode[], options?: {
|
|
2509
|
+
showDeviceImages?: boolean;
|
|
2510
|
+
}, previousNodes?: NetworkNode[]): NetworkNode[];
|
|
2511
|
+
|
|
2512
|
+
type DiagramPortContextValue = {
|
|
2513
|
+
highlightedPortHandles?: readonly DiagramPortHandleRef[];
|
|
2514
|
+
onPortClick?: (payload: DiagramPortClickPayload) => void;
|
|
2515
|
+
portClickEnabled: boolean;
|
|
2516
|
+
};
|
|
2517
|
+
declare const DiagramPortProvider: React$1.Provider<DiagramPortContextValue>;
|
|
2518
|
+
declare function useDiagramPortInteraction(): DiagramPortContextValue;
|
|
2519
|
+
declare function isDiagramPortHandleHighlighted(highlightedPortHandles: readonly DiagramPortHandleRef[] | undefined, nodeId: string, handleId: string): boolean;
|
|
2520
|
+
|
|
2294
2521
|
/**
|
|
2295
2522
|
* Template Schema V2 — unified device template model.
|
|
2296
2523
|
*
|
|
@@ -2600,4 +2827,4 @@ declare function useNetworkDiagram(store: NetworkDiagramStore): NetworkDiagramSt
|
|
|
2600
2827
|
declare function useNodes(store: NetworkDiagramStore): NetworkNode[];
|
|
2601
2828
|
declare function useEdges(store: NetworkDiagramStore): NetworkEdge[];
|
|
2602
2829
|
|
|
2603
|
-
export { COUPLERS_PER_PANEL, COUPLER_SLOT_HEIGHT_PX, COUPLER_WIDTH_PX, CableNode, ClosureNode, CouplerNode, type DeviceImageFit, type DeviceImageOptions, type DeviceImageRepeat, DeviceNode, DevicePlacementError, type DevicePlacementValidation, type DevicePort, type DeviceStatus, type DeviceTemplateV2, type
|
|
2830
|
+
export { type BuildPathLayoutOptions, COUPLERS_PER_PANEL, COUPLER_SLOT_HEIGHT_PX, COUPLER_WIDTH_PX, CableNode, ClosureNode, CouplerNode, DEFAULT_DIAGRAM_DIM_OPACITY, type DeviceFace, type DeviceImageFit, type DeviceImageOptions, type DeviceImageRepeat, DeviceNode, type DeviceNodeData, DevicePlacementError, type DevicePlacementValidation, type DevicePort, type DeviceStatus, type DeviceTemplateV2, type DiagramDocument, type DiagramEdge, type DiagramEdgeEndpoint, type DiagramEndpoint, DiagramErrorBoundary, type DiagramErrorBoundaryProps, type DiagramErrorBoundaryState, type DiagramExternalRef, type DiagramFocusOptions, type DiagramNode, type DiagramNodeKind, type DiagramNodePlacement, type DiagramNodeRender, type DiagramPortClickPayload, type DiagramPortContextValue, type DiagramPortHandleRef, DiagramPortProvider, type DiagramUiState, type EndpointConnectionKind, type EndpointMetadata, FIBER_COLORS_12, type FiberCable, type FiberCableType, type FiberColorId, FiberEdge, FiberNode, FibreCableWithTubesExpanded, type FibreCableWithTubesExpandedProps, type FibreFlowCable, type FibreFlowCableKind, type FibreFlowCableLayout, type FibreFlowCableNodeData, type FibreFlowCircuit, type FibreFlowClosure, type FibreFlowClosureNodeData, type FibreFlowColorMode, type FibreFlowEndpoint, type FibreFlowLayoutDirection, FibreFlowMap, type FibreFlowMapProps, type FibreFlowRow, type FibreFlowSplice, type FibreFlowTubeLabel, FibreSplitNode, HANDLE_EXTENSION_PX, type InventoryCableDTO, type InventoryDeviceDTO, type InventoryRackDTO, type ListPossiblePortHandleIdsOptions, type MountClass, MultiTubeCableNode, type NetBoxCable, type NetBoxDevice, type NetBoxDeviceTransformOptions, type NetBoxInterface, type NetBoxMappedPort, type NetBoxPortPosition, type NetBoxRack, NetworkDiagram, type NetworkDiagramActionPanelOptions, type NetworkDiagramFitViewOptions, type NetworkDiagramFlowMethods, type NetworkDiagramFlowObject, type NetworkDiagramInteractionOptions, type NetworkDiagramOptions, type NetworkDiagramProps, type NetworkDiagramState, type NetworkDiagramStore, type NetworkDiagramStoreApi, type NetworkDiagramStoreState, type NetworkDiagramToImageOptions, type NetworkDiagramValidateConnectionParams, type NetworkDiagramValidationResult, type NetworkEdge, type NetworkEdgeData, type NetworkEdgeType, type NetworkGraphSnapshot, type NetworkNode, type NetworkNodeData, type NetworkNodeDataBase, type NetworkNodeDataByType, type NetworkNodeType, PANEL_BORDER_WIDTH, PANEL_HEADER_HEIGHT, PANEL_HEIGHT_PX, PANEL_PADDING, PANEL_TUBE_TRAY_SPACING, PANEL_WIDTH_PX, POWER_CONNECTORS, PatchPanelNode, type PathLayoutDirection, type PathLayoutEdgeInput, type PathLayoutStepInput, type Port, type PortBlock, type PortCableType, type PortPosition, type PortType, type PortVisualDimensions, type PortVisualInput, type PortVisualKind, type PowerConnectorConfig, PowerEdge, type PowerPortStyle, type PowerSide, RACK_HEADER_HEIGHT, RACK_WIDTH_PX, type RackConfig, type RackDevice, type RackDeviceType, type RackLayoutMode, type RackMountMode, type RackMountedNodeType, RackNode, type RackNodeData, type RackNodeProps, type RackSchemaOptions, type RawNetboxTemplate, type RawTemplatePort, type RawTemplatePortBlock, type ReplaceEdgeOptions, type SpliceConfig, SpliceNode, SplicePlacementError, type SplicePlacementValidation, type SpliceSchemaOptions, type SpliceTrayConfig, SpliceTrayNode, TEMPLATE_SCHEMA_VERSION, type TemplateFaceData, type TemplateFrontRearPortLink, type TemplateParseResult, type TemplatePort, type TemplatePortBlock, type TemplateSource, type TemplateValidationIssue, type TemplateValidationReport, type TemplateWidth, TubeNode, type UNumberingDirection, U_HEIGHT_PX, type ValidateConnectionParams, type ValidationResult, VerticalPDU, Width, addDeviceToRack, addSpliceToTray, applyDeviceDisplayToNodes, applyDiagramFocusToEdges, applyDiagramFocusToNodes, baseColorFor, buildDevicePortGroupsFromPorts, buildNodesFromRackConfig, buildNodesFromSpliceConfig, buildPathLayoutGraph, buildPortBlocksFromPorts, buildPortHandleId, buildPortHandleId as buildReactNetworksHandleId, buildReactNetworksPortGroupsFromPorts, calculateClosureDimensions, calculateCouplerRightX, calculateCouplerSlotSpacing, calculateCouplerSpacing, calculateDevicePositionFromU, calculatePanelDimensions, calculateSlotPositionFromY, calculateSplicePositionFromNumber, calculateUPositions, calculateYFromSlotPosition, countTemplateFacePorts, createNetworkDiagramStore, createRackConfigFromNodes, createSpliceConfigFromNodes, diagramDocumentToNetworkGraph, fiberSolidOrStriped, findNearestRack, findNextAvailableHolderPosition, findNextAvailableUPosition, flattenDevicePortsFromGroups, flattenReactNetworksPortGroups, generateLayout, getConnectorConfig, getCouplerDimensions, getDefaultDeviceFace, getDeviceConnectorType, getEndpointMetadata, getFiberColor, getFrontPortBlocks, getInnerContentWidth, getPDUPortType, getPanelHeight, getPanelWidth, getPowerPortStyle, getRackBounds, getRearPortBlocks, getResolvedPortBlocks, getStandardPortVisualDimensions, getStatusColor, getTrayDimensions, getTubeDimensions, hasDiagramFocus, hasFrontPorts, hasRearPorts, inventoryCableToNetworkEdge, inventoryDeviceToNetworkNode, inventoryRackToNetworkNode, inventoryToDiagramDocument, inventoryToNetworkDiagram, isDeviceDiagramNode, isDiagramPortHandleHighlighted, isEdgeInDiagramFocus, isHighPowerConnector, isNodeInDiagramFocus, isPointInRack, isPowerPortType, isStriped, isUPositionAvailable, listPossiblePortHandleIds, looksLikePowerHandleId, netboxCableToNetworkEdge, netboxDeviceToNetworkNode, netboxRackToNetworkNode, netboxToDiagramDocument, netboxToNetworkDiagram, networkGraphToDiagramDocument, normalizeDevicePorts, normalizeDirectionalHandleId, normalizeHandleId, normalizePortPositionInput, normalizeReactNetworksPorts, parseNetboxTemplate, parseSemanticPortPosition, removeDeviceFromRack, removeSpliceFromTray, replaceEdge, resolveDevicePortBlocksFromFlatPorts, resolveDevicePortFace, resolveDevicePortGroup, resolveEndpointCompatibilityKeys, resolveNodeDevicePorts, resolvePortVisualKind, resolveReactNetworksNodePorts, resolveReactNetworksPortFace, resolveReactNetworksPortGroup, snapToCouplerPosition, snapToSplicePosition, snapToUPosition, updateDeviceUPosition$1 as updateDeviceUPosition, updateDeviceUPosition as updateDeviceUPositionInSchema, updateSpliceHolderPosition, useEdges as useDiagramEdges, useNodes as useDiagramNodes, useDiagramPortInteraction, useNetworkDiagram, validateAndSnapDevice, validatePortHandleOnNodeData, validateRackDevicePlacements, validateRenderFidelity, validateSplicePlacements };
|