💌 A beautiful, fast and fully open source mail client for Mac, Windows and Linux.
Go to file
Juan Tejada b559d41bed 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
apm refactor(env): new NylasEnv global 2015-11-17 16:41:20 -08:00
build fix(locales): Copy lproj files to ensure navigator.language works 2015-12-15 11:34:56 -08:00
docs docs(tests): add docs about integration testing 2015-12-11 16:25:25 -05:00
dot-nylas feat(keymap): add new <KeymapHandlers /> 2015-11-06 11:47:06 -08:00
examples fix(quickschedule): Several UI fixes 2015-12-09 16:41:30 -08:00
internal_packages feat(editor-region): Add support to register components as editors 2015-12-18 11:06:44 -08:00
keymaps feat(paste): Paste accepts more HTML, paste and match style now available 2015-12-07 15:34:03 -08:00
menus fix(menu): Toggle Menu Bar doesn't do anything #606 2015-12-09 16:27:47 -08:00
script feat(transactions): Explicit (and faster) database transactions 2015-12-17 11:46:05 -08:00
spec feat(editor-region): Add support to register components as editors 2015-12-18 11:06:44 -08:00
spec_integration add(integration-test): Adds test for onboarding flow with Exchange 2015-12-14 15:14:58 -08:00
src feat(editor-region): Add support to register components as editors 2015-12-18 11:06:44 -08:00
static fix(editable-list): Prevent empty selection on esc pressed + other fixes 2015-12-14 14:29:45 -08:00
.eslintrc Update grunt tasks to lint and transpile es6 code using babel 2015-11-06 17:40:42 -08:00
.gitignore feat(spec): add config dir to integration specs 2015-12-10 10:52:20 -05:00
.gitmodules feat(build): add nylas build resources 2015-12-02 13:59:54 -08:00
.travis.yml fix(ci): stable instead of release/* branches 2015-12-11 17:13:42 -08:00
appveyor.yml fix(ci): stable instead of release/* branches 2015-12-11 17:13:42 -08:00
CHANGELOG.md bump(version): 0.3.32 2015-12-15 11:59:01 -08:00
CONTRIBUTING.md Update CONTRIBUTING.md 2015-10-29 16:58:46 -07:00
LICENSE.md meta(license): Add GPLv3 License 2015-10-01 10:23:42 -07:00
N1.sh fix(spec): cleanup N1.sh and make specs fail with exit code 1 2015-11-23 16:00:55 -05:00
package.json bump(version): 0.3.32 2015-12-15 11:59:01 -08:00
README.md Added link to plugin and theme repo 2015-12-14 14:24:13 -06:00

N1 Logo

N1 Screenshot

N1 is an open-source mail client built on the modern web with Electron, React, and Flux. It is designed to be extensible, so it's easy to create new experiences and workflows around email. N1 is built on the Nylas Sync Engine which is also open source free software.

Build Status Slack Invite Button

Download N1

You can download compiled versions of N1 for Windows, Mac OS X, and Linux (.deb) from https://nylas.com/N1. You can also build and run N1 on Fedora. A Fedora distribution is coming soon!

Build A Plugin

Plugins lie at the heart of N1 and give it its powerful features. Building your own plugins allows you to integrate the app with other tools, experiment with new workflows, and more. Follow the Getting Started guide to write your first plugin in 5 minutes.

If you would like to run the N1 source and contribute, check out our contributing guide.

Running Locally

By default the N1 source points to our hosted version of the Nylas Sync Engine; however, the Sync Engine is open source and you can run it yourself.

Feature Requests / Package Ideas

Have an idea for a package, or a feature you'd love to see in N1? Check out our public Trello board to contribute your thoughts and vote on existing ideas or see the existing plugins and themes.