@procaaso/alphinity-ui-components 1.0.4 → 1.0.6
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.cjs +2076 -473
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +64 -3
- package/dist/index.d.ts +64 -3
- package/dist/index.js +2026 -426
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -448,6 +448,11 @@ interface NodeInstance {
|
|
|
448
448
|
y: number;
|
|
449
449
|
};
|
|
450
450
|
labelFontSize?: number;
|
|
451
|
+
status?: 'stopped' | 'running' | 'alarm' | 'warning' | string;
|
|
452
|
+
customColors?: {
|
|
453
|
+
fill?: string;
|
|
454
|
+
stroke?: string;
|
|
455
|
+
};
|
|
451
456
|
metadata?: Record<string, unknown>;
|
|
452
457
|
}
|
|
453
458
|
interface Transform {
|
|
@@ -797,6 +802,41 @@ interface UseTelemetryResult {
|
|
|
797
802
|
*/
|
|
798
803
|
declare function useTelemetry(options?: UseTelemetryOptions): UseTelemetryResult;
|
|
799
804
|
|
|
805
|
+
/**
|
|
806
|
+
* Options for syncing telemetry status to node status
|
|
807
|
+
*/
|
|
808
|
+
interface UseTelemetryStatusOptions {
|
|
809
|
+
/** Whether status sync is enabled (default: true) */
|
|
810
|
+
enabled?: boolean;
|
|
811
|
+
/** Custom status mapping function */
|
|
812
|
+
mapStatus?: (telemetryStatus: string) => string;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Hook to sync telemetry status to node instance status for dynamic coloring
|
|
816
|
+
*
|
|
817
|
+
* Updates node.status based on telemetry status values:
|
|
818
|
+
* - 'normal' → 'running'
|
|
819
|
+
* - 'warning' → 'warning'
|
|
820
|
+
* - 'alarm' / 'fault' → 'alarm'
|
|
821
|
+
* - 'off' → 'stopped'
|
|
822
|
+
*
|
|
823
|
+
* @param telemetry - Telemetry map from useTelemetry
|
|
824
|
+
* @param diagram - Current diagram state
|
|
825
|
+
* @param setDiagram - Diagram state setter
|
|
826
|
+
* @param options - Configuration options
|
|
827
|
+
*
|
|
828
|
+
* @example
|
|
829
|
+
* ```tsx
|
|
830
|
+
* const { telemetry } = useTelemetry();
|
|
831
|
+
* const [diagram, setDiagram] = useState<Diagram>({...});
|
|
832
|
+
*
|
|
833
|
+
* useTelemetryStatus(telemetry, diagram, setDiagram, {
|
|
834
|
+
* enabled: mode === 'runtime'
|
|
835
|
+
* });
|
|
836
|
+
* ```
|
|
837
|
+
*/
|
|
838
|
+
declare function useTelemetryStatus(telemetry: TelemetryMap, diagram: Diagram, setDiagram: (diagram: Diagram) => void, options?: UseTelemetryStatusOptions): void;
|
|
839
|
+
|
|
800
840
|
interface DragPoint {
|
|
801
841
|
x: number;
|
|
802
842
|
y: number;
|
|
@@ -887,6 +927,8 @@ interface PIDCanvasFeatures {
|
|
|
887
927
|
multiSelect?: boolean;
|
|
888
928
|
/** Enable telemetry data overlays (default: false) */
|
|
889
929
|
telemetry?: boolean;
|
|
930
|
+
/** Scale factor for telemetry displays (default: 1.0, range: 0.5-2.0) */
|
|
931
|
+
telemetryScale?: number;
|
|
890
932
|
/** Enable drag-and-drop for nodes (default: false) */
|
|
891
933
|
dragNodes?: boolean;
|
|
892
934
|
/** Snap dragged nodes to grid (0 = no snap) */
|
|
@@ -1064,11 +1106,30 @@ declare const exampleDiagram: Diagram;
|
|
|
1064
1106
|
*/
|
|
1065
1107
|
declare const mockSymbolLibrary: Record<string, SymbolDefinition>;
|
|
1066
1108
|
/**
|
|
1067
|
-
*
|
|
1109
|
+
* Register a custom symbol definition
|
|
1110
|
+
* @param symbol - The symbol definition to register
|
|
1111
|
+
* @example
|
|
1112
|
+
* registerSymbol({
|
|
1113
|
+
* id: 'my-custom-valve',
|
|
1114
|
+
* name: 'My Custom Valve',
|
|
1115
|
+
* category: 'valve',
|
|
1116
|
+
* viewBox: { x: 0, y: 0, width: 100, height: 100 },
|
|
1117
|
+
* ports: [...],
|
|
1118
|
+
* svgContent: '...',
|
|
1119
|
+
* });
|
|
1120
|
+
*/
|
|
1121
|
+
declare function registerSymbol(symbol: SymbolDefinition): void;
|
|
1122
|
+
/**
|
|
1123
|
+
* Register multiple custom symbols at once
|
|
1124
|
+
* @param symbols - Array of symbol definitions or a record of symbols
|
|
1125
|
+
*/
|
|
1126
|
+
declare function registerSymbols(symbols: SymbolDefinition[] | Record<string, SymbolDefinition>): void;
|
|
1127
|
+
/**
|
|
1128
|
+
* Get symbol definition by ID (checks both mock library and custom symbols)
|
|
1068
1129
|
*/
|
|
1069
1130
|
declare function getSymbolDefinition(symbolId: string): SymbolDefinition | undefined;
|
|
1070
1131
|
/**
|
|
1071
|
-
* Get all available symbol IDs
|
|
1132
|
+
* Get all available symbol IDs (includes both mock library and custom symbols)
|
|
1072
1133
|
*/
|
|
1073
1134
|
declare function getAvailableSymbols(): string[];
|
|
1074
1135
|
|
|
@@ -1135,4 +1196,4 @@ interface SimulationOptions {
|
|
|
1135
1196
|
*/
|
|
1136
1197
|
declare function useSimulation(telemetry: TelemetryMap, updateTelemetryBatch: (updates: Array<any>) => void, options?: SimulationOptions): void;
|
|
1137
1198
|
|
|
1138
|
-
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 };
|
|
1199
|
+
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 PIDCanvasControls, type PIDCanvasFeatures, 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 UseTelemetryStatusOptions, type UseViewBoxOptions, type UseViewBoxResult, ValueEntry, type ValueEntryProps, type ViewBox, ZoomButton, ZoomControls, calculateThresholdStatus, exampleDiagram, exportDiagram, generateRoutePoints, getAvailableSymbols, getPortWorldPosition, getSymbolDefinition, importDiagram, mockSymbolLibrary, nodeHasPort, overlayStyles, registerSymbol, registerSymbols, useDrag, useKeyboardShortcuts, useSelection, useSimulation, useTelemetry, useTelemetryStatus, useTheme, useViewBox, validateDiagram };
|
package/dist/index.d.ts
CHANGED
|
@@ -448,6 +448,11 @@ interface NodeInstance {
|
|
|
448
448
|
y: number;
|
|
449
449
|
};
|
|
450
450
|
labelFontSize?: number;
|
|
451
|
+
status?: 'stopped' | 'running' | 'alarm' | 'warning' | string;
|
|
452
|
+
customColors?: {
|
|
453
|
+
fill?: string;
|
|
454
|
+
stroke?: string;
|
|
455
|
+
};
|
|
451
456
|
metadata?: Record<string, unknown>;
|
|
452
457
|
}
|
|
453
458
|
interface Transform {
|
|
@@ -797,6 +802,41 @@ interface UseTelemetryResult {
|
|
|
797
802
|
*/
|
|
798
803
|
declare function useTelemetry(options?: UseTelemetryOptions): UseTelemetryResult;
|
|
799
804
|
|
|
805
|
+
/**
|
|
806
|
+
* Options for syncing telemetry status to node status
|
|
807
|
+
*/
|
|
808
|
+
interface UseTelemetryStatusOptions {
|
|
809
|
+
/** Whether status sync is enabled (default: true) */
|
|
810
|
+
enabled?: boolean;
|
|
811
|
+
/** Custom status mapping function */
|
|
812
|
+
mapStatus?: (telemetryStatus: string) => string;
|
|
813
|
+
}
|
|
814
|
+
/**
|
|
815
|
+
* Hook to sync telemetry status to node instance status for dynamic coloring
|
|
816
|
+
*
|
|
817
|
+
* Updates node.status based on telemetry status values:
|
|
818
|
+
* - 'normal' → 'running'
|
|
819
|
+
* - 'warning' → 'warning'
|
|
820
|
+
* - 'alarm' / 'fault' → 'alarm'
|
|
821
|
+
* - 'off' → 'stopped'
|
|
822
|
+
*
|
|
823
|
+
* @param telemetry - Telemetry map from useTelemetry
|
|
824
|
+
* @param diagram - Current diagram state
|
|
825
|
+
* @param setDiagram - Diagram state setter
|
|
826
|
+
* @param options - Configuration options
|
|
827
|
+
*
|
|
828
|
+
* @example
|
|
829
|
+
* ```tsx
|
|
830
|
+
* const { telemetry } = useTelemetry();
|
|
831
|
+
* const [diagram, setDiagram] = useState<Diagram>({...});
|
|
832
|
+
*
|
|
833
|
+
* useTelemetryStatus(telemetry, diagram, setDiagram, {
|
|
834
|
+
* enabled: mode === 'runtime'
|
|
835
|
+
* });
|
|
836
|
+
* ```
|
|
837
|
+
*/
|
|
838
|
+
declare function useTelemetryStatus(telemetry: TelemetryMap, diagram: Diagram, setDiagram: (diagram: Diagram) => void, options?: UseTelemetryStatusOptions): void;
|
|
839
|
+
|
|
800
840
|
interface DragPoint {
|
|
801
841
|
x: number;
|
|
802
842
|
y: number;
|
|
@@ -887,6 +927,8 @@ interface PIDCanvasFeatures {
|
|
|
887
927
|
multiSelect?: boolean;
|
|
888
928
|
/** Enable telemetry data overlays (default: false) */
|
|
889
929
|
telemetry?: boolean;
|
|
930
|
+
/** Scale factor for telemetry displays (default: 1.0, range: 0.5-2.0) */
|
|
931
|
+
telemetryScale?: number;
|
|
890
932
|
/** Enable drag-and-drop for nodes (default: false) */
|
|
891
933
|
dragNodes?: boolean;
|
|
892
934
|
/** Snap dragged nodes to grid (0 = no snap) */
|
|
@@ -1064,11 +1106,30 @@ declare const exampleDiagram: Diagram;
|
|
|
1064
1106
|
*/
|
|
1065
1107
|
declare const mockSymbolLibrary: Record<string, SymbolDefinition>;
|
|
1066
1108
|
/**
|
|
1067
|
-
*
|
|
1109
|
+
* Register a custom symbol definition
|
|
1110
|
+
* @param symbol - The symbol definition to register
|
|
1111
|
+
* @example
|
|
1112
|
+
* registerSymbol({
|
|
1113
|
+
* id: 'my-custom-valve',
|
|
1114
|
+
* name: 'My Custom Valve',
|
|
1115
|
+
* category: 'valve',
|
|
1116
|
+
* viewBox: { x: 0, y: 0, width: 100, height: 100 },
|
|
1117
|
+
* ports: [...],
|
|
1118
|
+
* svgContent: '...',
|
|
1119
|
+
* });
|
|
1120
|
+
*/
|
|
1121
|
+
declare function registerSymbol(symbol: SymbolDefinition): void;
|
|
1122
|
+
/**
|
|
1123
|
+
* Register multiple custom symbols at once
|
|
1124
|
+
* @param symbols - Array of symbol definitions or a record of symbols
|
|
1125
|
+
*/
|
|
1126
|
+
declare function registerSymbols(symbols: SymbolDefinition[] | Record<string, SymbolDefinition>): void;
|
|
1127
|
+
/**
|
|
1128
|
+
* Get symbol definition by ID (checks both mock library and custom symbols)
|
|
1068
1129
|
*/
|
|
1069
1130
|
declare function getSymbolDefinition(symbolId: string): SymbolDefinition | undefined;
|
|
1070
1131
|
/**
|
|
1071
|
-
* Get all available symbol IDs
|
|
1132
|
+
* Get all available symbol IDs (includes both mock library and custom symbols)
|
|
1072
1133
|
*/
|
|
1073
1134
|
declare function getAvailableSymbols(): string[];
|
|
1074
1135
|
|
|
@@ -1135,4 +1196,4 @@ interface SimulationOptions {
|
|
|
1135
1196
|
*/
|
|
1136
1197
|
declare function useSimulation(telemetry: TelemetryMap, updateTelemetryBatch: (updates: Array<any>) => void, options?: SimulationOptions): void;
|
|
1137
1198
|
|
|
1138
|
-
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 };
|
|
1199
|
+
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 PIDCanvasControls, type PIDCanvasFeatures, 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 UseTelemetryStatusOptions, type UseViewBoxOptions, type UseViewBoxResult, ValueEntry, type ValueEntryProps, type ViewBox, ZoomButton, ZoomControls, calculateThresholdStatus, exampleDiagram, exportDiagram, generateRoutePoints, getAvailableSymbols, getPortWorldPosition, getSymbolDefinition, importDiagram, mockSymbolLibrary, nodeHasPort, overlayStyles, registerSymbol, registerSymbols, useDrag, useKeyboardShortcuts, useSelection, useSimulation, useTelemetry, useTelemetryStatus, useTheme, useViewBox, validateDiagram };
|