@procaaso/alphinity-ui-components 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import * as react from 'react';
2
2
  import react__default from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
4
  import * as _mui_material_OverridableComponent from '@mui/material/OverridableComponent';
4
5
  import * as _emotion_styled from '@emotion/styled';
5
6
  import * as _emotion_react from '@emotion/react';
6
7
  import * as _mui_system from '@mui/system';
7
8
  import * as _mui_material from '@mui/material';
8
- import * as react_jsx_runtime from 'react/jsx-runtime';
9
9
 
10
10
  interface ButtonProps extends react__default.ButtonHTMLAttributes<HTMLButtonElement> {
11
11
  variant?: 'primary' | 'secondary';
@@ -436,4 +436,684 @@ interface ThemeToggleProps extends react__default.HTMLAttributes<HTMLDivElement>
436
436
  }
437
437
  declare const ThemeToggle: react__default.FC<ThemeToggleProps>;
438
438
 
439
- export { Button, type ButtonProps, CardHeader, CardUnit, CardValue, CircularGauge, type CircularGaugeProps, ControlPanel, type ControlPanelProps, DashboardCard, type DisplayMode, DisplayModeToggle, EquipmentIndicator, type EquipmentIndicatorProps, EquipmentIndicatorWithSparkline, type EquipmentIndicatorWithSparklineProps, FixedSVGContainer, FooterPanel, FullscreenContainer, FullscreenWorkspace, type FullscreenWorkspaceProps, type FullscreenWorkspaceTab, LeftPanel, LeftToggleButton, LegacyValueEntry, type LegacyValueEntryProps, type ModeConfig, type OverlayTheme, PanelContent, PanelTabs, RightPanel, RightToggleButton, SVGArea, SVGLockedOverlay, type SVGLockedOverlayProps, ScrollableSVGWrapper, Selector, type SelectorOption, type SelectorProps, Sparkline, type SparklineProps, StatusIndicator, type StatusIndicatorProps, ThemeProvider, ThemeToggle, type ThemeToggleProps, TrendLine, type TrendLineProps, ValueEntry, type ValueEntryProps, ZoomButton, ZoomControls, overlayStyles, useTheme };
439
+ interface NodeInstance {
440
+ id: string;
441
+ symbolId: string;
442
+ transform: Transform;
443
+ ports?: PortInstance[];
444
+ visible?: boolean;
445
+ label?: string;
446
+ labelOffset?: {
447
+ x: number;
448
+ y: number;
449
+ };
450
+ labelFontSize?: number;
451
+ metadata?: Record<string, unknown>;
452
+ }
453
+ interface Transform {
454
+ x: number;
455
+ y: number;
456
+ rotation: number;
457
+ scale?: number;
458
+ flipX?: boolean;
459
+ flipY?: boolean;
460
+ }
461
+ interface PortInstance {
462
+ id: string;
463
+ x: number;
464
+ y: number;
465
+ type: PortType;
466
+ label?: string;
467
+ }
468
+ type PortType = 'inlet' | 'outlet' | 'control' | 'signal';
469
+
470
+ interface PipeEdge {
471
+ id: string;
472
+ fromNodeId: string;
473
+ fromPortId?: string;
474
+ toNodeId: string;
475
+ toPortId?: string;
476
+ routePoints: Point[];
477
+ visible?: boolean;
478
+ style?: PipeStyle;
479
+ label?: string;
480
+ showLabel?: boolean;
481
+ labelOffset?: {
482
+ x: number;
483
+ y: number;
484
+ };
485
+ metadata?: Record<string, unknown>;
486
+ }
487
+ interface Point {
488
+ x: number;
489
+ y: number;
490
+ }
491
+ interface PipeStyle {
492
+ stroke: string;
493
+ strokeWidth: number;
494
+ strokeDasharray?: string;
495
+ opacity?: number;
496
+ }
497
+
498
+ interface Overlay {
499
+ id: string;
500
+ type: OverlayType;
501
+ anchorType: AnchorType;
502
+ anchorId?: string;
503
+ offset: Point;
504
+ binding?: DataBinding;
505
+ content?: OverlayContent;
506
+ style?: React.CSSProperties;
507
+ }
508
+ type OverlayType = 'value' | 'label' | 'gauge' | 'trend' | 'custom';
509
+ type AnchorType = 'node' | 'pipe' | 'absolute';
510
+ interface DataBinding {
511
+ sourceType: 'tag' | 'expression' | 'static';
512
+ source: string;
513
+ format?: string;
514
+ updateInterval?: number;
515
+ transform?: string;
516
+ }
517
+ interface OverlayContent {
518
+ text?: string;
519
+ component?: string;
520
+ props?: Record<string, unknown>;
521
+ }
522
+
523
+ interface Diagram {
524
+ id: string;
525
+ name: string;
526
+ version: string;
527
+ viewBox: ViewBox;
528
+ nodes: NodeInstance[];
529
+ pipes: PipeEdge[];
530
+ overlays: Overlay[];
531
+ metadata?: DiagramMetadata;
532
+ }
533
+ interface ViewBox {
534
+ x: number;
535
+ y: number;
536
+ width: number;
537
+ height: number;
538
+ }
539
+ interface DiagramMetadata {
540
+ author?: string;
541
+ created?: string;
542
+ modified?: string;
543
+ tags?: string[];
544
+ description?: string;
545
+ backgroundColor?: string;
546
+ }
547
+
548
+ interface SymbolDefinition {
549
+ id: string;
550
+ name: string;
551
+ category: SymbolCategory;
552
+ svgContent: string;
553
+ viewBox: ViewBox;
554
+ ports: PortDefinition[];
555
+ thumbnail?: string;
556
+ metadata?: SymbolMetadata;
557
+ }
558
+ type SymbolCategory = 'valve' | 'pump' | 'vessel' | 'heat-exchanger' | 'instrument' | 'actuator' | 'sensor' | 'other';
559
+ interface PortDefinition {
560
+ id: string;
561
+ x: number;
562
+ y: number;
563
+ type: PortType;
564
+ label?: string;
565
+ direction?: 'in' | 'out' | 'bi';
566
+ }
567
+ interface SymbolMetadata {
568
+ description?: string;
569
+ manufacturer?: string;
570
+ modelNumber?: string;
571
+ tags?: string[];
572
+ }
573
+
574
+ /**
575
+ * Status levels for telemetry values
576
+ */
577
+ type TelemetryStatus$1 = 'normal' | 'warning' | 'alarm' | 'fault' | 'off';
578
+ /**
579
+ * Live telemetry value with status
580
+ */
581
+ interface TelemetryValue {
582
+ /** Current value */
583
+ value: number | string | boolean;
584
+ /** Status/severity level */
585
+ status: TelemetryStatus$1;
586
+ /** Unit of measurement (optional) */
587
+ unit?: string;
588
+ /** Timestamp of last update */
589
+ timestamp?: number;
590
+ /** Quality indicator (0-100, where 100 is good) */
591
+ quality?: number;
592
+ }
593
+ /**
594
+ * Telemetry data binding for a node
595
+ */
596
+ interface TelemetryBinding {
597
+ /** Node ID this telemetry is bound to */
598
+ nodeId: string;
599
+ /** Tag/variable name for the telemetry source */
600
+ tag: string;
601
+ /** Current telemetry value */
602
+ value: TelemetryValue;
603
+ /** Historical values for sparkline/trend (optional) */
604
+ history?: number[];
605
+ /** Thresholds for status determination */
606
+ thresholds?: {
607
+ /** High-High threshold (value >= this triggers alarm) */
608
+ highHigh?: number;
609
+ /** High threshold (value >= this triggers warning) */
610
+ high?: number;
611
+ /** Low threshold (value <= this triggers warning) */
612
+ low?: number;
613
+ /** Low-Low threshold (value <= this triggers alarm/fault) */
614
+ lowLow?: number;
615
+ /** Custom label for high-high threshold */
616
+ highHighLabel?: string;
617
+ /** Custom label for high threshold */
618
+ highLabel?: string;
619
+ /** Custom label for low threshold */
620
+ lowLabel?: string;
621
+ /** Custom label for low-low threshold */
622
+ lowLowLabel?: string;
623
+ };
624
+ /** Custom colors for status levels */
625
+ statusColors?: {
626
+ normal?: string;
627
+ warning?: string;
628
+ alarm?: string;
629
+ fault?: string;
630
+ off?: string;
631
+ };
632
+ /** Display configuration */
633
+ display?: {
634
+ /** Show value overlay above node */
635
+ showValue?: boolean;
636
+ /** Show status indicator */
637
+ showStatus?: boolean;
638
+ /** Custom label for the value */
639
+ label?: string;
640
+ /** Number of decimal places for numeric values */
641
+ precision?: number;
642
+ /** Show sparkline trend (requires history) */
643
+ showSparkline?: boolean;
644
+ /** Sparkline color (defaults to status color) */
645
+ sparklineColor?: string;
646
+ /** Custom background color (hex code or 'status' for status-based color) */
647
+ backgroundColor?: string;
648
+ /** Custom text color for value display (hex code) */
649
+ textColor?: string;
650
+ /** Horizontal offset from node center */
651
+ offsetX?: number;
652
+ /** Vertical offset from node center */
653
+ offsetY?: number;
654
+ };
655
+ }
656
+ /**
657
+ * Map of telemetry bindings by node ID
658
+ */
659
+ type TelemetryMap = Map<string, TelemetryBinding>;
660
+
661
+ interface UseViewBoxOptions {
662
+ /** Initial viewBox configuration */
663
+ initialViewBox: ViewBox;
664
+ /** Enable pan interaction (default: true) */
665
+ enablePan?: boolean;
666
+ /** Enable zoom interaction (default: true) */
667
+ enableZoom?: boolean;
668
+ /** Minimum zoom level (smaller = more zoomed in, default: 0.1) */
669
+ minZoom?: number;
670
+ /** Maximum zoom level (larger = more zoomed out, default: 10) */
671
+ maxZoom?: number;
672
+ /** Zoom sensitivity (default: 0.001) */
673
+ zoomSensitivity?: number;
674
+ /** Allow left-click drag for panning (default: true for touch-friendly) */
675
+ allowLeftClickPan?: boolean;
676
+ }
677
+ interface UseViewBoxResult {
678
+ /** Current viewBox state */
679
+ viewBox: ViewBox;
680
+ /** Reset viewBox to initial state */
681
+ resetViewBox: () => void;
682
+ /** Zoom in (decrease viewBox size) */
683
+ zoomIn: () => void;
684
+ /** Zoom out (increase viewBox size) */
685
+ zoomOut: () => void;
686
+ /** Convert screen coordinates to world (SVG) coordinates */
687
+ screenToWorld: (screenX: number, screenY: number) => {
688
+ x: number;
689
+ y: number;
690
+ };
691
+ /** SVG element ref to attach event listeners */
692
+ svgRef: React.RefObject<SVGSVGElement | null>;
693
+ }
694
+ /**
695
+ * Custom hook for managing ViewBox state with pan and zoom interactions
696
+ *
697
+ * Pan controls:
698
+ * - Left mouse button + drag (if allowLeftClickPan=true, default)
699
+ * - Middle mouse button + drag (always)
700
+ * - Space + left mouse button + drag (always)
701
+ * - Touch drag (single finger)
702
+ *
703
+ * Zoom controls:
704
+ * - Mouse wheel (zoom to cursor position)
705
+ * - Pinch gesture (touch devices)
706
+ * - Programmatic zoomIn/zoomOut functions
707
+ */
708
+ declare function useViewBox(options: UseViewBoxOptions): UseViewBoxResult;
709
+
710
+ interface SelectionState {
711
+ /** IDs of selected nodes */
712
+ selectedNodeIds: Set<string>;
713
+ /** IDs of selected pipes */
714
+ selectedPipeIds: Set<string>;
715
+ }
716
+ interface UseSelectionOptions {
717
+ /** Allow multiple selection with Ctrl/Cmd key (default: true) */
718
+ multiSelect?: boolean;
719
+ /** Initial selection state */
720
+ initialSelection?: SelectionState;
721
+ /** Callback when selection changes */
722
+ onSelectionChange?: (selection: SelectionState) => void;
723
+ }
724
+ interface UseSelectionResult {
725
+ /** Current selection state */
726
+ selection: SelectionState;
727
+ /** Check if a node is selected */
728
+ isNodeSelected: (nodeId: string) => boolean;
729
+ /** Check if a pipe is selected */
730
+ isPipeSelected: (pipeId: string) => boolean;
731
+ /** Select a node */
732
+ selectNode: (nodeId: string, multiSelect?: boolean) => void;
733
+ /** Select a pipe */
734
+ selectPipe: (pipeId: string, multiSelect?: boolean) => void;
735
+ /** Clear all selections */
736
+ clearSelection: () => void;
737
+ /** Select multiple nodes */
738
+ selectNodes: (nodeIds: string[]) => void;
739
+ /** Select multiple pipes */
740
+ selectPipes: (pipeIds: string[]) => void;
741
+ }
742
+ /**
743
+ * Custom hook for managing selection state in P&ID diagrams
744
+ *
745
+ * Supports:
746
+ * - Single selection (click)
747
+ * - Multi-selection (Ctrl+click)
748
+ * - Programmatic selection
749
+ * - Selection callbacks
750
+ */
751
+ declare function useSelection(options?: UseSelectionOptions): UseSelectionResult;
752
+
753
+ interface UseTelemetryOptions {
754
+ /** Initial telemetry bindings */
755
+ initialBindings?: TelemetryBinding[];
756
+ /** Callback when telemetry values change */
757
+ onTelemetryChange?: (bindings: TelemetryMap) => void;
758
+ /** Auto-refresh interval in milliseconds (0 = disabled) */
759
+ refreshInterval?: number;
760
+ }
761
+ interface UseTelemetryResult {
762
+ /** Current telemetry bindings map */
763
+ telemetry: TelemetryMap;
764
+ /** Update a single telemetry value */
765
+ updateTelemetry: (nodeId: string, value: TelemetryValue) => void;
766
+ /** Update multiple telemetry values at once */
767
+ updateTelemetryBatch: (updates: Array<{
768
+ nodeId: string;
769
+ value: TelemetryValue;
770
+ history?: number[];
771
+ }>) => void;
772
+ /** Get telemetry for a specific node */
773
+ getTelemetry: (nodeId: string) => TelemetryBinding | undefined;
774
+ /** Clear all telemetry data */
775
+ clearTelemetry: () => void;
776
+ /** Set telemetry bindings */
777
+ setBindings: (bindings: TelemetryBinding[]) => void;
778
+ }
779
+ /**
780
+ * Custom hook for managing telemetry data bindings
781
+ *
782
+ * Supports:
783
+ * - Real-time value updates
784
+ * - Status monitoring (normal, warning, alarm, fault, off)
785
+ * - Batch updates for performance
786
+ * - Auto-refresh capability
787
+ * - Quality indicators
788
+ */
789
+ declare function useTelemetry(options?: UseTelemetryOptions): UseTelemetryResult;
790
+
791
+ interface DragPoint {
792
+ x: number;
793
+ y: number;
794
+ }
795
+ interface DragState {
796
+ /** Whether drag is currently active */
797
+ isDragging: boolean;
798
+ /** Initial position when drag started */
799
+ startPosition: DragPoint | null;
800
+ /** Current drag offset from start */
801
+ offset: DragPoint;
802
+ /** ID of the item being dragged */
803
+ draggedId: string | null;
804
+ }
805
+ interface UseDragOptions {
806
+ /** Callback when drag starts */
807
+ onDragStart?: (id: string, position: DragPoint) => void;
808
+ /** Callback during drag movement */
809
+ onDragMove?: (id: string, offset: DragPoint, position: DragPoint) => void;
810
+ /** Callback when drag ends */
811
+ onDragEnd?: (id: string, offset: DragPoint, finalPosition: DragPoint) => void;
812
+ /** Snap to grid size (0 = no snap) */
813
+ snapToGrid?: number;
814
+ /** Minimum drag distance before triggering (prevents accidental drags) */
815
+ dragThreshold?: number;
816
+ /** Convert screen coordinates to world coordinates */
817
+ screenToWorld?: (screenX: number, screenY: number) => DragPoint;
818
+ }
819
+ interface UseDragResult {
820
+ /** Current drag state */
821
+ dragState: DragState;
822
+ /** Start dragging an item */
823
+ startDrag: (id: string, event: React.MouseEvent | React.TouchEvent, itemPosition: DragPoint) => void;
824
+ /** Cancel current drag */
825
+ cancelDrag: () => void;
826
+ /** Check if a specific item is being dragged */
827
+ isDraggingItem: (id: string) => boolean;
828
+ }
829
+ /**
830
+ * Custom hook for drag-and-drop functionality in P&ID diagrams
831
+ *
832
+ * Supports:
833
+ * - Mouse drag
834
+ * - Touch drag
835
+ * - Snap-to-grid
836
+ * - World coordinate conversion (for SVG viewBox)
837
+ * - Drag threshold to prevent accidental drags
838
+ */
839
+ declare function useDrag(options?: UseDragOptions): UseDragResult;
840
+
841
+ interface KeyboardShortcutsOptions {
842
+ /** Callback when Delete or Backspace is pressed */
843
+ onDelete?: () => void;
844
+ /** Callback when Ctrl+C is pressed */
845
+ onCopy?: () => void;
846
+ /** Callback when Ctrl+V is pressed */
847
+ onPaste?: () => void;
848
+ /** Callback when Ctrl+Z is pressed (undo) */
849
+ onUndo?: () => void;
850
+ /** Callback when Ctrl+Y or Ctrl+Shift+Z is pressed (redo) */
851
+ onRedo?: () => void;
852
+ /** Callback when Ctrl+A is pressed (select all) */
853
+ onSelectAll?: () => void;
854
+ /** Enable keyboard shortcuts (default: true) */
855
+ enabled?: boolean;
856
+ }
857
+ /**
858
+ * Custom hook for handling keyboard shortcuts in P&ID diagrams
859
+ *
860
+ * Supported shortcuts:
861
+ * - Delete/Backspace: Delete selected items
862
+ * - Ctrl+C: Copy selected items
863
+ * - Ctrl+V: Paste copied items
864
+ * - Ctrl+Z: Undo last action
865
+ * - Ctrl+Y / Ctrl+Shift+Z: Redo
866
+ * - Ctrl+A: Select all
867
+ */
868
+ declare function useKeyboardShortcuts(options: KeyboardShortcutsOptions): void;
869
+
870
+ interface PIDCanvasFeatures {
871
+ /** Enable pan interaction (default: true) */
872
+ pan?: boolean;
873
+ /** Enable zoom interaction (default: true) */
874
+ zoom?: boolean;
875
+ /** Enable selection interaction (default: false) */
876
+ selection?: boolean;
877
+ /** Allow multi-selection with Ctrl/Cmd key (default: true) */
878
+ multiSelect?: boolean;
879
+ /** Enable telemetry data overlays (default: false) */
880
+ telemetry?: boolean;
881
+ /** Enable drag-and-drop for nodes (default: false) */
882
+ dragNodes?: boolean;
883
+ /** Snap dragged nodes to grid (0 = no snap) */
884
+ snapToGrid?: number;
885
+ /** Enable keyboard shortcuts for delete/copy/paste (default: false) */
886
+ keyboardShortcuts?: boolean;
887
+ /** Enable pipe waypoint editing (drag waypoints, add/remove) (default: false) */
888
+ editPipeRoutes?: boolean;
889
+ /** Enable dropping symbols from library to add nodes (default: false) */
890
+ allowSymbolDrop?: boolean;
891
+ /** Enable connection drawing mode to create pipes between nodes (default: false) */
892
+ connectionMode?: boolean;
893
+ /** Show background grid (default: true) */
894
+ showGrid?: boolean;
895
+ /** Background color for canvas (default: '#ffffff') */
896
+ backgroundColor?: string;
897
+ }
898
+ interface PIDCanvasProps extends react__default.HTMLAttributes<HTMLDivElement> {
899
+ /** The diagram to render */
900
+ diagram: Diagram;
901
+ /** Optional className for the container */
902
+ className?: string;
903
+ /** Optional inline styles for the container */
904
+ style?: react__default.CSSProperties;
905
+ /** Enable interactive features (pan, zoom, selection, telemetry, dragNodes) */
906
+ features?: PIDCanvasFeatures;
907
+ /** Callback when selection changes */
908
+ onSelectionChange?: (selection: SelectionState) => void;
909
+ /** Callback when a node is clicked */
910
+ onNodeClick?: (nodeId: string) => void;
911
+ /** Callback when a pipe is clicked */
912
+ onPipeClick?: (pipeId: string) => void;
913
+ /** Callback when a node is moved (drag-and-drop) */
914
+ onNodeMove?: (nodeId: string, newX: number, newY: number) => void;
915
+ /** Callback when diagram changes (for internal state updates) */
916
+ onDiagramChange?: (diagram: Diagram) => void;
917
+ /** Callback when items are deleted */
918
+ onDelete?: (nodeIds: string[], pipeIds: string[]) => void;
919
+ /** Callback when items are copied (returns copied data for external storage) */
920
+ onItemsCopied?: (nodeIds: string[], pipeIds: string[]) => void;
921
+ /** Callback when paste is requested (external code should handle the paste logic) */
922
+ onPaste?: () => void;
923
+ /** Callback when a symbol is dropped onto canvas (returns symbol ID and position) */
924
+ onSymbolDrop?: (symbolId: string, position: {
925
+ x: number;
926
+ y: number;
927
+ }) => void;
928
+ /** Callback when a pipe is created via connection mode */
929
+ onPipeCreated?: (sourceNodeId: string, targetNodeId: string, sourcePortId?: string, targetPortId?: string) => void;
930
+ /** Telemetry data bindings for live values */
931
+ telemetry?: TelemetryMap;
932
+ }
933
+ /**
934
+ * PIDCanvas - Interactive canvas for rendering P&ID diagrams
935
+ *
936
+ * Features:
937
+ * - Renders nodes (PR #3) and pipes (PR #4) with static layout
938
+ * - Drag-and-drop: Drag nodes to reposition (PR #8)
939
+ *
940
+ * Future: Editing tools, symbol library UI
941
+ */
942
+ declare function PIDCanvas({ diagram, className, style, features, onSelectionChange, onNodeClick, onPipeClick, onNodeMove, onDiagramChange, onDelete, onItemsCopied, onPaste, onSymbolDrop, onPipeCreated, telemetry, ...props }: PIDCanvasProps): react__default.ReactElement;
943
+
944
+ interface SymbolLibraryProps {
945
+ /** Optional className for styling */
946
+ className?: string;
947
+ /** Callback when a symbol drag starts */
948
+ onSymbolDragStart?: (symbolId: string, event: react__default.DragEvent) => void;
949
+ /** Show category filter */
950
+ showCategories?: boolean;
951
+ /** Custom symbol categories */
952
+ categories?: string[];
953
+ }
954
+ /**
955
+ * SymbolLibrary - Browse and drag symbols onto the canvas
956
+ *
957
+ * Displays available symbols organized by category
958
+ * Supports drag-and-drop to add new nodes to diagrams
959
+ */
960
+ declare function SymbolLibrary({ className, onSymbolDragStart, showCategories, categories, }: SymbolLibraryProps): react__default.ReactElement;
961
+
962
+ interface NodeConfigPanelProps {
963
+ /** Selected node to configure */
964
+ node: NodeInstance;
965
+ /** Telemetry binding for the node (if any) */
966
+ binding: TelemetryBinding | null;
967
+ /** Callback when node properties are updated */
968
+ onUpdateNode: (updates: Partial<NodeInstance>) => void;
969
+ /** Callback when telemetry is added/updated */
970
+ onUpdateTelemetry: (updates: any) => void;
971
+ /** Callback when telemetry binding is added for the first time */
972
+ onAddTelemetry?: () => void;
973
+ /** Callback when node is removed */
974
+ onRemove: () => void;
975
+ /** Additional CSS class name */
976
+ className?: string;
977
+ /** Custom styles */
978
+ style?: react__default.CSSProperties;
979
+ }
980
+ /**
981
+ * NodeConfigPanel - Reusable configuration panel for editing node properties and telemetry
982
+ *
983
+ * @example
984
+ * ```tsx
985
+ * <NodeConfigPanel
986
+ * node={selectedNode}
987
+ * binding={telemetry.get(selectedNode.id)}
988
+ * onUpdateNode={(updates) => updateNode(selectedNode.id, updates)}
989
+ * onUpdateTelemetry={(updates) => updateTelemetryBatch([updates])}
990
+ * onRemove={() => removeNode(selectedNode.id)}
991
+ * />
992
+ * ```
993
+ */
994
+ declare function NodeConfigPanel({ node, binding, onUpdateNode, onUpdateTelemetry, onAddTelemetry, onRemove, className, style, }: NodeConfigPanelProps): react_jsx_runtime.JSX.Element;
995
+
996
+ /**
997
+ * Validates a diagram object structure
998
+ */
999
+ declare function validateDiagram(diagram: unknown): {
1000
+ valid: boolean;
1001
+ errors: string[];
1002
+ };
1003
+ /**
1004
+ * Serializes a diagram to JSON string
1005
+ */
1006
+ declare function exportDiagram(diagram: Diagram): string;
1007
+ /**
1008
+ * Parses a diagram from JSON string
1009
+ */
1010
+ declare function importDiagram(json: string): Diagram;
1011
+
1012
+ /**
1013
+ * Calculate the world position of a port on a node instance
1014
+ *
1015
+ * Takes into account the node's transform (position, rotation, scale, flip)
1016
+ * and the port's position within the symbol's viewBox
1017
+ */
1018
+ declare function getPortWorldPosition(node: NodeInstance, portId: string): Point | null;
1019
+ /**
1020
+ * Generate route points for a pipe from source port to destination port
1021
+ *
1022
+ * Options:
1023
+ * - direct: Straight line from source to destination
1024
+ * - orthogonal: Right-angle routing (future enhancement)
1025
+ * - custom: Provide your own waypoints
1026
+ */
1027
+ declare function generateRoutePoints(fromNode: NodeInstance, fromPortId: string, toNode: NodeInstance, toPortId: string, options?: {
1028
+ style?: 'direct' | 'orthogonal';
1029
+ waypoints?: Point[];
1030
+ }): Point[];
1031
+ /**
1032
+ * Validate that a node has a specific port
1033
+ */
1034
+ declare function nodeHasPort(node: NodeInstance, portId: string): boolean;
1035
+
1036
+ /**
1037
+ * Example P&ID diagram with a simple valve-pump-tank flow
1038
+ * Uses automatic port-to-port connection routing
1039
+ */
1040
+ declare const exampleDiagram: Diagram;
1041
+
1042
+ /**
1043
+ * Mock symbol library with basic P&ID shapes
1044
+ * Phase 4 will add proper symbol library management
1045
+ */
1046
+ declare const mockSymbolLibrary: Record<string, SymbolDefinition>;
1047
+ /**
1048
+ * Get symbol definition by ID
1049
+ */
1050
+ declare function getSymbolDefinition(symbolId: string): SymbolDefinition | undefined;
1051
+ /**
1052
+ * Get all available symbol IDs
1053
+ */
1054
+ declare function getAvailableSymbols(): string[];
1055
+
1056
+ /**
1057
+ * Telemetry status type
1058
+ */
1059
+ type TelemetryStatus = 'normal' | 'warning' | 'alarm' | 'fault' | 'off';
1060
+ /**
1061
+ * Threshold configuration
1062
+ */
1063
+ interface Thresholds {
1064
+ highHigh?: number;
1065
+ high?: number;
1066
+ low?: number;
1067
+ lowLow?: number;
1068
+ }
1069
+ /**
1070
+ * Calculate status based on value and thresholds
1071
+ * @param value - Current numeric value
1072
+ * @param thresholds - Threshold configuration
1073
+ * @returns Status string
1074
+ */
1075
+ declare function calculateThresholdStatus(value: number, thresholds?: Thresholds): TelemetryStatus;
1076
+ /**
1077
+ * Default thresholds for typical industrial processes (percentage-based)
1078
+ */
1079
+ declare const DEFAULT_THRESHOLDS: Thresholds;
1080
+
1081
+ /**
1082
+ * Options for simulation behavior
1083
+ */
1084
+ interface SimulationOptions {
1085
+ /** Update interval in milliseconds (default: 2000) */
1086
+ interval?: number;
1087
+ /** Whether simulation is enabled (default: true) */
1088
+ enabled?: boolean;
1089
+ /** Maximum change per update (default: 10) */
1090
+ maxChange?: number;
1091
+ /** Minimum value clamp (default: 0) */
1092
+ minValue?: number;
1093
+ /** Maximum value clamp (default: 100) */
1094
+ maxValue?: number;
1095
+ /** Maximum history length (default: 10) */
1096
+ historyLength?: number;
1097
+ /** Custom value generator function */
1098
+ generateValue?: (currentValue: number, nodeId: string) => number;
1099
+ }
1100
+ /**
1101
+ * Hook to automatically simulate telemetry data updates
1102
+ * Randomly updates numeric telemetry values and calculates status based on thresholds
1103
+ *
1104
+ * @param telemetry - Telemetry map from useTelemetry
1105
+ * @param updateTelemetryBatch - Batch update function from useTelemetry
1106
+ * @param options - Simulation configuration options
1107
+ *
1108
+ * @example
1109
+ * ```tsx
1110
+ * const { telemetry, updateTelemetryBatch } = useTelemetry();
1111
+ * useSimulation(telemetry, updateTelemetryBatch, {
1112
+ * interval: 2000,
1113
+ * enabled: mode === 'runtime'
1114
+ * });
1115
+ * ```
1116
+ */
1117
+ declare function useSimulation(telemetry: TelemetryMap, updateTelemetryBatch: (updates: Array<any>) => void, options?: SimulationOptions): void;
1118
+
1119
+ export { type AnchorType, Button, type ButtonProps, CardHeader, CardUnit, CardValue, CircularGauge, type CircularGaugeProps, ControlPanel, type ControlPanelProps, DEFAULT_THRESHOLDS, DashboardCard, type DataBinding, type Diagram, type DiagramMetadata, type DisplayMode, DisplayModeToggle, type DragPoint, type DragState, EquipmentIndicator, type EquipmentIndicatorProps, EquipmentIndicatorWithSparkline, type EquipmentIndicatorWithSparklineProps, FixedSVGContainer, FooterPanel, FullscreenContainer, FullscreenWorkspace, type FullscreenWorkspaceProps, type FullscreenWorkspaceTab, type KeyboardShortcutsOptions, LeftPanel, LeftToggleButton, LegacyValueEntry, type LegacyValueEntryProps, type ModeConfig, NodeConfigPanel, type NodeConfigPanelProps, type NodeInstance, type Overlay, type OverlayContent, type OverlayTheme, type OverlayType, PIDCanvas, type PIDCanvasProps, PanelContent, PanelTabs, type PipeEdge, type PipeStyle, type Point, type PortDefinition, type PortInstance, type PortType, RightPanel, RightToggleButton, SVGArea, SVGLockedOverlay, type SVGLockedOverlayProps, ScrollableSVGWrapper, type SelectionState, Selector, type SelectorOption, type SelectorProps, type SimulationOptions, Sparkline, type SparklineProps, StatusIndicator, type StatusIndicatorProps, type SymbolCategory, type SymbolDefinition, SymbolLibrary, type SymbolLibraryProps, type SymbolMetadata, type TelemetryBinding, type TelemetryMap, type TelemetryStatus$1 as TelemetryStatus, type TelemetryValue, ThemeProvider, ThemeToggle, type ThemeToggleProps, type Thresholds, type Transform, TrendLine, type TrendLineProps, type UseDragOptions, type UseDragResult, type UseSelectionOptions, type UseSelectionResult, type UseTelemetryOptions, type UseTelemetryResult, type UseViewBoxOptions, type UseViewBoxResult, ValueEntry, type ValueEntryProps, type ViewBox, ZoomButton, ZoomControls, calculateThresholdStatus, exampleDiagram, exportDiagram, generateRoutePoints, getAvailableSymbols, getPortWorldPosition, getSymbolDefinition, importDiagram, mockSymbolLibrary, nodeHasPort, overlayStyles, useDrag, useKeyboardShortcuts, useSelection, useSimulation, useTelemetry, useTheme, useViewBox, validateDiagram };