maze-blockly-wrapper 0.5.4 → 0.6.0

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/App.d.ts CHANGED
@@ -1,12 +1,6 @@
1
- import React, { Component } from 'react';
1
+ import React from 'react';
2
2
  import 'bootstrap/dist/css/bootstrap.min.css';
3
3
  import './styles/App.scss';
4
- interface AppState {
5
- count: number;
6
- activeTab: string;
7
- }
8
- declare class App extends Component<Record<string, never>, AppState> {
9
- constructor(props: Record<string, never>);
10
- render(): React.JSX.Element;
11
- }
4
+ import './i18n';
5
+ declare const App: React.FC;
12
6
  export default App;
@@ -1,15 +1,10 @@
1
1
  import React from 'react';
2
- import type { GameState, MazeConfig } from './types';
2
+ import type { GameState } from './types';
3
3
  interface GameControlsProps {
4
4
  gameState: GameState;
5
- currentDirection: 'north' | 'south' | 'east' | 'west';
6
5
  isExecuting: boolean;
7
- isGenerating: boolean;
8
- mazeConfig: MazeConfig;
9
6
  onRunCode: () => void;
10
7
  onResetGame: () => void;
11
- onGenerateNewMaze: () => void;
12
- isEditable?: boolean;
13
8
  className?: string;
14
9
  }
15
10
  declare const GameControls: React.FC<GameControlsProps>;
