@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
@@ -0,0 +1,224 @@
1
+ /**
2
+ * @module core/AutoCoreTagContext
3
+ *
4
+ * @document ../../additional-docs/AutCoreTagContext.md
5
+ *
6
+ * @summary
7
+ * A React Context + Provider that:
8
+ * - Buffers **raw** controller values for every tag (exactly as received)
9
+ * - Derives **display** values from raw using current `scales` and optional tag `codec`
10
+ * - Recomputes display values **from raw** whenever a scale changes (no lossy re-scaling)
11
+ * - Inverse-scales on `write()` so the server always receives controller units
12
+ * - Supports ADS one-shot refresh, GNV-style scale objects, and resilient eager reads
13
+ *
14
+ * @remarks
15
+ * ❖ **Two representations per tag**
16
+ * - `rawValues[tagName]`: last controller value as-is (pre-scale, pre-codec)
17
+ * - `values[tagName]`: app-visible value derived from raw (scales/codec applied)
18
+ *
19
+ * ❖ **Scaling**
20
+ * - Provide `scales` keyed by scale group (e.g., `"position"`, `"load"`).
21
+ * - Each scale may point at a server tag (`serverTag`) that publishes an object
22
+ * `{ name, scale, label }` (GNV-style). When received, the Provider recomputes
23
+ * *only* affected display values **from raw**.
24
+ * - Manual `updateScale(name, scale, label)` writes the object back to the server
25
+ * (if `serverTag` is configured) and recomputes from raw locally.
26
+ *
27
+ * ❖ **Lifecycle order (eagerRead = true)**
28
+ * 1. Pull server scales first (so first ADS burst displays in correct units)
29
+ * 2. Register ADS symbols and subscribe all domains
30
+ * 3. Eager-pull non-ADS (refresh if available, else read_value)
31
+ * 4. ADS `refresh` one-shot publish
32
+ *
33
+ * ❖ **Writes**
34
+ * - `write(tagName, displayValue)` → (codec?) → inverse-scale → `write_value`
35
+ * - `tap(tagName)` pulses booleans `true → (300ms) → false` with proper domain envelopes
36
+ *
37
+ * ❖ **Resilience**
38
+ * - Eager reads tolerate “missing key” errors on fresh systems and keep going
39
+ * - All re-scaling recomputes from **raw** to avoid cumulative precision/race issues
40
+ *
41
+ * @example Minimal wiring
42
+ * ```tsx
43
+ * import { AutoCoreTagProvider } from "@adcops/autocore-react/core/AutoCoreTagContext";
44
+ * import type { TagConfig, ScaleConfig } from "@adcops/autocore-react/core/AutoCoreTagTypes";
45
+ *
46
+ * const acTagSpec = [
47
+ * { tagName: "pressPosition", domain: "ADS", valueType: "number", symbolName: "AX.Press.Position", scale: "position" },
48
+ * { tagName: "pressLoad", domain: "ADS", valueType: "number", symbolName: "AX.Press.Load", scale: "load" },
49
+ * { tagName: "isMotorsOn", domain: "ADS", valueType: "boolean", symbolName: "GIO.isMotorsOn" },
50
+ * ] as const satisfies readonly TagConfig[];
51
+ *
52
+ * const scales: Record<string, ScaleConfig> = {
53
+ * position: {
54
+ * name: "position",
55
+ * scale: 1.0,
56
+ * label: "mm",
57
+ * serverTag: { domain: "GNV", symbolName: "position_units" }, // expects {name, scale, label}
58
+ * },
59
+ * load: {
60
+ * name: "load",
61
+ * scale: 1.0,
62
+ * label: "N",
63
+ * serverTag: { domain: "GNV", symbolName: "load_units" }, // expects {name, scale, label}
64
+ * },
65
+ * };
66
+ *
67
+ * export function AppRoot() {
68
+ * return (
69
+ * <AutoCoreTagProvider tags={acTagSpec} scales={scales} eagerRead>
70
+ * <App />
71
+ * </AutoCoreTagProvider>
72
+ * );
73
+ * }
74
+ * ```
75
+ *
76
+ * @example Consuming values with hooks
77
+ * ```tsx
78
+ * import { makeAutoCoreTagHooks } from "@adcops/autocore-react/hooks/useAutoCoreTag";
79
+ * import { AutoCoreTagContext } from "@adcops/autocore-react/core/AutoCoreTagContext";
80
+ *
81
+ * export const AutoCoreHooks = makeAutoCoreTagHooks(AutoCoreTagContext, acTagSpec);
82
+ *
83
+ * function Dashboard() {
84
+ * const { value: pos } = AutoCoreHooks.useAutoCoreTag("pressPosition"); // display units
85
+ * const { value: load } = AutoCoreHooks.useAutoCoreTag("pressLoad");
86
+ * const { scales, updateScale } = AutoCoreHooks.useScales();
87
+ *
88
+ * return (
89
+ * <>
90
+ * <div>Position: {pos} {scales.position.label}</div>
91
+ * <div>Load: {load} {scales.load.label}</div>
92
+ * <button onClick={() => updateScale("position", 1/25.4, "in")}>inches</button>
93
+ * </>
94
+ * );
95
+ * }
96
+ * ```
97
+ */
98
+ import React, { type ReactNode } from "react";
99
+ import type { BaseContextValue, TagConfig, ScaleConfig } from "./AutoCoreTagTypes";
100
+ type VMapRuntime = Record<string, unknown>;
101
+ export declare const AutoCoreTagContext: React.Context<BaseContextValue<VMapRuntime>>;
102
+ /**
103
+ * AutoCoreTagProvider
104
+ *
105
+ * @description
106
+ * React Provider that wires up AutoCore tags to live server updates, buffers **raw**
107
+ * controller values, exposes **display** values (scales/codec applied), and handles
108
+ * writes/taps with proper domain envelopes. Scaling is **always** applied to display
109
+ * values only; raw values remain untouched and are the single source of truth.
110
+ *
111
+ * @props
112
+ * - `tags: readonly TagConfig[]`
113
+ * The full tag spec. Each tag declares `tagName`, `domain`, `symbolName`,
114
+ * `valueType` ("boolean"|"number"|"string"|"json"), optional `scale` name, and
115
+ * optional `codec` for JSON.
116
+ *
117
+ * - `scales?: Record<string, ScaleConfig>`
118
+ * Map of scale groups (`position`, `load`, …). Each scale may include an optional
119
+ * `serverTag` `{ domain, symbolName }`. When present, the provider reads that key
120
+ * first and subscribes to updates. The server must publish a GNV-style object
121
+ * `{ name, scale, label }` (stringified or object). When a new scale arrives,
122
+ * the provider recomputes affected display values **from raw**.
123
+ *
124
+ * - `eagerRead?: boolean = true`
125
+ * If true, the provider performs a non-ADS eager fetch pass (refresh if available,
126
+ * otherwise read_value with backoff) and then performs a single ADS `refresh`.
127
+ * Missing keys are common on clean systems—these are logged and skipped.
128
+ *
129
+ * - `children: ReactNode`
130
+ * Your app subtree that consumes `AutoCoreTagContext`.
131
+ *
132
+ * @context value
133
+ * - `values`: Partial<Record<tagName, unknown>> — app-visible (scaled/decoded)
134
+ * - `rawValues`: Record<tagName, unknown> — last controller values as received
135
+ * - `isLoading`: boolean — true until initial wiring completes
136
+ * - `write(tagName, displayValue)`: Promise<void>
137
+ * Serializes/encodes JSON if needed and inverse-scales numbers back to raw units.
138
+ * Dispatches `write_value` with appropriate domain envelope:
139
+ * - ADS: `{ symbol_name, value }`
140
+ * - GNV: `{ group:"ux", key, value }`
141
+ * - Other: `{ key, value }`
142
+ * - `tap(tagName)`: Promise<void>
143
+ * For boolean tags only. Pulses true → 300ms → false with the proper envelope.
144
+ * - `scales`: Record<string, ScaleConfig> — current factors/labels
145
+ * - `updateScale(name, scale, label)`: Promise<void>
146
+ * Writes `{ name, scale, label }` to the configured `serverTag` (if present) and
147
+ * recomputes display values **from raw** locally.
148
+ *
149
+ * @example With server-driven scales (GNV) and ADS data
150
+ * ```tsx
151
+ * const tags: readonly TagConfig[] = [
152
+ * { tagName: "pressPosition", domain: "ADS", valueType: "number", symbolName: "AX.Press.Pos", scale: "position" },
153
+ * { tagName: "pressLoad", domain: "ADS", valueType: "number", symbolName: "AX.Press.Load", scale: "load" },
154
+ * { tagName: "isMotorsOn", domain: "ADS", valueType: "boolean", symbolName: "GIO.isMotorsOn" },
155
+ * // JSON with codec example
156
+ * { tagName: "jobMeta", domain: "GNV", valueType: "json", symbolName: "job_meta",
157
+ * codec: {
158
+ * fromServer: (raw) => (typeof raw === "string" ? JSON.parse(raw) : raw),
159
+ * toServer: (val) => JSON.stringify(val),
160
+ * }
161
+ * },
162
+ * ] as const;
163
+ *
164
+ * const scales: Record<string, ScaleConfig> = {
165
+ * position: {
166
+ * name: "position",
167
+ * scale: 1, label: "mm",
168
+ * serverTag: { domain: "GNV", symbolName: "position_units" } // expects {name, scale, label}
169
+ * },
170
+ * load: {
171
+ * name: "load",
172
+ * scale: 1, label: "N",
173
+ * serverTag: { domain: "GNV", symbolName: "load_units" } // expects {name, scale, label}
174
+ * }
175
+ * };
176
+ *
177
+ * <AutoCoreTagProvider tags={tags} scales={scales} eagerRead>
178
+ * <YourApp/>
179
+ * </AutoCoreTagProvider>
180
+ * ```
181
+ *
182
+ * @example Reading values, raw vs display, and writing
183
+ * ```tsx
184
+ * import { makeAutoCoreTagHooks } from "../hooks/useAutoCoreTag";
185
+ * import { AutoCoreTagContext } from "../core/AutoCoreTagContext";
186
+ *
187
+ * const Hooks = makeAutoCoreTagHooks(AutoCoreTagContext, tags);
188
+ *
189
+ * function Status() {
190
+ * const { value: pos, isLoading } = Hooks.useAutoCoreTag("pressPosition"); // scaled
191
+ * const { value: rawPos } = (() => {
192
+ * // access raw via context when needed for debugging
193
+ * const ctx = React.useContext(AutoCoreTagContext);
194
+ * return { value: ctx.rawValues["pressPosition"] };
195
+ * })();
196
+ *
197
+ * const { scales, updateScale } = Hooks.useScales();
198
+ *
199
+ * return (
200
+ * <>
201
+ * <div>Pos: {pos} {scales.position.label} (raw: {String(rawPos)})</div>
202
+ * <button onClick={() => updateScale("position", 1/25.4, "in")}>inches</button>
203
+ * </>
204
+ * );
205
+ * }
206
+ * ```
207
+ *
208
+ * @example Tapping booleans and writing numbers in display units
209
+ * ```tsx
210
+ * const { tap } = Hooks.useAutoCoreTag("isMotorsOn");
211
+ * const { write } = Hooks.useAutoCoreTag("pressPosition");
212
+ *
213
+ * <button onClick={() => tap()}>Motors TAP</button>
214
+ * <button onClick={() => write(10.0)}>Jog to 10 (display units)</button>
215
+ * ```
216
+ */
217
+ export declare const AutoCoreTagProvider: React.FC<{
218
+ children: ReactNode;
219
+ tags: readonly TagConfig[];
220
+ scales?: Record<string, ScaleConfig>;
221
+ eagerRead?: boolean;
222
+ }>;
223
+ export {};
224
+ //# sourceMappingURL=AutoCoreTagContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoCoreTagContext.d.ts","sourceRoot":"","sources":["../../src/core/AutoCoreTagContext.tsx"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgGG;AAGH,OAAO,KAAK,EAAE,EAQV,KAAK,SAAS,EACjB,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EACR,gBAAgB,EAChB,SAAS,EACT,WAAW,EACd,MAAM,oBAAoB,CAAC;AAE5B,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE3C,eAAO,MAAM,kBAAkB,8CAQ7B,CAAC;AAQH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkHG;AACH,eAAO,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC;IACvC,QAAQ,EAAE,SAAS,CAAC;IACpB,IAAI,EAAE,SAAS,SAAS,EAAE,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB,CAkbA,CAAC"}
@@ -0,0 +1 @@
1
+ import{jsx as _jsx}from"react/jsx-runtime";import React,{useRef,createContext,useCallback,useContext,useEffect,useMemo,useState}from"react";import{EventEmitterContext}from"./EventEmitterContext";export const AutoCoreTagContext=createContext({values:{},rawValues:{},isLoading:!0,write:async()=>{},tap:async()=>{},scales:{},updateScale:async()=>{}});const sleep=e=>new Promise(t=>setTimeout(t,e));export const AutoCoreTagProvider=({children:e,tags:t,scales:a={},eagerRead:s=!0})=>{const o=useRef(!1),{invoke:n,isConnected:r,subscribe:c,unsubscribe:l}=useContext(EventEmitterContext),[u,i]=useState(()=>{const e={};for(const a of t)void 0!==a.initialValue&&(e[a.tagName]=a.initialValue);return e}),[m,f]=useState({}),[y,b]=useState(a),p=useRef(y),v=useRef(u);useEffect(()=>{p.current=y},[y]),useEffect(()=>{v.current=u},[u]);const[g,d]=useState(!0),N=useCallback((e,t)=>{const{valueType:a,scale:s,codec:o}=e;if("number"===a&&"number"==typeof t&&s){const e=p.current[s];return t*(e?.scale??1)}if("json"===a&&o?.fromServer)try{return o.fromServer(t)}catch{}return t},[]),C=useCallback((e,t)=>{const{valueType:a,scale:s,codec:o}=e;if("json"===a&&o?.toServer)try{t=o.toServer(t)}catch{}if("number"===a&&"number"==typeof t&&s){const e=p.current[s];return t/(e?.scale??1)}return t},[]),w=useCallback(e=>{const a=t.filter(t=>t.scale===e);a.length&&f(e=>{const t={...e};for(const e of a){const a=v.current[e.tagName];if("number"!=typeof a)continue;const s=N(e,a);t[e.tagName]!==s&&(t[e.tagName]=s)}return t})},[t,N]),h=useCallback((e,t)=>{i(a=>a[e.tagName]===t?a:{...a,[e.tagName]:t});const a=N(e,t);f(t=>t[e.tagName]===a?t:{...t,[e.tagName]:a})},[N]),x=useCallback(async(e,t,a)=>{const s=a?.concurrency??4,o=a?.minDelayMs??20,r=a?.jitterMs??40;let c=0;const l=Array.from({length:s},()=>(async()=>{for(;;){const a=c++;if(a>=t.length)return;const s=t[a];try{let t=!1;try{await n(e,"refresh",{topic:s.symbolName}),t=!0}catch{}if(!t){const t="GNV"===e.toUpperCase()?{group:"ux",key:s.symbolName}:{key:s.symbolName};s.options&&(t.options=s.options);try{const a=await n(e,"read_value",t);a?.success&&a?.valid&&h(s,a.data)}catch(e){}}}catch(e){}finally{const e=Math.floor(Math.random()*r);await sleep(o+e)}}})());await Promise.all(l)},[n,h]),k=useCallback(async()=>{for(const[e,t]of Object.entries(a)){if(!t.serverTag)continue;const{domain:a,symbolName:s}=t.serverTag;try{const t=await n(a,"read_value",{group:"ux",key:s});if(t.data&&(t.success??1)&&(t.valid??1)){const a=JSON.parse(t.data);if(a&&"number"==typeof a.scale){const{scale:t,label:s}=a;b(a=>({...a,[e]:{...a[e],scale:t,label:s??a[e]?.label??"---"}})),w(e)}}}catch{}}},[n,a,w]);useEffect(()=>{let e=!0;const a=[],u=async()=>{if(e&&!o.current){o.current=!0;try{await(async()=>{const o=new Map;for(const e of t){const t=o.get(e.domain);t?t.push(e):o.set(e.domain,[e])}try{await k();for(const[t,r]of o.entries()){if("ADS"===t.toUpperCase())for(const e of r)try{const t=e.options?{symbol_name:e.symbolName,options:e.options}:{symbol_name:e.symbolName};await n("ADS","register_symbol",t)}catch(e){}for(const s of r){const o=c(`${t}/${s.symbolName}`,t=>{e&&h(s,t?.value)});a.push(o)}s&&"ADS"!==t.toUpperCase()&&await x(t,r,{concurrency:4,minDelayMs:20,jitterMs:40})}s&&await n("ADS","refresh",{})}finally{e&&setTimeout(()=>e&&d(!1),100)}})()}finally{e&&setTimeout(()=>e&&d(!1),100)}}};if(r())u();else{const e=c("HUB/connected",()=>{l(e),u()});a.push(e)}return()=>{e=!1,a.forEach(l),o.current=!1}},[c,l,r,n,s,t,k,x,h]);const S=useMemo(()=>Object.entries(a).filter(([,e])=>e.serverTag).map(([e,t])=>({scaleName:e,domain:t.serverTag.domain,symbolName:t.serverTag.symbolName})),[a]);useEffect(()=>{let e=!0;const t=[];for(const{scaleName:a,domain:s,symbolName:o}of S){const n=c(`${s}/${o}`,t=>{if(!e)return;const s=t?.value;if(s&&"object"==typeof s&&"number"==typeof s.scale){const{scale:e,label:t}=s;b(s=>({...s,[a]:{...s[a],scale:e,label:t??s[a]?.label??"---"}})),w(a)}});t.push(n)}return()=>{e=!1,t.forEach(l)}},[c,l,S,w]);const T=useCallback(async(e,a)=>{const s=t.find(t=>t.tagName===e);if(!s)return;const o=C(s,a);let r;const c=s.domain.toUpperCase();r="ADS"===c?{symbol_name:s.symbolName,value:o}:"GNV"===c?{group:"ux",key:s.symbolName,value:o}:{key:s.symbolName,value:o},await n(s.domain,"write_value",r)},[t,n,C]),E=useCallback(async e=>{const a=t.find(t=>t.tagName===e);if(!a)return;if("boolean"!==a.valueType)return;const s=a.domain.toUpperCase(),o=e=>"ADS"===s?{symbol_name:a.symbolName,value:e}:"GNV"===s?{group:"ux",key:a.symbolName,value:e}:{key:a.symbolName,value:e};await n(a.domain,"write_value",o(!0)),await sleep(300),await n(a.domain,"write_value",o(!1))},[t,n]),_=useCallback(async(e,t,a)=>{const s=y[e];s&&(s.serverTag&&await n(s.serverTag.domain,"write_value",{group:"ux",key:s.serverTag.symbolName,value:{name:e,scale:t,label:a}}),b(s=>({...s,[e]:{...s[e],scale:t,label:a}})),w(e))},[y,n,w]);useEffect(()=>{f(e=>{const a={...e};for(const e of t){const t=v.current[e.tagName];if(void 0===t)continue;const s=N(e,t);a[e.tagName]!==s&&(a[e.tagName]=s)}return a})},[t,N,y]);const j=useMemo(()=>({values:m,rawValues:u,isLoading:g,write:T,tap:E,scales:y,updateScale:_}),[m,u,g,T,E,y,_]);return _jsx(AutoCoreTagContext.Provider,{value:j,children:e})};
@@ -0,0 +1,162 @@
1
+ /**
2
+ * @module core/AutoCoreTagTypes
3
+ *
4
+ * Core type system for AutoCore's tag layer:
5
+ * - Strongly-typed tag values (boolean/number/string/json)
6
+ * - Optional **scales** for numeric unit conversion (e.g., mm ⇄ in)
7
+ * - Optional **codecs** to present richer client-side types (Date/Map) while
8
+ * keeping pure JSON across the wire (serde_json::Value on the server)
9
+ */
10
+ export type PrimitiveKind = "boolean" | "number" | "string" | "json";
11
+ /** Strict JSON value (mirrors serde_json::Value) */
12
+ type JsonPrimitive = string | number | boolean | null;
13
+ export type JsonValue = JsonPrimitive | {
14
+ [key: string]: JsonValue;
15
+ } | JsonValue[];
16
+ /**
17
+ * Extended client-side value you *may* choose to present in the UI.
18
+ * Use codecs to round-trip these as pure JSON to the server.
19
+ */
20
+ export type ExtendedJsonValue = JsonValue | Date | Map<string, JsonValue>;
21
+ /**
22
+ * Map a tag's declared primitive kind to the app-visible type.
23
+ * - "json" becomes ExtendedJsonValue so UIs can work with Date/Map when desired.
24
+ */
25
+ export type TagValueOf<K extends PrimitiveKind> = K extends "boolean" ? boolean : K extends "number" ? number : K extends "string" ? string : ExtendedJsonValue;
26
+ /**
27
+ * Runtime binding for a single tag, as returned by hooks like `useAutoCoreTag`.
28
+ * - `value` is app-visible (already scaled/decoded)
29
+ * - `rawValue` is the last **unscaled, un-decoded** controller value received (server JSON)
30
+ * - `write` expects app-visible value (provider will inverse-scale/encode)
31
+ * - `tap` is typically for boolean momentaries (provider may pulse true→false)
32
+ */
33
+ export type TagBinding<T> = Readonly<{
34
+ /** App-visible value (scaled/decoded). */
35
+ value: T | undefined;
36
+ /** Last raw value from the server (pre-scale, pre-codec). */
37
+ rawValue: unknown | undefined;
38
+ /** Write a new app-visible value (provider will inverse-scale/encode). */
39
+ write: (displayValue: T) => Promise<void>;
40
+ /** Momentary action; typically boolean true→false pulse. */
41
+ tap: () => Promise<void>;
42
+ /** True while initial read/bootstrapping is in progress. */
43
+ isLoading: boolean;
44
+ }>;
45
+ /**
46
+ * Configuration for a named scale group.
47
+ * Apply by setting `scale: "<name>"` on numeric tags.
48
+ */
49
+ export interface ScaleConfig {
50
+ /** Unique name for this scale group (e.g., "position", "load") */
51
+ name: string;
52
+ /** Current scale factor — incoming values ×= scale; outgoing values /= scale */
53
+ scale: number;
54
+ /** Units/label for display (e.g., "mm", "in", "lbs") */
55
+ label: string;
56
+ /** Optional description for debugging/documentation */
57
+ description?: string;
58
+ /**
59
+ * Optional server tag that provides the scale dynamically.
60
+ * (If used, your provider should subscribe and update `scale` when it changes.)
61
+ */
62
+ serverTag?: {
63
+ domain: string;
64
+ symbolName: string;
65
+ };
66
+ }
67
+ /**
68
+ * A codec lets a tag expose a richer client-side type while staying JSON on the wire.
69
+ * Common examples:
70
+ * - Date values: ISO string ⇄ Date
71
+ * - Map-like blobs: object ⇄ Map<string, JsonValue>
72
+ */
73
+ export type TagCodec<TIn = unknown, TOut extends JsonValue = JsonValue> = {
74
+ /** raw JSON (from server) → app-visible value */
75
+ fromServer?: (raw: unknown) => TIn;
76
+ /** app-visible value → pure JSON (to server) */
77
+ toServer?: (value: TIn) => TOut;
78
+ };
79
+ /**
80
+ * Tag configuration descriptor used to build a typed spec.
81
+ *
82
+ * @typeParam K - Literal tag name (use `as const` on your spec array)
83
+ * @typeParam T - Primitive kind for type mapping (boolean/number/string/json)
84
+ */
85
+ export type TagConfig<K extends string = string, T extends PrimitiveKind = PrimitiveKind> = {
86
+ /** Local key used by UI/consumers (unique within your spec) */
87
+ tagName: K;
88
+ /** Domain for the symbol (e.g., "ADS", "MEMORYSTORE") */
89
+ domain: string;
90
+ /** Server symbol/topic name (as used by your backend invoke API) */
91
+ symbolName: string;
92
+ /** Declared primitive kind for typing and DevPanel rendering */
93
+ valueType: T;
94
+ /** Optional initial **raw** value before first server update */
95
+ initialValue?: TagValueOf<T>;
96
+ /** Optional per-tag hook/config options (e.g., cycle time, debounce) */
97
+ options?: Record<string, unknown>;
98
+ /**
99
+ * Optional scale group for numeric tags.
100
+ * If present, provider will:
101
+ * - Multiply incoming numbers by the group's `scale`
102
+ * - Divide outgoing numbers by the group's `scale`
103
+ */
104
+ scale?: string;
105
+ /**
106
+ * Optional codec to present richer UI types while keeping JSON on the wire.
107
+ * Only commonly used with `valueType: "json"`.
108
+ */
109
+ codec?: TagCodec;
110
+ };
111
+ /** Extract the tag config for a particular tag name `K` from a `Spec` */
112
+ export type ExtractByTag<Spec extends readonly TagConfig[], K> = Extract<Spec[number], {
113
+ tagName: K;
114
+ }>;
115
+ /**
116
+ * Build a strongly-typed map of tagName → app-visible value type.
117
+ * Use with `as const` specs to preserve literal tag names.
118
+ */
119
+ export type TagValueMap<Spec extends readonly TagConfig[]> = {
120
+ [K in Spec[number]["tagName"]]: TagValueOf<ExtractByTag<Spec, K>["valueType"]>;
121
+ };
122
+ /**
123
+ * Helper: binding type for a specific tag name from a spec.
124
+ */
125
+ export type BindingOf<Spec extends readonly TagConfig[], K extends Spec[number]["tagName"]> = TagBinding<TagValueMap<Spec>[K]>;
126
+ /**
127
+ * Enhanced context value with scale management.
128
+ * Providers should:
129
+ * - Buffer **raw** values in `rawValues` (pre-scale, pre-codec)
130
+ * - Populate `values` from `rawValues` using current scales/codecs
131
+ * - Inverse-scale/encode on write(t) before invoking backend
132
+ */
133
+ export interface BaseContextValue<VMap extends Record<string, any>> {
134
+ /** Current app-visible tag values (already scaled/decoded). */
135
+ values: Partial<VMap>;
136
+ /** Last raw (controller) values, as received (pre-scale, pre-codec). */
137
+ rawValues: Record<string, unknown>;
138
+ /** Whether initial reads are pending. */
139
+ isLoading: boolean;
140
+ /**
141
+ * Write a single tag value (app-visible → provider will inverse-scale/encode).
142
+ * Strongly typed by tag name when used with a typed Context.
143
+ */
144
+ write: <K extends keyof VMap & string>(tagName: K, value: VMap[K]) => Promise<void>;
145
+ /**
146
+ * Trigger a momentary/toggle action for a tag.
147
+ * Typically used for boolean "request" bits.
148
+ */
149
+ tap: <K extends keyof VMap & string>(tagName: K) => Promise<void>;
150
+ /** Current scale configurations by name. */
151
+ scales: Record<string, ScaleConfig>;
152
+ /**
153
+ * Update a scale group (factor and label). Providers should recompute affected tags from **raw**.
154
+ *
155
+ * @param scaleName - Name of the scale group (e.g., "position")
156
+ * @param newScale - New scale factor (display = raw * newScale)
157
+ * @param newLabel - New units label (e.g., "inches")
158
+ */
159
+ updateScale: (scaleName: string, newScale: number, newLabel: string) => Promise<void>;
160
+ }
161
+ export {};
162
+ //# sourceMappingURL=AutoCoreTagTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoCoreTagTypes.d.ts","sourceRoot":"","sources":["../../src/core/AutoCoreTagTypes.ts"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AAEH,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErE,oDAAoD;AACpD,KA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