mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-21 09:38:01 +02:00
Tools: Enable eslint rule comma-dangle: always-multiline for functions
This commit is contained in:
parent
5a8032050d
commit
77df474b46
@ -119,7 +119,7 @@ module.exports = {
|
||||
'objects': 'always-multiline',
|
||||
'imports': 'always-multiline',
|
||||
'exports': 'always-multiline',
|
||||
'functions': 'never',
|
||||
'functions': 'always-multiline',
|
||||
}],
|
||||
'comma-spacing': ['error', { 'before': false, 'after': true }],
|
||||
'no-trailing-spaces': 'error',
|
||||
@ -209,7 +209,7 @@ module.exports = {
|
||||
'enums': 'always-multiline',
|
||||
'generics': 'always-multiline',
|
||||
'tuples': 'always-multiline',
|
||||
'functions': 'never',
|
||||
'functions': 'always-multiline',
|
||||
}],
|
||||
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
|
||||
'@typescript-eslint/semi': ['error', 'always'],
|
||||
|
@ -50,7 +50,7 @@ class LinkSelector {
|
||||
link: matches[n][0],
|
||||
noteX: matches[n].index,
|
||||
noteY: i,
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -482,7 +482,7 @@ class AppGui {
|
||||
if (this.linkSelector_.link) {
|
||||
this.term_.moveTo(
|
||||
this.linkSelector_.noteX + cursorOffsetX,
|
||||
this.linkSelector_.noteY + cursorOffsetY
|
||||
this.linkSelector_.noteY + cursorOffsetY,
|
||||
);
|
||||
shim.setTimeout(() => this.term_.term().inverse(this.linkSelector_.link), 50);
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ class Command extends BaseCommand {
|
||||
reg.db(),
|
||||
sync.lockHandler(),
|
||||
appTypeToLockType(Setting.value('appType')),
|
||||
Setting.value('clientId')
|
||||
Setting.value('clientId'),
|
||||
);
|
||||
|
||||
migrationHandler.setLogger(cliUtils.stdoutLogger(this.stdout.bind(this)));
|
||||
|
@ -39,7 +39,7 @@ async function createClients() {
|
||||
// eslint-disable-next-line promise/prefer-await-to-then -- Old code before rule was applied
|
||||
execCommand(client, 'config sync.target 2').then(() => {
|
||||
return execCommand(client, `config sync.2.path ${syncDir}`);
|
||||
})
|
||||
}),
|
||||
);
|
||||
output.push(client);
|
||||
}
|
||||
|
@ -248,7 +248,7 @@ describe('MdToHtml', () => {
|
||||
const result = await mdToHtml.render(input, null, { bodyOnly: true, mapsToLine: true });
|
||||
expect(result.html.trim()).toBe('<h1 id="head" class="maps-to-line" source-line="0" source-line-end="1">Head</h1>\n' +
|
||||
'<p class="maps-to-line" source-line="1" source-line-end="2">Fruits</p>\n' +
|
||||
'<ul>\n<li class="maps-to-line" source-line="2" source-line-end="3">Apple</li>\n</ul>'
|
||||
'<ul>\n<li class="maps-to-line" source-line="2" source-line-end="3">Apple</li>\n</ul>',
|
||||
);
|
||||
}
|
||||
}));
|
||||
|
@ -24,7 +24,7 @@ function newPluginService(appVersion = '1.4') {
|
||||
{
|
||||
dispatch: () => {},
|
||||
getState: () => {},
|
||||
}
|
||||
},
|
||||
);
|
||||
return service;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ function newPluginService(appVersion = '1.4') {
|
||||
{
|
||||
dispatch: () => {},
|
||||
getState: () => {},
|
||||
}
|
||||
},
|
||||
);
|
||||
return service;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ export function newPluginService(appVersion = '1.4', options: PluginServiceOptio
|
||||
{
|
||||
dispatch: () => {},
|
||||
getState: options.getState ? options.getState : () => {},
|
||||
}
|
||||
},
|
||||
);
|
||||
return service;
|
||||
}
|
||||
|
@ -10,7 +10,7 @@ delete require.cache[require.resolve('./paths')];
|
||||
const NODE_ENV = process.env.NODE_ENV;
|
||||
if (!NODE_ENV) {
|
||||
throw new Error(
|
||||
'The NODE_ENV environment variable is required but was not specified.'
|
||||
'The NODE_ENV environment variable is required but was not specified.',
|
||||
);
|
||||
}
|
||||
|
||||
@ -36,7 +36,7 @@ dotenvFiles.forEach(dotenvFile => {
|
||||
require('dotenv-expand')(
|
||||
require('dotenv').config({
|
||||
path: dotenvFile,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
});
|
||||
@ -78,7 +78,7 @@ function getClientEnvironment(publicUrl) {
|
||||
// This should only be used as an escape hatch. Normally you would put
|
||||
// images into the `src` and `import` them in code to get their paths.
|
||||
PUBLIC_URL: publicUrl,
|
||||
}
|
||||
},
|
||||
);
|
||||
// Stringify all values so we can feed into Webpack DefinePlugin
|
||||
const stringified = {
|
||||
|
@ -55,8 +55,8 @@ function getAdditionalModulePaths(options = {}) {
|
||||
throw new Error(
|
||||
chalk.red.bold(
|
||||
'Your project\'s `baseUrl` can only be set to `src` or `node_modules`.' +
|
||||
' Create React App does not support other values at this time.'
|
||||
)
|
||||
' Create React App does not support other values at this time.',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ function getModules() {
|
||||
|
||||
if (hasTsConfig && hasJsConfig) {
|
||||
throw new Error(
|
||||
'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.'
|
||||
'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.',
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ const moduleFileExtensions = [
|
||||
// Resolve file paths in the same order as webpack
|
||||
const resolveModule = (resolveFn, filePath) => {
|
||||
const extension = moduleFileExtensions.find(extension =>
|
||||
fs.existsSync(resolveFn(`${filePath}.${extension}`))
|
||||
fs.existsSync(resolveFn(`${filePath}.${extension}`)),
|
||||
);
|
||||
|
||||
if (extension) {
|
||||
|
@ -7,14 +7,14 @@ exports.resolveModuleName = (
|
||||
moduleName,
|
||||
containingFile,
|
||||
compilerOptions,
|
||||
resolutionHost
|
||||
resolutionHost,
|
||||
) => {
|
||||
return resolveModuleName(
|
||||
moduleName,
|
||||
containingFile,
|
||||
compilerOptions,
|
||||
resolutionHost,
|
||||
typescript.resolveModuleName
|
||||
typescript.resolveModuleName,
|
||||
);
|
||||
};
|
||||
|
||||
@ -23,13 +23,13 @@ exports.resolveTypeReferenceDirective = (
|
||||
moduleName,
|
||||
containingFile,
|
||||
compilerOptions,
|
||||
resolutionHost
|
||||
resolutionHost,
|
||||
) => {
|
||||
return resolveModuleName(
|
||||
moduleName,
|
||||
containingFile,
|
||||
compilerOptions,
|
||||
resolutionHost,
|
||||
typescript.resolveTypeReferenceDirective
|
||||
typescript.resolveTypeReferenceDirective,
|
||||
);
|
||||
};
|
||||
|
@ -46,15 +46,15 @@ if (process.env.HOST) {
|
||||
console.log(
|
||||
chalk.cyan(
|
||||
`Attempting to bind to HOST environment variable: ${chalk.yellow(
|
||||
chalk.bold(process.env.HOST)
|
||||
)}`
|
||||
)
|
||||
chalk.bold(process.env.HOST),
|
||||
)}`,
|
||||
),
|
||||
);
|
||||
console.log(
|
||||
'If this was unintentional, check that you haven\'t mistakenly set it in your shell.'
|
||||
'If this was unintentional, check that you haven\'t mistakenly set it in your shell.',
|
||||
);
|
||||
console.log(
|
||||
`Learn more here: ${chalk.yellow('https://bit.ly/CRA-advanced-config')}`
|
||||
`Learn more here: ${chalk.yellow('https://bit.ly/CRA-advanced-config')}`,
|
||||
);
|
||||
console.log();
|
||||
}
|
||||
@ -102,7 +102,7 @@ checkBrowsers(paths.appPath, isInteractive)
|
||||
// Serve webpack assets generated by the compiler over a web server.
|
||||
const serverConfig = createDevServerConfig(
|
||||
proxyConfig,
|
||||
urls.lanUrlForConfig
|
||||
urls.lanUrlForConfig,
|
||||
);
|
||||
const devServer = new WebpackDevServer(compiler, serverConfig);
|
||||
// Launch WebpackDevServer.
|
||||
@ -120,8 +120,8 @@ checkBrowsers(paths.appPath, isInteractive)
|
||||
if (process.env.NODE_PATH) {
|
||||
console.log(
|
||||
chalk.yellow(
|
||||
'Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.'
|
||||
)
|
||||
'Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.',
|
||||
),
|
||||
);
|
||||
console.log();
|
||||
}
|
||||
|
@ -74,7 +74,7 @@ const pluginClasses = [
|
||||
|
||||
const appDefaultState = createAppDefaultState(
|
||||
bridge().windowContentSize(),
|
||||
resourceEditWatcherDefaultState
|
||||
resourceEditWatcherDefaultState,
|
||||
);
|
||||
|
||||
class Application extends BaseApplication {
|
||||
|
@ -71,36 +71,36 @@ class ClipperConfigScreenComponent extends React.Component {
|
||||
webClipperStatusComps.push(
|
||||
<p key="text_1" style={theme.textStyle}>
|
||||
<b>{_('The web clipper service is enabled and set to auto-start.')}</b>
|
||||
</p>
|
||||
</p>,
|
||||
);
|
||||
if (this.props.clipperServer.startState === 'started') {
|
||||
webClipperStatusComps.push(
|
||||
<p key="text_2" style={theme.textStyle}>
|
||||
{_('Status: Started on port %d', this.props.clipperServer.port)}
|
||||
</p>
|
||||
</p>,
|
||||
);
|
||||
} else {
|
||||
webClipperStatusComps.push(
|
||||
<p key="text_3" style={theme.textStyle}>
|
||||
{_('Status: %s', this.props.clipperServer.startState)}
|
||||
</p>
|
||||
</p>,
|
||||
);
|
||||
}
|
||||
webClipperStatusComps.push(
|
||||
<button key="disable_button" style={buttonStyle} onClick={this.disableClipperServer_click}>
|
||||
{_('Disable Web Clipper Service')}
|
||||
</button>
|
||||
</button>,
|
||||
);
|
||||
} else {
|
||||
webClipperStatusComps.push(
|
||||
<p key="text_4" style={theme.textStyle}>
|
||||
{_('The web clipper service is not enabled.')}
|
||||
</p>
|
||||
</p>,
|
||||
);
|
||||
webClipperStatusComps.push(
|
||||
<button key="enable_button" style={buttonStyle} onClick={this.enableClipperServer_click}>
|
||||
{_('Enable Web Clipper Service')}
|
||||
</button>
|
||||
</button>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -197,7 +197,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
theme={theme}
|
||||
text={_('Help')}
|
||||
/>
|
||||
</p>
|
||||
</p>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -219,7 +219,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
onClick={this.checkSyncConfig_}
|
||||
/>
|
||||
{statusComp}
|
||||
</div>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -381,7 +381,7 @@ class ConfigScreenComponent extends React.Component<any, any> {
|
||||
items.push(
|
||||
<option value={e.key.toString()} key={e.key}>
|
||||
{settingOptions[e.key]}
|
||||
</option>
|
||||
</option>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -29,7 +29,7 @@ const callHook = (isUpdate: boolean, pluginEnabled = true, pluginInstalledViaGUI
|
||||
},
|
||||
repoApi,
|
||||
onPluginSettingsChange,
|
||||
isUpdate
|
||||
isUpdate,
|
||||
);
|
||||
|
||||
describe('useOnInstallHandler', () => {
|
||||
@ -37,7 +37,7 @@ describe('useOnInstallHandler', () => {
|
||||
beforeAll(() => {
|
||||
(PluginService.instance as jest.Mock).mockReturnValue(pluginServiceInstance);
|
||||
(defaultPluginSetting as jest.Mock).mockImplementation(
|
||||
jest.requireActual('@joplin/lib/services/plugins/PluginService').defaultPluginSetting
|
||||
jest.requireActual('@joplin/lib/services/plugins/PluginService').defaultPluginSetting,
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -59,7 +59,7 @@ export default function DialogButtonRow(props: Props) {
|
||||
buttonComps.push(
|
||||
<button key={b.name} style={buttonStyle} onClick={() => onCustomButtonClick({ buttonName: b.name })} onKeyDown={onKeyDown}>
|
||||
{b.label}
|
||||
</button>
|
||||
</button>,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -68,7 +68,7 @@ export default function DialogButtonRow(props: Props) {
|
||||
buttonComps.push(
|
||||
<button disabled={props.okButtonDisabled} key="ok" style={buttonStyle} onClick={onOkButtonClick} ref={props.okButtonRef} onKeyDown={onKeyDown}>
|
||||
{props.okButtonLabel ? props.okButtonLabel : _('OK')}
|
||||
</button>
|
||||
</button>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ export default function DialogButtonRow(props: Props) {
|
||||
buttonComps.push(
|
||||
<button disabled={props.cancelButtonDisabled} key="cancel" style={{ ...buttonStyle }} onClick={onCancelButtonClick}>
|
||||
{props.cancelButtonLabel ? props.cancelButtonLabel : _('Cancel')}
|
||||
</button>
|
||||
</button>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ const EncryptionConfigScreen = (props: Props) => {
|
||||
<tr key={mk.id}>
|
||||
<td style={theme.textStyle}>{mk.id}</td>
|
||||
<td><button onClick={() => onUpgradeMasterKey(mk)} style={theme.buttonStyle}>Upgrade</button></td>
|
||||
</tr>
|
||||
</tr>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -309,7 +309,7 @@ const EncryptionConfigScreen = (props: Props) => {
|
||||
rows.push(
|
||||
<tr key={id}>
|
||||
<td style={theme.textStyle}>{id}</td>
|
||||
</tr>
|
||||
</tr>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -89,14 +89,14 @@ export default class ErrorBoundary extends React.Component<Props, State> {
|
||||
<section key="message">
|
||||
<h2>Message</h2>
|
||||
<p>{this.state.error.message}</p>
|
||||
</section>
|
||||
</section>,
|
||||
);
|
||||
|
||||
output.push(
|
||||
<section key="versionInfo">
|
||||
<h2>Version info</h2>
|
||||
<pre>{versionInfo(packageInfo, this.state.plugins).message}</pre>
|
||||
</section>
|
||||
</section>,
|
||||
);
|
||||
|
||||
if (this.state.pluginInfos.length) {
|
||||
@ -104,7 +104,7 @@ export default class ErrorBoundary extends React.Component<Props, State> {
|
||||
<section key="pluginSettings">
|
||||
<h2>Plugins</h2>
|
||||
<pre>{JSON.stringify(this.state.pluginInfos, null, 4)}</pre>
|
||||
</section>
|
||||
</section>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ export default class ErrorBoundary extends React.Component<Props, State> {
|
||||
<section key="stacktrace">
|
||||
<h2>Stack trace</h2>
|
||||
<pre>{this.state.error.stack}</pre>
|
||||
</section>
|
||||
</section>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -123,7 +123,7 @@ export default class ErrorBoundary extends React.Component<Props, State> {
|
||||
<section key="componentStack">
|
||||
<h2>Component stack</h2>
|
||||
<pre>{this.state.errorInfo.componentStack}</pre>
|
||||
</section>
|
||||
</section>,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ const styleSelector = createSelector(
|
||||
};
|
||||
|
||||
return output;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
function platformAssets(type: string) {
|
||||
|
@ -42,7 +42,7 @@ class ImportScreenComponent extends React.Component<Props, State> {
|
||||
},
|
||||
() => {
|
||||
void this.doImport();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ export const KeymapConfigScreen = ({ themeId }: KeymapConfigScreenProps) => {
|
||||
<div>
|
||||
{accelerator.split('+').map(part => <kbd style={styles.kbd} key={part}>{part}</kbd>).reduce(
|
||||
(accumulator, part) => (accumulator.length ? [...accumulator, ' + ', part] : [part]),
|
||||
[]
|
||||
[],
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
@ -12,7 +12,7 @@ const useCommandStatus = (): [CommandStatus, (commandName: string)=> void, (comm
|
||||
keymapService.getCommandNames().reduce((accumulator: CommandStatus, command: string) => {
|
||||
accumulator[command] = false;
|
||||
return accumulator;
|
||||
}, {})
|
||||
}, {}),
|
||||
);
|
||||
|
||||
const disableStatus = (commandName: string) => setStatus(prevStatus => ({ ...prevStatus, [commandName]: false }));
|
||||
|
@ -608,37 +608,37 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
msg = this.renderNotificationMessage(
|
||||
_('Safe mode is currently active. Note rendering and all plugins are temporarily disabled.'),
|
||||
_('Disable safe mode and restart'),
|
||||
onDisableSafeModeAndRestart
|
||||
onDisableSafeModeAndRestart,
|
||||
);
|
||||
} else if (this.props.hasMissingSyncCredentials) {
|
||||
msg = this.renderNotificationMessage(
|
||||
_('The synchronisation password is missing.'),
|
||||
_('Set the password'),
|
||||
onViewSyncSettingsScreen
|
||||
onViewSyncSettingsScreen,
|
||||
);
|
||||
} else if (this.props.shouldUpgradeSyncTarget) {
|
||||
msg = this.renderNotificationMessage(
|
||||
_('The sync target needs to be upgraded before Joplin can sync. The operation may take a few minutes to complete and the app needs to be restarted. To proceed please click on the link.'),
|
||||
_('Restart and upgrade'),
|
||||
onRestartAndUpgrade
|
||||
onRestartAndUpgrade,
|
||||
);
|
||||
} else if (this.props.hasDisabledEncryptionItems) {
|
||||
msg = this.renderNotificationMessage(
|
||||
_('Some items cannot be decrypted.'),
|
||||
_('View them now'),
|
||||
onViewStatusScreen
|
||||
onViewStatusScreen,
|
||||
);
|
||||
} else if (this.props.showNeedUpgradingMasterKeyMessage) {
|
||||
msg = this.renderNotificationMessage(
|
||||
_('One of your master keys use an obsolete encryption method.'),
|
||||
_('View them now'),
|
||||
onViewEncryptionConfigScreen
|
||||
onViewEncryptionConfigScreen,
|
||||
);
|
||||
} else if (this.props.showShouldReencryptMessage) {
|
||||
msg = this.renderNotificationMessage(
|
||||
_('The default encryption method has been changed, you should re-encrypt your data.'),
|
||||
_('More info'),
|
||||
onViewEncryptionConfigScreen
|
||||
onViewEncryptionConfigScreen,
|
||||
);
|
||||
} else if (this.showShareInvitationNotification(this.props)) {
|
||||
const invitation = this.props.shareInvitations.find(inv => inv.status === 0);
|
||||
@ -649,25 +649,25 @@ class MainScreenComponent extends React.Component<Props, State> {
|
||||
_('Accept'),
|
||||
() => onInvitationRespond(invitation.id, invitation.share.folder_id, invitation.master_key, true),
|
||||
_('Reject'),
|
||||
() => onInvitationRespond(invitation.id, invitation.share.folder_id, invitation.master_key, false)
|
||||
() => onInvitationRespond(invitation.id, invitation.share.folder_id, invitation.master_key, false),
|
||||
);
|
||||
} else if (this.props.hasDisabledSyncItems) {
|
||||
msg = this.renderNotificationMessage(
|
||||
_('Some items cannot be synchronised.'),
|
||||
_('View them now'),
|
||||
onViewStatusScreen
|
||||
onViewStatusScreen,
|
||||
);
|
||||
} else if (this.props.showMissingMasterKeyMessage) {
|
||||
msg = this.renderNotificationMessage(
|
||||
_('One or more master keys need a password.'),
|
||||
_('Set the password'),
|
||||
onViewEncryptionConfigScreen
|
||||
onViewEncryptionConfigScreen,
|
||||
);
|
||||
} else if (this.props.showInstallTemplatesPlugin) {
|
||||
msg = this.renderNotificationMessage(
|
||||
'The template feature has been moved to a plugin called "Templates".',
|
||||
'Install plugin',
|
||||
onViewPluginScreen
|
||||
onViewPluginScreen,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -301,7 +301,7 @@ function useMenu(props: Props) {
|
||||
return menuUtils.commandsToMenuItems(
|
||||
commandNames.concat(pluginCommandNames),
|
||||
(commandName: string) => onMenuItemClickRef.current(commandName),
|
||||
props.locale
|
||||
props.locale,
|
||||
);
|
||||
// eslint-disable-next-line @seiyab/react-hooks/exhaustive-deps -- Old code before rule was applied
|
||||
}, [commandNames, pluginCommandNames, props.locale]);
|
||||
@ -347,7 +347,7 @@ function useMenu(props: Props) {
|
||||
if (type === 'notes') {
|
||||
sortItems.push(
|
||||
{ ...menuItemDic.toggleNotesSortOrderReverse, type: 'checkbox' },
|
||||
{ ...menuItemDic.toggleNotesSortOrderField, visible: false }
|
||||
{ ...menuItemDic.toggleNotesSortOrderField, visible: false },
|
||||
);
|
||||
} else {
|
||||
sortItems.push({
|
||||
@ -391,7 +391,7 @@ function useMenu(props: Props) {
|
||||
{
|
||||
plugins: pluginsRef.current,
|
||||
customCss: props.customCss,
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
});
|
||||
@ -414,7 +414,7 @@ function useMenu(props: Props) {
|
||||
});
|
||||
|
||||
exportItems.push(
|
||||
menuItemDic.exportPdf
|
||||
menuItemDic.exportPdf,
|
||||
);
|
||||
|
||||
// We need a dummy entry, otherwise the ternary operator to show a
|
||||
|
@ -68,7 +68,7 @@ export default function MultiNoteActions(props: MultiNoteActionsProps) {
|
||||
itemComps.push(
|
||||
<button key={item.label} style={styles.button} onClick={() => multiNotesButton_click(item)}>
|
||||
{item.label}
|
||||
</button>
|
||||
</button>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -838,7 +838,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
|
||||
click: async () => {
|
||||
editorCutText();
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
menu.append(
|
||||
@ -848,7 +848,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
|
||||
click: async () => {
|
||||
editorCopyText();
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
menu.append(
|
||||
@ -858,7 +858,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
|
||||
click: async () => {
|
||||
editorPaste();
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const spellCheckerMenuItems = SpellCheckerService.instance().contextMenuItems(params.misspelledWord, params.dictionarySuggestions);
|
||||
|
@ -750,13 +750,13 @@ const TinyMCE = (props: NoteBodyEditorProps, ref: any) => {
|
||||
].concat(
|
||||
pluginAssets
|
||||
.filter((a: any) => a.mime === 'text/css')
|
||||
.map((a: any) => a.path)
|
||||
.map((a: any) => a.path),
|
||||
);
|
||||
|
||||
const allJsFiles = [].concat(
|
||||
pluginAssets
|
||||
.filter((a: any) => a.mime === 'application/javascript')
|
||||
.map((a: any) => a.path)
|
||||
.map((a: any) => a.path),
|
||||
);
|
||||
|
||||
|
||||
|
@ -181,6 +181,6 @@ export async function processPastedHtml(html: string) {
|
||||
return mappedResources[src];
|
||||
}), {
|
||||
allowedFilePrefixes: [Setting.value('resourceDir')],
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
@ -231,7 +231,7 @@ class NotePropertiesDialog extends React.Component<Props, State> {
|
||||
},
|
||||
() => {
|
||||
resolve();
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ class NoteRevisionViewerComponent extends React.PureComponent<Props, State> {
|
||||
},
|
||||
() => {
|
||||
void this.reloadNote();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
@ -116,7 +116,7 @@ class NoteRevisionViewerComponent extends React.PureComponent<Props, State> {
|
||||
},
|
||||
() => {
|
||||
void this.reloadNote();
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -198,7 +198,7 @@ class NoteRevisionViewerComponent extends React.PureComponent<Props, State> {
|
||||
revisionListItems.push(
|
||||
<option key={rev.id} value={rev.id}>
|
||||
{`${time.formatMsToLocal(rev.item_updated_time)} (${stats})`}
|
||||
</option>
|
||||
</option>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -275,28 +275,28 @@ export default class PromptDialog extends React.Component<Props, any> {
|
||||
buttonComps.push(
|
||||
<button key="create" disabled={!this.state.answer} style={styles.button} onClick={() => onClose(true, 'create')}>
|
||||
{_('Create')}
|
||||
</button>
|
||||
</button>,
|
||||
);
|
||||
}
|
||||
if (buttonTypes.indexOf('ok') >= 0) {
|
||||
buttonComps.push(
|
||||
<button key="ok" disabled={!this.state.answer} style={styles.button} onClick={() => onClose(true, 'ok')}>
|
||||
{_('OK')}
|
||||
</button>
|
||||
</button>,
|
||||
);
|
||||
}
|
||||
if (buttonTypes.indexOf('cancel') >= 0) {
|
||||
buttonComps.push(
|
||||
<button key="cancel" style={styles.button} onClick={() => onClose(false, 'cancel')}>
|
||||
{_('Cancel')}
|
||||
</button>
|
||||
</button>,
|
||||
);
|
||||
}
|
||||
if (buttonTypes.indexOf('clear') >= 0) {
|
||||
buttonComps.push(
|
||||
<button key="clear" style={styles.button} onClick={() => onClose(false, 'clear')}>
|
||||
{_('Clear')}
|
||||
</button>
|
||||
</button>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -111,7 +111,7 @@ const ResourceTableComp = (props: ResourceTable) => {
|
||||
<td style={cellStyle} className="dataCell">
|
||||
<button style={theme.buttonStyle} onClick={() => props.onResourceDelete(resource)}>{_('Delete')}</button>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>,
|
||||
)}
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -267,5 +267,5 @@ root.render(
|
||||
<ErrorBoundary>
|
||||
<Root />
|
||||
</ErrorBoundary>
|
||||
</Provider>
|
||||
</Provider>,
|
||||
);
|
||||
|
@ -280,7 +280,7 @@ const SidebarComponent = (props: Props) => {
|
||||
const menu = new Menu();
|
||||
|
||||
menu.append(
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('newFolder'))
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('newFolder')),
|
||||
);
|
||||
|
||||
menu.popup({ window: bridge().window() });
|
||||
@ -314,13 +314,13 @@ const SidebarComponent = (props: Props) => {
|
||||
|
||||
if (itemType === BaseModel.TYPE_FOLDER && !item.encryption_applied) {
|
||||
menu.append(
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('newFolder', itemId))
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('newFolder', itemId)),
|
||||
);
|
||||
}
|
||||
|
||||
if (itemType === BaseModel.TYPE_FOLDER) {
|
||||
menu.append(
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('deleteFolder', itemId))
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('deleteFolder', itemId)),
|
||||
);
|
||||
} else {
|
||||
menu.append(
|
||||
@ -342,7 +342,7 @@ const SidebarComponent = (props: Props) => {
|
||||
});
|
||||
}
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@ -364,7 +364,7 @@ const SidebarComponent = (props: Props) => {
|
||||
click: async () => {
|
||||
await InteropServiceHelper.export(props.dispatch, module, { sourceFolderIds: [itemId], plugins: pluginsRef.current });
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@ -386,7 +386,7 @@ const SidebarComponent = (props: Props) => {
|
||||
new MenuItem({
|
||||
label: _('Export'),
|
||||
submenu: exportMenu,
|
||||
})
|
||||
}),
|
||||
);
|
||||
if (Setting.value('notes.perFolderSortOrderEnabled')) {
|
||||
menu.append(new MenuItem({
|
||||
@ -404,13 +404,13 @@ const SidebarComponent = (props: Props) => {
|
||||
click: () => {
|
||||
clipboard.writeText(getFolderCallbackUrl(itemId));
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if (itemType === BaseModel.TYPE_TAG) {
|
||||
menu.append(new MenuItem(
|
||||
menuUtils.commandToStatefulMenuItem('renameTag', itemId)
|
||||
menuUtils.commandToStatefulMenuItem('renameTag', itemId),
|
||||
));
|
||||
menu.append(
|
||||
new MenuItem({
|
||||
@ -418,7 +418,7 @@ const SidebarComponent = (props: Props) => {
|
||||
click: () => {
|
||||
clipboard.writeText(getTagCallbackUrl(itemId));
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@ -431,7 +431,7 @@ const SidebarComponent = (props: Props) => {
|
||||
itemType === ModelType.Folder && location === MenuItemLocation.FolderContextMenu
|
||||
) {
|
||||
menu.append(
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem(view.commandName, itemId))
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem(view.commandName, itemId)),
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -705,7 +705,7 @@ const SidebarComponent = (props: Props) => {
|
||||
onDrop: onFolderDrop_,
|
||||
['data-folder-id']: '',
|
||||
toggleblock: 1,
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
const foldersStyle = useMemo(() => {
|
||||
@ -725,14 +725,14 @@ const SidebarComponent = (props: Props) => {
|
||||
style={foldersStyle}
|
||||
>
|
||||
{folderItems}
|
||||
</div>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
||||
items.push(
|
||||
renderHeader('tagHeader', _('Tags'), 'icon-tags', null, null, {
|
||||
toggleblock: 1,
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
if (props.tags.length) {
|
||||
@ -743,7 +743,7 @@ const SidebarComponent = (props: Props) => {
|
||||
items.push(
|
||||
<div className="tags" key="tag_items" style={{ display: props.tagHeaderIsExpanded ? 'block' : 'none' }}>
|
||||
{tagItems}
|
||||
</div>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -765,7 +765,7 @@ const SidebarComponent = (props: Props) => {
|
||||
syncReportText.push(
|
||||
<StyledSyncReportText key={i}>
|
||||
{lines[i]}
|
||||
</StyledSyncReportText>
|
||||
</StyledSyncReportText>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -133,14 +133,14 @@ function StatusScreen(props: Props) {
|
||||
<li style={theme.textStyle} key={`item_${n}`}>
|
||||
<span>{text}</span>
|
||||
{retryLink}
|
||||
</li>
|
||||
</li>,
|
||||
);
|
||||
} else {
|
||||
itemsHtml.push(
|
||||
<div style={theme.textStyle} key={`item_${n}`}>
|
||||
<span>{text}</span>
|
||||
{retryLink}
|
||||
</div>
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ markJsUtils.markKeyword = (mark, keyword, stringUtils, extraOptions = null) => {
|
||||
return true;
|
||||
},
|
||||
...extraOptions,
|
||||
}
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -46,7 +46,7 @@ const style = createSelector(
|
||||
output.buttonLabelSelected = { ...output.buttonLabel, color: theme.color };
|
||||
|
||||
return output;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
module.exports = style;
|
||||
|
@ -45,15 +45,15 @@ export default class NoteListUtils {
|
||||
|
||||
if (!hasEncrypted) {
|
||||
menu.append(
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('setTags', noteIds))
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('setTags', noteIds)),
|
||||
);
|
||||
|
||||
menu.append(
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('moveToFolder', noteIds))
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('moveToFolder', noteIds)),
|
||||
);
|
||||
|
||||
menu.append(
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('duplicateNote', noteIds))
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem('duplicateNote', noteIds)),
|
||||
);
|
||||
|
||||
if (singleNoteId) {
|
||||
@ -64,8 +64,8 @@ export default class NoteListUtils {
|
||||
if (noteIds.length <= 1) {
|
||||
menu.append(
|
||||
new MenuItem(
|
||||
menuUtils.commandToStatefulMenuItem('toggleNoteType', noteIds)
|
||||
)
|
||||
menuUtils.commandToStatefulMenuItem('toggleNoteType', noteIds),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
const switchNoteType = async (noteIds: string[], type: string) => {
|
||||
@ -84,7 +84,7 @@ export default class NoteListUtils {
|
||||
click: async () => {
|
||||
await switchNoteType(noteIds, 'note');
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
menu.append(
|
||||
@ -93,7 +93,7 @@ export default class NoteListUtils {
|
||||
click: async () => {
|
||||
await switchNoteType(noteIds, 'todo');
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ export default class NoteListUtils {
|
||||
}
|
||||
clipboard.writeText(links.join(' '));
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
if (noteIds.length === 1) {
|
||||
@ -118,15 +118,15 @@ export default class NoteListUtils {
|
||||
click: () => {
|
||||
clipboard.writeText(getNoteCallbackUrl(noteIds[0]));
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
if ([9, 10].includes(Setting.value('sync.target'))) {
|
||||
menu.append(
|
||||
new MenuItem(
|
||||
menuUtils.commandToStatefulMenuItem('showShareNoteDialog', noteIds.slice())
|
||||
)
|
||||
menuUtils.commandToStatefulMenuItem('showShareNoteDialog', noteIds.slice()),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@ -150,14 +150,14 @@ export default class NoteListUtils {
|
||||
customCss: props.customCss,
|
||||
});
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
exportMenu.append(
|
||||
new MenuItem(
|
||||
menuUtils.commandToStatefulMenuItem('exportPdf', noteIds)
|
||||
)
|
||||
menuUtils.commandToStatefulMenuItem('exportPdf', noteIds),
|
||||
),
|
||||
);
|
||||
|
||||
const exportMenuItem = new MenuItem({ label: _('Export'), submenu: exportMenu });
|
||||
@ -167,8 +167,8 @@ export default class NoteListUtils {
|
||||
|
||||
menu.append(
|
||||
new MenuItem(
|
||||
menuUtils.commandToStatefulMenuItem('deleteNote', noteIds)
|
||||
)
|
||||
menuUtils.commandToStatefulMenuItem('deleteNote', noteIds),
|
||||
),
|
||||
);
|
||||
|
||||
const pluginViewInfos = pluginUtils.viewInfosByType(props.plugins, 'menuItem');
|
||||
@ -179,7 +179,7 @@ export default class NoteListUtils {
|
||||
|
||||
if (cmdService.isEnabled(info.view.commandName)) {
|
||||
menu.append(
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem(info.view.commandName, noteIds))
|
||||
new MenuItem(menuUtils.commandToStatefulMenuItem(info.view.commandName, noteIds)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -31,7 +31,7 @@ const tasks = {
|
||||
fn: async () => {
|
||||
await compileSass(
|
||||
`${__dirname}/style.scss`,
|
||||
`${__dirname}/style.min.css`
|
||||
`${__dirname}/style.min.css`,
|
||||
);
|
||||
},
|
||||
},
|
||||
|
@ -108,7 +108,7 @@ function UserWebview(props: Props, ref: any) {
|
||||
frameWindow(),
|
||||
isReady,
|
||||
postMessage,
|
||||
props.html
|
||||
props.html,
|
||||
);
|
||||
|
||||
const contentSize = useContentSize(
|
||||
@ -117,14 +117,14 @@ function UserWebview(props: Props, ref: any) {
|
||||
minWidth,
|
||||
minHeight,
|
||||
props.fitToContent,
|
||||
isReady
|
||||
isReady,
|
||||
);
|
||||
|
||||
useSubmitHandler(
|
||||
frameWindow(),
|
||||
props.onSubmit,
|
||||
props.onDismiss,
|
||||
htmlHash
|
||||
htmlHash,
|
||||
);
|
||||
|
||||
useWebviewToPluginMessages(
|
||||
@ -132,14 +132,14 @@ function UserWebview(props: Props, ref: any) {
|
||||
isReady,
|
||||
props.pluginId,
|
||||
props.viewId,
|
||||
postMessage
|
||||
postMessage,
|
||||
);
|
||||
|
||||
useScriptLoader(
|
||||
postMessage,
|
||||
isReady,
|
||||
props.scripts,
|
||||
cssFilePath
|
||||
cssFilePath,
|
||||
);
|
||||
|
||||
return <StyledFrame
|
||||
|
@ -32,7 +32,7 @@ const FolderPicker: FunctionComponent<FolderPickerProps> = ({
|
||||
const theme = themeStyle(themeId);
|
||||
|
||||
const addFolderChildren = (
|
||||
folders: FolderEntityWithChildren[], pickerItems: DropdownListItem[], indent: number
|
||||
folders: FolderEntityWithChildren[], pickerItems: DropdownListItem[], indent: number,
|
||||
) => {
|
||||
folders.sort((a, b) => {
|
||||
const aTitle = a && a.title ? a.title : '';
|
||||
|
@ -43,12 +43,12 @@ export default function NoteBodyViewer(props: Props) {
|
||||
props.highlightedKeywords,
|
||||
props.noteResources,
|
||||
props.paddingBottom,
|
||||
props.noteHash
|
||||
props.noteHash,
|
||||
);
|
||||
|
||||
const onResourceLongPress = useOnResourceLongPress(
|
||||
props.onJoplinLinkClick,
|
||||
dialogBoxRef
|
||||
dialogBoxRef,
|
||||
);
|
||||
|
||||
const onMessage = useOnMessage(
|
||||
@ -56,7 +56,7 @@ export default function NoteBodyViewer(props: Props) {
|
||||
props.noteBody,
|
||||
props.onMarkForDownload,
|
||||
props.onJoplinLinkClick,
|
||||
onResourceLongPress
|
||||
onResourceLongPress,
|
||||
);
|
||||
|
||||
const onLoadEnd = useCallback(() => {
|
||||
|
@ -125,7 +125,7 @@ export default function useSource(noteBody: string, noteMarkupLanguage: number,
|
||||
noteMarkupLanguage,
|
||||
bodyToRender,
|
||||
rendererTheme,
|
||||
mdOptions
|
||||
mdOptions,
|
||||
);
|
||||
|
||||
if (cancelled) return;
|
||||
|
@ -51,7 +51,7 @@ interface CodeMirrorResult extends CodeMirrorControl {
|
||||
}
|
||||
|
||||
export function initCodeMirror(
|
||||
parentElement: any, initialText: string, settings: EditorSettings
|
||||
parentElement: any, initialText: string, settings: EditorSettings,
|
||||
): CodeMirrorResult {
|
||||
logMessage('Initializing CodeMirror...');
|
||||
const theme = settings.themeData;
|
||||
|
@ -82,7 +82,7 @@ const computeDecorations = (view: EditorView) => {
|
||||
for (const { from, to } of view.visibleRanges) {
|
||||
ensureSyntaxTree(
|
||||
view.state,
|
||||
to
|
||||
to,
|
||||
)?.iterate({
|
||||
from, to,
|
||||
enter: node => {
|
||||
|
@ -11,35 +11,35 @@ describe('markdownCommands.bulletedVsChecklist', () => {
|
||||
|
||||
it('should remove a checklist following a bulleted list without modifying the bulleted list', async () => {
|
||||
const editor = await createEditor(
|
||||
initialDocText, EditorSelection.cursor(bulletedListPart.length + 5), expectedTags
|
||||
initialDocText, EditorSelection.cursor(bulletedListPart.length + 5), expectedTags,
|
||||
);
|
||||
|
||||
toggleList(ListType.CheckList)(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
`${bulletedListPart}\n\nThis is a checklist\nwith multiple items.\n☑`
|
||||
`${bulletedListPart}\n\nThis is a checklist\nwith multiple items.\n☑`,
|
||||
);
|
||||
});
|
||||
|
||||
it('should remove an unordered list following a checklist without modifying the checklist', async () => {
|
||||
const editor = await createEditor(
|
||||
initialDocText, EditorSelection.cursor(bulletedListPart.length - 5), expectedTags
|
||||
initialDocText, EditorSelection.cursor(bulletedListPart.length - 5), expectedTags,
|
||||
);
|
||||
|
||||
toggleList(ListType.UnorderedList)(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
`Test\nThis is a test.\n3\n4\n5\n\n${checklistPart}`
|
||||
`Test\nThis is a test.\n3\n4\n5\n\n${checklistPart}`,
|
||||
);
|
||||
});
|
||||
|
||||
it('should replace a selection of unordered and task lists with a correctly-numbered list', async () => {
|
||||
const editor = await createEditor(
|
||||
initialDocText, EditorSelection.range(0, initialDocText.length), expectedTags
|
||||
initialDocText, EditorSelection.range(0, initialDocText.length), expectedTags,
|
||||
);
|
||||
|
||||
toggleList(ListType.OrderedList)(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'1. Test\n2. This is a test.\n3. 3\n4. 4\n5. 5'
|
||||
+ '\n\n6. This is a checklist\n7. with multiple items.\n8. ☑'
|
||||
+ '\n\n6. This is a checklist\n7. with multiple items.\n8. ☑',
|
||||
);
|
||||
});
|
||||
});
|
||||
|
@ -9,7 +9,7 @@ describe('markdownCommands', () => {
|
||||
it('should bold/italicize everything selected', async () => {
|
||||
const initialDocText = 'Testing...';
|
||||
const editor = await createEditor(
|
||||
initialDocText, EditorSelection.range(0, initialDocText.length), []
|
||||
initialDocText, EditorSelection.range(0, initialDocText.length), [],
|
||||
);
|
||||
|
||||
toggleBolded(editor);
|
||||
@ -36,7 +36,7 @@ describe('markdownCommands', () => {
|
||||
it('for a cursor, bolding, then italicizing, should produce a bold-italic region', async () => {
|
||||
const initialDocText = '';
|
||||
const editor = await createEditor(
|
||||
initialDocText, EditorSelection.cursor(0), []
|
||||
initialDocText, EditorSelection.cursor(0), [],
|
||||
);
|
||||
|
||||
toggleBolded(editor);
|
||||
@ -110,14 +110,14 @@ describe('markdownCommands', () => {
|
||||
const editor = await createEditor(
|
||||
initialDocText,
|
||||
EditorSelection.cursor('Testing...\n\n> This'.length),
|
||||
['Blockquote']
|
||||
['Blockquote'],
|
||||
);
|
||||
|
||||
toggleHeaderLevel(1)(editor);
|
||||
|
||||
const mainSel = editor.state.selection.main;
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'Testing...\n\n> # This is a test.\n> ...a test'
|
||||
'Testing...\n\n> # This is a test.\n> ...a test',
|
||||
);
|
||||
expect(mainSel.empty).toBe(true);
|
||||
expect(mainSel.from).toBe('Testing...\n\n> # This is a test.'.length);
|
||||
@ -125,7 +125,7 @@ describe('markdownCommands', () => {
|
||||
toggleHeaderLevel(3)(editor);
|
||||
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'Testing...\n\n> ### This is a test.\n> ...a test'
|
||||
'Testing...\n\n> ### This is a test.\n> ...a test',
|
||||
);
|
||||
});
|
||||
|
||||
@ -135,9 +135,9 @@ describe('markdownCommands', () => {
|
||||
initialDocText,
|
||||
EditorSelection.range(
|
||||
'Testing...\n\n> This'.length,
|
||||
'Testing...\n\n> This is a test.\n> y = mx + b'.length
|
||||
'Testing...\n\n> This is a test.\n> y = mx + b'.length,
|
||||
),
|
||||
['Blockquote']
|
||||
['Blockquote'],
|
||||
);
|
||||
|
||||
toggleMath(editor);
|
||||
@ -145,7 +145,7 @@ describe('markdownCommands', () => {
|
||||
// Toggling math should surround the content in '$$'s
|
||||
const mainSel = editor.state.selection.main;
|
||||
expect(editor.state.doc.toString()).toEqual(
|
||||
'Testing...\n\n> $$\n> This is a test.\n> y = mx + b\n> $$\n> ...a test'
|
||||
'Testing...\n\n> $$\n> This is a test.\n> y = mx + b\n> $$\n> ...a test',
|
||||
);
|
||||
expect(mainSel.from).toBe('Testing...\n\n'.length);
|
||||
expect(mainSel.to).toBe('Testing...\n\n> $$\n> This is a test.\n> y = mx + b\n> $$'.length);
|
||||
@ -157,7 +157,7 @@ describe('markdownCommands', () => {
|
||||
const editor = await createEditor(
|
||||
initialDocText,
|
||||
EditorSelection.cursor('Testing...\n\n> $$\n> This is'.length),
|
||||
['Blockquote', blockMathTagName]
|
||||
['Blockquote', blockMathTagName],
|
||||
);
|
||||
|
||||
// Toggling math should remove the '$$'s
|
||||
@ -174,12 +174,12 @@ describe('markdownCommands', () => {
|
||||
|
||||
updateLink('bar', 'https://example.com/')(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'[bar](https://example.com/)'
|
||||
'[bar](https://example.com/)',
|
||||
);
|
||||
|
||||
updateLink('', 'https://example.com/')(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'https://example.com/'
|
||||
'https://example.com/',
|
||||
);
|
||||
});
|
||||
|
||||
@ -225,7 +225,7 @@ describe('markdownCommands', () => {
|
||||
toggleMath(editor);
|
||||
editor.dispatch(editor.state.replaceSelection('f(x) = ...'));
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'> Testing...> \n> \n> $$\n> f(x) = ...\n> $$'
|
||||
'> Testing...> \n> \n> $$\n> f(x) = ...\n> $$',
|
||||
);
|
||||
|
||||
// If we toggle math again, everything from the start of the line with the first
|
||||
|
@ -12,12 +12,12 @@ describe('markdownCommands.toggleList', () => {
|
||||
const editor = await createEditor(
|
||||
initialDocText,
|
||||
EditorSelection.cursor(5),
|
||||
['BulletList', 'InlineCode']
|
||||
['BulletList', 'InlineCode'],
|
||||
);
|
||||
|
||||
toggleList(ListType.UnorderedList)(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'testing\nthis is a `test`\n'
|
||||
'testing\nthis is a `test`\n',
|
||||
);
|
||||
});
|
||||
|
||||
@ -26,12 +26,12 @@ describe('markdownCommands.toggleList', () => {
|
||||
const editor = await createEditor(
|
||||
initialDocText,
|
||||
EditorSelection.cursor('Testing...\nThis is a'.length),
|
||||
[]
|
||||
[],
|
||||
);
|
||||
|
||||
toggleList(ListType.OrderedList)(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'Testing...\n1. This is a test\nof list toggling...'
|
||||
'Testing...\n1. This is a test\nof list toggling...',
|
||||
);
|
||||
|
||||
editor.setState(EditorState.create({
|
||||
@ -41,7 +41,7 @@ describe('markdownCommands.toggleList', () => {
|
||||
|
||||
toggleList(ListType.OrderedList)(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'1. Testing...\n2. This is a test\n3. of list toggling...'
|
||||
'1. Testing...\n2. This is a test\n3. of list toggling...',
|
||||
);
|
||||
});
|
||||
|
||||
@ -51,12 +51,12 @@ describe('markdownCommands.toggleList', () => {
|
||||
const editor = await createEditor(
|
||||
unorderedListText,
|
||||
EditorSelection.cursor(unorderedListText.length),
|
||||
['BulletList']
|
||||
['BulletList'],
|
||||
);
|
||||
|
||||
toggleList(ListType.OrderedList)(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'1. 1\n2. 2\n3. 3\n4. 4\n5. 5\n6. 6\n7. 7'
|
||||
'1. 1\n2. 2\n3. 3\n4. 4\n5. 5\n6. 6\n7. 7',
|
||||
);
|
||||
});
|
||||
|
||||
@ -154,12 +154,12 @@ describe('markdownCommands.toggleList', () => {
|
||||
const editor = await createEditor(
|
||||
initialDocText,
|
||||
EditorSelection.cursor(0),
|
||||
['OrderedList', 'BulletList']
|
||||
['OrderedList', 'BulletList'],
|
||||
);
|
||||
|
||||
toggleList(ListType.CheckList)(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'- [ ] Foo\n- [ ] Bar\n- [ ] Baz\n\t- Test\n\t- of\n\t- sublists\n- [ ] Foo'
|
||||
'- [ ] Foo\n- [ ] Bar\n- [ ] Baz\n\t- Test\n\t- of\n\t- sublists\n- [ ] Foo',
|
||||
);
|
||||
});
|
||||
|
||||
@ -169,7 +169,7 @@ describe('markdownCommands.toggleList', () => {
|
||||
const editor = await createEditor(
|
||||
initialDocText,
|
||||
EditorSelection.cursor(initialDocText.length),
|
||||
['OrderedList']
|
||||
['OrderedList'],
|
||||
);
|
||||
|
||||
increaseIndent(editor);
|
||||
@ -177,12 +177,12 @@ describe('markdownCommands.toggleList', () => {
|
||||
|
||||
toggleList(ListType.CheckList)(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'1. This\n2. is\n\t- [ ] '
|
||||
'1. This\n2. is\n\t- [ ] ',
|
||||
);
|
||||
|
||||
editor.dispatch(editor.state.replaceSelection('a test.'));
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'1. This\n2. is\n\t- [ ] a test.'
|
||||
'1. This\n2. is\n\t- [ ] a test.',
|
||||
);
|
||||
});
|
||||
|
||||
@ -191,12 +191,12 @@ describe('markdownCommands.toggleList', () => {
|
||||
const initialDocText = `${preSubListText}> \t* a\n> \t* test\n> * of list toggling`;
|
||||
const editor = await createEditor(
|
||||
initialDocText, EditorSelection.cursor(preSubListText.length + 3),
|
||||
['BlockQuote', 'BulletList']
|
||||
['BlockQuote', 'BulletList'],
|
||||
);
|
||||
|
||||
toggleList(ListType.OrderedList)(editor);
|
||||
expect(editor.state.doc.toString()).toBe(
|
||||
'> # List test\n> * This\n> * is\n> \t1. a\n> \t2. test\n> * of list toggling'
|
||||
'> # List test\n> * This\n> * is\n> \t1. a\n> \t2. test\n> * of list toggling',
|
||||
);
|
||||
expect(editor.state.selection.main.from).toBe(preSubListText.length);
|
||||
});
|
||||
|
@ -250,7 +250,7 @@ export const toggleList = (listType: ListType): Command => {
|
||||
|
||||
sel = EditorSelection.range(
|
||||
doc.line(newFromLineNo).from,
|
||||
doc.line(newToLineNo).to
|
||||
doc.line(newToLineNo).to,
|
||||
);
|
||||
computeSelectionProps();
|
||||
}
|
||||
@ -299,7 +299,7 @@ export const toggleList = (listType: ListType): Command => {
|
||||
const containerMatch = lineContent.match(containerRegex);
|
||||
if (!containerMatch) {
|
||||
throw new Error(
|
||||
'Assertion failed: container regex does not match line content.'
|
||||
'Assertion failed: container regex does not match line content.',
|
||||
);
|
||||
}
|
||||
|
||||
@ -336,7 +336,7 @@ export const toggleList = (listType: ListType): Command => {
|
||||
} else {
|
||||
sel = EditorSelection.range(
|
||||
sel.from,
|
||||
sel.to + charsAdded
|
||||
sel.to + charsAdded,
|
||||
);
|
||||
}
|
||||
|
||||
@ -374,10 +374,10 @@ export const toggleHeaderLevel = (level: number): Command => {
|
||||
`${level - 1 >= 1 ? `(?:^[#]{1,${level - 1}}\\s)|` : ''
|
||||
|
||||
// Check all number of #s higher than [level]
|
||||
}(?:^[#]{${level + 1},}\\s)`
|
||||
}(?:^[#]{${level + 1},}\\s)`,
|
||||
),
|
||||
'',
|
||||
matchEmpty
|
||||
matchEmpty,
|
||||
);
|
||||
view.dispatch(changes);
|
||||
|
||||
@ -387,7 +387,7 @@ export const toggleHeaderLevel = (level: number): Command => {
|
||||
// We want exactly [level] '#' characters.
|
||||
new RegExp(`^[#]{${level}} `),
|
||||
`${headerStr} `,
|
||||
matchEmpty
|
||||
matchEmpty,
|
||||
);
|
||||
view.dispatch(changes);
|
||||
|
||||
@ -408,7 +408,7 @@ export const increaseIndent: Command = (view: EditorView): boolean => {
|
||||
matchNothing,
|
||||
// ...and thus always add indentUnit.
|
||||
indentUnit,
|
||||
matchEmpty
|
||||
matchEmpty,
|
||||
);
|
||||
view.dispatch(changes);
|
||||
|
||||
@ -429,7 +429,7 @@ export const decreaseIndent: Command = (view: EditorView): boolean => {
|
||||
new RegExp(`^(?:[\\t]|[ ]{1,${getIndentUnit(view.state)}})`),
|
||||
// Don't add new text
|
||||
'',
|
||||
matchEmpty
|
||||
matchEmpty,
|
||||
);
|
||||
|
||||
view.dispatch(changes);
|
||||
|
@ -143,7 +143,7 @@ const BlockMathConfig: MarkdownConfig = {
|
||||
let stop;
|
||||
|
||||
let endMatch = mathBlockEndRegex.exec(
|
||||
line.text.substring(mathStartMatch[0].length)
|
||||
line.text.substring(mathStartMatch[0].length),
|
||||
);
|
||||
|
||||
// If the math region ends immediately (on the same line),
|
||||
@ -183,7 +183,7 @@ const BlockMathConfig: MarkdownConfig = {
|
||||
Math.min(lineEnd, stop + delimLen),
|
||||
|
||||
// The child of the container element should be the content element
|
||||
[contentElem]
|
||||
[contentElem],
|
||||
);
|
||||
cx.addElement(containerElement);
|
||||
|
||||
|
@ -103,7 +103,7 @@ describe('markdownReformatter', () => {
|
||||
});
|
||||
|
||||
const changes = toggleRegionFormatGlobally(
|
||||
initialState, inlineCodeRegionSpec, blockCodeRegionSpec
|
||||
initialState, inlineCodeRegionSpec, blockCodeRegionSpec,
|
||||
);
|
||||
|
||||
const newState = initialState.update(changes).state;
|
||||
@ -117,7 +117,7 @@ describe('markdownReformatter', () => {
|
||||
});
|
||||
|
||||
const changes = toggleRegionFormatGlobally(
|
||||
initialState, inlineCodeRegionSpec, blockCodeRegionSpec
|
||||
initialState, inlineCodeRegionSpec, blockCodeRegionSpec,
|
||||
);
|
||||
|
||||
const newState = initialState.update(changes).state;
|
||||
|
@ -84,7 +84,7 @@ export enum MatchSide {
|
||||
// Returns the length of a match for this in the given selection,
|
||||
// -1 if no match is found.
|
||||
export const findInlineMatch = (
|
||||
doc: DocumentText, spec: RegionSpec, sel: SelectionRange, side: MatchSide
|
||||
doc: DocumentText, spec: RegionSpec, sel: SelectionRange, side: MatchSide,
|
||||
): number => {
|
||||
const [regex, template] = (() => {
|
||||
if (side === MatchSide.Start) {
|
||||
@ -182,7 +182,7 @@ export const isIndentationEquivalent = (state: EditorState, a: string, b: string
|
||||
|
||||
// Expands and returns a copy of [sel] to the smallest container node with name in [nodeNames].
|
||||
export const growSelectionToNode = (
|
||||
state: EditorState, sel: SelectionRange, nodeNames: string|string[]|null
|
||||
state: EditorState, sel: SelectionRange, nodeNames: string|string[]|null,
|
||||
): SelectionRange => {
|
||||
if (!nodeNames) {
|
||||
return sel;
|
||||
@ -235,7 +235,7 @@ export const growSelectionToNode = (
|
||||
// If the selection is already surrounded by these characters, they are
|
||||
// removed.
|
||||
const toggleInlineRegionSurrounded = (
|
||||
doc: DocumentText, sel: SelectionRange, spec: RegionSpec
|
||||
doc: DocumentText, sel: SelectionRange, spec: RegionSpec,
|
||||
): SelectionUpdate => {
|
||||
let content = doc.sliceString(sel.from, sel.to);
|
||||
const startMatchLen = findInlineMatch(doc, spec, sel, MatchSide.Start);
|
||||
@ -291,7 +291,7 @@ const toggleInlineRegionSurrounded = (
|
||||
// Returns updated selections: For all selections in the given `EditorState`, toggles
|
||||
// whether each is contained in an inline region of type [spec].
|
||||
export const toggleInlineSelectionFormat = (
|
||||
state: EditorState, spec: RegionSpec, sel: SelectionRange
|
||||
state: EditorState, spec: RegionSpec, sel: SelectionRange,
|
||||
): SelectionUpdate => {
|
||||
const endMatchLen = findInlineMatch(state.doc, spec, sel, MatchSide.End);
|
||||
|
||||
@ -315,7 +315,7 @@ export const toggleInlineSelectionFormat = (
|
||||
|
||||
// Like toggleInlineSelectionFormat, but for all selections in [state].
|
||||
export const toggleInlineFormatGlobally = (
|
||||
state: EditorState, spec: RegionSpec
|
||||
state: EditorState, spec: RegionSpec,
|
||||
): TransactionSpec => {
|
||||
const changes = state.changeByRange((sel: SelectionRange) => {
|
||||
return toggleInlineSelectionFormat(state, spec, sel);
|
||||
@ -328,13 +328,13 @@ export const toggleRegionFormatGlobally = (
|
||||
state: EditorState,
|
||||
|
||||
inlineSpec: RegionSpec,
|
||||
blockSpec: RegionSpec
|
||||
blockSpec: RegionSpec,
|
||||
): TransactionSpec => {
|
||||
const doc = state.doc;
|
||||
const preserveBlockQuotes = true;
|
||||
|
||||
const getMatchEndPoints = (
|
||||
match: RegExpMatchArray, line: Line, inBlockQuote: boolean
|
||||
match: RegExpMatchArray, line: Line, inBlockQuote: boolean,
|
||||
): [startIdx: number, stopIdx: number] => {
|
||||
const startIdx = line.from + match.index;
|
||||
let stopIdx;
|
||||
@ -499,7 +499,7 @@ export const toggleRegionFormatGlobally = (
|
||||
|
||||
// Selection should now encompass all lines that were changed.
|
||||
range: EditorSelection.range(
|
||||
fromLine.from, toLine.to + charsAdded
|
||||
fromLine.from, toLine.to + charsAdded,
|
||||
),
|
||||
};
|
||||
});
|
||||
@ -515,7 +515,7 @@ export const toggleSelectedLinesStartWith = (
|
||||
matchEmpty: boolean,
|
||||
|
||||
// Name associated with what [regex] matches (e.g. FencedCode)
|
||||
nodeName?: string
|
||||
nodeName?: string,
|
||||
): TransactionSpec => {
|
||||
const ignoreBlockQuotes = true;
|
||||
const getLineContentStart = (line: Line): number => {
|
||||
@ -701,7 +701,7 @@ export const renumberList = (state: EditorState, sel: SelectionRange): Selection
|
||||
} else {
|
||||
sel = EditorSelection.range(
|
||||
fromLine.from,
|
||||
toLine.to + charsAdded
|
||||
toLine.to + charsAdded,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -229,7 +229,7 @@ for (const language of supportedLanguages) {
|
||||
name: language.name,
|
||||
alias: language.aliases,
|
||||
support,
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -10,7 +10,7 @@ import loadLangauges from './loadLanguages';
|
||||
// Creates and returns a minimal editor with markdown extensions. Waits to return the editor
|
||||
// until all syntax tree tags in `expectedSyntaxTreeTags` exist.
|
||||
const createEditor = async (
|
||||
initialText: string, initialSelection: SelectionRange, expectedSyntaxTreeTags: string[]
|
||||
initialText: string, initialSelection: SelectionRange, expectedSyntaxTreeTags: string[],
|
||||
): Promise<EditorView> => {
|
||||
await loadLangauges();
|
||||
|
||||
|
@ -10,7 +10,7 @@ const forceFullParse = (editorState: EditorState) => {
|
||||
|
||||
if (!syntaxTreeAvailable(editorState)) {
|
||||
throw new Error(
|
||||
`Unable to generate a syntax tree in ${timeout}. Is the editor configured to parse a language?`
|
||||
`Unable to generate a syntax tree in ${timeout}. Is the editor configured to parse a language?`,
|
||||
);
|
||||
}
|
||||
};
|
||||
|
@ -41,7 +41,7 @@ const Toolbar = (props: ToolbarProps) => {
|
||||
key={key.toString()}
|
||||
styleSheet={props.styleSheet}
|
||||
spec={spec}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ const Toolbar = (props: ToolbarProps) => {
|
||||
const containerWidth = event.nativeEvent.layout.width;
|
||||
const maxButtonsTotal = Math.floor(containerWidth / buttonSize);
|
||||
setMaxButtonsEachSide(Math.floor(
|
||||
Math.min((maxButtonsTotal - 1) / 2, allButtonSpecs.length / 2)
|
||||
Math.min((maxButtonsTotal - 1) / 2, allButtonSpecs.length / 2),
|
||||
));
|
||||
}, [allButtonSpecs.length]);
|
||||
|
||||
|
@ -41,7 +41,7 @@ const ToolbarOverflowRows = (props: OverflowPopupProps) => {
|
||||
|
||||
// After invoking this button's action, hide the overflow menu
|
||||
onActionComplete={props.onToggleOverflow}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
|
||||
// Show the "hide overflow" button if in the center of the last row
|
||||
@ -54,7 +54,7 @@ const ToolbarOverflowRows = (props: OverflowPopupProps) => {
|
||||
styleSheet={props.styleSheet}
|
||||
overflowVisible={true}
|
||||
onToggleOverflowVisible={props.onToggleOverflow}
|
||||
/>
|
||||
/>,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -69,7 +69,7 @@ const ToolbarOverflowRows = (props: OverflowPopupProps) => {
|
||||
>
|
||||
{row}
|
||||
</ScrollView>
|
||||
</View>
|
||||
</View>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -120,7 +120,7 @@ type OnSetVisibleCallback = (visible: boolean)=> void;
|
||||
type OnSearchStateChangeCallback = (state: SearchState)=> void;
|
||||
const useEditorControl = (
|
||||
injectJS: OnInjectJSCallback, setLinkDialogVisible: OnSetVisibleCallback,
|
||||
setSearchState: OnSearchStateChangeCallback, searchStateRef: RefObject<SearchState>
|
||||
setSearchState: OnSearchStateChangeCallback, searchStateRef: RefObject<SearchState>,
|
||||
): EditorControl => {
|
||||
return useMemo(() => {
|
||||
return {
|
||||
@ -132,7 +132,7 @@ const useEditorControl = (
|
||||
},
|
||||
select(anchor: number, head: number) {
|
||||
injectJS(
|
||||
`cm.select(${JSON.stringify(anchor)}, ${JSON.stringify(head)});`
|
||||
`cm.select(${JSON.stringify(anchor)}, ${JSON.stringify(head)});`,
|
||||
);
|
||||
},
|
||||
insertText(text: string) {
|
||||
@ -299,7 +299,7 @@ function NoteEditor(props: Props, ref: any) {
|
||||
};
|
||||
|
||||
const editorControl = useEditorControl(
|
||||
injectJS, setLinkDialogVisible, setSearchState, searchStateRef
|
||||
injectJS, setLinkDialogVisible, setSearchState, searchStateRef,
|
||||
);
|
||||
|
||||
useImperativeHandle(ref, () => {
|
||||
|
@ -39,7 +39,7 @@ interface ActionButtonProps {
|
||||
}
|
||||
|
||||
const ActionButton = (
|
||||
props: ActionButtonProps
|
||||
props: ActionButtonProps,
|
||||
) => {
|
||||
return (
|
||||
<CustomButton
|
||||
@ -154,7 +154,7 @@ export const SearchPanel = (props: SearchPanelProps) => {
|
||||
|
||||
// Creates a TextInut with the given parameters
|
||||
const createInput = (
|
||||
placeholder: string, value: string, onChange: OnChangeCallback, autoFocus: boolean
|
||||
placeholder: string, value: string, onChange: OnChangeCallback, autoFocus: boolean,
|
||||
) => {
|
||||
return (
|
||||
<TextInput
|
||||
@ -229,7 +229,7 @@ export const SearchPanel = (props: SearchPanelProps) => {
|
||||
},
|
||||
|
||||
// Autofocus
|
||||
true
|
||||
true,
|
||||
);
|
||||
|
||||
const replaceTextInput = createInput(
|
||||
@ -242,7 +242,7 @@ export const SearchPanel = (props: SearchPanelProps) => {
|
||||
},
|
||||
|
||||
// Don't autofocus
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
const labeledSearchInput = (
|
||||
|
@ -71,7 +71,7 @@ export default (props: Props) => {
|
||||
onPress: () => {},
|
||||
style: 'cancel',
|
||||
},
|
||||
]
|
||||
],
|
||||
);
|
||||
}, []);
|
||||
|
||||
@ -108,7 +108,7 @@ export default (props: Props) => {
|
||||
onPress: () => {},
|
||||
style: 'cancel',
|
||||
},
|
||||
]
|
||||
],
|
||||
);
|
||||
}, [profileConfig]);
|
||||
|
||||
@ -144,7 +144,7 @@ export default (props: Props) => {
|
||||
onPress: () => {},
|
||||
style: 'cancel',
|
||||
},
|
||||
]
|
||||
],
|
||||
);
|
||||
}}
|
||||
/>
|
||||
|
@ -333,7 +333,7 @@ class ScreenHeaderComponent extends PureComponent<ScreenHeaderProps, ScreenHeade
|
||||
}
|
||||
|
||||
function saveButton(
|
||||
styles: any, onPress: OnPressCallback, disabled: boolean, show: boolean
|
||||
styles: any, onPress: OnPressCallback, disabled: boolean, show: boolean,
|
||||
) {
|
||||
if (!show) return null;
|
||||
|
||||
@ -489,7 +489,7 @@ class ScreenHeaderComponent extends PureComponent<ScreenHeaderProps, ScreenHeade
|
||||
menuOptionComponents.push(
|
||||
<MenuOption value={o.onPress} key={`menuOption_${key++}`} style={this.styles().contextMenuItem} disabled={!!o.disabled}>
|
||||
<Text style={o.disabled ? this.styles().contextMenuItemTextDisabled : this.styles().contextMenuItemText}>{o.title}</Text>
|
||||
</MenuOption>
|
||||
</MenuOption>,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -501,13 +501,13 @@ class ScreenHeaderComponent extends PureComponent<ScreenHeaderProps, ScreenHeade
|
||||
menuOptionComponents.push(
|
||||
<MenuOption value={() => this.deleteButton_press()} key={'menuOption_delete'} style={this.styles().contextMenuItem}>
|
||||
<Text style={this.styles().contextMenuItemText}>{_('Delete')}</Text>
|
||||
</MenuOption>
|
||||
</MenuOption>,
|
||||
);
|
||||
|
||||
menuOptionComponents.push(
|
||||
<MenuOption value={() => this.duplicateButton_press()} key={'menuOption_duplicate'} style={this.styles().contextMenuItem}>
|
||||
<Text style={this.styles().contextMenuItemText}>{_('Duplicate')}</Text>
|
||||
</MenuOption>
|
||||
</MenuOption>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -622,7 +622,7 @@ class ScreenHeaderComponent extends PureComponent<ScreenHeaderProps, ScreenHeade
|
||||
if (this.props.onSaveButtonPress) this.props.onSaveButtonPress();
|
||||
},
|
||||
this.props.saveButtonDisabled === true,
|
||||
this.props.showSaveButton === true
|
||||
this.props.showSaveButton === true,
|
||||
)}
|
||||
{titleComp}
|
||||
{selectAllButtonComp}
|
||||
|
@ -92,7 +92,7 @@ export default (props: Props) => {
|
||||
onPress: () => complete(false),
|
||||
style: 'cancel',
|
||||
},
|
||||
]
|
||||
],
|
||||
);
|
||||
}, [initialPromptDone, display, props.dispatch]);
|
||||
|
||||
|
@ -273,7 +273,7 @@ class ConfigScreenComponent extends BaseScreenComponent {
|
||||
{
|
||||
text: _('Discard changes'),
|
||||
onPress: goBack,
|
||||
}]
|
||||
}],
|
||||
);
|
||||
|
||||
return true;
|
||||
@ -369,10 +369,10 @@ class ConfigScreenComponent extends BaseScreenComponent {
|
||||
'sync.10.inboxEmail',
|
||||
_('Copy to clipboard'),
|
||||
() => Clipboard.setString(this.props.settings['sync.10.inboxEmail']),
|
||||
{ description }
|
||||
{ description },
|
||||
)
|
||||
}
|
||||
</View>
|
||||
</View>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -621,7 +621,7 @@ class ConfigScreenComponent extends BaseScreenComponent {
|
||||
{_('- Location: to allow attaching geo-location information to a note.')}
|
||||
</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -636,7 +636,7 @@ class ConfigScreenComponent extends BaseScreenComponent {
|
||||
{_('Make a donation')}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>,
|
||||
);
|
||||
|
||||
settingComps.push(
|
||||
@ -650,7 +650,7 @@ class ConfigScreenComponent extends BaseScreenComponent {
|
||||
{_('Joplin website')}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>,
|
||||
);
|
||||
|
||||
settingComps.push(
|
||||
@ -664,31 +664,31 @@ class ConfigScreenComponent extends BaseScreenComponent {
|
||||
{_('Privacy Policy')}
|
||||
</Text>
|
||||
</TouchableOpacity>
|
||||
</View>
|
||||
</View>,
|
||||
);
|
||||
|
||||
settingComps.push(
|
||||
<View key="version_info_app" style={this.styles().settingContainer}>
|
||||
<Text style={this.styles().settingText}>{`Joplin ${VersionInfo.appVersion}`}</Text>
|
||||
</View>
|
||||
</View>,
|
||||
);
|
||||
|
||||
settingComps.push(
|
||||
<View key="version_info_db" style={this.styles().settingContainer}>
|
||||
<Text style={this.styles().settingText}>{_('Database v%s', reg.db().version())}</Text>
|
||||
</View>
|
||||
</View>,
|
||||
);
|
||||
|
||||
settingComps.push(
|
||||
<View key="version_info_fts" style={this.styles().settingContainer}>
|
||||
<Text style={this.styles().settingText}>{_('FTS enabled: %d', this.props.settings['db.ftsEnabled'])}</Text>
|
||||
</View>
|
||||
</View>,
|
||||
);
|
||||
|
||||
settingComps.push(
|
||||
<View key="version_info_hermes" style={this.styles().settingContainer}>
|
||||
<Text style={this.styles().settingText}>{_('Hermes enabled: %d', (global as any).HermesInternal ? 1 : 0)}</Text>
|
||||
</View>
|
||||
</View>,
|
||||
);
|
||||
|
||||
return (
|
||||
|
@ -40,7 +40,7 @@ describe('NoteExportButton', () => {
|
||||
await act(() => fireEvent.press(exportButton));
|
||||
|
||||
await waitFor(() =>
|
||||
expect(view.queryByText(_('Exported successfully!'))).not.toBeNull()
|
||||
expect(view.queryByText(_('Exported successfully!'))).not.toBeNull(),
|
||||
);
|
||||
|
||||
// With the default folder setup, there should be no warnings
|
||||
|
@ -565,7 +565,7 @@ class NoteScreenComponent extends BaseScreenComponent {
|
||||
},
|
||||
(error: any) => {
|
||||
reject(error);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -756,7 +756,7 @@ class NoteScreenComponent extends BaseScreenComponent {
|
||||
uri: data.uri,
|
||||
type: 'image/jpg',
|
||||
},
|
||||
'image'
|
||||
'image',
|
||||
);
|
||||
|
||||
this.setState({ showCamera: false });
|
||||
|
@ -262,7 +262,7 @@ const EncryptionConfigScreen = (props: Props) => {
|
||||
rows.push(
|
||||
<Text style={styles.normalText} key={id}>
|
||||
{id}
|
||||
</Text>
|
||||
</Text>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ const SideMenuContentComponent = (props: Props) => {
|
||||
toValue: 1,
|
||||
duration: 3000,
|
||||
easing: Easing.linear,
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
syncIconAnimation.start();
|
||||
@ -156,7 +156,7 @@ const SideMenuContentComponent = (props: Props) => {
|
||||
|
||||
if (folder.id === props.inboxJopId) {
|
||||
return folderDeletion(
|
||||
_('Delete the Inbox notebook?\n\nIf you delete the inbox notebook, any email that\'s recently been sent to it may be lost.')
|
||||
_('Delete the Inbox notebook?\n\nIf you delete the inbox notebook, any email that\'s recently been sent to it may be lost.'),
|
||||
);
|
||||
}
|
||||
return folderDeletion(_('Delete notebook "%s"?\n\nAll notes and sub-notebooks within this notebook will also be deleted.', folder.title));
|
||||
@ -191,7 +191,7 @@ const SideMenuContentComponent = (props: Props) => {
|
||||
],
|
||||
{
|
||||
cancelable: false,
|
||||
}
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
@ -456,7 +456,7 @@ const SideMenuContentComponent = (props: Props) => {
|
||||
items.push(
|
||||
<Text key="sync_report" style={styles_.syncStatus}>
|
||||
{fullReport.join('\n')}
|
||||
</Text>
|
||||
</Text>,
|
||||
);
|
||||
}
|
||||
|
||||
@ -464,7 +464,7 @@ const SideMenuContentComponent = (props: Props) => {
|
||||
items.push(
|
||||
<Text key="net_info" style={styles_.syncStatus}>
|
||||
{ _('Mobile data - auto-sync disabled') }
|
||||
</Text>
|
||||
</Text>,
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -22,5 +22,5 @@ utils.registerGulpTasks(gulp, tasks);
|
||||
gulp.task('build', gulp.series(
|
||||
'buildInjectedJs',
|
||||
'encodeAssets',
|
||||
'podInstall'
|
||||
'podInstall',
|
||||
));
|
||||
|
@ -72,7 +72,7 @@ module.exports = {
|
||||
}
|
||||
return path.join(process.cwd(), `node_modules/${name}`);
|
||||
},
|
||||
}
|
||||
},
|
||||
),
|
||||
},
|
||||
projectRoot: path.resolve(__dirname),
|
||||
|
@ -881,7 +881,7 @@ class AppComponent extends React.Component {
|
||||
this.unsubscribeScreenWidthChangeHandler_ = Dimensions.addEventListener('change', this.handleScreenWidthChange_);
|
||||
|
||||
this.themeChangeListener_ = Appearance.addChangeListener(
|
||||
({ colorScheme }) => onSystemColorSchemeChange(colorScheme)
|
||||
({ colorScheme }) => onSystemColorSchemeChange(colorScheme),
|
||||
);
|
||||
onSystemColorSchemeChange(Appearance.getColorScheme());
|
||||
|
||||
|
@ -36,7 +36,7 @@ class BundledFile {
|
||||
|
||||
public constructor(
|
||||
public readonly bundleName: string,
|
||||
private readonly sourceFilePath: string
|
||||
private readonly sourceFilePath: string,
|
||||
) {
|
||||
this.rootFileDirectory = dirname(sourceFilePath);
|
||||
this.bundleBaseName = basename(sourceFilePath, extname(sourceFilePath));
|
||||
@ -200,7 +200,7 @@ class BundledFile {
|
||||
const bundledFiles: BundledFile[] = [
|
||||
new BundledFile(
|
||||
'codeMirrorBundle',
|
||||
`${mobileDir}/components/NoteEditor/CodeMirror/CodeMirror.ts`
|
||||
`${mobileDir}/components/NoteEditor/CodeMirror/CodeMirror.ts`,
|
||||
),
|
||||
];
|
||||
|
||||
|
@ -25,7 +25,7 @@ const autodetectTheme = () => {
|
||||
const colorScheme = systemColorScheme;
|
||||
logger.debug(
|
||||
'Autodetecting theme. getColorScheme returns', Appearance.getColorScheme(),
|
||||
'and the expected theme is', systemColorScheme
|
||||
'and the expected theme is', systemColorScheme,
|
||||
);
|
||||
|
||||
if (colorScheme === 'dark') {
|
||||
|
@ -16,7 +16,7 @@ class DatabaseDriverReactNative {
|
||||
},
|
||||
error => {
|
||||
reject(error);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -35,7 +35,7 @@ class DatabaseDriverReactNative {
|
||||
},
|
||||
error => {
|
||||
reject(error);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
@ -66,7 +66,7 @@ class DatabaseDriverReactNative {
|
||||
},
|
||||
error => {
|
||||
reject(error);
|
||||
}
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ class GeolocationReact {
|
||||
error => {
|
||||
reject(error);
|
||||
},
|
||||
options
|
||||
options,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
@ -150,7 +150,7 @@ module.exports = class extends Generator {
|
||||
const newContent = mergePackageKey(null, sourceContent, destContent);
|
||||
return JSON.stringify(newContent, null, 2);
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
} else if (this.options.update && destFile === 'plugin.config.json' && this.fs.exists(destFilePath)) {
|
||||
// Keep existing content for now. Maybe later we could merge the configs.
|
||||
@ -163,20 +163,20 @@ module.exports = class extends Generator {
|
||||
process: (sourceBuffer) => {
|
||||
return mergeIgnoreFile(sourceBuffer.toString(), destContent);
|
||||
},
|
||||
}
|
||||
},
|
||||
);
|
||||
} else {
|
||||
this.fs.copyTpl(
|
||||
this.templatePath(file),
|
||||
destFilePath,
|
||||
this.props
|
||||
this.props,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this.fs.copy(
|
||||
this.templatePath('api'),
|
||||
this.destinationPath('api')
|
||||
this.destinationPath('api'),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ function createPluginArchive(sourceDir, destPath) {
|
||||
cwd: sourceDir,
|
||||
sync: true,
|
||||
},
|
||||
distFiles
|
||||
distFiles,
|
||||
);
|
||||
|
||||
console.info(chalk.cyan(`Plugin archive has been created in ${destPath}`));
|
||||
|
@ -43,7 +43,7 @@ export default class EventDispatcher<EventKeyType extends string|symbol|number,
|
||||
// This allows any iterators over this.listeners to continue iterating
|
||||
// without skipping elements.
|
||||
this.listeners[eventName] = this.listeners[eventName].filter(
|
||||
otherCallback => otherCallback !== callback
|
||||
otherCallback => otherCallback !== callback,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -547,7 +547,7 @@ export default class JoplinDatabase extends Database {
|
||||
encryption_cipher_text: 'TEXT NOT NULL DEFAULT ""',
|
||||
encryption_applied: 'INT NOT NULL DEFAULT 0',
|
||||
encryption_blob_encrypted: 'INT NOT NULL DEFAULT 0',
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@ -761,7 +761,7 @@ export default class JoplinDatabase extends Database {
|
||||
encryption_applied: 'INT NOT NULL DEFAULT 0',
|
||||
markup_language: 'INT NOT NULL DEFAULT 1',
|
||||
is_shared: 'INT NOT NULL DEFAULT 0',
|
||||
})
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -537,7 +537,7 @@ export default class Synchronizer {
|
||||
(fnName, ...args) => {
|
||||
return this.apiCall(fnName, ...args);
|
||||
},
|
||||
action => { return this.dispatch(action); }
|
||||
action => { return this.dispatch(action); },
|
||||
);
|
||||
} // DELETE_REMOTE STEP
|
||||
|
||||
@ -768,7 +768,7 @@ export default class Synchronizer {
|
||||
local,
|
||||
syncTargetId,
|
||||
itemIsReadOnly,
|
||||
(action: any) => this.dispatch(action)
|
||||
(action: any) => this.dispatch(action),
|
||||
);
|
||||
|
||||
completeItemProcessing(path);
|
||||
|
@ -198,7 +198,7 @@ shared.settingsSections = createSelector(
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
shared.settingsToComponents2 = function(comp, device, settings, selectedSectionName = '') {
|
||||
|
@ -138,7 +138,7 @@ class FileApiDriverDropbox {
|
||||
{
|
||||
'Dropbox-API-Arg': JSON.stringify({ path: this.makePath_(path) }),
|
||||
},
|
||||
options
|
||||
options,
|
||||
);
|
||||
return response;
|
||||
} catch (error) {
|
||||
@ -182,7 +182,7 @@ class FileApiDriverDropbox {
|
||||
mute: true, // Don't send a notification to user since there can be many of these updates
|
||||
}),
|
||||
},
|
||||
options
|
||||
options,
|
||||
);
|
||||
} catch (error) {
|
||||
if (this.hasErrorCode_(error, 'restricted_content')) {
|
||||
|
@ -4,7 +4,7 @@ const { useEffect, useRef } = shim.react();
|
||||
function useEventListener(
|
||||
eventName: any,
|
||||
handler: any,
|
||||
element?: any
|
||||
element?: any,
|
||||
) {
|
||||
// Create a ref that stores handler
|
||||
const savedHandler = useRef<any>();
|
||||
|
@ -56,7 +56,7 @@ markJsUtils.markKeyword = (mark, keyword, stringUtils, extraOptions = null) => {
|
||||
return true;
|
||||
},
|
||||
...extraOptions,
|
||||
}
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -626,7 +626,7 @@ export default class BaseItem extends BaseModel {
|
||||
`,
|
||||
this.db().escapeField(ItemClass.tableName()),
|
||||
whereSql.join(' AND '),
|
||||
limit
|
||||
limit,
|
||||
);
|
||||
|
||||
const items = await ItemClass.modelSelectAll(sql);
|
||||
@ -689,7 +689,7 @@ export default class BaseItem extends BaseModel {
|
||||
this.db().escapeField(ItemClass.tableName()),
|
||||
Number(syncTarget),
|
||||
extraWhere,
|
||||
limit
|
||||
limit,
|
||||
);
|
||||
|
||||
const neverSyncedItem = await ItemClass.modelSelectAll(sql);
|
||||
@ -718,7 +718,7 @@ export default class BaseItem extends BaseModel {
|
||||
this.db().escapeField(ItemClass.tableName()),
|
||||
Number(syncTarget),
|
||||
extraWhere,
|
||||
newLimit
|
||||
newLimit,
|
||||
);
|
||||
|
||||
changedItems = await ItemClass.modelSelectAll(sql);
|
||||
@ -855,7 +855,7 @@ export default class BaseItem extends BaseModel {
|
||||
SELECT id
|
||||
FROM %s
|
||||
WHERE encryption_applied = 0`,
|
||||
this.db().escapeField(ItemClass.tableName())
|
||||
this.db().escapeField(ItemClass.tableName()),
|
||||
);
|
||||
|
||||
const items = await ItemClass.modelSelectAll(sql);
|
||||
@ -918,7 +918,7 @@ export default class BaseItem extends BaseModel {
|
||||
this.getClass('Folder'),
|
||||
options.changeSource,
|
||||
BaseItem.syncShareCache,
|
||||
o.parent_id
|
||||
o.parent_id,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ export default class NoteResource extends BaseModel {
|
||||
|
||||
queries.push({
|
||||
sql: 'INSERT INTO note_resources (note_id, resource_id, is_associated, last_seen_time) VALUES (?, ?, ?, ?)',
|
||||
params: ['', id, 0, lastSeenTime] }
|
||||
params: ['', id, 0, lastSeenTime] },
|
||||
);
|
||||
}
|
||||
await this.db().transactionExecBatch(queries);
|
||||
@ -141,7 +141,7 @@ export default class NoteResource extends BaseModel {
|
||||
AND last_seen_time < ?
|
||||
AND last_seen_time != 0
|
||||
`,
|
||||
[cutOffTime]
|
||||
[cutOffTime],
|
||||
);
|
||||
return output.map((r: any) => r.resource_id);
|
||||
}
|
||||
|
@ -1312,7 +1312,7 @@ class Setting extends BaseModel {
|
||||
onClick: () => {
|
||||
shim.openOrCreateFile(
|
||||
this.customCssFilePath(Setting.customCssFilenames.RENDERED_MARKDOWN),
|
||||
'/* For styling the rendered Markdown */'
|
||||
'/* For styling the rendered Markdown */',
|
||||
);
|
||||
},
|
||||
type: SettingItemType.Button,
|
||||
@ -1329,7 +1329,7 @@ class Setting extends BaseModel {
|
||||
onClick: () => {
|
||||
shim.openOrCreateFile(
|
||||
this.customCssFilePath(Setting.customCssFilenames.JOPLIN_APP),
|
||||
`/* For styling the entire Joplin app (except the rendered Markdown, which is defined in \`${Setting.customCssFilenames.RENDERED_MARKDOWN}\`) */`
|
||||
`/* For styling the entire Joplin app (except the rendered Markdown, which is defined in \`${Setting.customCssFilenames.RENDERED_MARKDOWN}\`) */`,
|
||||
);
|
||||
},
|
||||
type: SettingItemType.Button,
|
||||
|
@ -32,7 +32,7 @@ export default class Tag extends BaseItem {
|
||||
|
||||
return Note.previews(
|
||||
null,
|
||||
{ ...options, conditions: [`id IN ("${noteIds.join('","')}")`] }
|
||||
{ ...options, conditions: [`id IN ("${noteIds.join('","')}")`] },
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -211,12 +211,12 @@ const createShallowArrayEqualSelector = createSelectorCreator(
|
||||
if (prev[i] !== next[i]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
const selectArrayShallow = createCachedSelector(
|
||||
(state: any) => state.array,
|
||||
(array: any[]) => array
|
||||
(array: any[]) => array,
|
||||
)({
|
||||
keySelector: (_state: any, cacheKey: any) => {
|
||||
return cacheKey;
|
||||
|
@ -350,7 +350,7 @@ export default class KeymapService extends BaseService {
|
||||
'Accelerator "%s" is used for "%s" and "%s" commands. This may lead to unexpected behaviour.',
|
||||
itemAccelerator,
|
||||
originalItem.command,
|
||||
itemCommand
|
||||
itemCommand,
|
||||
));
|
||||
} else if (itemAccelerator) {
|
||||
usedAccelerators.add(itemAccelerator);
|
||||
|
@ -44,7 +44,7 @@ export default class ResourceService extends BaseService {
|
||||
AND id > ?
|
||||
ORDER BY id ASC
|
||||
LIMIT 10
|
||||
`, [BaseModel.TYPE_NOTE, Setting.value('resourceService.lastProcessedChangeId')]
|
||||
`, [BaseModel.TYPE_NOTE, Setting.value('resourceService.lastProcessedChangeId')],
|
||||
);
|
||||
|
||||
if (!changes.length) break;
|
||||
|
@ -126,7 +126,7 @@ export default class RevisionService extends BaseService {
|
||||
ORDER BY id ASC
|
||||
LIMIT 10
|
||||
`,
|
||||
[BaseModel.TYPE_NOTE, ItemChange.SOURCE_SYNC, ItemChange.SOURCE_DECRYPTION, Setting.value('revisionService.lastProcessedChangeId')]
|
||||
[BaseModel.TYPE_NOTE, ItemChange.SOURCE_SYNC, ItemChange.SOURCE_DECRYPTION, Setting.value('revisionService.lastProcessedChangeId')],
|
||||
);
|
||||
|
||||
if (!changes.length) break;
|
||||
|
@ -42,14 +42,14 @@ const createShallowObjectEqualSelector = createSelectorCreator(
|
||||
if (prev[n] !== next[n]) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
// This selector ensures that for the given command names, the same toolbar
|
||||
// button array is returned if the underlying toolbar buttons have not changed.
|
||||
const selectObjectByCommands = createCachedSelector(
|
||||
(state: any) => state.array,
|
||||
(array: any[]) => array
|
||||
(array: any[]) => array,
|
||||
)({
|
||||
keySelector: (_state: any, commandNames: string[]) => {
|
||||
return commandNames.join('_');
|
||||
|
@ -13,7 +13,7 @@ describe('Module', () => {
|
||||
|
||||
const importModuleMultiSource = makeImportModule(
|
||||
baseMetadata,
|
||||
() => new InteropService_Importer_Base()
|
||||
() => new InteropService_Importer_Base(),
|
||||
);
|
||||
|
||||
const importModuleSingleSource = makeImportModule({
|
||||
|
@ -63,7 +63,7 @@ const moduleFullLabel = (metadata: ImportMetadata|ExportMetadata, moduleSource:
|
||||
};
|
||||
|
||||
export const makeImportModule = (
|
||||
metadata: Partial<ImportMetadata>, factory: ()=> InteropService_Importer_Base
|
||||
metadata: Partial<ImportMetadata>, factory: ()=> InteropService_Importer_Base,
|
||||
): ImportModule => {
|
||||
const importerDefaults: ImportMetadata = {
|
||||
...defaultBaseMetadata,
|
||||
@ -93,7 +93,7 @@ export const makeImportModule = (
|
||||
};
|
||||
|
||||
export const makeExportModule = (
|
||||
metadata: Partial<ExportMetadata>, factory: ()=> InteropService_Exporter_Base
|
||||
metadata: Partial<ExportMetadata>, factory: ()=> InteropService_Exporter_Base,
|
||||
): ExportModule => {
|
||||
const exporterDefaults: ExportMetadata = {
|
||||
...defaultBaseMetadata,
|
||||
|
@ -140,7 +140,7 @@ export default class JoplinSettings {
|
||||
this.plugin_.deprecationNotice(
|
||||
'1.8',
|
||||
'joplin.settings.registerSetting() is deprecated in favour of joplin.settings.registerSettings()',
|
||||
!registerSettingAllowedPluginIds.includes(this.plugin_.id)
|
||||
!registerSettingAllowedPluginIds.includes(this.plugin_.id),
|
||||
);
|
||||
|
||||
await this.registerSettings({ [key]: settingItem });
|
||||
|
@ -109,7 +109,7 @@ export default class SearchEngine {
|
||||
queries.push({ sql: `
|
||||
INSERT INTO notes_normalized(${SearchEngine.relevantFields})
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
params: [n.id, n.title, n.body, n.user_created_time, n.user_updated_time, n.is_todo, n.todo_completed, n.todo_due, n.parent_id, n.latitude, n.longitude, n.altitude, n.source_url] }
|
||||
params: [n.id, n.title, n.body, n.user_created_time, n.user_updated_time, n.is_todo, n.todo_completed, n.todo_due, n.parent_id, n.latitude, n.longitude, n.altitude, n.source_url] },
|
||||
);
|
||||
}
|
||||
|
||||
@ -174,7 +174,7 @@ export default class SearchEngine {
|
||||
ORDER BY id ASC
|
||||
LIMIT 10
|
||||
`,
|
||||
[BaseModel.TYPE_NOTE, lastChangeId]
|
||||
[BaseModel.TYPE_NOTE, lastChangeId],
|
||||
);
|
||||
|
||||
if (!changes.length) break;
|
||||
@ -184,7 +184,7 @@ export default class SearchEngine {
|
||||
const noteIds = changes.map(a => a.item_id);
|
||||
const notes = await Note.modelSelectAll(`
|
||||
SELECT ${SearchEngine.relevantFields}
|
||||
FROM notes WHERE id IN ("${noteIds.join('","')}") AND is_conflict = 0 AND encryption_applied = 0`
|
||||
FROM notes WHERE id IN ("${noteIds.join('","')}") AND is_conflict = 0 AND encryption_applied = 0`,
|
||||
);
|
||||
|
||||
for (let i = 0; i < changes.length; i++) {
|
||||
|
@ -91,7 +91,7 @@ const filterByTableName = (
|
||||
requirement: Requirement,
|
||||
withs: string[],
|
||||
tableName: string,
|
||||
useFts: boolean
|
||||
useFts: boolean,
|
||||
) => {
|
||||
const operator: Operation = getOperator(requirement, relation);
|
||||
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user