/********************************************************
+*   (c) Mojang. All rights reserved                     *
+*   (c) Microsoft. All rights reserved.                 *
+*********************************************************/

{
  "namespace": "jigsaw_editor",

  "horizontal_buffer": {
    "type": "panel",
    "size": [ 10, 0 ]
  },

  "vertical_buffer": {
    "type": "panel",
    "size": [ 0, 10 ]
  },

  "common_text_label": {
    "type": "label",
    "size": [ "default", 10 ],
    "color": "$main_header_text_color",
    "layer": 1
  },

  "text_edit_box@common.text_edit_box": {
    "size": [ "100%", 22 ],
    "max_length": 40
  },

  "data_item_title_and_edit": {
    "type": "stack_panel",
    "size": [ "100%", "100%c" ],
    "controls": [
      {
        "data_title@jigsaw_editor.common_text_label": {
          "text": "$data_title"
        }
      },
      {
        "data_text_edit@jigsaw_editor.text_edit_box": {
          "$text_box_name": "$data_text_box_name",
          "$text_edit_box_content_binding_name": "$data_text_box_value"
        }
      }
    ]
  },

  "text_change_toggle@common_toggles.light_text_toggle": {
    "$checked_control": "common_toggles.toggle_unchecked",
    "$checked_hover_control": "common_toggles.toggle_unchecked_hover"
  },

  "data_item_title_and_toggle": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "size": [ "100%", "100%cm" ],
    "controls": [
      {
        "title_holder": {
          "type": "panel",
          "size": [ "100%c", 0 ],
          "inherit_max_sibling_height": true,
          "controls": [
            {
              "data_title@jigsaw_editor.common_text_label": {
                "text": "$data_title"
              }
            }
          ]
        }
      },
      { "buffer_1@jigsaw_editor.horizontal_buffer": {} },
      {
        "data_toggle@jigsaw_editor.text_change_toggle": {
          "size": [ "fill", 20 ],
          "$button_text_binding_type": "global",
          "$button_text": "#joint_type_toggle_text",

          "$toggle_name": "toggle.joint_type_toggle",

          "$toggle_binding_type": "global",
          "$toggle_state_binding_name": "#joint_type_toggle_state"
        }
      }
    ]
  },

  "exit_buttons": {
    "type": "stack_panel",
    "orientation": "horizontal",
    "size": [ "100%", "100%cm" ],
    "controls": [
      {
        "done_button@common_buttons.light_text_button": {
          "size": [ "fill", 20 ],
          "$button_text": "jigsaw.exit.done",
          "$pressed_button_name": "button.exit_done"
        }
      },
      { "buffer_1@jigsaw_editor.horizontal_buffer": {} },
      {
        "cancel_button@common_buttons.light_text_button": {
          "size": [ "fill", 20 ],
          "$button_text": "jigsaw.exit.cancel",
          "$pressed_button_name": "button.menu_exit"
        }
      }
    ]
  },

  "jigsaw_editor_content": {
    "type": "stack_panel",
    "size": [ "100% - 20px", "100% - 20px" ],
    "max_size": [ 292, "100%" ],
    "controls": [
      {
        "target_pool_title_and_edit@jigsaw_editor.data_item_title_and_edit": {
          "$data_title": "jigsaw.title.target_pool",
          "$data_text_box_name": "text_box.target_pool_text_box",
          "$data_text_box_value": "#target_pool_text_box_value"
        }
      },
      { "buffer_1@jigsaw_editor.vertical_buffer": {} },
      {
        "name_title_and_edit@jigsaw_editor.data_item_title_and_edit": {
          "$data_title": "jigsaw.title.name",
          "$data_text_box_name": "text_box.name_text_box",
          "$data_text_box_value": "#name_text_box_value"
        }
      },
      { "buffer_2@jigsaw_editor.vertical_buffer": {} },
      {
        "target_title_and_edit@jigsaw_editor.data_item_title_and_edit": {
          "$data_title": "jigsaw.title.target",
          "$data_text_box_name": "text_box.target_text_box",
          "$data_text_box_value": "#target_text_box_value"
        }
      },
      { "buffer_3@jigsaw_editor.vertical_buffer": {} },
      {
        "final_block_title_and_edit@jigsaw_editor.data_item_title_and_edit": {
          "$data_title": "jigsaw.title.final_block",
          "$data_text_box_name": "text_box.final_block_text_box",
          "$data_text_box_value": "#final_block_text_box_value"
        }
      },
      { "buffer_4@jigsaw_editor.vertical_buffer": {} },
      {
        "joing_type_title_and_toggle@jigsaw_editor.data_item_title_and_toggle": {
          "$data_title": "jigsaw.title.joint_type",
          "$toggle_name": "toggle.joint_type_toggle,",
          "$toggle_state_binding_name": "#joint_type_toggle_state"
        }
      },
      {
        "lower_buffer": {
          "type": "panel",
          "size": [ "100%", "fill" ]
        }
      },
      { "exit_buttons@jigsaw_editor.exit_buttons": {} }
    ]
  },

  "jigsaw_editor_screen@common.base_screen": {
    "button_mappings": [
      {
        "from_button_id": "button.menu_cancel",
        "to_button_id": "button.menu_exit",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.menu_inventory_cancel",
        "to_button_id": "button.menu_exit",
        "mapping_type": "global"
      },
      {
        "from_button_id": "button.menu_tab_left",
        "to_button_id": "button.menu_tab_left",
        "mapping_type": "global",
        "scope": "view"
      },
      {
        "from_button_id": "button.menu_tab_right",
        "to_button_id": "button.menu_tab_right",
        "mapping_type": "global",
        "scope": "view"
      }
    ],
    "$screen_content": "jigsaw_editor.jigsaw_editor_content",
    "$screen_bg_content": "common.screen_background"
  }
}
