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:
- 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:
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:
Originally, this was going to be a totally independent package, but
I wasn't able to isolate the functionality and get it tied in to
the delta-stream consumption. Here's how it currently works:
- The preferences package has a new tab which allows you to edit
mail filters. Filters are saved in a new core store, and a new
stock component (ScenarioEditor) renders the editor. The editor
takes a set of templates that define a value space, and outputs
a valid set of values.
- A new MailFilterProcessor takes messages and creates tasks to
apply the actions from the MailFiltersStore.
- The worker-sync package now uses the MailFilterProcessor to
apply filters /before/ it calls didPassivelyReceiveNewModels,
so filtrs are applied before any notifications are created.
- A new task, ReprocessMailFiltersTask allows you to run filters
on all of your existing mail. It leverages the existing TaskQueue
architecture to: a) resume where it left off if you quit midway,
b) be queryable (for status) from all windows and c) cancelable.
The TaskQueue is a bit strange because it runs performLocal and
performRemote very differently, and I had to use `performRemote`.
(todo refactor soon.)
This diff also changes the EditableList a bit to behave like a
controlled component and render focused / unfocused states.
Test Plan: Run tests, only for actual filter processing atm.
Reviewers: juan, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2379
Summary:
Fixes a number of smaller UI issues. Fixes T6173, T6207
Full list of changes:
- Ensure time slots / days display in order
- Allow time blocks of any size to be set on half hour intervals
- Don't reset calendar when changing event length
- Expand calendar on window resize
- Change window title from "Electron"
- Add delete button to cancel individual calendar events
- Move event details box to the left side
- Prevent addition of duplicate time slots
Test Plan: manual
Reviewers: bengotow
Reviewed By: bengotow
Maniphest Tasks: T6173, T6207
Differential Revision: https://phab.nylas.com/D2333
Summary:
Related to #320, #494, #515, #553
Ignore newlines and returns in HTML, they can be inside tags
Allow all attributes so that paste from excel looks nice
Never let someone paste a `contenteditable` attribute
Update specs
Test Plan: Run new specs
Reviewers: juan, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2309
[Composer Templates / Quick Reply plugin example]
Add a page to preferences with a basic editor for quick reply templates,
allowing add, delete, and edit (HTML and rendered text), with instructions
for how to add variable regions. Add methods to TemplatesStore to enable
these. Fix issues in plugin with quoted text handling, name conflicts,
`this` scoping.
Summary:
- Rename DraftStoreExtension to ComposerExtension
- Rename MessageStoreExtension to MessageViewExtension
- Rename ContenteditablePlugin to ContenteditableExtension
- Update Contenteditable to use new naming convention
- Adds support for extension handlers as props
- Add ExtensionRegistry to register extensions:
- ContenteditableExtensions will not be registered through the
ExtensionRegistry. They are meant for internal use, or if anyone wants
to use our Contenteditable component directly in their plugins.
- Adds specs
- Refactors internal_packages and src to use new names and new ExtensionRegistry api
- Adds deprecation util function and deprecation notices for old api methods:
- DraftStore.{registerExtension, unregisterExtension}
- MessageStore.{registerExtension, unregisterExtension}
- DraftStoreExtension.{onMouseUp, onTabDown}
- MessageStoreExtension
- Adds and updates docs
Test Plan: - Unit tests
Reviewers: bengotow, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2293
Summary:
Add signatures back in.
Extract contenteditable css to its own file instead of being bundled with
the composer.
Test Plan: manual
Reviewers: juan, bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2295
Electron 0.35.1 includes the tray fixes we contributed last week but also includes API restructuring and improvements. Most importantly, modules from electron are now imported via `require('electron')`
Summary:
Several fixes and updates the the Send Availability example package. Switches from
using `electron-safe-ipc` to using `protocol.RegisterStringProtocol` to communicate
with the child window. Changes the URLs in the package from localhost to our live
demo backend.
Test Plan: manual
Reviewers: bengotow
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2271
Summary:
- Include ES6 files in spec-suite
- Fix template store specs
- Refactors TemplateStore a little bit to adjust to specs
- Convert coffe .cjsx files to ES6 .jsx files
- Fix TemplateDraftStoreExtension functions
- Update ComposerTemplates example README
Test Plan: - Plugin unit tests
Reviewers: bengotow, evan
Reviewed By: evan
Differential Revision: https://phab.nylas.com/D2250
Summary:
Refactor keymaps to wrap components with a <KeymapHandlers /> component.
This more Reactful way of declaring keyback handlers prevents us from
needing to subscribe to `atom.commands`
Test Plan: new tests
Reviewers: bengotow, juan
Reviewed By: bengotow
Differential Revision: https://phab.nylas.com/D2226