@procaaso/alphinity-ui-components 1.0.4 → 1.0.5
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 +2021 -467
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -1
- package/dist/index.d.ts +43 -1
- package/dist/index.js +1973 -420
- 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) */
|
|
@@ -1135,4 +1177,4 @@ interface SimulationOptions {
|
|
|
1135
1177
|
*/
|
|
1136
1178
|
declare function useSimulation(telemetry: TelemetryMap, updateTelemetryBatch: (updates: Array<any>) => void, options?: SimulationOptions): void;
|
|
1137
1179
|
|
|
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 };
|
|
1180
|
+
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, 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) */
|
|
@@ -1135,4 +1177,4 @@ interface SimulationOptions {
|
|
|
1135
1177
|
*/
|
|
1136
1178
|
declare function useSimulation(telemetry: TelemetryMap, updateTelemetryBatch: (updates: Array<any>) => void, options?: SimulationOptions): void;
|
|
1137
1179
|
|
|
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 };
|
|
1180
|
+
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, useDrag, useKeyboardShortcuts, useSelection, useSimulation, useTelemetry, useTelemetryStatus, useTheme, useViewBox, validateDiagram };
|