From dbcc5f1370eab62c5885955dc5b6913644a41484 Mon Sep 17 00:00:00 2001 From: Felix Erdmann Date: Fri, 20 Dec 2024 13:58:39 +0000 Subject: [PATCH 1/6] feat: read library list from compiler api --- src/components/CodeEditor/Sidebar.js | 31 +++++- src/data/versions.js | 157 --------------------------- 2 files changed, 26 insertions(+), 162 deletions(-) delete mode 100644 src/data/versions.js diff --git a/src/components/CodeEditor/Sidebar.js b/src/components/CodeEditor/Sidebar.js index 4820e4c2..457d7477 100644 --- a/src/components/CodeEditor/Sidebar.js +++ b/src/components/CodeEditor/Sidebar.js @@ -5,7 +5,6 @@ import Accordion from "@mui/material/Accordion"; import AccordionSummary from "@mui/material/AccordionSummary"; import AccordionDetails from "@mui/material/AccordionDetails"; import Typography from "@mui/material/Typography"; -import { LibraryVersions } from "../../data/versions.js"; import { useMonaco } from "@monaco-editor/react"; import { Button } from "@mui/material"; import SerialMonitor from "./SerialMonitor.js"; @@ -34,6 +33,27 @@ const Sidebar = () => { }); }; + const [libraries, setLibraries] = React.useState([]); + React.useEffect(() => { + const fetchLibraries = async () => { + const { data } = await axios.get( + `${process.env.REACT_APP_COMPILER_URL}/libraries`, + { + params: { + format: "json", + }, + } + ); + const myLibs = data.installed_libraries + .map(({ library }) => library) + .filter((lib) => lib.location == "user") + .sort((a, b) => a.name.localeCompare(b.name)); + + setLibraries(myLibs); + }; + fetchLibraries(); + }, []); + return (
{"serial" in navigator ? ( @@ -128,15 +148,16 @@ const Sidebar = () => { style={{ overflow: "auto", width: "100%", + height: "100%", padding: "1rem", }} >

{Blockly.Msg.codeeditor_libraries_text}

- {LibraryVersions().map((object, i) => { + {libraries.map((library, i) => { return ( -

- - {object.library} {object.version} +

+ + {library.name} {library.version}

); diff --git a/src/data/versions.js b/src/data/versions.js deleted file mode 100644 index 5315dfc6..00000000 --- a/src/data/versions.js +++ /dev/null @@ -1,157 +0,0 @@ -export const LibraryVersions = () => { - return [ - { - library: "SSD1306 Plot Library", - link: "https://github.com/sensebox/SSD1306-Plot-Library/", - }, - { - library: "SDS011 Library", - link: "https://github.com/sensebox/SDS011-select-serial/", - }, - { - library: "RV8523 Arduino Library", - link: "https://github.com/sensebox/RV8523-RTC-Arduino-Library", - }, - { - library: "BMX055_Library", - link: "https://github.com/sensebox/BMX055-Arduino-Library/", - }, - { - library: "LTR329", - link: "https://github.com/sensebox/LTR329-Lightsensor-Arduino-Library/", - }, - { - library: "VEML6070", - link: "https://github.com/sensebox/VEML6070-UV-Arduino-Library/", - }, - { - library: "senseBox Web Library", - link: "https://github.com/sensebox/sensebox-libweb/", - }, - { - library: "Arduino WiFi101", - link: "https://github.com/arduino-libraries/WiFi101", - }, - { - library: "Ethernet", - link: "https://github.com/arduino-libraries/Ethernet", - }, - { - library: "ArduinoJson", - link: "https://github.com/bblanchon/ArduinoJson", - }, - { - library: "Adafruit Sensor Library", - link: "https://github.com/adafruit/Adafruit_Sensor", - }, - { - library: "Adafruit HDC1000 Library", - link: "https://github.com/adafruit/Adafruit_HDC1000_Library", - }, - { - library: "Adafruit BME280 Library", - link: "https://github.com/adafruit/Adafruit_BME280_Library", - }, - { - library: "Adafruit BMP280 Library", - link: "https://github.com/adafruit/Adafruit_BMP280_Library", - }, - { - library: "Adafruit BME680 Library", - link: "https://github.com/adafruit/Adafruit_BME680", - }, - { - library: "Adafruit DPS310", - link: "https://github.com/adafruit/Adafruit_DPS310", - }, - { - library: "Adafruit NeoPixel", - link: "https://github.com/adafruit/Adafruit_NeoPixel", - }, - { - library: "Adafruit SSD1306", - link: "https://github.com/adafruit/Adafruit_SSD1306", - }, - { - library: "Adafruit GFX Library", - link: "https://github.com/adafruit/Adafruit-GFX-Library", - }, - { - library: "Adafruit MQTT Library", - link: "https://github.com/adafruit/Adafruit_MQTT_Library", - }, - { - library: "Adafruit BusIO", - link: "https://github.com/adafruit/Adafruit_BusIO", - }, - { - library: "Adafruit SleepyDog Library", - link: "https://github.com/adafruit/Adafruit_SleepyDog", - }, - { - library: "DallasTemperature", - link: "https://github.com/milesburton/Arduino-Temperature-Control-Library", - }, - { - library: "ArduinoBearSSL", - link: "https://github.com/arduino-libraries/ArduinoBearSSL", - }, - { - library: "ArduinoECCX08", - link: "https://github.com/arduino-libraries/ArduinoECCX08", - }, - { - library: "SparkFun SCD30 Arduino Library", - link: "https://github.com/sparkfun/SparkFun_SCD30_Arduino_Library", - }, - { - library: "SparkFun u-blox GNSS Arduino Library", - link: "https://github.com/sparkfun/SparkFun_u-blox_GNSS_Arduino_Library", - }, - { - library: "NewPing", - link: "https://bitbucket.org/teckel12/arduino-new-ping/wiki/Home", - }, - { - library: "IBM LMIC framework", - link: "https://github.com/matthijskooijman/arduino-lmic", - }, - { - library: "LoRa Serialization", - link: "https://github.com/thesolarnomad/lora-serialization", - }, - { - library: "CayenneLPP", - link: "https://github.com/ElectronicCats/CayenneLPP", - }, - { - library: "OneWire", - link: "https://github.com/PaulStoffregen/OneWire", - }, - { - library: "Nova Fitness Sds dust sensors library", - link: "https://github.com/lewapek/sds-dust-sensors-arduino-library", - }, - { - library: "JC_Button", - link: "https://github.com/JChristensen/JC_Button", - }, - { library: "SD", link: "https://github.com/arduino-libraries/SD" }, - { - library: "BSEC Software Library", - link: "https://github.com/BoschSensortec/BSEC-Arduino-library", - }, - { - library: "TheThingsNetwork", - link: "https://github.com/TheThingsNetwork/arduino-device-lib", - }, - { - library: "NTPClient", - link: "https://github.com/arduino-libraries/NTPClient", - }, - { - library: "phyphox BLE", - link: "https://github.com/phyphox/phyphox-arduino", - }, - ]; -}; From 73cbf25a249c6544b045a6fc9a921c24710bcada Mon Sep 17 00:00:00 2001 From: Eric Thieme-Garmann Date: Fri, 10 Jan 2025 15:18:44 +0100 Subject: [PATCH 2/6] update hint box links --- .../Blockly/blocks/sensebox-display.js | 2 +- src/components/Blockly/blocks/sensebox-led.js | 23 ++++- .../Blockly/blocks/sensebox-osem.js | 2 +- .../Blockly/blocks/sensebox-sensors.js | 3 + .../Blockly/msg/de/sensebox-display.js | 1 + src/components/Blockly/msg/de/sensebox-led.js | 3 + .../Blockly/msg/de/sensebox-osem.js | 2 +- .../Blockly/msg/de/sensebox-sensors.js | 25 +++-- src/components/TooltipViewer.js | 91 +++++++------------ 9 files changed, 81 insertions(+), 71 deletions(-) diff --git a/src/components/Blockly/blocks/sensebox-display.js b/src/components/Blockly/blocks/sensebox-display.js index dc4b42de..b4916b4f 100644 --- a/src/components/Blockly/blocks/sensebox-display.js +++ b/src/components/Blockly/blocks/sensebox-display.js @@ -219,7 +219,7 @@ Blockly.Blocks["sensebox_display_show"] = { this.appendDummyInput().appendField(Blockly.Msg.sensebox_display_show); this.appendStatementInput("SHOW"); this.setTooltip(Blockly.Msg.sensebox_display_show_tip); - this.setHelpUrl(""); + this.setHelpUrl(Blockly.Msg.senseBox_display_helpurl); this.setPreviousStatement(true, null); this.setNextStatement(true, null); }, diff --git a/src/components/Blockly/blocks/sensebox-led.js b/src/components/Blockly/blocks/sensebox-led.js index 7be4a6a2..4968f3cb 100644 --- a/src/components/Blockly/blocks/sensebox-led.js +++ b/src/components/Blockly/blocks/sensebox-led.js @@ -97,6 +97,12 @@ Blockly.Blocks["sensebox_ws2818_led"] = { this.setPreviousStatement(true, null); this.setNextStatement(true, null); this.setTooltip(Blockly.Msg.senseBox_ws2818_rgb_led_tooltip); + if (selectedBoard().title === "MCU-S2") { + this.setHelpUrl(Blockly.Msg.senseBox_ws2818_rgb_led_helpurl); + } + else { + this.setHelpUrl(Blockly.Msg.senseBox_ws2818_rgb_led_helpurl_2); + } }, }; @@ -216,6 +222,7 @@ Blockly.Blocks["sensebox_ws2812_matrix_init"] = { this.setPreviousStatement(true, null); this.setNextStatement(true, null); this.setTooltip(Blockly.Msg.senseBox_ws2812_rgb_matrix_init_tooltip); + this.setHelpUrl(Blockly.Msg.senseBox_ws2812_rgb_matrix_helpurl); }, }; @@ -246,6 +253,9 @@ Blockly.Blocks["sensebox_ws2812_matrix_text"] = { this.setPreviousStatement(true, null); this.setNextStatement(true, null); this.setTooltip(Blockly.Msg.senseBox_ws2812_rgb_matrix_print_tooltip); + this.setHelpUrl(Blockly.Msg.senseBox_ws2812_rgb_matrix_helpurl); + + }, }; @@ -274,6 +284,8 @@ Blockly.Blocks["sensebox_ws2812_matrix_drawPixel"] = { this.setPreviousStatement(true, null); this.setNextStatement(true, null); this.setTooltip(Blockly.Msg.senseBox_ws2812_rgb_matrix_draw_pixel_tooltip); + this.setHelpUrl(Blockly.Msg.senseBox_ws2812_rgb_matrix_helpurl); + }, }; @@ -290,6 +302,8 @@ Blockly.Blocks["sensebox_ws2812_matrix_clear"] = { this.setPreviousStatement(true, null); this.setNextStatement(true, null); this.setTooltip(Blockly.Msg.senseBox_ws2812_rgb_matrix_clear_tooltip); + this.setHelpUrl(Blockly.Msg.senseBox_ws2812_rgb_matrix_helpurl); + }, }; @@ -309,6 +323,8 @@ Blockly.Blocks["sensebox_ws2812_matrix_showBitmap"] = { this.setPreviousStatement(true, null); this.setNextStatement(true, null); this.setTooltip(Blockly.Msg.senseBox_ws2812_rgb_matrix_show_bitmap_tooltip); + this.setHelpUrl(Blockly.Msg.senseBox_ws2812_rgb_matrix_helpurl); + }, }; @@ -332,6 +348,8 @@ Blockly.Blocks["sensebox_ws2812_matrix_bitmap"] = { ); this.setOutput(true, "Bitmap"); this.setTooltip(Blockly.Msg.senseBox_ws2812_rgb_matrix_bitmap_tooltip); + this.setHelpUrl(Blockly.Msg.senseBox_ws2812_rgb_matrix_helpurl); + }, }; @@ -350,6 +368,8 @@ Blockly.Blocks["sensebox_ws2812_matrix_custom_bitmap"] = { this.setTooltip( Blockly.Msg.senseBox_ws2812_rgb_matrix_custom_bitmap_tooltip, ); + this.setHelpUrl(Blockly.Msg.senseBox_ws2812_rgb_matrix_helpurl); + }, }; @@ -867,6 +887,7 @@ Blockly.defineBlocksWithJsonArray([ output: "Bitmap", colour: getColour().sensebox, tooltip: Blockly.Msg.senseBox_ws2812_rgb_matrix_draw_bitmap_tooltip, - helpUrl: "", + helpUrl: Blockly.Msg.senseBox_ws2812_rgb_matrix_helpurl, + }, ]); diff --git a/src/components/Blockly/blocks/sensebox-osem.js b/src/components/Blockly/blocks/sensebox-osem.js index 8d08dbe3..1af023ab 100644 --- a/src/components/Blockly/blocks/sensebox-osem.js +++ b/src/components/Blockly/blocks/sensebox-osem.js @@ -127,7 +127,7 @@ Blockly.Blocks["sensebox_osem_connection"] = { Blockly.Blocks["sensebox_send_to_osem"] = { init: function () { this.setTooltip(Blockly.Msg.senseBox_send_to_osem_tip); - this.setHelpUrl(""); + this.setHelpUrl(Blockly.Msg.senseBox_osem_connection_helpurl); this.setColour(getColour().sensebox); this.appendDummyInput().appendField(Blockly.Msg.senseBox_send_to_osem); if (boxes) { diff --git a/src/components/Blockly/blocks/sensebox-sensors.js b/src/components/Blockly/blocks/sensebox-sensors.js index 64344a8e..8dba7655 100644 --- a/src/components/Blockly/blocks/sensebox-sensors.js +++ b/src/components/Blockly/blocks/sensebox-sensors.js @@ -329,6 +329,7 @@ Blockly.Blocks["sensebox_tof_imager"] = { .appendField(dropdown, "dropdown"); this.setOutput(true, Types.NUMBER.typeName); this.setTooltip(Blockly.Msg.sensebox_tof_imager_tooltip); + this.setHelpUrl(Blockly.Msg.sensebox_tof_imager_helpurl); this.getField("dropdown").setValidator( function (val) { this.updateShape_(val === "DistanzBM"); @@ -478,6 +479,7 @@ Blockly.Blocks["sensebox_gps"] = { this.setOutput(true, Types.NUMBER.typeName); this.setColour(getColour().sensebox); this.setTooltip(Blockly.Msg.senseBox_gps_tooltip); + this.setHelpUrl(Blockly.Msg.senseBox_gps_helpurl); }, }; @@ -702,6 +704,7 @@ Blockly.Blocks["sensebox_esp32s2_light"] = { this.setOutput(true, Types.DECIMAL.typeName); this.setColour(getColour().sensebox); this.setTooltip(Blockly.Msg.senseBox_esp32_photodiode_tooltip); + this.setHelpUrl(Blockly.Msg.senseBox_esp32_photodiode_helpurl); this.data = { name: "Photodiode" }; }, }; diff --git a/src/components/Blockly/msg/de/sensebox-display.js b/src/components/Blockly/msg/de/sensebox-display.js index b475aeb1..b7c756b4 100644 --- a/src/components/Blockly/msg/de/sensebox-display.js +++ b/src/components/Blockly/msg/de/sensebox-display.js @@ -8,6 +8,7 @@ export const DISPLAY = { **Anschluss:** I2C `, + senseBox_display_clearDisplay_tooltip: "Löscht die Anzeige auf dem Display. Sollte immer zu Begin oder am Ende der Endlosschleife aufgerufen werden.", senseBox_display_clearDisplay: "Display löschen", diff --git a/src/components/Blockly/msg/de/sensebox-led.js b/src/components/Blockly/msg/de/sensebox-led.js index 4c3a44f5..9b2091fe 100644 --- a/src/components/Blockly/msg/de/sensebox-led.js +++ b/src/components/Blockly/msg/de/sensebox-led.js @@ -10,6 +10,8 @@ export const LED = { senseBox_ws2818_rgb_led_init_tooltip: `Schließe die RGB-LED an einen der **digital/analog Ports** an. Wenn mehrere RGB-LEDs miteinander verkettet werden kannst du über die Position bestimmen welche LED angesteuert wird. `, senseBox_ws2818_rgb_led_color: `Farbe`, senseBox_ws2818_rgb_led_number: `Anzahl`, + senseBox_ws2818_rgb_led_helpurl: 'https://docs.sensebox.de/docs/hardware/accessoires/rgb-led-esp32', + senseBox_ws2818_rgb_led_helpurl_2: 'https://docs.sensebox.de/docs/hardware/accessoires/rgb-led', /** * Color @@ -75,4 +77,5 @@ export const LED = { `0x29B3, 0x74DA, 0x74DA, 0x74DA, 0x0000, 0x0000, 0x0000, 0xB5B6, 0x0000, 0x0000, 0x29B3, 0x29B3, 0x29B3, 0x0000, 0x0000, 0x0000, // 0x0060 (96) pixels}`, senseBox_ws2812_rgb_matrix_draw_bitmap: `Male eine eigene Bitmap`, senseBox_ws2812_rgb_matrix_draw_bitmap_tooltip: `Wähle anzuzeigende Farben für die einzelnen Pixel aus.`, + senseBox_ws2812_rgb_matrix_helpurl: 'https://docs.sensebox.de/docs/hardware/accessoires/led-matrix', }; diff --git a/src/components/Blockly/msg/de/sensebox-osem.js b/src/components/Blockly/msg/de/sensebox-osem.js index 79f62a65..827861b9 100644 --- a/src/components/Blockly/msg/de/sensebox-osem.js +++ b/src/components/Blockly/msg/de/sensebox-osem.js @@ -4,7 +4,7 @@ export const OSEM = { */ senseBox_osem_connection_tip: "Verwende diesen Block, um deine senseBox mit der openSenseMap zu verbinden. Registriere deine senseBox auf der openSenseMap und trage die IDs und den API-Schlüssel ein. Verwende anschließend den Block ***Sende Messwert an die openSenseMap*** und die Sensor-ID, um die Messwerte zu übertragen.", - senseBox_osem_connection_helpurl: "https://www.opensensemap.org/", + senseBox_osem_connection_helpurl: "https://docs.sensebox.de/docs/editors/blockly/blocks/web/opensensemap", senseBox_send_to_osem_tip: "Sende mit diesem Block Messwerte an die openSenseMap. Verwende pro Messwert einen Block und trage die zugewiesene Sensor ID ein", senseBox_send_to_osem: "Sende Messwert an die openSenseMap", diff --git a/src/components/Blockly/msg/de/sensebox-sensors.js b/src/components/Blockly/msg/de/sensebox-sensors.js index de40b62f..50cd52c2 100644 --- a/src/components/Blockly/msg/de/sensebox-sensors.js +++ b/src/components/Blockly/msg/de/sensebox-sensors.js @@ -24,14 +24,14 @@ export const SENSORS = { senseBox_sensor_dps310: "Luftdruck-/Temperatursensor (DPS310)", senseBox_sensor_dps310_tooltip: "Schließe den Sensor an einen der **I2C-Anschlüsse** an. Der Sensor gibt dir den Messwert für den Luftdruck in hPa. Um die korrekte Höhe über NN zu berechnen benötigt der Sensor einen aktuellen Referenzwert.", - senseBox_sensor_dps310_helpurl: "", + senseBox_sensor_dps310_helpurl: "https://docs.sensebox.de/docs/hardware/sensors/luftdruck-temperatur", /** * Mikro */ senseBox_sound: "Mikrofon", - senseBox_sound_tip: - "Schließe den Sensor über das Breadbord an einen der **analog/digital** Ports an. Gibt den Messwert des Mikrofons in Volt zurück", + senseBox_sound_tooltip: + "Schließe den Sensor über das Breadbord an einen der **Analog/Digital** Ports an. Gibt den Messwert des Mikrofons in Volt zurück", senseBox_sound_helpurl: "https://docs.sensebox.de/hardware/sensoren-mikro/", /** @@ -116,7 +116,7 @@ Wenn die maximale Distanz überschritten wird, wird ein Wert von **O** ausgegebe **Beachte:** Das GPS Modul benöigt beim ersten Verwenden relativ lange (ca. 5-10 Minuten) bis es deinen Standort gefunden hat! `, - senseBox_gps_helpurl: "https://docs.sensebox.de/hardware/sensoren-gps/", + senseBox_gps_helpurl: "https://docs.sensebox.de/docs/hardware/accessoires/gps/", /** * Windspeed @@ -129,7 +129,7 @@ Wenn die maximale Distanz überschritten wird, wird ein Wert von **O** ausgegebe */ senseBox_soundsensor_dfrobot: "Soundsensor (DF Robot)", senseBox_soundsensor_dfrobot_tooltip: - "Schließe den Sensor an einen der **digital/analog Ports** an. Der Sensor gibt dir den Messwert in dB mit einer Nachkommastelle", + "Schließe den Sensor an einen der **Digital/Analog Ports** an. Der Sensor gibt dir den Messwert in dB mit einer Nachkommastelle", senseBox_soundsensor_dfrobot_helpurl: "https://docs.sensebox.de/hardware/sensoren-lautstaerke/", /* @@ -185,7 +185,7 @@ Die Messwerte für Temperatur, Luftfeuchtigkeit und Luftdruck können direkt ver senseBox_sds011_serial1: "Serial1", senseBox_sds011_serial2: "Serial2", senseBox_sds011_helpurl: - "https://docs.sensebox.de/hardware/sensoren-feinstaub/", + "https://docs.sensebox.de/docs/hardware/sensors/feinstaub-sds011/", /** * Button @@ -215,7 +215,7 @@ Die Messwerte für Temperatur, Luftfeuchtigkeit und Luftdruck können direkt ver senseBox_sps30_tooltip: "Dieser Block gibt dir den Messwert des Sensirion SPS30 Feinstaubsensor. Schließe den Feinstaubsensor an einen der **I2C** Anschlüssen an. Im Dropdown Menü zwischen PM1.0, PM2.5, PM4.0 und PM10 auswählen. Der Messwert wird dir als **Kommazahl** in µg/m3", senseBox_sps30_helpurl: - "https://docs.sensebox.de/hardware/sensoren-feinstaub/", + "https://docs.sensebox.de/docs/hardware/sensors/feinstaub-sps30/", /** * Photodiode MCUS2(ESP32) @@ -224,8 +224,16 @@ Die Messwerte für Temperatur, Luftfeuchtigkeit und Luftdruck können direkt ver senseBox_esp32_photodiode: "Lichtintensität", senseBox_esp32_photodiode_tooltip: "Die Photodiode misst Lichtintensität. Der ausgegebene Wert ist eine **Ganzzahl** zwischen 0 und 4095. Je höher der Wert, desto heller ist die Umgebung.", - + senseBox_esp32_photodiode_helpurl:"https://docs.sensebox.de/docs/hardware/sensors/photodiode", + /** + * MPU6050 */ + senseBox_mpu6050_tooltip: "Der MPU6050 ist ein Beschleunigungs- und Gyroskopsensor. Schließe den Sensor an einen der I2C Anschlüsse an. Der Sensor gibt dir die Beschleunigung in m/s² und die Winkelgeschwindigkeit in °/s zurück.", + senseBox_mpu6050_helpurl:"https://docs.sensebox.de/docs/hardware/sensors/mpu6050/", + + + + /** * ToF Imager * */ @@ -236,4 +244,5 @@ Die Messwerte für Temperatur, Luftfeuchtigkeit und Luftdruck können direkt ver sensebox_distance_bitmap: "8x8 Distanzen als Bitmap (für LED-Matrix)", sensebox_tof_imager_max_distance: "Maximal messbare Distanz ", sensebox_tof_imager_max_distance_unit: "cm", + sensebox_tof_imager_helpurl: "https://docs.sensebox.de/docs/hardware/sensors/tof", }; diff --git a/src/components/TooltipViewer.js b/src/components/TooltipViewer.js index 43fc80c7..1cbdfb2c 100644 --- a/src/components/TooltipViewer.js +++ b/src/components/TooltipViewer.js @@ -42,66 +42,39 @@ class TooltipViewer extends Component { render() { return ( - - - {Blockly.Msg.tooltip_viewer} - - - - - {this.props.tooltip} - - {store.getState().workspace.code.data ? ( - - ) : ( - {`${Blockly.Msg.tooltip_moreInformation} [${Blockly.Msg.labels_here}](${this.props.helpurl})`} - )} - - - {store.getState().workspace.code.data ? ( - { - this.toggleDialog(); - }} - maxWidth={"md"} - fullWidth={true} - > - - - - - - - - ) : null} + + + Sensor Informationen + + + {this.props.tooltip} + + {this.props.helpurl && ( + + )} + ); } From f558e20fd2b854d4479f6e328fe3859733fce3ba Mon Sep 17 00:00:00 2001 From: Eric Thieme-Garmann Date: Fri, 10 Jan 2025 16:06:10 +0100 Subject: [PATCH 3/6] fixed hitn button and styled a bit --- src/components/Blockly/msg/de/ui.js | 1 + src/components/CodeViewer.js | 2 +- src/components/TooltipViewer.js | 34 +++++++++++++++++++++++++---- 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/components/Blockly/msg/de/ui.js b/src/components/Blockly/msg/de/ui.js index 1181491f..3178d70d 100644 --- a/src/components/Blockly/msg/de/ui.js +++ b/src/components/Blockly/msg/de/ui.js @@ -323,6 +323,7 @@ export const UI = { tooltip_viewer: "Hilfe", tooltip_moreInformation: "Mehr Informationen findest du ", + tooltip_moreInformation_02: "Informationem zum Block", tooltip_hint: "Wähle einen Block aus um dir die Hilfe anzeigen zu lassen", /** diff --git a/src/components/CodeViewer.js b/src/components/CodeViewer.js index 8f892728..f2ec06b5 100644 --- a/src/components/CodeViewer.js +++ b/src/components/CodeViewer.js @@ -108,7 +108,7 @@ class CodeViewer extends Component { var curlyBrackets = "{ }"; var unequal = "<>"; return ( - + { @@ -44,18 +45,43 @@ class TooltipViewer extends Component { - - Sensor Informationen - + + + {Blockly.Msg.tooltip_moreInformation_02} + + + {this.props.tooltip} From 028d3e2e204c4f618e8a515073efa9e5c3f9aab4 Mon Sep 17 00:00:00 2001 From: Eric Thieme-Garmann Date: Tue, 21 Jan 2025 11:57:08 +0100 Subject: [PATCH 4/6] translation fixes --- src/components/Blockly/msg/de/ui.js | 2 +- src/components/Blockly/msg/en/ui.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Blockly/msg/de/ui.js b/src/components/Blockly/msg/de/ui.js index 82ee37e4..81a8bc16 100644 --- a/src/components/Blockly/msg/de/ui.js +++ b/src/components/Blockly/msg/de/ui.js @@ -322,7 +322,7 @@ export const UI = { */ tooltip_viewer: "Hilfe", - tooltip_moreInformation_02: "Informationem zum Block", + tooltip_moreInformation_02: "Informationen zum Block", tooltip_moreInformation: "Mehr Informationen", tooltip_hint: "Wähle einen Block aus um dir die Hilfe anzeigen zu lassen", diff --git a/src/components/Blockly/msg/en/ui.js b/src/components/Blockly/msg/en/ui.js index 4c3d4595..336ddddc 100644 --- a/src/components/Blockly/msg/en/ui.js +++ b/src/components/Blockly/msg/en/ui.js @@ -317,6 +317,7 @@ export const UI = { tooltip_viewer: "Help", tooltip_moreInformation: "More information", + tooltip_moreInformation_02: "Information about the Block", tooltip_hint: "Select a Block to show the hint", /** From 926205d944eacfd6c8c507a9ed06d489971c6ad2 Mon Sep 17 00:00:00 2001 From: Eric Thieme-Garmann Date: Tue, 21 Jan 2025 12:50:10 +0100 Subject: [PATCH 5/6] adjust border radius and background --- src/components/TooltipViewer.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/TooltipViewer.js b/src/components/TooltipViewer.js index bf1fdfa5..28a81e07 100644 --- a/src/components/TooltipViewer.js +++ b/src/components/TooltipViewer.js @@ -49,8 +49,7 @@ class TooltipViewer extends Component { overflowY: "scroll", marginTop: "1vh", padding: "1rem", - backgroundColor: "#f9f9f9", - borderRadius: "10px", + borderRadius: "4px", border: "1px solid #ddd", boxShadow: "0px 4px 6px rgba(0, 0, 0, 0.1)", }} From 92973bf39c76590407ab1d5c7965e06c480248a5 Mon Sep 17 00:00:00 2001 From: Eric Thieme-Garmann Date: Tue, 21 Jan 2025 12:51:17 +0100 Subject: [PATCH 6/6] slightly adjust padding --- src/components/TooltipViewer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/TooltipViewer.js b/src/components/TooltipViewer.js index 28a81e07..92fd7258 100644 --- a/src/components/TooltipViewer.js +++ b/src/components/TooltipViewer.js @@ -48,7 +48,7 @@ class TooltipViewer extends Component { height: "25vh", overflowY: "scroll", marginTop: "1vh", - padding: "1rem", + padding: "1.1rem", borderRadius: "4px", border: "1px solid #ddd", boxShadow: "0px 4px 6px rgba(0, 0, 0, 0.1)",