@touchcastllc/napster-companion-api-dev 2.1.0-alpha.2 → 2.1.0-alpha.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/README.md CHANGED
@@ -178,12 +178,12 @@ The entry point survives every way a session can end — the visitor pressing **
178
178
  the inactivity timeout, a dropped connection, `instance.destroy()` — and returns to
179
179
  idle so the next session is one click away.
180
180
 
181
- > **Caveat: `button` and `persistence` do not compose yet.** Ending a session under
182
- > persistence has to unwrap the page, and unwrapping is a real top-level navigation.
183
- > That page load takes the entry point with it, so the visitor gets a fresh load of
184
- > the page rather than the button reappearing in place — and any navigation they did
185
- > inside the persisted frame is lost. The SDK warns when both flags are on. Use one
186
- > or the other until this is resolved.
181
+ With `persistence` on as well, every page that loads the SDK is wrapped as soon as
182
+ `init()` runs — before any click — so each of those pages loads twice. However the
183
+ session ends, the visitor stays on the page they are on: **End**, the inactivity card
184
+ and a server-side end reload it; a failure (`getToken()` rejecting, a dropped
185
+ connection) reveals it in place, or loads it if they had navigated since. The button
186
+ comes back on that load wherever the SDK is loaded.
187
187
 
188
188
  ### Inline layout: minimum container size
189
189
 
@@ -214,6 +214,24 @@ has only 175px of width, but the controls need at least 176px, so the buttons ar
214
214
  clipped"*. It warns once each time the problem appears and again if it comes back after
215
215
  being fixed.
216
216
 
217
+ ### Accessibility
218
+
219
+ The widget targets WCAG 2.2 AA in its default configuration. Some settings hand part of
220
+ that to you:
221
+
222
+ - **`style.accentColor`** is the background of white text and icons (the mic button and
223
+ the buttons on the microphone and "Still there?" cards). Keep at least **4.5:1**
224
+ contrast with white. The default `#be369d` gives 5:1; a light green such as `#6dbf36`
225
+ gives 2.3:1 and fails.
226
+ - **`disclaimer.color`** must keep the disclaimer text at **4.5:1** against the dark
227
+ panel behind the controls. The default white passes; a dark text color does not.
228
+ - **`controls.enabled: false`** removes the SDK's own keyboard-operable controls. Your
229
+ replacement mute, volume and end buttons must work from the keyboard and have
230
+ accessible names.
231
+
232
+ Details:
233
+ **[developers.napster.com/docs/sdks/web-sdk/accessibility](https://developers.napster.com/docs/sdks/web-sdk/accessibility)**.
234
+
217
235
  For framework-specific setup, version pinning and the first working session, see
218
236
  **[developers.napster.com/docs/sdks/web-sdk/installation](https://developers.napster.com/docs/sdks/web-sdk/installation)**.
219
237
 
@@ -49,5 +49,6 @@ export declare enum DataChannelMessageType {
49
49
  SET_SETTINGS = "set_settings",
50
50
  START_VIDEO = "start_video",
51
51
  STOP_VIDEO = "stop_video",
52
- FUNCTION_CALL_OUTPUT = "send_function_output"
52
+ FUNCTION_CALL_OUTPUT = "send_function_output",
53
+ RESET_INACTIVITY_TIMEOUT = "reset_inactivity_timeout"
53
54
  }
package/lib/index.d.ts CHANGED
@@ -109,7 +109,9 @@ declare class NapsterCompanionApiSdkVanilla implements NapsterCompanionApiSDK {
109
109
  * already models this ordering for its own onDestroy callback.
110
110
  *
111
111
  * revealOnly rather than end(): under persistence the page is already wrapped by the time
112
- * the gate settles, so a failed mint should reveal it in place rather than navigate.
112
+ * the gate settles, so a failed mint reveals it in place rather than reloading it — unless
113
+ * the visitor has already browsed to another page inside the frame (button mode wraps
114
+ * long before any click), in which case unwrap() loads that page instead (CA-1250).
113
115
  *
114
116
  * `preserveRoot` (== button mode) reports through the failure channel
115
117
  * (onSessionFailedHandler) instead of onError directly. Unlike a thrown rejection,
@@ -162,11 +164,13 @@ declare class NapsterCompanionApiSdkVanilla implements NapsterCompanionApiSDK {
162
164
  * pre-minted token string is not accepted.
163
165
  */
164
166
  init(getToken: () => Promise<string>, config?: Partial<NapsterCompanionApiConfig>): Promise<NapsterCompanionApiInstance>;
167
+ private startFaceTracking;
168
+ private stopFaceTracking;
165
169
  private createInstanceMethods;
166
170
  }
167
171
  declare const NapsterCompanionApiSdk: NapsterCompanionApiSdkVanilla;
168
172
  export { NapsterCompanionApiSdk };
169
- export type { NapsterCompanionApiConfig, NapsterCompanionApiInstance, NapsterCompanionApiController, PersistenceOptions, ButtonConfig, LayoutConfig, StyleConfig, AgentConfig, CompanionFunction, FeatureConfig, FaceTrackingConfig, FaceTrackingData, FaceTrackingController, MouthLandmarks, } from "./types";
173
+ export type { NapsterCompanionApiConfig, NapsterCompanionApiInstance, NapsterCompanionApiController, PersistenceOptions, ButtonConfig, LayoutConfig, StyleConfig, AgentConfig, CompanionFunction, FeatureConfig, } from "./types";
170
174
  export { Position } from "./types";
171
175
  export { DataChannelMessageType } from "./constants/events";
172
176
  export { checkPiPSupport, resetPiPSupportCache } from "./utils/PiPManager";