Socket
Socket
Sign inDemoInstall

mathlive

Package Overview
Dependencies
Maintainers
1
Versions
171
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.78.0

Diff

Changelog

Source

0.78.0 2022-08-11

Breaking Changes

  • The way errors are reported has changed.

    Previously a math-error event would be dispatched (or the onError listener would be invoked). This made it difficult to find out when an error no longer applied.

    • font-not-found: If the fonts fail to load, a class of ML__fonts-did-not-load is added to the document's body.
    • invalid-keybinding: A message is output to the console if a keybinding includes a combination of keys which cannot be performed with the current keyboard layout
    • Other errors are LaTeX syntax errors in the value of the mathfield. There can be more than one such error in a given mathfield. These errors are reported as mf.errors, an array of LatexSyntaxError. This property can be consulted for example during the handler for a change event.
  • Inline shortcuts now only apply in math mode. The mode property of InlineShortcutDefinition has been removed.

Improvements

  • Internal: introduction of GlobalContext to encapsulate information necessary to parse and render: macro definitions, registers, definition of commands and some optional settings. A mathfield is a GlobalContext, but it is also used when rendering static LaTeX.

  • The symbol used to indicate a placeholder (i.e. \placeholder{}) can now be customized with mf.setOptions({ placeholderSymbol: '?' }).

    Some symbols that work pretty well:

    • U+25A0 BLACK SQUARE
    • U+25A2 WHITE SQUARE WITH ROUNDED CORNERS
    • U+2B1A DOTTED SQUARE
  • The following CSS variables can be used to control the appearance of the selection:

    • --selection-background-color-focused
    • --selection-background-color
    • --selection-color-focused
    • --selection-color
    • --caret-color
  • Spacing commands (e.g. \,) now serialize a space when using the ascii-math format

  • #1572 Keyboard events (keyup, keydown, keypress) are now fired more consistently. They can be intercepted by calling preventDefault() during the capture phase.

Features

  • #1556 Support for East-Asian fraction navigation, where the denominator is read/written before the numerator. To use East Asian fraction navigation, set the option fractionNavigationOrder to "denominator-numerator".
  • Paste in a mathfield can be prevented by listening for a paste event and doing a preventDefault() on it
  • #1439 A synthetic click event is now dispatched when a click occurs inside the mathfield.

Issues Resolved

  • When using the Chrome Device Toolbar to emulate a mobile device, typing on the physical keyboard resulted in duplicate input.
  • #1545 Switching from a tab with a focused mathfield to another tab, then return to the tab with the matfield would lose the focus on the mathfield. The focus is now restored, similarly to what happens with a textarea element
  • When repeatedly hiding/showing the virtual keyboard, the virtual keyboard stylesheet would leak in the <header> of the document
  • #1564 The keydown events are now propagated for non-printable keys.
  • #1561 Last atom in group (atom with skipBoundary property) was skipped when moving forward
arnog
published 0.77.0 •

Changelog

Source

0.77.0 2022-07-05

Improvements

  • Changed the key on the bottom right of the virtual keyboard from moveToNextPlaceholder (equivalent to Tab key on physical keyboard) to commit (equivalent to Return on physical keyboard). Pressing this key (or the Return key on a physical keyboard) triggers a change event.

Issues Resolved

  • #1523 When switching between keyboard layouts the body of the document was getting erroneously enlarged vertically.
  • When using makeSharedVirtualKeyboard() if clicking directly on the virtual keyboard toggle of a mathfield that is not focused, the keyboard would be displayed with options that did not match the mathfield (it would have the wrong custom keyboard for example).
  • #1537 On Firefox, calling blur() on a <math-field> element resulted in document.activeElement still being set to the mathfield.
  • #1544 Allow physical keyboard input to be turned off.
arnog
published 0.76.1 •

Changelog

Source

0.76.1 2022-06-29

Issues Resolved

  • #1521 Regression In some cases a vertical scrollbar unexpectedly appeared in the mathfield
arnog
published 0.76.0 •

Changelog

Source

0.76.0 2022-06-28

Improvements

  • In the second argument of the \colorbox command, use \ensuremath when necessary to indicate that the content is math, rather than a mode shift command
  • When selecting all the children of a superscript or subscript, consider the superscript/subscript selected as well
  • #1041 When pasting textual content, if it can't be otherwise determined, assume the content to be LaTeX
  • Avoid excessive scrolling when bringing the mathfield into view.
  • Fonts could get loaded multiple times when the virtual keyboard was displayed or when static math was rendered

Features

  • #1335 Added support for the beforeinput and input events from [Input Events Level 1] (https://www.w3.org/TR/input-events-1/).

    While an input event was dispatched before, it did not conform to the InputEvent interface. The input event now includes an inputType property detailing what caused the event to be dispatched, and in some cases a data property.

    The beforeinput event is dispatched before the content of the mathfield is modified and is a cancelable event.

    A pair of beforeinput and input events are also dispatched when content is deleted, with an appropriate inputType value.

    An input event with a inputType property of "insertLineBreak" is dispatched when the Return or Enter keys are pressed.

    This matches more closely the behavior of the <textarea> element.

  • Added new latex-unstyled output format. Use it with getValue() to get a LaTeX representation of the mathfield content, without any color or background color styling command

