{
  "type": "pdf-gallery-viewer",
  "description": "Gallery viewer with thumbnail rail, page preview, navigation, and PDF download from SQL or static pages.",
  "hasChildren": false,
  "propsSchema": {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
      "label": {
        "description": "Label text displayed above the widget",
        "type": "string"
      },
      "sql": {
        "description": "DuckDB SQL query with {{udf_name}} and $param_name placeholders. Must return value, title, and image columns. Takes precedence over pages.",
        "type": "string"
      },
      "pages": {
        "description": "Static array of pages. Used when sql is not provided or when sql fails.",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "value": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "object",
                  "propertyNames": {
                    "type": "string"
                  },
                  "additionalProperties": {}
                }
              ]
            },
            "title": {
              "type": "string",
              "description": "Title displayed under the thumbnail"
            },
            "image": {
              "type": "string",
              "description": "Image URL or base64 data URL used for thumbnail, preview, and PDF export"
            }
          },
          "required": [
            "value",
            "title",
            "image"
          ],
          "description": "A single page with value, title, and image."
        }
      },
      "defaultPageIndex": {
        "default": 0,
        "description": "Initial selected page index (0-based).",
        "type": "number"
      },
      "mode": {
        "default": "vertical",
        "description": "Layout mode. vertical places thumbnails on the left; horizontal places thumbnails on top.",
        "type": "string",
        "enum": [
          "vertical",
          "horizontal"
        ]
      },
      "thumbnailWidth": {
        "default": 120,
        "description": "Thumbnail card width in pixels.",
        "type": "number",
        "exclusiveMinimum": 0
      },
      "thumbnailHeight": {
        "default": 90,
        "description": "Thumbnail card height in pixels.",
        "type": "number",
        "exclusiveMinimum": 0
      },
      "previewHeight": {
        "default": 400,
        "description": "Preview pane height in pixels.",
        "type": "number",
        "exclusiveMinimum": 0
      },
      "pdfFileName": {
        "default": "document.pdf",
        "description": "Downloaded PDF file name.",
        "type": "string"
      },
      "downloadEnabled": {
        "default": true,
        "description": "If true, shows the download PDF button in the preview toolbar.",
        "type": "boolean"
      },
      "navigationEnabled": {
        "default": true,
        "description": "If true, shows previous and next page buttons in the preview toolbar.",
        "type": "boolean"
      },
      "style": {
        "description": "Inline CSS styles as a plain CSS string (e.g., \"height: 100%; min-height: 480px\")",
        "type": "string"
      }
    },
    "description": "PDF/gallery viewer with thumbnail rail, full-page preview, navigation, and browser-side PDF download. Prefer sql for dynamic pages from UDF DataFrames; fall back to pages array for static data."
  }
}
