@adcops/autocore-react 3.0.1 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/BlocklyLogo.d.ts +3 -0
- package/dist/assets/BlocklyLogo.js +1 -0
- package/dist/assets/Distance.d.ts +3 -0
- package/dist/assets/Distance.js +1 -0
- package/dist/assets/JogLong.d.ts +3 -0
- package/dist/assets/JogLong.js +1 -0
- package/dist/assets/JogMedium.d.ts +3 -0
- package/dist/assets/JogMedium.js +1 -0
- package/dist/assets/JogShort.d.ts +3 -0
- package/dist/assets/JogShort.js +1 -0
- package/dist/assets/PythonLogo.d.ts +3 -0
- package/dist/assets/PythonLogo.js +1 -0
- package/dist/assets/Rotation3D.d.ts +3 -0
- package/dist/assets/Rotation3D.js +1 -0
- package/dist/assets/RotationCcw.d.ts +3 -0
- package/dist/assets/RotationCcw.js +1 -0
- package/dist/assets/RotationCcwA.d.ts +3 -0
- package/dist/assets/RotationCcwA.js +1 -0
- package/dist/assets/RotationCcwB.d.ts +3 -0
- package/dist/assets/RotationCcwB.js +1 -0
- package/dist/assets/RotationCcwC.d.ts +3 -0
- package/dist/assets/RotationCcwC.js +1 -0
- package/dist/assets/RotationCw.d.ts +3 -0
- package/dist/assets/RotationCw.js +1 -0
- package/dist/assets/RotationCwA.d.ts +3 -0
- package/dist/assets/RotationCwA.js +1 -0
- package/dist/assets/RotationCwB.d.ts +3 -0
- package/dist/assets/RotationCwB.js +1 -0
- package/dist/assets/RotationCwC.d.ts +3 -0
- package/dist/assets/RotationCwC.js +1 -0
- package/dist/assets/Run.d.ts +3 -0
- package/dist/assets/Run.js +1 -0
- package/dist/assets/Speed.d.ts +3 -0
- package/dist/assets/Speed.js +1 -0
- package/dist/assets/SpeedFast.d.ts +3 -0
- package/dist/assets/SpeedFast.js +1 -0
- package/dist/assets/SpeedMedium.d.ts +3 -0
- package/dist/assets/SpeedMedium.js +1 -0
- package/dist/assets/SpeedNone.d.ts +3 -0
- package/dist/assets/SpeedNone.js +1 -0
- package/dist/assets/SpeedSlow.d.ts +3 -0
- package/dist/assets/SpeedSlow.js +1 -0
- package/dist/assets/Walk.d.ts +3 -0
- package/dist/assets/Walk.js +1 -0
- package/dist/assets/index.d.ts +22 -0
- package/dist/assets/index.js +1 -0
- package/dist/assets/svg/blockly_logo.svg +82 -0
- package/dist/assets/svg/distance.svg +40 -0
- package/dist/assets/svg/jog_long.svg +1 -0
- package/dist/assets/svg/jog_medium.svg +1 -0
- package/dist/assets/svg/jog_short.svg +1 -0
- package/dist/assets/svg/python_logo.svg +246 -0
- package/dist/assets/svg/rotation_3d.svg +1 -0
- package/dist/assets/svg/rotation_ccw.svg +50 -0
- package/dist/assets/svg/rotation_ccw_a.svg +57 -0
- package/dist/assets/svg/rotation_ccw_b.svg +57 -0
- package/dist/assets/svg/rotation_ccw_c.svg +57 -0
- package/dist/assets/svg/rotation_cw.svg +49 -0
- package/dist/assets/svg/rotation_cw_a.svg +30 -0
- package/dist/assets/svg/rotation_cw_b.svg +30 -0
- package/dist/assets/svg/rotation_cw_c.svg +30 -0
- package/dist/assets/svg/run.svg +1 -0
- package/dist/assets/svg/speed.svg +39 -0
- package/dist/assets/svg/speed_fast.svg +1 -0
- package/dist/assets/svg/speed_medium.svg +1 -0
- package/dist/assets/svg/speed_none.svg +1 -0
- package/dist/assets/svg/speed_slow.svg +1 -0
- package/dist/assets/svg/walk.svg +1 -0
- package/dist/components/BlocklyEditor.css +25 -0
- package/dist/components/BlocklyEditor.d.ts +120 -0
- package/dist/components/BlocklyEditor.js +1 -0
- package/dist/components/CodeEditor.d.ts +76 -0
- package/dist/components/CodeEditor.js +1 -0
- package/dist/components/Indicator.d.ts +12 -27
- package/dist/components/Indicator.js +1 -1
- package/dist/components/IndicatorButton.d.ts +56 -37
- package/dist/components/IndicatorButton.js +1 -1
- package/dist/components/JogPanel.css +41 -0
- package/dist/components/JogPanel.d.ts +118 -0
- package/dist/components/JogPanel.js +1 -0
- package/dist/components/Lamp.d.ts +81 -0
- package/dist/components/Lamp.js +1 -0
- package/dist/components/ToggleGroup.d.ts +103 -0
- package/dist/components/ToggleGroup.js +1 -0
- package/dist/components/ValueInput.d.ts +109 -0
- package/dist/components/ValueInput.js +1 -0
- package/dist/core/ActionMode.d.ts +9 -0
- package/dist/core/ActionMode.js +1 -0
- package/dist/core/IndicatorButtonState.d.ts +21 -0
- package/dist/core/IndicatorButtonState.js +1 -0
- package/dist/core/MaskPatterns.d.ts +4 -0
- package/dist/core/MaskPatterns.js +1 -1
- package/docs/assets/highlight.css +25 -18
- package/docs/assets/navigation.js +1 -1
- package/docs/assets/search.js +1 -1
- package/docs/classes/components_BlocklyEditor.BlocklyEditor.html +124 -0
- package/docs/classes/components_CodeEditor.CodeEditor.html +128 -0
- package/docs/classes/components_Indicator.Indicator.html +8 -8
- package/docs/classes/components_IndicatorButton.IndicatorButton.html +17 -17
- package/docs/classes/components_JogPanel.JogPanel.html +138 -0
- package/docs/classes/components_Lamp.Lamp.html +105 -0
- package/docs/classes/components_OskDialog.OskDialog.html +5 -5
- package/docs/classes/components_ToggleGroup.ToggleGroup.html +118 -0
- package/docs/classes/components_ValueDisplay.ValueDisplay.html +4 -4
- package/docs/classes/components_ValueInput.ValueInput.html +115 -0
- package/docs/classes/core_ValueSimulator.ValueSimulator.html +2 -2
- package/docs/classes/hub_HubBase.HubBase.html +4 -4
- package/docs/classes/hub_HubSimulate.HubSimulate.html +2 -2
- package/docs/classes/hub_HubSocketIo.HubSocketIo.html +5 -5
- package/docs/classes/hub_HubTauri.HubTauri.html +5 -5
- package/docs/enums/components_JogPanel.JogDistanceAction.html +5 -0
- package/docs/enums/components_JogPanel.JogPanelAction.html +18 -0
- package/docs/enums/components_JogPanel.JogSpeedAction.html +5 -0
- package/docs/enums/core_ActionMode.ActionMode.html +6 -0
- package/docs/enums/core_IndicatorColor.IndicatorColor.html +23 -0
- package/docs/functions/assets_BlocklyLogo.default.html +1 -0
- package/docs/functions/assets_Distance.default.html +1 -0
- package/docs/functions/assets_JogLong.default.html +1 -0
- package/docs/functions/assets_JogMedium.default.html +1 -0
- package/docs/functions/assets_JogShort.default.html +1 -0
- package/docs/functions/assets_PythonLogo.default.html +1 -0
- package/docs/functions/assets_Rotation3D.default.html +1 -0
- package/docs/functions/assets_RotationCcw.default.html +1 -0
- package/docs/functions/assets_RotationCcwA.default.html +1 -0
- package/docs/functions/assets_RotationCcwB.default.html +1 -0
- package/docs/functions/assets_RotationCcwC.default.html +1 -0
- package/docs/functions/assets_RotationCw.default.html +1 -0
- package/docs/functions/assets_RotationCwA.default.html +1 -0
- package/docs/functions/assets_RotationCwB.default.html +1 -0
- package/docs/functions/assets_RotationCwC.default.html +1 -0
- package/docs/functions/assets_Run.default.html +1 -0
- package/docs/functions/assets_Speed.default.html +1 -0
- package/docs/functions/assets_SpeedFast.default.html +1 -0
- package/docs/functions/assets_SpeedMedium.default.html +1 -0
- package/docs/functions/assets_SpeedNone.default.html +1 -0
- package/docs/functions/assets_SpeedSlow.default.html +1 -0
- package/docs/functions/assets_Walk.default.html +1 -0
- package/docs/functions/components_BlocklyEditor.createCustomToolbox.html +6 -0
- package/docs/functions/components_Osk.Osk.html +2 -2
- package/docs/functions/core_EventEmitterContext.EventEmitterProvider.html +2 -2
- package/docs/functions/core_UniqueId.UniqueId.html +2 -2
- package/docs/functions/core_hoc.hocAddSubscription.html +2 -2
- package/docs/functions/hub.createHub.html +2 -2
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +18 -2
- package/docs/interfaces/components_IndicatorButton.IndicatorButtonProps.html +160 -132
- package/docs/interfaces/components_JogPanel.JogPanelButtonDefinition.html +5 -0
- package/docs/interfaces/components_ToggleGroup.ToggleGroupProps.html +636 -0
- package/docs/interfaces/core_EventEmitterContext.Action.html +2 -2
- package/docs/interfaces/core_EventEmitterContext.EventEmitterContextType.html +2 -2
- package/docs/interfaces/core_EventEmitterContext.State.html +2 -2
- package/docs/interfaces/core_EventEmitterContext.Subscription.html +2 -2
- package/docs/interfaces/core_IndicatorButtonState.IndicatorButtonState.html +10 -0
- package/docs/interfaces/core_PositionContext.IPositionContext.html +2 -2
- package/docs/modules/assets.html +23 -0
- package/docs/modules/assets_BlocklyLogo.html +2 -0
- package/docs/modules/assets_Distance.html +2 -0
- package/docs/modules/assets_JogLong.html +2 -0
- package/docs/modules/assets_JogMedium.html +2 -0
- package/docs/modules/assets_JogShort.html +2 -0
- package/docs/modules/assets_PythonLogo.html +2 -0
- package/docs/modules/assets_Rotation3D.html +2 -0
- package/docs/modules/assets_RotationCcw.html +2 -0
- package/docs/modules/assets_RotationCcwA.html +2 -0
- package/docs/modules/assets_RotationCcwB.html +2 -0
- package/docs/modules/assets_RotationCcwC.html +2 -0
- package/docs/modules/assets_RotationCw.html +2 -0
- package/docs/modules/assets_RotationCwA.html +2 -0
- package/docs/modules/assets_RotationCwB.html +2 -0
- package/docs/modules/assets_RotationCwC.html +2 -0
- package/docs/modules/assets_Run.html +2 -0
- package/docs/modules/assets_Speed.html +2 -0
- package/docs/modules/assets_SpeedFast.html +2 -0
- package/docs/modules/assets_SpeedMedium.html +2 -0
- package/docs/modules/assets_SpeedNone.html +2 -0
- package/docs/modules/assets_SpeedSlow.html +2 -0
- package/docs/modules/assets_Walk.html +2 -0
- package/docs/modules/components_BlocklyEditor.html +5 -0
- package/docs/modules/components_CodeEditor.html +3 -0
- package/docs/modules/components_Indicator.html +2 -2
- package/docs/modules/components_IndicatorButton.html +4 -4
- package/docs/modules/components_JogPanel.html +9 -0
- package/docs/modules/components_Lamp.html +4 -0
- package/docs/modules/components_Osk.html +2 -2
- package/docs/modules/components_OskDialog.html +2 -2
- package/docs/modules/components_ToggleGroup.html +5 -0
- package/docs/modules/components_ValueDisplay.html +2 -2
- package/docs/modules/components_ValueInput.html +2 -0
- package/docs/modules/core_ActionMode.html +2 -0
- package/docs/modules/core_EventEmitterContext.html +2 -2
- package/docs/modules/{components_IndicatorColor.html → core_IndicatorButtonState.html} +2 -2
- package/docs/modules/core_IndicatorColor.html +2 -0
- package/docs/modules/core_MaskPatterns.html +2 -2
- package/docs/modules/core_NumerableTypes.html +2 -2
- package/docs/modules/core_PositionContext.html +2 -2
- package/docs/modules/core_UniqueId.html +2 -2
- package/docs/modules/core_ValueSimulator.html +2 -2
- package/docs/modules/core_hoc.html +2 -2
- package/docs/modules/hub.html +2 -2
- package/docs/modules/hub_HubBase.html +2 -2
- package/docs/modules/hub_HubSimulate.html +2 -2
- package/docs/modules/hub_HubSocketIo.html +2 -2
- package/docs/modules/hub_HubTauri.html +2 -2
- package/docs/types/components_IndicatorButton.IndicatorButtonOptionsType.html +1 -0
- package/docs/types/core_EventEmitterContext.EmitterDispatchFunction.html +2 -2
- package/docs/types/core_EventEmitterContext.EmitterSubscribeFunction.html +2 -2
- package/docs/types/core_EventEmitterContext.EmitterUnsubscribeFunction.html +2 -2
- package/docs/types/core_NumerableTypes.NumerableFormatOptions.html +2 -2
- package/docs/types/core_hoc.HocAddSubscriptionProps.html +2 -2
- package/docs/variables/components_BlocklyEditor.StandardToolbox.html +1 -0
- package/docs/variables/components_JogPanel.DefaultLinearJogButtons.html +2 -0
- package/docs/variables/components_JogPanel.DefaultRotationJogButtons.html +2 -0
- package/docs/variables/core_EventEmitterContext.EventEmitterContext.html +6 -6
- package/docs/variables/core_MaskPatterns.PrimeReactMaskPatterns.html +2 -2
- package/docs/variables/core_MaskPatterns.RegExMaskPatterns.html +3 -2
- package/docs/variables/core_PositionContext.DimensionsContext.html +2 -2
- package/package.json +8 -4
- package/readme.md +33 -0
- package/src/assets/BlocklyLogo.tsx +27 -0
- package/src/assets/Distance.tsx +18 -0
- package/src/assets/JogLong.tsx +13 -0
- package/src/assets/JogMedium.tsx +13 -0
- package/src/assets/JogShort.tsx +13 -0
- package/src/assets/PythonLogo.tsx +83 -0
- package/src/assets/Rotation3D.tsx +13 -0
- package/src/assets/RotationCcw.tsx +33 -0
- package/src/assets/RotationCcwA.tsx +45 -0
- package/src/assets/RotationCcwB.tsx +45 -0
- package/src/assets/RotationCcwC.tsx +45 -0
- package/src/assets/RotationCw.tsx +31 -0
- package/src/assets/RotationCwA.tsx +42 -0
- package/src/assets/RotationCwB.tsx +42 -0
- package/src/assets/RotationCwC.tsx +42 -0
- package/src/assets/Run.tsx +13 -0
- package/src/assets/Speed.tsx +18 -0
- package/src/assets/SpeedFast.tsx +13 -0
- package/src/assets/SpeedMedium.tsx +13 -0
- package/src/assets/SpeedNone.tsx +13 -0
- package/src/assets/SpeedSlow.tsx +13 -0
- package/src/assets/Walk.tsx +13 -0
- package/src/assets/index.ts +22 -0
- package/src/assets/svg/blockly_logo.svg +82 -0
- package/src/assets/svg/distance.svg +40 -0
- package/src/assets/svg/jog_long.svg +1 -0
- package/src/assets/svg/jog_medium.svg +1 -0
- package/src/assets/svg/jog_short.svg +1 -0
- package/src/assets/svg/python_logo.svg +246 -0
- package/src/assets/svg/rotation_3d.svg +1 -0
- package/src/assets/svg/rotation_ccw.svg +50 -0
- package/src/assets/svg/rotation_ccw_a.svg +57 -0
- package/src/assets/svg/rotation_ccw_b.svg +57 -0
- package/src/assets/svg/rotation_ccw_c.svg +57 -0
- package/src/assets/svg/rotation_cw.svg +49 -0
- package/src/assets/svg/rotation_cw_a.svg +30 -0
- package/src/assets/svg/rotation_cw_b.svg +30 -0
- package/src/assets/svg/rotation_cw_c.svg +30 -0
- package/src/assets/svg/run.svg +1 -0
- package/src/assets/svg/speed.svg +39 -0
- package/src/assets/svg/speed_fast.svg +1 -0
- package/src/assets/svg/speed_medium.svg +1 -0
- package/src/assets/svg/speed_none.svg +1 -0
- package/src/assets/svg/speed_slow.svg +1 -0
- package/src/assets/svg/walk.svg +1 -0
- package/src/components/BlocklyEditor.css +25 -0
- package/src/components/BlocklyEditor.tsx +598 -0
- package/src/components/CodeEditor.tsx +156 -0
- package/src/components/Indicator.tsx +63 -118
- package/src/components/IndicatorButton.tsx +104 -50
- package/src/components/JogPanel.css +41 -0
- package/src/components/JogPanel.tsx +461 -0
- package/src/components/Lamp.tsx +243 -0
- package/src/components/ToggleGroup.tsx +429 -0
- package/src/components/ValueInput.tsx +261 -0
- package/src/core/ActionMode.ts +20 -0
- package/src/core/IndicatorButtonState.ts +34 -0
- package/src/core/MaskPatterns.ts +7 -1
- package/tools/copy-distribution-files.cjs +3 -2
- package/dist/components/DPad.css +0 -522
- package/dist/components/DPad.d.ts +0 -34
- package/dist/components/DPad.js +0 -1
- package/docs/enums/components_DPad.VcJoyPadAction.html +0 -10
- package/docs/enums/components_DPad.VcJoyPadButtonId.html +0 -7
- package/docs/enums/components_IndicatorButton.ActionMode.html +0 -6
- package/docs/enums/components_IndicatorColor.IndicatorColor.html +0 -23
- package/docs/functions/components_DPad.VcDPad.html +0 -5
- package/docs/interfaces/components_IndicatorButton.IndicatorButtonState.html +0 -10
- package/docs/modules/components_DPad.html +0 -5
- package/src/components/DPad.css +0 -522
- package/src/components/DPad.tsx +0 -94
- /package/dist/{components → core}/IndicatorColor.d.ts +0 -0
- /package/dist/{components → core}/IndicatorColor.js +0 -0
- /package/src/{components → core}/IndicatorColor.ts +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
height="24"
|
|
4
|
+
viewBox="0 -960 960 960"
|
|
5
|
+
width="24"
|
|
6
|
+
fill="white"
|
|
7
|
+
version="1.1"
|
|
8
|
+
id="svg1"
|
|
9
|
+
sodipodi:docname="speed.svg"
|
|
10
|
+
inkscape:version="1.3.2 (091e20e, 2023-11-25, custom)"
|
|
11
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
12
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
xmlns:svg="http://www.w3.org/2000/svg">
|
|
15
|
+
<defs
|
|
16
|
+
id="defs1" />
|
|
17
|
+
<sodipodi:namedview
|
|
18
|
+
id="namedview1"
|
|
19
|
+
pagecolor="#505050"
|
|
20
|
+
bordercolor="#eeeeee"
|
|
21
|
+
borderopacity="1"
|
|
22
|
+
inkscape:showpageshadow="0"
|
|
23
|
+
inkscape:pageopacity="0"
|
|
24
|
+
inkscape:pagecheckerboard="0"
|
|
25
|
+
inkscape:deskcolor="#505050"
|
|
26
|
+
inkscape:zoom="33.875"
|
|
27
|
+
inkscape:cx="12"
|
|
28
|
+
inkscape:cy="12"
|
|
29
|
+
inkscape:window-width="1920"
|
|
30
|
+
inkscape:window-height="1009"
|
|
31
|
+
inkscape:window-x="1912"
|
|
32
|
+
inkscape:window-y="-8"
|
|
33
|
+
inkscape:window-maximized="1"
|
|
34
|
+
inkscape:current-layer="svg1" />
|
|
35
|
+
<path
|
|
36
|
+
d="m 406.33774,-313.68 q 28.512,28.512 73.656,27.918 45.144,-0.594 66.528,-32.67 l 200.772,-300.564 q 10.692,-16.632 -2.97,-30.294 -13.662,-13.662 -30.294,-2.97 l -300.564,200.772 q -32.076,21.384 -33.858,65.34 -1.782,43.956 26.73,72.468 z m 73.656,-546.48 q 42.768,0 84.348,7.128 41.58,7.128 80.784,22.572 19.008,7.128 40.392,26.73 21.384,19.602 11.88,37.422 -9.504,17.82 -42.768,23.76 -33.264,5.94 -53.46,-1.188 -29.7,-10.692 -59.994,-16.038 -30.294,-5.346 -61.182,-5.346 -158.004,0 -269.082,111.078 -111.078003,111.078 -111.078003,269.082 0,49.896 13.662003,98.604 13.662,48.708 38.61,91.476 h 655.776 q 27.324,-45.144 39.798,-93.852 12.474,-48.708 12.474,-100.98 0,-30.888 -5.346,-60.588 -5.346,-29.7 -16.038,-58.212 -7.128,-20.196 -2.376,-39.204 4.752,-19.008 21.384,-32.076 15.444,-11.88 33.858,-7.128 18.414,4.752 25.542,21.384 17.82,41.58 27.324,84.942 9.504,43.362 10.692,88.506 1.188,67.716 -15.444,129.492 -16.632,61.776 -48.708,117.612 -13.068,21.384 -35.64,33.264 -22.572,11.88 -47.52,11.88 h -655.776 q -24.948,0 -47.52,-11.88 -22.572003,-11.88 -35.640006,-33.264 -30.888,-53.46 -47.52,-113.454 -16.6320005,-59.994 -16.6320005,-126.522 0,-98.604 37.4220005,-184.734 37.422003,-86.13 102.168006,-150.876 64.746,-64.746 151.47,-102.168 86.724,-37.422 184.14,-37.422 z m 8.316,371.844 z"
|
|
37
|
+
id="path1"
|
|
38
|
+
style="stroke-width:1.188" />
|
|
39
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="white"><path d="M177-80q-18 0-29.5-12T136-120q0-8 3-15t9-13l664-664q6-6 13-9t15-3q16 0 28 11.5t12 29.5v643q0 25-17.5 42.5T820-80H177Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="white"><path d="M177-80q-18 0-29.5-12T136-120q0-8 3-15t9-13l664-664q6-6 13-9t15-3q16 0 28 11.5t12 29.5v643q0 25-17.5 42.5T820-80H177Zm423-80h200v-526L600-486v326Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="white"><path d="M177-80q-27 0-37.5-24.5T148-148l664-664q19-19 43.5-8.5T880-783v643q0 25-17.5 42.5T820-80H177Zm96-80h527v-526L273-160Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="white"><path d="M177-80q-18 0-29.5-12T136-120q0-8 3-15t9-13l664-664q6-6 13-9t15-3q16 0 28 11.5t12 29.5v643q0 25-17.5 42.5T820-80H177Zm223-80h400v-526L400-286v126Z"/></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 -960 960 960" width="24" fill="white"><path d="M436-364 371-72q-3 14-14.5 23T330-40q-20 0-32-15t-8-34l102-515-72 28v96q0 17-11.5 28.5T280-440q-17 0-28.5-11.5T240-480v-122q0-12 6.5-21.5T264-638l178-76q14-6 29.5-7t29.5 4q14 5 26.5 14t20.5 23l40 64q13 20 30.5 38t39.5 31q14 8 31 14.5t34 9.5q16 3 26.5 14.5T760-480q0 17-12 28t-29 9q-56-8-100.5-35T541-543l-25 123 72 68q6 6 9 13.5t3 15.5v243q0 17-11.5 28.5T560-40q-17 0-28.5-11.5T520-80v-220l-84-64Zm104-376q-33 0-56.5-23.5T460-820q0-33 23.5-56.5T540-900q33 0 56.5 23.5T620-820q0 33-23.5 56.5T540-740Z"/></svg>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2024 Automated Design Corp.. All Rights Reserved.
|
|
3
|
+
* Created Date: 2024-03-15 14:22:54
|
|
4
|
+
* -----
|
|
5
|
+
* Last Modified: 2024-03-18 08:23:33
|
|
6
|
+
* -----
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
.editor-toggle-group {
|
|
11
|
+
margin-bottom: 2mm;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
.fill-height {
|
|
16
|
+
height: 100%;
|
|
17
|
+
width: 100%;
|
|
18
|
+
background-color: green;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* In your CSS file */
|
|
22
|
+
.icon-scale {
|
|
23
|
+
height: 24px;
|
|
24
|
+
width: auto;
|
|
25
|
+
}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import Blockly from "blockly";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import "./BlocklyEditor.css";
|
|
4
|
+
/**
|
|
5
|
+
* Properties for the Blockly Editor.
|
|
6
|
+
*/
|
|
7
|
+
interface BlocklyEditorProps {
|
|
8
|
+
/**
|
|
9
|
+
* The initial XML representation of the Blockly workspace. Can be undefined
|
|
10
|
+
* if the workspace should start empty.
|
|
11
|
+
*/
|
|
12
|
+
initialXml: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The configuration definition for the Blockly Toolbox.
|
|
15
|
+
*/
|
|
16
|
+
toolbox: Blockly.utils.toolbox.ToolboxDefinition;
|
|
17
|
+
/**
|
|
18
|
+
* Allows the parent component to add/subtract from the calculated
|
|
19
|
+
* width of the BlocklyEditor to account for other components (like a menu, toolbar, switch)
|
|
20
|
+
* in the view.
|
|
21
|
+
*/
|
|
22
|
+
widthAdjustment: number;
|
|
23
|
+
/**
|
|
24
|
+
* Allows the parent component to add/subtract from the calculated
|
|
25
|
+
* height of the BlocklyEditor to account for other components (like a menu, toolbar, switch)
|
|
26
|
+
* in the view.
|
|
27
|
+
*/
|
|
28
|
+
heightAdjustment: number;
|
|
29
|
+
/**
|
|
30
|
+
* Callback fired when the Blockly workspace content changes.
|
|
31
|
+
* Note: This does not directly reflect changes to the XML or the code.
|
|
32
|
+
*/
|
|
33
|
+
onWorkspaceChanged?: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Callback fired when the XML representation of the workspace changes.
|
|
36
|
+
* @param xml The updated XML representation of the workspace.
|
|
37
|
+
*/
|
|
38
|
+
onXmlChanged?: (xml: string) => void;
|
|
39
|
+
/**
|
|
40
|
+
* Callback fired when the generated code (e.g., Python) changes.
|
|
41
|
+
* @param code The updated generated code.
|
|
42
|
+
*/
|
|
43
|
+
onCodeChanged?: (code: string) => void;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* State of the BlocklyEditor
|
|
47
|
+
*/
|
|
48
|
+
interface BlocklyEditorState {
|
|
49
|
+
/**
|
|
50
|
+
* A name for the Blockly editor, potentially used for identification.
|
|
51
|
+
*/
|
|
52
|
+
name: string;
|
|
53
|
+
/**
|
|
54
|
+
* The current XML representation of the workspace.
|
|
55
|
+
*/
|
|
56
|
+
xml: string;
|
|
57
|
+
/**
|
|
58
|
+
* The current generated code (e.g., Python).
|
|
59
|
+
*/
|
|
60
|
+
code: string;
|
|
61
|
+
/**
|
|
62
|
+
* The height of the first parent container with
|
|
63
|
+
* classname "blockly-container". It is important to set
|
|
64
|
+
* a parent container with this class name for auto-sizing to work!
|
|
65
|
+
*/
|
|
66
|
+
parentHeight: number;
|
|
67
|
+
/**
|
|
68
|
+
* The width of the first parent container with
|
|
69
|
+
* classname "blockly-container". It is important to set
|
|
70
|
+
* a parent container with this class name for auto-sizing to work!
|
|
71
|
+
*/
|
|
72
|
+
parentWidth: number;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* A view that contains the blockly editor, wrapping the react-blockly BlocklyWorkspace
|
|
76
|
+
* component. The added value of this BlocklyEditor component is that it will automatically
|
|
77
|
+
* size to the container, which can be a bit tricky when using blockly.
|
|
78
|
+
*
|
|
79
|
+
* The auto-sizing requires a parent component to have the className "blockly-container". This
|
|
80
|
+
* should be a component that has a known size roughly the size that you want the BlocklyEditor
|
|
81
|
+
* to appear. Otherwise, the BlocklyEditor will use the dimentions of the entire window, which usually is
|
|
82
|
+
* more than you want.
|
|
83
|
+
*
|
|
84
|
+
* Right now, the editor only supports generating python code, but a feature to specify the
|
|
85
|
+
* generator for different languages is planned.
|
|
86
|
+
*/
|
|
87
|
+
export declare class BlocklyEditor extends React.Component<BlocklyEditorProps, BlocklyEditorState> {
|
|
88
|
+
static defaultProps: {
|
|
89
|
+
initialXml: undefined;
|
|
90
|
+
widthAdjustment: number;
|
|
91
|
+
heightAdjustment: number;
|
|
92
|
+
onWorkspaceChanged: undefined;
|
|
93
|
+
onXmlChanged: undefined;
|
|
94
|
+
onCodeChanged: undefined;
|
|
95
|
+
};
|
|
96
|
+
private ref;
|
|
97
|
+
/**
|
|
98
|
+
* Constructor
|
|
99
|
+
*/
|
|
100
|
+
constructor(props: BlocklyEditorProps);
|
|
101
|
+
componentDidMount(): void;
|
|
102
|
+
componentDidUpdate(prevProps: BlocklyEditorProps): void;
|
|
103
|
+
componentWillUnmount(): void;
|
|
104
|
+
updateParentSize: () => void;
|
|
105
|
+
private onWorkspaceChanged;
|
|
106
|
+
private setXml;
|
|
107
|
+
private onInject;
|
|
108
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
}
|
|
110
|
+
export default BlocklyEditor;
|
|
111
|
+
/**
|
|
112
|
+
* Creates a custom Blockly toolbox XML string by inserting additional XML before and after
|
|
113
|
+
* the standard Blockly toolbox.
|
|
114
|
+
*
|
|
115
|
+
* @param {string | undefined} xmlBefore - The XML content to be inserted before the built-in Blockly blocks.
|
|
116
|
+
* @param {string | undefined} xmlAfter - The XML content to be inserted after the built-in Blockly blocks.
|
|
117
|
+
* @returns {string} The customized toolbox XML string.
|
|
118
|
+
*/
|
|
119
|
+
export declare const createCustomToolbox: (xmlBefore: string | undefined, xmlAfter: string | undefined) => string;
|
|
120
|
+
export declare const StandardToolbox = "\n <xml id=\"toolbox\" style=\"display: none\">\n <!-- BEGIN: Built-in Blockly Blocks //-->\n <category name=\"Logic\" categorystyle=\"logic_category\">\n <block type=\"controls_if\"></block>\n <block type=\"logic_compare\"></block>\n <block type=\"logic_operation\"></block>\n <block type=\"logic_negate\"></block>\n <block type=\"logic_boolean\"></block>\n <block type=\"logic_null\" disabled=\"true\"></block>\n <block type=\"logic_ternary\"></block>\n </category>\n <category name=\"Loops\" categorystyle=\"loop_category\">\n <block type=\"controls_repeat_ext\">\n <value name=\"TIMES\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">10</field>\n </shadow>\n </value>\n </block>\n <block type=\"controls_repeat\" disabled=\"true\"></block>\n <block type=\"controls_whileUntil\"></block>\n <block type=\"controls_for\">\n <value name=\"FROM\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n <value name=\"TO\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">10</field>\n </shadow>\n </value>\n <value name=\"BY\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n </block>\n <block type=\"controls_forEach\"></block>\n <block type=\"controls_flow_statements\"></block>\n </category>\n <category name=\"Math\" categorystyle=\"math_category\">\n <block type=\"math_number\" gap=\"32\">\n <field name=\"NUM\">123</field>\n </block>\n <block type=\"math_arithmetic\">\n <value name=\"A\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n <value name=\"B\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n </block>\n <block type=\"math_single\">\n <value name=\"NUM\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">9</field>\n </shadow>\n </value>\n </block>\n <block type=\"math_trig\">\n <value name=\"NUM\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">45</field>\n </shadow>\n </value>\n </block>\n <block type=\"math_constant\"></block>\n <block type=\"math_number_property\">\n <value name=\"NUMBER_TO_CHECK\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">0</field>\n </shadow>\n </value>\n </block>\n <block type=\"math_round\">\n <value name=\"NUM\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">3.1</field>\n </shadow>\n </value>\n </block>\n <block type=\"math_on_list\"></block>\n <block type=\"math_modulo\">\n <value name=\"DIVIDEND\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">64</field>\n </shadow>\n </value>\n <value name=\"DIVISOR\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">10</field>\n </shadow>\n </value>\n </block>\n <block type=\"math_constrain\">\n <value name=\"VALUE\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">50</field>\n </shadow>\n </value>\n <value name=\"LOW\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n <value name=\"HIGH\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">100</field>\n </shadow>\n </value>\n </block>\n <block type=\"math_random_int\">\n <value name=\"FROM\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n <value name=\"TO\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">100</field>\n </shadow>\n </value>\n </block>\n <block type=\"math_random_float\"></block>\n <block type=\"math_atan2\">\n <value name=\"X\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n <value name=\"Y\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">1</field>\n </shadow>\n </value>\n </block>\n </category>\n <category name=\"Text\" categorystyle=\"text_category\">\n <block type=\"text\"></block>\n <block type=\"text_multiline\"></block>\n <block type=\"text_join\"></block>\n <block type=\"text_append\">\n <value name=\"TEXT\">\n <shadow type=\"text\"></shadow>\n </value>\n </block>\n <block type=\"text_length\">\n <value name=\"VALUE\">\n <shadow type=\"text\">\n <field name=\"TEXT\">abc</field>\n </shadow>\n </value>\n </block>\n <block type=\"text_isEmpty\">\n <value name=\"VALUE\">\n <shadow type=\"text\">\n <field name=\"TEXT\"></field>\n </shadow>\n </value>\n </block>\n <block type=\"text_indexOf\">\n <value name=\"VALUE\">\n <block type=\"variables_get\">\n <field name=\"VAR\">text</field>\n </block>\n </value>\n <value name=\"FIND\">\n <shadow type=\"text\">\n <field name=\"TEXT\">abc</field>\n </shadow>\n </value>\n </block>\n <block type=\"text_charAt\">\n <value name=\"VALUE\">\n <block type=\"variables_get\">\n <field name=\"VAR\">text</field>\n </block>\n </value>\n </block>\n <block type=\"text_getSubstring\">\n <value name=\"STRING\">\n <block type=\"variables_get\">\n <field name=\"VAR\">text</field>\n </block>\n </value>\n </block>\n <block type=\"text_changeCase\">\n <value name=\"TEXT\">\n <shadow type=\"text\">\n <field name=\"TEXT\">abc</field>\n </shadow>\n </value>\n </block>\n <block type=\"text_trim\">\n <value name=\"TEXT\">\n <shadow type=\"text\">\n <field name=\"TEXT\">abc</field>\n </shadow>\n </value>\n </block>\n <block type=\"text_count\">\n <value name=\"SUB\">\n <shadow type=\"text\"></shadow>\n </value>\n <value name=\"TEXT\">\n <shadow type=\"text\"></shadow>\n </value>\n </block>\n <block type=\"text_replace\">\n <value name=\"FROM\">\n <shadow type=\"text\"></shadow>\n </value>\n <value name=\"TO\">\n <shadow type=\"text\"></shadow>\n </value>\n <value name=\"TEXT\">\n <shadow type=\"text\"></shadow>\n </value>\n </block>\n <block type=\"text_reverse\">\n <value name=\"TEXT\">\n <shadow type=\"text\"></shadow>\n </value>\n </block>\n <label text=\"Input/Output:\" web-class=\"ioLabel\"></label>\n <block type=\"text_print\">\n <value name=\"TEXT\">\n <shadow type=\"text\">\n <field name=\"TEXT\">abc</field>\n </shadow>\n </value>\n </block>\n <block type=\"text_prompt_ext\">\n <value name=\"TEXT\">\n <shadow type=\"text\">\n <field name=\"TEXT\">abc</field>\n </shadow>\n </value>\n </block>\n </category>\n <category name=\"Lists\" categorystyle=\"list_category\">\n <block type=\"lists_create_with\">\n <mutation items=\"0\"></mutation>\n </block>\n <block type=\"lists_create_with\"></block>\n <block type=\"lists_repeat\">\n <value name=\"NUM\">\n <shadow type=\"math_number\">\n <field name=\"NUM\">5</field>\n </shadow>\n </value>\n </block>\n <block type=\"lists_length\"></block>\n <block type=\"lists_isEmpty\"></block>\n <block type=\"lists_indexOf\">\n <value name=\"VALUE\">\n <block type=\"variables_get\">\n <field name=\"VAR\">list</field>\n </block>\n </value>\n </block>\n <block type=\"lists_getIndex\">\n <value name=\"VALUE\">\n <block type=\"variables_get\">\n <field name=\"VAR\">list</field>\n </block>\n </value>\n </block>\n <block type=\"lists_setIndex\">\n <value name=\"LIST\">\n <block type=\"variables_get\">\n <field name=\"VAR\">list</field>\n </block>\n </value>\n </block>\n <block type=\"lists_getSublist\">\n <value name=\"LIST\">\n <block type=\"variables_get\">\n <field name=\"VAR\">list</field>\n </block>\n </value>\n </block>\n <block type=\"lists_split\">\n <value name=\"DELIM\">\n <shadow type=\"text\">\n <field name=\"TEXT\">,</field>\n </shadow>\n </value>\n </block>\n <block type=\"lists_sort\"></block>\n <block type=\"lists_reverse\"></block>\n </category>\n <category name=\"Variables\" categorystyle=\"variable_category\" custom=\"VARIABLE\"></category>\n <category name=\"Functions\" categorystyle=\"procedure_category\" custom=\"PROCEDURE\"></category>\n\n <!-- END: Built-in Blockly Blocks //-->\n\n </xml>\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx,Fragment as _Fragment}from"react/jsx-runtime";import{pythonGenerator}from"blockly/python";import{BlocklyWorkspace}from"react-blockly";import React from"react";import"./BlocklyEditor.css";export class BlocklyEditor extends React.Component{constructor(e){super(e),Object.defineProperty(this,"ref",{enumerable:!0,configurable:!0,writable:!0,value:React.createRef()}),Object.defineProperty(this,"updateParentSize",{enumerable:!0,configurable:!0,writable:!0,value:()=>{if(this.ref.current){let e=0,n=0,t=this.ref.current.parentElement;for(;null!=t&&(e=t.offsetWidth,n=t.offsetHeight,!(t.className.indexOf("blockly-container")>=0));)t=t.parentElement;e<300&&(e=300),n<300&&(n=300),this.setState({parentWidth:.9*e+this.props.widthAdjustment,parentHeight:.9*n+this.props.heightAdjustment})}}}),Object.defineProperty(this,"onWorkspaceChanged",{enumerable:!0,configurable:!0,writable:!0,value:e=>{const n=pythonGenerator.workspaceToCode(e);this.setState({code:n}),void 0!==this.props.onWorkspaceChanged&&null!==this.props.onWorkspaceChanged&&this.props.onWorkspaceChanged(),void 0!==this.props.onCodeChanged&&null!==this.props.onCodeChanged&&this.props.onCodeChanged(n)}}),Object.defineProperty(this,"setXml",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.setState({xml:e}),void 0!==this.props.onXmlChanged&&null!==this.props.onXmlChanged&&this.props.onXmlChanged(e)}}),Object.defineProperty(this,"onInject",{enumerable:!0,configurable:!0,writable:!0,value:e=>{}}),this.state={name:"",xml:"",code:"",parentWidth:0,parentHeight:0}}componentDidMount(){this.updateParentSize(),window.addEventListener("resize",this.updateParentSize)}componentDidUpdate(e){}componentWillUnmount(){window.removeEventListener("resize",this.updateParentSize)}render(){return _jsx(_Fragment,{children:_jsx(BlocklyWorkspace,{className:"fill-height",toolboxConfiguration:this.props.toolbox,initialXml:this.props.initialXml,onWorkspaceChange:this.onWorkspaceChanged,onXmlChange:this.setXml,onInject:this.onInject,workspaceConfiguration:{grid:{spacing:20,length:3,colour:"#ccc",snap:!0}}})})}}Object.defineProperty(BlocklyEditor,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{initialXml:void 0,widthAdjustment:0,heightAdjustment:0,onWorkspaceChanged:void 0,onXmlChanged:void 0,onCodeChanged:void 0}});export default BlocklyEditor;export const createCustomToolbox=(e,n)=>{const t="\x3c!-- END: Built-in Blockly Blocks //--\x3e",a=StandardToolbox.indexOf("\x3c!-- BEGIN: Built-in Blockly Blocks //--\x3e"),l=StandardToolbox.indexOf(t);if(-1===a||-1===l)throw new Error("Could not find markers in standard toolbox");return StandardToolbox.slice(0,a)+(e||"")+StandardToolbox.slice(a,l+39)+(n||"")+StandardToolbox.slice(l+39+1)};export const StandardToolbox='\n <xml id="toolbox" style="display: none">\n \x3c!-- BEGIN: Built-in Blockly Blocks //--\x3e\n <category name="Logic" categorystyle="logic_category">\n <block type="controls_if"></block>\n <block type="logic_compare"></block>\n <block type="logic_operation"></block>\n <block type="logic_negate"></block>\n <block type="logic_boolean"></block>\n <block type="logic_null" disabled="true"></block>\n <block type="logic_ternary"></block>\n </category>\n <category name="Loops" categorystyle="loop_category">\n <block type="controls_repeat_ext">\n <value name="TIMES">\n <shadow type="math_number">\n <field name="NUM">10</field>\n </shadow>\n </value>\n </block>\n <block type="controls_repeat" disabled="true"></block>\n <block type="controls_whileUntil"></block>\n <block type="controls_for">\n <value name="FROM">\n <shadow type="math_number">\n <field name="NUM">1</field>\n </shadow>\n </value>\n <value name="TO">\n <shadow type="math_number">\n <field name="NUM">10</field>\n </shadow>\n </value>\n <value name="BY">\n <shadow type="math_number">\n <field name="NUM">1</field>\n </shadow>\n </value>\n </block>\n <block type="controls_forEach"></block>\n <block type="controls_flow_statements"></block>\n </category>\n <category name="Math" categorystyle="math_category">\n <block type="math_number" gap="32">\n <field name="NUM">123</field>\n </block>\n <block type="math_arithmetic">\n <value name="A">\n <shadow type="math_number">\n <field name="NUM">1</field>\n </shadow>\n </value>\n <value name="B">\n <shadow type="math_number">\n <field name="NUM">1</field>\n </shadow>\n </value>\n </block>\n <block type="math_single">\n <value name="NUM">\n <shadow type="math_number">\n <field name="NUM">9</field>\n </shadow>\n </value>\n </block>\n <block type="math_trig">\n <value name="NUM">\n <shadow type="math_number">\n <field name="NUM">45</field>\n </shadow>\n </value>\n </block>\n <block type="math_constant"></block>\n <block type="math_number_property">\n <value name="NUMBER_TO_CHECK">\n <shadow type="math_number">\n <field name="NUM">0</field>\n </shadow>\n </value>\n </block>\n <block type="math_round">\n <value name="NUM">\n <shadow type="math_number">\n <field name="NUM">3.1</field>\n </shadow>\n </value>\n </block>\n <block type="math_on_list"></block>\n <block type="math_modulo">\n <value name="DIVIDEND">\n <shadow type="math_number">\n <field name="NUM">64</field>\n </shadow>\n </value>\n <value name="DIVISOR">\n <shadow type="math_number">\n <field name="NUM">10</field>\n </shadow>\n </value>\n </block>\n <block type="math_constrain">\n <value name="VALUE">\n <shadow type="math_number">\n <field name="NUM">50</field>\n </shadow>\n </value>\n <value name="LOW">\n <shadow type="math_number">\n <field name="NUM">1</field>\n </shadow>\n </value>\n <value name="HIGH">\n <shadow type="math_number">\n <field name="NUM">100</field>\n </shadow>\n </value>\n </block>\n <block type="math_random_int">\n <value name="FROM">\n <shadow type="math_number">\n <field name="NUM">1</field>\n </shadow>\n </value>\n <value name="TO">\n <shadow type="math_number">\n <field name="NUM">100</field>\n </shadow>\n </value>\n </block>\n <block type="math_random_float"></block>\n <block type="math_atan2">\n <value name="X">\n <shadow type="math_number">\n <field name="NUM">1</field>\n </shadow>\n </value>\n <value name="Y">\n <shadow type="math_number">\n <field name="NUM">1</field>\n </shadow>\n </value>\n </block>\n </category>\n <category name="Text" categorystyle="text_category">\n <block type="text"></block>\n <block type="text_multiline"></block>\n <block type="text_join"></block>\n <block type="text_append">\n <value name="TEXT">\n <shadow type="text"></shadow>\n </value>\n </block>\n <block type="text_length">\n <value name="VALUE">\n <shadow type="text">\n <field name="TEXT">abc</field>\n </shadow>\n </value>\n </block>\n <block type="text_isEmpty">\n <value name="VALUE">\n <shadow type="text">\n <field name="TEXT"></field>\n </shadow>\n </value>\n </block>\n <block type="text_indexOf">\n <value name="VALUE">\n <block type="variables_get">\n <field name="VAR">text</field>\n </block>\n </value>\n <value name="FIND">\n <shadow type="text">\n <field name="TEXT">abc</field>\n </shadow>\n </value>\n </block>\n <block type="text_charAt">\n <value name="VALUE">\n <block type="variables_get">\n <field name="VAR">text</field>\n </block>\n </value>\n </block>\n <block type="text_getSubstring">\n <value name="STRING">\n <block type="variables_get">\n <field name="VAR">text</field>\n </block>\n </value>\n </block>\n <block type="text_changeCase">\n <value name="TEXT">\n <shadow type="text">\n <field name="TEXT">abc</field>\n </shadow>\n </value>\n </block>\n <block type="text_trim">\n <value name="TEXT">\n <shadow type="text">\n <field name="TEXT">abc</field>\n </shadow>\n </value>\n </block>\n <block type="text_count">\n <value name="SUB">\n <shadow type="text"></shadow>\n </value>\n <value name="TEXT">\n <shadow type="text"></shadow>\n </value>\n </block>\n <block type="text_replace">\n <value name="FROM">\n <shadow type="text"></shadow>\n </value>\n <value name="TO">\n <shadow type="text"></shadow>\n </value>\n <value name="TEXT">\n <shadow type="text"></shadow>\n </value>\n </block>\n <block type="text_reverse">\n <value name="TEXT">\n <shadow type="text"></shadow>\n </value>\n </block>\n <label text="Input/Output:" web-class="ioLabel"></label>\n <block type="text_print">\n <value name="TEXT">\n <shadow type="text">\n <field name="TEXT">abc</field>\n </shadow>\n </value>\n </block>\n <block type="text_prompt_ext">\n <value name="TEXT">\n <shadow type="text">\n <field name="TEXT">abc</field>\n </shadow>\n </value>\n </block>\n </category>\n <category name="Lists" categorystyle="list_category">\n <block type="lists_create_with">\n <mutation items="0"></mutation>\n </block>\n <block type="lists_create_with"></block>\n <block type="lists_repeat">\n <value name="NUM">\n <shadow type="math_number">\n <field name="NUM">5</field>\n </shadow>\n </value>\n </block>\n <block type="lists_length"></block>\n <block type="lists_isEmpty"></block>\n <block type="lists_indexOf">\n <value name="VALUE">\n <block type="variables_get">\n <field name="VAR">list</field>\n </block>\n </value>\n </block>\n <block type="lists_getIndex">\n <value name="VALUE">\n <block type="variables_get">\n <field name="VAR">list</field>\n </block>\n </value>\n </block>\n <block type="lists_setIndex">\n <value name="LIST">\n <block type="variables_get">\n <field name="VAR">list</field>\n </block>\n </value>\n </block>\n <block type="lists_getSublist">\n <value name="LIST">\n <block type="variables_get">\n <field name="VAR">list</field>\n </block>\n </value>\n </block>\n <block type="lists_split">\n <value name="DELIM">\n <shadow type="text">\n <field name="TEXT">,</field>\n </shadow>\n </value>\n </block>\n <block type="lists_sort"></block>\n <block type="lists_reverse"></block>\n </category>\n <category name="Variables" categorystyle="variable_category" custom="VARIABLE"></category>\n <category name="Functions" categorystyle="procedure_category" custom="PROCEDURE"></category>\n\n \x3c!-- END: Built-in Blockly Blocks //--\x3e\n\n </xml>\n';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { editor } from 'monaco-editor';
|
|
3
|
+
import { Monaco } from '@monaco-editor/react';
|
|
4
|
+
interface CodeEditorProps {
|
|
5
|
+
/**
|
|
6
|
+
* Code content of the editor
|
|
7
|
+
*/
|
|
8
|
+
code: string | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Programming language type for syntax highlighting
|
|
11
|
+
* @default 'python'
|
|
12
|
+
*/
|
|
13
|
+
language: string;
|
|
14
|
+
/**
|
|
15
|
+
* Visual theme of the editor. vs-dark is generally preferred.
|
|
16
|
+
* @default 'vs-dark'
|
|
17
|
+
*/
|
|
18
|
+
theme: 'vs-dark' | 'vs-light';
|
|
19
|
+
/**
|
|
20
|
+
* Whether the editor is read only
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
readOnly: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Style of the cursor in the editor.
|
|
26
|
+
* @default 'line'
|
|
27
|
+
*/
|
|
28
|
+
cursorStyle: "line" | "block" | "underline" | "line-thin" | "block-outline" | "underline-thin" | undefined;
|
|
29
|
+
/** Callback when the user types chances into the editor. */
|
|
30
|
+
onCodeChanged?(code: string | undefined): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Wrapper for the Microsoft Monaco editor, configured for our most common defaults.
|
|
34
|
+
*/
|
|
35
|
+
export declare class CodeEditor extends React.Component<CodeEditorProps> {
|
|
36
|
+
/**
|
|
37
|
+
* Default properties for this component.
|
|
38
|
+
*/
|
|
39
|
+
static defaultProps: {
|
|
40
|
+
code: undefined;
|
|
41
|
+
language: string;
|
|
42
|
+
theme: string;
|
|
43
|
+
readOnly: boolean;
|
|
44
|
+
cursorStyle: string;
|
|
45
|
+
onCodeChanged: undefined;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Constructor
|
|
49
|
+
* @param props PythonEditorProps
|
|
50
|
+
*/
|
|
51
|
+
constructor(props: CodeEditorProps);
|
|
52
|
+
/**
|
|
53
|
+
* The editor is initialized and displayed in the view.
|
|
54
|
+
* @param editor
|
|
55
|
+
* @param monaco
|
|
56
|
+
*/
|
|
57
|
+
editorDidMount: (editor: editor.IStandaloneCodeEditor, monaco: Monaco) => void;
|
|
58
|
+
/**
|
|
59
|
+
* The editor is about to mount into the view.
|
|
60
|
+
* @param monaco Instance of the editor.
|
|
61
|
+
*/
|
|
62
|
+
handleEditorWillMount: (monaco: Monaco) => void;
|
|
63
|
+
/**
|
|
64
|
+
* Handle changes to the editor's contents.
|
|
65
|
+
* @param newValue New value of editor content.
|
|
66
|
+
* @param e
|
|
67
|
+
*/
|
|
68
|
+
onChange: (newValue: string | undefined, e: any) => void;
|
|
69
|
+
handleEditorValidation: (markers: editor.IMarker[]) => void;
|
|
70
|
+
/**
|
|
71
|
+
* Render the component into the view.
|
|
72
|
+
* @returns
|
|
73
|
+
*/
|
|
74
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
}
|
|
76
|
+
export default CodeEditor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import*as React from"react";import Editor from"@monaco-editor/react";export class CodeEditor extends React.Component{constructor(e){super(e),Object.defineProperty(this,"editorDidMount",{enumerable:!0,configurable:!0,writable:!0,value:(e,o)=>{e.focus()}}),Object.defineProperty(this,"handleEditorWillMount",{enumerable:!0,configurable:!0,writable:!0,value:e=>{}}),Object.defineProperty(this,"onChange",{enumerable:!0,configurable:!0,writable:!0,value:(e,o)=>{void 0!==this.props.onCodeChanged&&null!==this.props.onCodeChanged&&this.props.onCodeChanged(e)}}),Object.defineProperty(this,"handleEditorValidation",{enumerable:!0,configurable:!0,writable:!0,value:e=>{e.forEach((e=>{}))}})}render(){const e={selectOnLineNumbers:!0,roundedSelection:!1,readOnly:this.props.readOnly,cursorStyle:this.props.cursorStyle,automaticLayout:!0,theme:this.props.theme,language:this.props.language,folding:!1};return _jsx(Editor,{value:this.props.code,height:"100%",width:"100%",defaultLanguage:"python",defaultValue:"",onChange:this.onChange,onMount:this.editorDidMount,beforeMount:this.handleEditorWillMount,onValidate:this.handleEditorValidation,theme:"vs-dark",options:e})}}Object.defineProperty(CodeEditor,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{code:void 0,language:"python",theme:"vs-dark",readOnly:!1,cursorStyle:"line",onCodeChanged:void 0}});export default CodeEditor;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import React, { Component } from 'react';
|
|
2
2
|
import { EventEmitterContextType } from '../core/EventEmitterContext';
|
|
3
|
-
import { IndicatorColor } from "
|
|
3
|
+
import { IndicatorColor } from "../core/IndicatorColor";
|
|
4
4
|
export { IndicatorColor };
|
|
5
5
|
interface IndicatorProps {
|
|
6
|
+
/**
|
|
7
|
+
* Label of the group/row. Can be any element.
|
|
8
|
+
*
|
|
9
|
+
* ## Examples
|
|
10
|
+
* ```
|
|
11
|
+
* <Indicator label="Simple Text" />
|
|
12
|
+
* <Indicator label={<span><i className="pi pi-check"></i> Icon and Text</span>} />
|
|
13
|
+
* <Indicator label={<YourCustomIconComponent />} />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
label?: React.ReactNode;
|
|
6
17
|
/**
|
|
7
18
|
* State to be displayed<br/>
|
|
8
19
|
*
|
|
@@ -13,23 +24,6 @@ interface IndicatorProps {
|
|
|
13
24
|
* * `undefined` is treated as **not available**
|
|
14
25
|
*/
|
|
15
26
|
value?: boolean | undefined;
|
|
16
|
-
/**
|
|
17
|
-
* X position (in pixels)
|
|
18
|
-
*/
|
|
19
|
-
x?: number;
|
|
20
|
-
/**
|
|
21
|
-
* Y position (in pixels)
|
|
22
|
-
*/
|
|
23
|
-
y?: number;
|
|
24
|
-
/**
|
|
25
|
-
* Width (in pixels)
|
|
26
|
-
*/
|
|
27
|
-
width?: number;
|
|
28
|
-
/**
|
|
29
|
-
* Height (in pixels)<br/>
|
|
30
|
-
* @default width
|
|
31
|
-
*/
|
|
32
|
-
height?: number;
|
|
33
27
|
/**
|
|
34
28
|
* CSS color for **enabled** state
|
|
35
29
|
*/
|
|
@@ -46,12 +40,6 @@ interface IndicatorProps {
|
|
|
46
40
|
* Custom class name to be attached
|
|
47
41
|
*/
|
|
48
42
|
className?: string;
|
|
49
|
-
/**
|
|
50
|
-
* Enable absolute positioning for the component, allowing it to be
|
|
51
|
-
* placed on a specific position of its parent. This is useful when
|
|
52
|
-
* laying components over an image or wireframe.
|
|
53
|
-
*/
|
|
54
|
-
useAbsolutePositioning?: boolean;
|
|
55
43
|
/**
|
|
56
44
|
* The topic to monitor to display. Optional.
|
|
57
45
|
*/
|
|
@@ -65,12 +53,9 @@ export declare class Indicator extends Component<IndicatorProps, IndicatorState>
|
|
|
65
53
|
static contextType: React.Context<EventEmitterContextType>;
|
|
66
54
|
protected unsubscribeTopicId: number | null;
|
|
67
55
|
static defaultProps: {
|
|
68
|
-
width: number;
|
|
69
|
-
height: number;
|
|
70
56
|
onColor: string;
|
|
71
57
|
offColor: string;
|
|
72
58
|
invalidColor: string;
|
|
73
|
-
useAbsolutePositioning: boolean;
|
|
74
59
|
};
|
|
75
60
|
constructor(props: IndicatorProps);
|
|
76
61
|
componentDidMount(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{Component}from"react";import
|
|
1
|
+
import{jsx as _jsx,jsxs as _jsxs}from"react/jsx-runtime";import{Component}from"react";import{EventEmitterContext}from"../core/EventEmitterContext";import{IndicatorColor}from"../core/IndicatorColor";export{IndicatorColor};export class Indicator extends Component{constructor(e){super(e),Object.defineProperty(this,"unsubscribeTopicId",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.state={subscribedValue:e.value,fontSize:"100%"}}componentDidMount(){const{topic:e}=this.props;if(e&&null===this.unsubscribeTopicId){const{subscribe:t}=this.context;this.unsubscribeTopicId=t(e,(e=>{this.setState({subscribedValue:e})}))}}componentDidUpdate(e){e.value!==this.props.value&&this.setState({subscribedValue:this.props.value})}componentWillUnmount(){if(null!==this.unsubscribeTopicId){const{unsubscribe:e}=this.context;e(this.unsubscribeTopicId),this.unsubscribeTopicId=null}}render(){const{label:e,value:t,onColor:o,offColor:r,invalidColor:s}=this.props,{subscribedValue:i}=this.state;let n,a=i;switch(void 0!==t&&(a=t),a){case!0:n=o;break;case!1:n=r;break;default:n=s}return _jsxs("div",{className:"p-inputgroup flex-1",style:{alignItems:"center !important"},children:[_jsx("span",{className:"p-inputgroup-addon",style:{backgroundColor:n,width:"22px"},children:" "}),_jsx("span",{className:"p-inputgroup-addon",children:e})]})}}Object.defineProperty(Indicator,"contextType",{enumerable:!0,configurable:!0,writable:!0,value:EventEmitterContext}),Object.defineProperty(Indicator,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{onColor:"green",offColor:"gray",invalidColor:"black"}});export default Indicator;
|
|
@@ -1,28 +1,51 @@
|
|
|
1
1
|
import { Component } from 'react';
|
|
2
2
|
import { ButtonProps } from 'primereact/button';
|
|
3
3
|
import { EventEmitterContextType } from '../core/EventEmitterContext';
|
|
4
|
-
import { IndicatorColor } from "
|
|
4
|
+
import { IndicatorColor } from "../core/IndicatorColor";
|
|
5
5
|
export { IndicatorColor };
|
|
6
|
+
import { ActionMode } from '../core/ActionMode';
|
|
7
|
+
export { ActionMode };
|
|
8
|
+
import { IndicatorButtonState } from '../core/IndicatorButtonState';
|
|
9
|
+
export declare type IndicatorButtonOptionsType = string[] | undefined[] | undefined;
|
|
6
10
|
/**
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
11
|
+
* Common properties for an indicating button, toggle or similar component.
|
|
12
|
+
* These types of components both indicate a state and execute commands/signals.
|
|
13
|
+
* This type of component is very common in industrial HMIs.
|
|
14
|
+
*
|
|
15
|
+
* These properties support displaying values of boolean, number and string states.
|
|
16
|
+
*
|
|
17
|
+
* Available boolean states: **on**, **off** and **not available**:
|
|
18
|
+
*
|
|
19
|
+
* * `true` is treated as **on**
|
|
20
|
+
* * `false` is treated as **off**
|
|
21
|
+
* * `undefined` is treated as **not available**
|
|
22
|
+
*
|
|
23
|
+
* Numeric values can be used. When there is only 2 or less possible states,
|
|
24
|
+
* 0 will be considered false (OFF), anything else will be considered true (ON).
|
|
25
|
+
* Undefined will be treated as "not available.""
|
|
26
|
+
*
|
|
27
|
+
* When the indicator contains more than 2 states, then the number will be matched
|
|
28
|
+
* to the available state, in order. More than two states requires usage of the
|
|
29
|
+
* options field, and declaring more than two states there.
|
|
30
|
+
*
|
|
31
|
+
* If a string state is used, it will be matched exactly to the matching
|
|
32
|
+
* label in the `options` field.
|
|
33
|
+
*
|
|
17
34
|
*
|
|
18
35
|
* For more information on the AutoCore Button API Specification, see
|
|
19
36
|
* [Additional Documentation](../additional-docs/ButtonApiSpecs.md).
|
|
20
37
|
*/
|
|
21
|
-
export interface IndicatorButtonProps extends ButtonProps {
|
|
38
|
+
export interface IndicatorButtonProps extends Omit<ButtonProps, 'value'> {
|
|
22
39
|
/**
|
|
23
40
|
* Topic name to monitor for state indication.
|
|
41
|
+
* If `value` field is not undefined, then that value is used instead.
|
|
24
42
|
*/
|
|
25
43
|
topic?: string;
|
|
44
|
+
/**
|
|
45
|
+
* State to be displayed.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
value?: boolean | number | string;
|
|
26
49
|
/**
|
|
27
50
|
* Color for the button when the state is TRUE.
|
|
28
51
|
*/
|
|
@@ -32,13 +55,30 @@ export interface IndicatorButtonProps extends ButtonProps {
|
|
|
32
55
|
*/
|
|
33
56
|
offColor?: IndicatorColor;
|
|
34
57
|
/**
|
|
35
|
-
*
|
|
58
|
+
* An array of string labels to display as the available options.
|
|
59
|
+
*
|
|
60
|
+
* For items with 2 states or less:
|
|
61
|
+
* Index 0 is the label when value is OFF.
|
|
62
|
+
* Index 1 is the label when value is ON.
|
|
63
|
+
*
|
|
64
|
+
* If only only value is given (Index 0), then that value is used for all states.
|
|
65
|
+
* For many controls, this is the same as setting the `label` field and leaving this
|
|
66
|
+
* field undefined.
|
|
67
|
+
*/
|
|
68
|
+
options?: IndicatorButtonOptionsType;
|
|
69
|
+
/**
|
|
70
|
+
* Icon to be displayed on the button. Overrideen by onIcon or offIcon if those
|
|
71
|
+
* are not undefined.
|
|
36
72
|
*/
|
|
37
|
-
|
|
73
|
+
icon?: string;
|
|
38
74
|
/**
|
|
39
|
-
*
|
|
75
|
+
* Icon displayed when the state is TRUE. Falls back to `icon` if undefined.
|
|
40
76
|
*/
|
|
41
|
-
|
|
77
|
+
onIcon?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Icon displayed when the state is FALSE. Falls back to `icon` if undefined.
|
|
80
|
+
*/
|
|
81
|
+
offIcon?: string;
|
|
42
82
|
/**
|
|
43
83
|
* Name of the command to invoke on button events.
|
|
44
84
|
* If command is "*", then the commandTopic will be dispatched
|
|
@@ -72,27 +112,6 @@ export interface IndicatorButtonProps extends ButtonProps {
|
|
|
72
112
|
*/
|
|
73
113
|
invert?: boolean;
|
|
74
114
|
}
|
|
75
|
-
/**
|
|
76
|
-
* State for the IndicatorButton.
|
|
77
|
-
*/
|
|
78
|
-
export interface IndicatorButtonState {
|
|
79
|
-
/**
|
|
80
|
-
* Current value/state of the button based on the subscribed topic.
|
|
81
|
-
*/
|
|
82
|
-
currentValue?: boolean;
|
|
83
|
-
/**
|
|
84
|
-
* Indicates whether the button is disabled.
|
|
85
|
-
*/
|
|
86
|
-
isDisabled?: boolean;
|
|
87
|
-
/**
|
|
88
|
-
* Indicates whether the button is invisible.
|
|
89
|
-
*/
|
|
90
|
-
isInvisible?: boolean;
|
|
91
|
-
/**
|
|
92
|
-
* The button is in the "down" state.
|
|
93
|
-
*/
|
|
94
|
-
isPressed: boolean;
|
|
95
|
-
}
|
|
96
115
|
export declare class IndicatorButton extends Component<IndicatorButtonProps, IndicatorButtonState> {
|
|
97
116
|
static contextType: import("react").Context<EventEmitterContextType>;
|
|
98
117
|
static defaultProps: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as _jsx}from"react/jsx-runtime";import{Component}from"react";import{Button}from"primereact/button";import{EventEmitterContext}from"../core/EventEmitterContext";import{IndicatorColor}from"
|
|
1
|
+
import{jsx as _jsx}from"react/jsx-runtime";import{Component}from"react";import{Button}from"primereact/button";import{EventEmitterContext}from"../core/EventEmitterContext";import{IndicatorColor}from"../core/IndicatorColor";export{IndicatorColor};import{ActionMode}from"../core/ActionMode";export{ActionMode};export class IndicatorButton extends Component{constructor(e){super(e),Object.defineProperty(this,"handleTopicUpdate",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.setState({currentValue:e})}}),Object.defineProperty(this,"handleDisableTopicUpdate",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.setState({isDisabled:e})}}),Object.defineProperty(this,"handleInvisibleTopicUpdate",{enumerable:!0,configurable:!0,writable:!0,value:e=>{this.setState({isInvisible:e})}}),this.state={currentValue:void 0,isDisabled:!1,isInvisible:!1,isPressed:!1}}componentDidMount(){this.setupSubscriptions()}componentDidUpdate(e){}componentWillUnmount(){}setupSubscriptions(){const{topic:e,disableTopic:t,invisibleTopic:o}=this.props,{subscribe:i}=this.context;e&&i(e,this.handleTopicUpdate),t&&i(t,this.handleDisableTopicUpdate),o&&i(o,this.handleInvisibleTopicUpdate)}handleOnPressed(){const{isPressed:e}=this.state,{actionMode:t}=this.props;e||(this.setState({isPressed:!0}),t!==ActionMode.Tap&&t!==ActionMode.Pressed||this.dispatchCommand(!0))}handleOnReleased(){const{isPressed:e}=this.state,{actionMode:t}=this.props;e&&(this.setState({isPressed:!1}),t===ActionMode.Tap?this.dispatchCommand(!1):t===ActionMode.Released&&this.dispatchCommand(!0))}dispatchCommand(e){const{command:t,commandTopic:o,commandArgs:i}=this.props,{dispatch:n}=this.context;if(null!=t&&t.length>0){n({topic:t,payload:{topic:o,value:e,...i}})}}render(){const{currentValue:e,isDisabled:t,isInvisible:o}=this.state,{className:i,severity:n,label:s,raised:a,value:r,onColor:l,offColor:d,options:c,topic:p,command:u,commandArgs:h,disableTopic:m,invisibleTopic:b,inputMode:f,invert:v,onIcon:C,offIcon:I,icon:T,...x}=this.props;let P,M=e;void 0!==r&&(M=r),null!=c?(P=M?c[1]:c[0],null!=P&&0!==P.length||(P=s)):P=s;let g=M?C:I;null!=g&&0!==g.length||(g=T);let y=M?l:d;return void 0===M&&(y=IndicatorColor.IndicatorInvalid),_jsx(Button,{...x,label:P,icon:`pi ${g}`,className:i,style:{color:"white",backgroundColor:y,display:o?"none":"block"},disabled:t,onMouseDown:()=>this.handleOnPressed(),onTouchStart:()=>this.handleOnPressed(),onMouseUp:()=>this.handleOnReleased(),onTouchEnd:()=>this.handleOnReleased(),value:m,raised:!0})}}Object.defineProperty(IndicatorButton,"contextType",{enumerable:!0,configurable:!0,writable:!0,value:EventEmitterContext}),Object.defineProperty(IndicatorButton,"defaultProps",{enumerable:!0,configurable:!0,writable:!0,value:{onColor:IndicatorColor.IndicatorGreen,offColor:"gray"}});export default IndicatorButton;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (C) 2024 Automated Design Corp. All Rights Reserved.
|
|
3
|
+
* Created Date: 2024-01-16 13:17:33
|
|
4
|
+
* -----
|
|
5
|
+
* Last Modified: 2024-03-19 10:37:26
|
|
6
|
+
* -----
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
.jogpanel-container {
|
|
11
|
+
margin: 2mm;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column; /* Stack children vertically */
|
|
14
|
+
align-items: center; /* Center children horizontally within the container */
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.grid-container {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 10px; /* Adjust the gap between rows */
|
|
21
|
+
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.grid-row {
|
|
25
|
+
display: flex;
|
|
26
|
+
justify-content: space-between;
|
|
27
|
+
gap: 10px; /* Adjust the gap between buttons */
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.button-item {
|
|
31
|
+
flex: 1; /* Make buttons expand to fill the row */
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.distance-selector {
|
|
35
|
+
margin-top: 2mm; /* Gap between buttons and distance selector */
|
|
36
|
+
margin-left: auto;
|
|
37
|
+
margin-right: auto;
|
|
38
|
+
width: -moz-fit-content;
|
|
39
|
+
width: fit-content;
|
|
40
|
+
}
|
|
41
|
+
|