Mailspring/internal_packages
Juan Tejada 96da7ccb2d feat(editor-region): Add support to register components as editors
Summary:
- The main purpose of this is to be able to properly register the editor for the markdown plugin (and any other plugins to come)

- Refactors ComposerView and Contenteditable ->
  - Replaces Contenteditable with an InjectedComponent for a new region role:
    "Composer:Editor"
  - Creates a new component called ComposerEditor, which is the one that is
    being registered by default as "Composer:Editor"
  - I used this class to try to standardize the props that should be
    passed to any would be editor Component:
    - Renamed a bunch of the props which (I think) had a bit of
      confusing names
    - Added a bunch of docs for these in the source file, although
      I feel like those docs should live elsewhere, like in the
      ComponentRegion docs.
  - In the process, I ended up pulling some stuff out of ComposerView and
    some stuff out of the Contenteditable, namely:
    - The scrolling logic to ensure that the composer is visible while
      typing was moved outside of the Contenteditable -- this feels more
      like the ComposerEditor's responsibility, especially since the
      Contenteditable is meant to be used in other contexts as well.
    - The ComposerExtensions state; it feels less awkward for me if this
      is inside the ComposerEditor because 1) ComposerView does less
      things, 2) these are actually just being passed to the
      Contenteditable, 3) I feel like other plugins shouldn't need to
      mess around with ComposerExtensions, so we shouldn't pass them to the
      editor. If you register an editor different from our default one,
      any other ComposerExtension callbacks will be disabled, which
      I feel is expected behavior.
  - I think there is still some more refactoring to be done, and I left some TODOS
    here and there, but I think this diff is already big enough and its a minimal
    set of changes to get the markdown editor working in a not so duck
    tapish way.
- New props for InjectedComponent:
  - `requiredMethods`: allows you to define a collection of methods that
    should be implemented by any Component that registers for your
    desired region.
    - It will throw an error if these are not implemented
    - It will automatically pass calls made on the InjectedComponent to these methods
      down to the instance of the actual registered component
    - Would love some comments on this approach and impl
  - `fallback`: allows you to define a default component to use if none were
    registered through the ComponentRegistry
- Misc:
  - Added a new test case for the QuotedHTMLTransformer
- Tests:
  - They were minimally updated so that they don't break, but a big TODO
    is to properly refactor them. I plan to do that in an upcoming
    diff.

Test Plan: - Unit tests

Reviewers: bengotow, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D2372
2015-12-18 11:06:44 -08:00
..
account-sidebar fix(warning): Remove implicit return from event handler to remove react 2015-12-10 18:19:13 -08:00
attachments fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
category-picker fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
composer feat(editor-region): Add support to register components as editors 2015-12-18 11:06:44 -08:00
composer-signature fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
composer-spellcheck fix(spellcheck): check for existing languages and add tests 2015-12-09 18:10:55 -05:00
events feat(observables): Implementation of observables to replace some stores 2015-12-07 16:52:46 -08:00
feedback bump(electron): 0.34.3 => 0.35.1 2015-11-23 22:09:17 -08:00
inbox-contact-elements fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
message-autoload-images fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
message-list feat(editor-region): Add support to register components as editors 2015-12-18 11:06:44 -08:00
mode-switch fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
notification-mailto fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
notification-update-available fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
notifications feat(observables): Implementation of observables to replace some stores 2015-12-07 16:52:46 -08:00
onboarding fix(auth): Log first account creation 2015-12-08 17:05:59 -08:00
plugins fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
preferences fix(aliases): Add note that aliases may need to be setup 2015-12-15 11:56:31 -08:00
print fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
search-bar fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
sidebar-fullcontact feat(transactions): Explicit (and faster) database transactions 2015-12-17 11:46:05 -08:00
system-tray fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
thread-list fix(shortcuts): Fix shortcut handlers for marking as read/unread 2015-12-14 10:32:45 -08:00
tooltip fix(license): GPLv3 => GPL-3.0 2015-12-07 10:50:47 -08:00
ui-dark feat(theme-selector): Add theme selector to preferences page 2015-12-15 10:29:58 -08:00
ui-light feat(theme-selector): Add theme selector to preferences page 2015-12-15 10:29:58 -08:00
undo-redo fix(theme): Dark mode styling for undo/redo component 2015-12-07 15:11:11 -08:00
unread-notifications feat(account-prefs): Adds new page for Account in preferences 2015-12-10 15:27:29 -08:00
worker-sync feat(transactions): Explicit (and faster) database transactions 2015-12-17 11:46:05 -08:00
worker-ui feat(transactions): Explicit (and faster) database transactions 2015-12-17 11:46:05 -08:00