mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-03-01 05:40:17 +01:00
* ✨ v0.7.5-rc2
* docs: update README
* refactor(settings): Update rememberForkOption default value
* a11y: proper screen reader announcements for content blocks
* Update version to 0.7.423 in package-lock.json and packages/data-provider/package.json
* chore: rename rememberForkOption -> rememberDefaultFork to apply new default value
* fix: headlessui menu stealing focus from Settings Dialog when pressing Enter
22 lines
726 B
TypeScript
22 lines
726 B
TypeScript
// AnnouncerContext.tsx
|
|
import React from 'react';
|
|
import type { AnnounceOptions } from '~/common';
|
|
|
|
interface AnnouncerContextType {
|
|
announceAssertive: (options: AnnounceOptions) => void;
|
|
announcePolite: (options: AnnounceOptions) => void;
|
|
}
|
|
|
|
const defaultContext: AnnouncerContextType = {
|
|
announceAssertive: () => console.warn('Announcement failed, LiveAnnouncer context is missing'),
|
|
announcePolite: () => console.warn('Announcement failed, LiveAnnouncer context is missing'),
|
|
};
|
|
|
|
const AnnouncerContext = React.createContext<AnnouncerContextType>(defaultContext);
|
|
|
|
export const useLiveAnnouncer = () => {
|
|
const context = React.useContext(AnnouncerContext);
|
|
return context;
|
|
};
|
|
|
|
export default AnnouncerContext;
|