{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "docx-editor-document-list",
  "framework": "javascript",
  "type": "registry:component",
  "component": "DocxEditor",
  "variant": "document-list",
  "dependencies": [
    "@syncfusion/ej2-documenteditor",
    "@syncfusion/ej2-popups"
  ],
  "description": "Document list dialog opens named Word documents by author into the editor with a title bar.",
  "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": true,
    "platformIndex": "https://ai.syncfusion.com/javascript/llms.txt",
    "skillPack": "syncfusion/javascript-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/javascript/docx-editor-document-list.md"
  },
  "files": [
    {
      "target": "src/components/docx-editor-document-list/docx-editor.html",
      "content": "<div class=\"control-section\" style=\"min-height: auto;\">\n    <div id=\"Grid\" style=\"height: calc(100vh - 160px);\"></div>\n    <!-- Initialize default Dialog -->\n    <div id=\"defaultDialog\">\n        <div id='documenteditor_titlebar' class=\"e-de-ctn-title\" ></div>\n        <div id=documenteditor_container_body style=\"display: block; height: calc( -230px + 100vh);\">\n            <div id=\"container\"></div>\n        </div>\n    </div>\n</div>\n\n<script id=\"fileNameTemplate\">\n    <div>\n        <svg width=\"30\" height=\"30\" viewBox=\"0 0 30 30\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n            <path d=\"M3 3C3 1.34315 4.34315 0 6 0H16.7574C17.553 0 18.3161 0.316071 18.8787 0.87868L26.1213 8.12132C26.6839 8.68393 27 9.44699 27 10.2426V27C27 28.6569 25.6569 30 24 30H6C4.34315 30 3 28.6569 3 27V3Z\" fill=\"#4889EF\"/>\n            <path d=\"M17.5 11H25V10.5042C25 9.76949 24.7304 9.0603 24.2422 8.51114L19.9463 3.67818C18.9974 2.61074 17.6374 2 16.2092 2H16V9.5C16 10.3284 16.6716 11 17.5 11Z\" fill=\"#D6E5FE\"/>\n            <path d=\"M10.3044 12H10.8868H11.104H11.6817L12.6231 16.3922L13.3963 12H15L13.5719 19H12.777H12.5552H11.8943L10.993 15.0093L10.1103 19H9.44945H9.22761H8.42808L7 12H8.60832L9.38188 16.3816L10.3044 12Z\" fill=\"white\"/>\n            <rect x=\"7\" y=\"21\" width=\"16\" height=\"2\" rx=\"1\" fill=\"white\"/>\n            <rect x=\"7\" y=\"25\" width=\"11\" height=\"2\" rx=\"1\" fill=\"white\"/>\n        </svg><span style=\"vertical-align: super;\">${FileName}</span>\n    </div>\n</script>\n<style>\n@import '../style.css';\n    .ej2-new {\n        height: 590px;\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    .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    [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\n    /** sample level font icons ends*/\n\n/* Table styling (Bootstrap-like) */\n#Grid table {\n    border: 1px solid #d7d7d7;\n    table-layout: fixed;\n    width: 100%;\n}\n#Grid table th,\n#Grid table td {\n    border: 1px solid #d7d7d7;\n    padding: 12px 8px;\n    overflow: hidden;\n    white-space: nowrap;\n}\n#Grid table th {\n    width: 33.33%;\n    font-weight: 600;\n    text-align: left;\n}\n#Grid table th.e-de-table-actions-header {\n    text-align: center;\n}\n#Grid table td {\n    width: 33.33%;\n}\n#Grid table td.e-de-table-actions-cell {\n    text-align: center;\n}\n#Grid table td.e-de-table-author-cell {\n    padding-top: 20px;\n}\n/* Hide center column (Author) borders */\n#Grid table th:nth-child(1),\n#Grid table td:nth-child(1) {\n    border-right: none;\n}\n#Grid table td:nth-child(1) {\n  overflow: hidden;\n  white-space: nowrap;\n}\n#Grid table th:nth-child(2),\n#Grid table td:nth-child(2) {\n    border-left: none;\n    border-right: none;\n}\n#Grid table th:nth-child(3),\n#Grid table td:nth-child(3) {\n    border-left: none;\n}\n#Grid table tbody tr:hover {\n    background-color: #f9f9f9;\n}\n/* Action button styles and icons */\n.e-de-view-btn,\n.e-de-edit-btn {\n    background-color: transparent;\n    border: 1px solid transparent;\n    border-radius: 4px;\n    padding: 4px 6px !important;\n    margin: 0 4px;\n    cursor: pointer;\n    transition: all 0.3s ease;\n    display: inline-flex;\n    align-items: center;\n    justify-content: center;\n    min-width: 28px;\n    min-height: 28px;\n    text-decoration: none;\n    outline: none;\n    box-sizing: border-box;\n}\n.e-de-view-btn:hover,\n.e-de-edit-btn:hover {\n    background-color: #f5f5f5;\n    border-color: #ccc;\n    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);\n    text-decoration: none;\n    outline: none;\n}\n.e-de-view-btn:focus,\n.e-de-edit-btn:focus {\n    outline: none;\n    text-decoration: none;\n}\n.e-de-view-btn:active,\n.e-de-edit-btn:active {\n    background-color: #efefef;\n    border-color: #999;\n    outline: none;\n}\n.e-de-view-icon,\n.e-de-edit-icon {\n    font-size: 16px;\n    color: #7a8a99;\n    display: inline-block;\n    text-decoration: none;\n    font-weight: 600;\n    line-height: 1;\n}\n.e-de-view-btn:hover .e-de-view-icon,\n.e-de-edit-btn:hover .e-de-edit-icon {\n    color: #5a6a7a;\n    text-decoration: none;\n    font-weight: 600;\n}\n.e-de-view-btn:active .e-de-view-icon,\n.e-de-edit-btn:active .e-de-edit-icon {\n    color: #333;\n    text-decoration: none;\n    font-weight: 600;\n}\n#Grid table tbody tr:hover {\n    background-color: var(--de-row-hover, rgba(0, 0, 0, 0.04));\n}\n/* Dark theme override */\nbody.e-dark-mode #Grid table tbody tr:hover,\nbody[class*='-dark'] #Grid table tbody tr:hover {\n    background-color: var(--de-row-hover-dark, rgba(255, 255, 255, 0.07));\n}\n</style>\n"
    },
    {
      "target": "src/components/docx-editor-document-list/docx-editor.ts",
      "content": "// tslint:disable-next-line:max-line-length\nimport { DocumentEditorContainer, Toolbar} from '@syncfusion/ej2-documenteditor';\nimport { Dialog } from '@syncfusion/ej2-popups';\nimport { TitleBar } from '../title-bar';\nimport { defaultDocument, characterFormat, paragraphFormat, styles, weblayout } from '../datasource/docx-editor-data';\n\n\nlet gridData: Object[] = [\n    {\n        FileName: 'Getting Started.docx', Author: 'Ryan Hodson'\n    },\n    {\n        FileName: 'Character Formatting.docx', Author: 'Elton Stoneman'\n    },\n    {\n        FileName: 'Paragraph Format.docx', Author: 'Peter Shaw'\n    },\n    {\n        FileName: 'Style.docx', Author: 'Cody Lindley'\n    },\n    {\n        FileName: 'Web Layout.docx', Author: 'Scott Allen'\n    },\n];\nexport function initDocxEditorDocumentList(): void {\n\n    let dialogObj: Dialog= new Dialog({\n        width: '90%',\n        height: '90%',\n        visible: false,\n        enableResize: true,\n        isModal: true,\n        zIndex: 1500,\n        position: { X: 'center', Y: 'center' }\n      });\n    dialogObj.appendTo('#defaultDialog');\n\n    let hostUrl: string = 'https://document.syncfusion.com/web-services/docx-editor/api/documenteditor/';\n    let container: DocumentEditorContainer = new DocumentEditorContainer({ height:\"90%\", serviceUrl:hostUrl, enableToolbar: true , zIndex: 3000 , documentEditorSettings:{ showRuler: true}});\n    DocumentEditorContainer.Inject(Toolbar);\n    container.appendTo('#container'); \n    let titleBar: TitleBar = new TitleBar(document.getElementById('documenteditor_titlebar'), container.documentEditor, true, false, dialogObj);\n    container.documentChange = (): void => {\n        titleBar.updateDocumentTitle();\n        container.documentEditor.focusIn();\n    };\n\n    let commandClick: any = function(args:any){\n        let mode = args.mode;\n        let currentDocument = args.rowData.FileName;\n        container.documentEditor.documentName = currentDocument.replace(\".docx\", \"\");\n        titleBar.updateDocumentTitle();\n        switch (currentDocument) {\n            case \"Getting Started.docx\":\n                container.documentEditor.open(JSON.stringify((<any>defaultDocument))); break;\n            case \"Character Formatting.docx\":\n                container.documentEditor.open(JSON.stringify((<any>characterFormat))); break;\n            case \"Paragraph Formatting.docx\":\n                container.documentEditor.open(JSON.stringify((<any>paragraphFormat))); break;\n            case \"Styles.docx\":\n                container.documentEditor.open(JSON.stringify((<any>styles))); break;\n            case \"Web layout.docx\":\n                container.documentEditor.open(JSON.stringify((<any>weblayout))); break;\n        }\n        if(mode === 'View'){\n            container.documentEditor.enableContextMenu = false;\n            container.documentEditor.isReadOnly = true;\n            container.showPropertiesPane = false;\n            const share = document.getElementById('documenteditor-share');\n            if (share) share.style.display = 'none';\n            container.toolbarItems = ['Open', 'Separator', 'Find'];\n        } else {\n            container.documentEditor.enableContextMenu = true;\n            container.documentEditor.isReadOnly = false;\n            container.showPropertiesPane = true;\n            const share = document.getElementById('documenteditor-share');\n            if (share) share.style.display = 'block';\n            container.toolbarItems = ['New', 'Open', 'Separator', 'Undo', 'Redo', 'Separator', 'Image', 'Table', 'Hyperlink', 'Bookmark', 'TableOfContents', 'Separator', 'Header', 'Footer', 'PageSetup', 'PageNumber', 'Break', 'InsertFootnote', 'InsertEndnote', 'Separator', 'Find', 'Separator', 'Comments', 'TrackChanges', 'Separator', 'LocalClipboard', 'RestrictEditing', 'Separator', 'FormFields', 'UpdateFields'];\n        }\n        dialogObj.show();\n    };\n\n    function createTableHeader() {\n        const thead = document.createElement('thead');\n        const tr = document.createElement('tr');\n        const headerCells: string[] = ['File Name', 'Author', 'Actions'];\n        headerCells.forEach((headerText) => {\n            const th = document.createElement('th');\n            th.setAttribute('scope', 'col');\n            th.textContent = headerText;\n            if (headerText === 'Actions') {\n                th.classList.add('e-de-table-actions-header');\n            }\n            tr.appendChild(th);\n        });\n        thead.appendChild(tr);\n        return thead;\n    }\n\n    function createIconSpan(iconClass: any) {\n        const span = document.createElement('span');\n        span.className = 'e-icons ' + iconClass + ' e-flat';\n        if (iconClass.includes('e-eye')) {\n            span.classList.add('e-de-view-icon');\n        } else if (iconClass.includes('e-edit')) {\n            span.classList.add('e-de-edit-icon');\n        }\n        return span;\n    }\n\n    function renderBootstrapTable(): void {\n        const gridContainer = document.querySelector('#Grid');\n        const tplScript = document.getElementById('fileNameTemplate') as HTMLScriptElement;\n        const tplHtml = tplScript ? tplScript.innerHTML.trim() : '';\n        let tplNode: HTMLElement | undefined;\n        if (tplHtml) {\n            const tmp = document.createElement('div');\n            tmp.innerHTML = tplHtml;\n            tplNode = tmp.firstElementChild as HTMLElement;\n        }\n\n        const table = document.createElement('table');\n        table.className = 'table table-hover table-borderless align-middle';\n        table.appendChild(createTableHeader());\n        const tbody = document.createElement('tbody');\n\n        gridData.forEach((row: any) => {\n            const tr = document.createElement('tr');\n\n            // File name cell (with template)\n            const fileNameTd = document.createElement('td');\n            if (tplNode) {\n                const clone = tplNode.cloneNode(true) as HTMLElement;\n                const span = clone.querySelector('span');\n                if (span) { span.textContent = row.FileName; }\n                fileNameTd.appendChild(clone);\n            } else {\n                fileNameTd.textContent = row.FileName;\n            }\n            tr.appendChild(fileNameTd);\n\n            // Author cell\n            const authorTd = document.createElement('td');\n            authorTd.textContent = row.Author;\n            authorTd.classList.add('e-de-table-author-cell');\n            tr.appendChild(authorTd);\n\n            // Actions cell\n            const actionTd = document.createElement('td');\n            actionTd.classList.add('e-de-table-actions-cell');\n\n            const viewBtn = document.createElement('button');\n            viewBtn.type = 'button';\n            viewBtn.className = 'btn btn-sm btn-link text-secondary p-2 e-de-view-btn';\n            viewBtn.title = 'View';\n            viewBtn.appendChild(createIconSpan('e-eye'));\n            viewBtn.addEventListener('click', () => {\n                commandClick({ mode: 'View', rowData: row });\n            });\n\n            const editBtn = document.createElement('button');\n            editBtn.type = 'button';\n            editBtn.className = 'btn btn-sm btn-link text-secondary p-2 e-de-edit-btn';\n            editBtn.title = 'Edit';\n            editBtn.appendChild(createIconSpan('e-edit'));\n            editBtn.addEventListener('click', () => {\n                commandClick({ mode: 'Edit', rowData: row });\n            });\n\n            actionTd.appendChild(viewBtn);\n            actionTd.appendChild(editBtn);\n            tr.appendChild(actionTd);\n            tbody.appendChild(tr);\n        });\n\n        table.appendChild(tbody);\n        (gridContainer as HTMLElement).innerHTML = '';\n        (gridContainer as HTMLElement).appendChild(table);\n    }\n\n    function destroyed() {\n        container.destroy();\n        dialogObj.destroy();\n    }\n\n    // Initial render\n    renderBootstrapTable();\n\n    // cleanup on unload\n    window.addEventListener('beforeunload', destroyed, { once: true });\n}\n"
    }
  ]
}