{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "docx-editor-comments",
  "framework": "aspnet-mvc",
  "type": "registry:component",
  "component": "DocxEditor",
  "variant": "comments",
  "dependencies": [
    "Syncfusion.AspNetMvc.DocumentEditor"
  ],
  "description": "Document editor demonstrating threaded comments and at-mention support in the document.",
  "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/aspnet-mvc/llms.txt",
    "skillPack": "syncfusion/aspnetmvc-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/aspnet-mvc/docx-editor-comments.md"
  },
  "files": [
    {
      "target": "src/components/docx-editor-comments/DocxEditor.cshtml",
      "content": "@using Syncfusion.EJ2\n@section ControlsSection{\n    <div class=\"control-section\">\n        <div class=\"flex-container\">\n            <label class=\"switchLabel\" for=\"checked\">Ribbon UI</label>\n            @*<div class=\"e-message render-mode-info\">\n                    <span class=\"e-msg-icon render-mode-info-icon\" title=\"Turn OFF to switch from Ribbon to toolbar UI\"></span>\n                </div>\n                @Html.EJS().Switch(\"toolbarSwitch\").CssClass(\"buttonSwitch\").Change(\"onSwitchChange\").Checked(true).Render()*@\n        </div>\n        <div id='documenteditor_titlebar' class=\"e-de-ctn-title\"></div>\n        @Html.EJS().DocumentEditorContainer(\"container\").Height(\"590px\").CurrentUser(\"Nancy Davolio\").UserColor(\"#b70f34\").EnableToolbar(true).Render()\n    </div>\n    <script src=\"~/Scripts/documenteditor/default-properties.js\"></script>\n}\n\n@section Scripts{\n    <script>\n        var documenteditor;\n        ej.documenteditor.DocumentEditorContainer.Inject(ej.documenteditor.Toolbar, ej.documenteditor.Ribbon);\n\ndocument.addEventListener('DOMContentLoaded', function () {\n            var documenteditorElement = document.getElementById(\"container\");\n            documenteditorElement.style.height = \"590px\";\n            documenteditorElement.style.width = \"100%\";\n            var container = documenteditorElement.ej2_instances[0];\n            container.toolbarMode = \"Ribbon\";\n            container.showPropertiesPane = false;\n            container.documentEditorSettings.showRuler = true;\n            var mentionData = [\n                { \"Name\": \"Selma Rose\", \"Eimg\": \"3\", \"EmailId\": \"selma@mycompany.com\" },\n                { \"Name\": \"Russo Kay\", \"Eimg\": \"8\", \"EmailId\": \"russo@mycompany.com\" },\n                { \"Name\": \"Camden Kate\", \"Eimg\": \"9\", \"EmailId\": \"camden@mycompany.com\" },\n            ];\n            container.documentEditorSettings.mentionSettings = { dataSource: mentionData, fields: { text: 'Name' }}\n            container.documentEditorSettings.commentSettings.highlightCommentsByAuthor = true;\n            documenteditor = container.documentEditor;\n            documenteditorElement.ej2_instances[0].serviceUrl = window.baseurl + 'api/documenteditorservice/';\n            documenteditor.serviceUrl = window.baseurl + 'api/documenteditorservice/';\n            var ajax = new ej.base.Ajax(\"@Url.Content(\"~/scripts/documenteditor/data-comments.json\")\", 'GET', true);\n            ajax.send().then();\n            ajax.onSuccess = function (data) {\n                documenteditor.open(data);\n                documenteditor.documentName = 'Comments';\n                documenteditor.showComments = true;\n                updateDocumentTitle();\n            };\n            container.documentChange = function (args) {\n                 updateDocumentTitle();\n            };\n            container.commentDelete = function (args) {\n                if (args.author !== documenteditor.currentUser) {\n                    args.cancel = true;\n                    ejs.popups.DialogUtility.alert({\n                        title: 'Information',\n                        content: 'Delete restriction enabled. Only the author of the comment can delete it.',\n                        showCloseIcon: true,\n                        closeOnEscape: true,\n                    });\n                }\n            };\n            var exportItem = {\n                text: 'Export',\n                id: 'custom_item',\n                iconCss: 'e-icons e-export',\n                items: [\n                    { id: 'sfdt', text: 'Syncfusion Document Text (*.sfdt)' },\n                    { id: 'docx', text: 'Word Document (*.docx)' },\n                    { id: 'dotx', text: 'Word Template (*.dotx)' },\n                    { id: 'text', text: 'Plain Text (*.txt)' },\n                    { id: 'pdf', text: 'PDF (*.pdf)' },\n                    { id: 'html', text: 'HyperText Markup Language (*.html)' },\n                    { id: 'rtf', text: 'Rich Text Format (*.rtf)' },\n                    { id: 'md', text: 'Markdown (*.md)' },\n                    { id: 'odt', text: 'OpenDocument Text (*.odt)' },\n                    { id: 'wordml', text: 'Word XML Document (*.xml)' },\n                ],\n            };\n            container.fileMenuItems = ['New', 'Open', exportItem, 'Print'];\n            container.fileMenuItemClick = function (args) {\n                if (args.item.id) {\n                    var value = args.item.id;\n                    var sampleName = container.documentEditor.documentName === '' ? 'sample' : container.documentEditor.documentName;\n                    switch (value) {\n                        case 'docx':\n                            container.documentEditor.save(sampleName, 'Docx');\n                            break;\n                        case 'sfdt':\n                            container.documentEditor.save(sampleName, 'Sfdt');\n                            break;\n                        case 'text':\n                            container.documentEditor.save(sampleName, 'Txt');\n                            break;\n                        case 'dotx':\n                            container.documentEditor.save(sampleName, 'Dotx');\n                            break;\n                        case 'pdf':\n                            saveFormat('Pdf');\n                            break;\n                        case 'html':\n                            saveFormat('Html');\n                            break;\n                        case 'odt':\n                            saveFormat('Odt');\n                            break;\n                        case 'md':\n                            saveFormat('Md');\n                            break;\n                        case 'rtf':\n                            saveFormat('Rtf');\n                            break;\n                        case 'wordml':\n                            saveFormat('Xml');\n                            break;\n                    }\n                }\n            };\n            container.dataBind();\n            titleBarDiv = document.getElementById('documenteditor_titlebar');\n            initComponentAndWireEvent();\n        showButtons(false);\n        });\n\n        function saveFormat(type) {\n            var spinTarget = document.getElementById('container');\n            ej.popups.createSpinner({\n                target: spinTarget\n            });\n            ej.popups.showSpinner(spinTarget);\n            var container = document.getElementById(\"container\").ej2_instances[0];\n            var format = type;\n            var url = window.baseurl + 'api/documenteditorservice/Export';\n            var http = new XMLHttpRequest();\n            http.open('POST', url);\n            http.setRequestHeader('Content-Type', 'application/json;charset=UTF-8');\n            var sfdt = {\n                Content: container.documentEditor.serialize(),\n                Filename: container.documentEditor.documentName,\n                Format: '.' + format\n            };\n            http.onload = function () {\n                if (http.status === 200) {\n                    var responseData = http.response;\n                    var downloadLink = document.createElement('a');\n                    downloadLink.href = responseData;\n                    downloadLink.download = container.documentEditor.documentName + '.' + (format).toLowerCase();\n                    document.body.appendChild(downloadLink);\n                    ej.popups.hideSpinner(spinTarget);\n                    downloadLink.click();\n                    document.body.removeChild(downloadLink);\n                }\n                else {\n                    console.error('Request failed with status:', http.status);\n                    ej.popups.hideSpinner(spinTarget);\n                }\n            };\n            http.send(JSON.stringify(sfdt));\n        }\n    </script>\n}\n\n<style>\n    #container {\n        display: block;\n        height: 500px;\n    }\n\n    .flex-container {\n        display: flex;\n        justify-content: flex-end;\n        align-items: center;\n    }\n\n    .render-mode-info {\n        background: none;\n        border: none;\n        padding-left: 0px;\n    }\n\n        .render-mode-info .render-mode-info-icon {\n            height: 16px;\n            width: 16px;\n        }\n\n    .switchLabel {\n        font-family: \"Segoe UI\", \"GeezaPro\", \"DejaVu Serif\", sans-serif;\n        font-weight: 400;\n        line-height: 20px;\n        letter-spacing: 0.24px;\n        text-align: right;\n        font-size: 14px;\n        margin-bottom: 0px;\n    }\n\n    .render-mode-info .render-mode-info-icon::before {\n        line-height: normal;\n    }\n\n    .buttonSwitch {\n        Width: 40px;\n        Height: 24px;\n    }\n\n    #documenteditor_titlebar {\n        border-bottom: 1px solid #2B3481;\n        height: 36px;\n        line-height: 26px;\n        width: 100%;\n        font-size: 12px;\n        padding-left: 15px;\n        padding-right: 10px;\n        font-family: inherit;\n    }\n\n    #documenteditor_title_contentEditor {\n        height: 26px;\n        max-width: 85%;\n        width: auto;\n        overflow: hidden;\n        display: inline-block;\n        padding-left: 4px;\n        padding-right: 4px;\n        margin: 5px;\n    }\n\n\n    .single-line {\n        cursor: text !important;\n        outline: none;\n    }\n\n        .single-line:hover {\n            border-color: #e4e4e4 !important;\n        }\n\n    [contenteditable=\"true\"].single-line {\n        white-space: nowrap;\n        border-color: #e4e4e4 !important;\n    }\n\n    @@font-face {\n        font-family: 'Sample brower icons';\n        font-weight: normal;\n        font-style: normal;\n    }\n\n    [class^=\"e-de-icon-\"],\n    [class*=\" e-de-icon-\"] {\n        font-family: 'Sample brower icons' !important;\n    }\n\n    .e-de-icon-Print:before {\n        content: \"\\e723\";\n    }\n\n    .e-de-icon-Download:before {\n        content: \"\\e728\";\n    }\n</style>\n"
    },
    {
      "target": "src/components/docx-editor-comments/DocxEditorController.cs",
      "content": "using Syncfusion.EJ2.Navigations;\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.Web.Mvc;\n\nnamespace EJ2MVCSampleBrowser.Controllers.DocumentEditor\n{\n    public partial class DocumentEditorController : Controller\n    {\n        public ActionResult Comments()\n        {\n            this.DocumentEditorViewResultHelper();\n            return View(\"~/Views/Home/docx-editor/comments/DocxEditor.cshtml\");\n        }\n    }\n}"
    }
  ]
}