@touchcastllc/napster-companion-api-dev 2.0.0-alpha.12 → 2.0.0-alpha.13
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/lib/button/session.d.ts +7 -0
- package/lib/button/trigger.d.ts +2 -0
- package/lib/components/Avatar/controlsAutoHide.d.ts +4 -0
- package/lib/components/InactiveOverlay/index.d.ts +2 -0
- package/lib/components/StyledTooltip/index.d.ts +3 -0
- package/lib/constants/accessibleNames.d.ts +7 -0
- package/lib/constants/inactivity.d.ts +6 -0
- package/lib/constants/index.d.ts +1 -0
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.esm.js +1 -1
- package/lib/index.js +1 -1
- package/lib/index.standalone.js +1 -1
- package/lib/utils/InactiveOverlayManager.d.ts +10 -0
- package/lib/utils/announcer.d.ts +26 -0
- package/lib/utils/focus.d.ts +8 -0
- package/lib/utils/hostLanguage.d.ts +15 -0
- package/lib/utils/inertSiblings.d.ts +12 -0
- package/lib/utils/widgetRoot.d.ts +5 -0
- package/package.json +1 -1
|
@@ -43,6 +43,10 @@ export declare class InactiveOverlayManager {
|
|
|
43
43
|
private isVisible;
|
|
44
44
|
private readonly mountElement;
|
|
45
45
|
private pipTarget;
|
|
46
|
+
/** Where keyboard focus was when the overlay took it (CA-1139). */
|
|
47
|
+
private returnFocusTo;
|
|
48
|
+
/** Switches back on what the overlay covers (CA-1139 review). */
|
|
49
|
+
private restoreCovered;
|
|
46
50
|
private readonly callbacks;
|
|
47
51
|
constructor(mountElement: HTMLElement, callbacks?: InactiveOverlayCallbacks);
|
|
48
52
|
/**
|
|
@@ -55,6 +59,12 @@ export declare class InactiveOverlayManager {
|
|
|
55
59
|
* This is the single entry point for hiding the overlay
|
|
56
60
|
*/
|
|
57
61
|
hide(): void;
|
|
62
|
+
/**
|
|
63
|
+
* restoreFocus is false when the session is ending (countdown run out,
|
|
64
|
+
* teardown): destroyInstance() moves focus once, to the entry point or
|
|
65
|
+
* mount — restoring here first would move it twice (Serhii's review).
|
|
66
|
+
*/
|
|
67
|
+
private hideOverlay;
|
|
58
68
|
/**
|
|
59
69
|
* Check if overlay is currently visible
|
|
60
70
|
*/
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The widget's one screen-reader announcer (CA-1139).
|
|
3
|
+
*
|
|
4
|
+
* A single visually hidden `aria-live="polite"` region per root, shared by
|
|
5
|
+
* everything that needs to speak — several regions would talk over each
|
|
6
|
+
* other. The PiP document gets its own, since a live region only speaks for
|
|
7
|
+
* the document it lives in. Styled in App.css.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Text is written this long after the region is cleared. Screen readers
|
|
11
|
+
* announce a *change* to a region that already exists; clearing and writing
|
|
12
|
+
* in the same tick is no change at all, and a region created in the same tick
|
|
13
|
+
* as its text is often not read.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ANNOUNCE_DELAY_MS = 100;
|
|
16
|
+
/**
|
|
17
|
+
* Adds the announcer to a root, or returns the one it has. Call this when the
|
|
18
|
+
* root is created, so the region already exists by the time anything speaks.
|
|
19
|
+
*/
|
|
20
|
+
export declare function createAnnouncer(root: HTMLElement): HTMLElement;
|
|
21
|
+
/**
|
|
22
|
+
* Reads `text` out through the announcer of the root `from` belongs to.
|
|
23
|
+
* `from` may be inside the root (main page) or contain it (the PiP body,
|
|
24
|
+
* which holds the PiP stage).
|
|
25
|
+
*/
|
|
26
|
+
export declare function announce(from: HTMLElement, text: string): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Focuses an element that may not be focusable on its own — a container the
|
|
3
|
+
* widget was in, or the widget root — so focus has somewhere sensible to land
|
|
4
|
+
* instead of <body> (CA-1139). A plain <div> gets a temporary tabindex="-1",
|
|
5
|
+
* dropped again once focus moves on; a tabindex the host set is left as is.
|
|
6
|
+
* <body> is skipped: focus is already there, and it must not gain a tabindex.
|
|
7
|
+
*/
|
|
8
|
+
export declare function focusWithTemporaryTabindex(el: HTMLElement): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The widget's own texts are English and the SDK root says so (`lang="en"`,
|
|
3
|
+
* CA-1148). Texts the integrator supplies through the config (button label
|
|
4
|
+
* and description, disclaimer) are written in the host page's language
|
|
5
|
+
* instead, so they carry the page's `lang` — otherwise a screen reader would
|
|
6
|
+
* read, say, a German label with the English voice.
|
|
7
|
+
*/
|
|
8
|
+
/** The host page's declared language, or "" when it declares none. */
|
|
9
|
+
export declare function hostLanguage(): string;
|
|
10
|
+
/**
|
|
11
|
+
* Marks an element holding integrator text with the host page's language.
|
|
12
|
+
* With no page language there is nothing to mark it with: the attribute is
|
|
13
|
+
* removed and the element inherits the root's English.
|
|
14
|
+
*/
|
|
15
|
+
export declare function applyHostLanguage(el: HTMLElement): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Makes everything next to `el` inert — not focusable, not read by screen
|
|
3
|
+
* readers — and returns a function that undoes it. Used while an overlay
|
|
4
|
+
* covers its siblings, so Tab cannot reach a control hidden under it
|
|
5
|
+
* (CA-1139). Not `aria-modal`: that would claim the whole host page.
|
|
6
|
+
*
|
|
7
|
+
* A sibling holding the widget's announcer is not made inert itself — inert
|
|
8
|
+
* content is not read out, so the warning would go silent (the PiP stage
|
|
9
|
+
* holds both the announcer and the controls). Its other children are, instead.
|
|
10
|
+
* Elements that were already inert are left out, so the undo keeps them so.
|
|
11
|
+
*/
|
|
12
|
+
export declare function makeSiblingsInert(el: HTMLElement): () => void;
|