diff --git a/build/tasks/copy-files-for-build-task.coffee b/build/tasks/copy-files-for-build-task.coffee index d96d788af..1e005bd20 100644 --- a/build/tasks/copy-files-for-build-task.coffee +++ b/build/tasks/copy-files-for-build-task.coffee @@ -169,7 +169,6 @@ module.exports = (grunt) -> cp directory, path.join(appDir, directory), filter: filterPackage cp 'spec', path.join(appDir, 'spec') - cp 'examples', path.join(appDir, 'examples') cp 'src', path.join(appDir, 'src'), filter: /.+\.(cson|coffee|cjsx|jsx)$/ cp 'static', path.join(appDir, 'static') diff --git a/examples/N1-Composer-Translate/README.md b/examples/N1-Composer-Translate/README.md deleted file mode 100644 index 1ed5b1111..000000000 --- a/examples/N1-Composer-Translate/README.md +++ /dev/null @@ -1,26 +0,0 @@ - -## Translate - -A package for N1 that translates draft text into other languages using the Yandex Translation API. - - - -#### Install this plugin - -1. Download and run N1 - -2. From the menu, select `Developer > Install a Plugin Manually...` - The dialog will default to this examples directory. Just choose the - `N1-Composer-Translate` folder to install it! - - > When you install packages, they're moved to `~/.nylas/packages`, - > and N1 runs `apm install` on the command line to fetch dependencies - > listed in the package's `package.json` - -#### Build documentation - -``` -cjsx-transform lib/main.cjsx > docs/main.coffee -docco docs/main.coffee -rm docs/main.coffee -``` diff --git a/examples/N1-Message-View-on-Github/icon.png b/examples/N1-Message-View-on-Github/icon.png deleted file mode 100644 index b01405fd2..000000000 Binary files a/examples/N1-Message-View-on-Github/icon.png and /dev/null differ diff --git a/examples/N1-Personal-Level-Indicators/README.md b/examples/N1-Personal-Level-Indicators/README.md deleted file mode 100644 index 568336b34..000000000 --- a/examples/N1-Personal-Level-Indicators/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# Personal Level Icon - -An icon to indicate whether an email was sent to either just you, or you and other recipients, or a mailing list that you were on. - - - -#### Install this plugin - -1. Download and run N1 - -2. From the menu, select `Developer > Install a Plugin Manually...` - The dialog will default to this examples directory. Just choose the - `N1-Personal-Level-Indicators` folder to install it! - - > When you install packages, they're moved to `~/.nylas/packages`, - > and N1 runs `apm install` on the command line to fetch dependencies - > listed in the package's `package.json` - -#### Who? - -This package is annotated for developers who have no experience with React, Flux, Electron, or N1. diff --git a/examples/composer-templates b/examples/composer-templates new file mode 120000 index 000000000..7dbad6858 --- /dev/null +++ b/examples/composer-templates @@ -0,0 +1 @@ +../internal_packages/composer-templates \ No newline at end of file diff --git a/examples/composer-translate b/examples/composer-translate new file mode 120000 index 000000000..fde926953 --- /dev/null +++ b/examples/composer-translate @@ -0,0 +1 @@ +../internal_packages/composer-translate \ No newline at end of file diff --git a/examples/github-contact-card b/examples/github-contact-card new file mode 120000 index 000000000..6da624f58 --- /dev/null +++ b/examples/github-contact-card @@ -0,0 +1 @@ +../internal_packages/github-contact-card \ No newline at end of file diff --git a/examples/message-view-on-github b/examples/message-view-on-github new file mode 120000 index 000000000..3a7fe6657 --- /dev/null +++ b/examples/message-view-on-github @@ -0,0 +1 @@ +../internal_packages/message-view-on-github \ No newline at end of file diff --git a/examples/personal-level-indicators b/examples/personal-level-indicators new file mode 120000 index 000000000..55f68067a --- /dev/null +++ b/examples/personal-level-indicators @@ -0,0 +1 @@ +../internal_packages/personal-level-indicators \ No newline at end of file diff --git a/examples/N1-Personal-Level-Indicators/package.json b/examples/personal-level-inicators/package.json similarity index 51% rename from examples/N1-Personal-Level-Indicators/package.json rename to examples/personal-level-inicators/package.json index 111835ad6..8b803b647 100644 --- a/examples/N1-Personal-Level-Indicators/package.json +++ b/examples/personal-level-inicators/package.json @@ -1,7 +1,10 @@ { - "name": "PersonalLevelIndicators", + "name": "personal-level-indicators", "main": "./lib/main", "version": "0.1.0", + "isOptional": true, + "title": "Personal Level Indicators", + "description": "Display chevrons beside threads that indicate whether you're a direct recipient or the only recipient on a thread.", "repository": { "type": "git", "url": "" diff --git a/examples/phishing-detection b/examples/phishing-detection new file mode 120000 index 000000000..5bbeb95cf --- /dev/null +++ b/examples/phishing-detection @@ -0,0 +1 @@ +../internal_packages/phishing-detection \ No newline at end of file diff --git a/examples/quick-schedule b/examples/quick-schedule new file mode 120000 index 000000000..b49b472f1 --- /dev/null +++ b/examples/quick-schedule @@ -0,0 +1 @@ +../internal_packages/quick-schedule \ No newline at end of file diff --git a/examples/N1-Composer-Templates/README.md b/internal_packages/composer-templates/README.md similarity index 91% rename from examples/N1-Composer-Templates/README.md rename to internal_packages/composer-templates/README.md index b7bf1389c..4c73990e2 100644 --- a/examples/N1-Composer-Templates/README.md +++ b/internal_packages/composer-templates/README.md @@ -14,7 +14,7 @@ tags are always stripped so the recipient never sees any highlighting. This example is a good starting point for plugins that want to extend the composer experience. - + #### Install this plugin diff --git a/examples/N1-Composer-Templates/assets/Welcome to Templates.html b/internal_packages/composer-templates/assets/Welcome to Templates.html similarity index 100% rename from examples/N1-Composer-Templates/assets/Welcome to Templates.html rename to internal_packages/composer-templates/assets/Welcome to Templates.html diff --git a/examples/N1-Composer-Templates/assets/icon-composer-templates@2x.png b/internal_packages/composer-templates/assets/icon-composer-templates@2x.png similarity index 100% rename from examples/N1-Composer-Templates/assets/icon-composer-templates@2x.png rename to internal_packages/composer-templates/assets/icon-composer-templates@2x.png diff --git a/examples/N1-Composer-Templates/icon.png b/internal_packages/composer-templates/icon.png similarity index 100% rename from examples/N1-Composer-Templates/icon.png rename to internal_packages/composer-templates/icon.png diff --git a/examples/N1-Composer-Templates/lib/main.es6 b/internal_packages/composer-templates/lib/main.es6 similarity index 100% rename from examples/N1-Composer-Templates/lib/main.es6 rename to internal_packages/composer-templates/lib/main.es6 diff --git a/examples/N1-Composer-Templates/lib/preferences-templates.cjsx b/internal_packages/composer-templates/lib/preferences-templates.cjsx similarity index 100% rename from examples/N1-Composer-Templates/lib/preferences-templates.cjsx rename to internal_packages/composer-templates/lib/preferences-templates.cjsx diff --git a/examples/N1-Composer-Templates/lib/template-composer-extension.es6 b/internal_packages/composer-templates/lib/template-composer-extension.es6 similarity index 97% rename from examples/N1-Composer-Templates/lib/template-composer-extension.es6 rename to internal_packages/composer-templates/lib/template-composer-extension.es6 index 2093248fb..83d499a91 100644 --- a/examples/N1-Composer-Templates/lib/template-composer-extension.es6 +++ b/internal_packages/composer-templates/lib/template-composer-extension.es6 @@ -58,10 +58,11 @@ class TemplatesComposerExtension extends ComposerExtension { const treeWalker = document.createTreeWalker(editableNode, NodeFilter.SHOW_ELEMENT + NodeFilter.SHOW_TEXT); let curIndex = 0; let nextIndex = null; - let node; - while (node = treeWalker.nextNode()) { + let node = treeWalker.nextNode(); + while (node) { if (sel.anchorNode === node || sel.focusNode === node) break; if (node.nodeName === 'CODE' && node.classList.contains('var')) curIndex++; + node = treeWalker.nextNode(); } nextIndex = event.shiftKey ? curIndex - 1 : curIndex; nextIndex = (nextIndex + nodes.length) % nodes.length; // allow wraparound in both directions diff --git a/examples/N1-Composer-Templates/lib/template-editor.coffee b/internal_packages/composer-templates/lib/template-editor.coffee similarity index 100% rename from examples/N1-Composer-Templates/lib/template-editor.coffee rename to internal_packages/composer-templates/lib/template-editor.coffee diff --git a/examples/N1-Composer-Templates/lib/template-picker.jsx b/internal_packages/composer-templates/lib/template-picker.jsx similarity index 95% rename from examples/N1-Composer-Templates/lib/template-picker.jsx rename to internal_packages/composer-templates/lib/template-picker.jsx index 0cd6032e1..1e48eed39 100644 --- a/examples/N1-Composer-Templates/lib/template-picker.jsx +++ b/internal_packages/composer-templates/lib/template-picker.jsx @@ -67,7 +67,7 @@ class TemplatePicker extends React.Component { render() { const button = ( diff --git a/examples/N1-Composer-Templates/lib/template-status-bar.jsx b/internal_packages/composer-templates/lib/template-status-bar.jsx similarity index 100% rename from examples/N1-Composer-Templates/lib/template-status-bar.jsx rename to internal_packages/composer-templates/lib/template-status-bar.jsx diff --git a/examples/N1-Composer-Templates/lib/template-store.es6 b/internal_packages/composer-templates/lib/template-store.es6 similarity index 77% rename from examples/N1-Composer-Templates/lib/template-store.es6 rename to internal_packages/composer-templates/lib/template-store.es6 index c7ddd4dfc..cb7b847f6 100644 --- a/examples/N1-Composer-Templates/lib/template-store.es6 +++ b/internal_packages/composer-templates/lib/template-store.es6 @@ -1,6 +1,5 @@ import {DraftStore, Actions, QuotedHTMLTransformer} from 'nylas-exports'; import NylasStore from 'nylas-store'; -import shell from 'shell'; import path from 'path'; import fs from 'fs'; @@ -42,12 +41,12 @@ class TemplateStore extends NylasStore { fs.exists(this._templatesDir, (exists) => { if (exists) { this._populate(); - this.watch() + this.watch(); } else { fs.mkdir(this._templatesDir, () => { fs.readFile(this._welcomePath, (err, welcome) => { fs.writeFile(path.join(this._templatesDir, this._welcomeName), welcome, () => { - this.watch() + this.watch(); }); }); }); @@ -56,8 +55,9 @@ class TemplateStore extends NylasStore { } watch() { - if(!this._watcher) + if (!this._watcher) { this._watcher = fs.watch(this._templatesDir, () => this._populate()); + } } unwatch() { this._watcher.close(); @@ -103,7 +103,7 @@ class TemplateStore extends NylasStore { if (draftClientId) { DraftStore.sessionForClientId(draftClientId).then((session) => { const draft = session.draft(); - const draftName = name ? name : draft.subject.replace(TemplateStore.INVALID_TEMPLATE_NAME_REGEX,""); + const draftName = name ? name : draft.subject.replace(TemplateStore.INVALID_TEMPLATE_NAME_REGEX, ''); const draftContents = contents ? contents : QuotedHTMLTransformer.removeQuotedHTML(draft.body); if (!draftName || draftName.length === 0) { this._displayError('Give your draft a subject to name your template.'); @@ -115,44 +115,44 @@ class TemplateStore extends NylasStore { }); return; } - if (!name || name.length === 0) + if (!name || name.length === 0) { this._displayError('You must provide a name for your template.'); - - if (!contents || contents.length === 0) + } + if (!contents || contents.length === 0) { this._displayError('You must provide contents for your template.'); - + } this.saveNewTemplate(name, contents, this._onShowTemplates); } _onShowTemplates() { Actions.switchPreferencesTab('Quick Replies'); - Actions.openPreferences() + Actions.openPreferences(); } _displayError(message) { const dialog = require('remote').require('dialog'); dialog.showErrorBox('Template Creation Error', message); } - _displayDialog(title,message,buttons) { + _displayDialog(title, message, buttons) { const dialog = require('remote').require('dialog'); - return 0==dialog.showMessageBox({ - title: title, - message: title, - detail: message, - buttons: buttons, - type: 'info' - }); + return (dialog.showMessageBox({ + title: title, + message: title, + detail: message, + buttons: buttons, + type: 'info', + }) === 0); } saveNewTemplate(name, contents, callback) { - if(name.match(TemplateStore.INVALID_TEMPLATE_NAME_REGEX)) { - this._displayError("Invalid template name! Names can only contain letters, numbers, spaces, dashes, and underscores."); + if (name.match(TemplateStore.INVALID_TEMPLATE_NAME_REGEX)) { + this._displayError('Invalid template name! Names can only contain letters, numbers, spaces, dashes, and underscores.'); return; } - var template = this._getTemplate(name); - if(template) { - this._displayError("A template with that name already exists!"); + const template = this._getTemplate(name); + if (template) { + this._displayError('A template with that name already exists!'); return; } this.saveTemplate(name, contents, callback); @@ -160,9 +160,10 @@ class TemplateStore extends NylasStore { } _getTemplate(name, id) { - for(let template of this._items) { - if((template.name === name || name == null) && (template.id === id || id == null)) + for (const template of this._items) { + if ((template.name === name || name === null) && (template.id === id || id === null)) { return template; + } } return null; } @@ -171,7 +172,7 @@ class TemplateStore extends NylasStore { const filename = `${name}.html`; const templatePath = path.join(this._templatesDir, filename); - var template = this._getTemplate(name); + let template = this._getTemplate(name); this.unwatch(); fs.writeFile(templatePath, contents, (err) => { this.watch(); @@ -180,38 +181,42 @@ class TemplateStore extends NylasStore { template = { id: filename, name: name, - path: templatePath + path: templatePath, }; this._items.push(template); } - if(callback) + if (callback) { callback(template); + } }); } deleteTemplate(name, callback) { - var template = this._getTemplate(name); - if (!template) { return undefined } + const template = this._getTemplate(name); + if (!template) { return undefined; } - if(this._displayDialog( + if (this._displayDialog( 'Delete this template?', 'The template and its file will be permanently deleted.', - ['Delete','Cancel'] - )) + ['Delete', 'Cancel'] + )) { fs.unlink(template.path, () => { this._populate(); - if(callback) - callback() + if (callback) { + callback(); + } }); + } } renameTemplate(oldName, newName, callback) { - if(newName.match(TemplateStore.INVALID_TEMPLATE_NAME_REGEX)) { - this._displayError("Invalid template name! Names can only contain letters, numbers, spaces, dashes, and underscores."); + const template = this._getTemplate(oldName); + if (!template) { return; } + + if (newName.match(TemplateStore.INVALID_TEMPLATE_NAME_REGEX)) { + this._displayError('Invalid template name! Names can only contain letters, numbers, spaces, dashes, and underscores.'); return; } - var template = this._getTemplate(oldName); - if (!template) { return undefined } const newFilename = `${newName}.html`; const oldPath = path.join(this._templatesDir, `${oldName}.html`); @@ -221,25 +226,25 @@ class TemplateStore extends NylasStore { template.id = newFilename; template.path = newPath; this.trigger(this); - callback(template) + callback(template); }); } _onInsertTemplateId({templateId, draftClientId} = {}) { this.getTemplateContents(templateId, (body) => { DraftStore.sessionForClientId(draftClientId).then((session)=> { - var proceed = true; + let proceed = true; if (!session.draft().pristine) { proceed = this._displayDialog( 'Replace draft contents?', 'It looks like your draft already has some content. Loading this template will ' + 'overwrite all draft contents.', - ['Replace contents','Cancel'] - ) + ['Replace contents', 'Cancel'] + ); } - if(proceed) { - draftHtml = QuotedHTMLTransformer.appendQuotedHTML(body, session.draft().body); + if (proceed) { + const draftHtml = QuotedHTMLTransformer.appendQuotedHTML(body, session.draft().body); session.changes.add({body: draftHtml}); } }); @@ -247,8 +252,8 @@ class TemplateStore extends NylasStore { } getTemplateContents(templateId, callback) { - var template = this._getTemplate(null,templateId); - if (!template) { return undefined } + const template = this._getTemplate(null, templateId); + if (!template) { return; } fs.readFile(template.path, (err, data)=> { const body = data.toString(); diff --git a/examples/N1-Composer-Templates/package.json b/internal_packages/composer-templates/package.json similarity index 89% rename from examples/N1-Composer-Templates/package.json rename to internal_packages/composer-templates/package.json index bb6aeac00..4f136a23d 100755 --- a/examples/N1-Composer-Templates/package.json +++ b/internal_packages/composer-templates/package.json @@ -1,9 +1,11 @@ { - "name": "N1-Composer-Templates", + "name": "composer-templates", "version": "0.1.0", "main": "./lib/main", + "isOptional": true, "isStarterPackage": true, + "title": "Templates", "description": "Create templates you can use to pre-fill the composer - never type the same email again!", "icon": "./icon.png", diff --git a/examples/N1-Composer-Templates/screenshot.png b/internal_packages/composer-templates/screenshot.png similarity index 100% rename from examples/N1-Composer-Templates/screenshot.png rename to internal_packages/composer-templates/screenshot.png diff --git a/examples/N1-Composer-Templates/spec/template-store-spec.es6 b/internal_packages/composer-templates/spec/template-store-spec.es6 similarity index 100% rename from examples/N1-Composer-Templates/spec/template-store-spec.es6 rename to internal_packages/composer-templates/spec/template-store-spec.es6 diff --git a/examples/N1-Composer-Templates/stylesheets/message-templates.less b/internal_packages/composer-templates/stylesheets/message-templates.less similarity index 100% rename from examples/N1-Composer-Templates/stylesheets/message-templates.less rename to internal_packages/composer-templates/stylesheets/message-templates.less diff --git a/examples/N1-Composer-Translate/.gitignore b/internal_packages/composer-translate/.gitignore similarity index 100% rename from examples/N1-Composer-Translate/.gitignore rename to internal_packages/composer-translate/.gitignore diff --git a/internal_packages/composer-translate/README.md b/internal_packages/composer-translate/README.md new file mode 100644 index 000000000..64730fd92 --- /dev/null +++ b/internal_packages/composer-translate/README.md @@ -0,0 +1,20 @@ + +## Translate + +A package for N1 that translates draft text into other languages using the Yandex Translation API. + + + +#### Enable this plugin + +1. Download and run N1 + +2. Navigate to Preferences > Plugins and click "Enable" beside the plugin. + +#### Build documentation + +``` +cjsx-transform lib/main.cjsx > docs/main.coffee +docco docs/main.coffee +rm docs/main.coffee +``` diff --git a/examples/N1-Composer-Translate/assets/translate-icon@2x.png b/internal_packages/composer-translate/assets/translate-icon@2x.png similarity index 100% rename from examples/N1-Composer-Translate/assets/translate-icon@2x.png rename to internal_packages/composer-translate/assets/translate-icon@2x.png diff --git a/examples/N1-Composer-Translate/docs/docco.css b/internal_packages/composer-translate/docs/docco.css similarity index 100% rename from examples/N1-Composer-Translate/docs/docco.css rename to internal_packages/composer-translate/docs/docco.css diff --git a/examples/N1-Composer-Translate/docs/main.coffee b/internal_packages/composer-translate/docs/main.coffee similarity index 100% rename from examples/N1-Composer-Translate/docs/main.coffee rename to internal_packages/composer-translate/docs/main.coffee diff --git a/examples/N1-Composer-Translate/docs/main.html b/internal_packages/composer-translate/docs/main.html similarity index 100% rename from examples/N1-Composer-Translate/docs/main.html rename to internal_packages/composer-translate/docs/main.html diff --git a/examples/N1-Composer-Translate/docs/public/fonts/aller-bold.eot b/internal_packages/composer-translate/docs/public/fonts/aller-bold.eot similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/aller-bold.eot rename to internal_packages/composer-translate/docs/public/fonts/aller-bold.eot diff --git a/examples/N1-Composer-Translate/docs/public/fonts/aller-bold.ttf b/internal_packages/composer-translate/docs/public/fonts/aller-bold.ttf similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/aller-bold.ttf rename to internal_packages/composer-translate/docs/public/fonts/aller-bold.ttf diff --git a/examples/N1-Composer-Translate/docs/public/fonts/aller-bold.woff b/internal_packages/composer-translate/docs/public/fonts/aller-bold.woff similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/aller-bold.woff rename to internal_packages/composer-translate/docs/public/fonts/aller-bold.woff diff --git a/examples/N1-Composer-Translate/docs/public/fonts/aller-light.eot b/internal_packages/composer-translate/docs/public/fonts/aller-light.eot similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/aller-light.eot rename to internal_packages/composer-translate/docs/public/fonts/aller-light.eot diff --git a/examples/N1-Composer-Translate/docs/public/fonts/aller-light.ttf b/internal_packages/composer-translate/docs/public/fonts/aller-light.ttf similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/aller-light.ttf rename to internal_packages/composer-translate/docs/public/fonts/aller-light.ttf diff --git a/examples/N1-Composer-Translate/docs/public/fonts/aller-light.woff b/internal_packages/composer-translate/docs/public/fonts/aller-light.woff similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/aller-light.woff rename to internal_packages/composer-translate/docs/public/fonts/aller-light.woff diff --git a/examples/N1-Composer-Translate/docs/public/fonts/fleurons.eot b/internal_packages/composer-translate/docs/public/fonts/fleurons.eot similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/fleurons.eot rename to internal_packages/composer-translate/docs/public/fonts/fleurons.eot diff --git a/examples/N1-Composer-Translate/docs/public/fonts/fleurons.ttf b/internal_packages/composer-translate/docs/public/fonts/fleurons.ttf similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/fleurons.ttf rename to internal_packages/composer-translate/docs/public/fonts/fleurons.ttf diff --git a/examples/N1-Composer-Translate/docs/public/fonts/fleurons.woff b/internal_packages/composer-translate/docs/public/fonts/fleurons.woff similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/fleurons.woff rename to internal_packages/composer-translate/docs/public/fonts/fleurons.woff diff --git a/examples/N1-Composer-Translate/docs/public/fonts/roboto-black.eot b/internal_packages/composer-translate/docs/public/fonts/roboto-black.eot similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/roboto-black.eot rename to internal_packages/composer-translate/docs/public/fonts/roboto-black.eot diff --git a/examples/N1-Composer-Translate/docs/public/fonts/roboto-black.ttf b/internal_packages/composer-translate/docs/public/fonts/roboto-black.ttf similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/roboto-black.ttf rename to internal_packages/composer-translate/docs/public/fonts/roboto-black.ttf diff --git a/examples/N1-Composer-Translate/docs/public/fonts/roboto-black.woff b/internal_packages/composer-translate/docs/public/fonts/roboto-black.woff similarity index 100% rename from examples/N1-Composer-Translate/docs/public/fonts/roboto-black.woff rename to internal_packages/composer-translate/docs/public/fonts/roboto-black.woff diff --git a/examples/N1-Composer-Translate/docs/public/images/gray.png b/internal_packages/composer-translate/docs/public/images/gray.png similarity index 100% rename from examples/N1-Composer-Translate/docs/public/images/gray.png rename to internal_packages/composer-translate/docs/public/images/gray.png diff --git a/examples/N1-Composer-Translate/docs/public/stylesheets/normalize.css b/internal_packages/composer-translate/docs/public/stylesheets/normalize.css similarity index 100% rename from examples/N1-Composer-Translate/docs/public/stylesheets/normalize.css rename to internal_packages/composer-translate/docs/public/stylesheets/normalize.css diff --git a/examples/N1-Composer-Translate/examples-screencap-translate.png b/internal_packages/composer-translate/examples-screencap-translate.png similarity index 100% rename from examples/N1-Composer-Translate/examples-screencap-translate.png rename to internal_packages/composer-translate/examples-screencap-translate.png diff --git a/examples/N1-Composer-Translate/icon.png b/internal_packages/composer-translate/icon.png similarity index 100% rename from examples/N1-Composer-Translate/icon.png rename to internal_packages/composer-translate/icon.png diff --git a/examples/N1-Composer-Translate/lib/main.cjsx b/internal_packages/composer-translate/lib/main.cjsx similarity index 98% rename from examples/N1-Composer-Translate/lib/main.cjsx rename to internal_packages/composer-translate/lib/main.cjsx index c3fbee878..f81e1af03 100644 --- a/examples/N1-Composer-Translate/lib/main.cjsx +++ b/internal_packages/composer-translate/lib/main.cjsx @@ -71,7 +71,7 @@ class TranslateButton extends React.Component # _renderButton: => diff --git a/examples/N1-Composer-Translate/package.json b/internal_packages/composer-translate/package.json similarity index 90% rename from examples/N1-Composer-Translate/package.json rename to internal_packages/composer-translate/package.json index 6d5d93c13..46b6e7b9e 100755 --- a/examples/N1-Composer-Translate/package.json +++ b/internal_packages/composer-translate/package.json @@ -1,9 +1,11 @@ { - "name": "N1-Composer-Translate", + "name": "composer-translate", "version": "0.2.0", "main": "./lib/main", + "isOptional": true, "isStarterPackage": true, + "title": "Translation", "description": "Translate your drafts in the composer into other languages using the Yandex Translation API.", "icon": "./icon.png", diff --git a/examples/N1-Composer-Translate/spec/main-spec.coffee b/internal_packages/composer-translate/spec/main-spec.coffee similarity index 100% rename from examples/N1-Composer-Translate/spec/main-spec.coffee rename to internal_packages/composer-translate/spec/main-spec.coffee diff --git a/examples/N1-Composer-Translate/stylesheets/translate.less b/internal_packages/composer-translate/stylesheets/translate.less similarity index 100% rename from examples/N1-Composer-Translate/stylesheets/translate.less rename to internal_packages/composer-translate/stylesheets/translate.less diff --git a/examples/N1-Github-Contact-Card-Section/README.md b/internal_packages/github-contact-card/README.md similarity index 86% rename from examples/N1-Github-Contact-Card-Section/README.md rename to internal_packages/github-contact-card/README.md index 932065083..488118589 100644 --- a/examples/N1-Github-Contact-Card-Section/README.md +++ b/internal_packages/github-contact-card/README.md @@ -7,7 +7,7 @@ and then displays public repos and their stars. This example is a good starting point for plugins that want to display data from external sources in the sidebar. - + #### Install this plugin diff --git a/examples/N1-Github-Contact-Card-Section/assets/github.png b/internal_packages/github-contact-card/assets/github.png similarity index 100% rename from examples/N1-Github-Contact-Card-Section/assets/github.png rename to internal_packages/github-contact-card/assets/github.png diff --git a/examples/N1-Github-Contact-Card-Section/docs/docco.css b/internal_packages/github-contact-card/docs/docco.css similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/docco.css rename to internal_packages/github-contact-card/docs/docco.css diff --git a/examples/N1-Github-Contact-Card-Section/docs/github-user-store.html b/internal_packages/github-contact-card/docs/github-user-store.html similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/github-user-store.html rename to internal_packages/github-contact-card/docs/github-user-store.html diff --git a/examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-bold.eot b/internal_packages/github-contact-card/docs/public/fonts/aller-bold.eot similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-bold.eot rename to internal_packages/github-contact-card/docs/public/fonts/aller-bold.eot diff --git a/examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-bold.ttf b/internal_packages/github-contact-card/docs/public/fonts/aller-bold.ttf similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-bold.ttf rename to internal_packages/github-contact-card/docs/public/fonts/aller-bold.ttf diff --git a/examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-bold.woff b/internal_packages/github-contact-card/docs/public/fonts/aller-bold.woff similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-bold.woff rename to internal_packages/github-contact-card/docs/public/fonts/aller-bold.woff diff --git a/examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-light.eot b/internal_packages/github-contact-card/docs/public/fonts/aller-light.eot similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-light.eot rename to internal_packages/github-contact-card/docs/public/fonts/aller-light.eot diff --git a/examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-light.ttf b/internal_packages/github-contact-card/docs/public/fonts/aller-light.ttf similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-light.ttf rename to internal_packages/github-contact-card/docs/public/fonts/aller-light.ttf diff --git a/examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-light.woff b/internal_packages/github-contact-card/docs/public/fonts/aller-light.woff similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/public/fonts/aller-light.woff rename to internal_packages/github-contact-card/docs/public/fonts/aller-light.woff diff --git a/examples/N1-Github-Contact-Card-Section/docs/public/fonts/roboto-black.eot b/internal_packages/github-contact-card/docs/public/fonts/roboto-black.eot similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/public/fonts/roboto-black.eot rename to internal_packages/github-contact-card/docs/public/fonts/roboto-black.eot diff --git a/examples/N1-Github-Contact-Card-Section/docs/public/fonts/roboto-black.ttf b/internal_packages/github-contact-card/docs/public/fonts/roboto-black.ttf similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/public/fonts/roboto-black.ttf rename to internal_packages/github-contact-card/docs/public/fonts/roboto-black.ttf diff --git a/examples/N1-Github-Contact-Card-Section/docs/public/fonts/roboto-black.woff b/internal_packages/github-contact-card/docs/public/fonts/roboto-black.woff similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/public/fonts/roboto-black.woff rename to internal_packages/github-contact-card/docs/public/fonts/roboto-black.woff diff --git a/examples/N1-Github-Contact-Card-Section/docs/public/stylesheets/normalize.css b/internal_packages/github-contact-card/docs/public/stylesheets/normalize.css similarity index 100% rename from examples/N1-Github-Contact-Card-Section/docs/public/stylesheets/normalize.css rename to internal_packages/github-contact-card/docs/public/stylesheets/normalize.css diff --git a/internal_packages/github-contact-card/icon.png b/internal_packages/github-contact-card/icon.png new file mode 100644 index 000000000..0c32bda74 Binary files /dev/null and b/internal_packages/github-contact-card/icon.png differ diff --git a/examples/N1-Github-Contact-Card-Section/lib/github-contact-card-section.cjsx b/internal_packages/github-contact-card/lib/github-contact-card-section.cjsx similarity index 95% rename from examples/N1-Github-Contact-Card-Section/lib/github-contact-card-section.cjsx rename to internal_packages/github-contact-card/lib/github-contact-card-section.cjsx index 2a1574a7e..b836da70b 100644 --- a/examples/N1-Github-Contact-Card-Section/lib/github-contact-card-section.cjsx +++ b/internal_packages/github-contact-card/lib/github-contact-card-section.cjsx @@ -1,4 +1,4 @@ -_ = require 'underscore-plus' +_ = require 'underscore' GithubUserStore = require "./github-user-store" {React} = require 'nylas-exports' @@ -33,7 +33,7 @@ class GithubProfile extends React.Component # Coffeescript at transpile-time. We're actually creating a nested tree of Javascript # objects here that *represent* the DOM we want.
- + {@props.profile.login}
{repoElements}
diff --git a/examples/N1-Github-Contact-Card-Section/lib/github-user-store.coffee b/internal_packages/github-contact-card/lib/github-user-store.coffee similarity index 88% rename from examples/N1-Github-Contact-Card-Section/lib/github-user-store.coffee rename to internal_packages/github-contact-card/lib/github-user-store.coffee index cd04ca92f..7078cd5db 100644 --- a/examples/N1-Github-Contact-Card-Section/lib/github-user-store.coffee +++ b/internal_packages/github-contact-card/lib/github-user-store.coffee @@ -1,4 +1,4 @@ -_ = require 'underscore-plus' +_ = require 'underscore' Reflux = require 'reflux' request = require 'request' {FocusedContactsStore} = require 'nylas-exports' @@ -77,8 +77,8 @@ GithubUserStore = Reflux.createStore @_profile = @_cache[email] = profile @trigger(@) - # Wrap the Node `request` library and pass the User-Agent header, which is required - # by Github's API. Also pass `json:true`, which causes responses to be automatically - # parsed. - _githubRequest: (url, callback) -> - request({url: url, headers: {'User-Agent': 'request'}, json: true}, callback) + # Wrap the Node `request` library and pass the User-Agent header, which is required + # by Github's API. Also pass `json:true`, which causes responses to be automatically + # parsed. + _githubRequest: (url, callback) -> + request({url: url, headers: {'User-Agent': 'request'}, json: true}, callback) diff --git a/examples/N1-Github-Contact-Card-Section/lib/main.cjsx b/internal_packages/github-contact-card/lib/main.cjsx similarity index 97% rename from examples/N1-Github-Contact-Card-Section/lib/main.cjsx rename to internal_packages/github-contact-card/lib/main.cjsx index 356dd6b21..1dd8435a9 100644 --- a/examples/N1-Github-Contact-Card-Section/lib/main.cjsx +++ b/internal_packages/github-contact-card/lib/main.cjsx @@ -1,4 +1,4 @@ -_ = require 'underscore-plus' +_ = require 'underscore' GithubContactCardSection = require "./github-contact-card-section" {ComponentRegistry, WorkspaceStore} = require "nylas-exports" diff --git a/examples/N1-Github-Contact-Card-Section/package.json b/internal_packages/github-contact-card/package.json similarity index 80% rename from examples/N1-Github-Contact-Card-Section/package.json rename to internal_packages/github-contact-card/package.json index e37251b2f..f75ecc2c1 100644 --- a/examples/N1-Github-Contact-Card-Section/package.json +++ b/internal_packages/github-contact-card/package.json @@ -1,10 +1,12 @@ { - "name": "N1-Github-Contact-Card-Section", + "name": "github-contact-card", "version": "0.1.0", "main": "./lib/main", + "isOptional": true, "isStarterPackage": true, - "title": "Github", + + "title": "GitHub Sidebar Info", "description": "Extends the contact card in the sidebar to show public repos of the people you email.", "icon": "./icon.png", @@ -19,6 +21,6 @@ "dependencies": { "reflux": "0.1.13", "request": "^2.53", - "underscore-plus": "^1.6" + "underscore": "^1.8" } } diff --git a/examples/N1-Github-Contact-Card-Section/screenshot.png b/internal_packages/github-contact-card/screenshot.png similarity index 100% rename from examples/N1-Github-Contact-Card-Section/screenshot.png rename to internal_packages/github-contact-card/screenshot.png diff --git a/examples/N1-Github-Contact-Card-Section/stylesheets/sidebar-github-profile.less b/internal_packages/github-contact-card/stylesheets/sidebar-github-profile.less similarity index 100% rename from examples/N1-Github-Contact-Card-Section/stylesheets/sidebar-github-profile.less rename to internal_packages/github-contact-card/stylesheets/sidebar-github-profile.less diff --git a/examples/N1-Message-View-on-Github/assets/github@2x.png b/internal_packages/message-view-on-github/assets/github@2x.png similarity index 100% rename from examples/N1-Message-View-on-Github/assets/github@2x.png rename to internal_packages/message-view-on-github/assets/github@2x.png diff --git a/examples/N1-Github-Contact-Card-Section/icon.png b/internal_packages/message-view-on-github/icon.png similarity index 100% rename from examples/N1-Github-Contact-Card-Section/icon.png rename to internal_packages/message-view-on-github/icon.png diff --git a/examples/N1-Message-View-on-Github/keymaps/github.cson b/internal_packages/message-view-on-github/keymaps/github.cson similarity index 100% rename from examples/N1-Message-View-on-Github/keymaps/github.cson rename to internal_packages/message-view-on-github/keymaps/github.cson diff --git a/examples/N1-Message-View-on-Github/lib/github-store.coffee b/internal_packages/message-view-on-github/lib/github-store.coffee similarity index 100% rename from examples/N1-Message-View-on-Github/lib/github-store.coffee rename to internal_packages/message-view-on-github/lib/github-store.coffee diff --git a/examples/N1-Message-View-on-Github/lib/main.cjsx b/internal_packages/message-view-on-github/lib/main.cjsx similarity index 100% rename from examples/N1-Message-View-on-Github/lib/main.cjsx rename to internal_packages/message-view-on-github/lib/main.cjsx diff --git a/examples/N1-Message-View-on-Github/lib/view-on-github-button.cjsx b/internal_packages/message-view-on-github/lib/view-on-github-button.cjsx similarity index 98% rename from examples/N1-Message-View-on-Github/lib/view-on-github-button.cjsx rename to internal_packages/message-view-on-github/lib/view-on-github-button.cjsx index 074b6bbb5..07875c237 100644 --- a/examples/N1-Message-View-on-Github/lib/view-on-github-button.cjsx +++ b/internal_packages/message-view-on-github/lib/view-on-github-button.cjsx @@ -83,7 +83,7 @@ class ViewOnGithubButton extends React.Component title={"Visit Thread on GitHub"}> + url="nylas://message-view-on-github/assets/github@2x.png" /> diff --git a/examples/N1-Message-View-on-Github/package.json b/internal_packages/message-view-on-github/package.json similarity index 51% rename from examples/N1-Message-View-on-Github/package.json rename to internal_packages/message-view-on-github/package.json index 0d9fe441a..f54720ecc 100644 --- a/examples/N1-Message-View-on-Github/package.json +++ b/internal_packages/message-view-on-github/package.json @@ -1,10 +1,15 @@ { - "name": "N1-Message-View-on-Github", + "name": "message-view-on-github", "version": "0.1.0", "main": "./lib/main", "description": "View on Github button", "license": "GPL-3.0", - "private": true, + + "title":"View on GitHub", + "description": "Adds a 'View On GitHub' button that appears when viewing GitHub emails.", + "icon": "./icon.png", + "isOptional": true, + "engines": { "nylas": ">=0.3.0 <0.5.0" }, diff --git a/examples/N1-Message-View-on-Github/stylesheets/github.less b/internal_packages/message-view-on-github/stylesheets/github.less similarity index 100% rename from examples/N1-Message-View-on-Github/stylesheets/github.less rename to internal_packages/message-view-on-github/stylesheets/github.less diff --git a/internal_packages/onboarding/lib/initial-packages-page.cjsx b/internal_packages/onboarding/lib/initial-packages-page.cjsx index 4723095a2..54fe852a5 100644 --- a/internal_packages/onboarding/lib/initial-packages-page.cjsx +++ b/internal_packages/onboarding/lib/initial-packages-page.cjsx @@ -3,52 +3,28 @@ path = require 'path' {RetinaImg, ConfigPropContainer} = require 'nylas-component-kit' {EdgehillAPI} = require 'nylas-exports' OnboardingActions = require './onboarding-actions' -InitialPackagesStore = require './initial-packages-store' - -RunningPackageInstalls = 0 class InstallButton extends React.Component constructor: (@props) -> @state = - installed: NylasEnv.packages.resolvePackagePath(@props.package.name)? - installing: false + installed: !NylasEnv.packages.isPackageDisabled(@props.package.name) render: => classname = "btn btn-install" - classname += " installing" if @state.installing classname += " installed" if @state.installed
_onInstall: => - return if @state.installing or @state.installed - return unless @props.package.path - RunningPackageInstalls += 1 - @setState(installing: true) - NylasEnv.packages.installPackageFromPath @props.package.path, (err) => - RunningPackageInstalls -= 1 - @props.onPackageInstaled() - @setState({ - installing: false - installed: NylasEnv.packages.resolvePackagePath(@props.package.name)? - }) + NylasEnv.packages.enablePackage(@props.package.name) + @setState(installed: true) class InitialPackagesPage extends React.Component @displayName: "InitialPackagesPage" constructor: (@props) -> - @state = @getStateFromStores() - - componentDidMount: => - @unlisten = InitialPackagesStore.listen => - @setState(@getStateFromStores()) - - componentWillUnmount: => - @unlisten?() - - getStateFromStores: => - packages: InitialPackagesStore.starterPackages - error: InitialPackagesStore.lastError + @state = + packages: NylasEnv.packages.getAvailablePackageMetadata().filter ({isStarterPackage}) => isStarterPackage render: =>
@@ -63,12 +39,11 @@ class InitialPackagesPage extends React.Component

