@adcops/autocore-react 3.0.39 → 3.1.1

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.
Files changed (393) hide show
  1. package/additional-docs/AutoCoreTagContext.md +441 -0
  2. package/dist/assets/BlocklyLogo.d.ts +1 -0
  3. package/dist/assets/BlocklyLogo.d.ts.map +1 -0
  4. package/dist/assets/Distance.d.ts +1 -0
  5. package/dist/assets/Distance.d.ts.map +1 -0
  6. package/dist/assets/JogLong.d.ts +1 -0
  7. package/dist/assets/JogLong.d.ts.map +1 -0
  8. package/dist/assets/JogMedium.d.ts +1 -0
  9. package/dist/assets/JogMedium.d.ts.map +1 -0
  10. package/dist/assets/JogShort.d.ts +1 -0
  11. package/dist/assets/JogShort.d.ts.map +1 -0
  12. package/dist/assets/PythonLogo.d.ts +1 -0
  13. package/dist/assets/PythonLogo.d.ts.map +1 -0
  14. package/dist/assets/Rotation3D.d.ts +1 -0
  15. package/dist/assets/Rotation3D.d.ts.map +1 -0
  16. package/dist/assets/RotationCcw.d.ts +1 -0
  17. package/dist/assets/RotationCcw.d.ts.map +1 -0
  18. package/dist/assets/RotationCcwA.d.ts +1 -0
  19. package/dist/assets/RotationCcwA.d.ts.map +1 -0
  20. package/dist/assets/RotationCcwB.d.ts +1 -0
  21. package/dist/assets/RotationCcwB.d.ts.map +1 -0
  22. package/dist/assets/RotationCcwC.d.ts +1 -0
  23. package/dist/assets/RotationCcwC.d.ts.map +1 -0
  24. package/dist/assets/RotationCw.d.ts +1 -0
  25. package/dist/assets/RotationCw.d.ts.map +1 -0
  26. package/dist/assets/RotationCwA.d.ts +1 -0
  27. package/dist/assets/RotationCwA.d.ts.map +1 -0
  28. package/dist/assets/RotationCwB.d.ts +1 -0
  29. package/dist/assets/RotationCwB.d.ts.map +1 -0
  30. package/dist/assets/RotationCwC.d.ts +1 -0
  31. package/dist/assets/RotationCwC.d.ts.map +1 -0
  32. package/dist/assets/Run.d.ts +1 -0
  33. package/dist/assets/Run.d.ts.map +1 -0
  34. package/dist/assets/Speed.d.ts +1 -0
  35. package/dist/assets/Speed.d.ts.map +1 -0
  36. package/dist/assets/SpeedFast.d.ts +1 -0
  37. package/dist/assets/SpeedFast.d.ts.map +1 -0
  38. package/dist/assets/SpeedMedium.d.ts +1 -0
  39. package/dist/assets/SpeedMedium.d.ts.map +1 -0
  40. package/dist/assets/SpeedNone.d.ts +1 -0
  41. package/dist/assets/SpeedNone.d.ts.map +1 -0
  42. package/dist/assets/SpeedSlow.d.ts +1 -0
  43. package/dist/assets/SpeedSlow.d.ts.map +1 -0
  44. package/dist/assets/Walk.d.ts +1 -0
  45. package/dist/assets/Walk.d.ts.map +1 -0
  46. package/dist/assets/index.d.ts +1 -0
  47. package/dist/assets/index.d.ts.map +1 -0
  48. package/dist/components/AutoCoreDevPanel.d.ts +144 -0
  49. package/dist/components/AutoCoreDevPanel.d.ts.map +1 -0
  50. package/dist/components/AutoCoreDevPanel.js +1 -0
  51. package/dist/components/BlocklyEditor.d.ts +1 -0
  52. package/dist/components/BlocklyEditor.d.ts.map +1 -0
  53. package/dist/components/BlocklyEditor.js +1 -1
  54. package/dist/components/CodeEditor.d.ts +2 -1
  55. package/dist/components/CodeEditor.d.ts.map +1 -0
  56. package/dist/components/CodeEditor.js +1 -1
  57. package/dist/components/FileList.d.ts +1 -0
  58. package/dist/components/FileList.d.ts.map +1 -0
  59. package/dist/components/FileList.js +1 -1
  60. package/dist/components/FileSelect.d.ts +1 -0
  61. package/dist/components/FileSelect.d.ts.map +1 -0
  62. package/dist/components/FileSelect.js +1 -1
  63. package/dist/components/FitText.d.ts +1 -0
  64. package/dist/components/FitText.d.ts.map +1 -0
  65. package/dist/components/FitText.js +1 -1
  66. package/dist/components/Indicator.d.ts +2 -1
  67. package/dist/components/Indicator.d.ts.map +1 -0
  68. package/dist/components/Indicator.js +1 -1
  69. package/dist/components/IndicatorButton.d.ts +23 -137
  70. package/dist/components/IndicatorButton.d.ts.map +1 -0
  71. package/dist/components/IndicatorButton.js +1 -1
  72. package/dist/components/IndicatorRect.d.ts +2 -1
  73. package/dist/components/IndicatorRect.d.ts.map +1 -0
  74. package/dist/components/JogPanel.d.ts +1 -0
  75. package/dist/components/JogPanel.d.ts.map +1 -0
  76. package/dist/components/Lamp.d.ts +2 -1
  77. package/dist/components/Lamp.d.ts.map +1 -0
  78. package/dist/components/Lamp.js +1 -1
  79. package/dist/components/Osk.d.ts +1 -0
  80. package/dist/components/Osk.d.ts.map +1 -0
  81. package/dist/components/Osk.js +1 -1
  82. package/dist/components/OskDialog.d.ts +1 -0
  83. package/dist/components/OskDialog.d.ts.map +1 -0
  84. package/dist/components/ProgressBarWithValue.d.ts +1 -0
  85. package/dist/components/ProgressBarWithValue.d.ts.map +1 -0
  86. package/dist/components/ProgressBarWithValue.js +1 -1
  87. package/dist/components/TextInput.d.ts +62 -103
  88. package/dist/components/TextInput.d.ts.map +1 -0
  89. package/dist/components/TextInput.js +1 -1
  90. package/dist/components/ToggleGroup.d.ts +2 -1
  91. package/dist/components/ToggleGroup.d.ts.map +1 -0
  92. package/dist/components/ToggleGroup.js +1 -1
  93. package/dist/components/ValueDisplay.d.ts +3 -2
  94. package/dist/components/ValueDisplay.d.ts.map +1 -0
  95. package/dist/components/ValueDisplay.js +1 -1
  96. package/dist/components/ValueIndicator.d.ts +2 -1
  97. package/dist/components/ValueIndicator.d.ts.map +1 -0
  98. package/dist/components/ValueIndicator.js +1 -1
  99. package/dist/components/ValueInput.d.ts +2 -1
  100. package/dist/components/ValueInput.d.ts.map +1 -0
  101. package/dist/components/ValueInput.js +1 -1
  102. package/dist/core/ActionMode.d.ts +1 -0
  103. package/dist/core/ActionMode.d.ts.map +1 -0
  104. package/dist/core/AutoCoreTagContext.d.ts +224 -0
  105. package/dist/core/AutoCoreTagContext.d.ts.map +1 -0
  106. package/dist/core/AutoCoreTagContext.js +1 -0
  107. package/dist/core/AutoCoreTagTypes.d.ts +162 -0
  108. package/dist/core/AutoCoreTagTypes.d.ts.map +1 -0
  109. package/dist/core/AutoCoreTagTypes.js +1 -0
  110. package/dist/core/EventEmitterContext.d.ts +295 -2
  111. package/dist/core/EventEmitterContext.d.ts.map +1 -0
  112. package/dist/core/EventEmitterContext.js +1 -1
  113. package/dist/core/IndicatorButtonState.d.ts +1 -0
  114. package/dist/core/IndicatorButtonState.d.ts.map +1 -0
  115. package/dist/core/IndicatorColor.d.ts +1 -0
  116. package/dist/core/IndicatorColor.d.ts.map +1 -0
  117. package/dist/core/MaskPatterns.d.ts +1 -0
  118. package/dist/core/MaskPatterns.d.ts.map +1 -0
  119. package/dist/core/NumerableTypes.d.ts +1 -0
  120. package/dist/core/NumerableTypes.d.ts.map +1 -0
  121. package/dist/core/NumerableTypes.js +1 -1
  122. package/dist/core/PositionContext.d.ts +1 -1
  123. package/dist/core/PositionContext.d.ts.map +1 -0
  124. package/dist/core/UniqueId.d.ts +1 -0
  125. package/dist/core/UniqueId.d.ts.map +1 -0
  126. package/dist/core/ValueSimulator.d.ts +2 -1
  127. package/dist/core/ValueSimulator.d.ts.map +1 -0
  128. package/dist/core/ValueSimulator.js +1 -1
  129. package/dist/core/hoc.d.ts +1 -0
  130. package/dist/core/hoc.d.ts.map +1 -0
  131. package/dist/core/hoc.js +1 -1
  132. package/dist/hooks/adsHooks.d.ts +1 -0
  133. package/dist/hooks/adsHooks.d.ts.map +1 -0
  134. package/dist/hooks/adsHooks.js +1 -1
  135. package/dist/hooks/commandHooks.d.ts +1 -0
  136. package/dist/hooks/commandHooks.d.ts.map +1 -0
  137. package/dist/hooks/commandHooks.js +1 -1
  138. package/dist/hooks/index.d.ts +1 -0
  139. package/dist/hooks/index.d.ts.map +1 -0
  140. package/dist/hooks/useAutoCoreTag.d.ts +26 -0
  141. package/dist/hooks/useAutoCoreTag.d.ts.map +1 -0
  142. package/dist/hooks/useAutoCoreTag.js +1 -0
  143. package/dist/hooks/useScaledValue.d.ts +1 -0
  144. package/dist/hooks/useScaledValue.d.ts.map +1 -0
  145. package/dist/hooks/useScaledValue.js +1 -1
  146. package/dist/hub/CommandMessage.d.ts +1 -0
  147. package/dist/hub/CommandMessage.d.ts.map +1 -0
  148. package/dist/hub/HubBase.d.ts +3 -2
  149. package/dist/hub/HubBase.d.ts.map +1 -0
  150. package/dist/hub/HubSimulate.d.ts +2 -1
  151. package/dist/hub/HubSimulate.d.ts.map +1 -0
  152. package/dist/hub/HubSimulate.js +1 -1
  153. package/dist/hub/HubTauri.d.ts +2 -1
  154. package/dist/hub/HubTauri.d.ts.map +1 -0
  155. package/dist/hub/HubTauri.js +1 -1
  156. package/dist/hub/HubWebSocket.d.ts +2 -1
  157. package/dist/hub/HubWebSocket.d.ts.map +1 -0
  158. package/dist/hub/HubWebSocket.js +1 -1
  159. package/dist/hub/index.d.ts +2 -1
  160. package/dist/hub/index.d.ts.map +1 -0
  161. package/dist/hub/index.js +1 -1
  162. package/docs/.nojekyll +1 -0
  163. package/docs/assets/hierarchy.js +1 -0
  164. package/docs/assets/highlight.css +134 -0
  165. package/docs/assets/icons.js +18 -0
  166. package/docs/assets/icons.svg +1 -0
  167. package/docs/assets/main.js +60 -0
  168. package/docs/assets/navigation.js +1 -0
  169. package/docs/assets/search.js +1 -0
  170. package/docs/assets/style.css +1633 -0
  171. package/docs/classes/components_CodeEditor.CodeEditor.html +108 -101
  172. package/docs/classes/components_Indicator.Indicator.html +122 -0
  173. package/docs/classes/components_IndicatorRect.IndicatorRect.html +121 -0
  174. package/docs/classes/components_JogPanel.JogPanel.html +104 -106
  175. package/docs/classes/components_Lamp.Lamp.html +96 -79
  176. package/docs/classes/components_OskDialog.OskDialog.html +125 -0
  177. package/docs/classes/components_TextInput.TextInput.html +99 -89
  178. package/docs/classes/components_ValueDisplay.ValueDisplay.html +148 -0
  179. package/docs/classes/components_ValueIndicator.ValueIndicator.html +98 -91
  180. package/docs/classes/core_ValueSimulator.ValueSimulator.html +51 -0
  181. package/docs/classes/hub_HubBase.HubBase.html +106 -0
  182. package/docs/classes/hub_HubSimulate.HubSimulate.html +75 -0
  183. package/docs/classes/hub_HubTauri.HubTauri.html +93 -0
  184. package/docs/classes/hub_HubWebSocket.HubWebSocket.html +75 -69
  185. package/docs/documents/core_AutoCoreTagContext.AutoCoreTagContext.html +148 -0
  186. package/docs/enums/components_JogPanel.JogDistanceAction.html +5 -5
  187. package/docs/enums/components_JogPanel.JogPanelAction.html +18 -18
  188. package/docs/enums/components_JogPanel.JogSpeedAction.html +5 -5
  189. package/docs/enums/core_ActionMode.ActionMode.html +6 -6
  190. package/docs/enums/core_IndicatorColor.IndicatorColor.html +22 -22
  191. package/docs/functions/assets.BlocklyLogo.html +1 -0
  192. package/docs/functions/assets.Distance.html +1 -0
  193. package/docs/functions/assets.JogLong.html +1 -0
  194. package/docs/functions/assets.JogMedium.html +1 -0
  195. package/docs/functions/assets.JogShort.html +1 -0
  196. package/docs/functions/assets.PythonLogo.html +1 -0
  197. package/docs/functions/assets.Rotation3D.html +1 -0
  198. package/docs/functions/assets.RotationCcw.html +1 -0
  199. package/docs/functions/assets.RotationCcwA.html +1 -0
  200. package/docs/functions/assets.RotationCcwB.html +1 -0
  201. package/docs/functions/assets.RotationCcwC.html +1 -0
  202. package/docs/functions/assets.RotationCw.html +1 -0
  203. package/docs/functions/assets.RotationCwA.html +1 -0
  204. package/docs/functions/assets.RotationCwB.html +1 -0
  205. package/docs/functions/assets.RotationCwC.html +1 -0
  206. package/docs/functions/assets.Run.html +1 -0
  207. package/docs/functions/assets.Speed.html +1 -0
  208. package/docs/functions/assets.SpeedFast.html +1 -0
  209. package/docs/functions/assets.SpeedMedium.html +1 -0
  210. package/docs/functions/assets.SpeedNone.html +1 -0
  211. package/docs/functions/assets.SpeedSlow.html +1 -0
  212. package/docs/functions/assets.Walk.html +1 -0
  213. package/docs/functions/components_BlocklyEditor.createCustomToolbox.html +5 -5
  214. package/docs/functions/core_UniqueId.UniqueId.html +9 -0
  215. package/docs/functions/core_hoc.hocAddSubscription.html +6 -0
  216. package/docs/functions/hooks_adsHooks.useAdsRegisterSymbols.html +16 -0
  217. package/docs/functions/hooks_adsHooks.useAdsTapValue.html +8 -0
  218. package/docs/functions/hooks_adsHooks.useAdsWriteScaledValue.html +18 -0
  219. package/docs/functions/hooks_adsHooks.useAdsWriteValue.html +9 -0
  220. package/docs/functions/hooks_commandHooks.useRegisterSymbols.html +16 -0
  221. package/docs/functions/hooks_commandHooks.useTapValue.html +10 -0
  222. package/docs/functions/hooks_commandHooks.useWriteScaledValue.html +18 -0
  223. package/docs/functions/hooks_commandHooks.useWriteValue.html +11 -0
  224. package/docs/functions/hooks_useAutoCoreTag.ts.makeAutoCoreTagHooks.html +12 -0
  225. package/docs/functions/hooks_useScaledValue.useScaledValue.html +18 -0
  226. package/docs/functions/hub.createHub.html +3 -0
  227. package/docs/hierarchy.html +1 -0
  228. package/docs/index.html +148 -0
  229. package/docs/interfaces/components_IndicatorButton.IndicatorButtonProps.html +654 -0
  230. package/docs/interfaces/components_IndicatorRect.IndicatorRectProps.html +37 -0
  231. package/docs/interfaces/components_JogPanel.JogPanelButtonDefinition.html +5 -5
  232. package/docs/interfaces/components_ToggleGroup.ToggleGroupProps.html +545 -519
  233. package/docs/interfaces/core_AutoCoreTagTypes.BaseContextValue.html +12 -0
  234. package/docs/interfaces/core_AutoCoreTagTypes.ScaleConfig.html +13 -0
  235. package/docs/interfaces/core_EventEmitterContext.Action.html +8 -0
  236. package/docs/interfaces/core_EventEmitterContext.EventEmitterContextType.html +33 -0
  237. package/docs/interfaces/core_EventEmitterContext.State.html +8 -0
  238. package/docs/interfaces/core_EventEmitterContext.Subscription.html +6 -0
  239. package/docs/interfaces/core_IndicatorButtonState.IndicatorButtonState.html +10 -10
  240. package/docs/interfaces/core_PositionContext.IPositionContext.html +17 -0
  241. package/docs/interfaces/hub_CommandMessage.CommandMessage.html +6 -6
  242. package/docs/interfaces/hub_CommandMessage.CommandMessageResult.html +4 -4
  243. package/docs/modules/assets.html +1 -23
  244. package/docs/modules/assets_BlocklyLogo.html +1 -2
  245. package/docs/modules/assets_Distance.html +1 -2
  246. package/docs/modules/assets_JogLong.html +1 -2
  247. package/docs/modules/assets_JogMedium.html +1 -2
  248. package/docs/modules/assets_JogShort.html +1 -2
  249. package/docs/modules/assets_PythonLogo.html +1 -2
  250. package/docs/modules/assets_Rotation3D.html +1 -2
  251. package/docs/modules/assets_RotationCcw.html +1 -2
  252. package/docs/modules/assets_RotationCcwA.html +1 -2
  253. package/docs/modules/assets_RotationCcwB.html +1 -2
  254. package/docs/modules/assets_RotationCcwC.html +1 -2
  255. package/docs/modules/assets_RotationCw.html +1 -2
  256. package/docs/modules/assets_RotationCwA.html +1 -2
  257. package/docs/modules/assets_RotationCwB.html +1 -2
  258. package/docs/modules/assets_RotationCwC.html +1 -2
  259. package/docs/modules/assets_Run.html +1 -2
  260. package/docs/modules/assets_Speed.html +1 -2
  261. package/docs/modules/assets_SpeedFast.html +1 -2
  262. package/docs/modules/assets_SpeedMedium.html +1 -2
  263. package/docs/modules/assets_SpeedNone.html +1 -2
  264. package/docs/modules/assets_SpeedSlow.html +1 -2
  265. package/docs/modules/assets_Walk.html +1 -2
  266. package/docs/modules/components_AutoCoreDevPanel.html +20 -0
  267. package/docs/modules/components_BlocklyEditor.html +1 -5
  268. package/docs/modules/components_CodeEditor.html +1 -3
  269. package/docs/modules/components_FileList.html +1 -3
  270. package/docs/modules/components_FileSelect.html +1 -0
  271. package/docs/modules/components_FitText.html +1 -3
  272. package/docs/modules/components_Indicator.html +1 -0
  273. package/docs/modules/components_IndicatorButton.html +1 -0
  274. package/docs/modules/components_IndicatorRect.html +1 -0
  275. package/docs/modules/components_JogPanel.html +1 -9
  276. package/docs/modules/components_Lamp.html +1 -4
  277. package/docs/modules/components_Osk.html +1 -0
  278. package/docs/modules/components_OskDialog.html +1 -0
  279. package/docs/modules/components_ProgressBarWithValue.html +1 -0
  280. package/docs/modules/components_TextInput.html +1 -2
  281. package/docs/modules/components_ToggleGroup.html +1 -6
  282. package/docs/modules/components_ValueDisplay.html +1 -0
  283. package/docs/modules/components_ValueIndicator.html +1 -4
  284. package/docs/modules/components_ValueInput.html +1 -2
  285. package/docs/modules/core_ActionMode.html +1 -2
  286. package/docs/modules/core_AutoCoreTagContext.html +11 -0
  287. package/docs/modules/core_AutoCoreTagTypes.html +1 -0
  288. package/docs/modules/core_EventEmitterContext.html +53 -0
  289. package/docs/modules/core_IndicatorButtonState.html +1 -2
  290. package/docs/modules/core_IndicatorColor.html +1 -2
  291. package/docs/modules/core_MaskPatterns.html +1 -0
  292. package/docs/modules/core_NumerableTypes.html +1 -0
  293. package/docs/modules/core_PositionContext.html +1 -0
  294. package/docs/modules/core_UniqueId.html +1 -0
  295. package/docs/modules/core_ValueSimulator.html +1 -0
  296. package/docs/modules/core_hoc.html +1 -0
  297. package/docs/modules/hooks.html +1 -0
  298. package/docs/modules/hooks_adsHooks.html +1 -0
  299. package/docs/modules/hooks_commandHooks.html +1 -0
  300. package/docs/modules/hooks_useAutoCoreTag.ts.html +52 -0
  301. package/docs/modules/hooks_useScaledValue.html +1 -0
  302. package/docs/modules/hub.html +1 -0
  303. package/docs/modules/hub_CommandMessage.html +1 -3
  304. package/docs/modules/hub_HubBase.html +1 -0
  305. package/docs/modules/hub_HubSimulate.html +1 -0
  306. package/docs/modules/hub_HubTauri.html +1 -0
  307. package/docs/modules/hub_HubWebSocket.html +1 -2
  308. package/docs/modules.html +23 -0
  309. package/docs/types/components_IndicatorButton.IndicatorButtonOptionsType.html +1 -1
  310. package/docs/types/core_AutoCoreTagTypes.ExtractByTag.html +2 -0
  311. package/docs/types/core_AutoCoreTagTypes.PrimitiveKind.html +1 -0
  312. package/docs/types/core_AutoCoreTagTypes.TagConfig.html +16 -0
  313. package/docs/types/core_AutoCoreTagTypes.TagValueMap.html +1 -0
  314. package/docs/types/core_AutoCoreTagTypes.TagValueOf.html +1 -0
  315. package/docs/types/core_EventEmitterContext.EmitterDispatchFunction.html +3 -0
  316. package/docs/types/core_EventEmitterContext.EmitterSubscribeFunction.html +3 -0
  317. package/docs/types/core_EventEmitterContext.EmitterUnsubscribeFunction.html +3 -0
  318. package/docs/types/core_NumerableTypes.NumerableFormatOptions.html +4 -0
  319. package/docs/types/core_hoc.HocAddSubscriptionProps.html +6 -0
  320. package/docs/variables/components_AutoCoreDevPanel.AutoCoreDevPanel.html +43 -0
  321. package/docs/variables/components_BlocklyEditor.BlocklyEditor.html +13 -0
  322. package/docs/variables/components_BlocklyEditor.StandardToolbox.html +1 -1
  323. package/docs/variables/components_FileList.FileList.html +23 -0
  324. package/docs/variables/components_FileSelect.FileSelect.html +1 -0
  325. package/docs/variables/components_FitText.FitText.html +4 -0
  326. package/docs/variables/components_IndicatorButton.IndicatorButton.html +1 -0
  327. package/docs/variables/components_JogPanel.DefaultLinearJogButtons.html +2 -2
  328. package/docs/variables/components_JogPanel.DefaultRotationJogButtons.html +2 -2
  329. package/docs/variables/components_Osk.Osk.html +1 -0
  330. package/docs/variables/components_ProgressBarWithValue.ProgressBarWithValue.html +1 -0
  331. package/docs/variables/components_ToggleGroup.ToggleGroup.html +1 -0
  332. package/docs/variables/components_ValueInput.ValueInput.html +4 -0
  333. package/docs/variables/core_AutoCoreTagContext.AutoCoreTagContext.html +1 -0
  334. package/docs/variables/core_AutoCoreTagContext.AutoCoreTagProvider.html +7 -0
  335. package/docs/variables/core_EventEmitterContext.EventEmitterContext.html +64 -0
  336. package/docs/variables/core_EventEmitterContext.EventEmitterProvider.html +10 -0
  337. package/docs/variables/core_MaskPatterns.PrimeReactMaskPatterns.html +14 -0
  338. package/docs/variables/core_MaskPatterns.RegExMaskPatterns.html +15 -0
  339. package/docs/variables/core_PositionContext.DimensionsContext.html +6 -0
  340. package/docs/variables/hooks_useScaledValue.kMillimeters2Inches.html +2 -0
  341. package/docs/variables/hooks_useScaledValue.kNewtons2Pounds.html +2 -0
  342. package/package.json +32 -27
  343. package/readme.md +193 -22
  344. package/src/components/AutoCoreDevPanel.tsx +411 -0
  345. package/src/components/CodeEditor.tsx +2 -2
  346. package/src/components/FileList.tsx +2 -2
  347. package/src/components/Indicator.tsx +2 -2
  348. package/src/components/IndicatorButton.tsx +187 -333
  349. package/src/components/IndicatorRect.tsx +2 -2
  350. package/src/components/Lamp.tsx +3 -3
  351. package/src/components/TextInput.tsx +159 -240
  352. package/src/components/ToggleGroup.tsx +3 -3
  353. package/src/components/ValueDisplay.tsx +4 -4
  354. package/src/components/ValueIndicator.tsx +2 -2
  355. package/src/components/ValueInput.tsx +2 -2
  356. package/src/core/AutoCoreTagContext.tsx +698 -0
  357. package/src/core/AutoCoreTagTypes.ts +202 -0
  358. package/src/core/EventEmitterContext.tsx +582 -225
  359. package/src/core/ValueSimulator.ts +2 -2
  360. package/src/hooks/useAutoCoreTag.ts +103 -0
  361. package/src/hub/HubBase.ts +3 -3
  362. package/src/hub/HubSimulate.ts +2 -2
  363. package/src/hub/HubTauri.ts +3 -3
  364. package/src/hub/HubWebSocket.ts +29 -32
  365. package/src/hub/index.ts +2 -2
  366. package/tsconfig.json +43 -28
  367. package/docs/classes/components_BlocklyEditor.BlocklyEditor.html +0 -124
  368. package/docs/classes/components_ValueInput.ValueInput.html +0 -113
  369. package/docs/functions/assets_BlocklyLogo.default.html +0 -1
  370. package/docs/functions/assets_Distance.default.html +0 -1
  371. package/docs/functions/assets_JogLong.default.html +0 -1
  372. package/docs/functions/assets_JogMedium.default.html +0 -1
  373. package/docs/functions/assets_JogShort.default.html +0 -1
  374. package/docs/functions/assets_PythonLogo.default.html +0 -1
  375. package/docs/functions/assets_Rotation3D.default.html +0 -1
  376. package/docs/functions/assets_RotationCcw.default.html +0 -1
  377. package/docs/functions/assets_RotationCcwA.default.html +0 -1
  378. package/docs/functions/assets_RotationCcwB.default.html +0 -1
  379. package/docs/functions/assets_RotationCcwC.default.html +0 -1
  380. package/docs/functions/assets_RotationCw.default.html +0 -1
  381. package/docs/functions/assets_RotationCwA.default.html +0 -1
  382. package/docs/functions/assets_RotationCwB.default.html +0 -1
  383. package/docs/functions/assets_RotationCwC.default.html +0 -1
  384. package/docs/functions/assets_Run.default.html +0 -1
  385. package/docs/functions/assets_Speed.default.html +0 -1
  386. package/docs/functions/assets_SpeedFast.default.html +0 -1
  387. package/docs/functions/assets_SpeedMedium.default.html +0 -1
  388. package/docs/functions/assets_SpeedNone.default.html +0 -1
  389. package/docs/functions/assets_SpeedSlow.default.html +0 -1
  390. package/docs/functions/assets_Walk.default.html +0 -1
  391. package/docs/functions/components_FileList.FileList.html +0 -21
  392. package/docs/functions/components_FitText.FitText.html +0 -8
  393. package/docs/functions/components_ToggleGroup.ToggleGroup.html +0 -5
