@pie-lib/math-input-mathlive 1.0.6 → 1.0.9-next.6608

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.
@@ -29,9 +29,121 @@ const DISPLAYLINES_REGEX = /^\\displaylines\{([\s\S]*)\}$/;
29
29
  const MQ_FIELD_REGEX = /\\MathQuillMathField\[([^\]]*)\]\{([^{}]*)\}/g;
30
30
  const PLACEHOLDER_REGEX = /\\placeholder\[([^\]]*)\]\{([^{}]*)\}/g;
31
31
 
32
+ /**
33
+ * Unnamed placeholders, which MathLive inserts on its own.
34
+ *
35
+ * Typing a command with empty arguments (`\longdiv{}`, `\frac{}{}`) makes
36
+ * MathLive serialise the empty slots as `\placeholder{}`. That token is
37
+ * MathLive-specific: MathJax - which @pie-lib/math-rendering uses to render
38
+ * prompts and previews - has no such command and renders it as red error text.
39
+ * Stored latex must therefore keep plain empty groups.
40
+ */
41
+ const BARE_PLACEHOLDER_REGEX = /\\placeholder\{([^{}]*)\}/g;
42
+ const BARE_PLACEHOLDER_NO_ARG_REGEX = /\\placeholder(?![[{a-zA-Z])/g;
43
+
32
44
  /** Default id used when stored latex has an unnamed field. */
33
45
  export const DEFAULT_FIELD_ID = 'r1';
34
46
 
47
+ /**
48
+ * A visible stand-in for an empty argument slot, used for STATIC rendering only.
49
+ *
50
+ * Stored latex legitimately contains empty groups - `\longdiv{}`, `\frac{}{}`,
51
+ * `x^{}` - to express a command's shape. MathQuill drew those as a shaded box
52
+ * (`.mq-empty`); MathLive renders `{}` as nothing, so `convertLatexToMarkup`
53
+ * output comes out completely blank (not even the surrounding bracket, in the
54
+ * case of `\enclose{longdiv}{}`).
55
+ *
56
+ * `\placeholder{}` is not usable here: in static markup it renders as a
57
+ * non-breaking space, because its editable box only exists inside a live
58
+ * mathfield. So an actual glyph is required.
59
+ *
60
+ * Live mathfields need none of this - MathLive manages empty slots itself.
61
+ */
62
+ const EMPTY_SLOT = '\\htmlData{pie-empty=1}{\\unicode{"25AB}}';
63
+ const EMPTY_GROUP_REGEX = /\{\s*\}/g;
64
+
65
+ /**
66
+ * Make empty argument slots visible, for static rendering.
67
+ *
68
+ * Display-only: never feed the result to a mathfield or to storage - the
69
+ * original latex is what gets typed and saved.
70
+ *
71
+ * @param {string} latex
72
+ * @returns {string}
73
+ */
74
+ export const withVisibleEmptySlots = (latex) => (latex || '').replace(EMPTY_GROUP_REGEX, `{${EMPTY_SLOT}}`);
75
+
76
+ /**
77
+ * Pie commands that take an argument, and their native MathLive equivalents.
78
+ *
79
+ * These MUST NOT be handled as MathLive macros. A macro is serialised from the
80
+ * arguments it was created with, so text typed inside its expansion never makes
81
+ * it back out: `getValue('latex')` keeps returning `\longdiv{\placeholder{}}`
82
+ * while `getValue('ascii-math')` shows the typed content. Setting
83
+ * `captureSelection: false` lets the cursor in but does not change
84
+ * serialisation.
85
+ *
86
+ * Expanding to native constructs instead gives real, editable atoms that
87
+ * round-trip. All three targets are understood by MathJax too, so stored latex
88
+ * still renders in @pie-lib/math-rendering without a reverse mapping.
89
+ */
90
+ /**
91
+ * Rewrite argument-taking pie commands into native MathLive latex.
92
+ * Applied on the way *into* a mathfield.
93
+ *
94
+ * @param {string} latex
95
+ * @returns {string}
96
+ */
97
+ export const toNativeCommands = (latex) => {
98
+ if (typeof latex !== 'string' || !latex) {
99
+ return latex || '';
100
+ }
101
+
102
+ let out = latex;
103
+
104
+ // \abs{x} -> \left|x\right| needs brace-aware handling, the rest are prefix
105
+ // swaps.
106
+ out = replaceAbs(out);
107
+ out = out.replace(/\\longdiv\{/g, '\\enclose{longdiv}{');
108
+ out = out.replace(/\\overarc\{/g, '\\overparen{');
109
+
110
+ return out;
111
+ };
112
+
113
+ /** `\abs{x}` -> `\left|x\right|`, matching balanced braces. */
114
+ const replaceAbs = (latex) => {
115
+ let out = latex;
116
+ let idx = out.indexOf('\\abs{');
117
+
118
+ while (idx !== -1) {
119
+ const open = idx + '\\abs{'.length - 1;
120
+ let depth = 0;
121
+ let close = -1;
122
+
123
+ for (let i = open; i < out.length; i++) {
124
+ if (out[i] === '{') depth++;
125
+ else if (out[i] === '}') {
126
+ depth--;
127
+ if (depth === 0) {
128
+ close = i;
129
+ break;
130
+ }
131
+ }
132
+ }
133
+
134
+ if (close === -1) {
135
+ break;
136
+ }
137
+
138
+ const inner = out.slice(open + 1, close);
139
+
140
+ out = `${out.slice(0, idx)}\\left|${inner}\\right|${out.slice(close + 1)}`;
141
+ idx = out.indexOf('\\abs{');
142
+ }
143
+
144
+ return out;
145
+ };
146
+
35
147
  /**
36
148
  * Ids of the answer blocks in a piece of stored latex, in document order.
37
149
  *
@@ -67,8 +179,12 @@ export const toMathLive = (latex) => {
67
179
  return latex || '';
68
180
  }
69
181
 
182
+ // Argument-taking pie commands -> native constructs, so their content stays
183
+ // editable and serialises back correctly (see toNativeCommands).
184
+ let out = toNativeCommands(latex);
185
+
70
186
  // Answer blocks: \MathQuillMathField[id]{x} -> \placeholder[id]{x}
71
- let out = latex.replace(MQ_FIELD_REGEX, (_m, id, content) => `\\placeholder[${id || DEFAULT_FIELD_ID}]{${content}}`);
187
+ out = out.replace(MQ_FIELD_REGEX, (_m, id, content) => `\\placeholder[${id || DEFAULT_FIELD_ID}]{${content}}`);
72
188
 
73
189
  // Newlines: \embed{newLine}[] -> a multiline environment
74
190
  if (out.indexOf(NEWLINE_EMBED) !== -1) {
@@ -108,6 +224,13 @@ export const fromMathLive = (latex) => {
108
224
  (_m, id, content) => `\\MathQuillMathField[${id || DEFAULT_FIELD_ID}]{${content}}`,
109
225
  );
110
226
 
227
+ // Unnamed placeholders are MathLive's own representation of an empty slot and
228
+ // must not reach storage or MathJax. Unwrap them: keep any content, drop the
229
+ // command itself (the surrounding braces are already part of the host latex,
230
+ // so re-adding them here would produce `\longdiv{{}}`).
231
+ out = out.replace(BARE_PLACEHOLDER_REGEX, (_m, content) => content);
232
+ out = out.replace(BARE_PLACEHOLDER_NO_ARG_REGEX, '');
233
+
111
234
  return out;
112
235
  };
113
236
 
@@ -124,8 +247,10 @@ const COMMANDS_WITH_ARGS = {
124
247
  '\\overline': '\\overline{#?}',
125
248
  '\\overrightarrow': '\\overrightarrow{#?}',
126
249
  '\\overleftrightarrow': '\\overleftrightarrow{#?}',
127
- '\\overarc': '\\overarc{#?}',
128
- '\\longdiv': '\\longdiv{#?}',
250
+ // Native forms, not the pie macros: a macro would not serialise the user's
251
+ // typed content back out (see toNativeCommands).
252
+ '\\overarc': '\\overparen{#?}',
253
+ '\\longdiv': '\\enclose{longdiv}{#?}',
129
254
  '^': '^{#?}',
130
255
  _: '_{#?}',
131
256
  '(': '\\left(#?\\right)',
@@ -1,5 +1,5 @@
1
1
  import debug from 'debug';
2
- import { NEWLINE_EMBED, toMathLive } from './latex-bridge';
2
+ import { NEWLINE_EMBED, toMathLive, withVisibleEmptySlots } from './latex-bridge';
3
3
 
4
4
  const log = debug('pie-lib:math-input-mathlive:instance');
5
5
 
@@ -75,8 +75,9 @@ export const configureFonts = (dir) => {
75
75
  * way in the editor and in the static renderer.
76
76
  */
77
77
  export const PIE_MACROS = {
78
+ // Argument-less symbols. Atomic is correct here: backspace should remove the
79
+ // whole glyph, and there is nothing to type into.
78
80
  parallelogram: '\\htmlData{pie-macro=parallelogram}{\\unicode{"25B1}}',
79
- overarc: '\\overparen{#1}',
80
81
  napprox: '\\not\\approx',
81
82
  nsim: '\\not\\sim',
82
83
  ncong: '\\not\\cong',
@@ -85,7 +86,15 @@ export const PIE_MACROS = {
85
86
  divide: '\\div',
86
87
  degree: '^{\\circ}',
87
88
  square: '\\unicode{"25A1}',
88
- longdiv: '\\htmlData{pie-macro=longdiv}{#1}',
89
+
90
+ // Argument-taking commands, kept ONLY so previously authored latex still
91
+ // parses and renders. They are never used for editing: MathLive serialises a
92
+ // macro from the arguments it was created with, so text typed inside the
93
+ // expansion never comes back out of `getValue('latex')`. Anything entering a
94
+ // mathfield is rewritten to the native equivalent first - see
95
+ // `toNativeCommands` in latex-bridge.
96
+ longdiv: '\\enclose{longdiv}{#1}',
97
+ overarc: '\\overparen{#1}',
89
98
  abs: '\\left|#1\\right|',
90
99
  };
91
100
 
@@ -347,7 +356,7 @@ export function applyStaticMath(element, latex, options = {}) {
347
356
  return undefined;
348
357
  }
349
358
 
350
- element.innerHTML = ml.convertLatexToMarkup(toMathLive(source), {
359
+ element.innerHTML = ml.convertLatexToMarkup(withVisibleEmptySlots(toMathLive(source)), {
351
360
  macros: { ...getMacros(), ...(options.macros || {}) },
352
361
  });
353
362
 
@@ -372,7 +381,10 @@ export function latexToMarkup(latex, options = {}) {
372
381
  }
373
382
 
374
383
  try {
375
- return ml.convertLatexToMarkup(toMathLive(latex), {
384
+ // Empty groups render as nothing in static markup, so give them a visible
385
+ // box. This covers every static path: keypad labels, mf.Static in display
386
+ // mode, and applyStaticMath.
387
+ return ml.convertLatexToMarkup(withVisibleEmptySlots(toMathLive(latex)), {
376
388
  macros: { ...getMacros(), ...(options.macros || {}) },
377
389
  ...options,
378
390
  });
@@ -51,6 +51,19 @@ export const placeholderStyles = {
51
51
  borderBottom: '1px solid currentColor',
52
52
  minWidth: '1em',
53
53
  },
54
+ // Stand-in glyph for an empty argument slot in STATIC math (see
55
+ // `withVisibleEmptySlots`). Muted so it reads as "a slot goes here" rather
56
+ // than as part of the symbol, matching how MathQuill shaded `.mq-empty`.
57
+ '& [data-pie-empty]': {
58
+ opacity: 0.5,
59
+ },
60
+ // Stretchy accents render an <svg>; mathlive-static.css positions it
61
+ // absolutely at width:100%. Repeated here so static math cannot blow out its
62
+ // container if that stylesheet is missing.
63
+ '& svg': {
64
+ position: 'absolute',
65
+ width: '100%',
66
+ },
54
67
  };
55
68
 
56
69
  /**
package/src/mf/static.jsx CHANGED
@@ -4,11 +4,14 @@ import { styled } from '@mui/material/styles';
4
4
  import debug from 'debug';
5
5
  import { loadMathLive, getMacros, latexToMarkup } from '../mathlive-instance';
6
6
  import { toMathLive, fromMathLive, fieldIds } from '../latex-bridge';
7
+ import { placeholderStyles } from './common-styles';
7
8
 
8
9
  const log = debug('pie-lib:math-input-mathlive:static');
9
10
 
10
11
  const Holder = styled('span')({
11
12
  display: 'inline-block',
13
+ // Shared static-math rules: muted empty-slot glyphs and svg containment.
14
+ ...placeholderStyles,
12
15
  '& math-field': {
13
16
  display: 'inline-block',
14
17
  border: 'none',
@@ -1,133 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
5
- var _react = _interopRequireDefault(require("react"));
6
- var _react2 = require("@testing-library/react");
7
- var _styles = require("@mui/material/styles");
8
- var _index = require("../index");
9
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
10
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11
- /**
12
- * Exercises the exact call patterns real consumers use against
13
- * @pie-lib/math-input, to catch drop-in incompatibilities.
14
- *
15
- * Sources:
16
- * - packages/math-toolbar/src/editor-and-pad.jsx:16,185
17
- * - packages/math-toolbar/src/math-preview.jsx:8,156
18
- * - packages/editable-html/src/plugins/respArea/math-templated/index.jsx:92
19
- * - packages/editable-html-tip-tap/src/components/respArea/MathTemplated.jsx:111
20
- */
21
- describe('drop-in compatibility with @pie-lib/math-input consumers', function () {
22
- describe('mq.CommonMqStyles destructuring', function () {
23
- it('math-preview.jsx: { commonMqFontStyles, longdivStyles, supsubStyles }', function () {
24
- var _mq$CommonMqStyles = _index.mq.CommonMqStyles,
25
- commonMqFontStyles = _mq$CommonMqStyles.commonMqFontStyles,
26
- longdivStyles = _mq$CommonMqStyles.longdivStyles,
27
- supsubStyles = _mq$CommonMqStyles.supsubStyles;
28
- expect(commonMqFontStyles).toBeDefined();
29
- expect(longdivStyles).toBeDefined();
30
- expect(supsubStyles).toBeDefined();
31
- });
32
- it('editor-and-pad.jsx: also { commonMqKeyboardStyles }', function () {
33
- var _mq$CommonMqStyles2 = _index.mq.CommonMqStyles,
34
- commonMqFontStyles = _mq$CommonMqStyles2.commonMqFontStyles,
35
- commonMqKeyboardStyles = _mq$CommonMqStyles2.commonMqKeyboardStyles,
36
- longdivStyles = _mq$CommonMqStyles2.longdivStyles,
37
- supsubStyles = _mq$CommonMqStyles2.supsubStyles;
38
- expect(commonMqKeyboardStyles).toBeDefined();
39
- // All four must be spreadable into an emotion style object.
40
- expect(function () {
41
- return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, commonMqFontStyles), commonMqKeyboardStyles), longdivStyles), supsubStyles);
42
- }).not.toThrow();
43
- });
44
- it('the destructured groups survive being spread into a styled component', function () {
45
- var _mq$CommonMqStyles3 = _index.mq.CommonMqStyles,
46
- commonMqFontStyles = _mq$CommonMqStyles3.commonMqFontStyles,
47
- longdivStyles = _mq$CommonMqStyles3.longdivStyles,
48
- supsubStyles = _mq$CommonMqStyles3.supsubStyles;
49
- var Styled = (0, _styles.styled)('div')(_objectSpread(_objectSpread(_objectSpread({}, commonMqFontStyles), longdivStyles), supsubStyles));
50
- expect(function () {
51
- return (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(Styled, null));
52
- }).not.toThrow();
53
- });
54
- });
55
- describe('mq.Input', function () {
56
- it('editor-and-pad.jsx: styled(mq.Input) renders', function () {
57
- var MathEditor = (0, _styles.styled)(_index.mq.Input)(function () {
58
- return {
59
- width: '100%'
60
- };
61
- });
62
- expect(function () {
63
- return (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(MathEditor, {
64
- latex: "\\\\frac{1}{2}",
65
- onChange: function onChange() {}
66
- }));
67
- }).not.toThrow();
68
- });
69
- it('accepts the className that styled() injects', function () {
70
- var Styled = (0, _styles.styled)(_index.mq.Input)({
71
- padding: 4
72
- });
73
- var _render = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(Styled, {
74
- latex: "x",
75
- onChange: function onChange() {}
76
- })),
77
- container = _render.container;
78
- expect(container.firstChild).toBeTruthy();
79
- expect(container.firstChild.className).toBeTruthy();
80
- });
81
- });
82
- describe('mq.Static', function () {
83
- it('math-preview.jsx: <mq.Static latex onFocus onBlur />', function () {
84
- expect(function () {
85
- return (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(_index.mq.Static, {
86
- latex: '\\frac{1}{2}',
87
- onFocus: function onFocus() {},
88
- onBlur: function onBlur() {}
89
- }));
90
- }).not.toThrow();
91
- });
92
- it('math-templated respArea: <mq.Static latex={value} />', function () {
93
- expect(function () {
94
- return (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(_index.mq.Static, {
95
- latex: 'x=1'
96
- }));
97
- }).not.toThrow();
98
- });
99
- it('renders answer-block latex (the templated-math case) without throwing', function () {
100
- expect(function () {
101
- return (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(_index.mq.Static, {
102
- latex: 'x=\\MathQuillMathField[r1]{}',
103
- onSubFieldChange: function onSubFieldChange() {}
104
- }));
105
- }).not.toThrow();
106
- });
107
- it('is styleable, as keypad labels were in math-input', function () {
108
- var Styled = (0, _styles.styled)(_index.mq.Static)({
109
- pointerEvents: 'none'
110
- });
111
- expect(function () {
112
- return (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(Styled, {
113
- latex: '\\pi'
114
- }));
115
- }).not.toThrow();
116
- });
117
- });
118
- describe('surface parity', function () {
119
- it('exposes exactly the names math-input exported', function () {
120
- // eslint-disable-next-line global-require
121
- var pkg = require('../index');
122
- ['keysForGrade', 'addBrackets', 'removeBrackets', 'keys', 'HorizontalKeypad', 'mq', 'updateSpans', 'registerEmbed', 'applyStaticMath'].forEach(function (name) {
123
- expect(pkg[name]).toBeDefined();
124
- });
125
- });
126
- it('mq exposes Input, Static and CommonMqStyles', function () {
127
- ['Input', 'Static', 'CommonMqStyles'].forEach(function (name) {
128
- expect(_index.mq[name]).toBeDefined();
129
- });
130
- });
131
- });
132
- });
133
- //# sourceMappingURL=drop-in-compat.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"drop-in-compat.test.js","names":["_react","_interopRequireDefault","require","_react2","_styles","_index","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","describe","it","_mq$CommonMqStyles","mq","CommonMqStyles","commonMqFontStyles","longdivStyles","supsubStyles","expect","toBeDefined","_mq$CommonMqStyles2","commonMqKeyboardStyles","not","toThrow","_mq$CommonMqStyles3","Styled","styled","render","createElement","MathEditor","Input","width","latex","onChange","padding","_render","container","firstChild","toBeTruthy","className","Static","onFocus","onBlur","onSubFieldChange","pointerEvents","pkg","name"],"sources":["../../src/__tests__/drop-in-compat.test.jsx"],"sourcesContent":["import React from 'react';\nimport { render } from '@testing-library/react';\nimport { styled } from '@mui/material/styles';\n\nimport { mq } from '../index';\n\n/**\n * Exercises the exact call patterns real consumers use against\n * @pie-lib/math-input, to catch drop-in incompatibilities.\n *\n * Sources:\n * - packages/math-toolbar/src/editor-and-pad.jsx:16,185\n * - packages/math-toolbar/src/math-preview.jsx:8,156\n * - packages/editable-html/src/plugins/respArea/math-templated/index.jsx:92\n * - packages/editable-html-tip-tap/src/components/respArea/MathTemplated.jsx:111\n */\ndescribe('drop-in compatibility with @pie-lib/math-input consumers', () => {\n describe('mq.CommonMqStyles destructuring', () => {\n it('math-preview.jsx: { commonMqFontStyles, longdivStyles, supsubStyles }', () => {\n const { commonMqFontStyles, longdivStyles, supsubStyles } = mq.CommonMqStyles;\n\n expect(commonMqFontStyles).toBeDefined();\n expect(longdivStyles).toBeDefined();\n expect(supsubStyles).toBeDefined();\n });\n\n it('editor-and-pad.jsx: also { commonMqKeyboardStyles }', () => {\n const { commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles } = mq.CommonMqStyles;\n\n expect(commonMqKeyboardStyles).toBeDefined();\n // All four must be spreadable into an emotion style object.\n expect(() => ({\n ...commonMqFontStyles,\n ...commonMqKeyboardStyles,\n ...longdivStyles,\n ...supsubStyles,\n })).not.toThrow();\n });\n\n it('the destructured groups survive being spread into a styled component', () => {\n const { commonMqFontStyles, longdivStyles, supsubStyles } = mq.CommonMqStyles;\n const Styled = styled('div')({ ...commonMqFontStyles, ...longdivStyles, ...supsubStyles });\n\n expect(() => render(<Styled />)).not.toThrow();\n });\n });\n\n describe('mq.Input', () => {\n it('editor-and-pad.jsx: styled(mq.Input) renders', () => {\n const MathEditor = styled(mq.Input)(() => ({ width: '100%' }));\n\n expect(() => render(<MathEditor latex=\"\\\\frac{1}{2}\" onChange={() => {}} />)).not.toThrow();\n });\n\n it('accepts the className that styled() injects', () => {\n const Styled = styled(mq.Input)({ padding: 4 });\n const { container } = render(<Styled latex=\"x\" onChange={() => {}} />);\n\n expect(container.firstChild).toBeTruthy();\n expect(container.firstChild.className).toBeTruthy();\n });\n });\n\n describe('mq.Static', () => {\n it('math-preview.jsx: <mq.Static latex onFocus onBlur />', () => {\n expect(() => render(<mq.Static latex={'\\\\frac{1}{2}'} onFocus={() => {}} onBlur={() => {}} />)).not.toThrow();\n });\n\n it('math-templated respArea: <mq.Static latex={value} />', () => {\n expect(() => render(<mq.Static latex={'x=1'} />)).not.toThrow();\n });\n\n it('renders answer-block latex (the templated-math case) without throwing', () => {\n expect(() =>\n render(<mq.Static latex={'x=\\\\MathQuillMathField[r1]{}'} onSubFieldChange={() => {}} />),\n ).not.toThrow();\n });\n\n it('is styleable, as keypad labels were in math-input', () => {\n const Styled = styled(mq.Static)({ pointerEvents: 'none' });\n\n expect(() => render(<Styled latex={'\\\\pi'} />)).not.toThrow();\n });\n });\n\n describe('surface parity', () => {\n it('exposes exactly the names math-input exported', () => {\n // eslint-disable-next-line global-require\n const pkg = require('../index');\n\n [\n 'keysForGrade',\n 'addBrackets',\n 'removeBrackets',\n 'keys',\n 'HorizontalKeypad',\n 'mq',\n 'updateSpans',\n 'registerEmbed',\n 'applyStaticMath',\n ].forEach((name) => {\n expect(pkg[name]).toBeDefined();\n });\n });\n\n it('mq exposes Input, Static and CommonMqStyles', () => {\n ['Input', 'Static', 'CommonMqStyles'].forEach((name) => {\n expect(mq[name]).toBeDefined();\n });\n });\n });\n});\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AAA8B,SAAAI,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,QAAAe,gBAAA,aAAAhB,CAAA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,CAAC,UAACyC,IAAI,EAAK;QACtD5B,MAAM,CAACL,SAAE,CAACiC,IAAI,CAAC,CAAC,CAAC3B,WAAW,CAAC,CAAC;MAChC,CAAC,CAAC;IACJ,CAAC,CAAC;EACJ,CAAC,CAAC;AACJ,CAAC,CAAC","ignoreList":[]}
@@ -1,118 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
5
- var _react = _interopRequireDefault(require("react"));
6
- var _react2 = require("@testing-library/react");
7
- var _index = require("../index");
8
- describe('math-input-mathlive public API', function () {
9
- it('mirrors the @pie-lib/math-input export surface', function () {
10
- expect((0, _typeof2["default"])(_index.keysForGrade)).toBe('function');
11
- expect((0, _typeof2["default"])(_index.addBrackets)).toBe('function');
12
- expect((0, _typeof2["default"])(_index.removeBrackets)).toBe('function');
13
- expect((0, _typeof2["default"])(_index.registerEmbed)).toBe('function');
14
- expect((0, _typeof2["default"])(_index.applyStaticMath)).toBe('function');
15
- expect((0, _typeof2["default"])(_index.updateSpans)).toBe('function');
16
- expect(_index.keys).toBeDefined();
17
- expect(_index.keys.baseSet).toBeDefined();
18
- });
19
- it('exports the field wrappers under both mf and mq', function () {
20
- expect(_index.mf.Input).toBeDefined();
21
- expect(_index.mf.Static).toBeDefined();
22
- // `mq` alias lets a consumer swap packages by changing only the import.
23
- expect(_index.mq).toBe(_index.mf);
24
- });
25
- it('updateSpans is a safe no-op', function () {
26
- expect(function () {
27
- return (0, _index.updateSpans)();
28
- }).not.toThrow();
29
- });
30
- it('CommonMqStyles keeps the shape consumers destructure', function () {
31
- // math-toolbar does:
32
- // const { commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles }
33
- // = mq.CommonMqStyles;
34
- var _mf$CommonMqStyles = _index.mf.CommonMqStyles,
35
- commonMqFontStyles = _mf$CommonMqStyles.commonMqFontStyles,
36
- commonMqKeyboardStyles = _mf$CommonMqStyles.commonMqKeyboardStyles,
37
- longdivStyles = _mf$CommonMqStyles.longdivStyles,
38
- supsubStyles = _mf$CommonMqStyles.supsubStyles;
39
- [commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles].forEach(function (s) {
40
- expect(s).toBeDefined();
41
- expect((0, _typeof2["default"])(s)).toBe('object');
42
- });
43
- });
44
- it('bracket helpers round-trip', function () {
45
- expect((0, _index.addBrackets)('x')).toEqual('\\(x\\)');
46
- expect((0, _index.removeBrackets)('\\(x\\)')).toEqual('x');
47
- expect((0, _index.removeBrackets)((0, _index.addBrackets)('\\frac{1}{2}'))).toEqual('\\frac{1}{2}');
48
- });
49
- it('keysForGrade returns a 5-row keyset', function () {
50
- var set = (0, _index.keysForGrade)('geometry');
51
- expect(Array.isArray(set)).toBe(true);
52
- expect(set.length).toBe(5);
53
- });
54
- });
55
- describe('rendering', function () {
56
- // MathLive is a browser-only custom element; loadMathLive() resolves async and
57
- // is a no-op-ish under jsdom. These assert the components mount without
58
- // throwing, which is what regressed most often in the MathQuill version.
59
- it('KeyPad renders without a live MathLive instance', function () {
60
- var _render = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(_index.KeyPad, {
61
- onPress: function onPress() {}
62
- })),
63
- container = _render.container;
64
- expect(container.querySelectorAll('button').length).toBeGreaterThan(0);
65
- });
66
- it('KeyPad falls back to raw latex for labels before MathLive loads', function () {
67
- var _render2 = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(_index.KeyPad, {
68
- onPress: function onPress() {},
69
- baseSet: [[{
70
- name: 'pi',
71
- latex: '\\pi',
72
- category: 'constants'
73
- }]]
74
- })),
75
- container = _render2.container;
76
- expect(container.textContent).toContain('\\pi');
77
- });
78
- it('KeyPad fires onPress with the key definition', function () {
79
- var onPress = jest.fn();
80
- var key = {
81
- name: 'x',
82
- label: 'x',
83
- write: 'x',
84
- category: 'vars'
85
- };
86
- var _render3 = (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(_index.KeyPad, {
87
- onPress: onPress,
88
- baseSet: [[key]]
89
- })),
90
- container = _render3.container;
91
- container.querySelector('button').click();
92
- expect(onPress).toHaveBeenCalledWith(key);
93
- });
94
- it('MathInput mounts', function () {
95
- expect(function () {
96
- return (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(_index.MathInput, {
97
- latex: "\\\\frac{1}{2}",
98
- onChange: function onChange() {}
99
- }));
100
- }).not.toThrow();
101
- });
102
- it('HorizontalKeypad mounts and reports the legacy {value,type} model', function () {
103
- var onClick = jest.fn();
104
- expect(function () {
105
- return (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(_index.HorizontalKeypad, {
106
- onClick: onClick
107
- }));
108
- }).not.toThrow();
109
- });
110
- it('Static renders display-mode latex without a mathfield', function () {
111
- expect(function () {
112
- return (0, _react2.render)(/*#__PURE__*/_react["default"].createElement(_index.mf.Static, {
113
- latex: "\\\\frac{1}{2}"
114
- }));
115
- }).not.toThrow();
116
- });
117
- });
118
- //# sourceMappingURL=index.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.test.js","names":["_react","_interopRequireDefault","require","_react2","_index","describe","it","expect","_typeof2","keysForGrade","toBe","addBrackets","removeBrackets","registerEmbed","applyStaticMath","updateSpans","keys","toBeDefined","baseSet","mf","Input","Static","mq","not","toThrow","_mf$CommonMqStyles","CommonMqStyles","commonMqFontStyles","commonMqKeyboardStyles","longdivStyles","supsubStyles","forEach","s","toEqual","set","Array","isArray","length","_render","render","createElement","KeyPad","onPress","container","querySelectorAll","toBeGreaterThan","_render2","name","latex","category","textContent","toContain","jest","fn","key","label","write","_render3","querySelector","click","toHaveBeenCalledWith","MathInput","onChange","onClick","HorizontalKeypad"],"sources":["../../src/__tests__/index.test.jsx"],"sourcesContent":["import React from 'react';\nimport { render } from '@testing-library/react';\n\nimport {\n keys,\n keysForGrade,\n addBrackets,\n removeBrackets,\n registerEmbed,\n applyStaticMath,\n updateSpans,\n mf,\n mq,\n MathInput,\n HorizontalKeypad,\n KeyPad,\n} from '../index';\n\ndescribe('math-input-mathlive public API', () => {\n it('mirrors the @pie-lib/math-input export surface', () => {\n expect(typeof keysForGrade).toBe('function');\n expect(typeof addBrackets).toBe('function');\n expect(typeof removeBrackets).toBe('function');\n expect(typeof registerEmbed).toBe('function');\n expect(typeof applyStaticMath).toBe('function');\n expect(typeof updateSpans).toBe('function');\n expect(keys).toBeDefined();\n expect(keys.baseSet).toBeDefined();\n });\n\n it('exports the field wrappers under both mf and mq', () => {\n expect(mf.Input).toBeDefined();\n expect(mf.Static).toBeDefined();\n // `mq` alias lets a consumer swap packages by changing only the import.\n expect(mq).toBe(mf);\n });\n\n it('updateSpans is a safe no-op', () => {\n expect(() => updateSpans()).not.toThrow();\n });\n\n it('CommonMqStyles keeps the shape consumers destructure', () => {\n // math-toolbar does:\n // const { commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles }\n // = mq.CommonMqStyles;\n const { commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles } = mf.CommonMqStyles;\n\n [commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles].forEach((s) => {\n expect(s).toBeDefined();\n expect(typeof s).toBe('object');\n });\n });\n\n it('bracket helpers round-trip', () => {\n expect(addBrackets('x')).toEqual('\\\\(x\\\\)');\n expect(removeBrackets('\\\\(x\\\\)')).toEqual('x');\n expect(removeBrackets(addBrackets('\\\\frac{1}{2}'))).toEqual('\\\\frac{1}{2}');\n });\n\n it('keysForGrade returns a 5-row keyset', () => {\n const set = keysForGrade('geometry');\n\n expect(Array.isArray(set)).toBe(true);\n expect(set.length).toBe(5);\n });\n});\n\ndescribe('rendering', () => {\n // MathLive is a browser-only custom element; loadMathLive() resolves async and\n // is a no-op-ish under jsdom. These assert the components mount without\n // throwing, which is what regressed most often in the MathQuill version.\n it('KeyPad renders without a live MathLive instance', () => {\n const { container } = render(<KeyPad onPress={() => {}} />);\n\n expect(container.querySelectorAll('button').length).toBeGreaterThan(0);\n });\n\n it('KeyPad falls back to raw latex for labels before MathLive loads', () => {\n const { container } = render(\n <KeyPad onPress={() => {}} baseSet={[[{ name: 'pi', latex: '\\\\pi', category: 'constants' }]]} />,\n );\n\n expect(container.textContent).toContain('\\\\pi');\n });\n\n it('KeyPad fires onPress with the key definition', () => {\n const onPress = jest.fn();\n const key = { name: 'x', label: 'x', write: 'x', category: 'vars' };\n const { container } = render(<KeyPad onPress={onPress} baseSet={[[key]]} />);\n\n container.querySelector('button').click();\n\n expect(onPress).toHaveBeenCalledWith(key);\n });\n\n it('MathInput mounts', () => {\n expect(() => render(<MathInput latex=\"\\\\frac{1}{2}\" onChange={() => {}} />)).not.toThrow();\n });\n\n it('HorizontalKeypad mounts and reports the legacy {value,type} model', () => {\n const onClick = jest.fn();\n\n expect(() => render(<HorizontalKeypad onClick={onClick} />)).not.toThrow();\n });\n\n it('Static renders display-mode latex without a mathfield', () => {\n expect(() => render(<mf.Static latex=\"\\\\frac{1}{2}\" />)).not.toThrow();\n });\n});\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAeAG,QAAQ,CAAC,gCAAgC,EAAE,YAAM;EAC/CC,EAAE,CAAC,gDAAgD,EAAE,YAAM;IACzDC,MAAM,KAAAC,QAAA,aAAQC,mBAAY,EAAC,CAACC,IAAI,CAAC,UAAU,CAAC;IAC5CH,MAAM,KAAAC,QAAA,aAAQG,kBAAW,EAAC,CAACD,IAAI,CAAC,UAAU,CAAC;IAC3CH,MAAM,KAAAC,QAAA,aAAQI,qBAAc,EAAC,CAACF,IAAI,CAAC,UAAU,CAAC;IAC9CH,MAAM,KAAAC,QAAA,aAAQK,oBAAa,EAAC,CAACH,IAAI,CAAC,UAAU,CAAC;IAC7CH,MAAM,KAAAC,QAAA,aAAQM,sBAAe,EAAC,CAACJ,IAAI,CAAC,UAAU,CAAC;IAC/CH,MAA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