mirror of
https://github.com/dbeaver/cloudbeaver.git
synced 2026-09-24 16:04:36 +08:00
feat(plugin-info): CB-1450 change plugin name
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@cloudbeaver/plugin-info",
|
||||
"name": "@cloudbeaver/plugin-help",
|
||||
"sideEffects": false,
|
||||
"version": "0.1.0",
|
||||
"description": "",
|
||||
+1
-7
@@ -8,13 +8,7 @@
|
||||
|
||||
import type { TLocalizationToken } from '@cloudbeaver/core-localization';
|
||||
|
||||
export interface IShortcutBody {
|
||||
code: string;
|
||||
and?: IShortcutBody;
|
||||
or?: IShortcutBody;
|
||||
}
|
||||
|
||||
export interface IShortcut {
|
||||
label: TLocalizationToken;
|
||||
body: IShortcutBody;
|
||||
code: string[];
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2022 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import type { IShortcut } from './IShortcut';
|
||||
|
||||
export const DATA_VIEWER_SHORTCUTS: IShortcut[] = [
|
||||
{
|
||||
label: 'data_viewer_shortcut_start_inline_editing',
|
||||
code: ['Enter', 'Backspace'],
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_add_new_row',
|
||||
code: ['Alt + Insert'],
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_duplicate_row',
|
||||
code: ['Ctrl + Alt + Insert'],
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_delete_row',
|
||||
code: ['Delete'],
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_revert_inline_editor_changes',
|
||||
code: ['Escape'],
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_past_value',
|
||||
code: ['Ctrl + V'],
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_copy_value',
|
||||
code: ['Ctrl + C'],
|
||||
},
|
||||
];
|
||||
|
||||
export const SQL_EDITOR_SHORTCUTS: IShortcut[] = [
|
||||
{
|
||||
label: 'sql_editor_shortcut_execute_statement',
|
||||
code: ['Ctrl + Enter'],
|
||||
},
|
||||
{
|
||||
label: 'sql_editor_shortcut_execute_statement_new_tab',
|
||||
code: ['Ctrl + \\', 'Ctrl + Shift + Enter'],
|
||||
},
|
||||
{
|
||||
label: 'sql_editor_shortcut_execute_script',
|
||||
code: ['Alt + X'],
|
||||
},
|
||||
{
|
||||
label: 'sql_editor_shortcut_show_execution_plan',
|
||||
code: ['Shift + Ctrl + E'],
|
||||
},
|
||||
{
|
||||
label: 'sql_editor_shortcut_open_editor_in_new_tab',
|
||||
code: ['Alt + T'],
|
||||
},
|
||||
];
|
||||
+31
-23
@@ -11,10 +11,10 @@ import styled, { css } from 'reshadow';
|
||||
import { useTranslate } from '@cloudbeaver/core-localization';
|
||||
import { composes, useStyles } from '@cloudbeaver/core-theming';
|
||||
|
||||
import type { IShortcutBody } from './IShortcut';
|
||||
import type { IShortcut } from './IShortcut';
|
||||
|
||||
interface Props {
|
||||
body: IShortcutBody;
|
||||
shortcut: IShortcut;
|
||||
}
|
||||
|
||||
const style = composes(
|
||||
@@ -24,7 +24,15 @@ const style = composes(
|
||||
}
|
||||
`,
|
||||
css`
|
||||
shortcut-body {
|
||||
shortcut-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
shortcut-label {
|
||||
margin-right: 8px;
|
||||
}
|
||||
shortcut-content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
@@ -43,27 +51,27 @@ const style = composes(
|
||||
}
|
||||
`);
|
||||
|
||||
export const ShortcutBody: React.FC<Props> = function ShortcutBody({ body }) {
|
||||
export const Shortcut: React.FC<Props> = function Shortcut({ shortcut }) {
|
||||
const translate = useTranslate();
|
||||
const styles = useStyles(style);
|
||||
|
||||
return styled(styles)(
|
||||
<shortcut-body>
|
||||
<shortcut-code>
|
||||
{body.code}
|
||||
</shortcut-code>
|
||||
{body.and && (
|
||||
<>
|
||||
<span>+</span>
|
||||
<ShortcutBody body={body.and} />
|
||||
</>
|
||||
)}
|
||||
{body.or && (
|
||||
<>
|
||||
<span>{translate('ui_or')}</span>
|
||||
<ShortcutBody body={body.or} />
|
||||
</>
|
||||
)}
|
||||
</shortcut-body>
|
||||
return styled(useStyles(style))(
|
||||
<shortcut-container>
|
||||
<shortcut-label>
|
||||
{translate(shortcut.label)}
|
||||
</shortcut-label>
|
||||
<shortcut-content>
|
||||
{shortcut.code.map((code, index, array) => {
|
||||
const next = !!array[index + 1];
|
||||
return (
|
||||
<>
|
||||
<shortcut-code>
|
||||
{code}
|
||||
</shortcut-code>
|
||||
{next && <span>{translate('ui_or')}</span>}
|
||||
</>
|
||||
);
|
||||
})}
|
||||
</shortcut-content>
|
||||
</shortcut-container>
|
||||
);
|
||||
};
|
||||
+1
-1
@@ -13,7 +13,7 @@ import { PluginBootstrap } from './PluginBootstrap';
|
||||
|
||||
export const manifest: PluginManifest = {
|
||||
info: {
|
||||
name: 'Info plugin',
|
||||
name: 'Help plugin',
|
||||
},
|
||||
|
||||
providers: [
|
||||
@@ -1,132 +0,0 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2022 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import type { IShortcut } from './IShortcut';
|
||||
|
||||
export const DATA_VIEWER_SHORTCUTS: IShortcut[] = [
|
||||
{
|
||||
label: 'data_viewer_shortcut_start_inline_editing',
|
||||
body: {
|
||||
code: 'Enter',
|
||||
or: {
|
||||
code: 'Backspace',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_add_new_row',
|
||||
body: {
|
||||
code: 'Alt',
|
||||
and: {
|
||||
code: 'Insert',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_duplicate_row',
|
||||
body: {
|
||||
code: 'Ctrl',
|
||||
and: {
|
||||
code: 'Alt',
|
||||
and: {
|
||||
code: 'Insert',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_delete_row',
|
||||
body: {
|
||||
code: 'Delete',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_revert_inline_editor_changes',
|
||||
body: {
|
||||
code: 'Escape',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_past_value',
|
||||
body: {
|
||||
code: 'Ctrl',
|
||||
and: {
|
||||
code: 'V',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'data_viewer_shortcut_copy_value',
|
||||
body: {
|
||||
code: 'Ctrl',
|
||||
and: {
|
||||
code: 'C',
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export const SQL_EDITOR_SHORTCUTS: IShortcut[] = [
|
||||
{
|
||||
label: 'sql_editor_shortcut_execute_statement',
|
||||
body: {
|
||||
code: 'Ctrl',
|
||||
and: {
|
||||
code: 'Enter',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'sql_editor_shortcut_execute_statement_new_tab',
|
||||
body: {
|
||||
code: 'Ctrl',
|
||||
and: {
|
||||
code: '\\',
|
||||
},
|
||||
or: {
|
||||
code: 'Ctrl',
|
||||
and: {
|
||||
code: 'Shift',
|
||||
and: {
|
||||
code: 'Enter',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'sql_editor_shortcut_execute_script',
|
||||
body: {
|
||||
code: 'Alt',
|
||||
and: {
|
||||
code: 'X',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'sql_editor_shortcut_show_execution_plan',
|
||||
body: {
|
||||
code: 'Shift',
|
||||
and: {
|
||||
code: 'Ctrl',
|
||||
and: {
|
||||
code: 'E',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'sql_editor_shortcut_open_editor_in_new_tab',
|
||||
body: {
|
||||
code: 'Alt',
|
||||
and: {
|
||||
code: 'T',
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -1,42 +0,0 @@
|
||||
/*
|
||||
* CloudBeaver - Cloud Database Manager
|
||||
* Copyright (C) 2020-2022 DBeaver Corp and others
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0.
|
||||
* you may not use this file except in compliance with the License.
|
||||
*/
|
||||
|
||||
import styled, { css } from 'reshadow';
|
||||
|
||||
import { useTranslate } from '@cloudbeaver/core-localization';
|
||||
|
||||
import type { IShortcut } from './IShortcut';
|
||||
import { ShortcutBody } from './ShortcutBody';
|
||||
|
||||
interface Props {
|
||||
shortcut: IShortcut;
|
||||
}
|
||||
|
||||
const style = css`
|
||||
shortcut-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
shortcut-label {
|
||||
margin-right: 8px;
|
||||
}
|
||||
`;
|
||||
|
||||
export const Shortcut: React.FC<Props> = function Shortcut({ shortcut }) {
|
||||
const translate = useTranslate();
|
||||
|
||||
return styled(style)(
|
||||
<shortcut-container>
|
||||
<shortcut-label>
|
||||
{translate(shortcut.label)}
|
||||
</shortcut-label>
|
||||
<ShortcutBody body={shortcut.body} />
|
||||
</shortcut-container>
|
||||
);
|
||||
};
|
||||
@@ -14,7 +14,7 @@ import spreadsheetNew from '@cloudbeaver/plugin-data-spreadsheet-new';
|
||||
import dataViewer from '@cloudbeaver/plugin-data-viewer';
|
||||
import ddlViewer from '@cloudbeaver/plugin-ddl-viewer';
|
||||
import gisViewer from '@cloudbeaver/plugin-gis-viewer';
|
||||
import info from '@cloudbeaver/plugin-info';
|
||||
import help from '@cloudbeaver/plugin-help';
|
||||
import localization from '@cloudbeaver/plugin-localization';
|
||||
import objectViewer from '@cloudbeaver/plugin-object-viewer';
|
||||
import productPlugin from '@cloudbeaver/plugin-product';
|
||||
@@ -56,7 +56,7 @@ const PLUGINS: PluginManifest[] = [
|
||||
productPlugin,
|
||||
settingsMenu,
|
||||
settingsMenuAdministration,
|
||||
info,
|
||||
help,
|
||||
];
|
||||
|
||||
bootstrap(PLUGINS);
|
||||
|
||||
Reference in New Issue
Block a user