Issues Resolved

  • #1489 In some cases, applying a background color, then entering some equations, could result in incorrect LaTeX output
  • Correct serialization for \char"0040 4, or in general any command with an unbraced numeric argument followed by an ambiguous decimal or hexadecimal character
  • Avoid crashing when deleting a range that overlaps with all the atoms in the root
  • #1195 MathML output could be incorrect in some situations involving LaTeX groups followed by a superscript and subscript
  • #1120 If a <mathfield> element had some hooks and listeners customized, then was removed from the DOM and reinserted later, the hooks and listener functions would revert to their default implementation
  • #1302 Long press on the backspace key of the virtual keyboard would output an error to the console. Long press on the backspace key is now a shortcut to clear the entire mathfield.
arnog
published 0.75.0 •

Changelog

Source

0.75.0 2022-06-21

Features

  • #970 It is now possible to vertically scroll the content of the mathfield.

Improvements

  • If the layout of the page is such that a mathfield would appear behind a virtual keyboard because there isn't enough space for the virtual keyboard and the mathfield, the height of the page is now adjusted so that both the mathfield and the virtual keyboard are visible (#1358)
  • When the virtual keyboard is invoked, if a mathfield was positioned at the bottom of the page, it could get covered with the virtual keyboard and become inaccessible
  • When a mathfield is set to a fixed height and it contains content that doesn't fit vertically, a scrollbar will appear.
  • If the content of the mathfield was taller than could fit in the mathfield, typing would not bring the content of the mathfield into view. (#1310)
  • When typing or using the virtual keyboard the mathfield would not always scroll into view to become visible (#1173)
  • Propagate content change event on paste in text and LaTeX mode
  • Added the container and content CSS part to customize the inside of the mathfield.

Issues Resolved

  • #1497 On iOS, tapping the edge of the mathfield could bring the native virtual keyboard
  • #1456 When multiple mathfields are present in a page, with makeSharedVirtualKeyboard(), calling setOptions() to change the virtual keyboard mode on those mathfields could cause the keyboards to not be shared.
  • #1501 The keybindings to get into and out of text mode (shift+quote) work again
  • #1517 Text content was not correctly serialized
  • #1503 A spurious = character was produced in the serialization of \ne. The MathML and ASCIIMath serialization of \ne were incorrect.
  • #1513 Using the virtual keyboard to apply underline or overline to the selection resulted in a placeholder being inserted instead.
arnog
published 0.74.0 •

Changelog

Source

0.74.0 2022-06-06

Improvements

  • Improved API/workflow to control the behavior of the virtual keyboard when multiple mathfields are displayed in the page.

    In order to get a coordinated behavior between the mathfields, it is now only necessary to call makeSharedVirtualKeyboard().

    The use-shared-virtual-keyboard attribute is now only necessary when using a mathfield in an iframe.

    If the virtual-keyboard-mode attribute of mathfield is set to auto or onfocus, the virtual keyboard will activate and hide automatically. It is no longer necessary to set the mode to off and to listen for focus change event to show/hide the keyboard manually.

    If the virtual keyboard is visible and the focus changes between two mathfields, the virtual keyboard will stay visible (it will not hide with an animation, then get revealed again).

    If changing focus between two mathfields with identical keyboard configurations the keyboard will not blink (previously the keyboard would get destructed and reconstructed, even if its configuration was identical between two mathfields).

Issues Resolved

  • #1477 Undo/redo did not generate an input event
arnog
published 0.73.7 •

Changelog

Source

0.73.7 2022-05-29

Improvements

  • Preferably use serialized atoms for clipboard copy/paste operations. This internal format captures more of the editing state than the LaTeX representation.
  • Change the default textual output to clipboard to use $$ as a format indicator.

Issues Resolved

  • #1467 Improvements to the Typescript public declarations
  • #1475 Copying a formula containing a matrix could render the mathfield unresponsive
arnog
published 0.73.6 •

Changelog

Source

0.73.6 2022-05-28

Issues Resolved

  • #1466 In LaTeX mode, doing a Select All (cmd+A), then delete would put the mathfield in an inconsistent state
  • While in LaTeX mode, doing a Select All (cmd+A) with a partial command followed by an auto-complete suggestion would render the mathfield unresponsive
arnog
published 0.73.4 •

Changelog

Source

0.73.4 2022-05-27

Issues Resolved

  • Correctly export the Typescript declaration for some static functions.
  • When editing a formula that contains a matrix, the formatting of the matrix could change, for example when pasting some content.
  • #1465 The bounds of large operators (integral, sum) would not accept any content.
  • When setting the background color of an entire equation, the color command would not be generated.
  • #1445 Improve the \colorbox command, and other text mode commands, to be more interoperable when they contain math content (use $ and $$ rather than \\( and \\[))
  • #1443 On mobile, prevent the focus from changing while the alternate key panel is up
arnog
published 0.73.3 •

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