Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mathlive

Package Overview
Dependencies
Maintainers
1
Versions
173
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mathlive - npm Package Versions

13
18

0.98.0

Diff

Changelog

Source

0.98.0 2023-12-03

Breaking Changes

  • The mf.setPromptContent() method has been renamed to mf.setPromptValue() for consistency with the mf.getPromptValue() method.

  • The mf.stripPromptContent() method has been removed. Its functionality can be achieved with:

const prompts = mf.getPrompts();
const values = prompts.map(id => mf.getPromptValue(id));
prompts.forEach(id => mf.setPromptValue(id, ""));

Improvements

  • A new mf.getPromptRange() method returns the selection range of a prompt. This can be used for example to focus a mathfield and select a specific prompt:
mf.focus();
mf.selection = mf.getPromptRange(id);
  • The Color, Background Color and Variant menus correctly toggle the colors and variant, and reflect their state with a checkmark or mixedmark.

  • Setting the mf.menuItems property before the mathfield is inserted in the DOM will now correctly update the menu items.

  • Correctly display tooltips in the menu when invoked via the menu icon.

  • Localized menu items in the context menu.

New Features

  • #348 Added a placeholder attribute, similar to the placeholder attribute of a <textarea> element. This specifies a short hint as a LaTeX string that describes the expected value of the mathfield. When the mathfield is empty, the placeholder text is displayed. The placeholder text can be styled with the math-field::part(placeholder) CSS selector.

  • #2162 Added a "latex-without-placeholders" format to the getValue() method. This format is similar to the "latex" format, but does not include the placeholders (for "fill-in-the-blanks").

Issues Resolved

  • #2169 Changing the selection programatically will now correctly update the mathfield.

  • #2189 If the decimal separator is set to ,, the virtual keyboard will now correctly display the decimal separator as a comma.

  • #2139 On some keyboard layouts, <kbd>ALT</kbd>+<kbd>/</kbd> would insert a \/ command, which is not standard. Now, the simple / is inserted.

arnog
published 0.97.4 •

Changelog

Source

0.97.4 2023-11-29

Issues Resolved

  • When a global .row class was defined, it would be applied to the virtual keyboard rows, resulting in incorrect layout.

Improvements

  • Added mf.queryStyle() method to query the style of a selection or the current style if no selection.
arnog
published 0.97.3 •

Changelog

Source

0.97.3 2023-11-28

Improvements

  • The mode-change event is now dispatched more consistently when the mode changes.

  • When the mathfield loses focus, if some of the content is in LaTeX mode, it remains in LaTeX mode. Previously, it would switch to math mode when losing focus.

  • Changing the user-select CSS property before inserting the mathfield in the DOM would not always be respected.

  • Use the DOM Popover API when available, which should ensure menus are displayed on top of other elements more consistently.

  • Added support for accented characters in the virtual keyboard (press and hold a vowel on an alphabetic keyboard to get accented variants), including a modified AZERTY layout (<kbd>SHIFT</kbd>+digits to get common accented characters).

  • Improved rendering of the menu for CJK and LTR languages.

Issues Resolved

  • If there were multiple mathfield elements on the page, only the last one would display tooltips.

  • #2184 Pressing the <kbd>TAB</kbd> key when in a prompt (fill-in-the-blank) would not move to the next prompt

  • #2183 The MathML serialization of factorial was incorrect.

  • #2181 The MathML serialization of limits was incorrect.

arnog
published 0.97.2 •

Changelog

Source

0.97.2 2023-11-21

Issues Resolved

  • Keybindings for German Linux keyboard layout were not working correctly.
arnog
published 0.97.1 •

Changelog

Source

0.97.1 2023-11-20

Issues Resolved

  • #2180 Allow the context menu to get turned off by setting mf.menuItems = []

  • Fixed a layout issue with the positioning of the context menu in some cases.

  • Improved dark mode appearance of context menu

arnog
published 0.97.0 •

Changelog

Source

0.97.0 2023-11-20

New Features

  • Context Menu Right-clicking on a mathfield or clicking the menu icon next to the virtual keyboard icon will bring up a context menu.

    The keyboard shortcut <kbd>ALT</kbd>+<kbd>SPACE</kbd> will also bring up the context menu. This keyboard shortcut previously toggled the virtual keyboard. This keyboard shortcut to toggle the virtual keyboard is now <kbd>ALT</kbd>+<kbd>SHIFT</kbd>+<kbd>SPACE</kbd>.

    The menu includes commands to:

    • insert and edit matrixes
    • evaluate, simplify and solve equations
    • change the variant of a symbol (blackboard, fraktur, etc...)
    • change the style (italic, bold, etc...) of the selection
    • change the color and background color
    • insert text
    • copy LaTeX, MathML or MathASCII to the clipboard
    • toggle the virtual keyboard

    The content of the menu may change in future versions, and feedback is welcome.

    The menu can be customized by setting the mf.menuItems property of the mathfield. The value of this property is an array of menu items. See the documentation for details.

Improvements

  • The tooltip above the virtual keyboard toggle (and the menu glyph) now only appears after a delay.

Issues Resolved

  • The expression \pmod5 is now correctly parsed as \pmod{5}. Macros that used an argument that was not a literal group were not parsed correctly.
arnog
published 0.96.2 •

Changelog

Source

0.96.2 2023-11-16

