rapier-math 2.4.0 → 2.4.1
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/index.mjs +1 -1
- package/dist/rapier-math.js +9 -9
- package/docs/math-components.json +6 -6
- package/docs/math-resources.json +10 -10
- package/package.json +1 -1
- package/src/math/classic.js +1 -1
- package/src/math/parser.js +8 -8
- package/src/tools/build-math.mjs +1 -1
- package/tests/check.mjs +1 -0
package/README.md
CHANGED
|
@@ -48,4 +48,4 @@ licensed under the GUST Font License. [LICENSE](LICENSE) contains both complete
|
|
|
48
48
|
[Component provenance](docs/math-components.json) and [source hashes](docs/math-resources.json)
|
|
49
49
|
travel with the package.
|
|
50
50
|
|
|
51
|
-
Version 2.4.
|
|
51
|
+
Version 2.4.1. Classic payload: 691650 bytes; gzip (level 9): 405505 bytes.
|
package/dist/index.mjs
CHANGED
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
import {parseMathTex as parse} from '../src/math/parser.js';
|
|
3
3
|
import {renderMath as render, mathRenderToString as renderToString} from '../src/math/api.js';
|
|
4
4
|
import {mathFit as fit, mathObserve as observe} from '../src/math/browser.js';
|
|
5
|
-
const version = "2.4.
|
|
5
|
+
const version = "2.4.1";
|
|
6
6
|
export {version, parse, render, renderToString, fit, observe};
|
|
7
7
|
export default Object.freeze({version, parse, render, renderToString, fit, observe});
|
package/dist/rapier-math.js
CHANGED
|
@@ -1795,6 +1795,14 @@ class MathTexParser {
|
|
|
1795
1795
|
return this.row([base, ...(/^(divergence|curl)$/.test(name) ? [this.literal(name === 'curl' ? '×' : '⋅', {class: 'bin', variant: 'roman'})] : []), ...(this.is('{') ? [this.argument()] : [])]);
|
|
1796
1796
|
}
|
|
1797
1797
|
if (['Tr', 'tr', 'trace', 'rank', 'diag', 'Res'].includes(name)) return this.node('text', {value: name === 'trace' ? 'tr' : name, variant: 'roman', class: 'op', limits: 'never'});
|
|
1798
|
+
if (name === 'qty' || name === 'quantity') {
|
|
1799
|
+
if (this.is('{')) return this.node('fence', {left: '{', right: '}', body: this.argument()});
|
|
1800
|
+
const left = this.readDelimiter(), right = {'(': ')', '[': ']', '{': '}', '|': '|', '‖': '‖', '⟨': '⟩'}[left];
|
|
1801
|
+
if (!right) this.error('invalid-delimiter', 'A quantity needs paired delimiters.', token);
|
|
1802
|
+
const body = this.nested(() => this.parseRow(item => item.kind === 'char' && item.value === right));
|
|
1803
|
+
this.expect(right);
|
|
1804
|
+
return this.node('fence', {left, right, body});
|
|
1805
|
+
}
|
|
1798
1806
|
// \qq{text} and the \qif family: text between quads; \qc is a comma and a quad.
|
|
1799
1807
|
if (/^q/.test(name)) {
|
|
1800
1808
|
const quad = () => this.node('space', {width: 1}), words = {qcc: 'c.c.'};
|
|
@@ -1807,14 +1815,6 @@ class MathTexParser {
|
|
|
1807
1815
|
const env = name === 'bmqty' ? 'bmatrix' : name === 'vmqty' ? 'vmatrix' : name === 'smqty' ? 'smallmatrix' : name === 'pmqty' ? 'pmatrix' : 'matrix';
|
|
1808
1816
|
return this.tableFromTokens(this.rawArgument(), env);
|
|
1809
1817
|
}
|
|
1810
|
-
if (name === 'qty' || name === 'quantity') {
|
|
1811
|
-
if (this.is('{')) return this.node('fence', {left: '(', right: ')', body: this.argument()});
|
|
1812
|
-
const left = this.readDelimiter(), right = {'(': ')', '[': ']', '{': '}', '|': '|', '‖': '‖', '⟨': '⟩'}[left];
|
|
1813
|
-
if (!right) this.error('invalid-delimiter', 'A quantity needs paired delimiters.', token);
|
|
1814
|
-
const body = this.nested(() => this.parseRow(item => item.kind === 'char' && item.value === right));
|
|
1815
|
-
this.expect(right);
|
|
1816
|
-
return this.node('fence', {left, right, body});
|
|
1817
|
-
}
|
|
1818
1818
|
const first = this.argument();
|
|
1819
1819
|
if (/^(bra|ket|pqty|bqty|Bqty|vqty|abs|absolutevalue|norm)$/.test(name)) {
|
|
1820
1820
|
const ends = {bra: ['⟨', '|'], ket: ['|', '⟩'], pqty: ['(', ')'], bqty: ['[', ']'], Bqty: ['{', '}'], vqty: ['|', '|'], abs: ['|', '|'], absolutevalue: ['|', '|'], norm: ['‖', '‖']}[name];
|
|
@@ -3897,7 +3897,7 @@ function mathRenderWithMathML(source, options = {}) {
|
|
|
3897
3897
|
|
|
3898
3898
|
// SPDX-License-Identifier: MIT
|
|
3899
3899
|
globalThis.RapierMath=Object.freeze({
|
|
3900
|
-
version:'2.
|
|
3900
|
+
version:'2.4.1', parse:parseMathTex,
|
|
3901
3901
|
render:renderMath, renderToString:mathRenderToString,
|
|
3902
3902
|
fit:mathFit, observe:mathObserve,
|
|
3903
3903
|
toMathML:mathToMathML, renderWithMathML:mathRenderWithMathML,
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"spdxVersion": "SPDX-2.3",
|
|
3
3
|
"dataLicense": "CC0-1.0",
|
|
4
4
|
"SPDXID": "SPDXRef-DOCUMENT",
|
|
5
|
-
"name": "rapier-math-2.4.
|
|
6
|
-
"documentNamespace": "https://rapier.website/spdx/rapier-math-2.4.
|
|
5
|
+
"name": "rapier-math-2.4.1",
|
|
6
|
+
"documentNamespace": "https://rapier.website/spdx/rapier-math-2.4.1-7a77ad33427f039d17bfd06bd7ebede8e31ec4d5734f4ab42296712b8fa723be",
|
|
7
7
|
"creationInfo": {
|
|
8
|
-
"created": "2026-10-
|
|
8
|
+
"created": "2026-10-16T00:15:00.000Z",
|
|
9
9
|
"creators": [
|
|
10
10
|
"Tool: rapier-math-components",
|
|
11
11
|
"Organization: rapier.website"
|
|
@@ -15,17 +15,17 @@
|
|
|
15
15
|
{
|
|
16
16
|
"name": "rapier-math",
|
|
17
17
|
"SPDXID": "SPDXRef-rapier-math",
|
|
18
|
-
"versionInfo": "2.4.
|
|
18
|
+
"versionInfo": "2.4.1",
|
|
19
19
|
"downloadLocation": "NOASSERTION",
|
|
20
20
|
"filesAnalyzed": false,
|
|
21
21
|
"licenseConcluded": "MIT AND LicenseRef-GUST-Font-License",
|
|
22
22
|
"licenseDeclared": "MIT AND LicenseRef-GUST-Font-License",
|
|
23
23
|
"copyrightText": "NOASSERTION",
|
|
24
|
-
"sourceInfo": "Verified current build inputs: math-resources.json (SHA-256
|
|
24
|
+
"sourceInfo": "Verified current build inputs: math-resources.json (SHA-256 0d4a67615eaedaa5c913509cab9168f564d4228a86dd8ecd3ce14fed99d679ea).",
|
|
25
25
|
"checksums": [
|
|
26
26
|
{
|
|
27
27
|
"algorithm": "SHA256",
|
|
28
|
-
"checksumValue": "
|
|
28
|
+
"checksumValue": "7a77ad33427f039d17bfd06bd7ebede8e31ec4d5734f4ab42296712b8fa723be"
|
|
29
29
|
}
|
|
30
30
|
]
|
|
31
31
|
},
|
package/docs/math-resources.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
-
"bundle": "rapier-math-2.4.
|
|
2
|
+
"bundle": "rapier-math-2.4.1.js",
|
|
3
3
|
"packageBundle": "dist/rapier-math.js",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.1",
|
|
5
5
|
"license": "MIT AND LicenseRef-GUST-Font-License",
|
|
6
6
|
"bytes": 691650,
|
|
7
|
-
"gzipBytes":
|
|
8
|
-
"sha256": "
|
|
9
|
-
"sha384": "
|
|
7
|
+
"gzipBytes": 405505,
|
|
8
|
+
"sha256": "7a77ad33427f039d17bfd06bd7ebede8e31ec4d5734f4ab42296712b8fa723be",
|
|
9
|
+
"sha384": "xYr9WOgmolJEla0EhbjXh57d5/ea/D1RF/j8IED8833Ywuj5Bmasl68y98wKYLKH",
|
|
10
10
|
"sources": [
|
|
11
11
|
{
|
|
12
12
|
"file": "math/font.js",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"file": "math/parser.js",
|
|
25
25
|
"packageFile": "src/math/parser.js",
|
|
26
26
|
"bytes": 99002,
|
|
27
|
-
"sha256": "
|
|
27
|
+
"sha256": "112bd3308c9ac2d571345c927bfd92b1152cf11a4379be65d93fde63636ae56c"
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
"file": "math/source.js",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"file": "math/classic.js",
|
|
91
91
|
"packageFile": "src/math/classic.js",
|
|
92
92
|
"bytes": 269,
|
|
93
|
-
"sha256": "
|
|
93
|
+
"sha256": "8761a574d100b3b52a6ba0d3088279c50025527b0c87eb5c40cf16400f48d2d7"
|
|
94
94
|
}
|
|
95
95
|
],
|
|
96
96
|
"recipe": [
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"file": "tools/build-math.mjs",
|
|
123
123
|
"packageFile": "src/tools/build-math.mjs",
|
|
124
124
|
"bytes": 9604,
|
|
125
|
-
"sha256": "
|
|
125
|
+
"sha256": "db22abcbff9384c1e1e26a2dd680940c9a5a5c2649ea9655a84ed45f1d1ed233"
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
"file": "math/LICENSE-MIT",
|
|
@@ -151,8 +151,8 @@
|
|
|
151
151
|
{
|
|
152
152
|
"file": "math/package-check.mjs",
|
|
153
153
|
"packageFile": "tests/check.mjs",
|
|
154
|
-
"bytes":
|
|
155
|
-
"sha256": "
|
|
154
|
+
"bytes": 8742,
|
|
155
|
+
"sha256": "25e06cb2b28a6fd404e624c22c8acefe41e988fe9383c91155c820e197cb54a8"
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
"file": "math/package-readme.mjs",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rapier-math",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
4
4
|
"description": "Self-contained offline LaTeX-to-SVG rendering with Latin Modern outlines, optional Markdown integrations and streaming helpers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.mjs",
|
package/src/math/classic.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: MIT
|
|
2
2
|
globalThis.RapierMath=Object.freeze({
|
|
3
|
-
version:'2.
|
|
3
|
+
version:'2.4.1', parse:parseMathTex,
|
|
4
4
|
render:renderMath, renderToString:mathRenderToString,
|
|
5
5
|
fit:mathFit, observe:mathObserve,
|
|
6
6
|
toMathML:mathToMathML, renderWithMathML:mathRenderWithMathML,
|
package/src/math/parser.js
CHANGED
|
@@ -1080,6 +1080,14 @@ class MathTexParser {
|
|
|
1080
1080
|
return this.row([base, ...(/^(divergence|curl)$/.test(name) ? [this.literal(name === 'curl' ? '×' : '⋅', {class: 'bin', variant: 'roman'})] : []), ...(this.is('{') ? [this.argument()] : [])]);
|
|
1081
1081
|
}
|
|
1082
1082
|
if (['Tr', 'tr', 'trace', 'rank', 'diag', 'Res'].includes(name)) return this.node('text', {value: name === 'trace' ? 'tr' : name, variant: 'roman', class: 'op', limits: 'never'});
|
|
1083
|
+
if (name === 'qty' || name === 'quantity') {
|
|
1084
|
+
if (this.is('{')) return this.node('fence', {left: '{', right: '}', body: this.argument()});
|
|
1085
|
+
const left = this.readDelimiter(), right = {'(': ')', '[': ']', '{': '}', '|': '|', '‖': '‖', '⟨': '⟩'}[left];
|
|
1086
|
+
if (!right) this.error('invalid-delimiter', 'A quantity needs paired delimiters.', token);
|
|
1087
|
+
const body = this.nested(() => this.parseRow(item => item.kind === 'char' && item.value === right));
|
|
1088
|
+
this.expect(right);
|
|
1089
|
+
return this.node('fence', {left, right, body});
|
|
1090
|
+
}
|
|
1083
1091
|
// \qq{text} and the \qif family: text between quads; \qc is a comma and a quad.
|
|
1084
1092
|
if (/^q/.test(name)) {
|
|
1085
1093
|
const quad = () => this.node('space', {width: 1}), words = {qcc: 'c.c.'};
|
|
@@ -1092,14 +1100,6 @@ class MathTexParser {
|
|
|
1092
1100
|
const env = name === 'bmqty' ? 'bmatrix' : name === 'vmqty' ? 'vmatrix' : name === 'smqty' ? 'smallmatrix' : name === 'pmqty' ? 'pmatrix' : 'matrix';
|
|
1093
1101
|
return this.tableFromTokens(this.rawArgument(), env);
|
|
1094
1102
|
}
|
|
1095
|
-
if (name === 'qty' || name === 'quantity') {
|
|
1096
|
-
if (this.is('{')) return this.node('fence', {left: '(', right: ')', body: this.argument()});
|
|
1097
|
-
const left = this.readDelimiter(), right = {'(': ')', '[': ']', '{': '}', '|': '|', '‖': '‖', '⟨': '⟩'}[left];
|
|
1098
|
-
if (!right) this.error('invalid-delimiter', 'A quantity needs paired delimiters.', token);
|
|
1099
|
-
const body = this.nested(() => this.parseRow(item => item.kind === 'char' && item.value === right));
|
|
1100
|
-
this.expect(right);
|
|
1101
|
-
return this.node('fence', {left, right, body});
|
|
1102
|
-
}
|
|
1103
1103
|
const first = this.argument();
|
|
1104
1104
|
if (/^(bra|ket|pqty|bqty|Bqty|vqty|abs|absolutevalue|norm)$/.test(name)) {
|
|
1105
1105
|
const ends = {bra: ['⟨', '|'], ket: ['|', '⟩'], pqty: ['(', ')'], bqty: ['[', ']'], Bqty: ['{', '}'], vqty: ['|', '|'], abs: ['|', '|'], absolutevalue: ['|', '|'], norm: ['‖', '‖']}[name];
|
package/src/tools/build-math.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {mathModules, mathClassicSource} from '../math/package-build.mjs';
|
|
|
12
12
|
import {mathReadme} from '../math/package-readme.mjs';
|
|
13
13
|
|
|
14
14
|
const ROOT = resolve(dirname(fileURLToPath(import.meta.url)), '..');
|
|
15
|
-
export const MATH_VERSION = '2.4.
|
|
15
|
+
export const MATH_VERSION = '2.4.1';
|
|
16
16
|
export const MATH_BUNDLE = 'rapier-math-' + MATH_VERSION + '.js';
|
|
17
17
|
export const MATH_SOURCES = ['font.js', 'symbols.js', 'parser.js', 'source.js', 'variants.js', 'layout.js', 'fallbacks.js', 'responsive.js', 'api.js', 'browser.js', 'mathml.js', 'semantic-api.js', 'combined.js', 'classic.js'].map(name => 'math/' + name);
|
|
18
18
|
export const MATH_RECIPE = ['math/build-font.py', 'math/FONT-SOURCE.md', 'math/FONT-LICENSE.txt', 'math/package-verify.mjs', 'tools/build-math.mjs', 'math/LICENSE-MIT', 'math/adoption-verify.mjs', 'math/package-build.mjs', 'math/package-layout.mjs', 'math/package-check.mjs', 'math/package-readme.mjs', 'math/README.md', 'math/SEMANTICS.md', 'math/semantic-verify.mjs', 'math/typeset-verify.mjs'];
|
package/tests/check.mjs
CHANGED
|
@@ -55,6 +55,7 @@ assert(Object.isFrozen(module.default));
|
|
|
55
55
|
const context = createContext({atob, URL});
|
|
56
56
|
new Script(classicSource, {filename: resources.bundle}).runInContext(context);
|
|
57
57
|
const classic = context.RapierMath;
|
|
58
|
+
assert.equal(classic.version, pkg.version, 'classic/package release identity');
|
|
58
59
|
const plain = value => JSON.parse(JSON.stringify(value));
|
|
59
60
|
const unescape = text => text.replace(/&(amp|lt|gt|quot|apos|#\d+|#x[\da-f]+);/gi, (_, entity) =>
|
|
60
61
|
entity[0] === '#' ? String.fromCodePoint(entity[1] === 'x' ? parseInt(entity.slice(2), 16) : Number(entity.slice(1))) :
|