{
  "$schema": "https://schemas.wp.org/trunk/block.json",
  "apiVersion": 3,
  "title": "Media Gallery",
  "name": "brandy/media-gallery",
  "category": "brandy-blocks",
  "description": "Image gallery in grid or slider layout, with PhotoSwipe lightbox (pinch-zoom, swipe, captions).",
  "keywords": [
    "gallery",
    "lightbox",
    "photoswipe",
    "grid",
    "slider",
    "carousel",
    "media"
  ],
  "attributes": {
    "displayMode": {
      "type": "string",
      "default": "grid",
      "enum": [
        "grid",
        "slider"
      ]
    },
    "columns": {
      "type": "object",
      "default": {
        "desktop": 3,
        "tablet": 2,
        "mobile": 1
      }
    },
    "gap": {
      "type": "string",
      "default": "16px"
    },
    "titlePosition": {
      "type": "string",
      "default": "below",
      "enum": [
        "below",
        "top-left",
        "top-right",
        "bottom-left",
        "bottom-right",
        "center",
        "hidden"
      ]
    },
    "captionSource": {
      "type": "string",
      "default": "title",
      "enum": [
        "title",
        "description",
        "imageAlt",
        "none"
      ]
    },
    "enableLightbox": {
      "type": "boolean",
      "default": true
    },
    "showCounter": {
      "type": "boolean",
      "default": true
    },
    "loop": {
      "type": "boolean",
      "default": true
    },
    "isDynamic": {
      "type": "boolean",
      "default": false
    },
    "query": {
      "type": "object",
      "default": {
        "postType": "post",
        "perPage": 6,
        "orderBy": "date",
        "order": "desc",
        "offset": 0,
        "categories": [],
        "tags": [],
        "exclude": []
      }
    },
    "presetKey": {
      "type": "string",
      "default": ""
    },
    "controlsPlacement": {
      "type": "string",
      "default": ""
    },
    "controlsNav": {
      "type": "string",
      "default": ""
    },
    "controlsDots": {
      "type": "string",
      "default": ""
    },
    "controlsReveal": {
      "type": "string",
      "default": ""
    },
    "dimInactiveSlides": {
      "type": "boolean",
      "default": false
    },
    "controlsNavColors": {
      "type": "object",
      "default": {}
    },
    "controlsDotsColors": {
      "type": "object",
      "default": {}
    }
  },
  "providesContext": {
    "brandy/mediaGalleryCaptionSource": "captionSource",
    "brandy/mediaGalleryEnableLightbox": "enableLightbox",
    "brandy/mediaGalleryTitlePosition": "titlePosition",
    "brandy/mediaGalleryDisplayMode": "displayMode",
    "brandy/mediaGalleryIsDynamic": "isDynamic"
  },
  "allowedBlocks": [
    "brandy/media-gallery-item"
  ],
  "example": {
    "viewportWidth": 1400,
    "attributes": {
      "displayMode": "grid",
      "columns": {
        "desktop": 3,
        "tablet": 2,
        "mobile": 1
      },
      "gap": "16px",
      "titlePosition": "below",
      "isDynamic": false
    },
    "innerBlocks": [
      {
        "name": "brandy/media-gallery-item",
        "attributes": {},
        "innerBlocks": [
          {
            "name": "core/image",
            "attributes": {
              "url": "https://images.wpbrandy.com/uploads/skateboards-post-img-1.webp",
              "alt": "Deck art laid out on a workbench"
            }
          },
          {
            "name": "core/heading",
            "attributes": {
              "level": 3,
              "content": "Deck art"
            }
          },
          {
            "name": "core/paragraph",
            "attributes": {
              "content": "Hand-screened graphics, one deck at a time."
            }
          }
        ]
      },
      {
        "name": "brandy/media-gallery-item",
        "attributes": {},
        "innerBlocks": [
          {
            "name": "core/image",
            "attributes": {
              "url": "https://images.wpbrandy.com/uploads/skateboards-post-img-2.webp",
              "alt": "Rider mid-trick at the park"
            }
          },
          {
            "name": "core/heading",
            "attributes": {
              "level": 3,
              "content": "Park sessions"
            }
          },
          {
            "name": "core/paragraph",
            "attributes": {
              "content": "Shot on a Tuesday, before the crowds."
            }
          }
        ]
      },
      {
        "name": "brandy/media-gallery-item",
        "attributes": {},
        "innerBlocks": [
          {
            "name": "core/image",
            "attributes": {
              "url": "https://images.wpbrandy.com/uploads/skateboards-post-img-3.webp",
              "alt": "Wheels and bearings on a shop counter"
            }
          },
          {
            "name": "core/heading",
            "attributes": {
              "level": 3,
              "content": "Parts and setups"
            }
          },
          {
            "name": "core/paragraph",
            "attributes": {
              "content": "Every build starts with the right wheels."
            }
          }
        ]
      }
    ]
  },
  "supports": {
    "reusable": false,
    "html": false,
    "align": [
      "wide",
      "full"
    ],
    "spacing": {
      "margin": true,
      "padding": true,
      "blockGap": true,
      "__experimentalSkipSerialization": [
        "blockGap"
      ],
      "__experimentalDefaultControls": {
        "blockGap": true
      }
    }
  },
  "render": "file:./render.php",
  "textdomain": "brandy-blocks",
  "editorScript": "file:./index.js",
  "editorStyle": "file:./index.css",
  "style": "file:./style-index.css",
  "viewScriptModule": "file:./view.js"
}