Issues Resolved

  • The vertical alignment of formulas containing some fractions was incorrect in some cases.
  • #2168 Changing the MathfieldELement.locale or MathfieldElement.strings would not affect existing mathfields.
  • Incorrectly accessing static properties (for example using mf.locale instead of MathfieldElement.locale) will now throw an error.
  • #2160 The keycap tooltips were not displayed.
  • #2144 When smartFence was on, an inline shortcut that conflicted with a delimiter was ignored.

Improvements

  • #2141: Added St Mary's Road symbols for theoretical computer science, including \mapsfrom.
  • #2158 Support the German keyboard layout on Linux.
  • #2102 The mathfield element now respects the user-select CSS property. If it is set to none, the mathfield will not be selectable.
arnog
published 0.96.1 •

Changelog

Source

0.96.1 2023-11-15

Improvements

  • Simplified the syntax to modify registers. Use mf.registers.arraystretch = 1.5 instead of mf.registers = {...mf.registers, arraystretch: 1.5}`
  • Allow changing registers using \renewcommand, for example \renewcommand{\arraystretch}{1.5}
  • Added keycap shortcuts [up] and [down] to move the selection up or down in a matrix.
  • Display the environment popover when the selection is inside a matrix, even when the virtual keyboard is not visible.

Issues Resolved

  • #2159 Runtime error in sandboxed mode when in an iframe from different origin
  • #2175 Addressed some rendering issues with Safar where a fraction inside a \left...\right was vertically offset.
  • #2176 Using the [hide-keyboard] virtual keycap would cause a runtime error.
  • #2161 When the virtual keyboard is hidden, a geometrychange event is dispatched.
arnog
published 0.96.0 •

Changelog

Source

0.96.0 2023-11-14

Breaking Changes

  • The function serializeMathJsonToLatex() has been renamed to convertMathJsonToLatex() for consistency.

Issues Resolved

  • A closing parenthesis following a function application would be ignored, i.e. (f(x)) would be parsed as (f(x).
  • #2116 Pressing the "/" key after an expression ending with a superscript would not recognize the left argument as a numerator.
  • #2124 In text mode, some characters were incorrectly interpreted as a math command, for example ( was interpreted as \lparen`. This could cause some interoperability issues.
  • #2110 If using the keyboard to enter several macros mapping to an \operatorname command, some of the commands could fail to render. For example, typing "1mm + 2mm" in a mathfield would result in "1 + 2mm" to be displayed.
  • When inserting an mchem atom, preserve the verbatimLatex associated with the atom, so that the value property of the atom is correctly serialized.
  • When invoking the moveToMathfieldEnd command, the selection was not changed if it was not collapsed and already at the end of the mathfield. Similarly for moveToMathfieldStart.

Improvements

  • Added support for additional commands from the mathtools, actuarialangle, colonequals, statmath and amsopn packages
  • Added support for longdiv enclosure (\mathenclose{longdiv}{...})
  • The decimal separator key (.) in the virtual keyboard was displayed as a blank key.
  • #2109 In the virtual keyboard, some placeholders could be hard to see when a keycap was in a pressed state.
  • #2105 The keycap shift + in the numeric keyboard was inserting a sum with limits contrary to what the keycap label indicated.
  • In the alphabetic virtual keyboard, the , key now produces a semicolon when shifted and has a variant panel with additional punctuation.
  • Improved virtual keyboard for integrals with more explicit template
  • When removing the limit of an integral or a sum, do not delete the operator itself.
  • #2122 On the Virtual Keyboard, the multiplication key now produces \cdot instead of \times. Use shift to produce \times.
  • Improved serialization to ASCIIMath and MathML (#2130 and others)
  • #2121 For ASCIIMath and MathML serialization, including phantom closing delimiter in the output.
  • Pressing the Action keycap on the virtual keyboard with the shift key pressed now inserts a new line (similar to what shift+enter does on a physical keyboard).
  • Render \displaystyle and \textstyle to MathML
  • Avoid runtime error if the mathfield gets deleted during a selection change event.
arnog
published 0.95.5 •

Changelog

Source

0.95.5 2023-08-18

Issues Resolved

  • #2091 The variant panel for the 7 key was the variant panel for 4.
  • #2093 Inline shortcuts can be corrected with backspace, i.e. typing sen[backspace][backspace]in will be corrected to \\sin.
  • #2018 Some VK toolbar items could be offset by a few pixels on some mobile devices
  • The caret was not visible when placed after an \operator*{} command
  • The \class{}{} command in a mathfield was not working correctly.

Improvements

  • #2052 When double-clicking then dragging, the selection is now extended to the nearest boundary. This applies to math, text and LaTeX zones.
  • Added prompt CSS part to the mathfield element. This allows styling of prompts (placeholders) in a fill-in-the-blank mathfield.
  • Added w40 keycap class (4-wide)
  • When using renderMathInElement() preserve the LaTeX as a data- attribute on the element.
  • Added speakable text for \imaginaryI, \imaginaryJ, \ne and \neq
  • Added ARIA label to keyboard toggle glyph
  • More robust check for PointerEvent support
  • Throw an error if attempting to access mf.mathVirtualKeyboard. The virtual keyboard is now a singleton, accessible as window.mathVirtualKeyboard.
  • When a command attribute is associated with a keycap, a math-virtual-keyboard-command event is dispatched when the keycap is pressed.
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