package/readme.md CHANGED
@@ -15,26 +15,202 @@ PrimeReact to supply almost all but the most obscure controls, and adds a wrappe
15
15
  signals from the backend to the common controls. This allows autocore-react to focus on the additional
16
16
  features needed for machine-control user interfaces, while PrimeReact excels at development of components.
17
17
 
18
- ## Hub
18
+ ## Installation
19
19
 
20
- Whether running in a browser or within a Tauri application, the user interface of a web app needs to
21
- communicate with a backed. The Hub abstracts this by defining a common base class, then automatically
22
- selecting the proper pipeline based upon the environment. If the Tauri environment is detected, HubTauri
23
- is loaded. For a browser instance, a socket.io connection is used. When running in a development environment,
24
- a simulated backend that simply echoes responses is used.
20
+ Install from NPM.
25
21
 
26
- When writing the main application or developing components, you only need to focus on the Hub class. Because the
27
- backend is selected automatically, the web application does not need to be modified for each individual environment.
22
+ ```
23
+ npm install --save @adcops/autocore-react
24
+ ```
28
25
 
26
+ ## Quick Start
29
27
 
30
- ## Installation
28
+ ### 1. Define Your Tags
31
29
 
32
- Install from NPM.
30
+ Create `AutoCoreTags.ts` to define all the tags your application will use:
33
31
 
