@mp70/react-networks 0.5.1 → 0.7.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/LICENSE +46 -0
- package/README.md +13 -11
- package/dist/document-adapter-B-6MM_tj.d.mts +1449 -0
- package/dist/document-adapter-B-6MM_tj.d.ts +1449 -0
- package/dist/index.d.mts +49 -1244
- package/dist/index.d.ts +49 -1244
- 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/dist/model.d.mts +33 -0
- package/dist/model.d.ts +33 -0
- package/dist/model.js +2 -0
- package/dist/model.js.map +1 -0
- package/dist/model.mjs +2 -0
- package/dist/model.mjs.map +1 -0
- package/package.json +46 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,47 +1,9 @@
|
|
|
1
|
-
import React
|
|
1
|
+
import React, { Component, ReactNode, ErrorInfo, CSSProperties } from 'react';
|
|
2
|
+
import { N as NetworkDiagramProps, a as NetworkNode, b as NetworkEdgeData, c as NetworkNodeDataBase, R as RackNodeData, D as DeviceNodeData, F as FibreFlowCableNodeData, d as FibreFlowClosureNodeData, e as FibreFlowClosure, f as FibreFlowCircuit, g as NetworkDiagramInteractionOptions, h as FibreFlowCable, i as NetworkEdge, j as DiagramDocument, k as RackConfig, l as RackDevice, S as SpliceTrayConfig, m as SpliceConfig, P as PortBlock, n as DevicePort, o as DeviceFace, p as PortType, q as DeviceStatus, r as DiagramPortHandleRef, s as DiagramPortClickPayload, t as PortCableType, u as PortPosition } from './document-adapter-B-6MM_tj.js';
|
|
3
|
+
export { A as ApplyDirectionalPortHandleIdOptions, B as BuildPathLayoutOptions, v as DescribedPortHandle, w as DeviceImageFit, x as DeviceImageOptions, y as DeviceImageRepeat, z as DiagramEdge, C as DiagramEdgeEndpoint, E as DiagramEndpoint, G as DiagramExternalRef, H as DiagramNode, I as DiagramNodeKind, J as DiagramNodePlacement, K as DiagramNodeRender, L as DiagramUiState, M as FiberCable, O as FiberCableType, Q as FibreFlowCableKind, T as FibreFlowEndpoint, U as FibreFlowSplice, V as HandleShape, W as ListPossiblePortHandleIdsOptions, X as NetworkConnectionRejection, Y as NetworkDiagramActionPanelOptions, Z as NetworkDiagramFitViewOptions, _ as NetworkDiagramFlowMethods, $ as NetworkDiagramFlowObject, a0 as NetworkDiagramStoreApi, a1 as NetworkDiagramStoreState, a2 as NetworkDiagramToImageOptions, a3 as NetworkDiagramValidateConnectionParams, a4 as NetworkDiagramValidationResult, a5 as NetworkEdgeType, a6 as NetworkGraphSnapshot, a7 as NetworkNodeData, a8 as NetworkNodeDataByType, a9 as NetworkNodeType, aa as ParsedHandleId, ab as PathLayoutDirection, ac as PathLayoutEdgeInput, ad as PathLayoutStepInput, ae as Port, af as PowerSide, ag as RackDeviceType, ah as RackLayoutMode, ai as RackMountMode, aj as UNumberingDirection, ak as Width, al as applyDirectionalPortHandleId, am as applyFaceAliasHandleId, an as buildCouplerHandleId, ao as buildDevicePortGroupsFromPorts, ap as buildFiberHandleId, aq as buildPathLayoutGraph, ar as buildPortHandleId, as as buildReactNetworksHandleId, at as buildReactNetworksPortGroupsFromPorts, au as buildSpliceHandleId, av as buildSplitIoHandleId, aw as buildTubeHandleId, ax as describePortHandle, ay as diagramDocumentToNetworkGraph, az as flattenDevicePortsFromGroups, aA as flattenReactNetworksPortGroups, aB as getOppositeSideHandleId, aC as isPowerPortType, aD as listPossiblePortHandleIds, aE as looksLikePowerHandleId, aF as networkGraphToDiagramDocument, aG as normalizeDevicePorts, aH as normalizeDirectionalHandleId, aI as normalizeHandleId, aJ as normalizePortPositionInput, aK as normalizeReactNetworksPorts, aL as parseHandleId, aM as parseSemanticPortPosition, aN as resolveDevicePortBlocksFromFlatPorts, aO as resolveDevicePortFace, aP as resolveDevicePortGroup, aQ as resolveNodeDevicePorts, aR as resolveReactNetworksNodePorts, aS as resolveReactNetworksPortFace, aT as resolveReactNetworksPortGroup, aU as sanitizeHandleIdForMatching, aV as validatePortHandleOnNodeData } from './document-adapter-B-6MM_tj.js';
|
|
2
4
|
import * as reactflow from 'reactflow';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
type FibreFlowCableKind = 'simple' | 'tube';
|
|
6
|
-
interface FibreFlowEndpoint {
|
|
7
|
-
tube?: number;
|
|
8
|
-
fiber: number;
|
|
9
|
-
}
|
|
10
|
-
interface FibreFlowSplice {
|
|
11
|
-
id: string;
|
|
12
|
-
from: FibreFlowEndpoint;
|
|
13
|
-
to: FibreFlowEndpoint;
|
|
14
|
-
lossDb?: number;
|
|
15
|
-
circuitId?: string;
|
|
16
|
-
label?: string;
|
|
17
|
-
color?: string;
|
|
18
|
-
}
|
|
19
|
-
interface FibreFlowCable {
|
|
20
|
-
id: string;
|
|
21
|
-
label: string;
|
|
22
|
-
kind?: FibreFlowCableKind;
|
|
23
|
-
fiberCount?: number;
|
|
24
|
-
tubeCount?: number;
|
|
25
|
-
fibersPerTube?: number;
|
|
26
|
-
tubeStartIndex?: number;
|
|
27
|
-
fiberStartIndex?: number;
|
|
28
|
-
tubeColorMap?: Record<number, string>;
|
|
29
|
-
jacketColor?: string;
|
|
30
|
-
distanceLabel?: string;
|
|
31
|
-
distanceMeters?: number;
|
|
32
|
-
}
|
|
33
|
-
interface FibreFlowClosure {
|
|
34
|
-
id: string;
|
|
35
|
-
chamberId?: string;
|
|
36
|
-
leftCable: FibreFlowCable;
|
|
37
|
-
rightCable: FibreFlowCable;
|
|
38
|
-
splices: FibreFlowSplice[];
|
|
39
|
-
}
|
|
40
|
-
interface FibreFlowCircuit {
|
|
41
|
-
id: string;
|
|
42
|
-
label: string;
|
|
43
|
-
color?: string;
|
|
44
|
-
}
|
|
5
|
+
import { NodeProps, EdgeProps, Edge, Connection } from 'reactflow';
|
|
6
|
+
export { Connection, ConnectionMode, EdgeTypes, FitViewOptions, NodeTypes, Position, ReactFlowInstance, Viewport, XYPosition } from 'reactflow';
|
|
45
7
|
|
|
46
8
|
interface NetBoxPortPosition {
|
|
47
9
|
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
@@ -222,1040 +184,7 @@ interface NetBoxCable {
|
|
|
222
184
|
};
|
|
223
185
|
}
|
|
224
186
|
|
|
225
|
-
|
|
226
|
-
* Rack device width configuration
|
|
227
|
-
* @public
|
|
228
|
-
*/
|
|
229
|
-
|
|
230
|
-
declare enum Width {
|
|
231
|
-
/** Full width device (19" rack width) */
|
|
232
|
-
FULL = "full",
|
|
233
|
-
/** Half width device (9.5" rack width) */
|
|
234
|
-
HALF = "half"
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Port configuration for network devices
|
|
238
|
-
* @public
|
|
239
|
-
*/
|
|
240
|
-
/**
|
|
241
|
-
* Port type enumeration
|
|
242
|
-
* @public
|
|
243
|
-
*/
|
|
244
|
-
type PortType = 'ethernet' | 'rj45' | 'fiber' | 'console' | 'mgmt' | 'usb' | 'power_ac' | 'power_c13' | 'power_c19';
|
|
245
|
-
/**
|
|
246
|
-
* Cable types used for connected network ports.
|
|
247
|
-
* @public
|
|
248
|
-
*/
|
|
249
|
-
type PortCableType = 'smf' | 'cat6' | 'om3' | 'om4' | 'om5' | 'cat5e' | 'cat6a' | 'cat7' | 'fiber' | 'ethernet';
|
|
250
|
-
/**
|
|
251
|
-
* Device image fit options.
|
|
252
|
-
*
|
|
253
|
-
* Values mirror object-fit terms for API ergonomics and are mapped to valid
|
|
254
|
-
* background-size values by renderers where needed.
|
|
255
|
-
*
|
|
256
|
-
* @public
|
|
257
|
-
*/
|
|
258
|
-
type DeviceImageFit = 'cover' | 'contain' | 'contain-height' | 'fill' | 'none' | 'scale-down';
|
|
259
|
-
/**
|
|
260
|
-
* Device image repeat options.
|
|
261
|
-
* @public
|
|
262
|
-
*/
|
|
263
|
-
type DeviceImageRepeat = 'no-repeat' | 'repeat' | 'repeat-x' | 'repeat-y';
|
|
264
|
-
/**
|
|
265
|
-
* Shared image configuration for rack-mounted devices and device nodes.
|
|
266
|
-
* @public
|
|
267
|
-
*/
|
|
268
|
-
interface DeviceImageOptions {
|
|
269
|
-
/** Optional front image URL for device background (PNG, SVG, JPEG, etc.) */
|
|
270
|
-
frontImageUrl?: string;
|
|
271
|
-
/** Optional rear image URL for device background (PNG, SVG, JPEG, etc.) */
|
|
272
|
-
rearImageUrl?: string;
|
|
273
|
-
/** Optional attribution URL for front image (e.g. source/license link) */
|
|
274
|
-
frontImageAttribution?: string;
|
|
275
|
-
/** Optional attribution URL for rear image (e.g. source/license link) */
|
|
276
|
-
rearImageAttribution?: string;
|
|
277
|
-
/** Optional background sizing for device images */
|
|
278
|
-
imageFit?: DeviceImageFit;
|
|
279
|
-
/** Optional background position for device images */
|
|
280
|
-
imagePosition?: string;
|
|
281
|
-
/** Optional background repeat for device images */
|
|
282
|
-
imageRepeat?: DeviceImageRepeat;
|
|
283
|
-
/** When true, stretch device image to fill the device bounds (overrides imageFit) */
|
|
284
|
-
stretchToFit?: boolean;
|
|
285
|
-
}
|
|
286
|
-
/**
|
|
287
|
-
* Explicit handle placement for a device/PDU port.
|
|
288
|
-
* @public
|
|
289
|
-
*/
|
|
290
|
-
interface PortPosition {
|
|
291
|
-
/** Handle side on the node */
|
|
292
|
-
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
293
|
-
/** Side offset as percentage (0-100) */
|
|
294
|
-
offsetPercent?: number;
|
|
295
|
-
/** Side offset in pixels */
|
|
296
|
-
offsetPx?: number;
|
|
297
|
-
/** Absolute X position as percentage (0-100) */
|
|
298
|
-
xPercent?: number;
|
|
299
|
-
/** Absolute Y position as percentage (0-100) */
|
|
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;
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Recommended simple port input for device and PDU rendering.
|
|
308
|
-
* Pass a flat array in `ports`; `react-networks` groups entries into front/rear
|
|
309
|
-
* `PortBlock[]` internally using each port's `face` and `group`.
|
|
310
|
-
* @public
|
|
311
|
-
*/
|
|
312
|
-
interface DevicePort {
|
|
313
|
-
/** Stable handle identifier override (defaults to `group + label`, or `label` for power) */
|
|
314
|
-
id?: string;
|
|
315
|
-
/** Display label for the port */
|
|
316
|
-
label: string;
|
|
317
|
-
/** Front/rear device face. `back` is accepted as an alias for `rear`. */
|
|
318
|
-
face?: DeviceFace | 'back';
|
|
319
|
-
/** Optional block/group name (for example `Network Ports`, `QSFP28`, `Power Ports`) */
|
|
320
|
-
group?: string;
|
|
321
|
-
/** Optional source/detected family label used for visual kind inference */
|
|
322
|
-
sourceTypeLabel?: string;
|
|
323
|
-
/** Whether the port is currently connected */
|
|
324
|
-
connected?: boolean;
|
|
325
|
-
/** Type of port for styling and validation */
|
|
326
|
-
type?: PortType;
|
|
327
|
-
/** Cable type for connection validation */
|
|
328
|
-
cableType?: PortCableType;
|
|
329
|
-
/** Optional power connector type for rendering (mainly for PDU ports) */
|
|
330
|
-
connectorType?: 'C13' | 'C14' | 'C19' | 'C20';
|
|
331
|
-
/** Optional compatibility keys. When omitted, defaults are derived from type/cable/connector data. */
|
|
332
|
-
compatibility?: string[];
|
|
333
|
-
/** Optional sort order within a face/group bucket */
|
|
334
|
-
order?: number;
|
|
335
|
-
/**
|
|
336
|
-
* Optional placement hint.
|
|
337
|
-
* Use `side` with `offsetPercent`/`offsetPx` for edge-anchored placement,
|
|
338
|
-
* or `xPercent`/`yPercent` for exact coordinates.
|
|
339
|
-
*/
|
|
340
|
-
position?: PortPosition;
|
|
341
|
-
}
|
|
342
|
-
interface Port {
|
|
343
|
-
/** Stable handle identifier override (defaults to `label`) */
|
|
344
|
-
id?: string;
|
|
345
|
-
/** Display label for the port */
|
|
346
|
-
label: string;
|
|
347
|
-
/** Optional source/detected family label used for visual kind inference */
|
|
348
|
-
sourceTypeLabel?: string;
|
|
349
|
-
/** Whether the port is currently connected */
|
|
350
|
-
connected: boolean;
|
|
351
|
-
/** Type of port for styling and validation */
|
|
352
|
-
type?: PortType;
|
|
353
|
-
/** Cable type for connection validation */
|
|
354
|
-
cableType?: PortCableType;
|
|
355
|
-
/** Optional power connector type for rendering (mainly for PDU ports) */
|
|
356
|
-
connectorType?: 'C13' | 'C14' | 'C19' | 'C20';
|
|
357
|
-
/** Optional compatibility keys. When omitted, defaults are derived from type/cable/connector data. */
|
|
358
|
-
compatibility?: string[];
|
|
359
|
-
/** Optional explicit handle placement */
|
|
360
|
-
position?: PortPosition;
|
|
361
|
-
}
|
|
362
|
-
/**
|
|
363
|
-
* Group of related ports on a device
|
|
364
|
-
* @public
|
|
365
|
-
*/
|
|
366
|
-
interface PortBlock {
|
|
367
|
-
/** Name of the port group */
|
|
368
|
-
name: string;
|
|
369
|
-
/** Array of ports in this group */
|
|
370
|
-
ports: Port[];
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Network node types supported by the diagram
|
|
374
|
-
* @public
|
|
375
|
-
*/
|
|
376
|
-
type NetworkNodeType = 'rack' | 'switch' | 'router' | 'server' | 'fiber' | 'patch-panel' | 'device' | 'vertical-pdu' | 'splice' | 'splice-tray' | 'tube' | 'cable' | 'multi-tube-cable' | 'coupler' | 'closure' | 'fibre-split' | 'fibre-flow-cable' | 'fibre-flow-closure';
|
|
377
|
-
/**
|
|
378
|
-
* Device status states
|
|
379
|
-
* @public
|
|
380
|
-
*/
|
|
381
|
-
type DeviceStatus = 'active' | 'inactive' | 'maintenance';
|
|
382
|
-
/**
|
|
383
|
-
* Device face orientations
|
|
384
|
-
* @public
|
|
385
|
-
*/
|
|
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
|
-
};
|
|
398
|
-
/**
|
|
399
|
-
* Rack rendering layout modes.
|
|
400
|
-
* @public
|
|
401
|
-
*/
|
|
402
|
-
type RackLayoutMode = 'single-face' | 'split-face';
|
|
403
|
-
/**
|
|
404
|
-
* Rack mounting behavior for a device.
|
|
405
|
-
* @public
|
|
406
|
-
*/
|
|
407
|
-
type RackMountMode = 'front' | 'rear' | 'both';
|
|
408
|
-
/**
|
|
409
|
-
* Power port side configuration
|
|
410
|
-
* @public
|
|
411
|
-
*/
|
|
412
|
-
type PowerSide = 'left' | 'right';
|
|
413
|
-
/**
|
|
414
|
-
* U numbering direction for racks
|
|
415
|
-
* @public
|
|
416
|
-
*/
|
|
417
|
-
type UNumberingDirection = 'bottom-up' | 'top-down';
|
|
418
|
-
/**
|
|
419
|
-
* Shared node data fields available across node types.
|
|
420
|
-
* Specific node kinds can narrow these fields via `NetworkNodeDataByType`.
|
|
421
|
-
* @public
|
|
422
|
-
*/
|
|
423
|
-
interface NetworkNodeDataBase extends DeviceImageOptions {
|
|
424
|
-
/** Display label for the node */
|
|
425
|
-
label: string;
|
|
426
|
-
/** Current status of the node/device */
|
|
427
|
-
status?: DeviceStatus | string;
|
|
428
|
-
/** Simple flat port input or grouped port blocks. Use `portGroups` / `rearPortGroups` for explicit grouped control. */
|
|
429
|
-
ports?: DevicePort[] | PortBlock[] | number;
|
|
430
|
-
/** Advanced grouped front port input */
|
|
431
|
-
portGroups?: PortBlock[];
|
|
432
|
-
/** Advanced grouped rear port input */
|
|
433
|
-
rearPortGroups?: PortBlock[];
|
|
434
|
-
/** Grouped rear port blocks (rack JSON alias for `rearPortGroups`) */
|
|
435
|
-
rearPorts?: PortBlock[];
|
|
436
|
-
/** List of connected node IDs */
|
|
437
|
-
connections?: string[];
|
|
438
|
-
/** NetBox integration ID */
|
|
439
|
-
netboxId?: number | string;
|
|
440
|
-
/** NetBox object type */
|
|
441
|
-
netboxType?: 'device' | 'rack' | 'interface' | 'cable' | string;
|
|
442
|
-
/** Inventory integration ID */
|
|
443
|
-
inventoryId?: number | string;
|
|
444
|
-
/** Inventory object type */
|
|
445
|
-
inventoryType?: 'device' | 'rack' | 'interface' | 'cable' | string;
|
|
446
|
-
/** Rack height in U units */
|
|
447
|
-
uHeight?: number;
|
|
448
|
-
/** Device position within rack in U units */
|
|
449
|
-
uPosition?: number;
|
|
450
|
-
/** Whether this node is currently mounted inside a rack container */
|
|
451
|
-
isRackMounted?: boolean;
|
|
452
|
-
/** Front/rear orientation for devices and rack faces */
|
|
453
|
-
face?: DeviceFace;
|
|
454
|
-
/** Rack rendering layout mode */
|
|
455
|
-
rackLayout?: RackLayoutMode;
|
|
456
|
-
/** Gap in pixels between front and rear faces in split-face mode */
|
|
457
|
-
rackFaceGapPx?: number;
|
|
458
|
-
/** Device mount behavior within a rack */
|
|
459
|
-
mountMode?: RackMountMode;
|
|
460
|
-
/** Device type specification */
|
|
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;
|
|
467
|
-
/** Device manufacturer */
|
|
468
|
-
manufacturer?: string;
|
|
469
|
-
/** Device role in network */
|
|
470
|
-
role?: string;
|
|
471
|
-
/** Device width configuration */
|
|
472
|
-
width?: Width | number;
|
|
473
|
-
/** Power port side for rear face */
|
|
474
|
-
powerSide?: PowerSide;
|
|
475
|
-
/** Vertical PDU height in centimeters */
|
|
476
|
-
heightCm?: number;
|
|
477
|
-
/** Number of AC power ports */
|
|
478
|
-
powerPorts?: number;
|
|
479
|
-
/** Optional explicit PDU connector sequence */
|
|
480
|
-
portTypes?: Array<'C13' | 'C19'>;
|
|
481
|
-
/** Optional grouped PDU ports (supports custom positions/types) */
|
|
482
|
-
pduPortGroups?: PortBlock[];
|
|
483
|
-
/** Vertical PDU width in pixels */
|
|
484
|
-
widthPx?: number;
|
|
485
|
-
/** Optional management unit position for vertical PDUs */
|
|
486
|
-
mgmt_unit?: 'top' | 'middle' | 'bottom';
|
|
487
|
-
/** U numbering direction for rack nodes */
|
|
488
|
-
uNumberingDirection?: UNumberingDirection;
|
|
489
|
-
/** Custom header text for rack nodes */
|
|
490
|
-
customHeaderText?: string;
|
|
491
|
-
/** Rack UI marker visibility */
|
|
492
|
-
showUMarkers?: boolean;
|
|
493
|
-
/** Holder position within tray (1-12) for splice nodes */
|
|
494
|
-
holderPosition?: number;
|
|
495
|
-
/** Loss value in dB for splice nodes */
|
|
496
|
-
lossDb?: number;
|
|
497
|
-
/** Splice mode */
|
|
498
|
-
mode?: 'single' | 'ribbon';
|
|
499
|
-
/** Legacy ribbon flag */
|
|
500
|
-
ribbon?: boolean;
|
|
501
|
-
/** Ribbon fiber IDs */
|
|
502
|
-
ribbonFiberIds?: number[];
|
|
503
|
-
/** Connector type for coupler nodes */
|
|
504
|
-
connector?: 'SC' | 'LC';
|
|
505
|
-
/** Number of fibers for coupler nodes (1, 2, or 4) */
|
|
506
|
-
couplerFiberCount?: 1 | 2 | 4;
|
|
507
|
-
/** Optional port labels for left side of coupler */
|
|
508
|
-
portLabelsLeft?: string[];
|
|
509
|
-
/** Optional port labels for right side of coupler */
|
|
510
|
-
portLabelsRight?: string[];
|
|
511
|
-
/** Slot position for couplers inside panels (1-based, vertical slots aligned to right edge) */
|
|
512
|
-
slotPosition?: number;
|
|
513
|
-
/** Width override for panel-like container nodes */
|
|
514
|
-
panelWidth?: number;
|
|
515
|
-
/** Height override for panel-like container nodes */
|
|
516
|
-
panelHeight?: number;
|
|
517
|
-
/** Width override for closure nodes */
|
|
518
|
-
closureWidth?: number;
|
|
519
|
-
/** Height override for closure nodes */
|
|
520
|
-
closureHeight?: number;
|
|
521
|
-
/** Optional rack width in pixels (for rack nodes, default: 300px) */
|
|
522
|
-
rackWidthPx?: number;
|
|
523
|
-
/** Number of rows for container nodes (patch-panel, closure) */
|
|
524
|
-
rows?: number;
|
|
525
|
-
/** Number of columns for container nodes (patch-panel, closure) */
|
|
526
|
-
cols?: number;
|
|
527
|
-
/** Number of trays for closure nodes */
|
|
528
|
-
trayCount?: number;
|
|
529
|
-
/** Header text for container nodes */
|
|
530
|
-
header?: string;
|
|
531
|
-
/** Type of fibre splitter: 'splitter' or 'WDM' (default: 'splitter') */
|
|
532
|
-
splitterType?: 'splitter' | 'WDM';
|
|
533
|
-
/** Number of input fibers on the left (1 or 2, default: 1) */
|
|
534
|
-
inputCount?: number;
|
|
535
|
-
/** Number of output fibers on the right (1-64, default: 8) */
|
|
536
|
-
outputCount?: number;
|
|
537
|
-
/** Tube index (1-based) */
|
|
538
|
-
tubeIndex?: number;
|
|
539
|
-
/** Tube count for multi-tube cables */
|
|
540
|
-
tubeCount?: number;
|
|
541
|
-
/** Tube start index for multi-tube cables */
|
|
542
|
-
tubeStartIndex?: number;
|
|
543
|
-
/** Number of fibers per tube */
|
|
544
|
-
fibersPerTube?: number;
|
|
545
|
-
/** Total fiber count for cables */
|
|
546
|
-
fiberCount?: number;
|
|
547
|
-
/** Cable identifier */
|
|
548
|
-
cableId?: string;
|
|
549
|
-
/** Primary node color override */
|
|
550
|
-
color?: string;
|
|
551
|
-
/** Rotation in degrees for rotatable nodes */
|
|
552
|
-
rotation?: number;
|
|
553
|
-
/** Tube handle orientation */
|
|
554
|
-
startOn?: 'left-center' | 'left' | 'right';
|
|
555
|
-
/** Rack metadata for integrations */
|
|
556
|
-
facilityId?: string | number | null;
|
|
557
|
-
/** Rack serial metadata */
|
|
558
|
-
serial?: string | null;
|
|
559
|
-
/** Asset tag metadata */
|
|
560
|
-
assetTag?: string | null;
|
|
561
|
-
/** Site metadata */
|
|
562
|
-
site?: string;
|
|
563
|
-
/** Tenant metadata */
|
|
564
|
-
tenant?: string;
|
|
565
|
-
/** Primary IPv4 metadata */
|
|
566
|
-
primaryIp4?: string;
|
|
567
|
-
/** Primary IPv6 metadata */
|
|
568
|
-
primaryIp6?: string;
|
|
569
|
-
/** Rack name metadata */
|
|
570
|
-
rack?: string | number | null;
|
|
571
|
-
/** Optional arrays used by inventory/netbox transforms */
|
|
572
|
-
racks?: unknown[];
|
|
573
|
-
devices?: unknown[];
|
|
574
|
-
cables?: unknown[];
|
|
575
|
-
/** UI color mode metadata */
|
|
576
|
-
colorMode?: 'light' | 'dark' | 'system';
|
|
577
|
-
/** Generic dimensions used by some helpers */
|
|
578
|
-
height?: number;
|
|
579
|
-
headerHeight?: number;
|
|
580
|
-
/** Optional precomputed map for handle-to-face resolution */
|
|
581
|
-
handleSideMap?: Record<string, DeviceFace>;
|
|
582
|
-
/** Additional extension metadata */
|
|
583
|
-
metadata?: Record<string, unknown>;
|
|
584
|
-
}
|
|
585
|
-
/**
|
|
586
|
-
* Rack node data.
|
|
587
|
-
* @public
|
|
588
|
-
*/
|
|
589
|
-
interface RackNodeData extends NetworkNodeDataBase {
|
|
590
|
-
ports?: number;
|
|
591
|
-
}
|
|
592
|
-
/**
|
|
593
|
-
* Device-like node data (servers/switches/routers/generic device).
|
|
594
|
-
* @public
|
|
595
|
-
*/
|
|
596
|
-
interface DeviceNodeData extends NetworkNodeDataBase {
|
|
597
|
-
ports?: DevicePort[] | PortBlock[] | number;
|
|
598
|
-
}
|
|
599
|
-
/**
|
|
600
|
-
* Fibre flow cable node data.
|
|
601
|
-
* @public
|
|
602
|
-
*/
|
|
603
|
-
interface FibreFlowCableNodeData extends NetworkNodeDataBase {
|
|
604
|
-
cable: FibreFlowCable;
|
|
605
|
-
side: 'left' | 'right';
|
|
606
|
-
rowHeight: number;
|
|
607
|
-
columnWidth: number;
|
|
608
|
-
showTubeLabels: boolean;
|
|
609
|
-
showFiberNumbers: boolean;
|
|
610
|
-
layout: unknown;
|
|
611
|
-
colorMode?: 'dark' | 'light';
|
|
612
|
-
}
|
|
613
|
-
/**
|
|
614
|
-
* Fibre flow closure node data.
|
|
615
|
-
* @public
|
|
616
|
-
*/
|
|
617
|
-
interface FibreFlowClosureNodeData extends NetworkNodeDataBase {
|
|
618
|
-
width?: number;
|
|
619
|
-
height?: number;
|
|
620
|
-
headerHeight?: number;
|
|
621
|
-
colorMode?: 'dark' | 'light';
|
|
622
|
-
}
|
|
623
|
-
/**
|
|
624
|
-
* Mapping from node type to corresponding data type.
|
|
625
|
-
* @public
|
|
626
|
-
*/
|
|
627
|
-
interface NetworkNodeDataByType {
|
|
628
|
-
rack: RackNodeData;
|
|
629
|
-
switch: DeviceNodeData;
|
|
630
|
-
router: DeviceNodeData;
|
|
631
|
-
server: DeviceNodeData;
|
|
632
|
-
fiber: NetworkNodeDataBase;
|
|
633
|
-
'patch-panel': NetworkNodeDataBase;
|
|
634
|
-
device: DeviceNodeData;
|
|
635
|
-
'vertical-pdu': NetworkNodeDataBase;
|
|
636
|
-
splice: NetworkNodeDataBase;
|
|
637
|
-
'splice-tray': NetworkNodeDataBase;
|
|
638
|
-
tube: NetworkNodeDataBase;
|
|
639
|
-
cable: NetworkNodeDataBase;
|
|
640
|
-
'multi-tube-cable': NetworkNodeDataBase;
|
|
641
|
-
coupler: NetworkNodeDataBase;
|
|
642
|
-
closure: NetworkNodeDataBase;
|
|
643
|
-
'fibre-split': NetworkNodeDataBase;
|
|
644
|
-
'fibre-flow-cable': FibreFlowCableNodeData;
|
|
645
|
-
'fibre-flow-closure': FibreFlowClosureNodeData;
|
|
646
|
-
}
|
|
647
|
-
/**
|
|
648
|
-
* Union of all node data variants.
|
|
649
|
-
* @public
|
|
650
|
-
*/
|
|
651
|
-
type NetworkNodeData = NetworkNodeDataByType[NetworkNodeType];
|
|
652
|
-
/**
|
|
653
|
-
* Network node structure with data discriminated by `type`.
|
|
654
|
-
* @public
|
|
655
|
-
*/
|
|
656
|
-
type NetworkNode<TType extends NetworkNodeType = NetworkNodeType, TExtra = unknown> = TType extends NetworkNodeType ? Node<NetworkNodeDataByType[TType] & TExtra, TType> & {
|
|
657
|
-
/** Type of network node */
|
|
658
|
-
type: TType;
|
|
659
|
-
/** Node data and configuration */
|
|
660
|
-
data: NetworkNodeDataByType[TType] & TExtra;
|
|
661
|
-
} : never;
|
|
662
|
-
/**
|
|
663
|
-
* Network edge types
|
|
664
|
-
* @public
|
|
665
|
-
*/
|
|
666
|
-
type NetworkEdgeType = 'fiber' | 'ethernet' | 'power' | 'smoothstep' | 'step' | 'thick-cable' | 'fibre-flow' | 'fibre-flow-link';
|
|
667
|
-
/**
|
|
668
|
-
* Edge data payload.
|
|
669
|
-
* @public
|
|
670
|
-
*/
|
|
671
|
-
interface NetworkEdgeData {
|
|
672
|
-
/** Connection bandwidth */
|
|
673
|
-
bandwidth?: string;
|
|
674
|
-
/** Cable length */
|
|
675
|
-
length?: number;
|
|
676
|
-
/** Edge color for styling */
|
|
677
|
-
color?: string;
|
|
678
|
-
/** Edge kind for styling/validation */
|
|
679
|
-
kind?: 'fiber' | 'power' | 'network';
|
|
680
|
-
/** Whether this edge represents a ribbon fiber connection */
|
|
681
|
-
isRibbon?: boolean;
|
|
682
|
-
/** Array of fiber IDs for ribbon mode (6-12 fibers) */
|
|
683
|
-
ribbonFiberIds?: number[];
|
|
684
|
-
/** Highlight edge with a pulsing stroke */
|
|
685
|
-
highlight?: boolean;
|
|
686
|
-
/** Override highlight color (defaults to edge color) */
|
|
687
|
-
highlightColor?: string;
|
|
688
|
-
/** Override highlight max stroke width */
|
|
689
|
-
highlightWidth?: number;
|
|
690
|
-
/** Optional tag for grouping edges in demos */
|
|
691
|
-
traceTag?: string;
|
|
692
|
-
/** Legacy striped edge flag */
|
|
693
|
-
striped?: boolean;
|
|
694
|
-
/** Cable type metadata used by demos/helpers */
|
|
695
|
-
cableType?: PortCableType;
|
|
696
|
-
/** NetBox integration metadata */
|
|
697
|
-
netboxId?: number | string;
|
|
698
|
-
netboxType?: 'device' | 'rack' | 'interface' | 'cable' | string;
|
|
699
|
-
/** Inventory integration metadata */
|
|
700
|
-
inventoryId?: number | string;
|
|
701
|
-
inventoryType?: 'device' | 'rack' | 'interface' | 'cable' | string;
|
|
702
|
-
/** Status metadata */
|
|
703
|
-
status?: string;
|
|
704
|
-
/** Endpoint metadata */
|
|
705
|
-
terminationA?: string;
|
|
706
|
-
terminationB?: string;
|
|
707
|
-
/** Optional display label for the edge */
|
|
708
|
-
label?: string;
|
|
709
|
-
/** Optional opacity for styling (0–1) */
|
|
710
|
-
opacity?: number;
|
|
711
|
-
/** Optional power edge stroke width override */
|
|
712
|
-
powerStrokeWidth?: number;
|
|
713
|
-
/** Optional power edge stroke dasharray override */
|
|
714
|
-
powerStrokeDasharray?: string;
|
|
715
|
-
/** Optional power edge opacity override (0–1) */
|
|
716
|
-
powerOpacity?: number;
|
|
717
|
-
/** Additional extension metadata */
|
|
718
|
-
metadata?: Record<string, unknown>;
|
|
719
|
-
}
|
|
720
|
-
/**
|
|
721
|
-
* Network edge data structure
|
|
722
|
-
* @public
|
|
723
|
-
*/
|
|
724
|
-
type NetworkEdge<TData extends NetworkEdgeData = NetworkEdgeData> = {
|
|
725
|
-
/** Unique identifier for the edge */
|
|
726
|
-
id: string;
|
|
727
|
-
/** Source node ID */
|
|
728
|
-
source: string;
|
|
729
|
-
/** Target node ID */
|
|
730
|
-
target: string;
|
|
731
|
-
/** Source handle/port ID */
|
|
732
|
-
sourceHandle?: string;
|
|
733
|
-
/** Target handle/port ID */
|
|
734
|
-
targetHandle?: string;
|
|
735
|
-
/** Type of network connection */
|
|
736
|
-
type?: NetworkEdgeType;
|
|
737
|
-
/** Whether the edge should be hidden from rendering */
|
|
738
|
-
hidden?: boolean;
|
|
739
|
-
/** Edge data and configuration */
|
|
740
|
-
data?: TData;
|
|
741
|
-
};
|
|
742
|
-
/**
|
|
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`.
|
|
746
|
-
* @public
|
|
747
|
-
*/
|
|
748
|
-
interface DiagramDocument {
|
|
749
|
-
nodes: DiagramNode[];
|
|
750
|
-
edges: DiagramEdge[];
|
|
751
|
-
ui?: DiagramUiState;
|
|
752
|
-
metadata?: Record<string, unknown>;
|
|
753
|
-
}
|
|
754
|
-
/**
|
|
755
|
-
* Node kinds used by the document model.
|
|
756
|
-
* @public
|
|
757
|
-
*/
|
|
758
|
-
type DiagramNodeKind = 'rack' | 'equipment' | 'pdu' | 'fiber' | 'tube' | 'cable' | 'multi-tube-cable' | 'splice' | 'coupler' | 'splitter' | 'container' | 'fibre-flow-cable' | 'fibre-flow-closure';
|
|
759
|
-
/**
|
|
760
|
-
* Placement data for document nodes.
|
|
761
|
-
* @public
|
|
762
|
-
*/
|
|
763
|
-
interface DiagramNodePlacement {
|
|
764
|
-
position: {
|
|
765
|
-
x: number;
|
|
766
|
-
y: number;
|
|
767
|
-
};
|
|
768
|
-
parentId?: string;
|
|
769
|
-
extent?: 'parent';
|
|
770
|
-
rack?: {
|
|
771
|
-
uPosition?: number;
|
|
772
|
-
mountMode?: RackMountMode;
|
|
773
|
-
rackLayout?: RackLayoutMode;
|
|
774
|
-
rackWidthPx?: number;
|
|
775
|
-
rackFaceGapPx?: number;
|
|
776
|
-
};
|
|
777
|
-
container?: {
|
|
778
|
-
slotPosition?: number;
|
|
779
|
-
holderPosition?: number;
|
|
780
|
-
};
|
|
781
|
-
}
|
|
782
|
-
/**
|
|
783
|
-
* Endpoint definition for document nodes.
|
|
784
|
-
* @public
|
|
785
|
-
*/
|
|
786
|
-
interface DiagramEndpoint {
|
|
787
|
-
id: string;
|
|
788
|
-
label: string;
|
|
789
|
-
face?: DeviceFace | 'internal';
|
|
790
|
-
group?: string;
|
|
791
|
-
role?: 'network' | 'power' | 'fiber' | 'tube' | 'splice' | 'coupler' | 'splitter' | 'cable' | 'generic';
|
|
792
|
-
medium?: 'ethernet' | 'fiber' | 'power' | 'tube' | 'generic';
|
|
793
|
-
type?: PortType;
|
|
794
|
-
cableType?: PortCableType;
|
|
795
|
-
connector?: string;
|
|
796
|
-
compatibility?: string[];
|
|
797
|
-
layout?: PortPosition;
|
|
798
|
-
}
|
|
799
|
-
/**
|
|
800
|
-
* Render-focused node data for the document model.
|
|
801
|
-
* @public
|
|
802
|
-
*/
|
|
803
|
-
interface DiagramNodeRender {
|
|
804
|
-
status?: DeviceStatus | string;
|
|
805
|
-
face?: DeviceFace;
|
|
806
|
-
width?: Width | number;
|
|
807
|
-
widthPx?: number;
|
|
808
|
-
height?: number;
|
|
809
|
-
header?: string;
|
|
810
|
-
color?: string;
|
|
811
|
-
colorMode?: 'light' | 'dark' | 'system';
|
|
812
|
-
rackWidthPx?: number;
|
|
813
|
-
rackFaceGapPx?: number;
|
|
814
|
-
images?: DeviceImageOptions;
|
|
815
|
-
dimensions?: Record<string, number | undefined>;
|
|
816
|
-
showUMarkers?: boolean;
|
|
817
|
-
customHeaderText?: string;
|
|
818
|
-
powerSide?: PowerSide;
|
|
819
|
-
rotation?: number;
|
|
820
|
-
}
|
|
821
|
-
/**
|
|
822
|
-
* External reference attached to a document node.
|
|
823
|
-
* @public
|
|
824
|
-
*/
|
|
825
|
-
interface DiagramExternalRef {
|
|
826
|
-
source: 'netbox' | 'inventory' | string;
|
|
827
|
-
id: string | number;
|
|
828
|
-
type?: string;
|
|
829
|
-
metadata?: Record<string, unknown>;
|
|
830
|
-
}
|
|
831
|
-
/**
|
|
832
|
-
* Document node.
|
|
833
|
-
* @public
|
|
834
|
-
*/
|
|
835
|
-
interface DiagramNode {
|
|
836
|
-
id: string;
|
|
837
|
-
kind: DiagramNodeKind;
|
|
838
|
-
subtype?: string;
|
|
839
|
-
label: string;
|
|
840
|
-
placement: DiagramNodePlacement;
|
|
841
|
-
endpoints?: DiagramEndpoint[];
|
|
842
|
-
render?: DiagramNodeRender;
|
|
843
|
-
config?: Record<string, unknown>;
|
|
844
|
-
externalRefs?: DiagramExternalRef[];
|
|
845
|
-
metadata?: Record<string, unknown>;
|
|
846
|
-
}
|
|
847
|
-
/**
|
|
848
|
-
* Endpoint reference used by document edges.
|
|
849
|
-
* @public
|
|
850
|
-
*/
|
|
851
|
-
interface DiagramEdgeEndpoint {
|
|
852
|
-
nodeId: string;
|
|
853
|
-
endpointId?: string | null;
|
|
854
|
-
}
|
|
855
|
-
/**
|
|
856
|
-
* Document edge.
|
|
857
|
-
* @public
|
|
858
|
-
*/
|
|
859
|
-
interface DiagramEdge {
|
|
860
|
-
id: string;
|
|
861
|
-
source: DiagramEdgeEndpoint;
|
|
862
|
-
target: DiagramEdgeEndpoint;
|
|
863
|
-
type?: NetworkEdgeType;
|
|
864
|
-
hidden?: boolean;
|
|
865
|
-
data?: NetworkEdgeData;
|
|
866
|
-
metadata?: Record<string, unknown>;
|
|
867
|
-
}
|
|
868
|
-
/**
|
|
869
|
-
* Non-topology UI state stored alongside a document.
|
|
870
|
-
* @public
|
|
871
|
-
*/
|
|
872
|
-
interface DiagramUiState {
|
|
873
|
-
nodeState?: Record<string, {
|
|
874
|
-
face?: DeviceFace;
|
|
875
|
-
handleSideMap?: Record<string, DeviceFace>;
|
|
876
|
-
}>;
|
|
877
|
-
metadata?: Record<string, unknown>;
|
|
878
|
-
}
|
|
879
|
-
/**
|
|
880
|
-
* Rack device types
|
|
881
|
-
* @public
|
|
882
|
-
*/
|
|
883
|
-
type RackDeviceType = 'server' | 'switch' | 'router' | 'patch-panel' | 'ups';
|
|
884
|
-
/**
|
|
885
|
-
* Rack configuration structure
|
|
886
|
-
* @public
|
|
887
|
-
*/
|
|
888
|
-
interface RackConfig {
|
|
889
|
-
/** Unique rack identifier */
|
|
890
|
-
id: string;
|
|
891
|
-
/** Rack display name */
|
|
892
|
-
name: string;
|
|
893
|
-
/** Rack position coordinates */
|
|
894
|
-
position: {
|
|
895
|
-
x: number;
|
|
896
|
-
y: number;
|
|
897
|
-
};
|
|
898
|
-
/** Rack height in U units */
|
|
899
|
-
units: number;
|
|
900
|
-
/** U numbering direction (default: 'bottom-up') */
|
|
901
|
-
uNumberingDirection?: UNumberingDirection;
|
|
902
|
-
/** Custom header text for rack */
|
|
903
|
-
customHeaderText?: string;
|
|
904
|
-
/** Rack rendering layout mode */
|
|
905
|
-
rackLayout?: RackLayoutMode;
|
|
906
|
-
/** Gap in pixels between front and rear faces in split-face mode */
|
|
907
|
-
rackFaceGapPx?: number;
|
|
908
|
-
/** Devices mounted in the rack */
|
|
909
|
-
devices: RackDevice[];
|
|
910
|
-
/** Optional rack width in pixels (default: 300px which represents standard 48.26cm/19" rack) */
|
|
911
|
-
rackWidthPx?: number;
|
|
912
|
-
}
|
|
913
|
-
/**
|
|
914
|
-
* Device mounted in a rack
|
|
915
|
-
* @public
|
|
916
|
-
*/
|
|
917
|
-
interface RackDevice extends DeviceImageOptions {
|
|
918
|
-
/** Unique device identifier */
|
|
919
|
-
id: string;
|
|
920
|
-
/** Device display name */
|
|
921
|
-
name: string;
|
|
922
|
-
/** Starting U position in rack */
|
|
923
|
-
unit: number;
|
|
924
|
-
/** Device height in U units */
|
|
925
|
-
height: number;
|
|
926
|
-
/** Device type */
|
|
927
|
-
type: RackDeviceType;
|
|
928
|
-
/** Device width configuration */
|
|
929
|
-
width?: Width;
|
|
930
|
-
/** Device mount behavior within a rack */
|
|
931
|
-
mountMode?: RackMountMode;
|
|
932
|
-
/** Device role in network */
|
|
933
|
-
role?: string;
|
|
934
|
-
/** Recommended simple port input (flat `DevicePort[]` or grouped `PortBlock[]`). */
|
|
935
|
-
ports?: DevicePort[] | PortBlock[];
|
|
936
|
-
/** Current status of the device */
|
|
937
|
-
status?: DeviceStatus | string;
|
|
938
|
-
/** Advanced grouped front port input */
|
|
939
|
-
portGroups?: PortBlock[];
|
|
940
|
-
/** Advanced grouped rear port input */
|
|
941
|
-
rearPortGroups?: PortBlock[];
|
|
942
|
-
/** Grouped rear port blocks (rack JSON alias for `rearPortGroups`) */
|
|
943
|
-
rearPorts?: PortBlock[];
|
|
944
|
-
/** Power port side for rear face */
|
|
945
|
-
powerSide?: PowerSide;
|
|
946
|
-
/** Connected device IDs */
|
|
947
|
-
connections?: string[];
|
|
948
|
-
}
|
|
949
|
-
/**
|
|
950
|
-
* Fiber cable types
|
|
951
|
-
* @public
|
|
952
|
-
*/
|
|
953
|
-
type FiberCableType = 'single-mode' | 'multi-mode';
|
|
954
|
-
/**
|
|
955
|
-
* Fiber cable configuration
|
|
956
|
-
* @public
|
|
957
|
-
*/
|
|
958
|
-
interface FiberCable {
|
|
959
|
-
/** Unique cable identifier */
|
|
960
|
-
id: string;
|
|
961
|
-
/** Cable display name */
|
|
962
|
-
name: string;
|
|
963
|
-
/** Fiber cable type */
|
|
964
|
-
type: FiberCableType;
|
|
965
|
-
/** Cable length */
|
|
966
|
-
length: number;
|
|
967
|
-
/** Cable color for visualization */
|
|
968
|
-
color: string;
|
|
969
|
-
/** Connection endpoints */
|
|
970
|
-
connections: {
|
|
971
|
-
/** Source connection point */
|
|
972
|
-
from: string;
|
|
973
|
-
/** Target connection point */
|
|
974
|
-
to: string;
|
|
975
|
-
};
|
|
976
|
-
}
|
|
977
|
-
/**
|
|
978
|
-
* Splice configuration structure
|
|
979
|
-
* @public
|
|
980
|
-
*/
|
|
981
|
-
interface SpliceConfig {
|
|
982
|
-
/** Unique splice identifier */
|
|
983
|
-
id: string;
|
|
984
|
-
/** Splice display name */
|
|
985
|
-
name: string;
|
|
986
|
-
/** Holder position within tray (1-12) */
|
|
987
|
-
holder: number;
|
|
988
|
-
/** Loss value in dB */
|
|
989
|
-
lossDb?: number;
|
|
990
|
-
/** Splice mode: 'single' for individual fiber, 'ribbon' for ribbon splices */
|
|
991
|
-
mode?: 'single' | 'ribbon';
|
|
992
|
-
/** For ribbon mode: array of fiber IDs (6-12) in the ribbon */
|
|
993
|
-
ribbonFiberIds?: number[];
|
|
994
|
-
}
|
|
995
|
-
/**
|
|
996
|
-
* Splice tray configuration structure
|
|
997
|
-
* @public
|
|
998
|
-
*/
|
|
999
|
-
interface SpliceTrayConfig {
|
|
1000
|
-
/** Unique tray identifier */
|
|
1001
|
-
id: string;
|
|
1002
|
-
/** Tray display name */
|
|
1003
|
-
name: string;
|
|
1004
|
-
/** Tray position coordinates */
|
|
1005
|
-
position: {
|
|
1006
|
-
x: number;
|
|
1007
|
-
y: number;
|
|
1008
|
-
};
|
|
1009
|
-
/** Splices in this tray */
|
|
1010
|
-
splices: SpliceConfig[];
|
|
1011
|
-
}
|
|
1012
|
-
/**
|
|
1013
|
-
* Fine-grained interaction controls for network diagrams.
|
|
1014
|
-
* @public
|
|
1015
|
-
*/
|
|
1016
|
-
interface NetworkDiagramInteractionOptions {
|
|
1017
|
-
/** Enable node dragging. */
|
|
1018
|
-
nodesDraggable?: boolean;
|
|
1019
|
-
/** Enable creating connections from node handles. */
|
|
1020
|
-
nodesConnectable?: boolean;
|
|
1021
|
-
/** Enable selecting nodes/edges. */
|
|
1022
|
-
elementsSelectable?: boolean;
|
|
1023
|
-
/** Enable keyboard/mouse focus on edges. */
|
|
1024
|
-
edgesFocusable?: boolean;
|
|
1025
|
-
/** Enable reconnecting existing edges. */
|
|
1026
|
-
edgesReconnectable?: boolean;
|
|
1027
|
-
/** Enable click-to-connect behavior on handles. */
|
|
1028
|
-
connectOnClick?: boolean;
|
|
1029
|
-
/** Enable panning by dragging the canvas. */
|
|
1030
|
-
panOnDrag?: boolean;
|
|
1031
|
-
/** Enable panning by scrolling. */
|
|
1032
|
-
panOnScroll?: boolean;
|
|
1033
|
-
/** Enable zoom via mouse wheel/trackpad scroll. */
|
|
1034
|
-
zoomOnScroll?: boolean;
|
|
1035
|
-
/** Enable pinch-zoom gestures. */
|
|
1036
|
-
zoomOnPinch?: boolean;
|
|
1037
|
-
/** Enable zoom on double click. */
|
|
1038
|
-
zoomOnDoubleClick?: boolean;
|
|
1039
|
-
/** Enable deleting selected edges with keyboard keys. */
|
|
1040
|
-
allowKeyboardDelete?: boolean;
|
|
1041
|
-
/** Show or hide the built-in React Flow controls widget. */
|
|
1042
|
-
showControls?: boolean;
|
|
1043
|
-
/** Show or hide the minimap. */
|
|
1044
|
-
showMiniMap?: boolean;
|
|
1045
|
-
/** Show or hide the interactive lock/unlock button in controls. */
|
|
1046
|
-
showInteractiveControl?: boolean;
|
|
1047
|
-
}
|
|
1048
|
-
/**
|
|
1049
|
-
* Selection action panel options rendered above selected racks/devices.
|
|
1050
|
-
* @public
|
|
1051
|
-
*/
|
|
1052
|
-
interface NetworkDiagramActionPanelOptions {
|
|
1053
|
-
/** Enable or disable the floating action panel entirely. Defaults to true. */
|
|
1054
|
-
enabled?: boolean;
|
|
1055
|
-
/** Show or hide the front/rear toggle button. Defaults to true. */
|
|
1056
|
-
showRearToggle?: boolean;
|
|
1057
|
-
/** Show or hide the De-rack button for rack-mounted devices. Defaults to true. */
|
|
1058
|
-
showDeRack?: boolean;
|
|
1059
|
-
}
|
|
1060
|
-
/**
|
|
1061
|
-
* Serializable flow snapshot payload for save/restore helpers.
|
|
1062
|
-
* @public
|
|
1063
|
-
*/
|
|
1064
|
-
interface NetworkDiagramFlowObject {
|
|
1065
|
-
/** Snapshot nodes */
|
|
1066
|
-
nodes: NetworkNode[];
|
|
1067
|
-
/** Snapshot edges */
|
|
1068
|
-
edges: NetworkEdge[];
|
|
1069
|
-
/** Optional viewport state */
|
|
1070
|
-
viewport?: Viewport;
|
|
1071
|
-
}
|
|
1072
|
-
/**
|
|
1073
|
-
* Options for exported diagram images.
|
|
1074
|
-
* @public
|
|
1075
|
-
*/
|
|
1076
|
-
interface NetworkDiagramToImageOptions {
|
|
1077
|
-
/** Export width in px (clamped to 1-8192). */
|
|
1078
|
-
width?: number;
|
|
1079
|
-
/** Export height in px (clamped to 1-8192). */
|
|
1080
|
-
height?: number;
|
|
1081
|
-
backgroundColor?: string;
|
|
1082
|
-
/** Export padding in px (clamped to 0-2048). */
|
|
1083
|
-
padding?: number;
|
|
1084
|
-
/** Device pixel ratio multiplier (clamped to 0.1-4). */
|
|
1085
|
-
pixelRatio?: number;
|
|
1086
|
-
/** JPEG/WebP quality (clamped to 0-1 when used). */
|
|
1087
|
-
quality?: number;
|
|
1088
|
-
filter?: (domNode: HTMLElement) => boolean;
|
|
1089
|
-
}
|
|
1090
|
-
/**
|
|
1091
|
-
* Fit-view options that support targeting node IDs directly.
|
|
1092
|
-
* @public
|
|
1093
|
-
*/
|
|
1094
|
-
interface NetworkDiagramFitViewOptions extends Omit<FitViewOptions, 'nodes'> {
|
|
1095
|
-
/** Optional node IDs to fit */
|
|
1096
|
-
nodes?: string[];
|
|
1097
|
-
}
|
|
1098
|
-
/**
|
|
1099
|
-
* Exposed methods for save/restore and export integrations.
|
|
1100
|
-
* @public
|
|
1101
|
-
*/
|
|
1102
|
-
interface NetworkDiagramFlowMethods {
|
|
1103
|
-
toObject: () => NetworkDiagramFlowObject;
|
|
1104
|
-
setViewport: (viewport: Viewport) => void;
|
|
1105
|
-
setNodes: (nodes: NetworkNode[]) => void;
|
|
1106
|
-
setEdges: (edges: NetworkEdge[]) => void;
|
|
1107
|
-
toImage: (options?: NetworkDiagramToImageOptions) => Promise<string>;
|
|
1108
|
-
getNodes: () => NetworkNode[];
|
|
1109
|
-
getEdges: () => NetworkEdge[];
|
|
1110
|
-
fitView: (options?: NetworkDiagramFitViewOptions) => void;
|
|
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
|
-
}
|
|
1139
|
-
/**
|
|
1140
|
-
* Store contract accepted by `NetworkDiagram`.
|
|
1141
|
-
* @public
|
|
1142
|
-
*/
|
|
1143
|
-
interface NetworkDiagramStoreApi {
|
|
1144
|
-
getState: () => NetworkDiagramStoreState;
|
|
1145
|
-
setState: (partial: Partial<NetworkDiagramStoreState>) => void;
|
|
1146
|
-
subscribe: (listener: (state: NetworkDiagramStoreState) => void) => () => void;
|
|
1147
|
-
selectEdgeZIndex: (edge: NetworkEdge) => number;
|
|
1148
|
-
validateConnection: (params: NetworkDiagramValidateConnectionParams) => NetworkDiagramValidationResult;
|
|
1149
|
-
selectNodeById: (id: string) => NetworkNode | undefined;
|
|
1150
|
-
selectConnectedEdges: (nodeId: string) => NetworkEdge[];
|
|
1151
|
-
}
|
|
1152
|
-
/**
|
|
1153
|
-
* Network diagram component props
|
|
1154
|
-
* @public
|
|
1155
|
-
*/
|
|
1156
|
-
interface NetworkDiagramProps {
|
|
1157
|
-
/** Controlled document model. When provided, it takes precedence over nodes/edges props. */
|
|
1158
|
-
document?: DiagramDocument;
|
|
1159
|
-
/** Initial document for uncontrolled document mode. */
|
|
1160
|
-
initialDocument?: DiagramDocument;
|
|
1161
|
-
/** Callback when the document changes in document mode. */
|
|
1162
|
-
onDocumentChange?: (document: DiagramDocument) => void;
|
|
1163
|
-
/** Controlled nodes array */
|
|
1164
|
-
nodes?: NetworkNode[];
|
|
1165
|
-
/** Controlled edges array */
|
|
1166
|
-
edges?: NetworkEdge[];
|
|
1167
|
-
/** Callback when nodes change (controlled mode) */
|
|
1168
|
-
onNodesChange?: (nodes: NetworkNode[]) => void;
|
|
1169
|
-
/** Callback when edges change (controlled mode) */
|
|
1170
|
-
onEdgesChange?: (edges: NetworkEdge[]) => void;
|
|
1171
|
-
/** Initial nodes for uncontrolled mode */
|
|
1172
|
-
initialNodes?: NetworkNode[];
|
|
1173
|
-
/** Initial edges for uncontrolled mode */
|
|
1174
|
-
initialEdges?: NetworkEdge[];
|
|
1175
|
-
/** Headless store injection */
|
|
1176
|
-
store?: NetworkDiagramStoreApi;
|
|
1177
|
-
/** Enable debug mode */
|
|
1178
|
-
debug?: boolean;
|
|
1179
|
-
/** Callback when a node is clicked or selection changes (null when deselected) */
|
|
1180
|
-
onNodeClick?: (node: NetworkNode | null) => void;
|
|
1181
|
-
/** Callback when an edge is clicked */
|
|
1182
|
-
onEdgeClick?: (edge: NetworkEdge) => void;
|
|
1183
|
-
/** Custom React Flow node types to merge with defaults */
|
|
1184
|
-
nodeTypes?: NodeTypes;
|
|
1185
|
-
/** Custom React Flow edge types to merge with defaults */
|
|
1186
|
-
edgeTypes?: EdgeTypes;
|
|
1187
|
-
/** Optional onConnect override (React Flow connection handler) */
|
|
1188
|
-
onConnect?: (connection: Connection) => void;
|
|
1189
|
-
/** Optional onEdgeUpdate override */
|
|
1190
|
-
onEdgeUpdate?: (oldEdge: Edge, newConnection: Connection) => void;
|
|
1191
|
-
/** Optional isValidConnection override */
|
|
1192
|
-
isValidConnection?: (connection: Connection) => boolean;
|
|
1193
|
-
/** Optional connection mode override */
|
|
1194
|
-
connectionMode?: ConnectionMode;
|
|
1195
|
-
/** Callback when a device face changes */
|
|
1196
|
-
onFaceChange?: (nodeId: string, face: DeviceFace) => void;
|
|
1197
|
-
/** Callback when rack face changes */
|
|
1198
|
-
onRackFaceChange?: (rackId: string, face: DeviceFace) => void;
|
|
1199
|
-
/** CSS class name */
|
|
1200
|
-
className?: string;
|
|
1201
|
-
/** Inline styles */
|
|
1202
|
-
style?: React.CSSProperties;
|
|
1203
|
-
/** If true, vertically align rack bottoms to the same baseline */
|
|
1204
|
-
alignRacksToBottom?: boolean;
|
|
1205
|
-
/** Allow rack-mounted devices to move between racks/ungroup on drag and drop. Defaults to true. */
|
|
1206
|
-
reAssignable?: boolean;
|
|
1207
|
-
/** Color mode for the diagram */
|
|
1208
|
-
colorMode?: 'light' | 'dark' | 'system';
|
|
1209
|
-
/** Callback when React Flow instance is initialized */
|
|
1210
|
-
onInit?: (instance: ReactFlowInstance) => void;
|
|
1211
|
-
/** Callback to get React Flow methods for save/restore */
|
|
1212
|
-
onFlowMethods?: (methods: NetworkDiagramFlowMethods) => void;
|
|
1213
|
-
/** Show download button */
|
|
1214
|
-
showDownloadButton?: boolean;
|
|
1215
|
-
/** Download button position */
|
|
1216
|
-
downloadButtonPosition?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
|
|
1217
|
-
/** Custom download button text */
|
|
1218
|
-
downloadButtonText?: string;
|
|
1219
|
-
/** Download button styling options */
|
|
1220
|
-
downloadButtonStyle?: React.CSSProperties;
|
|
1221
|
-
/** Use smoothstep edges for tube connections (both tube-to-cable and cable-to-tube). Default is fiber. */
|
|
1222
|
-
useSmoothstepEdgesForTubes?: boolean;
|
|
1223
|
-
/** Force read-only behavior for the diagram (no drag/connect/delete/reconnect/pan/zoom edits). */
|
|
1224
|
-
readOnly?: boolean;
|
|
1225
|
-
/** Centralized interaction options for consistent edit/lock behavior. */
|
|
1226
|
-
interaction?: NetworkDiagramInteractionOptions;
|
|
1227
|
-
/** Configuration for the floating action panel shown on selected rack/device nodes. */
|
|
1228
|
-
actionPanel?: NetworkDiagramActionPanelOptions;
|
|
1229
|
-
/** Optional fitView options passed to React Flow */
|
|
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;
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
declare const NetworkDiagram: React$1.FC<NetworkDiagramProps>;
|
|
187
|
+
declare const NetworkDiagram: React.FC<NetworkDiagramProps>;
|
|
1259
188
|
|
|
1260
189
|
interface DiagramErrorBoundaryProps {
|
|
1261
190
|
/** Content to render when an error is caught */
|
|
@@ -1301,16 +230,23 @@ interface RackNodeProps extends NodeProps<NetworkNode['data']> {
|
|
|
1301
230
|
onRackFaceChange?: (rackId: string, face: 'front' | 'rear') => void;
|
|
1302
231
|
isDragOver?: boolean;
|
|
1303
232
|
}
|
|
1304
|
-
/**
|
|
1305
|
-
|
|
233
|
+
/**
|
|
234
|
+
* Memoized; uses useStoreApi (not useReactFlow) so rack chrome does not re-render on every node move.
|
|
235
|
+
*
|
|
236
|
+
* The comparator intentionally omits the `onFaceChange` / `onRackFaceChange` function
|
|
237
|
+
* props: this is only safe because `NetworkDiagram` passes them as ref-backed stable
|
|
238
|
+
* callbacks. If a caller ever renders `RackNode` with unstable face-change handlers,
|
|
239
|
+
* add them here or the node will keep a stale callback.
|
|
240
|
+
*/
|
|
241
|
+
declare const RackNode: React.NamedExoticComponent<RackNodeProps>;
|
|
1306
242
|
|
|
1307
|
-
declare const FiberNode: React
|
|
243
|
+
declare const FiberNode: React.FC<NodeProps<NetworkNode['data']>>;
|
|
1308
244
|
|
|
1309
|
-
declare const FiberEdge: React
|
|
1310
|
-
label?: string | React
|
|
1311
|
-
labelStyle?: React
|
|
245
|
+
declare const FiberEdge: React.NamedExoticComponent<Pick<reactflow.Edge<NetworkEdgeData | undefined>, "id" | "source" | "target" | "data" | "style" | "selected" | "animated"> & Pick<reactflow.WrapEdgeProps<any>, "sourcePosition" | "targetPosition" | "interactionWidth" | "sourceX" | "sourceY" | "targetX" | "targetY" | "sourceHandleId" | "targetHandleId"> & {
|
|
246
|
+
label?: string | React.ReactNode;
|
|
247
|
+
labelStyle?: React.CSSProperties;
|
|
1312
248
|
labelShowBg?: boolean;
|
|
1313
|
-
labelBgStyle?: React
|
|
249
|
+
labelBgStyle?: React.CSSProperties;
|
|
1314
250
|
labelBgPadding?: [number, number];
|
|
1315
251
|
labelBgBorderRadius?: number;
|
|
1316
252
|
} & {
|
|
@@ -1321,16 +257,16 @@ declare const FiberEdge: React$1.NamedExoticComponent<Pick<reactflow.Edge<Networ
|
|
|
1321
257
|
className?: string;
|
|
1322
258
|
}>;
|
|
1323
259
|
|
|
1324
|
-
declare const PowerEdge: React
|
|
260
|
+
declare const PowerEdge: React.NamedExoticComponent<EdgeProps>;
|
|
1325
261
|
|
|
1326
262
|
/** Memoized to avoid re-rendering rack devices when unrelated nodes move (React Flow perf guide). */
|
|
1327
|
-
declare const DeviceNode: React
|
|
263
|
+
declare const DeviceNode: React.NamedExoticComponent<NodeProps<NetworkNodeDataBase | RackNodeData | DeviceNodeData | FibreFlowCableNodeData | FibreFlowClosureNodeData>>;
|
|
1328
264
|
|
|
1329
|
-
declare const VerticalPDU: React
|
|
265
|
+
declare const VerticalPDU: React.NamedExoticComponent<NodeProps<NetworkNodeDataBase | RackNodeData | DeviceNodeData | FibreFlowCableNodeData | FibreFlowClosureNodeData>>;
|
|
1330
266
|
|
|
1331
|
-
declare const SpliceNode: React
|
|
267
|
+
declare const SpliceNode: React.FC<NodeProps<NetworkNode['data']>>;
|
|
1332
268
|
|
|
1333
|
-
declare const SpliceTrayNode: React
|
|
269
|
+
declare const SpliceTrayNode: React.FC<NodeProps<NetworkNode['data']>>;
|
|
1334
270
|
|
|
1335
271
|
/**
|
|
1336
272
|
* TubeNode
|
|
@@ -1342,7 +278,7 @@ declare const SpliceTrayNode: React$1.FC<NodeProps<NetworkNode['data']>>;
|
|
|
1342
278
|
* - 'left': handles on left side, tube handle on left
|
|
1343
279
|
* - 'right': handles on right side with reversed colors, tube handle on right
|
|
1344
280
|
*/
|
|
1345
|
-
declare const TubeNode: React
|
|
281
|
+
declare const TubeNode: React.FC<NodeProps<NetworkNode['data']>>;
|
|
1346
282
|
|
|
1347
283
|
/**
|
|
1348
284
|
* CableNode
|
|
@@ -1350,7 +286,7 @@ declare const TubeNode: React$1.FC<NodeProps<NetworkNode['data']>>;
|
|
|
1350
286
|
* - Each colored handle corresponds to a single fiber
|
|
1351
287
|
* - Displays cable summary text (fiber count + cable identifier)
|
|
1352
288
|
*/
|
|
1353
|
-
declare const CableNode: React
|
|
289
|
+
declare const CableNode: React.FC<NodeProps<NetworkNode['data']>>;
|
|
1354
290
|
|
|
1355
291
|
/**
|
|
1356
292
|
* MultiTubeCableNode
|
|
@@ -1358,13 +294,13 @@ declare const CableNode: React$1.FC<NodeProps<NetworkNode['data']>>;
|
|
|
1358
294
|
* - Each colored handle corresponds to a tube within the cable
|
|
1359
295
|
* - Displays cable summary text (fiber count + cable identifier)
|
|
1360
296
|
*/
|
|
1361
|
-
declare const MultiTubeCableNode: React
|
|
297
|
+
declare const MultiTubeCableNode: React.FC<NodeProps<NetworkNode['data']>>;
|
|
1362
298
|
|
|
1363
|
-
declare const CouplerNode: React
|
|
299
|
+
declare const CouplerNode: React.FC<NodeProps<NetworkNode['data']>>;
|
|
1364
300
|
|
|
1365
|
-
declare const PatchPanelNode: React
|
|
301
|
+
declare const PatchPanelNode: React.FC<NodeProps<NetworkNode['data']>>;
|
|
1366
302
|
|
|
1367
|
-
declare const ClosureNode: React
|
|
303
|
+
declare const ClosureNode: React.FC<NodeProps<NetworkNode['data']>>;
|
|
1368
304
|
|
|
1369
305
|
/**
|
|
1370
306
|
* FibreSplitNode component for rendering fiber splitters and WDM devices
|
|
@@ -1372,7 +308,7 @@ declare const ClosureNode: React$1.FC<NodeProps<NetworkNode['data']>>;
|
|
|
1372
308
|
*
|
|
1373
309
|
* @public
|
|
1374
310
|
*/
|
|
1375
|
-
declare const FibreSplitNode: React
|
|
311
|
+
declare const FibreSplitNode: React.FC<NodeProps<NetworkNode['data']>>;
|
|
1376
312
|
|
|
1377
313
|
type FibreFlowLayoutDirection = 'horizontal' | 'vertical';
|
|
1378
314
|
type FibreFlowColorMode = 'dark' | 'light';
|
|
@@ -1391,11 +327,11 @@ interface FibreFlowMapProps {
|
|
|
1391
327
|
colorMode?: FibreFlowColorMode;
|
|
1392
328
|
showCircuitId?: boolean;
|
|
1393
329
|
className?: string;
|
|
1394
|
-
style?: React
|
|
330
|
+
style?: React.CSSProperties;
|
|
1395
331
|
readOnly?: boolean;
|
|
1396
332
|
interaction?: NetworkDiagramInteractionOptions;
|
|
1397
333
|
}
|
|
1398
|
-
declare const FibreFlowMap: React
|
|
334
|
+
declare const FibreFlowMap: React.FC<FibreFlowMapProps>;
|
|
1399
335
|
|
|
1400
336
|
interface FibreFlowRow {
|
|
1401
337
|
key: string;
|
|
@@ -1429,7 +365,7 @@ interface FibreCableWithTubesExpandedProps {
|
|
|
1429
365
|
showFiberNumbers?: boolean;
|
|
1430
366
|
showCableLabel?: boolean;
|
|
1431
367
|
}
|
|
1432
|
-
declare const FibreCableWithTubesExpanded: React
|
|
368
|
+
declare const FibreCableWithTubesExpanded: React.FC<FibreCableWithTubesExpandedProps>;
|
|
1433
369
|
|
|
1434
370
|
interface InventoryRackDTO {
|
|
1435
371
|
id: string | number;
|
|
@@ -2106,13 +1042,20 @@ declare function buildPortBlocksFromPorts(devicePorts: DevicePort[]): {
|
|
|
2106
1042
|
rearPorts: PortBlock[];
|
|
2107
1043
|
};
|
|
2108
1044
|
/**
|
|
2109
|
-
*
|
|
2110
|
-
*
|
|
1045
|
+
* Node-data subset accepted by {@link getResolvedPortBlocks}: a flat
|
|
1046
|
+
* `DevicePort[]` on `ports`, grouped `PortBlock[]` on
|
|
1047
|
+
* `ports`/`portGroups`/`rearPortGroups`, or a `rearPorts` block fallback.
|
|
2111
1048
|
* @public
|
|
2112
1049
|
*/
|
|
2113
1050
|
type ResolvedPortBlockInput = Pick<NetworkNode['data'], 'ports' | 'portGroups' | 'rearPortGroups'> & {
|
|
2114
1051
|
rearPorts?: PortBlock[];
|
|
2115
1052
|
};
|
|
1053
|
+
/**
|
|
1054
|
+
* Resolve the grouped front/rear port blocks from any supported input form:
|
|
1055
|
+
* flat `ports: DevicePort[]`, grouped `PortBlock[]`, or explicit
|
|
1056
|
+
* `portGroups` / `rearPortGroups`.
|
|
1057
|
+
* @public
|
|
1058
|
+
*/
|
|
2116
1059
|
declare function getResolvedPortBlocks(data: ResolvedPortBlockInput | undefined): {
|
|
2117
1060
|
ports: PortBlock[];
|
|
2118
1061
|
rearPorts: PortBlock[];
|
|
@@ -2143,146 +1086,6 @@ declare function hasRearPorts(data: Pick<NetworkNode['data'], 'ports' | 'portGro
|
|
|
2143
1086
|
*/
|
|
2144
1087
|
declare function getDefaultDeviceFace(data: Pick<NetworkNode['data'], 'ports' | 'portGroups' | 'rearPortGroups'> | undefined): DeviceFace;
|
|
2145
1088
|
|
|
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
|
-
};
|
|
2278
|
-
|
|
2279
|
-
interface NetworkGraphSnapshot {
|
|
2280
|
-
nodes: NetworkNode[];
|
|
2281
|
-
edges: NetworkEdge[];
|
|
2282
|
-
}
|
|
2283
|
-
declare function networkGraphToDiagramDocument(snapshot: NetworkGraphSnapshot, previousDocument?: DiagramDocument): DiagramDocument;
|
|
2284
|
-
declare function diagramDocumentToNetworkGraph(document: DiagramDocument): NetworkGraphSnapshot;
|
|
2285
|
-
|
|
2286
1089
|
type EndpointConnectionKind = 'power' | 'network' | 'unknown';
|
|
2287
1090
|
interface EndpointMetadata {
|
|
2288
1091
|
normalizedHandle: string;
|
|
@@ -2401,7 +1204,7 @@ declare function isStriped(id: FiberColorId | number): boolean;
|
|
|
2401
1204
|
* @returns CSS properties for the color
|
|
2402
1205
|
* @public
|
|
2403
1206
|
*/
|
|
2404
|
-
declare function fiberSolidOrStriped(id: FiberColorId | number): React
|
|
1207
|
+
declare function fiberSolidOrStriped(id: FiberColorId | number): React.CSSProperties;
|
|
2405
1208
|
/**
|
|
2406
1209
|
* Get the hex color code for a fiber color ID
|
|
2407
1210
|
* @param id - Fiber color ID (1-24)
|
|
@@ -2495,9 +1298,11 @@ declare const DEFAULT_DIAGRAM_DIM_OPACITY = 0.25;
|
|
|
2495
1298
|
declare function hasDiagramFocus(options: DiagramFocusOptions): boolean;
|
|
2496
1299
|
declare function isNodeInDiagramFocus(nodeId: string, options: DiagramFocusOptions): boolean;
|
|
2497
1300
|
declare function isEdgeInDiagramFocus(edgeId: string, edge: Pick<NetworkEdge, 'source' | 'target'>, options: DiagramFocusOptions): boolean;
|
|
1301
|
+
/** A {@link NetworkNode} carrying the runtime `style` React Flow applies (e.g. dim opacity). @public */
|
|
2498
1302
|
type RuntimeNode = NetworkNode & {
|
|
2499
1303
|
style?: CSSProperties;
|
|
2500
1304
|
};
|
|
1305
|
+
/** A {@link NetworkEdge} carrying the runtime `style` React Flow applies (e.g. dim opacity). @public */
|
|
2501
1306
|
type RuntimeEdge = NetworkEdge & {
|
|
2502
1307
|
style?: CSSProperties;
|
|
2503
1308
|
};
|
|
@@ -2514,7 +1319,7 @@ type DiagramPortContextValue = {
|
|
|
2514
1319
|
onPortClick?: (payload: DiagramPortClickPayload) => void;
|
|
2515
1320
|
portClickEnabled: boolean;
|
|
2516
1321
|
};
|
|
2517
|
-
declare const DiagramPortProvider: React
|
|
1322
|
+
declare const DiagramPortProvider: React.Provider<DiagramPortContextValue>;
|
|
2518
1323
|
declare function useDiagramPortInteraction(): DiagramPortContextValue;
|
|
2519
1324
|
declare function isDiagramPortHandleHighlighted(highlightedPortHandles: readonly DiagramPortHandleRef[] | undefined, nodeId: string, handleId: string): boolean;
|
|
2520
1325
|
|
|
@@ -2827,4 +1632,4 @@ declare function useNetworkDiagram(store: NetworkDiagramStore): NetworkDiagramSt
|
|
|
2827
1632
|
declare function useNodes(store: NetworkDiagramStore): NetworkNode[];
|
|
2828
1633
|
declare function useEdges(store: NetworkDiagramStore): NetworkEdge[];
|
|
2829
1634
|
|
|
2830
|
-
export {
|
|
1635
|
+
export { COUPLERS_PER_PANEL, COUPLER_SLOT_HEIGHT_PX, COUPLER_WIDTH_PX, CableNode, ClosureNode, CouplerNode, DEFAULT_DIAGRAM_DIM_OPACITY, DeviceFace, DeviceNode, DeviceNodeData, DevicePlacementError, type DevicePlacementValidation, DevicePort, DeviceStatus, type DeviceTemplateV2, DiagramDocument, DiagramErrorBoundary, type DiagramErrorBoundaryProps, type DiagramErrorBoundaryState, type DiagramFocusOptions, DiagramPortClickPayload, type DiagramPortContextValue, DiagramPortHandleRef, DiagramPortProvider, type EndpointConnectionKind, type EndpointMetadata, FIBER_COLORS_12, type FiberColorId, FiberEdge, FiberNode, FibreCableWithTubesExpanded, type FibreCableWithTubesExpandedProps, FibreFlowCable, type FibreFlowCableLayout, FibreFlowCableNodeData, FibreFlowCircuit, FibreFlowClosure, FibreFlowClosureNodeData, type FibreFlowColorMode, type FibreFlowLayoutDirection, FibreFlowMap, type FibreFlowMapProps, type FibreFlowRow, type FibreFlowTubeLabel, FibreSplitNode, HANDLE_EXTENSION_PX, type InventoryCableDTO, type InventoryDeviceDTO, type InventoryRackDTO, type MountClass, MultiTubeCableNode, type NetBoxCable, type NetBoxDevice, type NetBoxDeviceTransformOptions, type NetBoxInterface, type NetBoxMappedPort, type NetBoxPortPosition, type NetBoxRack, NetworkDiagram, NetworkDiagramInteractionOptions, type NetworkDiagramOptions, NetworkDiagramProps, type NetworkDiagramState, type NetworkDiagramStore, NetworkEdge, NetworkEdgeData, NetworkNode, NetworkNodeDataBase, PANEL_BORDER_WIDTH, PANEL_HEADER_HEIGHT, PANEL_HEIGHT_PX, PANEL_PADDING, PANEL_TUBE_TRAY_SPACING, PANEL_WIDTH_PX, POWER_CONNECTORS, PatchPanelNode, PortBlock, PortCableType, PortPosition, PortType, type PortVisualDimensions, type PortVisualInput, type PortVisualKind, type PowerConnectorConfig, PowerEdge, type PowerPortStyle, RACK_HEADER_HEIGHT, RACK_WIDTH_PX, RackConfig, RackDevice, type RackMountedNodeType, RackNode, RackNodeData, type RackNodeProps, type RackSchemaOptions, type RawNetboxTemplate, type RawTemplatePort, type RawTemplatePortBlock, type ReplaceEdgeOptions, type ResolvedPortBlockInput, type RuntimeEdge, type RuntimeNode, SpliceConfig, SpliceNode, SplicePlacementError, type SplicePlacementValidation, type SpliceSchemaOptions, SpliceTrayConfig, SpliceTrayNode, TEMPLATE_SCHEMA_VERSION, type TemplateFaceData, type TemplateFrontRearPortLink, type TemplateParseResult, type TemplatePort, type TemplatePortBlock, type TemplateSource, type TemplateValidationIssue, type TemplateValidationReport, type TemplateWidth, TubeNode, U_HEIGHT_PX, type ValidateConnectionParams, type ValidationResult, VerticalPDU, addDeviceToRack, addSpliceToTray, applyDeviceDisplayToNodes, applyDiagramFocusToEdges, applyDiagramFocusToNodes, baseColorFor, buildNodesFromRackConfig, buildNodesFromSpliceConfig, buildPortBlocksFromPorts, calculateClosureDimensions, calculateCouplerRightX, calculateCouplerSlotSpacing, calculateCouplerSpacing, calculateDevicePositionFromU, calculatePanelDimensions, calculateSlotPositionFromY, calculateSplicePositionFromNumber, calculateUPositions, calculateYFromSlotPosition, countTemplateFacePorts, createNetworkDiagramStore, createRackConfigFromNodes, createSpliceConfigFromNodes, fiberSolidOrStriped, findNearestRack, findNextAvailableHolderPosition, findNextAvailableUPosition, 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, isStriped, isUPositionAvailable, netboxCableToNetworkEdge, netboxDeviceToNetworkNode, netboxRackToNetworkNode, netboxToDiagramDocument, netboxToNetworkDiagram, parseNetboxTemplate, removeDeviceFromRack, removeSpliceFromTray, replaceEdge, resolveEndpointCompatibilityKeys, resolvePortVisualKind, snapToCouplerPosition, snapToSplicePosition, snapToUPosition, updateDeviceUPosition$1 as updateDeviceUPosition, updateDeviceUPosition as updateDeviceUPositionInSchema, updateSpliceHolderPosition, useEdges as useDiagramEdges, useNodes as useDiagramNodes, useDiagramPortInteraction, useNetworkDiagram, validateAndSnapDevice, validateRackDevicePlacements, validateRenderFidelity, validateSplicePlacements };
|