import PlayerPlayIcon from "@tabler/icons/outline/player-play.svg";
import { BlockDefinition } from "../types";

export const blocks = [
  {
    type: "events:when_start_clicked",
    message0: "%{BKY_WHEN_START_CLICKED}",
    args0: [
      {
        type: "field_image",
        src: PlayerPlayIcon,
        width: 24,
        height: 24,
        alt: "play",
      },
    ],
    message1: "%1",
    args1: [
      {
        type: "input_statement",
        name: "SUBSTACK",
      },
    ],
    category: "events",
    style: "event_blocks",
    suppressPrefixSuffix: true,
  } as const,
  {
    type: "events:when_sprite_clicked",
    message0: "%{BKY_WHEN_SPRITE_CLICKED}",
    args0: [],
    message1: "%1",
    args1: [
      {
        type: "input_statement",
        name: "SUBSTACK",
      },
    ],
    category: "events",
    style: "event_blocks",
    suppressPrefixSuffix: true,
  } as const,
  {
    type: "events:when_key_pressed",
    message0: "%{BKY_WHEN_KEY_PRESSED}",
    args0: [
      {
        type: "field_dropdown",
        name: "KEY",
        options: [
          ["%{BKY_KEY_ANY}", "any"],
          ["%{BKY_KEY_SPACE}", " "],
          ["%{BKY_KEY_ARROW_UP}", "ArrowUp"],
          ["%{BKY_KEY_ARROW_DOWN}", "ArrowDown"],
          ["%{BKY_KEY_ARROW_LEFT}", "ArrowLeft"],
          ["%{BKY_KEY_ARROW_RIGHT}", "ArrowRight"],
          ["a", "a"],
          ["b", "b"],
          ["c", "c"],
          ["d", "d"],
          ["e", "e"],
          ["f", "f"],
          ["g", "g"],
          ["h", "h"],
          ["i", "i"],
          ["j", "j"],
          ["k", "k"],
          ["l", "l"],
          ["m", "m"],
          ["n", "n"],
          ["o", "o"],
          ["p", "p"],
          ["q", "q"],
          ["r", "r"],
          ["s", "s"],
          ["t", "t"],
          ["u", "u"],
          ["v", "v"],
          ["w", "w"],
          ["x", "x"],
          ["y", "y"],
          ["z", "z"],
          ["0", "0"],
          ["1", "1"],
          ["2", "2"],
          ["3", "3"],
          ["4", "4"],
          ["5", "5"],
          ["6", "6"],
          ["7", "7"],
          ["8", "8"],
          ["9", "9"],
        ],
      },
    ],
    message1: "%1",
    args1: [
      {
        type: "input_statement",
        name: "SUBSTACK",
      },
    ],
    category: "events",
    style: "event_blocks",
    suppressPrefixSuffix: true,
  } as const,
] satisfies BlockDefinition[];
