@sekyro/react 0.1.0-rc.3 → 0.1.0-rc.4
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/CHANGELOG.md +39 -0
- package/README.md +15 -7
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -27
- package/dist/index.d.ts +29 -27
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -5
- package/assets/audio/v1/README.md +0 -60
- package/assets/audio/v1/manifest.json +0 -7
package/dist/index.d.cts
CHANGED
|
@@ -92,6 +92,11 @@ interface Strings {
|
|
|
92
92
|
"capture.tips.uncover": string;
|
|
93
93
|
"capture.tips.eyeLevel": string;
|
|
94
94
|
"capture.tips.straight": string;
|
|
95
|
+
/** Spoken by the pre-capture "Listen" button (voice key `capture.tips.summary`); says what the built-in tips say. */
|
|
96
|
+
"capture.tips.summary": string;
|
|
97
|
+
"capture.tips.listen": string;
|
|
98
|
+
/** The Listen button's label while the summary plays. */
|
|
99
|
+
"capture.tips.stop": string;
|
|
95
100
|
"capture.permission.granted": string;
|
|
96
101
|
"capture.permission.prompt": string;
|
|
97
102
|
"capture.permission.denied": string;
|
|
@@ -133,8 +138,12 @@ declare function reasonStringKey(reason: ReasonCode): StringKey | null;
|
|
|
133
138
|
*/
|
|
134
139
|
declare function attemptsRemainingText(dictionary: Strings, locale: SekyroLocale, count: number): string;
|
|
135
140
|
|
|
136
|
-
/**
|
|
137
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Keys that can be spoken: the engine's `fcv3.*` gate hints, plus
|
|
143
|
+
* `capture.tips.summary` — the pre-capture "Listen to the instructions" summary
|
|
144
|
+
* (played only on an explicit tap, never during capture).
|
|
145
|
+
*/
|
|
146
|
+
type VoiceKey = "fcv3.no_face" | "fcv3.come_closer" | "fcv3.move_back" | "fcv3.center_face" | "fcv3.straighten" | "fcv3.more_light" | "fcv3.too_bright" | "fcv3.hold_still" | "fcv3.steady_camera" | "capture.tips.summary";
|
|
138
147
|
/** Every {@link VoiceKey}, in a stable order (e.g. to build a clip map). */
|
|
139
148
|
declare const VOICE_KEYS: readonly VoiceKey[];
|
|
140
149
|
|
|
@@ -151,37 +160,22 @@ type VoiceClipMap = {
|
|
|
151
160
|
};
|
|
152
161
|
/** `voice.clips`: a resolver function or a `{ [locale]: { [voiceKey]: url } }` map. */
|
|
153
162
|
type VoiceClipSource = VoiceClipResolver | VoiceClipMap;
|
|
154
|
-
/**
|
|
155
|
-
* A clip-set manifest (the `assets/audio/<set>/manifest.json` shape): per
|
|
156
|
-
* locale, one entry per shipped clip, keyed by clip name (`center_face` for
|
|
157
|
-
* `fcv3.center_face`). Entry contents (sha256, text, bytes) are not needed to resolve.
|
|
158
|
-
*/
|
|
159
|
-
interface VoiceClipManifest {
|
|
160
|
-
readonly set: string;
|
|
161
|
-
readonly clips: {
|
|
162
|
-
readonly [L in SekyroLocale]?: Readonly<Record<string, unknown>> | undefined;
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Resolver over a manifest: a listed key resolves to `<baseUrl>/<locale>/<name>.mp3`
|
|
167
|
-
* (`baseUrl` = the set's directory, where its manifest.json lives); anything
|
|
168
|
-
* else resolves to `null`, so a missing clip costs no 404 round-trip.
|
|
169
|
-
*/
|
|
170
|
-
declare function createManifestResolver(manifest: VoiceClipManifest, baseUrl: string): VoiceClipResolver;
|
|
171
163
|
|
|
172
164
|
/** Voice-guidance options of `<LivenessCapture voice>`. */
|
|
173
165
|
interface VoiceOptions {
|
|
174
166
|
/** Initial state when the viewer has no stored preference. Default `true`. */
|
|
175
167
|
defaultEnabled?: boolean;
|
|
176
168
|
/**
|
|
177
|
-
* Clip source; replaces the
|
|
178
|
-
* or a map `{ [locale]: { [voiceKey]: url } }` (e.g. delivered by
|
|
169
|
+
* Clip source; replaces the default. Either a resolver `(key, locale) → url | null`
|
|
170
|
+
* or a map `{ [locale]: { [voiceKey]: url } }` (e.g. delivered by your backend;
|
|
179
171
|
* pass a new object to change it). A key without a URL — or a resolver that
|
|
180
172
|
* throws — means "no clip" (speech fallback applies).
|
|
173
|
+
*
|
|
174
|
+
* Default: in verification mode, the Sekyro clip set delivered with the
|
|
175
|
+
* session (`https://assets.sekyro.ai` — allow it in your CSP `media-src`);
|
|
176
|
+
* in capture-only mode, none (device voice only).
|
|
181
177
|
*/
|
|
182
178
|
clips?: VoiceClipSource;
|
|
183
|
-
/** Base of the bundled clip set; default `${assetBaseUrl ?? "/models-v3"}/audio/v1`. */
|
|
184
|
-
clipBaseUrl?: string;
|
|
185
179
|
/** Locales where the device voice (speechSynthesis) may speak when no clip plays. Default `true` (all). */
|
|
186
180
|
speechFallback?: boolean | readonly SekyroLocale[];
|
|
187
181
|
/** localStorage key of the viewer's preference; `null` = do not persist. Default `"sekyro.voiceGuidance"`. */
|
|
@@ -293,13 +287,21 @@ interface LivenessCaptureProps {
|
|
|
293
287
|
startDisabled?: boolean;
|
|
294
288
|
/** Built-in Start label; default `capture.start`. */
|
|
295
289
|
startLabel?: ReactNode;
|
|
296
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* Tips on the pre-capture screen; default {@link DEFAULT_TIPS}; `false` hides the card.
|
|
292
|
+
* The "Listen to the instructions" button (spoken `capture.tips.summary`)
|
|
293
|
+
* shows with the built-in tips only — or with any tips when `voice.clips`
|
|
294
|
+
* supplies a `capture.tips.summary` clip for the locale.
|
|
295
|
+
*/
|
|
297
296
|
tips?: false | ReadonlyArray<BuiltInTipId | IntroTip>;
|
|
298
297
|
/** Camera the attempt opens with; default `"user"` (front). */
|
|
299
298
|
defaultFacing?: CameraFacing;
|
|
300
299
|
/**
|
|
301
|
-
* Voice guidance (on by default:
|
|
302
|
-
*
|
|
300
|
+
* Voice guidance (on by default). Clips: `voice.clips` when given; else, in
|
|
301
|
+
* verification mode, the Sekyro clip set delivered with the session (served
|
|
302
|
+
* from `https://assets.sekyro.ai` — allow it in your CSP `media-src`); else
|
|
303
|
+
* none. The device voice covers any key without a clip.
|
|
304
|
+
* `false` = no speech, no voice switch, no stage chip, no "Listen" button.
|
|
303
305
|
*/
|
|
304
306
|
voice?: false | VoiceOptions;
|
|
305
307
|
/** Telemetry: once per change of the displayed, spoken-able (`fcv3.*`) guidance key. */
|
|
@@ -386,4 +388,4 @@ declare function SekyroThemeProvider({ theme, children, className }: SekyroTheme
|
|
|
386
388
|
/** The complete dictionary for `locale` with `overrides` merged on top. */
|
|
387
389
|
declare function resolveStrings(locale: SekyroLocale, overrides?: Partial<Strings>): Strings;
|
|
388
390
|
|
|
389
|
-
export { type BuiltInTipId, DEFAULT_THEME, DEFAULT_TIPS, type IntroContext, type IntroTip, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, type LivenessNotice, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, VOICE_KEYS, type
|
|
391
|
+
export { type BuiltInTipId, DEFAULT_THEME, DEFAULT_TIPS, type IntroContext, type IntroTip, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, type LivenessNotice, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, VOICE_KEYS, type VoiceClipMap, type VoiceClipResolver, type VoiceClipSource, type VoiceControl, type VoiceKey, type VoiceOptions, ar, attemptsRemainingText, captureErrorStringKey, en, fr, hintStringKey, reasonStringKey, resolveStrings, themeToCssVars };
|
package/dist/index.d.ts
CHANGED
|
@@ -92,6 +92,11 @@ interface Strings {
|
|
|
92
92
|
"capture.tips.uncover": string;
|
|
93
93
|
"capture.tips.eyeLevel": string;
|
|
94
94
|
"capture.tips.straight": string;
|
|
95
|
+
/** Spoken by the pre-capture "Listen" button (voice key `capture.tips.summary`); says what the built-in tips say. */
|
|
96
|
+
"capture.tips.summary": string;
|
|
97
|
+
"capture.tips.listen": string;
|
|
98
|
+
/** The Listen button's label while the summary plays. */
|
|
99
|
+
"capture.tips.stop": string;
|
|
95
100
|
"capture.permission.granted": string;
|
|
96
101
|
"capture.permission.prompt": string;
|
|
97
102
|
"capture.permission.denied": string;
|
|
@@ -133,8 +138,12 @@ declare function reasonStringKey(reason: ReasonCode): StringKey | null;
|
|
|
133
138
|
*/
|
|
134
139
|
declare function attemptsRemainingText(dictionary: Strings, locale: SekyroLocale, count: number): string;
|
|
135
140
|
|
|
136
|
-
/**
|
|
137
|
-
|
|
141
|
+
/**
|
|
142
|
+
* Keys that can be spoken: the engine's `fcv3.*` gate hints, plus
|
|
143
|
+
* `capture.tips.summary` — the pre-capture "Listen to the instructions" summary
|
|
144
|
+
* (played only on an explicit tap, never during capture).
|
|
145
|
+
*/
|
|
146
|
+
type VoiceKey = "fcv3.no_face" | "fcv3.come_closer" | "fcv3.move_back" | "fcv3.center_face" | "fcv3.straighten" | "fcv3.more_light" | "fcv3.too_bright" | "fcv3.hold_still" | "fcv3.steady_camera" | "capture.tips.summary";
|
|
138
147
|
/** Every {@link VoiceKey}, in a stable order (e.g. to build a clip map). */
|
|
139
148
|
declare const VOICE_KEYS: readonly VoiceKey[];
|
|
140
149
|
|
|
@@ -151,37 +160,22 @@ type VoiceClipMap = {
|
|
|
151
160
|
};
|
|
152
161
|
/** `voice.clips`: a resolver function or a `{ [locale]: { [voiceKey]: url } }` map. */
|
|
153
162
|
type VoiceClipSource = VoiceClipResolver | VoiceClipMap;
|
|
154
|
-
/**
|
|
155
|
-
* A clip-set manifest (the `assets/audio/<set>/manifest.json` shape): per
|
|
156
|
-
* locale, one entry per shipped clip, keyed by clip name (`center_face` for
|
|
157
|
-
* `fcv3.center_face`). Entry contents (sha256, text, bytes) are not needed to resolve.
|
|
158
|
-
*/
|
|
159
|
-
interface VoiceClipManifest {
|
|
160
|
-
readonly set: string;
|
|
161
|
-
readonly clips: {
|
|
162
|
-
readonly [L in SekyroLocale]?: Readonly<Record<string, unknown>> | undefined;
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Resolver over a manifest: a listed key resolves to `<baseUrl>/<locale>/<name>.mp3`
|
|
167
|
-
* (`baseUrl` = the set's directory, where its manifest.json lives); anything
|
|
168
|
-
* else resolves to `null`, so a missing clip costs no 404 round-trip.
|
|
169
|
-
*/
|
|
170
|
-
declare function createManifestResolver(manifest: VoiceClipManifest, baseUrl: string): VoiceClipResolver;
|
|
171
163
|
|
|
172
164
|
/** Voice-guidance options of `<LivenessCapture voice>`. */
|
|
173
165
|
interface VoiceOptions {
|
|
174
166
|
/** Initial state when the viewer has no stored preference. Default `true`. */
|
|
175
167
|
defaultEnabled?: boolean;
|
|
176
168
|
/**
|
|
177
|
-
* Clip source; replaces the
|
|
178
|
-
* or a map `{ [locale]: { [voiceKey]: url } }` (e.g. delivered by
|
|
169
|
+
* Clip source; replaces the default. Either a resolver `(key, locale) → url | null`
|
|
170
|
+
* or a map `{ [locale]: { [voiceKey]: url } }` (e.g. delivered by your backend;
|
|
179
171
|
* pass a new object to change it). A key without a URL — or a resolver that
|
|
180
172
|
* throws — means "no clip" (speech fallback applies).
|
|
173
|
+
*
|
|
174
|
+
* Default: in verification mode, the Sekyro clip set delivered with the
|
|
175
|
+
* session (`https://assets.sekyro.ai` — allow it in your CSP `media-src`);
|
|
176
|
+
* in capture-only mode, none (device voice only).
|
|
181
177
|
*/
|
|
182
178
|
clips?: VoiceClipSource;
|
|
183
|
-
/** Base of the bundled clip set; default `${assetBaseUrl ?? "/models-v3"}/audio/v1`. */
|
|
184
|
-
clipBaseUrl?: string;
|
|
185
179
|
/** Locales where the device voice (speechSynthesis) may speak when no clip plays. Default `true` (all). */
|
|
186
180
|
speechFallback?: boolean | readonly SekyroLocale[];
|
|
187
181
|
/** localStorage key of the viewer's preference; `null` = do not persist. Default `"sekyro.voiceGuidance"`. */
|
|
@@ -293,13 +287,21 @@ interface LivenessCaptureProps {
|
|
|
293
287
|
startDisabled?: boolean;
|
|
294
288
|
/** Built-in Start label; default `capture.start`. */
|
|
295
289
|
startLabel?: ReactNode;
|
|
296
|
-
/**
|
|
290
|
+
/**
|
|
291
|
+
* Tips on the pre-capture screen; default {@link DEFAULT_TIPS}; `false` hides the card.
|
|
292
|
+
* The "Listen to the instructions" button (spoken `capture.tips.summary`)
|
|
293
|
+
* shows with the built-in tips only — or with any tips when `voice.clips`
|
|
294
|
+
* supplies a `capture.tips.summary` clip for the locale.
|
|
295
|
+
*/
|
|
297
296
|
tips?: false | ReadonlyArray<BuiltInTipId | IntroTip>;
|
|
298
297
|
/** Camera the attempt opens with; default `"user"` (front). */
|
|
299
298
|
defaultFacing?: CameraFacing;
|
|
300
299
|
/**
|
|
301
|
-
* Voice guidance (on by default:
|
|
302
|
-
*
|
|
300
|
+
* Voice guidance (on by default). Clips: `voice.clips` when given; else, in
|
|
301
|
+
* verification mode, the Sekyro clip set delivered with the session (served
|
|
302
|
+
* from `https://assets.sekyro.ai` — allow it in your CSP `media-src`); else
|
|
303
|
+
* none. The device voice covers any key without a clip.
|
|
304
|
+
* `false` = no speech, no voice switch, no stage chip, no "Listen" button.
|
|
303
305
|
*/
|
|
304
306
|
voice?: false | VoiceOptions;
|
|
305
307
|
/** Telemetry: once per change of the displayed, spoken-able (`fcv3.*`) guidance key. */
|
|
@@ -386,4 +388,4 @@ declare function SekyroThemeProvider({ theme, children, className }: SekyroTheme
|
|
|
386
388
|
/** The complete dictionary for `locale` with `overrides` merged on top. */
|
|
387
389
|
declare function resolveStrings(locale: SekyroLocale, overrides?: Partial<Strings>): Strings;
|
|
388
390
|
|
|
389
|
-
export { type BuiltInTipId, DEFAULT_THEME, DEFAULT_TIPS, type IntroContext, type IntroTip, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, type LivenessNotice, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, VOICE_KEYS, type
|
|
391
|
+
export { type BuiltInTipId, DEFAULT_THEME, DEFAULT_TIPS, type IntroContext, type IntroTip, LivenessCapture, type LivenessCaptureProps, type LivenessCaptureSlots, type LivenessNotice, NO_FACE_DEBOUNCE_MS, type SekyroLocale, type SekyroTheme, type SekyroThemeColors, SekyroThemeProvider, type SekyroThemeProviderProps, type StringKey, type Strings, VOICE_KEYS, type VoiceClipMap, type VoiceClipResolver, type VoiceClipSource, type VoiceControl, type VoiceKey, type VoiceOptions, ar, attemptsRemainingText, captureErrorStringKey, en, fr, hintStringKey, reasonStringKey, resolveStrings, themeToCssVars };
|