32
+ ```typescript
33
+ import type { TagConfig } from "@adcops/autocore-react/core/AutoCoreTagTypes";
34
+
35
+ export const acTagSpec = [
36
+ { "tagName": "isControlPowerOk", "domain": "ADS", "symbolName": "GIO.xbControlPowerOk", "valueType": "boolean" },
37
+ { "tagName": "motorSpeed", "domain": "ADS", "symbolName": "MAIN.ctx.motor.fSpeed", "valueType": "number" },
38
+ { "tagName": "isAutoCycleRunning", "domain": "ADS", "symbolName": "MAIN.ctx.gm.bAutoCycleRunning", "valueType": "boolean" },
39
+ { "tagName": "positionScalar", "domain": "MEMORYSTORE", "symbolName": "position_scalar", "valueType": "number", "initialValue": 1.0 }
40
+ ] as const satisfies readonly TagConfig[];
41
+
42
+ export default acTagSpec;
34
43
  ```
35
- npm install --save @adcops/autocore-react
44
+
45
+ ### 2. Create Typed Hooks
46
+
47
+ Create `AutoCore.ts` to generate strongly-typed hooks:
48
+
49
+ ```typescript
50
+ import { acTagSpec } from "./AutoCoreTags";
51
+ import { AutoCoreTagContext } from "@adcops/autocore-react/core/AutoCoreTagContext";
52
+ import { makeAutoCoreTagHooks } from "@adcops/autocore-react/hooks/useAutoCoreTag";
53
+
54
+ export const AutoCoreHooks = makeAutoCoreTagHooks(AutoCoreTagContext, acTagSpec);
55
+ ```
56
+
57
+
58
+ #### Define Scales (Optional)
59
+ For applications that need unit conversion, create `AutoCoreScales.ts` with server-driven scaling:
60
+
61
+
62
+ ```tsx
63
+ import { ScaleConfig } from "@adcops/autocore-react/core/AutoCoreTagTypes";
64
+
65
+ export const acScales = {
66
+ position: {
67
+ name: "position",
68
+ scale: 1.0,
69
+ label: "mm",
70
+ serverTag: { domain: "GNV", symbolName: "position_scalar" }
71
+ },
72
+ load: {
73
+ name: "load",
74
+ scale: 1.0,
75
+ label: "N",
76
+ serverTag: { domain: "GNV", symbolName: "load_scalar" }
77
+ }
78
+ } as const satisfies Record<string, ScaleConfig>;
79
+ ```
80
+
81
+ Note: Server tags now store both scale factor and label as a JSON object: `{ scale: 1.0, label: "mm" }`. Legacy numeric-only values are supported for backward compatibility.
82
+
83
+ Next, reference scales in your tag definitions.
84
+
85
+ ```tsx
86
+ // In AutoCoreTags.ts - add scale property to numeric tags
87
+ { "tagName": "pressPosition", "domain": "ADS", "symbolName": "MAIN.ctx.gm.fPressPosition", "valueType": "number", "scale": "position" },
88
+ { "tagName": "pressLoad", "domain": "ADS", "symbolName": "MAIN.ctx.gm.fPressLoad", "valueType": "number", "scale": "load" }
89
+ ```
90
+
91
+ ### 3. Wrap Your App
92
+
93
+ Update your `App.tsx` to provide the contexts:
94
+
95
+ ```typescript
96
+ import React from 'react';
97
+ import { PrimeReactProvider } from 'primereact/api';
98
+ import { EventEmitterProvider } from "@adcops/autocore-react/core/EventEmitterContext";
99
+ import { AutoCoreTagProvider } from "@adcops/autocore-react/core/AutoCoreTagContext";
100
+ import { acTagSpec } from "./AutoCoreTags";
101
+ import { acScales } from "./AutoCoreScales";
102
+
103
+ function App() {
104
+ return (
105
+ <EventEmitterProvider>
106
+ <PrimeReactProvider>
107
+ <AutoCoreTagProvider tags={acTagSpec} scales={acScales} eagerRead>
108
+ <div className="app-wrapper">
109
+ <main className="main-wrapper">
110
+ <YourMainContent />
111
+ </main>
112
+ </div>
113
+ </AutoCoreTagProvider>
114
+ </PrimeReactProvider>
115
+ </EventEmitterProvider>
116
+ );
117
+ }
118
+
119
+ export default App;
36
120
  ```
