Skip to content

Commit eaf2c88

Browse files
author
zhouhongxuan
committed
docs: add changelog
1 parent 05f7ab7 commit eaf2c88

File tree

1 file changed

+194
-0
lines changed

1 file changed

+194
-0
lines changed

CHANGELOG.md

Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
1+
# CHANGELOG
2+
3+
## v0.7.2
4+
5+
### Fix
6+
7+
- including type declarations in the `package.json`
8+
- making public `.options` a private field
9+
10+
---
11+
12+
## v0.7.1
13+
14+
### Features
15+
16+
- Generating .d.ts files for projects using typescript.
17+
18+
### Fix
19+
20+
- Select the range's container element correctly when it is not Text/Comment/CDATASection.
21+
22+
---
23+
24+
## v0.7.0
25+
26+
### Features
27+
28+
- Make get id methods more flexible.
29+
- It will get correct id(s) inside a wrapper. No need to be a wrapper element.
30+
- It is limited in the root scope.
31+
32+
### Fix
33+
34+
- Retain the wrapper's classname when wrapping a partial node.
35+
36+
---
37+
38+
## v0.6.0
39+
40+
### Features
41+
42+
- Add `.getExtraIdByDom` instance method which helps get extra ids from a wrapper.
43+
- 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.
44+
- 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.
45+
46+
### Fix
47+
48+
- When pre&next nodes are empty texts, the text node's wrapper should not be split.
49+
- Avoid add duplicate functions to a hook.
50+
51+
### Other updates
52+
53+
- Add unit tests for hook, event emitter and new features.
54+
- Use unknown type instead of any.
55+
56+
---
57+
58+
## v0.5.2
59+
60+
### Features
61+
62+
- Support verbose configuration. It decides whether warning&error message will be output.
63+
- Add a static method .isHighlightWrapNode(). You can use it to test whether a node(DOM) is a highlight wrapper.
64+
65+
### Fix
66+
67+
- Prevent emit REMOVE event when no node is affected by calling `.remove()` and `.removeAll()`
68+
- Fix the bug in `.getAll`, now it will return correct data
69+
- Prevent injecting duplicate stylesheets when one has been injected
70+
71+
### Other updates
72+
73+
- Add a suit of unit tests to ensure the code quality.
74+
- Refactor the way of error reporting.
75+
- Remove `.dataset` polyfill.
76+
77+
---
78+
79+
## v0.5.1
80+
81+
### Fix
82+
83+
- fix the bug: When the root node has no children (except text nodes), the highlights can't be recreate by sources.
84+
85+
## v0.6.0-beta.0
86+
87+
### Features
88+
89+
- add a new hook: Serialize.Restore
90+
91+
> 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.
92+
93+
---
94+
95+
## v0.5.0
96+
97+
### Features
98+
99+
- add an option: support changing the default wrapper's tag name
100+
101+
using it as below
102+
103+
```typescript
104+
const highlighter = new Highlighter({
105+
wrapTag: 'b'
106+
});
107+
```
108+
109+
---
110+
111+
## 0.4.0-beta.0
112+
113+
### Features
114+
115+
- support highlighting on mobile devices:
116+
- automatically detect whether mobile devices
117+
- use touch events when on mobile devices
118+
119+
### Other updates
120+
121+
- source code: provide some internal methods for dom operation
122+
- example app: bugfix & update
123+
124+
---
125+
126+
## v0.3.5
127+
128+
### Fix
129+
130+
- Bugfix: The highlighter.removeAll() method doesn't work
131+
132+
---
133+
134+
## v0.3.4
135+
136+
### Fix
137+
138+
- bugfix: `highlighter.removeAll()` does not work properly
139+
140+
---
141+
142+
## v0.3.3
143+
144+
### Fix
145+
146+
- hook: Remove.UpdateNode --> Remove.UpdateNodes
147+
148+
### Other update
149+
150+
- docs: english version
151+
- use new README for the example
152+
153+
---
154+
155+
## v0.3.2
156+
157+
### Updates
158+
159+
- refactor: split some painter's functions
160+
- update: update docs and the example
161+
162+
---
163+
164+
## v0.3.1
165+
166+
### Updates
167+
168+
- Structure refactor
169+
- Handling compatibility issues
170+
- Remove unnecessary modules
171+
172+
---
173+
174+
## v0.0.3
175+
176+
### Features
177+
178+
- support setting config dynamically
179+
180+
### Break Changes
181+
182+
- rename `.render()` to `.fromSource()`
183+
- rename `.highlight()` to `.fromRange()`
184+
- remove `.init` method and `highlight:init` event
185+
186+
---
187+
188+
## v0.0.2
189+
190+
### Features
191+
192+
- set highlight style (class) by id
193+
- get highlight position info (offsetTop, offsetLeft)
194+
- highlighting web text by passing range manually

0 commit comments

Comments
 (0)