From c1f98f2fb39afa6f73fe19f02c1bfe1622886d16 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 12 Jan 2016 10:18:36 -0800 Subject: [PATCH 01/31] fix(readme): Remove link to plugins repo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 15b0c3c37..80dcc585b 100644 --- a/README.md +++ b/README.md @@ -56,4 +56,4 @@ By default the N1 source points to our hosted version of the Nylas Sync Engine; Have an idea for a package, or a feature you'd love to see in N1? Check out our [public Trello board](https://trello.com/b/hxsqB6vx/n1-open-source-roadmap) -to contribute your thoughts and vote on existing ideas or see the [existing plugins and themes](http://github.com/nylas/n1-plugins). +to contribute your thoughts and vote on existing ideas. From b14b7086abdac79113c22639633458a63675dc61 Mon Sep 17 00:00:00 2001 From: Ben Gotow Date: Tue, 12 Jan 2016 10:28:34 -0800 Subject: [PATCH 02/31] fix(indicators): Remove duplicate `description` key --- internal_packages/personal-level-indicators/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/internal_packages/personal-level-indicators/package.json b/internal_packages/personal-level-indicators/package.json index 43156799c..7c9ae9838 100644 --- a/internal_packages/personal-level-indicators/package.json +++ b/internal_packages/personal-level-indicators/package.json @@ -15,7 +15,6 @@ "engines": { "nylas": ">=0.3.0 <0.5.0" }, - "description": "Enter a description of your package!", "dependencies": [], "license": "MIT" } From 1c12fe3d6aab98e3b8b7a855a9600566adcc8bbd Mon Sep 17 00:00:00 2001 From: Juan Tejada Date: Tue, 12 Jan 2016 12:32:59 -0800 Subject: [PATCH 03/31] fix(composer): Fix focus behavior when signature present and when clicking outside: - When focusing the composer via click inside the contenteditable region or via tabbing, last text node before the signature (or blockquotes) will be focused. - When focusing composer by clicking outside contenteditable region, it will default to default contenteditable focus behavior via new method: `nativeFocus` --- internal_packages/composer/lib/composer-editor.jsx | 8 +++++++- internal_packages/composer/lib/composer-view.cjsx | 6 +++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/internal_packages/composer/lib/composer-editor.jsx b/internal_packages/composer/lib/composer-editor.jsx index d8d70d0be..0388dad8f 100644 --- a/internal_packages/composer/lib/composer-editor.jsx +++ b/internal_packages/composer/lib/composer-editor.jsx @@ -128,7 +128,7 @@ class ComposerEditor extends Component { // quoted text that is visible. (as in forwarded messages.) // this.refs.contenteditable.atomicEdit( ({editor})=> { - const walker = document.createTreeWalker(editor.rootNode, NodeFilter.SHOW_TEXT | NodeFilter.SHOW_ELEMENT); + const walker = document.createTreeWalker(editor.rootNode, NodeFilter.SHOW_TEXT); const nodesBelowUserBody = editor.rootNode.querySelectorAll('.nylas-n1-signature, .gmail_quote, blockquote'); let lastNode = null; @@ -162,6 +162,12 @@ class ComposerEditor extends Component { }); } + nativeFocus() { + this.refs.contenteditable.atomicEdit( ({editor})=> { + editor.rootNode.focus(); + }); + } + /** * @private * This method was included so that the tests don't break diff --git a/internal_packages/composer/lib/composer-view.cjsx b/internal_packages/composer/lib/composer-view.cjsx index 000037e5e..cec3f610b 100644 --- a/internal_packages/composer/lib/composer-view.cjsx +++ b/internal_packages/composer/lib/composer-view.cjsx @@ -332,6 +332,7 @@ class ComposerView extends React.Component onComponentDidRender={@_onEditorBodyDidRender} requiredMethods={[ 'focus' + 'nativeFocus' 'getCurrentSelection' 'getPreviousSelection' '_onDOMMutated' @@ -493,7 +494,10 @@ class ComposerView extends React.Component _onMouseUpComposerBody: (event) => if event.target is @_mouseDownTarget - @setState(focusedField: Fields.Body) + # We don't set state directly here because we want the native + # contenteditable focus behavior. When the contenteditable gets focused + # the focused field state will be properly set via editor.onFocus + @refs[Fields.Body].nativeFocus() @_mouseDownTarget = null # When a user focuses the composer, it's possible that no input is From f679f7c21437ff176aee198162d079386c94b472 Mon Sep 17 00:00:00 2001 From: Drew Regitsky Date: Tue, 12 Jan 2016 12:44:22 -0800 Subject: [PATCH 04/31] fix(templates): fix several bugs in templates plugin Fixes behavior when there are no template files, prevents renaming/creating with an empty name, fixes yet another way to accidentally make yellow text, misc small style fixes --- .../lib/preferences-templates.cjsx | 36 +++++++++++++------ .../lib/template-editor.coffee | 30 ++++++++-------- .../lib/template-status-bar.jsx | 2 +- .../composer-templates/lib/template-store.es6 | 11 +++++- .../stylesheets/message-templates.less | 7 +++- src/dom-utils.coffee | 4 +-- 6 files changed, 58 insertions(+), 32 deletions(-) diff --git a/internal_packages/composer-templates/lib/preferences-templates.cjsx b/internal_packages/composer-templates/lib/preferences-templates.cjsx index 0f7024434..08b4c506a 100644 --- a/internal_packages/composer-templates/lib/preferences-templates.cjsx +++ b/internal_packages/composer-templates/lib/preferences-templates.cjsx @@ -13,7 +13,7 @@ class PreferencesTemplates extends React.Component {templates, selectedTemplate, selectedTemplateName} = @_getStateFromStores() @state = editAsHTML: false - editState: null + editState: if templates.length==0 then "new" else null templates: templates selectedTemplate: selectedTemplate selectedTemplateName: selectedTemplateName @@ -108,14 +108,14 @@ class PreferencesTemplates extends React.Component _renderEditableTemplate: -> _renderHTMLTemplate: ->