37
121
 
122
+ ### 4. Use Tags in Components
123
+
124
+ Import your typed hooks and use them in any component:
125
+
126
+ ```typescript
127
+ import React from 'react';
128
+ import { Button } from 'primereact/button';
129
+ import { AutoCoreHooks } from './AutoCore';
130
+
131
+ export const ControlPanel: React.FC = () => {
132
+ // Single tag access
133
+ const { value: powerOk, write: setPowerOk } = AutoCoreHooks.useAutoCoreTag("isControlPowerOk");
134
+ const { value: motorSpeed, write: setMotorSpeed } = AutoCoreHooks.useAutoCoreTag("motorSpeed");
135
+
136
+ // Multiple tag access
137
+ const { values } = AutoCoreHooks.useAutoCoreTags(["isControlPowerOk", "isAutoCycleRunning"]);
138
+
139
+ // Computed state
140
+ const { selected: canStart } = AutoCoreHooks.useAutoCoreSelect(v =>
141
+ !!v["isControlPowerOk"] && !v["isAutoCycleRunning"]
142
+ );
143
+
144
+ return (
145
+ <div>
146
+ <div>Power OK: {powerOk ? "Yes" : "No"}</div>
147
+ <div>Motor Speed: {motorSpeed} RPM</div>
148
+
149
+ <Button
150
+ label="Start Motor"
151
+ disabled={!canStart}
152
+ onClick={() => setMotorSpeed(1000)}
153
+ />
154
+
155
+ <Button
156
+ label="Emergency Stop"
157
+ severity="danger"
158
+ onClick={() => setPowerOk(false)}
159
+ />
160
+ </div>
161
+ );
162
+ };
163
+ ```
164
+
165
+ ### 5. Development Panel (Optional)
166
+
167
+ Add a debugging panel for development:
168
+
169
+ ```typescript
170
+ import { AutoCoreDevPanel } from "@adcops/autocore-react/components/AutoCoreDevPanel";
171
+ import { acTagSpec } from "./AutoCoreTags";
172
+
173
+ // In your App component:
174
+ {process.env.NODE_ENV === 'development' && (
175
+ <AutoCoreDevPanel
176
+ tags={acTagSpec}
177
+ className="fixed bottom-4 right-4 bg-white shadow-lg"
178
+ />
179
+ )}
180
+ ```
181
+
182
+ ## AutoCoreTagContext Features
183
+
184
+ - **Strongly-typed**: Full TypeScript support with IntelliSense for tag names and value types
185
+ - **Global state**: Share tag values across your entire application
186
+ - **Real-time updates**: Automatic subscription to server data changes
187
+ - **No optimistic updates**: UI always reflects true server state
188
+ - **Error handling**: Proper async/await patterns with error feedback
189
+ - **Development tools**: Built-in debugging panel for testing
190
+
191
+ ## Architecture
192
+
193
+ ### Hub (Internal)
194
+
195
+ The Hub is an internal abstraction that handles communication with the backend. It automatically
196
+ selects the proper pipeline based on the environment: HubTauri for Tauri applications, socket.io
197
+ for browser instances, and a simulated backend for development environments.
198
+
199
+ **Important**: Applications should not interact with the Hub directly. Instead, use the higher-level
200
+ abstractions described below.
201
+
202
+ ### EventEmitterContext
203
+
204
+ The EventEmitterContext provides a global event system for component communication and backend
205
+ interaction through `invoke()`, `subscribe()`, and `dispatch()` methods. This is automatically
206
+ available when you wrap your app with `<EventEmitterProvider>`.
207
+
208
+ ### AutoCoreTagContext (Recommended)
209
+
210
+ For most backend data interactions, use the AutoCoreTagContext system with strongly-typed hooks.
211
+ This provides the cleanest, most maintainable approach for managing server state in your components.
212
+ See the Quick Start section above for setup and usage.
213
+
38
214
  ## Development
