{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "title": "HTML Widget Template Schema",
  "description": "Defines a web-component based widget template that uses vanilla HTML.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "htmlTemplate"
  ],
  "properties": {
    "meta": {
      "type": "object",
      "title": "Template Meta",
      "additionalProperties": false,
      "properties": {
        "dependencies": {
          "type": "array",
          "description": "A list of NPM resources to load into the widget",
          "items": {
            "$ref": "#/definitions/npmDependency"
          }
        },
        "plugins": {
          "type": "array",
          "description": "A list of component editors used in editing the widget",
          "items": {
            "$ref": "#/definitions/npmDependency"
          }
        }
      }
    },
    "htmlTemplate": {
      "type": "string",
      "title": "HTML Template",
      "description": "Raw HTML content that can use web components."
    },
    "autoPopup": {
      "type": "boolean",
      "title": "Auto Popup",
      "description": "Whether this widget should automatically popup on page load",
      "default": false
    },
    "brandingConfig": {
      "type": "object",
      "title": "Branding Config"
    }
  },
  "definitions": {
    "npmDependency": {
      "type": "object",
      "properties": {
        "package": {
          "type": "string",
          "description": "An NPM package name or scoped package"
        },
        "version": {
          "type": "string",
          "description": "An NPM version string, such as Patch releases: 1.0 or 1.0.x or ~1.0.4 Minor releases: 1 or 1.x or ^1.0.4 Major releases: * or x",
          "default": "latest"
        },
        "filePath": {
          "type": "string",
          "description": "The path to a resource in the specified package",
          "default": ""
        }
      },
      "required": [
        "version",
        "package"
      ]
    }
  }
}