accented 0.0.0-20250424114613 → 0.0.0-20250701143712
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -193
- package/dist/accented.d.ts +7 -7
- package/dist/accented.d.ts.map +1 -1
- package/dist/accented.js +30 -27
- package/dist/accented.js.map +1 -1
- package/dist/common/tokens.d.ts +2 -0
- package/dist/common/tokens.d.ts.map +1 -0
- package/dist/common/tokens.js +2 -0
- package/dist/common/tokens.js.map +1 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/dom-updater.d.ts +1 -1
- package/dist/dom-updater.d.ts.map +1 -1
- package/dist/dom-updater.js +14 -13
- package/dist/dom-updater.js.map +1 -1
- package/dist/elements/accented-dialog.d.ts +2 -3
- package/dist/elements/accented-dialog.d.ts.map +1 -1
- package/dist/elements/accented-dialog.js +14 -8
- package/dist/elements/accented-dialog.js.map +1 -1
- package/dist/elements/accented-trigger.d.ts +3 -4
- package/dist/elements/accented-trigger.d.ts.map +1 -1
- package/dist/elements/accented-trigger.js +10 -10
- package/dist/elements/accented-trigger.js.map +1 -1
- package/dist/fullscreen-listener.d.ts +1 -1
- package/dist/fullscreen-listener.d.ts.map +1 -1
- package/dist/fullscreen-listener.js +3 -4
- package/dist/fullscreen-listener.js.map +1 -1
- package/dist/intersection-observer.d.ts +1 -1
- package/dist/intersection-observer.d.ts.map +1 -1
- package/dist/intersection-observer.js +12 -6
- package/dist/intersection-observer.js.map +1 -1
- package/dist/log-and-rethrow.d.ts +1 -1
- package/dist/log-and-rethrow.d.ts.map +1 -1
- package/dist/log-and-rethrow.js +2 -3
- package/dist/log-and-rethrow.js.map +1 -1
- package/dist/logger.d.ts +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +2 -2
- package/dist/logger.js.map +1 -1
- package/dist/register-elements.d.ts +1 -1
- package/dist/register-elements.d.ts.map +1 -1
- package/dist/register-elements.js +6 -7
- package/dist/register-elements.js.map +1 -1
- package/dist/resize-listener.d.ts +1 -1
- package/dist/resize-listener.d.ts.map +1 -1
- package/dist/resize-listener.js +3 -4
- package/dist/resize-listener.js.map +1 -1
- package/dist/scanner.d.ts +2 -2
- package/dist/scanner.d.ts.map +1 -1
- package/dist/scanner.js +36 -36
- package/dist/scanner.js.map +1 -1
- package/dist/scroll-listeners.d.ts +1 -1
- package/dist/scroll-listeners.d.ts.map +1 -1
- package/dist/scroll-listeners.js +3 -4
- package/dist/scroll-listeners.js.map +1 -1
- package/dist/state.d.ts +1 -1
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +4 -5
- package/dist/state.js.map +1 -1
- package/dist/task-queue.d.ts +2 -2
- package/dist/task-queue.d.ts.map +1 -1
- package/dist/task-queue.js +1 -1
- package/dist/task-queue.js.map +1 -1
- package/dist/types.d.ts +102 -46
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/are-elements-with-issues-equal.d.ts +2 -2
- package/dist/utils/are-elements-with-issues-equal.d.ts.map +1 -1
- package/dist/utils/are-elements-with-issues-equal.js +3 -3
- package/dist/utils/are-elements-with-issues-equal.js.map +1 -1
- package/dist/utils/are-issue-sets-equal.d.ts +2 -2
- package/dist/utils/are-issue-sets-equal.d.ts.map +1 -1
- package/dist/utils/are-issue-sets-equal.js +3 -3
- package/dist/utils/are-issue-sets-equal.js.map +1 -1
- package/dist/utils/containing-blocks.d.ts.map +1 -1
- package/dist/utils/containing-blocks.js +1 -1
- package/dist/utils/containing-blocks.js.map +1 -1
- package/dist/utils/contains.d.ts +1 -1
- package/dist/utils/contains.d.ts.map +1 -1
- package/dist/utils/contains.js +1 -1
- package/dist/utils/contains.js.map +1 -1
- package/dist/utils/deduplicate-nodes.js +0 -1
- package/dist/utils/deduplicate-nodes.js.map +1 -1
- package/dist/utils/deep-merge.d.ts +1 -1
- package/dist/utils/deep-merge.d.ts.map +1 -1
- package/dist/utils/deep-merge.js +8 -5
- package/dist/utils/deep-merge.js.map +1 -1
- package/dist/utils/dom-helpers.d.ts.map +1 -1
- package/dist/utils/dom-helpers.js +4 -2
- package/dist/utils/dom-helpers.js.map +1 -1
- package/dist/utils/ensure-non-empty.d.ts +1 -1
- package/dist/utils/ensure-non-empty.d.ts.map +1 -1
- package/dist/utils/ensure-non-empty.js +2 -2
- package/dist/utils/ensure-non-empty.js.map +1 -1
- package/dist/utils/get-element-html.d.ts +1 -1
- package/dist/utils/get-element-html.d.ts.map +1 -1
- package/dist/utils/get-element-html.js +4 -2
- package/dist/utils/get-element-html.js.map +1 -1
- package/dist/utils/get-element-position.d.ts +2 -2
- package/dist/utils/get-element-position.d.ts.map +1 -1
- package/dist/utils/get-element-position.js +21 -25
- package/dist/utils/get-element-position.js.map +1 -1
- package/dist/utils/get-parent.d.ts +1 -1
- package/dist/utils/get-parent.d.ts.map +1 -1
- package/dist/utils/get-parent.js +1 -1
- package/dist/utils/get-parent.js.map +1 -1
- package/dist/utils/get-scan-context.d.ts +2 -2
- package/dist/utils/get-scan-context.d.ts.map +1 -1
- package/dist/utils/get-scan-context.js +9 -9
- package/dist/utils/get-scan-context.js.map +1 -1
- package/dist/utils/get-scrollable-ancestors.d.ts +1 -1
- package/dist/utils/get-scrollable-ancestors.d.ts.map +1 -1
- package/dist/utils/get-scrollable-ancestors.js +5 -5
- package/dist/utils/get-scrollable-ancestors.js.map +1 -1
- package/dist/utils/is-node-in-scan-context.d.ts +2 -2
- package/dist/utils/is-node-in-scan-context.d.ts.map +1 -1
- package/dist/utils/is-node-in-scan-context.js +5 -5
- package/dist/utils/is-node-in-scan-context.js.map +1 -1
- package/dist/utils/is-non-empty.d.ts +2 -0
- package/dist/utils/is-non-empty.d.ts.map +1 -0
- package/dist/utils/is-non-empty.js +4 -0
- package/dist/utils/is-non-empty.js.map +1 -0
- package/dist/utils/normalize-context.d.ts +2 -2
- package/dist/utils/normalize-context.d.ts.map +1 -1
- package/dist/utils/normalize-context.js +10 -8
- package/dist/utils/normalize-context.js.map +1 -1
- package/dist/utils/recalculate-positions.d.ts +1 -1
- package/dist/utils/recalculate-positions.d.ts.map +1 -1
- package/dist/utils/recalculate-positions.js +5 -5
- package/dist/utils/recalculate-positions.js.map +1 -1
- package/dist/utils/recalculate-scrollable-ancestors.d.ts +1 -1
- package/dist/utils/recalculate-scrollable-ancestors.d.ts.map +1 -1
- package/dist/utils/recalculate-scrollable-ancestors.js +4 -4
- package/dist/utils/recalculate-scrollable-ancestors.js.map +1 -1
- package/dist/utils/shadow-dom-aware-mutation-observer.d.ts +1 -1
- package/dist/utils/shadow-dom-aware-mutation-observer.d.ts.map +1 -1
- package/dist/utils/shadow-dom-aware-mutation-observer.js +19 -22
- package/dist/utils/shadow-dom-aware-mutation-observer.js.map +1 -1
- package/dist/utils/supports-anchor-positioning.d.ts +1 -1
- package/dist/utils/supports-anchor-positioning.d.ts.map +1 -1
- package/dist/utils/supports-anchor-positioning.js +1 -1
- package/dist/utils/supports-anchor-positioning.js.map +1 -1
- package/dist/utils/transform-violations.d.ts +2 -2
- package/dist/utils/transform-violations.d.ts.map +1 -1
- package/dist/utils/transform-violations.js +9 -9
- package/dist/utils/transform-violations.js.map +1 -1
- package/dist/utils/update-elements-with-issues.d.ts +3 -3
- package/dist/utils/update-elements-with-issues.d.ts.map +1 -1
- package/dist/utils/update-elements-with-issues.js +34 -29
- package/dist/utils/update-elements-with-issues.js.map +1 -1
- package/dist/validate-options.d.ts +2 -2
- package/dist/validate-options.d.ts.map +1 -1
- package/dist/validate-options.js +24 -23
- package/dist/validate-options.js.map +1 -1
- package/package.json +7 -4
- package/src/accented.test.ts +2 -2
- package/src/accented.ts +39 -32
- package/src/common/tokens.ts +1 -0
- package/src/constants.ts +1 -1
- package/src/dom-updater.ts +26 -19
- package/src/elements/accented-dialog.ts +69 -43
- package/src/elements/accented-trigger.ts +54 -43
- package/src/fullscreen-listener.ts +15 -11
- package/src/intersection-observer.ts +27 -16
- package/src/log-and-rethrow.ts +2 -3
- package/src/logger.ts +8 -6
- package/src/register-elements.ts +7 -7
- package/src/resize-listener.ts +15 -11
- package/src/scanner.ts +66 -50
- package/src/scroll-listeners.ts +27 -19
- package/src/state.ts +24 -21
- package/src/task-queue.test.ts +5 -4
- package/src/task-queue.ts +2 -2
- package/src/types.ts +151 -95
- package/src/utils/are-elements-with-issues-equal.ts +7 -5
- package/src/utils/are-issue-sets-equal.test.ts +10 -6
- package/src/utils/are-issue-sets-equal.ts +8 -6
- package/src/utils/containing-blocks.ts +6 -3
- package/src/utils/contains.test.ts +2 -2
- package/src/utils/contains.ts +1 -1
- package/src/utils/deduplicate-nodes.ts +1 -1
- package/src/utils/deep-merge.test.ts +8 -1
- package/src/utils/deep-merge.ts +14 -8
- package/src/utils/dom-helpers.ts +6 -2
- package/src/utils/ensure-non-empty.ts +2 -2
- package/src/utils/get-element-html.ts +4 -2
- package/src/utils/get-element-position.ts +37 -24
- package/src/utils/get-parent.ts +1 -1
- package/src/utils/get-scan-context.test.ts +14 -8
- package/src/utils/get-scan-context.ts +12 -15
- package/src/utils/get-scrollable-ancestors.ts +8 -5
- package/src/utils/is-node-in-scan-context.test.ts +3 -3
- package/src/utils/is-node-in-scan-context.ts +6 -6
- package/src/utils/is-non-empty.ts +3 -0
- package/src/utils/normalize-context.test.ts +9 -9
- package/src/utils/normalize-context.ts +17 -10
- package/src/utils/recalculate-positions.ts +5 -5
- package/src/utils/recalculate-scrollable-ancestors.ts +4 -4
- package/src/utils/shadow-dom-aware-mutation-observer.ts +21 -24
- package/src/utils/supports-anchor-positioning.ts +3 -3
- package/src/utils/transform-violations.test.ts +22 -20
- package/src/utils/transform-violations.ts +14 -10
- package/src/utils/update-elements-with-issues.test.ts +49 -49
- package/src/utils/update-elements-with-issues.ts +96 -71
- package/src/validate-options.ts +91 -38
package/dist/scanner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scanner.js","sourceRoot":"","sources":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C,CAAC,CAAC;IAEH,gBAAgB,CAAC,OAAO,CAAC,QAAQ,EAAE;QACjC,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE,IAAI;KACpB,CAAC,CAAC;IAEH,OAAO,GAAG,EAAE;QACV,gBAAgB,CAAC,UAAU,EAAE,CAAC;IAChC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function setupScrollListeners(): () => void;
|
|
2
2
|
//# sourceMappingURL=scroll-listeners.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-listeners.d.ts","sourceRoot":"","sources":["../src/scroll-listeners.ts"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"scroll-listeners.d.ts","sourceRoot":"","sources":["../src/scroll-listeners.ts"],"names":[],"mappings":"AAKA,wBAAgB,oBAAoB,eAuCnC"}
|
package/dist/scroll-listeners.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { effect } from '@preact/signals-core';
|
|
2
|
-
import
|
|
2
|
+
import { logAndRethrow } from './log-and-rethrow.js';
|
|
3
3
|
import { scrollableAncestors } from './state.js';
|
|
4
|
-
import
|
|
5
|
-
export
|
|
4
|
+
import { recalculatePositions } from './utils/recalculate-positions.js';
|
|
5
|
+
export function setupScrollListeners() {
|
|
6
6
|
const documentAbortController = new AbortController();
|
|
7
7
|
document.addEventListener('scroll', () => {
|
|
8
8
|
try {
|
|
@@ -34,5 +34,4 @@ export default function setupScrollListeners() {
|
|
|
34
34
|
disposeOfEffect();
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
;
|
|
38
37
|
//# sourceMappingURL=scroll-listeners.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-listeners.js","sourceRoot":"","sources":["../src/scroll-listeners.ts"],"names":[],"mappings":"AAAA,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,CAAC,CAAC,CAAC;IAEH,OAAO,GAAG,EAAE;QACV,uBAAuB,CAAC,KAAK,EAAE,CAAC;QAChC,eAAe,EAAE,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC"}
|
package/dist/state.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ElementWithIssues, ExtendedElementWithIssues } from './types';
|
|
1
|
+
import type { ElementWithIssues, ExtendedElementWithIssues } from './types.ts';
|
|
2
2
|
export declare const enabled: import("@preact/signals-core").Signal<boolean>;
|
|
3
3
|
export declare const extendedElementsWithIssues: import("@preact/signals-core").Signal<ExtendedElementWithIssues[]>;
|
|
4
4
|
export declare const elementsWithIssues: import("@preact/signals-core").ReadonlySignal<ElementWithIssues[]>;
|
package/dist/state.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE/E,eAAO,MAAM,OAAO,gDAAgB,CAAC;AAErC,eAAO,MAAM,0BAA0B,oEAA+C,CAAC;AAEvF,eAAO,MAAM,kBAAkB,oEAM9B,CAAC;AAEF,eAAO,MAAM,SAAS,0DASrB,CAAC;AAEF,eAAO,MAAM,mBAAmB,6DAO/B,CAAC"}
|
package/dist/state.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { computed, signal } from '@preact/signals-core';
|
|
2
2
|
export const enabled = signal(false);
|
|
3
3
|
export const extendedElementsWithIssues = signal([]);
|
|
4
|
-
export const elementsWithIssues = computed(() => extendedElementsWithIssues.value.map(extendedElementWithIssues => ({
|
|
4
|
+
export const elementsWithIssues = computed(() => extendedElementsWithIssues.value.map((extendedElementWithIssues) => ({
|
|
5
5
|
element: extendedElementWithIssues.element,
|
|
6
6
|
rootNode: extendedElementWithIssues.rootNode,
|
|
7
|
-
issues: extendedElementWithIssues.issues.value
|
|
7
|
+
issues: extendedElementWithIssues.issues.value,
|
|
8
8
|
})));
|
|
9
|
-
export const rootNodes = computed(() => new Set((enabled.value ? [document] : [])
|
|
10
|
-
.concat(...(extendedElementsWithIssues.value.map(extendedElementWithIssues => extendedElementWithIssues.rootNode)))));
|
|
9
|
+
export const rootNodes = computed(() => new Set((enabled.value ? [document] : []).concat(...extendedElementsWithIssues.value.map((extendedElementWithIssues) => extendedElementWithIssues.rootNode))));
|
|
11
10
|
export const scrollableAncestors = computed(() => extendedElementsWithIssues.value.reduce((scrollableAncestors, extendedElementWithIssues) => {
|
|
12
11
|
for (const scrollableAncestor of extendedElementWithIssues.scrollableAncestors.value) {
|
|
13
12
|
scrollableAncestors.add(scrollableAncestor);
|
package/dist/state.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"state.js","sourceRoot":"","sources":["../src/state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAIxD,MAAM,CAAC,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;AAErC,MAAM,CAAC,MAAM,0BAA0B,GAAG,MAAM,CAAmC,EAAE,CAAC,CAAC;AAEvF,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAA2B,GAAG,EAAE,CACxE,0BAA0B,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC;IACnE,OAAO,EAAE,yBAAyB,CAAC,OAAO;IAC1C,QAAQ,EAAE,yBAAyB,CAAC,QAAQ;IAC5C,MAAM,EAAE,yBAAyB,CAAC,MAAM,CAAC,KAAK;CAC/C,CAAC,CAAC,CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,SAAS,GAAG,QAAQ,CAC/B,GAAG,EAAE,CACH,IAAI,GAAG,CACL,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAgB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAC9C,GAAG,0BAA0B,CAAC,KAAK,CAAC,GAAG,CACrC,CAAC,yBAAyB,EAAE,EAAE,CAAC,yBAAyB,CAAC,QAAQ,CAClE,CACF,CACF,CACJ,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,CAAe,GAAG,EAAE,CAC7D,0BAA0B,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,mBAAmB,EAAE,yBAAyB,EAAE,EAAE;IACzF,KAAK,MAAM,kBAAkB,IAAI,yBAAyB,CAAC,mBAAmB,CAAC,KAAK,EAAE,CAAC;QACrF,mBAAmB,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC,EAAE,IAAI,GAAG,EAAW,CAAC,CACvB,CAAC"}
|
package/dist/task-queue.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Throttle } from './types';
|
|
1
|
+
import type { Throttle } from './types.ts';
|
|
2
2
|
type TaskCallback<T> = (items: Array<T>) => void;
|
|
3
|
-
export
|
|
3
|
+
export declare class TaskQueue<T> {
|
|
4
4
|
#private;
|
|
5
5
|
constructor(asyncCallback: TaskCallback<T>, throttle: Required<Throttle>);
|
|
6
6
|
addMultiple(items: Array<T>): void;
|
package/dist/task-queue.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-queue.d.ts","sourceRoot":"","sources":["../src/task-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"task-queue.d.ts","sourceRoot":"","sources":["../src/task-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,KAAK,YAAY,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;AAEjD,qBAAa,SAAS,CAAC,CAAC;;gBAOV,aAAa,EAAE,YAAY,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAqCxE,WAAW,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;IAS3B,GAAG,CAAC,IAAI,EAAE,CAAC;CAGZ"}
|
package/dist/task-queue.js
CHANGED
package/dist/task-queue.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"task-queue.js","sourceRoot":"","sources":["../src/task-queue.ts"],"names":[],"mappings":"AAIA,MAAM,
|
|
1
|
+
{"version":3,"file":"task-queue.js","sourceRoot":"","sources":["../src/task-queue.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,SAAS;IACpB,SAAS,CAAW;IACpB,cAAc,GAA2B,IAAI,CAAC;IAE9C,MAAM,GAAG,IAAI,GAAG,EAAK,CAAC;IACtB,UAAU,GAAG,KAAK,CAAC;IAEnB,YAAY,aAA8B,EAAE,QAA4B;QACtE,IAAI,CAAC,cAAc,GAAG,aAAa,CAAC;QACpC,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;IAC5B,CAAC;IAED,KAAK,CAAC,OAAO;QACX,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,OAAO;QACT,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QAEvB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YAC5B,MAAM,IAAI,OAAO,CAAC,CA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-
import type
|
|
2
|
+
import type axe from 'axe-core';
|
|
3
|
+
import type { AccentedTrigger } from './elements/accented-trigger.ts';
|
|
4
4
|
export type Throttle = {
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* How long Accented must wait (in milliseconds) to run a scan after a mutation or after the previous scan (whichever finished last).
|
|
7
|
+
*
|
|
8
|
+
* If the page you’re scanning has a lot of nodes,
|
|
9
|
+
* scanning may take a noticeable time (~ a few hundred milliseconds),
|
|
10
|
+
* during which time the main thread will be blocked most of the time.
|
|
7
11
|
*
|
|
8
|
-
*
|
|
12
|
+
* You may want to experiment with this value if your page contents change frequently
|
|
13
|
+
* or if it has JavaScript-based animations running on the main thread.
|
|
14
|
+
*
|
|
15
|
+
* @default 1000
|
|
9
16
|
* */
|
|
10
17
|
wait?: number;
|
|
11
18
|
/**
|
|
12
|
-
*
|
|
19
|
+
* If `leading` is set to `true`, the scan runs immediately after a mutation.
|
|
20
|
+
* In this case, `wait` only applies to subsequent scans,
|
|
21
|
+
* giving the page at least `wait` milliseconds between the end of the previous scan
|
|
22
|
+
* and the beginning of the next one.
|
|
13
23
|
*
|
|
14
|
-
* If `
|
|
24
|
+
* If `leading` is set to `false`, the wait applies to mutations as well,
|
|
25
|
+
* delaying the output.
|
|
26
|
+
* This may be useful if you’re expecting quick bursts of mutations on your page.
|
|
15
27
|
*
|
|
16
|
-
*
|
|
28
|
+
* @default true
|
|
17
29
|
* */
|
|
18
30
|
leading?: boolean;
|
|
19
31
|
};
|
|
20
32
|
export type Output = {
|
|
21
33
|
/**
|
|
22
|
-
* Whether
|
|
34
|
+
* Whether the list of elements with issues should be printed to the browser console whenever issues are added, removed, or changed.
|
|
23
35
|
*
|
|
24
|
-
*
|
|
36
|
+
* @default true
|
|
25
37
|
* */
|
|
26
38
|
console?: boolean;
|
|
27
39
|
};
|
|
@@ -41,47 +53,32 @@ export type ContextObject = {
|
|
|
41
53
|
};
|
|
42
54
|
export type Context = ContextProp | ContextObject;
|
|
43
55
|
export declare const allowedAxeOptions: readonly ["rules", "runOnly"];
|
|
44
|
-
export type AxeOptions = Pick<axe.RunOptions, typeof allowedAxeOptions[number]>;
|
|
56
|
+
export type AxeOptions = Pick<axe.RunOptions, (typeof allowedAxeOptions)[number]>;
|
|
45
57
|
type CallbackParams = {
|
|
46
58
|
/**
|
|
47
|
-
* The most
|
|
59
|
+
* The most up-to-date array of all elements with accessibility issues.
|
|
48
60
|
* */
|
|
49
61
|
elementsWithIssues: Array<ElementWithIssues>;
|
|
50
62
|
/**
|
|
51
|
-
*
|
|
52
|
-
*
|
|
63
|
+
* Runtime performance of the last scan. An object with the following props:
|
|
64
|
+
* - `totalBlockingTime`: how long the main thread was blocked by Accented during the last scan, in milliseconds.
|
|
53
65
|
* It’s further divided into the `scan` and `domUpdate` phases.
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* * `scanContext`: nodes that got scanned. Either an array of nodes,
|
|
57
|
-
* or an object with `include` and `exclude` properties (if any nodes were excluded).
|
|
66
|
+
* - `scan`: how long scanning (the execution of `axe.run()`) took, in milliseconds.
|
|
67
|
+
* - `domUpdate`: how long the DOM update (adding / removing outlines and dialog trigger buttons) took, in milliseconds.
|
|
58
68
|
* */
|
|
59
69
|
performance: {
|
|
60
70
|
totalBlockingTime: number;
|
|
61
71
|
scan: number;
|
|
62
72
|
domUpdate: number;
|
|
63
|
-
scanContext: ScanContext | Array<Node>;
|
|
64
73
|
};
|
|
74
|
+
/**
|
|
75
|
+
* Nodes that got scanned. Either an array of nodes,
|
|
76
|
+
* or an object with `include` and `exclude` properties (if any nodes were excluded).
|
|
77
|
+
*/
|
|
78
|
+
scanContext: ScanContext | Array<Node>;
|
|
65
79
|
};
|
|
66
80
|
export type Callback = (params: CallbackParams) => void;
|
|
67
81
|
export type AccentedOptions = {
|
|
68
|
-
/**
|
|
69
|
-
* The `context` parameter for `axe.run()`.
|
|
70
|
-
*
|
|
71
|
-
* Determines what element(s) to scan for accessibility issues.
|
|
72
|
-
*
|
|
73
|
-
* Accepts a variety of shapes:
|
|
74
|
-
* * an element reference;
|
|
75
|
-
* * a selector;
|
|
76
|
-
* * a `NodeList`;
|
|
77
|
-
* * an include / exclude object;
|
|
78
|
-
* * and more.
|
|
79
|
-
*
|
|
80
|
-
* See documentation: https://www.deque.com/axe/core-documentation/api-documentation/#context-parameter
|
|
81
|
-
*
|
|
82
|
-
* Default: `document`.
|
|
83
|
-
*/
|
|
84
|
-
context?: Context;
|
|
85
82
|
/**
|
|
86
83
|
* The `options` parameter for `axe.run()`.
|
|
87
84
|
*
|
|
@@ -94,13 +91,70 @@ export type AccentedOptions = {
|
|
|
94
91
|
*
|
|
95
92
|
* See documentation: https://www.deque.com/axe/core-documentation/api-documentation/#options-parameter
|
|
96
93
|
*
|
|
97
|
-
*
|
|
94
|
+
* @default {}
|
|
98
95
|
*/
|
|
99
96
|
axeOptions?: AxeOptions;
|
|
97
|
+
/**
|
|
98
|
+
* A function that will be called after each scan.
|
|
99
|
+
*
|
|
100
|
+
* Potential uses:
|
|
101
|
+
|
|
102
|
+
* - do something with the scan results,
|
|
103
|
+
* for example send them to a backend for storage and analysis;
|
|
104
|
+
* - analyze Accented’s performance.
|
|
105
|
+
*
|
|
106
|
+
* @default () => {}
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
*
|
|
110
|
+
* accented({
|
|
111
|
+
* callback: ({ elementsWithIssues, performance, scanContext }) => {
|
|
112
|
+
* console.log('Elements with issues:', elementsWithIssues);
|
|
113
|
+
* console.log('Total blocking time:', performance.totalBlockingTime);
|
|
114
|
+
* console.log('Scan context:', scanContext);
|
|
115
|
+
* }
|
|
116
|
+
* });
|
|
117
|
+
*
|
|
118
|
+
* */
|
|
119
|
+
callback?: Callback;
|
|
120
|
+
/**
|
|
121
|
+
* The `context` parameter for `axe.run()`.
|
|
122
|
+
*
|
|
123
|
+
* Determines what part(s) of the page to scan for accessibility issues.
|
|
124
|
+
*
|
|
125
|
+
* Accepts a variety of shapes:
|
|
126
|
+
*
|
|
127
|
+
* - a [`Node`](https://developer.mozilla.org/en-US/docs/Web/API/Node) (in practice it will likely be an instance of [`Element`](https://developer.mozilla.org/en-US/docs/Web/API/Element), [`Document`](https://developer.mozilla.org/en-US/docs/Web/API/Document), or [`DocumentFragment`](https://developer.mozilla.org/en-US/docs/Web/API/DocumentFragment));
|
|
128
|
+
* - a valid [CSS selector](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_selectors);
|
|
129
|
+
* - an object for selecting elements within shadow DOM,
|
|
130
|
+
* whose shape is `{ fromShadowDom: [selector1, selector2, ...] }`,
|
|
131
|
+
* where `selector1`, `selector2`, etc. select shadow hosts, and the last selector selects the actual context.
|
|
132
|
+
* `selector2` in this example is _within_ the shadow root created on the element(s) that match `selector1`,
|
|
133
|
+
* so in practice you shouldn’t have more than two elements in such an array
|
|
134
|
+
* unless you have a very complex structure with multiple shadow DOM layers;
|
|
135
|
+
* - a [`NodeList`](https://developer.mozilla.org/en-US/docs/Web/API/NodeList) (likely a result of a [`querySelectorAll()`](https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll) call);
|
|
136
|
+
* - an array containing any combination of selectors, nodes, or shadow DOM objects (described above);
|
|
137
|
+
* - an object containing `include` and / or `exclude` properties.
|
|
138
|
+
* It’s useful if you’d like to exclude certain elements or parts of the page.
|
|
139
|
+
* The values for `include` and `exclude` can take any of the above shapes.
|
|
140
|
+
* It’s unlikely that you’d want to have complex `include` / `exclude` rules,
|
|
141
|
+
* but if you do, the exact behavior is documented by the relevant tests:
|
|
142
|
+
* [`is-node-in-scan-context.test.ts`](https://github.com/pomerantsev/accented/blob/main/packages/accented/src/utils/is-node-in-scan-context.test.ts).
|
|
143
|
+
*
|
|
144
|
+
* See also the documentation for the [`context` parameter of `axe.run()`](https://www.deque.com/axe/core-documentation/api-documentation/#context-parameter),
|
|
145
|
+
* which the `context` option from Accented mostly mirrors
|
|
146
|
+
* (note that Accented doesn’t support the `fromFrames` object shape).
|
|
147
|
+
*
|
|
148
|
+
* @default document
|
|
149
|
+
*/
|
|
150
|
+
context?: Context;
|
|
100
151
|
/**
|
|
101
152
|
* The character sequence that’s used in various elements, attributes and stylesheets that Accented adds to the page.
|
|
153
|
+
*
|
|
154
|
+
* You shouldn’t have to provide this prop unless some of the names on your page have "accented" in it and conflict with what Accented provides by default.
|
|
155
|
+
*
|
|
102
156
|
* * The data attribute that’s added to elements with issues (default: `data-accented`).
|
|
103
|
-
* * The custom elements for the button and the dialog that get created for each element with issues
|
|
157
|
+
* * The names of custom elements for the button and the dialog that get created for each element with issues
|
|
104
158
|
* (default: `accented-trigger`, `accented-dialog`).
|
|
105
159
|
* * The CSS cascade layer containing page-wide Accented-specific styles (default: `accented`).
|
|
106
160
|
* * The prefix for some of the CSS custom properties used by Accented (default: `--accented-`).
|
|
@@ -110,23 +164,25 @@ export type AccentedOptions = {
|
|
|
110
164
|
* Only lowercase alphanumeric characters and dashes (-) are allowed in the name,
|
|
111
165
|
* and it must start with a lowercase letter.
|
|
112
166
|
*
|
|
113
|
-
*
|
|
167
|
+
* @default 'accented'
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
*
|
|
171
|
+
* accented({name: 'my-name'});
|
|
172
|
+
*
|
|
173
|
+
* With the above option provided, the attribute set on elements with issues will be `data-my-name`,
|
|
174
|
+
* a custom element will be called `my-name-trigger`, and so on.
|
|
175
|
+
*
|
|
114
176
|
*/
|
|
115
177
|
name?: string;
|
|
116
178
|
/**
|
|
117
|
-
*
|
|
179
|
+
* An object controlling how the results of scans are presented.
|
|
118
180
|
* */
|
|
119
181
|
output?: Output;
|
|
120
182
|
/**
|
|
121
|
-
*
|
|
183
|
+
* An object controlling at what moments Accented will run its scans.
|
|
122
184
|
* */
|
|
123
185
|
throttle?: Throttle;
|
|
124
|
-
/**
|
|
125
|
-
* A callback that will be called after each scan.
|
|
126
|
-
*
|
|
127
|
-
* Default: `() => {}`.
|
|
128
|
-
* */
|
|
129
|
-
callback?: Callback;
|
|
130
186
|
};
|
|
131
187
|
/**
|
|
132
188
|
* A function that fully disables Accented,
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAEtE,MAAM,MAAM,QAAQ,GAAG;IACrB;;;;;;;;;;;SAWK;IACL,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;;;;;SAWK;IACL,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG;IACnB;;;;SAIK;IACL,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF;;;GAGG;AAEH,MAAM,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAIzE,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,QAAQ,CAAC;AAGtD,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,YAAY,CAAC;AAElD,MAAM,MAAM,aAAa,GACrB;IACE,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,GACD;IACE,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB,CAAC;AAEN,MAAM,MAAM,OAAO,GAAG,WAAW,GAAG,aAAa,CAAC;AAElD,eAAO,MAAM,iBAAiB,+BAAgC,CAAC;AAE/D,MAAM,MAAM,UAAU,GAAG,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IACd,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,WAAW,GAAG,UAAU,CAAC;IAClC,QAAQ,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,GAAG;IACtD,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,qBAAqB,GAAG;IAC9D,MAAM,EAAE,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,OAAO,EAAE,eAAe,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC3B,UAAU,EAAE,OAAO,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,EAAE,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1C,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACrB,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;CACtB,CAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAqEA,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BaseElementWithIssues } from
|
|
2
|
-
export
|
|
1
|
+
import type { BaseElementWithIssues } from '../types.ts';
|
|
2
|
+
export declare function areElementsWithIssuesEqual(elementWithIssues1: BaseElementWithIssues, elementWithIssues2: BaseElementWithIssues): boolean;
|
|
3
3
|
//# sourceMappingURL=are-elements-with-issues-equal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"are-elements-with-issues-equal.d.ts","sourceRoot":"","sources":["../../src/utils/are-elements-with-issues-equal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"are-elements-with-issues-equal.d.ts","sourceRoot":"","sources":["../../src/utils/are-elements-with-issues-equal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzD,wBAAgB,0BAA0B,CACxC,kBAAkB,EAAE,qBAAqB,EACzC,kBAAkB,EAAE,qBAAqB,WAM1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
return elementWithIssues1.element === elementWithIssues2.element
|
|
3
|
-
|
|
1
|
+
export function areElementsWithIssuesEqual(elementWithIssues1, elementWithIssues2) {
|
|
2
|
+
return (elementWithIssues1.element === elementWithIssues2.element &&
|
|
3
|
+
elementWithIssues1.rootNode === elementWithIssues2.rootNode);
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=are-elements-with-issues-equal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"are-elements-with-issues-equal.js","sourceRoot":"","sources":["../../src/utils/are-elements-with-issues-equal.ts"],"names":[],"mappings":"AAEA,MAAM,
|
|
1
|
+
{"version":3,"file":"are-elements-with-issues-equal.js","sourceRoot":"","sources":["../../src/utils/are-elements-with-issues-equal.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,0BAA0B,CACxC,kBAAyC,EACzC,kBAAyC;IAEzC,OAAO,CACL,kBAAkB,CAAC,OAAO,KAAK,kBAAkB,CAAC,OAAO;QACzD,kBAAkB,CAAC,QAAQ,KAAK,kBAAkB,CAAC,QAAQ,CAC5D,CAAC;AACJ,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Issue } from '../types';
|
|
2
|
-
export
|
|
1
|
+
import type { Issue } from '../types.ts';
|
|
2
|
+
export declare function areIssueSetsEqual(issues1: Array<Issue>, issues2: Array<Issue>): boolean;
|
|
3
3
|
//# sourceMappingURL=are-issue-sets-equal.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"are-issue-sets-equal.d.ts","sourceRoot":"","sources":["../../src/utils/are-issue-sets-equal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"are-issue-sets-equal.d.ts","sourceRoot":"","sources":["../../src/utils/are-issue-sets-equal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAIzC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,WAO7E"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const issueProps = ['id', 'title', 'description', 'url', 'impact'];
|
|
2
|
-
export
|
|
3
|
-
return issues1.length === issues2.length &&
|
|
4
|
-
issues1.every(issue1 => Boolean(issues2.find(issue2 => issueProps.every(prop => issue2[prop] === issue1[prop]))));
|
|
2
|
+
export function areIssueSetsEqual(issues1, issues2) {
|
|
3
|
+
return (issues1.length === issues2.length &&
|
|
4
|
+
issues1.every((issue1) => Boolean(issues2.find((issue2) => issueProps.every((prop) => issue2[prop] === issue1[prop])))));
|
|
5
5
|
}
|
|
6
6
|
//# sourceMappingURL=are-issue-sets-equal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"are-issue-sets-equal.js","sourceRoot":"","sources":["../../src/utils/are-issue-sets-equal.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAEvF,MAAM,
|
|
1
|
+
{"version":3,"file":"are-issue-sets-equal.js","sourceRoot":"","sources":["../../src/utils/are-issue-sets-equal.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,GAAuB,CAAC,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAEvF,MAAM,UAAU,iBAAiB,CAAC,OAAqB,EAAE,OAAqB;IAC5E,OAAO,CACL,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,MAAM;QACjC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,CACvB,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAC7F,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containing-blocks.d.ts","sourceRoot":"","sources":["../../src/utils/containing-blocks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"containing-blocks.d.ts","sourceRoot":"","sources":["../../src/utils/containing-blocks.ts"],"names":[],"mappings":"AAuCA,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,mBAAmB,WAErE;AAED,wBAAgB,mCAAmC,SAgBlD"}
|
|
@@ -35,7 +35,7 @@ export function initializeContainingBlockSupportSet() {
|
|
|
35
35
|
const propsToTest = [
|
|
36
36
|
{ prop: 'filter', value: 'blur(1px)' },
|
|
37
37
|
{ prop: 'backdropFilter', value: 'blur(1px)' },
|
|
38
|
-
{ prop: 'containerType', value: 'size' }
|
|
38
|
+
{ prop: 'containerType', value: 'size' },
|
|
39
39
|
];
|
|
40
40
|
for (const { prop, value } of propsToTest) {
|
|
41
41
|
if (testContainingBlockCreation(prop, value)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"containing-blocks.js","sourceRoot":"","sources":["../../src/utils/containing-blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,SAAS,2BAA2B,
|
|
1
|
+
{"version":3,"file":"containing-blocks.js","sourceRoot":"","sources":["../../src/utils/containing-blocks.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,SAAS,2BAA2B,CAClC,IAAO,EACP,KAA6B;IAE7B,MAAM,SAAS,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAChD,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;IAC9B,SAAS,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;IACnC,SAAS,CAAC,KAAK,CAAC,gBAAgB,GAAG,MAAM,CAAC;IAC1C,SAAS,CAAC,KAAK,CAAC,eAAe,GAAG,MAAM,CAAC;IAEzC,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC;IACjC,OAAO,CAAC,KAAK,CAAC,gBAAgB,GAAG,GAAG,CAAC;IACrC,OAAO,CAAC,KAAK,CAAC,eAAe,GAAG,GAAG,CAAC;IAEpC,SAAS,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;IAC/B,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IACrC,MAAM,aAAa,GAAG,SAAS,CAAC,qBAAqB,EAAE,CAAC;IACxD,MAAM,WAAW,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;IAEpD,SAAS,CAAC,MAAM,EAAE,CAAC;IAEnB,OAAO,aAAa,CAAC,GAAG,KAAK,WAAW,CAAC,GAAG,IAAI,aAAa,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,CAAC;AAC1F,CAAC;AAED,wFAAwF;AACxF,mFAAmF;AACnF,wCAAwC;AACxC,MAAM,8BAA8B,GAAG,IAAI,GAAG,EAA6B,CAAC;AAE5E,MAAM,UAAU,sBAAsB,CAAC,IAA+B;IACpE,OAAO,8BAA8B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAClD,CAAC;AAED,MAAM,UAAU,mCAAmC;IAKjD,MAAM,WAAW,GAAqE;QACpF,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,EAAE;QACtC,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,EAAE;QAC9C,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE;KACzC,CAAC;IAEF,KAAK,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,WAAW,EAAE,CAAC;QAC1C,IAAI,2BAA2B,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC;YAC7C,8BAA8B,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC3C,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/utils/contains.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function contains(ancestor: Node, descendant: Node): boolean;
|
|
2
2
|
//# sourceMappingURL=contains.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contains.d.ts","sourceRoot":"","sources":["../../src/utils/contains.ts"],"names":[],"mappings":"AAEA,
|
|
1
|
+
{"version":3,"file":"contains.d.ts","sourceRoot":"","sources":["../../src/utils/contains.ts"],"names":[],"mappings":"AAEA,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,GAAG,OAAO,CAgBlE"}
|
package/dist/utils/contains.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../src/utils/contains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEpE,MAAM,
|
|
1
|
+
{"version":3,"file":"contains.js","sourceRoot":"","sources":["../../src/utils/contains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEpE,MAAM,UAAU,QAAQ,CAAC,QAAc,EAAE,UAAgB;IACvD,IAAI,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,QAAQ,GAAG,UAAU,CAAC,WAAW,EAAE,CAAC;IACxC,OAAO,QAAQ,EAAE,CAAC;QAChB,IAAI,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC;YAC9D,OAAO,KAAK,CAAC;QACf,CAAC;QACD,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC3B,IAAI,QAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC5B,OAAO,IAAI,CAAC;QACd,CAAC;QACD,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IAChC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deduplicate-nodes.js","sourceRoot":"","sources":["../../src/utils/deduplicate-nodes.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,KAAkB;IACjD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"deduplicate-nodes.js","sourceRoot":"","sources":["../../src/utils/deduplicate-nodes.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,KAAkB;IACjD,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep-merge.d.ts","sourceRoot":"","sources":["../../src/utils/deep-merge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deep-merge.d.ts","sourceRoot":"","sources":["../../src/utils/deep-merge.ts"],"names":[],"mappings":"AAGA,KAAK,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAKrC,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,GAAG,SAAS,CAezE"}
|
package/dist/utils/deep-merge.js
CHANGED
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
import { isNode } from './dom-helpers.js';
|
|
2
|
+
const isObject = (obj) => typeof obj === 'object' && obj !== null && !Array.isArray(obj);
|
|
3
|
+
export function deepMerge(target, source) {
|
|
2
4
|
const output = { ...target };
|
|
3
5
|
for (const key of Object.keys(source)) {
|
|
4
|
-
if (
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
if (isObject(source[key])) {
|
|
7
|
+
// Don't merge DOM nodes.
|
|
8
|
+
if (isObject(target[key]) && !isNode(target[key])) {
|
|
9
|
+
output[key] = deepMerge(target[key], source[key]);
|
|
7
10
|
}
|
|
8
11
|
else {
|
|
9
|
-
output[key] =
|
|
12
|
+
output[key] = source[key];
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
15
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deep-merge.js","sourceRoot":"","sources":["../../src/utils/deep-merge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deep-merge.js","sourceRoot":"","sources":["../../src/utils/deep-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAK1C,MAAM,QAAQ,GAAG,CAAC,GAAY,EAAoB,EAAE,CAClD,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;AAEjE,MAAM,UAAU,SAAS,CAAC,MAAiB,EAAE,MAAiB;IAC5D,MAAM,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,CAAC;IAC7B,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACtC,IAAI,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YAC1B,yBAAyB;YACzB,IAAI,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBAClD,MAAM,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YACpD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YAC5B,CAAC;QACH,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/dom-helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"dom-helpers.d.ts","sourceRoot":"","sources":["../../src/utils/dom-helpers.ts"],"names":[],"mappings":"AAAA,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,IAAI,CAO/C;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,IAAI,QAAQ,CAEvD;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,OAAO,CAErD;AAED,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,QAAQ,CAEvD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,IAAI,gBAAgB,CAEvE;AAED,wBAAgB,YAAY,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,gBAAgB,IAAI,UAAU,CAE/F;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,WAAW,CAKtE;AAED,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,IAAI,UAAU,CAKpE"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export function isNode(obj) {
|
|
2
|
-
return 'nodeType' in obj &&
|
|
3
|
-
|
|
2
|
+
return ('nodeType' in obj &&
|
|
3
|
+
typeof obj.nodeType === 'number' &&
|
|
4
|
+
'nodeName' in obj &&
|
|
5
|
+
typeof obj.nodeName === 'string');
|
|
4
6
|
}
|
|
5
7
|
export function isNodeList(obj) {
|
|
6
8
|
return Object.prototype.toString.call(obj) === '[object NodeList]';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dom-helpers.js","sourceRoot":"","sources":["../../src/utils/dom-helpers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,OAAO,UAAU,IAAI,GAAG,
|
|
1
|
+
{"version":3,"file":"dom-helpers.js","sourceRoot":"","sources":["../../src/utils/dom-helpers.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,MAAM,CAAC,GAAW;IAChC,OAAO,CACL,UAAU,IAAI,GAA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
|
2
2
|
//# sourceMappingURL=ensure-non-empty.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ensure-non-empty.d.ts","sourceRoot":"","sources":["../../src/utils/ensure-non-empty.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"ensure-non-empty.d.ts","sourceRoot":"","sources":["../../src/utils/ensure-non-empty.ts"],"names":[],"mappings":"AAAA,wBAAgB,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAKvD"}
|