e9a3d2ccff8d35d99081acad068d41c790c419a6ebe83cabf018fa3ccc149f43.json 5.4 KB

1
  1. {"ast":null,"code":"function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n return keys;\n}\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n return target;\n}\nfunction _defineProperty(obj, key, value) {\n key = _toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nfunction _toPropertyKey(arg) {\n var key = _toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}\nfunction _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\n}\nimport { computeTextAlternative } from \"./accessible-name-and-description.mjs\";\nimport { queryIdRefs } from \"./util.mjs\";\n\n/**\n * @param root\n * @param options\n * @returns\n */\nexport function computeAccessibleDescription(root) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var description = queryIdRefs(root, \"aria-describedby\").map(function (element) {\n return computeTextAlternative(element, _objectSpread(_objectSpread({}, options), {}, {\n compute: \"description\"\n }));\n }).join(\" \");\n\n // TODO: Technically we need to make sure that node wasn't used for the accessible name\n // This causes `description_1.0_combobox-focusable-manual` to fail\n //\n // https://www.w3.org/TR/html-aam-1.0/#accessible-name-and-description-computation\n // says for so many elements to use the `title` that we assume all elements are considered\n if (description === \"\") {\n var title = root.getAttribute(\"title\");\n description = title === null ? \"\" : title;\n }\n return description;\n}","map":{"version":3,"names":["computeTextAlternative","queryIdRefs","computeAccessibleDescription","root","options","arguments","length","undefined","description","map","element","_objectSpread","compute","join","title","getAttribute"],"sources":["/Users/max_liu/max_liu/company/tools_auto_pt/node_modules/dom-accessibility-api/sources/accessible-description.ts"],"sourcesContent":["import {\n\tcomputeTextAlternative,\n\tComputeTextAlternativeOptions,\n} from \"./accessible-name-and-description\";\nimport { queryIdRefs } from \"./util\";\n\n/**\n * @param root\n * @param options\n * @returns\n */\nexport function computeAccessibleDescription(\n\troot: Element,\n\toptions: ComputeTextAlternativeOptions = {}\n): string {\n\tlet description = queryIdRefs(root, \"aria-describedby\")\n\t\t.map((element) => {\n\t\t\treturn computeTextAlternative(element, {\n\t\t\t\t...options,\n\t\t\t\tcompute: \"description\",\n\t\t\t});\n\t\t})\n\t\t.join(\" \");\n\n\t// TODO: Technically we need to make sure that node wasn't used for the accessible name\n\t// This causes `description_1.0_combobox-focusable-manual` to fail\n\t//\n\t// https://www.w3.org/TR/html-aam-1.0/#accessible-name-and-description-computation\n\t// says for so many elements to use the `title` that we assume all elements are considered\n\tif (description === \"\") {\n\t\tconst title = root.getAttribute(\"title\");\n\t\tdescription = title === null ? \"\" : title;\n\t}\n\n\treturn description;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SACCA,sBAAsB,QAEhB,uCAAmC;AAC1C,SAASC,WAAW,QAAQ,YAAQ;;AAEpC;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,4BAA4BA,CAC3CC,IAAa,EAEJ;EAAA,IADTC,OAAsC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EAE3C,IAAIG,WAAW,GAAGP,WAAW,CAACE,IAAI,EAAE,kBAAkB,CAAC,CACrDM,GAAG,CAAC,UAACC,OAAO,EAAK;IACjB,OAAOV,sBAAsB,CAACU,OAAO,EAAAC,aAAA,CAAAA,aAAA,KACjCP,OAAO;MACVQ,OAAO,EAAE;IAAa,GACrB;EACH,CAAC,CAAC,CACDC,IAAI,CAAC,GAAG,CAAC;;EAEX;EACA;EACA;EACA;EACA;EACA,IAAIL,WAAW,KAAK,EAAE,EAAE;IACvB,IAAMM,KAAK,GAAGX,IAAI,CAACY,YAAY,CAAC,OAAO,CAAC;IACxCP,WAAW,GAAGM,KAAK,KAAK,IAAI,GAAG,EAAE,GAAGA,KAAK;EAC1C;EAEA,OAAON,WAAW;AACnB","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}