temml 0.11.11 → 0.12.2
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 +1 -1
- package/dist/Temml-Asana.css +28 -0
- package/dist/Temml-Latin-Modern.css +29 -1
- package/dist/Temml-Libertinus.css +28 -0
- package/dist/Temml-Local.css +28 -0
- package/dist/Temml-NotoSans.css +28 -0
- package/dist/Temml-STIX2.css +28 -0
- package/dist/temml.cjs +305 -253
- package/dist/temml.d.ts +2 -2
- package/dist/temml.js +305 -253
- package/dist/temml.min.js +1 -1
- package/dist/temml.mjs +305 -253
- package/dist/temmlPostProcess.js +1 -1
- package/package.json +1 -1
- package/src/Settings.js +3 -3
- package/src/buildMathML.js +1 -1
- package/src/canceltoArrow.svg +15 -0
- package/src/domTree.js +1 -1
- package/src/environments/array.js +7 -7
- package/src/environments/cd.js +1 -1
- package/src/functions/accent.js +3 -4
- package/src/functions/accentunder.js +2 -2
- package/src/functions/arrow.js +2 -2
- package/src/functions/cancelto.js +56 -16
- package/src/functions/color.js +1 -1
- package/src/functions/cr.js +1 -1
- package/src/functions/delimsizing.js +1 -1
- package/src/functions/enclose.js +8 -10
- package/src/functions/envTag.js +1 -1
- package/src/functions/font.js +1 -1
- package/src/functions/genfrac.js +1 -1
- package/src/functions/{horizBrace.js → horizBracket.js} +6 -6
- package/src/functions/includegraphics.js +1 -1
- package/src/functions/kern.js +1 -1
- package/src/functions/label.js +1 -1
- package/src/functions/lap.js +1 -1
- package/src/functions/mclass.js +2 -2
- package/src/functions/multiscript.js +1 -1
- package/src/functions/not.js +1 -1
- package/src/functions/op.js +2 -1
- package/src/functions/operatorname.js +1 -1
- package/src/functions/phantom.js +1 -1
- package/src/functions/raise.js +1 -1
- package/src/functions/rule.js +1 -1
- package/src/functions/sfrac.js +1 -1
- package/src/functions/smash.js +1 -1
- package/src/functions/sqrt.js +1 -1
- package/src/functions/supsub.js +6 -6
- package/src/functions/symbolsOp.js +1 -1
- package/src/functions/symbolsOrd.js +1 -1
- package/src/functions/symbolsSpacing.js +1 -1
- package/src/functions/tip.js +1 -1
- package/src/functions/toggle.js +1 -1
- package/src/functions/vcenter.js +1 -1
- package/src/functions/verb.js +1 -1
- package/src/functions.js +2 -2
- package/src/linebreaking.js +1 -1
- package/src/mathMLTree.js +1 -7
- package/src/postProcess.js +1 -1
- package/src/stretchy.js +5 -8
- package/src/units.js +1 -1
- package/src/utils.js +8 -15
package/src/functions/verb.js
CHANGED
package/src/functions.js
CHANGED
|
@@ -10,7 +10,7 @@ import "./functions/accent";
|
|
|
10
10
|
import "./functions/accentunder";
|
|
11
11
|
import "./functions/arrow";
|
|
12
12
|
import "./functions/bordermatrix"
|
|
13
|
-
|
|
13
|
+
import "./functions/cancelto";
|
|
14
14
|
import "./environments/cd";
|
|
15
15
|
import "./functions/char";
|
|
16
16
|
import "./functions/color";
|
|
@@ -23,7 +23,7 @@ import "./functions/envTag";
|
|
|
23
23
|
import "./functions/font";
|
|
24
24
|
import "./functions/genfrac";
|
|
25
25
|
import "./functions/hbox";
|
|
26
|
-
import "./functions/
|
|
26
|
+
import "./functions/horizBracket";
|
|
27
27
|
import "./functions/html";
|
|
28
28
|
import "./functions/includegraphics";
|
|
29
29
|
import "./functions/kern";
|
package/src/linebreaking.js
CHANGED
package/src/mathMLTree.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* HTML text markup respectively.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import utils from "./utils";
|
|
8
|
+
import * as utils from "./utils";
|
|
9
9
|
import { DocumentFragment } from "./tree";
|
|
10
10
|
import { createClass } from "./domTree";
|
|
11
11
|
|
|
@@ -172,9 +172,3 @@ export const wrapWithMstyle = expression => {
|
|
|
172
172
|
}
|
|
173
173
|
return node
|
|
174
174
|
}
|
|
175
|
-
|
|
176
|
-
export default {
|
|
177
|
-
MathNode,
|
|
178
|
-
TextNode,
|
|
179
|
-
newDocumentFragment
|
|
180
|
-
};
|
package/src/postProcess.js
CHANGED
package/src/stretchy.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file provides support for building horizontal stretchy elements.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import mathMLTree from "./mathMLTree"
|
|
5
|
+
import * as mathMLTree from "./mathMLTree"
|
|
6
6
|
|
|
7
7
|
// TODO: Remove when Chromium stretches \widetilde & \widehat
|
|
8
8
|
const estimatedWidth = node => {
|
|
@@ -48,6 +48,8 @@ const stretchyCodePoint = {
|
|
|
48
48
|
xrightarrow: "\u2192",
|
|
49
49
|
underbrace: "\u23df",
|
|
50
50
|
overbrace: "\u23de",
|
|
51
|
+
overbracket: "\u23b4",
|
|
52
|
+
underbracket: "\u23b5",
|
|
51
53
|
overgroup: "\u23e0",
|
|
52
54
|
overparen: "⏜",
|
|
53
55
|
undergroup: "\u23e1",
|
|
@@ -89,7 +91,7 @@ const stretchyCodePoint = {
|
|
|
89
91
|
chemequilibrium: "\u21cc"
|
|
90
92
|
}
|
|
91
93
|
|
|
92
|
-
const mathMLnode = function(label) {
|
|
94
|
+
export const mathMLnode = function(label) {
|
|
93
95
|
const child = new mathMLTree.TextNode(stretchyCodePoint[label.slice(1)])
|
|
94
96
|
const node = new mathMLTree.MathNode("mo", [child])
|
|
95
97
|
node.setAttribute("stretchy", "true")
|
|
@@ -99,7 +101,7 @@ const mathMLnode = function(label) {
|
|
|
99
101
|
const crookedWides = ["\\widetilde", "\\widehat", "\\widecheck", "\\utilde"]
|
|
100
102
|
|
|
101
103
|
// TODO: Remove when Chromium stretches \widetilde & \widehat
|
|
102
|
-
const accentNode = (group) => {
|
|
104
|
+
export const accentNode = (group) => {
|
|
103
105
|
const mo = mathMLnode(group.label)
|
|
104
106
|
if (crookedWides.includes(group.label)) {
|
|
105
107
|
const width = estimatedWidth(group.base)
|
|
@@ -113,8 +115,3 @@ const accentNode = (group) => {
|
|
|
113
115
|
}
|
|
114
116
|
return mo
|
|
115
117
|
}
|
|
116
|
-
|
|
117
|
-
export default {
|
|
118
|
-
mathMLnode,
|
|
119
|
-
accentNode
|
|
120
|
-
}
|
package/src/units.js
CHANGED
package/src/utils.js
CHANGED
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
/**
|
|
8
8
|
* Provide a default value if a setting is undefined
|
|
9
9
|
*/
|
|
10
|
-
const deflt = function(setting, defaultIfUndefined) {
|
|
10
|
+
export const deflt = function(setting, defaultIfUndefined) {
|
|
11
11
|
return setting === undefined ? defaultIfUndefined : setting;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
// hyphenate and escape adapted from Facebook's React under Apache 2 license
|
|
15
15
|
|
|
16
16
|
const uppercase = /([A-Z])/g;
|
|
17
|
-
const hyphenate = function(str) {
|
|
17
|
+
export const hyphenate = function(str) {
|
|
18
18
|
return str.replace(uppercase, "-$1").toLowerCase();
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -31,7 +31,7 @@ const ESCAPE_REGEX = /[&><"']/g;
|
|
|
31
31
|
/**
|
|
32
32
|
* Escapes text to prevent scripting attacks.
|
|
33
33
|
*/
|
|
34
|
-
function escape(text) {
|
|
34
|
+
export function escape(text) {
|
|
35
35
|
return String(text).replace(ESCAPE_REGEX, (match) => ESCAPE_LOOKUP[match]);
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -40,7 +40,7 @@ function escape(text) {
|
|
|
40
40
|
* cases, this will just be the group itself, but when ordgroups and colors have
|
|
41
41
|
* a single element, we want to pull that out.
|
|
42
42
|
*/
|
|
43
|
-
const getBaseElem = function(group) {
|
|
43
|
+
export const getBaseElem = function(group) {
|
|
44
44
|
if (group.type === "ordgroup") {
|
|
45
45
|
if (group.body.length === 1) {
|
|
46
46
|
return getBaseElem(group.body[0]);
|
|
@@ -65,7 +65,7 @@ const getBaseElem = function(group) {
|
|
|
65
65
|
* with a single character in them. To decide if something is a character box,
|
|
66
66
|
* we find its innermost group, and see if it is a single character.
|
|
67
67
|
*/
|
|
68
|
-
const isCharacterBox = function(group) {
|
|
68
|
+
export const isCharacterBox = function(group) {
|
|
69
69
|
const baseElem = getBaseElem(group);
|
|
70
70
|
|
|
71
71
|
// These are all the types of groups which hold single characters
|
|
@@ -112,16 +112,9 @@ export const protocolFromUrl = function(url) {
|
|
|
112
112
|
* 1/6551.6em with our ptPerEm = 10):
|
|
113
113
|
* http://www.ctex.org/documents/shredder/src/texbook.pdf#page=69
|
|
114
114
|
*/
|
|
115
|
-
const round = function(n) {
|
|
115
|
+
export const round = function(n) {
|
|
116
116
|
return +n.toFixed(4);
|
|
117
117
|
};
|
|
118
118
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
escape,
|
|
122
|
-
hyphenate,
|
|
123
|
-
getBaseElem,
|
|
124
|
-
isCharacterBox,
|
|
125
|
-
protocolFromUrl,
|
|
126
|
-
round
|
|
127
|
-
};
|
|
119
|
+
// Identify short letters. Used for accents and \cancelto.
|
|
120
|
+
export const smalls = "acegıȷmnopqrsuvwxyzαγεηικμνοπρςστυχωϕ𝐚𝐜𝐞𝐠𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐮𝐯𝐰𝐱𝐲𝐳"
|