@procaaso/alphinity-ui-components 1.0.5 → 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 CHANGED
@@ -78,6 +78,8 @@ __export(index_exports, {
78
78
  mockSymbolLibrary: () => mockSymbolLibrary,
79
79
  nodeHasPort: () => nodeHasPort,
80
80
  overlayStyles: () => overlayStyles,
81
+ registerSymbol: () => registerSymbol,
82
+ registerSymbols: () => registerSymbols,
81
83
  useDrag: () => useDrag,
82
84
  useKeyboardShortcuts: () => useKeyboardShortcuts,
83
85
  useSelection: () => useSelection,
@@ -1794,13 +1796,13 @@ var mockSymbolLibrary = {
1794
1796
  id: "valve-gate",
1795
1797
  name: "Gate Valve (Powered)",
1796
1798
  category: "valve",
1797
- viewBox: { x: 0, y: 0, width: 52, height: 52 },
1799
+ viewBox: { x: 0, y: 0, width: 26, height: 26 },
1798
1800
  ports: [
1799
- { id: "inlet", x: 0, y: 36, type: "inlet", direction: "in" },
1800
- { id: "outlet", x: 52, y: 36, type: "outlet", direction: "out" }
1801
+ { id: "inlet", x: 0, y: 18, type: "inlet", direction: "in" },
1802
+ { id: "outlet", x: 26, y: 18, type: "outlet", direction: "out" }
1801
1803
  ],
1802
1804
  svgContent: `
1803
- <g>
1805
+ <g transform="scale(0.5)">
1804
1806
  <!-- Actuator box -->
1805
1807
  <rect x="16.74" y="0" width="18.02" height="18.02" fill="var(--symbol-fill, #edeeef)" stroke="var(--symbol-stroke, #666666)" pointer-events="all"/>
1806
1808
  <!-- Actuator stem -->
@@ -1818,13 +1820,13 @@ var mockSymbolLibrary = {
1818
1820
  id: "pump-positive-displacement",
1819
1821
  name: "Positive Displacement Pump",
1820
1822
  category: "pump",
1821
- viewBox: { x: 0, y: 0, width: 56.25, height: 56.25 },
1823
+ viewBox: { x: 0, y: 0, width: 28.125, height: 28.125 },
1822
1824
  ports: [
1823
- { id: "inlet", x: 0, y: 28.125, type: "inlet", direction: "in" },
1824
- { id: "outlet", x: 56.25, y: 28.125, type: "outlet", direction: "out" }
1825
+ { id: "inlet", x: 0, y: 14.0625, type: "inlet", direction: "in" },
1826
+ { id: "outlet", x: 28.125, y: 14.0625, type: "outlet", direction: "out" }
1825
1827
  ],
1826
1828
  svgContent: `
1827
- <g transform="scale(0.5625)">
1829
+ <g transform="scale(0.28125)">
1828
1830
  <!-- Outer circle -->
1829
1831
  <ellipse
1830
1832
  cx="50"
@@ -1866,13 +1868,13 @@ var mockSymbolLibrary = {
1866
1868
  id: "vannefold-bottom",
1867
1869
  name: "Vannefold Block (Bottom)",
1868
1870
  category: "valve",
1869
- viewBox: { x: -0.5, y: -0.5, width: 88, height: 67.785156 },
1871
+ viewBox: { x: -0.25, y: -0.25, width: 44, height: 33.892578 },
1870
1872
  ports: [
1871
- { id: "bottom-inlet", x: 0, y: 25, type: "control", direction: "in" },
1872
- { id: "top-outlet", x: 48, y: 65, type: "control", direction: "out" }
1873
+ { id: "bottom-inlet", x: 0, y: 12.5, type: "control", direction: "in" },
1874
+ { id: "top-outlet", x: 24, y: 32.5, type: "control", direction: "out" }
1873
1875
  ],
1874
1876
  svgContent: `
1875
- <g>
1877
+ <g transform="scale(0.5)">
1876
1878
  <!-- Bottom inlet pipe -->
1877
1879
  <path
1878
1880
  d="M 3,29.785156 H 0 v -10 h 3 m 14,10 h 3 v -10 h -3 m -15,8 h 16 m -16,-6 h 16"
@@ -1930,13 +1932,13 @@ var mockSymbolLibrary = {
1930
1932
  id: "vannefold-middle",
1931
1933
  name: "Vannefold Block (Middle)",
1932
1934
  category: "valve",
1933
- viewBox: { x: -0.5, y: -0.5, width: 95, height: 53.097656 },
1935
+ viewBox: { x: -0.25, y: -0.25, width: 47.5, height: 26.548828 },
1934
1936
  ports: [
1935
- { id: "left-inlet", x: 0, y: 27.3125, type: "control", direction: "in" },
1936
- { id: "right-outlet", x: 95, y: 27.3125, type: "control", direction: "out" }
1937
+ { id: "left-inlet", x: 0, y: 13.65625, type: "control", direction: "in" },
1938
+ { id: "right-outlet", x: 47.5, y: 13.65625, type: "control", direction: "out" }
1937
1939
  ],
1938
1940
  svgContent: `
1939
- <g>
1941
+ <g transform="scale(0.5)">
1940
1942
  <!-- Left inlet pipe -->
1941
1943
  <path
1942
1944
  d="M 3,22.3125 H 0 v 10 H 3 m 14,-10 h 3 v 10 h -3 m -15,-8 h 16 m -16,6 h 16"
@@ -1985,13 +1987,13 @@ var mockSymbolLibrary = {
1985
1987
  id: "vannefold-top",
1986
1988
  name: "Vannefold Block (Top)",
1987
1989
  category: "valve",
1988
- viewBox: { x: -0.5, y: -0.5, width: 95, height: 60.785156 },
1990
+ viewBox: { x: -0.25, y: -0.25, width: 47.5, height: 30.392578 },
1989
1991
  ports: [
1990
- { id: "bottom-inlet", x: 0, y: 35, type: "control", direction: "in" },
1991
- { id: "top-outlet", x: 48, y: 0, type: "control", direction: "out" }
1992
+ { id: "bottom-inlet", x: 0, y: 17.5, type: "control", direction: "in" },
1993
+ { id: "top-outlet", x: 24, y: 0, type: "control", direction: "out" }
1992
1994
  ],
1993
1995
  svgContent: `
1994
- <g>
1996
+ <g transform="scale(0.5)">
1995
1997
  <!-- Bottom inlet pipe -->
1996
1998
  <path
1997
1999
  d="M 3,30 H 0 V 40 H 3 M 17,30 h 3 V 40 H 17 M 2,32 H 18 M 2,38 H 18"
@@ -2041,13 +2043,13 @@ var mockSymbolLibrary = {
2041
2043
  id: "vannefold-top-top-inlet",
2042
2044
  name: "Vannefold Block (Top, Top Inlet)",
2043
2045
  category: "valve",
2044
- viewBox: { x: 0, y: 0, width: 88, height: 67.576004 },
2046
+ viewBox: { x: 0, y: 0, width: 44, height: 33.788002 },
2045
2047
  ports: [
2046
- { id: "top-inlet", x: 47, y: 0, type: "control", direction: "in" },
2047
- { id: "bottom-outlet", x: 0, y: 42, type: "control", direction: "out" }
2048
+ { id: "top-inlet", x: 23.5, y: 0, type: "control", direction: "in" },
2049
+ { id: "bottom-outlet", x: 0, y: 21, type: "control", direction: "out" }
2048
2050
  ],
2049
2051
  svgContent: `
2050
- <g>
2052
+ <g transform="scale(0.5)">
2051
2053
  <!-- Top inlet pipe flange -->
2052
2054
  <path
2053
2055
  d="M 52,3 V 1.3598666e-8 H 42 V 3 m 10,14 v 3 H 42 V 17 M 50,2 V 18 M 44,2 v 16"
@@ -2105,13 +2107,13 @@ var mockSymbolLibrary = {
2105
2107
  id: "vannefold-left",
2106
2108
  name: "Vannefold Block (Left)",
2107
2109
  category: "valve",
2108
- viewBox: { x: 0, y: 0, width: 67.785156, height: 88.5 },
2110
+ viewBox: { x: 0, y: 0, width: 33.892578, height: 44.25 },
2109
2111
  ports: [
2110
- { id: "left-inlet", x: 0, y: 41.5, type: "control", direction: "in" },
2111
- { id: "right-outlet", x: 42, y: 87, type: "control", direction: "out" }
2112
+ { id: "left-inlet", x: 0, y: 20.75, type: "control", direction: "in" },
2113
+ { id: "right-outlet", x: 21, y: 43.5, type: "control", direction: "out" }
2112
2114
  ],
2113
2115
  svgContent: `
2114
- <g>
2116
+ <g transform="scale(0.5)">
2115
2117
  <!-- Left inlet pipe flange -->
2116
2118
  <path
2117
2119
  d="M 3,46.5 H 2.8789924e-8 v -10 H 3 m 14,10 h 3 v -10 h -3 m -15,8 h 16 m -16,-6 h 16"
@@ -2168,13 +2170,13 @@ var mockSymbolLibrary = {
2168
2170
  id: "vannefold-right",
2169
2171
  name: "Vannefold Block (Right)",
2170
2172
  category: "valve",
2171
- viewBox: { x: 0, y: 0, width: 67.785156, height: 88.5 },
2173
+ viewBox: { x: 0, y: 0, width: 33.892578, height: 44.25 },
2172
2174
  ports: [
2173
- { id: "right-inlet", x: 67.785156, y: 41.5, type: "control", direction: "in" },
2174
- { id: "left-outlet", x: 24.785156, y: 87.5, type: "control", direction: "out" }
2175
+ { id: "right-inlet", x: 33.892578, y: 20.75, type: "control", direction: "in" },
2176
+ { id: "left-outlet", x: 12.392578, y: 43.75, type: "control", direction: "out" }
2175
2177
  ],
2176
2178
  svgContent: `
2177
- <g>
2179
+ <g transform="scale(0.5)">
2178
2180
  <!-- Right inlet pipe flange -->
2179
2181
  <path
2180
2182
  d="m 63.785156,46.5 h 3 v -10 h -3 m -14,10 h -3 v -10 h 3 m 15,8 h -16 m 16,-6 h -16"
@@ -2231,16 +2233,16 @@ var mockSymbolLibrary = {
2231
2233
  id: "pixer",
2232
2234
  name: "Pixer",
2233
2235
  category: "pump",
2234
- viewBox: { x: 0, y: 0, width: 50.625, height: 46.6875 },
2236
+ viewBox: { x: 0, y: 0, width: 25.3125, height: 23.34375 },
2235
2237
  ports: [
2236
- { id: "right-outlet", x: 50.625, y: 30.9375, type: "control", direction: "out" },
2237
- { id: "left-outlet", x: 0, y: 30.9375, type: "control", direction: "out" },
2238
- { id: "left-inlet", x: 50.625, y: 19.6875, type: "control", direction: "in" },
2239
- { id: "right-inlet", x: 0, y: 19.6875, type: "control", direction: "in" },
2240
- { id: "top-inlet", x: 25.3125, y: 0, type: "control", direction: "in" }
2238
+ { id: "right-outlet", x: 25.3125, y: 15.46875, type: "control", direction: "out" },
2239
+ { id: "left-outlet", x: 0, y: 15.46875, type: "control", direction: "out" },
2240
+ { id: "left-inlet", x: 25.3125, y: 9.84375, type: "control", direction: "in" },
2241
+ { id: "right-inlet", x: 0, y: 9.84375, type: "control", direction: "in" },
2242
+ { id: "top-inlet", x: 12.65625, y: 0, type: "control", direction: "in" }
2241
2243
  ],
2242
2244
  svgContent: `
2243
- <g transform="scale(0.196875) translate(-195, -186)">
2245
+ <g transform="scale(0.0984375) translate(-195, -186)">
2244
2246
  <!-- Top mounting flange -->
2245
2247
  <rect
2246
2248
  width="141.313"
@@ -2505,16 +2507,16 @@ var mockSymbolLibrary = {
2505
2507
  id: "pixer-barb",
2506
2508
  name: "Pixer (Hose Barb)",
2507
2509
  category: "pump",
2508
- viewBox: { x: 0, y: 0, width: 50.625, height: 46.6875 },
2510
+ viewBox: { x: 0, y: 0, width: 25.3125, height: 23.34375 },
2509
2511
  ports: [
2510
- { id: "right-outlet", x: 50.625, y: 30.9375, type: "control", direction: "out" },
2511
- { id: "left-outlet", x: 0, y: 30.9375, type: "control", direction: "out" },
2512
- { id: "left-inlet", x: 50.625, y: 19.6875, type: "control", direction: "in" },
2513
- { id: "right-inlet", x: 0, y: 19.6875, type: "control", direction: "in" },
2514
- { id: "top-inlet", x: 25.3125, y: 0, type: "control", direction: "in" }
2512
+ { id: "right-outlet", x: 25.3125, y: 15.46875, type: "control", direction: "out" },
2513
+ { id: "left-outlet", x: 0, y: 15.46875, type: "control", direction: "out" },
2514
+ { id: "left-inlet", x: 25.3125, y: 9.84375, type: "control", direction: "in" },
2515
+ { id: "right-inlet", x: 0, y: 9.84375, type: "control", direction: "in" },
2516
+ { id: "top-inlet", x: 12.65625, y: 0, type: "control", direction: "in" }
2515
2517
  ],
2516
2518
  svgContent: `
2517
- <g transform="scale(0.196875) translate(-195, -186)">
2519
+ <g transform="scale(0.0984375) translate(-195, -186)">
2518
2520
  <!-- Hose barb ridges at top -->
2519
2521
  <rect
2520
2522
  width="20"
@@ -2796,15 +2798,15 @@ var mockSymbolLibrary = {
2796
2798
  id: "vessel-balloon",
2797
2799
  name: "Vessel",
2798
2800
  category: "vessel",
2799
- viewBox: { x: 0, y: 0, width: 50.625, height: 91 },
2801
+ viewBox: { x: 0, y: 0, width: 25.3125, height: 45.5 },
2800
2802
  ports: [
2801
- { id: "top", type: "inlet", x: 25.3125, y: 0 },
2802
- { id: "left", type: "inlet", x: 5, y: 39 },
2803
- { id: "right", type: "outlet", x: 45.625, y: 39 },
2804
- { id: "bottom", type: "outlet", x: 25.3125, y: 91 }
2803
+ { id: "top", type: "inlet", x: 12.65625, y: 0 },
2804
+ { id: "left", type: "inlet", x: 2.5, y: 19.5 },
2805
+ { id: "right", type: "outlet", x: 22.8125, y: 19.5 },
2806
+ { id: "bottom", type: "outlet", x: 12.65625, y: 45.5 }
2805
2807
  ],
2806
2808
  svgContent: `
2807
- <g transform="scale(0.196875) translate(-195, -100)">
2809
+ <g transform="scale(0.0984375) translate(-195, -100)">
2808
2810
  <!-- Top opening nozzle -->
2809
2811
  <rect
2810
2812
  width="65"
@@ -2869,19 +2871,53 @@ var mockSymbolLibrary = {
2869
2871
  tags: ["vessel", "storage", "tank", "balloon"]
2870
2872
  }
2871
2873
  },
2874
+ "hollow-fiber": {
2875
+ id: "hollow-fiber",
2876
+ name: "Hollow Fiber",
2877
+ category: "other",
2878
+ viewBox: { x: 0, y: 0, width: 30, height: 109 },
2879
+ ports: [
2880
+ { id: "top-left", type: "outlet", x: 10, y: 2.75 },
2881
+ { id: "top-right", type: "outlet", x: 24.5, y: 22.25 },
2882
+ { id: "bottom-left", type: "inlet", x: 10, y: 106.25 },
2883
+ { id: "bottom-right", type: "inlet", x: 24.5, y: 87.25 }
2884
+ ],
2885
+ svgContent: `
2886
+ <g transform="scale(0.5)">
2887
+ <!-- Top left flange -->
2888
+ <rect x="10.5" y="0.5" width="20" height="10" rx="1.5" ry="1.5" fill="var(--symbol-fill, #eaeaea)" stroke="var(--symbol-stroke, #000000)" />
2889
+
2890
+ <!-- Top right flange -->
2891
+ <rect x="39.5" y="39.5" width="20" height="10" rx="1.5" ry="1.5" fill="var(--symbol-fill, #eaeaea)" stroke="var(--symbol-stroke, #000000)" />
2892
+
2893
+ <!-- Bottom left flange -->
2894
+ <rect x="10.5" y="207.5" width="20" height="10" rx="1.5" ry="1.5" fill="var(--symbol-fill, #eaeaea)" stroke="var(--symbol-stroke, #000000)" />
2895
+
2896
+ <!-- Bottom right flange -->
2897
+ <rect x="39.5" y="169.5" width="20" height="10" rx="1.5" ry="1.5" fill="var(--symbol-fill, #eaeaea)" stroke="var(--symbol-stroke, #000000)" />
2898
+
2899
+ <!-- Main vessel body -->
2900
+ <rect x="0.5" y="9.5" width="40" height="199.5" rx="6" ry="6" fill="var(--symbol-fill, #eaeaea)" stroke="var(--symbol-stroke, #000000)" />
2901
+ </g>
2902
+ `,
2903
+ metadata: {
2904
+ description: "Hollow fiber filter module with multiple inlet/outlet connections",
2905
+ tags: ["filter", "hollow-fiber", "filtration", "separation", "membrane"]
2906
+ }
2907
+ },
2872
2908
  "psr-f": {
2873
2909
  id: "psr-f",
2874
2910
  name: "PSR F",
2875
2911
  category: "instrument",
2876
- viewBox: { x: 0, y: 0, width: 57, height: 57 },
2912
+ viewBox: { x: 0, y: 0, width: 28.5, height: 28.5 },
2877
2913
  ports: [
2878
- { id: "top", type: "signal", x: 28.5, y: 14.25 },
2879
- { id: "right", type: "signal", x: 42.75, y: 28.5 },
2880
- { id: "bottom", type: "signal", x: 28.5, y: 42.75 },
2881
- { id: "left", type: "signal", x: 14.25, y: 28.5 }
2914
+ { id: "top", type: "signal", x: 14.25, y: 7.125 },
2915
+ { id: "right", type: "signal", x: 21.375, y: 14.25 },
2916
+ { id: "bottom", type: "signal", x: 14.25, y: 21.375 },
2917
+ { id: "left", type: "signal", x: 7.125, y: 14.25 }
2882
2918
  ],
2883
2919
  svgContent: `
2884
- <g transform="scale(0.5) translate(28.5, 28.5)">
2920
+ <g transform="scale(0.25) translate(28.5, 28.5)">
2885
2921
  <!-- Circle background -->
2886
2922
  <ellipse
2887
2923
  cx="28.5"
@@ -2915,15 +2951,15 @@ var mockSymbolLibrary = {
2915
2951
  id: "psr-p",
2916
2952
  name: "PSR P",
2917
2953
  category: "instrument",
2918
- viewBox: { x: 0, y: 0, width: 57, height: 57 },
2954
+ viewBox: { x: 0, y: 0, width: 28.5, height: 28.5 },
2919
2955
  ports: [
2920
- { id: "top", type: "signal", x: 28.5, y: 14.25 },
2921
- { id: "right", type: "signal", x: 42.75, y: 28.5 },
2922
- { id: "bottom", type: "signal", x: 28.5, y: 42.75 },
2923
- { id: "left", type: "signal", x: 14.25, y: 28.5 }
2956
+ { id: "top", type: "signal", x: 14.25, y: 7.125 },
2957
+ { id: "right", type: "signal", x: 21.375, y: 14.25 },
2958
+ { id: "bottom", type: "signal", x: 14.25, y: 21.375 },
2959
+ { id: "left", type: "signal", x: 7.125, y: 14.25 }
2924
2960
  ],
2925
2961
  svgContent: `
2926
- <g transform="scale(0.5) translate(28.5, 28.5)">
2962
+ <g transform="scale(0.25) translate(28.5, 28.5)">
2927
2963
  <!-- Circle background -->
2928
2964
  <ellipse
2929
2965
  cx="28.5"
@@ -2954,11 +2990,22 @@ var mockSymbolLibrary = {
2954
2990
  }
2955
2991
  }
2956
2992
  };
2993
+ var customSymbols = {};
2994
+ function registerSymbol(symbol) {
2995
+ customSymbols[symbol.id] = symbol;
2996
+ }
2997
+ function registerSymbols(symbols) {
2998
+ if (Array.isArray(symbols)) {
2999
+ symbols.forEach((symbol) => registerSymbol(symbol));
3000
+ } else {
3001
+ Object.values(symbols).forEach((symbol) => registerSymbol(symbol));
3002
+ }
3003
+ }
2957
3004
  function getSymbolDefinition(symbolId) {
2958
- return mockSymbolLibrary[symbolId];
3005
+ return customSymbols[symbolId] ?? mockSymbolLibrary[symbolId];
2959
3006
  }
2960
3007
  function getAvailableSymbols() {
2961
- return Object.keys(mockSymbolLibrary);
3008
+ return [...Object.keys(customSymbols), ...Object.keys(mockSymbolLibrary)];
2962
3009
  }
2963
3010
 
2964
3011
  // src/components/PIDCanvas/NodeRenderer.tsx
@@ -6588,6 +6635,8 @@ function useSimulation(telemetry, updateTelemetryBatch, options = {}) {
6588
6635
  mockSymbolLibrary,
6589
6636
  nodeHasPort,
6590
6637
  overlayStyles,
6638
+ registerSymbol,
6639
+ registerSymbols,
6591
6640
  useDrag,
6592
6641
  useKeyboardShortcuts,
6593
6642
  useSelection,