Comparing version 0.11.0 to 0.11.1
289
CHANGELOG.md
@@ -7,2 +7,291 @@ # Changelog | ||
## 0.11.1 (September 19th, 2019) | ||
### Added | ||
* Support post processor on paste entities. (Tee Xie in 3043573) | ||
* Adding 'preserveSelectionOnBlur' prop (#2128) (Matthew Holloway in db792ef) | ||
### Changed | ||
* Reaping draft_segmented_entities_behavior (Mohamed Moussa in cd4adaa) | ||
* Make insertIntoList strict-local (Kevin Chavez in db64f93) | ||
* Adopt Contributor Covenant (Paul O'Shannessy in 2c61167) | ||
* Flowify editOnKeyDown.js (Kevin Chavez in 8473e41) | ||
* (Flowify) decodeInlineStyleRanges.js (Kevin Chavez in 20a619c) | ||
* Flowify editOnInput.js (Kevin Chavez in 594a14f) | ||
* Flowify editOnBlur.js (Kevin Chavez in 6972278) | ||
* updated function description for onEditInput event handler function (#2132) (Mukesh Soni in 14349f1) | ||
* updated hastext method to not account for zero space width chars (#2163) (Ajith V in 85aa3a3) | ||
* Encode non-ASCII characters in all snapshot tests (Daniel Lo Nigro in 734bd82) | ||
* @flow -> @flow-strict for html/shared (Runjie Guan in 0375c0e) | ||
* Revert D16421104: [rfc][draft-js] catch errors when encoding entity map (Frank Thompson in 8e9cabf) | ||
* catch errors when encoding entity map (Frank Thompson in 259d122) | ||
* Revert D16362778: [rfc][draftjs] catch errors when encoding entity map (Frank Thompson in 96e7f25) | ||
* catch errors when encoding entity map (Frank Thompson in c0e911c) | ||
* Flow-type DataTransfer.js (Kevin Chavez in ed09f78) | ||
* All these modules can actually be strict (Kevin Chavez in bc716b2) | ||
### Fixed | ||
* convertFromHTML breaks after converting \n string, issue #1822 (#1823) (Sannikov in 9246cc7) | ||
* Fixes HTML importer to make image entity immutable (#2184) (Claudio Procida in b858f43) | ||
* Fixing js example and cleaning up one sentence (#2172) (Liz LeCrone in 819f58c) | ||
* Reaping draft_killswitch_allow_nontextnodes (generatedunixname89002005287564 in 0e2e9a7) | ||
* Fix for workchat composer cursor jumping (Jainil Parekh in aed35d2) | ||
* Fix various grammatical errors (#2158) (Jordan Lee in 1ff8c8c) | ||
* Composer: Not assuming element has leaves (Nitzan Raz in ce8bdd0) | ||
* Update jsfiddle links with recent versions of the Draft and React (#2145) (Günay Mert Karadoğan in 22b7599) | ||
* Changes reference to BSD license to MIT (#2130) (claudiopro in 4064cae) | ||
* Updates CHANGELOG for v0.11.0 (#2052) (Claudio Procida in 973f7ff) | ||
* Fixed a bug causing block data being over-written when pasted. (Tee Xie in 82e2135) | ||
* Merge pull request #2113 from danielo515/patch-1 (Claudio Procida in 0e88544) | ||
* Update ShipIt Sync (Claudio Procida in 0f138d1) | ||
## 0.11.0 (July 9th, 2019) | ||
### Added | ||
* Adds support for nullish coalescing operator (#2076) (Claudio Procida in 96c7221) | ||
* Add import statements for hooks-example in README (#2075) (Bennett in 943f6dc) | ||
* Unit tests for DraftStringKey (Claudio Procida in 978ad6b) | ||
* Adding Hooks in docs (#2004) (Charles ⚡ in f9f5fd6) | ||
* Exports `isSoftNewlineEvent` as static method of `KeyBindingUtil` (Kevin Hawkinson in aede823) | ||
* Add live demo to README.md (#1907) (PLa in 6db3726) | ||
* added highlighting (`<mark>` tag) to draft js html to content block converter (Isaiah Solomon in 37f2f2a) | ||
* Relicense under MIT and remove patents grant (#1967) (Claudio Procida in 585af35) | ||
* Ctrl-K at end of line should delete newline (Sophie Alpert in 6455493) | ||
* Add type annotations to `React.Component` classes in html/shared (Paco Estevez Garcia in 2e3a181) | ||
* Add return type annotation to `addEmojiInput` (Sam Goldman in 280d242) | ||
* Unstyle empty list item on Enter key (#769) (Eric Biewener in a0267a9) | ||
* Allow Option+Space to be handled on OSX Chrome (#1254) (Colin Jeanne in 022bcf7) | ||
* Added information about nature of block keys (#1892) (Prateek Nayak in 8ad59c4) | ||
* Add flow to files (Nivedita Chopra in d87e093) | ||
* Docs: add explicit deprecation notes to Entity methods (#1787) (vinogradov in cc6b897) | ||
* Clarifies editor example, changes height to min-height (#1889) (Claudio Procida in 67d6fda) | ||
* Improves editor overview example with min height and border (#1887) (Claudio Procida in b8862fd) | ||
* Adds iframed editor example (#1879) (Claudio Procida in 8d5cbbe) | ||
* Perform untab on backspace for nested items (Nivedita Chopra in 0688fa3) | ||
* Support custom block rendering (Nivedita Chopra in fbe2267) | ||
* Updates favicons and launcher icons with Draftjs logo (#1872) (Claudio Procida in d9c9d40) | ||
* Merge successive non-leaf blocks resulting from tab (Nivedita Chopra in fbd18ce) | ||
* Merge successive non-leaf blocks resulting from untab (Nivedita Chopra in 36e588a) | ||
* Unnest the first non-leaf child (Nivedita Chopra in 0cb3804) | ||
* Implement untab operations (Nivedita Chopra in 77e6844) | ||
* added favicon (#1871) (saranshkataria in b9dd551) | ||
* Add Algolia search (#1864) (Yangshun Tay in 1bf2145) | ||
* `KeyBindingUtil`: add `usesMacOSHeuristics` method (#869) (William Boman in 98e7730) | ||
* Export `RawDraftContentState` publicly (#1841) (Cédric Messiant in c6ff39d) | ||
* Implement moveChildUp operation for untab (Nivedita Chopra in e145a2a) | ||
* Allow insertion at a specific point for updateParentChild (Nivedita Chopra in 6b83312) | ||
* Implement onTab in NestedRichTextEditorUtil (Nivedita Chopra in 8d3cfba) | ||
* Add utilty methods for creating a new parent & updating node to become sibling's child (Nivedita Chopra in 6f73657) | ||
* Add utility methods for parent-child & sibling pointer updates (Nivedita Chopra in 0cb80b7) | ||
* Warn visibly when extensions break Draft (Sophie Alpert in c0fb6a8) | ||
* Add data structure invariants for tree data (Nivedita Chopra in ad4f64f) | ||
* Add Draft.js logo to header (Joel Marcey in 0ce20bc) | ||
* Enable deprecated-type rule in www (George Zahariev in dc9fa27) | ||
* Add different counter-style for ordered lists based on their depth (Noam Elboim in d2a3ae8) | ||
* Finish modernizing `convertFromHTMLToContentBlocks` - max nesting bug fix (Noam Elboim in 06c0ee6) | ||
* Finish modernizing `convertFromHTMLToContentBlocks` - upgrade draft-js internals (Noam Elboim in d24b802) | ||
* Finish modernizing `convertFromHTMLToContentBlocks` - nesting bug fix (Noam Elboim in 49bdd85) | ||
* Add docs about `DraftDecoratorComponentProps` (Flarnie Marchan in 7fddfcd) | ||
* Add list block `onTab` test (il kwon Sim in 102701c) | ||
* Integrating experiments on playground (mitermayer in b6ae887) | ||
* Add clarifying comments to `getRemovalRange` (Flarnie Marchan in 28cb4a3) | ||
* Adding Rich Editor to the playground (mitermayer in 227d125) | ||
* Allow indentation beyond one level deeper than block above. (Eric Biewener in 73e5a9c) | ||
* Enabling a GK manager for the plaground (mitermayer in 8eea2c2) | ||
* Bundle size stats (Alan in 5ffce3d) | ||
* Clear block type when pressing backspace (Sophie Alpert in 6a1e2b0) | ||
* added favicon to website (Michael Baldwin in 6cc2d85) | ||
* expose start/end positions of a decorated component within a contentBlock (Matthew Mans in 3a3d34b) | ||
* Add draft js playground (Julian Krispel-Samsel in 18fdffb) | ||
### Changed | ||
* Moves test for legacy convertFromHTMLToContentBlocks out of OSS repo (Claudio Procida in 5eb49b1) | ||
* Removes legacy convertFromHTMLToContentBlocks from OSS repo (Claudio Procida in a7d955e) | ||
* Renames convertFromHTMLToContentBlocks2 to convertFromHTMLToContentBlocks (Claudio Procida in d08399b) | ||
* Removes all resolved uses of convertFromHTMLToContentBlocks_DEPRECATED (Claudio Procida in ec43403) | ||
* draft-js: clean up useless divs from HTML when pasting content (Daniel Quadros de Miranda in 0f5427a) | ||
* docs: remove --save flag (#2008) (Mounish Sai in f92d4b1) | ||
* Rename DraftEditorBlock to EditorBlock (#2002) (Umang Galaiya in 8514b57) | ||
* Removes unnecessary eslint disable rules (Claudio Procida in 1ba0764) | ||
* Upgrades react-scripts to ^1.1.5 (#2042) (Claudio Procida in 71ef373) | ||
* Upgrades docusaurus (#2039) (Claudio Procida in 21753fa) | ||
* Removes unused gulp-browserify-thin (#2032) (Claudio Procida in fc3549a) | ||
* Upgrades @babel/core, babel-preset-fbjs, and gulp-util (#2028) (Claudio Procida in 68196f6) | ||
* Deploy 0.94 to www (George Zahariev in 6183935) | ||
* deploy 0.93 (Daniel Sainati in 3400cda) | ||
* Normalize case in `convertFromHTMLToContentBlocks` variable names (Claudio Procida in b4183b1) | ||
* Cleans up and refreshes generated website resources (#1998) (Claudio Procida in bd799f5) | ||
* Upgrades Draft to React 16.8 ⚛️ (#1996) (claudiopro in a97ed7e) | ||
* Adds email notifications for TravisCI builds (#1990) (Claudio Procida in a4cc10d) | ||
* Upgrades flow-bin to 0.91.0 and mutes fbjs joinClasses error � (#1989) (Claudio Procida in e8a281c) | ||
* Update to 0.92.0 (Paco Estevez Garcia in c022efb) | ||
* Update webpack-dev-server & babel version in TeX examples (#1981) (Nivedita Chopra in a3a3585) | ||
* Remove `componentWillReceiveProps` usages in examples (#1952) (Deep in 363f66e) | ||
* Upgrade to Gulp 4 (fixes build) (#1957) (Kevin Chavez in 85ad25c) | ||
* Kill permanent permanently. (Andrey Sukhachev in 236270a) | ||
* Deploy Flow v0.85 to www (Sam Goldman in 744af91) | ||
* flow 0.84 www deploy (Avik Chaudhuri in 59dd225) | ||
* Bring back the ariaOwneeID prop. (#1883) (Andrea Fercia in ce7f677) | ||
* Add Node.js version 10 for CI (#1909) (noelyoo in 4a9a6a8) | ||
* Refactor buffer constructor (#1912) (noelyoo in 11d7379) | ||
* Update Advanced-Topics-Inline-Styles.md (#1902) (Yao Bin in 0b7ec2a) | ||
* Remove flow typing for DraftEntity mock (#1891) (Nivedita Chopra in 75aa88a) | ||
* Flow strict for some files (Nivedita Chopra in bbd3ef1) | ||
* Update documentation concerning immutable updates (#1884) (Connor Jennings in c336ae2) | ||
* Update docs to ensure kebab menu shows subheads (#1885) (Connor Jennings in 2ff0c7e) | ||
* Support npm version 6.x (#1866) (Yangshun Tay in 724fdc6) | ||
* Remove unused var in BlockTree (#1859) (Nivedita Chopra in 0a45fcd) | ||
* Update jest version to latest (#1858) (Nivedita Chopra in b962974) | ||
* Update Advanced-Topics-Entities.md (#1767) (alaoui abdellah in d40ff40) | ||
* Update link to code of conduct (#1855) (Nivedita Chopra in 8c373b6) | ||
* var => const on remaining file (Nivedita Chopra in 022798c) | ||
* Update prettier version to 1.13.6 (#1854) (Nivedita Chopra in e2c24cf) | ||
* Remove Flow Strict Local from files with future sketchy-null errors after bug fix (George Zahariev in c5b785a) | ||
* Remove non-leaf blocks in tree => raw conversion (Nivedita Chopra in f5b2acb) | ||
* Update Docusaurus to 1.3.3 (#1797) (Yangshun Tay in d6a0ac0) | ||
* modify docs overview url (#1802) (Shubham Tiwari in 9f86efb) | ||
* v0.79.1 in www (Panagiotis Vekris in 93a90a9) | ||
* Remove gating on draft_non_native_insertion_forces_selection (Sophie Alpert in 1a5b27a) | ||
* 5/n Disable forward delete across blocks when nested blocks are enabled (Flarnie Marchan in 0600549) | ||
* 3/n Splitting PR #1828: updates to the Rich Text Editor example (#1828) (mitermayer in e98e91e) | ||
* 2/n splitting PR #1828: updating `removeRangeFromContentState` (#1828) (mitermayer in a399e43) | ||
* 1/n splitting PR #1828: Initial forking of `RichTextEditorUtil` (#1828) (mitermayer in 328ddc6) | ||
* Warn if `moveSelectionForward/Backward` called with non-collapsed selection (Flarnie Marchan in 99eca6b) | ||
* codemod jasmine -> jest in html/shared (Aaron Abramov in 7f9299d) | ||
* Remove logo from background circle (#1800) (Paul O’Shannessy in 47ae65a) | ||
* var => const on test files (Nivedita Chopra in 0f58b64) | ||
* Migrate to Docusaurus - Attempt #2 (Noam Elboim in 710919b) | ||
* Remove old decorator fingerprint logic (Sophie Alpert in b2f6ed0) | ||
* Use strict-local in as many files as possible (Miorel Palii in 3798902) | ||
* Pass eventTimeStamp to `handleKeyPress` to allow tracking (Flarnie Marchan in 0ecf9a6) | ||
* Pass synthetic event to `handleBeforeInput` callback (Flarnie Marchan in b86b5ce) | ||
* `React.Element<any>` / `React.Element<*>` -> `React.Node` as much as possible (Miorel Palii in a1f4593) | ||
* Change remaining vars to let/const (Nivedita Chopra in 8de2db9) | ||
* Removed `@providesModule` tags and dependencies from draft-js (Rubén Norte in ee2e9c8) | ||
* Add `@providesModule` back to draft-js modules (Ashley Watkins in 05b2b4c) | ||
* Add common Flow type for decorator components (Ashley Watkins in 8000486) | ||
* Add `@providesModule` back to draft-js modules (Rubén Norte in 4c4465f) | ||
* Removed `@providesModule` tag from non-generated files in html/shared directories (1/1) (Rubén Norte in 293f262) | ||
* 2/n Remove last vestiges of cWU (Flarnie Marchan in e954091) | ||
* 1/n Move `blockSelect` flag out of cWU (Flarnie Marchan in 0f6199d) | ||
* Upgrade to Flow v0.68.0 (Sam Goldman in a99f51e) | ||
* Strict-ify files that can be strict-ified with no additional changes (Miorel Palii in 22f9c52) | ||
* rename-unsafe-lifecycles (Brian Vaughn in 8b3e8c9) | ||
* Refactor `convertFromHTMLtoContentBlocks` (Nicolas Champsavoir in 732b69d) | ||
* Making gkx overwrittable (mitermayer in 7495adf) | ||
* 2/n Do update `blockSelectEvents` flag, during render (Flarnie Marchan in e571268) | ||
* 1/n remove GK on `flushSync` (Flarnie Marchan in 4241f43) | ||
* Playground - Making sure blockMap should always visible by default (mitermayer in 7eb2a50) | ||
* Move uglifyjs-webpack-plugin to devDependencies (Thibaud Colas in 4de1345) | ||
* Making a more sane .gitignore (mitermayer in f4bc3a7) | ||
* Examples cleanup (Ken Hibino in 67f3586) | ||
* Ensure selection collapses if user tries to replace with matching text (Brian Ng in 084bdb6) | ||
* Move `_latestEditorState` assignment back to commit phase (Sophie Alpert in 04c2b9c) | ||
* Remove Node 6 from engines list in package.json (Thibaud Colas in 584d849) | ||
* Update `_latestEditorState` in render too (Flarnie Marchan in 90a8f22) | ||
* Widen logging and add stack trace for IE selection bug (Flarnie Marchan in a6317e6) | ||
* Match block and inline examples for consistency. (cbeninati in e65a8e6) | ||
* Bundle size stats + Misc changes (Alan Norbauer in 0a1f981) | ||
* Remove `componentWillUpdate` under GK (Flarnie Marchan in 7885959) | ||
* try disabling 'blockSelectEvents' flag (Flarnie Marchan in d144883) | ||
* Update site footer from 2017 -> 2018 (Michael Chen in 558352c) | ||
* Make the Flow type of `CompositeDraftDecorator`'s constructor more strict (Steven Luscher in a894030) | ||
* Deprecated the coarse `onArrowUp` et al key handler props on `DraftEditor.react` to make it possible to produce editor commands from these keys (Steven Luscher in dc5ca7f) | ||
* Wrap Draft handlers in `flushControlled` instead of `flushSync` (Andrew Clark in cda13cb) | ||
* Update docs/APIReference-Editor.md (Sai Kishore Komanduri in 27a5f10) | ||
* Bumping internal flow version (mitermayer in 342a51a) | ||
* Switch from `DraftFeatureFlags` to gkx() (Sophie Alpert in 07eb9c4) | ||
* Add `flushSync` to Draft.js for *only* GK folks (Flarnie Marchan in 26040e5) | ||
### Fixed | ||
* Fixed drag and drop `.length` error (#2117) (job in 2487e7d) | ||
* Fix broken id anchor (#2095) (Sajad Torkamani in eddcc55) | ||
* Typo corrected - Overview.md (#2089) (Jonathan Erlich in 87a812d) | ||
* fix: set to nested list items to right depth (Kevin Li in 12c4480) | ||
* fix(styles): avoid permanently accumulating attribute styles (Kevin Li in 7cfb055) | ||
* Fixes runtime error when cutting empty selection at the end of the content (Claudio Procida in 23fc70f) | ||
* Fixing major Android editing issues (#2035) (Fabio M. Costa in 634bd29) | ||
* Fix broken link in Overview.md (#2062) (seojeee in e8e0bcf) | ||
* Fix failing `DraftStringKey` test (#2064) (Claudio Procida in fe4e266) | ||
* Fixes require order lint issues /2 (Claudio Procida in 76e121e) | ||
* Fixes require order lint issues (Claudio Procida in e2c5357) | ||
* Fix the issue of draft JS does not do copy and paste correctly with custom entities. (Tee Xie in d09ef3e) | ||
* fix typo in README.md (#2055) (Tanner Eustice in 75a89ff) | ||
* rename `*.test.js` to `*-test.js` to match naming convention (Aaron Abramov in dc58df8) | ||
* Convert some of draftjs' `ReactDOM.findDOMNode` to refs (#2051) (Dennis Wilkins in 1fae34f) | ||
* Correct warning condition (#2049) (Ben Gardner in ffd8f59) | ||
* Fix npm run dev (#2030) (Fabio M. Costa in 3c01ef6) | ||
* Specify correct type of `joinClasses` (George Zahariev in 7b9a7e1) | ||
* Restores flow error suppression for fbjs@1.0.0 (#2014) (Claudio Procida in 6a26a82) | ||
* Fix leading line feed conversion (Guillaume Aubert in 5081c87) | ||
* Handles `<br>` tags in refactored HTML converter (Claudio Procida in fdf63aa) | ||
* Typo fix in code comment (#1997) (Deniz Susman in e84e757) | ||
* Fix bad destructuring when content block key has a `-` (#1995) (Jan Karlo Dela Cruz in c21a9f7) | ||
* Fix typo in code comment for DraftEditor (#1991) (Deniz Susman in 7167210) | ||
* Fixes lint warnings in `convertFromHTMLToContentBlocks2` tests (Claudio Procida in e942ee9) | ||
* Update fbjs to 1.0.0 to fix ReDos Vulnerability (#1978) (Anthony Muscat in 9b2a366) | ||
* Normalize copyright headers to BSD + patents grant and drop the year (#1964) (Claudio Procida in 642aa11) | ||
* Fixes flow error (#1962) (Claudio Procida in fb7882b) | ||
* Remove unused suppression comments from www as of v0.89 (Gabe Levi in 8dd6dda) | ||
* Add correct type annotations to DraftEditor.react.js (Paco Estevez Garcia in 83edf02) | ||
* Fix `$FlowFixMe` type not working for CI builds of draft-js (Paco Estevez Garcia in 81f92ee) | ||
* Annotate exports codemod on html/shared (Paco Estevez Garcia in 7cb10f9) | ||
* Revert D13097194: [codemod][types-first] Add type annotations to html/shared (Craig Phillips in 010fce7) | ||
* Add type annotations to html/shared (Paco Estevez Garcia in 6f4102d) | ||
* Fix all 'curly' violations (Paul O'Shannessy in ab199ef) | ||
* Fix tex and universal examples crash because of different React versions (#1756) (#1931) (Thibaud Colas in 7dddded) | ||
* Fix typo (#1913) (noelyoo in 1d3c77f) | ||
* Fixes some drag-n-drop problems (#1599) (Denis Oblogin in 20a0f73) | ||
* Bug/1668 (#1691) (Alexis H in 1d2d854) | ||
* Fix SelectionState’s `hasEdgeWithin` (#1811) (Andrew Branch in 7666e95) | ||
* Fix drop issue (#1725) (LaySent in 800d6b5) | ||
* fixes #868 (#1878) (Julian Krispel in 6ba124c) | ||
* Fix check for tree blocks (Nivedita Chopra in 690f7ef) | ||
* Fix bug in merge blocks (Nivedita Chopra in 7daa87e) | ||
* Fix raw to tree conversion (Nivedita Chopra in 8ac1922) | ||
* Bug Fix - Remove deleted block from its parent's children (Nivedita Chopra in 02e0e00) | ||
* Fix small typo (#1865) (Valentin Hervieu in 8bb9c6c) | ||
* Fix paste handling for images with `role="presentation"` (Jainil Parekh in 6df3808) | ||
* Minor fix in entities docs (#1534) (Alastair Hole in 9f0d115) | ||
* Fixes incorrect docs, see #1497 (#1837) (Matt Greenfield in a18b6fe) | ||
* Fixes warning for missing keys in example color controls (#1853) (Claudio Procida in 4a5ad07) | ||
* Fix Lint errors for type imports (Nivedita Chopra in e6c693c) | ||
* Fix Travis breakage caused due to unimported `idx` module (Nivedita Chopra in 3306ddf) | ||
* Fix `DraftTreeAdapter` to respect the tree invariants (Nivedita Chopra in 39be488) | ||
* Inline call to `gkx` to combat fatal in `ContentState` (Steven Luscher in a6c9ffd) | ||
* Handle ReactDOM type errors (Ashley Watkins in 9130859) | ||
* Fix tree invariants test (#1836) (Nivedita Chopra in 05208a8) | ||
* Fix unlucky failures in character replacement (Sophie Alpert in ae25b8f) | ||
* Regression test for bug with nested block and deleting (Flarnie Marchan in 2d7ad18) | ||
* Tree Data - Fix for backspace at the start of a nested block (Nivedita Chopra in cf48f77) | ||
* Tree Data - Don't update pointers if range is within the same block (Nivedita Chopra in f3d3490) | ||
* Fix Draft input cursor jumping to the end (Dan Abramov in 37dadd3) | ||
* Fix tests to be independent on the implementation of invariant (Matthew McKeen in 81cc54b) | ||
* Re-apply order-requires linter on html/shared/ (Dave Alongi in 0bb8d76) | ||
* Auto-fix `prefer-const` ESLint rule (3/n) (Miorel Palii in bf1a028) | ||
* Auto-fix all auto-fixable eqeqeq problems (Miorel Palii in eea70f4) | ||
* Fixing Docusaurus migration issues (Noam Elboim in 72ad814) | ||
* Fix block tree before/after comparison (Sophie Alpert in fa88ee1) | ||
* Fixed license, Flow and lint issues in draft-js (Rubén Norte in 3e9ff8e) | ||
* Actually for real fix the flow type of decorator props (Flarnie Marchan in 7e1a107) | ||
* Workaround for BlockNode variance issue caused by flow transform (#1621) (Bob Ippolito in 1d77500) | ||
* Revert "rename-unsafe-lifecycles" (mitermayer in 6eec8f9) | ||
* Fix typo (Aditya Bhardwaj in 6ef6c66) | ||
* Website: Fixed code highlight (Marcelo Jorge Vieira in 04c667c) | ||
* Fixing tex example (Guilherme Miranda in 900ef76) | ||
* Fix typo (Thomas Broadley in 35b3605) | ||
* Fixing master (mitermayer in 4c12ead) | ||
* Fix Linux keyboard shortcuts (Thomas Nardone in f6fbf1c) | ||
* fix typo in changelog (Flarnie Marchan in 93bc209) | ||
### Meta | ||
* Add issue triage guidelines to CONTRIBUTING.md (#1896) (Nivedita Chopra in 7df9eb9) | ||
* Add meeting notes for 10/12 (#1901) (Nivedita Chopra in 9a96ab0) | ||
* Add meeting notes from 9/7 (#1862) (Nivedita Chopra in b8ea228) | ||
* Change oncall to draft_js (Nivedita Chopra in fbc8a0c) | ||
* Update biweekly sync meeting notes from February 2018 (Flarnie Marchan in 1ef4044) | ||
* Update weekly meeting notes from Oct. 2017 - Jan. 2018 (Flarnie Marchan in 7017825) | ||
## 0.10.5 (January 19th, 2018) | ||
@@ -9,0 +298,0 @@ |
@@ -128,3 +128,4 @@ /** | ||
var blockMap = this.getBlockMap(); | ||
return blockMap.size > 1 || blockMap.first().getLength() > 0; | ||
return blockMap.size > 1 || // make sure that there are no zero width space chars | ||
escape(blockMap.first().getText()).replace(/%u200B/g, '').length > 0; | ||
}; | ||
@@ -131,0 +132,0 @@ |
@@ -584,3 +584,3 @@ /** | ||
this.currentEntity = this.entityMap.__create('IMAGE', 'MUTABLE', entityConfig); // The child text node cannot just have a space or return as content (since | ||
this.currentEntity = this.entityMap.__create('IMAGE', 'IMMUTABLE', entityConfig); // The child text node cannot just have a space or return as content (since | ||
// we strip those out), unless the image is for presentation only. | ||
@@ -587,0 +587,0 @@ // See https://github.com/facebook/draft-js/issues/231 for some context. |
@@ -28,5 +28,3 @@ /** | ||
if (ranges) { | ||
ranges.forEach(function ( | ||
/*object*/ | ||
range) { | ||
ranges.forEach(function (range) { | ||
var cursor = substr(text, 0, range.offset).length; | ||
@@ -33,0 +31,0 @@ var end = cursor + substr(text, range.offset, range.length).length; |
@@ -151,3 +151,8 @@ /** | ||
return this.props.tree.map(function (leafSet, ii) { | ||
var leavesForLeafSet = leafSet.get('leaves'); | ||
var leavesForLeafSet = leafSet.get('leaves'); // T44088704 | ||
if (leavesForLeafSet.size === 0) { | ||
return null; | ||
} | ||
var lastLeaf = leavesForLeafSet.size - 1; | ||
@@ -154,0 +159,0 @@ var leaves = leavesForLeafSet.map(function (leaf, jj) { |
@@ -82,3 +82,6 @@ /** | ||
} | ||
/* $FlowFixMe This comment suppresses an error found DataTransfer was typed. | ||
* getFiles() returns an array of <Files extends Blob>, not Blob */ | ||
var files = data.getFiles(); | ||
@@ -85,0 +88,0 @@ |
@@ -13,2 +13,4 @@ /** | ||
var UserAgent = require("fbjs/lib/UserAgent"); | ||
var onBeforeInput = require("./editOnBeforeInput"); | ||
@@ -38,2 +40,4 @@ | ||
var isChrome = UserAgent.isBrowser('Chrome'); | ||
var selectionHandler = isChrome ? onSelect : function (e) {}; | ||
var DraftEditorEditHandler = { | ||
@@ -51,4 +55,10 @@ onBeforeInput: onBeforeInput, | ||
onPaste: onPaste, | ||
onSelect: onSelect | ||
onSelect: onSelect, | ||
// In certain cases, contenteditable on chrome does not fire the onSelect | ||
// event, causing problems with cursor positioning. Therefore, the selection | ||
// state update handler is added to more events to ensure that the selection | ||
// state is always synced with the actual cursor positions. | ||
onMouseUp: selectionHandler, | ||
onKeyUp: selectionHandler | ||
}; | ||
module.exports = DraftEditorEditHandler; |
@@ -23,4 +23,2 @@ /** | ||
var gkx = require("./gkx"); | ||
var Immutable = require("immutable"); | ||
@@ -74,5 +72,6 @@ | ||
replaceWithFragment: function replaceWithFragment(contentState, targetRange, fragment) { | ||
var mergeBlockData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'REPLACE_WITH_NEW_DATA'; | ||
var withoutEntities = removeEntitiesAtEdges(contentState, targetRange); | ||
var withoutText = removeRangeFromContentState(withoutEntities, targetRange); | ||
return insertFragmentIntoContentState(withoutText, withoutText.getSelectionAfter(), fragment); | ||
return insertFragmentIntoContentState(withoutText, withoutText.getSelectionAfter(), fragment, mergeBlockData); | ||
}, | ||
@@ -104,18 +103,9 @@ removeRange: function removeRange(contentState, rangeToRemove, removalDirection) { | ||
if (startEntityKey && startEntityKey === endEntityKey) { | ||
var _adjustedRemovalRange = getCharacterRemovalRange(contentState.getEntityMap(), startBlock, endBlock, rangeToRemove, removalDirection); | ||
return removeRangeFromContentState(contentState, _adjustedRemovalRange); | ||
var adjustedRemovalRange = getCharacterRemovalRange(contentState.getEntityMap(), startBlock, endBlock, rangeToRemove, removalDirection); | ||
return removeRangeFromContentState(contentState, adjustedRemovalRange); | ||
} | ||
} | ||
var adjustedRemovalRange = rangeToRemove; | ||
if (gkx('draft_segmented_entities_behavior')) { | ||
// Adjust the selection to properly delete segemented and immutable | ||
// entities | ||
adjustedRemovalRange = getCharacterRemovalRange(contentState.getEntityMap(), startBlock, endBlock, rangeToRemove, removalDirection); | ||
} | ||
var withoutEntities = removeEntitiesAtEdges(contentState, adjustedRemovalRange); | ||
return removeRangeFromContentState(withoutEntities, adjustedRemovalRange); | ||
var withoutEntities = removeEntitiesAtEdges(contentState, rangeToRemove); | ||
return removeRangeFromContentState(withoutEntities, rangeToRemove); | ||
}, | ||
@@ -122,0 +112,0 @@ splitBlock: function splitBlock(contentState, selectionState) { |
@@ -28,3 +28,5 @@ /** | ||
// opposed to clicking to another tab or window). | ||
if (getActiveElement() === document.body) { | ||
// However if users wish to override this behaviour they can provide | ||
// a prop preserveSelectionOnBlur of `true`. | ||
if (!Boolean(editor.props.preserveSelectionOnBlur) && getActiveElement() === document.body) { | ||
var _selection = global.getSelection(); | ||
@@ -31,0 +33,0 @@ |
@@ -21,6 +21,7 @@ /** | ||
var _require = require("./draftKeyUtils"), | ||
notEmptyKey = _require.notEmptyKey; | ||
var findAncestorOffsetKey = require("./findAncestorOffsetKey"); | ||
var gkx = require("./gkx"); | ||
var keyCommandPlainBackspace = require("./keyCommandPlainBackspace"); | ||
@@ -42,3 +43,14 @@ | ||
/** | ||
* This function is intended to handle spellcheck and autocorrect changes, | ||
* This function serves two purposes | ||
* | ||
* 1. To update the editorState and call onChange method with the new | ||
* editorState. This editorState is calculated in editOnBeforeInput but the | ||
* onChange method is not called with the new state until this method does it. | ||
* It is done to handle a specific case where certain character inputs might | ||
* be replaced with something else. E.g. snippets ('rc' might be replaced | ||
* with boilerplate code for react component). More information on the | ||
* exact problem can be found here - | ||
* https://github.com/facebook/draft-js/commit/07892ba479bd4dfc6afd1e0ed179aaf51cd138b1 | ||
* | ||
* 2. intended to handle spellcheck and autocorrect changes, | ||
* which occur in the DOM natively without any opportunity to observe or | ||
@@ -65,14 +77,7 @@ * interpret the changes before they occur. | ||
isCollapsed = domSelection.isCollapsed; | ||
var isNotTextNode = anchorNode.nodeType !== Node.TEXT_NODE; | ||
var isNotTextOrElementNode = anchorNode.nodeType !== Node.TEXT_NODE && anchorNode.nodeType !== Node.ELEMENT_NODE; | ||
if (gkx('draft_killswitch_allow_nontextnodes')) { | ||
if (isNotTextNode) { | ||
return; | ||
} | ||
} else { | ||
if (isNotTextOrElementNode) { | ||
// TODO: (t16149272) figure out context for this change | ||
return; | ||
} | ||
if (isNotTextOrElementNode) { | ||
// TODO: (t16149272) figure out context for this change | ||
return; | ||
} | ||
@@ -153,4 +158,4 @@ | ||
var entityKey = block.getEntityAt(start); | ||
var entity = entityKey && content.getEntity(entityKey); | ||
var entityType = entity && entity.getMutability(); | ||
var entity = notEmptyKey(entityKey) ? content.getEntity(entityKey) : null; | ||
var entityType = entity != null ? entity.getMutability() : null; | ||
var preserveEntity = entityType === 'MUTABLE'; // Immutable or segmented entities cannot properly be handled by the | ||
@@ -157,0 +162,0 @@ // default browser undo, so we have to use a different change type to |
@@ -186,3 +186,3 @@ /** | ||
if (!command) { | ||
if (command == null || command === '') { | ||
if (keyCode === Keys.SPACE && isChrome && isOptionKeyCommand(e)) { | ||
@@ -189,0 +189,0 @@ // The default keydown event has already been prevented in order to stop |
@@ -44,2 +44,4 @@ /** | ||
if (!data.isRichText()) { | ||
/* $FlowFixMe This comment suppresses an error found DataTransfer was typed. | ||
* getFiles() returns an array of <Files extends Blob>, not Blob */ | ||
var files = data.getFiles(); | ||
@@ -46,0 +48,0 @@ var defaultFileText = data.getText(); |
@@ -28,2 +28,3 @@ /** | ||
var updateExistingBlock = function updateExistingBlock(contentState, selectionState, blockMap, fragmentBlock, targetKey, targetOffset) { | ||
var mergeBlockData = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 'REPLACE_WITH_NEW_DATA'; | ||
var targetBlock = blockMap.get(targetKey); | ||
@@ -34,6 +35,18 @@ var text = targetBlock.getText(); | ||
var finalOffset = targetOffset + fragmentBlock.getText().length; | ||
var data = null; | ||
switch (mergeBlockData) { | ||
case 'MERGE_OLD_DATA_TO_NEW_DATA': | ||
data = fragmentBlock.getData().merge(targetBlock.getData()); | ||
break; | ||
case 'REPLACE_WITH_NEW_DATA': | ||
data = fragmentBlock.getData(); | ||
break; | ||
} | ||
var newBlock = targetBlock.merge({ | ||
text: text.slice(0, targetOffset) + fragmentBlock.getText() + text.slice(targetOffset), | ||
characterList: insertIntoList(chars, fragmentBlock.getCharacterList(), targetOffset), | ||
data: fragmentBlock.getData() | ||
data: data | ||
}); | ||
@@ -216,2 +229,3 @@ return contentState.merge({ | ||
var insertFragmentIntoContentState = function insertFragmentIntoContentState(contentState, selectionState, fragmentBlockMap) { | ||
var mergeBlockData = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'REPLACE_WITH_NEW_DATA'; | ||
!selectionState.isCollapsed() ? process.env.NODE_ENV !== "production" ? invariant(false, '`insertFragment` should only be called with a collapsed selection state.') : invariant(false) : void 0; | ||
@@ -231,3 +245,3 @@ var blockMap = contentState.getBlockMap(); | ||
if (fragment.size === 1) { | ||
return updateExistingBlock(contentState, selectionState, blockMap, fragment.first(), targetKey, targetOffset); | ||
return updateExistingBlock(contentState, selectionState, blockMap, fragment.first(), targetKey, targetOffset, mergeBlockData); | ||
} | ||
@@ -234,0 +248,0 @@ |
@@ -16,3 +16,5 @@ /** | ||
*/ | ||
function insertIntoList(targetList, toInsert, offset) { | ||
function insertIntoList(targetListArg, toInsert, offset) { | ||
var targetList = targetListArg; | ||
if (offset === targetList.count()) { | ||
@@ -19,0 +21,0 @@ toInsert.forEach(function (c) { |
{ | ||
"name": "draft-js", | ||
"description": "A React framework for building text editors.", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"keywords": [ | ||
@@ -46,2 +46,3 @@ "draftjs", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.4.4", | ||
"@babel/plugin-proposal-optional-chaining": "^7.6.0", | ||
"babel-eslint": "^8.1.1", | ||
@@ -48,0 +49,0 @@ "babel-preset-fbjs": "^3.2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1740570
337
26447
41