{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "rich-text-editor-paste-cleanup",
  "framework": "blazor",
  "type": "registry:component",
  "component": "RichTextEditor",
  "variant": "paste-cleanup",
  "dependencies": [
    "Syncfusion.Blazor.RichTextEditor"
  ],
  "description": "Rich text editor cleaning Word formatting during paste actions to retain consistent editor styles.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/blazor/llms.txt",
    "skillPack": "syncfusion/blazor-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/blazor/rich-text-editor-paste-cleanup.md"
  },
  "files": [
    {
      "target": "src/components/rich-text-editor-paste-cleanup/RichTextEditor.razor",
      "content": "@page \"/rich-text-editor/paste-cleanup\"\n@using Syncfusion.Blazor.DropDowns\n@using Syncfusion.Blazor.RichTextEditor\n<div class=\"col-lg-8 control-section\">\n    <div class=\"\">\n        <SfRichTextEditor @bind-Value=\"@Value\">\n            <RichTextEditorPasteCleanupSettings Prompt=\"@Prompt\" PlainText=\"@Plaintext\" KeepFormat=\"@Keepformat\" DeniedAttributes=\"@Deniedattr\"\n                                                AllowedStyleProperties=\"@Allowedstyle\" DeniedTags=\"@Deniedtags\" />\n        </SfRichTextEditor>\n    </div>\n</div>\n<PropertyPanel ControlSecClass=\"col-lg-8\">\n        <table id=\"property\" title=\"Properties\">\n            <tbody>\n                <tr>\n                    <td>\n                        <div>Format Option</div>\n                    </td>\n                    <td>\n                        <div>\n                            <SfDropDownList @ref=\"DropObj\" TItem=\"PasteOptions\" TValue=\"string\" PopupHeight=\"200px\" @bind-Value=\"PasteDefaultValue\" DataSource=\"@Options\">\n                                <DropDownListFieldSettings Text=\"Text\" Value=\"Id\" />\n                                <DropDownListEvents TValue=\"string\" TItem=\"PasteOptions\" ValueChange=\"ValueChange\" />\n                            </SfDropDownList>\n                        </div>\n                    </td>\n                </tr>\n                <tr>\n                    <td>\n                        <div>Denied Tags </div>\n                    </td>\n                    <td>\n                        <div>\n                            <input type=\"text\" @bind=\"@DeniedTagsText\" class=\"e-input\" @onblur=\"DeniedTagsblur\" placeholder=\"img[!href], h1\" aria-label=\"Denied Tags\"/>\n                        </div>\n                    </td>\n                </tr>\n                <tr>\n                    <td>\n                        <div>Denied Attributes </div>\n                    </td>\n                    <td>\n                        <div>\n                            <input type=\"text\" @bind=\"@DeniedAttributesText\" class=\"e-input\" @onblur=\"DeniedAttributesblur\" placeholder=\"id, title\" aria-label=\"Denied Attributes\"/>\n                        </div>\n                    </td>\n                </tr>\n                <tr>\n                    <td>\n                        <div>Allowed Style Properties </div>\n                    </td>\n                    <td>\n                        <div>\n                            <input type=\"text\" @bind=\"@AllowedStylePropertiesText\" class=\"e-input\" @onblur=\"AllowedStylePropertiesblur\" placeholder=\"href, style\" aria-label=\"Style Properties\"/>\n                        </div>\n                    </td>\n                </tr>\n            </tbody>\n        </table>\n</PropertyPanel>\n<style>\n    .sf-property-section table td {\n        width: 50%;\n    }\n    .sf-property-section table div {\n        padding-left: 10px;\n        padding-top: 10px;\n    }\n    .sf-property-section {\n        padding-top: 20px;\n    }\n    .sf-property-section .e-icons.e-settings,\n    .sf-property-panel-header {\n        height: 0;\n    }\n</style>\n@code {\n    private SfDropDownList<string, PasteOptions>? DropObj;\n    private string PasteDefaultValue { get; set; } = \"prompt\";\n    private bool Prompt = true;\n    private bool Plaintext = false;\n    private bool Keepformat = false;\n    private string? DeniedTagsText { get; set; }\n    private string? DeniedAttributesText { get; set; }\n    private string? AllowedStylePropertiesText { get; set; }\n    private string[]? Deniedtags { get; set; }\n    private string[]? Deniedattr { get; set; }\n    private string[] Allowedstyle { get; set; } = new string[]\n    {\n        \"background\", \"background-color\", \"border\", \"border-bottom\", \"border-left\", \"border-radius\",\n        \"border-right\", \"border-style\", \"border-top\", \"border-width\", \"clear\", \"color\", \"cursor\",\n        \"direction\", \"display\", \"float\", \"font\", \"font-family\", \"font-size\", \"font-weight\", \"font-style\",\n        \"height\", \"left\", \"line-height\", \"margin\", \"margin-top\", \"margin-left\",\n        \"margin-right\", \"margin-bottom\", \"max-height\", \"max-width\", \"min-height\", \"min-width\",\n        \"overflow\", \"overflow-x\", \"overflow-y\", \"padding\", \"padding-bottom\", \"padding-left\", \"padding-right\",\n        \"padding-top\", \"position\", \"right\", \"table-layout\", \"text-align\", \"text-decoration\", \"text-indent\",\n        \"top\", \"vertical-align\", \"visibility\", \"white-space\", \"width\"\n    };\n    private string Value { get; set; } = @\"<h4>Paste Cleanup in Rich Text Editor<br></h4><p>The Rich Text Editor automatically <strong>cleans up formatted content</strong> when you paste from external sources like Word, Google Docs, or web pages.</p><p><b>Paste Cleanup properties:</b></p><ul>\n                <li><strong>Prompt </strong>- specifies whether to enable the prompt when pasting in Rich Text Editor\n                </li>\n                <li><strong>Plain Text </strong>- specifies whether to paste as plain text or not in Rich Text Editor.\n                </li>\n                <li><strong>Keep Format</strong>- specifies whether to keep or remove the format when pasting in Rich Text Editor.\n                </li>\n                <li><strong>Denied Tags</strong> - specifies the tags to restrict when pasting in Rich Text Editor.\n                </li>\n                <li><strong>Denied Attributes</strong> - specifies the attributes to restrict when pasting in Rich Text Editor.\n                </li>\n                <li><strong>Allowed Style Properties</strong> - specifies the allowed style properties when pasting in Rich Text Editor.\n                </li>\n            </ul><p><span><strong>Try It Out!</strong></span></p><p>Copy content from a web page or document and paste it here. The editor will display a prompt and allow you to input your options.</p>\";\n    private class PasteOptions\n    {\n        public string? Id { get; set; }\n        public string? Text { get; set; }\n    }\n    private List<PasteOptions> Options = new List<PasteOptions>()\n    {\n        new PasteOptions(){ Id= \"prompt\", Text= \"Prompt\" },\n        new PasteOptions(){ Id= \"plainText\", Text= \"Plain Text\" },\n        new PasteOptions(){ Id= \"keepFormat\", Text= \"Keep Format\" },\n        new PasteOptions(){ Id= \"cleanFormat\", Text= \"Clean Format\" },\n    };\n    private void ValueChange(@Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, PasteOptions> args)\n    {\n        if (args.Value == \"prompt\")\n        {\n            this.Prompt = true;\n        }\n        else if (args.Value == \"plainText\")\n        {\n            this.Prompt = false;\n            this.Plaintext = true;\n        }\n        else if (args.Value == \"keepFormat\")\n        {\n            this.Prompt = false;\n            this.Plaintext = false;\n            this.Keepformat = true;\n        }\n        else if (args.Value == \"cleanFormat\")\n        {\n            this.Prompt = false;\n            this.Plaintext = false;\n            this.Keepformat = false;\n        }\n    }\n    private void DeniedTagsblur(Microsoft.AspNetCore.Components.Web.FocusEventArgs e)\n    {\n        if (this.DeniedTagsText != null)\n        {\n            this.Deniedtags = this.DeniedTagsText.Split(',');\n        }\n    }\n    private void DeniedAttributesblur(Microsoft.AspNetCore.Components.Web.FocusEventArgs e)\n    {\n        if (this.DeniedAttributesText != null)\n        {\n            this.Deniedattr = this.DeniedAttributesText.Split(',');\n        }\n    }\n    private void AllowedStylePropertiesblur(Microsoft.AspNetCore.Components.Web.FocusEventArgs e)\n    {\n        if (this.AllowedStylePropertiesText != null)\n        {\n            this.Allowedstyle = this.AllowedStylePropertiesText.Split(',');\n        }\n    }\n}"
    }
  ]
}