Skip to content
Merged
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
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"scripts": {
"=============================================================================== clean": "",
"clean:dir": "clean() { pnpm -s log:single \"Cleaning $1 directory\"; pnpm rimraf $1; }; clean",
"clean:lib": "clean() { pnpm -s log:single \"Cleaning $1 components\"; pnpm rimraf -g components/$1'/**/lib'; }; clean",
"clean:lib": "clean() { pnpm -s log:single \"Cleaning $1 component libs\"; pnpm rimraf -g components/$1'/**/lib'; }; clean",
"clean:mod": "clean() { pnpm -s log:comp \"Cleaning $1 module\"; pnpm -s clean:dir $1 && pnpm -s clean:lib $1; }; clean",
"=============================================================================== copy": "",
"copy:assets": "pnpm -s log:comp 'Copying assets'; copy() { pnpm -s copy:mj2 $1 && pnpm -s copy:mml3 $1; }; copy",
Expand All @@ -84,7 +84,7 @@
"cjs:bundle:finalize": "pnpm -s log:single 'Finalize cjs bundle'; echo '{\n \"type\": \"commonjs\"\n}' > bundle-cjs/package.json;",
"cjs:compile": "pnpm -s log:single 'Compiling cjs typescript files' && pnpm tsc --project tsconfig/cjs.json",
"cjs:components:build": "pnpm -s log:comp 'Building cjs components'; pnpm -s cjs:components:src:build && pnpm clean:dir bundle-cjs && pnpm -s cjs:components:make --build",
"cjs:components:clean": "pnpm -s log:single \"Cleaning cjs components\" pnpm rimraf components/cjs",
"cjs:components:clean": "pnpm -s log:single \"Cleaning cjs components\"; pnpm rimraf components/cjs",
"cjs:components:compile": "pnpm -s log:single 'Compiling component files'; pnpm tsc --project tsconfig/components.json",
"cjs:components:copy": "pnpm copyfiles -u 2 -e 'components/mjs/**/*.js' 'components/mjs/**/*' components/cjs",
"cjs:components:finalize": "pnpm -s log:comp 'Finalize cjs components'; pnpm -s cjs:components:copy && pnpm -s copy:pkg components/cjs && pnpm -s clean:lib cjs",
Expand Down Expand Up @@ -138,9 +138,12 @@
"xslt3": "^2.6.0"
},
"dependencies": {
"@xmldom/xmldom": "^0.8.10",
"commander": "^12.0.0",
"mathjax-modern-font": "^4.0.0-beta.5",
"mhchemparser": "^4.2.1",
"mj-context-menu": "^0.9.1",
"speech-rule-engine": "^4.1.0-beta.9"
"speech-rule-engine": "^4.1.0-beta.9",
"wicked-good-xpath": "^1.3.0"
}
}
21 changes: 21 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions ts/a11y/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,10 @@ export function ExplorerMathDocumentMixin<B extends MathDocumentConstructor<HTML
aria: true,
}),
a11y: {
...BaseDocument.OPTIONS.a11y,
align: 'top', // placement of magnified expression
backgroundColor: 'Blue', // color for background of selected sub-expression
backgroundOpacity: 20, // opacity for background of selected sub-expression
braille: true, // switch on Braille output
flame: false, // color collapsible sub-expressions
foregroundColor: 'Black', // color to use for text of selected sub-expression
foregroundOpacity: 100, // opacity for text of selected sub-expression
Expand All @@ -216,7 +216,6 @@ export function ExplorerMathDocumentMixin<B extends MathDocumentConstructor<HTML
magnification: 'None', // type of magnification
magnify: '400%', // percentage of magnification of zoomed expressions
mouseMagnifier: false, // switch on magnification via mouse hovering
speech: true, // switch on speech output
subtitles: true, // show speech as a subtitle
treeColoring: false, // tree color expression
viewBraille: true, // display Braille output as subtitles
Expand Down
6 changes: 5 additions & 1 deletion ts/a11y/semantic-enrich.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,14 @@ export function EnrichedMathDocumentMixin<N, T, D, B extends MathDocumentConstru
sre: expandable({
speech: 'none', // by default no speech is included
locale: 'en', // switch the locale
domain: 'clearspeak', // speech rules domain
domain: 'clearspeak', // speech rules domain
style: 'default', // speech rules style
braille: 'nemeth', // TODO: Dummy switch for braille
}),
a11y: expandable({
speech: true, // switch on speech output
braille: true, // switch on Braille output
})
};

/**
Expand Down
12 changes: 6 additions & 6 deletions ts/a11y/speech/GeneratorPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ export class GeneratorPool<N, T, D> {
/**
* The current speech setting for Sre
*/
private currentLocale = 'none';
private currentBraille = 'none';
private static currentLocale = 'none';
private static currentBraille = 'none';
private _options: OptionList = {};

/**
Expand Down Expand Up @@ -138,13 +138,13 @@ export class GeneratorPool<N, T, D> {
private _update(options: OptionList) {
if (!options || !options.sre) return false;
let update = false;
if (options.sre.braille !== this.currentBraille) {
this.currentBraille = options.sre.braille;
if (options.sre.braille !== GeneratorPool.currentBraille) {
GeneratorPool.currentBraille = options.sre.braille;
update = true;
Sre.setupEngine({locale: options.sre.braille})
}
if (options.sre.locale !== this.currentLocale) {
this.currentLocale = options.sre.locale;
if (options.sre.locale !== GeneratorPool.currentLocale) {
GeneratorPool.currentLocale = options.sre.locale;
update = true;
Sre.setupEngine({locale: options.sre.locale})
}
Expand Down