New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mathlive

Package Overview
Dependencies
Maintainers
1
Versions
176
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathlive - npm Package Versions

1
18

0.69.5

Diff

Changelog

Source

0.69.5 2021-08-05

Improvements

  • When using keybindings or virtual keyboard keys, insert the content in the current math style, rather than forcing display style.

  • Correctly handle loading MathLive in a non-browser context (e.g. Node)

  • Updated localization strings

arnog
published 0.69.4 •

Changelog

Source

0.69.4 2021-06-22

Improvements

  • Updated to ComputeEngine 0.4.2 for better parsing of LaTeX.
  • When copying or cutting to the clipboard, if the MathJSON parsing fails, ignore the MathJSON and fallback to LaTeX. Previously, if there was a failure during parsing an empty MathJSON expression would be put on the clipboard, which result in subsequent attempts at pasting the content into a mathfield to fail.
  • Updated various localizations (contributed by @physedo).
arnog
published 0.69.3 •

Changelog

Source

0.69.3 2021-06-10

Improvements

  • Added localization for Irish (contributed by @physedo).

Issues Resolved

  • #1000 When serializing subscripts and superscripts, serialize the subscript first: \int_0^{\infty} instead of \int^{\infty}_0.
  • In some page layouts, the virtual keyboard could be displayed at an incorrect location, or scroll with the page.
arnog
published 0.69.2 •

arnog
published 0.69.1 •

Changelog

Source

0.69.1 2021-06-09

Improvements

  • Attempt to fix installation of the npm package on some Windows configurations
arnog
published 0.69.0 •

Changelog

Source

0.69.0 2021-06-09

