Skip to content

Commit 2d356b2

Browse files
committed
deps
1 parent 7e0ffae commit 2d356b2

12 files changed

+390
-354
lines changed

dist/mathlive.js

+14-4
Original file line numberDiff line numberDiff line change
@@ -4862,6 +4862,7 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`,
48624862
// here: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/menclose
48634863
// The second, optional, specifies the style to use for the notations.
48644864
defineFunction('enclose', '{notation:string}[style:string]{body:auto}', null, (_name, args) => {
4865+
var _a;
48654866
const result = {
48664867
type: 'enclose',
48674868
strokeColor: 'currentColor',
@@ -4922,7 +4923,7 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`,
49224923
result.strokeColor;
49234924
// Normalize the list of notations.
49244925
result.notation = {};
4925-
args[0]
4926+
((_a = args[0]) !== null && _a !== void 0 ? _a : '')
49264927
.split(/[, ]/)
49274928
.filter((v) => v.length > 0)
49284929
.forEach((x) => {
@@ -7803,7 +7804,8 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`,
78037804
*/
78047805
function makeNullFence(type, context, classes) {
78057806
return makeSpan('', 'sizing' + // @todo not useful, redundant with 'nulldelimiter'
7806-
// 'reset-' + context.size, 'size5', // @todo: that seems like a lot of resizing... do we need both?
7807+
// 'reset-' + context.size, 'size5',
7808+
// @todo: that seems like a lot of resizing... do we need both?
78077809
context.mathstyle.adjustTo(MATHSTYLES.textstyle) +
78087810
' nulldelimiter ' + // The null delimiter has a width, specified by class 'nulldelimiter'
78097811
(classes || ''), type);
@@ -13062,7 +13064,7 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`,
1306213064
return true;
1306313065
}
1306413066
function up(model, options) {
13065-
var _a;
13067+
var _a, _b;
1306613068
options = options !== null && options !== void 0 ? options : { extend: false };
1306713069
const extend = (_a = options.extend) !== null && _a !== void 0 ? _a : false;
1306813070
collapseSelectionBackward(model);
@@ -13096,11 +13098,15 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`,
1309613098
}
1309713099
else {
1309813100
model.announce('line');
13101+
if (!model.suppressChangeNotifications &&
13102+
!((_b = model.hooks) === null || _b === void 0 ? void 0 : _b.moveOut(model, 'upward'))) {
13103+
return false;
13104+
}
1309913105
}
1310013106
return true;
1310113107
}
1310213108
function down(model, options) {
13103-
var _a;
13109+
var _a, _b;
1310413110
options = options !== null && options !== void 0 ? options : { extend: false };
1310513111
const extend = (_a = options.extend) !== null && _a !== void 0 ? _a : false;
1310613112
collapseSelectionForward(model);
@@ -13135,6 +13141,10 @@ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`,
1313513141
}
1313613142
else {
1313713143
model.announce('line');
13144+
if (!model.suppressChangeNotifications &&
13145+
!((_b = model.hooks) === null || _b === void 0 ? void 0 : _b.moveOut(model, 'downward'))) {
13146+
return false;
13147+
}
1313813148
}
1313913149
return true;
1314013150
}

dist/mathlive.js.map

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mathlive.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/mathlive.min.mjs

+1-1
Large diffs are not rendered by default.

dist/mathlive.mjs

