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.
Files changed (62) hide show
  1. package/README.md +1 -1
  2. package/dist/Temml-Asana.css +28 -0
  3. package/dist/Temml-Latin-Modern.css +29 -1
  4. package/dist/Temml-Libertinus.css +28 -0
  5. package/dist/Temml-Local.css +28 -0
  6. package/dist/Temml-NotoSans.css +28 -0
  7. package/dist/Temml-STIX2.css +28 -0
  8. package/dist/temml.cjs +305 -253
  9. package/dist/temml.d.ts +2 -2
  10. package/dist/temml.js +305 -253
  11. package/dist/temml.min.js +1 -1
  12. package/dist/temml.mjs +305 -253
  13. package/dist/temmlPostProcess.js +1 -1
  14. package/package.json +1 -1
  15. package/src/Settings.js +3 -3
  16. package/src/buildMathML.js +1 -1
  17. package/src/canceltoArrow.svg +15 -0
  18. package/src/domTree.js +1 -1
  19. package/src/environments/array.js +7 -7
  20. package/src/environments/cd.js +1 -1
  21. package/src/functions/accent.js +3 -4
  22. package/src/functions/accentunder.js +2 -2
  23. package/src/functions/arrow.js +2 -2
  24. package/src/functions/cancelto.js +56 -16
  25. package/src/functions/color.js +1 -1
  26. package/src/functions/cr.js +1 -1
  27. package/src/functions/delimsizing.js +1 -1
  28. package/src/functions/enclose.js +8 -10
  29. package/src/functions/envTag.js +1 -1
  30. package/src/functions/font.js +1 -1
  31. package/src/functions/genfrac.js +1 -1
  32. package/src/functions/{horizBrace.js → horizBracket.js} +6 -6
  33. package/src/functions/includegraphics.js +1 -1
  34. package/src/functions/kern.js +1 -1
  35. package/src/functions/label.js +1 -1
  36. package/src/functions/lap.js +1 -1
  37. package/src/functions/mclass.js +2 -2
  38. package/src/functions/multiscript.js +1 -1
  39. package/src/functions/not.js +1 -1
  40. package/src/functions/op.js +2 -1
  41. package/src/functions/operatorname.js +1 -1
  42. package/src/functions/phantom.js +1 -1
  43. package/src/functions/raise.js +1 -1
  44. package/src/functions/rule.js +1 -1
  45. package/src/functions/sfrac.js +1 -1
  46. package/src/functions/smash.js +1 -1
  47. package/src/functions/sqrt.js +1 -1
  48. package/src/functions/supsub.js +6 -6
  49. package/src/functions/symbolsOp.js +1 -1
  50. package/src/functions/symbolsOrd.js +1 -1
  51. package/src/functions/symbolsSpacing.js +1 -1
  52. package/src/functions/tip.js +1 -1
  53. package/src/functions/toggle.js +1 -1
  54. package/src/functions/vcenter.js +1 -1
  55. package/src/functions/verb.js +1 -1
  56. package/src/functions.js +2 -2
  57. package/src/linebreaking.js +1 -1
  58. package/src/mathMLTree.js +1 -7
  59. package/src/postProcess.js +1 -1
  60. package/src/stretchy.js +5 -8
  61. package/src/units.js +1 -1
  62. package/src/utils.js +8 -15
@@ -1,5 +1,5 @@
1
1
  import defineFunction from "../defineFunction";
2
- import mathMLTree from "../mathMLTree";
2
+ import * as mathMLTree from "../mathMLTree";
3
3
  import ParseError from "../ParseError";
4
4
 
5
5
  defineFunction({
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
- //import "./functions/cancelto";
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/horizBrace";
26
+ import "./functions/horizBracket";
27
27
  import "./functions/html";
28
28
  import "./functions/includegraphics";
29
29
  import "./functions/kern";
@@ -1,4 +1,4 @@
1
- import mathMLTree from "./mathMLTree"
1
+ import * as mathMLTree from "./mathMLTree"
2
2
  import { DocumentFragment } from "./tree"
3
3
 
4
4
  /*
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
- };
@@ -5,7 +5,7 @@
5
5
  * https://mit-license.org/
6
6
  */
7
7
 
8
- export const version = "0.11.11";
8
+ export const version = "0.12.02";
9
9
 
10
10
  export function postProcess(block) {
11
11
  const labelMap = {}
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
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  import ParseError from "./ParseError"
7
- import utils from "./utils"
7
+ import * as utils from "./utils"
8
8
 
9
9
  const ptPerUnit = {
10
10
  // Convert to CSS (Postscipt) points, not TeX points
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
- export default {
120
- deflt,
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αγεηικμνοπρςστυχωϕ𝐚𝐜𝐞𝐠𝐦𝐧𝐨𝐩𝐪𝐫𝐬𝐮𝐯𝐰𝐱𝐲𝐳"