GitPedia
alienzhou

alienzhou/web-highlighter

✨ A no-runtime dependency lib for text highlighting & persistence on any website ✨🖍️

17 Releases
Latest: 4y ago
v0.7.4Latest
alienzhoualienzhou·4y ago·June 24, 2021
GitHub

📋 Changes

  • [Array.prototype.includes](https://caniuse.com/array-includes)
  • [String: startsWith](https://caniuse.com/mdn-javascript_builtins_string_startswith)
  • [RegExp: unicode](https://caniuse.com/mdn-javascript_builtins_regexp_unicode)
v0.7.3
alienzhoualienzhou·4y ago·June 19, 2021
GitHub

📋 Changes

  • 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
  • better typings for event emitter #81
  • tsconfig path alias and npm scripts #84
v0.7.2
alienzhoualienzhou·4y ago·June 19, 2021
GitHub

📋 Changes

  • including type declarations in the `package.json`
  • making public `.options` a private field
v0.7.1
alienzhoualienzhou·5y ago·January 16, 2021
GitHub

📋 Changes

  • Generating .d.ts files for projects using typescript.
  • Select the range's container element correctly when it is not Text/Comment/CDATASection. #56
v0.7.0
alienzhoualienzhou·5y ago·July 12, 2020
GitHub

📋 Changes

  • 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.
v0.6.0
alienzhoualienzhou·6y ago·May 20, 2020
GitHub

📋 Changes

  • Add `.getExtraIdByDom` instance method which helps get extra ids from a wrapper. [more>>](https://github.com/alienzhou/web-highlighter/tree/v0.6.0#highlightergetextraidbydomnode)
  • 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. [more>>](https://github.com/alienzhou/web-highlighter/blob/master/docs/ADVANCE.md#serializerestore)
  • Support remove function in hooks. Now `hook.tap()` will return a function for removing it. Besides, you can also call `hook.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.
v0.5.2
alienzhoualienzhou·6y ago·May 17, 2020
GitHub

📋 Changes

  • 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.
v0.5.1
alienzhoualienzhou·6y ago·May 17, 2020
GitHub

📋 Changes

  • fix the bug: When the root node has no children (except text nodes), the highlights can't be recreate by sources. #38
v0.6.0-beta.0
alienzhoualienzhou·6y ago·May 17, 2020
GitHub

📋 Changes

  • add a new hook: `Serialize.Restore`
v0.5.0
alienzhoualienzhou·6y ago·January 22, 2020
GitHub

📋 Changes

  • add an option: support changing the default wrapper's tag name
0.4.0-beta.0
alienzhoualienzhou·6y ago·December 20, 2019
GitHub

📋 Changes

  • support highlighting on mobile devices: (#26 )
  • 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
v0.3.5
alienzhoualienzhou·6y ago·December 18, 2019
GitHub

📋 Changes

  • Bugfix: The `highlighter.removeAll()` method doesn't work
v0.3.3
alienzhoualienzhou·7y ago·May 1, 2019
GitHub

📋 Changes

  • hook: Remove.UpdateNode --> Remove.UpdateNodes
  • docs: english version
  • use new README for the example
v0.3.2
alienzhoualienzhou·7y ago·April 21, 2019
GitHub

📋 Changes

  • refactor: split some painter's functions
  • update: update docs and the example
v0.3.1
alienzhoualienzhou·7y ago·April 17, 2019
GitHub

📋 Changes

  • Structure refactor
  • Handling compatibility issues
  • Remove unnecessary modules
v0.0.3
alienzhoualienzhou·7y ago·December 8, 2018
GitHub

📋 Changes

  • support setting config dynamically
  • rename `.render()` to `.fromSource()`
  • rename `.highlight()` to `.fromRange()`
  • remove `.init` method and `highlight:init` event
v0.0.2
alienzhoualienzhou·7y ago·December 7, 2018
GitHub

📋 Changes

  • set highlight style (class) by id
  • get highlight position info (offsetTop, offsetLeft)
  • highlighting web text by passing range manually