From ab35c3557fd86e54bede2bbbe52d1e7472cbd5b6 Mon Sep 17 00:00:00 2001 From: amedora Date: Thu, 16 Aug 2018 16:36:00 +0900 Subject: [PATCH 1/9] add Monokai style for SnippetTab --- browser/components/SnippetTab.styl | 46 +++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/browser/components/SnippetTab.styl b/browser/components/SnippetTab.styl index 0cf4ce49..02f88f8c 100644 --- a/browser/components/SnippetTab.styl +++ b/browser/components/SnippetTab.styl @@ -136,4 +136,48 @@ body[data-theme="solarized-dark"] color $ui-solarized-dark-text-color .deleteButton - color alpha($ui-solarized-dark-text-color, 30%) \ No newline at end of file + color alpha($ui-solarized-dark-text-color, 30%) + +body[data-theme="monokai"] + .root + color $ui-monokai-text-color + border-color $ui-dark-borderColor + &:hover + background-color $ui-monokai-noteDetail-backgroundColor + .deleteButton + color $ui-monokai-text-color + &:hover + background-color darken($ui-monokai-noteDetail-backgroundColor, 15%) + &:active + color $ui-monokai-text-color + background-color $ui-dark-button--active-backgroundColor + + .root--active + color $ui-monokai-text-color + border-color $ui-monokai-borderColor + &:hover + background-color $ui-monokai-noteDetail-backgroundColor + .deleteButton + color $ui-monokai-text-color + &:hover + background-color darken($ui-monokai-noteDetail-backgroundColor, 15%) + &:active + color $ui-monokai-text-color + background-color $ui-dark-button--active-backgroundColor + + .button + border none + color $ui-monokai-text-color + background-color transparent + transition color background-color 0.15s + border-left 4px solid transparent + &:hover + color $ui-monokai-text-color + background-color $ui-monokai-noteDetail-backgroundColor + + .input + background-color $ui-monokai-noteDetail-backgroundColor + color $ui-monokai-text-color + + .deleteButton + color alpha($ui-monokai-text-color, 30%) \ No newline at end of file From b39ef5948b1d7f5b11cbc076b28a5e2d1243512b Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Mon, 20 Aug 2018 20:30:49 +0200 Subject: [PATCH 2/9] add EditorConfig --- .editorconfig | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..a4730cbf --- /dev/null +++ b/.editorconfig @@ -0,0 +1,16 @@ +# EditorConfig is awesome: http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Space indentation +[*] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true + +# The indent size used in the `package.json` file cannot be changed +# https://github.com/npm/npm/pull/3180#issuecomment-16336516 +[{*.yml,*.yaml,package.json}] +indent_style = space +indent_size = 2 From 71605fb8fe6f8e25d4d905e3f64cec75196598a1 Mon Sep 17 00:00:00 2001 From: Jack Hsieh Date: Sun, 26 Aug 2018 09:36:00 -0700 Subject: [PATCH 3/9] Fix text not readable for Monokai theme while creating new folder --- browser/styles/index.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/styles/index.styl b/browser/styles/index.styl index 7d32e77a..0c6896a2 100644 --- a/browser/styles/index.styl +++ b/browser/styles/index.styl @@ -377,7 +377,7 @@ $ui-monokai-button--active-backgroundColor = #f92672 $ui-monokai-button--hover-backgroundColor = lighten($ui-dark-backgroundColor, 10%) $ui-monokai-button--focus-borderColor = lighten(#369DCD, 25%) -modalmonokai() +modalMonokai() position relative z-index $modal-z-index width 100% From 7716880a6caa60c2411d4df4bf25027f2655aabe Mon Sep 17 00:00:00 2001 From: Jack Hsieh Date: Sun, 26 Aug 2018 16:47:22 -0700 Subject: [PATCH 4/9] Fix scroll for long table --- browser/components/markdown.styl | 1 + 1 file changed, 1 insertion(+) diff --git a/browser/components/markdown.styl b/browser/components/markdown.styl index 03503231..fb30742d 100644 --- a/browser/components/markdown.styl +++ b/browser/components/markdown.styl @@ -257,6 +257,7 @@ table display block width 100% margin 0 0 1em + overflow-x auto thead tr background-color tableHeadBgColor From 9f8246a26a2387b5dcae7e59bd8174c350cfee99 Mon Sep 17 00:00:00 2001 From: Baptiste Augrain Date: Thu, 30 Aug 2018 17:52:50 +0200 Subject: [PATCH 5/9] add default language for snippet note --- browser/main/Detail/SnippetNoteDetail.js | 3 ++- browser/main/NewNoteButton/index.js | 5 +++-- browser/main/modals/NewNoteModal.js | 4 ++-- .../main/modals/PreferencesModal/ConfigTab.styl | 2 +- browser/main/modals/PreferencesModal/UiTab.js | 17 +++++++++++++++++ 5 files changed, 25 insertions(+), 6 deletions(-) diff --git a/browser/main/Detail/SnippetNoteDetail.js b/browser/main/Detail/SnippetNoteDetail.js index 652d1f53..6220b5a4 100644 --- a/browser/main/Detail/SnippetNoteDetail.js +++ b/browser/main/Detail/SnippetNoteDetail.js @@ -573,11 +573,12 @@ class SnippetNoteDetail extends React.Component { } addSnippet () { + const { config } = this.props const { note } = this.state note.snippets = note.snippets.concat([{ name: '', - mode: 'Plain Text', + mode: config.editor.snippetDefaultLanguage || 'text', content: '' }]) const snippetIndex = note.snippets.length - 1 diff --git a/browser/main/NewNoteButton/index.js b/browser/main/NewNoteButton/index.js index a9b8de58..85dc7f40 100644 --- a/browser/main/NewNoteButton/index.js +++ b/browser/main/NewNoteButton/index.js @@ -34,14 +34,15 @@ class NewNoteButton extends React.Component { } handleNewNoteButtonClick (e) { - const { location, dispatch } = this.props + const { location, dispatch, config } = this.props const { storage, folder } = this.resolveTargetFolder() modal.open(NewNoteModal, { storage: storage.key, folder: folder.key, dispatch, - location + location, + config }) } diff --git a/browser/main/modals/NewNoteModal.js b/browser/main/modals/NewNoteModal.js index b748587c..f6aa2c67 100644 --- a/browser/main/modals/NewNoteModal.js +++ b/browser/main/modals/NewNoteModal.js @@ -61,7 +61,7 @@ class NewNoteModal extends React.Component { handleSnippetNoteButtonClick (e) { AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_SNIPPET') AwsMobileAnalyticsConfig.recordDynamicCustomEvent('ADD_ALLNOTE') - const { storage, folder, dispatch, location } = this.props + const { storage, folder, dispatch, location, config } = this.props dataApi .createNote(storage, { @@ -72,7 +72,7 @@ class NewNoteModal extends React.Component { snippets: [ { name: '', - mode: 'text', + mode: config.editor.snippetDefaultLanguage || 'text', content: '' } ] diff --git a/browser/main/modals/PreferencesModal/ConfigTab.styl b/browser/main/modals/PreferencesModal/ConfigTab.styl index 0e5f81fb..31994d97 100644 --- a/browser/main/modals/PreferencesModal/ConfigTab.styl +++ b/browser/main/modals/PreferencesModal/ConfigTab.styl @@ -24,7 +24,7 @@ line-height 30px .group-section-label - width 150px + width 200px text-align left margin-right 10px font-size 14px diff --git a/browser/main/modals/PreferencesModal/UiTab.js b/browser/main/modals/PreferencesModal/UiTab.js index aa3568e7..8ad8666c 100644 --- a/browser/main/modals/PreferencesModal/UiTab.js +++ b/browser/main/modals/PreferencesModal/UiTab.js @@ -85,6 +85,7 @@ class UiTab extends React.Component { displayLineNumbers: this.refs.editorDisplayLineNumbers.checked, switchPreview: this.refs.editorSwitchPreview.value, keyMap: this.refs.editorKeyMap.value, + snippetDefaultLanguage: this.refs.editorSnippetDefaultLanguage.value, scrollPastEnd: this.refs.scrollPastEnd.checked, fetchUrlTitle: this.refs.editorFetchUrlTitle.checked }, @@ -386,6 +387,22 @@ class UiTab extends React.Component {