package/dist/index.cjs.js CHANGED
@@ -2931,33 +2931,63 @@ class Browser {
2931
2931
  Browser.type = "languageDetector";
2932
2932
  const common$2 = { "moves": "Tahy", "steps": "Kroky", "walls": "Steny", "running": "Spúšťam...", "runCode": "▶️ Spustiť kód", "reset": "🔄 Resetovať", "generating": "🔄 Generujem...", "generateNewMaze": "🎲 Generovať nový labyrint", "editor": "✏️ Editor", "game": "🎮 Hra a programovanie", "gameView": "Pohľad na hru", "programmingBlocks": "Programovacie bloky", "generatedCode": "Vygenerovaný kód:", "noCodeGenerated": "// Zatiaľ nebol vygenerovaný žiadny kód", "calculating": "Počítam...", "north": "Sever", "south": "Juh", "east": "Východ", "west": "Západ" };
2933
2933
  const game$2 = { "congratulations": "🎉 Gratulujeme! Dosiahli ste cieľ! 🎯", "gameOver": "❌ Koniec hry! Prekročili ste maximálny počet ťahov.", "movement": "Pohyb", "coins": "Mince", "letters": "Písmená", "keys": "Kľúče", "control": "Riadenie", "logic": "Logika", "math": "Matematika" };
2934
- const blocks$2 = { "moveForward": "Posunúť sa dopredu", "turnLeft": "Otočiť sa vľavo", "turnRight": "Otočiť sa vpravo", "turnAround": "Otočiť sa okolo", "repeat": "Opakovať", "if": "Ak" };
2934
+ const blocks$2 = { "moveForward": "Posunúť sa dopredu", "turnLeft": "Otočiť sa vľavo", "turnRight": "Otočiť sa vpravo", "turnAround": "Otočiť sa okolo", "repeat": "Opakovať", "if": "Ak", "moveForwardTooltip": "Posunúť pavúka o jeden krok dopredu", "turnLeftTooltip": "Otočiť pavúka o 90 stupňov vľavo", "turnRightTooltip": "Otočiť pavúka o 90 stupňov vpravo", "turnAroundTooltip": "Otočiť pavúka o 180 stupňov okolo", "repeatTooltip": "Opakovať bloky vnútri zadaný počet krát", "whileTooltip": "Opakovať bloky vnútri, kým je podmienka pravdivá", "compareTooltip": "Porovnať dve čísla a vrátiť true alebo false", "numberTooltip": "Číslo", "collectCoinTooltip": "Zozbierať mincu, ak je na aktuálnej pozícii", "coinsCollectedTooltip": "Vráti počet zozbieraných mincí", "collectLetterTooltip": "Zozbierať písmeno, ak je na aktuálnej pozícii", "hasCoinTooltip": "Vráti true, ak je na aktuálnej pozícii minca", "hasLetterTooltip": "Vráti true, ak je na aktuálnej pozícii písmeno" };
2935
2935
  const language$2 = { "select": "Vybrať jazyk", "slovak": "Slovenčina", "czech": "Čeština", "hungarian": "Maďarčina" };
2936
+ const validation$2 = { "errors": "Chyby validácie:", "warnings": "Upozornenia:", "doorsNoKeys": "Labyrint má dvere, ale žiadne kľúče. Dvere sa nedajú prejsť bez kľúčov.", "keysNoDoors": "Labyrint má kľúče, ale žiadne dvere. Kľúče nie sú potrebné, ak nie sú dvere.", "moreDoorsThanKeys": "Labyrint má {{doors}} dverí, ale len {{keys}} kľúčov. Niektoré dvere môžu byť nedostupné.", "missingLetters": 'Cieľový reťazec "{{targetString}}" vyžaduje písmená, ktoré chýbajú v labyrinte: {{missingLetters}}', "extraLetters": "Labyrint obsahuje písmená, ktoré nie sú potrebné pre cieľový reťazec: {{extraLetters}}" };
2937
+ const tools$2 = { "wall": "Stena", "clear": "Vymazať", "start": "Štart", "finish": "Cieľ", "coin": "Minca", "letter": "Písmeno", "key": "Kľúč", "door": "Dvere", "targetStringPlaceholder": "Cieľový reťazec (voliteľný)", "regenerate": "Regenerovať", "clearAll": "Vymazať všetko" };
2938
+ const app$2 = { "imageGraphics": "Grafika obrázkov", "graphicsTest": "Test grafiky", "debugTest": "Debug test", "externalTest": "Test externého importu", "configTest": "Test konfigurácie" };
2939
+ const gameStatus$2 = { "coins": "Mince", "keys": "Kľúče", "moves": "Tahy", "inventory": "Inventár", "itemsCollected": "Zozbierané predmety" };
2940
+ const testing$2 = { "instructions": "Inštrukcie na testovanie:", "switchConfigurations": "Prepnutie konfigurácie:", "switchConfigurationsDesc": 'Kliknite na "Prepnutie konfigurácie" na testovanie rôznych grafických nastavení', "monitorLogs": "Sledovanie logov:", "monitorLogsDesc": "Sledujte logy, aby ste videli, kedy sa zmení grafická konfigurácia", "testImageLoading": "Testovanie načítania obrázkov:", "testImageLoadingDesc": "Overte, že sa obrázky načítajú správne a v prípade zlyhania sa použijú znaky", "testUrlValidity": "Testovanie platnosti URL:", "testUrlValidityDesc": "Použite URL tester na overenie platnosti URL obrázkov pred ich použitím", "testFallbackBehavior": "Testovanie záložného správania:", "testFallbackBehaviorDesc": "Konfigurácia 4 používa neplatné URL na testovanie záložných znakov", "checkToolSelection": "Kontrola výberu nástrojov:", "checkToolSelectionDesc": "Všimnite si, ako tlačidlá nástrojov teraz zobrazujú skutočné obrázky namiesto generických emoji", "verifyEditorGame": "Overenie editora/hry:", "verifyEditorGameDesc": "Skontrolujte, že oba taby editora a hry odrážajú zmeny" };
2936
2941
  const sk = {
2937
2942
  common: common$2,
2938
2943
  game: game$2,
2939
2944
  blocks: blocks$2,
2940
- language: language$2
2945
+ language: language$2,
2946
+ validation: validation$2,
2947
+ tools: tools$2,
2948
+ app: app$2,
2949
+ gameStatus: gameStatus$2,
2950
+ testing: testing$2
2941
2951
  };
2942
2952
  const common$1 = { "moves": "Tahy", "steps": "Kroky", "walls": "Stěny", "running": "Spouštím...", "runCode": "▶️ Spustit kód", "reset": "🔄 Resetovat", "generating": "🔄 Generuji...", "generateNewMaze": "🎲 Generovat nový labyrint", "editor": "✏️ Editor", "game": "🎮 Hra a programování", "gameView": "Pohled na hru", "programmingBlocks": "Programovací bloky", "generatedCode": "Vygenerovaný kód:", "noCodeGenerated": "// Zatím nebyl vygenerován žádný kód", "calculating": "Počítám...", "north": "Sever", "south": "Jih", "east": "Východ", "west": "Západ" };
2943
2953
  const game$1 = { "congratulations": "🎉 Gratulujeme! Dosáhli jste cíle! 🎯", "gameOver": "❌ Konec hry! Překročili jste maximální počet tahů.", "movement": "Pohyb", "coins": "Mince", "letters": "Písmena", "keys": "Klíče", "control": "Řízení", "logic": "Logika", "math": "Matematika" };
2944
- const blocks$1 = { "moveForward": "Posunout se dopředu", "turnLeft": "Otočit se vlevo", "turnRight": "Otočit se vpravo", "turnAround": "Otočit se kolem", "repeat": "Opakovat", "if": "Pokud" };
2954
+ const blocks$1 = { "moveForward": "Posunout se dopředu", "turnLeft": "Otočit se vlevo", "turnRight": "Otočit se vpravo", "turnAround": "Otočit se kolem", "repeat": "Opakovat", "if": "Pokud", "moveForwardTooltip": "Posunout pavouka o jeden krok dopředu", "turnLeftTooltip": "Otočit pavouka o 90 stupňů vlevo", "turnRightTooltip": "Otočit pavouka o 90 stupňů vpravo", "turnAroundTooltip": "Otočit pavouka o 180 stupňů kolem", "repeatTooltip": "Opakovat bloky uvnitř zadaný počet krát", "whileTooltip": "Opakovat bloky uvnitř, dokud je podmínka pravdivá", "compareTooltip": "Porovnat dvě čísla a vrátit true nebo false", "numberTooltip": "Číslo", "collectCoinTooltip": "Sebrat minci, pokud je na aktuální pozici", "coinsCollectedTooltip": "Vrátí počet sebraných mincí", "collectLetterTooltip": "Sebrat písmeno, pokud je na aktuální pozici", "hasCoinTooltip": "Vrátí true, pokud je na aktuální pozici mince", "hasLetterTooltip": "Vrátí true, pokud je na aktuální pozici písmeno" };
2945
2955
  const language$1 = { "select": "Vybrat jazyk", "slovak": "Slovenština", "czech": "Čeština", "hungarian": "Maďarština" };
2956
+ const validation$1 = { "errors": "Chyby validace:", "warnings": "Upozornění:", "doorsNoKeys": "Labyrint má dveře, ale žádné klíče. Dveře se nedají projít bez klíčů.", "keysNoDoors": "Labyrint má klíče, ale žádné dveře. Klíče nejsou potřeba, pokud nejsou dveře.", "moreDoorsThanKeys": "Labyrint má {{doors}} dveří, ale jen {{keys}} klíčů. Některé dveře mohou být nedostupné.", "missingLetters": 'Cílový řetězec "{{targetString}}" vyžaduje písmena, která chybí v labyrintu: {{missingLetters}}', "extraLetters": "Labyrint obsahuje písmena, která nejsou potřebná pro cílový řetězec: {{extraLetters}}" };
2957
+ const tools$1 = { "wall": "Stěna", "clear": "Vymazat", "start": "Start", "finish": "Cíl", "coin": "Mince", "letter": "Písmeno", "key": "Klíč", "door": "Dveře", "targetStringPlaceholder": "Cílový řetězec (volitelný)", "regenerate": "Regenerovat", "clearAll": "Vymazat vše" };
2958
+ const app$1 = { "imageGraphics": "Grafika obrázků", "graphicsTest": "Test grafiky", "debugTest": "Debug test", "externalTest": "Test externího importu", "configTest": "Test konfigurace" };
2959
+ const gameStatus$1 = { "coins": "Mince", "keys": "Klíče", "moves": "Tahy", "inventory": "Inventář", "itemsCollected": "Sebrané předměty" };
2960
+ const testing$1 = { "instructions": "Testovací instrukce:", "switchConfigurations": "Přepnutí konfigurace:", "switchConfigurationsDesc": 'Klikněte na "Přepnutí konfigurace" na testování různých grafických nastavení', "monitorLogs": "Sledování logů:", "monitorLogsDesc": "Sledujte logy, abyste viděli, kdy se změní grafická konfigurace", "testImageLoading": "Testování načítání obrázků:", "testImageLoadingDesc": "Ověřte, že se obrázky načítají správně a v případě selhání se použijí znaky", "testUrlValidity": "Testování platnosti URL:", "testUrlValidityDesc": "Použijte URL tester na ověření platnosti URL obrázků před jejich použitím", "testFallbackBehavior": "Testování záložního chování:", "testFallbackBehaviorDesc": "Konfigurace 4 používá neplatné URL na testování záložních znaků", "checkToolSelection": "Kontrola výběru nástrojů:", "checkToolSelectionDesc": "Všimněte si, jak tlačítka nástrojů nyní zobrazují skutečné obrázky místo generických emoji", "verifyEditorGame": "Ověření editoru/hry:", "verifyEditorGameDesc": "Zkontrolujte, že oba taby editoru a hry odrážejí změny" };
2946
2961
  const cs = {
2947
2962
  common: common$1,
2948
2963
  game: game$1,
2949
2964
  blocks: blocks$1,
2950
- language: language$1
2965
+ language: language$1,
2966
+ validation: validation$1,
2967
+ tools: tools$1,
2968
+ app: app$1,
2969
+ gameStatus: gameStatus$1,
2970
+ testing: testing$1
2951
2971
  };
2952
2972
  const common = { "moves": "Lépések", "steps": "Lépések", "walls": "Falak", "running": "Futtatom...", "runCode": "▶️ Kód futtatása", "reset": "🔄 Visszaállítás", "generating": "🔄 Generálás...", "generateNewMaze": "🎲 Új labirintus generálása", "editor": "✏️ Szerkesztő", "game": "🎮 Játék és programozás", "gameView": "Játék nézet", "programmingBlocks": "Programozási blokkok", "generatedCode": "Generált kód:", "noCodeGenerated": "// Még nincs generált kód", "calculating": "Számítás...", "north": "Észak", "south": "Dél", "east": "Kelet", "west": "Nyugat" };
2953
2973
  const game = { "congratulations": "🎉 Gratulálunk! Elérted a célt! 🎯", "gameOver": "❌ Játék vége! Túllépted a maximális lépésszámot.", "movement": "Mozgás", "coins": "Érmék", "letters": "Betűk", "keys": "Kulcsok", "control": "Vezérlés", "logic": "Logika", "math": "Matematika" };
2954
- const blocks = { "moveForward": "Előre lépés", "turnLeft": "Balra fordulás", "turnRight": "Jobbra fordulás", "turnAround": "Megfordulás", "repeat": "Ismétlés", "if": "Ha" };
2974
+ const blocks = { "moveForward": "Előre lépés", "turnLeft": "Balra fordulás", "turnRight": "Jobbra fordulás", "turnAround": "Megfordulás", "repeat": "Ismétlés", "if": "Ha", "moveForwardTooltip": "A pók egy lépést előre mozgatása", "turnLeftTooltip": "A pók 90 fokkal balra fordítása", "turnRightTooltip": "A pók 90 fokkal jobbra fordítása", "turnAroundTooltip": "A pók 180 fokkal megfordítása", "repeatTooltip": "A blokkok megadott számú ismétlése", "whileTooltip": "A blokkok ismétlése, amíg a feltétel igaz", "compareTooltip": "Két szám összehasonlítása és true vagy false visszaadása", "numberTooltip": "Szám", "collectCoinTooltip": "Érme gyűjtése, ha van a jelenlegi pozíción", "coinsCollectedTooltip": "Az eddig gyűjtött érmék számát adja vissza", "collectLetterTooltip": "Betű gyűjtése, ha van a jelenlegi pozíción", "hasCoinTooltip": "True-t ad vissza, ha van érme a jelenlegi pozíción", "hasLetterTooltip": "True-t ad vissza, ha van betű a jelenlegi pozíción" };
2955
2975
  const language = { "select": "Nyelv kiválasztása", "slovak": "Szlovák", "czech": "Cseh", "hungarian": "Magyar" };
2976
+ const validation = { "errors": "Validációs hibák:", "warnings": "Figyelmeztetések:", "doorsNoKeys": "A labirintusnak vannak ajtói, de nincsenek kulcsok. Az ajtók nem járhatók át kulcs nélkül.", "keysNoDoors": "A labirintusnak vannak kulcsai, de nincsenek ajtók. A kulcsok nem szükségesek, ha nincsenek ajtók.", "moreDoorsThanKeys": "A labirintusnak {{doors}} ajtója van, de csak {{keys}} kulcsa. Néhány ajtó elérhetetlen lehet.", "missingLetters": 'A "{{targetString}}" célkarakterlánc olyan betűket igényel, amelyek hiányoznak a labirintusból: {{missingLetters}}', "extraLetters": "A labirintus olyan betűket tartalmaz, amelyekre nincs szükség a célkarakterlánc esetében: {{extraLetters}}" };
2977
+ const tools = { "wall": "Fal", "clear": "Törlés", "start": "Kezdés", "finish": "Cél", "coin": "Érme", "letter": "Betű", "key": "Kulcs", "door": "Ajtó", "targetStringPlaceholder": "Célkarakterlánc (opcionális)", "regenerate": "Újragenerálás", "clearAll": "Összes törlése" };
2978
+ const app = { "imageGraphics": "Képek grafikája", "graphicsTest": "Grafika teszt", "debugTest": "Debug teszt", "externalTest": "Külső import teszt", "configTest": "Konfiguráció teszt" };
2979
+ const gameStatus = { "coins": "Érmék", "keys": "Kulcsok", "moves": "Lépések", "inventory": "Leltár", "itemsCollected": "Összegyűjtött tárgyak" };
2980
+ const testing = { "instructions": "Tesztelési utasítások:", "switchConfigurations": "Konfiguráció váltás:", "switchConfigurationsDesc": 'Kattintson a "Konfiguráció váltás" gombra a különböző grafikai beállítások teszteléséhez', "monitorLogs": "Naplók figyelése:", "monitorLogsDesc": "Figyelje a naplókat, hogy lássa, mikor változik a grafikai konfiguráció", "testImageLoading": "Képek betöltésének tesztelése:", "testImageLoadingDesc": "Ellenőrizze, hogy a képek megfelelően töltődnek be, és hiba esetén karakterekre váltanak", "testUrlValidity": "URL érvényesség tesztelése:", "testUrlValidityDesc": "Használja az URL tesztelőt a kép URL-ek érvényességének ellenőrzéséhez használat előtt", "testFallbackBehavior": "Tartalék viselkedés tesztelése:", "testFallbackBehaviorDesc": "A 4. konfiguráció hibás URL-eket használ a tartalék karakterek teszteléséhez", "checkToolSelection": "Eszköz kiválasztás ellenőrzése:", "checkToolSelectionDesc": "Figyelje meg, hogyan jelenítik meg most az eszközgombok a tényleges képeket a generikus emoji helyett", "verifyEditorGame": "Szerkesztő/játék ellenőrzése:", "verifyEditorGameDesc": "Ellenőrizze, hogy mindkét szerkesztő és játék tab tükrözi a változásokat" };
2956
2981
  const hu = {
2957
2982
  common,
2958
2983
  game,
2959
2984
  blocks,
2960
- language
2985
+ language,
2986
+ validation,
2987
+ tools,
2988
+ app,
2989
+ gameStatus,
2990
+ testing
2961
2991
  };
2962
2992
  const resources = {
2963
2993
  sk: {
@@ -7334,8 +7364,6 @@ const GraphicsImage = ({
7334
7364
  className,
7335
7365
  onError: handleImageError,
7336
7366
  onLoad: handleImageLoad,
7337
- onLoadStart: () => console.log(`[GraphicsImage] Image load started: ${src}`),
7338
- onAbort: () => console.warn(`[GraphicsImage] Image load aborted: ${src}`),
7339
7367
  title: `Image: ${src}`
7340
7368
  }
7341
7369
  );
@@ -7363,13 +7391,13 @@ const validateDoorKeyRequirement = (config2) => {
7363
7391
  const hasDoors = config2.doors.length > 0;
7364
7392
  const hasKeys = config2.keys.length > 0;
7365
7393
  if (hasDoors && !hasKeys) {
7366
- errors.push("Maze has doors but no keys. Doors cannot be passed without keys.");
7394
+ errors.push(instance.t("validation.doorsNoKeys"));
7367
7395
  }
7368
7396
  if (hasKeys && !hasDoors) {
7369
- warnings.push("Maze has keys but no doors. Keys are not needed if there are no doors.");
7397
+ warnings.push(instance.t("validation.keysNoDoors"));
7370
7398
  }
7371
7399
  if (hasDoors && hasKeys && config2.keys.length < config2.doors.length) {
7372
- warnings.push(`Maze has ${config2.doors.length} doors but only ${config2.keys.length} keys. Some doors may be unreachable.`);
7400
+ warnings.push(instance.t("validation.moreDoorsThanKeys", { doors: config2.doors.length, keys: config2.keys.length }));
7373
7401
  }
7374
7402
  return {
7375
7403
  isValid: errors.length === 0,
@@ -7401,11 +7429,14 @@ const validateTargetString = (config2) => {
7401
7429
  }
7402
7430
  });
7403
7431
  if (missingLetters.length > 0) {
7404
- errors.push(`Target string "${config2.targetString}" requires letters that are missing from the maze: ${missingLetters.join(", ")}`);
7432
+ errors.push(instance.t("validation.missingLetters", {
7433
+ targetString: config2.targetString,
7434
+ missingLetters: missingLetters.join(", ")
7435
+ }));
7405
7436
  }
7406
7437
  const extraLetters = Object.keys(mazeCounts).filter((letter) => !targetCounts[letter]);
7407
7438
  if (extraLetters.length > 0) {
7408
- warnings.push(`Maze contains letters not needed for target string: ${extraLetters.join(", ")}`);
7439
+ warnings.push(instance.t("validation.extraLetters", { extraLetters: extraLetters.join(", ") }));
7409
7440
  }
7410
7441
  return {
7411
7442
  isValid: errors.length === 0,
@@ -7426,6 +7457,7 @@ const EditableMazeGrid = ({
7426
7457
  className
7427
7458
  }) => {
7428
7459
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
7460
+ const { t } = useTranslation();
7429
7461
  const [selectedTool, setSelectedTool] = React.useState("wall");
7430
7462
  const [isDrawing, setIsDrawing] = React.useState(false);
7431
7463
  const [selectedLetter, setSelectedLetter] = React.useState("A");
@@ -7434,27 +7466,27 @@ const EditableMazeGrid = ({
7434
7466
  const toolOptions = [
7435
7467
  {
7436
7468
  value: "wall",
7437
- label: "Wall",
7469
+ label: t("tools.wall"),
7438
7470
  icon: /* @__PURE__ */ jsxRuntime.jsx(
7439
7471
  GraphicsImage,
7440
7472
  {
7441
7473
  src: (_a = blocksConfig == null ? void 0 : blocksConfig.wall) == null ? void 0 : _a.imageUrl,
7442
- alt: "Wall",
7474
+ alt: t("tools.wall"),
7443
7475
  fallback: ((_b = blocksConfig == null ? void 0 : blocksConfig.wall) == null ? void 0 : _b.character) || "🧱",
7444
7476
  size: 16
7445
7477
  }
7446
7478
  )
7447
7479
  },
7448
- { value: "empty", label: "Clear", icon: "⬜" },
7449
- { value: "start", label: "Start", icon: "🚀" },
7480
+ { value: "empty", label: t("tools.clear"), icon: "⬜" },
7481
+ { value: "start", label: t("tools.start"), icon: "🚀" },
7450
7482
  {
7451
7483
  value: "finish",
7452
- label: "Finish",
7484
+ label: t("tools.finish"),
7453
7485
  icon: /* @__PURE__ */ jsxRuntime.jsx(
7454
7486
  GraphicsImage,
7455
7487
  {
7456
7488
  src: (_c = blocksConfig == null ? void 0 : blocksConfig.finish) == null ? void 0 : _c.imageUrl,
7457
- alt: "Finish",
7489
+ alt: t("tools.finish"),
7458
7490
  fallback: ((_d = blocksConfig == null ? void 0 : blocksConfig.finish) == null ? void 0 : _d.character) || "🎯",
7459
7491
  size: 16
7460
7492
  }
@@ -7462,26 +7494,26 @@ const EditableMazeGrid = ({
7462
7494
  },
7463
7495
  {
7464
7496
  value: "coin",
7465
- label: "Coin",
7497
+ label: t("tools.coin"),
7466
7498
  icon: /* @__PURE__ */ jsxRuntime.jsx(
7467
7499
  GraphicsImage,
7468
7500
  {
7469
7501
  src: (_e = blocksConfig == null ? void 0 : blocksConfig.coin) == null ? void 0 : _e.imageUrl,
7470
- alt: "Coin",
7502
+ alt: t("tools.coin"),
7471
7503
  fallback: ((_f = blocksConfig == null ? void 0 : blocksConfig.coin) == null ? void 0 : _f.character) || "🪙",
7472
7504
  size: 16
7473
7505
  }
7474
7506
  )
7475
7507
  },
7476
- { value: "letter", label: "Letter", icon: "📝" },
7508
+ { value: "letter", label: t("tools.letter"), icon: "📝" },
7477
7509
  {
7478
7510
  value: "key",
7479
- label: "Key",
7511
+ label: t("tools.key"),
7480
7512
  icon: /* @__PURE__ */ jsxRuntime.jsx(
7481
7513
  GraphicsImage,
7482
7514
  {
7483
7515
  src: (_g = blocksConfig == null ? void 0 : blocksConfig.key) == null ? void 0 : _g.imageUrl,
7484
- alt: "Key",
7516
+ alt: t("tools.key"),
7485
7517
  fallback: ((_h = blocksConfig == null ? void 0 : blocksConfig.key) == null ? void 0 : _h.character) || "🗝️",
7486
7518
  size: 16
7487
7519
  }
@@ -7489,12 +7521,12 @@ const EditableMazeGrid = ({
7489
7521
  },
7490
7522
  {
7491
7523
  value: "door",
7492
- label: "Door",
7524
+ label: t("tools.door"),
7493
7525
  icon: /* @__PURE__ */ jsxRuntime.jsx(
7494
7526
  GraphicsImage,
7495
7527
  {
7496
7528
  src: (_i = blocksConfig == null ? void 0 : blocksConfig.door) == null ? void 0 : _i.imageUrl,
7497
- alt: "Door",
7529
+ alt: t("tools.door"),
7498
7530
  fallback: ((_j = blocksConfig == null ? void 0 : blocksConfig.door) == null ? void 0 : _j.character) || "🚪",
7499
7531
  size: 16
7500
7532
  }
@@ -7640,7 +7672,7 @@ const EditableMazeGrid = ({
7640
7672
  const newConfig = __spreadProps(__spreadValues({}, config2), { targetString: value || void 0 });
7641
7673
  onConfigChange(newConfig);
7642
7674
  };
7643
- const validation = validateMaze(config2);
7675
+ const validation2 = validateMaze(config2);
7644
7676
  return /* @__PURE__ */ jsxRuntime.jsxs(Card$1, { className, children: [
7645
7677
  /* @__PURE__ */ jsxRuntime.jsx(Card$1.Header, { className: "bg-light border-0", children: /* @__PURE__ */ jsxRuntime.jsxs(Row, { className: "align-items-center", children: [
7646
7678
  /* @__PURE__ */ jsxRuntime.jsx(Col, { xs: "auto", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "btn-group", role: "group", children: toolOptions.map((option) => /* @__PURE__ */ jsxRuntime.jsx(
@@ -7677,25 +7709,25 @@ const EditableMazeGrid = ({
7677
7709
  {
7678
7710
  size: "sm",
7679
7711
  type: "text",
7680
- placeholder: "Target string (optional)",
7712
+ placeholder: t("tools.targetStringPlaceholder"),
7681
7713
  value: targetString,
7682
7714
  onChange: (e) => handleTargetStringChange(e.target.value),
7683
7715
  style: { minWidth: "150px" }
7684
7716
  }
7685
7717
  ) }),
7686
7718
  /* @__PURE__ */ jsxRuntime.jsxs(Col, { xs: "auto", children: [
7687
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline-secondary", size: "sm", onClick: regenerateMaze, className: "me-2", children: "Regenerate" }),
7688
- /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline-secondary", size: "sm", onClick: clearMaze, children: "Clear All" })
7719
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline-secondary", size: "sm", onClick: regenerateMaze, className: "me-2", children: t("tools.regenerate") }),
7720
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "outline-secondary", size: "sm", onClick: clearMaze, children: t("tools.clearAll") })
7689
7721
  ] })
7690
7722
  ] }) }),
7691
7723
  /* @__PURE__ */ jsxRuntime.jsxs(Card$1.Body, { children: [
7692
- validation.errors.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Alert$1, { variant: "danger", className: "mb-3", children: [
7693
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Validation Errors:" }),
7694
- /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mb-0", children: validation.errors.map((error, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: error }, index)) })
7724
+ validation2.errors.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Alert$1, { variant: "danger", className: "mb-3", children: [
7725
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: t("validation.errors") }),
7726
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mb-0", children: validation2.errors.map((error, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: error }, index)) })
7695
7727
  ] }),
7696
- validation.warnings.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Alert$1, { variant: "warning", className: "mb-3", children: [
7697
- /* @__PURE__ */ jsxRuntime.jsx("strong", { children: "Warnings:" }),
7698
- /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mb-0", children: validation.warnings.map((warning2, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: warning2 }, index)) })
7728
+ validation2.warnings.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Alert$1, { variant: "warning", className: "mb-3", children: [
7729
+ /* @__PURE__ */ jsxRuntime.jsx("strong", { children: t("validation.warnings") }),
7730
+ /* @__PURE__ */ jsxRuntime.jsx("ul", { className: "mb-0", children: validation2.warnings.map((warning2, index) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: warning2 }, index)) })
7699
7731
  ] }),
7700
7732
  /* @__PURE__ */ jsxRuntime.jsx(
7701
7733
  "div",
@@ -7744,7 +7776,7 @@ const EditableMazeGrid = ({
7744
7776
  GraphicsImage,
7745
7777
  {
7746
7778
  src: (_q2 = blocksConfig == null ? void 0 : blocksConfig.wall) == null ? void 0 : _q2.imageUrl,
7747
- alt: "Wall",
7779
+ alt: t("tools.wall"),
7748
7780
  fallback: ((_r2 = blocksConfig == null ? void 0 : blocksConfig.wall) == null ? void 0 : _r2.character) || "🧱",
7749
7781
  size: 20
7750
7782
  }
@@ -7753,7 +7785,7 @@ const EditableMazeGrid = ({
7753
7785
  GraphicsImage,
7754
7786
  {
7755
7787
  src: (_s = blocksConfig == null ? void 0 : blocksConfig.finish) == null ? void 0 : _s.imageUrl,
7756
- alt: "Finish",
7788
+ alt: t("tools.finish"),
7757
7789
  fallback: ((_t = blocksConfig == null ? void 0 : blocksConfig.finish) == null ? void 0 : _t.character) || "F",
7758
7790
  size: 20
7759
7791
  }
@@ -7762,7 +7794,7 @@ const EditableMazeGrid = ({
7762
7794
  GraphicsImage,
7763
7795
  {
7764
7796
  src: (_u = blocksConfig == null ? void 0 : blocksConfig.coin) == null ? void 0 : _u.imageUrl,
7765
- alt: "Coin",
7797
+ alt: t("tools.coin"),
7766
7798
  fallback: ((_v = blocksConfig == null ? void 0 : blocksConfig.coin) == null ? void 0 : _v.character) || "🪙",
7767
7799
  size: 16
7768
7800
  }
@@ -7772,7 +7804,7 @@ const EditableMazeGrid = ({
7772
7804
  GraphicsImage,
7773
7805
  {
7774
7806
  src: (_w = blocksConfig == null ? void 0 : blocksConfig.key) == null ? void 0 : _w.imageUrl,
7775
- alt: "Key",
7807
+ alt: t("tools.key"),
7776
7808
  fallback: ((_x = blocksConfig == null ? void 0 : blocksConfig.key) == null ? void 0 : _x.character) || "🗝️",
7777
7809
  size: 16
7778
7810
  }
@@ -7781,7 +7813,7 @@ const EditableMazeGrid = ({
7781
7813
  GraphicsImage,
7782
7814
  {
7783
7815
  src: (_y = blocksConfig == null ? void 0 : blocksConfig.door) == null ? void 0 : _y.imageUrl,
7784
- alt: "Door",
7816
+ alt: t("tools.door"),
7785
7817
  fallback: ((_z = blocksConfig == null ? void 0 : blocksConfig.door) == null ? void 0 : _z.character) || "🚪",
7786
7818
  size: 20
7787
7819
  }
@@ -8988,7 +9020,9 @@ const MazeTabs = ({
8988
9020
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "row mb-3", children: [
8989
9021
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-md-6", children: /* @__PURE__ */ jsxRuntime.jsx(Alert$1, { variant: "info", className: "mb-2", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [
8990
9022
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
8991
- "🪙 Coins: ",
9023
+ "🪙 ",
9024
+ t("gameStatus.coins"),
9025
+ ": ",
8992
9026
  /* @__PURE__ */ jsxRuntime.jsxs(Badge, { bg: "warning", text: "dark", children: [
8993
9027
  gameState.coinsCollected,
8994
9028
  "/",
@@ -8996,7 +9030,9 @@ const MazeTabs = ({
8996
9030
  ] })
8997
9031
  ] }),
8998
9032
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
8999
- "🗝️ Keys: ",
9033
+ "🗝️ ",
9034
+ t("gameStatus.keys"),
9035
+ ": ",
9000
9036
  /* @__PURE__ */ jsxRuntime.jsxs(Badge, { bg: "success", children: [
9001
9037
  gameState.keysCollected,
9002
9038
  "/",
@@ -9004,7 +9040,8 @@ const MazeTabs = ({
9004
9040
  ] })
9005
9041
  ] }),
9006
9042
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
9007
- "Moves: ",
9043
+ t("gameStatus.moves"),
9044
+ ": ",
9008
9045
  /* @__PURE__ */ jsxRuntime.jsxs(Badge, { bg: "secondary", children: [
9009
9046
  gameState.moveCount,
9010
9047
  "/",
@@ -9015,11 +9052,13 @@ const MazeTabs = ({
9015
9052
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "col-md-6", children: /* @__PURE__ */ jsxRuntime.jsxs(Alert$1, { variant: "info", className: "mb-2", children: [
9016
9053
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [
9017
9054
  /* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
9018
- "📦 Inventory (",
9055
+ "📦 ",
9056
+ t("gameStatus.inventory"),
9057
+ " (",
9019
9058
  gameState.inventory.length,
9020
9059
  ")"
9021
9060
  ] }),
9022
- /* @__PURE__ */ jsxRuntime.jsx("span", { children: "Items Collected" })
9061
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: t("gameStatus.itemsCollected") })
9023
9062
  ] }),
9024
9063
  gameState.inventory.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "d-flex flex-wrap gap-1", children: gameState.inventory.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
9025
9064
  Badge,
@@ -9092,81 +9131,35 @@ const MazeTabs = ({
9092
9131
  };
9093
9132
  const GameControls = ({
9094
9133
  gameState,
9095
- currentDirection,
9096
9134
  isExecuting,
9097
- isGenerating,
9098
- mazeConfig,
9099
9135
  onRunCode,
9100
9136
  onResetGame,
9101
- onGenerateNewMaze,
9102
- isEditable = false,
9103
9137
  className
9104
9138
  }) => {
9105
9139
  const { t } = useTranslation();
9106
9140
  return /* @__PURE__ */ jsxRuntime.jsx(Card$1, { className, children: /* @__PURE__ */ jsxRuntime.jsxs(Card$1.Body, { children: [
9107
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex justify-content-between align-items-center", children: [
9108
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
9109
- /* @__PURE__ */ jsxRuntime.jsxs(Badge, { bg: "primary", className: "me-2", children: [
9110
- t("common.moves"),
9111
- ": ",
9112
- gameState.moveCount,
9113
- "/",
9114
- gameState.maxMoves
9115
- ] }),
9116
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { bg: currentDirection === "north" ? "success" : "secondary", className: "me-1", children: "↑" }),
9117
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { bg: currentDirection === "east" ? "success" : "secondary", className: "me-1", children: "→" }),
9118
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { bg: currentDirection === "south" ? "success" : "secondary", className: "me-1", children: "↓" }),
9119
- /* @__PURE__ */ jsxRuntime.jsx(Badge, { bg: currentDirection === "west" ? "success" : "secondary", className: "me-1", children: "←" })
9120
- ] }),
9121
- /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
9122
- /* @__PURE__ */ jsxRuntime.jsx(
9123
- Button,
9124
- {
9125
- variant: "success",
9126
- onClick: onRunCode,
9127
- disabled: isExecuting || gameState.isGameOver,
9128
- className: "me-2",
9129
- children: isExecuting ? t("common.running") : t("common.runCode")
9130
- }
9131
- ),
9132
- /* @__PURE__ */ jsxRuntime.jsx(
9133
- Button,
9134
- {
9135
- variant: "outline-secondary",
9136
- onClick: onResetGame,
9137
- disabled: isExecuting,
9138
- className: "me-2",
9139
- children: t("common.reset")
9140
- }
9141
- )
9142
- ] })
9143
- ] }),
9144
- isEditable && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "d-flex align-items-center mt-3 p-3 bg-light rounded", children: [
9145
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "me-3", children: [
9146
- /* @__PURE__ */ jsxRuntime.jsxs(Form$1.Label, { className: "mb-1 fw-bold", children: [
9147
- t("common.steps"),
9148
- ":"
9149
- ] }),
9150
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted", children: mazeConfig.estimatedSteps || t("common.calculating") })
9151
- ] }),
9152
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "me-3", children: [
9153
- /* @__PURE__ */ jsxRuntime.jsxs(Form$1.Label, { className: "mb-1 fw-bold", children: [
9154
- t("common.walls"),
9155
- ":"
9156
- ] }),
9157
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-muted", children: mazeConfig.walls.length })
9158
- ] }),
9141
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "d-flex justify-content-between align-items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
9142
+ /* @__PURE__ */ jsxRuntime.jsx(
9143
+ Button,
9144
+ {
9145
+ variant: "success",
9146
+ onClick: onRunCode,
9147
+ disabled: isExecuting || gameState.isGameOver,
9148
+ className: "me-2",
9149
+ children: isExecuting ? t("common.running") : t("common.runCode")
9150
+ }
9151
+ ),
9159
9152
  /* @__PURE__ */ jsxRuntime.jsx(
9160
9153
  Button,
9161
9154
  {
9162
- variant: "primary",
9163
- onClick: onGenerateNewMaze,
9164
- disabled: isExecuting || isGenerating,
9165
- className: "ms-auto",
9166
- children: isGenerating ? t("common.generating") : t("common.generateNewMaze")
9155
+ variant: "outline-secondary",
9156
+ onClick: onResetGame,
9157
+ disabled: isExecuting,
9158
+ className: "me-2",
9159
+ children: t("common.reset")
9167
9160
  }
9168
9161
  )
9169
- ] }),
9162
+ ] }) }),
9170
9163
  gameState.isGameWon && /* @__PURE__ */ jsxRuntime.jsx(Alert$1, { variant: "success", className: "mt-3 mb-0", children: t("game.congratulations") }),
9171
9164
  gameState.isGameOver && !gameState.isGameWon && /* @__PURE__ */ jsxRuntime.jsx(Alert$1, { variant: "danger", className: "mt-3 mb-0", children: t("game.gameOver") })
9172
9165
  ] }) });
@@ -9522,20 +9515,6 @@ class MazeGame extends React.Component {
9522
9515
  this.blocklyRef.current.executeCode();
9523
9516
  }
9524
9517
  });
9525
- // private handleMinStepsChange = (event: React.ChangeEvent<HTMLInputElement>) => {
9526
- // const value = parseInt(event.target.value);
9527
- // if (!isNaN(value) && value >= 3 && value <= 30) {
9528
- // this.setState({ minSteps: value }, () => {
9529
- // // Regenerate maze with new minimum steps if the current maze doesn't meet the requirement
9530
- // if (this.mazeConfig.estimatedSteps && this.mazeConfig.estimatedSteps < value) {
9531
- // this.generateMaze();
9532
- // }
9533
- // });
9534
- // }
9535
- // };
9536
- __publicField(this, "handleGenerateNewMaze", () => {
9537
- this.generateMaze();
9538
- });
9539
9518
  if (props.configuration) {
9540
9519
  this.mazeConfig = __spreadValues({}, props.configuration);
9541
9520
  }
@@ -9943,8 +9922,19 @@ class MazeGame extends React.Component {
9943
9922
  }
9944
9923
  this.setState({ isExecuting: false });
9945
9924
  }
9925
+ // private handleMinStepsChange = (event: React.ChangeEvent<HTMLInputElement>) => {
9926
+ // const value = parseInt(event.target.value);
9927
+ // if (!isNaN(value) && value >= 3 && value <= 30) {
9928
+ // this.setState({ minSteps: value }, () => {
9929
+ // // Regenerate maze with new minimum steps if the current maze doesn't meet the requirement
9930
+ // if (this.mazeConfig.estimatedSteps && this.mazeConfig.estimatedSteps < value) {
9931
+ // this.generateMaze();
9932
+ // }
9933
+ // });
9934
+ // }
9935
+ // };
9946
9936
  render() {
9947
- const { gameState, currentDirection, isExecuting, generatedCode, isGenerating } = this.state;
9937
+ const { gameState, currentDirection, isExecuting, generatedCode } = this.state;
9948
9938
  const blocklyConfig = this.getBlocklyConfig();
9949
9939
  return /* @__PURE__ */ jsxRuntime.jsx("div", { className: `maze-game ${this.props.className || ""}`, children: /* @__PURE__ */ jsxRuntime.jsx(Container, { fluid: true, children: /* @__PURE__ */ jsxRuntime.jsx(Row, { children: /* @__PURE__ */ jsxRuntime.jsxs(Col, { children: [
9950
9940
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "d-flex justify-content-end mb-3", children: /* @__PURE__ */ jsxRuntime.jsx(LanguageSelector, {}) }),
@@ -9952,14 +9942,9 @@ class MazeGame extends React.Component {
9952
9942
  GameControls,
9953
9943
  {
9954
9944
  gameState,
9955
- currentDirection,
9956
9945
  isExecuting,
9957
- isGenerating,
9958
- mazeConfig: this.mazeConfig,
9959
9946
  onRunCode: this.runCode,
9960
9947
  onResetGame: this.resetGame,
9961
- onGenerateNewMaze: this.handleGenerateNewMaze,
9962
- isEditable: this.props.isEditable,
9963
9948
  className: "mb-3"
9964
9949
  }
9965
9950
  ),