M: Revert to default selection behavior and fix minor issues
This commit is contained in:
parent
6c13a9e774
commit
ff744b5367
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -151,6 +151,7 @@
|
||||||
"rsconcept",
|
"rsconcept",
|
||||||
"rsedit",
|
"rsedit",
|
||||||
"rseditor",
|
"rseditor",
|
||||||
|
"rsexpression",
|
||||||
"rsform",
|
"rsform",
|
||||||
"rsforms",
|
"rsforms",
|
||||||
"rsgraph",
|
"rsgraph",
|
||||||
|
|
|
@ -13,18 +13,18 @@ import { ToggleNavigation } from './toggle-navigation';
|
||||||
import { UserMenu } from './user-menu';
|
import { UserMenu } from './user-menu';
|
||||||
|
|
||||||
export function Navigation() {
|
export function Navigation() {
|
||||||
const router = useConceptNavigation();
|
const { push } = useConceptNavigation();
|
||||||
const size = useWindowSize();
|
const size = useWindowSize();
|
||||||
const noNavigationAnimation = useAppLayoutStore(state => state.noNavigationAnimation);
|
const noNavigationAnimation = useAppLayoutStore(state => state.noNavigationAnimation);
|
||||||
|
|
||||||
const navigateHome = (event: React.MouseEvent<Element>) =>
|
const navigateHome = (event: React.MouseEvent<Element>) =>
|
||||||
router.push({ path: urls.home, newTab: event.ctrlKey || event.metaKey });
|
push({ path: urls.home, newTab: event.ctrlKey || event.metaKey });
|
||||||
const navigateLibrary = (event: React.MouseEvent<Element>) =>
|
const navigateLibrary = (event: React.MouseEvent<Element>) =>
|
||||||
router.push({ path: urls.library, newTab: event.ctrlKey || event.metaKey });
|
push({ path: urls.library, newTab: event.ctrlKey || event.metaKey });
|
||||||
const navigateHelp = (event: React.MouseEvent<Element>) =>
|
const navigateHelp = (event: React.MouseEvent<Element>) =>
|
||||||
router.push({ path: urls.manuals, newTab: event.ctrlKey || event.metaKey });
|
push({ path: urls.manuals, newTab: event.ctrlKey || event.metaKey });
|
||||||
const navigateCreateNew = (event: React.MouseEvent<Element>) =>
|
const navigateCreateNew = (event: React.MouseEvent<Element>) =>
|
||||||
router.push({ path: urls.create_schema, newTab: event.ctrlKey || event.metaKey });
|
push({ path: urls.create_schema, newTab: event.ctrlKey || event.metaKey });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<nav className='z-navigation sticky top-0 left-0 right-0 select-none bg-prim-100'>
|
<nav className='z-navigation sticky top-0 left-0 right-0 select-none bg-prim-100'>
|
||||||
|
|
|
@ -29,34 +29,6 @@ import { refsNavigation } from './click-navigation';
|
||||||
import { NaturalLanguage, ReferenceTokens } from './parse';
|
import { NaturalLanguage, ReferenceTokens } from './parse';
|
||||||
import { refsHoverTooltip } from './tooltip';
|
import { refsHoverTooltip } from './tooltip';
|
||||||
|
|
||||||
const editorSetup: BasicSetupOptions = {
|
|
||||||
highlightSpecialChars: false,
|
|
||||||
history: true,
|
|
||||||
drawSelection: true,
|
|
||||||
syntaxHighlighting: false,
|
|
||||||
defaultKeymap: true,
|
|
||||||
historyKeymap: true,
|
|
||||||
|
|
||||||
lineNumbers: false,
|
|
||||||
highlightActiveLineGutter: false,
|
|
||||||
foldGutter: false,
|
|
||||||
dropCursor: true,
|
|
||||||
allowMultipleSelections: false,
|
|
||||||
indentOnInput: false,
|
|
||||||
bracketMatching: false,
|
|
||||||
closeBrackets: false,
|
|
||||||
autocompletion: false,
|
|
||||||
rectangularSelection: false,
|
|
||||||
crosshairCursor: false,
|
|
||||||
highlightActiveLine: false,
|
|
||||||
highlightSelectionMatches: false,
|
|
||||||
closeBracketsKeymap: false,
|
|
||||||
searchKeymap: false,
|
|
||||||
foldKeymap: false,
|
|
||||||
completionKeymap: false,
|
|
||||||
lintKeymap: false
|
|
||||||
};
|
|
||||||
|
|
||||||
interface RefsInputInputProps
|
interface RefsInputInputProps
|
||||||
extends Pick<
|
extends Pick<
|
||||||
ReactCodeMirrorProps,
|
ReactCodeMirrorProps,
|
||||||
|
@ -117,7 +89,6 @@ export const RefsInput = forwardRef<ReactCodeMirrorRef, RefsInputInputProps>(
|
||||||
fontFamily: 'inherit',
|
fontFamily: 'inherit',
|
||||||
background: !disabled ? APP_COLORS.bgInput : APP_COLORS.bgDefault,
|
background: !disabled ? APP_COLORS.bgInput : APP_COLORS.bgDefault,
|
||||||
foreground: APP_COLORS.fgDefault,
|
foreground: APP_COLORS.fgDefault,
|
||||||
selection: APP_COLORS.bgHover,
|
|
||||||
caret: APP_COLORS.fgDefault
|
caret: APP_COLORS.fgDefault
|
||||||
},
|
},
|
||||||
styles: [
|
styles: [
|
||||||
|
@ -225,3 +196,32 @@ export const RefsInput = forwardRef<ReactCodeMirrorRef, RefsInputInputProps>(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// ======= Internal ==========
|
||||||
|
const editorSetup: BasicSetupOptions = {
|
||||||
|
highlightSpecialChars: false,
|
||||||
|
history: true,
|
||||||
|
drawSelection: false,
|
||||||
|
syntaxHighlighting: false,
|
||||||
|
defaultKeymap: true,
|
||||||
|
historyKeymap: true,
|
||||||
|
|
||||||
|
lineNumbers: false,
|
||||||
|
highlightActiveLineGutter: false,
|
||||||
|
foldGutter: false,
|
||||||
|
dropCursor: true,
|
||||||
|
allowMultipleSelections: false,
|
||||||
|
indentOnInput: false,
|
||||||
|
bracketMatching: false,
|
||||||
|
closeBrackets: false,
|
||||||
|
autocompletion: false,
|
||||||
|
rectangularSelection: false,
|
||||||
|
crosshairCursor: false,
|
||||||
|
highlightActiveLine: false,
|
||||||
|
highlightSelectionMatches: false,
|
||||||
|
closeBracketsKeymap: false,
|
||||||
|
searchKeymap: false,
|
||||||
|
foldKeymap: false,
|
||||||
|
completionKeymap: false,
|
||||||
|
lintKeymap: false
|
||||||
|
};
|
||||||
|
|
|
@ -81,7 +81,6 @@ export const RSInput = forwardRef<ReactCodeMirrorRef, RSInputProps>(
|
||||||
fontFamily: 'inherit',
|
fontFamily: 'inherit',
|
||||||
background: !disabled ? APP_COLORS.bgInput : APP_COLORS.bgDefault,
|
background: !disabled ? APP_COLORS.bgInput : APP_COLORS.bgDefault,
|
||||||
foreground: APP_COLORS.fgDefault,
|
foreground: APP_COLORS.fgDefault,
|
||||||
selection: APP_COLORS.bgHover,
|
|
||||||
caret: APP_COLORS.fgDefault
|
caret: APP_COLORS.fgDefault
|
||||||
},
|
},
|
||||||
styles: [
|
styles: [
|
||||||
|
@ -184,7 +183,7 @@ export const RSInput = forwardRef<ReactCodeMirrorRef, RSInputProps>(
|
||||||
const editorSetup: BasicSetupOptions = {
|
const editorSetup: BasicSetupOptions = {
|
||||||
highlightSpecialChars: false,
|
highlightSpecialChars: false,
|
||||||
history: true,
|
history: true,
|
||||||
drawSelection: true,
|
drawSelection: false,
|
||||||
syntaxHighlighting: false,
|
syntaxHighlighting: false,
|
||||||
defaultKeymap: true,
|
defaultKeymap: true,
|
||||||
historyKeymap: true,
|
historyKeymap: true,
|
||||||
|
|
|
@ -113,7 +113,7 @@ export function FormCreateCst({ schema }: FormCreateCstProps) {
|
||||||
id='dlg_cst_show_comment'
|
id='dlg_cst_show_comment'
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
type='button'
|
type='button'
|
||||||
className='self-start cc-label text-sec-600 hover:underline'
|
className='self-start cc-label text-sec-600 hover:underline select-none'
|
||||||
onClick={() => setForceComment(true)}
|
onClick={() => setForceComment(true)}
|
||||||
>
|
>
|
||||||
Добавить комментарий
|
Добавить комментарий
|
||||||
|
|
|
@ -146,7 +146,7 @@ export function FormConstituenta({ disabled, id, toggleReset, schema, activeCst,
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
<div className='absolute z-pop top-0 left-[calc(7ch+4px+3rem)] flex select-none'>
|
<div className='absolute z-pop top-0 left-[calc(7ch+4px+3rem)] flex select-none'>
|
||||||
<div className='pt-1 text-sm font-medium whitespace-nowrap select-text cursor-default'>
|
<div className='pt-1 text-sm font-medium min-w-16 whitespace-nowrap select-text cursor-default'>
|
||||||
<span>Имя </span>
|
<span>Имя </span>
|
||||||
<span className='ml-1'>{activeCst?.alias ?? ''}</span>
|
<span className='ml-1'>{activeCst?.alias ?? ''}</span>
|
||||||
</div>
|
</div>
|
||||||
|
@ -264,7 +264,7 @@ export function FormConstituenta({ disabled, id, toggleReset, schema, activeCst,
|
||||||
<button
|
<button
|
||||||
type='button'
|
type='button'
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
className='self-start cc-label text-sec-600 hover:underline'
|
className='self-start cc-label text-sec-600 hover:underline select-none'
|
||||||
onClick={() => setForceComment(true)}
|
onClick={() => setForceComment(true)}
|
||||||
>
|
>
|
||||||
Добавить комментарий
|
Добавить комментарий
|
||||||
|
|
|
@ -41,9 +41,7 @@ export const APP_COLORS = {
|
||||||
fgOrange: 'var(--acc-fg-orange)'
|
fgOrange: 'var(--acc-fg-orange)'
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/** Represents Select component theme. */
|
||||||
* Represents Select component theme.
|
|
||||||
*/
|
|
||||||
export const SELECT_THEME = {
|
export const SELECT_THEME = {
|
||||||
primary: APP_COLORS.bgPrimary,
|
primary: APP_COLORS.bgPrimary,
|
||||||
primary75: APP_COLORS.bgSelected,
|
primary75: APP_COLORS.bgSelected,
|
||||||
|
|
|
@ -19,6 +19,15 @@
|
||||||
z-index: 100;
|
z-index: 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cm-selectionBackground {
|
||||||
|
background: highlight !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cm-content ::selection {
|
||||||
|
background: highlight !important;
|
||||||
|
color: highlighttext !important;
|
||||||
|
}
|
||||||
|
|
||||||
.cm-editor {
|
.cm-editor {
|
||||||
resize: vertical;
|
resize: vertical;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
@ -43,6 +52,8 @@
|
||||||
.cm-editor .cm-placeholder {
|
.cm-editor .cm-placeholder {
|
||||||
font-family: var(--font-main);
|
font-family: var(--font-main);
|
||||||
color: var(--clr-prim-600);
|
color: var(--clr-prim-600);
|
||||||
|
user-select: none;
|
||||||
|
-webkit-user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.react-flow__handle {
|
.react-flow__handle {
|
||||||
|
|
|
@ -94,16 +94,9 @@
|
||||||
outline-color: transparent;
|
outline-color: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
::selection {
|
|
||||||
background: var(--clr-sec-100);
|
|
||||||
}
|
|
||||||
|
|
||||||
tr:hover ::selection {
|
|
||||||
background: var(--clr-warn-100);
|
|
||||||
}
|
|
||||||
|
|
||||||
::placeholder {
|
::placeholder {
|
||||||
color: var(--clr-prim-600);
|
color: var(--clr-prim-600);
|
||||||
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wrapping headers */
|
/* Wrapping headers */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user