Releases: arnog/mathlive
v0.26
Breaking Changes
- Public method now start with
$
. This convention is also used, for example,
by the Vue.js project. For now, aliases exist that begin with '_' (the previous
convention), however you are encourage to migrate as soon as possible. The
function that are affected are:_el()
,_insert()
,_keystroke()
,_latex()
,
_perform()
,_revertToOriginalContent()
,_selectedText()
,
_selectionAtEnd()
,_selectionAtStart()
,_selectionDepth()
,
_selectionIsCollapsed()
,_setConfig()
,_text()
,_typedText()
(this was initially implemented in 0.25)
Major New Features
- Support for dark mode. Triggered automatically by the browser or
by settingtheme="dark"
on the<body>
tag. - New implementation for inline shortcuts. Now support complex inline
shortcuts including_
,(
and other keys. - Virtual Keyboards can now be described using a JSON data structure. Contribution from @rpdiss. Thanks!
- New
MathLive.toSpeakableText()
function - New
config.onAnnounce
handler
Other Improvements
- The
$perform()
function now accepts selector both in camelCase
or kebab-case. - Improved display of some keys in the keyboard caption panel
- New logo!
- Improved documentation, including adding pages for keyboard shortcuts,
examples, macros, selectors and config options. - Better support for IE11 via transpiling (thanks @synergycodes!)
Bug fixes
- #103 - Fixed issues where the math path could become invalid. Also made the
code more resilient to invalid paths. - #128 - Properly cleanup event handlers on destruction
Codebase Health and Performance
- Some minor optimizations and performance improvements, including
lazy loading of sounds and some other resources. - Moved some modules to classes.
Vue support
Added support for a Vue wrapper.
0.24.1 (December 17, 2018)
Fix issues in keyboard handling.
0.24 (December 16, 2018)
Breaking Changes
- Several handlers had some inconsistent signatures, or in some cases passed
invalid values as their arguments. This has been fixed, but it
required changing the signature of some handlers. For consistency, the first
argument of the handlers now refers to the mathfield to which it applies.
MathLive.makeMathField('input', {
onContentDidChange: mf => {
document.getElementById('output').innerHTML = mf.latex();
}
});
Keep in mind that arrow functions lexically bind their context, so this
actually refers to the originating context (not to the mathfield).
The affected handlers are:
onFocus
onBlur
onKeystroke
onMoveOutOf
onTabOutOf
onContentWillChange
onContentDidChange
onSelectionWillChange
onSelectionDidChange
onUndoStateWillChange
onUndoStateDidChange
onVirtualKeyboardToggle
onReadAloudStatus
It is recommended that you check if you use any of those handlers and
validate their signatures.
Major New Features
- Support for native JavaScript modules, contributed by
Jason Boxman (https://github.com/jboxman). Thanks, Jason!
The previous method, using a <script>
tag, is still supported:
<script src="../../dist/mathlive.js"></script>
but it is recommended to use native JavaScript modules:
<script type='module'>
import MathLive from '../../dist/mathlive.mjs';
</script>
(note the .mjs
extension indicating this is a JavaScript module).
A few caveats about using modules:
- JavaScript modules are automatically in strict mode
- To use JavaScript modules you need to be in your own module. With a
<script>
tag, this is indicated by adding thetype='module'
attribute. The code inside
a module is not leaked to the global scope, the module has its own scope. As a
result, functions defined inside the module (inside your<script>
tag) will
not be visible outside the module. You will need to either attach them to a
global object (such aswindow
) or in the case of even handlers, attach them
to the relevant element, usingaddEventListener
.
See examples/basic/index.esm.html
for a complete example.
If you were previously loading the non-minified version, that is the raw sources,
which can be useful to debug issues, you need to use modules to load them, while
you may have used requirejs
previously. The sources are now included in the
distribution for this purpose.
Instead of:
define(['mathlive/src/mathlive'], function(MathLive) {
MathLive.makeMathField(/*...*/);
}
use:
import MathLive from '../../dist/src/mathlive.js';
MathLive.makeMathField(/*...*/);
- Support for SRE (Speech Rule Engine) from Volker Sorge. Optional, and needs
to be installed separately. - Improved text to speech support, including karaoke mode (read aloud with
synchronized highlighting) - New configuration setting to control the spacing between elements,
horizontalSpacingScale
. Supplying a value > 1.0 can improve readability for
some users. - Added notifications when undo state change,
onUndoStateWillChange
and
onUndoStateDidChange
- Added support for correctly inserting rows and columns in arrays.
Other Improvements
v0.0.15
0.0.15 (July 1, 2017)
New Features
- Properly exported public API, including
renderMathInDocument()
and
renderMathInElement()
- Added \enclose command, implementing the MathML equivalent.
- Added \cancel, \bcancel and \xcancel commands
- Added
preserveOriginalContent
option toMathLive.renderMathIn...()
- Made
\backslash
work in text mode, for example when an argument of\rlap{}
- Added
MathField.revertToOriginalContent()
when a math field is no longer
needed for an element - Added customization of the command bar. See
MathField.config()
and
config.commands
- Added
MathLive.revertToOriginalContent()
andMathLive.getOriginalContent()
- Added optional namespacing of
data-
attributes - Added
onContentWillChange
andonContentDidChange
handlers in the math
field config object. - Added tutorials and improved documentation
Bug Fixes
- Fixed #5: AZERTY keyboard input was misbehaving, particularly for the
^
key - Dead keys (
´
,^
,¨
,˜
and others on some keyboards) were not properly
handled - Complex emojis (emojis made of multiple codepoints, such as emojis with skin
tone modifiers, or emojis with a ZERO WIDTH JOINER, such as the David Bowie
emoji) would be incorrectly recognized as multiple symbols - Fixed the
\color
command - Properly roundtrip to LaTeX
\rlap
,\color
and many other commands. Now,
copying content using these commands in a math field will result in the correct
LaTeX code to be generated.
Sprint 14
This is the first release on GitHub.
New in this release:
- NPM-based build system
- Integration with Travis CI
- Bundling of Javascript with Webpack
- Documentation: guides + API documentation