'.concat(u.serializer.serialize(l[i]),' (Link ').concat(i+1," of ").concat(l.length,")
")},{type:"htmlpanel",html:""},{type:"panel",items:[{type:"checkbox",name:"noSymbol",label:"No symbol"},{type:"checkbox",name:"downArrow",label:"Down arrow symbol"},{type:"checkbox",name:"topPage",label:"Top of page symbol"},{type:"checkbox",name:"neArrow",label:"NE pointing arrow"},{type:"checkbox",name:"rightArrow",label:"Right-pointing arrow"},{type:"checkbox",name:"overlappingSquares",label:"Overlapping squares"},{type:"checkbox",name:"customSvgSymbol",label:"Custom SVG symbol"},{type:"input",name:"customSvg",label:"Custom SVG",inputType:"textarea",value:''}]},{type:"htmlpanel",html:""},{type:"panel",items:[{type:"checkbox",name:"srTextExternal",label:" external site"},{type:"checkbox",name:"srTextNone",label:"None"},{type:"checkbox",name:"srTextNewTab",label:" opens in a new tab"},{type:"checkbox",name:"srTextScrollDown",label:" scrolls down this page"},{type:"checkbox",name:"srTextTopPage",label:" returns to top of page"}]}]},initialData:{linkHtml:0'.concat(u.serializer.serialize(l[i]),' (Link ').concat(i+1," of ").concat(l.length,")
")},{type:"htmlpanel",html:""},{type:"panel",items:[{type:"checkbox",name:"noSymbol",label:"No symbol"},{type:"checkbox",name:"downArrow",label:"Down arrow symbol"},{type:"checkbox",name:"topPage",label:"Top of page symbol"},{type:"checkbox",name:"neArrow",label:"NE pointing arrow"},{type:"checkbox",name:"rightArrow",label:"Right-pointing arrow"},{type:"checkbox",name:"overlappingSquares",label:"Overlapping squares"},{type:"checkbox",name:"customSvgSymbol",label:"Custom SVG symbol"},{type:"input",name:"customSvg",label:"Custom SVG",inputType:"textarea",value:''}]},{type:"htmlpanel",html:""},{type:"panel",items:[{type:"checkbox",name:"srTextExternal",label:" external site"},{type:"checkbox",name:"srTextNone",label:"None"},{type:"checkbox",name:"srTextNewTab",label:" opens in a new tab"},{type:"checkbox",name:"srTextScrollDown",label:" scrolls down this page"},{type:"checkbox",name:"srTextTopPage",label:" returns to top of page"}]}]},initialData:{linkHtml:0".concat(editor.serializer.serialize(links[currentIndex]), " (Link ").concat(currentIndex + 1, " of ").concat(links.length, ")
") + }, + { + type: 'htmlpanel', + html: '' + }, + { + type: 'panel', + items: [ + { type: 'checkbox', name: 'noSymbol', label: 'No symbol' }, + { type: 'checkbox', name: 'downArrow', label: 'Down arrow symbol' }, + { type: 'checkbox', name: 'topPage', label: 'Top of page symbol' }, + { type: 'checkbox', name: 'neArrow', label: 'NE pointing arrow' }, + { type: 'checkbox', name: 'rightArrow', label: 'Right-pointing arrow' }, + { type: 'checkbox', name: 'overlappingSquares', label: 'Overlapping squares' }, + { type: 'checkbox', name: 'customSvgSymbol', label: 'Custom SVG symbol' }, + { + type: 'input', + name: 'customSvg', + label: 'Custom SVG', + inputType: 'textarea', + value: '' + } + ] + }, + { + type: 'htmlpanel', + html: '' + }, + { + type: 'panel', + items: [ + { type: 'checkbox', name: 'srTextExternal', label: ' external site' }, + { type: 'checkbox', name: 'srTextNone', label: 'None' }, + { type: 'checkbox', name: 'srTextNewTab', label: ' opens in a new tab' }, + { type: 'checkbox', name: 'srTextScrollDown', label: ' scrolls down this page' }, + { type: 'checkbox', name: 'srTextTopPage', label: ' returns to top of page' } + ] + } + ] + }, + initialData: { + linkHtml: links.length > 0 ? editor.serializer.serialize(links[currentIndex]) : '', + isFirstLink: isFirstPage, + isLastLink: isLastPage, + noSymbol: true, + downArrow: false, + topPage: false, + neArrow: false, + rightArrow: false, + overlappingSquares: false, + customSvgSymbol: false, + customSvg: '' + }, + buttons: [ + { + type: 'custom', + name: 'prev', + text: 'Previous', + enabled: !isFirstPage, + primary: false + }, + { + type: 'custom', + name: 'next', + text: 'Next', + enabled: !isLastPage, + primary: false + }, + { + type: 'custom', + name: 'update', + text: 'Update', + primary: true + }, + { + type: 'custom', + name: 'removeTarget', + text: 'Remove target=_blank', + primary: false + }, + { + type: 'custom', + name: 'insertTarget', + text: 'Insert target=_blank', + primary: false + }, + { + type: 'custom', + name: 'done', + text: 'Done', + primary: false + } + ], + onChange: function (dialogApi, details) { + if (details.name.startsWith('noSymbol') || details.name.startsWith('downArrow') || details.name.startsWith('topPage') || details.name.startsWith('neArrow') || details.name.startsWith('rightArrow') || details.name.startsWith('overlappingSquares')) { + var symbolCheckboxes = ['noSymbol', 'downArrow', 'topPage', 'neArrow', 'rightArrow', 'overlappingSquares']; + symbolCheckboxes.forEach(function (symbol) { + var _a; + if (symbol !== details.name) { + dialogApi.setData((_a = {}, _a[symbol] = false, _a)); + } + }); + } + if (details.name === 'customSvgSymbol') { + dialogApi.setData({ customSvgSymbol: details.value }); + } + else if (details.name.startsWith('srText')) { + var srTextCheckboxes = ['srTextNone', 'srTextNewTab', 'srTextScrollDown', 'srTextTopPage']; + srTextCheckboxes.forEach(function (srText) { + var _a; + if (srText !== 'srTextExternal' && srText !== details.name) { + dialogApi.setData((_a = {}, _a[srText] = false, _a)); + } + }); + } + }, + onAction: function (dialogApi, details) { + var data = dialogApi.getData(); + var link = links[currentIndex]; + switch (details.name) { + case 'prev': + if (currentIndex > 0) { + currentIndex--; + dialogApi.redial(pageConfig(currentIndex === 0, false)); + updateDialogContent(dialogApi); + } + break; + case 'next': + if (currentIndex < links.length - 1) { + currentIndex++; + dialogApi.redial(pageConfig(false, currentIndex === links.length - 1)); + updateDialogContent(dialogApi); + } + break; + case 'update': + { + // Remove existing symbols and screen-reader-only text + var srOnlyElements = editor.dom.select('span.sr-only', link); + srOnlyElements.forEach(function (el) { return editor.dom.remove(el); }); + var symbolElements = editor.dom.select('span[aria-hidden="true"]', link); + symbolElements.forEach(function (el) { return editor.dom.remove(el); }); + var linkContent = link.innerHTML; + var srTextContent = getSrTextHtml(data); + var symbolHtml = getSymbolHtml(data); + linkContent += "".concat(srTextContent).concat(symbolHtml); + editor.dom.setHTML(link, linkContent); + break; + } + case 'removeTarget': + { + editor.dom.setAttrib(link, 'target', null); + editor.dom.setAttrib(link, 'rel', null); + break; + } + case 'insertTarget': + { + editor.dom.setAttrib(link, 'target', '_blank'); + editor.dom.setAttrib(link, 'rel', 'noopener noreferrer'); + break; + } + case 'skip': + { + if (currentIndex < links.length - 1) { + currentIndex++; + dialogApi.redial(pageConfig(false, currentIndex === links.length - 1)); + updateDialogContent(dialogApi); + } + break; + } + case 'done': + { + dialogApi.close(); + break; + } + default: + break; + } + } + }); }; + var dialogApi = editor.windowManager.open(pageConfig(currentIndex === 0, currentIndex === links.length - 1)); + updateDialogContent(dialogApi); + } + }); +}; +/* harmony default export */ __webpack_exports__["default"] = (function () { + tinymce.PluginManager.add('a11y-links', setup); +}); + + +/***/ }) + +/******/ }); +//# sourceMappingURL=demo.js.map \ No newline at end of file diff --git a/scratch/compiled/demo.js.map b/scratch/compiled/demo.js.map new file mode 100644 index 0000000..9b7f5e9 --- /dev/null +++ b/scratch/compiled/demo.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/demo/ts/Demo.ts","webpack:///./src/main/ts/Plugin.ts"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AChFA;AAAA;AAA0C;AAI1C,+DAAM,EAAE,CAAC;AAET,OAAO,CAAC,IAAI,CAAC;IACX,QAAQ,EAAE,kBAAkB;I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E,KAAK,EAAE,qBAAqB,CAAC,CAAC;gCACzD,MAAM;6BACP;wBACH,KAAK,MAAM;4BACT;gCACE,IAAI,YAAY,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;oCACnC,YAAY,EAAE,CAAC;oCACf,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,YAAY,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;oCACvE,mBAAmB,CAAC,SAAS,CAAC,CAAC;iCAChC;gCACD,MAAM;6BACP;wBACH,KAAK,MAAM;4BACT;gCACE,SAAS,CAAC,KAAK,EAAE,CAAC;gCAClB,MAAM;6BACP;wBACH;4BACE,MAAM;qBACT;gBACH,CAAC;aACF,CAAC,EA7LqE,CA6LrE,CAAC;YAEH,IAAM,SAAS,GAAG,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,YAAY,KAAK,CAAC,EAAE,YAAY,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;YAC/G,mBAAmB,CAAC,SAAS,CAAC,CAAC;QACjC,CAAC;KACF,CAAC,CAAC;AACL,CAAC,CAAC;AAEa;IACb,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;AACjD,CAAC,EAAC","file":"demo.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./src/demo/ts/Demo.ts\");\n","import { TinyMCE } from 'tinymce';\r\n\r\nimport Plugin from '../../main/ts/Plugin';\r\n\r\ndeclare let tinymce: TinyMCE;\r\n\r\nPlugin();\r\n\r\ntinymce.init({\r\n selector: 'textarea.tinymce',\r\n plugins: 'code a11y-links',\r\n toolbar: 'a11y-links'\r\n});\r\n","import { Editor, TinyMCE } from 'tinymce';\r\n\r\ndeclare const tinymce: TinyMCE;\r\n\r\nconst setup = (editor: Editor, url: string): void => {\r\n\r\n editor.ui.registry.addIcon('custom-links-icon', '');\r\n editor.ui.registry.addButton('a11y-links', {\r\n icon: 'custom-links-icon',\r\n tooltip: 'Accessible Links',\r\n onAction: () => {\r\n const links = editor.dom.select('a');\r\n let currentIndex = 0;\r\n\r\n const updateDialogContent = (dialogApi: any) => {\r\n if (links.length > 0) {\r\n links.forEach(link => {\r\n editor.dom.setAttrib(link, 'data-mce-selected', null);\r\n });\r\n editor.dom.setAttrib(links[currentIndex], 'data-mce-selected', 'inline-boundary');\r\n\r\n dialogApi.setData({\r\n linkHtml: editor.serializer.serialize(links[currentIndex]),\r\n isFirstLink: currentIndex === 0,\r\n isLastLink: currentIndex === links.length - 1,\r\n noSymbol: true,\r\n downArrow: false,\r\n topPage: false,\r\n neArrow: false,\r\n rightArrow: false,\r\n overlappingSquares: false,\r\n customSvgSymbol: false,\r\n customSvg: ''\r\n });\r\n }\r\n };\r\n\r\n const getSymbolHtml = (data: any) => {\r\n const symbolMap = {\r\n noSymbol: '',\r\n downArrow: '↓',\r\n topPage: '↥',\r\n neArrow: '↗',\r\n rightArrow: '🔗',\r\n overlappingSquares: '🗗',\r\n customSvg: data.customSvgSymbol ? data.customSvg : ''\r\n };\r\n const selectedSymbol = ['noSymbol', 'downArrow', 'topPage', 'neArrow', 'rightArrow', 'overlappingSquares', 'customSvg'].find(symbol => data[symbol]);\r\n return symbolMap[selectedSymbol || 'noSymbol'];\r\n };\r\n\r\n const getSrTextHtml = (data: any) => {\r\n let srTextContent = '';\r\n\r\n if (data.srTextExternal) {\r\n srTextContent += ` external site`;\r\n }\r\n\r\n const srTextMap = {\r\n srTextNone: '',\r\n srTextNewTab: ' opens in a new tab',\r\n srTextScrollDown: ' scrolls down this page',\r\n srTextTopPage: ' returns to top of page'\r\n };\r\n \r\n Object.keys(srTextMap).forEach(key => {\r\n if (data[key] && key !== 'srTextNone') {\r\n srTextContent += srTextMap[key];\r\n }\r\n });\r\n\r\n return srTextContent;\r\n };\r\n\r\n const pageConfig = (isFirstPage: boolean, isLastPage: boolean): any => ({\r\n title: 'Link Accessibility Options',\r\n size: 'medium',\r\n body: {\r\n type: 'panel',\r\n items: [\r\n {\r\n type: 'htmlpanel',\r\n html: `${editor.serializer.serialize(links[currentIndex])} (Link ${currentIndex + 1} of ${links.length})
`\r\n },\r\n {\r\n type: 'htmlpanel',\r\n html: ''\r\n },\r\n {\r\n type: 'panel',\r\n items: [\r\n { type: 'checkbox', name: 'noSymbol', label: 'No symbol' },\r\n { type: 'checkbox', name: 'downArrow', label: 'Down arrow symbol' },\r\n { type: 'checkbox', name: 'topPage', label: 'Top of page symbol' },\r\n { type: 'checkbox', name: 'neArrow', label: 'NE pointing arrow' },\r\n { type: 'checkbox', name: 'rightArrow', label: 'Right-pointing arrow' },\r\n { type: 'checkbox', name: 'overlappingSquares', label: 'Overlapping squares' },\r\n { type: 'checkbox', name: 'customSvgSymbol', label: 'Custom SVG symbol' },\r\n {\r\n type: 'input',\r\n name: 'customSvg',\r\n label: 'Custom SVG',\r\n inputType: 'textarea',\r\n value: ''\r\n }\r\n ]\r\n },\r\n {\r\n type: 'htmlpanel',\r\n html: ''\r\n },\r\n {\r\n type: 'panel',\r\n items: [\r\n { type: 'checkbox', name: 'srTextExternal', label: ' external site' },\r\n { type: 'checkbox', name: 'srTextNone', label: 'None' },\r\n { type: 'checkbox', name: 'srTextNewTab', label: ' opens in a new tab' },\r\n { type: 'checkbox', name: 'srTextScrollDown', label: ' scrolls down this page' },\r\n { type: 'checkbox', name: 'srTextTopPage', label: ' returns to top of page' }\r\n ]\r\n }\r\n ]\r\n },\r\n initialData: {\r\n linkHtml: links.length > 0 ? editor.serializer.serialize(links[currentIndex]) : '',\r\n isFirstLink: isFirstPage,\r\n isLastLink: isLastPage,\r\n noSymbol: true,\r\n downArrow: false,\r\n topPage: false,\r\n neArrow: false,\r\n rightArrow: false,\r\n overlappingSquares: false,\r\n customSvgSymbol: false,\r\n customSvg: ''\r\n },\r\n buttons: [\r\n {\r\n type: 'custom',\r\n name: 'prev',\r\n text: 'Previous',\r\n enabled: !isFirstPage,\r\n primary: false\r\n },\r\n {\r\n type: 'custom',\r\n name: 'next',\r\n text: 'Next',\r\n enabled: !isLastPage,\r\n primary: false\r\n },\r\n {\r\n type: 'custom',\r\n name: 'update',\r\n text: 'Update',\r\n primary: true\r\n },\r\n {\r\n type: 'custom',\r\n name: 'removeTarget',\r\n text: 'Remove target=_blank',\r\n primary: false\r\n },\r\n {\r\n type: 'custom',\r\n name: 'insertTarget',\r\n text: 'Insert target=_blank',\r\n primary: false\r\n },\r\n {\r\n type: 'custom',\r\n name: 'done',\r\n text: 'Done',\r\n primary: false\r\n }\r\n ],\r\n onChange: (dialogApi: any, details: any) => {\r\n if (details.name.startsWith('noSymbol') || details.name.startsWith('downArrow') || details.name.startsWith('topPage') || details.name.startsWith('neArrow') || details.name.startsWith('rightArrow') || details.name.startsWith('overlappingSquares')) {\r\n const symbolCheckboxes = ['noSymbol', 'downArrow', 'topPage', 'neArrow', 'rightArrow', 'overlappingSquares'];\r\n symbolCheckboxes.forEach(symbol => {\r\n if (symbol !== details.name) {\r\n dialogApi.setData({ [symbol]: false });\r\n }\r\n });\r\n }\r\n if (details.name === 'customSvgSymbol') {\r\n dialogApi.setData({ customSvgSymbol: details.value });\r\n } else if (details.name.startsWith('srText')) {\r\n const srTextCheckboxes = ['srTextNone', 'srTextNewTab', 'srTextScrollDown', 'srTextTopPage'];\r\n srTextCheckboxes.forEach(srText => {\r\n if (srText !== 'srTextExternal' && srText !== details.name) {\r\n dialogApi.setData({ [srText]: false });\r\n }\r\n });\r\n }\r\n },\r\n onAction: (dialogApi: any, details: any) => {\r\n const data = dialogApi.getData();\r\n const link = links[currentIndex];\r\n\r\n switch (details.name) {\r\n case 'prev':\r\n if (currentIndex > 0) {\r\n currentIndex--;\r\n dialogApi.redial(pageConfig(currentIndex === 0, false));\r\n updateDialogContent(dialogApi);\r\n }\r\n break;\r\n case 'next':\r\n if (currentIndex < links.length - 1) {\r\n currentIndex++;\r\n dialogApi.redial(pageConfig(false, currentIndex === links.length - 1));\r\n updateDialogContent(dialogApi);\r\n }\r\n break;\r\n case 'update':\r\n {\r\n // Remove existing symbols and screen-reader-only text\r\n const srOnlyElements = editor.dom.select('span.sr-only', link);\r\n srOnlyElements.forEach(el => editor.dom.remove(el));\r\n\r\n const symbolElements = editor.dom.select('span[aria-hidden=\"true\"]', link);\r\n symbolElements.forEach(el => editor.dom.remove(el));\r\n\r\n let linkContent = link.innerHTML;\r\n\r\n const srTextContent = getSrTextHtml(data);\r\n const symbolHtml = getSymbolHtml(data);\r\n\r\n linkContent += `${srTextContent}${symbolHtml}`;\r\n editor.dom.setHTML(link, linkContent);\r\n break;\r\n }\r\n case 'removeTarget':\r\n {\r\n editor.dom.setAttrib(link, 'target', null);\r\n editor.dom.setAttrib(link, 'rel', null);\r\n break;\r\n }\r\n case 'insertTarget':\r\n {\r\n editor.dom.setAttrib(link, 'target', '_blank');\r\n editor.dom.setAttrib(link, 'rel', 'noopener noreferrer');\r\n break;\r\n }\r\n case 'skip':\r\n {\r\n if (currentIndex < links.length - 1) {\r\n currentIndex++;\r\n dialogApi.redial(pageConfig(false, currentIndex === links.length - 1));\r\n updateDialogContent(dialogApi);\r\n }\r\n break;\r\n }\r\n case 'done':\r\n {\r\n dialogApi.close();\r\n break;\r\n }\r\n default:\r\n break;\r\n }\r\n }\r\n });\r\n\r\n const dialogApi = editor.windowManager.open(pageConfig(currentIndex === 0, currentIndex === links.length - 1));\r\n updateDialogContent(dialogApi);\r\n }\r\n });\r\n};\r\n\r\nexport default (): void => {\r\n tinymce.PluginManager.add('a11y-links', setup);\r\n};\r\n"],"sourceRoot":""} \ No newline at end of file