@pie-lib/math-input-mathlive 2.0.1-next.20261112103425 → 2.0.1-next.20261116081603

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/index.d.ts CHANGED
@@ -4,6 +4,7 @@ import MathInput from './math-input.js';
4
4
  import HorizontalKeypad from './horizontal-keypad.js';
5
5
  import KeyPad from './keypad/index.js';
6
6
  import * as mf from './mf/index.js';
7
+ import { deepActiveElement } from './mf/inactive-caret.js';
7
8
  import { registerEmbed, applyStaticMath, latexToMarkup, loadMathLive, configureFonts, getMacros, PIE_MACROS } from './mathlive-instance.js';
8
9
  import { toMathLive, fromMathLive, fieldIds, keyToAction, answerBlockLatex, NEWLINE_EMBED } from './latex-bridge.js';
9
10
  declare const addBrackets: (s: any) => any;
@@ -17,4 +18,4 @@ declare const removeBrackets: (s: any) => any;
17
18
  * export is kept so callers do not break.
18
19
  */
19
20
  declare const updateSpans: () => void;
20
- export { keysForGrade, addBrackets, removeBrackets, keys, MathInput, HorizontalKeypad, KeyPad, updateSpans, mf, mf as mq, registerEmbed, applyStaticMath, latexToMarkup, loadMathLive, configureFonts, getMacros, PIE_MACROS, toMathLive, fromMathLive, fieldIds, keyToAction, answerBlockLatex, NEWLINE_EMBED, };
21
+ export { keysForGrade, addBrackets, removeBrackets, keys, MathInput, HorizontalKeypad, KeyPad, updateSpans, mf, mf as mq, registerEmbed, applyStaticMath, latexToMarkup, loadMathLive, configureFonts, getMacros, PIE_MACROS, toMathLive, fromMathLive, fieldIds, keyToAction, answerBlockLatex, NEWLINE_EMBED, deepActiveElement, };
package/dist/index.js CHANGED
@@ -4,8 +4,9 @@ import { MathInput as n } from "./math-input.js";
4
4
  import r from "./horizontal-keypad.js";
5
5
  import { KeyPad as i } from "./keypad/index.js";
6
6
  import { mf_exports as a } from "./mf/index.js";
7
- import { PIE_MACROS as o, applyStaticMath as s, configureFonts as c, getMacros as l, latexToMarkup as u, loadMathLive as d, registerEmbed as f } from "./mathlive-instance.js";
8
- import { NEWLINE_EMBED as p, answerBlockLatex as m, fieldIds as h, fromMathLive as g, keyToAction as _, toMathLive as v } from "./latex-bridge.js";
7
+ import { deepActiveElement as o } from "./mf/inactive-caret.js";
8
+ import { PIE_MACROS as s, applyStaticMath as c, configureFonts as l, getMacros as u, latexToMarkup as d, loadMathLive as f, registerEmbed as p } from "./mathlive-instance.js";
9
+ import { NEWLINE_EMBED as m, answerBlockLatex as h, fieldIds as g, fromMathLive as _, keyToAction as v, toMathLive as y } from "./latex-bridge.js";
9
10
  // src/index.tsx
10
- var y = (e) => e.indexOf("\\(") === 0 ? e : `\\(${e}`, b = (e) => e.indexOf("\\)") === e.length - 2 ? e : `${e}\\)`, x = (e) => e.indexOf("\\(") === 0 ? e.substring(2) : e, S = (e) => e.indexOf("\\)") === e.length - 2 ? e.substring(0, e.length - 2) : e, C = (e) => b(y(e)), w = (e) => S(x(e)), T = () => {};
11
- export { r as HorizontalKeypad, i as KeyPad, n as MathInput, p as NEWLINE_EMBED, o as PIE_MACROS, C as addBrackets, m as answerBlockLatex, s as applyStaticMath, c as configureFonts, h as fieldIds, g as fromMathLive, l as getMacros, _ as keyToAction, t as keys, e as keysForGrade, u as latexToMarkup, d as loadMathLive, a as mf, a as mq, f as registerEmbed, w as removeBrackets, v as toMathLive, T as updateSpans };
11
+ var b = (e) => e.indexOf("\\(") === 0 ? e : `\\(${e}`, x = (e) => e.indexOf("\\)") === e.length - 2 ? e : `${e}\\)`, S = (e) => e.indexOf("\\(") === 0 ? e.substring(2) : e, C = (e) => e.indexOf("\\)") === e.length - 2 ? e.substring(0, e.length - 2) : e, w = (e) => x(b(e)), T = (e) => C(S(e)), E = () => {};
12
+ export { r as HorizontalKeypad, i as KeyPad, n as MathInput, m as NEWLINE_EMBED, s as PIE_MACROS, w as addBrackets, h as answerBlockLatex, c as applyStaticMath, l as configureFonts, o as deepActiveElement, g as fieldIds, _ as fromMathLive, u as getMacros, v as keyToAction, t as keys, e as keysForGrade, d as latexToMarkup, f as loadMathLive, a as mf, a as mq, p as registerEmbed, T as removeBrackets, y as toMathLive, E as updateSpans };
@@ -8,6 +8,8 @@ export declare const KEYPAD_CARET_CLASS = "pie-caret-for-keypad";
8
8
  * it reads differently from a focused field.
9
9
  */
10
10
  export declare const KEYPAD_CARET_CSS: string;
11
+ /** The focused element, looking through shadow roots. */
12
+ export declare const deepActiveElement: () => Element | null;
11
13
  /**
12
14
  * MathLive hides its caret when a field blurs, though it keeps the insertion point. While a keypad
13
15
  * button has focus, keep the caret showing there. Focus going anywhere else removes it.
@@ -28,4 +28,4 @@ function o(e) {
28
28
  e.removeEventListener("blur", l), o();
29
29
  };
30
30
  }
31
- export { e as KEYPAD_ATTRIBUTE, t as KEYPAD_CARET_CLASS, n as KEYPAD_CARET_CSS, o as keepCaretWhileKeypadFocused };
31
+ export { e as KEYPAD_ATTRIBUTE, t as KEYPAD_CARET_CLASS, n as KEYPAD_CARET_CSS, a as deepActiveElement, o as keepCaretWhileKeypadFocused };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-lib/math-input-mathlive",
3
- "version": "2.0.1-next.20261112103425",
3
+ "version": "2.0.1-next.20261116081603",
4
4
  "description": "MathLive-based math input (drop-in alternative to @pie-lib/math-input)",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -17,7 +17,7 @@
17
17
  "mathlive": "0.110.0",
18
18
  "prop-types": "^15.7.2",
19
19
  "@pie-element/shared-lodash": "0.1.4-next.20261110072702",
20
- "@pie-lib/render-ui": "8.0.8-next.20261110124518",
20
+ "@pie-lib/render-ui": "8.0.8-next.20261116081603",
21
21
  "@pie-element/shared-i18n": "0.1.3-next.20261110124518"
22
22
  },
23
23
  "type": "module",