mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-20 10:20:15 +01:00
🎙️ a11y: Screen Reader Support for Dynamic Content Updates (#3625)
* WIP: first pass, hooks * wip: isStream arg * feat: first pass, dynamic content updates, screen reader announcements * chore: unrelated, styling redundancy
This commit is contained in:
parent
05696233a9
commit
6655304753
14 changed files with 353 additions and 54 deletions
|
|
@ -66,7 +66,7 @@ export function getEnabledEndpoints() {
|
|||
if (endpointsEnv) {
|
||||
enabledEndpoints = endpointsEnv
|
||||
.split(',')
|
||||
.filter((endpoint) => endpoint?.trim())
|
||||
.filter((endpoint) => endpoint.trim())
|
||||
.map((endpoint) => endpoint.trim());
|
||||
}
|
||||
return enabledEndpoints;
|
||||
|
|
@ -347,3 +347,16 @@ export function parseTextParts(contentParts: a.TMessageContentParts[]): string {
|
|||
|
||||
return result;
|
||||
}
|
||||
|
||||
export const SEPARATORS = ['.', '?', '!', '۔', '。', '‥', ';', '¡', '¿', '\n', '```'];
|
||||
|
||||
export function findLastSeparatorIndex(text: string, separators = SEPARATORS): number {
|
||||
let lastIndex = -1;
|
||||
for (const separator of separators) {
|
||||
const index = text.lastIndexOf(separator);
|
||||
if (index > lastIndex) {
|
||||
lastIndex = index;
|
||||
}
|
||||
}
|
||||
return lastIndex;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue