1 |
- {"ast":null,"code":"import { computeTextAlternative } from \"./accessible-name-and-description.mjs\";\nimport { hasAnyConcreteRoles } from \"./util.mjs\";\n/**\n * https://w3c.github.io/aria/#namefromprohibited\n */\n\nfunction prohibitsNaming(node) {\n return hasAnyConcreteRoles(node, [\"caption\", \"code\", \"deletion\", \"emphasis\", \"generic\", \"insertion\", \"paragraph\", \"presentation\", \"strong\", \"subscript\", \"superscript\"]);\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 */\n\n\nexport function computeAccessibleName(root) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (prohibitsNaming(root)) {\n return \"\";\n }\n\n return computeTextAlternative(root, options);\n}","map":{"version":3,"sources":["../sources/accessible-name.ts"],"names":["hasAnyConcreteRoles","options","prohibitsNaming","computeTextAlternative"],"mappings":"AAAA,SAAA,sBAAA,QAAA,uCAAA;AAIA,SAAA,mBAAA,QAAA,YAAA;AAEA;AACA;AACA;;AACA,SAAA,eAAA,CAAA,IAAA,EAA8C;AAC7C,SAAOA,mBAAmB,CAAA,IAAA,EAAO,CAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,UAAA,EAAA,SAAA,EAAA,WAAA,EAAA,WAAA,EAAA,cAAA,EAAA,QAAA,EAAA,WAAA,EAAjC,aAAiC,CAAP,CAA1B;AAaA;AAED;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAAA,qBAAA,CAAA,IAAA,EAGG;AAAA,MADTC,OACS,GAAA,SAAA,CAAA,MAAA,GAAA,CAAA,IAAA,SAAA,CAAA,CAAA,CAAA,KAAA,SAAA,GAAA,SAAA,CAAA,CAAA,CAAA,GADgC,EAChC;;AACT,MAAIC,eAAe,CAAnB,IAAmB,CAAnB,EAA2B;AAC1B,WAAA,EAAA;AACA;;AAED,SAAOC,sBAAsB,CAAA,IAAA,EAA7B,OAA6B,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"]},"metadata":{},"sourceType":"module"}
|