Removing unsupported APIs to fix compatibility issues in IE11:
- highlight wrapper inside another wrapper not get updated when deleting #80
- make the className the latest one when wrapping a partial or an overlap node #82
- including type declarations in the
package.json
- making public
.options
a private field
- Generating .d.ts files for projects using typescript.
- Select the range's container element correctly when it is not Text/Comment/CDATASection.
- Make get id methods more flexible.
- It will get correct id(s) inside a wrapper. No need to be a wrapper element.
- It is limited in the root scope.
- Retain the wrapper's classname when wrapping a partial node.
- Add
.getExtraIdByDom
instance method which helps get extra ids from a wrapper. - Add a new hook:
Serialize.Restore
. You can use it to customize your own restoring method. When you tap this hook, the HighlightSource instance will use the function you pass to calculate the start and end nodes' info. - Support remove function in hooks. Now
hook.tap()
will return a function for removing it. Besides, you can also callhook.remove()
to remove a tapped function.
- When pre&next nodes are empty texts, the text node's wrapper should not be split.
- Avoid add duplicate functions to a hook.
- Add unit tests for hook, event emitter and new features.
- Use unknown type instead of any.
- Support verbose configuration. It decides whether warning&error message will be output.
- Add a static method .isHighlightWrapNode(). You can use it to test whether a node(DOM) is a highlight wrapper.
- Prevent emit REMOVE event when no node is affected by calling
.remove()
and.removeAll()
- Fix the bug in
.getAll
, now it will return correct data - Prevent injecting duplicate stylesheets when one has been injected
- Add a suit of unit tests to ensure the code quality.
- Refactor the way of error reporting.
- Remove
.dataset
polyfill.
- fix the bug: When the root node has no children (except text nodes), the highlights can't be recreate by sources.
- add a new hook: Serialize.Restore
Customize your own restoring method. When you tap this hook, the HighlightSource instance will use the function you pass to calculate the start and end nodes' info.
- add an option: support changing the default wrapper's tag name
using it as below
const highlighter = new Highlighter({
wrapTag: 'b'
});
- support highlighting on mobile devices:
- automatically detect whether mobile devices
- use touch events when on mobile devices
- source code: provide some internal methods for dom operation
- example app: bugfix & update
- Bugfix: The highlighter.removeAll() method doesn't work
- bugfix:
highlighter.removeAll()
does not work properly
- hook: Remove.UpdateNode --> Remove.UpdateNodes
- docs: english version
- use new README for the example
- refactor: split some painter's functions
- update: update docs and the example
- Structure refactor
- Handling compatibility issues
- Remove unnecessary modules
- support setting config dynamically
- rename
.render()
to.fromSource()
- rename
.highlight()
to.fromRange()
- remove
.init
method andhighlight:init
event
- set highlight style (class) by id
- get highlight position info (offsetTop, offsetLeft)
- highlighting web text by passing range manually