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
15 changes: 9 additions & 6 deletions components/mjs/a11y/speech/speech.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ import {SpeechHandler} from '#js/a11y/speech.js';

if (MathJax.loader) {
let path = Package.resolvePath('[sre]', false);
if (!hasWindow) {
let maps = Package.resolvePath('[mathmaps]', false);
if (hasWindow) {
path = new URL(path, location).href;
maps = new URL(maps, location).href;
} else {
const REQUIRE = typeof require !== 'undefined' ? require : MathJax.config.loader.require;
if (REQUIRE?.resolve) {
const pool = MathJax.config.options?.worker?.pool || 'speech-workerpool.js';
path = path.replace(/\/bundle\/sre$/, '/cjs/a11y/sre');
path = REQUIRE.resolve(`${path}/${pool}`).replace(/\/[^\/]*$/, '');
path = REQUIRE.resolve(`${path}/package.json`).replace(/\/[^\/]*$/, '');
maps = REQUIRE.resolve(`${maps}/base.json`).replace(/\/[^\/]*$/, '');
} else {
path = '';
path = maps = '';
}
}
if (path) {
combineDefaults(MathJax.config, 'options', { worker: { path } });
combineDefaults(MathJax.config, 'options', { worker: { path, maps } });
}
}

Expand Down
12 changes: 0 additions & 12 deletions components/mjs/a11y/sre/workerpool/config.json

This file was deleted.

6 changes: 0 additions & 6 deletions components/mjs/a11y/sre/workerpool/speech-workerpool.js

This file was deleted.

5 changes: 0 additions & 5 deletions components/mjs/a11y/sre/workerpool/webpack.cjs

This file was deleted.

3 changes: 2 additions & 1 deletion components/mjs/dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ export const dependencies = {
export const paths = {
tex: '[mathjax]/input/tex/extensions',
mml: '[mathjax]/input/mml/extensions',
sre: '[mathjax]/sre'
sre: '[mathjax]/sre',
mathmaps: '[sre]/mathmaps',
};

export const provides = {
Expand Down
1 change: 1 addition & 0 deletions components/mjs/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const source = {
'a11y/complexity': `${src}/a11y/complexity/complexity.js`,
'a11y/explorer': `${src}/a11y/explorer/explorer.js`,
'a11y/sre': `${src}/a11y/sre/sre.js`,
'[mathmaps]': `${src}/../../bundle/sre/mathmaps`,
'ui/lazy': `${src}/ui/lazy/lazy.js`,
'ui/menu': `${src}/ui/menu/menu.js`,
'ui/safe': `${src}/ui/safe/safe.js`,
Expand Down
3 changes: 0 additions & 3 deletions lab/build/init.js

This file was deleted.

1 change: 0 additions & 1 deletion lab/build/sre.js
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
import './init.js';
export * from '#js/a11y/sre/sre.js';
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,6 @@
"@mathjax/mathjax-newcm-font": "4.0.0-rc.2",
"mhchemparser": "^4.2.1",
"mj-context-menu": "^0.9.1",
"speech-rule-engine": "5.0.0-alpha.6"
"speech-rule-engine": "5.0.0-alpha.7"
}
}
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion ts/a11y/speech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export function SpeechMathDocumentMixin<
}),
worker: {
path: sreRoot(),
pool: 'speech-workerpool.html',
maps: sreRoot().replace(/[cm]js\/a11y\/sre$/, 'bundle/sre/mathmaps'),
worker: 'speech-worker.js',
debug: false,
},
Expand Down
3 changes: 1 addition & 2 deletions ts/a11y/speech/MessageTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,9 @@ export type WorkerCommand = {
data: Message;
};

export type PoolCommand = {
export type ClientCommand = {
cmd: string;
data: WorkerCommand | Message;
};

export type Structure = { [id: string]: any };
export type StructureData = Structure | string;
Loading