accessible-name.mjs.map 1.7 KB

1
  1. {"version":3,"sources":["../sources/accessible-name.ts"],"names":["computeTextAlternative","hasAnyConcreteRoles","prohibitsNaming","node","computeAccessibleName","root","options"],"mappings":"AAAA,SACCA,sBADD,QAGO,uCAHP;AAIA,SAASC,mBAAT,QAAoC,YAApC;AAEA;AACA;AACA;;AACA,SAASC,eAAT,CAAyBC,IAAzB,EAA8C;AAC7C,SAAOF,mBAAmB,CAACE,IAAD,EAAO,CAChC,SADgC,EAEhC,MAFgC,EAGhC,UAHgC,EAIhC,UAJgC,EAKhC,SALgC,EAMhC,WANgC,EAOhC,WAPgC,EAQhC,cARgC,EAShC,QATgC,EAUhC,WAVgC,EAWhC,aAXgC,CAAP,CAA1B;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAASC,qBAAT,CACNC,IADM,EAGG;AAAA,MADTC,OACS,uEADgC,EAChC;;AACT,MAAIJ,eAAe,CAACG,IAAD,CAAnB,EAA2B;AAC1B,WAAO,EAAP;AACA;;AAED,SAAOL,sBAAsB,CAACK,IAAD,EAAOC,OAAP,CAA7B;AACA","sourcesContent":["import {\n\tcomputeTextAlternative,\n\tComputeTextAlternativeOptions,\n} from \"./accessible-name-and-description\";\nimport { hasAnyConcreteRoles } from \"./util\";\n\n/**\n * https://w3c.github.io/aria/#namefromprohibited\n */\nfunction prohibitsNaming(node: Node): boolean {\n\treturn hasAnyConcreteRoles(node, [\n\t\t\"caption\",\n\t\t\"code\",\n\t\t\"deletion\",\n\t\t\"emphasis\",\n\t\t\"generic\",\n\t\t\"insertion\",\n\t\t\"paragraph\",\n\t\t\"presentation\",\n\t\t\"strong\",\n\t\t\"subscript\",\n\t\t\"superscript\",\n\t]);\n}\n\n/**\n * implements https://w3c.github.io/accname/#mapping_additional_nd_name\n * @param root\n * @param [options]\n * @parma [options.getComputedStyle] - mock window.getComputedStyle. Needs `content`, `display` and `visibility`\n */\nexport function computeAccessibleName(\n\troot: Element,\n\toptions: ComputeTextAlternativeOptions = {}\n): string {\n\tif (prohibitsNaming(root)) {\n\t\treturn \"\";\n\t}\n\n\treturn computeTextAlternative(root, options);\n}\n"],"file":"accessible-name.mjs"}