{
  "definitions": {
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "ddg_easy_editor_extension_v4.00",
  "title": "Dotdigital Easy Editor Extension",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "listing",
    "template"
  ],
  "properties": {
    "listing": {
      "$id": "#root/listing",
      "title": "listing",
      "type": "object",
      "description": "The extensions listing and tile details",
      "required": [
        "scope",
        "author",
        "group",
        "icon",
        "name",
        "description",
        "links"
      ],
      "properties": {
        "scope": {
          "$id": "#root/listing/scope",
          "title": "scope",
          "type": "array",
          "minItems": 1,
          "description": "Which Easy Editors the extension can be used with",
          "items": {
            "type": "string",
            "enum": [
              "pagesAndForms",
              "email"
            ]
          },
          "examples": [
            [
              "email"
            ]
          ]
        },
        "author": {
          "$id": "#root/listing/author",
          "title": "author",
          "type": "string",
          "description": "Who created the extension",
          "pattern": "^.{3,50}$",
          "examples": [
            "Dotdigital"
          ]
        },
        "group": {
          "$id": "#root/listing/group",
          "title": "group",
          "type": "object",
          "description": "The group the extension will be listed under in Easy Editor",
          "required": [
            "name",
            "icon"
          ],
          "properties": {
            "name": {
              "$id": "#root/listing/group/name",
              "title": "Name",
              "type": "string",
              "description": "The name of the group the extension will be listed under",
              "examples": [
                "Product stars"
              ],
              "pattern": "^.{3,52}$"
            },
            "icon": {
              "$id": "#root/listing/group/icon",
              "title": "icon",
              "type": "string",
              "default": null,
              "description": "The the icon for the group in SVG format",
              "examples": [
                "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n    <rect width=\"40\" height=\"40\" rx=\"2\" fill=\"white\"/>\r\n    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.7899 30.9777L31.9086 16.9383L24.9383 14.9663L20.4162 8L15.8941 14.9663L8 17.1997L13.0992 23.7384L12.7899 30.9777Z\" fill=\"#0042E4\"/>\r\n    <rect x=\"24.0322\" y=\"23.1682\" width=\"7.96779\" height=\"8.07962\" rx=\"3.98389\" fill=\"#FF4E61\"/>\r\n</svg>"
              ]
            }
          }
        },
        "icon": {
          "$id": "#root/listing/icon",
          "title": "Icon",
          "type": "string",
          "default": null,
          "description": "The icon for the extension in SVG format",
          "examples": [
            "<svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\r\n    <rect width=\"40\" height=\"40\" rx=\"2\" fill=\"white\"/>\r\n    <path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M12.7899 30.9777L31.9086 16.9383L24.9383 14.9663L20.4162 8L15.8941 14.9663L8 17.1997L13.0992 23.7384L12.7899 30.9777Z\" fill=\"#0042E4\"/>\r\n    <rect x=\"24.0322\" y=\"23.1682\" width=\"7.96779\" height=\"8.07962\" rx=\"3.98389\" fill=\"#FF4E61\"/>\r\n</svg>"
          ]
        },
        "name": {
          "$id": "#root/listing/name",
          "title": "name",
          "type": "string",
          "description": "The name of the extension",
          "examples": [
            "Product stars"
          ],
          "pattern": "^.{3,50}$",
          "default": "My extension"
        },
        "description": {
          "$id": "#root/listing/description",
          "title": "Description",
          "type": "string",
          "description": "The description of the functionality of the extension",
          "examples": [
            "Displays a star rating for the last product the customer purchased."
          ],
          "pattern": "^.{20,}$"
        },
        "links": {
          "$id": "#root/listing/links",
          "title": "links",
          "type": "array",
          "default": [
          ],
          "description": "Any links to be listed with the description",
          "items": {
            "$id": "#root/listing/links/items",
            "title": "items",
            "type": "object",
            "required": [
              "linkDescription",
              "url"
            ],
            "properties": {
              "description": {
                "$id": "#root/listing/links/items/description",
                "title": "description",
                "type": "string",
                "description": "The short description of what the link is to",
                "examples": [
                  "Yotpo"
                ],
                "pattern": "^.{3,110}$"
              },
              "url": {
                "$id": "#root/listing/links/items/url",
                "title": "url",
                "type": "string",
                "description": "The URL for the link",
                "examples": [
                  "https://acme.com/about"
                ]
              }
            }
          }
        },
        "inherit_styles": {
          "title": "inherit_styles",
          "type": "boolean",
          "default": false,
          "description": "Whether the app blocks mark-up should inherit the campaign styles setup in Easy Editors style manager or not",
          "examples": [
            true
          ]
        },
        "min_width": {
          "title": "min_width",
          "type": "integer",
          "description": "The minimum width in pixels this app block requires to render. <br><br>Note: If not specified the app block cannot be used within columns!",
          "examples": [
            300
          ]
        },
        "max_width": {
          "title": "max_width",
          "type": "integer",
          "description": "The maximum width in pixels this app block can render correctly in. <br><br>Note: Optional but useful to set to avoid formatting issues if there is an upper limit",
          "examples": [
            800
          ]
        }
      }
    },
    "parameters": {
      "$id": "#root/parameters",
      "title": "parameters",
      "type": "object",
      "properties": {
        "interactive": {
          "$id": "#root/parameters/interactive",
          "title": "interactive",
          "type": "array",
          "default": [
          ],
          "description": "The parameters required to be entered by the user",
          "items": {
            "$id": "#root/parameters/interactive/items",
            "title": "items",
            "type": "object",
            "required": [
              "id",
              "name",
              "parameter_type",
              "required"
            ],
            "properties": {
              "id": {
                "$id": "#root/parameters/interactive/items/id",
                "title": "id",
                "type": "string",
                "description": "The unique id for this parameter",
                "examples": [
                  "numeric_1"
                ],
                "pattern": "^[a-zA-z0-9_]*$"
              },
              "name": {
                "$id": "#root/parameters/interactive/items/name",
                "title": "name",
                "type": "string",
                "description": "The unique parameter name to be displayed",
                "examples": [
                  "Default cash value"
                ],
                "pattern": "^.{3,50}$"
              },
              "category": {
                "$id": "#root/parameters/interactive/items/category",
                "title": "category",
                "type": "string",
                "description": "The category of the parameter, the category is used to group parameters together in the editor into sections.",
                "examples": [
                  "Product criteria"
                ],
                "default": "General",
                "pattern": "^.{3,50}$"
              },
              "sub_category": {
                "$id": "#root/parameters/interactive/items/sub_category",
                "title": "sub category",
                "type": "string",
                "description": "The subcategory of the parameter, the subcategory is used to group parameters together in the editor, useful when you need multiple parameter values to define one concept e.g. font and color.",
                "examples": [
                  "Headline style"
                ],
                "pattern": "^.{3,50}$"
              },
              "parameter_type": {
                "$id": "#root/parameters/interactive/items/parameter_type",
                "title": "parameter_type",
                "type": "string",
                "enum": [
                  "numeric",
                  "string",
                  "boolean",
                  "check-list",
                  "multiple-choice",
                  "dropdown",
                  "color-picker",
                  "date-time"
                ],
                "description": "The input type for the parameter",
                "examples": [
                  "numeric"
                ]
              },
              "options": {
                "$id": "#root/parameters/interactive/items/parameter_type",
                "title": "parameter_type",
                "type": "array",
                "minItems": 1,
                "description": "Describes options to select for multiple choice, check list or dropdown parameter types. Note: Must be defined if the parameter type is one of: multiple choice, check list or dropdown",
                "items": {
                  "type": "string",
                  "description": "The values for the multi select user controls",
                  "examples": [
                    "Yes,No"
                  ]
                }
              },
              "min_value": {
                "$id": "#root/parameters/interactive/items/min_value",
                "title": "min_value",
                "type": "number",
                "description": "Specifies the minimum acceptable value when using a numeric type. Note: Must be lower than max_value if specified",
                "default": null,
                "examples": [
                  30.0,
                  -1.0
                ]
              },
              "max_value": {
                "$id": "#root/parameters/interactive/items/max_value",
                "title": "max_value",
                "type": "number",
                "description": "Specifies the maximum acceptable value when using a numeric type. Note: Must be higher than min_value if specified",
                "default": null,
                "examples": [
                  100.0,
                  10.0
                ]
              },
              "step": {
                "$id": "#root/parameters/interactive/items/step",
                "title": "step",
                "type": "number",
                "description": "Specifies the step change between valid values for numeric types",
                "default": null,
                "examples": [
                  2,
                  1
                ]
              },
              "request_time": {
                "$id": "#root/parameters/interactive/items/request_time",
                "title": "request_time",
                "type": "boolean",
                "description": "Whether we should prompt the user to specify a time as well as a date",
                "default": "false"
              },
              "datetime_format": {
                "$id": "#root/parameters/interactive/items/datetime_format",
                "title": "datetime_format",
                "type": "string",
                "description": "The output format for the date time; for `date-time` parameters and defaults to ISO 8601",
                "default": "c",
                "examples": [
                  "U",
                  "c",
                  "d/m/Y",
                  "m/d/Y H:i:s"
                ]
              },
              "timezone_id": {
                "$id": "#root/parameters/interactive/items/timezone_id",
                "title": "timezone_id",
                "type": "string",
                "description": "The output timezone for the date time; for `date-time` parameters only and defaults to the current users timezone",
                "enum": [
                  "AUS Central Standard Time",
                  "AUS Eastern Standard Time",
                  "Afghanistan Standard Time",
                  "Alaskan Standard Time",
                  "Aleutian Standard Time",
                  "Altai Standard Time",
                  "Arab Standard Time",
                  "Arabian Standard Time",
                  "Arabic Standard Time",
                  "Argentina Standard Time",
                  "Astrakhan Standard Time",
                  "Atlantic Standard Time",
                  "Aus Central W. Standard Time",
                  "Azerbaijan Standard Time",
                  "Azores Standard Time",
                  "Bahia Standard Time",
                  "Bangladesh Standard Time",
                  "Belarus Standard Time",
                  "Bougainville Standard Time",
                  "Canada Central Standard Time",
                  "Cape Verde Standard Time",
                  "Caucasus Standard Time",
                  "Cen. Australia Standard Time",
                  "Central America Standard Time",
                  "Central Asia Standard Time",
                  "Central Brazilian Standard Time",
                  "Central Europe Standard Time",
                  "Central European Standard Time",
                  "Central Pacific Standard Time",
                  "Central Standard Time (Mexico)",
                  "Central Standard Time",
                  "Chatham Islands Standard Time",
                  "China Standard Time",
                  "Cuba Standard Time",
                  "Dateline Standard Time",
                  "E. Africa Standard Time",
                  "E. Australia Standard Time",
                  "E. Europe Standard Time",
                  "E. South America Standard Time",
                  "Easter Island Standard Time",
                  "Eastern Standard Time (Mexico)",
                  "Eastern Standard Time",
                  "Egypt Standard Time",
                  "Ekaterinburg Standard Time",
                  "FLE Standard Time",
                  "Fiji Standard Time",
                  "GMT Standard Time",
                  "GTB Standard Time",
                  "Georgian Standard Time",
                  "Greenland Standard Time",
                  "Greenwich Standard Time",
                  "Haiti Standard Time",
                  "Hawaiian Standard Time",
                  "India Standard Time",
                  "Iran Standard Time",
                  "Israel Standard Time",
                  "Jordan Standard Time",
                  "Kaliningrad Standard Time",
                  "Kamchatka Standard Time",
                  "Korea Standard Time",
                  "Libya Standard Time",
                  "Line Islands Standard Time",
                  "Lord Howe Standard Time",
                  "Magadan Standard Time",
                  "Magallanes Standard Time",
                  "Marquesas Standard Time",
                  "Mauritius Standard Time",
                  "Mid-Atlantic Standard Time",
                  "Middle East Standard Time",
                  "Montevideo Standard Time",
                  "Morocco Standard Time",
                  "Mountain Standard Time (Mexico)",
                  "Mountain Standard Time",
                  "Myanmar Standard Time",
                  "N. Central Asia Standard Time",
                  "Namibia Standard Time",
                  "Nepal Standard Time",
                  "New Zealand Standard Time",
                  "Newfoundland Standard Time",
                  "Norfolk Standard Time",
                  "North Asia East Standard Time",
                  "North Asia Standard Time",
                  "North Korea Standard Time",
                  "Omsk Standard Time",
                  "Pacific SA Standard Time",
                  "Pacific Standard Time (Mexico)",
                  "Pacific Standard Time",
                  "Pakistan Standard Time",
                  "Paraguay Standard Time",
                  "Qyzylorda Standard Time",
                  "Romance Standard Time",
                  "Russia Time Zone 10",
                  "Russia Time Zone 11",
                  "Russia Time Zone 3",
                  "Russian Standard Time",
                  "SA Eastern Standard Time",
                  "SA Pacific Standard Time",
                  "SA Western Standard Time",
                  "SE Asia Standard Time",
                  "Saint Pierre Standard Time",
                  "Sakhalin Standard Time",
                  "Samoa Standard Time",
                  "Sao Tome Standard Time",
                  "Saratov Standard Time",
                  "Singapore Standard Time",
                  "South Africa Standard Time",
                  "South Sudan Standard Time",
                  "Sri Lanka Standard Time",
                  "Sudan Standard Time",
                  "Syria Standard Time",
                  "Taipei Standard Time",
                  "Tasmania Standard Time",
                  "Tocantins Standard Time",
                  "Tokyo Standard Time",
                  "Tomsk Standard Time",
                  "Tonga Standard Time",
                  "Transbaikal Standard Time",
                  "Turkey Standard Time",
                  "Turks And Caicos Standard Time",
                  "US Eastern Standard Time",
                  "US Mountain Standard Time",
                  "UTC",
                  "UTC+12",
                  "UTC+13",
                  "UTC-02",
                  "UTC-08",
                  "UTC-09",
                  "UTC-11",
                  "Ulaanbaatar Standard Time",
                  "Venezuela Standard Time",
                  "Vladivostok Standard Time",
                  "Volgograd Standard Time",
                  "W. Australia Standard Time",
                  "W. Central Africa Standard Time",
                  "W. Europe Standard Time",
                  "W. Mongolia Standard Time",
                  "West Asia Standard Time",
                  "West Bank Standard Time",
                  "West Pacific Standard Time",
                  "Yakutsk Standard Time",
                  "Yukon Standard Time"
                ],
                "examples": [
                  "UTC"
                ]
              },
              "default_value": {
                "$id": "#root/parameters/interactive/items/default_value",
                "title": "default_value",
                "type": "string",
                "description": "The default value for this parameter",
                "default": null,
                "examples": [
                  "50.00",
                  "1.0"
                ]
              },
              "required": {
                "$id": "#root/parameters/interactive/items/required",
                "title": "required",
                "type": "boolean",
                "examples": [
                  true
                ],
                "default": true,
                "description": "Whether a value for this parameter must be entered by the user"
              },
              "help": {
                "$id": "#root/parameters/interactive/items/help",
                "title": "help",
                "type": "string",
                "description": "A short description of what is required in this parameter",
                "examples": [
                  "This is your numeric field user help text"
                ],
                "pattern": ".{3,110}"
              },
              "encode_output": {
                "$id": "#root/parameters/interactive/items/encode_output",
                "title": "encode_output",
                "type": "string",
                "description": "Optionally choose to encode the parameters output.",
                "enum": [
                  "urlEncode",
                  "htmlEncode",
                  "base64"
                ],
                "examples": [
                  "urlEncode"
                ]
              }
            }
          }
        },
        "non_interactive": {
          "$id": "#root/parameters/non_interactive",
          "title": "non_interactive",
          "type": "array",
          "default": [
          ],
          "description": "The derived parameters used in the template",
          "items": {
            "$id": "#root/parameters/non_interactive/items",
            "title": "items",
            "type": "object",
            "required": [
              "id",
              "value"
            ],
            "properties": {
              "id": {
                "$id": "#root/parameters/non_interactive/items/id",
                "title": "id",
                "type": "string",
                "description": "The unique id for this parameter",
                "examples": [
                  "sku"
                ],
                "pattern": "^[a-zA-z0-9_]*$"
              },
              "value": {
                "$id": "#root/parameters/non_interactive/items/value",
                "title": "value",
                "type": "string",
                "description": "The value, contact field or liquid script",
                "examples": [
                  "{% assign Orders_data = contact.insight.Orders | sort: 'purchase_date' | reverse %}{{ Orders_data.first.id }}"
                ]
              },
              "encode_output": {
                "$id": "#root/parameters/interactive/items/encode_output",
                "title": "encode_output",
                "type": "string",
                "description": "Optionally choose to encode the parameters output.",
                "enum": [
                  "url-encode",
                  "html-encode",
                  "base64"
                ],
                "examples": [
                  "url-encode"
                ]
              }
            }
          }
        },
        "preview": {
          "$id": "#root/parameters/preview",
          "title": "preview",
          "type": "array",
          "default": [
          ],
          "description": "The preview parameters used in the template. These are only used during a preview viewing and then removed when published.",
          "items": {
            "$id": "#root/parameters/non_interactive/items",
            "title": "items",
            "type": "object",
            "required": [
              "id",
              "value"
            ],
            "properties": {
              "id": {
                "$id": "#root/parameters/non_interactive/items/id",
                "title": "id",
                "type": "string",
                "description": "The unique id for this parameter; all parameters must start with 'preview_'",
                "examples": [
                  "preview_ignoreFlag"
                ],
                "pattern": "^preview_[a-zA-z0-9_]*$"
              },
              "value": {
                "$id": "#root/parameters/non_interactive/items/value",
                "title": "value",
                "type": "string",
                "description": "The value, contact field or liquid script",
                "examples": [
                  "test=true"
                ]
              },
              "encode_output": {
                "$id": "#root/parameters/interactive/items/encode_output",
                "title": "encode_output",
                "type": "string",
                "description": "Optionally choose to encode the parameters output.",
                "enum": [
                  "url-encode",
                  "html-encode",
                  "base64"
                ],
                "examples": [
                  "url-encode"
                ]
              }
            }
          }
        }
      }
    },
    "template": {
      "$id": "#root/template",
      "title": "template",
      "type": "string",
      "description": "The HTML markup that will be merged. Use [[Parameter id]] to refer to a parameter",
      "examples": [
        "<script type=\"text/javascript\">\r\n(function e(){var e=document.createElement(\"script\");e.type=\"text/javascript\",e.async=true,e.src=\"//staticw2.yotpo.com/[[yotpo_app_key]]/widget.js\";var t=document.getElementsByTagName(\"script\")[0];t.parentNode.insertBefore(e,t)})();\r\n</script>\r\n\r\n<div class=\"yotpo bottomLine\"\r\ndata-yotpo-product-id=\"[[sku]]\">\r\n</div>"
      ]
    }
  }
}