- {@_renderError()} {@state.packages.map (item) =>
- +
- +
{item.title}
{item.description}
@@ -78,30 +53,14 @@ class InitialPackagesPage extends React.Component
- _renderError: => - return false unless @state.error -
{@state.error.toString()}
- - _renderStartSpinner: => - return false unless @state.waitingToGetStarted -
- _onPrevPage: => OnboardingActions.moveToPage('initial-preferences') - _onPackageInstaled: => - if RunningPackageInstalls is 0 and @state.waitingToGetStarted - @_onGetStarted() - _onGetStarted: => - if RunningPackageInstalls > 0 - @setState(waitingToGetStarted: true) - else - require('electron').ipcRenderer.send('account-setup-successful') + require('electron').ipcRenderer.send('account-setup-successful') module.exports = InitialPackagesPage diff --git a/internal_packages/onboarding/lib/initial-packages-store.coffee b/internal_packages/onboarding/lib/initial-packages-store.coffee deleted file mode 100644 index 9339c4ffd..000000000 --- a/internal_packages/onboarding/lib/initial-packages-store.coffee +++ /dev/null @@ -1,55 +0,0 @@ -path = require 'path' -fs = require 'fs' -async = require 'async' -NylasStore = require 'nylas-store' - -class InitialPackagesStore extends NylasStore - constructor: -> - @starterPackages = [] - {resourcePath} = NylasEnv.getLoadSettings() - - if resourcePath.indexOf('app.asar') != -1 - @starterPackagesPath = path.join(resourcePath,'..', 'app.asar.unpacked', 'examples') - else - @starterPackagesPath = path.join(resourcePath, "examples") - - @lastError = null - @loadStarterPackages() - - loadStarterPackages: => - fs.readdir @starterPackagesPath, (err, filenames) => - return @encounteredError(err) if err - packageJSONPaths = filenames.map (name) => - path.join(@starterPackagesPath, name, 'package.json') - - async.filter packageJSONPaths, fs.exists, (packageJSONPaths) => - return @encounteredError(err) if err - - async.map packageJSONPaths, fs.readFile, (err, packageJSONStrings) => - return @encounteredError(err) if err - - @starterPackages = packageJSONStrings.map(@parseStarterPackage) - # Remove falsy values / packages that were not starter packages - @starterPackages = @starterPackages.filter(Boolean) - - @trigger() - - parseStarterPackage: (jsonString) => - try - json = JSON.parse(jsonString) - - unless json?.isStarterPackage? - return false - unless json.icon? and json.title? and json.description? - console.log("Starter package `#{json.name}` is missing icon, title or description") - return false - - json.path = path.join(@starterPackagesPath, json.name) - json.iconPath = path.join(@starterPackagesPath, json.name, json.icon) - json - - encounteredError: (err) => - @lastError = err - @trigger() - -module.exports = new InitialPackagesStore() diff --git a/internal_packages/personal-level-indicators/README.md b/internal_packages/personal-level-indicators/README.md new file mode 100644 index 000000000..6142bac51 --- /dev/null +++ b/internal_packages/personal-level-indicators/README.md @@ -0,0 +1,15 @@ +# Personal Level Icon + +An icon to indicate whether an email was sent to either just you, or you and other recipients, or a mailing list that you were on. + + + +#### Enable this plugin + +1. Download and run N1 + +2. Navigate to Preferences > Plugins and click "Enable" beside the plugin. + +#### Who? + +This package is annotated for developers who have no experience with React, Flux, Electron, or N1. diff --git a/examples/N1-Personal-Level-Indicators/docs/docco.css b/internal_packages/personal-level-indicators/docs/docco.css similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/docco.css rename to internal_packages/personal-level-indicators/docs/docco.css diff --git a/examples/N1-Personal-Level-Indicators/docs/personal-level-icon.html b/internal_packages/personal-level-indicators/docs/personal-level-icon.html similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/personal-level-icon.html rename to internal_packages/personal-level-indicators/docs/personal-level-icon.html diff --git a/examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-bold.eot b/internal_packages/personal-level-indicators/docs/public/fonts/aller-bold.eot similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-bold.eot rename to internal_packages/personal-level-indicators/docs/public/fonts/aller-bold.eot diff --git a/examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-bold.ttf b/internal_packages/personal-level-indicators/docs/public/fonts/aller-bold.ttf similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-bold.ttf rename to internal_packages/personal-level-indicators/docs/public/fonts/aller-bold.ttf diff --git a/examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-bold.woff b/internal_packages/personal-level-indicators/docs/public/fonts/aller-bold.woff similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-bold.woff rename to internal_packages/personal-level-indicators/docs/public/fonts/aller-bold.woff diff --git a/examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-light.eot b/internal_packages/personal-level-indicators/docs/public/fonts/aller-light.eot similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-light.eot rename to internal_packages/personal-level-indicators/docs/public/fonts/aller-light.eot diff --git a/examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-light.ttf b/internal_packages/personal-level-indicators/docs/public/fonts/aller-light.ttf similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-light.ttf rename to internal_packages/personal-level-indicators/docs/public/fonts/aller-light.ttf diff --git a/examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-light.woff b/internal_packages/personal-level-indicators/docs/public/fonts/aller-light.woff similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/public/fonts/aller-light.woff rename to internal_packages/personal-level-indicators/docs/public/fonts/aller-light.woff diff --git a/examples/N1-Personal-Level-Indicators/docs/public/fonts/roboto-black.eot b/internal_packages/personal-level-indicators/docs/public/fonts/roboto-black.eot similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/public/fonts/roboto-black.eot rename to internal_packages/personal-level-indicators/docs/public/fonts/roboto-black.eot diff --git a/examples/N1-Personal-Level-Indicators/docs/public/fonts/roboto-black.ttf b/internal_packages/personal-level-indicators/docs/public/fonts/roboto-black.ttf similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/public/fonts/roboto-black.ttf rename to internal_packages/personal-level-indicators/docs/public/fonts/roboto-black.ttf diff --git a/examples/N1-Personal-Level-Indicators/docs/public/fonts/roboto-black.woff b/internal_packages/personal-level-indicators/docs/public/fonts/roboto-black.woff similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/public/fonts/roboto-black.woff rename to internal_packages/personal-level-indicators/docs/public/fonts/roboto-black.woff diff --git a/examples/N1-Personal-Level-Indicators/docs/public/stylesheets/normalize.css b/internal_packages/personal-level-indicators/docs/public/stylesheets/normalize.css similarity index 100% rename from examples/N1-Personal-Level-Indicators/docs/public/stylesheets/normalize.css rename to internal_packages/personal-level-indicators/docs/public/stylesheets/normalize.css diff --git a/examples/N1-Personal-Level-Indicators/examples-screencap-personal-level-icon.png b/internal_packages/personal-level-indicators/examples-screencap-personal-level-icon.png similarity index 100% rename from examples/N1-Personal-Level-Indicators/examples-screencap-personal-level-icon.png rename to internal_packages/personal-level-indicators/examples-screencap-personal-level-icon.png diff --git a/internal_packages/personal-level-indicators/icon.png b/internal_packages/personal-level-indicators/icon.png new file mode 100644 index 000000000..4b6f6e75a Binary files /dev/null and b/internal_packages/personal-level-indicators/icon.png differ diff --git a/examples/N1-Personal-Level-Indicators/lib/main.cjsx b/internal_packages/personal-level-indicators/lib/main.cjsx similarity index 100% rename from examples/N1-Personal-Level-Indicators/lib/main.cjsx rename to internal_packages/personal-level-indicators/lib/main.cjsx diff --git a/examples/N1-Personal-Level-Indicators/lib/personal-level-icon.cjsx b/internal_packages/personal-level-indicators/lib/personal-level-icon.cjsx similarity index 100% rename from examples/N1-Personal-Level-Indicators/lib/personal-level-icon.cjsx rename to internal_packages/personal-level-indicators/lib/personal-level-icon.cjsx diff --git a/examples/N1-Personal-Level-Indicators/lib/personal-level-icon.coffee b/internal_packages/personal-level-indicators/lib/personal-level-icon.coffee similarity index 100% rename from examples/N1-Personal-Level-Indicators/lib/personal-level-icon.coffee rename to internal_packages/personal-level-indicators/lib/personal-level-icon.coffee diff --git a/internal_packages/personal-level-indicators/package.json b/internal_packages/personal-level-indicators/package.json new file mode 100644 index 000000000..43156799c --- /dev/null +++ b/internal_packages/personal-level-indicators/package.json @@ -0,0 +1,21 @@ +{ + "name": "personal-level-indicators", + "main": "./lib/main", + "version": "0.1.0", + + "title": "Personal Level Indicators", + "description": "Display chevrons beside threads that indicate whether you're a direct recipient or the only recipient on a thread.", + "icon": "./icon.png", + "isOptional": true, + + "repository": { + "type": "git", + "url": "" + }, + "engines": { + "nylas": ">=0.3.0 <0.5.0" + }, + "description": "Enter a description of your package!", + "dependencies": [], + "license": "MIT" +} diff --git a/examples/N1-Personal-Level-Indicators/stylesheets/main.less b/internal_packages/personal-level-indicators/stylesheets/main.less similarity index 100% rename from examples/N1-Personal-Level-Indicators/stylesheets/main.less rename to internal_packages/personal-level-indicators/stylesheets/main.less diff --git a/examples/N1-Phishing-Detection/.gitignore b/internal_packages/phishing-detection/.gitignore similarity index 100% rename from examples/N1-Phishing-Detection/.gitignore rename to internal_packages/phishing-detection/.gitignore diff --git a/examples/N1-Phishing-Detection/README.md b/internal_packages/phishing-detection/README.md similarity index 100% rename from examples/N1-Phishing-Detection/README.md rename to internal_packages/phishing-detection/README.md diff --git a/examples/N1-Phishing-Detection/docs/docco.css b/internal_packages/phishing-detection/docs/docco.css similarity index 100% rename from examples/N1-Phishing-Detection/docs/docco.css rename to internal_packages/phishing-detection/docs/docco.css diff --git a/examples/N1-Phishing-Detection/docs/main.coffee b/internal_packages/phishing-detection/docs/main.coffee similarity index 97% rename from examples/N1-Phishing-Detection/docs/main.coffee rename to internal_packages/phishing-detection/docs/main.coffee index 6fc28e4ee..40278749d 100644 --- a/examples/N1-Phishing-Detection/docs/main.coffee +++ b/internal_packages/phishing-detection/docs/main.coffee @@ -64,10 +64,9 @@ class PhishingIndicator extends React.Component # This is our core logic for our whole package! If the `from` and # `replyTo` emails are different, then we want to show a phishing warning. - if reply_to isnt from - return [from, reply_to] + return [from, reply_to] if reply_to isnt from - return [null, null]; + return [null, null] module.exports = diff --git a/examples/N1-Phishing-Detection/docs/main.html b/internal_packages/phishing-detection/docs/main.html similarity index 100% rename from examples/N1-Phishing-Detection/docs/main.html rename to internal_packages/phishing-detection/docs/main.html diff --git a/examples/N1-Phishing-Detection/docs/public/fonts/aller-bold.eot b/internal_packages/phishing-detection/docs/public/fonts/aller-bold.eot similarity index 100% rename from examples/N1-Phishing-Detection/docs/public/fonts/aller-bold.eot rename to internal_packages/phishing-detection/docs/public/fonts/aller-bold.eot diff --git a/examples/N1-Phishing-Detection/docs/public/fonts/aller-bold.ttf b/internal_packages/phishing-detection/docs/public/fonts/aller-bold.ttf similarity index 100% rename from examples/N1-Phishing-Detection/docs/public/fonts/aller-bold.ttf rename to internal_packages/phishing-detection/docs/public/fonts/aller-bold.ttf diff --git a/examples/N1-Phishing-Detection/docs/public/fonts/aller-bold.woff b/internal_packages/phishing-detection/docs/public/fonts/aller-bold.woff similarity index 100% rename from examples/N1-Phishing-Detection/docs/public/fonts/aller-bold.woff rename to internal_packages/phishing-detection/docs/public/fonts/aller-bold.woff diff --git a/examples/N1-Phishing-Detection/docs/public/fonts/aller-light.eot b/internal_packages/phishing-detection/docs/public/fonts/aller-light.eot similarity index 100% rename from examples/N1-Phishing-Detection/docs/public/fonts/aller-light.eot rename to internal_packages/phishing-detection/docs/public/fonts/aller-light.eot diff --git a/examples/N1-Phishing-Detection/docs/public/fonts/aller-light.ttf b/internal_packages/phishing-detection/docs/public/fonts/aller-light.ttf similarity index 100% rename from examples/N1-Phishing-Detection/docs/public/fonts/aller-light.ttf rename to internal_packages/phishing-detection/docs/public/fonts/aller-light.ttf diff --git a/examples/N1-Phishing-Detection/docs/public/fonts/aller-light.woff b/internal_packages/phishing-detection/docs/public/fonts/aller-light.woff similarity index 100% rename from examples/N1-Phishing-Detection/docs/public/fonts/aller-light.woff rename to internal_packages/phishing-detection/docs/public/fonts/aller-light.woff diff --git a/examples/N1-Phishing-Detection/docs/public/fonts/roboto-black.eot b/internal_packages/phishing-detection/docs/public/fonts/roboto-black.eot similarity index 100% rename from examples/N1-Phishing-Detection/docs/public/fonts/roboto-black.eot rename to internal_packages/phishing-detection/docs/public/fonts/roboto-black.eot diff --git a/examples/N1-Phishing-Detection/docs/public/fonts/roboto-black.ttf b/internal_packages/phishing-detection/docs/public/fonts/roboto-black.ttf similarity index 100% rename from examples/N1-Phishing-Detection/docs/public/fonts/roboto-black.ttf rename to internal_packages/phishing-detection/docs/public/fonts/roboto-black.ttf diff --git a/examples/N1-Phishing-Detection/docs/public/fonts/roboto-black.woff b/internal_packages/phishing-detection/docs/public/fonts/roboto-black.woff similarity index 100% rename from examples/N1-Phishing-Detection/docs/public/fonts/roboto-black.woff rename to internal_packages/phishing-detection/docs/public/fonts/roboto-black.woff diff --git a/examples/N1-Phishing-Detection/docs/public/stylesheets/normalize.css b/internal_packages/phishing-detection/docs/public/stylesheets/normalize.css similarity index 100% rename from examples/N1-Phishing-Detection/docs/public/stylesheets/normalize.css rename to internal_packages/phishing-detection/docs/public/stylesheets/normalize.css diff --git a/internal_packages/phishing-detection/icon.png b/internal_packages/phishing-detection/icon.png new file mode 100644 index 000000000..6b476c1fd Binary files /dev/null and b/internal_packages/phishing-detection/icon.png differ diff --git a/examples/N1-Phishing-Detection/lib/main.cjsx b/internal_packages/phishing-detection/lib/main.cjsx similarity index 100% rename from examples/N1-Phishing-Detection/lib/main.cjsx rename to internal_packages/phishing-detection/lib/main.cjsx diff --git a/examples/N1-Phishing-Detection/package.json b/internal_packages/phishing-detection/package.json similarity index 57% rename from examples/N1-Phishing-Detection/package.json rename to internal_packages/phishing-detection/package.json index f50f75c79..a47e7090c 100755 --- a/examples/N1-Phishing-Detection/package.json +++ b/internal_packages/phishing-detection/package.json @@ -2,15 +2,16 @@ "name": "phishing", "version": "0.2.1", "main": "./lib/main", - "description": "An example package for Nylas Mail that translates drafts into other languages using the Yandex API.", "license": "GPL-3.0", + + "title": "Phishing Detection", + "description": "Warns you when an email specifies a reply-to address which is not the from address.", + "icon": "./icon.png", + "isOptional": true, + "engines": { "nylas": ">=0.3.0 <0.5.0" }, - "repository": { - "type": "git", - "url": "https://github.com/nylas/translate" - }, "windowTypes": { "default": true, "composer": true diff --git a/examples/N1-Phishing-Detection/screenshot.png b/internal_packages/phishing-detection/screenshot.png similarity index 100% rename from examples/N1-Phishing-Detection/screenshot.png rename to internal_packages/phishing-detection/screenshot.png diff --git a/examples/N1-Phishing-Detection/spec/main-spec.coffee b/internal_packages/phishing-detection/spec/main-spec.coffee similarity index 100% rename from examples/N1-Phishing-Detection/spec/main-spec.coffee rename to internal_packages/phishing-detection/spec/main-spec.coffee diff --git a/examples/N1-Phishing-Detection/stylesheets/index.less b/internal_packages/phishing-detection/stylesheets/index.less similarity index 100% rename from examples/N1-Phishing-Detection/stylesheets/index.less rename to internal_packages/phishing-detection/stylesheets/index.less diff --git a/examples/N1-Phishing-Detection/stylesheets/phishing.less b/internal_packages/phishing-detection/stylesheets/phishing.less similarity index 100% rename from examples/N1-Phishing-Detection/stylesheets/phishing.less rename to internal_packages/phishing-detection/stylesheets/phishing.less diff --git a/internal_packages/plugins/lib/main.cjsx b/internal_packages/plugins/lib/main.cjsx index e11a37dd0..ac9005699 100644 --- a/internal_packages/plugins/lib/main.cjsx +++ b/internal_packages/plugins/lib/main.cjsx @@ -1,28 +1,16 @@ -PluginsView = require "./plugins-view" -PluginsTabsView = require "./plugins-tabs-view" - {ComponentRegistry, + PreferencesUIStore, WorkspaceStore} = require 'nylas-exports' module.exports = activate: (@state={}) -> - WorkspaceStore.defineSheet 'Plugins', {root: true, name: 'Plugins', supportedModes: ['list']}, - list: ['RootSidebar', 'Plugins'] + @preferencesTab = new PreferencesUIStore.TabItem + tabId: "Plugins" + displayName: "Plugins" + component: require "./preferences-plugins" - @sidebarItem = new WorkspaceStore.SidebarItem - sheet: WorkspaceStore.Sheet.Plugins - icon: 'plugins.png' - id: 'plugins' - name: 'Plugins' - section: 'Views' - - WorkspaceStore.addSidebarItem(@sidebarItem) - - ComponentRegistry.register PluginsView, - location: WorkspaceStore.Location.Plugins + PreferencesUIStore.registerPreferencesTab(@preferencesTab) deactivate: -> - ComponentRegistry.unregister(PluginsView) - ComponentRegistry.unregister(PluginsTabsView) - WorkspaceStore.undefineSheet('Plugins') + PreferencesUIStore.unregisterPreferencesTab(@preferencesTab.sectionId) diff --git a/internal_packages/plugins/lib/package-set.cjsx b/internal_packages/plugins/lib/package-set.cjsx index a72031d19..a43229f32 100644 --- a/internal_packages/plugins/lib/package-set.cjsx +++ b/internal_packages/plugins/lib/package-set.cjsx @@ -15,7 +15,7 @@ class PackageSet extends React.Component if packages.length is 0 count = [] packages.push( -
{@props.emptyText ? "No packages to display."}
+
{@props.emptyText ? "No plugins to display."}
)
diff --git a/internal_packages/plugins/lib/package.cjsx b/internal_packages/plugins/lib/package.cjsx index 47cd189da..b9091ad53 100644 --- a/internal_packages/plugins/lib/package.cjsx +++ b/internal_packages/plugins/lib/package.cjsx @@ -1,6 +1,6 @@ React = require 'react' _ = require 'underscore' - +{Flexbox} = require 'nylas-component-kit' PluginsActions = require './plugins-actions' class Package extends React.Component @@ -16,7 +16,7 @@ class Package extends React.Component extras = [] if @props.package.installed - if @props.package.category in ['user' ,'dev'] + if @props.package.category in ['user' ,'dev', 'example'] if @props.package.enabled actions.push
Disable
else @@ -31,7 +31,7 @@ class Package extends React.Component else actions.push
Install
- {name, description} = @props.package + {name, description, title} = @props.package if @props.package.newerVersionAvailable extras.push( @@ -41,14 +41,17 @@ class Package extends React.Component
) -
-
-
{actions}
-
{name}
+ +
+ +
+
+
{title ? name}
{description}
+
{actions}
{extras} -
+ _onDisablePackage: => PluginsActions.disablePackage(@props.package) diff --git a/internal_packages/plugins/lib/packages-store.coffee b/internal_packages/plugins/lib/packages-store.coffee index b4f3d1a2d..3f5838ed1 100644 --- a/internal_packages/plugins/lib/packages-store.coffee +++ b/internal_packages/plugins/lib/packages-store.coffee @@ -138,11 +138,17 @@ PackagesStore = Reflux.createStore _onPackagesChanged: -> @_apm.getInstalled().then (packages) => - for category in ['dev', 'user', 'core'] + for category in ['dev', 'user'] packages[category] = packages[category].filter ({theme}) -> not theme packages[category].forEach (pkg) => pkg.category = category delete @_installing[pkg.name] + + available = NylasEnv.packages.getAvailablePackageMetadata() + examples = available.filter ({isOptional}) -> isOptional + packages['example'] = examples.map (pkg) -> + _.extend({}, pkg, {installed: true, category: 'example'}) + @_installed = packages @trigger() @@ -162,15 +168,8 @@ PackagesStore = Reflux.createStore @_apm.update(pkg, pkg.newerVersion) _onInstallPackage: -> - {resourcePath} = NylasEnv.getLoadSettings() - if resourcePath.indexOf('app.asar') != -1 - starterPackagesPath = path.join(resourcePath,'..', 'app.asar.unpacked', 'examples') - else - starterPackagesPath = path.join(resourcePath, "examples") - NylasEnv.showOpenDialog title: "Choose a Package Directory" - defaultPath: starterPackagesPath properties: ['openDirectory'] , (filenames) => return if not filenames or filenames.length is 0 diff --git a/internal_packages/plugins/lib/plugins-view.cjsx b/internal_packages/plugins/lib/preferences-plugins.cjsx similarity index 100% rename from internal_packages/plugins/lib/plugins-view.cjsx rename to internal_packages/plugins/lib/preferences-plugins.cjsx diff --git a/internal_packages/plugins/lib/tab-installed.cjsx b/internal_packages/plugins/lib/tab-installed.cjsx index 2689da877..ecb19d981 100644 --- a/internal_packages/plugins/lib/tab-installed.cjsx +++ b/internal_packages/plugins/lib/tab-installed.cjsx @@ -40,8 +40,11 @@ class TabInstalled extends React.Component placeholder="Search Installed Plugins"/> You don't have any plugins installed in ~/.nylas/packages.} /> + {devCTA}
-
diff --git a/internal_packages/plugins/stylesheets/plugins.less b/internal_packages/plugins/stylesheets/plugins.less index 4855ffa77..574b14b6c 100644 --- a/internal_packages/plugins/stylesheets/plugins.less +++ b/internal_packages/plugins/stylesheets/plugins.less @@ -22,11 +22,6 @@ } .plugins-view { - background: @background-off-primary; - position: absolute; - width:100%; - height:100%; - .new-package { margin-bottom:50px; } @@ -56,32 +51,36 @@ margin-top:35px; } .package { + align-items: center; background: @background-primary; border: 1px solid @border-color-divider; margin-top:@padding-large-vertical; margin-bottom:@padding-large-vertical; + padding:@padding-large-vertical @padding-large-horizontal; - .padded { - padding:@padding-large-vertical @padding-large-horizontal @padding-large-vertical @padding-large-horizontal; + .icon { + padding-right: @padding-large-horizontal; } - - .title { - color: @text-color-heading; + .info { + max-width: 380px; cursor: default; - margin:0; - font-size: @font-size-h4; - font-weight: @font-weight-normal; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - .description { - padding-top:@padding-base-vertical; - color: @text-color-very-subtle; - font-size: @font-size-small; + + .title { + color: @text-color-heading; + font-size: @font-size-h4; + font-weight: @font-weight-normal; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .description { + padding-top:@padding-base-vertical; + color: @text-color-very-subtle; + font-size: @font-size-small; + } } .actions { - float:right; + flex: 1; text-align: right; .btn { margin-left:@padding-small-horizontal; diff --git a/examples/N1-Quick-Schedule/README.md b/internal_packages/quick-schedule/README.md similarity index 59% rename from examples/N1-Quick-Schedule/README.md rename to internal_packages/quick-schedule/README.md index ea0688af5..50efb7ee2 100644 --- a/examples/N1-Quick-Schedule/README.md +++ b/internal_packages/quick-schedule/README.md @@ -2,24 +2,16 @@ Say goodbye to the hassle of scheduling! This new plugin lets you avoid the typical back-and-forth of picking a time to meet. Just select a few options, and your recipient confirms with one click. It's the best way to instantly schedule meetings. -This plugin works by adding a small "QuickSchedule" button next to the Send button in the composer. Clicking the button will open a calendar where you can select potential times to meet. These times are placed in the draft, and your recipient can confirm a time with one click. It even automatically adds the event to both calendars! +This plugin works by adding a small "QuickSchedule" button next to the Send button in the composer. Clicking the button will open a calendar where you can select potential times to meet. These times are placed in the draft, and your recipient can confirm a time with one click. It even automatically adds the event to both calendars! - + -### How to install this plugin +#### Enable this plugin -1. [Download and run N1](https://nylas.com/n1) - -2. From the menu, select `Developer > Install a Plugin Manually...` - The dialog will default to this examples directory. Just choose the - `N1-Quick-Schedule` folder to install it! - - > Note: When you install plugins, they're moved to `~/.nylas/packages`, - > and N1 runs `apm install` on the command line to fetch dependencies - > listed in the package's `package.json` +1. Download and run N1 +2. Navigate to Preferences > Plugins and click "Enable" beside the plugin. #### Who is this for? Anyone who makes a lot of appointments! If you are a developer, this is also a great example of a more complicated plugin that requires a backend service, and demonstrates how arbitrary JavaScript can be inserted to create custom functionality. - diff --git a/examples/N1-Quick-Schedule/assets/quickschedule-icon@2x.png b/internal_packages/quick-schedule/assets/quickschedule-icon@2x.png similarity index 100% rename from examples/N1-Quick-Schedule/assets/quickschedule-icon@2x.png rename to internal_packages/quick-schedule/assets/quickschedule-icon@2x.png diff --git a/examples/N1-Quick-Schedule/backend/Procfile b/internal_packages/quick-schedule/backend/Procfile similarity index 100% rename from examples/N1-Quick-Schedule/backend/Procfile rename to internal_packages/quick-schedule/backend/Procfile diff --git a/examples/N1-Quick-Schedule/backend/app.json b/internal_packages/quick-schedule/backend/app.json similarity index 100% rename from examples/N1-Quick-Schedule/backend/app.json rename to internal_packages/quick-schedule/backend/app.json diff --git a/examples/N1-Quick-Schedule/backend/backend.py b/internal_packages/quick-schedule/backend/backend.py similarity index 100% rename from examples/N1-Quick-Schedule/backend/backend.py rename to internal_packages/quick-schedule/backend/backend.py diff --git a/examples/N1-Quick-Schedule/backend/models.py b/internal_packages/quick-schedule/backend/models.py similarity index 100% rename from examples/N1-Quick-Schedule/backend/models.py rename to internal_packages/quick-schedule/backend/models.py diff --git a/examples/N1-Quick-Schedule/backend/requirements.txt b/internal_packages/quick-schedule/backend/requirements.txt similarity index 100% rename from examples/N1-Quick-Schedule/backend/requirements.txt rename to internal_packages/quick-schedule/backend/requirements.txt diff --git a/examples/N1-Quick-Schedule/backend/runtime.txt b/internal_packages/quick-schedule/backend/runtime.txt similarity index 100% rename from examples/N1-Quick-Schedule/backend/runtime.txt rename to internal_packages/quick-schedule/backend/runtime.txt diff --git a/examples/N1-Quick-Schedule/backend/session.py b/internal_packages/quick-schedule/backend/session.py similarity index 100% rename from examples/N1-Quick-Schedule/backend/session.py rename to internal_packages/quick-schedule/backend/session.py diff --git a/examples/N1-Quick-Schedule/backend/static/js/moment-timezone-with-data.min.js b/internal_packages/quick-schedule/backend/static/js/moment-timezone-with-data.min.js similarity index 100% rename from examples/N1-Quick-Schedule/backend/static/js/moment-timezone-with-data.min.js rename to internal_packages/quick-schedule/backend/static/js/moment-timezone-with-data.min.js diff --git a/examples/N1-Quick-Schedule/backend/static/js/moment.min.js b/internal_packages/quick-schedule/backend/static/js/moment.min.js similarity index 100% rename from examples/N1-Quick-Schedule/backend/static/js/moment.min.js rename to internal_packages/quick-schedule/backend/static/js/moment.min.js diff --git a/examples/N1-Quick-Schedule/backend/templates/bad_event_link.html b/internal_packages/quick-schedule/backend/templates/bad_event_link.html similarity index 100% rename from examples/N1-Quick-Schedule/backend/templates/bad_event_link.html rename to internal_packages/quick-schedule/backend/templates/bad_event_link.html diff --git a/examples/N1-Quick-Schedule/backend/templates/event_email.html b/internal_packages/quick-schedule/backend/templates/event_email.html similarity index 100% rename from examples/N1-Quick-Schedule/backend/templates/event_email.html rename to internal_packages/quick-schedule/backend/templates/event_email.html diff --git a/examples/N1-Quick-Schedule/backend/templates/event_email.txt b/internal_packages/quick-schedule/backend/templates/event_email.txt similarity index 100% rename from examples/N1-Quick-Schedule/backend/templates/event_email.txt rename to internal_packages/quick-schedule/backend/templates/event_email.txt diff --git a/examples/N1-Quick-Schedule/backend/templates/show_event.html b/internal_packages/quick-schedule/backend/templates/show_event.html similarity index 100% rename from examples/N1-Quick-Schedule/backend/templates/show_event.html rename to internal_packages/quick-schedule/backend/templates/show_event.html diff --git a/examples/N1-Quick-Schedule/backend/templates/success.html b/internal_packages/quick-schedule/backend/templates/success.html similarity index 100% rename from examples/N1-Quick-Schedule/backend/templates/success.html rename to internal_packages/quick-schedule/backend/templates/success.html diff --git a/examples/N1-Quick-Schedule/bootstrap.min.css b/internal_packages/quick-schedule/bootstrap.min.css similarity index 100% rename from examples/N1-Quick-Schedule/bootstrap.min.css rename to internal_packages/quick-schedule/bootstrap.min.css diff --git a/examples/N1-Quick-Schedule/bootstrap.min.js b/internal_packages/quick-schedule/bootstrap.min.js similarity index 100% rename from examples/N1-Quick-Schedule/bootstrap.min.js rename to internal_packages/quick-schedule/bootstrap.min.js diff --git a/examples/N1-Quick-Schedule/calendar.html b/internal_packages/quick-schedule/calendar.html similarity index 100% rename from examples/N1-Quick-Schedule/calendar.html rename to internal_packages/quick-schedule/calendar.html diff --git a/examples/N1-Quick-Schedule/docs/availability-composer-extension.html b/internal_packages/quick-schedule/docs/availability-composer-extension.html similarity index 100% rename from examples/N1-Quick-Schedule/docs/availability-composer-extension.html rename to internal_packages/quick-schedule/docs/availability-composer-extension.html diff --git a/examples/N1-Quick-Schedule/docs/calendar-button.html b/internal_packages/quick-schedule/docs/calendar-button.html similarity index 100% rename from examples/N1-Quick-Schedule/docs/calendar-button.html rename to internal_packages/quick-schedule/docs/calendar-button.html diff --git a/examples/N1-Quick-Schedule/docs/docco.css b/internal_packages/quick-schedule/docs/docco.css similarity index 100% rename from examples/N1-Quick-Schedule/docs/docco.css rename to internal_packages/quick-schedule/docs/docco.css diff --git a/examples/N1-Quick-Schedule/docs/main.html b/internal_packages/quick-schedule/docs/main.html similarity index 100% rename from examples/N1-Quick-Schedule/docs/main.html rename to internal_packages/quick-schedule/docs/main.html diff --git a/examples/N1-Quick-Schedule/docs/public/fonts/aller-bold.eot b/internal_packages/quick-schedule/docs/public/fonts/aller-bold.eot similarity index 100% rename from examples/N1-Quick-Schedule/docs/public/fonts/aller-bold.eot rename to internal_packages/quick-schedule/docs/public/fonts/aller-bold.eot diff --git a/examples/N1-Quick-Schedule/docs/public/fonts/aller-bold.ttf b/internal_packages/quick-schedule/docs/public/fonts/aller-bold.ttf similarity index 100% rename from examples/N1-Quick-Schedule/docs/public/fonts/aller-bold.ttf rename to internal_packages/quick-schedule/docs/public/fonts/aller-bold.ttf diff --git a/examples/N1-Quick-Schedule/docs/public/fonts/aller-bold.woff b/internal_packages/quick-schedule/docs/public/fonts/aller-bold.woff similarity index 100% rename from examples/N1-Quick-Schedule/docs/public/fonts/aller-bold.woff rename to internal_packages/quick-schedule/docs/public/fonts/aller-bold.woff diff --git a/examples/N1-Quick-Schedule/docs/public/fonts/aller-light.eot b/internal_packages/quick-schedule/docs/public/fonts/aller-light.eot similarity index 100% rename from examples/N1-Quick-Schedule/docs/public/fonts/aller-light.eot rename to internal_packages/quick-schedule/docs/public/fonts/aller-light.eot diff --git a/examples/N1-Quick-Schedule/docs/public/fonts/aller-light.ttf b/internal_packages/quick-schedule/docs/public/fonts/aller-light.ttf similarity index 100% rename from examples/N1-Quick-Schedule/docs/public/fonts/aller-light.ttf rename to internal_packages/quick-schedule/docs/public/fonts/aller-light.ttf diff --git a/examples/N1-Quick-Schedule/docs/public/fonts/aller-light.woff b/internal_packages/quick-schedule/docs/public/fonts/aller-light.woff similarity index 100% rename from examples/N1-Quick-Schedule/docs/public/fonts/aller-light.woff rename to internal_packages/quick-schedule/docs/public/fonts/aller-light.woff diff --git a/examples/N1-Quick-Schedule/docs/public/fonts/roboto-black.eot b/internal_packages/quick-schedule/docs/public/fonts/roboto-black.eot similarity index 100% rename from examples/N1-Quick-Schedule/docs/public/fonts/roboto-black.eot rename to internal_packages/quick-schedule/docs/public/fonts/roboto-black.eot diff --git a/examples/N1-Quick-Schedule/docs/public/fonts/roboto-black.ttf b/internal_packages/quick-schedule/docs/public/fonts/roboto-black.ttf similarity index 100% rename from examples/N1-Quick-Schedule/docs/public/fonts/roboto-black.ttf rename to internal_packages/quick-schedule/docs/public/fonts/roboto-black.ttf diff --git a/examples/N1-Quick-Schedule/docs/public/fonts/roboto-black.woff b/internal_packages/quick-schedule/docs/public/fonts/roboto-black.woff similarity index 100% rename from examples/N1-Quick-Schedule/docs/public/fonts/roboto-black.woff rename to internal_packages/quick-schedule/docs/public/fonts/roboto-black.woff diff --git a/examples/N1-Quick-Schedule/docs/public/stylesheets/normalize.css b/internal_packages/quick-schedule/docs/public/stylesheets/normalize.css similarity index 100% rename from examples/N1-Quick-Schedule/docs/public/stylesheets/normalize.css rename to internal_packages/quick-schedule/docs/public/stylesheets/normalize.css diff --git a/examples/N1-Quick-Schedule/fullcalendar/changelog.txt b/internal_packages/quick-schedule/fullcalendar/changelog.txt similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/changelog.txt rename to internal_packages/quick-schedule/fullcalendar/changelog.txt diff --git a/examples/N1-Quick-Schedule/fullcalendar/fullcalendar.css b/internal_packages/quick-schedule/fullcalendar/fullcalendar.css similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/fullcalendar.css rename to internal_packages/quick-schedule/fullcalendar/fullcalendar.css diff --git a/examples/N1-Quick-Schedule/fullcalendar/fullcalendar.js b/internal_packages/quick-schedule/fullcalendar/fullcalendar.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/fullcalendar.js rename to internal_packages/quick-schedule/fullcalendar/fullcalendar.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/fullcalendar.min.css b/internal_packages/quick-schedule/fullcalendar/fullcalendar.min.css similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/fullcalendar.min.css rename to internal_packages/quick-schedule/fullcalendar/fullcalendar.min.css diff --git a/examples/N1-Quick-Schedule/fullcalendar/fullcalendar.min.js b/internal_packages/quick-schedule/fullcalendar/fullcalendar.min.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/fullcalendar.min.js rename to internal_packages/quick-schedule/fullcalendar/fullcalendar.min.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/fullcalendar.print.css b/internal_packages/quick-schedule/fullcalendar/fullcalendar.print.css similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/fullcalendar.print.css rename to internal_packages/quick-schedule/fullcalendar/fullcalendar.print.css diff --git a/examples/N1-Quick-Schedule/fullcalendar/gcal.js b/internal_packages/quick-schedule/fullcalendar/gcal.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/gcal.js rename to internal_packages/quick-schedule/fullcalendar/gcal.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang-all.js b/internal_packages/quick-schedule/fullcalendar/lang-all.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang-all.js rename to internal_packages/quick-schedule/fullcalendar/lang-all.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/ar-ma.js b/internal_packages/quick-schedule/fullcalendar/lang/ar-ma.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/ar-ma.js rename to internal_packages/quick-schedule/fullcalendar/lang/ar-ma.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/ar-sa.js b/internal_packages/quick-schedule/fullcalendar/lang/ar-sa.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/ar-sa.js rename to internal_packages/quick-schedule/fullcalendar/lang/ar-sa.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/ar-tn.js b/internal_packages/quick-schedule/fullcalendar/lang/ar-tn.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/ar-tn.js rename to internal_packages/quick-schedule/fullcalendar/lang/ar-tn.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/ar.js b/internal_packages/quick-schedule/fullcalendar/lang/ar.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/ar.js rename to internal_packages/quick-schedule/fullcalendar/lang/ar.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/bg.js b/internal_packages/quick-schedule/fullcalendar/lang/bg.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/bg.js rename to internal_packages/quick-schedule/fullcalendar/lang/bg.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/ca.js b/internal_packages/quick-schedule/fullcalendar/lang/ca.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/ca.js rename to internal_packages/quick-schedule/fullcalendar/lang/ca.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/cs.js b/internal_packages/quick-schedule/fullcalendar/lang/cs.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/cs.js rename to internal_packages/quick-schedule/fullcalendar/lang/cs.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/da.js b/internal_packages/quick-schedule/fullcalendar/lang/da.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/da.js rename to internal_packages/quick-schedule/fullcalendar/lang/da.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/de-at.js b/internal_packages/quick-schedule/fullcalendar/lang/de-at.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/de-at.js rename to internal_packages/quick-schedule/fullcalendar/lang/de-at.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/de.js b/internal_packages/quick-schedule/fullcalendar/lang/de.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/de.js rename to internal_packages/quick-schedule/fullcalendar/lang/de.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/el.js b/internal_packages/quick-schedule/fullcalendar/lang/el.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/el.js rename to internal_packages/quick-schedule/fullcalendar/lang/el.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/en-au.js b/internal_packages/quick-schedule/fullcalendar/lang/en-au.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/en-au.js rename to internal_packages/quick-schedule/fullcalendar/lang/en-au.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/en-ca.js b/internal_packages/quick-schedule/fullcalendar/lang/en-ca.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/en-ca.js rename to internal_packages/quick-schedule/fullcalendar/lang/en-ca.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/en-gb.js b/internal_packages/quick-schedule/fullcalendar/lang/en-gb.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/en-gb.js rename to internal_packages/quick-schedule/fullcalendar/lang/en-gb.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/es.js b/internal_packages/quick-schedule/fullcalendar/lang/es.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/es.js rename to internal_packages/quick-schedule/fullcalendar/lang/es.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/fa.js b/internal_packages/quick-schedule/fullcalendar/lang/fa.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/fa.js rename to internal_packages/quick-schedule/fullcalendar/lang/fa.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/fi.js b/internal_packages/quick-schedule/fullcalendar/lang/fi.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/fi.js rename to internal_packages/quick-schedule/fullcalendar/lang/fi.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/fr-ca.js b/internal_packages/quick-schedule/fullcalendar/lang/fr-ca.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/fr-ca.js rename to internal_packages/quick-schedule/fullcalendar/lang/fr-ca.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/fr.js b/internal_packages/quick-schedule/fullcalendar/lang/fr.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/fr.js rename to internal_packages/quick-schedule/fullcalendar/lang/fr.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/he.js b/internal_packages/quick-schedule/fullcalendar/lang/he.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/he.js rename to internal_packages/quick-schedule/fullcalendar/lang/he.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/hi.js b/internal_packages/quick-schedule/fullcalendar/lang/hi.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/hi.js rename to internal_packages/quick-schedule/fullcalendar/lang/hi.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/hr.js b/internal_packages/quick-schedule/fullcalendar/lang/hr.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/hr.js rename to internal_packages/quick-schedule/fullcalendar/lang/hr.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/hu.js b/internal_packages/quick-schedule/fullcalendar/lang/hu.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/hu.js rename to internal_packages/quick-schedule/fullcalendar/lang/hu.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/id.js b/internal_packages/quick-schedule/fullcalendar/lang/id.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/id.js rename to internal_packages/quick-schedule/fullcalendar/lang/id.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/is.js b/internal_packages/quick-schedule/fullcalendar/lang/is.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/is.js rename to internal_packages/quick-schedule/fullcalendar/lang/is.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/it.js b/internal_packages/quick-schedule/fullcalendar/lang/it.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/it.js rename to internal_packages/quick-schedule/fullcalendar/lang/it.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/ja.js b/internal_packages/quick-schedule/fullcalendar/lang/ja.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/ja.js rename to internal_packages/quick-schedule/fullcalendar/lang/ja.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/ko.js b/internal_packages/quick-schedule/fullcalendar/lang/ko.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/ko.js rename to internal_packages/quick-schedule/fullcalendar/lang/ko.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/lt.js b/internal_packages/quick-schedule/fullcalendar/lang/lt.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/lt.js rename to internal_packages/quick-schedule/fullcalendar/lang/lt.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/lv.js b/internal_packages/quick-schedule/fullcalendar/lang/lv.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/lv.js rename to internal_packages/quick-schedule/fullcalendar/lang/lv.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/nb.js b/internal_packages/quick-schedule/fullcalendar/lang/nb.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/nb.js rename to internal_packages/quick-schedule/fullcalendar/lang/nb.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/nl.js b/internal_packages/quick-schedule/fullcalendar/lang/nl.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/nl.js rename to internal_packages/quick-schedule/fullcalendar/lang/nl.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/pl.js b/internal_packages/quick-schedule/fullcalendar/lang/pl.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/pl.js rename to internal_packages/quick-schedule/fullcalendar/lang/pl.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/pt-br.js b/internal_packages/quick-schedule/fullcalendar/lang/pt-br.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/pt-br.js rename to internal_packages/quick-schedule/fullcalendar/lang/pt-br.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/pt.js b/internal_packages/quick-schedule/fullcalendar/lang/pt.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/pt.js rename to internal_packages/quick-schedule/fullcalendar/lang/pt.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/ro.js b/internal_packages/quick-schedule/fullcalendar/lang/ro.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/ro.js rename to internal_packages/quick-schedule/fullcalendar/lang/ro.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/ru.js b/internal_packages/quick-schedule/fullcalendar/lang/ru.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/ru.js rename to internal_packages/quick-schedule/fullcalendar/lang/ru.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/sk.js b/internal_packages/quick-schedule/fullcalendar/lang/sk.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/sk.js rename to internal_packages/quick-schedule/fullcalendar/lang/sk.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/sl.js b/internal_packages/quick-schedule/fullcalendar/lang/sl.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/sl.js rename to internal_packages/quick-schedule/fullcalendar/lang/sl.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/sr-cyrl.js b/internal_packages/quick-schedule/fullcalendar/lang/sr-cyrl.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/sr-cyrl.js rename to internal_packages/quick-schedule/fullcalendar/lang/sr-cyrl.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/sr.js b/internal_packages/quick-schedule/fullcalendar/lang/sr.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/sr.js rename to internal_packages/quick-schedule/fullcalendar/lang/sr.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/sv.js b/internal_packages/quick-schedule/fullcalendar/lang/sv.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/sv.js rename to internal_packages/quick-schedule/fullcalendar/lang/sv.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/th.js b/internal_packages/quick-schedule/fullcalendar/lang/th.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/th.js rename to internal_packages/quick-schedule/fullcalendar/lang/th.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/tr.js b/internal_packages/quick-schedule/fullcalendar/lang/tr.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/tr.js rename to internal_packages/quick-schedule/fullcalendar/lang/tr.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/uk.js b/internal_packages/quick-schedule/fullcalendar/lang/uk.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/uk.js rename to internal_packages/quick-schedule/fullcalendar/lang/uk.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/vi.js b/internal_packages/quick-schedule/fullcalendar/lang/vi.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/vi.js rename to internal_packages/quick-schedule/fullcalendar/lang/vi.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/zh-cn.js b/internal_packages/quick-schedule/fullcalendar/lang/zh-cn.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/zh-cn.js rename to internal_packages/quick-schedule/fullcalendar/lang/zh-cn.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lang/zh-tw.js b/internal_packages/quick-schedule/fullcalendar/lang/zh-tw.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lang/zh-tw.js rename to internal_packages/quick-schedule/fullcalendar/lang/zh-tw.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/animated-overlay.gif b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/animated-overlay.gif similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/animated-overlay.gif rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/animated-overlay.gif diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_flat_15_cd0a0a_40x100.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_100_e4f1fb_1x400.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_50_3baae3_1x400.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_50_3baae3_1x400.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_50_3baae3_1x400.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_50_3baae3_1x400.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_glass_80_d7ebf9_1x400.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-hard_100_f2f5f7_1x100.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-hard_70_000000_1x100.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-soft_100_deedf7_1x100.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-bg_highlight-soft_25_ffef8f_1x100.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-icons_2694e8_256x240.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-icons_2694e8_256x240.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-icons_2694e8_256x240.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-icons_2694e8_256x240.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-icons_2e83ff_256x240.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-icons_2e83ff_256x240.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-icons_2e83ff_256x240.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-icons_2e83ff_256x240.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-icons_3d80b3_256x240.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-icons_3d80b3_256x240.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-icons_3d80b3_256x240.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-icons_3d80b3_256x240.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-icons_72a7cf_256x240.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-icons_72a7cf_256x240.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-icons_72a7cf_256x240.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-icons_72a7cf_256x240.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-icons_ffffff_256x240.png b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-icons_ffffff_256x240.png similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/images/ui-icons_ffffff_256x240.png rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/images/ui-icons_ffffff_256x240.png diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/jquery-ui.min.css b/internal_packages/quick-schedule/fullcalendar/lib/cupertino/jquery-ui.min.css similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/cupertino/jquery-ui.min.css rename to internal_packages/quick-schedule/fullcalendar/lib/cupertino/jquery-ui.min.css diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/jquery-ui.custom.min.js b/internal_packages/quick-schedule/fullcalendar/lib/jquery-ui.custom.min.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/jquery-ui.custom.min.js rename to internal_packages/quick-schedule/fullcalendar/lib/jquery-ui.custom.min.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/jquery.min.js b/internal_packages/quick-schedule/fullcalendar/lib/jquery.min.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/jquery.min.js rename to internal_packages/quick-schedule/fullcalendar/lib/jquery.min.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/moment-timezone-with-data.min.js b/internal_packages/quick-schedule/fullcalendar/lib/moment-timezone-with-data.min.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/moment-timezone-with-data.min.js rename to internal_packages/quick-schedule/fullcalendar/lib/moment-timezone-with-data.min.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/lib/moment.min.js b/internal_packages/quick-schedule/fullcalendar/lib/moment.min.js similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/lib/moment.min.js rename to internal_packages/quick-schedule/fullcalendar/lib/moment.min.js diff --git a/examples/N1-Quick-Schedule/fullcalendar/license.txt b/internal_packages/quick-schedule/fullcalendar/license.txt similarity index 100% rename from examples/N1-Quick-Schedule/fullcalendar/license.txt rename to internal_packages/quick-schedule/fullcalendar/license.txt diff --git a/internal_packages/quick-schedule/icon.png b/internal_packages/quick-schedule/icon.png new file mode 100644 index 000000000..61028188b Binary files /dev/null and b/internal_packages/quick-schedule/icon.png differ diff --git a/examples/N1-Quick-Schedule/lib/availability-composer-extension.coffee b/internal_packages/quick-schedule/lib/availability-composer-extension.coffee similarity index 100% rename from examples/N1-Quick-Schedule/lib/availability-composer-extension.coffee rename to internal_packages/quick-schedule/lib/availability-composer-extension.coffee diff --git a/examples/N1-Quick-Schedule/lib/calendar-button.cjsx b/internal_packages/quick-schedule/lib/calendar-button.cjsx similarity index 84% rename from examples/N1-Quick-Schedule/lib/calendar-button.cjsx rename to internal_packages/quick-schedule/lib/calendar-button.cjsx index eb0350b8e..57bacd596 100644 --- a/examples/N1-Quick-Schedule/lib/calendar-button.cjsx +++ b/internal_packages/quick-schedule/lib/calendar-button.cjsx @@ -6,13 +6,13 @@ class CalendarButton extends React.Component render: => _onClick: => BrowserWindow = require('remote').require('browser-window') w = new BrowserWindow - title: 'N1 QuickSchedule' + title: 'N1 Quick Schedule' nodeIntegration: false webPreferences: webSecurity:false diff --git a/examples/N1-Quick-Schedule/lib/main.cjsx b/internal_packages/quick-schedule/lib/main.cjsx similarity index 100% rename from examples/N1-Quick-Schedule/lib/main.cjsx rename to internal_packages/quick-schedule/lib/main.cjsx diff --git a/examples/N1-Quick-Schedule/package.json b/internal_packages/quick-schedule/package.json similarity index 80% rename from examples/N1-Quick-Schedule/package.json rename to internal_packages/quick-schedule/package.json index 716c0fad1..6813427c3 100644 --- a/examples/N1-Quick-Schedule/package.json +++ b/internal_packages/quick-schedule/package.json @@ -1,5 +1,5 @@ { - "name": "N1-Quick-Schedule", + "name": "quick-schedule", "main": "./lib/main", "version": "0.1.0", "repository": { @@ -9,7 +9,12 @@ "engines": { "nylas": ">=0.3.0 <0.5.0" }, + + "title":"Quick Schedule", "description": "Send calendar availabilities via email for easier appointment scheduling.", + "icon": "./icon.png", + "isOptional": true, + "dependencies": { "electron-safe-ipc": "^0.5", "request": "^2.53" diff --git a/examples/N1-Quick-Schedule/screenshots/quick-schedule-1.png b/internal_packages/quick-schedule/screenshots/quick-schedule-1.png similarity index 100% rename from examples/N1-Quick-Schedule/screenshots/quick-schedule-1.png rename to internal_packages/quick-schedule/screenshots/quick-schedule-1.png diff --git a/examples/N1-Quick-Schedule/screenshots/quick-schedule-2.png b/internal_packages/quick-schedule/screenshots/quick-schedule-2.png similarity index 100% rename from examples/N1-Quick-Schedule/screenshots/quick-schedule-2.png rename to internal_packages/quick-schedule/screenshots/quick-schedule-2.png diff --git a/examples/N1-Quick-Schedule/screenshots/quick-schedule-3.png b/internal_packages/quick-schedule/screenshots/quick-schedule-3.png similarity index 100% rename from examples/N1-Quick-Schedule/screenshots/quick-schedule-3.png rename to internal_packages/quick-schedule/screenshots/quick-schedule-3.png diff --git a/script/bootstrap b/script/bootstrap index 3a4fa3844..11bf19469 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -187,25 +187,27 @@ function bootstrap() { // we need this because we don't put our modules in node_modules and npm // install doesn't find them. Run APM install on each package directory manually. - internalPackagesDir = path.resolve(__dirname, '..', 'internal_packages'); - internalPackages = fs.readdirSync('internal_packages'); - internalPackages.forEach(function(dir) { - var dirPackageJSONPath = path.join(internalPackagesDir, dir, 'package.json'); - // On windows and linux, invoking the apm command is very slow even when there are no - // dependencies. Make it faster by not calling unless we find there are deps. - if (fs.existsSync(dirPackageJSONPath)) { - var dirPackageJSON = JSON.parse(fs.readFileSync(dirPackageJSONPath)); - if (dirPackageJSON.dependencies && (Object.keys(dirPackageJSON.dependencies).length > 0)) { - commands.push({ - command: apmInstallCommand, - message: "Installing dependencies for "+dir, - options: { - cwd: path.join(internalPackagesDir, dir), - env: apmEnv - } - }); + [ + path.resolve(__dirname, '..', 'internal_packages') + ].forEach(function(packagesDir) { + fs.readdirSync(packagesDir).forEach(function(dir) { + var dirPackageJSONPath = path.join(packagesDir, dir, 'package.json'); + // On windows and linux, invoking the apm command is very slow even when there are no + // dependencies. Make it faster by not calling unless we find there are deps. + if (fs.existsSync(dirPackageJSONPath)) { + var dirPackageJSON = JSON.parse(fs.readFileSync(dirPackageJSONPath)); + if (dirPackageJSON.dependencies && (Object.keys(dirPackageJSON.dependencies).length > 0)) { + commands.push({ + command: apmInstallCommand, + message: "Installing dependencies for "+dir, + options: { + cwd: path.join(packagesDir, dir), + env: apmEnv + } + }); + } } - } + }); }); commands = commands.concat([ diff --git a/src/apm-wrapper.coffee b/src/apm-wrapper.coffee index 5347829df..216adfae0 100644 --- a/src/apm-wrapper.coffee +++ b/src/apm-wrapper.coffee @@ -22,6 +22,7 @@ class APMWrapper options ||= {} options.env = ATOM_API_URL: 'https://edgehill-packages.nylas.com/api' + ATOM_RESOURCE_PATH: NylasEnv.getLoadSettings().resourcePath ATOM_HOME: NylasEnv.getConfigDirPath() if process.platform is "win32" diff --git a/src/browser/application.coffee b/src/browser/application.coffee index 5b63debca..37f578878 100644 --- a/src/browser/application.coffee +++ b/src/browser/application.coffee @@ -74,6 +74,39 @@ class Application @config = new Config({@configDirPath, @resourcePath}) @config.load() + if not @config.get('core.disabledPackagesInitialized') + exampleNewNames = { + 'N1-Quick-Schedule': 'quick-schedule', + 'N1-Composer-Templates': 'composer-templates', + 'N1-Composer-Translate': 'composer-translate', + 'N1-Message-View-on-Github':'message-view-on-github', + 'N1-Personal-Level-Indicators':'personal-level-indicators', + 'N1-Phishing-Detection': 'phishing-detection', + 'N1-Github-Contact-Card-Section': 'github-contact-card', + } + exampleOldNames = Object.keys(exampleNewNames) + examplesEnabled = [] + + if fs.existsSync(path.join(@configDirPath, 'packages')) + # Temporary: Find the examples that have been manually installed + packages = fs.readdirSync(path.join(@configDirPath, 'packages')) + examplesEnabled = packages.filter (packageName) -> + packageName in exampleOldNames and packageName[0] isnt '.' + + # Move old installed examples to a deprecated folder + deprecatedPath = path.join(@configDirPath, 'packages-deprecated') + fs.mkdirSync(deprecatedPath) unless fs.existsSync(deprecatedPath) + examplesEnabled.forEach (dir) => + prevPath = path.join(@configDirPath, 'packages', dir) + nextPath = path.join(deprecatedPath, dir) + fs.renameSync(prevPath, nextPath) + + # Disable examples not specifically enabled + for oldName, newName of exampleNewNames + continue if oldName in examplesEnabled + @config.pushAtKeyPath('core.disabledPackages', newName) + @config.set('core.disabledPackagesInitialized', true) + # Normally, you enter dev mode by passing the --dev command line flag. # But for developers using the compiled app, it's easier to toggle dev # mode from the menu and have it persist through relaunch.