@mathzetta/inlinemath 0.0.0-stage → 0.2.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/LICENSE +21 -0
- package/README.md +326 -2
- package/dist/cas.external.js +2 -0
- package/dist/cas.js +2 -0
- package/dist/chunks/calculate-Cz87Lt0N.js +2 -0
- package/dist/chunks/draw-Bev17BJJ.js +2 -0
- package/dist/chunks/edit-C65xXzo8.js +2 -0
- package/dist/chunks/edit-M68aRA5o.js +2 -0
- package/dist/chunks/html-BimAqn7x.js +2 -0
- package/dist/chunks/html-CupluJSh.js +2 -0
- package/dist/chunks/lite-3Fb-OHbt.js +2 -0
- package/dist/fonts/GUST-FONT-LICENSE.txt +30 -0
- package/dist/fonts/fonts.css +17 -0
- package/dist/fonts/lmroman12-italic.woff2 +0 -0
- package/dist/fonts/lmroman12-regular.woff2 +0 -0
- package/dist/inlinemath-cas.external.global.min.js +2 -0
- package/dist/inlinemath-cas.global.min.js +2 -0
- package/dist/inlinemath-lite-calc.global.min.js +2 -0
- package/dist/inlinemath-lite.external.global.min.js +2 -0
- package/dist/inlinemath-lite.global.min.js +2 -0
- package/dist/inlinemath.css +158 -0
- package/dist/inlinemath.external.global.min.js +2 -0
- package/dist/inlinemath.external.js +2 -0
- package/dist/inlinemath.global.min.js +2 -0
- package/dist/inlinemath.js +2 -0
- package/dist/lite-calc.js +2 -0
- package/dist/lite.external.js +2 -0
- package/dist/lite.js +2 -0
- package/dist/markdown.external.js +2 -0
- package/dist/markdown.js +2 -0
- package/fonts/GUST-FONT-LICENSE.txt +30 -0
- package/fonts/fonts.css +17 -0
- package/fonts/lmroman12-italic.woff2 +0 -0
- package/fonts/lmroman12-regular.woff2 +0 -0
- package/inlinemath.css +158 -0
- package/package.json +95 -4
- package/src/calculator.js +6 -0
- package/src/cas.d.ts +3 -0
- package/src/cas.js +149 -0
- package/src/draw.js +72 -0
- package/src/edit.js +96 -0
- package/src/glyphs.js +40 -0
- package/src/html.js +32 -0
- package/src/index.d.ts +3 -0
- package/src/index.js +17 -0
- package/src/layout.js +649 -0
- package/src/lite-calc.d.ts +3 -0
- package/src/lite-calc.js +15 -0
- package/src/lite.d.ts +3 -0
- package/src/lite.js +18 -0
- package/src/markdown.d.ts +3 -0
- package/src/markdown.js +676 -0
- package/src/mathzetta.js +18 -0
- package/src/select.js +108 -0
- package/src/types.d.ts +204 -0
- package/src/variables.js +228 -0
- package/src/view.js +382 -0
package/src/lite-calc.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* '@mathzetta/inlinemath/lite-calc' — the lite build with MathZetta's calculator: `{{…}}` blocks are worked out
|
|
3
|
+
* ('3+4={{3+4}}' draws 3 + 4 = 7). The same as `@mathzetta/inlinemath/lite` plus `import 'mathzetta/calculate'`;
|
|
4
|
+
* this entry exists for the bundles in dist/, which carry their own copy of MathZetta.
|
|
5
|
+
*/
|
|
6
|
+
import { calculateBlock } from './calculator.js';
|
|
7
|
+
import { toHTML as draw, treeOf as tree } from './draw.js';
|
|
8
|
+
|
|
9
|
+
export { layout, DEFAULTS } from './layout.js';
|
|
10
|
+
export { select, numberTree } from './select.js';
|
|
11
|
+
export { calculateBlock, calculate } from './calculator.js';
|
|
12
|
+
|
|
13
|
+
/** toHTML with `{{…}}` blocks calculated (`options.scope` gives their variables values). */
|
|
14
|
+
export const toHTML = (input, options = {}) => draw(input, { ...options, blocks: options.blocks ?? calculateBlock });
|
|
15
|
+
export const treeOf = (input, options = {}) => tree(input, { ...options, blocks: options.blocks ?? calculateBlock });
|
package/src/lite.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// '@mathzetta/inlinemath/lite' — the drawing only: no live view, Markdown, CAS or calculator. See types.d.ts.
|
|
2
|
+
export type { Input, Node, Target, LayoutOptions, DrawOptions } from './types.js';
|
|
3
|
+
export { toHTML, treeOf, layout, DEFAULTS, select, numberTree } from './types.js';
|
package/src/lite.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* '@mathzetta/inlinemath/lite' — Inline Math's drawing only: `toHTML()` and nothing live. The same layout,
|
|
3
|
+
* glyphs, colours, highlights and accessible (spoken) labels as the full build, without the live
|
|
4
|
+
* view (render, step animation, events), Markdown, the CAS or the calculator.
|
|
5
|
+
*
|
|
6
|
+
* import { toHTML } from '@mathzetta/inlinemath/lite';
|
|
7
|
+
* el.innerHTML = toHTML('\\int_0^1 x^2 dx');
|
|
8
|
+
*
|
|
9
|
+
* `{{…}}` blocks: load the calculator too (`import 'mathzetta/calculate'`) and they are worked out
|
|
10
|
+
* ('3+4={{3+4}}' draws 3 + 4 = 7); without it they are drawn as written. For variables in them,
|
|
11
|
+
* pass `{ blocks: calculateBlock, scope }`.
|
|
12
|
+
*
|
|
13
|
+
* Needs inlinemath.css on the page (and optionally fonts/fonts.css), like the full build.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
export { toHTML, treeOf } from './draw.js';
|
|
17
|
+
export { layout, DEFAULTS } from './layout.js';
|
|
18
|
+
export { select, numberTree } from './select.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
// '@mathzetta/inlinemath/markdown' — Markdown with maths. See types.d.ts.
|
|
2
|
+
export type { MarkdownOptions, VariableDefinition } from './types.js';
|
|
3
|
+
export { markdownToHTML, renderMarkdownInto, extractMath, renderMarkdown, createVariables, variables, Variables } from './types.js';
|