@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.
- package/additional-docs/AutoCoreTagContext.md +441 -0
- package/dist/assets/BlocklyLogo.d.ts +1 -0
- package/dist/assets/BlocklyLogo.d.ts.map +1 -0
- package/dist/assets/Distance.d.ts +1 -0
- package/dist/assets/Distance.d.ts.map +1 -0
- package/dist/assets/JogLong.d.ts +1 -0
- package/dist/assets/JogLong.d.ts.map +1 -0
- package/dist/assets/JogMedium.d.ts +1 -0
- package/dist/assets/JogMedium.d.ts.map +1 -0
- package/dist/assets/JogShort.d.ts +1 -0
- package/dist/assets/JogShort.d.ts.map +1 -0
- package/dist/assets/PythonLogo.d.ts +1 -0
- package/dist/assets/PythonLogo.d.ts.map +1 -0
- package/dist/assets/Rotation3D.d.ts +1 -0
- package/dist/assets/Rotation3D.d.ts.map +1 -0
- package/dist/assets/RotationCcw.d.ts +1 -0
- package/dist/assets/RotationCcw.d.ts.map +1 -0
- package/dist/assets/RotationCcwA.d.ts +1 -0
- package/dist/assets/RotationCcwA.d.ts.map +1 -0
- package/dist/assets/RotationCcwB.d.ts +1 -0
- package/dist/assets/RotationCcwB.d.ts.map +1 -0
- package/dist/assets/RotationCcwC.d.ts +1 -0
- package/dist/assets/RotationCcwC.d.ts.map +1 -0
- package/dist/assets/RotationCw.d.ts +1 -0
- package/dist/assets/RotationCw.d.ts.map +1 -0
- package/dist/assets/RotationCwA.d.ts +1 -0
- package/dist/assets/RotationCwA.d.ts.map +1 -0
- package/dist/assets/RotationCwB.d.ts +1 -0
- package/dist/assets/RotationCwB.d.ts.map +1 -0
- package/dist/assets/RotationCwC.d.ts +1 -0
- package/dist/assets/RotationCwC.d.ts.map +1 -0
- package/dist/assets/Run.d.ts +1 -0
- package/dist/assets/Run.d.ts.map +1 -0
- package/dist/assets/Speed.d.ts +1 -0
- package/dist/assets/Speed.d.ts.map +1 -0
- package/dist/assets/SpeedFast.d.ts +1 -0
- package/dist/assets/SpeedFast.d.ts.map +1 -0
- package/dist/assets/SpeedMedium.d.ts +1 -0
- package/dist/assets/SpeedMedium.d.ts.map +1 -0
- package/dist/assets/SpeedNone.d.ts +1 -0
- package/dist/assets/SpeedNone.d.ts.map +1 -0
- package/dist/assets/SpeedSlow.d.ts +1 -0
- package/dist/assets/SpeedSlow.d.ts.map +1 -0
- package/dist/assets/Walk.d.ts +1 -0
- package/dist/assets/Walk.d.ts.map +1 -0
- package/dist/assets/index.d.ts +1 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/components/AutoCoreDevPanel.d.ts +144 -0
- package/dist/components/AutoCoreDevPanel.d.ts.map +1 -0
- package/dist/components/AutoCoreDevPanel.js +1 -0
- package/dist/components/BlocklyEditor.d.ts +1 -0
- package/dist/components/BlocklyEditor.d.ts.map +1 -0
- package/dist/components/BlocklyEditor.js +1 -1
- package/dist/components/CodeEditor.d.ts +2 -1
- package/dist/components/CodeEditor.d.ts.map +1 -0
- package/dist/components/CodeEditor.js +1 -1
- package/dist/components/FileList.d.ts +1 -0
- package/dist/components/FileList.d.ts.map +1 -0
- package/dist/components/FileList.js +1 -1
- package/dist/components/FileSelect.d.ts +1 -0
- package/dist/components/FileSelect.d.ts.map +1 -0
- package/dist/components/FileSelect.js +1 -1
- package/dist/components/FitText.d.ts +1 -0
- package/dist/components/FitText.d.ts.map +1 -0
- package/dist/components/FitText.js +1 -1
- package/dist/components/Indicator.d.ts +2 -1
- package/dist/components/Indicator.d.ts.map +1 -0
- package/dist/components/Indicator.js +1 -1
- package/dist/components/IndicatorButton.d.ts +23 -137
- package/dist/components/IndicatorButton.d.ts.map +1 -0
- package/dist/components/IndicatorButton.js +1 -1
- package/dist/components/IndicatorRect.d.ts +2 -1
- package/dist/components/IndicatorRect.d.ts.map +1 -0
- package/dist/components/JogPanel.d.ts +1 -0
- package/dist/components/JogPanel.d.ts.map +1 -0
- package/dist/components/Lamp.d.ts +2 -1
- package/dist/components/Lamp.d.ts.map +1 -0
- package/dist/components/Lamp.js +1 -1
- package/dist/components/Osk.d.ts +1 -0
- package/dist/components/Osk.d.ts.map +1 -0
- package/dist/components/Osk.js +1 -1
- package/dist/components/OskDialog.d.ts +1 -0
- package/dist/components/OskDialog.d.ts.map +1 -0
- package/dist/components/ProgressBarWithValue.d.ts +1 -0
- package/dist/components/ProgressBarWithValue.d.ts.map +1 -0
- package/dist/components/ProgressBarWithValue.js +1 -1
- package/dist/components/TextInput.d.ts +62 -103
- package/dist/components/TextInput.d.ts.map +1 -0
- package/dist/components/TextInput.js +1 -1
- package/dist/components/ToggleGroup.d.ts +2 -1
- package/dist/components/ToggleGroup.d.ts.map +1 -0
- package/dist/components/ToggleGroup.js +1 -1
- package/dist/components/ValueDisplay.d.ts +3 -2
- package/dist/components/ValueDisplay.d.ts.map +1 -0
- package/dist/components/ValueDisplay.js +1 -1
- package/dist/components/ValueIndicator.d.ts +2 -1
- package/dist/components/ValueIndicator.d.ts.map +1 -0
- package/dist/components/ValueIndicator.js +1 -1
- package/dist/components/ValueInput.d.ts +2 -1
- package/dist/components/ValueInput.d.ts.map +1 -0
- package/dist/components/ValueInput.js +1 -1
- package/dist/core/ActionMode.d.ts +1 -0
- package/dist/core/ActionMode.d.ts.map +1 -0
- package/dist/core/AutoCoreTagContext.d.ts +224 -0
- package/dist/core/AutoCoreTagContext.d.ts.map +1 -0
- package/dist/core/AutoCoreTagContext.js +1 -0
- package/dist/core/AutoCoreTagTypes.d.ts +162 -0
- package/dist/core/AutoCoreTagTypes.d.ts.map +1 -0
- package/dist/core/AutoCoreTagTypes.js +1 -0
- package/dist/core/EventEmitterContext.d.ts +295 -2
- package/dist/core/EventEmitterContext.d.ts.map +1 -0
- package/dist/core/EventEmitterContext.js +1 -1
- package/dist/core/IndicatorButtonState.d.ts +1 -0
- package/dist/core/IndicatorButtonState.d.ts.map +1 -0
- package/dist/core/IndicatorColor.d.ts +1 -0
- package/dist/core/IndicatorColor.d.ts.map +1 -0
- package/dist/core/MaskPatterns.d.ts +1 -0
- package/dist/core/MaskPatterns.d.ts.map +1 -0
- package/dist/core/NumerableTypes.d.ts +1 -0
- package/dist/core/NumerableTypes.d.ts.map +1 -0
- package/dist/core/NumerableTypes.js +1 -1
- package/dist/core/PositionContext.d.ts +1 -1
- package/dist/core/PositionContext.d.ts.map +1 -0
- package/dist/core/UniqueId.d.ts +1 -0
- package/dist/core/UniqueId.d.ts.map +1 -0
- package/dist/core/ValueSimulator.d.ts +2 -1
- package/dist/core/ValueSimulator.d.ts.map +1 -0
- package/dist/core/ValueSimulator.js +1 -1
- package/dist/core/hoc.d.ts +1 -0
- package/dist/core/hoc.d.ts.map +1 -0
- package/dist/core/hoc.js +1 -1
- package/dist/hooks/adsHooks.d.ts +1 -0
- package/dist/hooks/adsHooks.d.ts.map +1 -0
- package/dist/hooks/adsHooks.js +1 -1
- package/dist/hooks/commandHooks.d.ts +1 -0
- package/dist/hooks/commandHooks.d.ts.map +1 -0
- package/dist/hooks/commandHooks.js +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/useAutoCoreTag.d.ts +26 -0
- package/dist/hooks/useAutoCoreTag.d.ts.map +1 -0
- package/dist/hooks/useAutoCoreTag.js +1 -0
- package/dist/hooks/useScaledValue.d.ts +1 -0
- package/dist/hooks/useScaledValue.d.ts.map +1 -0
- package/dist/hooks/useScaledValue.js +1 -1
- package/dist/hub/CommandMessage.d.ts +1 -0
- package/dist/hub/CommandMessage.d.ts.map +1 -0
- package/dist/hub/HubBase.d.ts +3 -2
- package/dist/hub/HubBase.d.ts.map +1 -0
- package/dist/hub/HubSimulate.d.ts +2 -1
- package/dist/hub/HubSimulate.d.ts.map +1 -0
- package/dist/hub/HubSimulate.js +1 -1
- package/dist/hub/HubTauri.d.ts +2 -1
- package/dist/hub/HubTauri.d.ts.map +1 -0
- package/dist/hub/HubTauri.js +1 -1
- package/dist/hub/HubWebSocket.d.ts +2 -1
- package/dist/hub/HubWebSocket.d.ts.map +1 -0
- package/dist/hub/HubWebSocket.js +1 -1
- package/dist/hub/index.d.ts +2 -1
- package/dist/hub/index.d.ts.map +1 -0
- package/dist/hub/index.js +1 -1
- package/docs/.nojekyll +1 -0
- package/docs/assets/hierarchy.js +1 -0
- package/docs/assets/highlight.css +134 -0
- package/docs/assets/icons.js +18 -0
- package/docs/assets/icons.svg +1 -0
- package/docs/assets/main.js +60 -0
- package/docs/assets/navigation.js +1 -0
- package/docs/assets/search.js +1 -0
- package/docs/assets/style.css +1633 -0
- package/docs/classes/components_CodeEditor.CodeEditor.html +108 -101
- package/docs/classes/components_Indicator.Indicator.html +122 -0
- package/docs/classes/components_IndicatorRect.IndicatorRect.html +121 -0
- package/docs/classes/components_JogPanel.JogPanel.html +104 -106
- package/docs/classes/components_Lamp.Lamp.html +96 -79
- package/docs/classes/components_OskDialog.OskDialog.html +125 -0
- package/docs/classes/components_TextInput.TextInput.html +99 -89
- package/docs/classes/components_ValueDisplay.ValueDisplay.html +148 -0
- package/docs/classes/components_ValueIndicator.ValueIndicator.html +98 -91
- package/docs/classes/core_ValueSimulator.ValueSimulator.html +51 -0
- package/docs/classes/hub_HubBase.HubBase.html +106 -0
- package/docs/classes/hub_HubSimulate.HubSimulate.html +75 -0
- package/docs/classes/hub_HubTauri.HubTauri.html +93 -0
- package/docs/classes/hub_HubWebSocket.HubWebSocket.html +75 -69
- package/docs/documents/core_AutoCoreTagContext.AutoCoreTagContext.html +148 -0
- package/docs/enums/components_JogPanel.JogDistanceAction.html +5 -5
- package/docs/enums/components_JogPanel.JogPanelAction.html +18 -18
- package/docs/enums/components_JogPanel.JogSpeedAction.html +5 -5
- package/docs/enums/core_ActionMode.ActionMode.html +6 -6
- package/docs/enums/core_IndicatorColor.IndicatorColor.html +22 -22
- package/docs/functions/assets.BlocklyLogo.html +1 -0
- package/docs/functions/assets.Distance.html +1 -0
- package/docs/functions/assets.JogLong.html +1 -0
- package/docs/functions/assets.JogMedium.html +1 -0
- package/docs/functions/assets.JogShort.html +1 -0
- package/docs/functions/assets.PythonLogo.html +1 -0
- package/docs/functions/assets.Rotation3D.html +1 -0
- package/docs/functions/assets.RotationCcw.html +1 -0
- package/docs/functions/assets.RotationCcwA.html +1 -0
- package/docs/functions/assets.RotationCcwB.html +1 -0
- package/docs/functions/assets.RotationCcwC.html +1 -0
- package/docs/functions/assets.RotationCw.html +1 -0
- package/docs/functions/assets.RotationCwA.html +1 -0
- package/docs/functions/assets.RotationCwB.html +1 -0
- package/docs/functions/assets.RotationCwC.html +1 -0
- package/docs/functions/assets.Run.html +1 -0
- package/docs/functions/assets.Speed.html +1 -0
- package/docs/functions/assets.SpeedFast.html +1 -0
- package/docs/functions/assets.SpeedMedium.html +1 -0
- package/docs/functions/assets.SpeedNone.html +1 -0
- package/docs/functions/assets.SpeedSlow.html +1 -0
- package/docs/functions/assets.Walk.html +1 -0
- package/docs/functions/components_BlocklyEditor.createCustomToolbox.html +5 -5
- package/docs/functions/core_UniqueId.UniqueId.html +9 -0
- package/docs/functions/core_hoc.hocAddSubscription.html +6 -0
- package/docs/functions/hooks_adsHooks.useAdsRegisterSymbols.html +16 -0
- package/docs/functions/hooks_adsHooks.useAdsTapValue.html +8 -0
- package/docs/functions/hooks_adsHooks.useAdsWriteScaledValue.html +18 -0
- package/docs/functions/hooks_adsHooks.useAdsWriteValue.html +9 -0
- package/docs/functions/hooks_commandHooks.useRegisterSymbols.html +16 -0
- package/docs/functions/hooks_commandHooks.useTapValue.html +10 -0
- package/docs/functions/hooks_commandHooks.useWriteScaledValue.html +18 -0
- package/docs/functions/hooks_commandHooks.useWriteValue.html +11 -0
- package/docs/functions/hooks_useAutoCoreTag.ts.makeAutoCoreTagHooks.html +12 -0
- package/docs/functions/hooks_useScaledValue.useScaledValue.html +18 -0
- package/docs/functions/hub.createHub.html +3 -0
- package/docs/hierarchy.html +1 -0
- package/docs/index.html +148 -0
- package/docs/interfaces/components_IndicatorButton.IndicatorButtonProps.html +654 -0
- package/docs/interfaces/components_IndicatorRect.IndicatorRectProps.html +37 -0
- package/docs/interfaces/components_JogPanel.JogPanelButtonDefinition.html +5 -5
- package/docs/interfaces/components_ToggleGroup.ToggleGroupProps.html +545 -519
- package/docs/interfaces/core_AutoCoreTagTypes.BaseContextValue.html +12 -0
- package/docs/interfaces/core_AutoCoreTagTypes.ScaleConfig.html +13 -0
- package/docs/interfaces/core_EventEmitterContext.Action.html +8 -0
- package/docs/interfaces/core_EventEmitterContext.EventEmitterContextType.html +33 -0
- package/docs/interfaces/core_EventEmitterContext.State.html +8 -0
- package/docs/interfaces/core_EventEmitterContext.Subscription.html +6 -0
- package/docs/interfaces/core_IndicatorButtonState.IndicatorButtonState.html +10 -10
- package/docs/interfaces/core_PositionContext.IPositionContext.html +17 -0
- package/docs/interfaces/hub_CommandMessage.CommandMessage.html +6 -6
- package/docs/interfaces/hub_CommandMessage.CommandMessageResult.html +4 -4
- package/docs/modules/assets.html +1 -23
- package/docs/modules/assets_BlocklyLogo.html +1 -2
- package/docs/modules/assets_Distance.html +1 -2
- package/docs/modules/assets_JogLong.html +1 -2
- package/docs/modules/assets_JogMedium.html +1 -2
- package/docs/modules/assets_JogShort.html +1 -2
- package/docs/modules/assets_PythonLogo.html +1 -2
- package/docs/modules/assets_Rotation3D.html +1 -2
- package/docs/modules/assets_RotationCcw.html +1 -2
- package/docs/modules/assets_RotationCcwA.html +1 -2
- package/docs/modules/assets_RotationCcwB.html +1 -2
- package/docs/modules/assets_RotationCcwC.html +1 -2
- package/docs/modules/assets_RotationCw.html +1 -2
- package/docs/modules/assets_RotationCwA.html +1 -2
- package/docs/modules/assets_RotationCwB.html +1 -2
- package/docs/modules/assets_RotationCwC.html +1 -2
- package/docs/modules/assets_Run.html +1 -2
- package/docs/modules/assets_Speed.html +1 -2
- package/docs/modules/assets_SpeedFast.html +1 -2
- package/docs/modules/assets_SpeedMedium.html +1 -2
- package/docs/modules/assets_SpeedNone.html +1 -2
- package/docs/modules/assets_SpeedSlow.html +1 -2
- package/docs/modules/assets_Walk.html +1 -2
- package/docs/modules/components_AutoCoreDevPanel.html +20 -0
- package/docs/modules/components_BlocklyEditor.html +1 -5
- package/docs/modules/components_CodeEditor.html +1 -3
- package/docs/modules/components_FileList.html +1 -3
- package/docs/modules/components_FileSelect.html +1 -0
- package/docs/modules/components_FitText.html +1 -3
- package/docs/modules/components_Indicator.html +1 -0
- package/docs/modules/components_IndicatorButton.html +1 -0
- package/docs/modules/components_IndicatorRect.html +1 -0
- package/docs/modules/components_JogPanel.html +1 -9
- package/docs/modules/components_Lamp.html +1 -4
- package/docs/modules/components_Osk.html +1 -0
- package/docs/modules/components_OskDialog.html +1 -0
- package/docs/modules/components_ProgressBarWithValue.html +1 -0
- package/docs/modules/components_TextInput.html +1 -2
- package/docs/modules/components_ToggleGroup.html +1 -6
- package/docs/modules/components_ValueDisplay.html +1 -0
- package/docs/modules/components_ValueIndicator.html +1 -4
- package/docs/modules/components_ValueInput.html +1 -2
- package/docs/modules/core_ActionMode.html +1 -2
- package/docs/modules/core_AutoCoreTagContext.html +11 -0
- package/docs/modules/core_AutoCoreTagTypes.html +1 -0
- package/docs/modules/core_EventEmitterContext.html +53 -0
- package/docs/modules/core_IndicatorButtonState.html +1 -2
- package/docs/modules/core_IndicatorColor.html +1 -2
- package/docs/modules/core_MaskPatterns.html +1 -0
- package/docs/modules/core_NumerableTypes.html +1 -0
- package/docs/modules/core_PositionContext.html +1 -0
- package/docs/modules/core_UniqueId.html +1 -0
- package/docs/modules/core_ValueSimulator.html +1 -0
- package/docs/modules/core_hoc.html +1 -0
- package/docs/modules/hooks.html +1 -0
- package/docs/modules/hooks_adsHooks.html +1 -0
- package/docs/modules/hooks_commandHooks.html +1 -0
- package/docs/modules/hooks_useAutoCoreTag.ts.html +52 -0
- package/docs/modules/hooks_useScaledValue.html +1 -0
- package/docs/modules/hub.html +1 -0
- package/docs/modules/hub_CommandMessage.html +1 -3
- package/docs/modules/hub_HubBase.html +1 -0
- package/docs/modules/hub_HubSimulate.html +1 -0
- package/docs/modules/hub_HubTauri.html +1 -0
- package/docs/modules/hub_HubWebSocket.html +1 -2
- package/docs/modules.html +23 -0
- package/docs/types/components_IndicatorButton.IndicatorButtonOptionsType.html +1 -1
- package/docs/types/core_AutoCoreTagTypes.ExtractByTag.html +2 -0
- package/docs/types/core_AutoCoreTagTypes.PrimitiveKind.html +1 -0
- package/docs/types/core_AutoCoreTagTypes.TagConfig.html +16 -0
- package/docs/types/core_AutoCoreTagTypes.TagValueMap.html +1 -0
- package/docs/types/core_AutoCoreTagTypes.TagValueOf.html +1 -0
- package/docs/types/core_EventEmitterContext.EmitterDispatchFunction.html +3 -0
- package/docs/types/core_EventEmitterContext.EmitterSubscribeFunction.html +3 -0
- package/docs/types/core_EventEmitterContext.EmitterUnsubscribeFunction.html +3 -0
- package/docs/types/core_NumerableTypes.NumerableFormatOptions.html +4 -0
- package/docs/types/core_hoc.HocAddSubscriptionProps.html +6 -0
- package/docs/variables/components_AutoCoreDevPanel.AutoCoreDevPanel.html +43 -0
- package/docs/variables/components_BlocklyEditor.BlocklyEditor.html +13 -0
- package/docs/variables/components_BlocklyEditor.StandardToolbox.html +1 -1
- package/docs/variables/components_FileList.FileList.html +23 -0
- package/docs/variables/components_FileSelect.FileSelect.html +1 -0
- package/docs/variables/components_FitText.FitText.html +4 -0
- package/docs/variables/components_IndicatorButton.IndicatorButton.html +1 -0
- package/docs/variables/components_JogPanel.DefaultLinearJogButtons.html +2 -2
- package/docs/variables/components_JogPanel.DefaultRotationJogButtons.html +2 -2
- package/docs/variables/components_Osk.Osk.html +1 -0
- package/docs/variables/components_ProgressBarWithValue.ProgressBarWithValue.html +1 -0
- package/docs/variables/components_ToggleGroup.ToggleGroup.html +1 -0
- package/docs/variables/components_ValueInput.ValueInput.html +4 -0
- package/docs/variables/core_AutoCoreTagContext.AutoCoreTagContext.html +1 -0
- package/docs/variables/core_AutoCoreTagContext.AutoCoreTagProvider.html +7 -0
- package/docs/variables/core_EventEmitterContext.EventEmitterContext.html +64 -0
- package/docs/variables/core_EventEmitterContext.EventEmitterProvider.html +10 -0
- package/docs/variables/core_MaskPatterns.PrimeReactMaskPatterns.html +14 -0
- package/docs/variables/core_MaskPatterns.RegExMaskPatterns.html +15 -0
- package/docs/variables/core_PositionContext.DimensionsContext.html +6 -0
- package/docs/variables/hooks_useScaledValue.kMillimeters2Inches.html +2 -0
- package/docs/variables/hooks_useScaledValue.kNewtons2Pounds.html +2 -0
- package/package.json +32 -27
- package/readme.md +193 -22
- package/src/components/AutoCoreDevPanel.tsx +411 -0
- package/src/components/CodeEditor.tsx +2 -2
- package/src/components/FileList.tsx +2 -2
- package/src/components/Indicator.tsx +2 -2
- package/src/components/IndicatorButton.tsx +187 -333
- package/src/components/IndicatorRect.tsx +2 -2
- package/src/components/Lamp.tsx +3 -3
- package/src/components/TextInput.tsx +159 -240
- package/src/components/ToggleGroup.tsx +3 -3
- package/src/components/ValueDisplay.tsx +4 -4
- package/src/components/ValueIndicator.tsx +2 -2
- package/src/components/ValueInput.tsx +2 -2
- package/src/core/AutoCoreTagContext.tsx +698 -0
- package/src/core/AutoCoreTagTypes.ts +202 -0
- package/src/core/EventEmitterContext.tsx +582 -225
- package/src/core/ValueSimulator.ts +2 -2
- package/src/hooks/useAutoCoreTag.ts +103 -0
- package/src/hub/HubBase.ts +3 -3
- package/src/hub/HubSimulate.ts +2 -2
- package/src/hub/HubTauri.ts +3 -3
- package/src/hub/HubWebSocket.ts +29 -32
- package/src/hub/index.ts +2 -2
- package/tsconfig.json +43 -28
- package/docs/classes/components_BlocklyEditor.BlocklyEditor.html +0 -124
- package/docs/classes/components_ValueInput.ValueInput.html +0 -113
- package/docs/functions/assets_BlocklyLogo.default.html +0 -1
- package/docs/functions/assets_Distance.default.html +0 -1
- package/docs/functions/assets_JogLong.default.html +0 -1
- package/docs/functions/assets_JogMedium.default.html +0 -1
- package/docs/functions/assets_JogShort.default.html +0 -1
- package/docs/functions/assets_PythonLogo.default.html +0 -1
- package/docs/functions/assets_Rotation3D.default.html +0 -1
- package/docs/functions/assets_RotationCcw.default.html +0 -1
- package/docs/functions/assets_RotationCcwA.default.html +0 -1
- package/docs/functions/assets_RotationCcwB.default.html +0 -1
- package/docs/functions/assets_RotationCcwC.default.html +0 -1
- package/docs/functions/assets_RotationCw.default.html +0 -1
- package/docs/functions/assets_RotationCwA.default.html +0 -1
- package/docs/functions/assets_RotationCwB.default.html +0 -1
- package/docs/functions/assets_RotationCwC.default.html +0 -1
- package/docs/functions/assets_Run.default.html +0 -1
- package/docs/functions/assets_Speed.default.html +0 -1
- package/docs/functions/assets_SpeedFast.default.html +0 -1
- package/docs/functions/assets_SpeedMedium.default.html +0 -1
- package/docs/functions/assets_SpeedNone.default.html +0 -1
- package/docs/functions/assets_SpeedSlow.default.html +0 -1
- package/docs/functions/assets_Walk.default.html +0 -1
- package/docs/functions/components_FileList.FileList.html +0 -21
- package/docs/functions/components_FitText.FitText.html +0 -8
- package/docs/functions/components_ToggleGroup.ToggleGroup.html +0 -5
|
@@ -1,6 +1,298 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview EventEmitterContext - Global Event Bus for AutoCore React Applications
|
|
3
|
+
*
|
|
4
|
+
* The EventEmitterContext provides a comprehensive event-driven communication system for React applications,
|
|
5
|
+
* enabling seamless interaction between components and backend services. It serves as the foundational layer
|
|
6
|
+
* for AutoCore's real-time data flow and component communication architecture.
|
|
7
|
+
*
|
|
8
|
+
* ## Core Features
|
|
9
|
+
*
|
|
10
|
+
* - **Global Event Bus**: Publish and subscribe to events across all components
|
|
11
|
+
* - **Backend Integration**: Direct communication with AutoCore server via Hub abstraction
|
|
12
|
+
* - **Type-Safe Subscriptions**: Strongly-typed event handling with automatic cleanup
|
|
13
|
+
* - **Connection Management**: Automatic reconnection and state synchronization
|
|
14
|
+
* - **Development Tools**: Built-in debugging and subscription introspection
|
|
15
|
+
*
|
|
16
|
+
* ## Architecture
|
|
17
|
+
*
|
|
18
|
+
* The system consists of three main components:
|
|
19
|
+
* 1. **EventEmitterProvider**: React context provider that manages global state
|
|
20
|
+
* 2. **Hub**: Abstraction layer for backend communication (WebSocket, HTTP, etc.)
|
|
21
|
+
* 3. **Subscription Manager**: Handles event routing and lifecycle management
|
|
22
|
+
*
|
|
23
|
+
* ## Basic Usage
|
|
24
|
+
*
|
|
25
|
+
* ### 1. Application Setup
|
|
26
|
+
*
|
|
27
|
+
* Wrap your entire application with the EventEmitterProvider:
|
|
28
|
+
*
|
|
29
|
+
* ```tsx
|
|
30
|
+
* // App.tsx
|
|
31
|
+
* import React from 'react';
|
|
32
|
+
* import { EventEmitterProvider } from '@adcops/autocore-react/core/EventEmitterContext';
|
|
33
|
+
* import { PrimeReactProvider } from 'primereact/api';
|
|
34
|
+
* import { MainView } from './MainView';
|
|
35
|
+
*
|
|
36
|
+
* export default function App() {
|
|
37
|
+
* return (
|
|
38
|
+
* <EventEmitterProvider>
|
|
39
|
+
* <PrimeReactProvider>
|
|
40
|
+
* <MainView />
|
|
41
|
+
* </PrimeReactProvider>
|
|
42
|
+
* </EventEmitterProvider>
|
|
43
|
+
* );
|
|
44
|
+
* }
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* ### 2. Component Communication
|
|
48
|
+
*
|
|
49
|
+
* Use the context for inter-component communication:
|
|
50
|
+
*
|
|
51
|
+
* ```tsx
|
|
52
|
+
* // PublisherComponent.tsx
|
|
53
|
+
* import React, { useContext } from 'react';
|
|
54
|
+
* import { EventEmitterContext } from '@adcops/autocore-react/core/EventEmitterContext';
|
|
55
|
+
* import { Button } from 'primereact/button';
|
|
56
|
+
*
|
|
57
|
+
* export const PublisherComponent: React.FC = () => {
|
|
58
|
+
* const { dispatch } = useContext(EventEmitterContext);
|
|
59
|
+
*
|
|
60
|
+
* const handleButtonClick = () => {
|
|
61
|
+
* dispatch({
|
|
62
|
+
* topic: 'user-action/button-clicked',
|
|
63
|
+
* payload: { timestamp: Date.now(), buttonId: 'main-action' }
|
|
64
|
+
* });
|
|
65
|
+
* };
|
|
66
|
+
*
|
|
67
|
+
* return <Button label="Trigger Event" onClick={handleButtonClick} />;
|
|
68
|
+
* };
|
|
69
|
+
*
|
|
70
|
+
* // SubscriberComponent.tsx
|
|
71
|
+
* import React, { useContext, useEffect, useState } from 'react';
|
|
72
|
+
* import { EventEmitterContext } from '@adcops/autocore-react/core/EventEmitterContext';
|
|
73
|
+
*
|
|
74
|
+
* export const SubscriberComponent: React.FC = () => {
|
|
75
|
+
* const { subscribe, unsubscribe } = useContext(EventEmitterContext);
|
|
76
|
+
* const [lastAction, setLastAction] = useState<any>(null);
|
|
77
|
+
*
|
|
78
|
+
* useEffect(() => {
|
|
79
|
+
* const subscriptionId = subscribe('user-action/button-clicked', (payload) => {
|
|
80
|
+
* setLastAction(payload);
|
|
81
|
+
* console.log('Button clicked at:', payload.timestamp);
|
|
82
|
+
* });
|
|
83
|
+
*
|
|
84
|
+
* return () => unsubscribe(subscriptionId);
|
|
85
|
+
* }, [subscribe, unsubscribe]);
|
|
86
|
+
*
|
|
87
|
+
* return (
|
|
88
|
+
* <div>
|
|
89
|
+
* {lastAction && (
|
|
90
|
+
* <p>Last action: {new Date(lastAction.timestamp).toLocaleTimeString()}</p>
|
|
91
|
+
* )}
|
|
92
|
+
* </div>
|
|
93
|
+
* );
|
|
94
|
+
* };
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* ### 3. Backend Integration
|
|
98
|
+
*
|
|
99
|
+
* Communicate with AutoCore server through the integrated Hub:
|
|
100
|
+
*
|
|
101
|
+
* ```tsx
|
|
102
|
+
* // ControlPanel.tsx
|
|
103
|
+
* import React, { useContext, useEffect, useState } from 'react';
|
|
104
|
+
* import { EventEmitterContext } from '@adcops/autocore-react/core/EventEmitterContext';
|
|
105
|
+
* import { Button } from 'primereact/button';
|
|
106
|
+
* import { InputNumber } from 'primereact/inputnumber';
|
|
107
|
+
*
|
|
108
|
+
* export const ControlPanel: React.FC = () => {
|
|
109
|
+
* const { invoke, subscribe, unsubscribe, isConnected } = useContext(EventEmitterContext);
|
|
110
|
+
* const [motorSpeed, setMotorSpeed] = useState<number>(0);
|
|
111
|
+
* const [targetSpeed, setTargetSpeed] = useState<number>(100);
|
|
112
|
+
* const [connected, setConnected] = useState<boolean>(false);
|
|
113
|
+
*
|
|
114
|
+
* // Monitor connection status
|
|
115
|
+
* useEffect(() => {
|
|
116
|
+
* setConnected(isConnected());
|
|
117
|
+
*
|
|
118
|
+
* const connectionSub = subscribe('HUB/connected', () => setConnected(true));
|
|
119
|
+
* const disconnectionSub = subscribe('HUB/disconnected', () => setConnected(false));
|
|
120
|
+
*
|
|
121
|
+
* return () => {
|
|
122
|
+
* unsubscribe(connectionSub);
|
|
123
|
+
* unsubscribe(disconnectionSub);
|
|
124
|
+
* };
|
|
125
|
+
* }, [subscribe, unsubscribe, isConnected]);
|
|
126
|
+
*
|
|
127
|
+
* // Subscribe to real-time motor speed updates
|
|
128
|
+
* useEffect(() => {
|
|
129
|
+
* const speedSub = subscribe('ADS/MAIN.motor.speed', (data) => {
|
|
130
|
+
* setMotorSpeed(data.value);
|
|
131
|
+
* });
|
|
132
|
+
*
|
|
133
|
+
* return () => unsubscribe(speedSub);
|
|
134
|
+
* }, [subscribe, unsubscribe]);
|
|
135
|
+
*
|
|
136
|
+
* // Send commands to backend
|
|
137
|
+
* const handleSpeedChange = async () => {
|
|
138
|
+
* try {
|
|
139
|
+
* const result = await invoke('ADS', 'write_value', {
|
|
140
|
+
* symbol_name: 'MAIN.motor.setpoint',
|
|
141
|
+
* value: targetSpeed
|
|
142
|
+
* });
|
|
143
|
+
*
|
|
144
|
+
* if (!result.success) {
|
|
145
|
+
* console.error('Failed to set motor speed:', result.error_message);
|
|
146
|
+
* }
|
|
147
|
+
* } catch (error) {
|
|
148
|
+
* console.error('Communication error:', error);
|
|
149
|
+
* }
|
|
150
|
+
* };
|
|
151
|
+
*
|
|
152
|
+
* const handleEmergencyStop = async () => {
|
|
153
|
+
* try {
|
|
154
|
+
* await invoke('ADS', 'emergency_stop', {});
|
|
155
|
+
* } catch (error) {
|
|
156
|
+
* console.error('Emergency stop failed:', error);
|
|
157
|
+
* }
|
|
158
|
+
* };
|
|
159
|
+
*
|
|
160
|
+
* return (
|
|
161
|
+
* <div className="control-panel">
|
|
162
|
+
* <div className="status">
|
|
163
|
+
* Connection: {connected ? '🟢 Connected' : '🔴 Disconnected'}
|
|
164
|
+
* </div>
|
|
165
|
+
*
|
|
166
|
+
* <div className="motor-control">
|
|
167
|
+
* <p>Current Speed: {motorSpeed} RPM</p>
|
|
168
|
+
*
|
|
169
|
+
* <InputNumber
|
|
170
|
+
* value={targetSpeed}
|
|
171
|
+
* onValueChange={(e) => setTargetSpeed(e.value || 0)}
|
|
172
|
+
* min={0}
|
|
173
|
+
* max={1000}
|
|
174
|
+
* suffix=" RPM"
|
|
175
|
+
* />
|
|
176
|
+
*
|
|
177
|
+
* <Button
|
|
178
|
+
* label="Set Speed"
|
|
179
|
+
* onClick={handleSpeedChange}
|
|
180
|
+
* disabled={!connected}
|
|
181
|
+
* />
|
|
182
|
+
*
|
|
183
|
+
* <Button
|
|
184
|
+
* label="Emergency Stop"
|
|
185
|
+
* onClick={handleEmergencyStop}
|
|
186
|
+
* severity="danger"
|
|
187
|
+
* disabled={!connected}
|
|
188
|
+
* />
|
|
189
|
+
* </div>
|
|
190
|
+
* </div>
|
|
191
|
+
* );
|
|
192
|
+
* };
|
|
193
|
+
* ```
|
|
194
|
+
*
|
|
195
|
+
* ### 4. Advanced Pattern: State Management Hook
|
|
196
|
+
*
|
|
197
|
+
* Create reusable hooks for common patterns:
|
|
198
|
+
*
|
|
199
|
+
* ```tsx
|
|
200
|
+
* // hooks/useRealtimeValue.ts
|
|
201
|
+
* import { useContext, useEffect, useState } from 'react';
|
|
202
|
+
* import { EventEmitterContext } from '@adcops/autocore-react/core/EventEmitterContext';
|
|
203
|
+
*
|
|
204
|
+
* export function useRealtimeValue<T>(topic: string, initialValue?: T) {
|
|
205
|
+
* const { subscribe, unsubscribe } = useContext(EventEmitterContext);
|
|
206
|
+
* const [value, setValue] = useState<T | undefined>(initialValue);
|
|
207
|
+
* const [lastUpdate, setLastUpdate] = useState<Date | null>(null);
|
|
208
|
+
*
|
|
209
|
+
* useEffect(() => {
|
|
210
|
+
* const subscriptionId = subscribe(topic, (data) => {
|
|
211
|
+
* setValue(data.value);
|
|
212
|
+
* setLastUpdate(new Date());
|
|
213
|
+
* });
|
|
214
|
+
*
|
|
215
|
+
* return () => unsubscribe(subscriptionId);
|
|
216
|
+
* }, [topic, subscribe, unsubscribe]);
|
|
217
|
+
*
|
|
218
|
+
* return { value, lastUpdate };
|
|
219
|
+
* }
|
|
220
|
+
*
|
|
221
|
+
* // Usage in component
|
|
222
|
+
* export const SensorDisplay: React.FC = () => {
|
|
223
|
+
* const { value: temperature } = useRealtimeValue<number>('ADS/sensors.temperature');
|
|
224
|
+
* const { value: pressure } = useRealtimeValue<number>('ADS/sensors.pressure');
|
|
225
|
+
*
|
|
226
|
+
* return (
|
|
227
|
+
* <div>
|
|
228
|
+
* <p>Temperature: {temperature?.toFixed(1)}°C</p>
|
|
229
|
+
* <p>Pressure: {pressure?.toFixed(2)} bar</p>
|
|
230
|
+
* </div>
|
|
231
|
+
* );
|
|
232
|
+
* };
|
|
233
|
+
* ```
|
|
234
|
+
*
|
|
235
|
+
* ## Integration with AutoCore Systems
|
|
236
|
+
*
|
|
237
|
+
* The EventEmitterContext is designed to work seamlessly with other AutoCore React components:
|
|
238
|
+
*
|
|
239
|
+
* ```tsx
|
|
240
|
+
* // Complete AutoCore application setup
|
|
241
|
+
* import React from 'react';
|
|
242
|
+
* import { EventEmitterProvider } from '@adcops/autocore-react/core/EventEmitterContext';
|
|
243
|
+
* import { AutoCoreTagProvider } from '@adcops/autocore-react/core/AutoCoreTagContext';
|
|
244
|
+
* import { PrimeReactProvider } from 'primereact/api';
|
|
245
|
+
* import { tagSpec } from './config/tags';
|
|
246
|
+
* import { MainInterface } from './components/MainInterface';
|
|
247
|
+
*
|
|
248
|
+
* export default function App() {
|
|
249
|
+
* return (
|
|
250
|
+
* <EventEmitterProvider>
|
|
251
|
+
* <AutoCoreTagProvider tags={tagSpec} eagerRead>
|
|
252
|
+
* <PrimeReactProvider>
|
|
253
|
+
* <MainInterface />
|
|
254
|
+
* </PrimeReactProvider>
|
|
255
|
+
* </AutoCoreTagProvider>
|
|
256
|
+
* </EventEmitterProvider>
|
|
257
|
+
* );
|
|
258
|
+
* }
|
|
259
|
+
* ```
|
|
260
|
+
*
|
|
261
|
+
* ## Best Practices
|
|
262
|
+
*
|
|
263
|
+
* 1. **Always Cleanup Subscriptions**: Use the cleanup function returned by useEffect
|
|
264
|
+
* 2. **Use Meaningful Topic Names**: Follow a hierarchical naming convention (e.g., 'domain/category/specific')
|
|
265
|
+
* 3. **Handle Connection States**: Always check connection status before invoking backend functions
|
|
266
|
+
* 4. **Error Handling**: Wrap invoke calls in try-catch blocks
|
|
267
|
+
* 5. **Type Safety**: Use TypeScript interfaces for payload structures
|
|
268
|
+
* 6. **Performance**: Avoid subscribing to high-frequency events in render-heavy components
|
|
269
|
+
*
|
|
270
|
+
* ## Debugging
|
|
271
|
+
*
|
|
272
|
+
* Use the built-in debugging features:
|
|
273
|
+
*
|
|
274
|
+
* ```tsx
|
|
275
|
+
* const { getSubscriptions, state } = useContext(EventEmitterContext);
|
|
276
|
+
*
|
|
277
|
+
* // View all subscriptions
|
|
278
|
+
* console.log('All subscriptions:', getSubscriptions());
|
|
279
|
+
*
|
|
280
|
+
* // View subscriptions for specific topic
|
|
281
|
+
* console.log('Motor subscriptions:', getSubscriptions('ADS/MAIN.motor.speed'));
|
|
282
|
+
*
|
|
283
|
+
* // View current state
|
|
284
|
+
* console.log('EventEmitter state:', state);
|
|
285
|
+
* ```
|
|
286
|
+
*
|
|
287
|
+
* @module core/EventEmitterContext
|
|
288
|
+
* @version 3.0.41
|
|
289
|
+
* @author Automated Design Corp.
|
|
290
|
+
* @since 1.0.0
|
|
291
|
+
*/
|
|
292
|
+
import React from "react";
|
|
293
|
+
import type { ReactNode } from "react";
|
|
2
294
|
import { Hub } from "../hub";
|
|
3
|
-
import { CommandMessageResult } from "../hub/CommandMessage";
|
|
295
|
+
import type { CommandMessageResult } from "../hub/CommandMessage";
|
|
4
296
|
export { Hub };
|
|
5
297
|
/**
|
|
6
298
|
* Represents an event subsription.
|
|
@@ -267,3 +559,4 @@ export declare const EventEmitterContext: React.Context<EventEmitterContextType>
|
|
|
267
559
|
export declare const EventEmitterProvider: React.FC<{
|
|
268
560
|
children: ReactNode;
|
|
269
561
|
}>;
|
|
562
|
+
//# sourceMappingURL=EventEmitterContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventEmitterContext.d.ts","sourceRoot":"","sources":["../../src/core/EventEmitterContext.tsx"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkSG;AAEH,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,EAAa,GAAG,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAE,GAAG,EAAE,CAAC;AAEf;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,sDAAsD;IACtD,EAAE,EAAE,MAAM,CAAC;IACX,yBAAyB;IACzB,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;CAC/B;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,GAAG,CAAC;IAChB,kFAAkF;IAClF,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAAC;IAE9C,6DAA6D;IAC7D,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;GAIG;AACH,MAAM,WAAW,MAAM;IACrB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;AAElE;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC;;OAEG;IACH,KAAK,EAAE,KAAK,CAAC;IAEb;;;;;OAKG;IACH,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAEnC;;;OAGG;IACH,MAAM,CACJ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC;;;;;OAKG;IACH,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC;IAEpE;;;;OAIG;IACH,WAAW,EAAE,CAAC,cAAc,EAAE,MAAM,KAAK,IAAI,CAAC;IAE9C;;;OAGG;IACH,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;IAEhB;;;;OAIG;IACH,gBAAgB,EAAE,CAChB,KAAK,CAAC,EAAE,MAAM,KACX,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,YAAY,EAAE,CAAC;IAErD;;;OAGG;IACH,WAAW,EAAE,MAAM,OAAO,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyHG;AACH,eAAO,MAAM,mBAAmB,wCA6B9B,CAAC;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CAsIlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{createContext,useState,useMemo,useCallback}from"react";import{createHub,Hub}from"../hub";export{Hub};
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import React,{createContext,useState,useMemo,useCallback,useRef,useEffect}from"react";import{createHub,Hub}from"../hub";export{Hub};export const EventEmitterContext=createContext({state:{subscriptions:{},nextSubscriptionId:1},dispatch:()=>{},subscribe:()=>0,invoke:async(e,t,r)=>Promise.resolve({data:{},success:!1,error_message:""}),unsubscribe:e=>{},hub:null,getSubscriptions:()=>[],isConnected:()=>!1});export const EventEmitterProvider=({children:e})=>{const[t,r]=useState({subscriptions:{},nextSubscriptionId:1}),s=useMemo(()=>createHub(),[]),c=useRef(1),n=useRef({});useEffect(()=>{r(e=>({...e,subscriptions:{...n.current},nextSubscriptionId:c.current}))},[]);const o=useCallback(e=>{const{topic:t,payload:s}=e,c=n.current[t]?.slice()??[];for(const e of c)try{e.callback(s)}catch(e){}r(e=>({...e,eventData:s}))},[]),u=useCallback((e,t)=>{const s=c.current++,o={id:s,callback:t},u=[...n.current[e]??[],o];return n.current={...n.current,[e]:u},r(e=>({...e,subscriptions:{...n.current},nextSubscriptionId:c.current})),s},[]),i=useCallback(e=>{const t={};for(const[r,s]of Object.entries(n.current)){const c=s.filter(t=>t.id!==e);c.length>0&&(t[r]=c)}n.current=t,r(e=>({...e,subscriptions:{...t}}))},[]);useEffect(()=>()=>{n.current={},c.current=1},[]),import.meta&&import.meta.hot&&import.meta.hot.dispose(()=>{n.current={},c.current=1});const a=useMemo(()=>({state:t,dispatch:o,subscribe:u,unsubscribe:i,invoke:s.invoke,hub:s,getSubscriptions:e=>e?n.current[e]??[]:n.current,isConnected:s.isConnected}),[t,s,o,u,i]);return s.setContext(a),_jsx(EventEmitterContext.Provider,{value:a,children:e})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorButtonState.d.ts","sourceRoot":"","sources":["../../src/core/IndicatorButtonState.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACjC;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;IAEzC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;OAEG;IACH,SAAS,EAAG,OAAO,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IndicatorColor.d.ts","sourceRoot":"","sources":["../../src/core/IndicatorColor.ts"],"names":[],"mappings":"AAUA;;;GAGG;AACH,oBAAY,cAAc;IACtB,8CAA8C;IAC9C,cAAc,UAAU;IACxB,+EAA+E;IAC/E,WAAW,UAAiB;IAC5B,kCAAkC;IAClC,YAAY,SAAS;IACrB,uDAAuD;IACvD,YAAY,QAAQ;IACpB,8DAA8D;IAC9D,eAAe,WAAW;IAC1B,sDAAsD;IACtD,cAAc,QAAgB;IAC9B,yDAAyD;IACzD,gBAAgB,WAAkB;IAClC,wFAAwF;IACxF,gBAAgB,UAAU;IAC1B,4DAA4D;IAC5D,mBAAmB,SAAS;IAC5B,+DAA+D;IAC/D,aAAa,SAAS;CACzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MaskPatterns.d.ts","sourceRoot":"","sources":["../../src/core/MaskPatterns.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,eAAO,MAAM,iBAAiB;IAC1B;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAEH;;;;OAIG;;IAIH;;OAEG;;CAEG,CAAC;AAIX;;GAEG;AACH,eAAO,MAAM,sBAAsB;IAC/B,iCAAiC;;IAEjC,+CAA+C;;IAE/C,yDAAyD;;IAEzD,yDAAyD;;IAEzD,yDAAyD;;IAEzD,yDAAyD;;IAEzD,yDAAyD;;IAEzD,yDAAyD;;IAEzD,yDAAyD;;IAEzD,yDAAyD;;IAEzD,yDAAyD;;IAEzD,yDAAyD;;CAGnD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumerableTypes.d.ts","sourceRoot":"","sources":["../../src/core/NumerableTypes.ts"],"names":[],"mappings":"AAUA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;;GAIG;AACH,KAAK,wBAAwB,CAAC,CAAC,IAAI,CAAC,SAAS;IAC3C,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9B,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9B,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;CAC/B,GACG,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GAC/D,CAAC,SAAS;IACR,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;IAC9B,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;CAC/B,GACD,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GAC1C,CAAC,SAAS;IACR,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAAC;CAC/B,GACD,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,GACrB,GAAG,CAAC;AAER;;;;GAIG;AACH,KAAK,oBAAoB,CAAC,CAAC,IAAI,wBAAwB,CAAC,CAAC,CAAC,SAAS,MAAM,CAAC,GAEtE;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC;CAAE,GACpE,KAAK,CAAC;AAEV;;;GAGG;AACH,KAAK,qBAAqB,GAAG,oBAAoB,CAAC,OAAO,MAAM,CAAC,CAAC;AAGjE;;;;GAIG;AACH,KAAK,4BAA4B,GAAG,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAEhE;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC,4BAA4B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import{format}from"numerable";
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/**
|
|
3
2
|
* Interface representing the position and scale context of a component within its parent container.
|
|
4
3
|
*
|
|
@@ -36,3 +35,4 @@ export interface IPositionContext {
|
|
|
36
35
|
*/
|
|
37
36
|
export declare const DimensionsContext: import("react").Context<IPositionContext>;
|
|
38
37
|
export default DimensionsContext;
|
|
38
|
+
//# sourceMappingURL=PositionContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PositionContext.d.ts","sourceRoot":"","sources":["../../src/core/PositionContext.ts"],"names":[],"mappings":"AAeA;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAE/B;;;;OAIG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,2CAI5B,CAAC;AAEH,eAAe,iBAAiB,CAAC"}
|
package/dist/core/UniqueId.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UniqueId.d.ts","sourceRoot":"","sources":["../../src/core/UniqueId.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,IAAK,MAAM,CAElC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EmitterDispatchFunction } from "./EventEmitterContext";
|
|
1
|
+
import type { EmitterDispatchFunction } from "./EventEmitterContext";
|
|
2
2
|
/**
|
|
3
3
|
* Generates values for simulating data into an HMI.
|
|
4
4
|
* Used for demonstration and development testing.
|
|
@@ -69,3 +69,4 @@ export declare class ValueSimulator {
|
|
|
69
69
|
protected updateTopic(topic: string, value: any): void;
|
|
70
70
|
}
|
|
71
71
|
export default ValueSimulator;
|
|
72
|
+
//# sourceMappingURL=ValueSimulator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValueSimulator.d.ts","sourceRoot":"","sources":["../../src/core/ValueSimulator.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAGrE;;;GAGG;AACH,qBAAa,cAAc;IAEvB,SAAS,CAAC,KAAK,EAAE,OAAO,CAAS;IACjC,SAAS,CAAC,KAAK,EAAE,OAAO,CAAQ;IAEhC,SAAS,CAAC,MAAM,EAAE,MAAM,CAAK;IAC7B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAK;IAC7B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAK;IAC7B,SAAS,CAAC,MAAM,EAAE,MAAM,CAAK;IAE7B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAK;IAC5B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAK;IAC5B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAK;IAC5B,SAAS,CAAC,KAAK,EAAE,MAAM,CAAK;IAE5B,SAAS,CAAC,iBAAiB,EAAG,OAAO,CAAQ;IAC7C,SAAS,CAAC,iBAAiB,EAAG,OAAO,CAAQ;IAC7C,SAAS,CAAC,iBAAiB,EAAG,OAAO,CAAQ;IAC7C,SAAS,CAAC,iBAAiB,EAAG,OAAO,CAAQ;IAE7C,SAAS,CAAC,UAAU,EAAG,MAAM,CAA+B;IAC5D,SAAS,CAAC,UAAU,EAAG,MAAM,CAA+B;IAC5D,SAAS,CAAC,UAAU,EAAG,MAAM,CAAsC;IACnE,SAAS,CAAC,UAAU,EAAG,MAAM,CAAsC;IAEnE,SAAS,CAAC,UAAU,EAAE,MAAM,CAAK;IAEjC,SAAS,CAAC,QAAQ,EAAE,uBAAuB,CAAC;IAE5C;;;OAGG;gBACS,QAAQ,EAAE,uBAAuB;IAI7C;;OAEG;IACH,KAAK;IAWL;;OAEG;IACH,IAAI;IAQJ;;OAEG;IACH,SAAS,CAAC,MAAM;IA+BhB;;;;;;OAMG;IACH,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAYzF;;;;;;;;;;;;OAYG;IACH,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC;IAOnG;;OAEG;IACH,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;CAQlD;AAED,eAAe,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export class ValueSimulator{constructor(i){Object.defineProperty(this,"bBit1",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"bBit2",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"iRamp1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iRamp2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"fRamp1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"fRamp2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iSin1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iSin2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"fSin1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"fSin2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iRamp1DirectionUp",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"iRamp2DirectionUp",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"fRamp1DirectionUp",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"fRamp2DirectionUp",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"iSin1Angle",{enumerable:!0,configurable:!0,writable:!0,value:Math.random()*Math.PI*2}),Object.defineProperty(this,"iSin2Angle",{enumerable:!0,configurable:!0,writable:!0,value:Math.random()*Math.PI*2}),Object.defineProperty(this,"fSin1Angle",{enumerable:!0,configurable:!0,writable:!0,value:Math.random()*Math.PI*2/10}),Object.defineProperty(this,"fSin2Angle",{enumerable:!0,configurable:!0,writable:!0,value:Math.random()*Math.PI*2/10}),Object.defineProperty(this,"intervalId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"dispatch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dispatch=i}start(){0===this.intervalId&&(this.intervalId=setInterval((
|
|
1
|
+
export class ValueSimulator{constructor(i){Object.defineProperty(this,"bBit1",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"bBit2",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"iRamp1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iRamp2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"fRamp1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"fRamp2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iSin1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iSin2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"fSin1",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"fSin2",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"iRamp1DirectionUp",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"iRamp2DirectionUp",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"fRamp1DirectionUp",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"fRamp2DirectionUp",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"iSin1Angle",{enumerable:!0,configurable:!0,writable:!0,value:Math.random()*Math.PI*2}),Object.defineProperty(this,"iSin2Angle",{enumerable:!0,configurable:!0,writable:!0,value:Math.random()*Math.PI*2}),Object.defineProperty(this,"fSin1Angle",{enumerable:!0,configurable:!0,writable:!0,value:Math.random()*Math.PI*2/10}),Object.defineProperty(this,"fSin2Angle",{enumerable:!0,configurable:!0,writable:!0,value:Math.random()*Math.PI*2/10}),Object.defineProperty(this,"intervalId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"dispatch",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.dispatch=i}start(){0===this.intervalId&&(this.intervalId=setInterval(()=>this.update(),1e3))}stop(){0!==this.intervalId&&(clearInterval(this.intervalId),this.intervalId=0)}update(){this.bBit1=!this.bBit1,this.bBit2=!this.bBit2,[this.iRamp1,this.iRamp1DirectionUp]=this.updateRamp(this.iRamp1,this.iRamp1DirectionUp,32767),[this.iRamp2,this.iRamp2DirectionUp]=this.updateRamp(this.iRamp2,this.iRamp2DirectionUp,32767),[this.fRamp1,this.fRamp1DirectionUp]=this.updateRamp(this.fRamp1,this.fRamp1DirectionUp,3276.7),[this.fRamp2,this.fRamp2DirectionUp]=this.updateRamp(this.fRamp2,this.fRamp2DirectionUp,3276.7),[this.iSin1,this.iSin1Angle]=this.updateSin(this.iSin1,this.iSin1Angle,Math.PI/180,32767),[this.iSin2,this.iSin2Angle]=this.updateSin(this.iSin2,this.iSin2Angle,Math.PI/180,32767),[this.fSin1,this.fSin1Angle]=this.updateSin(this.fSin1,this.fSin1Angle,Math.PI/180,3276.7),[this.fSin2,this.fSin2Angle]=this.updateSin(this.fSin2,this.fSin2Angle,Math.PI/180,3276.7),this.updateTopic("value-simulator-bBit1",this.bBit1),this.updateTopic("value-simulator-bBit2",this.bBit2),this.updateTopic("value-simulator-iRamp1",this.iRamp1),this.updateTopic("value-simulator-iRamp2",this.iRamp2),this.updateTopic("value-simulator-fRamp1",this.fRamp1),this.updateTopic("value-simulator-fRamp2",this.fRamp2),this.updateTopic("value-simulator-iSin1",this.iSin1),this.updateTopic("value-simulator-iSin2",this.iSin2),this.updateTopic("value-simulator-fSin1",this.fSin1),this.updateTopic("value-simulator-fSin2",this.fSin2)}updateRamp(i,e,t){if(e){if(++i>=t)return[i,!1]}else if(--i<=0)return[i,!0];return[i,e]}updateSin(i,e,t,a){return e+=t,[Math.sin(e)*a,e]}updateTopic(i,e){this.dispatch({topic:i,payload:e})}}export default ValueSimulator;
|
package/dist/core/hoc.d.ts
CHANGED
|
@@ -29,3 +29,4 @@ export type HocAddSubscriptionProps = {
|
|
|
29
29
|
* @returns A component that subscribes to the given topic and updates its specified prop with the received data.
|
|
30
30
|
*/
|
|
31
31
|
export declare function hocAddSubscription<P extends HocAddSubscriptionProps>(WrappedComponent: React.ComponentType<P>, topic: string, propName: keyof P): (props: Omit<P, keyof HocAddSubscriptionProps>) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
//# sourceMappingURL=hoc.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hoc.d.ts","sourceRoot":"","sources":["../../src/core/hoc.tsx"],"names":[],"mappings":"AASA;;;;;;;;;;;GAWG;AAGH,OAAO,KAA0C,MAAM,OAAO,CAAC;AAG/D;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG;IAClC,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,mGAAmG;IACnG,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAGF;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,uBAAuB,EAChE,gBAAgB,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EACxC,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,MAAM,CAAC,IAED,OAAO,IAAI,CAAC,CAAC,EAAE,MAAM,uBAAuB,CAAC,6CAchE"}
|
package/dist/core/hoc.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{useState,useEffect,useContext}from"react";import{EventEmitterContext}from"./EventEmitterContext";export function hocAddSubscription(t,e,r){return function(n){const[o,s]=useState(),{subscribe:u,unsubscribe:
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import React,{useState,useEffect,useContext}from"react";import{EventEmitterContext}from"./EventEmitterContext";export function hocAddSubscription(t,e,r){return function(n){const[o,s]=useState(),{subscribe:u,unsubscribe:c}=useContext(EventEmitterContext);useEffect(()=>{const t=u(e,s);return()=>c(t)},[e,u,c]);return _jsx(t,{...n,...{[r]:o}})}}
|
package/dist/hooks/adsHooks.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adsHooks.d.ts","sourceRoot":"","sources":["../../src/hooks/adsHooks.tsx"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,qBAAqB,GAC9B,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,EAC7C,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAS,MAAM,CAAC,MAAM,EAAE,EAAE,CAAM,SAuDnC,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,IAMjC,OAAO,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,mBAO1D;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,WAKnD,MAAM,mBAa1C;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CActE"}
|
package/dist/hooks/adsHooks.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext,useRef,useEffect,useCallback}from"react";import{EventEmitterContext}from"../core/EventEmitterContext";function sleep(e){return new Promise(
|
|
1
|
+
import{useContext,useRef,useEffect,useCallback}from"react";import{EventEmitterContext}from"../core/EventEmitterContext";function sleep(e){return new Promise(t=>setTimeout(t,e))}export const useAdsRegisterSymbols=(e,t,n={})=>{const{invoke:r,subscribe:s,unsubscribe:o,isConnected:u}=useContext(EventEmitterContext),c=useRef([]),a=useRef(!0);return useEffect(()=>{a.current=!0;const i=async()=>{for(const[o,u]of Object.entries(t))try{const t=n[o]?{symbol_name:u,options:n[o]}:{symbol_name:u};await r("ADS","register_symbol",t);const i=s(`ADS/${u}`,t=>{if(a.current){const n=e[o];n&&n(t.value)}});c.current.push(i)}catch(e){}await r("ADS","refresh",{})};if(u())i();else{let e=s("HUB/connected",()=>{i(),o(e)});c.current.push(e)}return()=>{a.current=!1,c.current.forEach(e=>o(e)),c.current=[]}},[]),null};export function useAdsWriteValue(e){const{invoke:t}=useContext(EventEmitterContext);return async n=>{try{await t("ADS","write_value",{symbol_name:e,value:n})}catch(e){}}}export function useAdsWriteScaledValue(e,t,n){const{invoke:r}=useContext(EventEmitterContext);return useCallback(async s=>{const o=(s-n)/t;try{await r("ADS","write_value",{symbol_name:e,value:o})}catch(e){}},[e,t,n,r])}export function useAdsTapValue(e){const{invoke:t}=useContext(EventEmitterContext),n="write_value";return async()=>{try{await t("ADS",n,{symbol_name:e,value:!0}),await sleep(300),await t("ADS",n,{symbol_name:e,value:!1})}catch(e){}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commandHooks.d.ts","sourceRoot":"","sources":["../../src/hooks/commandHooks.tsx"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,eAAO,MAAM,kBAAkB,GAC3B,QAAS,MAAM,EACf,SAAS,MAAM,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC,EAC7C,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,UAAS,MAAM,CAAC,MAAM,EAAE,EAAE,CAAM,SAiEnC,CAAC;AAGF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAG,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,GAAG,MAAsB,IAI/E,OAAO,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,mBAO1D;AAOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAG,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,GAAG,MAAsB,WAGjG,MAAM,mBAa1C;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAG,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,GAAG,MAAsB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAYpH"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext,useRef,useEffect,useCallback}from"react";import{EventEmitterContext}from"../core/EventEmitterContext";function sleep(e){return new Promise(
|
|
1
|
+
import{useContext,useRef,useEffect,useCallback}from"react";import{EventEmitterContext}from"../core/EventEmitterContext";function sleep(e){return new Promise(t=>setTimeout(t,e))}export const useRegisterSymbols=(e,t,n,r={})=>{const{subscribe:o,unsubscribe:u,isConnected:s,invoke:c}=useContext(EventEmitterContext),a=useRef([]),i=useRef(!0);return useEffect(()=>{i.current=!0;const r=async()=>{for(const[r,u]of Object.entries(n))try{const n=o(`${e}/${u}`,e=>{if(i.current){const n=t[r];n&&n(e.value)}});a.current.push(n),await c(e,"refresh",{topic:`${u}`})}catch(e){}};if(s())r();else{let e=o("HUB/connected",()=>{setTimeout(()=>{r(),u(e)},500)});a.current.push(e)}return()=>{i.current=!1,a.current.forEach(e=>u(e)),a.current=[]}},[]),null};export function useWriteValue(e,t,n="write_value"){const{invoke:r}=useContext(EventEmitterContext);return async o=>{try{await r(e,n,{topic:t,value:o})}catch(e){}}}export function useWriteScaledValue(e,t,n,r,o="write_value"){const{invoke:u}=useContext(EventEmitterContext);return useCallback(async s=>{const c=(s-r)/n;try{await u(e,o,{symbol_name:t,value:c})}catch(e){}},[t,n,r,u])}export function useTapValue(e,t,n="write_value"){const{invoke:r}=useContext(EventEmitterContext);return async()=>{try{await r(e,n,{symbol_name:t,value:!0}),await sleep(300),await r(e,n,{symbol_name:t,value:!1})}catch(e){}}}
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAUA,OAAO,EAAC,qBAAqB,EAAE,gBAAgB,EAAE,cAAc,EAAC,MAAM,YAAY,CAAC;AACnF,OAAO,EAAC,cAAc,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BaseContextValue, TagConfig, TagValueMap } from "../core/AutoCoreTagTypes";
|
|
2
|
+
export declare function makeAutoCoreTagHooks<Spec extends readonly TagConfig[]>(Context: React.Context<BaseContextValue<TagValueMap<Spec>>>, tags: Spec): {
|
|
3
|
+
readonly useAutoCoreTag: <K extends Spec[number]["tagName"]>(tagName: K) => {
|
|
4
|
+
readonly value: TagValueMap<Spec>[K];
|
|
5
|
+
readonly rawValue: unknown;
|
|
6
|
+
readonly write: (displayValue: TagValueMap<Spec>[K]) => Promise<void>;
|
|
7
|
+
readonly tap: () => Promise<void>;
|
|
8
|
+
readonly isLoading: boolean;
|
|
9
|
+
};
|
|
10
|
+
readonly useAutoCoreTags: <K extends Spec[number]["tagName"]>(tagNames: readonly K[]) => {
|
|
11
|
+
readonly values: { [P in K]: TagValueMap<Spec>[P]; };
|
|
12
|
+
readonly rawValues: { [P_1 in K]: unknown; };
|
|
13
|
+
readonly write: (tagName: K, value: TagValueMap<Spec>[K]) => Promise<void>;
|
|
14
|
+
readonly isLoading: boolean;
|
|
15
|
+
};
|
|
16
|
+
readonly useAutoCoreSelect: <R>(selector: (all: Readonly<Partial<TagValueMap<Spec>>>) => R, deps?: any[]) => {
|
|
17
|
+
readonly selected: R;
|
|
18
|
+
readonly isLoading: boolean;
|
|
19
|
+
};
|
|
20
|
+
readonly useScales: () => {
|
|
21
|
+
readonly scales: Record<string, import("../core/AutoCoreTagTypes").ScaleConfig>;
|
|
22
|
+
readonly updateScale: (scaleName: string, newScale: number, newLabel: string) => Promise<void>;
|
|
23
|
+
readonly getScale: (scaleName: string) => import("../core/AutoCoreTagTypes").ScaleConfig;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=useAutoCoreTag.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useAutoCoreTag.d.ts","sourceRoot":"","sources":["../../src/hooks/useAutoCoreTag.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAEzF,wBAAgB,oBAAoB,CAAC,IAAI,SAAS,SAAS,SAAS,EAAE,EACpE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAC3D,IAAI,EAAE,IAAI;8BAYc,CAAC,2CAA4B,CAAC;;;;;;;+BAyB7B,CAAC,4CAA6B,SAAS,CAAC,EAAE;4BAOrD,CAAC;;kCAY6B,CAAC;;;iCAUlB,CAAC,YAAY,CAAC,GAAG,EAAE,QAAQ,CAAC,OAAO,mBAAM,CAAC,KAAK,CAAC,SAAQ,GAAG,EAAE;;;;;;;uCAW7C,MAAM;;EAKlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{useCallback,useContext,useMemo}from"react";export function makeAutoCoreTagHooks(e,a){return{useAutoCoreTag:t=>{const{values:s,rawValues:u,isLoading:o,write:r,tap:n}=useContext(e),l=(e=>a.find(a=>a.tagName===e))(t);if(!l)throw new Error(`useAutoCoreTag: unknown tagName '${String(t)}'`);const i=useCallback(e=>r(t,e),[r,t]),c=useCallback(()=>n?.(t),[n,t]);return{value:s[t],rawValue:u[t],write:i,tap:c,isLoading:o}},useAutoCoreTags:a=>{const{values:t,rawValues:s,isLoading:u,write:o}=useContext(e);return{values:useMemo(()=>Object.fromEntries(a.map(e=>[e,t[e]])),[t,a]),rawValues:useMemo(()=>Object.fromEntries(a.map(e=>[e,s[e]])),[s,a]),write:useCallback(async(e,a)=>{await o(e,a)},[o]),isLoading:u}},useAutoCoreSelect:(a,t=[])=>{const{values:s,isLoading:u}=useContext(e);return{selected:useMemo(()=>a(s),[s,...t]),isLoading:u}},useScales:()=>{const{scales:a,updateScale:t}=useContext(e),s=useCallback(e=>a[e],[a]);return{scales:a,updateScale:t,getScale:s}}}}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScaledValue.d.ts","sourceRoot":"","sources":["../../src/hooks/useScaledValue.tsx"],"names":[],"mappings":"AAaA;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAiB,CAAC;AAEpD;;GAEG;AACH,eAAO,MAAM,eAAe,EAAG,MAAyB,CAAC;AAGzD,KAAK,oBAAoB,GAAG,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,GAAE,MAAU,GAAG,oBAAoB,CAoB5G"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useCallback,useState,useEffect}from"react";export const kMillimeters2Inches=1/25.4;export const kNewtons2Pounds=1/4.4482216153;export function useScaledValue(e,t,s=0){const[u,c]=useState(e),[o,a]=useState((
|
|
1
|
+
import{useCallback,useState,useEffect}from"react";export const kMillimeters2Inches=1/25.4;export const kNewtons2Pounds=1/4.4482216153;export function useScaledValue(e,t,s=0){const[u,c]=useState(e),[o,a]=useState(()=>e*t+s);useEffect(()=>{a(u*t+s)},[u,t,s]);return[o,useCallback(e=>{c(e)},[t,s])]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CommandMessage.d.ts","sourceRoot":"","sources":["../../src/hub/CommandMessage.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,oBAAoB;IAEjC,IAAI,EAAE,GAAG,CAAC;IAEV,OAAO,EAAG,OAAO,CAAC;IAElB,aAAa,EAAE,MAAM,CAAC;CACzB;AAID,MAAM,WAAW,cAAc;IAG3B,UAAU,EAAE,MAAM,CAAC;IAEnB,MAAM,EAAE,MAAM,CAAC;IAEf,KAAK,EAAE,MAAM,CAAC;IAEd,IAAI,CAAC,EAAE,GAAG,CAAC;IAEX,MAAM,CAAC,EAAE,oBAAoB,CAAC;CACjC"}
|
package/dist/hub/HubBase.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EventEmitterContextType } from '../core/EventEmitterContext';
|
|
2
|
-
import { CommandMessageResult } from "./CommandMessage";
|
|
1
|
+
import type { EventEmitterContextType } from '../core/EventEmitterContext';
|
|
2
|
+
import type { CommandMessageResult } from "./CommandMessage";
|
|
3
3
|
/**
|
|
4
4
|
* Base class for the interface for the IPC to the backend,
|
|
5
5
|
* which may be websockets, MQTT, the Tauri API,
|
|
@@ -179,3 +179,4 @@ export declare abstract class HubBase {
|
|
|
179
179
|
toLocalFName(backendTopic: string): string;
|
|
180
180
|
}
|
|
181
181
|
export default HubBase;
|
|
182
|
+
//# sourceMappingURL=HubBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HubBase.d.ts","sourceRoot":"","sources":["../../src/hub/HubBase.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,uBAAuB,EAAC,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAG3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AACH,8BAAsB,OAAO;IAEzB,SAAS,CAAC,2BAA2B,EAAG,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,CAA4B;IACtF,SAAS,CAAC,sBAAsB,EAAG,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,CAA4B;IACjF,SAAS,CAAC,2BAA2B,EAAG,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,CAA4B;IACtF,SAAS,CAAC,2BAA2B,EAAG,GAAG,CAAC,MAAM,EAAC,MAAM,CAAC,CAA4B;IAEtF,SAAS,CAAC,OAAO,EAAG,uBAAuB,GAAG,IAAI,CAAQ;IAE1D,SAAS,CAAC,YAAY,EAAG,OAAO,CAAS;IAGzC;;OAEG;;IAKH;;;;;;;;;;OAUG;IACH,UAAU,CAAC,OAAO,EAAG,uBAAuB,GAAG,IAAI;IAInD;;;OAGG;IACH,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAG,MAAM,GAAI,OAAO,CAAC,oBAAoB,CAAC;IAGjG;;;OAGG;IACH,SAAS,CAAC,cAAc,GAAI,GAAI,OAAO,UAEtC;IAED;;OAEG;IACH,WAAW,QAAQ,OAAO,CAEzB;IAED;;;;;;;;OAQG;IACH,WAAW,CAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAG,MAAM,EAAE,KAAK,EAAG,MAAM,GAAG,IAAI,EAAE,KAAK,CAAC,EAAG,GAAG,GAAK,OAAO,CAAC,oBAAoB,CAAC;IAQlH;;;;OAIG;IACH,OAAO,CAAC,KAAK,EAAG,MAAM,EAAE,IAAI,EAAG,GAAG,GAAG,SAAS,GAAI,IAAI;IAWtD;;;;OAIG;IACH,QAAQ,CAAC,UAAU,EAAG,MAAM,EAAE,YAAY,EAAE,MAAM,GAAK,IAAI;IAK3D;;;OAGG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,GAAI,IAAI;IAYrC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAG,MAAM,EAAE,YAAY,EAAE,MAAM,GAAK,IAAI;IAK3D;;;OAGG;IACH,UAAU,CAAC,UAAU,EAAE,MAAM,GAAI,IAAI;IAYrC;;;;;OAKG;IACH,cAAc,CAAC,UAAU,EAAG,MAAM,GAAI,MAAM;IAa5C;;;;;OAKG;IACH,cAAc,CAAC,UAAU,EAAG,MAAM,GAAI,MAAM;IAc5C;;;;;OAKG;IACH,YAAY,CAAC,YAAY,EAAG,MAAM,GAAI,MAAM;IAc5C;;;;;OAKG;IACH,YAAY,CAAC,YAAY,EAAG,MAAM,GAAI,MAAM;CAc/C;AAGD,eAAe,OAAO,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HubBase } from './HubBase';
|
|
2
|
-
import { CommandMessageResult } from "./CommandMessage";
|
|
2
|
+
import type { CommandMessageResult } from "./CommandMessage";
|
|
3
3
|
/**
|
|
4
4
|
* Hub for simulating functionality when no backend is present.
|
|
5
5
|
*/
|
|
@@ -19,3 +19,4 @@ export declare class HubSimulate extends HubBase {
|
|
|
19
19
|
invoke(domain: string, fname: string, payload?: object, timeout?: number): Promise<CommandMessageResult>;
|
|
20
20
|
}
|
|
21
21
|
export default HubSimulate;
|
|
22
|
+
//# sourceMappingURL=HubSimulate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HubSimulate.d.ts","sourceRoot":"","sources":["../../src/hub/HubSimulate.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAC7D;;GAEG;AACH,qBAAa,WAAY,SAAQ,OAAO;IAEpC;;OAEG;;IAKH;;;;;;;OAOG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,GAAE,MAAW,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAmB/G;AAED,eAAe,WAAW,CAAC"}
|
package/dist/hub/HubSimulate.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{HubBase}from"./HubBase";export class HubSimulate extends HubBase{constructor(){super()}invoke(e,s,r,t=20){return new Promise((
|
|
1
|
+
import{HubBase}from"./HubBase";export class HubSimulate extends HubBase{constructor(){super()}invoke(e,s,r,t=20){return new Promise((e,s)=>{setTimeout(()=>{e({data:r,error_message:"",success:!0})},t)})}}export default HubSimulate;
|
package/dist/hub/HubTauri.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HubBase } from './HubBase';
|
|
2
|
-
import { CommandMessageResult } from "./CommandMessage";
|
|
2
|
+
import type { CommandMessageResult } from "./CommandMessage";
|
|
3
3
|
/**
|
|
4
4
|
* Hub for integrating with the Tauri backend.
|
|
5
5
|
*
|
|
@@ -85,3 +85,4 @@ export declare class HubTauri extends HubBase {
|
|
|
85
85
|
*/
|
|
86
86
|
invoke(domain: string, fname: string, payload?: object | undefined): Promise<CommandMessageResult>;
|
|
87
87
|
}
|
|
88
|
+
//# sourceMappingURL=HubTauri.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HubTauri.d.ts","sourceRoot":"","sources":["../../src/hub/HubTauri.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAC,oBAAoB,EAAC,MAAM,kBAAkB,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,qBAAa,QAAS,SAAQ,OAAO;IAEjC;;OAEG;;IAgCH;;;;;;OAMG;IACH,MAAM,CAAC,MAAM,EAAG,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAkBtG"}
|