Comparing version 0.98.4 to 0.98.5
@@ -1,2 +0,2 @@ | ||
/* 0.98.4 */ import type { Keys } from './types-utils'; | ||
/* 0.98.5 */ import type { Keys } from './types-utils'; | ||
import type { ParseMode, Style, TabularEnvironment } from './core-types'; | ||
@@ -3,0 +3,0 @@ import type { InsertOptions, Mathfield, Model } from './mathfield'; |
@@ -1,2 +0,2 @@ | ||
/* 0.98.4 */ export type MathstyleName = 'displaystyle' | 'textstyle' | 'scriptstyle' | 'scriptscriptstyle'; | ||
/* 0.98.5 */ export type MathstyleName = 'displaystyle' | 'textstyle' | 'scriptstyle' | 'scriptscriptstyle'; | ||
export type NormalizedMacroDictionary = Record<string, MacroDefinition>; | ||
@@ -3,0 +3,0 @@ export type ArgumentType = ParseMode | ('bbox' | 'colspec' | 'delim' | 'value' | 'rest' | 'string' | 'balanced-string' | 'expression' | 'auto'); |
@@ -1,2 +0,2 @@ | ||
/* 0.98.4 */ import type { Selector } from './commands'; | ||
/* 0.98.5 */ import type { Selector } from './commands'; | ||
import type { LatexSyntaxError, MacroDictionary, ParseMode, Registers, Style } from './core-types'; | ||
@@ -681,2 +681,6 @@ import type { InsertOptions, OutputFormat, Offset, Range, Selection, Mathfield } from './mathfield'; | ||
private static _computeEngine; | ||
/** @internal */ | ||
private static _isFunction; | ||
static get isFunction(): (command: string) => boolean; | ||
static set isFunction(value: (command: string) => boolean); | ||
static loadSound(sound: 'plonk' | 'keypress' | 'spacebar' | 'delete' | 'return'): Promise<void>; | ||
@@ -683,0 +687,0 @@ static playSound(name: 'keypress' | 'spacebar' | 'delete' | 'plonk' | 'return'): Promise<void>; |
@@ -1,2 +0,2 @@ | ||
/* 0.98.4 */ import type { Selector } from './commands'; | ||
/* 0.98.5 */ import type { Selector } from './commands'; | ||
import type { ParseMode, Style } from './core-types'; | ||
@@ -3,0 +3,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
/* 0.98.4 */ /** | ||
/* 0.98.5 */ /** | ||
* Server-side rendering exports. | ||
@@ -82,4 +82,30 @@ * | ||
export declare function convertLatexToSpeakableText(latex: string): string; | ||
/** | ||
* Convert a MathJSON expression to a LaTeX string. | ||
* | ||
* ```js | ||
* convertMathJsonToLatex(["Add", 1, 2]); | ||
* // -> "1 + 2" | ||
* ``` | ||
* @category Converting | ||
*/ | ||
export declare function convertMathJsonToLatex(json: Expression): string; | ||
/** Convert a LaTeX string to a string of AsciiMath. | ||
* | ||
* ```js | ||
* convertLatexToAsciiMath("\\frac{1}{2}"); | ||
* // -> "1/2" | ||
* ``` | ||
* @category Converting | ||
*/ | ||
export declare function convertLatexToAsciiMath(latex: string, parseMode?: ParseMode): string; | ||
/** | ||
* Convert an AsciiMath string to a LaTeX string. | ||
* | ||
* ```js | ||
* convertAsciiMathToLatex("1/2"); | ||
* // -> "\\frac{1}{2}" | ||
* ``` | ||
* @category Converting | ||
*/ | ||
export declare function convertAsciiMathToLatex(ascii: string): string; |
@@ -1,16 +0,24 @@ | ||
/* 0.98.4 */ /** | ||
/* 0.98.5 */ /** | ||
* | ||
* Use MathLive to render and edit mathematical formulas. | ||
* Importing this package in a web page will make the `<math-field>` custom | ||
* element available. Use it as a drop-in replacement for `<textarea>` or | ||
* `<input type="text">` to allow the user to type and edit mathematical | ||
* expressions. | ||
* | ||
* | ||
* @example | ||
* <script type="module"> | ||
* // Load the `MathLive` module from a CDN | ||
* import { convertLatexToSpeakableText } from 'https://unpkg.com/mathlive?module'; | ||
* | ||
* console.log(convertLatexToSpeakableText('e^{i\\pi}+1=0')); | ||
* ```html | ||
* <script src="https://unpkg.com/mathlive"></script> | ||
* <math-field>\frac{1}{2}</math-field> | ||
* <script> | ||
* const mf = document.querySelector('math-field'); | ||
* mf.addEventListener('input', (ev) => { | ||
* console.log('New value:', mf.value); | ||
* }); | ||
* </script> | ||
* ``` | ||
* | ||
* @packageDocumentation MathLive SDK Reference 0.98.4 | ||
* @version 0.98.4 | ||
* @packageDocumentation MathLive SDK Reference | ||
* @version 0.98.5 | ||
* | ||
@@ -17,0 +25,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
/* 0.98.4 */ import type { Mathfield, Range } from './mathfield'; | ||
/* 0.98.5 */ import type { Mathfield, Range } from './mathfield'; | ||
import type { Selector } from './commands'; | ||
@@ -345,9 +345,20 @@ import type { ParseMode, MacroDictionary, Registers } from './core-types'; | ||
/** | ||
* Return true if the latex command is a function that could take | ||
* implicit arguments. By default, this includes trigonometric function, | ||
* so `\sin x` is interpreted as `\sin(x)`. | ||
* | ||
* This affects editing, for example how the `/` key is interpreted after | ||
* such as symbol. | ||
* | ||
*/ | ||
isImplicitFunction: (name: string) => boolean; | ||
/** | ||
* The LaTeX string to insert when the spacebar is pressed (on the physical or | ||
* virtual keyboard). | ||
* | ||
* Use `"\;"` for a thick space, `"\:"` for a medium space, `"\,"` for a thin space. | ||
* Use `"\;"` for a thick space, `"\:"` for a medium space, `"\,"` for a | ||
* thin space. | ||
* | ||
* Do not use `" "` (a regular space), as whitespace is skipped by LaTeX so this | ||
* will do nothing. | ||
* Do not use `" "` (a regular space), as whitespace is skipped by LaTeX | ||
* so this will do nothing. | ||
* | ||
@@ -397,11 +408,10 @@ * **Default**: `""` (empty string) | ||
```javascript | ||
mf.setConfig({ | ||
macros: { | ||
...mf.getOption('macros'), | ||
smallfrac: '^{#1}\\!\\!/\\!_{#2}', | ||
}, | ||
}); | ||
mf.macros = { | ||
...mf.macros, | ||
smallfrac: '^{#1}\\!\\!/\\!_{#2}', | ||
}; | ||
``` | ||
* | ||
* Note that `getOption()` is called to keep the existing macros and add to them. | ||
* Note that `...mf.macros` is used to keep the existing macros and add to | ||
* them. | ||
* Otherwise, all the macros are replaced with the new definition. | ||
@@ -408,0 +418,0 @@ * |
@@ -1,2 +0,2 @@ | ||
/* 0.98.4 */ /** | ||
/* 0.98.5 */ /** | ||
* @internal | ||
@@ -3,0 +3,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
/* 0.98.4 */ export type KeyboardModifiers = { | ||
/* 0.98.5 */ export type KeyboardModifiers = { | ||
alt: boolean; | ||
@@ -3,0 +3,0 @@ control: boolean; |
@@ -1,2 +0,2 @@ | ||
/* 0.98.4 */ import type { KeyboardModifiers } from './ui-events-types'; | ||
/* 0.98.5 */ import type { KeyboardModifiers } from './ui-events-types'; | ||
/** | ||
@@ -3,0 +3,0 @@ * The type of a menu item: |
@@ -1,2 +0,2 @@ | ||
/* 0.98.4 */ import type { Selector } from './commands'; | ||
/* 0.98.5 */ import type { Selector } from './commands'; | ||
import type { ParseMode, Style } from './core-types'; | ||
@@ -3,0 +3,0 @@ import type { OriginValidator } from './options'; |
{ | ||
"name": "mathlive", | ||
"version": "0.98.4", | ||
"version": "0.98.5", | ||
"description": "A web component for math input", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -52,13 +52,16 @@ <div align="center"> | ||
Using MathLive is easy! Simply add a `<math-field>` tag to your page, and it | ||
works just like a `<textarea>` or `<button>` element. You can manipulate the | ||
mathfield using methods of the element and listen for events to be notified when | ||
its internal state changes. | ||
Using MathLive is easy! Simply add a `<math-field>` tag to your page. It | ||
initializes automatically and works just like a `<textarea>` or `<button>` | ||
element. You can manipulate the mathfield using methods of the element and | ||
listen for events to be notified when its internal state changes. | ||
`npm install mathlive` | ||
```javascript | ||
import 'mathlive'; | ||
``` | ||
```html | ||
<!DOCTYPE html> | ||
<html lang="en-US"> | ||
<head> | ||
<script src="https://unpkg.com/mathlive"></script> | ||
</head> | ||
<body> | ||
@@ -70,2 +73,12 @@ <math-field>f(x)=</math-field> | ||
You can also add it using CDN | ||
```html | ||
<head> | ||
<script src="https://unpkg.com/mathlive"></script> | ||
</head> | ||
``` | ||
Check documentation for [React](https://cortexjs.io/mathlive/guides/react/) and | ||
[interaction with Mathfield](https://cortexjs.io/mathlive/guides/interacting/). | ||
## 📖 Documentation | ||
@@ -97,3 +110,2 @@ | ||
- Join our [Discord server](https://discord.gg/yhmvVeJ4Hd) | ||
- Join our [Gitter forum](https://cortexjs.io/gitter/) | ||
- Drop a line to [arno@arno.org](arno@arno.org) | ||
@@ -100,0 +112,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5308278
98860
113