39
215
 
40
216
  We typically have an external Tauri project designed to import and test the autocore-react library. We find that
@@ -56,14 +232,12 @@ npm publish --tag staging --access=public
56
232
 
57
233
  Note that we have to specify that the access is public because the tag makes this "scoped," which are private by default.
58
234
 
59
-
60
235
  In the test project, simply install the 'staging' tag version.
61
236
 
62
237
  ```
63
238
  npm install @adcops/autocore-react@staging
64
239
  ```
65
240
 
66
-
67
241
  ### npm link
68
242
 
69
243
  In the root of the autocore-react project, initiate npm link:
@@ -131,10 +305,6 @@ overwrite existing .tsx files. If you need to update a pre-existing .tsx file, d
131
305
  Possible options for SVGR:
132
306
  https://react-svgr.com/docs/options/
133
307
 
134
-
135
-
136
-
137
-
138
308
  ## Documentation
139
309
 
140
310
  To generate documentation:
@@ -144,29 +314,30 @@ npm run generate-docs
144
314
 
145
315
  Publishing the package will also regenerate the documentation.
146
316
 
147
-
148
-
149
317
  ## Additional Documentation
150
318
 
151
319
  Beyond doc-comments in the code, we provide additional documentation in the additional-docs folder.
152
320
 
