Summary: When focusing the composer, select the end of the last text block above any signatures / quoted text (which can be visible by default in Fwd:).
Test Plan: Run tests
Reviewers: juan, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2411
Summary:
Remove FocusTrackingRegion—all CommandRegions should be focusable, and nesting the two creates varying behavior based on which is the parent
Calling focus() on an injected / unsafe component should always do /something/. Try the inner React method, inner DOM method, or call on ourselves
Rename contentEditable._focusEditor to "focus" since it intends to replace default focus behavior
In ComposerView, always change focus via setState, never by calling focus() directly. Rather than tracking `_lastFocusedField`, just focus whenever the activeElement isnt within the focusedField. Make body initial focus when draft is pristine...
...(ensures new drafts are focused)
Test Plan: Run tests
Reviewers: evan, juan
Reviewed By: evan, juan
Differential Revision: https://phab.nylas.com/D2406
Summary:
WIP:
This is a quick patch for Drew to make extensions async
We'll need to think through the upgrade/deprecation plan to roll out async
extensions across all of our APIs.
Test Plan: TODO
Reviewers: drew, evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2392
Summary:
- Fixes#862
- Makes it behave like hackpad -- adding nested lists will indent the
current list item
- Fix lint errors
Test Plan: - Integration tests
Reviewers: evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2402
Summary:
- Rewrites composer extension adpater to support all versions of the
ComposerExtension API we've ever declared. This will allow old plugins (or
plugins that haven't been reinstalled after update) to keep functioning
without breaking N1
- Adds specs
Test Plan: - Unit tests
Reviewers: evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2399
Summary:
- Fixes bug with Composer focus caused by injected component. The composer body
was being focused, but the cursor remained at the beginning of the content
instead of at the end. This was caused because the focus method was being
called before the content had actually been rendered to the dom.
- Adds a callback to check when injected comp was actually rendered, and uses
that to focus the body at the correct time.
- Updates specs
- Updates behavior of focusing composer body when selecting threads in split
mode -- resolves #T3444
- It will focus the body when a thread is selcted via a click
- It wont focus the body when a thread is selected via arrow keys
- It will focus the body when a new inline reply is created
- Updates specs
Test Plan: - Unit tests
Reviewers: evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2393
Summary:
Changes the internal signatures plugin to wrap the signature in a
`<div class="nylas-n1-signature">` block, to make it easier to detect and handle
signatures from within other plugins.
Also:
- Fixes the QuickSchedule plugin to place the scheduling block above the signature.
- Fixes a small syntax error in Translate plugin
Test Plan: manual
Reviewers: evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2383
Summary:
Adds several new features to the templates plugin, fixes some existing bugs, and
refactors existing code.
New Plugin Features/Fixes:
- Changes the templates editor in preferences to allow variables to be entered with
`{{brackets}}`. Handles many contenteditable complexities to implement.
- Better interaction for renaming and deleting of templates in the editor.
- Changes tabbing behavior when using templates. Tabbing between variables now wraps
around, and typing tab from outside a variable region highlights the closest region.
- Prevents "Enter" key in the composer when inside a variable region, and strips all
formatting/tags from within the region - this prevents major contenteditable issues
that can result in inline CSS in the style of our variable regions, which will not be
removed when sending.
- Shows a warning when choosing a template if it will replace existing text in a draft.
- Prevents invalid characters in template names (due to filenames, esp. on Windows),
and shows an error message. Strips these characters from draft titles when making a
template.
- Fixes a bug where TemplateStore's initialization code was being called multiple times.
New N1 code:
- Several new methods in `DOMUtils` useful for working with contenteditable.
- Implement some missing methods in `Editor`
Refactor:
- Major refactor/rewrite of template composer extension to use new DOMUtils methods
and simplify the logic (while adding new functionality).
Remaining issues:
- `preferences-tempaltes.cjsx` and `template-editor.coffee` should be rewritten in ES6
for consistency
- Need tests for new DOMUtils functions and for new Templates plugin code.
Test Plan: manual, need to update specs
Reviewers: evan, bengotow
Reviewed By: evan, bengotow
Subscribers: juan
Differential Revision: https://phab.nylas.com/D2382
Summary: Add missing code to make onClick work in contenteditable extensions.
Test Plan: manual
Reviewers: juan, evan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2395