@pie-lib/math-input-mathlive 1.0.0
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/README.md +119 -0
- package/lib/__tests__/index.test.js +118 -0
- package/lib/__tests__/index.test.js.map +1 -0
- package/lib/__tests__/latex-bridge.test.js +186 -0
- package/lib/__tests__/latex-bridge.test.js.map +1 -0
- package/lib/__tests__/mathlive-instance.test.js +137 -0
- package/lib/__tests__/mathlive-instance.test.js.map +1 -0
- package/lib/horizontal-keypad.js +101 -0
- package/lib/horizontal-keypad.js.map +1 -0
- package/lib/index.js +143 -0
- package/lib/index.js.map +1 -0
- package/lib/keypad/index.js +365 -0
- package/lib/keypad/index.js.map +1 -0
- package/lib/keypad/keys-layout.js +22 -0
- package/lib/keypad/keys-layout.js.map +1 -0
- package/lib/keys/basic-operators.js +33 -0
- package/lib/keys/basic-operators.js.map +1 -0
- package/lib/keys/chars.js +12 -0
- package/lib/keys/chars.js.map +1 -0
- package/lib/keys/comparison.js +39 -0
- package/lib/keys/comparison.js.map +1 -0
- package/lib/keys/constants.js +37 -0
- package/lib/keys/constants.js.map +1 -0
- package/lib/keys/digits.js +46 -0
- package/lib/keys/digits.js.map +1 -0
- package/lib/keys/edit.js +14 -0
- package/lib/keys/edit.js.map +1 -0
- package/lib/keys/exponent.js +30 -0
- package/lib/keys/exponent.js.map +1 -0
- package/lib/keys/fractions.js +29 -0
- package/lib/keys/fractions.js.map +1 -0
- package/lib/keys/geometry.js +140 -0
- package/lib/keys/geometry.js.map +1 -0
- package/lib/keys/grades.js +259 -0
- package/lib/keys/grades.js.map +1 -0
- package/lib/keys/index.js +35 -0
- package/lib/keys/index.js.map +1 -0
- package/lib/keys/log.js +27 -0
- package/lib/keys/log.js.map +1 -0
- package/lib/keys/logic.js +19 -0
- package/lib/keys/logic.js.map +1 -0
- package/lib/keys/matrices.js +19 -0
- package/lib/keys/matrices.js.map +1 -0
- package/lib/keys/misc.js +62 -0
- package/lib/keys/misc.js.map +1 -0
- package/lib/keys/navigation.js +20 -0
- package/lib/keys/navigation.js.map +1 -0
- package/lib/keys/operators.js +15 -0
- package/lib/keys/operators.js.map +1 -0
- package/lib/keys/statistics.js +40 -0
- package/lib/keys/statistics.js.map +1 -0
- package/lib/keys/sub-sup.js +19 -0
- package/lib/keys/sub-sup.js.map +1 -0
- package/lib/keys/trigonometry.js +45 -0
- package/lib/keys/trigonometry.js.map +1 -0
- package/lib/keys/utils.js +87 -0
- package/lib/keys/utils.js.map +1 -0
- package/lib/keys/vars.js +24 -0
- package/lib/keys/vars.js.map +1 -0
- package/lib/latex-bridge.js +195 -0
- package/lib/latex-bridge.js.map +1 -0
- package/lib/math-input.js +143 -0
- package/lib/math-input.js.map +1 -0
- package/lib/mathlive-instance.js +319 -0
- package/lib/mathlive-instance.js.map +1 -0
- package/lib/mf/common-styles.js +111 -0
- package/lib/mf/common-styles.js.map +1 -0
- package/lib/mf/index.js +72 -0
- package/lib/mf/index.js.map +1 -0
- package/lib/mf/input.js +266 -0
- package/lib/mf/input.js.map +1 -0
- package/lib/mf/static.js +396 -0
- package/lib/mf/static.js.map +1 -0
- package/package.json +31 -0
- package/src/__tests__/index.test.jsx +109 -0
- package/src/__tests__/latex-bridge.test.js +151 -0
- package/src/__tests__/mathlive-instance.test.js +130 -0
- package/src/horizontal-keypad.jsx +73 -0
- package/src/index.jsx +63 -0
- package/src/keypad/index.jsx +335 -0
- package/src/keypad/keys-layout.js +16 -0
- package/src/keys/basic-operators.js +32 -0
- package/src/keys/chars.js +5 -0
- package/src/keys/comparison.js +28 -0
- package/src/keys/constants.js +35 -0
- package/src/keys/digits.js +40 -0
- package/src/keys/edit.js +3 -0
- package/src/keys/exponent.js +28 -0
- package/src/keys/fractions.js +26 -0
- package/src/keys/geometry.js +144 -0
- package/src/keys/grades.js +367 -0
- package/src/keys/index.js +20 -0
- package/src/keys/log.js +22 -0
- package/src/keys/logic.js +15 -0
- package/src/keys/matrices.js +15 -0
- package/src/keys/misc.js +65 -0
- package/src/keys/navigation.js +8 -0
- package/src/keys/operators.js +10 -0
- package/src/keys/statistics.js +38 -0
- package/src/keys/sub-sup.js +15 -0
- package/src/keys/trigonometry.js +15 -0
- package/src/keys/utils.js +66 -0
- package/src/keys/vars.js +19 -0
- package/src/latex-bridge.js +190 -0
- package/src/math-input.jsx +115 -0
- package/src/mathlive-instance.js +286 -0
- package/src/mf/common-styles.js +108 -0
- package/src/mf/index.js +26 -0
- package/src/mf/input.jsx +223 -0
- package/src/mf/static.jsx +358 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "NEWLINE_EMBED", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _latexBridge.NEWLINE_EMBED;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
exports.__setMathLiveForTest = exports.__resetEmbeds = exports.PIE_MACROS = void 0;
|
|
15
|
+
exports.applyStaticMath = applyStaticMath;
|
|
16
|
+
exports.getMathLive = exports.getMacros = exports.configureFonts = void 0;
|
|
17
|
+
exports.latexToMarkup = latexToMarkup;
|
|
18
|
+
exports.loadMathLive = void 0;
|
|
19
|
+
exports.registerEmbed = registerEmbed;
|
|
20
|
+
exports.registeredEmbeds = void 0;
|
|
21
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
22
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
24
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
25
|
+
var _latexBridge = require("./latex-bridge");
|
|
26
|
+
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; }
|
|
27
|
+
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; }
|
|
28
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
29
|
+
var log = (0, _debug["default"])('pie-lib:math-input-mathlive:instance');
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* MathLive bootstrap + compatibility shims for @pie-lib/math-input's public API.
|
|
33
|
+
*
|
|
34
|
+
* MathLive is loaded lazily and only in the browser: the editor bundle is
|
|
35
|
+
* ~227KB gzip and registers custom elements, so it must never run during SSR.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
var mathlive;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Where the KaTeX woff2 fonts are served from, as configured by the host app.
|
|
42
|
+
* `undefined` means "not configured"; `null` means "explicitly disabled".
|
|
43
|
+
*/
|
|
44
|
+
var fontsDirectory;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Turn a fonts path into a fully-qualified URL.
|
|
48
|
+
*
|
|
49
|
+
* MathLive's default `fontsDirectory` is the relative `'./fonts/'`, which it
|
|
50
|
+
* resolves against its own script URL. Under a bundler (webpack/Next) that
|
|
51
|
+
* script URL is empty, so `new URL('./fonts/', '')` throws
|
|
52
|
+
* "Failed to construct 'URL': Invalid base URL" from `loadFonts`.
|
|
53
|
+
* Resolving against `document.baseURI` avoids that entirely and honours any
|
|
54
|
+
* <base href> / asset prefix the host app uses.
|
|
55
|
+
*/
|
|
56
|
+
var absoluteFontsDirectory = function absoluteFontsDirectory(dir) {
|
|
57
|
+
if (!dir) {
|
|
58
|
+
return dir;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Already absolute (http://, https://, //cdn...) - MathLive handles these.
|
|
62
|
+
if (/^(?:[a-z+]+:)?\/\//i.test(dir)) {
|
|
63
|
+
return dir;
|
|
64
|
+
}
|
|
65
|
+
try {
|
|
66
|
+
return new URL(dir, document.baseURI).href;
|
|
67
|
+
} catch (e) {
|
|
68
|
+
log('could not resolve fontsDirectory "%s": %s', dir, e && e.message);
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Tell the package where the MathLive fonts are served from.
|
|
75
|
+
*
|
|
76
|
+
* Call before `loadMathLive()`. Accepts an absolute URL, a root-relative path
|
|
77
|
+
* (`/mathlive-fonts`) or a relative one; pass `null` to skip font loading and
|
|
78
|
+
* fall back to system fonts.
|
|
79
|
+
*
|
|
80
|
+
* The fonts ship inside the `mathlive` package (`node_modules/mathlive/fonts`)
|
|
81
|
+
* and must be copied into whatever the host app serves statically.
|
|
82
|
+
*
|
|
83
|
+
* @param {string|null} dir
|
|
84
|
+
*/
|
|
85
|
+
var configureFonts = exports.configureFonts = function configureFonts(dir) {
|
|
86
|
+
fontsDirectory = dir;
|
|
87
|
+
if (mathlive) {
|
|
88
|
+
mathlive.MathfieldElement.fontsDirectory = absoluteFontsDirectory(dir);
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Custom macros for the pie-specific commands that the MathQuill fork
|
|
94
|
+
* understood but stock LaTeX does not.
|
|
95
|
+
*
|
|
96
|
+
* Kept deliberately in sync with the MathJax macros in
|
|
97
|
+
* @pie-lib/math-rendering (`render-math.js`) so the same latex renders the same
|
|
98
|
+
* way in the editor and in the static renderer.
|
|
99
|
+
*/
|
|
100
|
+
var PIE_MACROS = exports.PIE_MACROS = {
|
|
101
|
+
parallelogram: "\\htmlData{pie-macro=parallelogram}{\\unicode{\"25B1}}",
|
|
102
|
+
overarc: '\\overparen{#1}',
|
|
103
|
+
napprox: '\\not\\approx',
|
|
104
|
+
nsim: '\\not\\sim',
|
|
105
|
+
ncong: '\\not\\cong',
|
|
106
|
+
nparallel: '\\not\\parallel',
|
|
107
|
+
perpendicular: '\\perp',
|
|
108
|
+
divide: '\\div',
|
|
109
|
+
degree: '^{\\circ}',
|
|
110
|
+
square: "\\unicode{\"25A1}",
|
|
111
|
+
longdiv: '\\htmlData{pie-macro=longdiv}{#1}',
|
|
112
|
+
abs: '\\left|#1\\right|'
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Registry for `registerEmbed`.
|
|
117
|
+
*
|
|
118
|
+
* MathLive has no embed plugin system, so an embed is expressed as a macro that
|
|
119
|
+
* expands to real LaTeX. `\htmlData{embed=<name>}` tags the rendered output so
|
|
120
|
+
* consumers can target it with CSS exactly as they targeted the old
|
|
121
|
+
* `htmlString` markup.
|
|
122
|
+
*
|
|
123
|
+
* Known embeds map to native constructs:
|
|
124
|
+
* - `newLine` -> structural, handled by latex-bridge (`\displaylines` + `\\`)
|
|
125
|
+
* - `answerBlock`-> `\placeholder{}` (interactive, read via the prompts API)
|
|
126
|
+
*
|
|
127
|
+
* @type {Map<string, {factory: Function, latex: string}>}
|
|
128
|
+
*/
|
|
129
|
+
var embeds = new Map();
|
|
130
|
+
var KNOWN_EMBED_LATEX = {
|
|
131
|
+
// newLine is structural: it is translated by latex-bridge before it ever
|
|
132
|
+
// reaches MathLive, so the macro only needs to be harmless.
|
|
133
|
+
newLine: '',
|
|
134
|
+
answerBlock: '\\placeholder{}'
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Load MathLive. Resolves to undefined during SSR.
|
|
139
|
+
* @returns {Promise<object|undefined>}
|
|
140
|
+
*/
|
|
141
|
+
var loadMathLive = exports.loadMathLive = /*#__PURE__*/function () {
|
|
142
|
+
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
|
|
143
|
+
var _t;
|
|
144
|
+
return _regenerator["default"].wrap(function (_context) {
|
|
145
|
+
while (1) switch (_context.prev = _context.next) {
|
|
146
|
+
case 0:
|
|
147
|
+
if (!(typeof window === 'undefined')) {
|
|
148
|
+
_context.next = 1;
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
return _context.abrupt("return", undefined);
|
|
152
|
+
case 1:
|
|
153
|
+
if (mathlive) {
|
|
154
|
+
_context.next = 6;
|
|
155
|
+
break;
|
|
156
|
+
}
|
|
157
|
+
_context.prev = 2;
|
|
158
|
+
_context.next = 3;
|
|
159
|
+
return Promise.resolve().then(function () {
|
|
160
|
+
return _interopRequireWildcard(require('mathlive'));
|
|
161
|
+
});
|
|
162
|
+
case 3:
|
|
163
|
+
mathlive = _context.sent;
|
|
164
|
+
_context.next = 5;
|
|
165
|
+
break;
|
|
166
|
+
case 4:
|
|
167
|
+
_context.prev = 4;
|
|
168
|
+
_t = _context["catch"](2);
|
|
169
|
+
// MathLive is browser-only and ships an ESM-conditional exports map, so
|
|
170
|
+
// the import can fail in test/SSR-ish runtimes. Fail soft: callers all
|
|
171
|
+
// handle a missing instance (static rendering falls back to raw latex).
|
|
172
|
+
log('MathLive could not be loaded: %s', _t && _t.message);
|
|
173
|
+
return _context.abrupt("return", undefined);
|
|
174
|
+
case 5:
|
|
175
|
+
// Always replace MathLive's relative `'./fonts/'` default: it throws
|
|
176
|
+
// "Invalid base URL" when bundled. Either point at the host app's copy or
|
|
177
|
+
// disable font loading, both of which are safe.
|
|
178
|
+
if (fontsDirectory === undefined) {
|
|
179
|
+
log('no fontsDirectory configured - MathLive will use fallback fonts. ' + 'Call configureFonts("/path/to/fonts") with a copy of node_modules/mathlive/fonts to enable them.');
|
|
180
|
+
}
|
|
181
|
+
mathlive.MathfieldElement.fontsDirectory = fontsDirectory === undefined ? null : absoluteFontsDirectory(fontsDirectory);
|
|
182
|
+
case 6:
|
|
183
|
+
return _context.abrupt("return", mathlive);
|
|
184
|
+
case 7:
|
|
185
|
+
case "end":
|
|
186
|
+
return _context.stop();
|
|
187
|
+
}
|
|
188
|
+
}, _callee, null, [[2, 4]]);
|
|
189
|
+
}));
|
|
190
|
+
return function loadMathLive() {
|
|
191
|
+
return _ref.apply(this, arguments);
|
|
192
|
+
};
|
|
193
|
+
}();
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Synchronous accessor for an already-loaded MathLive.
|
|
197
|
+
* @returns {object|undefined}
|
|
198
|
+
*/
|
|
199
|
+
var getMathLive = exports.getMathLive = function getMathLive() {
|
|
200
|
+
return mathlive;
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* The macro dictionary to hand to a mathfield: pie macros plus anything
|
|
205
|
+
* registered through `registerEmbed`.
|
|
206
|
+
*
|
|
207
|
+
* @returns {object}
|
|
208
|
+
*/
|
|
209
|
+
var getMacros = exports.getMacros = function getMacros() {
|
|
210
|
+
var out = _objectSpread({}, PIE_MACROS);
|
|
211
|
+
embeds.forEach(function (_ref2, name) {
|
|
212
|
+
var latex = _ref2.latex;
|
|
213
|
+
out[name] = "\\htmlData{embed=".concat(name, "}{").concat(latex, "}");
|
|
214
|
+
});
|
|
215
|
+
return out;
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* Register an embed. API-compatible with @pie-lib/math-input's `registerEmbed`
|
|
220
|
+
* so existing callers do not change.
|
|
221
|
+
*
|
|
222
|
+
* MathQuill's factory returns `{ htmlString, text, latex }`. Only the
|
|
223
|
+
* declarative parts survive: `latex` round-trips through a macro and the
|
|
224
|
+
* styling hook becomes a `data-embed` attribute. Arbitrary DOM injection via
|
|
225
|
+
* `htmlString` has no MathLive equivalent and is ignored.
|
|
226
|
+
*
|
|
227
|
+
* @param {string} name
|
|
228
|
+
* @param {Function} factory
|
|
229
|
+
*/
|
|
230
|
+
function registerEmbed(name, factory) {
|
|
231
|
+
if (!name || typeof factory !== 'function') {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
var definition = {};
|
|
235
|
+
try {
|
|
236
|
+
definition = factory() || {};
|
|
237
|
+
} catch (e) {
|
|
238
|
+
log('embed factory threw for "%s": %s', name, e.message);
|
|
239
|
+
}
|
|
240
|
+
var latex = Object.prototype.hasOwnProperty.call(KNOWN_EMBED_LATEX, name) ? KNOWN_EMBED_LATEX[name] : definition.mathliveLatex || '\\placeholder{}';
|
|
241
|
+
if (!Object.prototype.hasOwnProperty.call(KNOWN_EMBED_LATEX, name) && !definition.mathliveLatex) {
|
|
242
|
+
// Unknown third-party embed: degrade instead of throwing. `htmlString`
|
|
243
|
+
// cannot be reproduced, so it renders as an editable slot.
|
|
244
|
+
log('embed "%s" is not natively supported by MathLive; rendering as a placeholder. ' + 'Provide `mathliveLatex` in the factory result to control this.', name);
|
|
245
|
+
}
|
|
246
|
+
embeds.set(name, {
|
|
247
|
+
factory: factory,
|
|
248
|
+
latex: latex
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/**
|
|
253
|
+
* Embeds registered so far. Exposed for tests/diagnostics.
|
|
254
|
+
* @returns {string[]}
|
|
255
|
+
*/
|
|
256
|
+
var registeredEmbeds = exports.registeredEmbeds = function registeredEmbeds() {
|
|
257
|
+
return Array.from(embeds.keys());
|
|
258
|
+
};
|
|
259
|
+
|
|
260
|
+
/** Reset the embed registry. Test helper. */
|
|
261
|
+
var __resetEmbeds = exports.__resetEmbeds = function __resetEmbeds() {
|
|
262
|
+
return embeds.clear();
|
|
263
|
+
};
|
|
264
|
+
|
|
265
|
+
/** Inject a stub MathLive instance. Test helper. */
|
|
266
|
+
var __setMathLiveForTest = exports.__setMathLiveForTest = function __setMathLiveForTest(stub) {
|
|
267
|
+
mathlive = stub;
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Render static math into an element. API-compatible with
|
|
272
|
+
* @pie-lib/math-input's `applyStaticMath`.
|
|
273
|
+
*
|
|
274
|
+
* @param {HTMLElement} element
|
|
275
|
+
* @param {string} [latex] assigned to the element before rendering
|
|
276
|
+
* @param {object} [options] `{ macros }` overrides
|
|
277
|
+
* @returns {HTMLElement|undefined} the element, for parity with the old return
|
|
278
|
+
*/
|
|
279
|
+
function applyStaticMath(element, latex) {
|
|
280
|
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
281
|
+
if (!element || typeof window === 'undefined') {
|
|
282
|
+
return undefined;
|
|
283
|
+
}
|
|
284
|
+
var ml = getMathLive();
|
|
285
|
+
if (!ml) {
|
|
286
|
+
log('applyStaticMath called before MathLive loaded - call loadMathLive() first');
|
|
287
|
+
return undefined;
|
|
288
|
+
}
|
|
289
|
+
var source = latex === undefined || latex === null ? element.textContent : latex;
|
|
290
|
+
element.innerHTML = ml.convertLatexToMarkup((0, _latexBridge.toMathLive)(source), {
|
|
291
|
+
macros: _objectSpread(_objectSpread({}, getMacros()), options.macros || {})
|
|
292
|
+
});
|
|
293
|
+
return element;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
/**
|
|
297
|
+
* Convert latex to markup using the pie macro set. Used for keypad labels and
|
|
298
|
+
* any read-only rendering that does not need a live mathfield.
|
|
299
|
+
*
|
|
300
|
+
* @param {string} latex
|
|
301
|
+
* @param {object} [options]
|
|
302
|
+
* @returns {string} HTML markup, or '' if MathLive is not loaded
|
|
303
|
+
*/
|
|
304
|
+
function latexToMarkup(latex) {
|
|
305
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
306
|
+
var ml = getMathLive();
|
|
307
|
+
if (!ml || !latex) {
|
|
308
|
+
return '';
|
|
309
|
+
}
|
|
310
|
+
try {
|
|
311
|
+
return ml.convertLatexToMarkup((0, _latexBridge.toMathLive)(latex), _objectSpread({
|
|
312
|
+
macros: _objectSpread(_objectSpread({}, getMacros()), options.macros || {})
|
|
313
|
+
}, options));
|
|
314
|
+
} catch (e) {
|
|
315
|
+
log('convertLatexToMarkup failed for "%s": %s', latex, e.message);
|
|
316
|
+
return '';
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=mathlive-instance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mathlive-instance.js","names":["_debug","_interopRequireDefault","require","_latexBridge","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","_interopRequireWildcard","WeakMap","n","__esModule","i","f","__proto__","_typeof","has","get","set","_t2","hasOwnProperty","call","log","debug","mathlive","fontsDirectory","absoluteFontsDirectory","dir","test","URL","document","baseURI","href","message","configureFonts","exports","MathfieldElement","PIE_MACROS","parallelogram","overarc","napprox","nsim","ncong","nparallel","perpendicular","divide","degree","square","longdiv","abs","embeds","Map","KNOWN_EMBED_LATEX","newLine","answerBlock","loadMathLive","_ref","_asyncToGenerator2","_regenerator","mark","_callee","_t","wrap","_context","prev","next","window","abrupt","undefined","Promise","resolve","then","sent","stop","getMathLive","getMacros","out","_ref2","name","latex","concat","registerEmbed","factory","definition","prototype","mathliveLatex","registeredEmbeds","Array","from","__resetEmbeds","clear","__setMathLiveForTest","stub","applyStaticMath","element","options","ml","source","textContent","innerHTML","convertLatexToMarkup","toMathLive","macros","latexToMarkup"],"sources":["../src/mathlive-instance.js"],"sourcesContent":["import debug from 'debug';\nimport { NEWLINE_EMBED, toMathLive } from './latex-bridge';\n\nconst log = debug('pie-lib:math-input-mathlive:instance');\n\n/**\n * MathLive bootstrap + compatibility shims for @pie-lib/math-input's public API.\n *\n * MathLive is loaded lazily and only in the browser: the editor bundle is\n * ~227KB gzip and registers custom elements, so it must never run during SSR.\n */\n\nlet mathlive;\n\n/**\n * Where the KaTeX woff2 fonts are served from, as configured by the host app.\n * `undefined` means \"not configured\"; `null` means \"explicitly disabled\".\n */\nlet fontsDirectory;\n\n/**\n * Turn a fonts path into a fully-qualified URL.\n *\n * MathLive's default `fontsDirectory` is the relative `'./fonts/'`, which it\n * resolves against its own script URL. Under a bundler (webpack/Next) that\n * script URL is empty, so `new URL('./fonts/', '')` throws\n * \"Failed to construct 'URL': Invalid base URL\" from `loadFonts`.\n * Resolving against `document.baseURI` avoids that entirely and honours any\n * <base href> / asset prefix the host app uses.\n */\nconst absoluteFontsDirectory = (dir) => {\n if (!dir) {\n return dir;\n }\n\n // Already absolute (http://, https://, //cdn...) - MathLive handles these.\n if (/^(?:[a-z+]+:)?\\/\\//i.test(dir)) {\n return dir;\n }\n\n try {\n return new URL(dir, document.baseURI).href;\n } catch (e) {\n log('could not resolve fontsDirectory \"%s\": %s', dir, e && e.message);\n return null;\n }\n};\n\n/**\n * Tell the package where the MathLive fonts are served from.\n *\n * Call before `loadMathLive()`. Accepts an absolute URL, a root-relative path\n * (`/mathlive-fonts`) or a relative one; pass `null` to skip font loading and\n * fall back to system fonts.\n *\n * The fonts ship inside the `mathlive` package (`node_modules/mathlive/fonts`)\n * and must be copied into whatever the host app serves statically.\n *\n * @param {string|null} dir\n */\nexport const configureFonts = (dir) => {\n fontsDirectory = dir;\n\n if (mathlive) {\n mathlive.MathfieldElement.fontsDirectory = absoluteFontsDirectory(dir);\n }\n};\n\n/**\n * Custom macros for the pie-specific commands that the MathQuill fork\n * understood but stock LaTeX does not.\n *\n * Kept deliberately in sync with the MathJax macros in\n * @pie-lib/math-rendering (`render-math.js`) so the same latex renders the same\n * way in the editor and in the static renderer.\n */\nexport const PIE_MACROS = {\n parallelogram: '\\\\htmlData{pie-macro=parallelogram}{\\\\unicode{\"25B1}}',\n overarc: '\\\\overparen{#1}',\n napprox: '\\\\not\\\\approx',\n nsim: '\\\\not\\\\sim',\n ncong: '\\\\not\\\\cong',\n nparallel: '\\\\not\\\\parallel',\n perpendicular: '\\\\perp',\n divide: '\\\\div',\n degree: '^{\\\\circ}',\n square: '\\\\unicode{\"25A1}',\n longdiv: '\\\\htmlData{pie-macro=longdiv}{#1}',\n abs: '\\\\left|#1\\\\right|',\n};\n\n/**\n * Registry for `registerEmbed`.\n *\n * MathLive has no embed plugin system, so an embed is expressed as a macro that\n * expands to real LaTeX. `\\htmlData{embed=<name>}` tags the rendered output so\n * consumers can target it with CSS exactly as they targeted the old\n * `htmlString` markup.\n *\n * Known embeds map to native constructs:\n * - `newLine` -> structural, handled by latex-bridge (`\\displaylines` + `\\\\`)\n * - `answerBlock`-> `\\placeholder{}` (interactive, read via the prompts API)\n *\n * @type {Map<string, {factory: Function, latex: string}>}\n */\nconst embeds = new Map();\n\nconst KNOWN_EMBED_LATEX = {\n // newLine is structural: it is translated by latex-bridge before it ever\n // reaches MathLive, so the macro only needs to be harmless.\n newLine: '',\n answerBlock: '\\\\placeholder{}',\n};\n\n/**\n * Load MathLive. Resolves to undefined during SSR.\n * @returns {Promise<object|undefined>}\n */\nexport const loadMathLive = async () => {\n if (typeof window === 'undefined') {\n return undefined;\n }\n\n if (!mathlive) {\n try {\n mathlive = await import('mathlive');\n } catch (e) {\n // MathLive is browser-only and ships an ESM-conditional exports map, so\n // the import can fail in test/SSR-ish runtimes. Fail soft: callers all\n // handle a missing instance (static rendering falls back to raw latex).\n log('MathLive could not be loaded: %s', e && e.message);\n return undefined;\n }\n\n // Always replace MathLive's relative `'./fonts/'` default: it throws\n // \"Invalid base URL\" when bundled. Either point at the host app's copy or\n // disable font loading, both of which are safe.\n if (fontsDirectory === undefined) {\n log(\n 'no fontsDirectory configured - MathLive will use fallback fonts. ' +\n 'Call configureFonts(\"/path/to/fonts\") with a copy of node_modules/mathlive/fonts to enable them.',\n );\n }\n\n mathlive.MathfieldElement.fontsDirectory =\n fontsDirectory === undefined ? null : absoluteFontsDirectory(fontsDirectory);\n }\n\n return mathlive;\n};\n\n/**\n * Synchronous accessor for an already-loaded MathLive.\n * @returns {object|undefined}\n */\nexport const getMathLive = () => mathlive;\n\n/**\n * The macro dictionary to hand to a mathfield: pie macros plus anything\n * registered through `registerEmbed`.\n *\n * @returns {object}\n */\nexport const getMacros = () => {\n const out = { ...PIE_MACROS };\n\n embeds.forEach(({ latex }, name) => {\n out[name] = `\\\\htmlData{embed=${name}}{${latex}}`;\n });\n\n return out;\n};\n\n/**\n * Register an embed. API-compatible with @pie-lib/math-input's `registerEmbed`\n * so existing callers do not change.\n *\n * MathQuill's factory returns `{ htmlString, text, latex }`. Only the\n * declarative parts survive: `latex` round-trips through a macro and the\n * styling hook becomes a `data-embed` attribute. Arbitrary DOM injection via\n * `htmlString` has no MathLive equivalent and is ignored.\n *\n * @param {string} name\n * @param {Function} factory\n */\nexport function registerEmbed(name, factory) {\n if (!name || typeof factory !== 'function') {\n return;\n }\n\n let definition = {};\n\n try {\n definition = factory() || {};\n } catch (e) {\n log('embed factory threw for \"%s\": %s', name, e.message);\n }\n\n const latex = Object.prototype.hasOwnProperty.call(KNOWN_EMBED_LATEX, name)\n ? KNOWN_EMBED_LATEX[name]\n : definition.mathliveLatex || '\\\\placeholder{}';\n\n if (!Object.prototype.hasOwnProperty.call(KNOWN_EMBED_LATEX, name) && !definition.mathliveLatex) {\n // Unknown third-party embed: degrade instead of throwing. `htmlString`\n // cannot be reproduced, so it renders as an editable slot.\n log(\n 'embed \"%s\" is not natively supported by MathLive; rendering as a placeholder. ' +\n 'Provide `mathliveLatex` in the factory result to control this.',\n name,\n );\n }\n\n embeds.set(name, { factory, latex });\n}\n\n/**\n * Embeds registered so far. Exposed for tests/diagnostics.\n * @returns {string[]}\n */\nexport const registeredEmbeds = () => Array.from(embeds.keys());\n\n/** Reset the embed registry. Test helper. */\nexport const __resetEmbeds = () => embeds.clear();\n\n/** Inject a stub MathLive instance. Test helper. */\nexport const __setMathLiveForTest = (stub) => {\n mathlive = stub;\n};\n\n/**\n * Render static math into an element. API-compatible with\n * @pie-lib/math-input's `applyStaticMath`.\n *\n * @param {HTMLElement} element\n * @param {string} [latex] assigned to the element before rendering\n * @param {object} [options] `{ macros }` overrides\n * @returns {HTMLElement|undefined} the element, for parity with the old return\n */\nexport function applyStaticMath(element, latex, options = {}) {\n if (!element || typeof window === 'undefined') {\n return undefined;\n }\n\n const ml = getMathLive();\n\n if (!ml) {\n log('applyStaticMath called before MathLive loaded - call loadMathLive() first');\n return undefined;\n }\n\n const source = latex === undefined || latex === null ? element.textContent : latex;\n\n element.innerHTML = ml.convertLatexToMarkup(toMathLive(source), {\n macros: { ...getMacros(), ...(options.macros || {}) },\n });\n\n return element;\n}\n\n/**\n * Convert latex to markup using the pie macro set. Used for keypad labels and\n * any read-only rendering that does not need a live mathfield.\n *\n * @param {string} latex\n * @param {object} [options]\n * @returns {string} HTML markup, or '' if MathLive is not loaded\n */\nexport function latexToMarkup(latex, options = {}) {\n const ml = getMathLive();\n\n if (!ml || !latex) {\n return '';\n }\n\n try {\n return ml.convertLatexToMarkup(toMathLive(latex), {\n macros: { ...getMacros(), ...(options.macros || {}) },\n ...options,\n });\n } catch (e) {\n log('convertLatexToMarkup failed for \"%s\": %s', latex, e.message);\n return '';\n }\n}\n\nexport { NEWLINE_EMBED };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC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M,GAAGlB,KAAK,KAAKX,SAAS,IAAIW,KAAK,KAAK,IAAI,GAAGe,OAAO,CAACI,WAAW,GAAGnB,KAAK;EAElFe,OAAO,CAACK,SAAS,GAAGH,EAAE,CAACI,oBAAoB,CAAC,IAAAC,uBAAU,EAACJ,MAAM,CAAC,EAAE;IAC9DK,MAAM,EAAAtG,aAAA,CAAAA,aAAA,KAAO2E,SAAS,CAAC,CAAC,GAAMoB,OAAO,CAACO,MAAM,IAAI,CAAC,CAAC;EACpD,CAAC,CAAC;EAEF,OAAOR,OAAO;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASS,aAAaA,CAACxB,KAAK,EAAgB;EAAA,IAAdgB,OAAO,GAAA9F,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAmE,SAAA,GAAAnE,SAAA,MAAG,CAAC,CAAC;EAC/C,IAAM+F,EAAE,GAAGtB,WAAW,CAAC,CAAC;EAExB,IAAI,CAACsB,EAAE,IAAI,CAACjB,KAAK,EAAE;IACjB,OAAO,EAAE;EACX;EAEA,IAAI;IACF,OAAOiB,EAAE,CAACI,oBAAoB,CAAC,IAAAC,uBAAU,EAACtB,KAAK,CAAC,EAAA/E,aAAA;MAC9CsG,MAAM,EAAAtG,aAAA,CAAAA,aAAA,KAAO2E,SAAS,CAAC,CAAC,GAAMoB,OAAO,CAACO,MAAM,IAAI,CAAC,CAAC;IAAG,GAClDP,OAAO,CACX,CAAC;EACJ,CAAC,CAAC,OAAO3G,CAAC,EAAE;IACVkC,GAAG,CAAC,0CAA0C,EAAEyD,KAAK,EAAE3F,CAAC,CAAC6C,OAAO,CAAC;IACjE,OAAO,EAAE;EACX;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.supsubStyles = exports.placeholderStyles = exports.longdivStyles = exports["default"] = exports.commonMqKeyboardStyles = exports.commonMqFontStyles = exports.commonMathLiveStyles = exports.commonKeyboardStyles = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
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
|
+
* Shared MathLive styling.
|
|
13
|
+
*
|
|
14
|
+
* Replaces @pie-lib/math-input's `common-mq-styles.js`. That file was built
|
|
15
|
+
* around MathQuill's `.mq-*` class names, none of which exist in MathLive
|
|
16
|
+
* output, so the selectors here target MathLive's own structure instead.
|
|
17
|
+
*
|
|
18
|
+
* The four named groups are kept because consumers destructure them:
|
|
19
|
+
*
|
|
20
|
+
* const { commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles }
|
|
21
|
+
* = mq.CommonMqStyles; // math-toolbar/src/editor-and-pad.jsx, math-preview.jsx
|
|
22
|
+
*
|
|
23
|
+
* Most are intentionally near-empty: MathLive sizes scripts, radicals and
|
|
24
|
+
* fences correctly on its own, so the MathQuill-era corrections are not needed.
|
|
25
|
+
* They stay as documented extension points rather than being deleted, so the
|
|
26
|
+
* destructuring above keeps working.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Font styling. MathQuill needed explicit MathJax font families to match the
|
|
31
|
+
* static renderer; MathLive ships the KaTeX fonts it renders with, so this only
|
|
32
|
+
* smooths rendering and lets the host override the family.
|
|
33
|
+
*/
|
|
34
|
+
var commonMqFontStyles = exports.commonMqFontStyles = {
|
|
35
|
+
'-webkit-font-smoothing': 'antialiased',
|
|
36
|
+
'& math-field': {
|
|
37
|
+
fontFamily: 'inherit'
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Long division. The MathQuill fork drew this with nested `.mq-longdiv-*`
|
|
43
|
+
* elements that needed manual offsets; here it comes from the `\longdiv` macro
|
|
44
|
+
* (see `PIE_MACROS`), tagged with `data-pie-macro="longdiv"`.
|
|
45
|
+
*/
|
|
46
|
+
var longdivStyles = exports.longdivStyles = {
|
|
47
|
+
'& [data-pie-macro="longdiv"]': {
|
|
48
|
+
display: 'inline-flex'
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Superscript/subscript sizing. MathLive follows TeX metrics, so no overrides
|
|
54
|
+
* are required.
|
|
55
|
+
*/
|
|
56
|
+
var supsubStyles = exports.supsubStyles = {};
|
|
57
|
+
|
|
58
|
+
/** Empty placeholder boxes (answer blocks / open slots). */
|
|
59
|
+
var placeholderStyles = exports.placeholderStyles = {
|
|
60
|
+
'& .ML__placeholder': {
|
|
61
|
+
borderBottom: '1px solid currentColor',
|
|
62
|
+
minWidth: '1em'
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Styling for the on-screen keyboard and any container rendering math labels.
|
|
68
|
+
* Also hides MathLive's own affordances, since pie supplies its own keypad.
|
|
69
|
+
*/
|
|
70
|
+
var commonMqKeyboardStyles = exports.commonMqKeyboardStyles = _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, commonMqFontStyles), longdivStyles), placeholderStyles), {}, {
|
|
71
|
+
touchAction: 'manipulation',
|
|
72
|
+
'& math-field': {
|
|
73
|
+
fontSize: 'inherit',
|
|
74
|
+
outline: 'none'
|
|
75
|
+
},
|
|
76
|
+
'& math-field::part(virtual-keyboard-toggle)': {
|
|
77
|
+
display: 'none'
|
|
78
|
+
},
|
|
79
|
+
'& math-field::part(menu-toggle)': {
|
|
80
|
+
display: 'none'
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/** Everything combined - the common case for a container of math. */
|
|
85
|
+
var commonMathLiveStyles = exports.commonMathLiveStyles = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({}, commonMqFontStyles), longdivStyles), supsubStyles), placeholderStyles), {}, {
|
|
86
|
+
'& math-field': {
|
|
87
|
+
fontSize: 'inherit',
|
|
88
|
+
outline: 'none'
|
|
89
|
+
},
|
|
90
|
+
'& math-field::part(virtual-keyboard-toggle)': {
|
|
91
|
+
display: 'none'
|
|
92
|
+
},
|
|
93
|
+
'& math-field::part(menu-toggle)': {
|
|
94
|
+
display: 'none'
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
var commonKeyboardStyles = exports.commonKeyboardStyles = commonMqKeyboardStyles;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Default export mirrors @pie-lib/math-input's `CommonMqStyles` object so
|
|
101
|
+
* existing destructuring keeps working.
|
|
102
|
+
*/
|
|
103
|
+
var _default = exports["default"] = {
|
|
104
|
+
commonMqFontStyles: commonMqFontStyles,
|
|
105
|
+
longdivStyles: longdivStyles,
|
|
106
|
+
supsubStyles: supsubStyles,
|
|
107
|
+
commonMqKeyboardStyles: commonMqKeyboardStyles,
|
|
108
|
+
placeholderStyles: placeholderStyles,
|
|
109
|
+
commonMathLiveStyles: commonMathLiveStyles
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=common-styles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common-styles.js","names":["commonMqFontStyles","exports","fontFamily","longdivStyles","display","supsubStyles","placeholderStyles","borderBottom","minWidth","commonMqKeyboardStyles","_objectSpread","touchAction","fontSize","outline","commonMathLiveStyles","commonKeyboardStyles","_default"],"sources":["../../src/mf/common-styles.js"],"sourcesContent":["/**\n * Shared MathLive styling.\n *\n * Replaces @pie-lib/math-input's `common-mq-styles.js`. That file was built\n * around MathQuill's `.mq-*` class names, none of which exist in MathLive\n * output, so the selectors here target MathLive's own structure instead.\n *\n * The four named groups are kept because consumers destructure them:\n *\n * const { commonMqFontStyles, commonMqKeyboardStyles, longdivStyles, supsubStyles }\n * = mq.CommonMqStyles; // math-toolbar/src/editor-and-pad.jsx, math-preview.jsx\n *\n * Most are intentionally near-empty: MathLive sizes scripts, radicals and\n * fences correctly on its own, so the MathQuill-era corrections are not needed.\n * They stay as documented extension points rather than being deleted, so the\n * destructuring above keeps working.\n */\n\n/**\n * Font styling. MathQuill needed explicit MathJax font families to match the\n * static renderer; MathLive ships the KaTeX fonts it renders with, so this only\n * smooths rendering and lets the host override the family.\n */\nexport const commonMqFontStyles = {\n '-webkit-font-smoothing': 'antialiased',\n '& math-field': {\n fontFamily: 'inherit',\n },\n};\n\n/**\n * Long division. The MathQuill fork drew this with nested `.mq-longdiv-*`\n * elements that needed manual offsets; here it comes from the `\\longdiv` macro\n * (see `PIE_MACROS`), tagged with `data-pie-macro=\"longdiv\"`.\n */\nexport const longdivStyles = {\n '& [data-pie-macro=\"longdiv\"]': {\n display: 'inline-flex',\n },\n};\n\n/**\n * Superscript/subscript sizing. MathLive follows TeX metrics, so no overrides\n * are required.\n */\nexport const supsubStyles = {};\n\n/** Empty placeholder boxes (answer blocks / open slots). */\nexport const placeholderStyles = {\n '& .ML__placeholder': {\n borderBottom: '1px solid currentColor',\n minWidth: '1em',\n },\n};\n\n/**\n * Styling for the on-screen keyboard and any container rendering math labels.\n * Also hides MathLive's own affordances, since pie supplies its own keypad.\n */\nexport const commonMqKeyboardStyles = {\n ...commonMqFontStyles,\n ...longdivStyles,\n ...placeholderStyles,\n touchAction: 'manipulation',\n '& math-field': {\n fontSize: 'inherit',\n outline: 'none',\n },\n '& math-field::part(virtual-keyboard-toggle)': {\n display: 'none',\n },\n '& math-field::part(menu-toggle)': {\n display: 'none',\n },\n};\n\n/** Everything combined - the common case for a container of math. */\nexport const commonMathLiveStyles = {\n ...commonMqFontStyles,\n ...longdivStyles,\n ...supsubStyles,\n ...placeholderStyles,\n '& math-field': {\n fontSize: 'inherit',\n outline: 'none',\n },\n '& math-field::part(virtual-keyboard-toggle)': {\n display: 'none',\n },\n '& math-field::part(menu-toggle)': {\n display: 'none',\n },\n};\n\nexport const commonKeyboardStyles = commonMqKeyboardStyles;\n\n/**\n * Default export mirrors @pie-lib/math-input's `CommonMqStyles` object so\n * existing destructuring keeps working.\n */\nexport default {\n commonMqFontStyles,\n longdivStyles,\n supsubStyles,\n commonMqKeyboardStyles,\n placeholderStyles,\n commonMathLiveStyles,\n};\n"],"mappings":";;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,IAAMA,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChC,wBAAwB,EAAE,aAAa;EACvC,cAAc,EAAE;IACdE,UAAU,EAAE;EACd;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACO,IAAMC,aAAa,GAAAF,OAAA,CAAAE,aAAA,GAAG;EAC3B,8BAA8B,EAAE;IAC9BC,OAAO,EAAE;EACX;AACF,CAAC;;AAED;AACA;AACA;AACA;AACO,IAAMC,YAAY,GAAAJ,OAAA,CAAAI,YAAA,GAAG,CAAC,CAAC;;AAE9B;AACO,IAAMC,iBAAiB,GAAAL,OAAA,CAAAK,iBAAA,GAAG;EAC/B,oBAAoB,EAAE;IACpBC,YAAY,EAAE,wBAAwB;IACtCC,QAAQ,EAAE;EACZ;AACF,CAAC;;AAED;AACA;AACA;AACA;AACO,IAAMC,sBAAsB,GAAAR,OAAA,CAAAQ,sBAAA,GAAAC,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,KAC9BV,kBAAkB,GAClBG,aAAa,GACbG,iBAAiB;EACpBK,WAAW,EAAE,cAAc;EAC3B,cAAc,EAAE;IACdC,QAAQ,EAAE,SAAS;IACnBC,OAAO,EAAE;EACX,CAAC;EACD,6CAA6C,EAAE;IAC7CT,OAAO,EAAE;EACX,CAAC;EACD,iCAAiC,EAAE;IACjCA,OAAO,EAAE;EACX;AAAC,EACF;;AAED;AACO,IAAMU,oBAAoB,GAAAb,OAAA,CAAAa,oBAAA,GAAAJ,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,CAAAA,aAAA,KAC5BV,kBAAkB,GAClBG,aAAa,GACbE,YAAY,GACZC,iBAAiB;EACpB,cAAc,EAAE;IACdM,QAAQ,EAAE,SAAS;IACnBC,OAAO,EAAE;EACX,CAAC;EACD,6CAA6C,EAAE;IAC7CT,OAAO,EAAE;EACX,CAAC;EACD,iCAAiC,EAAE;IACjCA,OAAO,EAAE;EACX;AAAC,EACF;AAEM,IAAMW,oBAAoB,GAAAd,OAAA,CAAAc,oBAAA,GAAGN,sBAAsB;;AAE1D;AACA;AACA;AACA;AAHA,IAAAO,QAAA,GAAAf,OAAA,cAIe;EACbD,kBAAkB,EAAlBA,kBAAkB;EAClBG,aAAa,EAAbA,aAAa;EACbE,YAAY,EAAZA,YAAY;EACZI,sBAAsB,EAAtBA,sBAAsB;EACtBH,iBAAiB,EAAjBA,iBAAiB;EACjBQ,oBAAoB,EAApBA;AACF,CAAC","ignoreList":[]}
|
package/lib/mf/index.js
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
Object.defineProperty(exports, "CommonMqStyles", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _commonStyles["default"];
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "Input", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function get() {
|
|
17
|
+
return _input["default"];
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "Static", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _static["default"];
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "commonKeyboardStyles", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function get() {
|
|
29
|
+
return _commonStyles.commonKeyboardStyles;
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "commonMathLiveStyles", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _commonStyles.commonMathLiveStyles;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "commonMqFontStyles", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _commonStyles.commonMqFontStyles;
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, "commonMqKeyboardStyles", {
|
|
45
|
+
enumerable: true,
|
|
46
|
+
get: function get() {
|
|
47
|
+
return _commonStyles.commonMqKeyboardStyles;
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "longdivStyles", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function get() {
|
|
53
|
+
return _commonStyles.longdivStyles;
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
Object.defineProperty(exports, "placeholderStyles", {
|
|
57
|
+
enumerable: true,
|
|
58
|
+
get: function get() {
|
|
59
|
+
return _commonStyles.placeholderStyles;
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "supsubStyles", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function get() {
|
|
65
|
+
return _commonStyles.supsubStyles;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
var _input = _interopRequireDefault(require("./input"));
|
|
69
|
+
var _static = _interopRequireDefault(require("./static"));
|
|
70
|
+
var _commonStyles = _interopRequireWildcard(require("./common-styles"));
|
|
71
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
72
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_input","_interopRequireDefault","require","_static","_commonStyles","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof","has","get","set","_t","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor"],"sources":["../../src/mf/index.js"],"sourcesContent":["import Input from './input';\nimport Static from './static';\nimport CommonMqStyles, {\n commonMathLiveStyles,\n commonKeyboardStyles,\n commonMqFontStyles,\n commonMqKeyboardStyles,\n longdivStyles,\n supsubStyles,\n placeholderStyles,\n} from './common-styles';\n\nexport {\n Input,\n Static,\n // Same object shape as @pie-lib/math-input's `mq.CommonMqStyles`, so\n // `const { commonMqFontStyles, ... } = mq.CommonMqStyles` keeps working.\n CommonMqStyles,\n commonMathLiveStyles,\n commonKeyboardStyles,\n commonMqFontStyles,\n commonMqKeyboardStyles,\n longdivStyles,\n supsubStyles,\n placeholderStyles,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,aAAA,GAAAC,uBAAA,CAAAH,OAAA;AAQyB,SAAAG,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,wBAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,mBAAAT,CAAA,iBAAAA,CAAA,gBAAAU,OAAA,CAAAV,CAAA,0BAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,cAAAM,EAAA,IAAAd,CAAA,gBAAAc,EAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAhB,CAAA,EAAAc,EAAA,OAAAP,CAAA,IAAAD,CAAA,GAAAW,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAnB,CAAA,EAAAc,EAAA,OAAAP,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAM,EAAA,EAAAP,CAAA,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