{i18n.__('⚠️ Please restart boostnote after you change the keymap')}

+ +
+
+ {i18n.__('Snippet Default Language')} +
+
+ +
+
- +
{i18n.__('Snippet Default Language')} @@ -398,7 +398,7 @@ class UiTab extends React.Component { onChange={(e) => this.handleUIChange(e)} > { - _.sortBy(CodeMirror.modeInfo.map(mode => mode.name)).map(name => ()) + _.sortBy(CodeMirror.modeInfo.map(mode => mode.name)).map(name => ()) }
diff --git a/locales/en.json b/locales/en.json index a9767492..ab7b33f6 100644 --- a/locales/en.json +++ b/locales/en.json @@ -175,5 +175,6 @@ "Allow styles": "Allow styles", "Allow dangerous html tags": "Allow dangerous html tags", "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.", - "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠" + "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠", + "Snippet Default Language": "Snippet Default Language" } diff --git a/locales/fr.json b/locales/fr.json index 8b880aa6..e5ce7314 100644 --- a/locales/fr.json +++ b/locales/fr.json @@ -152,5 +152,6 @@ "Allow styles": "Accepter les styles", "Allow dangerous html tags": "Accepter les tags html dangereux", "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "Convertir des flèches textuelles en jolis signes. ⚠ Cela va interferérer avec les éventuels commentaires HTML dans votre Markdown.", - "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ Vous avez collé un lien qui référence une pièce-jointe qui n'a pas pu être récupéré dans le dossier de stockage de la note. Coller des liens qui font référence à des pièces-jointes ne fonctionne que si la source et la destination et la même. Veuillez plutôt utiliser du Drag & Drop ! ⚠" + "⚠ You have pasted a link referring an attachment that could not be found in the storage location of this note. Pasting links referring attachments is only supported if the source and destination location is the same storage. Please Drag&Drop the attachment instead! ⚠": "⚠ Vous avez collé un lien qui référence une pièce-jointe qui n'a pas pu être récupéré dans le dossier de stockage de la note. Coller des liens qui font référence à des pièces-jointes ne fonctionne que si la source et la destination et la même. Veuillez plutôt utiliser du Drag & Drop ! ⚠", + "Snippet Default Language": "Langage par défaut d'un snippet" } From 01641b5af4c873a8f4f1b9e277b752c0335e791b Mon Sep 17 00:00:00 2001 From: William Grant Date: Sat, 1 Sep 2018 12:54:48 +1000 Subject: [PATCH 7/9] fixed --- browser/styles/index.styl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/styles/index.styl b/browser/styles/index.styl index 7d32e77a..a52a8f61 100644 --- a/browser/styles/index.styl +++ b/browser/styles/index.styl @@ -5,7 +5,7 @@ $danger-color = #c9302c $danger-lighten-color = lighten(#c9302c, 5%) // Layouts -$statusBar-height = 22px +$statusBar-height = 28px $sideNav-width = 200px $sideNav--folded-width = 44px $topBar-height = 60px From d015b18c66cb76dd83b9dfec2b28eaf61d96c42e Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Sat, 1 Sep 2018 16:50:52 +0900 Subject: [PATCH 8/9] Revert flickering fix --- browser/components/CodeEditor.js | 6 ++---- browser/components/MarkdownEditor.js | 3 +-- browser/components/MarkdownPreview.js | 11 ++--------- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/browser/components/CodeEditor.js b/browser/components/CodeEditor.js index f16cc53c..d81ce39d 100644 --- a/browser/components/CodeEditor.js +++ b/browser/components/CodeEditor.js @@ -24,7 +24,6 @@ export default class CodeEditor extends React.Component { constructor (props) { super(props) - this.state = { isReady: false } this.scrollHandler = _.debounce(this.handleScroll.bind(this), 100, { leading: false, trailing: true @@ -215,7 +214,7 @@ export default class CodeEditor extends React.Component { CodeMirror.Vim.defineEx('wq', 'wq', this.quitEditor) CodeMirror.Vim.defineEx('qw', 'qw', this.quitEditor) CodeMirror.Vim.map('ZZ', ':q', 'normal') - this.setState({ isReady: true }) + this.tableEditor = new TableEditor(new TextEditorInterface(this.editor)) eventEmitter.on('code:format-table', this.formatTable) } @@ -582,8 +581,7 @@ export default class CodeEditor extends React.Component { style={{ fontFamily, fontSize: fontSize, - width: width, - opacity: this.state.isReady ? '1' : '0' + width: width }} onDrop={e => this.handleDropImage(e)} /> diff --git a/browser/components/MarkdownEditor.js b/browser/components/MarkdownEditor.js index 2b388f90..ee80c887 100644 --- a/browser/components/MarkdownEditor.js +++ b/browser/components/MarkdownEditor.js @@ -6,7 +6,6 @@ import CodeEditor from 'browser/components/CodeEditor' import MarkdownPreview from 'browser/components/MarkdownPreview' import eventEmitter from 'browser/main/lib/eventEmitter' import { findStorage } from 'browser/lib/findStorage' -import debounceRender from 'react-debounce-render' class MarkdownEditor extends React.Component { constructor (props) { @@ -313,4 +312,4 @@ MarkdownEditor.propTypes = { ignorePreviewPointerEvents: PropTypes.bool } -export default debounceRender(CSSModules(MarkdownEditor, styles)) +export default CSSModules(MarkdownEditor, styles) diff --git a/browser/components/MarkdownPreview.js b/browser/components/MarkdownPreview.js index 610585ba..5376a773 100755 --- a/browser/components/MarkdownPreview.js +++ b/browser/components/MarkdownPreview.js @@ -180,9 +180,7 @@ const defaultCodeBlockFontFamily = [ export default class MarkdownPreview extends React.Component { constructor (props) { super(props) - this.state = { - isReady: false - } + this.contextMenuHandler = e => this.handleContextMenu(e) this.mouseDownHandler = e => this.handleMouseDown(e) this.mouseUpHandler = e => this.handleMouseUp(e) @@ -457,7 +455,6 @@ export default class MarkdownPreview extends React.Component { eventEmitter.on('export:save-md', this.saveAsMdHandler) eventEmitter.on('export:save-html', this.saveAsHtmlHandler) eventEmitter.on('print', this.printHandler) - setTimeout(() => this.setState({ isReady: true })) } componentWillUnmount () { @@ -850,11 +847,7 @@ export default class MarkdownPreview extends React.Component { className={ className != null ? 'MarkdownPreview ' + className : 'MarkdownPreview' } - style={ - this.state.isReady - ? Object.assign(style, { opacity: '1' }) - : Object.assign(style, { opacity: '0' }) - } + style={style} tabIndex={tabIndex} ref='root' /> From 6a2242725d4b8397fff3147d018a1af042b9b33a Mon Sep 17 00:00:00 2001 From: Junyoung Choi Date: Tue, 4 Sep 2018 16:11:27 +0900 Subject: [PATCH 9/9] v0.11.9 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e9949adf..c9e22164 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "boost", "productName": "Boostnote", - "version": "0.11.8", + "version": "0.11.9", "main": "index.js", "description": "Boostnote", "license": "GPL-3.0",