{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "docx-editor-document-protection",
  "framework": "blazor",
  "type": "registry:component",
  "component": "DocxEditor",
  "variant": "document-protection",
  "dependencies": [
    "Syncfusion.Blazor.WordProcessor"
  ],
  "description": "Document editor with protection settings and restricted editing modes.",
  "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/docx-editor-document-protection.md"
  },
  "files": [
    {
      "target": "src/components/docx-editor-document-protection/DocxEditor.razor",
      "content": "@page \"/document-editor/document-protection\"\r\n@namespace blazor.Components.Pages.DocumentProtection.DocumentProtection\r\n@using System.Text.Json\r\n@using Syncfusion.Blazor.Buttons;\r\n@using Syncfusion.Blazor.DocumentEditor;\r\n@using Syncfusion.Blazor.DropDowns;\r\n@using Syncfusion.Blazor.Inputs;\r\n\r\n<div class=\"control-section\">\r\n    <div class=\"content-wrapper\">\r\n        <div class=\"heading-section\">\r\n            <h5><b>User Permission</b></h5>\r\n        </div>\r\n        <div class=\"control-label\"><b>Current User</b></div>\r\n        <SfDropDownList TValue=\"string\" TItem=\"string\" @bind-Value=\"CurrentUser\" DataSource=\"@Users\" Placeholder=\"Select User\"></SfDropDownList>\r\n        <div class=\"control-label\"><b>User Color</b></div>\r\n        <SfColorPicker @bind-Value=\"UserColor\"></SfColorPicker>\r\n    </div>\r\n    <SfDocumentEditorContainer @ref=\"_containerRef\" Height=\"590px\" CurrentUser=\"@CurrentUser\" UserColor=\"@UserColor\" DocumentEditorSettings=\"_settings\">\r\n        <DocumentEditorContainerEvents Created=\"OnCreated\"></DocumentEditorContainerEvents>\r\n    </SfDocumentEditorContainer>\r\n</div>\r\n\r\n@code {\r\n    internal string CurrentUser { get; set; } = \"user.one@example.com\";\r\n    internal string UserColor { get; set; } = \"#b70f34\";\r\n    internal List<string> Users { get; set; } = new List<string> { \"user.one@example.com\", \"user.two@example.com\" };\r\n    private SfDocumentEditorContainer? _containerRef;\r\n    private DocumentEditorSettingsModel _settings = new DocumentEditorSettingsModel { ShowRuler = true };\r\n\r\n    public async Task OnCreated(object args)\r\n    {\r\n        if (_containerRef?.DocumentEditor != null)\r\n        {\r\n            string text = \"Pick a field on the left to insert a merge field at the cursor position.\";\r\n\r\n            var sfdt = new\r\n            {\r\n                sections = new[]\r\n                {\r\n                    new\r\n                    {\r\n                        blocks = new[]\r\n                        {\r\n                            new\r\n                            {\r\n                                inlines = new[]\r\n                                {\r\n                                    new { text }\r\n                                }\r\n                            }\r\n                        },\r\n                        headerFooter = new { },\r\n                        sectionFormat = new\r\n                        {\r\n                            pageWidth = 612,\r\n                            pageHeight = 792,\r\n                            leftMargin = 72,\r\n                            rightMargin = 72,\r\n                            topMargin = 72,\r\n                            bottomMargin = 72\r\n                        }\r\n                    }\r\n                }\r\n            };\r\n\r\n            string json = JsonSerializer.Serialize(sfdt);\r\n            await _containerRef.DocumentEditor.OpenAsync(json);\r\n            // Lock the document so only the current user can make changes.\r\n            await InvokeAsync(StateHasChanged);\r\n        }\r\n    }\r\n}\r\n"
    }
  ]
}