mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
add screenReaderMode option
This commit is contained in:
parent
f69e359554
commit
87f231d582
9 changed files with 20 additions and 3 deletions
1
.github/workflows/nodejs.yml
vendored
1
.github/workflows/nodejs.yml
vendored
|
|
@ -4,6 +4,7 @@ on:
|
|||
branches:
|
||||
- master
|
||||
- canary
|
||||
- screenreader
|
||||
pull_request:
|
||||
defaults:
|
||||
run:
|
||||
|
|
|
|||
|
|
@ -160,6 +160,9 @@ module.exports = {
|
|||
// set to true to disable auto updates
|
||||
disableAutoUpdates: false,
|
||||
|
||||
// set to true to enable screen reading apps (like NVDA) to read the contents of the terminal
|
||||
screenReaderMode: false,
|
||||
|
||||
// for advanced config flags please refer to https://hyper.is/#cfg
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -104,6 +104,7 @@ class TermGroup_ extends React.PureComponent<TermGroupProps> {
|
|||
webLinksActivationKey: this.props.webLinksActivationKey,
|
||||
macOptionSelectionMode: this.props.macOptionSelectionMode,
|
||||
disableLigatures: this.props.disableLigatures,
|
||||
screenReaderMode: this.props.screenReaderMode,
|
||||
uid
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -77,7 +77,8 @@ const getTermOptions = (props: TermProps): ITerminalOptions => {
|
|||
brightMagenta: props.colors.lightMagenta,
|
||||
brightCyan: props.colors.lightCyan,
|
||||
brightWhite: props.colors.lightWhite
|
||||
}
|
||||
},
|
||||
screenReaderMode: props.screenReaderMode
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -116,6 +116,7 @@ export default class Terms extends React.Component<TermsProps> {
|
|||
webLinksActivationKey: this.props.webLinksActivationKey,
|
||||
macOptionSelectionMode: this.props.macOptionSelectionMode,
|
||||
disableLigatures: this.props.disableLigatures,
|
||||
screenReaderMode: this.props.screenReaderMode,
|
||||
parentProps: this.props
|
||||
});
|
||||
|
||||
|
|
|
|||
1
lib/config.d.ts
vendored
1
lib/config.d.ts
vendored
|
|
@ -51,6 +51,7 @@ export type configOptions = {
|
|||
};
|
||||
padding: string;
|
||||
quickEdit: boolean;
|
||||
screenReaderMode: boolean;
|
||||
scrollback: number;
|
||||
selectionColor: string;
|
||||
shell: string;
|
||||
|
|
|
|||
|
|
@ -45,7 +45,8 @@ const mapStateToProps = (state: HyperState) => {
|
|||
webGLRenderer: state.ui.webGLRenderer,
|
||||
webLinksActivationKey: state.ui.webLinksActivationKey,
|
||||
macOptionSelectionMode: state.ui.macOptionSelectionMode,
|
||||
disableLigatures: state.ui.disableLigatures
|
||||
disableLigatures: state.ui.disableLigatures,
|
||||
screenReaderMode: state.ui.screenReaderMode
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
3
lib/hyper.d.ts
vendored
3
lib/hyper.d.ts
vendored
|
|
@ -79,6 +79,7 @@ export type uiState = Immutable<{
|
|||
quickEdit: boolean;
|
||||
resizeAt: number;
|
||||
rows: number | null;
|
||||
screenReaderMode: boolean;
|
||||
scrollback: number;
|
||||
selectionColor: string;
|
||||
showHamburgerMenu: boolean | '';
|
||||
|
|
@ -287,6 +288,7 @@ export type TermGroupOwnProps = {
|
|||
| 'onTitle'
|
||||
| 'padding'
|
||||
| 'quickEdit'
|
||||
| 'screenReaderMode'
|
||||
| 'scrollback'
|
||||
| 'selectionColor'
|
||||
| 'sessions'
|
||||
|
|
@ -344,6 +346,7 @@ export type TermProps = {
|
|||
padding: string;
|
||||
quickEdit: boolean;
|
||||
rows: number | null;
|
||||
screenReaderMode: boolean;
|
||||
scrollback: number;
|
||||
search: boolean;
|
||||
searchAddon: SearchAddon | null;
|
||||
|
|
|
|||
|
|
@ -107,7 +107,8 @@ const initial: uiState = Immutable<Mutable<uiState>>({
|
|||
webGLRenderer: true,
|
||||
webLinksActivationKey: '',
|
||||
macOptionSelectionMode: 'vertical',
|
||||
disableLigatures: true
|
||||
disableLigatures: true,
|
||||
screenReaderMode: false
|
||||
});
|
||||
|
||||
const reducer: IUiReducer = (state = initial, action) => {
|
||||
|
|
@ -264,6 +265,10 @@ const reducer: IUiReducer = (state = initial, action) => {
|
|||
ret.disableLigatures = config.disableLigatures;
|
||||
}
|
||||
|
||||
if (config.screenReaderMode !== undefined) {
|
||||
ret.screenReaderMode = config.screenReaderMode;
|
||||
}
|
||||
|
||||
ret._lastUpdate = now;
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in a new issue