1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 17:56:25 +00:00

Merge branch 'master' into filter-tags-and-folders

# Conflicts:
#	locales/zh-CN.json
This commit is contained in:
amedora
2020-01-30 10:13:16 +09:00
39 changed files with 417 additions and 108 deletions

View File

@@ -273,7 +273,7 @@ export default class CodeEditor extends React.Component {
} }
componentDidMount () { componentDidMount () {
const { rulers, enableRulers, enableMarkdownLint } = this.props const { rulers, enableRulers, enableMarkdownLint, RTL } = this.props
eventEmitter.on('line:jump', this.scrollToLineHandeler) eventEmitter.on('line:jump', this.scrollToLineHandeler)
snippetManager.init() snippetManager.init()
@@ -294,6 +294,8 @@ export default class CodeEditor extends React.Component {
scrollPastEnd: this.props.scrollPastEnd, scrollPastEnd: this.props.scrollPastEnd,
inputStyle: 'textarea', inputStyle: 'textarea',
dragDrop: false, dragDrop: false,
direction: RTL ? 'rtl' : 'ltr',
rtlMoveVisually: RTL,
foldGutter: true, foldGutter: true,
lint: enableMarkdownLint ? this.getCodeEditorLintConfig() : false, lint: enableMarkdownLint ? this.getCodeEditorLintConfig() : false,
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'CodeMirror-lint-markers'], gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter', 'CodeMirror-lint-markers'],
@@ -555,6 +557,10 @@ export default class CodeEditor extends React.Component {
if (prevProps.keyMap !== this.props.keyMap) { if (prevProps.keyMap !== this.props.keyMap) {
needRefresh = true needRefresh = true
} }
if (prevProps.RTL !== this.props.RTL) {
this.editor.setOption('direction', this.props.RTL ? 'rtl' : 'ltr')
this.editor.setOption('rtlMoveVisually', this.props.RTL)
}
if (prevProps.enableMarkdownLint !== enableMarkdownLint || prevProps.customMarkdownLintConfig !== customMarkdownLintConfig) { if (prevProps.enableMarkdownLint !== enableMarkdownLint || prevProps.customMarkdownLintConfig !== customMarkdownLintConfig) {
if (!enableMarkdownLint) { if (!enableMarkdownLint) {
this.editor.setOption('lint', {default: false}) this.editor.setOption('lint', {default: false})
@@ -1219,7 +1225,8 @@ CodeEditor.propTypes = {
spellCheck: PropTypes.bool, spellCheck: PropTypes.bool,
enableMarkdownLint: PropTypes.bool, enableMarkdownLint: PropTypes.bool,
customMarkdownLintConfig: PropTypes.string, customMarkdownLintConfig: PropTypes.string,
deleteUnusedAttachments: PropTypes.bool deleteUnusedAttachments: PropTypes.bool,
RTL: PropTypes.bool
} }
CodeEditor.defaultProps = { CodeEditor.defaultProps = {
@@ -1235,5 +1242,6 @@ CodeEditor.defaultProps = {
enableMarkdownLint: DEFAULT_CONFIG.editor.enableMarkdownLint, enableMarkdownLint: DEFAULT_CONFIG.editor.enableMarkdownLint,
customMarkdownLintConfig: DEFAULT_CONFIG.editor.customMarkdownLintConfig, customMarkdownLintConfig: DEFAULT_CONFIG.editor.customMarkdownLintConfig,
prettierConfig: DEFAULT_CONFIG.editor.prettierConfig, prettierConfig: DEFAULT_CONFIG.editor.prettierConfig,
deleteUnusedAttachments: DEFAULT_CONFIG.editor.deleteUnusedAttachments deleteUnusedAttachments: DEFAULT_CONFIG.editor.deleteUnusedAttachments,
RTL: false
} }

View File

@@ -267,7 +267,7 @@ class MarkdownEditor extends React.Component {
} }
render () { render () {
const {className, value, config, storageKey, noteKey, linesHighlighted} = this.props const {className, value, config, storageKey, noteKey, linesHighlighted, RTL} = this.props
let editorFontSize = parseInt(config.editor.fontSize, 10) let editorFontSize = parseInt(config.editor.fontSize, 10)
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14 if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
@@ -325,6 +325,7 @@ class MarkdownEditor extends React.Component {
customMarkdownLintConfig={config.editor.customMarkdownLintConfig} customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
prettierConfig={config.editor.prettierConfig} prettierConfig={config.editor.prettierConfig}
deleteUnusedAttachments={config.editor.deleteUnusedAttachments} deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
RTL={RTL}
/> />
<MarkdownPreview styleName={this.state.status === 'PREVIEW' <MarkdownPreview styleName={this.state.status === 'PREVIEW'
? 'preview' ? 'preview'
@@ -360,6 +361,7 @@ class MarkdownEditor extends React.Component {
allowCustomCSS={config.preview.allowCustomCSS} allowCustomCSS={config.preview.allowCustomCSS}
lineThroughCheckbox={config.preview.lineThroughCheckbox} lineThroughCheckbox={config.preview.lineThroughCheckbox}
onDrop={(e) => this.handleDropImage(e)} onDrop={(e) => this.handleDropImage(e)}
RTL={RTL}
/> />
</div> </div>
) )

View File

@@ -21,6 +21,7 @@ import yaml from 'js-yaml'
import { render } from 'react-dom' import { render } from 'react-dom'
import Carousel from 'react-image-carousel' import Carousel from 'react-image-carousel'
import ConfigManager from '../main/lib/ConfigManager' import ConfigManager from '../main/lib/ConfigManager'
import i18n from 'browser/lib/i18n'
const { remote, shell } = require('electron') const { remote, shell } = require('electron')
const attachmentManagement = require('../main/lib/dataApi/attachmentManagement') const attachmentManagement = require('../main/lib/dataApi/attachmentManagement')
@@ -63,7 +64,8 @@ function buildStyle (opts) {
scrollPastEnd, scrollPastEnd,
theme, theme,
allowCustomCSS, allowCustomCSS,
customCSS customCSS,
RTL
} = opts } = opts
return ` return `
@font-face { @font-face {
@@ -100,11 +102,14 @@ ${markdownStyle}
body { body {
font-family: '${fontFamily.join("','")}'; font-family: '${fontFamily.join("','")}';
font-size: ${fontSize}px; font-size: ${fontSize}px;
${scrollPastEnd ? ` ${scrollPastEnd ? `
padding-bottom: 90vh; padding-bottom: 90vh;
box-sizing: border-box; box-sizing: border-box;
` `
: ''} : ''}
${RTL ? 'direction: rtl;' : ''}
${RTL ? 'text-align: right;' : ''}
} }
@media print { @media print {
body { body {
@@ -114,6 +119,8 @@ body {
code { code {
font-family: '${codeBlockFontFamily.join("','")}'; font-family: '${codeBlockFontFamily.join("','")}';
background-color: rgba(0,0,0,0.04); background-color: rgba(0,0,0,0.04);
text-align: left;
direction: ltr;
} }
.lineNumber { .lineNumber {
${lineNumber && 'display: block !important;'} ${lineNumber && 'display: block !important;'}
@@ -245,6 +252,7 @@ export default class MarkdownPreview extends React.Component {
this.saveAsHtmlHandler = () => this.handleSaveAsHtml() this.saveAsHtmlHandler = () => this.handleSaveAsHtml()
this.saveAsPdfHandler = () => this.handleSaveAsPdf() this.saveAsPdfHandler = () => this.handleSaveAsPdf()
this.printHandler = () => this.handlePrint() this.printHandler = () => this.handlePrint()
this.resizeHandler = _.throttle(this.handleResize.bind(this), 100)
this.linkClickHandler = this.handleLinkClick.bind(this) this.linkClickHandler = this.handleLinkClick.bind(this)
this.initMarkdown = this.initMarkdown.bind(this) this.initMarkdown = this.initMarkdown.bind(this)
@@ -335,7 +343,8 @@ export default class MarkdownPreview extends React.Component {
scrollPastEnd, scrollPastEnd,
theme, theme,
allowCustomCSS, allowCustomCSS,
customCSS customCSS,
RTL
} = this.getStyleParams() } = this.getStyleParams()
const inlineStyles = buildStyle({ const inlineStyles = buildStyle({
@@ -346,9 +355,10 @@ export default class MarkdownPreview extends React.Component {
scrollPastEnd, scrollPastEnd,
theme, theme,
allowCustomCSS, allowCustomCSS,
customCSS customCSS,
RTL
}) })
let body = this.markdown.render(noteContent) let body = this.refs.root.contentWindow.document.body.innerHTML
body = attachmentManagement.fixLocalURLS( body = attachmentManagement.fixLocalURLS(
body, body,
this.props.storagePath this.props.storagePath
@@ -368,7 +378,7 @@ export default class MarkdownPreview extends React.Component {
let styles = '' let styles = ''
files.forEach(file => { files.forEach(file => {
styles += `<link rel="stylesheet" href="css/${path.basename(file)}">` styles += `<link rel="stylesheet" href="../css/${path.basename(file)}">`
}) })
return `<html> return `<html>
@@ -423,7 +433,8 @@ export default class MarkdownPreview extends React.Component {
.then(res => { .then(res => {
dialog.showMessageBox(remote.getCurrentWindow(), { dialog.showMessageBox(remote.getCurrentWindow(), {
type: 'info', type: 'info',
message: `Exported to ${filename}` message: `Exported to ${filename}`,
buttons: [i18n.__('Ok')]
}) })
}) })
.catch(err => { .catch(err => {
@@ -538,6 +549,10 @@ export default class MarkdownPreview extends React.Component {
'scroll', 'scroll',
this.scrollHandler this.scrollHandler
) )
this.refs.root.contentWindow.addEventListener(
'resize',
this.resizeHandler
)
eventEmitter.on('export:save-text', this.saveAsTextHandler) eventEmitter.on('export:save-text', this.saveAsTextHandler)
eventEmitter.on('export:save-md', this.saveAsMdHandler) eventEmitter.on('export:save-md', this.saveAsMdHandler)
eventEmitter.on('export:save-html', this.saveAsHtmlHandler) eventEmitter.on('export:save-html', this.saveAsHtmlHandler)
@@ -576,6 +591,10 @@ export default class MarkdownPreview extends React.Component {
'scroll', 'scroll',
this.scrollHandler this.scrollHandler
) )
this.refs.root.contentWindow.removeEventListener(
'resize',
this.resizeHandler
)
eventEmitter.off('export:save-text', this.saveAsTextHandler) eventEmitter.off('export:save-text', this.saveAsTextHandler)
eventEmitter.off('export:save-md', this.saveAsMdHandler) eventEmitter.off('export:save-md', this.saveAsMdHandler)
eventEmitter.off('export:save-html', this.saveAsHtmlHandler) eventEmitter.off('export:save-html', this.saveAsHtmlHandler)
@@ -608,7 +627,8 @@ export default class MarkdownPreview extends React.Component {
prevProps.theme !== this.props.theme || prevProps.theme !== this.props.theme ||
prevProps.scrollPastEnd !== this.props.scrollPastEnd || prevProps.scrollPastEnd !== this.props.scrollPastEnd ||
prevProps.allowCustomCSS !== this.props.allowCustomCSS || prevProps.allowCustomCSS !== this.props.allowCustomCSS ||
prevProps.customCSS !== this.props.customCSS prevProps.customCSS !== this.props.customCSS ||
prevProps.RTL !== this.props.RTL
) { ) {
this.applyStyle() this.applyStyle()
needsRewriteIframe = true needsRewriteIframe = true
@@ -632,7 +652,8 @@ export default class MarkdownPreview extends React.Component {
scrollPastEnd, scrollPastEnd,
theme, theme,
allowCustomCSS, allowCustomCSS,
customCSS customCSS,
RTL
} = this.props } = this.props
let { fontFamily, codeBlockFontFamily } = this.props let { fontFamily, codeBlockFontFamily } = this.props
fontFamily = _.isString(fontFamily) && fontFamily.trim().length > 0 fontFamily = _.isString(fontFamily) && fontFamily.trim().length > 0
@@ -658,7 +679,8 @@ export default class MarkdownPreview extends React.Component {
scrollPastEnd, scrollPastEnd,
theme, theme,
allowCustomCSS, allowCustomCSS,
customCSS customCSS,
RTL
} }
} }
@@ -672,7 +694,8 @@ export default class MarkdownPreview extends React.Component {
scrollPastEnd, scrollPastEnd,
theme, theme,
allowCustomCSS, allowCustomCSS,
customCSS customCSS,
RTL
} = this.getStyleParams() } = this.getStyleParams()
this.getWindow().document.getElementById( this.getWindow().document.getElementById(
@@ -686,7 +709,8 @@ export default class MarkdownPreview extends React.Component {
scrollPastEnd, scrollPastEnd,
theme, theme,
allowCustomCSS, allowCustomCSS,
customCSS customCSS,
RTL
}) })
} }
@@ -995,6 +1019,15 @@ export default class MarkdownPreview extends React.Component {
} }
} }
handleResize () {
_.forEach(
this.refs.root.contentWindow.document.querySelectorAll('svg[ratio]'),
el => {
el.setAttribute('height', el.clientWidth / el.getAttribute('ratio'))
}
)
}
focus () { focus () {
this.refs.root.focus() this.refs.root.focus()
} }

View File

@@ -137,7 +137,7 @@ class MarkdownSplitEditor extends React.Component {
} }
render () { render () {
const {config, value, storageKey, noteKey, linesHighlighted} = this.props const {config, value, storageKey, noteKey, linesHighlighted, RTL} = this.props
const storage = findStorage(storageKey) const storage = findStorage(storageKey)
let editorFontSize = parseInt(config.editor.fontSize, 10) let editorFontSize = parseInt(config.editor.fontSize, 10)
if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14 if (!(editorFontSize > 0 && editorFontSize < 101)) editorFontSize = 14
@@ -183,6 +183,7 @@ class MarkdownSplitEditor extends React.Component {
enableMarkdownLint={config.editor.enableMarkdownLint} enableMarkdownLint={config.editor.enableMarkdownLint}
customMarkdownLintConfig={config.editor.customMarkdownLintConfig} customMarkdownLintConfig={config.editor.customMarkdownLintConfig}
deleteUnusedAttachments={config.editor.deleteUnusedAttachments} deleteUnusedAttachments={config.editor.deleteUnusedAttachments}
RTL={RTL}
/> />
<div styleName='slider' style={{left: this.state.codeEditorWidthInPercent + '%'}} onMouseDown={e => this.handleMouseDown(e)} > <div styleName='slider' style={{left: this.state.codeEditorWidthInPercent + '%'}} onMouseDown={e => this.handleMouseDown(e)} >
<div styleName='slider-hitbox' /> <div styleName='slider-hitbox' />
@@ -213,6 +214,7 @@ class MarkdownSplitEditor extends React.Component {
customCSS={config.preview.customCSS} customCSS={config.preview.customCSS}
allowCustomCSS={config.preview.allowCustomCSS} allowCustomCSS={config.preview.allowCustomCSS}
lineThroughCheckbox={config.preview.lineThroughCheckbox} lineThroughCheckbox={config.preview.lineThroughCheckbox}
RTL={RTL}
/> />
</div> </div>
) )

View File

@@ -5,6 +5,7 @@ import PropTypes from 'prop-types'
import React from 'react' import React from 'react'
import { isArray, sortBy } from 'lodash' import { isArray, sortBy } from 'lodash'
import invertColor from 'invert-color' import invertColor from 'invert-color'
import Emoji from 'react-emoji-render'
import CSSModules from 'browser/lib/CSSModules' import CSSModules from 'browser/lib/CSSModules'
import { getTodoStatus } from 'browser/lib/getTodoStatus' import { getTodoStatus } from 'browser/lib/getTodoStatus'
import styles from './NoteItem.styl' import styles from './NoteItem.styl'
@@ -87,7 +88,7 @@ const NoteItem = ({
: <i styleName='item-title-icon' className='fa fa-fw fa-file-text-o' />} : <i styleName='item-title-icon' className='fa fa-fw fa-file-text-o' />}
<div styleName='item-title'> <div styleName='item-title'>
{note.title.trim().length > 0 {note.title.trim().length > 0
? note.title ? <Emoji text={note.title} />
: <span styleName='item-title-empty'>{i18n.__('Empty note')}</span>} : <span styleName='item-title-empty'>{i18n.__('Empty note')}</span>}
</div> </div>
<div styleName='item-middle'> <div styleName='item-middle'>

View File

@@ -427,6 +427,9 @@ pre.fence
canvas, svg canvas, svg
max-width 100% !important max-width 100% !important
svg[ratio]
width 100%
.gallery .gallery
width 100% width 100%
height 50vh height 50vh
@@ -447,6 +450,44 @@ pre.fence
color $ui-text-color color $ui-text-color
background-color $ui-tag-backgroundColor background-color $ui-tag-backgroundColor
.markdownIt-TOC-wrapper
list-style none
position fixed
right 0
top 0
margin-left 15px
z-index 1000
transition transform .2s ease-in-out
transform translateX(100%)
.markdownIt-TOC
display block
max-height 90vh
overflow-y auto
padding 25px
padding-left 38px
&,
&:before
background-color $ui-dark-backgroundColor
color: $ui-dark-text-color
&:hover
transform translateX(-15px)
&:before
content 'TOC'
position absolute
width 60px
height 30px
top 60px
left -29px
display flex
align-items center
justify-content center
transform-origin top left
transform rotate(-90deg)
themeDarkBackground = darken(#21252B, 10%) themeDarkBackground = darken(#21252B, 10%)
themeDarkText = #f9f9f9 themeDarkText = #f9f9f9
themeDarkBorder = lighten(themeDarkBackground, 20%) themeDarkBorder = lighten(themeDarkBackground, 20%)
@@ -514,6 +555,14 @@ body[data-theme="dark"]
color $ui-dark-text-color color $ui-dark-text-color
background-color $ui-dark-tag-backgroundColor background-color $ui-dark-tag-backgroundColor
.markdownIt-TOC-wrapper
&,
&:before
background-color darken(themeDarkBackground, 5%)
color themeDarkText
themeSolarizedDarkBackground = $ui-solarized-dark-noteDetail-backgroundColor
themeSolarizedDarkTableOdd = $ui-solarized-dark-noteDetail-backgroundColor themeSolarizedDarkTableOdd = $ui-solarized-dark-noteDetail-backgroundColor
themeSolarizedDarkTableEven = darken($ui-solarized-dark-noteDetail-backgroundColor, 10%) themeSolarizedDarkTableEven = darken($ui-solarized-dark-noteDetail-backgroundColor, 10%)
themeSolarizedDarkTableHead = themeSolarizedDarkTableEven themeSolarizedDarkTableHead = themeSolarizedDarkTableEven
@@ -522,7 +571,7 @@ themeSolarizedDarkTableBorder = themeDarkBorder
body[data-theme="solarized-dark"] body[data-theme="solarized-dark"]
color $ui-solarized-dark-text-color color $ui-solarized-dark-text-color
border-color themeDarkBorder border-color themeDarkBorder
background-color $ui-solarized-dark-noteDetail-backgroundColor background-color themeSolarizedDarkBackground
table table
thead thead
tr tr
@@ -557,6 +606,13 @@ body[data-theme="solarized-dark"]
color $ui-solarized-dark-button--active-color color $ui-solarized-dark-button--active-color
background-color $ui-solarized-dark-button-backgroundColor background-color $ui-solarized-dark-button-backgroundColor
.markdownIt-TOC-wrapper
&,
&:before
background-color darken(themeSolarizedDarkBackground, 15%)
color themeDarkText
themeMonokaiBackground = $ui-monokai-noteDetail-backgroundColor
themeMonokaiTableOdd = $ui-monokai-noteDetail-backgroundColor themeMonokaiTableOdd = $ui-monokai-noteDetail-backgroundColor
themeMonokaiTableEven = darken($ui-monokai-noteDetail-backgroundColor, 10%) themeMonokaiTableEven = darken($ui-monokai-noteDetail-backgroundColor, 10%)
themeMonokaiTableHead = themeMonokaiTableEven themeMonokaiTableHead = themeMonokaiTableEven
@@ -565,7 +621,7 @@ themeMonokaiTableBorder = themeDarkBorder
body[data-theme="monokai"] body[data-theme="monokai"]
color $ui-monokai-text-color color $ui-monokai-text-color
border-color themeDarkBorder border-color themeDarkBorder
background-color $ui-monokai-noteDetail-backgroundColor background-color themeMonokaiBackground
table table
thead thead
tr tr
@@ -603,6 +659,13 @@ body[data-theme="monokai"]
color $ui-monokai-button--active-color color $ui-monokai-button--active-color
background-color $ui-monokai-button-backgroundColor background-color $ui-monokai-button-backgroundColor
.markdownIt-TOC-wrapper
&,
&:before
background-color darken(themeMonokaiBackground, 15%)
color themeDarkText
themeDraculaBackground = $ui-dracula-noteDetail-backgroundColor
themeDraculaTableOdd = $ui-dracula-noteDetail-backgroundColor themeDraculaTableOdd = $ui-dracula-noteDetail-backgroundColor
themeDraculaTableEven = darken($ui-dracula-noteDetail-backgroundColor, 10%) themeDraculaTableEven = darken($ui-dracula-noteDetail-backgroundColor, 10%)
themeDraculaTableHead = themeDraculaTableEven themeDraculaTableHead = themeDraculaTableEven
@@ -611,7 +674,7 @@ themeDraculaTableBorder = themeDarkBorder
body[data-theme="dracula"] body[data-theme="dracula"]
color $ui-dracula-text-color color $ui-dracula-text-color
border-color themeDarkBorder border-color themeDarkBorder
background-color $ui-dracula-noteDetail-backgroundColor background-color themeDraculaBackground
table table
thead thead
tr tr
@@ -648,3 +711,9 @@ body[data-theme="dracula"]
.prev, .next .prev, .next
color $ui-dracula-button--active-color color $ui-dracula-button--active-color
background-color $ui-dracula-button-backgroundColor background-color $ui-dracula-button-backgroundColor
.markdownIt-TOC-wrapper
&,
&:before
background-color darken(themeDraculaBackground, 15%)
color themeDarkText

View File

@@ -22,18 +22,40 @@ function getId () {
function render (element, content, theme, enableHTMLLabel) { function render (element, content, theme, enableHTMLLabel) {
try { try {
const height = element.attributes.getNamedItem('data-height') const height = element.attributes.getNamedItem('data-height')
if (height && height.value !== 'undefined') { const isPredefined = height && height.value !== 'undefined'
if (isPredefined) {
element.style.height = height.value + 'vh' element.style.height = height.value + 'vh'
} }
const isDarkTheme = theme === 'dark' || theme === 'solarized-dark' || theme === 'monokai' || theme === 'dracula' const isDarkTheme = theme === 'dark' || theme === 'solarized-dark' || theme === 'monokai' || theme === 'dracula'
mermaidAPI.initialize({ mermaidAPI.initialize({
theme: isDarkTheme ? 'dark' : 'default', theme: isDarkTheme ? 'dark' : 'default',
themeCSS: isDarkTheme ? darkThemeStyling : '', themeCSS: isDarkTheme ? darkThemeStyling : '',
useMaxWidth: false, flowchart: {
flowchart: { htmlLabels: enableHTMLLabel } htmlLabels: enableHTMLLabel
},
gantt: {
useWidth: element.clientWidth
}
}) })
mermaidAPI.render(getId(), content, (svgGraph) => { mermaidAPI.render(getId(), content, (svgGraph) => {
element.innerHTML = svgGraph element.innerHTML = svgGraph
if (!isPredefined) {
const el = element.firstChild
const viewBox = el.getAttribute('viewBox').split(' ')
let ratio = viewBox[2] / viewBox[3]
if (el.style.maxWidth) {
const maxWidth = parseFloat(el.style.maxWidth)
ratio *= el.parentNode.clientWidth / maxWidth
}
el.setAttribute('ratio', ratio)
el.setAttribute('height', el.parentNode.clientWidth / ratio)
console.log(el)
}
}) })
} catch (e) { } catch (e) {
element.className = 'mermaid-error' element.className = 'mermaid-error'

View File

@@ -128,12 +128,19 @@ class Markdown {
this.md.use(require('markdown-it-abbr')) this.md.use(require('markdown-it-abbr'))
this.md.use(require('markdown-it-sub')) this.md.use(require('markdown-it-sub'))
this.md.use(require('markdown-it-sup')) this.md.use(require('markdown-it-sup'))
this.md.use(markdownItTocAndAnchor, {
toc: true, this.md.use(md => {
tocPattern: /\[TOC\]/i, markdownItTocAndAnchor(md, {
anchorLink: false, toc: true,
appendIdToHeading: false tocPattern: /\[TOC\]/i,
anchorLink: false,
appendIdToHeading: false
})
md.renderer.rules.toc_open = () => '<div class="markdownIt-TOC-wrapper">'
md.renderer.rules.toc_close = () => '</div>'
}) })
this.md.use(require('./markdown-it-deflist')) this.md.use(require('./markdown-it-deflist'))
this.md.use(require('./markdown-it-frontmatter')) this.md.use(require('./markdown-it-frontmatter'))

View File

@@ -31,6 +31,7 @@ import { confirmDeleteNote } from 'browser/lib/confirmDeleteNote'
import markdownToc from 'browser/lib/markdown-toc-generator' import markdownToc from 'browser/lib/markdown-toc-generator'
import queryString from 'query-string' import queryString from 'query-string'
import { replace } from 'connected-react-router' import { replace } from 'connected-react-router'
import ToggleDirectionButton from 'browser/main/Detail/ToggleDirectionButton'
class MarkdownNoteDetail extends React.Component { class MarkdownNoteDetail extends React.Component {
constructor (props) { constructor (props) {
@@ -46,7 +47,8 @@ class MarkdownNoteDetail extends React.Component {
isLockButtonShown: props.config.editor.type !== 'SPLIT', isLockButtonShown: props.config.editor.type !== 'SPLIT',
isLocked: false, isLocked: false,
editorType: props.config.editor.type, editorType: props.config.editor.type,
switchPreview: props.config.editor.switchPreview switchPreview: props.config.editor.switchPreview,
RTL: false
} }
this.dispatchTimer = null this.dispatchTimer = null
@@ -61,6 +63,7 @@ class MarkdownNoteDetail extends React.Component {
componentDidMount () { componentDidMount () {
ee.on('topbar:togglelockbutton', this.toggleLockButton) ee.on('topbar:togglelockbutton', this.toggleLockButton)
ee.on('topbar:toggledirectionbutton', () => this.handleSwitchDirection())
ee.on('topbar:togglemodebutton', () => { ee.on('topbar:togglemodebutton', () => {
const reversedType = this.state.editorType === 'SPLIT' ? 'EDITOR_PREVIEW' : 'SPLIT' const reversedType = this.state.editorType === 'SPLIT' ? 'EDITOR_PREVIEW' : 'SPLIT'
this.handleSwitchMode(reversedType) this.handleSwitchMode(reversedType)
@@ -99,6 +102,7 @@ class MarkdownNoteDetail extends React.Component {
componentWillUnmount () { componentWillUnmount () {
ee.off('topbar:togglelockbutton', this.toggleLockButton) ee.off('topbar:togglelockbutton', this.toggleLockButton)
ee.on('topbar:toggledirectionbutton', this.handleSwitchDirection)
ee.off('code:generate-toc', this.generateToc) ee.off('code:generate-toc', this.generateToc)
if (this.saveQueue != null) this.saveNow() if (this.saveQueue != null) this.saveNow()
} }
@@ -354,6 +358,12 @@ class MarkdownNoteDetail extends React.Component {
}) })
} }
handleSwitchDirection () {
// If in split mode, hide the lock button
const direction = this.state.RTL
this.setState({ RTL: !direction })
}
handleDeleteNote () { handleDeleteNote () {
this.handleTrashButtonClick() this.handleTrashButtonClick()
} }
@@ -393,6 +403,7 @@ class MarkdownNoteDetail extends React.Component {
onChange={this.handleUpdateContent.bind(this)} onChange={this.handleUpdateContent.bind(this)}
isLocked={this.state.isLocked} isLocked={this.state.isLocked}
ignorePreviewPointerEvents={ignorePreviewPointerEvents} ignorePreviewPointerEvents={ignorePreviewPointerEvents}
RTL={this.state.RTL}
/> />
} else { } else {
return <MarkdownSplitEditor return <MarkdownSplitEditor
@@ -404,6 +415,7 @@ class MarkdownNoteDetail extends React.Component {
linesHighlighted={note.linesHighlighted} linesHighlighted={note.linesHighlighted}
onChange={this.handleUpdateContent.bind(this)} onChange={this.handleUpdateContent.bind(this)}
ignorePreviewPointerEvents={ignorePreviewPointerEvents} ignorePreviewPointerEvents={ignorePreviewPointerEvents}
RTL={this.state.RTL}
/> />
} }
} }
@@ -472,7 +484,7 @@ class MarkdownNoteDetail extends React.Component {
</div> </div>
<div styleName='info-right'> <div styleName='info-right'>
<ToggleModeButton onClick={(e) => this.handleSwitchMode(e)} editorType={editorType} /> <ToggleModeButton onClick={(e) => this.handleSwitchMode(e)} editorType={editorType} />
<ToggleDirectionButton onClick={(e) => this.handleSwitchDirection(e)} isRTL={this.state.RTL} />
<StarButton <StarButton
onClick={(e) => this.handleStarButtonClick(e)} onClick={(e) => this.handleStarButtonClick(e)}
isActive={note.isStarred} isActive={note.isStarred}
@@ -518,6 +530,7 @@ class MarkdownNoteDetail extends React.Component {
print={this.print} print={this.print}
/> />
</div> </div>
</div> </div>
return ( return (

View File

@@ -15,7 +15,7 @@
.control-lockButton .control-lockButton
topBarButtonRight() topBarButtonRight()
position absolute position absolute
right 225px right 265px
&:hover .tooltip &:hover .tooltip
opacity 1 opacity 1

View File

@@ -0,0 +1,26 @@
import PropTypes from 'prop-types'
import React from 'react'
import CSSModules from 'browser/lib/CSSModules'
import styles from './ToggleDirectionButton.styl'
import i18n from 'browser/lib/i18n'
const ToggleDirectionButton = ({
onClick, isRTL
}) => (
<div styleName='control-toggleModeButton'>
<div styleName={isRTL ? 'active' : undefined} onClick={() => onClick()}>
<img src={!isRTL ? '../resources/icon/icon-left-to-right.svg' : ''} />
</div>
<div styleName={!isRTL ? 'active' : undefined} onClick={() => onClick()}>
<img src={!isRTL ? '' : '../resources/icon/icon-right-to-left.svg'} />
</div>
<span lang={i18n.locale} styleName='tooltip'>{i18n.__('Toggle Direction')}</span>
</div>
)
ToggleDirectionButton.propTypes = {
onClick: PropTypes.func.isRequired,
isRTL: PropTypes.string.isRequired
}
export default CSSModules(ToggleDirectionButton, styles)

View File

@@ -0,0 +1,85 @@
.control-toggleModeButton
height 25px
border-radius 50px
background-color #F4F4F4
width 52px
display flex
align-items center
position: relative
top 2px
margin-left 5px
.active
background-color #1EC38B
width 33px
height 24px
box-shadow 2px 0px 7px #eee
z-index 1
div
width 40px
height 100%
border-radius 50%
display flex
align-items center
justify-content center
cursor pointer
&:hover .tooltip
opacity 1
.tooltip
tooltip()
position absolute
pointer-events none
top 33px
left -10px
z-index 200
width 80px
padding 5px
line-height normal
border-radius 2px
opacity 0
transition 0.1s
.tooltip:lang(ja)
@extend .tooltip
left -8px
width 70px
body[data-theme="dark"]
.control-fullScreenButton
topBarButtonDark()
.control-toggleModeButton
background-color #3A404C
.active
background-color #1EC38B
box-shadow 2px 0px 7px #444444
body[data-theme="solarized-dark"]
.control-toggleModeButton
background-color #002B36
.active
background-color #1EC38B
box-shadow 2px 0px 7px #222222
body[data-theme="monokai"]
.control-toggleModeButton
background-color #373831
.active
background-color #f92672
box-shadow 2px 0px 7px #222222
body[data-theme="dracula"]
.control-toggleModeButton
background-color #44475a
.active
background-color #bd93f9
box-shadow 2px 0px 7px #222222
.control-toggleModeButton
-webkit-user-drag none
user-select none
> div img
-webkit-user-drag none
user-select none

View File

@@ -31,6 +31,7 @@ export const DEFAULT_CONFIG = {
hotkey: { hotkey: {
toggleMain: OSX ? 'Command + Alt + L' : 'Super + Alt + E', toggleMain: OSX ? 'Command + Alt + L' : 'Super + Alt + E',
toggleMode: OSX ? 'Command + Alt + M' : 'Ctrl + M', toggleMode: OSX ? 'Command + Alt + M' : 'Ctrl + M',
toggleDirection: OSX ? 'Command + Alt + Right' : 'Ctrl + Right',
deleteNote: OSX ? 'Command + Shift + Backspace' : 'Ctrl + Shift + Backspace', deleteNote: OSX ? 'Command + Shift + Backspace' : 'Ctrl + Shift + Backspace',
pasteSmartly: OSX ? 'Command + Shift + V' : 'Ctrl + Shift + V', pasteSmartly: OSX ? 'Command + Shift + V' : 'Ctrl + Shift + V',
prettifyMarkdown: OSX ? 'Command + Shift + F' : 'Ctrl + Shift + F', prettifyMarkdown: OSX ? 'Command + Shift + F' : 'Ctrl + Shift + F',
@@ -75,7 +76,7 @@ export const DEFAULT_CONFIG = {
customMarkdownLintConfig: DEFAULT_MARKDOWN_LINT_CONFIG, customMarkdownLintConfig: DEFAULT_MARKDOWN_LINT_CONFIG,
prettierConfig: ` { prettierConfig: ` {
"trailingComma": "es5", "trailingComma": "es5",
"tabWidth": 4, "tabWidth": 2,
"semi": false, "semi": false,
"singleQuote": true "singleQuote": true
}`, }`,

View File

@@ -4,6 +4,9 @@ module.exports = {
'toggleMode': () => { 'toggleMode': () => {
ee.emit('topbar:togglemodebutton') ee.emit('topbar:togglemodebutton')
}, },
'toggleDirection': () => {
ee.emit('topbar:toggledirectionbutton')
},
'deleteNote': () => { 'deleteNote': () => {
ee.emit('hotkey:deletenote') ee.emit('hotkey:deletenote')
}, },

View File

@@ -30,7 +30,8 @@ class HotkeyTab extends React.Component {
this.handleSettingError = (err) => { this.handleSettingError = (err) => {
if ( if (
this.state.config.hotkey.toggleMain === '' || this.state.config.hotkey.toggleMain === '' ||
this.state.config.hotkey.toggleMode === '' this.state.config.hotkey.toggleMode === '' ||
this.state.config.hotkey.toggleDirection === ''
) { ) {
this.setState({keymapAlert: { this.setState({keymapAlert: {
type: 'success', type: 'success',
@@ -79,6 +80,7 @@ class HotkeyTab extends React.Component {
config.hotkey = Object.assign({}, config.hotkey, { config.hotkey = Object.assign({}, config.hotkey, {
toggleMain: this.refs.toggleMain.value, toggleMain: this.refs.toggleMain.value,
toggleMode: this.refs.toggleMode.value, toggleMode: this.refs.toggleMode.value,
toggleDirection: this.refs.toggleDirection.value,
deleteNote: this.refs.deleteNote.value, deleteNote: this.refs.deleteNote.value,
pasteSmartly: this.refs.pasteSmartly.value, pasteSmartly: this.refs.pasteSmartly.value,
prettifyMarkdown: this.refs.prettifyMarkdown.value, prettifyMarkdown: this.refs.prettifyMarkdown.value,
@@ -154,6 +156,17 @@ class HotkeyTab extends React.Component {
/> />
</div> </div>
</div> </div>
<div styleName='group-section'>
<div styleName='group-section-label'>{i18n.__('Toggle Direction')}</div>
<div styleName='group-section-control'>
<input styleName='group-section-control-input'
onChange={(e) => this.handleHotkeyChange(e)}
ref='toggleDirection'
value={config.hotkey.toggleDirection}
type='text'
/>
</div>
</div>
<div styleName='group-section'> <div styleName='group-section'>
<div styleName='group-section-label'>{i18n.__('Delete Note')}</div> <div styleName='group-section-label'>{i18n.__('Delete Note')}</div>
<div styleName='group-section-control'> <div styleName='group-section-control'>

View File

@@ -142,7 +142,7 @@ class InfoTab extends React.Component {
>{i18n.__('Development')}</a>{i18n.__(' : Development configurations for Boostnote.')} >{i18n.__('Development')}</a>{i18n.__(' : Development configurations for Boostnote.')}
</li> </li>
<li styleName='cc'> <li styleName='cc'>
{i18n.__('Copyright (C) 2017 - 2019 BoostIO')} {i18n.__('Copyright (C) 2017 - 2020 BoostIO')}
</li> </li>
<li styleName='cc'> <li styleName='cc'>
{i18n.__('License: GPL v3')} {i18n.__('License: GPL v3')}

View File

@@ -1,3 +1,5 @@
> [Please consider to contribute to the new Boost Note app too!](https://github.com/BoostIO/BoostNote.next)
# Contributing to Boostnote (English) # Contributing to Boostnote (English)
### When you open an issue or a bug report ### When you open an issue or a bug report
@@ -67,12 +69,24 @@ GPL v3 라이센스는 다른 라이센스와 혼합해 사용하기엔 너무
# Contributing to Boostnote (Japanese) # Contributing to Boostnote (Japanese)
### バグレポートに関してのissueを立てる時 ### バグレポートに関してのissueを立てる時
イシューテンプレートはありませんが、1つお願いがあります。 イシューテンプレートがあります。このテンプレートに従って、できるだけ多くの情報を提供してください
**開発者ツールを開いた状態のBoostnoteのスクリーンショットを貼ってください**
よろしくお願いします。 よろしくお願いします。
### Pull requestを出す時
Pull requestのテンプレートがあります。このテンプレートを埋めてからコードをサブミットしてください。内容を正確に把握できるPull requestが作られていれば、迅速にレビューを行えます。
以下のことを必ず行ってください:
- [`code_style.md`](docs/code_style.md)を読み、コーディングスタイルを確認する
- 変更分のコードに対するテストコードを書き、以下のコマンドでテストを実行する
```
npm run test
```
- 以下のコマンドを使って、コードの静的解析を実行する
```
npm run lint
```
### Pull requestの著作権について ### Pull requestの著作権について
Pull requestをすることはその変化分のコードの著作権をBoostIOに譲渡することに同意することになります。 Pull requestをすることはその変化分のコードの著作権をBoostIOに譲渡することに同意することになります。

View File

@@ -1,6 +1,6 @@
# Build # Build
This page is also available in [Japanese](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/build.md), [Korean](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/build.md), [Russain](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/build.md), [Simplified Chinese](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/build.md), [French](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/build.md), [Portuguese](https://github.com/BoostIO/Boostnote/blob/master/docs/pt_BR/build.md) and [German](https://github.com/BoostIO/Boostnote/blob/master/docs/de/build.md). This page is also available in [Japanese](https://github.com/BoostIO/Boostnote/blob/master/docs/jp/build.md), [Korean](https://github.com/BoostIO/Boostnote/blob/master/docs/ko/build.md), [Russain](https://github.com/BoostIO/Boostnote/blob/master/docs/ru/build.md), [Traditional Chinese](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_TW/build.md), [Simplified Chinese](https://github.com/BoostIO/Boostnote/blob/master/docs/zh_CN/build.md), [French](https://github.com/BoostIO/Boostnote/blob/master/docs/fr/build.md), [Portuguese](https://github.com/BoostIO/Boostnote/blob/master/docs/pt_BR/build.md) and [German](https://github.com/BoostIO/Boostnote/blob/master/docs/de/build.md).
## Environments ## Environments

View File

@@ -86,21 +86,21 @@ const file = {
}, },
{ {
label: 'Focus Note', label: 'Focus Note',
accelerator: macOS ? 'Command+E' : 'Control+E', accelerator: 'CommandOrControl+E',
click () { click () {
mainWindow.webContents.send('detail:focus') mainWindow.webContents.send('detail:focus')
} }
}, },
{ {
label: 'Delete Note', label: 'Delete Note',
accelerator: macOS ? 'Command+Shift+Backspace' : 'Control+Shift+Backspace', accelerator: 'CommandOrControl+Shift+Backspace',
click () { click () {
mainWindow.webContents.send('detail:delete') mainWindow.webContents.send('detail:delete')
} }
}, },
{ {
label: 'Clone Note', label: 'Clone Note',
accelerator: macOS ? 'Command+D' : 'Control+D', accelerator: 'CommandOrControl+D',
click () { click () {
mainWindow.webContents.send('list:clone') mainWindow.webContents.send('list:clone')
} }
@@ -260,7 +260,7 @@ const view = {
}, },
{ {
label: 'Toggle Developer Tools', label: 'Toggle Developer Tools',
accelerator: macOS ? 'Command+Alt+I' : 'Control+Shift+I', accelerator: 'CommandOrControl+Alt+I',
click () { click () {
BrowserWindow.getFocusedWindow().toggleDevTools() BrowserWindow.getFocusedWindow().toggleDevTools()
} }
@@ -314,21 +314,21 @@ const view = {
}, },
{ {
label: 'Actual Size', label: 'Actual Size',
accelerator: macOS ? 'CommandOrControl+0' : 'Control+0', accelerator: 'CommandOrControl+0',
click () { click () {
mainWindow.webContents.send('status:zoomreset') mainWindow.webContents.send('status:zoomreset')
} }
}, },
{ {
label: 'Zoom In', label: 'Zoom In',
accelerator: macOS ? 'CommandOrControl+=' : 'Control+=', accelerator: 'CommandOrControl+=',
click () { click () {
mainWindow.webContents.send('status:zoomin') mainWindow.webContents.send('status:zoomin')
} }
}, },
{ {
label: 'Zoom Out', label: 'Zoom Out',
accelerator: macOS ? 'CommandOrControl+-' : 'Control+-', accelerator: 'CommandOrControl+-',
click () { click () {
mainWindow.webContents.send('status:zoomout') mainWindow.webContents.send('status:zoomout')
} }
@@ -384,6 +384,10 @@ const help = {
label: 'Boostnote official site', label: 'Boostnote official site',
click () { shell.openExternal('https://boostnote.io/') } click () { shell.openExternal('https://boostnote.io/') }
}, },
{
label: 'Wiki',
click () { shell.openExternal('https://github.com/BoostIO/Boostnote/wiki') }
},
{ {
label: 'Issue Tracker', label: 'Issue Tracker',
click () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') } click () { shell.openExternal('https://github.com/BoostIO/Boostnote/issues') }

View File

@@ -9,6 +9,7 @@
"Toggle Mode": "Přepnout režim", "Toggle Mode": "Přepnout režim",
"Add tag...": "Přidat štítek...", "Add tag...": "Přidat štítek...",
"Trash": "Koš", "Trash": "Koš",
"Ok": "Ok",
"MODIFICATION DATE": "DATUM ZMĚNY", "MODIFICATION DATE": "DATUM ZMĚNY",
"Words": "Slova", "Words": "Slova",
"Letters": "Písmena", "Letters": "Písmena",

View File

@@ -8,6 +8,7 @@
"to create a new note": "to create a new note", "to create a new note": "to create a new note",
"Toggle Mode": "Toggle Mode", "Toggle Mode": "Toggle Mode",
"Trash": "Trash", "Trash": "Trash",
"Ok": "Ok",
"MODIFICATION DATE": "MODIFICATION DATE", "MODIFICATION DATE": "MODIFICATION DATE",
"Words": "Words", "Words": "Words",
"Letters": "Letters", "Letters": "Letters",

View File

@@ -8,6 +8,7 @@
"to create a new note": "um eine neue Notiz zu erstellen", "to create a new note": "um eine neue Notiz zu erstellen",
"Toggle Mode": "Modus umschalten", "Toggle Mode": "Modus umschalten",
"Trash": "Papierkorb", "Trash": "Papierkorb",
"Ok": "Ok",
"MODIFICATION DATE": "ÄNDERUNGSDATUM", "MODIFICATION DATE": "ÄNDERUNGSDATUM",
"Words": "Wörter", "Words": "Wörter",
"Letters": "Buchstaben", "Letters": "Buchstaben",

View File

@@ -9,6 +9,7 @@
"Toggle Mode": "Toggle Mode", "Toggle Mode": "Toggle Mode",
"Add tag...": "Add tag...", "Add tag...": "Add tag...",
"Trash": "Trash", "Trash": "Trash",
"Ok": "Ok",
"MODIFICATION DATE": "MODIFICATION DATE", "MODIFICATION DATE": "MODIFICATION DATE",
"Words": "Words", "Words": "Words",
"Letters": "Letters", "Letters": "Letters",

View File

@@ -8,6 +8,7 @@
"to create a new note": "para crear una nueva nota", "to create a new note": "para crear una nueva nota",
"Toggle Mode": "Alternar modo", "Toggle Mode": "Alternar modo",
"Trash": "Basura", "Trash": "Basura",
"Ok": "Ok",
"MODIFICATION DATE": "FECHA DE MODIFICACIÓN", "MODIFICATION DATE": "FECHA DE MODIFICACIÓN",
"Words": "Palabras", "Words": "Palabras",
"Letters": "Letras", "Letters": "Letras",

View File

@@ -8,6 +8,7 @@
"to create a new note": "pour créer une nouvelle note", "to create a new note": "pour créer une nouvelle note",
"Toggle Mode": "Toggle Mode", "Toggle Mode": "Toggle Mode",
"Trash": "Poubelle", "Trash": "Poubelle",
"Ok": "Ok",
"MODIFICATION DATE": "DATE DE MODIFICATION", "MODIFICATION DATE": "DATE DE MODIFICATION",
"Words": "Mots", "Words": "Mots",
"Letters": "Lettres", "Letters": "Lettres",

View File

@@ -8,6 +8,7 @@
"to create a new note": "per creare una nuova nota", "to create a new note": "per creare una nuova nota",
"Toggle Mode": "Cambia Modalità", "Toggle Mode": "Cambia Modalità",
"Trash": "Cestino", "Trash": "Cestino",
"Ok": "Ok",
"MODIFICATION DATE": "DATA DI MODIFICA", "MODIFICATION DATE": "DATA DI MODIFICA",
"Words": "Parole", "Words": "Parole",
"Letters": "Lettere", "Letters": "Lettere",

View File

@@ -8,6 +8,7 @@
"to create a new note": "para criar uma nova nota", "to create a new note": "para criar uma nova nota",
"Toggle Mode": "Modo de alternância", "Toggle Mode": "Modo de alternância",
"Trash": "Lixeira", "Trash": "Lixeira",
"Ok": "Ok",
"MODIFICATION DATE": "DATA DE MODIFICAÇÃO", "MODIFICATION DATE": "DATA DE MODIFICAÇÃO",
"Words": "Palavras", "Words": "Palavras",
"Letters": "Letras", "Letters": "Letras",

View File

@@ -8,6 +8,7 @@
"to create a new note": "para criar uma nova nota", "to create a new note": "para criar uma nova nota",
"Toggle Mode": "Alternar Modo", "Toggle Mode": "Alternar Modo",
"Trash": "Lixo", "Trash": "Lixo",
"Ok": "Ok",
"MODIFICATION DATE": "DATA DE MODIFICAÇÃO", "MODIFICATION DATE": "DATA DE MODIFICAÇÃO",
"Words": "Palavras", "Words": "Palavras",
"Letters": "Letras", "Letters": "Letras",

View File

@@ -8,6 +8,7 @@
"to create a new note": "to create a new note", "to create a new note": "to create a new note",
"Toggle Mode": "Toggle Mode", "Toggle Mode": "Toggle Mode",
"Trash": "Trash", "Trash": "Trash",
"Ok": "Ok",
"MODIFICATION DATE": "MODIFICATION DATE", "MODIFICATION DATE": "MODIFICATION DATE",
"Words": "Words", "Words": "Words",
"Letters": "Letters", "Letters": "Letters",

View File

@@ -9,7 +9,7 @@
"Toggle Mode": "切换模式", "Toggle Mode": "切换模式",
"Trash": "废纸篓", "Trash": "废纸篓",
"MODIFICATION DATE": "更改时间", "MODIFICATION DATE": "更改时间",
"Words": "单词", "Words": "单词",
"Letters": "字数", "Letters": "字数",
"STORAGE": "本地存储", "STORAGE": "本地存储",
"FOLDER": "文件夹", "FOLDER": "文件夹",
@@ -40,13 +40,13 @@
"Editor Font Size": "编辑器字号", "Editor Font Size": "编辑器字号",
"Editor Font Family": "编辑器字体", "Editor Font Family": "编辑器字体",
"Editor Indent Style": "编辑器缩进风格", "Editor Indent Style": "编辑器缩进风格",
"Spaces": "空格", "Spaces": "Spaces",
"Tabs": "Tabs", "Tabs": "Tabs",
"Switch to Preview": "快速切换到预览界面", "Switch to Preview": "快速切换到预览界面",
"When Editor Blurred": "当编辑器失去焦点的时候,切换到预览界面", "When Editor Blurred": "当编辑器失去焦点的时候",
"When Editor Blurred, Edit On Double Click": "当编辑器失去焦点的时候预览,双击切换到编辑界面", "When Editor Blurred, Edit On Double Click": "当编辑器失去焦点的时候预览,双击切换到编辑界面",
"On Right Click": "右键点击切换两个界面", "On Right Click": "右键点击",
"Editor Keymap": "编辑器 Keymap", "Editor Keymap": "编辑器键位设置",
"default": "默认", "default": "默认",
"vim": "vim", "vim": "vim",
"emacs": "emacs", "emacs": "emacs",
@@ -82,7 +82,7 @@
"Analytics": "分析", "Analytics": "分析",
"Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote 收集匿名数据只为了提升软件使用体验,绝对不收集任何个人信息(包括笔记内容)", "Boostnote collects anonymous data for the sole purpose of improving the application, and strictly does not collect any personal information such the contents of your notes.": "Boostnote 收集匿名数据只为了提升软件使用体验,绝对不收集任何个人信息(包括笔记内容)",
"You can see how it works on ": "你可以看看它的源码是如何运作的 ", "You can see how it works on ": "你可以看看它的源码是如何运作的 ",
"You can choose to enable or disable this option.": "你可以选择开启或不开启这个功能", "You can choose to enable or disable this option.": "你可以选择开启或禁用这个功能",
"Enable analytics to help improve Boostnote": "允许对数据进行分析,帮助我们改进 Boostnote", "Enable analytics to help improve Boostnote": "允许对数据进行分析,帮助我们改进 Boostnote",
"Crowdfunding": "众筹", "Crowdfunding": "众筹",
"Dear Boostnote users,": "亲爱的用户:", "Dear Boostnote users,": "亲爱的用户:",
@@ -132,7 +132,7 @@
"Restore": "恢复", "Restore": "恢复",
"Permanent Delete": "永久删除", "Permanent Delete": "永久删除",
"Confirm note deletion": "确认删除笔记", "Confirm note deletion": "确认删除笔记",
"This will permanently remove this note.": "永久地删除这条笔记", "This will permanently remove this note.": "永久地删除这条笔记",
"Successfully applied!": "设置成功", "Successfully applied!": "设置成功",
"Albanian": "Albanian", "Albanian": "Albanian",
"Chinese (zh-CN)": "简体中文", "Chinese (zh-CN)": "简体中文",
@@ -208,7 +208,7 @@
"Folder Name": "文件夹名称", "Folder Name": "文件夹名称",
"No tags": "无标签", "No tags": "无标签",
"Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "将文本箭头转换为完整符号。 ⚠ 注意这会影响 Markdown 的 HTML 注释。", "Convert textual arrows to beautiful signs. ⚠ This will interfere with using HTML comments in your Markdown.": "将文本箭头转换为完整符号。 ⚠ 注意这会影响 Markdown 的 HTML 注释。",
"⚠ 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! ⚠": "⚠ 您粘贴了一个链接,但在此文档的存储位置中找不到对应的附件。仅当附件和文档在同一存储位置时,才支持粘贴引用附件的链接。请将附件拖放到文档内!⚠",
"Default New Note": "预设新笔记类型", "Default New Note": "预设新笔记类型",
"Show only related tags": "只显示相关标签", "Show only related tags": "只显示相关标签",
"Snippet Default Language": "程式码片段预设语言", "Snippet Default Language": "程式码片段预设语言",
@@ -219,9 +219,9 @@
"Custom CSS": "自定义 CSS", "Custom CSS": "自定义 CSS",
"Allow custom CSS for preview": "允许预览自定义 CSS", "Allow custom CSS for preview": "允许预览自定义 CSS",
"Render newlines in Markdown paragraphs as <br>": "在 Markdown 段落中使用 <br> 换行", "Render newlines in Markdown paragraphs as <br>": "在 Markdown 段落中使用 <br> 换行",
"Spellcheck disabled": "Spellcheck disabled", "Spellcheck disabled": "拼写检查已禁用",
"Show menu bar": "显示菜单栏", "Show menu bar": "显示菜单栏",
"Auto Detect": "Auto Detect", "Auto Detect": "自动检测",
"Filter tags/folders...": "filter tags/folders...", "Filter tags/folders...": "filter tags/folders...",
"Enable HTML label in mermaid flowcharts": "在 mermaid flowcharts 中启用 HTML 标签 ⚠ 这个选项可能会产生 XSS", "Enable HTML label in mermaid flowcharts": "在 mermaid flowcharts 中启用 HTML 标签 ⚠ 这个选项可能会产生 XSS",
"Wrap line in Snippet Note": "在 Snippet Note 里换行", "Wrap line in Snippet Note": "在 Snippet Note 里换行",
@@ -232,7 +232,7 @@
"Show/Hide Menu Bar": "显示/隐藏 菜单栏", "Show/Hide Menu Bar": "显示/隐藏 菜单栏",
"Save tags of a note in alphabetical order": "按字母顺序存储标签", "Save tags of a note in alphabetical order": "按字母顺序存储标签",
"Show tags of a note in alphabetical order": "按字母顺序显示标签", "Show tags of a note in alphabetical order": "按字母顺序显示标签",
"Enable live count of notes": "实时统计标签下笔记数", "Enable live count of notes": "实时统计标签下笔记数",
"New notes are tagged with the filtering tags": "新建的笔记带有在标签列表过滤的标签", "New notes are tagged with the filtering tags": "新建的笔记带有在标签列表过滤的标签",
"Front matter title field": "从 front-matter 中抽取标题的字段名", "Front matter title field": "从 front-matter 中抽取标题的字段名",
"Extract title from front matter": "启用从 front-matter 抽取标题", "Extract title from front matter": "启用从 front-matter 抽取标题",

View File

@@ -1,7 +1,7 @@
{ {
"name": "boost", "name": "boost",
"productName": "Boostnote", "productName": "Boostnote",
"version": "0.13.0", "version": "0.14.0",
"main": "index.js", "main": "index.js",
"description": "Boostnote", "description": "Boostnote",
"license": "GPL-3.0", "license": "GPL-3.0",
@@ -111,6 +111,7 @@
"react-composition-input": "^1.1.1", "react-composition-input": "^1.1.1",
"react-debounce-render": "^4.0.1", "react-debounce-render": "^4.0.1",
"react-dom": "^16.8.6", "react-dom": "^16.8.6",
"react-emoji-render": "^1.1.0",
"react-image-carousel": "^2.0.18", "react-image-carousel": "^2.0.18",
"react-redux": "^7.0.3", "react-redux": "^7.0.3",
"react-router-dom": "^5.0.0", "react-router-dom": "^5.0.0",

View File

@@ -1,6 +1,6 @@
{ {
"trailingComma": "es5", "trailingComma": "es5",
"tabWidth": 4, "tabWidth": 2,
"semi": false, "semi": false,
"singleQuote": true "singleQuote": true
} }

View File

@@ -1,4 +1,4 @@
> We will launch the new Boost Note in January 2020. Please support us via [Kickstarter](https://www.kickstarter.com/projects/kazz-boostio/new-boost-note)! > [We've launched desktop app of the new Boost Note now. We'll release its mobile app too in January 2020.](https://github.com/BoostIO/BoostNote.next)
![Boostnote app screenshot](./resources/repository/top.png) ![Boostnote app screenshot](./resources/repository/top.png)
@@ -11,10 +11,14 @@
</a> </a>
</p> </p>
## Download
[Find the latest release of Boostnote here!](https://github.com/BoostIO/boost-releases/releases/)
## Authors & Maintainers ## Authors & Maintainers
- [Rokt33r](https://github.com/rokt33r) - [Rokt33r](https://github.com/rokt33r)
- [Kazz](https://github.com/kazup01) - [KZ](https://github.com/kazup01)
- [ZeroX-DG](https://github.com/ZeroX-DG) - [ZeroX-DG](https://github.com/ZeroX-DG)
## Contributors ## Contributors
@@ -39,9 +43,8 @@ Issues on Boostnote can be funded by anyone and the money will be distributed to
#### More Information #### More Information
* Website: https://boostnote.io * Website: https://boostnote.io
* Newsletters: https://boostnote.io/#subscribe
* [Development](https://github.com/BoostIO/Boostnote/blob/master/docs/build.md): Development configurations for Boostnote. * [Development](https://github.com/BoostIO/Boostnote/blob/master/docs/build.md): Development configurations for Boostnote.
* Copyright (C) 2016 - 2019 BoostIO, Inc. * Copyright (C) 2016 - 2020 BoostIO, Inc.
#### License #### License

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!-- Generator: Gravit.io --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 19 19" width="19" height="19"><defs><clipPath id="_clipPath_D2hneLn2MshV3kxCCg6onfZAUvTCrRVv"><rect width="19" height="19"/></clipPath></defs><g clip-path="url(#_clipPath_D2hneLn2MshV3kxCCg6onfZAUvTCrRVv)"><path d=" M 6.25 7.875 L 6.25 11.938 L 7.875 11.938 L 7.875 3 L 9.5 3 L 9.5 11.938 L 11.125 11.938 L 11.125 3 L 12.75 3 L 12.75 1.375 L 6.25 1.375 C 4.454 1.375 3 2.829 3 4.625 C 3 6.421 4.454 7.875 6.25 7.875 Z M 16 14.375 L 12.75 11.125 L 12.75 13.563 L 3 13.563 L 3 15.188 L 12.75 15.188 L 12.75 17.625 L 16 14.375 Z " fill="none" vector-effect="non-scaling-stroke" stroke-width="1" stroke="rgb(30,195,139)" stroke-linejoin="miter" stroke-linecap="butt" stroke-miterlimit="4"/><path d=" M 0 0 L 24 0 L 24 24 L 0 24 L 0 0 Z " fill="none"/></g></svg>

After

Width:  |  Height:  |  Size: 946 B

View File

@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!-- Generator: Gravit.io --><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="0 0 19 19" width="19" height="19"><defs><clipPath id="_clipPath_4oBhjMfh8u0orAMDE1wkYXMRAyiloKfW"><rect width="19" height="19"/></clipPath></defs><g clip-path="url(#_clipPath_4oBhjMfh8u0orAMDE1wkYXMRAyiloKfW)"><path d=" M 7.875 7.875 L 7.875 11.938 L 9.5 11.938 L 9.5 3 L 11.125 3 L 11.125 11.938 L 12.75 11.938 L 12.75 3 L 14.375 3 L 14.375 1.375 L 7.875 1.375 C 6.079 1.375 4.625 2.829 4.625 4.625 C 4.625 6.421 6.079 7.875 7.875 7.875 Z M 6.25 13.563 L 6.25 11.125 L 3 14.375 L 6.25 17.625 L 6.25 15.188 L 16 15.188 L 16 13.563 L 6.25 13.563 Z " fill="none" vector-effect="non-scaling-stroke" stroke-width="1" stroke="rgb(30,195,139)" stroke-linejoin="miter" stroke-linecap="butt" stroke-miterlimit="4"/><path d=" M 0 -0.062 L 24 -0.062 L 24 23.938 L 0 23.938 L 0 -0.062 Z " fill="none"/></g></svg>

After

Width:  |  Height:  |  Size: 986 B

View File

@@ -87,7 +87,7 @@ Generated by [AVA](https://ava.li).
> Snapshot 1 > Snapshot 1
`<p data-line="1"><ul class="markdownIt-TOC">␊ `<p data-line="1"><div class="markdownIt-TOC-wrapper"><ul class="markdownIt-TOC">␊
<li><a href="#H1">H1</a>␊ <li><a href="#H1">H1</a>␊
<ul>␊ <ul>␊
<li><a href="#H2">H2</a>␊ <li><a href="#H2">H2</a>␊
@@ -98,7 +98,7 @@ Generated by [AVA](https://ava.li).
</ul>␊ </ul>␊
</li>␊ </li>␊
</ul>␊ </ul>␊
</p>␊ </div></p>␊
<h1 id="H1" data-line="2">H1</h1>␊ <h1 id="H1" data-line="2">H1</h1>␊
<h2 id="H2" data-line="3">H2</h2>␊ <h2 id="H2" data-line="3">H2</h2>␊
<h3 id="H3" data-line="4">H3</h3>␊ <h3 id="H3" data-line="4">H3</h3>␊
@@ -226,39 +226,4 @@ Generated by [AVA](https://ava.li).
> Snapshot 2 > Snapshot 2
`<p data-line="0">This is a &quot;QUOTE&quot;.</p>␊ `<p data-line="0">This is a &quot;QUOTE&quot;.</p>␊
## Markdown.render() should render PlantUML Ditaa correctly
> Snapshot 1
`<img src="http://www.plantuml.com/plantuml/png/SoWkIImgISaiIKpaqjQ50cq51GLj93Q2mrMZ00NQO3cmHX3RJW4cKmDI4v9QKQ805a8nfyObCp6zA34NgCObFxiqDpMl1AIcHj4tCJqpLH5i18evG52TKbk3B8og1kmC0cvMKB1Im0NYkA2ckMRcANWabgQbvYau5YMbPfP0p4UOWmcqkHnIyrB0GG00" alt="uml diagram" />␊
`
## Markdown.render() should render PlantUML Gantt correctly
> Snapshot 1
`<img src="http://www.plantuml.com/plantuml/svg/SoWkIImgIK_CAodXYWueoY_9BwaiI5L8IItEJC-BLSX9B2ufLZ0qLKX9h2pcYWv9BIvHA82fWaiRu906crsia5YYW6cqUh52QbuAbmEG0DiE0000" alt="uml diagram" />␊
`
## Markdown.render() should render PlantUML MindMaps correctly
> Snapshot 1
`<img src="http://www.plantuml.com/plantuml/svg/JOzD3e8m44Rtd6BMtNW192IM5I29HEDsAbKdeLD2MvNRIsjCMCsRlFd9LpgFipV4Wy4f4o2r8kHC23Yhm3wi9A0X3XzeYNrgwx1H6wvb1KTjqtRJoYhMtexBSAqJUescwoEUq4tn3xp9Fm7XfUS5HiiFO3Gw7SjT4QUCkkKxLy2-WAvl3rkrtEclBdOCXcnMwZN7ByiN" alt="uml diagram" />␊
`
## Markdown.render() should render PlantUML Umls correctly
> Snapshot 1
`<img src="http://www.plantuml.com/plantuml/svg/LOzD2eCm44RtESMtj0jx01V5E_G4Gvngo2_912gbTsz4LBfylCV7p5Y4ibJlbEENG2AocHV1P39hCJ6eOar8bCaZaROqyrDMnzWqXTcn8YqnGzSYqNC-q76sweoW5zOsLi57uMpHz-WESslY0jmVw1AjdaE30IPeLoVUceLTslrL3-2tS9ZA_qZRtm_vgh7PzkOF" alt="uml diagram" />␊
`
## Markdown.render() should render PlantUML WBS correctly
> Snapshot 1
`<img src="http://www.plantuml.com/plantuml/svg/ZP2_JiD03CRtFeNdRF04fR140gdGeREv-z8plVYYimFYxSabKbaxsR9-ylTdRyxLVpvjrz5XDb6OqR6MqEPRYSXPz4BdmsdNTVJAiuP4da1JBLy8lbmxUYxZbE6Wa_CLgUI8IXymS0rf9NeL5yxKDt24EhiKfMDcRNzVO79HcX8RLdvLfZBGa_KtFx2RKcpK7TZ3dTpZfWgskMAZ9jIXr94rW4PubM1RbBZOb-6NtcS9LpgBjlj_1w9QldbPjZHxQ5pg_GC0" alt="uml diagram" />␊
` `

View File

@@ -2661,7 +2661,7 @@ d@1:
dependencies: dependencies:
es5-ext "^0.10.9" es5-ext "^0.10.9"
"dagre-d3@github:dagrejs/dagre-d3": dagre-d3@dagrejs/dagre-d3:
version "0.6.4-pre" version "0.6.4-pre"
resolved "https://codeload.github.com/dagrejs/dagre-d3/tar.gz/e1a00e5cb518f5d2304a35647e024f31d178e55b" resolved "https://codeload.github.com/dagrejs/dagre-d3/tar.gz/e1a00e5cb518f5d2304a35647e024f31d178e55b"
dependencies: dependencies:
@@ -3142,6 +3142,11 @@ electron@4:
electron-download "^4.1.0" electron-download "^4.1.0"
extract-zip "^1.0.3" extract-zip "^1.0.3"
emoji-regex@^6.4.1:
version "6.5.1"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2"
integrity sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ==
emojis-list@^2.0.0: emojis-list@^2.0.0:
version "2.1.0" version "2.1.0"
resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389"
@@ -6045,7 +6050,7 @@ lodash.escaperegexp@^4.1.2:
version "4.1.2" version "4.1.2"
resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347" resolved "https://registry.yarnpkg.com/lodash.escaperegexp/-/lodash.escaperegexp-4.1.2.tgz#64762c48618082518ac3df4ccf5d5886dae20347"
lodash.flatten@^4.2.0: lodash.flatten@^4.2.0, lodash.flatten@^4.4.0:
version "4.4.0" version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
@@ -7937,6 +7942,17 @@ react-dom@^16.8.6:
prop-types "^15.6.2" prop-types "^15.6.2"
scheduler "^0.13.6" scheduler "^0.13.6"
react-emoji-render@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/react-emoji-render/-/react-emoji-render-1.1.0.tgz#af494619bf1012083bc20ad18eb0a6d92d04228c"
integrity sha512-HIHIrtWd8Jel4qDgIBRQnPPFChJakuRkMFl5N5wObYjYsL7a4pkwK5P9wrEKxQWqlbviTrjGOANAfFldnVuRIQ==
dependencies:
classnames "^2.2.5"
emoji-regex "^6.4.1"
lodash.flatten "^4.4.0"
prop-types "^15.5.8"
string-replace-to-array "^1.0.1"
react-image-carousel@^2.0.18: react-image-carousel@^2.0.18:
version "2.0.18" version "2.0.18"
resolved "https://registry.yarnpkg.com/react-image-carousel/-/react-image-carousel-2.0.18.tgz#5868ea09bd9cca09c4467d3d02695cd4e7792f28" resolved "https://registry.yarnpkg.com/react-image-carousel/-/react-image-carousel-2.0.18.tgz#5868ea09bd9cca09c4467d3d02695cd4e7792f28"
@@ -9137,6 +9153,15 @@ string-length@^2.0.0:
astral-regex "^1.0.0" astral-regex "^1.0.0"
strip-ansi "^4.0.0" strip-ansi "^4.0.0"
string-replace-to-array@^1.0.1:
version "1.0.3"
resolved "https://registry.yarnpkg.com/string-replace-to-array/-/string-replace-to-array-1.0.3.tgz#c93eba999a5ee24d731aebbaf5aba36b5f18f7bf"
integrity sha1-yT66mZpe4k1zGuu69auja18Y978=
dependencies:
invariant "^2.2.1"
lodash.flatten "^4.2.0"
lodash.isstring "^4.0.1"
string-width@^1.0.1, string-width@^1.0.2: string-width@^1.0.1, string-width@^1.0.2:
version "1.0.2" version "1.0.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"