UNPKG

15.1 kBMarkdownView Raw
1# Changelog
2
3Notable changes to Draft.js will be documented in this file.
4
5Changes to `src` are live in production on facebook.com at the time of release.
6
7## 0.10.5 (January 19th, 2018)
8
9### Added
10* Add support for `ariaDescribedBy` prop, for better a11y. (Suraj Karnati in
11 [a6af3e15](https://github.com/facebook/draft-js/commit/a6af3e15120e74c8797c5670f5bb63cb45c49a32))
12* Add support for `ariaLabelledBy` prop, for better a11y. ([@jackyho112](https://github.com/jackyho112)
13 in [#1519](https://github.com/facebook/draft-js/pull/1519))
14
15### Changed
16* Cause editor to break out of code block when user enters two blank lines. (Hanzhi Zhang
17 in [548fd5d1](https://github.com/facebook/draft-js/commit/548fd5d1b1c31b7b4c79cd70b101fae69d522b3f))
18
19### Fixed
20* Preserve list indentation when copying and pasting from one Draft.js editor
21 into another. ([@GordyD](https://github.com/GordyD) in [#1605](https://github.com/facebook/draft-js/pull/1605))
22* Fix `cannot read property 'update' of undefined` error that was thrown when
23 typing same character into selection that starts with that character. ([@existentialism](https://github.com/existentialism) in
24 [#1512](https://github.com/facebook/draft-js/pull/1512))
25* Fix `encodeRawBlocks` to handle non-contiguous entities. Entities should
26 always be contigious, and cover one sequential range of characters. However,
27 in cases where entityState is corrupted to include non-contiguous entities,
28 `encodeRawBlocks` would improperly process the entities in that case. (Frank
29 Thompson in [0059dd46](https://github.com/facebook/draft-js/commit/0059dd46f4d23af7d9803316aa93d8deddb5e8ae))
30* Updated CSS for DraftEditorPlaceholder to support multiline placeholder (Gaurav Vaish in
31 [c38b0285](https://github.com/facebook/draft-js/commit/c38b028513214416d66a3fdf191745dfde04ed2b)
32* Fix issue where typing at the end of a link caused the link to continue. (Ian
33 Jones in
34 [d16833b3](https://github.com/facebook/draft-js/commit/d16833b3dae77ccf13e3af7f5e42c8131b0d1d2c))
35* Fix regression of bug where clicking a link caused the focus to move but the
36selection state was not cleared, leading to a 'node not found' error.
37 ([@flarnie](https://github.com/flarnie)
38 in [55316176](https://github.com/facebook/draft-js/commit/553161761903bed7fad971d73e1fe04bb0ff360e))
39* Loosen Flow type definition for DraftBlockType to allow user-defined custom
40 block types. ([@mitermayer](https://github.com/mitermayer)
41 in [#1480](https://github.com/facebook/draft-js/pull/1480))
42
43## 0.10.4 (October 24th, 2017)
44
45### Added
46* Expose `onRightArrow` and `onLeftArrow` props to allow handling keyboard
47 events when right or left arrow is pressed.
48 ([@eessex](https://github.com/eessex)
49 in [#1384](https://github.com/facebook/draft-js/pull/1384))
50* Expose Draft.css as default CSS export in package.json for use by CSS
51 preprocessors. ([@darobin](https://github.com/darobin )
52 in [#566](https://github.com/facebook/draft-js/pull/566))
53
54### Changed
55* Change 'lookUpwardForInlineStyle' from O(n^2) to O(n), improving performance.
56 :) ([@Lemmih](https://github.com/Lemmih)
57 in [#1429](https://github.com/facebook/draft-js/pull/1429))
58
59### Fixed
60* Fix bug where editors inside draggable parent were broken for Safari.
61 ([@mattkrick](https://github.com/mattkrick) in
62 [#1326](https://github.com/facebook/draft-js/pull/1326))
63* Stop pulling in Enzyme as production dependency. D'oh.
64 ([@flarnie](https://github.com/flarnie) in
65 [#1415](https://github.com/facebook/draft-js/pull/1415))
66* Fix `TypeError: Cannot read property 'nodeType' of undefined` error where
67 `anchorNode` was `undefined`.
68 ([@tleunen](https://github.com/tleunen) in
69 [#1407](https://github.com/facebook/draft-js/pull/1407))
70* Fix error thrown when callback tries to `focus` on editor after it has been
71 unmounted. ([@mattkrick](https://github.com/mattkrick) in
72 [#1409](https://github.com/facebook/draft-js/pull/1409))
73* Fix bug where selecting a single character then typing it doesn't replace it.
74 ([@karanjthakkar](https://github.com/karanjthakkar) in
75 [#719](https://github.com/facebook/draft-js/pull/719))
76* Clear the block type when backspacing at the start of the first block with
77 rich text utils. ([@jvaill](https://github.com/jvaill) in
78 [#748](https://github.com/facebook/draft-js/pull/748))
79
80## 0.10.3 (September 28th, 2017)
81
82### Added
83* Allow React 16.\* as peer dependency. ([@nikgraf](https://github.com/nikgraf)
84 in [#1385](https://github.com/facebook/draft-js/pull/1385))
85
86### Fixed
87* Fixed bug where using a custom block type without overriding the default block
88 map threw an error. ([@southerncross](https://github.com/southerncross) in
89 [#1302](https://github.com/facebook/draft-js/pull/1302))
90* Update dependency on `fbjs` to get fix for bug where `focus()` caused
91 unexpected scroll ([@flarnie](https://github.com/flarnie) in
92 [#1401](https://github.com/facebook/draft-js/pull/1401))
93
94## 0.10.2
95
96### Added
97* Added support for `aria-controls` in draft.js ([@jessebeach](https://github.com/jessebeach) in [7f0cab28](https://github.com/facebook/draft-js/commit/7f0cab28386ec4bde8ec6289377bff9e53cd019b))
98
99### Changed
100* Change `aria-owns` to `aria-controls` in draft.js. ([@jessebeach](https://github.com/jessebeach) in [7f0cab28](https://github.com/facebook/draft-js/commit/7f0cab28386ec4bde8ec6289377bff9e53cd019b))
101 * Deprecates support of `ariaOwns` and `ariaOwneeID` props.
102* Deprecate use of `ariaHasPopup` prop in draft.js. `ariaExpanded` should be used instead if an input is showing a dropdown with options.([@jessebeach](https://github.com/jessebeach) in [744e9b4e](https://github.com/facebook/draft-js/commit/744e9b4eb4810797a93c66591fea6f9cac533b4b))
103* Pasting an `img` no longer inserts the `src` by default; now inserts image emoji if no decorator is used. ([@aadsm](https://github.com/aadsm) in [0b22d713](https://github.com/facebook/draft-js/commit/0b22d713d556ccc4820850099ad6231493b3f7aa) and [@flarnie](https://github.com/flarnie) in [1378](https://github.com/facebook/draft-js/pull/1378))
104
105### Fixed
106
107* Fix issue where selection state was not cleared on blur and refocus of the
108 editor. ([@sophiebits](https://github.com/sophiebits) in
109 [19b9b1c5](https://github.com/facebook/draft-js/commit/19b9b1c5007bcb3a4111ea31f8d9a8cda629a1ff))
110* Fix issue where pasting code into code block defaulted to plain text, and
111 styles were dropped from pasted blocks in general.
112 ([@bumbu](https://github.com/bumbu) in
113 [e8d10112](https://github.com/facebook/draft-js/commit/e8d101121fb9dd9203a46d899124a7be4b0b2936))
114* Fix issue where Flow was not running with some 'import' statements ([@flarnie](https://github.com/flarnie) & [@yuku-t](https://github.com/yuku-t) in [#1263](https://github.com/facebook/draft-js/pull/1262))
115* Fix bug where Draft threw when two keys were pressed at same time in React 16 async mode ([@sophiebits](https://github.com/sophiebits) in [1c6a49b8](https://github.com/facebook/draft-js/commit/1c6a49b8801183fe0c29458626c0b5dbe1238e59))
116* Fix recent Chrome bug where tab causes error ([@sophiebits](https://github.com/sophiebits) in [5863399a](https://github.com/facebook/draft-js/commit/5863399a3a1bcbbe9b090249504a70496a7af7cc))
117* Fix "Refs must have owner" error when multiple copies of React are used ([@mks11](https://github.com/mks11) in [#925](https://github.com/facebook/draft-js/pull/925))
118* Fix issue where AT could treat 'return' as submit in Draft ([@jessebeach](https://github.com/jessebeach) in [#1295](https://github.com/facebook/draft-js/pull/1295))
119* Don't allow `aria-expanded` to be true unless the aria role is combobox ([@jessebeach](https://github.com/jessebeach) in [3494d45d](https://github.com/facebook/draft-js/commit/3494d45d32b64d6e82e4b3e8fcade6a2b5c6bd46))
120* Fix pesky "This Selection object doesn't have any Ranges" bug ([@sophiebits](https://github.com/sophiebits) in [96688e10](https://github.com/facebook/draft-js/commit/96688e10b22a778c76e03009da4b9f3d05eba5f7) and [036e3a84](https://github.com/facebook/draft-js/commit/036e3a848e3593c97f4c3011e1ddc045e128a7af))
121* Fix bug where pasting `img` with large data URL source could crash editor ([@aadsm](https://github.com/aadsm) in [0b22d713](https://github.com/facebook/draft-js/commit/0b22d713d556ccc4820850099ad6231493b3f7aa))
122
123## 0.10.1
124
125### Added
126
127* Support UMD in dist output format (#1090)
128* Expose textDirectionality prop
129* Expose props disabling auto-correct, auto-complete, auto-capitalize
130* Add `editorKey` prop for SSR
131* Pass `block` to `customStyleFn` callback
132* Added `moveAtomicBlock` to `AtomicBlockUtils`
133
134### Fixed
135
136* Fix some cases of "Failed to execute 'setStart' on 'Range" bug (#1162)
137* Fix Chrome text deletion bug (#1155)
138* Pass fresh editorState to edit handlers (#1112 and #1113)
139* Fix for text insertion bugs in Android 5.1
140* Correctly delete immutable and segmented entity content when at the edge of a
141 selection
142 * Fix bug where all text except first letter was dropped in IE11
143 * Fix bug where starting new line incorrectly toggled inline style
144 * Fix 'getRangeClientRects' to work around [webkit selection bounding rect
145 bug](https://www.youtube.com/watch?v=TpNzVH5jlcU)
146
147## 0.10.0 (Dec. 16, 2016)
148
149### Added
150
151* Add improved API for entity manipulation to contentState
152* Add deprecation warnings to old Entity module API
153* Add image support to convertFromHTML
154* Add option of 'aliasedElements' in block render map
155
156### Changed
157
158* This version supports both the old and new Entity API; we
159 are deprecating the Entity module in favor of
160 using contentState. See [the migration guide.](https://draftjs.org/docs/v0-10-api-migration.html#content)
161
162### Fixed
163
164* Fix bug where block data was not removed when deleting atomic block
165* Fix bug preventing pasting from clipboard
166* Fix dead key deletion and deletion in 2-Set Korean
167* Fix ContentState.createFromBlockArray to allow taking an empty array
168* Improve typing in Korean on Windows
169
170## 0.9.1 (September 16, 2016)
171
172### Added
173
174* `customStyleFn` for more control over inline style ranges
175
176### Fixed
177
178* Update Flow version
179* Fix flow error in DraftEditorDragHandler
180
181## 0.9.0 (September 13, 2016)
182
183### Changed
184
185* Return 'handled' or 'not-handled' from cancellable handlers callback
186 * Boolean return value is deprecated
187* Expand and update documentation
188
189### Fixed
190
191* Fix selection of atomic block when it is the last block
192* Preserve the depth of custom block types when converting to raw
193* Stop mutating component children when creating blocks with wrapper elements
194
195## 0.8.1 (August 12, 2016)
196
197### Fixed
198
199* Include `object-assign` in npm dependencies
200* Include `babel-core` in npm dependencies of tex example
201
202## 0.8.0 (August 8, 2016)
203
204### Added
205
206* `customStyleFn` for more control over inline style ranges
207* Uses `internalClipboard` for Safari
208* Metadata for `ContentBlock` objects
209* `convertFromHTMLToContentBlocks`:
210 * Support for `mailto` protocol for links
211 * Support "unset" inline styles
212* Run ESLint on examples
213
214
215### Changed
216
217* Removed redundant ESLint module in TeX example
218* Update Travis CI config for readability, Node v4 requirements, and pruning/updating npm dependencies
219* Use `immutable` ~3.7.4 to avoid Flow errors in updated versions
220* Modify `getSelectionOffsetKeyForNode` to search for nested offset-annotated nodes
221* Upgrade eslint to 3.0.1, use fbjs config
222* Update to Flow 0.28
223* Jest
224 * Update to 12.1.1
225 * Replaced `jest.fn().mockReturnValue(x)` with `jest.fn(() => x)`
226* Remove extra spaces from the text decoration style
227* No longer using `nullthrows` for `blockRenderMap`
228* `convertFromHTMLToContentBlocks`:
229 * Improved variable names in `joinChunks`
230 * Additional whitelisted entities such as `className`, `rel`, `target`, `title`
231
232### Fixed
233
234* Fix bug where placeholder text was not being erased in Chrome
235* Fix bug where double click link in Firefox broke selection
236* Kill iOS tooltips
237* removed unnecessary `undefined` checks on `DraftEditorLeaf`
238* `convertFromHTMLToContentBlocks`:
239 * Preserve pasted block type on paste
240 * Strip XML carriage returns and zero-width spaces
241 * `getBlockMapSupportedTags()` will always return a valid array of tags
242* Documentation fixes
243
244## 0.7.0 (May 3, 2016)
245
246### Added
247
248* `blockRenderMap`: A map that allows configuration for the DOM elements and
249wrapper components to render, keyed by block type
250 * Includes configurability of element-to-block-type paste processing
251
252### Changed
253
254* Update to Jest 11.0.2
255
256### Fixed
257
258* Change deletion behavior around `atomic` blocks to avoid DOM selection errors
259* Properly apply entities across multiple blocks in
260* Improve placeholder behavior for a11y
261* Properly remove and modify entity ranges during spellcheck changes
262* Match Chrome `<textarea>` behavior during <kbd>cmd</kbd>+<kbd>backspace</kbd>
263command at visual line-start
264
265## 0.6.0 (April 27, 2016)
266
267### Added
268
269* `ContentState.getFirstBlock()` convenience method
270
271### Changed
272
273* <kbd>return</kbd> key handling now goes through command flow to enable easier
274custom `'split-block'` handling.
275* `convertFromRaw` now returns a `ContentState` object instead of an
276`Array<ContentBlock>`
277
278## 0.5.0 (April 12, 2016)
279
280### Fixed
281
282* <kbd>option</kbd>+<kbd>spacebar</kbd> no longer incorrectly scrolls browser in Chrome OSX
283* Cursor behavior when adding soft newlines
284
285### Added
286
287* `AtomicBlockUtils`, a utility module to simplify adding `atomic` blocks to
288an `EditorState`
289
290### Changed
291
292* The `media` block type is now `atomic`, to better represent that this type
293is not just intended for photos and videos
294
295## 0.4.0 (April 6, 2016)
296
297### Fixed
298
299* Avoid clearing inline style override when setting block type or depth
300
301### Added
302
303* `editable` field for custom block component configuration
304* Default key binding support for <kbd>Ctrl</kbd>+<kbd>M</kbd> (`split-block`)
305
306### Changed
307
308* Always wrap custom block components, based on block type
309 * Includes `data-editor`, `data-offset-key`, `data-block` in block props
310* Replace `onPasteRawText` prop with `handlePastedText`
311
312## 0.3.0 (March 22, 2016)
313
314### Fixed
315
316* Properly extract custom inline styles for `convertToRaw`
317* Fix internal paste behavior to better handle copied custom blocks
318
319### Added
320
321* Export `getVisibleSelectionRect`
322* Export `convertFromHTML`
323* Export `DraftEditorBlock`
324
325## 0.2.2 (March 9, 2016)
326
327### Fixed
328
329* Build before publish to get the warning suppression in place correctly
330
331## 0.2.1 (March 9, 2016)
332
333### Added
334
335* React 15 RC as peer/dev dependency, provide `suppressContentEditableWarning`
336
337## 0.2.0 (March 8, 2016)
338
339### Added
340
341* Move `white-space: pre-wrap` into inline style to resolve insertion issues
342* `handleDrop` prop method for `Editor` to allow manual drop management
343* `decoratedText` prop for decorator components
344* `getVisibleSelectionRect`, to provide Rect for DOM selection
345* Export `KeyBindingUtil` and `getDefaultKeyBinding`
346
347### Fixed
348
349* Triple-clicks followed by block type changes now only affect first block
350* `DraftEditorLeaf` now re-renders correctly when its styles change
351* Backspace behavior within empty code blocks
352
353## 0.1.0 (February 22, 2016)
354
355* Initial public release