+14-4
Original file line numberDiff line numberDiff line change
@@ -4856,6 +4856,7 @@ defineFunction('c', '{:string}', {}, (_name, args) => {
48564856
// here: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/menclose
48574857
// The second, optional, specifies the style to use for the notations.
48584858
defineFunction('enclose', '{notation:string}[style:string]{body:auto}', null, (_name, args) => {
4859+
var _a;
48594860
const result = {
48604861
type: 'enclose',
48614862
strokeColor: 'currentColor',
@@ -4916,7 +4917,7 @@ defineFunction('enclose', '{notation:string}[style:string]{body:auto}', null, (_
49164917
result.strokeColor;
49174918
// Normalize the list of notations.
49184919
result.notation = {};
4919-
args[0]
4920+
((_a = args[0]) !== null && _a !== void 0 ? _a : '')
49204921
.split(/[, ]/)
49214922
.filter((v) => v.length > 0)
49224923
.forEach((x) => {
@@ -7797,7 +7798,8 @@ function makeLeftRightDelim(type, delim, height, depth, context, classes = '') {
77977798
*/
77987799
function makeNullFence(type, context, classes) {
77997800
return makeSpan('', 'sizing' + // @todo not useful, redundant with 'nulldelimiter'
7800-
// 'reset-' + context.size, 'size5', // @todo: that seems like a lot of resizing... do we need both?
7801+
// 'reset-' + context.size, 'size5',
7802+
// @todo: that seems like a lot of resizing... do we need both?
78017803
context.mathstyle.adjustTo(MATHSTYLES.textstyle) +
78027804
' nulldelimiter ' + // The null delimiter has a width, specified by class 'nulldelimiter'
78037805
(classes || ''), type);
@@ -13056,7 +13058,7 @@ function move(model, dist, options) {
1305613058
return true;
1305713059
}
1305813060
function up(model, options) {
13059-
var _a;
13061+
var _a, _b;
1306013062
options = options !== null && options !== void 0 ? options : { extend: false };
1306113063
const extend = (_a = options.extend) !== null && _a !== void 0 ? _a : false;
1306213064
collapseSelectionBackward(model);
@@ -13090,11 +13092,15 @@ function up(model, options) {
1309013092
}
1309113093
else {
1309213094
model.announce('line');
13095+
if (!model.suppressChangeNotifications &&
13096+
!((_b = model.hooks) === null || _b === void 0 ? void 0 : _b.moveOut(model, 'upward'))) {
13097+
return false;
13098+
}
1309313099
}
1309413100
return true;
1309513101
}
1309613102
function down(model, options) {
13097-
var _a;
13103+
var _a, _b;
1309813104
options = options !== null && options !== void 0 ? options : { extend: false };
1309913105
const extend = (_a = options.extend) !== null && _a !== void 0 ? _a : false;
1310013106
collapseSelectionForward(model);
@@ -13129,6 +13135,10 @@ function down(model, options) {
1312913135
}
1313013136
else {
1313113137
model.announce('line');
13138+
if (!model.suppressChangeNotifications &&
13139+
!((_b = model.hooks) === null || _b === void 0 ? void 0 : _b.moveOut(model, 'downward'))) {
13140+
return false;
13141+
}
1313213142
}
1313313143
return true;
1313413144
}

dist/mathlive.mjs.map

+1
Large diffs are not rendered by default.

dist/public/config.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -337,14 +337,14 @@ export interface MathfieldHooks {
337337
* point to leave the mathfield.
338338
*
339339
* - <var>direction</var> indicates the direction of the navigation, either
340-
* `"forward"` or `"backward"`.
340+
* `"forward"` or `"backward"` or `"upward"` or `"downward"`.
341341
*
342342
* Return `false` to prevent the move, `true` to wrap around to the
343343
* start of the field.
344344
*
345345
* By default, the insertion point will wrap around.
346346
*/
347-
onMoveOutOf?: (sender: Mathfield, direction: 'forward' | 'backward') => boolean;
347+
onMoveOutOf?: (sender: Mathfield, direction: 'forward' | 'backward' | 'upward' | 'downward') => boolean;
348348
/**
349349
* A hook invoked when pressing tab (or shift-tab) would cause the
350350
* insertion point to leave the mathfield.

examples/customization/index.html

+83-92
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
<!DOCTYPE html>
22
<html lang="en-US">
3-
<head>
4-
<meta charset="utf-8" />
5-
<title>MathLive Basic Example</title>
6-
<meta name="viewport" content="width=device-width, initial-scale=1" />
7-
<link rel="stylesheet" href="../style.css" />
8-
</head>
9-
<body>
10-
<header>
11-
<h1>MathLive Customization Example</h1>
12-
</header>
13-
<main>
14-
<textarea></textarea>
15-
<div class="mathfield" id="mf1">f(x)=</div>
16-
<div class="mathfield" id="mf2">
17-
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
18-
\prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
19-
\quad\quad \text{for $|q|<1$}
20-
</div>
21-
<div class="mathfield" id="mf3">
22-
\frac{1}{4\pi t}e^{-\frac{x^2+y^2}{4t}}
23-
</div>
24-
<!-- <div class="mathfield" id='mf3' >\begin{array}{lc}
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<title>MathLive Basic Example</title>
7+
<meta name="viewport" content="width=device-width, initial-scale=1" />
8+
<link rel="stylesheet" href="../style.css" />
9+
</head>
10+
11+
<body>
12+
<header>
13+
<h1>MathLive Customization Example</h1>
14+
</header>
15+
<main>
16+
<textarea></textarea>
17+
<div class="mathfield" id="mf1">f(x)=</div>
18+
<div class="mathfield" id="mf2">
19+
1 + \frac{q^2}{(1-q)}+\frac{q^6}{(1-q)(1-q^2)}+\cdots =
20+
\prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})},
21+
\quad\quad \text{for $|q|<1$} </div>
22+
<div class="mathfield" id="mf3">
23+
\frac{1}{4\pi t}e^{-\frac{x^2+y^2}{4t}}
24+
</div>
25+
<!-- <div class="mathfield" id='mf3' >\begin{array}{lc}
2526
\text{Given:}\
2627
& f(x)=\operatorname {li}(x)-\sum _{\rho }\operatorname {li}(x^{\rho })-\log(2)+\int _{x}^{\infty }{\frac {dt}{t(t^{2}-1)\log(t)}}\
2728
\text{with}\\
@@ -33,82 +34,72 @@ <h1>MathLive Customization Example</h1>
3334
\text{where}\\
3435
& \( \Pi _{0}(x) \) \text{is Riemann's prime counting function.}
3536
\end{array}</div> -->
36-
<div class="output" id="latex"></div>
37-
<div class="output" id="mathjson"></div>
38-
</main>
37+
<div class="output" id="latex"></div>
38+
<div class="output" id="mathjson"></div>
39+
</main>
3940

40-
<footer>
41-
<a
42-
href="https://github.com/arnog/mathlive/tree/master/examples/customization"
43-
><svg
44-
class="fa-w-24"
45-
height="24px"
46-
style="vertical-align: -3px; margin-right: 6px;"
47-
>
48-
<use xlink:href="../icons.svg#github" /></svg
49-
>View source&nbsp;<svg class="fa-w-24" height="24px">
50-
<use xlink:href="../icons.svg#angle-right" /></svg
51-
></a>
52-
<a href="../"
53-
>More examples&nbsp;<svg class="fa-w-24" height="24px">
54-
<use xlink:href="../icons.svg#angle-right" /></svg
55-
></a>
56-
<a href="/"
57-
>Return to the homepage&nbsp;<svg class="fa-w-24" height="24px">
58-
<use xlink:href="../icons.svg#angle-right" /></svg
59-
></a>
60-
</footer>
41+
<footer>
42+
<a href="https://github.com/arnog/mathlive/tree/master/examples/customization"><svg class="fa-w-24"
43+
height="24px" style="vertical-align: -3px; margin-right: 6px;">
44+
<use xlink:href="../icons.svg#github" /></svg>View source&nbsp;<svg class="fa-w-24" height="24px">
45+
<use xlink:href="../icons.svg#angle-right" /></svg></a>
46+
<a href="../">More examples&nbsp;<svg class="fa-w-24" height="24px">
47+
<use xlink:href="../icons.svg#angle-right" /></svg></a>
48+
<a href="/">Return to the homepage&nbsp;<svg class="fa-w-24" height="24px">
49+
<use xlink:href="../icons.svg#angle-right" /></svg></a>
50+
</footer>
6151

62-
<script type="module">
63-
// import MathLive from '/dist/mathlive.mjs';
64-
import MathLive from '/dist/src/mathlive.js';
52+
<script type="module">
53+
import MathLive from '/dist/mathlive.mjs';
54+
// import MathLive from 'https://unpkg.com/mathlive/dist/mathlive.min.mjs';
6555

66-
MathLive.makeMathField('mf1', {
67-
smartMode: true, // Makes text entry easier
68-
virtualKeyboardMode: 'manual', // Always show virtual keyboard glyph
69-
onContentDidChange: updateOutput,
70-
});
56+
MathLive.makeMathField('mf1', {
57+
smartMode: true, // Makes text entry easier
58+
virtualKeyboardMode: 'manual', // Always show virtual keyboard glyph
59+
onContentDidChange: updateOutput,
60+
});
7161

72-
MathLive.makeMathField('mf2', {
73-
virtualKeyboardMode: 'onfocus', // Show the virtual keyboard on focus
74-
smartMode: false,
75-
onContentDidChange: updateOutput,
76-
});
62+
MathLive.makeMathField('mf2', {
63+
virtualKeyboardMode: 'onfocus', // Show the virtual keyboard on focus
64+
smartMode: false,
65+
onContentDidChange: updateOutput,
66+
});
7767

78-
MathLive.makeMathField('mf3', {
79-
smartMode: true,
80-
onContentDidChange: updateOutput,
81-
});
68+
MathLive.makeMathField('mf3', {
69+
smartMode: true,
70+
onContentDidChange: updateOutput,
71+
});
72+
73+
function updateOutput(mf) {
74+
const latex = mf.$text();
75+
document.getElementById('latex').innerHTML = escapeHtml(latex);
8276

83-
function updateOutput(mf) {
84-
const latex = mf.$text();
85-
document.getElementById('latex').innerHTML = escapeHtml(latex);
77+
const mathJSON = MathLive.latexToAST(latex);
78+
document.getElementById('mathjson').innerHTML = escapeHtml(
79+
JSON.stringify(mathJSON)
80+
);
81+
}
8682

87-
const mathJSON = MathLive.latexToAST(latex);
88-
document.getElementById('mathjson').innerHTML = escapeHtml(
89-
JSON.stringify(mathJSON)
83+
function escapeHtml(string) {
84+
return String(string).replace(/[&<>"'`=/\u200b]/g, function (
85+
s
86+
) {
87+
return (
88+
{
89+
'&': '&amp;',
90+
'<': '&lt;',
91+
'>': '&gt;',
92+
'"': '&quot;',
93+
"'": '&#39;',
94+
'/': '&#x2F;',
95+
'`': '&#x60;',
96+
'=': '&#x3D;',
97+
'\u200b': '&amp;#zws;',
98+
}[s] || s
9099
);
91-
}
100+
});
101+
}
102+
</script>
103+
</body>
92104

93-
function escapeHtml(string) {
94-
return String(string).replace(/[&<>"'`=/\u200b]/g, function (
95-
s
96-
) {
97-
return (
98-
{
99-
'&': '&amp;',
100-
'<': '&lt;',
101-
'>': '&gt;',
102-
'"': '&quot;',
103-
"'": '&#39;',
104-
'/': '&#x2F;',
105-
'`': '&#x60;',
106-
'=': '&#x3D;',
107-
'\u200b': '&amp;#zws;',
108-
}[s] || s
109-
);
110-
});
111-
}
112-
</script>
113-
</body>
114-
</html>
105+
</html>

0 commit comments

Comments
 (0)