abledom 0.0.2 → 0.0.3
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/dist/esm/index.js +24 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/index.js +24 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -95,6 +95,13 @@ var alignbottomleft_default = '<svg width="20" height="20" viewBox="0 0 20 20" f
|
|
|
95
95
|
|
|
96
96
|
// src/ui/ui.ts
|
|
97
97
|
var pressedClass = "pressed";
|
|
98
|
+
function createTrustedHTML(win, html) {
|
|
99
|
+
var _a, _b;
|
|
100
|
+
const escapeHTMLPolicy = (_b = (_a = win.trustedTypes) == null ? void 0 : _a.createPolicy) == null ? void 0 : _b.call(_a, "forceInner", {
|
|
101
|
+
createHTML: (html2) => html2
|
|
102
|
+
});
|
|
103
|
+
return escapeHTMLPolicy ? escapeHTMLPolicy.createHTML(html) : html;
|
|
104
|
+
}
|
|
98
105
|
var _NotificationUI = class _NotificationUI {
|
|
99
106
|
constructor(win, rule) {
|
|
100
107
|
__publicField(this, "_win");
|
|
@@ -128,14 +135,17 @@ var _NotificationUI = class _NotificationUI {
|
|
|
128
135
|
const wrapper = this._wrapper;
|
|
129
136
|
const element = notification.element;
|
|
130
137
|
wrapper.__abledomui = true;
|
|
131
|
-
wrapper.innerHTML =
|
|
138
|
+
wrapper.innerHTML = createTrustedHTML(
|
|
139
|
+
win,
|
|
140
|
+
`
|
|
132
141
|
<div class="abledom-notification-container"><div class="abledom-notification${rule.type === 2 /* Warning */ ? " abledom-notification_warning" : rule.type === 3 /* Info */ ? " abledom-notification_info" : ""}">
|
|
133
142
|
<button class="button" title="Log to Console">${log_default}</button>
|
|
134
143
|
<button class="button" title="Reveal in Elements panel">${reveal_default}</button>
|
|
135
144
|
${notification.message}
|
|
136
145
|
<a href class="button close" href="/" title="Open help" target="_blank">${help_default}</a>
|
|
137
146
|
<button class="button close" class="close" title="Hide">${close_default}</button>
|
|
138
|
-
</div></div
|
|
147
|
+
</div></div>`
|
|
148
|
+
);
|
|
139
149
|
const container = wrapper.firstElementChild;
|
|
140
150
|
const buttons = wrapper.querySelectorAll("button");
|
|
141
151
|
const logButton = buttons[0];
|
|
@@ -204,6 +214,7 @@ __publicField(_NotificationUI, "_highlight");
|
|
|
204
214
|
var NotificationUI = _NotificationUI;
|
|
205
215
|
var NotificationsUI = class {
|
|
206
216
|
constructor(win) {
|
|
217
|
+
__publicField(this, "_win");
|
|
207
218
|
__publicField(this, "_container");
|
|
208
219
|
__publicField(this, "_notificationsContainer");
|
|
209
220
|
__publicField(this, "_menuElement");
|
|
@@ -217,16 +228,19 @@ var NotificationsUI = class {
|
|
|
217
228
|
__publicField(this, "_isMuted", false);
|
|
218
229
|
__publicField(this, "_notifications", /* @__PURE__ */ new Set());
|
|
219
230
|
var _a;
|
|
231
|
+
this._win = win;
|
|
220
232
|
const container = this._container = win.document.createElement("div");
|
|
221
233
|
container.__abledomui = true;
|
|
222
234
|
container.id = "abledom-report";
|
|
223
|
-
container.innerHTML = `<style>${ui_default}</style
|
|
235
|
+
container.innerHTML = createTrustedHTML(win, `<style>${ui_default}</style>`);
|
|
224
236
|
const notificationsContainer = this._notificationsContainer = win.document.createElement("div");
|
|
225
237
|
notificationsContainer.className = "abledom-notifications-container";
|
|
226
238
|
container.appendChild(notificationsContainer);
|
|
227
239
|
const menuElement = this._menuElement = win.document.createElement("div");
|
|
228
240
|
menuElement.className = "abledom-menu-container";
|
|
229
|
-
menuElement.innerHTML =
|
|
241
|
+
menuElement.innerHTML = createTrustedHTML(
|
|
242
|
+
win,
|
|
243
|
+
`<div class="abledom-menu"><span class="notifications-count"></span
|
|
230
244
|
><button class="button" title="Show all notifications">${showall_default}</button
|
|
231
245
|
><button class="button" title="Hide all notifications">${hideall_default}</button
|
|
232
246
|
><button class="button" title="Mute newly appearing notifications">${muteall_default}</button
|
|
@@ -234,7 +248,8 @@ var NotificationsUI = class {
|
|
|
234
248
|
><button class="button align-button" title="Attach notifications to top left">${aligntopleft_default}</button
|
|
235
249
|
><button class="button align-button" title="Attach notifications to top right">${aligntopright_default}</button
|
|
236
250
|
><button class="button align-button align-button-last" title="Attach notifications to bottom right">${alignbottomright_default}</button
|
|
237
|
-
></div
|
|
251
|
+
></div>`
|
|
252
|
+
);
|
|
238
253
|
const [
|
|
239
254
|
notificationCountElement,
|
|
240
255
|
showAllButton,
|
|
@@ -332,7 +347,10 @@ var NotificationsUI = class {
|
|
|
332
347
|
_setNotificationsCount(count) {
|
|
333
348
|
const countElement = this._notificationCountElement;
|
|
334
349
|
if (countElement && count > 0) {
|
|
335
|
-
countElement.innerHTML =
|
|
350
|
+
countElement.innerHTML = createTrustedHTML(
|
|
351
|
+
this._win,
|
|
352
|
+
`<strong>${count}</strong> notification${count > 1 ? "s" : ""}`
|
|
353
|
+
);
|
|
336
354
|
this._menuElement.style.display = "block";
|
|
337
355
|
} else {
|
|
338
356
|
this._menuElement.style.display = "none";
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/rules/base.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","inline-file:/Users/marata/Documents/Work/abledom/src/ui/hideall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/muteall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/showall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/aligntopleft.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/aligntopright.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/alignbottomright.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/alignbottomleft.svg","../../src/ui/ui.ts","../../src/utils.ts","../../src/core.ts","../../src/rules/atomic.ts","../../src/rules/label.ts","../../src/rules/existingid.ts","../../src/rules/focuslost.ts","../../src/rules/badfocus.ts","../../src/rules/find.ts","../../src/rules/notify.ts"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport enum ValidationRuleType {\n Error = 1,\n Warning,\n Info,\n}\n\nexport interface ValidationNotification {\n id: string;\n message: string;\n element?: HTMLElement;\n rel?: Node;\n link?: string;\n stack?: string[];\n relStack?: string[];\n}\n\nexport interface ValidationResult {\n notification?: ValidationNotification;\n dependsOnIds?: Set<string>;\n}\n\nexport interface BlurNotification extends ValidationNotification {\n position?: string[];\n}\n\nexport abstract class ValidationRule<\n N extends ValidationNotification = ValidationNotification,\n> {\n abstract type: ValidationRuleType;\n abstract name: string;\n private _window?: Window;\n private _exceptions: ((element: HTMLElement) => boolean)[] = [];\n private _onNotification:\n | ((rult: ValidationRule<N>, notification: N) => void)\n | undefined;\n\n static init(\n instance: ValidationRule,\n window: Window,\n onNotification: (\n rule: ValidationRule,\n notification: ValidationNotification,\n ) => void,\n ): void {\n instance._window = window;\n instance._onNotification = onNotification;\n }\n\n static dispose(instance: ValidationRule): void {\n instance.dispose();\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 private dispose(): void {\n this._window = undefined;\n this._onNotification = undefined;\n this._exceptions = [];\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 notify(notification: N): void {\n this._onNotification?.(this, notification);\n }\n\n focused?(event: FocusEvent): ValidationNotification | null;\n blurred?(event: FocusEvent): BlurNotification | null;\n}\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-report :focus-visible {\\n outline: 3px solid red;\\n mix-blend-mode: difference;\\n}\\n\\n#abledom-report.abledom-align-left {\\n left: 10px;\\n right: auto;\\n}\\n\\n#abledom-report.abledom-align-right {\\n left: auto;\\n right: 10px;\\n}\\n\\n#abledom-report.abledom-align-bottom {\\n bottom: 20px;\\n top: auto;\\n}\\n\\n#abledom-report.abledom-align-top {\\n /* flex-direction: column-reverse; */\\n bottom: auto;\\n top: 10px;\\n}\\n\\n.abledom-menu-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-block;\\n margin: 2px auto 2px 0;\\n}\\n\\n#abledom-report.abledom-align-right .abledom-menu-container {\\n margin: 2px 0 2px auto;\\n}\\n\\n.abledom-menu {\\n background-color: rgba(140, 10, 121, 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-menu .notifications-count {\\n margin: 0 8px;\\n display: inline-block;\\n}\\n\\n.abledom-menu .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-menu .align-button {\\n border-right-color: rgba(0, 0, 0, 0.4);\\n border-radius: 0;\\n margin: 0;\\n}\\n\\n.abledom-menu .align-button:active,\\n#abledom-report .pressed {\\n background: linear-gradient(\\n 180deg,\\n rgba(130, 130, 130, 1) 0%,\\n rgba(180, 180, 180, 1) 100%\\n );\\n}\\n\\n.abledom-menu .align-button-first {\\n border-top-left-radius: 6px;\\n border-bottom-left-radius: 6px;\\n margin-left: 8px;\\n}\\n.abledom-menu .align-button-last {\\n border-top-right-radius: 6px;\\n border-bottom-right-radius: 6px;\\n border-right-color: rgba(255, 255, 255, 0.4);\\n}\\n\\n.abledom-notifications-container {\\n overflow: scroll;\\n max-height: calc(100vh - 100px);\\n}\\n\\n#abledom-report.abledom-align-right .abledom-notifications-container {\\n text-align: right;\\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.abledom-notification_warning {\\n background-color: rgba(163, 82, 1, 0.7);\\n}\\n.abledom-notification_info {\\n background-color: rgba(0, 0, 255, 0.7);\\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>\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"1.67\\\" y1=\\\"1.67\\\" x2=\\\"18.33\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"1.67\\\" y1=\\\"1.67\\\" x2=\\\"18.33\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"18.33\\\" y1=\\\"1.67\\\" x2=\\\"1.67\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"3\\\" y=\\\"3\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"11\\\" y=\\\"3\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"11\\\" y=\\\"11\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"3\\\" y=\\\"11\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","/*!\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 {\n ValidationNotification,\n ValidationRule,\n ValidationRuleType,\n} 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\n// @ts-expect-error parsed assets\nimport svgHideAll from \"./hideall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgMuteAll from \"./muteall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgShowAll from \"./showall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignTopLeft from \"./aligntopleft.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignTopRight from \"./aligntopright.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignBottomRight from \"./alignbottomright.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignBottomLeft from \"./alignbottomleft.svg?raw\";\n\nenum UIAlignments {\n BottomLeft = \"bottom-left\",\n BottomRight = \"bottom-right\",\n TopLeft = \"top-left\",\n TopRight = \"top-right\",\n}\n\nconst pressedClass = \"pressed\";\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 _notificationsUI: NotificationsUI | undefined;\n\n static setOnToggle(\n instance: NotificationUI,\n onToggle: (notificationUI: NotificationUI, show: boolean) => void,\n ) {\n instance._onToggle = onToggle;\n }\n\n private static _highlight: ElementHighlighter;\n\n private _win: Window;\n private _wrapper: HTMLElementWithAbleDOMUIFlag;\n private _rule: ValidationRule;\n private _onToggle:\n | ((notificationUI: NotificationUI, show: boolean) => void)\n | undefined;\n\n static getElement(instance: NotificationUI): HTMLElement {\n return instance._wrapper;\n }\n\n isHidden = false;\n\n constructor(win: Window, rule: ValidationRule) {\n this._win = win;\n this._rule = rule;\n\n if (!NotificationUI._notificationsUI) {\n NotificationUI._notificationsUI = new NotificationsUI(this._win);\n }\n\n this._wrapper = win.document.createElement(\n \"div\",\n ) as HTMLElementWithAbleDOMUIFlag;\n\n if (!NotificationUI._highlight) {\n NotificationUI._highlight = new ElementHighlighter(win);\n }\n\n NotificationUI._notificationsUI.addNotification(this);\n }\n\n update(notification: ValidationNotification): void {\n const win = this._win;\n const rule = this._rule;\n const wrapper = this._wrapper;\n const element = notification.element;\n\n wrapper.__abledomui = true;\n\n wrapper.innerHTML = `\n <div class=\"abledom-notification-container\"><div class=\"abledom-notification${\n rule.type === ValidationRuleType.Warning\n ? \" abledom-notification_warning\"\n : rule.type === ValidationRuleType.Info\n ? \" abledom-notification_info\"\n : \"\"\n }\">\n <button class=\"button\" title=\"Log to Console\">${svgLog}</button>\n <button class=\"button\" title=\"Reveal in Elements panel\">${svgReveal}</button>\n ${notification.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: \",\n \"\\nmessage:\",\n notification.message,\n \"\\nelement:\",\n element,\n ...(notification.rel ? [\"\\nrelative:\", notification.rel] : []),\n \"\\nnotification:\",\n notification,\n );\n };\n\n const hasDevTools =\n !!(win as WindowWithAbleDOMDevtools).__ableDOMDevtools?.revealElement &&\n false; // Temtorarily disabling the devtools plugin integration.\n\n if (hasDevTools && element && 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 this.toggle(false);\n NotificationUI._highlight?.hide();\n };\n\n container.onmouseover = () => {\n element && NotificationUI._highlight?.highlight(element);\n };\n\n container.onmouseout = () => {\n NotificationUI._highlight?.hide();\n };\n }\n\n toggle(show: boolean, initial = false) {\n this.isHidden = !show;\n\n if (!initial) {\n this._onToggle?.(this, show);\n\n if (!this._rule.anchored && !show) {\n this.dispose();\n }\n }\n\n this._wrapper.style.display = show ? \"block\" : \"none\";\n }\n\n dispose() {\n this._wrapper.remove();\n NotificationUI._notificationsUI?.removeNotification(this);\n }\n}\n\nexport class NotificationsUI {\n private _container: HTMLElement;\n private _notificationsContainer: HTMLElement;\n private _menuElement: HTMLElement;\n private _notificationCountElement: HTMLSpanElement | undefined;\n private _showAllButton: HTMLButtonElement | undefined;\n private _hideAllButton: HTMLButtonElement | undefined;\n private _alignBottomLeftButton: HTMLButtonElement | undefined;\n private _alignTopLeftButton: HTMLButtonElement | undefined;\n private _alignTopRightButton: HTMLButtonElement | undefined;\n private _alignBottomRightButton: HTMLButtonElement | undefined;\n\n private _isMuted = false;\n private _notifications: Set<NotificationUI> = new Set();\n\n constructor(win: Window) {\n const container = (this._container =\n win.document.createElement(\"div\")) as HTMLElementWithAbleDOMUIFlag;\n container.__abledomui = true;\n container.id = \"abledom-report\";\n container.innerHTML = `<style>${css}</style>`;\n\n const notificationsContainer = (this._notificationsContainer =\n win.document.createElement(\"div\")) as HTMLDivElement;\n notificationsContainer.className = \"abledom-notifications-container\";\n container.appendChild(notificationsContainer);\n\n const menuElement = (this._menuElement =\n win.document.createElement(\"div\")) as HTMLDivElement;\n\n menuElement.className = \"abledom-menu-container\";\n menuElement.innerHTML = `<div class=\"abledom-menu\"><span class=\"notifications-count\"></span\n ><button class=\"button\" title=\"Show all notifications\">${svgShowAll}</button\n ><button class=\"button\" title=\"Hide all notifications\">${svgHideAll}</button\n ><button class=\"button\" title=\"Mute newly appearing notifications\">${svgMuteAll}</button\n ><button class=\"button align-button align-button-first pressed\" title=\"Attach notifications to bottom left\">${svgAlignBottomLeft}</button\n ><button class=\"button align-button\" title=\"Attach notifications to top left\">${svgAlignTopLeft}</button\n ><button class=\"button align-button\" title=\"Attach notifications to top right\">${svgAlignTopRight}</button\n ><button class=\"button align-button align-button-last\" title=\"Attach notifications to bottom right\">${svgAlignBottomRight}</button\n ></div>`;\n\n // Make sure the string HTML above unpacks properly to the assignment below.\n const [\n notificationCountElement,\n showAllButton,\n hideAllButton,\n muteButton,\n alignBottomLeftButton,\n alignTopLeftButton,\n alignTopRightButton,\n alignBottomRightButton,\n ] = menuElement.firstElementChild?.childNodes || [];\n\n if (\n notificationCountElement instanceof HTMLSpanElement &&\n showAllButton instanceof HTMLButtonElement &&\n hideAllButton instanceof HTMLButtonElement &&\n muteButton instanceof HTMLButtonElement &&\n alignBottomLeftButton instanceof HTMLButtonElement &&\n alignTopLeftButton instanceof HTMLButtonElement &&\n alignTopRightButton instanceof HTMLButtonElement &&\n alignBottomRightButton instanceof HTMLButtonElement\n ) {\n container.appendChild(menuElement);\n\n this._notificationCountElement = notificationCountElement;\n this._showAllButton = showAllButton;\n this._hideAllButton = hideAllButton;\n this._alignBottomLeftButton = alignBottomLeftButton;\n this._alignTopLeftButton = alignTopLeftButton;\n this._alignTopRightButton = alignTopRightButton;\n this._alignBottomRightButton = alignBottomRightButton;\n\n showAllButton.onclick = () => {\n this.showAll();\n };\n hideAllButton.onclick = () => {\n this.hideAll();\n };\n muteButton.onclick = () => {\n const isMuted = (this._isMuted =\n muteButton.classList.toggle(pressedClass));\n\n if (isMuted) {\n muteButton.setAttribute(\n \"title\",\n \"Unmute newly appearing notifications\",\n );\n } else {\n muteButton.setAttribute(\n \"title\",\n \"Mute newly appearing notifications\",\n );\n }\n };\n\n alignBottomLeftButton.onclick = () => {\n this.setUIAlignment(UIAlignments.BottomLeft);\n };\n alignBottomRightButton.onclick = () => {\n this.setUIAlignment(UIAlignments.BottomRight);\n };\n alignTopLeftButton.onclick = () => {\n this.setUIAlignment(UIAlignments.TopLeft);\n };\n alignTopRightButton.onclick = () => {\n this.setUIAlignment(UIAlignments.TopRight);\n };\n }\n\n win.document.body.appendChild(container);\n }\n\n private setUIAlignment(alignment: UIAlignments) {\n this._alignBottomLeftButton?.classList.remove(pressedClass);\n this._alignBottomRightButton?.classList.remove(pressedClass);\n this._alignTopLeftButton?.classList.remove(pressedClass);\n this._alignTopRightButton?.classList.remove(pressedClass);\n\n this._container.classList.remove(\n \"abledom-align-left\",\n \"abledom-align-right\",\n \"abledom-align-top\",\n \"abledom-align-bottom\",\n );\n let containerClasses: string[] = [];\n let notificationsFirst = false;\n\n switch (alignment) {\n case UIAlignments.BottomLeft:\n containerClasses = [\"abledom-align-left\", \"abledom-align-bottom\"];\n notificationsFirst = true;\n this._alignBottomLeftButton?.classList.add(pressedClass);\n break;\n case UIAlignments.BottomRight:\n containerClasses = [\"abledom-align-right\", \"abledom-align-bottom\"];\n notificationsFirst = true;\n this._alignBottomRightButton?.classList.add(pressedClass);\n break;\n case UIAlignments.TopLeft:\n containerClasses = [\"abledom-align-left\", \"abledom-align-top\"];\n this._alignTopLeftButton?.classList.add(pressedClass);\n break;\n case UIAlignments.TopRight:\n containerClasses = [\"abledom-align-right\", \"abledom-align-top\"];\n this._alignTopRightButton?.classList.add(pressedClass);\n break;\n }\n\n this._container.classList.add(...containerClasses);\n this._container.insertBefore(\n this._notificationsContainer,\n notificationsFirst ? this._menuElement : null,\n );\n }\n\n private _setNotificationsCount(count: number) {\n const countElement = this._notificationCountElement;\n\n if (countElement && count > 0) {\n countElement.innerHTML = `<strong>${count}</strong> notification${count > 1 ? \"s\" : \"\"}`;\n this._menuElement.style.display = \"block\";\n } else {\n this._menuElement.style.display = \"none\";\n }\n }\n\n private _setShowHideButtonsVisibility() {\n const showAllButton = this._showAllButton;\n const hideAllButton = this._hideAllButton;\n\n if (!showAllButton || !hideAllButton) {\n return;\n }\n\n let allHidden = true;\n let allVisible = true;\n\n for (let notification of this._notifications) {\n if (notification.isHidden) {\n allVisible = false;\n } else {\n allHidden = false;\n }\n\n if (!allHidden && !allVisible) {\n break;\n }\n }\n\n hideAllButton.style.display = allHidden ? \"none\" : \"block\";\n showAllButton.style.display = allVisible ? \"none\" : \"block\";\n }\n\n addNotification(notification: NotificationUI) {\n if (this._notifications.has(notification)) {\n return;\n }\n\n if (this._isMuted) {\n notification.toggle(false, true);\n }\n\n this._notifications.add(notification);\n this._notificationsContainer.appendChild(\n NotificationUI.getElement(notification),\n );\n\n NotificationUI.setOnToggle(notification, () => {\n this._setShowHideButtonsVisibility();\n });\n\n this._setNotificationsCount(this._notifications.size);\n this._setShowHideButtonsVisibility();\n }\n\n removeNotification(notification: NotificationUI) {\n if (!this._notifications.has(notification)) {\n return;\n }\n\n this._notifications.delete(notification);\n\n this._setNotificationsCount(this._notifications.size);\n this._setShowHideButtonsVisibility();\n }\n\n hideAll() {\n this._notifications.forEach((notification) => {\n notification.toggle(false);\n });\n this._setShowHideButtonsVisibility();\n }\n\n showAll() {\n this._notifications.forEach((notification) => {\n notification.toggle(true);\n });\n this._setShowHideButtonsVisibility();\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\nimport {\n NotificationUI,\n HTMLElementWithAbleDOMUIFlag,\n isAbleDOMUIElement,\n} from \"./ui/ui\";\nimport { isAccessibilityAffectingElement } from \"./utils\";\nimport { ValidationRule, ValidationNotification } from \"./rules/base\";\n\n// class ValidationNotificationUI {\n// static _notificationsUI: NotificationsUI | undefined;\n\n// private _win: Window;\n// private _notification: NotificationUI | undefined;\n// // private _onHide: (() => void) | undefined;\n\n// constructor(\n// win: Window,\n// public error: ValidationNotification,\n// public type: ValidationRuleType,\n// // onHide?: () => void,\n// ) {\n// this._win = win;\n// // this._onHide = onHide;\n// this.report();\n// }\n\n// update(error: ValidationNotification, type: ValidationRuleType): void {\n// this.type = type;\n// this.error = error;\n// this.report();\n// }\n\n// report(): void {\n// if (!ValidationNotificationUI._notificationsUI) {\n// ValidationNotificationUI._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._win,\n// this.error,\n// this.type,\n// );\n// }\n\n// ValidationNotificationUI._notificationsUI.addNotification(notification);\n\n// const element = this.error.element as HTMLElementWithAbleDOMUIFlag;\n\n// if (element) {\n// const keyArray: IExceptionPathPart[] = [];\n\n// for (let el: HTMLElement | null = element; el; el = el.parentElement) {\n// keyArray.unshift({tagName: el.tagName});\n// }\n\n// console.error('AbleDOM path', this.error.id, this.error.element, keyArray);\n// }\n// }\n\n// toggle(show: boolean): void {\n// this._notification?.toggle(show);\n// }\n\n// remove(): void {\n// if (this._notification) {\n// ValidationNotificationUI._notificationsUI?.removeNotification(\n// this._notification,\n// );\n// delete this._notification;\n// }\n// }\n// }\n\ninterface HTMLElementWithAbleDOM extends HTMLElement {\n __abledom?: {\n notifications?: Map<ValidationRule, NotificationUI>;\n };\n}\n\nexport class AbleDOM {\n private _win: Window;\n private _observer: MutationObserver;\n private _clearValidationTimeout: (() => void) | undefined;\n private _elementsWithNotifications: 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._win = 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, _elementsToRemove.has(node as HTMLElementWithAbleDOM));\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 _addNotification(\n rule: ValidationRule,\n notification: ValidationNotification,\n ) {\n const element = notification?.element as HTMLElementWithAbleDOM | undefined;\n\n if (!notification) {\n this._removeNotification(element || this._win.document.body, rule);\n return;\n }\n\n let notificationUI: NotificationUI | undefined;\n\n if (rule.anchored && element) {\n let abledomOnElement = element.__abledom;\n\n if (!abledomOnElement) {\n abledomOnElement = element.__abledom = {};\n }\n\n let notifications = abledomOnElement.notifications;\n\n if (!notifications) {\n notifications = abledomOnElement.notifications = new Map();\n }\n\n notificationUI = notifications.get(rule);\n\n if (!notificationUI) {\n notificationUI = new NotificationUI(this._win, rule);\n notifications.set(rule, notificationUI);\n }\n\n this._elementsWithNotifications.add(element);\n } else {\n notificationUI = new NotificationUI(this._win, rule);\n }\n\n notificationUI.update(notification);\n }\n\n private _removeNotification(\n element: HTMLElementWithAbleDOM,\n rule: ValidationRule,\n ) {\n if (!rule.anchored) {\n return;\n }\n\n const notifications = element.__abledom?.notifications;\n\n if (!notifications) {\n return;\n }\n\n const notification = notifications.get(rule);\n\n if (notification) {\n notification.dispose();\n notifications.delete(rule);\n }\n\n if (notifications.size === 0) {\n this._elementsWithNotifications.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?.notifications\n ) {\n const dependsOnIds = new Set<string>();\n\n for (const rule of this._rules) {\n if (!rule.validate || 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?.notification) {\n this._addNotification(rule, validationResult.notification);\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?.notifications?.has(rule)) {\n this._removeNotification(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?.notifications?.keys() || [])];\n rules.forEach((rule) => this._removeNotification(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 const focusNotification = rule.focused?.(event);\n\n if (focusNotification) {\n this._addNotification(rule, focusNotification);\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 const blurNotification = rule.blurred?.(event);\n\n if (blurNotification) {\n this._addNotification(rule, blurNotification);\n }\n }\n };\n\n private _notifyAsync = (\n rule: ValidationRule,\n notification: ValidationNotification,\n ): void => {\n this._addNotification(rule, notification);\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.init(rule, this._win, this._notifyAsync);\n rule.start?.();\n }\n\n this._startFunc?.();\n }\n\n dispose() {\n this._win.document.addEventListener(\"focusin\", this._onFocusIn, true);\n this._win.document.addEventListener(\"focusout\", this._onFocusOut, true);\n\n this._remove(this._elementsWithNotifications);\n this._elementsWithNotifications.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 ValidationRule.dispose(rule);\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, ValidationRuleType } from \"./base\";\n\nexport class AtomicRule extends ValidationRule {\n type = ValidationRuleType.Error;\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 notification: {\n id: \"focusable-in-atomic\",\n message: \"Focusable element inside atomic focusable.\",\n element,\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, ValidationRuleType } 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 type = ValidationRuleType.Error;\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 notification: isElementVisible(element)\n ? {\n id: \"focusable-element-label\",\n message: \"Focusable element must have a non-empty text label.\",\n element,\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, ValidationRuleType } from \"./base\";\n\nexport class ExistingIdRule extends ValidationRule {\n type = ValidationRuleType.Error;\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 notification: {\n id: \"missing-id\",\n message: `Elements with referenced ids do not extist.`,\n element,\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 { BlurNotification, ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class FocusLostRule extends ValidationRule<BlurNotification> {\n type = ValidationRuleType.Error;\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 private _mouseEventTimer: number | undefined;\n private _releaseMouseEvent: (() => void) | 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 focused(event: FocusEvent): 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 blurred(event: FocusEvent): 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 || this._mouseEventTimer) {\n return null;\n }\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 const focusLostTimer = win.setTimeout(() => {\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 this.notify({\n element: target,\n id: \"focus-lost\",\n message: \"Focus lost.\",\n stack: this._lastBlurStack,\n relStack: this._lastFocusStack,\n position: targetPosition || [],\n });\n }\n }, this._focusLostTimeout);\n\n this._clearScheduledFocusLost = () => {\n delete this._clearScheduledFocusLost;\n win.clearTimeout(focusLostTimer);\n };\n\n return null;\n }\n\n start(): void {\n const win = this.window;\n\n if (!win) {\n return;\n }\n\n const onMouseEvent = () => {\n if (!this._mouseEventTimer) {\n this._mouseEventTimer = win.setTimeout(() => {\n this._mouseEventTimer = undefined;\n }, 0);\n }\n };\n\n win.addEventListener(\"mousedown\", onMouseEvent, true);\n win.addEventListener(\"mouseup\", onMouseEvent, true);\n win.addEventListener(\"mousemove\", onMouseEvent, true);\n\n this._releaseMouseEvent = () => {\n delete this._releaseMouseEvent;\n\n if (this._mouseEventTimer) {\n win.clearTimeout(this._mouseEventTimer);\n delete this._mouseEventTimer;\n }\n\n win.removeEventListener(\"mousedown\", onMouseEvent, true);\n win.removeEventListener(\"mouseup\", onMouseEvent, true);\n win.removeEventListener(\"mousemove\", onMouseEvent, true);\n };\n }\n\n stop(): void {\n this._releaseMouseEvent?.();\n this._clearScheduledFocusLost?.();\n this._focusedElement = undefined;\n this._focusedElementPosition = undefined;\n this._lastFocusStack = undefined;\n this._lastBlurStack = undefined;\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 { ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class BadFocusRule extends ValidationRule {\n type = ValidationRuleType.Error;\n name = \"bad-focus\";\n anchored = false;\n\n private _lastFocusStack: string[] | undefined;\n private _lastBlurStack: string[] | undefined;\n private _clearCheckTimer: (() => void) | undefined;\n\n focused(): null {\n this._lastFocusStack = getStackTrace();\n return null;\n }\n\n blurred(): null {\n const win = this.window;\n\n if (!win) {\n return null;\n }\n\n this._lastBlurStack = getStackTrace();\n\n this._clearCheckTimer?.();\n\n const checkTimer = win.setTimeout(() => {\n delete this._clearCheckTimer;\n\n if (\n document.activeElement &&\n !isElementVisible(document.activeElement as HTMLElement)\n ) {\n this.notify({\n id: \"bad-focus\",\n message: \"Focused stolen by invisible element.\",\n element: document.activeElement as HTMLElement,\n stack: this._lastBlurStack,\n relStack: this._lastFocusStack,\n });\n }\n }, 100);\n\n this._clearCheckTimer = () => {\n delete this._clearCheckTimer;\n win.clearTimeout(checkTimer);\n };\n\n return null;\n }\n\n stop(): void {\n this._clearCheckTimer?.();\n this._clearCheckTimer = undefined;\n this._lastFocusStack = undefined;\n this._lastBlurStack = undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { ValidationRule, ValidationResult, ValidationRuleType } from \"./base\";\n\nexport class FindElementRule extends ValidationRule {\n type = ValidationRuleType.Warning;\n name = \"find-element\";\n anchored = true;\n\n private _conditions: { [name: string]: (element: HTMLElement) => boolean } =\n {};\n\n addCondition(\n name: string,\n condition: (element: HTMLElement) => boolean,\n ): void {\n this._conditions[name] = condition;\n }\n\n removeCondition(name: string): void {\n delete this._conditions[name];\n }\n\n validate(element: HTMLElement): ValidationResult | null {\n for (const name of Object.keys(this._conditions)) {\n if (this._conditions[name](element)) {\n return {\n notification: {\n id: \"find-element\",\n message: `Element found: ${name}.`,\n element,\n },\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 */\nimport { ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class CustomNotifyRule extends ValidationRule {\n type = ValidationRuleType.Info;\n name = \"custom-notify\";\n anchored = false;\n\n customNotify(message: string, element?: HTMLElement): void {\n this.notify({\n id: \"custom-notify\",\n message,\n element,\n });\n }\n}\n"],"mappings":";;;;;AAKO,IAAK,qBAAL,kBAAKA,wBAAL;AACL,EAAAA,wCAAA,WAAQ,KAAR;AACA,EAAAA,wCAAA;AACA,EAAAA,wCAAA;AAHU,SAAAA;AAAA,GAAA;AAyBL,IAAe,iBAAf,MAEL;AAAA,EAFK;AAKL,wBAAQ;AACR,wBAAQ,eAAqD,CAAC;AAC9D,wBAAQ;AAAA;AAAA,EAIR,OAAO,KACL,UACA,QACA,gBAIM;AACN,aAAS,UAAU;AACnB,aAAS,kBAAkB;AAAA,EAC7B;AAAA,EAEA,OAAO,QAAQ,UAAgC;AAC7C,aAAS,QAAQ;AAAA,EACnB;AAAA,EAEA,OAAO,gBACL,UACA,SACS;AACT,eAAW,aAAa,SAAS,aAAa;AAC5C,UAAI,UAAU,OAAO,GAAG;AACtB,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WAAO;AAAA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AAAA;AACL;AACA,gCAAO;AACP,oCAAW;AAAA;AAAA,EAEX,aAAa,SAAiB,SAA6B;AACzD,SAAK,OAAO;AAAA,MACV,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":["ValidationRuleType","_a","node","rule"]}
|
|
1
|
+
{"version":3,"sources":["../../src/rules/base.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","inline-file:/Users/marata/Documents/Work/abledom/src/ui/hideall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/muteall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/showall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/aligntopleft.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/aligntopright.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/alignbottomright.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/alignbottomleft.svg","../../src/ui/ui.ts","../../src/utils.ts","../../src/core.ts","../../src/rules/atomic.ts","../../src/rules/label.ts","../../src/rules/existingid.ts","../../src/rules/focuslost.ts","../../src/rules/badfocus.ts","../../src/rules/find.ts","../../src/rules/notify.ts"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport enum ValidationRuleType {\n Error = 1,\n Warning,\n Info,\n}\n\nexport interface ValidationNotification {\n id: string;\n message: string;\n element?: HTMLElement;\n rel?: Node;\n link?: string;\n stack?: string[];\n relStack?: string[];\n}\n\nexport interface ValidationResult {\n notification?: ValidationNotification;\n dependsOnIds?: Set<string>;\n}\n\nexport interface BlurNotification extends ValidationNotification {\n position?: string[];\n}\n\nexport abstract class ValidationRule<\n N extends ValidationNotification = ValidationNotification,\n> {\n abstract type: ValidationRuleType;\n abstract name: string;\n private _window?: Window;\n private _exceptions: ((element: HTMLElement) => boolean)[] = [];\n private _onNotification:\n | ((rult: ValidationRule<N>, notification: N) => void)\n | undefined;\n\n static init(\n instance: ValidationRule,\n window: Window,\n onNotification: (\n rule: ValidationRule,\n notification: ValidationNotification,\n ) => void,\n ): void {\n instance._window = window;\n instance._onNotification = onNotification;\n }\n\n static dispose(instance: ValidationRule): void {\n instance.dispose();\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 private dispose(): void {\n this._window = undefined;\n this._onNotification = undefined;\n this._exceptions = [];\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 notify(notification: N): void {\n this._onNotification?.(this, notification);\n }\n\n focused?(event: FocusEvent): ValidationNotification | null;\n blurred?(event: FocusEvent): BlurNotification | null;\n}\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-report :focus-visible {\\n outline: 3px solid red;\\n mix-blend-mode: difference;\\n}\\n\\n#abledom-report.abledom-align-left {\\n left: 10px;\\n right: auto;\\n}\\n\\n#abledom-report.abledom-align-right {\\n left: auto;\\n right: 10px;\\n}\\n\\n#abledom-report.abledom-align-bottom {\\n bottom: 20px;\\n top: auto;\\n}\\n\\n#abledom-report.abledom-align-top {\\n /* flex-direction: column-reverse; */\\n bottom: auto;\\n top: 10px;\\n}\\n\\n.abledom-menu-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-block;\\n margin: 2px auto 2px 0;\\n}\\n\\n#abledom-report.abledom-align-right .abledom-menu-container {\\n margin: 2px 0 2px auto;\\n}\\n\\n.abledom-menu {\\n background-color: rgba(140, 10, 121, 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-menu .notifications-count {\\n margin: 0 8px;\\n display: inline-block;\\n}\\n\\n.abledom-menu .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-menu .align-button {\\n border-right-color: rgba(0, 0, 0, 0.4);\\n border-radius: 0;\\n margin: 0;\\n}\\n\\n.abledom-menu .align-button:active,\\n#abledom-report .pressed {\\n background: linear-gradient(\\n 180deg,\\n rgba(130, 130, 130, 1) 0%,\\n rgba(180, 180, 180, 1) 100%\\n );\\n}\\n\\n.abledom-menu .align-button-first {\\n border-top-left-radius: 6px;\\n border-bottom-left-radius: 6px;\\n margin-left: 8px;\\n}\\n.abledom-menu .align-button-last {\\n border-top-right-radius: 6px;\\n border-bottom-right-radius: 6px;\\n border-right-color: rgba(255, 255, 255, 0.4);\\n}\\n\\n.abledom-notifications-container {\\n overflow: scroll;\\n max-height: calc(100vh - 100px);\\n}\\n\\n#abledom-report.abledom-align-right .abledom-notifications-container {\\n text-align: right;\\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.abledom-notification_warning {\\n background-color: rgba(163, 82, 1, 0.7);\\n}\\n.abledom-notification_info {\\n background-color: rgba(0, 0, 255, 0.7);\\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>\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"1.67\\\" y1=\\\"1.67\\\" x2=\\\"18.33\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"1.67\\\" y1=\\\"1.67\\\" x2=\\\"18.33\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"18.33\\\" y1=\\\"1.67\\\" x2=\\\"1.67\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"3\\\" y=\\\"3\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"11\\\" y=\\\"3\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"11\\\" y=\\\"11\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"3\\\" y=\\\"11\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","/*!\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 {\n ValidationNotification,\n ValidationRule,\n ValidationRuleType,\n} 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\n// @ts-expect-error parsed assets\nimport svgHideAll from \"./hideall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgMuteAll from \"./muteall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgShowAll from \"./showall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignTopLeft from \"./aligntopleft.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignTopRight from \"./aligntopright.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignBottomRight from \"./alignbottomright.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignBottomLeft from \"./alignbottomleft.svg?raw\";\n\nenum UIAlignments {\n BottomLeft = \"bottom-left\",\n BottomRight = \"bottom-right\",\n TopLeft = \"top-left\",\n TopRight = \"top-right\",\n}\n\nconst pressedClass = \"pressed\";\n\ninterface WindowWithAbleDOMDevtools extends Window {\n __ableDOMDevtools?: {\n revealElement?: (element: HTMLElement) => Promise<boolean>;\n };\n}\n\n// TODO: Adjust the types once the Trusted Types typings are available in the DOM lib.\ninterface WindowWithTrustedTypes extends Window {\n trustedTypes?: {\n createPolicy?: (\n name: string,\n policy: { createHTML: (html: string) => string },\n ) => {\n createHTML: (html: string) => string;\n };\n };\n}\n\nfunction createTrustedHTML(win: WindowWithTrustedTypes, html: string): string {\n const escapeHTMLPolicy = win.trustedTypes?.createPolicy?.(\"forceInner\", {\n createHTML: (html: string) => html,\n });\n\n return escapeHTMLPolicy ? escapeHTMLPolicy.createHTML(html) : html;\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 _notificationsUI: NotificationsUI | undefined;\n\n static setOnToggle(\n instance: NotificationUI,\n onToggle: (notificationUI: NotificationUI, show: boolean) => void,\n ) {\n instance._onToggle = onToggle;\n }\n\n private static _highlight: ElementHighlighter;\n\n private _win: Window;\n private _wrapper: HTMLElementWithAbleDOMUIFlag;\n private _rule: ValidationRule;\n private _onToggle:\n | ((notificationUI: NotificationUI, show: boolean) => void)\n | undefined;\n\n static getElement(instance: NotificationUI): HTMLElement {\n return instance._wrapper;\n }\n\n isHidden = false;\n\n constructor(win: Window, rule: ValidationRule) {\n this._win = win;\n this._rule = rule;\n\n if (!NotificationUI._notificationsUI) {\n NotificationUI._notificationsUI = new NotificationsUI(this._win);\n }\n\n this._wrapper = win.document.createElement(\n \"div\",\n ) as HTMLElementWithAbleDOMUIFlag;\n\n if (!NotificationUI._highlight) {\n NotificationUI._highlight = new ElementHighlighter(win);\n }\n\n NotificationUI._notificationsUI.addNotification(this);\n }\n\n update(notification: ValidationNotification): void {\n const win = this._win;\n const rule = this._rule;\n const wrapper = this._wrapper;\n const element = notification.element;\n\n wrapper.__abledomui = true;\n\n wrapper.innerHTML = createTrustedHTML(\n win,\n `\n <div class=\"abledom-notification-container\"><div class=\"abledom-notification${\n rule.type === ValidationRuleType.Warning\n ? \" abledom-notification_warning\"\n : rule.type === ValidationRuleType.Info\n ? \" abledom-notification_info\"\n : \"\"\n }\">\n <button class=\"button\" title=\"Log to Console\">${svgLog}</button>\n <button class=\"button\" title=\"Reveal in Elements panel\">${svgReveal}</button>\n ${notification.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\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: \",\n \"\\nmessage:\",\n notification.message,\n \"\\nelement:\",\n element,\n ...(notification.rel ? [\"\\nrelative:\", notification.rel] : []),\n \"\\nnotification:\",\n notification,\n );\n };\n\n const hasDevTools =\n !!(win as WindowWithAbleDOMDevtools).__ableDOMDevtools?.revealElement &&\n false; // Temtorarily disabling the devtools plugin integration.\n\n if (hasDevTools && element && 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 this.toggle(false);\n NotificationUI._highlight?.hide();\n };\n\n container.onmouseover = () => {\n element && NotificationUI._highlight?.highlight(element);\n };\n\n container.onmouseout = () => {\n NotificationUI._highlight?.hide();\n };\n }\n\n toggle(show: boolean, initial = false) {\n this.isHidden = !show;\n\n if (!initial) {\n this._onToggle?.(this, show);\n\n if (!this._rule.anchored && !show) {\n this.dispose();\n }\n }\n\n this._wrapper.style.display = show ? \"block\" : \"none\";\n }\n\n dispose() {\n this._wrapper.remove();\n NotificationUI._notificationsUI?.removeNotification(this);\n }\n}\n\nexport class NotificationsUI {\n private _win: Window;\n private _container: HTMLElement;\n private _notificationsContainer: HTMLElement;\n private _menuElement: HTMLElement;\n private _notificationCountElement: HTMLSpanElement | undefined;\n private _showAllButton: HTMLButtonElement | undefined;\n private _hideAllButton: HTMLButtonElement | undefined;\n private _alignBottomLeftButton: HTMLButtonElement | undefined;\n private _alignTopLeftButton: HTMLButtonElement | undefined;\n private _alignTopRightButton: HTMLButtonElement | undefined;\n private _alignBottomRightButton: HTMLButtonElement | undefined;\n\n private _isMuted = false;\n private _notifications: Set<NotificationUI> = new Set();\n\n constructor(win: Window) {\n this._win = win;\n\n const container = (this._container =\n win.document.createElement(\"div\")) as HTMLElementWithAbleDOMUIFlag;\n container.__abledomui = true;\n container.id = \"abledom-report\";\n container.innerHTML = createTrustedHTML(win, `<style>${css}</style>`);\n\n const notificationsContainer = (this._notificationsContainer =\n win.document.createElement(\"div\")) as HTMLDivElement;\n notificationsContainer.className = \"abledom-notifications-container\";\n container.appendChild(notificationsContainer);\n\n const menuElement = (this._menuElement =\n win.document.createElement(\"div\")) as HTMLDivElement;\n\n menuElement.className = \"abledom-menu-container\";\n menuElement.innerHTML = createTrustedHTML(\n win,\n `<div class=\"abledom-menu\"><span class=\"notifications-count\"></span\n ><button class=\"button\" title=\"Show all notifications\">${svgShowAll}</button\n ><button class=\"button\" title=\"Hide all notifications\">${svgHideAll}</button\n ><button class=\"button\" title=\"Mute newly appearing notifications\">${svgMuteAll}</button\n ><button class=\"button align-button align-button-first pressed\" title=\"Attach notifications to bottom left\">${svgAlignBottomLeft}</button\n ><button class=\"button align-button\" title=\"Attach notifications to top left\">${svgAlignTopLeft}</button\n ><button class=\"button align-button\" title=\"Attach notifications to top right\">${svgAlignTopRight}</button\n ><button class=\"button align-button align-button-last\" title=\"Attach notifications to bottom right\">${svgAlignBottomRight}</button\n ></div>`,\n );\n\n // Make sure the string HTML above unpacks properly to the assignment below.\n const [\n notificationCountElement,\n showAllButton,\n hideAllButton,\n muteButton,\n alignBottomLeftButton,\n alignTopLeftButton,\n alignTopRightButton,\n alignBottomRightButton,\n ] = menuElement.firstElementChild?.childNodes || [];\n\n if (\n notificationCountElement instanceof HTMLSpanElement &&\n showAllButton instanceof HTMLButtonElement &&\n hideAllButton instanceof HTMLButtonElement &&\n muteButton instanceof HTMLButtonElement &&\n alignBottomLeftButton instanceof HTMLButtonElement &&\n alignTopLeftButton instanceof HTMLButtonElement &&\n alignTopRightButton instanceof HTMLButtonElement &&\n alignBottomRightButton instanceof HTMLButtonElement\n ) {\n container.appendChild(menuElement);\n\n this._notificationCountElement = notificationCountElement;\n this._showAllButton = showAllButton;\n this._hideAllButton = hideAllButton;\n this._alignBottomLeftButton = alignBottomLeftButton;\n this._alignTopLeftButton = alignTopLeftButton;\n this._alignTopRightButton = alignTopRightButton;\n this._alignBottomRightButton = alignBottomRightButton;\n\n showAllButton.onclick = () => {\n this.showAll();\n };\n hideAllButton.onclick = () => {\n this.hideAll();\n };\n muteButton.onclick = () => {\n const isMuted = (this._isMuted =\n muteButton.classList.toggle(pressedClass));\n\n if (isMuted) {\n muteButton.setAttribute(\n \"title\",\n \"Unmute newly appearing notifications\",\n );\n } else {\n muteButton.setAttribute(\n \"title\",\n \"Mute newly appearing notifications\",\n );\n }\n };\n\n alignBottomLeftButton.onclick = () => {\n this.setUIAlignment(UIAlignments.BottomLeft);\n };\n alignBottomRightButton.onclick = () => {\n this.setUIAlignment(UIAlignments.BottomRight);\n };\n alignTopLeftButton.onclick = () => {\n this.setUIAlignment(UIAlignments.TopLeft);\n };\n alignTopRightButton.onclick = () => {\n this.setUIAlignment(UIAlignments.TopRight);\n };\n }\n\n win.document.body.appendChild(container);\n }\n\n private setUIAlignment(alignment: UIAlignments) {\n this._alignBottomLeftButton?.classList.remove(pressedClass);\n this._alignBottomRightButton?.classList.remove(pressedClass);\n this._alignTopLeftButton?.classList.remove(pressedClass);\n this._alignTopRightButton?.classList.remove(pressedClass);\n\n this._container.classList.remove(\n \"abledom-align-left\",\n \"abledom-align-right\",\n \"abledom-align-top\",\n \"abledom-align-bottom\",\n );\n let containerClasses: string[] = [];\n let notificationsFirst = false;\n\n switch (alignment) {\n case UIAlignments.BottomLeft:\n containerClasses = [\"abledom-align-left\", \"abledom-align-bottom\"];\n notificationsFirst = true;\n this._alignBottomLeftButton?.classList.add(pressedClass);\n break;\n case UIAlignments.BottomRight:\n containerClasses = [\"abledom-align-right\", \"abledom-align-bottom\"];\n notificationsFirst = true;\n this._alignBottomRightButton?.classList.add(pressedClass);\n break;\n case UIAlignments.TopLeft:\n containerClasses = [\"abledom-align-left\", \"abledom-align-top\"];\n this._alignTopLeftButton?.classList.add(pressedClass);\n break;\n case UIAlignments.TopRight:\n containerClasses = [\"abledom-align-right\", \"abledom-align-top\"];\n this._alignTopRightButton?.classList.add(pressedClass);\n break;\n }\n\n this._container.classList.add(...containerClasses);\n this._container.insertBefore(\n this._notificationsContainer,\n notificationsFirst ? this._menuElement : null,\n );\n }\n\n private _setNotificationsCount(count: number) {\n const countElement = this._notificationCountElement;\n\n if (countElement && count > 0) {\n countElement.innerHTML = createTrustedHTML(\n this._win,\n `<strong>${count}</strong> notification${count > 1 ? \"s\" : \"\"}`,\n );\n this._menuElement.style.display = \"block\";\n } else {\n this._menuElement.style.display = \"none\";\n }\n }\n\n private _setShowHideButtonsVisibility() {\n const showAllButton = this._showAllButton;\n const hideAllButton = this._hideAllButton;\n\n if (!showAllButton || !hideAllButton) {\n return;\n }\n\n let allHidden = true;\n let allVisible = true;\n\n for (let notification of this._notifications) {\n if (notification.isHidden) {\n allVisible = false;\n } else {\n allHidden = false;\n }\n\n if (!allHidden && !allVisible) {\n break;\n }\n }\n\n hideAllButton.style.display = allHidden ? \"none\" : \"block\";\n showAllButton.style.display = allVisible ? \"none\" : \"block\";\n }\n\n addNotification(notification: NotificationUI) {\n if (this._notifications.has(notification)) {\n return;\n }\n\n if (this._isMuted) {\n notification.toggle(false, true);\n }\n\n this._notifications.add(notification);\n this._notificationsContainer.appendChild(\n NotificationUI.getElement(notification),\n );\n\n NotificationUI.setOnToggle(notification, () => {\n this._setShowHideButtonsVisibility();\n });\n\n this._setNotificationsCount(this._notifications.size);\n this._setShowHideButtonsVisibility();\n }\n\n removeNotification(notification: NotificationUI) {\n if (!this._notifications.has(notification)) {\n return;\n }\n\n this._notifications.delete(notification);\n\n this._setNotificationsCount(this._notifications.size);\n this._setShowHideButtonsVisibility();\n }\n\n hideAll() {\n this._notifications.forEach((notification) => {\n notification.toggle(false);\n });\n this._setShowHideButtonsVisibility();\n }\n\n showAll() {\n this._notifications.forEach((notification) => {\n notification.toggle(true);\n });\n this._setShowHideButtonsVisibility();\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\nimport {\n NotificationUI,\n HTMLElementWithAbleDOMUIFlag,\n isAbleDOMUIElement,\n} from \"./ui/ui\";\nimport { isAccessibilityAffectingElement } from \"./utils\";\nimport { ValidationRule, ValidationNotification } from \"./rules/base\";\n\ninterface HTMLElementWithAbleDOM extends HTMLElement {\n __abledom?: {\n notifications?: Map<ValidationRule, NotificationUI>;\n };\n}\n\nexport class AbleDOM {\n private _win: Window;\n private _observer: MutationObserver;\n private _clearValidationTimeout: (() => void) | undefined;\n private _elementsWithNotifications: 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._win = 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, _elementsToRemove.has(node as HTMLElementWithAbleDOM));\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 _addNotification(\n rule: ValidationRule,\n notification: ValidationNotification,\n ) {\n const element = notification?.element as HTMLElementWithAbleDOM | undefined;\n\n if (!notification) {\n this._removeNotification(element || this._win.document.body, rule);\n return;\n }\n\n let notificationUI: NotificationUI | undefined;\n\n if (rule.anchored && element) {\n let abledomOnElement = element.__abledom;\n\n if (!abledomOnElement) {\n abledomOnElement = element.__abledom = {};\n }\n\n let notifications = abledomOnElement.notifications;\n\n if (!notifications) {\n notifications = abledomOnElement.notifications = new Map();\n }\n\n notificationUI = notifications.get(rule);\n\n if (!notificationUI) {\n notificationUI = new NotificationUI(this._win, rule);\n notifications.set(rule, notificationUI);\n }\n\n this._elementsWithNotifications.add(element);\n } else {\n notificationUI = new NotificationUI(this._win, rule);\n }\n\n notificationUI.update(notification);\n }\n\n private _removeNotification(\n element: HTMLElementWithAbleDOM,\n rule: ValidationRule,\n ) {\n if (!rule.anchored) {\n return;\n }\n\n const notifications = element.__abledom?.notifications;\n\n if (!notifications) {\n return;\n }\n\n const notification = notifications.get(rule);\n\n if (notification) {\n notification.dispose();\n notifications.delete(rule);\n }\n\n if (notifications.size === 0) {\n this._elementsWithNotifications.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?.notifications\n ) {\n const dependsOnIds = new Set<string>();\n\n for (const rule of this._rules) {\n if (!rule.validate || 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?.notification) {\n this._addNotification(rule, validationResult.notification);\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?.notifications?.has(rule)) {\n this._removeNotification(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?.notifications?.keys() || [])];\n rules.forEach((rule) => this._removeNotification(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 const focusNotification = rule.focused?.(event);\n\n if (focusNotification) {\n this._addNotification(rule, focusNotification);\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 const blurNotification = rule.blurred?.(event);\n\n if (blurNotification) {\n this._addNotification(rule, blurNotification);\n }\n }\n };\n\n private _notifyAsync = (\n rule: ValidationRule,\n notification: ValidationNotification,\n ): void => {\n this._addNotification(rule, notification);\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.init(rule, this._win, this._notifyAsync);\n rule.start?.();\n }\n\n this._startFunc?.();\n }\n\n dispose() {\n this._win.document.addEventListener(\"focusin\", this._onFocusIn, true);\n this._win.document.addEventListener(\"focusout\", this._onFocusOut, true);\n\n this._remove(this._elementsWithNotifications);\n this._elementsWithNotifications.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 ValidationRule.dispose(rule);\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, ValidationRuleType } from \"./base\";\n\nexport class AtomicRule extends ValidationRule {\n type = ValidationRuleType.Error;\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 notification: {\n id: \"focusable-in-atomic\",\n message: \"Focusable element inside atomic focusable.\",\n element,\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, ValidationRuleType } 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 type = ValidationRuleType.Error;\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 notification: isElementVisible(element)\n ? {\n id: \"focusable-element-label\",\n message: \"Focusable element must have a non-empty text label.\",\n element,\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, ValidationRuleType } from \"./base\";\n\nexport class ExistingIdRule extends ValidationRule {\n type = ValidationRuleType.Error;\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 notification: {\n id: \"missing-id\",\n message: `Elements with referenced ids do not extist.`,\n element,\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 { BlurNotification, ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class FocusLostRule extends ValidationRule<BlurNotification> {\n type = ValidationRuleType.Error;\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 private _mouseEventTimer: number | undefined;\n private _releaseMouseEvent: (() => void) | 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 focused(event: FocusEvent): 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 blurred(event: FocusEvent): 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 || this._mouseEventTimer) {\n return null;\n }\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 const focusLostTimer = win.setTimeout(() => {\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 this.notify({\n element: target,\n id: \"focus-lost\",\n message: \"Focus lost.\",\n stack: this._lastBlurStack,\n relStack: this._lastFocusStack,\n position: targetPosition || [],\n });\n }\n }, this._focusLostTimeout);\n\n this._clearScheduledFocusLost = () => {\n delete this._clearScheduledFocusLost;\n win.clearTimeout(focusLostTimer);\n };\n\n return null;\n }\n\n start(): void {\n const win = this.window;\n\n if (!win) {\n return;\n }\n\n const onMouseEvent = () => {\n if (!this._mouseEventTimer) {\n this._mouseEventTimer = win.setTimeout(() => {\n this._mouseEventTimer = undefined;\n }, 0);\n }\n };\n\n win.addEventListener(\"mousedown\", onMouseEvent, true);\n win.addEventListener(\"mouseup\", onMouseEvent, true);\n win.addEventListener(\"mousemove\", onMouseEvent, true);\n\n this._releaseMouseEvent = () => {\n delete this._releaseMouseEvent;\n\n if (this._mouseEventTimer) {\n win.clearTimeout(this._mouseEventTimer);\n delete this._mouseEventTimer;\n }\n\n win.removeEventListener(\"mousedown\", onMouseEvent, true);\n win.removeEventListener(\"mouseup\", onMouseEvent, true);\n win.removeEventListener(\"mousemove\", onMouseEvent, true);\n };\n }\n\n stop(): void {\n this._releaseMouseEvent?.();\n this._clearScheduledFocusLost?.();\n this._focusedElement = undefined;\n this._focusedElementPosition = undefined;\n this._lastFocusStack = undefined;\n this._lastBlurStack = undefined;\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 { ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class BadFocusRule extends ValidationRule {\n type = ValidationRuleType.Error;\n name = \"bad-focus\";\n anchored = false;\n\n private _lastFocusStack: string[] | undefined;\n private _lastBlurStack: string[] | undefined;\n private _clearCheckTimer: (() => void) | undefined;\n\n focused(): null {\n this._lastFocusStack = getStackTrace();\n return null;\n }\n\n blurred(): null {\n const win = this.window;\n\n if (!win) {\n return null;\n }\n\n this._lastBlurStack = getStackTrace();\n\n this._clearCheckTimer?.();\n\n const checkTimer = win.setTimeout(() => {\n delete this._clearCheckTimer;\n\n if (\n document.activeElement &&\n !isElementVisible(document.activeElement as HTMLElement)\n ) {\n this.notify({\n id: \"bad-focus\",\n message: \"Focused stolen by invisible element.\",\n element: document.activeElement as HTMLElement,\n stack: this._lastBlurStack,\n relStack: this._lastFocusStack,\n });\n }\n }, 100);\n\n this._clearCheckTimer = () => {\n delete this._clearCheckTimer;\n win.clearTimeout(checkTimer);\n };\n\n return null;\n }\n\n stop(): void {\n this._clearCheckTimer?.();\n this._clearCheckTimer = undefined;\n this._lastFocusStack = undefined;\n this._lastBlurStack = undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { ValidationRule, ValidationResult, ValidationRuleType } from \"./base\";\n\nexport class FindElementRule extends ValidationRule {\n type = ValidationRuleType.Warning;\n name = \"find-element\";\n anchored = true;\n\n private _conditions: { [name: string]: (element: HTMLElement) => boolean } =\n {};\n\n addCondition(\n name: string,\n condition: (element: HTMLElement) => boolean,\n ): void {\n this._conditions[name] = condition;\n }\n\n removeCondition(name: string): void {\n delete this._conditions[name];\n }\n\n validate(element: HTMLElement): ValidationResult | null {\n for (const name of Object.keys(this._conditions)) {\n if (this._conditions[name](element)) {\n return {\n notification: {\n id: \"find-element\",\n message: `Element found: ${name}.`,\n element,\n },\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 */\nimport { ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class CustomNotifyRule extends ValidationRule {\n type = ValidationRuleType.Info;\n name = \"custom-notify\";\n anchored = false;\n\n customNotify(message: string, element?: HTMLElement): void {\n this.notify({\n id: \"custom-notify\",\n message,\n element,\n });\n }\n}\n"],"mappings":";;;;;AAKO,IAAK,qBAAL,kBAAKA,wBAAL;AACL,EAAAA,wCAAA,WAAQ,KAAR;AACA,EAAAA,wCAAA;AACA,EAAAA,wCAAA;AAHU,SAAAA;AAAA,GAAA;AAyBL,IAAe,iBAAf,MAEL;AAAA,EAFK;AAKL,wBAAQ;AACR,wBAAQ,eAAqD,CAAC;AAC9D,wBAAQ;AA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,eAAK,qBAAL;AACA,SAAK,mBAAmB;AACxB,SAAK,kBAAkB;AACvB,SAAK,iBAAiB;AAAA,EACxB;AACF;;;AC1DO,IAAM,kBAAN,cAA8B,eAAe;AAAA,EAA7C;AAAA;AACL;AACA,gCAAO;AACP,oCAAW;AAEX,wBAAQ,eACN,CAAC;AAAA;AAAA,EAEH,aACE,MACA,WACM;AACN,SAAK,YAAY,IAAI,IAAI;AAAA,EAC3B;AAAA,EAEA,gBAAgB,MAAoB;AAClC,WAAO,KAAK,YAAY,IAAI;AAAA,EAC9B;AAAA,EAEA,SAAS,SAA+C;AACtD,eAAW,QAAQ,OAAO,KAAK,KAAK,WAAW,GAAG;AAChD,UAAI,KAAK,YAAY,IAAI,EAAE,OAAO,GAAG;AACnC,eAAO;AAAA,UACL,cAAc;AAAA,YACZ,IAAI;AAAA,YACJ,SAAS,kBAAkB,IAAI;AAAA,YAC/B;AAAA,UACF;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AACF;;;AClCO,IAAM,mBAAN,cAA+B,eAAe;AAAA,EAA9C;AAAA;AACL;AACA,gCAAO;AACP,oCAAW;AAAA;AAAA,EAEX,aAAa,SAAiB,SAA6B;AACzD,SAAK,OAAO;AAAA,MACV,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":["ValidationRuleType","html","_a","node","rule"]}
|
package/dist/index.js
CHANGED
|
@@ -133,6 +133,13 @@ var alignbottomleft_default = '<svg width="20" height="20" viewBox="0 0 20 20" f
|
|
|
133
133
|
|
|
134
134
|
// src/ui/ui.ts
|
|
135
135
|
var pressedClass = "pressed";
|
|
136
|
+
function createTrustedHTML(win, html) {
|
|
137
|
+
var _a, _b;
|
|
138
|
+
const escapeHTMLPolicy = (_b = (_a = win.trustedTypes) == null ? void 0 : _a.createPolicy) == null ? void 0 : _b.call(_a, "forceInner", {
|
|
139
|
+
createHTML: (html2) => html2
|
|
140
|
+
});
|
|
141
|
+
return escapeHTMLPolicy ? escapeHTMLPolicy.createHTML(html) : html;
|
|
142
|
+
}
|
|
136
143
|
var _NotificationUI = class _NotificationUI {
|
|
137
144
|
constructor(win, rule) {
|
|
138
145
|
__publicField(this, "_win");
|
|
@@ -166,14 +173,17 @@ var _NotificationUI = class _NotificationUI {
|
|
|
166
173
|
const wrapper = this._wrapper;
|
|
167
174
|
const element = notification.element;
|
|
168
175
|
wrapper.__abledomui = true;
|
|
169
|
-
wrapper.innerHTML =
|
|
176
|
+
wrapper.innerHTML = createTrustedHTML(
|
|
177
|
+
win,
|
|
178
|
+
`
|
|
170
179
|
<div class="abledom-notification-container"><div class="abledom-notification${rule.type === 2 /* Warning */ ? " abledom-notification_warning" : rule.type === 3 /* Info */ ? " abledom-notification_info" : ""}">
|
|
171
180
|
<button class="button" title="Log to Console">${log_default}</button>
|
|
172
181
|
<button class="button" title="Reveal in Elements panel">${reveal_default}</button>
|
|
173
182
|
${notification.message}
|
|
174
183
|
<a href class="button close" href="/" title="Open help" target="_blank">${help_default}</a>
|
|
175
184
|
<button class="button close" class="close" title="Hide">${close_default}</button>
|
|
176
|
-
</div></div
|
|
185
|
+
</div></div>`
|
|
186
|
+
);
|
|
177
187
|
const container = wrapper.firstElementChild;
|
|
178
188
|
const buttons = wrapper.querySelectorAll("button");
|
|
179
189
|
const logButton = buttons[0];
|
|
@@ -242,6 +252,7 @@ __publicField(_NotificationUI, "_highlight");
|
|
|
242
252
|
var NotificationUI = _NotificationUI;
|
|
243
253
|
var NotificationsUI = class {
|
|
244
254
|
constructor(win) {
|
|
255
|
+
__publicField(this, "_win");
|
|
245
256
|
__publicField(this, "_container");
|
|
246
257
|
__publicField(this, "_notificationsContainer");
|
|
247
258
|
__publicField(this, "_menuElement");
|
|
@@ -255,16 +266,19 @@ var NotificationsUI = class {
|
|
|
255
266
|
__publicField(this, "_isMuted", false);
|
|
256
267
|
__publicField(this, "_notifications", /* @__PURE__ */ new Set());
|
|
257
268
|
var _a;
|
|
269
|
+
this._win = win;
|
|
258
270
|
const container = this._container = win.document.createElement("div");
|
|
259
271
|
container.__abledomui = true;
|
|
260
272
|
container.id = "abledom-report";
|
|
261
|
-
container.innerHTML = `<style>${ui_default}</style
|
|
273
|
+
container.innerHTML = createTrustedHTML(win, `<style>${ui_default}</style>`);
|
|
262
274
|
const notificationsContainer = this._notificationsContainer = win.document.createElement("div");
|
|
263
275
|
notificationsContainer.className = "abledom-notifications-container";
|
|
264
276
|
container.appendChild(notificationsContainer);
|
|
265
277
|
const menuElement = this._menuElement = win.document.createElement("div");
|
|
266
278
|
menuElement.className = "abledom-menu-container";
|
|
267
|
-
menuElement.innerHTML =
|
|
279
|
+
menuElement.innerHTML = createTrustedHTML(
|
|
280
|
+
win,
|
|
281
|
+
`<div class="abledom-menu"><span class="notifications-count"></span
|
|
268
282
|
><button class="button" title="Show all notifications">${showall_default}</button
|
|
269
283
|
><button class="button" title="Hide all notifications">${hideall_default}</button
|
|
270
284
|
><button class="button" title="Mute newly appearing notifications">${muteall_default}</button
|
|
@@ -272,7 +286,8 @@ var NotificationsUI = class {
|
|
|
272
286
|
><button class="button align-button" title="Attach notifications to top left">${aligntopleft_default}</button
|
|
273
287
|
><button class="button align-button" title="Attach notifications to top right">${aligntopright_default}</button
|
|
274
288
|
><button class="button align-button align-button-last" title="Attach notifications to bottom right">${alignbottomright_default}</button
|
|
275
|
-
></div
|
|
289
|
+
></div>`
|
|
290
|
+
);
|
|
276
291
|
const [
|
|
277
292
|
notificationCountElement,
|
|
278
293
|
showAllButton,
|
|
@@ -370,7 +385,10 @@ var NotificationsUI = class {
|
|
|
370
385
|
_setNotificationsCount(count) {
|
|
371
386
|
const countElement = this._notificationCountElement;
|
|
372
387
|
if (countElement && count > 0) {
|
|
373
|
-
countElement.innerHTML =
|
|
388
|
+
countElement.innerHTML = createTrustedHTML(
|
|
389
|
+
this._win,
|
|
390
|
+
`<strong>${count}</strong> notification${count > 1 ? "s" : ""}`
|
|
391
|
+
);
|
|
374
392
|
this._menuElement.style.display = "block";
|
|
375
393
|
} else {
|
|
376
394
|
this._menuElement.style.display = "none";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/rules/base.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","inline-file:/Users/marata/Documents/Work/abledom/src/ui/hideall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/muteall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/showall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/aligntopleft.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/aligntopright.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/alignbottomright.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/alignbottomleft.svg","../src/ui/ui.ts","../src/utils.ts","../src/core.ts","../src/rules/atomic.ts","../src/rules/label.ts","../src/rules/existingid.ts","../src/rules/focuslost.ts","../src/rules/badfocus.ts","../src/rules/find.ts","../src/rules/notify.ts"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { AbleDOM } from \"./core\";\nexport { ValidationRule, ValidationRuleType } from \"./rules/base\";\nexport type {\n ValidationResult,\n ValidationNotification,\n BlurNotification,\n} 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\";\nexport { FindElementRule } from \"./rules/find\";\nexport { CustomNotifyRule } from \"./rules/notify\";\nexport {\n isAccessibilityAffectingElement,\n hasAccessibilityAttribute,\n matchesSelector,\n isDisplayNone,\n isElementVisible,\n} from \"./utils\";\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport enum ValidationRuleType {\n Error = 1,\n Warning,\n Info,\n}\n\nexport interface ValidationNotification {\n id: string;\n message: string;\n element?: HTMLElement;\n rel?: Node;\n link?: string;\n stack?: string[];\n relStack?: string[];\n}\n\nexport interface ValidationResult {\n notification?: ValidationNotification;\n dependsOnIds?: Set<string>;\n}\n\nexport interface BlurNotification extends ValidationNotification {\n position?: string[];\n}\n\nexport abstract class ValidationRule<\n N extends ValidationNotification = ValidationNotification,\n> {\n abstract type: ValidationRuleType;\n abstract name: string;\n private _window?: Window;\n private _exceptions: ((element: HTMLElement) => boolean)[] = [];\n private _onNotification:\n | ((rult: ValidationRule<N>, notification: N) => void)\n | undefined;\n\n static init(\n instance: ValidationRule,\n window: Window,\n onNotification: (\n rule: ValidationRule,\n notification: ValidationNotification,\n ) => void,\n ): void {\n instance._window = window;\n instance._onNotification = onNotification;\n }\n\n static dispose(instance: ValidationRule): void {\n instance.dispose();\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 private dispose(): void {\n this._window = undefined;\n this._onNotification = undefined;\n this._exceptions = [];\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 notify(notification: N): void {\n this._onNotification?.(this, notification);\n }\n\n focused?(event: FocusEvent): ValidationNotification | null;\n blurred?(event: FocusEvent): BlurNotification | null;\n}\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-report :focus-visible {\\n outline: 3px solid red;\\n mix-blend-mode: difference;\\n}\\n\\n#abledom-report.abledom-align-left {\\n left: 10px;\\n right: auto;\\n}\\n\\n#abledom-report.abledom-align-right {\\n left: auto;\\n right: 10px;\\n}\\n\\n#abledom-report.abledom-align-bottom {\\n bottom: 20px;\\n top: auto;\\n}\\n\\n#abledom-report.abledom-align-top {\\n /* flex-direction: column-reverse; */\\n bottom: auto;\\n top: 10px;\\n}\\n\\n.abledom-menu-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-block;\\n margin: 2px auto 2px 0;\\n}\\n\\n#abledom-report.abledom-align-right .abledom-menu-container {\\n margin: 2px 0 2px auto;\\n}\\n\\n.abledom-menu {\\n background-color: rgba(140, 10, 121, 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-menu .notifications-count {\\n margin: 0 8px;\\n display: inline-block;\\n}\\n\\n.abledom-menu .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-menu .align-button {\\n border-right-color: rgba(0, 0, 0, 0.4);\\n border-radius: 0;\\n margin: 0;\\n}\\n\\n.abledom-menu .align-button:active,\\n#abledom-report .pressed {\\n background: linear-gradient(\\n 180deg,\\n rgba(130, 130, 130, 1) 0%,\\n rgba(180, 180, 180, 1) 100%\\n );\\n}\\n\\n.abledom-menu .align-button-first {\\n border-top-left-radius: 6px;\\n border-bottom-left-radius: 6px;\\n margin-left: 8px;\\n}\\n.abledom-menu .align-button-last {\\n border-top-right-radius: 6px;\\n border-bottom-right-radius: 6px;\\n border-right-color: rgba(255, 255, 255, 0.4);\\n}\\n\\n.abledom-notifications-container {\\n overflow: scroll;\\n max-height: calc(100vh - 100px);\\n}\\n\\n#abledom-report.abledom-align-right .abledom-notifications-container {\\n text-align: right;\\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.abledom-notification_warning {\\n background-color: rgba(163, 82, 1, 0.7);\\n}\\n.abledom-notification_info {\\n background-color: rgba(0, 0, 255, 0.7);\\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>\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"1.67\\\" y1=\\\"1.67\\\" x2=\\\"18.33\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"1.67\\\" y1=\\\"1.67\\\" x2=\\\"18.33\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"18.33\\\" y1=\\\"1.67\\\" x2=\\\"1.67\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"3\\\" y=\\\"3\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"11\\\" y=\\\"3\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"11\\\" y=\\\"11\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"3\\\" y=\\\"11\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","/*!\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 {\n ValidationNotification,\n ValidationRule,\n ValidationRuleType,\n} 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\n// @ts-expect-error parsed assets\nimport svgHideAll from \"./hideall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgMuteAll from \"./muteall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgShowAll from \"./showall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignTopLeft from \"./aligntopleft.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignTopRight from \"./aligntopright.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignBottomRight from \"./alignbottomright.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignBottomLeft from \"./alignbottomleft.svg?raw\";\n\nenum UIAlignments {\n BottomLeft = \"bottom-left\",\n BottomRight = \"bottom-right\",\n TopLeft = \"top-left\",\n TopRight = \"top-right\",\n}\n\nconst pressedClass = \"pressed\";\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 _notificationsUI: NotificationsUI | undefined;\n\n static setOnToggle(\n instance: NotificationUI,\n onToggle: (notificationUI: NotificationUI, show: boolean) => void,\n ) {\n instance._onToggle = onToggle;\n }\n\n private static _highlight: ElementHighlighter;\n\n private _win: Window;\n private _wrapper: HTMLElementWithAbleDOMUIFlag;\n private _rule: ValidationRule;\n private _onToggle:\n | ((notificationUI: NotificationUI, show: boolean) => void)\n | undefined;\n\n static getElement(instance: NotificationUI): HTMLElement {\n return instance._wrapper;\n }\n\n isHidden = false;\n\n constructor(win: Window, rule: ValidationRule) {\n this._win = win;\n this._rule = rule;\n\n if (!NotificationUI._notificationsUI) {\n NotificationUI._notificationsUI = new NotificationsUI(this._win);\n }\n\n this._wrapper = win.document.createElement(\n \"div\",\n ) as HTMLElementWithAbleDOMUIFlag;\n\n if (!NotificationUI._highlight) {\n NotificationUI._highlight = new ElementHighlighter(win);\n }\n\n NotificationUI._notificationsUI.addNotification(this);\n }\n\n update(notification: ValidationNotification): void {\n const win = this._win;\n const rule = this._rule;\n const wrapper = this._wrapper;\n const element = notification.element;\n\n wrapper.__abledomui = true;\n\n wrapper.innerHTML = `\n <div class=\"abledom-notification-container\"><div class=\"abledom-notification${\n rule.type === ValidationRuleType.Warning\n ? \" abledom-notification_warning\"\n : rule.type === ValidationRuleType.Info\n ? \" abledom-notification_info\"\n : \"\"\n }\">\n <button class=\"button\" title=\"Log to Console\">${svgLog}</button>\n <button class=\"button\" title=\"Reveal in Elements panel\">${svgReveal}</button>\n ${notification.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: \",\n \"\\nmessage:\",\n notification.message,\n \"\\nelement:\",\n element,\n ...(notification.rel ? [\"\\nrelative:\", notification.rel] : []),\n \"\\nnotification:\",\n notification,\n );\n };\n\n const hasDevTools =\n !!(win as WindowWithAbleDOMDevtools).__ableDOMDevtools?.revealElement &&\n false; // Temtorarily disabling the devtools plugin integration.\n\n if (hasDevTools && element && 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 this.toggle(false);\n NotificationUI._highlight?.hide();\n };\n\n container.onmouseover = () => {\n element && NotificationUI._highlight?.highlight(element);\n };\n\n container.onmouseout = () => {\n NotificationUI._highlight?.hide();\n };\n }\n\n toggle(show: boolean, initial = false) {\n this.isHidden = !show;\n\n if (!initial) {\n this._onToggle?.(this, show);\n\n if (!this._rule.anchored && !show) {\n this.dispose();\n }\n }\n\n this._wrapper.style.display = show ? \"block\" : \"none\";\n }\n\n dispose() {\n this._wrapper.remove();\n NotificationUI._notificationsUI?.removeNotification(this);\n }\n}\n\nexport class NotificationsUI {\n private _container: HTMLElement;\n private _notificationsContainer: HTMLElement;\n private _menuElement: HTMLElement;\n private _notificationCountElement: HTMLSpanElement | undefined;\n private _showAllButton: HTMLButtonElement | undefined;\n private _hideAllButton: HTMLButtonElement | undefined;\n private _alignBottomLeftButton: HTMLButtonElement | undefined;\n private _alignTopLeftButton: HTMLButtonElement | undefined;\n private _alignTopRightButton: HTMLButtonElement | undefined;\n private _alignBottomRightButton: HTMLButtonElement | undefined;\n\n private _isMuted = false;\n private _notifications: Set<NotificationUI> = new Set();\n\n constructor(win: Window) {\n const container = (this._container =\n win.document.createElement(\"div\")) as HTMLElementWithAbleDOMUIFlag;\n container.__abledomui = true;\n container.id = \"abledom-report\";\n container.innerHTML = `<style>${css}</style>`;\n\n const notificationsContainer = (this._notificationsContainer =\n win.document.createElement(\"div\")) as HTMLDivElement;\n notificationsContainer.className = \"abledom-notifications-container\";\n container.appendChild(notificationsContainer);\n\n const menuElement = (this._menuElement =\n win.document.createElement(\"div\")) as HTMLDivElement;\n\n menuElement.className = \"abledom-menu-container\";\n menuElement.innerHTML = `<div class=\"abledom-menu\"><span class=\"notifications-count\"></span\n ><button class=\"button\" title=\"Show all notifications\">${svgShowAll}</button\n ><button class=\"button\" title=\"Hide all notifications\">${svgHideAll}</button\n ><button class=\"button\" title=\"Mute newly appearing notifications\">${svgMuteAll}</button\n ><button class=\"button align-button align-button-first pressed\" title=\"Attach notifications to bottom left\">${svgAlignBottomLeft}</button\n ><button class=\"button align-button\" title=\"Attach notifications to top left\">${svgAlignTopLeft}</button\n ><button class=\"button align-button\" title=\"Attach notifications to top right\">${svgAlignTopRight}</button\n ><button class=\"button align-button align-button-last\" title=\"Attach notifications to bottom right\">${svgAlignBottomRight}</button\n ></div>`;\n\n // Make sure the string HTML above unpacks properly to the assignment below.\n const [\n notificationCountElement,\n showAllButton,\n hideAllButton,\n muteButton,\n alignBottomLeftButton,\n alignTopLeftButton,\n alignTopRightButton,\n alignBottomRightButton,\n ] = menuElement.firstElementChild?.childNodes || [];\n\n if (\n notificationCountElement instanceof HTMLSpanElement &&\n showAllButton instanceof HTMLButtonElement &&\n hideAllButton instanceof HTMLButtonElement &&\n muteButton instanceof HTMLButtonElement &&\n alignBottomLeftButton instanceof HTMLButtonElement &&\n alignTopLeftButton instanceof HTMLButtonElement &&\n alignTopRightButton instanceof HTMLButtonElement &&\n alignBottomRightButton instanceof HTMLButtonElement\n ) {\n container.appendChild(menuElement);\n\n this._notificationCountElement = notificationCountElement;\n this._showAllButton = showAllButton;\n this._hideAllButton = hideAllButton;\n this._alignBottomLeftButton = alignBottomLeftButton;\n this._alignTopLeftButton = alignTopLeftButton;\n this._alignTopRightButton = alignTopRightButton;\n this._alignBottomRightButton = alignBottomRightButton;\n\n showAllButton.onclick = () => {\n this.showAll();\n };\n hideAllButton.onclick = () => {\n this.hideAll();\n };\n muteButton.onclick = () => {\n const isMuted = (this._isMuted =\n muteButton.classList.toggle(pressedClass));\n\n if (isMuted) {\n muteButton.setAttribute(\n \"title\",\n \"Unmute newly appearing notifications\",\n );\n } else {\n muteButton.setAttribute(\n \"title\",\n \"Mute newly appearing notifications\",\n );\n }\n };\n\n alignBottomLeftButton.onclick = () => {\n this.setUIAlignment(UIAlignments.BottomLeft);\n };\n alignBottomRightButton.onclick = () => {\n this.setUIAlignment(UIAlignments.BottomRight);\n };\n alignTopLeftButton.onclick = () => {\n this.setUIAlignment(UIAlignments.TopLeft);\n };\n alignTopRightButton.onclick = () => {\n this.setUIAlignment(UIAlignments.TopRight);\n };\n }\n\n win.document.body.appendChild(container);\n }\n\n private setUIAlignment(alignment: UIAlignments) {\n this._alignBottomLeftButton?.classList.remove(pressedClass);\n this._alignBottomRightButton?.classList.remove(pressedClass);\n this._alignTopLeftButton?.classList.remove(pressedClass);\n this._alignTopRightButton?.classList.remove(pressedClass);\n\n this._container.classList.remove(\n \"abledom-align-left\",\n \"abledom-align-right\",\n \"abledom-align-top\",\n \"abledom-align-bottom\",\n );\n let containerClasses: string[] = [];\n let notificationsFirst = false;\n\n switch (alignment) {\n case UIAlignments.BottomLeft:\n containerClasses = [\"abledom-align-left\", \"abledom-align-bottom\"];\n notificationsFirst = true;\n this._alignBottomLeftButton?.classList.add(pressedClass);\n break;\n case UIAlignments.BottomRight:\n containerClasses = [\"abledom-align-right\", \"abledom-align-bottom\"];\n notificationsFirst = true;\n this._alignBottomRightButton?.classList.add(pressedClass);\n break;\n case UIAlignments.TopLeft:\n containerClasses = [\"abledom-align-left\", \"abledom-align-top\"];\n this._alignTopLeftButton?.classList.add(pressedClass);\n break;\n case UIAlignments.TopRight:\n containerClasses = [\"abledom-align-right\", \"abledom-align-top\"];\n this._alignTopRightButton?.classList.add(pressedClass);\n break;\n }\n\n this._container.classList.add(...containerClasses);\n this._container.insertBefore(\n this._notificationsContainer,\n notificationsFirst ? this._menuElement : null,\n );\n }\n\n private _setNotificationsCount(count: number) {\n const countElement = this._notificationCountElement;\n\n if (countElement && count > 0) {\n countElement.innerHTML = `<strong>${count}</strong> notification${count > 1 ? \"s\" : \"\"}`;\n this._menuElement.style.display = \"block\";\n } else {\n this._menuElement.style.display = \"none\";\n }\n }\n\n private _setShowHideButtonsVisibility() {\n const showAllButton = this._showAllButton;\n const hideAllButton = this._hideAllButton;\n\n if (!showAllButton || !hideAllButton) {\n return;\n }\n\n let allHidden = true;\n let allVisible = true;\n\n for (let notification of this._notifications) {\n if (notification.isHidden) {\n allVisible = false;\n } else {\n allHidden = false;\n }\n\n if (!allHidden && !allVisible) {\n break;\n }\n }\n\n hideAllButton.style.display = allHidden ? \"none\" : \"block\";\n showAllButton.style.display = allVisible ? \"none\" : \"block\";\n }\n\n addNotification(notification: NotificationUI) {\n if (this._notifications.has(notification)) {\n return;\n }\n\n if (this._isMuted) {\n notification.toggle(false, true);\n }\n\n this._notifications.add(notification);\n this._notificationsContainer.appendChild(\n NotificationUI.getElement(notification),\n );\n\n NotificationUI.setOnToggle(notification, () => {\n this._setShowHideButtonsVisibility();\n });\n\n this._setNotificationsCount(this._notifications.size);\n this._setShowHideButtonsVisibility();\n }\n\n removeNotification(notification: NotificationUI) {\n if (!this._notifications.has(notification)) {\n return;\n }\n\n this._notifications.delete(notification);\n\n this._setNotificationsCount(this._notifications.size);\n this._setShowHideButtonsVisibility();\n }\n\n hideAll() {\n this._notifications.forEach((notification) => {\n notification.toggle(false);\n });\n this._setShowHideButtonsVisibility();\n }\n\n showAll() {\n this._notifications.forEach((notification) => {\n notification.toggle(true);\n });\n this._setShowHideButtonsVisibility();\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\nimport {\n NotificationUI,\n HTMLElementWithAbleDOMUIFlag,\n isAbleDOMUIElement,\n} from \"./ui/ui\";\nimport { isAccessibilityAffectingElement } from \"./utils\";\nimport { ValidationRule, ValidationNotification } from \"./rules/base\";\n\n// class ValidationNotificationUI {\n// static _notificationsUI: NotificationsUI | undefined;\n\n// private _win: Window;\n// private _notification: NotificationUI | undefined;\n// // private _onHide: (() => void) | undefined;\n\n// constructor(\n// win: Window,\n// public error: ValidationNotification,\n// public type: ValidationRuleType,\n// // onHide?: () => void,\n// ) {\n// this._win = win;\n// // this._onHide = onHide;\n// this.report();\n// }\n\n// update(error: ValidationNotification, type: ValidationRuleType): void {\n// this.type = type;\n// this.error = error;\n// this.report();\n// }\n\n// report(): void {\n// if (!ValidationNotificationUI._notificationsUI) {\n// ValidationNotificationUI._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._win,\n// this.error,\n// this.type,\n// );\n// }\n\n// ValidationNotificationUI._notificationsUI.addNotification(notification);\n\n// const element = this.error.element as HTMLElementWithAbleDOMUIFlag;\n\n// if (element) {\n// const keyArray: IExceptionPathPart[] = [];\n\n// for (let el: HTMLElement | null = element; el; el = el.parentElement) {\n// keyArray.unshift({tagName: el.tagName});\n// }\n\n// console.error('AbleDOM path', this.error.id, this.error.element, keyArray);\n// }\n// }\n\n// toggle(show: boolean): void {\n// this._notification?.toggle(show);\n// }\n\n// remove(): void {\n// if (this._notification) {\n// ValidationNotificationUI._notificationsUI?.removeNotification(\n// this._notification,\n// );\n// delete this._notification;\n// }\n// }\n// }\n\ninterface HTMLElementWithAbleDOM extends HTMLElement {\n __abledom?: {\n notifications?: Map<ValidationRule, NotificationUI>;\n };\n}\n\nexport class AbleDOM {\n private _win: Window;\n private _observer: MutationObserver;\n private _clearValidationTimeout: (() => void) | undefined;\n private _elementsWithNotifications: 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._win = 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, _elementsToRemove.has(node as HTMLElementWithAbleDOM));\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 _addNotification(\n rule: ValidationRule,\n notification: ValidationNotification,\n ) {\n const element = notification?.element as HTMLElementWithAbleDOM | undefined;\n\n if (!notification) {\n this._removeNotification(element || this._win.document.body, rule);\n return;\n }\n\n let notificationUI: NotificationUI | undefined;\n\n if (rule.anchored && element) {\n let abledomOnElement = element.__abledom;\n\n if (!abledomOnElement) {\n abledomOnElement = element.__abledom = {};\n }\n\n let notifications = abledomOnElement.notifications;\n\n if (!notifications) {\n notifications = abledomOnElement.notifications = new Map();\n }\n\n notificationUI = notifications.get(rule);\n\n if (!notificationUI) {\n notificationUI = new NotificationUI(this._win, rule);\n notifications.set(rule, notificationUI);\n }\n\n this._elementsWithNotifications.add(element);\n } else {\n notificationUI = new NotificationUI(this._win, rule);\n }\n\n notificationUI.update(notification);\n }\n\n private _removeNotification(\n element: HTMLElementWithAbleDOM,\n rule: ValidationRule,\n ) {\n if (!rule.anchored) {\n return;\n }\n\n const notifications = element.__abledom?.notifications;\n\n if (!notifications) {\n return;\n }\n\n const notification = notifications.get(rule);\n\n if (notification) {\n notification.dispose();\n notifications.delete(rule);\n }\n\n if (notifications.size === 0) {\n this._elementsWithNotifications.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?.notifications\n ) {\n const dependsOnIds = new Set<string>();\n\n for (const rule of this._rules) {\n if (!rule.validate || 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?.notification) {\n this._addNotification(rule, validationResult.notification);\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?.notifications?.has(rule)) {\n this._removeNotification(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?.notifications?.keys() || [])];\n rules.forEach((rule) => this._removeNotification(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 const focusNotification = rule.focused?.(event);\n\n if (focusNotification) {\n this._addNotification(rule, focusNotification);\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 const blurNotification = rule.blurred?.(event);\n\n if (blurNotification) {\n this._addNotification(rule, blurNotification);\n }\n }\n };\n\n private _notifyAsync = (\n rule: ValidationRule,\n notification: ValidationNotification,\n ): void => {\n this._addNotification(rule, notification);\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.init(rule, this._win, this._notifyAsync);\n rule.start?.();\n }\n\n this._startFunc?.();\n }\n\n dispose() {\n this._win.document.addEventListener(\"focusin\", this._onFocusIn, true);\n this._win.document.addEventListener(\"focusout\", this._onFocusOut, true);\n\n this._remove(this._elementsWithNotifications);\n this._elementsWithNotifications.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 ValidationRule.dispose(rule);\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, ValidationRuleType } from \"./base\";\n\nexport class AtomicRule extends ValidationRule {\n type = ValidationRuleType.Error;\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 notification: {\n id: \"focusable-in-atomic\",\n message: \"Focusable element inside atomic focusable.\",\n element,\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, ValidationRuleType } 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 type = ValidationRuleType.Error;\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 notification: isElementVisible(element)\n ? {\n id: \"focusable-element-label\",\n message: \"Focusable element must have a non-empty text label.\",\n element,\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, ValidationRuleType } from \"./base\";\n\nexport class ExistingIdRule extends ValidationRule {\n type = ValidationRuleType.Error;\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 notification: {\n id: \"missing-id\",\n message: `Elements with referenced ids do not extist.`,\n element,\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 { BlurNotification, ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class FocusLostRule extends ValidationRule<BlurNotification> {\n type = ValidationRuleType.Error;\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 private _mouseEventTimer: number | undefined;\n private _releaseMouseEvent: (() => void) | 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 focused(event: FocusEvent): 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 blurred(event: FocusEvent): 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 || this._mouseEventTimer) {\n return null;\n }\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 const focusLostTimer = win.setTimeout(() => {\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 this.notify({\n element: target,\n id: \"focus-lost\",\n message: \"Focus lost.\",\n stack: this._lastBlurStack,\n relStack: this._lastFocusStack,\n position: targetPosition || [],\n });\n }\n }, this._focusLostTimeout);\n\n this._clearScheduledFocusLost = () => {\n delete this._clearScheduledFocusLost;\n win.clearTimeout(focusLostTimer);\n };\n\n return null;\n }\n\n start(): void {\n const win = this.window;\n\n if (!win) {\n return;\n }\n\n const onMouseEvent = () => {\n if (!this._mouseEventTimer) {\n this._mouseEventTimer = win.setTimeout(() => {\n this._mouseEventTimer = undefined;\n }, 0);\n }\n };\n\n win.addEventListener(\"mousedown\", onMouseEvent, true);\n win.addEventListener(\"mouseup\", onMouseEvent, true);\n win.addEventListener(\"mousemove\", onMouseEvent, true);\n\n this._releaseMouseEvent = () => {\n delete this._releaseMouseEvent;\n\n if (this._mouseEventTimer) {\n win.clearTimeout(this._mouseEventTimer);\n delete this._mouseEventTimer;\n }\n\n win.removeEventListener(\"mousedown\", onMouseEvent, true);\n win.removeEventListener(\"mouseup\", onMouseEvent, true);\n win.removeEventListener(\"mousemove\", onMouseEvent, true);\n };\n }\n\n stop(): void {\n this._releaseMouseEvent?.();\n this._clearScheduledFocusLost?.();\n this._focusedElement = undefined;\n this._focusedElementPosition = undefined;\n this._lastFocusStack = undefined;\n this._lastBlurStack = undefined;\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 { ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class BadFocusRule extends ValidationRule {\n type = ValidationRuleType.Error;\n name = \"bad-focus\";\n anchored = false;\n\n private _lastFocusStack: string[] | undefined;\n private _lastBlurStack: string[] | undefined;\n private _clearCheckTimer: (() => void) | undefined;\n\n focused(): null {\n this._lastFocusStack = getStackTrace();\n return null;\n }\n\n blurred(): null {\n const win = this.window;\n\n if (!win) {\n return null;\n }\n\n this._lastBlurStack = getStackTrace();\n\n this._clearCheckTimer?.();\n\n const checkTimer = win.setTimeout(() => {\n delete this._clearCheckTimer;\n\n if (\n document.activeElement &&\n !isElementVisible(document.activeElement as HTMLElement)\n ) {\n this.notify({\n id: \"bad-focus\",\n message: \"Focused stolen by invisible element.\",\n element: document.activeElement as HTMLElement,\n stack: this._lastBlurStack,\n relStack: this._lastFocusStack,\n });\n }\n }, 100);\n\n this._clearCheckTimer = () => {\n delete this._clearCheckTimer;\n win.clearTimeout(checkTimer);\n };\n\n return null;\n }\n\n stop(): void {\n this._clearCheckTimer?.();\n this._clearCheckTimer = undefined;\n this._lastFocusStack = undefined;\n this._lastBlurStack = undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { ValidationRule, ValidationResult, ValidationRuleType } from \"./base\";\n\nexport class FindElementRule extends ValidationRule {\n type = ValidationRuleType.Warning;\n name = \"find-element\";\n anchored = true;\n\n private _conditions: { [name: string]: (element: HTMLElement) => boolean } =\n {};\n\n addCondition(\n name: string,\n condition: (element: HTMLElement) => boolean,\n ): void {\n this._conditions[name] = condition;\n }\n\n removeCondition(name: string): void {\n delete this._conditions[name];\n }\n\n validate(element: HTMLElement): ValidationResult | null {\n for (const name of Object.keys(this._conditions)) {\n if (this._conditions[name](element)) {\n return {\n notification: {\n id: \"find-element\",\n message: `Element found: ${name}.`,\n element,\n },\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 */\nimport { ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class CustomNotifyRule extends ValidationRule {\n type = ValidationRuleType.Info;\n name = \"custom-notify\";\n anchored = false;\n\n customNotify(message: string, element?: HTMLElement): void {\n this.notify({\n id: \"custom-notify\",\n message,\n element,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAK,qBAAL,kBAAKA,wBAAL;AACL,EAAAA,wCAAA,WAAQ,KAAR;AACA,EAAAA,wCAAA;AACA,EAAAA,wCAAA;AAHU,SAAAA;AAAA,GAAA;AAyBL,IAAe,iBAAf,MAEL;AAAA,EAFK;AAKL,wBAAQ;AACR,wBAAQ,eAAqD,CAAC;AAC9D,wBAAQ;AAAA;AAAA,EAIR,OAAO,KACL,UACA,QACA,gBAIM;AACN,aAAS,UAAU;AACnB,aAAS,kBAAkB;AAAA,EAC7B;AAAA,EAEA,OAAO,QAAQ,UAAgC;AAC7C,aAAS,QAAQ;AAAA,EACnB;AAAA,EAEA,OAAO,gBACL,UACA,SACS;AACT,eAAW,aAAa,SAAS,aAAa;AAC5C,UAAI,UAAU,OAAO,GAAG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ACF;;;AClCO,IAAM,mBAAN,cAA+B,eAAe;AAAA,EAA9C;AAAA;AACL;AACA,gCAAO;AACP,oCAAW;AAAA;AAAA,EAEX,aAAa,SAAiB,SAA6B;AACzD,SAAK,OAAO;AAAA,MACV,IAAI;AAAA,MACJ;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AACF;","names":["ValidationRuleType","_a","node","rule"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/rules/base.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","inline-file:/Users/marata/Documents/Work/abledom/src/ui/hideall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/muteall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/showall.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/aligntopleft.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/aligntopright.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/alignbottomright.svg","inline-file:/Users/marata/Documents/Work/abledom/src/ui/alignbottomleft.svg","../src/ui/ui.ts","../src/utils.ts","../src/core.ts","../src/rules/atomic.ts","../src/rules/label.ts","../src/rules/existingid.ts","../src/rules/focuslost.ts","../src/rules/badfocus.ts","../src/rules/find.ts","../src/rules/notify.ts"],"sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport { AbleDOM } from \"./core\";\nexport { ValidationRule, ValidationRuleType } from \"./rules/base\";\nexport type {\n ValidationResult,\n ValidationNotification,\n BlurNotification,\n} 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\";\nexport { FindElementRule } from \"./rules/find\";\nexport { CustomNotifyRule } from \"./rules/notify\";\nexport {\n isAccessibilityAffectingElement,\n hasAccessibilityAttribute,\n matchesSelector,\n isDisplayNone,\n isElementVisible,\n} from \"./utils\";\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nexport enum ValidationRuleType {\n Error = 1,\n Warning,\n Info,\n}\n\nexport interface ValidationNotification {\n id: string;\n message: string;\n element?: HTMLElement;\n rel?: Node;\n link?: string;\n stack?: string[];\n relStack?: string[];\n}\n\nexport interface ValidationResult {\n notification?: ValidationNotification;\n dependsOnIds?: Set<string>;\n}\n\nexport interface BlurNotification extends ValidationNotification {\n position?: string[];\n}\n\nexport abstract class ValidationRule<\n N extends ValidationNotification = ValidationNotification,\n> {\n abstract type: ValidationRuleType;\n abstract name: string;\n private _window?: Window;\n private _exceptions: ((element: HTMLElement) => boolean)[] = [];\n private _onNotification:\n | ((rult: ValidationRule<N>, notification: N) => void)\n | undefined;\n\n static init(\n instance: ValidationRule,\n window: Window,\n onNotification: (\n rule: ValidationRule,\n notification: ValidationNotification,\n ) => void,\n ): void {\n instance._window = window;\n instance._onNotification = onNotification;\n }\n\n static dispose(instance: ValidationRule): void {\n instance.dispose();\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 private dispose(): void {\n this._window = undefined;\n this._onNotification = undefined;\n this._exceptions = [];\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 notify(notification: N): void {\n this._onNotification?.(this, notification);\n }\n\n focused?(event: FocusEvent): ValidationNotification | null;\n blurred?(event: FocusEvent): BlurNotification | null;\n}\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-report :focus-visible {\\n outline: 3px solid red;\\n mix-blend-mode: difference;\\n}\\n\\n#abledom-report.abledom-align-left {\\n left: 10px;\\n right: auto;\\n}\\n\\n#abledom-report.abledom-align-right {\\n left: auto;\\n right: 10px;\\n}\\n\\n#abledom-report.abledom-align-bottom {\\n bottom: 20px;\\n top: auto;\\n}\\n\\n#abledom-report.abledom-align-top {\\n /* flex-direction: column-reverse; */\\n bottom: auto;\\n top: 10px;\\n}\\n\\n.abledom-menu-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-block;\\n margin: 2px auto 2px 0;\\n}\\n\\n#abledom-report.abledom-align-right .abledom-menu-container {\\n margin: 2px 0 2px auto;\\n}\\n\\n.abledom-menu {\\n background-color: rgba(140, 10, 121, 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-menu .notifications-count {\\n margin: 0 8px;\\n display: inline-block;\\n}\\n\\n.abledom-menu .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-menu .align-button {\\n border-right-color: rgba(0, 0, 0, 0.4);\\n border-radius: 0;\\n margin: 0;\\n}\\n\\n.abledom-menu .align-button:active,\\n#abledom-report .pressed {\\n background: linear-gradient(\\n 180deg,\\n rgba(130, 130, 130, 1) 0%,\\n rgba(180, 180, 180, 1) 100%\\n );\\n}\\n\\n.abledom-menu .align-button-first {\\n border-top-left-radius: 6px;\\n border-bottom-left-radius: 6px;\\n margin-left: 8px;\\n}\\n.abledom-menu .align-button-last {\\n border-top-right-radius: 6px;\\n border-bottom-right-radius: 6px;\\n border-right-color: rgba(255, 255, 255, 0.4);\\n}\\n\\n.abledom-notifications-container {\\n overflow: scroll;\\n max-height: calc(100vh - 100px);\\n}\\n\\n#abledom-report.abledom-align-right .abledom-notifications-container {\\n text-align: right;\\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.abledom-notification_warning {\\n background-color: rgba(163, 82, 1, 0.7);\\n}\\n.abledom-notification_info {\\n background-color: rgba(0, 0, 255, 0.7);\\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>\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"1.67\\\" y1=\\\"1.67\\\" x2=\\\"18.33\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"1.67\\\" y1=\\\"1.67\\\" x2=\\\"18.33\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n <line x1=\\\"18.33\\\" y1=\\\"1.67\\\" x2=\\\"1.67\\\" y2=\\\"18.33\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <path d=\\\"M11.44 17.5a1.67 1.67 0 0 1-2.89 0\\\" stroke-width=\\\"1.5\\\"/>\\n <path d=\\\"M15 6.67a5 5 0 0 0-10 0v4.17a1.67 1.67 0 0 1-.83 1.44L3.33 14.17h13.34l-0.83-1.89a1.67 1.67 0 0 1-.83-1.44V6.67z\\\" stroke-width=\\\"1.5\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"3\\\" y=\\\"3\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"11\\\" y=\\\"3\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"11\\\" y=\\\"11\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","export default \"<svg width=\\\"20\\\" height=\\\"20\\\" viewBox=\\\"0 0 20 20\\\" fill=\\\"none\\\" stroke=\\\"currentColor\\\">\\n <rect x=\\\"3\\\" y=\\\"11\\\" width=\\\"6\\\" height=\\\"6\\\" stroke-width=\\\"2\\\"/>\\n</svg>\\n\";","/*!\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 {\n ValidationNotification,\n ValidationRule,\n ValidationRuleType,\n} 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\n// @ts-expect-error parsed assets\nimport svgHideAll from \"./hideall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgMuteAll from \"./muteall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgShowAll from \"./showall.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignTopLeft from \"./aligntopleft.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignTopRight from \"./aligntopright.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignBottomRight from \"./alignbottomright.svg?raw\";\n// @ts-expect-error parsed assets\nimport svgAlignBottomLeft from \"./alignbottomleft.svg?raw\";\n\nenum UIAlignments {\n BottomLeft = \"bottom-left\",\n BottomRight = \"bottom-right\",\n TopLeft = \"top-left\",\n TopRight = \"top-right\",\n}\n\nconst pressedClass = \"pressed\";\n\ninterface WindowWithAbleDOMDevtools extends Window {\n __ableDOMDevtools?: {\n revealElement?: (element: HTMLElement) => Promise<boolean>;\n };\n}\n\n// TODO: Adjust the types once the Trusted Types typings are available in the DOM lib.\ninterface WindowWithTrustedTypes extends Window {\n trustedTypes?: {\n createPolicy?: (\n name: string,\n policy: { createHTML: (html: string) => string },\n ) => {\n createHTML: (html: string) => string;\n };\n };\n}\n\nfunction createTrustedHTML(win: WindowWithTrustedTypes, html: string): string {\n const escapeHTMLPolicy = win.trustedTypes?.createPolicy?.(\"forceInner\", {\n createHTML: (html: string) => html,\n });\n\n return escapeHTMLPolicy ? escapeHTMLPolicy.createHTML(html) : html;\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 _notificationsUI: NotificationsUI | undefined;\n\n static setOnToggle(\n instance: NotificationUI,\n onToggle: (notificationUI: NotificationUI, show: boolean) => void,\n ) {\n instance._onToggle = onToggle;\n }\n\n private static _highlight: ElementHighlighter;\n\n private _win: Window;\n private _wrapper: HTMLElementWithAbleDOMUIFlag;\n private _rule: ValidationRule;\n private _onToggle:\n | ((notificationUI: NotificationUI, show: boolean) => void)\n | undefined;\n\n static getElement(instance: NotificationUI): HTMLElement {\n return instance._wrapper;\n }\n\n isHidden = false;\n\n constructor(win: Window, rule: ValidationRule) {\n this._win = win;\n this._rule = rule;\n\n if (!NotificationUI._notificationsUI) {\n NotificationUI._notificationsUI = new NotificationsUI(this._win);\n }\n\n this._wrapper = win.document.createElement(\n \"div\",\n ) as HTMLElementWithAbleDOMUIFlag;\n\n if (!NotificationUI._highlight) {\n NotificationUI._highlight = new ElementHighlighter(win);\n }\n\n NotificationUI._notificationsUI.addNotification(this);\n }\n\n update(notification: ValidationNotification): void {\n const win = this._win;\n const rule = this._rule;\n const wrapper = this._wrapper;\n const element = notification.element;\n\n wrapper.__abledomui = true;\n\n wrapper.innerHTML = createTrustedHTML(\n win,\n `\n <div class=\"abledom-notification-container\"><div class=\"abledom-notification${\n rule.type === ValidationRuleType.Warning\n ? \" abledom-notification_warning\"\n : rule.type === ValidationRuleType.Info\n ? \" abledom-notification_info\"\n : \"\"\n }\">\n <button class=\"button\" title=\"Log to Console\">${svgLog}</button>\n <button class=\"button\" title=\"Reveal in Elements panel\">${svgReveal}</button>\n ${notification.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\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: \",\n \"\\nmessage:\",\n notification.message,\n \"\\nelement:\",\n element,\n ...(notification.rel ? [\"\\nrelative:\", notification.rel] : []),\n \"\\nnotification:\",\n notification,\n );\n };\n\n const hasDevTools =\n !!(win as WindowWithAbleDOMDevtools).__ableDOMDevtools?.revealElement &&\n false; // Temtorarily disabling the devtools plugin integration.\n\n if (hasDevTools && element && 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 this.toggle(false);\n NotificationUI._highlight?.hide();\n };\n\n container.onmouseover = () => {\n element && NotificationUI._highlight?.highlight(element);\n };\n\n container.onmouseout = () => {\n NotificationUI._highlight?.hide();\n };\n }\n\n toggle(show: boolean, initial = false) {\n this.isHidden = !show;\n\n if (!initial) {\n this._onToggle?.(this, show);\n\n if (!this._rule.anchored && !show) {\n this.dispose();\n }\n }\n\n this._wrapper.style.display = show ? \"block\" : \"none\";\n }\n\n dispose() {\n this._wrapper.remove();\n NotificationUI._notificationsUI?.removeNotification(this);\n }\n}\n\nexport class NotificationsUI {\n private _win: Window;\n private _container: HTMLElement;\n private _notificationsContainer: HTMLElement;\n private _menuElement: HTMLElement;\n private _notificationCountElement: HTMLSpanElement | undefined;\n private _showAllButton: HTMLButtonElement | undefined;\n private _hideAllButton: HTMLButtonElement | undefined;\n private _alignBottomLeftButton: HTMLButtonElement | undefined;\n private _alignTopLeftButton: HTMLButtonElement | undefined;\n private _alignTopRightButton: HTMLButtonElement | undefined;\n private _alignBottomRightButton: HTMLButtonElement | undefined;\n\n private _isMuted = false;\n private _notifications: Set<NotificationUI> = new Set();\n\n constructor(win: Window) {\n this._win = win;\n\n const container = (this._container =\n win.document.createElement(\"div\")) as HTMLElementWithAbleDOMUIFlag;\n container.__abledomui = true;\n container.id = \"abledom-report\";\n container.innerHTML = createTrustedHTML(win, `<style>${css}</style>`);\n\n const notificationsContainer = (this._notificationsContainer =\n win.document.createElement(\"div\")) as HTMLDivElement;\n notificationsContainer.className = \"abledom-notifications-container\";\n container.appendChild(notificationsContainer);\n\n const menuElement = (this._menuElement =\n win.document.createElement(\"div\")) as HTMLDivElement;\n\n menuElement.className = \"abledom-menu-container\";\n menuElement.innerHTML = createTrustedHTML(\n win,\n `<div class=\"abledom-menu\"><span class=\"notifications-count\"></span\n ><button class=\"button\" title=\"Show all notifications\">${svgShowAll}</button\n ><button class=\"button\" title=\"Hide all notifications\">${svgHideAll}</button\n ><button class=\"button\" title=\"Mute newly appearing notifications\">${svgMuteAll}</button\n ><button class=\"button align-button align-button-first pressed\" title=\"Attach notifications to bottom left\">${svgAlignBottomLeft}</button\n ><button class=\"button align-button\" title=\"Attach notifications to top left\">${svgAlignTopLeft}</button\n ><button class=\"button align-button\" title=\"Attach notifications to top right\">${svgAlignTopRight}</button\n ><button class=\"button align-button align-button-last\" title=\"Attach notifications to bottom right\">${svgAlignBottomRight}</button\n ></div>`,\n );\n\n // Make sure the string HTML above unpacks properly to the assignment below.\n const [\n notificationCountElement,\n showAllButton,\n hideAllButton,\n muteButton,\n alignBottomLeftButton,\n alignTopLeftButton,\n alignTopRightButton,\n alignBottomRightButton,\n ] = menuElement.firstElementChild?.childNodes || [];\n\n if (\n notificationCountElement instanceof HTMLSpanElement &&\n showAllButton instanceof HTMLButtonElement &&\n hideAllButton instanceof HTMLButtonElement &&\n muteButton instanceof HTMLButtonElement &&\n alignBottomLeftButton instanceof HTMLButtonElement &&\n alignTopLeftButton instanceof HTMLButtonElement &&\n alignTopRightButton instanceof HTMLButtonElement &&\n alignBottomRightButton instanceof HTMLButtonElement\n ) {\n container.appendChild(menuElement);\n\n this._notificationCountElement = notificationCountElement;\n this._showAllButton = showAllButton;\n this._hideAllButton = hideAllButton;\n this._alignBottomLeftButton = alignBottomLeftButton;\n this._alignTopLeftButton = alignTopLeftButton;\n this._alignTopRightButton = alignTopRightButton;\n this._alignBottomRightButton = alignBottomRightButton;\n\n showAllButton.onclick = () => {\n this.showAll();\n };\n hideAllButton.onclick = () => {\n this.hideAll();\n };\n muteButton.onclick = () => {\n const isMuted = (this._isMuted =\n muteButton.classList.toggle(pressedClass));\n\n if (isMuted) {\n muteButton.setAttribute(\n \"title\",\n \"Unmute newly appearing notifications\",\n );\n } else {\n muteButton.setAttribute(\n \"title\",\n \"Mute newly appearing notifications\",\n );\n }\n };\n\n alignBottomLeftButton.onclick = () => {\n this.setUIAlignment(UIAlignments.BottomLeft);\n };\n alignBottomRightButton.onclick = () => {\n this.setUIAlignment(UIAlignments.BottomRight);\n };\n alignTopLeftButton.onclick = () => {\n this.setUIAlignment(UIAlignments.TopLeft);\n };\n alignTopRightButton.onclick = () => {\n this.setUIAlignment(UIAlignments.TopRight);\n };\n }\n\n win.document.body.appendChild(container);\n }\n\n private setUIAlignment(alignment: UIAlignments) {\n this._alignBottomLeftButton?.classList.remove(pressedClass);\n this._alignBottomRightButton?.classList.remove(pressedClass);\n this._alignTopLeftButton?.classList.remove(pressedClass);\n this._alignTopRightButton?.classList.remove(pressedClass);\n\n this._container.classList.remove(\n \"abledom-align-left\",\n \"abledom-align-right\",\n \"abledom-align-top\",\n \"abledom-align-bottom\",\n );\n let containerClasses: string[] = [];\n let notificationsFirst = false;\n\n switch (alignment) {\n case UIAlignments.BottomLeft:\n containerClasses = [\"abledom-align-left\", \"abledom-align-bottom\"];\n notificationsFirst = true;\n this._alignBottomLeftButton?.classList.add(pressedClass);\n break;\n case UIAlignments.BottomRight:\n containerClasses = [\"abledom-align-right\", \"abledom-align-bottom\"];\n notificationsFirst = true;\n this._alignBottomRightButton?.classList.add(pressedClass);\n break;\n case UIAlignments.TopLeft:\n containerClasses = [\"abledom-align-left\", \"abledom-align-top\"];\n this._alignTopLeftButton?.classList.add(pressedClass);\n break;\n case UIAlignments.TopRight:\n containerClasses = [\"abledom-align-right\", \"abledom-align-top\"];\n this._alignTopRightButton?.classList.add(pressedClass);\n break;\n }\n\n this._container.classList.add(...containerClasses);\n this._container.insertBefore(\n this._notificationsContainer,\n notificationsFirst ? this._menuElement : null,\n );\n }\n\n private _setNotificationsCount(count: number) {\n const countElement = this._notificationCountElement;\n\n if (countElement && count > 0) {\n countElement.innerHTML = createTrustedHTML(\n this._win,\n `<strong>${count}</strong> notification${count > 1 ? \"s\" : \"\"}`,\n );\n this._menuElement.style.display = \"block\";\n } else {\n this._menuElement.style.display = \"none\";\n }\n }\n\n private _setShowHideButtonsVisibility() {\n const showAllButton = this._showAllButton;\n const hideAllButton = this._hideAllButton;\n\n if (!showAllButton || !hideAllButton) {\n return;\n }\n\n let allHidden = true;\n let allVisible = true;\n\n for (let notification of this._notifications) {\n if (notification.isHidden) {\n allVisible = false;\n } else {\n allHidden = false;\n }\n\n if (!allHidden && !allVisible) {\n break;\n }\n }\n\n hideAllButton.style.display = allHidden ? \"none\" : \"block\";\n showAllButton.style.display = allVisible ? \"none\" : \"block\";\n }\n\n addNotification(notification: NotificationUI) {\n if (this._notifications.has(notification)) {\n return;\n }\n\n if (this._isMuted) {\n notification.toggle(false, true);\n }\n\n this._notifications.add(notification);\n this._notificationsContainer.appendChild(\n NotificationUI.getElement(notification),\n );\n\n NotificationUI.setOnToggle(notification, () => {\n this._setShowHideButtonsVisibility();\n });\n\n this._setNotificationsCount(this._notifications.size);\n this._setShowHideButtonsVisibility();\n }\n\n removeNotification(notification: NotificationUI) {\n if (!this._notifications.has(notification)) {\n return;\n }\n\n this._notifications.delete(notification);\n\n this._setNotificationsCount(this._notifications.size);\n this._setShowHideButtonsVisibility();\n }\n\n hideAll() {\n this._notifications.forEach((notification) => {\n notification.toggle(false);\n });\n this._setShowHideButtonsVisibility();\n }\n\n showAll() {\n this._notifications.forEach((notification) => {\n notification.toggle(true);\n });\n this._setShowHideButtonsVisibility();\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\nimport {\n NotificationUI,\n HTMLElementWithAbleDOMUIFlag,\n isAbleDOMUIElement,\n} from \"./ui/ui\";\nimport { isAccessibilityAffectingElement } from \"./utils\";\nimport { ValidationRule, ValidationNotification } from \"./rules/base\";\n\ninterface HTMLElementWithAbleDOM extends HTMLElement {\n __abledom?: {\n notifications?: Map<ValidationRule, NotificationUI>;\n };\n}\n\nexport class AbleDOM {\n private _win: Window;\n private _observer: MutationObserver;\n private _clearValidationTimeout: (() => void) | undefined;\n private _elementsWithNotifications: 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._win = 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, _elementsToRemove.has(node as HTMLElementWithAbleDOM));\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 _addNotification(\n rule: ValidationRule,\n notification: ValidationNotification,\n ) {\n const element = notification?.element as HTMLElementWithAbleDOM | undefined;\n\n if (!notification) {\n this._removeNotification(element || this._win.document.body, rule);\n return;\n }\n\n let notificationUI: NotificationUI | undefined;\n\n if (rule.anchored && element) {\n let abledomOnElement = element.__abledom;\n\n if (!abledomOnElement) {\n abledomOnElement = element.__abledom = {};\n }\n\n let notifications = abledomOnElement.notifications;\n\n if (!notifications) {\n notifications = abledomOnElement.notifications = new Map();\n }\n\n notificationUI = notifications.get(rule);\n\n if (!notificationUI) {\n notificationUI = new NotificationUI(this._win, rule);\n notifications.set(rule, notificationUI);\n }\n\n this._elementsWithNotifications.add(element);\n } else {\n notificationUI = new NotificationUI(this._win, rule);\n }\n\n notificationUI.update(notification);\n }\n\n private _removeNotification(\n element: HTMLElementWithAbleDOM,\n rule: ValidationRule,\n ) {\n if (!rule.anchored) {\n return;\n }\n\n const notifications = element.__abledom?.notifications;\n\n if (!notifications) {\n return;\n }\n\n const notification = notifications.get(rule);\n\n if (notification) {\n notification.dispose();\n notifications.delete(rule);\n }\n\n if (notifications.size === 0) {\n this._elementsWithNotifications.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?.notifications\n ) {\n const dependsOnIds = new Set<string>();\n\n for (const rule of this._rules) {\n if (!rule.validate || 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?.notification) {\n this._addNotification(rule, validationResult.notification);\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?.notifications?.has(rule)) {\n this._removeNotification(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?.notifications?.keys() || [])];\n rules.forEach((rule) => this._removeNotification(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 const focusNotification = rule.focused?.(event);\n\n if (focusNotification) {\n this._addNotification(rule, focusNotification);\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 const blurNotification = rule.blurred?.(event);\n\n if (blurNotification) {\n this._addNotification(rule, blurNotification);\n }\n }\n };\n\n private _notifyAsync = (\n rule: ValidationRule,\n notification: ValidationNotification,\n ): void => {\n this._addNotification(rule, notification);\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.init(rule, this._win, this._notifyAsync);\n rule.start?.();\n }\n\n this._startFunc?.();\n }\n\n dispose() {\n this._win.document.addEventListener(\"focusin\", this._onFocusIn, true);\n this._win.document.addEventListener(\"focusout\", this._onFocusOut, true);\n\n this._remove(this._elementsWithNotifications);\n this._elementsWithNotifications.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 ValidationRule.dispose(rule);\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, ValidationRuleType } from \"./base\";\n\nexport class AtomicRule extends ValidationRule {\n type = ValidationRuleType.Error;\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 notification: {\n id: \"focusable-in-atomic\",\n message: \"Focusable element inside atomic focusable.\",\n element,\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, ValidationRuleType } 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 type = ValidationRuleType.Error;\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 notification: isElementVisible(element)\n ? {\n id: \"focusable-element-label\",\n message: \"Focusable element must have a non-empty text label.\",\n element,\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, ValidationRuleType } from \"./base\";\n\nexport class ExistingIdRule extends ValidationRule {\n type = ValidationRuleType.Error;\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 notification: {\n id: \"missing-id\",\n message: `Elements with referenced ids do not extist.`,\n element,\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 { BlurNotification, ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class FocusLostRule extends ValidationRule<BlurNotification> {\n type = ValidationRuleType.Error;\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 private _mouseEventTimer: number | undefined;\n private _releaseMouseEvent: (() => void) | 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 focused(event: FocusEvent): 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 blurred(event: FocusEvent): 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 || this._mouseEventTimer) {\n return null;\n }\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 const focusLostTimer = win.setTimeout(() => {\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 this.notify({\n element: target,\n id: \"focus-lost\",\n message: \"Focus lost.\",\n stack: this._lastBlurStack,\n relStack: this._lastFocusStack,\n position: targetPosition || [],\n });\n }\n }, this._focusLostTimeout);\n\n this._clearScheduledFocusLost = () => {\n delete this._clearScheduledFocusLost;\n win.clearTimeout(focusLostTimer);\n };\n\n return null;\n }\n\n start(): void {\n const win = this.window;\n\n if (!win) {\n return;\n }\n\n const onMouseEvent = () => {\n if (!this._mouseEventTimer) {\n this._mouseEventTimer = win.setTimeout(() => {\n this._mouseEventTimer = undefined;\n }, 0);\n }\n };\n\n win.addEventListener(\"mousedown\", onMouseEvent, true);\n win.addEventListener(\"mouseup\", onMouseEvent, true);\n win.addEventListener(\"mousemove\", onMouseEvent, true);\n\n this._releaseMouseEvent = () => {\n delete this._releaseMouseEvent;\n\n if (this._mouseEventTimer) {\n win.clearTimeout(this._mouseEventTimer);\n delete this._mouseEventTimer;\n }\n\n win.removeEventListener(\"mousedown\", onMouseEvent, true);\n win.removeEventListener(\"mouseup\", onMouseEvent, true);\n win.removeEventListener(\"mousemove\", onMouseEvent, true);\n };\n }\n\n stop(): void {\n this._releaseMouseEvent?.();\n this._clearScheduledFocusLost?.();\n this._focusedElement = undefined;\n this._focusedElementPosition = undefined;\n this._lastFocusStack = undefined;\n this._lastBlurStack = undefined;\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 { ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class BadFocusRule extends ValidationRule {\n type = ValidationRuleType.Error;\n name = \"bad-focus\";\n anchored = false;\n\n private _lastFocusStack: string[] | undefined;\n private _lastBlurStack: string[] | undefined;\n private _clearCheckTimer: (() => void) | undefined;\n\n focused(): null {\n this._lastFocusStack = getStackTrace();\n return null;\n }\n\n blurred(): null {\n const win = this.window;\n\n if (!win) {\n return null;\n }\n\n this._lastBlurStack = getStackTrace();\n\n this._clearCheckTimer?.();\n\n const checkTimer = win.setTimeout(() => {\n delete this._clearCheckTimer;\n\n if (\n document.activeElement &&\n !isElementVisible(document.activeElement as HTMLElement)\n ) {\n this.notify({\n id: \"bad-focus\",\n message: \"Focused stolen by invisible element.\",\n element: document.activeElement as HTMLElement,\n stack: this._lastBlurStack,\n relStack: this._lastFocusStack,\n });\n }\n }, 100);\n\n this._clearCheckTimer = () => {\n delete this._clearCheckTimer;\n win.clearTimeout(checkTimer);\n };\n\n return null;\n }\n\n stop(): void {\n this._clearCheckTimer?.();\n this._clearCheckTimer = undefined;\n this._lastFocusStack = undefined;\n this._lastBlurStack = undefined;\n }\n}\n","/*!\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\nimport { ValidationRule, ValidationResult, ValidationRuleType } from \"./base\";\n\nexport class FindElementRule extends ValidationRule {\n type = ValidationRuleType.Warning;\n name = \"find-element\";\n anchored = true;\n\n private _conditions: { [name: string]: (element: HTMLElement) => boolean } =\n {};\n\n addCondition(\n name: string,\n condition: (element: HTMLElement) => boolean,\n ): void {\n this._conditions[name] = condition;\n }\n\n removeCondition(name: string): void {\n delete this._conditions[name];\n }\n\n validate(element: HTMLElement): ValidationResult | null {\n for (const name of Object.keys(this._conditions)) {\n if (this._conditions[name](element)) {\n return {\n notification: {\n id: \"find-element\",\n message: `Element found: ${name}.`,\n element,\n },\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 */\nimport { ValidationRule, ValidationRuleType } from \"./base\";\n\nexport class CustomNotifyRule extends ValidationRule {\n type = ValidationRuleType.Info;\n name = \"custom-notify\";\n anchored = false;\n\n customNotify(message: string, element?: HTMLElement): void {\n this.notify({\n id: \"custom-notify\",\n message,\n element,\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACKO,IAAK,qBAAL,kBAAKA,wBAAL;AACL,EAAAA,wCAAA,WAAQ,KAAR;AACA,EAAAA,wCAAA;AACA,EAAAA,wCAAA;AAHU,SAAAA;AAAA,GAAA;AAyBL,IAAe,iBAAf,MAEL;AAAA,EAFK;AAKL,wBAAQ;AACR,wBAAQ,eAAqD,CAAC;AAC9D,wBAAQ;AAAA;AAAA,EAIR,OAAO,KACL,UACA,QACA,gBAIM;AACN,aAAS,UAAU;AACnB,aAAS,kBAAkB;AAAA,EAC7B;AAAA,EAEA,OAAO,QAAQ,UAAgC;AAC7C,aAAS,QAAQ;AAAA,EACnB;AAAA,EAEA,OAAO,gBACL,UACA,SACS;AACT,eAAW,aAAa,SAAS,aAAa;AAC5C,UAAI,UAAU,OAAO,GAAG;AACtB,eAAO;AAAA,MACT;AAAA,IACF;AAEA,WAAO;AAAA,EACT;AAAA,EAEQ,UAAgB;AACtB,SAAK,UAAU;AACf,SAAK,kBAAkB;AACvB,SAAK,cAAc,CAAC;AAAA,EACtB;AAAA,EAEA,aAAa,gBAAyD;AA5ExE;AA6EI,eAAK,gBAAL,mBAAkB,KAAK;AAAA,EACzB;AAAA,EAEA,gBAAgB,gBAAyD;AACvE,UAAM,QAAQ,KAAK,YAAY,QAAQ,cAAc;AAErD,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