321
+ - AutoCoreTagContext Manual: [AutoCoreTagContext Manual](../additional-docs/AutoCoreTagContext.md).
153
322
  - Button API Specs: [Button API Specs](../additional-docs/ButtonApiSpecs.md).
154
323
  - Global Event Emitter: [Global Event Emitter](../additional-docs/GlobalEventEmitter.md).
155
324
 
156
-
157
325
  ## Acknowledgements
158
326
 
159
- Beyond the obvious, inherent React libraries, autocore-react greatly appreciates the works of
327
+ Beyond the obvious, inherent React and TypeScript libraries, autocore-react greatly appreciates the works of
160
328
  these additional libraries.
161
329
 
162
330
  - PrimeReact and PrimeIcons
163
331
  - numerable
164
332
  - Simple Keyboard (https://github.com/hodgef/simple-keyboard)
165
333
  - - We customize Simple Keyboard for cleaner physical keyboard integration.
334
+ - Monaco editor
335
+ - socket-io
336
+ - Tauri
166
337
 
167
338
  ## Copyright
168
339
 
169
- (C) Copyright 2021-2024 Automated Design Corp. All Rights Reserved.
340
+ (C) Copyright 2021-2025 Automated Design Corp. All Rights Reserved.
170
341
 
171
342
  ## License
172
343
 
@@ -0,0 +1,411 @@
1
+ /*
2
+ * Copyright (C) 2025 Automated Design Corp.. All Rights Reserved.
3
+ * Created Date: 2025-09-05 08:06:09
4
+ * -----
5
+ * Last Modified: 2025-09-10 11:15:10
6
+ * -----
7
+ *
8
+ */
9
+
10
+ /**
11
+ * @module components/AutoCoreDevPanel
12
+ *
13
+ * @summary
14
+ *
15
+ * A development and debugging panel for monitoring and manually interacting with AutoCore tags.
16
+ * This component provides real-time visibility into tag values and allows direct manipulation
17
+ * for testing and debugging purposes.
18
+ *
19
+ * @remarks
20
+ *
21
+ * The AutoCoreDevPanel is designed to be used during development to:
22
+ * - Monitor live tag values in real-time
23
+ * - Test write operations manually
24
+ * - Debug tag behavior and connectivity
25
+ * - Perform tap operations on boolean tags
26
+ * - Validate tag configurations
27
+ *
28
+ * The panel automatically connects to the global AutoCoreTagContext and displays all
29
+ * tags passed to it. No additional setup or factory functions are required.
30
+ *
31
+ * @example Basic Usage
32
+ * ```tsx
33
+ * import React from 'react';
34
+ * import { AutoCoreDevPanel } from "@adcops/autocore-react/components/AutoCoreDevPanel";
35
+ * import { acTagSpec } from "./AutoCoreTags";
36
+ *
37
+ * function App() {
38
+ * return (
39
+ * <div>
40
+ * <main>
41
+ * <YourMainContent />
42
+ * </main>
43
+ *
44
+ * {process.env.NODE_ENV === 'development' && (
45
+ * <AutoCoreDevPanel
46
+ * tags={acTagSpec}
47
+ * className="fixed bottom-4 right-4 bg-white shadow-lg"
48
+ * />
49
+ * )}
50
+ * </div>
51
+ * );
52
+ * }
53
+ * ```
54
+ *
55
+ * @example Styled Panel
56
+ * ```tsx
57
+ * import { AutoCoreDevPanel } from "@adcops/autocore-react/components/AutoCoreDevPanel";
58
+ * import { acTagSpec } from "./AutoCoreTags";
59
+ *
60
+ * // Custom styled panel
61
+ * <AutoCoreDevPanel
62
+ * tags={acTagSpec}
63
+ * title="Machine Status Monitor"
64
+ * className="
65
+ * fixed top-4 left-4
66
+ * bg-gray-900 text-white
67
+ * border border-gray-700
68
+ * shadow-2xl rounded-lg
69
+ * max-w-md
70
+ * "
71
+ * />
72
+ * ```
73
+ *
74
+ * @example Filtered Tags
75
+ * ```tsx
76
+ * import { AutoCoreDevPanel } from "@adcops/autocore-react/components/AutoCoreDevPanel";
77
+ * import { acTagSpec } from "./AutoCoreTags";
78
+ *
79
+ * // Show only specific tags for focused debugging
80
+ * const motorTags = acTagSpec.filter(tag =>
81
+ * tag.tagName.includes('motor') || tag.tagName.includes('axis')
82
+ * );
83
+ *
84
+ * <AutoCoreDevPanel
85
+ * tags={motorTags}
86
+ * title="Motor Control Debug"
87
+ * className="debug-panel"
88
+ * />
89
+ * ```
90
+ */
91
+
92
+ import React, { useContext, useMemo, useState, useCallback } from "react";
93
+ import type { TagConfig } from "../core/AutoCoreTagTypes";
94
+ import { AutoCoreTagContext } from "../core/AutoCoreTagContext";
95
+
96
+ /**
97
+ * Props for the AutoCoreDevPanel component.
98
+ */
99
+ interface AutoCoreDevPanelProps {
100
+ /**
101
+ * Array of tag configurations to display in the panel.
102
+ * Each tag will show its current value and provide controls for writing new values.
103
+ */
104
+ tags: readonly TagConfig[];
105
+
106
+ /**
107
+ * Optional title for the panel header.
108
+ * @defaultValue "AutoCore Dev Panel"
109
+ */
110
+ title?: string;
111
+
112
+ /**
113
+ * Optional CSS class names for custom styling.
114
+ * The panel has default styling but can be customized with Tailwind or custom CSS.
115
+ */
116
+ className?: string;
117
+ }
118
+
119
+ /**
120
+ * AutoCoreDevPanel - Development and debugging panel for AutoCore tags.
121
+ *
122
+ * This component provides a real-time debugging interface for monitoring and manipulating
123
+ * AutoCore tags during development. It displays current tag values, provides input controls
124
+ * for writing new values, and includes tap functionality for boolean tags.
125
+ *
126
+ * ## Features
127
+ *
128
+ * - **Real-time monitoring**: Shows live tag values as they update from the server
129
+ * - **Direct writes**: Input controls to write new values directly to tags
130
+ * - **Type-aware inputs**: Automatically provides appropriate input types (checkbox for boolean, number input for numeric, etc.)
131
+ * - **Tap functionality**: Special "TAP" buttons for boolean tags that send momentary true→false signals
132
+ * - **Error handling**: Visual feedback for write failures and validation errors
133
+ * - **Live status**: Indicator showing whether the system is loading or live
134
+ * - **JSON support**: Proper formatting and editing for JSON-type tags
135
+ *
136
+ * ## Input Types
137
+ *
138
+ * - **Boolean tags**: Checkbox for direct true/false setting + TAP button for momentary signals
139
+ * - **Number tags**: Number input with validation
140
+ * - **String tags**: Text input
141
+ * - **JSON tags**: Text input with JSON validation and pretty-printing
142
+ *
143
+ * ## Keyboard Shortcuts
144
+ *
145
+ * - **Enter key**: In text/number inputs, immediately sends the value to the server
146
+ * - **Tab navigation**: Navigate between inputs using standard keyboard navigation
147
+ *
148
+ * ## Error Handling
149
+ *
150
+ * Write operations that fail will show error messages below the input field.
151
+ * Common errors include:
152
+ * - Invalid number formats
153
+ * - Malformed JSON
154
+ * - Network/server errors
155
+ * - Tag not found errors
156
+ */
157
+ export const AutoCoreDevPanel: React.FC<AutoCoreDevPanelProps> = ({
158
+ tags,
159
+ title = "AutoCore Dev Panel",
160
+ className = "",
161
+ }) => {
162
+ const { values, rawValues, isLoading, write, tap, scales } = useContext(AutoCoreTagContext);
163
+
164
+ /** Local editable buffers & errors keyed by tagName */
165
+ const [editBuf, setEditBuf] = useState<Record<string, string>>({});
166
+ const [errors, setErrors] = useState<Record<string, string>>({});
167
+
168
+ const rows = useMemo(() => {
169
+ return tags.map((tag) => {
170
+ const display = values[tag.tagName];
171
+ const raw = rawValues[tag.tagName];
172
+ const scaleName = tag.scale ?? "";
173
+ const s = scaleName ? scales[scaleName] : undefined;
174
+ return {
175
+ tag,
176
+ display,
177
+ raw,
178
+ scaleName,
179
+ factor: s?.scale,
180
+ label: s?.label,
181
+ };
182
+ });
183
+ }, [tags, values, rawValues, scales]);
184
+
185
+ const setBuf = useCallback((tagName: string, v: string) => {
186
+ setEditBuf((prev) => ({ ...prev, [tagName]: v }));
187
+ setErrors((prev) => ({ ...prev, [tagName]: "" }));
188
+ }, []);
189
+
190
+ const setErr = useCallback((tagName: string, msg: string) => {
191
+ setErrors((prev) => ({ ...prev, [tagName]: msg }));
192
+ }, []);
193
+
194
+ const commit = useCallback(async (tag: TagConfig) => {
195
+ const tagName = tag.tagName;
196
+ const buf = editBuf[tagName];
197
+
198
+ try {
199
+ if (tag.valueType === "boolean") {
200
+ // Toggle to the buffer value if explicitly provided, else flip current
201
+ const desired =
202
+ buf === "true" ? true :
203
+ buf === "false" ? false :
204
+ !(values[tagName] as boolean);
205
+ await write(tagName as any, desired as any);
206
+ setBuf(tagName, "");
207
+ return;
208
+ }
209
+
210
+ if (tag.valueType === "number") {
211
+ if (buf == null || buf.trim() === "") {
212
+ setErr(tagName, "Enter a number.");
213
+ return;
214
+ }
215
+ const n = Number(buf);
216
+ if (Number.isNaN(n)) {
217
+ setErr(tagName, "Invalid number.");
218
+ return;
219
+ }
220
+ await write(tagName as any, n as any);
221
+ setBuf(tagName, "");
222
+ return;
223
+ }
224
+
225
+ if (tag.valueType === "string") {
226
+ await write(tagName as any, (buf ?? "") as any);
227
+ setBuf(tagName, "");
228
+ return;
229
+ }
230
+
231
+ // json
232
+ try {
233
+ const parsed = buf?.trim() ? JSON.parse(buf) : null;
234
+ await write(tagName as any, parsed as any);
235
+ setBuf(tagName, "");
236
+ } catch (e: any) {
237
+ setErr(tagName, "Invalid JSON.");
238
+ }
239
+ } catch (e: any) {
240
+ setErr(tagName, e?.message ?? String(e));
241
+ }
242
+ }, [editBuf, setBuf, setErr, write, values]);
243
+
244
+ const onKeyDownCommit = (ev: React.KeyboardEvent, tag: TagConfig) => {
245
+ if (ev.key === "Enter" && !ev.shiftKey) {
246
+ ev.preventDefault();
247
+ void commit(tag);
248
+ }
249
+ };
250
+
251
+ return (
252
+ <div className={`rounded-md border border-gray-200 bg-white text-sm ${className}`} style={{ minWidth: 680 }}>
253
+ <div className="flex items-center justify-between px-3 py-2" style={{ borderBottom: "1px solid #eee" }}>
254
+ <div className="flex items-center gap-2">
255
+ <strong>{title}</strong>
256
+ <span
257
+ title={isLoading ? "Loading" : "Live"}
258
+ style={{
259
+ width: 8, height: 8, borderRadius: 999,
260
+ background: isLoading ? "#aaa" : "#22c55e",
261
+ display: "inline-block"
262
+ }}
263
+ />
264
+ </div>
265
+ </div>
266
+
267
+ <div style={{ overflowX: "auto" }}>
268
+ <table style={{ borderCollapse: "collapse", width: "100%" }}>
269
+ <thead>
270
+ <tr>
271
+ <Th>Tag</Th>
272
+ <Th>Kind</Th>
273
+ <Th>Domain</Th>
274
+ <Th>Symbol</Th>
275
+ <Th>Display</Th>
276
+ <Th>Raw</Th>
277
+ <Th>Scale</Th>
278
+ <Th>Units</Th>
279
+ <Th>Input</Th>
280
+ <Th>Actions</Th>
281
+ </tr>
282
+ </thead>
283
+ <tbody>
284
+ {rows.map(({ tag, display, raw, scaleName, factor, label }) => {
285
+ const buf = editBuf[tag.tagName] ?? "";
286
+ const err = errors[tag.tagName];
287
+
288
+ return (
289
+ <tr key={tag.tagName}>
290
+ <Td mono>{tag.tagName}</Td>
291
+ <Td mono>{tag.valueType}</Td>
292
+ <Td mono>{tag.domain}</Td>
293
+ <Td mono>{tag.symbolName}</Td>
294
+ <Td mono>{fmt(display)}</Td>
295
+ <Td mono>{fmt(raw)}</Td>
296
+ <Td mono>{scaleName ? `${scaleName} ×${factor ?? 1}` : "—"}</Td>
297
+ <Td mono>{scaleName ? (label ?? "") : "—"}</Td>
298
+ <Td>
299
+ <InputForTag
300
+ tag={tag}
301
+ buf={buf}
302
+ setBuf={(v) => setBuf(tag.tagName, v)}
303
+ onKeyDown={(e) => onKeyDownCommit(e, tag)}
304
+ />
305
+ {err && <div style={{ color: "#dc2626", marginTop: 4 }}>{err}</div>}
306
+ </Td>
307
+ <Td>
308
+ <div style={{ display: "flex", gap: 6 }}>
309
+ <button onClick={() => commit(tag)}>Write</button>
310
+ {tag.valueType === "boolean" && (
311
+ <button onClick={() => tap(tag.tagName as any)}>TAP</button>
312
+ )}
313
+ </div>
314
+ </Td>
315
+ </tr>
316
+ );
317
+ })}
318
+ </tbody>
319
+ </table>
320
+ </div>
321
+ </div>
322
+ );
323
+ };
324
+
325
+ /** ---------- helpers ---------- */
326
+
327
+ const Th: React.FC<React.PropsWithChildren<{}>> = ({ children }) => (
328
+ <th style={{
329
+ textAlign: "left",
330
+ borderBottom: "1px solid #ddd",
331
+ padding: "6px 8px",
332
+ fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace"
333
+ }}>{children}</th>
334
+ );
335
+
336
+ const Td: React.FC<React.PropsWithChildren<{ mono?: boolean }>> = ({ children, mono }) => (
337
+ <td style={{
338
+ borderBottom: "1px solid #eee",
339
+ padding: "6px 8px",
340
+ whiteSpace: "nowrap",
341
+ fontFamily: mono ? "ui-monospace, SFMono-Regular, Menlo, monospace" : "inherit"
342
+ }}>{children}</td>
343
+ );
344
+
345
+ const InputForTag: React.FC<{
346
+ tag: TagConfig;
347
+ buf: string;
348
+ setBuf: (v: string) => void;
349
+ onKeyDown: (e: React.KeyboardEvent) => void;
350
+ }> = ({ tag, buf, setBuf, onKeyDown }) => {
351
+ if (tag.valueType === "boolean") {
352
+ // Boolean: checkbox controls direct true/false (buffer mirrors state as string)
353
+ return (
354
+ <label style={{ display: "inline-flex", alignItems: "center", gap: 6 }}>
355
+ <input
356
+ type="checkbox"
357
+ checked={buf ? buf === "true" : (Boolean as any)}
358
+ onChange={(e) => setBuf(e.target.checked ? "true" : "false")}
359
+ onKeyDown={onKeyDown}
360
+ />
361
+ <span>set</span>
362
+ </label>
363
+ );
364
+ }
365
+
366
+ if (tag.valueType === "number") {
367
+ return (
368
+ <input
369
+ type="number"
370
+ step="any"
371
+ value={buf}
372
+ onChange={(e) => setBuf(e.target.value)}
373
+ onKeyDown={onKeyDown}
374
+ style={{ width: 140 }}
375
+ placeholder="number…"
376
+ />
377
+ );
378
+ }
379
+
380
+ if (tag.valueType === "string") {
381
+ return (
382
+ <input
383
+ type="text"
384
+ value={buf}
385
+ onChange={(e) => setBuf(e.target.value)}
386
+ onKeyDown={onKeyDown}
387
+ style={{ width: 180 }}
388
+ placeholder="text…"
389
+ />
390
+ );
391
+ }
392
+
393
+ // json
394
+ return (
395
+ <textarea
396
+ value={buf}
397
+ onChange={(e) => setBuf(e.target.value)}
398
+ onKeyDown={onKeyDown}
399
+ rows={2}
400
+ style={{ width: 260, fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace" }}
401
+ placeholder='{"foo": 42}'
402
+ />
403
+ );
404
+ };
405
+
406
+ function fmt(v: unknown) {
407
+ if (v === null || v === undefined) return "—";
408
+ if (typeof v === "number") return Number.isFinite(v) ? v.toString() : String(v);
409
+ if (typeof v === "string") return v;
410
+ try { return JSON.stringify(v); } catch { return String(v); }
411
+ }
@@ -2,7 +2,7 @@
2
2
  * Copyright (C) 2024 Automated Design Corp.. All Rights Reserved.
3
3
  * Created Date: 2024-03-17 08:43:02
4
4
  * -----
5
- * Last Modified: 2024-03-18 11:29:08
5
+ * Last Modified: 2025-09-05 14:52:18
6
6
  * -----
7
7
  *
8
8
  */
@@ -12,7 +12,7 @@
12
12
  import * as React from 'react';
13
13
  import { editor } from 'monaco-editor';
14
14
  //import * as monaco from 'monaco-editor/esm/vs/editor/editor.api';
15
- import Editor, { Monaco } from '@monaco-editor/react';
15
+ import Editor, { type Monaco } from '@monaco-editor/react';
16
16
 
17
17
 
18
18
  interface CodeEditorProps {