@pie-element/shared-math-rendering-mathjax 0.1.4-next.20261007175429 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,11 @@
1
- export interface MathNameOptions {
2
- /**
3
- * Speaks one MathML `<math>` element. Defaults to the built-in English speaker; a host passes its
4
- * own to use SRE, another locale or ClearSpeak's full rule set. Returning nothing falls back to
5
- * the element's text.
6
- */
7
- speak?: (math: Element) => string | undefined;
8
- }
9
1
  /**
10
- * The accessible name of a control from its rendered content, or undefined when the content holds
11
- * no math, which leaves the name to the browser. Plain text and math keep their order, so a
12
- * choice of `(9.7 + √25)` followed by `feet` reads as one phrase.
13
- *
14
- * Shaped as a `ContentNamer` for `useDraggableControl`, and usable for any control that names
15
- * itself from its content: the result goes in `aria-label`. Math is read from the hidden MathML
16
- * that MathJax adds to each `mjx-container`, so call this after the content is typeset.
2
+ * Labels a typeset expression inside a control with its English speech, read from the hidden
3
+ * MathML MathJax leaves in the `mjx-container`. An `aria-label` on the container, which has no
4
+ * role, puts that speech in the name of the control around it in Chromium, Firefox and WebKit,
5
+ * among the control's other text. Math outside controls stays unlabelled, so screen readers keep
6
+ * navigating its MathML. A container that already has a label keeps it, because the page's
7
+ * renderer or a host's speech engine set it.
17
8
  */
18
- export declare function mathContentName(content: Element, options?: MathNameOptions): string | undefined;
9
+ export declare function nameMathInControl(container: Element): void;
10
+ /** Labels each typeset expression in `root` that sits inside a control. */
11
+ export declare function nameMathInControls(root: Element): void;
@@ -3,8 +3,8 @@
3
3
  * hidden MathML both MathJax versions emit, so it runs without MathJax's speech engine and its
4
4
  * worker, which a strict CSP blocks. Coverage is the school-math core: numbers, identifiers,
5
5
  * operators, fences, fractions, roots, scripts, limits on sums and integrals, accents and tables.
6
- * An element outside it speaks its children in order. A host that wants SRE or another engine
7
- * passes its own speaker to `mathContentName`.
6
+ * An element outside it speaks its children in order. A host that wants SRE, another locale or
7
+ * ClearSpeak's full rule set replaces the `aria-label` it puts on each `mjx-container`.
8
8
  */
9
9
  /** The English speech of one `<math>` element. */
10
10
  export declare function speakMathml(math: Element): string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/shared-math-rendering-mathjax",
3
- "version": "0.1.4-next.20261007175429",
3
+ "version": "0.1.4",
4
4
  "description": "MathJax adapter for PIE math rendering",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",