abledom 0.0.0 → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -12
- package/dist/esm/index.js +1153 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/index.d.cts +151 -0
- package/dist/index.d.ts +151 -0
- package/dist/index.js +1184 -0
- package/dist/index.js.map +1 -0
- package/dist/ts3.9/index.d.ts +139 -0
- package/package.json +45 -6
- package/CODE_OF_CONDUCT.md +0 -9
- package/SECURITY.md +0 -41
- package/SUPPORT.md +0 -25
- package/index.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","inline-file:/Users/marata/Documents/Work/abledom/src/ui/ui.css","inline-file:/Users/marata/Documents/Work/abledom/src/ui/close.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/help.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/log.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/reveal.svg","../src/ui/ui.ts","../src/utils.ts","../src/rules/base.ts","../src/core.ts","../src/rules/atomic.ts","../src/rules/label.ts","../src/rules/existingid.ts","../src/rules/focuslost.ts","../src/rules/badfocus.ts"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { AbleDOM } from \"./core\";\nexport { ValidationRule } from \"./rules/base\";\nexport type { FocusError, BlurError } from \"./rules/base\";\nexport { AtomicRule } from \"./rules/atomic\";\nexport { FocusableElementLabelRule } from \"./rules/label\";\nexport { ExistingIdRule } from \"./rules/existingid\";\nexport { FocusLostRule } from \"./rules/focuslost\";\nexport { BadFocusRule } from \"./rules/badfocus\";\n","export default \"#abledom-report {\\n bottom: 20px;\\n display: flex;\\n flex-direction: column;\\n left: 10px;\\n max-height: 80%;\\n max-width: 60%;\\n padding: 4px 8px;\\n position: absolute;\\n z-index: 100500;\\n}\\n\\n.abledom-notification-container {\\n backdrop-filter: blur(3px);\\n border-radius: 8px;\\n box-shadow: 0px 0px 4px rgba(127, 127, 127, 0.5);\\n display: inline-flex;\\n margin: 2px 0;\\n}\\n\\n.abledom-notification {\\n background-color: rgba(164, 2, 2, 0.7);\\n border-radius: 8px;\\n color: white;\\n display: inline flex;\\n font-family: Arial, Helvetica, sans-serif;\\n font-size: 16px;\\n line-height: 26px;\\n padding: 4px;\\n}\\n\\n.abledom-notification .button {\\n all: unset;\\n color: #000;\\n cursor: pointer;\\n background: linear-gradient(\\n 180deg,\\n rgba(255, 255, 255, 1) 0%,\\n rgba(200, 200, 200, 1) 100%\\n );\\n border-radius: 6px;\\n border: 1px solid rgba(255, 255, 255, 0.4);\\n box-sizing: border-box;\\n line-height: 0px;\\n margin-right: 4px;\\n max-height: 26px;\\n padding: 2px;\\n text-decoration: none;\\n}\\n\\n.abledom-notification .button:hover {\\n opacity: 0.7;\\n}\\n\\n.abledom-notification .button.close {\\n background: none;\\n border-color: transparent;\\n color: #fff;\\n margin: 0;\\n}\\n\\n.abledom-highlight {\\n background-color: yellow;\\n border: 1px solid red;\\n box-sizing: border-box;\\n display: none;\\n opacity: 0.6;\\n position: absolute;\\n z-index: 100499;\\n}\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\"\\n stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"\\n xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n <circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/>\\n <line x1=\\\"15\\\" y1=\\\"9\\\" x2=\\\"9\\\" y2=\\\"15\\\"/>\\n <line x1=\\\"9\\\" y1=\\\"9\\\" x2=\\\"15\\\" y2=\\\"15\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\"\\n stroke=\\\"currentColor\\\" stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\"\\n stroke-linejoin=\\\"round\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n <circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/>\\n <path d=\\\"M9.09 9a3 3 0 1 1 5.83 1c-.28 1.02-1.22 1.5-2.01 2.1-.76.58-1 1.1-1 2\\\"/>\\n <circle cx=\\\"12\\\" cy=\\\"17\\\" r=\\\"0.5\\\"/>\\n</svg>\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\"\\n stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"\\n xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n <polyline points=\\\"4 7 9 12 4 17\\\"/>\\n <line x1=\\\"11\\\" y1=\\\"19\\\" x2=\\\"20\\\" y2=\\\"19\\\"/>\\n</svg>\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 24 24\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\"\\n stroke-width=\\\"2\\\" stroke-linecap=\\\"round\\\" stroke-linejoin=\\\"round\\\"\\n xmlns=\\\"http://www.w3.org/2000/svg\\\">\\n <circle cx=\\\"12\\\" cy=\\\"12\\\" r=\\\"10\\\"/>\\n <line x1=\\\"12\\\" y1=\\\"2\\\" x2=\\\"12\\\" y2=\\\"6\\\"/>\\n <line x1=\\\"12\\\" y1=\\\"18\\\" x2=\\\"12\\\" y2=\\\"22\\\"/>\\n <line x1=\\\"2\\\" y1=\\\"12\\\" x2=\\\"6\\\" y2=\\\"12\\\"/>\\n <line x1=\\\"18\\\" y1=\\\"12\\\" x2=\\\"22\\\" y2=\\\"12\\\"/>\\n</svg>\";","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\n// The imports below will become string contents of the files unrolled by\n// both Vite (in `npm run dev`) and TSUP (in `npm run build`).\nimport { ValidationError } from \"../rules/base\";\n// @ts-expect-error parsed assets\nimport css from \"./ui.css?raw\";\n// @ts-expect-error parsed assets\nimport svgClose from \"./close.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgHelp from \"./help.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgLog from \"./log.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgReveal from \"./reveal.svg?raw\";\n\ninterface WindowWithAbleDOMDevtools extends Window {\n __ableDOMDevtools?: {\n revealElement?: (element: HTMLElement) => Promise<boolean>;\n };\n}\n\nexport interface HTMLElementWithAbleDOMUIFlag extends HTMLElement {\n // A flag to quickly test that the element should be ignored by the validator.\n __abledomui?: boolean;\n}\n\nexport class NotificationUI {\n private static _highlight: ElementHighlighter;\n\n private _wrapper: HTMLElement;\n\n static getElement(instance: NotificationUI): HTMLElement {\n return instance._wrapper;\n }\n\n constructor(element: HTMLElement, error: ValidationError) {\n const wrapper = (this._wrapper = document.createElement(\n \"div\",\n ) as HTMLElementWithAbleDOMUIFlag);\n\n const win = element.ownerDocument.defaultView;\n\n if (!win) {\n return;\n }\n\n if (!NotificationUI._highlight) {\n NotificationUI._highlight = new ElementHighlighter(win);\n }\n\n wrapper.__abledomui = true;\n\n wrapper.innerHTML = `\n <div class=\"abledom-notification-container\"><div class=\"abledom-notification\">\n <button class=\"button\" title=\"Log to Console\">${svgLog}</button>\n <button class=\"button\" title=\"Reveal in Elements panel\">${svgReveal}</button>\n ${error.message}\n <a href class=\"button close\" href=\"/\" title=\"Open help\" target=\"_blank\">${svgHelp}</a>\n <button class=\"button close\" class=\"close\" title=\"Hide\">${svgClose}</button>\n </div></div>`;\n\n const container = wrapper.firstElementChild as HTMLElement;\n const buttons = wrapper.querySelectorAll(\"button\");\n\n const logButton = buttons[0];\n const revealButton = buttons[1];\n const closeButton = buttons[2];\n\n logButton.onclick = () => {\n console.error(\n \"AbleDOM violation: \",\n \"\\nerror:\",\n error.message,\n \"\\nelement:\",\n element,\n ...(error.rel ? [\"\\nrelative:\", error.rel] : []),\n );\n };\n\n const hasDevTools = !!(win as WindowWithAbleDOMDevtools).__ableDOMDevtools\n ?.revealElement;\n\n if (hasDevTools && win.document.body.contains(element)) {\n revealButton.onclick = () => {\n const revealElement = (win as WindowWithAbleDOMDevtools)\n .__ableDOMDevtools?.revealElement;\n\n if (revealElement && win.document.body.contains(element)) {\n revealElement(element).then((revealed: boolean) => {\n if (!revealed) {\n // TODO\n }\n });\n }\n };\n } else {\n revealButton.style.display = \"none\";\n }\n\n closeButton.onclick = () => {\n wrapper.style.display = \"none\";\n NotificationUI._highlight?.hide();\n };\n\n container.onmouseover = () => {\n NotificationUI._highlight?.highlight(element);\n };\n\n container.onmouseout = () => {\n NotificationUI._highlight?.hide();\n };\n }\n\n dispose() {\n this._wrapper.remove();\n }\n}\n\nexport class NotificationsUI {\n // private _window: Window;\n private _container: HTMLElement;\n private _notifications: Set<NotificationUI> = new Set();\n\n constructor(win: Window) {\n // this._window = win;\n\n const container = (this._container =\n document.createElement(\"div\")) as HTMLElementWithAbleDOMUIFlag;\n container.__abledomui = true;\n container.id = \"abledom-report\";\n container.innerHTML = `<style>${css}</style>`;\n\n win.document.body.appendChild(container);\n }\n\n addNotification(notification: NotificationUI) {\n if (this._notifications.has(notification)) {\n return;\n }\n\n this._notifications.add(notification);\n this._container.appendChild(NotificationUI.getElement(notification));\n }\n\n removeNotification(notification: NotificationUI) {\n if (!this._notifications.has(notification)) {\n return;\n }\n\n this._notifications.delete(notification);\n this._container.removeChild(NotificationUI.getElement(notification));\n }\n}\n\nclass ElementHighlighter {\n private _window: Window;\n private _container: HTMLElement;\n\n constructor(win: Window) {\n this._window = win;\n\n const container = (this._container =\n win.document.createElement(\"div\")) as HTMLElementWithAbleDOMUIFlag;\n container.__abledomui = true;\n container.className = \"abledom-highlight\";\n }\n\n highlight(element: HTMLElement) {\n const rect = element.getBoundingClientRect();\n\n if (rect.width === 0 || rect.height === 0) {\n return;\n }\n\n const win = this._window;\n const container = this._container;\n const style = container.style;\n\n if (container.parentElement !== win.document.body) {\n win.document.body.appendChild(container);\n }\n\n style.width = `${rect.width}px`;\n style.height = `${rect.height}px`;\n style.top = `${rect.top}px`;\n style.left = `${rect.left}px`;\n\n container.style.display = \"block\";\n }\n\n hide() {\n this._container.style.display = \"none\";\n }\n}\n\nexport function isAbleDOMUIElement(element: HTMLElement): boolean {\n for (let el: HTMLElement | null = element; el; el = el.parentElement) {\n if ((el as HTMLElementWithAbleDOMUIFlag).__abledomui) {\n return true;\n }\n }\n\n return false;\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\ninterface ErrorWithStack extends ErrorConstructor {\n stackTraceLimit: number;\n}\n\nexport const focusableElementSelector = [\n \"a[href]\",\n \"button:not([disabled])\",\n \"input:not([disabled])\",\n \"select:not([disabled])\",\n \"textarea:not([disabled])\",\n \"*[tabindex]\",\n \"*[contenteditable]\",\n \"details > summary\",\n \"audio[controls]\",\n \"video[controls]\",\n].join(\", \");\n\nexport interface HTMLElementAttributes {\n readonly [name: string]: string;\n}\n\nexport const AccessibilityAffectingElements = {\n a: true,\n area: true,\n article: true,\n aside: true,\n body: true,\n button: true,\n datalist: true,\n details: true,\n dialog: true,\n dl: true,\n form: true,\n h1: true,\n h2: true,\n h3: true,\n h4: true,\n h5: true,\n h6: true,\n hr: true,\n iframe: true,\n img: true,\n input: true,\n li: true,\n link: true,\n main: true,\n menu: true,\n menuitem: true,\n meter: true,\n nav: true,\n object: true,\n ol: true,\n option: true,\n progress: true,\n section: true,\n select: true,\n tbody: true,\n textarea: true,\n tfoot: true,\n th: true,\n thead: true,\n ul: true,\n};\n\nexport const AccessibilityAttributes = {\n role: true,\n tabindex: true,\n disabled: true,\n required: true,\n readonly: true,\n hidden: true,\n \"aria-activedescendant\": true,\n \"aria-atomic\": true,\n \"aria-autocomplete\": true,\n \"aria-busy\": true,\n \"aria-checked\": true,\n \"aria-colcount\": true,\n \"aria-colindex\": true,\n \"aria-colspan\": true,\n \"aria-controls\": true,\n \"aria-current\": true,\n \"aria-describedby\": true,\n \"aria-details\": true,\n \"aria-disabled\": true,\n \"aria-dropeffect\": true,\n \"aria-errormessage\": true,\n \"aria-expanded\": true,\n \"aria-flowto\": true,\n \"aria-grabbed\": true,\n \"aria-haspopup\": true,\n \"aria-hidden\": true,\n \"aria-invalid\": true,\n \"aria-keyshortcuts\": true,\n \"aria-label\": true,\n \"aria-labelledby\": true,\n \"aria-level\": true,\n \"aria-live\": true,\n \"aria-modal\": true,\n \"aria-multiline\": true,\n \"aria-multiselectable\": true,\n \"aria-orientation\": true,\n \"aria-owns\": true,\n \"aria-placeholder\": true,\n \"aria-posinset\": true,\n \"aria-pressed\": true,\n \"aria-readonly\": true,\n \"aria-relevant\": true,\n \"aria-required\": true,\n \"aria-roledescription\": true,\n \"aria-rowcount\": true,\n \"aria-rowindex\": true,\n \"aria-rowspan\": true,\n \"aria-selected\": true,\n \"aria-setsize\": true,\n \"aria-sort\": true,\n \"aria-valuemax\": true,\n \"aria-valuemin\": true,\n \"aria-valuenow\": true,\n \"aria-valuetext\": true,\n};\n\nexport function isAccessibilityAffectingElement(element: HTMLElement): boolean {\n const tagName = element.tagName.toLowerCase();\n const attributes = getAttributes(element);\n\n return (\n tagName in AccessibilityAffectingElements ||\n hasAccessibilityAttribute(attributes)\n );\n}\n\nexport function hasAccessibilityAttribute(\n attributes: HTMLElementAttributes,\n): boolean {\n for (let attrName of Object.keys(attributes)) {\n if (\n attrName in AccessibilityAttributes &&\n !(\n attrName === \"role\" &&\n (attributes[attrName] === \"none\" ||\n attributes[attrName] === \"presentation\")\n )\n ) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function getAttributes(element: HTMLElement): HTMLElementAttributes {\n const names = element.getAttributeNames();\n const attributes: { [name: string]: string } = {};\n\n for (let name of names) {\n attributes[name] = element.getAttribute(name) || \"\";\n }\n\n return attributes;\n}\n\nexport function matchesSelector(\n element: HTMLElement,\n selector: string,\n): boolean {\n interface HTMLElementWithMatches extends HTMLElement {\n matchesSelector?: typeof HTMLElement.prototype.matches;\n msMatchesSelector?: typeof HTMLElement.prototype.matches;\n }\n\n const matches =\n element.matches ||\n (element as HTMLElementWithMatches).matchesSelector ||\n (element as HTMLElementWithMatches).msMatchesSelector ||\n element.webkitMatchesSelector;\n\n return matches && matches.call(element, selector);\n}\n\nexport function isDisplayNone(element: HTMLElement): boolean {\n const elementDocument = element.ownerDocument;\n const computedStyle = elementDocument.defaultView?.getComputedStyle(element);\n\n // offsetParent is null for elements with display:none, display:fixed and for <body>.\n if (\n element.offsetParent === null &&\n elementDocument.body !== element &&\n computedStyle?.position !== \"fixed\"\n ) {\n return true;\n }\n\n // For our purposes of looking for focusable elements, visibility:hidden has the same\n // effect as display:none.\n if (computedStyle?.visibility === \"hidden\") {\n return true;\n }\n\n // if an element has display: fixed, we need to check if it is also hidden with CSS,\n // or within a parent hidden with CSS\n if (computedStyle?.position === \"fixed\") {\n if (computedStyle.display === \"none\") {\n return true;\n }\n\n if (\n element.parentElement?.offsetParent === null &&\n elementDocument.body !== element.parentElement\n ) {\n return true;\n }\n }\n\n return false;\n}\n\nexport function isElementVisible(element: HTMLElement): boolean {\n if (!element.ownerDocument || element.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n\n if (isDisplayNone(element)) {\n return false;\n }\n\n const rect = element.ownerDocument.body.getBoundingClientRect();\n\n if (rect.width === 0 && rect.height === 0) {\n // This might happen, for example, if our <body> is in hidden <iframe>.\n return false;\n }\n\n return true;\n}\n\nexport function getStackTrace(): string[] {\n const oldStackTraceLimit = (Error as ErrorWithStack).stackTraceLimit;\n\n try {\n (Error as ErrorWithStack).stackTraceLimit = 1000;\n\n throw new Error();\n } catch (e) {\n (Error as ErrorWithStack).stackTraceLimit = oldStackTraceLimit;\n\n return (\n (e as Error).stack\n ?.split(\"\\n\")\n .slice(1)\n .map((line) => line.trim())\n .filter((line) => line.startsWith(\"at \")) || []\n );\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport interface ValidationError {\n id: string;\n message: string;\n rel?: Node;\n link?: string;\n stack?: string[];\n relStack?: string[];\n}\n\nexport interface ValidationResult {\n error?: ValidationError;\n dependsOnIds?: Set<string>;\n}\n\nexport interface FocusError {\n element: HTMLElement;\n error: ValidationError;\n}\n\nexport interface BlurError {\n element: HTMLElement;\n position?: string[];\n error: ValidationError;\n}\n\nexport abstract class ValidationRule {\n abstract name: string;\n private _window?: Window;\n private _exceptions: ((element: HTMLElement) => boolean)[] = [];\n\n static setWindow(instance: ValidationRule, window: Window): void {\n instance._window = window;\n }\n\n static checkExceptions(\n instance: ValidationRule,\n element: HTMLElement,\n ): boolean {\n for (const exception of instance._exceptions) {\n if (exception(element)) {\n return true;\n }\n }\n\n return false;\n }\n\n addException(checkException: (element: HTMLElement) => boolean): void {\n this._exceptions?.push(checkException);\n }\n\n removeException(checkException: (element: HTMLElement) => boolean): void {\n const index = this._exceptions.indexOf(checkException);\n\n if (index >= 0) {\n this._exceptions.splice(index, 1);\n }\n }\n\n /**\n * If true, the rule violation will be anchored to the currently present\n * in DOM element it is applied to, otherwise the error message will show\n * till it is dismissed.\n */\n abstract anchored: boolean;\n\n /**\n * Window is set when the rule is added to the AbleDOM instance.\n */\n get window(): Window | undefined {\n return this._window;\n }\n\n // Called when the parent AbleDOM instance is started.\n start?(): void;\n // Called when the parent AbleDOM instance is stopped.\n stop?(): void;\n\n // Called before validation. If returns false, the rule will not be applied to\n // the element.\n accept?(element: HTMLElement): boolean;\n\n validate?(element: HTMLElement): ValidationResult | null;\n\n async focused?(event: FocusEvent): Promise<FocusError | null>;\n async blurred?(event: FocusEvent): Promise<BlurError | null>;\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n NotificationsUI,\n NotificationUI,\n HTMLElementWithAbleDOMUIFlag,\n isAbleDOMUIElement,\n} from \"./ui/ui\";\nimport { isAccessibilityAffectingElement } from \"./utils\";\nimport { ValidationRule, ValidationError } from \"./rules/base\";\n\nexport class ValidationErrorReport {\n static _notificationsUI: NotificationsUI | undefined;\n\n private _notification: NotificationUI | undefined;\n private _onHide: (() => void) | undefined;\n\n constructor(\n public readonly element: HTMLElement,\n public error: ValidationError,\n onHide?: () => void,\n ) {\n this._onHide = onHide;\n this.report();\n }\n\n update(error: ValidationError): void {\n this.error = error;\n this.report();\n }\n\n report(): void {\n if (!ValidationErrorReport._notificationsUI) {\n ValidationErrorReport._notificationsUI = new NotificationsUI(window);\n }\n\n let notification = this._notification;\n\n if (notification) {\n /** TODO */\n } else {\n notification = this._notification = new NotificationUI(\n this.element,\n this.error,\n );\n }\n\n ValidationErrorReport._notificationsUI.addNotification(notification);\n }\n\n hide(): void {\n this._onHide?.();\n }\n\n remove(): void {\n if (this._notification) {\n ValidationErrorReport._notificationsUI?.removeNotification(\n this._notification,\n );\n delete this._notification;\n }\n }\n}\n\ninterface HTMLElementWithAbleDOM extends HTMLElement {\n __abledom?: {\n errors?: Map<ValidationRule, ValidationErrorReport>;\n };\n}\n\nexport class AbleDOM {\n private _window: Window;\n private _observer: MutationObserver;\n private _clearValidationTimeout: (() => void) | undefined;\n private _elementsWithErrors: Set<HTMLElementWithAbleDOM> = new Set();\n private _changedElementIds: Set<string> = new Set();\n private _elementsDependingOnId: Map<string, Set<HTMLElement>> = new Map();\n private _dependantIdsByElement: Map<HTMLElement, Set<string>> = new Map();\n private _idByElement: Map<HTMLElement, string> = new Map();\n private _rules: ValidationRule[] = [];\n private _startFunc: (() => void) | undefined;\n private _isStarted = false;\n\n constructor(win: Window) {\n this._window = win;\n\n const _elementsToValidate: Set<HTMLElementWithAbleDOM> = new Set();\n const _elementsToRemove: Set<HTMLElementWithAbleDOM> = new Set();\n\n win.document.addEventListener(\"focusin\", this._onFocusIn, true);\n win.document.addEventListener(\"focusout\", this._onFocusOut, true);\n\n this._observer = new MutationObserver((mutations) => {\n for (let mutation of mutations) {\n if ((mutation.target as HTMLElementWithAbleDOMUIFlag).__abledomui) {\n continue;\n }\n\n const added = mutation.addedNodes;\n const removed = mutation.removedNodes;\n const attributeName = mutation.attributeName;\n\n if (attributeName === \"id\") {\n // A bunch of aria attributes reference elements by id, so, we are handling it as special case.\n this._onElementId(mutation.target as HTMLElementWithAbleDOM, false);\n\n continue;\n }\n\n // Adding children should trigger revalidation of the parents (it could,\n // for example, be a text that of a parent button).\n lookUp(mutation.target);\n\n for (let i = 0; i < added.length; i++) {\n findTargets(added[i], false);\n }\n\n for (let i = 0; i < removed.length; i++) {\n findTargets(removed[i], true);\n }\n }\n\n this._clearValidationTimeout?.();\n\n const _validationTimeout: number | undefined = win.setTimeout(() => {\n delete this._clearValidationTimeout;\n\n this._remove(_elementsToRemove);\n this._validate(_elementsToValidate);\n\n _elementsToRemove.clear();\n _elementsToValidate.clear();\n this._changedElementIds.clear();\n }, 200); // Defer the validation a bit.\n\n this._clearValidationTimeout = () => {\n win.clearTimeout(_validationTimeout);\n delete this._clearValidationTimeout;\n };\n });\n\n this._startFunc = () => {\n delete this._startFunc;\n\n this._observer.observe(win.document, {\n childList: true,\n subtree: true,\n attributes: true,\n });\n\n // Initial validation.\n findTargets(win.document.body, false);\n this._validate(_elementsToValidate);\n _elementsToValidate.clear();\n };\n\n const addTarget = (node: Node, removed: boolean): void => {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n\n const id = (node as HTMLElement).id;\n\n if (id) {\n this._onElementId(node as HTMLElement, removed);\n }\n\n if (removed) {\n _elementsToRemove.add(node as HTMLElementWithAbleDOM);\n _elementsToValidate.delete(node as HTMLElementWithAbleDOM);\n } else {\n _elementsToValidate.add(node as HTMLElementWithAbleDOM);\n _elementsToRemove.delete(node as HTMLElementWithAbleDOM);\n }\n };\n\n function lookUp(node: Node): void {\n for (let n: Node | null = node; n; n = n.parentNode) {\n addTarget(n, false);\n }\n }\n\n function findTargets(node: Node, removed: boolean): void {\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return;\n }\n\n addTarget(node as HTMLElement, removed);\n\n const walker = win.document.createTreeWalker(\n node,\n NodeFilter.SHOW_ELEMENT,\n (node: Node): number => {\n addTarget(node, removed);\n return NodeFilter.FILTER_SKIP;\n },\n );\n\n if (walker) {\n while (walker.nextNode()) {\n /* Iterating for the sake of going through all elements in the subtree. */\n }\n }\n }\n }\n\n private _onElementId(element: HTMLElement, removed: boolean) {\n const elementId = element.getAttribute(\"id\");\n const oldElementId = this._idByElement.get(element);\n\n if (oldElementId) {\n this._changedElementIds.add(oldElementId);\n\n const elements = this._elementsDependingOnId.get(oldElementId);\n\n if (elements) {\n elements.delete(element);\n\n if (elements.size === 0) {\n this._elementsDependingOnId.delete(oldElementId);\n }\n }\n }\n\n if (elementId) {\n this._changedElementIds.add(elementId);\n\n let elements = this._elementsDependingOnId.get(elementId);\n\n if (removed) {\n this._idByElement.delete(element);\n\n if (elements) {\n elements.delete(element);\n\n if (elements.size === 0) {\n this._elementsDependingOnId.delete(elementId);\n }\n }\n } else {\n this._idByElement.set(element, elementId);\n\n if (!elements) {\n elements = new Set();\n this._elementsDependingOnId.set(elementId, elements);\n }\n\n elements.add(element);\n }\n } else {\n this._idByElement.delete(element);\n }\n }\n\n private _addValidationError(\n element: HTMLElementWithAbleDOM,\n rule: ValidationRule,\n error?: ValidationError,\n ) {\n if (!error) {\n this._removeElementError(element, rule);\n return;\n }\n\n if (rule.anchored) {\n let abledomOnElement = element.__abledom;\n\n if (!abledomOnElement) {\n abledomOnElement = element.__abledom = {};\n }\n\n let errors = abledomOnElement.errors;\n\n if (!errors) {\n errors = abledomOnElement.errors = new Map();\n }\n\n const report = errors.get(rule);\n\n if (report) {\n report.update(error);\n } else {\n errors.set(rule, new ValidationErrorReport(element, error));\n }\n\n this._elementsWithErrors.add(element);\n } else {\n const report = new ValidationErrorReport(element, error, () => {\n report.remove();\n });\n }\n }\n\n private _removeElementError(\n element: HTMLElementWithAbleDOM,\n rule: ValidationRule,\n ) {\n if (!rule.anchored) {\n return;\n }\n\n const errors = element.__abledom?.errors;\n\n if (!errors) {\n return;\n }\n\n const report = errors.get(rule);\n\n if (report) {\n report.remove();\n errors.delete(rule);\n }\n\n if (errors.size === 0) {\n this._elementsWithErrors.delete(element);\n delete element.__abledom;\n }\n }\n\n private _validate(elements: Set<HTMLElementWithAbleDOM>) {\n for (const id of this._changedElementIds) {\n const dependingOnId = this._elementsDependingOnId.get(id);\n\n if (dependingOnId) {\n for (const element of dependingOnId) {\n elements.add(element);\n }\n }\n }\n\n elements.forEach((element) => {\n if (\n isAccessibilityAffectingElement(element) ||\n element.__abledom?.errors\n ) {\n const dependsOnIds = new Set<string>();\n\n for (const rule of this._rules) {\n if (rule.accept?.(element) === false) {\n continue;\n }\n\n if (ValidationRule.checkExceptions(rule, element)) {\n continue;\n }\n\n const validationResult = rule.validate?.(element);\n\n if (validationResult) {\n this._addValidationError(element, rule, validationResult.error);\n\n const ids = validationResult.dependsOnIds;\n\n if (ids) {\n for (const id of ids) {\n dependsOnIds.add(id);\n }\n }\n } else if (element.__abledom?.errors?.has(rule)) {\n this._removeElementError(element, rule);\n }\n }\n\n this._processElementDependingOnIds(\n element,\n dependsOnIds.size === 0 ? null : dependsOnIds,\n );\n }\n });\n }\n\n private _processElementDependingOnIds(\n element: HTMLElement,\n ids: Set<string> | null,\n ): void {\n let dependsOnIds = this._dependantIdsByElement.get(element);\n\n if (!ids && !dependsOnIds) {\n return;\n }\n\n if (!dependsOnIds) {\n dependsOnIds = new Set();\n }\n\n if (!ids) {\n ids = new Set();\n }\n\n for (const id of dependsOnIds) {\n if (!ids.has(id)) {\n const elements = this._elementsDependingOnId.get(id);\n\n if (elements) {\n elements.delete(element);\n\n if (elements.size === 0) {\n this._elementsDependingOnId.delete(id);\n }\n }\n }\n }\n\n for (const id of ids) {\n if (!dependsOnIds.has(id)) {\n dependsOnIds.add(id);\n\n let elements = this._elementsDependingOnId.get(id);\n\n if (!elements) {\n elements = new Set();\n this._elementsDependingOnId.set(id, elements);\n }\n\n elements.add(element);\n }\n }\n\n if (dependsOnIds.size === 0) {\n this._dependantIdsByElement.delete(element);\n } else {\n this._dependantIdsByElement.set(element, dependsOnIds);\n }\n }\n\n private _remove(elements: Set<HTMLElementWithAbleDOM>) {\n elements.forEach((element) => {\n const rules = [...(element.__abledom?.errors?.keys() || [])];\n rules.forEach((rule) => this._removeElementError(element, rule));\n });\n }\n\n private _onFocusIn = (event: FocusEvent) => {\n const target = event.target as HTMLElement | null;\n\n if (target && isAbleDOMUIElement(target)) {\n return;\n }\n\n for (const rule of this._rules) {\n rule.focused?.(event).then(\n (focusError) => {\n if (focusError) {\n this._addValidationError(\n focusError.element,\n rule,\n focusError.error,\n );\n }\n },\n () => {\n // Ignore errors.\n },\n );\n }\n };\n\n private _onFocusOut = (event: FocusEvent) => {\n const target = event.target as HTMLElement | null;\n\n if (target && isAbleDOMUIElement(target)) {\n return;\n }\n\n for (const rule of this._rules) {\n rule.blurred?.(event).then(\n (focusError) => {\n if (focusError) {\n this._addValidationError(\n focusError.element,\n rule,\n focusError.error,\n );\n }\n },\n () => {\n // Ignore errors.\n },\n );\n }\n };\n\n addRule(rule: ValidationRule): void {\n this._rules.push(rule);\n }\n\n removeRule(rule: ValidationRule): void {\n const index = this._rules.indexOf(rule);\n\n if (index >= 0) {\n const rule = this._rules[index];\n this._rules.splice(index, 1);\n rule.stop?.();\n }\n }\n\n start(): void {\n if (this._isStarted) {\n return;\n }\n\n this._isStarted = true;\n\n for (const rule of this._rules) {\n ValidationRule.setWindow(rule, this._window);\n rule.start?.();\n }\n\n this._startFunc?.();\n }\n\n dispose() {\n this._window.document.addEventListener(\"focusin\", this._onFocusIn, true);\n this._window.document.addEventListener(\"focusout\", this._onFocusOut, true);\n\n this._remove(this._elementsWithErrors);\n this._elementsWithErrors.clear();\n\n this._dependantIdsByElement.clear();\n this._elementsDependingOnId.clear();\n this._idByElement.clear();\n\n this._clearValidationTimeout?.();\n\n for (const rule of this._rules) {\n rule.stop?.();\n }\n\n this._rules = [];\n\n if (this._startFunc) {\n delete this._startFunc;\n } else {\n this._observer.disconnect();\n }\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { focusableElementSelector, matchesSelector } from \"../utils\";\nimport { ValidationRule, ValidationResult } from \"./base\";\n\nexport class AtomicRule extends ValidationRule {\n name = \"atomic\";\n anchored = true;\n\n accept(element: HTMLElement): boolean {\n return matchesSelector(element, focusableElementSelector);\n }\n\n validate(element: HTMLElement): ValidationResult | null {\n const parentAtomic = document\n .evaluate(\n `ancestor::*[\n @role = 'button' or \n @role = 'checkbox' or \n @role = 'link' or \n @role = 'menuitem' or \n @role = 'menuitemcheckbox' or \n @role = 'menuitemradio' or \n @role = 'option' or \n @role = 'radio' or \n @role = 'switch' or \n @role = 'tab' or \n @role = 'treeitem' or\n self::a or\n self::button or\n self::input or\n self::option or\n self::textarea \n ][1]`,\n element,\n null,\n XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,\n null,\n )\n .snapshotItem(0);\n\n if (parentAtomic) {\n return {\n error: {\n id: \"focusable-in-atomic\",\n message: \"Focusable element inside atomic focusable.\",\n rel: parentAtomic,\n },\n };\n }\n\n return null;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n matchesSelector,\n focusableElementSelector,\n isElementVisible,\n} from \"../utils\";\nimport { ValidationRule, ValidationResult } from \"./base\";\n\nconst _keyboardEditableInputTypes = new Set([\n \"text\",\n \"password\",\n \"email\",\n \"search\",\n \"tel\",\n \"url\",\n \"number\",\n \"date\",\n \"month\",\n \"week\",\n \"time\",\n \"datetime-local\",\n]);\n\nexport class FocusableElementLabelRule extends ValidationRule {\n name = \"FocusableElementLabelRule\";\n anchored = true;\n\n private _isAriaHidden(element: HTMLElement): boolean {\n return document.evaluate(\n `ancestor-or-self::*[@aria-hidden = 'true' or @hidden]`,\n element,\n null,\n XPathResult.BOOLEAN_TYPE,\n null,\n ).booleanValue;\n }\n\n private _hasLabel(element: HTMLElement): boolean {\n const labels = (element as HTMLInputElement).labels;\n\n if (labels && labels.length > 0) {\n for (let i = 0; i < labels.length; i++) {\n const label = labels[i];\n if (label.innerText.trim()) {\n return true;\n }\n }\n }\n\n if (element.tagName === \"IMG\") {\n if ((element as HTMLImageElement).alt.trim()) {\n return true;\n }\n }\n\n const labelNodes = document.evaluate(\n `(\n .//@aria-label | \n .//text() | \n .//@title | \n .//img/@alt | \n .//input[@type = 'image']/@alt | \n .//input[@type != 'hidden'][@type = 'submit' or @type = 'reset' or @type = 'button']/@value\n )[not(ancestor-or-self::*[@aria-hidden = 'true' or @hidden])]`,\n element,\n null,\n XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,\n null,\n );\n\n for (let i = 0; i < labelNodes.snapshotLength; i++) {\n const val = labelNodes.snapshotItem(i)?.nodeValue?.trim();\n\n if (val) {\n return true;\n }\n }\n\n return false;\n }\n\n accept(element: HTMLElement): boolean {\n return matchesSelector(element, focusableElementSelector);\n }\n\n validate(element: HTMLElement): ValidationResult | null {\n if (element.tagName === \"INPUT\") {\n const type = (element as HTMLInputElement).type;\n\n if (type === \"hidden\") {\n return null;\n }\n\n if (_keyboardEditableInputTypes.has(type)) {\n return null;\n }\n\n if (type === \"image\") {\n if ((element as HTMLInputElement).alt.trim()) {\n return null;\n }\n }\n\n if (type === \"submit\" || type === \"reset\" || type === \"button\") {\n if ((element as HTMLInputElement).value.trim()) {\n return null;\n }\n }\n }\n\n if (this._isAriaHidden(element)) {\n return null;\n }\n\n if (this._hasLabel(element)) {\n return null;\n }\n\n const labelledByNodes = document.evaluate(\n `.//@aria-labelledby[not(ancestor-or-self::*[@aria-hidden = 'true' or @hidden])]`,\n element,\n null,\n XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,\n null,\n );\n\n const labelledByValues: string[] = [];\n\n for (let i = 0; i < labelledByNodes.snapshotLength; i++) {\n const val = (labelledByNodes.snapshotItem(i) as Attr)?.value\n ?.trim()\n .split(\" \");\n\n if (val?.length) {\n labelledByValues.push(...val);\n }\n }\n\n for (const id of labelledByValues) {\n const labelElement = document.getElementById(id);\n\n if (labelElement && this._hasLabel(labelElement)) {\n return {\n dependsOnIds: new Set(labelledByValues),\n };\n }\n }\n\n return {\n error: isElementVisible(element)\n ? {\n id: \"focusable-element-label\",\n message: \"Focusable element must have a non-empty text label.\",\n }\n : undefined,\n dependsOnIds: new Set(labelledByValues),\n };\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ValidationRule, ValidationResult } from \"./base\";\n\nexport class ExistingIdRule extends ValidationRule {\n name = \"existing-id\";\n anchored = true;\n\n accept(element: HTMLElement): boolean {\n return (\n element.hasAttribute(\"aria-labelledby\") ||\n element.hasAttribute(\"aria-describedby\") ||\n (element.tagName === \"LABEL\" && !!(element as HTMLLabelElement).htmlFor)\n );\n }\n\n validate(element: HTMLElement): ValidationResult | null {\n const ids = [\n ...(element.getAttribute(\"aria-labelledby\")?.split(\" \") || []),\n ...(element.getAttribute(\"aria-describedby\")?.split(\" \") || []),\n ...(element.tagName === \"LABEL\"\n ? [(element as HTMLLabelElement).htmlFor]\n : []),\n ].filter((id) => !!id);\n\n if (ids.length === 0) {\n return null;\n }\n\n for (const id of ids) {\n if (document.getElementById(id)) {\n return {\n dependsOnIds: new Set(ids),\n };\n }\n }\n\n return {\n error: {\n id: \"missing-id\",\n message: `Elements with referenced ids do not extist.`,\n },\n dependsOnIds: new Set(ids),\n };\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { isElementVisible, getStackTrace } from \"../utils\";\nimport { FocusError, BlurError, ValidationRule } from \"./base\";\n\nexport class FocusLostRule extends ValidationRule {\n name = \"focus-lost\";\n anchored = false;\n\n private _focusLostTimeout = 2000; // For now reporting lost focus after 2 seconds of it being lost.\n private _clearScheduledFocusLost: (() => void) | undefined;\n private _focusedElement: HTMLElement | undefined;\n private _focusedElementPosition: string[] | undefined;\n private _lastFocusStack: string[] | undefined;\n private _lastBlurStack: string[] | undefined;\n\n private _serializeElementPosition(element: HTMLElement): string[] {\n const position: string[] = [];\n const parentElement = element.parentElement;\n\n if (!parentElement) {\n return position;\n }\n\n for (\n let el: HTMLElement | null = parentElement;\n el;\n el = el.parentElement\n ) {\n const tagName = el.tagName.toLowerCase();\n position.push(tagName);\n }\n\n return position;\n }\n\n async focused(event: FocusEvent): Promise<FocusError | null> {\n const target = event.target as HTMLElement | null;\n\n this._clearScheduledFocusLost?.();\n\n if (target) {\n this._lastFocusStack = getStackTrace();\n\n this._focusedElement = target;\n this._focusedElementPosition = this._serializeElementPosition(target);\n }\n\n return null;\n }\n\n async blurred(event: FocusEvent): Promise<BlurError | null> {\n const target = event.target as HTMLElement | null;\n const win = this.window;\n\n this._clearScheduledFocusLost?.();\n\n if (!target || !win || event.relatedTarget) {\n return null;\n }\n\n let focusLostTimer: number | undefined;\n let rejectPromise: (() => void) | undefined;\n\n const targetPosition =\n this._focusedElement === target\n ? this._focusedElementPosition\n : undefined;\n\n this._lastBlurStack = getStackTrace();\n\n // Make sure to not hold the reference once the element is not focused anymore.\n this._focusedElement = undefined;\n this._focusedElementPosition = undefined;\n\n this._clearScheduledFocusLost = () => {\n delete this._clearScheduledFocusLost;\n\n rejectPromise?.();\n\n if (focusLostTimer) {\n win.clearTimeout(focusLostTimer);\n focusLostTimer = undefined;\n }\n };\n\n return new Promise<BlurError | null>((resolve, reject) => {\n rejectPromise = () => {\n rejectPromise = undefined;\n reject();\n };\n\n focusLostTimer = win.setTimeout(() => {\n focusLostTimer = undefined;\n rejectPromise = undefined;\n delete this._clearScheduledFocusLost;\n\n if (\n win.document.body &&\n (!win.document.activeElement ||\n win.document.activeElement === win.document.body) &&\n (!win.document.body.contains(target) || !isElementVisible(target))\n ) {\n resolve({\n element: target,\n position: targetPosition || [],\n error: {\n id: \"focus-lost\",\n message: \"Focus lost.\",\n stack: this._lastBlurStack,\n relStack: this._lastFocusStack,\n },\n });\n } else {\n resolve(null);\n }\n }, this._focusLostTimeout);\n });\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { isElementVisible, getStackTrace } from \"../utils\";\nimport { FocusError, BlurError, ValidationRule } from \"./base\";\n\nexport class BadFocusRule extends ValidationRule {\n name = \"bad-focus\";\n anchored = false;\n\n private _lastFocusStack: string[] | undefined;\n private _lastBlurStack: string[] | undefined;\n\n private _reject: (() => void) | undefined;\n\n async focused(): Promise<FocusError | null> {\n this._lastFocusStack = getStackTrace();\n this._reject?.();\n return null;\n }\n\n async blurred(): Promise<BlurError | null> {\n this._reject?.();\n\n const win = this.window;\n\n if (!win) {\n return null;\n }\n\n this._lastBlurStack = getStackTrace();\n\n return new Promise((resolve, reject) => {\n let checkTimer: number | undefined;\n\n this._reject = () => {\n if (checkTimer) {\n win.clearTimeout(checkTimer);\n checkTimer = undefined;\n }\n\n this._reject = undefined;\n reject();\n };\n\n checkTimer = win.setTimeout(() => {\n checkTimer = undefined;\n\n this._reject = undefined;\n\n if (\n document.activeElement &&\n !isElementVisible(document.activeElement as HTMLElement)\n ) {\n resolve({\n element: document.activeElement as HTMLElement,\n error: {\n id: \"bad-focus\",\n message: \"Focused stolen by invisible element.\",\n stack: this._lastBlurStack,\n relStack: this._lastFocusStack,\n },\n });\n } else {\n resolve(null);\n }\n }, 100);\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAO,aAAQ;;;ACAf,IAAO,gBAAQ;;;ACAf,IAAO,eAAQ;;;ACAf,IAAO,cAAQ;;;ACAf,IAAO,iBAAQ;;;AC8BR,IAAM,kBAAN,MAAM,gBAAe;AAAA,EAS1B,YAA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|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
interface ValidationError {
|
|
6
|
+
id: string;
|
|
7
|
+
message: string;
|
|
8
|
+
rel?: Node;
|
|
9
|
+
link?: string;
|
|
10
|
+
stack?: string[];
|
|
11
|
+
relStack?: string[];
|
|
12
|
+
}
|
|
13
|
+
interface ValidationResult {
|
|
14
|
+
error?: ValidationError;
|
|
15
|
+
dependsOnIds?: Set<string>;
|
|
16
|
+
}
|
|
17
|
+
interface FocusError {
|
|
18
|
+
element: HTMLElement;
|
|
19
|
+
error: ValidationError;
|
|
20
|
+
}
|
|
21
|
+
interface BlurError {
|
|
22
|
+
element: HTMLElement;
|
|
23
|
+
position?: string[];
|
|
24
|
+
error: ValidationError;
|
|
25
|
+
}
|
|
26
|
+
declare abstract class ValidationRule {
|
|
27
|
+
abstract name: string;
|
|
28
|
+
private _window?;
|
|
29
|
+
private _exceptions;
|
|
30
|
+
static setWindow(instance: ValidationRule, window: Window): void;
|
|
31
|
+
static checkExceptions(instance: ValidationRule, element: HTMLElement): boolean;
|
|
32
|
+
addException(checkException: (element: HTMLElement) => boolean): void;
|
|
33
|
+
removeException(checkException: (element: HTMLElement) => boolean): void;
|
|
34
|
+
/**
|
|
35
|
+
* If true, the rule violation will be anchored to the currently present
|
|
36
|
+
* in DOM element it is applied to, otherwise the error message will show
|
|
37
|
+
* till it is dismissed.
|
|
38
|
+
*/
|
|
39
|
+
abstract anchored: boolean;
|
|
40
|
+
/*
|
|
41
|
+
* Window is set when the rule is added to the AbleDOM instance.
|
|
42
|
+
*/
|
|
43
|
+
readonly window: Window | undefined;
|
|
44
|
+
start?(): void;
|
|
45
|
+
stop?(): void;
|
|
46
|
+
accept?(element: HTMLElement): boolean;
|
|
47
|
+
validate?(element: HTMLElement): ValidationResult | null;
|
|
48
|
+
focused?(event: FocusEvent): Promise<FocusError | null>;
|
|
49
|
+
blurred?(event: FocusEvent): Promise<BlurError | null>;
|
|
50
|
+
}
|
|
51
|
+
/*!
|
|
52
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
53
|
+
* Licensed under the MIT License.
|
|
54
|
+
*/
|
|
55
|
+
declare class AbleDOM {
|
|
56
|
+
private _window;
|
|
57
|
+
private _observer;
|
|
58
|
+
private _clearValidationTimeout;
|
|
59
|
+
private _elementsWithErrors;
|
|
60
|
+
private _changedElementIds;
|
|
61
|
+
private _elementsDependingOnId;
|
|
62
|
+
private _dependantIdsByElement;
|
|
63
|
+
private _idByElement;
|
|
64
|
+
private _rules;
|
|
65
|
+
private _startFunc;
|
|
66
|
+
private _isStarted;
|
|
67
|
+
constructor(win: Window);
|
|
68
|
+
private _onElementId;
|
|
69
|
+
private _addValidationError;
|
|
70
|
+
private _removeElementError;
|
|
71
|
+
private _validate;
|
|
72
|
+
private _processElementDependingOnIds;
|
|
73
|
+
private _remove;
|
|
74
|
+
private _onFocusIn;
|
|
75
|
+
private _onFocusOut;
|
|
76
|
+
addRule(rule: ValidationRule): void;
|
|
77
|
+
removeRule(rule: ValidationRule): void;
|
|
78
|
+
start(): void;
|
|
79
|
+
dispose(): void;
|
|
80
|
+
}
|
|
81
|
+
declare class AtomicRule extends ValidationRule {
|
|
82
|
+
name: string;
|
|
83
|
+
anchored: boolean;
|
|
84
|
+
accept(element: HTMLElement): boolean;
|
|
85
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
86
|
+
}
|
|
87
|
+
/*!
|
|
88
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
89
|
+
* Licensed under the MIT License.
|
|
90
|
+
*/
|
|
91
|
+
declare class FocusableElementLabelRule extends ValidationRule {
|
|
92
|
+
name: string;
|
|
93
|
+
anchored: boolean;
|
|
94
|
+
private _isAriaHidden;
|
|
95
|
+
private _hasLabel;
|
|
96
|
+
accept(element: HTMLElement): boolean;
|
|
97
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
98
|
+
}
|
|
99
|
+
/*!
|
|
100
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
101
|
+
* Licensed under the MIT License.
|
|
102
|
+
*/
|
|
103
|
+
declare class ExistingIdRule extends ValidationRule {
|
|
104
|
+
name: string;
|
|
105
|
+
anchored: boolean;
|
|
106
|
+
accept(element: HTMLElement): boolean;
|
|
107
|
+
validate(element: HTMLElement): ValidationResult | null;
|
|
108
|
+
}
|
|
109
|
+
/*!
|
|
110
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
111
|
+
* Licensed under the MIT License.
|
|
112
|
+
*/
|
|
113
|
+
declare class FocusLostRule extends ValidationRule {
|
|
114
|
+
name: string;
|
|
115
|
+
anchored: boolean;
|
|
116
|
+
private _focusLostTimeout;
|
|
117
|
+
private _clearScheduledFocusLost;
|
|
118
|
+
private _focusedElement;
|
|
119
|
+
private _focusedElementPosition;
|
|
120
|
+
private _lastFocusStack;
|
|
121
|
+
private _lastBlurStack;
|
|
122
|
+
private _serializeElementPosition;
|
|
123
|
+
focused(event: FocusEvent): Promise<FocusError | null>;
|
|
124
|
+
blurred(event: FocusEvent): Promise<BlurError | null>;
|
|
125
|
+
}
|
|
126
|
+
/*!
|
|
127
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
128
|
+
* Licensed under the MIT License.
|
|
129
|
+
*/
|
|
130
|
+
declare class BadFocusRule extends ValidationRule {
|
|
131
|
+
name: string;
|
|
132
|
+
anchored: boolean;
|
|
133
|
+
private _lastFocusStack;
|
|
134
|
+
private _lastBlurStack;
|
|
135
|
+
private _reject;
|
|
136
|
+
focused(): Promise<FocusError | null>;
|
|
137
|
+
blurred(): Promise<BlurError | null>;
|
|
138
|
+
}
|
|
139
|
+
export { AbleDOM, AtomicRule, BadFocusRule, BlurError, ExistingIdRule, FocusError, FocusLostRule, FocusableElementLabelRule, ValidationRule };
|
package/package.json
CHANGED
|
@@ -1,19 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "abledom",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"author": "Marat Abdullin <marata@microsoft.com>",
|
|
4
5
|
"description": "Continuous detection of typical web application accessibility problems.",
|
|
5
|
-
"
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"main": "./dist/index.js",
|
|
10
|
+
"module": "./dist/esm/index.js",
|
|
11
|
+
"typings": "./dist/index.d.ts",
|
|
12
|
+
"typesVersions": {
|
|
13
|
+
"<4.0": {
|
|
14
|
+
"dist/index.d.ts": [
|
|
15
|
+
"dist/ts3.9/index.d.ts"
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
6
22
|
"scripts": {
|
|
7
|
-
"
|
|
23
|
+
"dev": "vite",
|
|
24
|
+
"build": "tsup && npx downlevel-dts ./dist ./dist/ts3.9",
|
|
25
|
+
"clean": "rimraf dist",
|
|
26
|
+
"format": "prettier --check .",
|
|
27
|
+
"format:fix": "prettier --write .",
|
|
28
|
+
"lint": "eslint src/ test-pages/ devtools/",
|
|
29
|
+
"lint:fix": "npm run lint -- --fix",
|
|
30
|
+
"type-check": "tsc -b tsconfig.json",
|
|
31
|
+
"prepublishOnly": "npm run lint && npm run format && npm run build",
|
|
32
|
+
"release": "release-it"
|
|
8
33
|
},
|
|
9
34
|
"repository": {
|
|
10
35
|
"type": "git",
|
|
11
36
|
"url": "git+https://github.com/microsoft/abledom.git"
|
|
12
37
|
},
|
|
13
|
-
"author": "Marat Abdullin <marata@microsoft.com>",
|
|
14
|
-
"license": "MIT",
|
|
15
38
|
"bugs": {
|
|
16
39
|
"url": "https://github.com/microsoft/abledom/issues"
|
|
17
40
|
},
|
|
18
|
-
"homepage": "https://github.com/microsoft/abledom#readme"
|
|
41
|
+
"homepage": "https://github.com/microsoft/abledom#readme",
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^8.29.1",
|
|
44
|
+
"@typescript-eslint/parser": "^8.29.1",
|
|
45
|
+
"downlevel-dts": "^0.11.0",
|
|
46
|
+
"esbuild-plugin-inline-import": "^1.1.0",
|
|
47
|
+
"eslint": "^9.24.0",
|
|
48
|
+
"eslint-config-prettier": "^10.1.1",
|
|
49
|
+
"eslint-plugin-header": "^3.1.1",
|
|
50
|
+
"eslint-plugin-import": "^2.31.0",
|
|
51
|
+
"prettier": "^3.5.3",
|
|
52
|
+
"release-it": "^18.1.2",
|
|
53
|
+
"rimraf": "^6.0.1",
|
|
54
|
+
"tsup": "^8.4.0",
|
|
55
|
+
"typescript": "^5.8.3",
|
|
56
|
+
"vite": "^6.2.5"
|
|
57
|
+
}
|
|
19
58
|
}
|
package/CODE_OF_CONDUCT.md
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Microsoft Open Source Code of Conduct
|
|
2
|
-
|
|
3
|
-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
|
|
4
|
-
|
|
5
|
-
Resources:
|
|
6
|
-
|
|
7
|
-
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
|
|
8
|
-
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
|
|
9
|
-
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns
|
package/SECURITY.md
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
|
|
2
|
-
|
|
3
|
-
## Security
|
|
4
|
-
|
|
5
|
-
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
|
|
6
|
-
|
|
7
|
-
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
|
|
8
|
-
|
|
9
|
-
## Reporting Security Issues
|
|
10
|
-
|
|
11
|
-
**Please do not report security vulnerabilities through public GitHub issues.**
|
|
12
|
-
|
|
13
|
-
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
|
|
14
|
-
|
|
15
|
-
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
|
|
16
|
-
|
|
17
|
-
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
|
|
18
|
-
|
|
19
|
-
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
|
|
20
|
-
|
|
21
|
-
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
|
|
22
|
-
* Full paths of source file(s) related to the manifestation of the issue
|
|
23
|
-
* The location of the affected source code (tag/branch/commit or direct URL)
|
|
24
|
-
* Any special configuration required to reproduce the issue
|
|
25
|
-
* Step-by-step instructions to reproduce the issue
|
|
26
|
-
* Proof-of-concept or exploit code (if possible)
|
|
27
|
-
* Impact of the issue, including how an attacker might exploit the issue
|
|
28
|
-
|
|
29
|
-
This information will help us triage your report more quickly.
|
|
30
|
-
|
|
31
|
-
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
|
|
32
|
-
|
|
33
|
-
## Preferred Languages
|
|
34
|
-
|
|
35
|
-
We prefer all communications to be in English.
|
|
36
|
-
|
|
37
|
-
## Policy
|
|
38
|
-
|
|
39
|
-
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
|
|
40
|
-
|
|
41
|
-
<!-- END MICROSOFT SECURITY.MD BLOCK -->
|
package/SUPPORT.md
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
# TODO: The maintainer of this repo has not yet edited this file
|
|
2
|
-
|
|
3
|
-
**REPO OWNER**: Do you want Customer Service & Support (CSS) support for this product/project?
|
|
4
|
-
|
|
5
|
-
- **No CSS support:** Fill out this template with information about how to file issues and get help.
|
|
6
|
-
- **Yes CSS support:** Fill out an intake form at [aka.ms/onboardsupport](https://aka.ms/onboardsupport). CSS will work with/help you to determine next steps.
|
|
7
|
-
- **Not sure?** Fill out an intake as though the answer were "Yes". CSS will help you decide.
|
|
8
|
-
|
|
9
|
-
*Then remove this first heading from this SUPPORT.MD file before publishing your repo.*
|
|
10
|
-
|
|
11
|
-
# Support
|
|
12
|
-
|
|
13
|
-
## How to file issues and get help
|
|
14
|
-
|
|
15
|
-
This project uses GitHub Issues to track bugs and feature requests. Please search the existing
|
|
16
|
-
issues before filing new issues to avoid duplicates. For new issues, file your bug or
|
|
17
|
-
feature request as a new Issue.
|
|
18
|
-
|
|
19
|
-
For help and questions about using this project, please **REPO MAINTAINER: INSERT INSTRUCTIONS HERE
|
|
20
|
-
FOR HOW TO ENGAGE REPO OWNERS OR COMMUNITY FOR HELP. COULD BE A STACK OVERFLOW TAG OR OTHER
|
|
21
|
-
CHANNEL. WHERE WILL YOU HELP PEOPLE?**.
|
|
22
|
-
|
|
23
|
-
## Microsoft Support Policy
|
|
24
|
-
|
|
25
|
-
Support for this **PROJECT or PRODUCT** is limited to the resources listed above.
|
package/index.js
DELETED
|
File without changes
|