{
    "key": "bs-alert",
    "name": "$string.bsalert_name",
    "category": "bootstrap",
    "icon": "fa fa-exclamation-triangle",
    "template": "<div class=\"m-2 alert alert-{{severity}}{{#closable}} alert-dismissible{{/closable}} fade show\" role=\"alert\">\n  {{#closable}}\n   <button type=\"button\" class=\"close\" data-dismiss=\"alert\" data-bs-dismiss=\"alert\" aria-label=\"Close\">\n     <span aria-hidden=\"true\">&times;</span>\n   </button>\n  {{/closable}}\n  <div class=\"alert-content\">\n    <p>Lorem ipsum.</p>\n  </div>\n</div>\n<p><br></p>\n",
    "selectors": "div[role=\"alert\"].alert",
    "insertquery": "div[role=\"alert\"].alert .alert-content",
    "unwrap": "*",
    "parameters": [
        {
            "name": "severity",
            "title": "$string.bsalert_severity_title",
            "bind": "classRegex('alert-(.*)')",
            "value": "primary",
            "options": [
                "primary",
                "secondary",
                "success",
                "info",
                "warning",
                "danger",
                "light",
                "dark"
            ]
        },
        {
            "name": "closable",
            "title": "$string.bsalert_closable_title",
            "value": false,
            "bind": {
                "getValue": "(el) => el.querySelector(\"button.close\") !== null",
                "setValue": "(el, v) => {\n    var btnClose = el.querySelector(\"button.close\");\n    if (v && btnClose === null) {\n      var btn = '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" data-bs-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>';\n      const template = document.createElement('template');\n      template.innerHTML = btn;\n      el.prepend(template.content.firstChild);\n      el.classList.add('alert-dismissible');\n    } else if (!v) {\n      el.classList.remove('alert-dismissible');\n      btnClose && btnClose.remove();\n    }\n}\n"
            }
        }
    ],
    "autocomplete": "severity",
    "contextmenu": [
        {
            "actions": "printable | cut"
        }
    ],
    "author": "Josep Mulet <pep.mulet@gmail.com>",
    "version": "2.2.1"
}