withspectrum / draft-js-markdown-plugin

An opinionated DraftJS plugin for supporting Markdown syntax shortcuts
https://markdown-plugin.spectrum.chat/
MIT License
139 stars 42 forks source link

DraftJS v0.11.x Support #186

Open jakobo opened 4 years ago

jakobo commented 4 years ago

Fixes #181

To support DraftJS v0.11.x forward, handleBeforeInput needs to take an additional parameter eventTimestamp for synchronizing collaborative actions. This change adds support for eventTimestamp, updates all tests and snapshots, and updates the peerDependencies to match.

Contains stylistic changes triggered by saving with a .prettierrc. Since it was complaining in vscode, I also fixed the singleQuote property to match the intended value from the prettier docs.

BREAKING CHANGE: The changes to DraftJS and draft-js-plugin-editor are not backwards compatible with the 0.10.x/2.0.0 versions respectively. The peerDependencies were updated to reflect this and a note was added to the readme.

note: this PR is intentionally in smaller commits for the purpose of more efficient rebasing. At owner's request, I'm happy to squash these down to a single commit on approval & before merge. ❤️

tantaman commented 4 years ago

nice

but it'd be easier to review if you removed all the random formatting changes. For anyone who is curious, there fix is just a small change which adds a single variable to the parameter list of handleBeforeInput