Mailspring/internal_packages
Ben Gotow 4959944afb feat(signatures): Initial signature support
Summary:
- Draft Store extensions can now implement `prepareNewDraft` to have an opportunity to change a draft before it's displayed for the first time.

- When composers are torn down, they delete their draft if it is still pristine. This makes the behavior of closing unedited popout drafts the same as leaving unedited inline drafts.

- The DraftStoreProxy keeps the initial body of the draft *if* it started in a pristine state. This means "is the body empty" is just a simple == check, and it takes into account anything added to the body by extensions.

- Calling Actions.destroyDraft doesn't blow up anymore if the draft session can't be found. This was a bug and meant that you couldn't destroy drafts which hadn't been previously edited, and also meant that bad things(tm) happened when you called destroyDraft twice, which seemed like overkill.

- DestroyDraft task now exits gracefully when the draft cannot be found.

You can test this feature by adding the following to your config.cson:

```
  signatures:
     NAMESPACEID: "<br/><br/><div id=\"Signature\"><div id=\"divtagdefaultwrapper\" style=\"font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif\"><p></p><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"450\" style=\"font-family:'Times New Roman'; table-layout:fixed\"><tbody><tr><td class=\"logo-td\" align=\"left\" valign=\"top\" width=\"76\"><p style=\"margin-bottom:10px; margin-right:10px; font-family:Helvetica,Arial,sans-serif; font-size:14px; line-height:16px\"><a href=\"http://www.nylas.com/\" class=\"clink logo-container\" style=\"text-decoration:none\"><img alt=\"Nylas\" border=\"0\" class=\"sig-logo\" height=\"80\" width=\"66\" style=\"-webkit-user-select: none;\" src=\"https://s3-us-west-2.amazonaws.com/nylas-static-assets/nylas-email-signature.png\"></a></p><p class=\"social-list\" style=\"font-size:0px; line-height:0; font-family:Helvetica,Arial,sans-serif\"></p></td><td align=\"left\" valign=\"top\" nowrap=\"nowrap\" class=\"spacer-td\" width=\"16\" style=\"border-left-width:2px; border-left-style:solid; border-left-color:rgb(30,162,162)\"><img width=\"10\" style=\"-webkit-user-select: none;\" src=\"https://s3.amazonaws.com/htmlsig-assets/spacer.gif\"></td><td align=\"left\" valign=\"top\" nowrap=\"nowrap\" class=\"content-td\" width=\"368\"><div class=\"content-pad\"><p style=\"font-family:Helvetica,Arial,sans-serif; font-size:14px; line-height:16px; color:rgb(33,33,33); margin-bottom:10px\"><span class=\"txt signature_name-target sig-hide\" style=\"font-weight:bold; display:inline\">Gleb Polyakov</span>&nbsp;<span class=\"email-sep break\" style=\"display:inline\"><br></span><a class=\"link email signature_email-target sig-hide\" href=\"mailto:gleb@nylas.com\" style=\"color:rgb(30,162,162); text-decoration:none; display:inline\">gleb@nylas.com</a><span class=\"signature_email-sep sep\" style=\"display:inline\">&nbsp;/&nbsp;</span><span class=\"txt signature_mobilephone-target sig-hide\" style=\"display:inline\">404-786-4100</span></p><p style=\"font-family:Helvetica,Arial,sans-serif; font-size:14px; line-height:16px; margin-bottom:10px\"><span class=\"txt signature_companyname-target sig-hide\" style=\"font-weight:bold; color:rgb(33,33,33); display:inline\">Nylas</span>&nbsp;<span class=\"company-sep break\" style=\"display:inline\"><br></span><span class=\"address-sep break\"></span><span class=\"address2-sep break\"></span><span class=\"website-sep break\"></span><a class=\"link signature_website-target sig-hide\" href=\"http://www.nylas.com/\" style=\"color:rgb(30,162,162); text-decoration:none; display:inline\">http://www.nylas.com</a></p></div></td></tr><tr><td colspan=\"3\"></td></tr><tr><td colspan=\"3\"></td></tr><tr><td colspan=\"3\"><p class=\"txt signature_disclaimer-target\" style=\"font-family:Helvetica,Arial,sans-serif; color:rgb(33,33,33); font-size:9px; line-height:12px; margin-top:10px\"></p></td></tr></tbody></table><p></p></div></div>"
```

specs for draft store extension hooks, some draft store refactoring

Test Plan: Run a few new specs that make sure extensions are run

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1741
2015-07-14 12:20:06 -07:00
..
account-sidebar fix(back): Remove "Back to " prefix, centralize into back button itself, align using vertial-align instead of margin-top 2015-07-13 16:33:57 -07:00
attachments fix(attachment-css): Tiny style tweaks 2015-06-29 17:25:00 -07:00
calendar-bar refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
composer feat(signatures): Initial signature support 2015-07-14 12:20:06 -07:00
composer-signature feat(signatures): Initial signature support 2015-07-14 12:20:06 -07:00
developer-bar feat(offline-mode, undo-redo): Tasks handle network errors better and retry, undo/redo based on tasks 2015-07-07 13:38:53 -04:00
file-list feat(attachment): improved downloading and draggable images 2015-06-15 18:48:17 -07:00
inbox-contact-elements refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
message-list fix(back): Remove "Back to " prefix, centralize into back button itself, align using vertial-align instead of margin-top 2015-07-13 16:33:57 -07:00
message-templates feat(salesforce): new UI for Salesforce 2015-06-17 20:40:08 -07:00
mode-switch fix(assets): New toolbar icons, shadows to achieve less heavy edges on messages 2015-06-26 10:38:07 -07:00
notification-mailto refactor(utils): switch to regular underscore 2015-05-19 16:06:59 -07:00
notification-update-available fix(notifications): Give notifications tag like HTML5 Notifications so you can de-dupe 2015-05-25 10:27:36 -07:00
notifications fix(*): can select participant with space if it's an email 2015-07-13 10:25:30 -04:00
onboarding feat(api): add api-experimental.nylas.com as login option 2015-07-08 13:25:11 -07:00
search-bar fix(search): remove red search x 2015-06-18 09:43:18 -07:00
settings fix(getting-started): New menu item, sample package for devs 2015-07-06 14:23:51 -04:00
sidebar-fullcontact feat(salesforce): new UI for Salesforce 2015-06-17 20:40:08 -07:00
sidebar-inbox-internal Adding ATag component which prevents <a> tags from taking over edgehill when clicked. 2015-06-25 10:28:31 -07:00
thread-list fix(back): Remove "Back to " prefix, centralize into back button itself, align using vertial-align instead of margin-top 2015-07-13 16:33:57 -07:00
today fix(nylas-api): Globally handle 401s and notify user they need to sign in 2015-06-17 12:29:49 -07:00
tooltip feat(theming): Definitely not hacker mode. I don't know what you're talking about. 2015-06-05 11:40:44 -07:00
ui-dark feat(theming): Definitely not hacker mode. I don't know what you're talking about. 2015-06-05 11:40:44 -07:00
ui-light fix(build): Temporarily disable 'Task' tests Jenkins can't run, and avoid empty ui-variables files 2015-06-03 12:04:43 -07:00
unread-notifications fix(thread-list): Narrow mode, and new selection rules for three-pane 2015-06-11 18:00:40 -07:00