Breaking Changes

  • This release requires TypeScript 4.3 or later (the API uses asymmetric getters/setters). If you are using VSCode, you may need to change the version of TypeScript used by the editor for language services (syntax checking). To do so, with a TypeScript file open, click the Typescript version in the bottom bar, then choose "Select TypeScript Version", then "Use Workspace Version" (see https://code.visualstudio.com/docs/typescript/typescript-compiling#_using-newer-typescript-versions)

  • All the default imports have been removed. Instead of

import MathLive from 'mathlive';
MathLive.renderMathInDocument();

use:

import { renderMathInDocument } from 'mathlive';
renderMathInDocument();

If you are not calling a specific MathLive function and just need to use the <math-field> tag, use:

import from 'mathlive';
  • The following deprecated functions have been removed: latexToMathML()convertLatexToMathMl(), latexToSpeakableTextconvertLatexToSpeakableText, latexToMarkup()convertLatexToMarkup(),
  • The deprecated revertToOriginalContent functionality has been removed.
  • The deprecated overrideDefaultInlineShortcuts property has been removed. Instead, use:
mf.setConfig('inlineShortcuts', {
  ...mf.getConfig('inlineShortcuts'),
  ...newShortcuts,
});
  • The following MathField functions have been removed: $setConfig()setOptions(), getConfig()getOptions(), $perform()executeCommand(), $text()getValue(), $selectedText()getValue(), $selectionIsCollapsed(), $selectionDepth(), $selectionAtStart(), $selectionAtEnd(), $latex()getValue()andsetValue(), $el, $insert()insert(), $hasFocus()hasFocus(), $focus()focus(), $blur()blur(), $select()select(), $clearSelection()executeCommand('delete-backward'), $applyStyle()applyStyle(), $keystroke(), $typedText()

  • The makeMathField() function has been removed. Use new MathfieldElement() or the <math-field> tag instead:

// Before
let mf = MathLive.makeMathField(document.createElement('div'), {
  virtualKeyboardMode: 'manual',
});
mf.$latex('f(x) = \\sin x');
document.body.appendChild(mf.$el());

// After
let mfe = new MathfieldElement({
  virtualKeyboardMode: 'manual',
});
mfe.value = 'f(x) = \\sin x';
document.body.appendChild(mfe);

or:

<math-field virtual-keyboard-mode="manual">f(x) = \sin x</math-field>

Improvements

  • Added localization for Dutch (contributed by @harrisnl), Bosnian, Croatian, Czeck, Danish, Estonian, Finnish, Icelandic, Norwegian, Portuguese, Serbian, Slovak, Slovenian, Swedish, Turkish (contributed by @physedo).
  • The selection can now be set using an offset, i.e. mf.selection = 0 instead of mf.selection = { ranges:[[0, 0]] }.
  • Map \cdot to "times" in spoken-text format.
  • #994 When using virtualKeyboardContainer, the virtual keyboard is now displayed inside the container. The container should have a position of relative.
  • When replacing a placeholder with a LaTeX command in LaTeX mode (by pressing the \ key), remove the \placeholder{} command.
  • In spoken text, correctly handle \mathop and \operatorname.

New Features

  • The getOffsetDepth() method can be used to query the depth of a specific offset. Use mf.getOffsetDepth(mf.position) for the depth of the current position.
  • the onExport() hook provides an opportunity to customize the format exported to the Clipboard.

Issues Resolved

  • Actually change the keyboard toggle glyph when changed with setOptions
  • Reparse the formula when the macros dictionary is updated
  • #971 In some browsers, when mathfield elements are contained in a container with overflow: scroll, the dimensions of the viewport would be incorrectly affected.
  • #974 With non-US keyboard layout, always map the "/" key to a fraction.
arnog
published 0.68.1 •

Changelog

Source

0.68.1 2021-06-02

Improvements

  • Keybindings: keybindings can now be associated with specific keyboard layouts. By default, the keybindings that are specific to the US keyboard layout are no longer applied with other keyboard layouts. This makes it easier to use punctuation with some keyboard layouts and prevent some error messages from being thrown (addresses #962).

  • MathML: improved MathML output, especially for formulas with unbalanced delimiters

Issues Resolved

  • #969 and #967 Changed the way the build is done so that MathLive does not use MathJSON as a submodule but as a regular npm dependency, and builds correctly even in non-git environments.
  • #968 navigating with arrow keys cannot navigate past a macro
arnog
published 0.68.0 •

Changelog

Source

0.68.0 2021-05-31

Breaking Changes

#500 MathJSON support. The legacy MASTON/JSON format has been removed.
The MathJSON format is now integrated into MathLive 🚀 🎆 🥳

To get the MathJSON representation of a formula, use mf.getValue('math-json').

The latexToAST() and astToLatex() functions have been replaced by parseMathJson() and serializeMathJson().

import { parseMathJson, serializeMathJson } from 'mathlive';

MathJSON has an extensive API that supports parsing and serializing of custom LaTeX expressions. You can use it to define your own LaTeX "vocabulary" and "grammar" and transform it into MathJSON.

You can also convert MathJSON expressions into several canonical forms, do symbolic computation with MathJSON expressions, for example to compare them, and more.

Learn more at cortexjs.io/math-json/.

New Features

  • #952 It is now possible to define variants with keycaps in a custom keyboard. These variants are displayed with a long press on the keycap.
  • #955 When navigating with the arrow keys but there is nowhere to go, a move-out event is dispatched (or the lower-level onMoveOutOf hook is invoked, but using the event is recommended). This is an opportunity to handle this situation, for example by changing the focus to another element. To get the default behavior, which is to play a "plonk" sound, do not cancel the event. To prevent the "plonk" sound from playing, use evt.preventDefault(). Note tha previously a focus-out event was dispatched in this case, but since the focus is actually not changed by default, this was incorrect.

Improvements

  • The SpeechScope argument of the speak command is now optional.
  • Display the keys in the keystroke caption panel (alt/option+shift+K) in chronological order from left to right.
  • Do not inject stylesheets or placeholder elements for the popover panel, keystroke caption panel or virtual keyboard until actually needed, which may be never and thus result in a smaller DOM.

Architecture

  • The library is now null-safe, i.e. it compiles with the Typescript flag strictNullChecks. This will ensure that the public Typescript declaration file also compile with strictNullChecks if you make use of it in your own project.

Issues Resolved

  • #948 The Typescript declaration of set plonkSound() failed when compiled with strictNullChecks.
  • When using a mathfield as a web component, the speak command would be inoperative.
  • In Chrome/Blink, when a mathfield was in a contentEditable block, inserting a line before the component would make the component crash. Now the component is correctly disconnected, then reconnected and preserves its state across the disconnection.
  • #960 Typing "e^pi" would result in e\pi instead of e^\pi. Also, serializing some partial formulas, such as "e^" would result in incorrect LaTeX (e.g. "e").
  • In MathML serialization, 2^3 was not serializing the superscript (#951 ) and subscripts were not serialized for various constructs( #534).
arnog
published 0.67.0 •

Changelog

Source

0.67.0 2021-05-21

New Features

  • Added \overarc, \underarc, \overparen and \underparen commands.

Improvements

  • When replacing a selected range, snapshot in the undo state the collapsed selection before inserting the replacement.

Issues Resolved

  • Correctly calculate the padding for enclose atoms (broken in 0.66)
  • Setting the keypressSound to null would not turn off the sounds. Setting it to the string "null" did, though.
  • An input event would incorrectly bubble out of the mathfield, even in read-only mode.
  • When calling getOption(), or when examining a property on MathfieldElement, return the actual value, rather than an object literal that contains the value.
  • If the mathlive module was loaded before the <math-field> element was parsed in the document, the attributes of the mathfield would be ignored.
arnog
published 0.66.1 •

Changelog

Source

0.66.1 2021-05-21

Issues Resolved

  • Revert improvements where the display property of the mathfield would change depending on the default-mode property. This had unintended consequences in some cases. To control the layout of the mathfield, use style="display:inline-block;" instead.
  • When using applyStyle(), if a non-RGB color (e.g. "yellow") was used, it would not be applied to the selection.
  • When using applyStyle() if the font size was changed, it was always set to font size 1 (tiny).
  • Macro packages were incorrectly parsed
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc