Redactor - formattingAdd isn't changing code
Try this for data attributes:

"formattingAdd": {
    "add-animate": {
        "title": "Animate",
        "api": "module.block.format",
        "args": {
            "tag": "p",
            "attr": {
                "data-aos": "fade-right"
            },
            "type": "toggle"
        }
    }
}


This for classes:

"formattingAdd": {
    "add-note": {
        "title": "Note",
        "api": "module.block.format",
        "args": {
            "tag": "p",
            "class": "note"
        }
    }
}


redactor settings formatting