Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Markdown-style shortcuts for inline formats #134

Closed
thibaudcolas opened this issue Jan 15, 2018 · 4 comments
Closed

Add Markdown-style shortcuts for inline formats #134

thibaudcolas opened this issue Jan 15, 2018 · 4 comments
Labels
enhancement New feature or request help wanted Extra attention is needed
Milestone

Comments

@thibaudcolas
Copy link
Collaborator

Feature. Follow-up to #53

What is the current behavior?

At the moment, only block-level formatting (headings, lists, etc) & horizontal rules have Markdown shortcuts.

draftail-markdown-style

What is the expected behavior?

It would be cool to have shortcuts for inline formatting:

this is `code`, *italic*, _italic_, **bold**, __bold__
@thibaudcolas thibaudcolas added enhancement New feature or request help wanted Extra attention is needed labels Jan 15, 2018
@thibaudcolas thibaudcolas added this to the Post v1.0.0 milestone Jan 15, 2018
@thibaudcolas
Copy link
Collaborator Author

I realise now that this might be a bit harder than I had initially envisioned, because inline styles created with those markers shouldn't be sticky (while toolbar ones probably should). See withspectrum/draft-js-markdown-plugin#83 (comment).

@loicteixeira
Copy link

loicteixeira commented Jun 5, 2018

Umm that's a tough one. I think there are 2 scenarios to consider:

  1. As you type
  2. As you edit (e.g. when moving the cursor back to the ~start/~end of a text with inline-style)

In the first case, I would agree that once you "close" the style (with the corresponding Markdown tag), there should be no stickiness. It isn't different from the keyboard shortcuts behaviour (e.g. you press cmd+B to "enable" bold mode as you type, but as soon as you press cmd+B again to "disable" it, the bold style isn't sticky).

In the second case, I think it should be sticky as there would be no indication whether that style was applied via the toolbar or markdown formatting. This is the current behaviour whether you used the keyboard shortcut or the toolbar and markdown should be no different.

FWIW, Google Drive seems to have stickiness but Dropbox Paper doesn't. I can't test with Word.

Edit: I realise that in the as you edit scenario, the style is only sticky at the end of the style, not at the start of it but it might be for another issue.

@thibaudcolas
Copy link
Collaborator Author

thibaudcolas commented Jan 7, 2019

Totally agree with @loicteixeira's view above.

I think I found a way to have the best of both worlds, which is to only apply the style after the user enters an extra space character after the closing Markdown tag. For example in Dropbox Paper:

paper-markdown

Interestingly, it works differently for the code formatting, which doesn't require the space and never sticks. I'm not sure what to think of that.


Edit: here's an example where styles are never continued: https://markdown-plugin.spectrum.chat/. While I find it ok personally, I'm pretty sure there are lots of people used to continuing styles (or pressing a shortcut like cmd+B, then typing), so to me subsequent additions of text should continue the style no matter how it was entered.

@thibaudcolas
Copy link
Collaborator Author

Implemented in #187.

thibaudcolas added a commit to thibaudcolas/wagtail that referenced this issue Mar 4, 2019
This includes:

- [v1.0.0](https://github.com/springload/draftail/releases/tag/v1.0.0) (identical to v0.17.2)
- [v1.1.0](https://github.com/springload/draftail/releases/tag/v1.1.0) (contains fix for wagtail#4985)
- [v1.2.0](https://github.com/springload/draftail/releases/tag/v1.2.0)

Here is the combined CHANGELOG for what's relevant to Wagtail:

- wagtail#4985 – Prevent crash when filtering pasted content whose last block is to be removed (e.g. unsupported image) ([wagtail#179](springload/draftail#179)).
- Stop unnecessarily calling `onSave` in the editor’s `onBlur` ([wagtail#173](springload/draftail#173)).
- Prevent crash in `DraftUtils.getEntitySelection`, when the provided entity key isn't valid (undefined, missing) ([wagtail#168](springload/draftail#168)).
- Fix entity removal and editing not doing anything when the selection is backwards (right to left) ([wagtail#168](springload/draftail#168)).
- Prevent the editor from crashing when copy-paste filtering removes all of its content (thibaudcolas/draftjs-filters@652750f)

- Add support for Markdown shortcuts for inline styles, e.g. `**` for bold, `_` for italic, etc ([wagtail#134](springload/draftail#134), [wagtail#187](springload/draftail#187)). View the full list of [keyboard shortcuts](https://www.draftail.org/docs/keyboard-shortcuts).

- Add [`onFocus`](https://www.draftail.org/docs/api#managing-focus) and [`onBlur`](https://www.draftail.org/docs/api#managing-focus) props to use callbacks on those events. This can be useful for [form validation](https://www.draftail.org/docs/next/form-validation). [wagtail#170](springload/draftail#170), [wagtail#174](springload/draftail#174), thanks to [@TheSpicyMeatball](https://github.com/TheSpicyMeatball).
- Add [`plugins`](https://www.draftail.org/docs/plugins) API to support extensions of the editor using the [draft-js-plugins](https://github.com/draft-js-plugins/draft-js-plugins) architecture ([wagtail#83](springload/draftail#83), [wagtail#171](springload/draftail#171)).
- Add ability to disable or customise the editor toolbar with [`topToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add ability to add a toolbar below the editor with [`bottomToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add data reset parameter to `DraftUtils.resetBlockWithType()`.
- Enable list continuation on Enter for custom `*-list-item` blocks. All that’s required is for the block type to end with `-list-item`.

None of those API additions will be usable within Wagtail (at least without hacks) until corresponding rich text features APIs are built to allow their configuration. The last 2 additions would already be usable but they would only be useful when leveraging the other APIs.
thibaudcolas added a commit to thibaudcolas/wagtail that referenced this issue Mar 4, 2019
This includes:

- [v1.0.0](https://github.com/springload/draftail/releases/tag/v1.0.0) (identical to v0.17.2)
- [v1.1.0](https://github.com/springload/draftail/releases/tag/v1.1.0) (contains fix for wagtail#4985)
- [v1.2.0](https://github.com/springload/draftail/releases/tag/v1.2.0)

Here is the combined CHANGELOG for what's relevant to Wagtail:

Bug fixes
~~~~~~~~~

- wagtail#4985 – Prevent crash when filtering pasted content whose last block is to be removed (e.g. unsupported image) ([wagtail#179](springload/draftail#179)).
- Stop unnecessarily calling `onSave` in the editor’s `onBlur` ([wagtail#173](springload/draftail#173)).
- Prevent crash in `DraftUtils.getEntitySelection`, when the provided entity key isn't valid (undefined, missing) ([wagtail#168](springload/draftail#168)).
- Fix entity removal and editing not doing anything when the selection is backwards (right to left) ([wagtail#168](springload/draftail#168)).
- Prevent the editor from crashing when copy-paste filtering removes all of its content (thibaudcolas/draftjs-filters@652750f)

New features
~~~~~~~~~~~~

- Add support for Markdown shortcuts for inline styles, e.g. `**` for bold, `_` for italic, etc ([wagtail#134](springload/draftail#134), [wagtail#187](springload/draftail#187)). View the full list of [keyboard shortcuts](https://www.draftail.org/docs/keyboard-shortcuts).

New APIs
~~~~~~~~

- Add [`onFocus`](https://www.draftail.org/docs/api#managing-focus) and [`onBlur`](https://www.draftail.org/docs/api#managing-focus) props to use callbacks on those events. This can be useful for [form validation](https://www.draftail.org/docs/next/form-validation). [wagtail#170](springload/draftail#170), [wagtail#174](springload/draftail#174), thanks to [@TheSpicyMeatball](https://github.com/TheSpicyMeatball).
- Add [`plugins`](https://www.draftail.org/docs/plugins) API to support extensions of the editor using the [draft-js-plugins](https://github.com/draft-js-plugins/draft-js-plugins) architecture ([wagtail#83](springload/draftail#83), [wagtail#171](springload/draftail#171)).
- Add ability to disable or customise the editor toolbar with [`topToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add ability to add a toolbar below the editor with [`bottomToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add data reset parameter to `DraftUtils.resetBlockWithType()`.
- Enable list continuation on Enter for custom `*-list-item` blocks. All that’s required is for the block type to end with `-list-item`.

None of those API additions will be usable within Wagtail (at least without hacks) until corresponding rich text features APIs are built to allow their configuration. The last 2 additions would already be usable but they would only be useful when leveraging the other APIs.
thibaudcolas added a commit to thibaudcolas/wagtail that referenced this issue Mar 7, 2019
This includes:

- [v1.0.0](https://github.com/springload/draftail/releases/tag/v1.0.0) (identical to v0.17.2)
- [v1.1.0](https://github.com/springload/draftail/releases/tag/v1.1.0) (contains fix for wagtail#4985)
- [v1.2.0](https://github.com/springload/draftail/releases/tag/v1.2.0)

Here is the combined CHANGELOG for what's relevant to Wagtail:

Bug fixes
~~~~~~~~~

- wagtail#4985 – Prevent crash when filtering pasted content whose last block is to be removed (e.g. unsupported image) ([wagtail#179](springload/draftail#179)).
- Stop unnecessarily calling `onSave` in the editor’s `onBlur` ([wagtail#173](springload/draftail#173)).
- Prevent crash in `DraftUtils.getEntitySelection`, when the provided entity key isn't valid (undefined, missing) ([wagtail#168](springload/draftail#168)).
- Fix entity removal and editing not doing anything when the selection is backwards (right to left) ([wagtail#168](springload/draftail#168)).
- Prevent the editor from crashing when copy-paste filtering removes all of its content (thibaudcolas/draftjs-filters@652750f)

New features
~~~~~~~~~~~~

- Add support for Markdown shortcuts for inline styles, e.g. `**` for bold, `_` for italic, etc ([wagtail#134](springload/draftail#134), [wagtail#187](springload/draftail#187)). View the full list of [keyboard shortcuts](https://www.draftail.org/docs/keyboard-shortcuts).

New APIs
~~~~~~~~

- Add [`onFocus`](https://www.draftail.org/docs/api#managing-focus) and [`onBlur`](https://www.draftail.org/docs/api#managing-focus) props to use callbacks on those events. This can be useful for [form validation](https://www.draftail.org/docs/next/form-validation). [wagtail#170](springload/draftail#170), [wagtail#174](springload/draftail#174), thanks to [@TheSpicyMeatball](https://github.com/TheSpicyMeatball).
- Add [`plugins`](https://www.draftail.org/docs/plugins) API to support extensions of the editor using the [draft-js-plugins](https://github.com/draft-js-plugins/draft-js-plugins) architecture ([wagtail#83](springload/draftail#83), [wagtail#171](springload/draftail#171)).
- Add ability to disable or customise the editor toolbar with [`topToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add ability to add a toolbar below the editor with [`bottomToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add data reset parameter to `DraftUtils.resetBlockWithType()`.
- Enable list continuation on Enter for custom `*-list-item` blocks. All that’s required is for the block type to end with `-list-item`.

None of those API additions will be usable within Wagtail (at least without hacks) until corresponding rich text features APIs are built to allow their configuration. The last 2 additions would already be usable but they would only be useful when leveraging the other APIs.
thibaudcolas added a commit to thibaudcolas/wagtail that referenced this issue Mar 7, 2019
This includes:

- [v1.0.0](https://github.com/springload/draftail/releases/tag/v1.0.0) (identical to v0.17.2)
- [v1.1.0](https://github.com/springload/draftail/releases/tag/v1.1.0) (contains fix for wagtail#4985)
- [v1.2.0](https://github.com/springload/draftail/releases/tag/v1.2.0)
- [v1.2.1](https://github.com/springload/draftail/releases/tag/v1.2.1) (fixes regression in v1.2.0)

Here is the combined CHANGELOG for what's relevant to Wagtail:

Bug fixes
~~~~~~~~~

- wagtail#4985 – Prevent crash when filtering pasted content whose last block is to be removed (e.g. unsupported image) ([wagtail#179](springload/draftail#179)).
- Stop unnecessarily calling `onSave` in the editor’s `onBlur` ([wagtail#173](springload/draftail#173)).
- Prevent crash in `DraftUtils.getEntitySelection`, when the provided entity key isn't valid (undefined, missing) ([wagtail#168](springload/draftail#168)).
- Fix entity removal and editing not doing anything when the selection is backwards (right to left) ([wagtail#168](springload/draftail#168)).
- Prevent the editor from crashing when copy-paste filtering removes all of its content (thibaudcolas/draftjs-filters@652750f)

New features
~~~~~~~~~~~~

- Add support for Markdown shortcuts for inline styles, e.g. `**` for bold, `_` for italic, etc ([wagtail#134](springload/draftail#134), [wagtail#187](springload/draftail#187)). View the full list of [keyboard shortcuts](https://www.draftail.org/docs/keyboard-shortcuts).

New APIs
~~~~~~~~

- Add [`onFocus`](https://www.draftail.org/docs/api#managing-focus) and [`onBlur`](https://www.draftail.org/docs/api#managing-focus) props to use callbacks on those events. This can be useful for [form validation](https://www.draftail.org/docs/next/form-validation). [wagtail#170](springload/draftail#170), [wagtail#174](springload/draftail#174), thanks to [@TheSpicyMeatball](https://github.com/TheSpicyMeatball).
- Add [`plugins`](https://www.draftail.org/docs/plugins) API to support extensions of the editor using the [draft-js-plugins](https://github.com/draft-js-plugins/draft-js-plugins) architecture ([wagtail#83](springload/draftail#83), [wagtail#171](springload/draftail#171)).
- Add ability to disable or customise the editor toolbar with [`topToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add ability to add a toolbar below the editor with [`bottomToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add data reset parameter to `DraftUtils.resetBlockWithType()`.
- Enable list continuation on Enter for custom `*-list-item` blocks. All that’s required is for the block type to end with `-list-item`.

None of those API additions will be usable within Wagtail (at least without hacks) until corresponding rich text features APIs are built to allow their configuration. The last 2 additions would already be usable but they would only be useful when leveraging the other APIs.
thibaudcolas added a commit to thibaudcolas/wagtail that referenced this issue Mar 7, 2019
This includes:

- [v1.0.0](https://github.com/springload/draftail/releases/tag/v1.0.0) (identical to v0.17.2)
- [v1.1.0](https://github.com/springload/draftail/releases/tag/v1.1.0) (contains fix for wagtail#4985)
- [v1.2.0](https://github.com/springload/draftail/releases/tag/v1.2.0)
- [v1.2.1](https://github.com/springload/draftail/releases/tag/v1.2.1) (fixes regression in v1.2.0)

Here is the combined CHANGELOG for what's relevant to Wagtail:

Bug fixes
~~~~~~~~~

- wagtail#4985 – Prevent crash when filtering pasted content whose last block is to be removed (e.g. unsupported image) ([wagtail#179](springload/draftail#179)).
- Stop unnecessarily calling `onSave` in the editor’s `onBlur` ([wagtail#173](springload/draftail#173)).
- Prevent crash in `DraftUtils.getEntitySelection`, when the provided entity key isn't valid (undefined, missing) ([wagtail#168](springload/draftail#168)).
- Fix entity removal and editing not doing anything when the selection is backwards (right to left) ([wagtail#168](springload/draftail#168)).
- Prevent the editor from crashing when copy-paste filtering removes all of its content (thibaudcolas/draftjs-filters@652750f)

New features
~~~~~~~~~~~~

- Add support for Markdown shortcuts for inline styles, e.g. `**` for bold, `_` for italic, etc ([wagtail#134](springload/draftail#134), [wagtail#187](springload/draftail#187)). View the full list of [keyboard shortcuts](https://www.draftail.org/docs/keyboard-shortcuts).

New APIs
~~~~~~~~

- Add [`onFocus`](https://www.draftail.org/docs/api#managing-focus) and [`onBlur`](https://www.draftail.org/docs/api#managing-focus) props to use callbacks on those events. This can be useful for [form validation](https://www.draftail.org/docs/next/form-validation). [wagtail#170](springload/draftail#170), [wagtail#174](springload/draftail#174), thanks to [@TheSpicyMeatball](https://github.com/TheSpicyMeatball).
- Add [`plugins`](https://www.draftail.org/docs/plugins) API to support extensions of the editor using the [draft-js-plugins](https://github.com/draft-js-plugins/draft-js-plugins) architecture ([wagtail#83](springload/draftail#83), [wagtail#171](springload/draftail#171)).
- Add ability to disable or customise the editor toolbar with [`topToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add ability to add a toolbar below the editor with [`bottomToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add data reset parameter to `DraftUtils.resetBlockWithType()`.
- Enable list continuation on Enter for custom `*-list-item` blocks. All that’s required is for the block type to end with `-list-item`.

None of those API additions will be usable within Wagtail (at least without hacks) until corresponding rich text features APIs are built to allow their configuration. The last 2 additions would already be usable but they would only be useful when leveraging the other APIs.
thibaudcolas added a commit to thibaudcolas/wagtail that referenced this issue Mar 15, 2019
This includes:

- [v1.0.0](https://github.com/springload/draftail/releases/tag/v1.0.0) (identical to v0.17.2)
- [v1.1.0](https://github.com/springload/draftail/releases/tag/v1.1.0) (contains fix for wagtail#4985)
- [v1.2.0](https://github.com/springload/draftail/releases/tag/v1.2.0)
- [v1.2.1](https://github.com/springload/draftail/releases/tag/v1.2.1) (fixes regression in v1.2.0)

Here is the combined CHANGELOG for what's relevant to Wagtail:

Bug fixes
~~~~~~~~~

- wagtail#4985 – Prevent crash when filtering pasted content whose last block is to be removed (e.g. unsupported image) ([wagtail#179](springload/draftail#179)).
- Stop unnecessarily calling `onSave` in the editor’s `onBlur` ([wagtail#173](springload/draftail#173)).
- Prevent crash in `DraftUtils.getEntitySelection`, when the provided entity key isn't valid (undefined, missing) ([wagtail#168](springload/draftail#168)).
- Fix entity removal and editing not doing anything when the selection is backwards (right to left) ([wagtail#168](springload/draftail#168)).
- Prevent the editor from crashing when copy-paste filtering removes all of its content (thibaudcolas/draftjs-filters@652750f)

New features
~~~~~~~~~~~~

- Add support for Markdown shortcuts for inline styles, e.g. `**` for bold, `_` for italic, etc ([wagtail#134](springload/draftail#134), [wagtail#187](springload/draftail#187)). View the full list of [keyboard shortcuts](https://www.draftail.org/docs/keyboard-shortcuts).

New APIs
~~~~~~~~

- Add [`onFocus`](https://www.draftail.org/docs/api#managing-focus) and [`onBlur`](https://www.draftail.org/docs/api#managing-focus) props to use callbacks on those events. This can be useful for [form validation](https://www.draftail.org/docs/next/form-validation). [wagtail#170](springload/draftail#170), [wagtail#174](springload/draftail#174), thanks to [@TheSpicyMeatball](https://github.com/TheSpicyMeatball).
- Add [`plugins`](https://www.draftail.org/docs/plugins) API to support extensions of the editor using the [draft-js-plugins](https://github.com/draft-js-plugins/draft-js-plugins) architecture ([wagtail#83](springload/draftail#83), [wagtail#171](springload/draftail#171)).
- Add ability to disable or customise the editor toolbar with [`topToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add ability to add a toolbar below the editor with [`bottomToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add data reset parameter to `DraftUtils.resetBlockWithType()`.
- Enable list continuation on Enter for custom `*-list-item` blocks. All that’s required is for the block type to end with `-list-item`.

None of those API additions will be usable within Wagtail (at least without hacks) until corresponding rich text features APIs are built to allow their configuration. The last 2 additions would already be usable but they would only be useful when leveraging the other APIs.
thibaudcolas added a commit to thibaudcolas/wagtail that referenced this issue Mar 15, 2019
This includes:

- [v1.0.0](https://github.com/springload/draftail/releases/tag/v1.0.0) (identical to v0.17.2)
- [v1.1.0](https://github.com/springload/draftail/releases/tag/v1.1.0) (contains fix for wagtail#4985)
- [v1.2.0](https://github.com/springload/draftail/releases/tag/v1.2.0)
- [v1.2.1](https://github.com/springload/draftail/releases/tag/v1.2.1) (fixes regression in v1.2.0)

Here is the combined CHANGELOG for what's relevant to Wagtail:

Bug fixes
~~~~~~~~~

- wagtail#4985 – Prevent crash when filtering pasted content whose last block is to be removed (e.g. unsupported image) ([wagtail#179](springload/draftail#179)).
- Stop unnecessarily calling `onSave` in the editor’s `onBlur` ([wagtail#173](springload/draftail#173)).
- Prevent crash in `DraftUtils.getEntitySelection`, when the provided entity key isn't valid (undefined, missing) ([wagtail#168](springload/draftail#168)).
- Fix entity removal and editing not doing anything when the selection is backwards (right to left) ([wagtail#168](springload/draftail#168)).
- Prevent the editor from crashing when copy-paste filtering removes all of its content (thibaudcolas/draftjs-filters@652750f)

New features
~~~~~~~~~~~~

- Add support for Markdown shortcuts for inline styles, e.g. `**` for bold, `_` for italic, etc ([wagtail#134](springload/draftail#134), [wagtail#187](springload/draftail#187)). View the full list of [keyboard shortcuts](https://www.draftail.org/docs/keyboard-shortcuts).

New APIs
~~~~~~~~

- Add [`onFocus`](https://www.draftail.org/docs/api#managing-focus) and [`onBlur`](https://www.draftail.org/docs/api#managing-focus) props to use callbacks on those events. This can be useful for [form validation](https://www.draftail.org/docs/next/form-validation). [wagtail#170](springload/draftail#170), [wagtail#174](springload/draftail#174), thanks to [@TheSpicyMeatball](https://github.com/TheSpicyMeatball).
- Add [`plugins`](https://www.draftail.org/docs/plugins) API to support extensions of the editor using the [draft-js-plugins](https://github.com/draft-js-plugins/draft-js-plugins) architecture ([wagtail#83](springload/draftail#83), [wagtail#171](springload/draftail#171)).
- Add ability to disable or customise the editor toolbar with [`topToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add ability to add a toolbar below the editor with [`bottomToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add data reset parameter to `DraftUtils.resetBlockWithType()`.
- Enable list continuation on Enter for custom `*-list-item` blocks. All that’s required is for the block type to end with `-list-item`.

None of those API additions will be usable within Wagtail (at least without hacks) until corresponding rich text features APIs are built to allow their configuration. The last 2 additions would already be usable but they would only be useful when leveraging the other APIs.
thibaudcolas added a commit to thibaudcolas/wagtail that referenced this issue Mar 21, 2019
This includes:

- [v1.0.0](https://github.com/springload/draftail/releases/tag/v1.0.0) (identical to v0.17.2)
- [v1.1.0](https://github.com/springload/draftail/releases/tag/v1.1.0) (contains fix for wagtail#4985)
- [v1.2.0](https://github.com/springload/draftail/releases/tag/v1.2.0)
- [v1.2.1](https://github.com/springload/draftail/releases/tag/v1.2.1) (fixes regression in v1.2.0)

Here is the combined CHANGELOG for what's relevant to Wagtail:

Bug fixes
~~~~~~~~~

- wagtail#4985 – Prevent crash when filtering pasted content whose last block is to be removed (e.g. unsupported image) ([wagtail#179](springload/draftail#179)).
- Stop unnecessarily calling `onSave` in the editor’s `onBlur` ([wagtail#173](springload/draftail#173)).
- Prevent crash in `DraftUtils.getEntitySelection`, when the provided entity key isn't valid (undefined, missing) ([wagtail#168](springload/draftail#168)).
- Fix entity removal and editing not doing anything when the selection is backwards (right to left) ([wagtail#168](springload/draftail#168)).
- Prevent the editor from crashing when copy-paste filtering removes all of its content (thibaudcolas/draftjs-filters@652750f)

New features
~~~~~~~~~~~~

- Add support for Markdown shortcuts for inline styles, e.g. `**` for bold, `_` for italic, etc ([wagtail#134](springload/draftail#134), [wagtail#187](springload/draftail#187)). View the full list of [keyboard shortcuts](https://www.draftail.org/docs/keyboard-shortcuts).

New APIs
~~~~~~~~

- Add [`onFocus`](https://www.draftail.org/docs/api#managing-focus) and [`onBlur`](https://www.draftail.org/docs/api#managing-focus) props to use callbacks on those events. This can be useful for [form validation](https://www.draftail.org/docs/next/form-validation). [wagtail#170](springload/draftail#170), [wagtail#174](springload/draftail#174), thanks to [@TheSpicyMeatball](https://github.com/TheSpicyMeatball).
- Add [`plugins`](https://www.draftail.org/docs/plugins) API to support extensions of the editor using the [draft-js-plugins](https://github.com/draft-js-plugins/draft-js-plugins) architecture ([wagtail#83](springload/draftail#83), [wagtail#171](springload/draftail#171)).
- Add ability to disable or customise the editor toolbar with [`topToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add ability to add a toolbar below the editor with [`bottomToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add data reset parameter to `DraftUtils.resetBlockWithType()`.
- Enable list continuation on Enter for custom `*-list-item` blocks. All that’s required is for the block type to end with `-list-item`.

None of those API additions will be usable within Wagtail (at least without hacks) until corresponding rich text features APIs are built to allow their configuration. The last 2 additions would already be usable but they would only be useful when leveraging the other APIs.
thibaudcolas added a commit to wagtail/wagtail that referenced this issue Mar 21, 2019
…5117)

This includes:

- [v1.0.0](https://github.com/springload/draftail/releases/tag/v1.0.0) (identical to v0.17.2)
- [v1.1.0](https://github.com/springload/draftail/releases/tag/v1.1.0) (contains fix for #4985)
- [v1.2.0](https://github.com/springload/draftail/releases/tag/v1.2.0)
- [v1.2.1](https://github.com/springload/draftail/releases/tag/v1.2.1) (fixes regression in v1.2.0)

Here is the combined CHANGELOG for what's relevant to Wagtail:

Bug fixes
~~~~~~~~~

- #4985 – Prevent crash when filtering pasted content whose last block is to be removed (e.g. unsupported image) ([#179](springload/draftail#179)).
- Stop unnecessarily calling `onSave` in the editor’s `onBlur` ([#173](springload/draftail#173)).
- Prevent crash in `DraftUtils.getEntitySelection`, when the provided entity key isn't valid (undefined, missing) ([#168](springload/draftail#168)).
- Fix entity removal and editing not doing anything when the selection is backwards (right to left) ([#168](springload/draftail#168)).
- Prevent the editor from crashing when copy-paste filtering removes all of its content (thibaudcolas/draftjs-filters@652750f)

New features
~~~~~~~~~~~~

- Add support for Markdown shortcuts for inline styles, e.g. `**` for bold, `_` for italic, etc ([#134](springload/draftail#134), [#187](springload/draftail#187)). View the full list of [keyboard shortcuts](https://www.draftail.org/docs/keyboard-shortcuts).

New APIs
~~~~~~~~

- Add [`onFocus`](https://www.draftail.org/docs/api#managing-focus) and [`onBlur`](https://www.draftail.org/docs/api#managing-focus) props to use callbacks on those events. This can be useful for [form validation](https://www.draftail.org/docs/next/form-validation). [#170](springload/draftail#170), [#174](springload/draftail#174), thanks to [@TheSpicyMeatball](https://github.com/TheSpicyMeatball).
- Add [`plugins`](https://www.draftail.org/docs/plugins) API to support extensions of the editor using the [draft-js-plugins](https://github.com/draft-js-plugins/draft-js-plugins) architecture ([#83](springload/draftail#83), [#171](springload/draftail#171)).
- Add ability to disable or customise the editor toolbar with [`topToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add ability to add a toolbar below the editor with [`bottomToolbar`](https://www.draftail.org/docs/customising-toolbars).
- Add data reset parameter to `DraftUtils.resetBlockWithType()`.
- Enable list continuation on Enter for custom `*-list-item` blocks. All that’s required is for the block type to end with `-list-item`.

None of those API additions will be usable within Wagtail (at least without hacks) until corresponding rich text features APIs are built to allow their configuration. The last 2 additions would already be usable but they would only be useful when leveraging the other APIs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants