Skip to content

Add explorer key actions and improve auto-voice handling #1295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion ts/a11y/complexity/collapse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export class Collapse {
(node, complexity) => {
complexity = this.uncollapseChild(complexity, node, 0);
if (complexity > (this.cutoff.sqrt as number)) {
node.setProperty('collapse-variant', true);
complexity = this.recordCollapse(
node,
complexity,
Expand All @@ -209,6 +210,7 @@ export class Collapse {
(node, complexity) => {
complexity = this.uncollapseChild(complexity, node, 0, 2);
if (complexity > (this.cutoff.sqrt as number)) {
node.setProperty('collapse-variant', true);
complexity = this.recordCollapse(
node,
complexity,
Expand Down Expand Up @@ -582,6 +584,9 @@ export class Collapse {
const factory = this.complexity.factory;
const marker = node.getProperty('collapse-marker') as string;
const parent = node.parent;
const variant = node.getProperty('collapse-variant')
? { mathvariant: '-tex-variant' }
: {};
const maction = factory.create(
'maction',
{
Expand All @@ -594,7 +599,7 @@ export class Collapse {
),
},
[
factory.create('mtext', { mathcolor: 'blue' }, [
factory.create('mtext', { mathcolor: 'blue', ...variant }, [
(factory.create('text') as TextNode).setText(marker),
]),
]
Expand Down
26 changes: 26 additions & 0 deletions ts/a11y/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,32 @@ export function ExplorerMathDocumentMixin<
'mjx-help-dialog > input': {
margin: '.5em 2em',
},
'mjx-help-dialog kbd': {
display: 'inline-block',
padding: '3px 5px',
'font-size': '11px',
'line-height': '10px',
color: '#444d56',
'vertical-align': 'middle',
'background-color': '#fafbfc',
border: 'solid 1.5px #c6cbd1',
'border-bottom-color': '#959da5',
'border-radius': '3px',
'box-shadow': 'inset -.5px -1px 0 #959da5',
},
'mjx-help-dialog ul': {
'list-style-type': 'none',
},
'mjx-help-dialog li': {
'margin-bottom': '.5em',
},
'mjx-help-background': {
position: 'fixed',
top: 0,
left: 0,
right: 0,
bottom: 0,
},
};

/**
Expand Down
Loading