@pie-lib/math-input-mathlive 2.0.1-next.20261109082044 → 2.0.1-next.20261109091947
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.
- package/dist/i18n/ar.d.ts +4 -0
- package/dist/i18n/ar.js +4 -0
- package/dist/i18n/cy.d.ts +4 -0
- package/dist/i18n/cy.js +4 -0
- package/dist/i18n/en-AU.d.ts +4 -0
- package/dist/i18n/en-AU.js +4 -0
- package/dist/i18n/en-GB.d.ts +4 -0
- package/dist/i18n/en-GB.js +4 -0
- package/dist/i18n/en-US.d.ts +6 -0
- package/dist/i18n/en-US.js +4 -0
- package/dist/i18n/es.d.ts +4 -0
- package/dist/i18n/es.js +4 -0
- package/dist/i18n/fr.d.ts +4 -0
- package/dist/i18n/fr.js +4 -0
- package/dist/i18n/index.d.ts +3 -0
- package/dist/i18n/index.js +67 -0
- package/dist/i18n/ja.d.ts +4 -0
- package/dist/i18n/ja.js +4 -0
- package/dist/i18n/ko.d.ts +4 -0
- package/dist/i18n/ko.js +4 -0
- package/dist/i18n/nl-NL.d.ts +4 -0
- package/dist/i18n/nl-NL.js +4 -0
- package/dist/i18n/pt.d.ts +4 -0
- package/dist/i18n/pt.js +4 -0
- package/dist/i18n/ro.d.ts +4 -0
- package/dist/i18n/ro.js +4 -0
- package/dist/i18n/sv.d.ts +4 -0
- package/dist/i18n/sv.js +4 -0
- package/dist/i18n/th-TH.d.ts +4 -0
- package/dist/i18n/th-TH.js +4 -0
- package/dist/i18n/zh.d.ts +4 -0
- package/dist/i18n/zh.js +4 -0
- package/dist/mf/field-label.d.ts +4 -1
- package/dist/mf/field-label.js +7 -8
- package/dist/mf/input.d.ts +2 -0
- package/dist/mf/input.js +3 -2
- package/dist/mf/static.d.ts +2 -0
- package/dist/mf/static.js +3 -2
- package/package.json +3 -3
package/dist/i18n/ar.js
ADDED
package/dist/i18n/cy.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** The interface strings `@pie-lib/math-input-mathlive` renders; the source for every other locale. */
|
|
2
|
+
declare const _default: {
|
|
3
|
+
/** Accessible name of a `<math-field>` and of the keyboard input inside it. */
|
|
4
|
+
enterAnswerA11y: string;
|
|
5
|
+
};
|
|
6
|
+
export default _default;
|
package/dist/i18n/es.js
ADDED
package/dist/i18n/fr.js
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import e from "./en-US.js";
|
|
2
|
+
import { defineCatalogs as t } from "@pie-element/shared-i18n";
|
|
3
|
+
//#region src/i18n/index.ts
|
|
4
|
+
var n = t({
|
|
5
|
+
packageName: "@pie-lib/math-input-mathlive",
|
|
6
|
+
source: e,
|
|
7
|
+
loaders: {
|
|
8
|
+
es: () => import(
|
|
9
|
+
/* webpackMode: "eager" */
|
|
10
|
+
"./es.js"
|
|
11
|
+
),
|
|
12
|
+
"th-TH": () => import(
|
|
13
|
+
/* webpackMode: "eager" */
|
|
14
|
+
"./th-TH.js"
|
|
15
|
+
),
|
|
16
|
+
"en-GB": () => import(
|
|
17
|
+
/* webpackMode: "eager" */
|
|
18
|
+
"./en-GB.js"
|
|
19
|
+
),
|
|
20
|
+
"en-AU": () => import(
|
|
21
|
+
/* webpackMode: "eager" */
|
|
22
|
+
"./en-AU.js"
|
|
23
|
+
),
|
|
24
|
+
fr: () => import(
|
|
25
|
+
/* webpackMode: "eager" */
|
|
26
|
+
"./fr.js"
|
|
27
|
+
),
|
|
28
|
+
ar: () => import(
|
|
29
|
+
/* webpackMode: "eager" */
|
|
30
|
+
"./ar.js"
|
|
31
|
+
),
|
|
32
|
+
pt: () => import(
|
|
33
|
+
/* webpackMode: "eager" */
|
|
34
|
+
"./pt.js"
|
|
35
|
+
),
|
|
36
|
+
ko: () => import(
|
|
37
|
+
/* webpackMode: "eager" */
|
|
38
|
+
"./ko.js"
|
|
39
|
+
),
|
|
40
|
+
ja: () => import(
|
|
41
|
+
/* webpackMode: "eager" */
|
|
42
|
+
"./ja.js"
|
|
43
|
+
),
|
|
44
|
+
zh: () => import(
|
|
45
|
+
/* webpackMode: "eager" */
|
|
46
|
+
"./zh.js"
|
|
47
|
+
),
|
|
48
|
+
cy: () => import(
|
|
49
|
+
/* webpackMode: "eager" */
|
|
50
|
+
"./cy.js"
|
|
51
|
+
),
|
|
52
|
+
sv: () => import(
|
|
53
|
+
/* webpackMode: "eager" */
|
|
54
|
+
"./sv.js"
|
|
55
|
+
),
|
|
56
|
+
"nl-NL": () => import(
|
|
57
|
+
/* webpackMode: "eager" */
|
|
58
|
+
"./nl-NL.js"
|
|
59
|
+
),
|
|
60
|
+
ro: () => import(
|
|
61
|
+
/* webpackMode: "eager" */
|
|
62
|
+
"./ro.js"
|
|
63
|
+
)
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
//#endregion
|
|
67
|
+
export { n as catalogs };
|
package/dist/i18n/ja.js
ADDED
package/dist/i18n/ko.js
ADDED
package/dist/i18n/pt.js
ADDED
package/dist/i18n/ro.js
ADDED
package/dist/i18n/sv.js
ADDED
package/dist/i18n/zh.js
ADDED
package/dist/mf/field-label.d.ts
CHANGED
|
@@ -10,7 +10,10 @@
|
|
|
10
10
|
* The field is a group around that textbox. With MathLive's own `math` role, which it sets
|
|
11
11
|
* through ElementInternals, a focusable field holding a focusable textbox is a nested
|
|
12
12
|
* interactive control.
|
|
13
|
+
*
|
|
14
|
+
* The name follows `language`. A locale that is not resident names the field in English and
|
|
15
|
+
* starts loading; `onLoad` runs once it settles, so a component passes its own relabel there.
|
|
13
16
|
*/
|
|
14
|
-
export declare function labelMathField(mathField: Element | null | undefined, language?: string): void;
|
|
17
|
+
export declare function labelMathField(mathField: Element | null | undefined, language?: string, onLoad?: () => void): void;
|
|
15
18
|
/** Points a `<math-field>` at the element that describes it, or drops the reference. */
|
|
16
19
|
export declare function describeMathField(mathField: Element | null | undefined, describedBy?: string): void;
|
package/dist/mf/field-label.js
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import e from "
|
|
1
|
+
import { catalogs as e } from "../i18n/index.js";
|
|
2
2
|
//#region src/mf/field-label.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
e.setAttribute("role", "group"), e.setAttribute("aria-label", r), e.shadowRoot?.querySelector(".ML__keyboard-sink")?.setAttribute("aria-label", r);
|
|
3
|
+
function t(t, n, r) {
|
|
4
|
+
if (!t) return;
|
|
5
|
+
let i = e.forLocale(n, r).t("enterAnswerA11y");
|
|
6
|
+
t.setAttribute("role", "group"), t.setAttribute("aria-label", i), t.shadowRoot?.querySelector(".ML__keyboard-sink")?.setAttribute("aria-label", i);
|
|
8
7
|
}
|
|
9
|
-
function
|
|
8
|
+
function n(e, t) {
|
|
10
9
|
e && (t ? e.setAttribute("aria-describedby", t) : e.removeAttribute("aria-describedby"));
|
|
11
10
|
}
|
|
12
11
|
//#endregion
|
|
13
|
-
export {
|
|
12
|
+
export { n as describeMathField, t as labelMathField };
|
package/dist/mf/input.d.ts
CHANGED
|
@@ -20,6 +20,8 @@ export declare class Input extends React.Component {
|
|
|
20
20
|
readOnly: PropTypes.Requireable<boolean>;
|
|
21
21
|
innerRef: PropTypes.Requireable<(...args: any[]) => any>;
|
|
22
22
|
};
|
|
23
|
+
/** Renames the field once the language's catalog lands, for an element that did not preload it. */
|
|
24
|
+
relabel: () => void;
|
|
23
25
|
constructor(props: any);
|
|
24
26
|
componentDidMount(): Promise<void>;
|
|
25
27
|
componentDidUpdate(prevProps: any): void;
|
package/dist/mf/input.js
CHANGED
|
@@ -30,17 +30,18 @@ var _ = h("pie-lib:math-input-mathlive:input"), v = /([0-9])\\ (\\frac\{[^{}]*\}
|
|
|
30
30
|
readOnly: p.bool,
|
|
31
31
|
innerRef: p.func
|
|
32
32
|
};
|
|
33
|
+
relabel = () => u(this.mathField, this.props.language);
|
|
33
34
|
constructor(e) {
|
|
34
35
|
super(e), this.holderRef = f.createRef(), this.lastEmitted = void 0;
|
|
35
36
|
}
|
|
36
37
|
async componentDidMount() {
|
|
37
38
|
let e = this.mountGeneration = (this.mountGeneration || 0) + 1, t = await s();
|
|
38
|
-
e === this.mountGeneration && t?.MathfieldElement && this.holderRef.current && !this.mathField && (this.mathField = o(t), u(this.mathField, this.props.language), l(this.mathField, this.props.ariaDescribedBy), this.mathField.value = r(this.props.latex || ""), this.props.readOnly && (this.mathField.readOnly = !0), this.mathField.mathVirtualKeyboardPolicy = "manual", this.mathField.mathModeSpace = "\\ ", this.mathField.smartSuperscript = !1, a(this.mathField), this.untrackCaret = c(this.mathField), this.untrackSelection = d(this.mathField), this.untrackLongDivision = i(this.mathField), this.mathField.addEventListener("input", this.onInputEdit), this.holderRef.current.replaceChildren(this.mathField), u(this.mathField, this.props.language), this.props.innerRef && this.props.innerRef(this), this.pendingFocus && (this.pendingFocus = !1, this.mathField.focus()));
|
|
39
|
+
e === this.mountGeneration && t?.MathfieldElement && this.holderRef.current && !this.mathField && (this.mathField = o(t), u(this.mathField, this.props.language, this.relabel), l(this.mathField, this.props.ariaDescribedBy), this.mathField.value = r(this.props.latex || ""), this.props.readOnly && (this.mathField.readOnly = !0), this.mathField.mathVirtualKeyboardPolicy = "manual", this.mathField.mathModeSpace = "\\ ", this.mathField.smartSuperscript = !1, a(this.mathField), this.untrackCaret = c(this.mathField), this.untrackSelection = d(this.mathField), this.untrackLongDivision = i(this.mathField), this.mathField.addEventListener("input", this.onInputEdit), this.holderRef.current.replaceChildren(this.mathField), u(this.mathField, this.props.language, this.relabel), this.props.innerRef && this.props.innerRef(this), this.pendingFocus && (this.pendingFocus = !1, this.mathField.focus()));
|
|
39
40
|
}
|
|
40
41
|
componentDidUpdate(e) {
|
|
41
42
|
if (!this.mathField) return;
|
|
42
43
|
let { latex: t, readOnly: n, language: i } = this.props;
|
|
43
|
-
if (i !== e.language && u(this.mathField, i), this.props.ariaDescribedBy !== e.ariaDescribedBy && l(this.mathField, this.props.ariaDescribedBy), n !== e.readOnly && (this.mathField.readOnly = !!n), t != null && t !== this.lastEmitted) {
|
|
44
|
+
if (i !== e.language && u(this.mathField, i, this.relabel), this.props.ariaDescribedBy !== e.ariaDescribedBy && l(this.mathField, this.props.ariaDescribedBy), n !== e.readOnly && (this.mathField.readOnly = !!n), t != null && t !== this.lastEmitted) {
|
|
44
45
|
let e = r(t);
|
|
45
46
|
e !== this.mathField.value && (this.mathField.value = e);
|
|
46
47
|
}
|
package/dist/mf/static.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export default class Static extends React.Component {
|
|
|
31
31
|
static defaultProps: {
|
|
32
32
|
getFieldName: () => void;
|
|
33
33
|
};
|
|
34
|
+
/** Renames the field once the language's catalog lands, for an element that did not preload it. */
|
|
35
|
+
relabel: () => void;
|
|
34
36
|
constructor(props: any);
|
|
35
37
|
componentDidMount(): void;
|
|
36
38
|
/** Render display markup, or mount a live field when the latex has answer blocks. */
|
package/dist/mf/static.js
CHANGED
|
@@ -35,6 +35,7 @@ var E = w("pie-lib:math-input-mathlive:static"), D = "position:absolute;width:1p
|
|
|
35
35
|
setInput: S.func
|
|
36
36
|
};
|
|
37
37
|
static defaultProps = { getFieldName: () => {} };
|
|
38
|
+
relabel = () => b(this.mathField, this.props.language);
|
|
38
39
|
constructor(e) {
|
|
39
40
|
super(e), this.holderRef = x.createRef(), this.state = { markup: "" }, this.promptValues = {};
|
|
40
41
|
}
|
|
@@ -48,10 +49,10 @@ var E = w("pie-lib:math-input-mathlive:static"), D = "position:absolute;width:1p
|
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
let t = await _();
|
|
51
|
-
e === this.mountGeneration && t?.MathfieldElement && this.holderRef.current && !this.mathField && (this.mathField = m(t), b(this.mathField, this.props.language), y(this.mathField, this.props.ariaDescribedBy), this.mathField.readOnly = !0, this.mathField.mathVirtualKeyboardPolicy = "manual", this.mathField.mathModeSpace = "\\ ", this.mathField.smartSuperscript = !1, this.mathField.value = s(this.props.latex), p(this.mathField), this.untrackCaret = v(this.mathField), this.untrackLongDivision = f(this.mathField), this.mathField.addEventListener("input", this.onPromptInput), this.mathField.addEventListener("pointerdown", this.onPointerDown, !0), this.mathField.addEventListener("focusin", this.onPromptFocus), this.mathField.addEventListener("selection-change", this.onSelectionChange), this.mathField.addEventListener("keydown", this.onKeyDown), this.holderRef.current.replaceChildren(this.mathField), b(this.mathField, this.props.language), this.parkCaret(), this.createLiveRegion());
|
|
52
|
+
e === this.mountGeneration && t?.MathfieldElement && this.holderRef.current && !this.mathField && (this.mathField = m(t), b(this.mathField, this.props.language, this.relabel), y(this.mathField, this.props.ariaDescribedBy), this.mathField.readOnly = !0, this.mathField.mathVirtualKeyboardPolicy = "manual", this.mathField.mathModeSpace = "\\ ", this.mathField.smartSuperscript = !1, this.mathField.value = s(this.props.latex), p(this.mathField), this.untrackCaret = v(this.mathField), this.untrackLongDivision = f(this.mathField), this.mathField.addEventListener("input", this.onPromptInput), this.mathField.addEventListener("pointerdown", this.onPointerDown, !0), this.mathField.addEventListener("focusin", this.onPromptFocus), this.mathField.addEventListener("selection-change", this.onSelectionChange), this.mathField.addEventListener("keydown", this.onKeyDown), this.holderRef.current.replaceChildren(this.mathField), b(this.mathField, this.props.language, this.relabel), this.parkCaret(), this.createLiveRegion());
|
|
52
53
|
}
|
|
53
54
|
componentDidUpdate(e, t) {
|
|
54
|
-
!this.mathField && this.state.markup !== (t && t.markup) && d(this.holderRef.current), this.mathField && e.language !== this.props.language && b(this.mathField, this.props.language), this.mathField && e.ariaDescribedBy !== this.props.ariaDescribedBy && y(this.mathField, this.props.ariaDescribedBy), e.latex !== this.props.latex && (this.isInteractive() === this.interactive ? this.mathField ? n(this.props.latex) === n(e.latex) ? this.syncPrompts() : (this.mathField.value = s(this.props.latex), this.parkCaret()) : this.renderMarkup() : (this.unmountField(), this.setState({ markup: "" }), this.mount()));
|
|
55
|
+
!this.mathField && this.state.markup !== (t && t.markup) && d(this.holderRef.current), this.mathField && e.language !== this.props.language && b(this.mathField, this.props.language, this.relabel), this.mathField && e.ariaDescribedBy !== this.props.ariaDescribedBy && y(this.mathField, this.props.ariaDescribedBy), e.latex !== this.props.latex && (this.isInteractive() === this.interactive ? this.mathField ? n(this.props.latex) === n(e.latex) ? this.syncPrompts() : (this.mathField.value = s(this.props.latex), this.parkCaret()) : this.renderMarkup() : (this.unmountField(), this.setState({ markup: "" }), this.mount()));
|
|
55
56
|
}
|
|
56
57
|
parkCaret() {
|
|
57
58
|
if (!this.mathField || this.mathField.hasFocus?.()) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-lib/math-input-mathlive",
|
|
3
|
-
"version": "2.0.1-next.
|
|
3
|
+
"version": "2.0.1-next.20261109091947",
|
|
4
4
|
"description": "MathLive-based math input (drop-in alternative to @pie-lib/math-input)",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"mathlive": "0.110.0",
|
|
18
18
|
"prop-types": "^15.7.2",
|
|
19
19
|
"@pie-element/shared-lodash": "0.1.4-next.20261026212738",
|
|
20
|
-
"@pie-lib/render-ui": "8.0.8-next.
|
|
21
|
-
"@pie-
|
|
20
|
+
"@pie-lib/render-ui": "8.0.8-next.20261109091947",
|
|
21
|
+
"@pie-element/shared-i18n": "0.1.3-next.20261109082044"
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
24
|
"main": "./dist/index.js",
|