@ecopages/dev-toolbar 0.2.0-beta.30 → 0.2.0-beta.31

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ecopages/dev-toolbar",
3
- "version": "0.2.0-beta.30",
3
+ "version": "0.2.0-beta.31",
4
4
  "description": "Development toolbar for Ecopages",
5
5
  "keywords": [
6
6
  "ecopages",
@@ -10,10 +10,22 @@ import { RadiantElement } from '@ecopages/radiant';
10
10
  import { customElement } from '@ecopages/radiant/decorators/custom-element';
11
11
  import { state } from '@ecopages/radiant/decorators/state';
12
12
  import { toA11yBadge } from './a11y/a11y-badge.js';
13
- import { clearAuditCache, readAuditCache, writeAuditCache } from './a11y/audit-cache.js';
14
13
  import { resolveA11yIssueElement, runA11yChecks, toA11yIssueView } from './a11y/run-a11y-checks.js';
15
14
  import { groupA11yIssues } from './a11y/a11y-issue-groups.js';
16
15
  import { highlightElement } from '../runtime/highlight-element.js';
16
+ const auditCache = new Map();
17
+ function auditCacheKey(doc) {
18
+ return doc.defaultView?.location.href ?? '';
19
+ }
20
+ function readAuditCache(doc) {
21
+ return auditCache.get(auditCacheKey(doc));
22
+ }
23
+ function writeAuditCache(doc, issues) {
24
+ auditCache.set(auditCacheKey(doc), issues);
25
+ }
26
+ function clearAuditCache(doc) {
27
+ auditCache.delete(auditCacheKey(doc));
28
+ }
17
29
  let EcoDevToolbarA11y = class EcoDevToolbarA11y extends RadiantElement {
18
30
  axeRunning = false;
19
31
  issues = [];
@@ -1,6 +0,0 @@
1
- import type { A11yIssueView } from './run-a11y-checks.js';
2
- export declare function auditCacheKey(doc: Document): string;
3
- export declare function readAuditCache(doc: Document): A11yIssueView[] | undefined;
4
- export declare function writeAuditCache(doc: Document, issues: A11yIssueView[]): void;
5
- export declare function clearAuditCache(doc: Document): void;
6
- export declare function resetAuditCacheForTests(): void;
@@ -1,16 +0,0 @@
1
- const auditCache = new Map();
2
- export function auditCacheKey(doc) {
3
- return doc.defaultView?.location.href ?? '';
4
- }
5
- export function readAuditCache(doc) {
6
- return auditCache.get(auditCacheKey(doc));
7
- }
8
- export function writeAuditCache(doc, issues) {
9
- auditCache.set(auditCacheKey(doc), issues);
10
- }
11
- export function clearAuditCache(doc) {
12
- auditCache.delete(auditCacheKey(doc));
13
- }
14
- export function resetAuditCacheForTests() {
15
- auditCache.clear();
16
- }