diff --git a/package.json b/package.json index 5bb3296..d3e4727 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ }, "devDependencies": { "@biomejs/biome": "^1.7.2", - "@leaphy-robotics/playwright-arduino": "^1.0.4", + "@leaphy-robotics/playwright-arduino": "1.0.5", "@playwright/test": "^1.43.1", "@sentry/vite-plugin": "^2.16.1", "@sveltejs/vite-plugin-svelte": "^3.0.2", @@ -21,7 +21,7 @@ "@types/node": "^20.11.30", "@types/w3c-web-serial": "^1.0.6", "@types/wicg-file-system-access": "^2023.10.5", - "svelte": "5.0.0-next.121", + "svelte": "5.0.0-next.134", "svelte-check": "3.7.1", "tslib": "^2.6.2", "typescript": "^5.2.2", @@ -32,7 +32,8 @@ "@blockly/field-bitmap": "^4.0.16", "@blockly/workspace-backpack": "^5.3.7", "@floating-ui/dom": "^1.6.3", - "@fortawesome/free-solid-svg-icons": "^6.5.2", + "@fortawesome/free-brands-svg-icons": "^6.6.0", + "@fortawesome/free-solid-svg-icons": "6.6.0", "@leaphy-robotics/avrdude-webassembly": "^1.6.1", "@leaphy-robotics/dfu-util-wasm": "^1.0.2", "@leaphy-robotics/leaphy-blocks": "3.2.1", diff --git a/src/app.css b/src/app.css index 98caf97..d9427d3 100644 --- a/src/app.css +++ b/src/app.css @@ -26,7 +26,7 @@ body[data-color-scheme="light"] { --accent: #32a5a9; --on-accent: #fff; --text-muted: #d3d3d3; - --warning: #ffb818; + --warning: #ffcc00; } body[data-color-scheme="dark"] { --background: #24242b; @@ -42,6 +42,7 @@ body[data-color-scheme="dark"] { --accent: #32a5a9; --on-accent: #fff; --text-muted: #535361; + --warning: #ffcc00; } body { diff --git a/src/assets/default-program.json b/src/assets/default-program.json new file mode 100644 index 0000000..966140a --- /dev/null +++ b/src/assets/default-program.json @@ -0,0 +1,14 @@ +{ + "blocks": { + "languageVersion": 0, + "blocks": [ + { + "type": "leaphy_start", + "id": "rzE0Ve:6bHB~8aIqyj-U", + "deletable": false, + "x": 500, + "y": 10 + } + ] + } +} diff --git a/src/assets/translations/en.json b/src/assets/translations/en.json index 6e48143..e74407d 100644 --- a/src/assets/translations/en.json +++ b/src/assets/translations/en.json @@ -124,5 +124,11 @@ "EXPLAIN_BLOCK": "Explain Block ✨", "META_ATTRIBUTION": "Built with Meta Llama 3", "AI_RATE_LIMITED": "The explanation robot is a little too busy right now, please try again later.", - "CHOOSING_ROBOT": "Choose your board" + "CHOOSING_ROBOT": "Choose your board", + "INVALID_ROBOT": "The selected robot {robot} does not work with the automatically detected {board}!", + "INCOMPATIBLE_PROJECT": "Incompatible", + "CONTINUE": "Continue", + "UNKNOWN_BOARD": "Unknown", + "CLEAR_PROJECT": "Clear project", + "CLEAR_PROJECT_DESC": "Selecting this robot will clear your project, are you sure?" } diff --git a/src/assets/translations/nl.json b/src/assets/translations/nl.json index 96c3cde..3551bcb 100644 --- a/src/assets/translations/nl.json +++ b/src/assets/translations/nl.json @@ -124,5 +124,11 @@ "EXPLAIN_BLOCK": "Leg blok uit ✨", "META_ATTRIBUTION": "Gemaakt met Meta Llama 3", "AI_RATE_LIMITED": "De uitleg robot is op dit moment erg druk, probeer het later nog eens.", - "CHOOSING_ROBOT": "Kies je arduino" + "CHOOSING_ROBOT": "Kies je arduino", + "INVALID_ROBOT": "De geselecteerde robot {robot} werkt niet met de automatisch gedetecteerde {board}!", + "INCOMPATIBLE_PROJECT": "Ongeschikt", + "CONTINUE": "Ga door", + "UNKNOWN_BOARD": "Onbekend", + "CLEAR_PROJECT": "Wis project", + "CLEAR_PROJECT_DESC": "Door deze robot te selecteren wis je je project, weet je het zeker?" } diff --git a/src/lib/components/core/header/Header.svelte b/src/lib/components/core/header/Header.svelte index 7211590..9ce53de 100644 --- a/src/lib/components/core/header/Header.svelte +++ b/src/lib/components/core/header/Header.svelte @@ -3,12 +3,13 @@ import { _, locale } from "svelte-i18n"; import block from "$assets/block.svg"; import leaphyLogo from "$assets/leaphy-logo.svg"; +import Connect from "$components/core/popups/popups/Connect.svelte"; import Button from "$components/ui/Button.svelte"; import ContextItem from "$components/ui/ContextItem.svelte"; import Select from "$components/ui/Select.svelte"; import { loadWorkspaceFromString } from "$domain/blockly/blockly"; import { FileHandle } from "$domain/handles"; -import { robots } from "$domain/robots"; +import { getSelector, robots } from "$domain/robots"; import { Screen, Theme, screen, theme } from "$state/app.svelte"; import { audio, @@ -77,9 +78,13 @@ async function upload() { } async function connect() { - try { - await port.connect(Prompt.ALWAYS); - } catch {} + if (getSelector($robot)) + popups.open({ + component: Connect, + data: {}, + allowInteraction: false, + }); + else port.connect(Prompt.ALWAYS); } async function newProject() { @@ -393,15 +398,6 @@ function runPython() {