@pie-lib/math-input 9.0.1-next.20261006003311 → 9.0.1-next.20261006032932

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,6 +1,6 @@
1
1
  import { baseSet as e } from "../keys/index.js";
2
- import t from "../mq/static.js";
3
- import { commonMqKeyboardStyles as n } from "../mq/common-mq-styles.js";
2
+ import { commonMqKeyboardStyles as t } from "../mq/common-mq-styles.js";
3
+ import n from "../mq/static.js";
4
4
  import { sortKeys as r } from "./keys-layout.js";
5
5
  import { flatten as i } from "@pie-element/shared-lodash";
6
6
  import a from "react";
@@ -12,20 +12,24 @@ import u from "debug";
12
12
  import { color as d } from "@pie-lib/render-ui";
13
13
  import { jsx as f } from "react/jsx-runtime";
14
14
  //#region src/keypad/index.tsx
15
- var p = u("pie-lib:math-inline:keypad"), m = l(t)(({ latex: e }) => {
15
+ var p = u("pie-lib:math-inline:keypad"), m = d.v("pie"), h = [d.text(), d.keypadInk()], g = { "& .MuiTouchRipple-root": { color: `rgb(from ${d.text()} min(r, 255 - r) min(g, 255 - g) min(b, 255 - b))` } }, _ = { "&.Mui-focusVisible": {
16
+ outline: `2px solid ${d.focusOutline()}`,
17
+ outlineOffset: "-2px",
18
+ boxShadow: `inset 0 0 0 4px ${m("background", d.defaults.WHITE)}`
19
+ } }, v = l(n)(({ latex: e }) => {
16
20
  let t = {
17
21
  pointerEvents: "none",
18
22
  textTransform: "none !important",
19
- color: d.text(),
23
+ color: h,
20
24
  "& .mq-scaled.mq-sqrt-prefix": { transform: "scale(1, 0.9) !important" },
21
25
  "& .mq-sup-only .mq-sup": { marginBottom: "0.9px !important" },
22
26
  "& .mq-empty": { backgroundColor: `${d.keypadEmptyPlaceholder()} !important` },
23
- "& .mq-overline .mq-overline-inner": { borderTop: "2px solid black" },
27
+ "& .mq-overline .mq-overline-inner": { borderTop: "2px solid currentColor" },
24
28
  "& .mq-non-leaf.mq-overline": { borderTop: "none !important" },
25
29
  "& .mq-overarrow": {
26
30
  width: "30px",
27
31
  marginTop: "0 !important",
28
- borderTop: "2px solid black",
32
+ borderTop: "2px solid currentColor",
29
33
  fontFamily: "Roboto, Helvetica, Arial, sans-serif !important",
30
34
  "&.mq-arrow-both": {
31
35
  top: "0px !important",
@@ -85,7 +89,7 @@ var p = u("pie-lib:math-inline:keypad"), m = l(t)(({ latex: e }) => {
85
89
  },
86
90
  "& .mq-parallelogram": { lineHeight: .85 },
87
91
  "& .mq-overarc": {
88
- borderTop: "2px solid black !important",
92
+ borderTop: "2px solid currentColor !important",
89
93
  "& .mq-overline": { borderTop: "none !important" },
90
94
  "& .mq-overline-inner": {
91
95
  borderTop: "none !important",
@@ -110,13 +114,13 @@ var p = u("pie-lib:math-inline:keypad"), m = l(t)(({ latex: e }) => {
110
114
  }
111
115
  } : t;
112
116
  });
113
- m.propTypes = { latex: o.string.isRequired };
114
- var h = (e) => e ? {
117
+ v.propTypes = { latex: o.string.isRequired };
118
+ var y = (e) => e ? {
115
119
  gridTemplateColumns: `repeat(${e.columns}, minmax(min-content, 150px))`,
116
120
  gridTemplateRows: `repeat(${e.rows}, minmax(40px, 60px))`,
117
121
  gridAutoFlow: "initial"
118
- } : {}, g = l("div")(() => ({
119
- ...n,
122
+ } : {}, b = l("div")(() => ({
123
+ ...t,
120
124
  width: "100%",
121
125
  display: "grid",
122
126
  gridTemplateRows: "repeat(5, minmax(40px, 60px))",
@@ -131,18 +135,19 @@ var h = (e) => e ? {
131
135
  gridTemplateRows: "repeat(4, minmax(40px, 50px)) !important",
132
136
  "& *": { fontFamily: "Roboto, Helvetica, Arial, sans-serif !important" }
133
137
  }
134
- })), _ = l(s)(({ category: e, isDelete: t, isComma: n, isDot: r }) => ({
138
+ })), x = l(s)(({ category: e, isDelete: t, isComma: n, isDot: r }) => ({
135
139
  minWidth: "auto",
136
140
  textTransform: "none",
137
141
  fontSize: n || r ? "200% !important" : "140% !important",
138
142
  lineHeight: n || r ? "100%" : "normal",
139
- color: d.text(),
143
+ color: h,
140
144
  backgroundColor: e === "operators" ? d.keypadButtonOperator() : d.keypadButton(),
141
145
  "&:hover": { backgroundColor: e === "operators" ? d.keypadButtonOperatorHover() : d.keypadButtonHover() },
142
- "& .MuiTouchRipple-root": { color: `rgb(from ${d.text()} min(r, 255 - r) min(g, 255 - g) min(b, 255 - b))` },
146
+ ...g,
147
+ ..._,
143
148
  borderRadius: 0,
144
149
  ...t && { fontFamily: "Roboto, Helvetica, Arial, sans-serif !important" }
145
- })), v = l(s)(({ category: e }) => ({
150
+ })), S = l(s)(({ category: e }) => ({
146
151
  textTransform: "none",
147
152
  padding: 0,
148
153
  margin: 0,
@@ -150,14 +155,16 @@ var h = (e) => e ? {
150
155
  minWidth: "auto",
151
156
  borderRadius: 0,
152
157
  backgroundColor: e === "operators" ? d.keypadButtonOperator() : d.keypadButton(),
153
- "&:hover": { backgroundColor: e === "operators" ? d.keypadButtonOperatorHover() : d.keypadButtonHover() }
154
- })), y = l(c)(({ category: e }) => ({
158
+ "&:hover": { backgroundColor: e === "operators" ? d.keypadButtonOperatorHover() : d.keypadButtonHover() },
159
+ ...g,
160
+ ..._
161
+ })), C = l(c)(({ category: e }) => ({
155
162
  minWidth: "auto",
156
163
  backgroundColor: e === "operators" ? d.keypadButtonOperator() : d.keypadButton(),
157
164
  "&:hover": { backgroundColor: e === "operators" ? d.keypadButtonOperatorHover() : d.keypadButtonHover() },
158
165
  borderRadius: 0,
159
166
  "& .icon": { height: "30px" }
160
- })), b = class extends a.Component {
167
+ })), w = class extends a.Component {
161
168
  static propTypes = {
162
169
  className: o.string,
163
170
  controlledKeypadMode: o.bool,
@@ -219,9 +226,9 @@ var h = (e) => e ? {
219
226
  "language"
220
227
  ].includes(a), s = o ? this.flowKeys([], n || []) : this.flowKeys(t, n || []), c = s.length % 5 ? 1 : 0, l = {
221
228
  gridTemplateColumns: `repeat(${Math.floor(s.length / 5) + c}, minmax(min-content, 150px))`,
222
- ...h(r)
229
+ ...y(r)
223
230
  };
224
- return /* @__PURE__ */ f(g, {
231
+ return /* @__PURE__ */ f(b, {
225
232
  ref: this.keypadRef,
226
233
  className: [e, a].filter(Boolean).join(" "),
227
234
  style: l,
@@ -236,16 +243,16 @@ var h = (e) => e ? {
236
243
  ...e.actions || {},
237
244
  ...e.extraProps || {}
238
245
  };
239
- if (e.latex) return /* @__PURE__ */ f(v, {
246
+ if (e.latex) return /* @__PURE__ */ f(S, {
240
247
  onClick: r.onClick,
241
248
  disabled: r.disabled,
242
249
  category: o ? void 0 : e.category,
243
250
  "aria-label": e.ariaLabel ? e.ariaLabel : e.name || e.label,
244
251
  ...e.actions || {},
245
252
  ...e.extraProps || {},
246
- children: /* @__PURE__ */ f(m, { latex: e.latex })
253
+ children: /* @__PURE__ */ f(v, { latex: e.latex })
247
254
  }, r.key);
248
- if (e.label) return /* @__PURE__ */ f(_, {
255
+ if (e.label) return /* @__PURE__ */ f(x, {
249
256
  onClick: r.onClick,
250
257
  disabled: r.disabled,
251
258
  category: o ? void 0 : e.category,
@@ -259,7 +266,7 @@ var h = (e) => e ? {
259
266
  }, r.key);
260
267
  {
261
268
  let t = e.icon ? e.icon : "div";
262
- return /* @__PURE__ */ f(y, {
269
+ return /* @__PURE__ */ f(C, {
263
270
  tabIndex: "-1",
264
271
  onClick: r.onClick,
265
272
  disabled: r.disabled,
@@ -275,4 +282,4 @@ var h = (e) => e ? {
275
282
  }
276
283
  };
277
284
  //#endregion
278
- export { b as KeyPad, b as default };
285
+ export { w as KeyPad, w as default };
@@ -1,3 +1,47 @@
1
+ /**
2
+ * MathQuill's ink, which mathquill.css paints in black, #4d4d4d, grey and gray literals. The caret
3
+ * and the bars take the field's text colour, and an unfocused field's border takes
4
+ * --pie-border-dark. A focused field keeps MathQuill's focus border and glow.
5
+ */
6
+ export declare const mqInkStyles: {
7
+ [x: string]: {
8
+ borderLeftColor: string;
9
+ borderColor?: undefined;
10
+ borderTopColor?: undefined;
11
+ borderBottomColor?: undefined;
12
+ borderRightColor?: undefined;
13
+ } | {
14
+ borderColor: any;
15
+ borderLeftColor?: undefined;
16
+ borderTopColor?: undefined;
17
+ borderBottomColor?: undefined;
18
+ borderRightColor?: undefined;
19
+ } | {
20
+ borderTopColor: string;
21
+ borderLeftColor?: undefined;
22
+ borderColor?: undefined;
23
+ borderBottomColor?: undefined;
24
+ borderRightColor?: undefined;
25
+ } | {
26
+ borderBottomColor: string;
27
+ borderLeftColor?: undefined;
28
+ borderColor?: undefined;
29
+ borderTopColor?: undefined;
30
+ borderRightColor?: undefined;
31
+ } | {
32
+ borderLeftColor: string;
33
+ borderRightColor: string;
34
+ borderColor?: undefined;
35
+ borderTopColor?: undefined;
36
+ borderBottomColor?: undefined;
37
+ };
38
+ '&.mq-editable-field .mq-cursor, & .mq-editable-field .mq-cursor': {
39
+ borderLeftColor: string;
40
+ };
41
+ '&.mq-editable-field:not(.mq-focused), & .mq-editable-field:not(.mq-focused)': {
42
+ borderColor: any;
43
+ };
44
+ };
1
45
  export declare const commonMqFontStyles: {
2
46
  fontFamily: string;
3
47
  '-webkit-font-smoothing': string;
@@ -109,6 +153,45 @@ export declare const commonMqKeyboardStyles: {
109
153
  };
110
154
  };
111
155
  declare const _default: {
156
+ mqInkStyles: {
157
+ [x: string]: {
158
+ borderLeftColor: string;
159
+ borderColor?: undefined;
160
+ borderTopColor?: undefined;
161
+ borderBottomColor?: undefined;
162
+ borderRightColor?: undefined;
163
+ } | {
164
+ borderColor: any;
165
+ borderLeftColor?: undefined;
166
+ borderTopColor?: undefined;
167
+ borderBottomColor?: undefined;
168
+ borderRightColor?: undefined;
169
+ } | {
170
+ borderTopColor: string;
171
+ borderLeftColor?: undefined;
172
+ borderColor?: undefined;
173
+ borderBottomColor?: undefined;
174
+ borderRightColor?: undefined;
175
+ } | {
176
+ borderBottomColor: string;
177
+ borderLeftColor?: undefined;
178
+ borderColor?: undefined;
179
+ borderTopColor?: undefined;
180
+ borderRightColor?: undefined;
181
+ } | {
182
+ borderLeftColor: string;
183
+ borderRightColor: string;
184
+ borderColor?: undefined;
185
+ borderTopColor?: undefined;
186
+ borderBottomColor?: undefined;
187
+ };
188
+ '&.mq-editable-field .mq-cursor, & .mq-editable-field .mq-cursor': {
189
+ borderLeftColor: string;
190
+ };
191
+ '&.mq-editable-field:not(.mq-focused), & .mq-editable-field:not(.mq-focused)': {
192
+ borderColor: any;
193
+ };
194
+ };
112
195
  commonMqFontStyles: {
113
196
  fontFamily: string;
114
197
  '-webkit-font-smoothing': string;
@@ -1,12 +1,30 @@
1
+ import { color as e } from "@pie-lib/render-ui";
1
2
  //#region src/mq/common-mq-styles.ts
2
- var e = {
3
+ var t = (e) => `&.mq-math-mode ${e}, & .mq-math-mode ${e}`, n = {
4
+ "&.mq-editable-field .mq-cursor, & .mq-editable-field .mq-cursor": { borderLeftColor: "currentColor" },
5
+ "&.mq-editable-field:not(.mq-focused), & .mq-editable-field:not(.mq-focused)": { borderColor: e.borderDark() },
6
+ [[
7
+ ".mq-overline .mq-overline-inner",
8
+ ".mq-overarrow",
9
+ ".mq-overarrow .mq-overarrow-inner",
10
+ ".mq-overleftrightarrow .mq-overleftrightarrow-inner",
11
+ ".mq-overarc",
12
+ ".mq-longdiv .mq-longdiv-inner"
13
+ ].map(t).join(", ")]: { borderTopColor: "currentColor" },
14
+ [[".mq-underline", ".mq-xarrow .mq-xarrow-over"].map(t).join(", ")]: { borderBottomColor: "currentColor" },
15
+ [t(".mq-abs")]: {
16
+ borderLeftColor: "currentColor",
17
+ borderRightColor: "currentColor"
18
+ },
19
+ [t(".mq-matrix td.mq-empty")]: { borderColor: "currentColor" }
20
+ }, r = {
3
21
  fontFamily: "MJXZERO, MJXTEX !important",
4
22
  "-webkit-font-smoothing": "antialiased !important",
5
23
  "& .mq-math-mode > span > var": { fontFamily: "MJXZERO, MJXTEX-I !important" },
6
24
  "& .mq-math-mode span var": { fontFamily: "MJXZERO, MJXTEX-I !important" },
7
25
  "& .mq-math-mode .mq-nonSymbola": { fontFamily: "MJXZERO, MJXTEX-I !important" },
8
26
  "& .mq-math-mode > span > var.mq-operator-name": { fontFamily: "MJXZERO, MJXTEX !important" }
9
- }, t = {
27
+ }, i = {
10
28
  "& .mq-longdiv-inner": {
11
29
  marginTop: "-1px",
12
30
  marginLeft: "5px !important;",
@@ -17,7 +35,7 @@ var e = {
17
35
  }
18
36
  },
19
37
  "& .mq-math-mode .mq-longdiv": { display: "inline-flex !important" }
20
- }, n = {
38
+ }, a = {
21
39
  "& .mq-math-mode sup.mq-nthroot": {
22
40
  fontSize: "70% !important",
23
41
  verticalAlign: "0.5em !important",
@@ -31,9 +49,9 @@ var e = {
31
49
  },
32
50
  "& .mq-math-mode .mq-fraction + .mq-supsub.mq-sup-only": { verticalAlign: "0.4em !important" },
33
51
  "& .mq-math-mode .mq-supsub.mq-sup-only.mq-after-fraction-group": { verticalAlign: "0.4em !important" }
34
- }, r = { "& *": {
35
- ...e,
36
- ...t,
52
+ }, o = { "& *": {
53
+ ...r,
54
+ ...i,
37
55
  "& .mq-math-mode .mq-sqrt-prefix": { top: "0 !important" },
38
56
  "& .mq-math-mode .mq-empty": { padding: "9px 1px !important" },
39
57
  "& .mq-math-mode .mq-longdiv-inner .mq-empty": { padding: "0 !important" },
@@ -45,11 +63,12 @@ var e = {
45
63
  "& .mq-math-mode .mq-paren": { verticalAlign: "middle !important" },
46
64
  "& .mq-math-mode .mq-overarrow .mq-overarrow-inner .mq-empty": { padding: "0 !important" },
47
65
  "& .mq-math-mode .mq-overline .mq-overline-inner .mq-empty ": { padding: "0 !important" }
48
- } }, i = {
49
- commonMqFontStyles: e,
50
- longdivStyles: t,
51
- supsubStyles: n,
52
- commonMqKeyboardStyles: r
66
+ } }, s = {
67
+ mqInkStyles: n,
68
+ commonMqFontStyles: r,
69
+ longdivStyles: i,
70
+ supsubStyles: a,
71
+ commonMqKeyboardStyles: o
53
72
  };
54
73
  //#endregion
55
- export { e as commonMqFontStyles, r as commonMqKeyboardStyles, i as default, t as longdivStyles, n as supsubStyles };
74
+ export { r as commonMqFontStyles, o as commonMqKeyboardStyles, s as default, i as longdivStyles, n as mqInkStyles, a as supsubStyles };
package/dist/mq/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { __exportAll as e } from "../_virtual/_rolldown/runtime.js";
2
- import { Input as t } from "./input.js";
3
- import n from "./static.js";
4
- import r from "./common-mq-styles.js";
2
+ import t from "./common-mq-styles.js";
3
+ import { Input as n } from "./input.js";
4
+ import r from "./static.js";
5
5
  //#region src/mq/index.ts
6
6
  var i = /* @__PURE__ */ e({
7
- CommonMqStyles: () => r,
8
- Input: () => t,
9
- Static: () => n
7
+ CommonMqStyles: () => t,
8
+ Input: () => n,
9
+ Static: () => r
10
10
  });
11
11
  //#endregion
12
- export { r as CommonMqStyles, t as Input, n as Static, i as mq_exports };
12
+ export { t as CommonMqStyles, n as Input, r as Static, i as mq_exports };
package/dist/mq/input.js CHANGED
@@ -1,20 +1,21 @@
1
1
  import { labelFieldTextareas as e } from "./field-label.js";
2
2
  import { MQ as t } from "./mathquill-instance.js";
3
- import n from "react";
4
- import r from "prop-types";
5
- import { styled as i } from "@mui/material/styles";
6
- import a from "debug";
7
- import { jsx as o } from "react/jsx-runtime";
3
+ import { mqInkStyles as n } from "./common-mq-styles.js";
4
+ import r from "react";
5
+ import i from "prop-types";
6
+ import { styled as a } from "@mui/material/styles";
7
+ import o from "debug";
8
+ import { jsx as s } from "react/jsx-runtime";
8
9
  //#region src/mq/input.tsx
9
- var s = a("math-input:mq:input"), c = i("span")({}), l = class extends n.Component {
10
+ var c = o("math-input:mq:input"), l = a("span")(n), u = class extends r.Component {
10
11
  static propTypes = {
11
- className: r.string,
12
- onClick: r.func,
13
- onChange: r.func,
14
- latex: r.string,
15
- onFocus: r.func,
16
- onBlur: r.func,
17
- language: r.string
12
+ className: i.string,
13
+ onClick: i.func,
14
+ onChange: i.func,
15
+ latex: i.string,
16
+ onFocus: i.func,
17
+ onBlur: i.func,
18
+ language: i.string
18
19
  };
19
20
  componentDidMount() {
20
21
  if (!t) throw Error("MQ is not defined - but component has mounted?");
@@ -32,13 +33,13 @@ var s = a("math-input:mq:input"), c = i("span")({}), l = class extends n.Compone
32
33
  return this.mathField.latex(""), "";
33
34
  }
34
35
  blur() {
35
- s("blur mathfield"), this.mathField.blur();
36
+ c("blur mathfield"), this.mathField.blur();
36
37
  }
37
38
  focus() {
38
- s("focus mathfield..."), this.mathField.focus();
39
+ c("focus mathfield..."), this.mathField.focus();
39
40
  }
40
41
  command(e) {
41
- return s("command: ", e), Array.isArray(e) ? e.forEach((e) => {
42
+ return c("command: ", e), Array.isArray(e) ? e.forEach((e) => {
42
43
  this.mathField.cmd(e);
43
44
  }) : this.mathField.cmd(e), this.mathField.focus(), this.mathField.latex();
44
45
  }
@@ -46,10 +47,10 @@ var s = a("math-input:mq:input"), c = i("span")({}), l = class extends n.Compone
46
47
  return this.mathField.keystroke(e), this.mathField.focus(), this.mathField.latex();
47
48
  }
48
49
  write(e) {
49
- return s("write: ", e), this.mathField.write(e), this.mathField.focus(), this.mathField.latex();
50
+ return c("write: ", e), this.mathField.write(e), this.mathField.focus(), this.mathField.latex();
50
51
  }
51
52
  onInputEdit = () => {
52
- s("[onInputEdit] ...");
53
+ c("[onInputEdit] ...");
53
54
  let { onChange: e } = this.props;
54
55
  this.mathField && e && e(this.mathField.latex());
55
56
  };
@@ -67,11 +68,11 @@ var s = a("math-input:mq:input"), c = i("span")({}), l = class extends n.Compone
67
68
  this.refresh(), t && t(e);
68
69
  };
69
70
  shouldComponentUpdate(e) {
70
- return s("next: ", e.latex), s("current: ", this.mathField.latex()), e.latex !== this.mathField.latex();
71
+ return c("next: ", e.latex), c("current: ", this.mathField.latex()), e.latex !== this.mathField.latex();
71
72
  }
72
73
  render() {
73
74
  let { onFocus: e, onBlur: t, className: n } = this.props;
74
- return /* @__PURE__ */ o(c, {
75
+ return /* @__PURE__ */ s(l, {
75
76
  className: n,
76
77
  onKeyDown: this.onKeyPress,
77
78
  onClick: this.onClick,
@@ -82,4 +83,4 @@ var s = a("math-input:mq:input"), c = i("span")({}), l = class extends n.Compone
82
83
  }
83
84
  };
84
85
  //#endregion
85
- export { l as Input, l as default };
86
+ export { u as Input, u as default };
package/dist/mq/static.js CHANGED
@@ -1,31 +1,33 @@
1
1
  import { updateSpans as e } from "../updateSpans.js";
2
2
  import { labelFieldTextareas as t } from "./field-label.js";
3
3
  import { MQ as n } from "./mathquill-instance.js";
4
- import r from "react";
5
- import i from "prop-types";
6
- import a from "debug";
7
- import { jsx as o } from "react/jsx-runtime";
4
+ import { mqInkStyles as r } from "./common-mq-styles.js";
5
+ import i from "react";
6
+ import a from "prop-types";
7
+ import { styled as o } from "@mui/material/styles";
8
+ import s from "debug";
9
+ import { jsx as c } from "react/jsx-runtime";
8
10
  //#region src/mq/static.tsx
9
- var s = a("pie-lib:math-input:mq:static"), c = /\\MathQuillMathField\[r\d*\]\{(.*?)\}/g, l = / /g;
10
- function u(e = "") {
11
- return e.replace(l, "");
11
+ var l = s("pie-lib:math-input:mq:static"), u = /\\MathQuillMathField\[r\d*\]\{(.*?)\}/g, d = / /g;
12
+ function f(e = "") {
13
+ return e.replace(d, "");
12
14
  }
13
- function d(e) {
15
+ function p(e) {
14
16
  let t = 0;
15
17
  for (let n = 0; n < (e || "").length; n++) e[n] === "{" && t++;
16
18
  return t;
17
19
  }
18
- var f = class extends r.Component {
20
+ var m = o("span")(r), h = class extends i.Component {
19
21
  static propTypes = {
20
- latex: i.string.isRequired,
21
- onFocus: i.func,
22
- onBlur: i.func,
23
- className: i.string,
24
- getFieldName: i.func,
25
- onSubFieldChange: i.func,
26
- onSubFieldFocus: i.func,
27
- setInput: i.func,
28
- language: i.string
22
+ latex: a.string.isRequired,
23
+ onFocus: a.func,
24
+ onBlur: a.func,
25
+ className: a.string,
26
+ getFieldName: a.func,
27
+ onSubFieldChange: a.func,
28
+ onSubFieldFocus: a.func,
29
+ setInput: a.func,
30
+ language: a.string
29
31
  };
30
32
  static defaultProps = { getFieldName: () => {} };
31
33
  constructor(e) {
@@ -34,7 +36,7 @@ var f = class extends r.Component {
34
36
  previousLatex: "",
35
37
  inputSource: null,
36
38
  isDeleteKeyPressed: !1
37
- }, this.inputRef = r.createRef();
39
+ }, this.inputRef = i.createRef();
38
40
  }
39
41
  componentDidMount() {
40
42
  this.update(), e(), this.createLiveRegion(), this.addEventListeners();
@@ -85,7 +87,7 @@ var f = class extends r.Component {
85
87
  return;
86
88
  }
87
89
  let { previousLatex: t, inputSource: n, isDeleteKeyPressed: r } = this.state, i = "Converted to math symbol";
88
- if (n === "keyboard" && !r) if (d(e) > d(t)) this.announceMessage(i);
90
+ if (n === "keyboard" && !r) if (p(e) > p(t)) this.announceMessage(i);
89
91
  else try {
90
92
  this.mathField.parseLatex(t), this.mathField.parseLatex(e), e == t && this.announceMessage(i);
91
93
  } catch (e) {
@@ -114,15 +116,15 @@ var f = class extends r.Component {
114
116
  t(this.inputRef?.current, this.props.language);
115
117
  };
116
118
  blur = () => {
117
- s("blur mathfield"), this.mathField.blur();
119
+ l("blur mathfield"), this.mathField.blur();
118
120
  };
119
121
  focus = () => {
120
- s("focus mathfield..."), this.mathField.focus();
122
+ l("focus mathfield..."), this.mathField.focus();
121
123
  };
122
124
  shouldComponentUpdate(e) {
123
125
  try {
124
- let t = u(this.mathField.parseLatex(e.latex)), n = (e.latex.match(c) || []).length, r = t !== u(this.mathField.latex().trim()) || n !== Object.keys(this.mathField.innerFields).length / 2;
125
- return s("[shouldComponentUpdate] ", r), r;
126
+ let t = f(this.mathField.parseLatex(e.latex)), n = (e.latex.match(u) || []).length, r = t !== f(this.mathField.latex().trim()) || n !== Object.keys(this.mathField.innerFields).length / 2;
127
+ return l("[shouldComponentUpdate] ", r), r;
126
128
  } catch (e) {
127
129
  return console.warn("Error parsing latex:", e.message, "skip update"), console.warn(e), !1;
128
130
  }
@@ -142,7 +144,7 @@ var f = class extends r.Component {
142
144
  };
143
145
  render() {
144
146
  let { onBlur: e, className: t } = this.props;
145
- return /* @__PURE__ */ o("span", {
147
+ return /* @__PURE__ */ c(m, {
146
148
  className: t,
147
149
  onFocus: this.onFocus,
148
150
  onBlur: e,
@@ -151,4 +153,4 @@ var f = class extends r.Component {
151
153
  }
152
154
  };
153
155
  //#endregion
154
- export { f as default };
156
+ export { h as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/math-input",
3
- "version": "9.0.1-next.20261006003311",
3
+ "version": "9.0.1-next.20261006032932",
4
4
  "description": "React implementation of @pie-lib/math-input",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,8 +16,8 @@
16
16
  "debug": "^4.1.1",
17
17
  "prop-types": "^15.7.2",
18
18
  "@pie-element/shared-lodash": "0.1.2-next.20261005190856",
19
- "@pie-lib/render-ui": "8.0.1-next.20261006003311",
20
- "@pie-lib/translator": "5.0.1-next.20261005075357"
19
+ "@pie-lib/render-ui": "8.0.1-next.20261006032932",
20
+ "@pie-lib/translator": "5.0.1-next.20261006032932"
21
21
  },
22
22
  "type": "module",
23
23
  "main": "./dist/index.js",