mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-25 20:40:36 +03:00
M: Revert to default selection behavior and fix minor issues
This commit is contained in:
parent
79158c5cf5
commit
4cf43dd7dc
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -151,6 +151,7 @@
|
|||
"rsconcept",
|
||||
"rsedit",
|
||||
"rseditor",
|
||||
"rsexpression",
|
||||
"rsform",
|
||||
"rsforms",
|
||||
"rsgraph",
|
||||
|
|
|
@ -13,18 +13,18 @@ import { ToggleNavigation } from './toggle-navigation';
|
|||
import { UserMenu } from './user-menu';
|
||||
|
||||
export function Navigation() {
|
||||
const router = useConceptNavigation();
|
||||
const { push } = useConceptNavigation();
|
||||
const size = useWindowSize();
|
||||
const noNavigationAnimation = useAppLayoutStore(state => state.noNavigationAnimation);
|
||||
|
||||
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>) =>
|
||||
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>) =>
|
||||
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>) =>
|
||||
router.push({ path: urls.create_schema, newTab: event.ctrlKey || event.metaKey });
|
||||
push({ path: urls.create_schema, newTab: event.ctrlKey || event.metaKey });
|
||||
|
||||
return (
|
||||
<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 { 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
|
||||
extends Pick<
|
||||
ReactCodeMirrorProps,
|
||||
|
@ -117,7 +89,6 @@ export const RefsInput = forwardRef<ReactCodeMirrorRef, RefsInputInputProps>(
|
|||
fontFamily: 'inherit',
|
||||
background: !disabled ? APP_COLORS.bgInput : APP_COLORS.bgDefault,
|
||||
foreground: APP_COLORS.fgDefault,
|
||||
selection: APP_COLORS.bgHover,
|
||||
caret: APP_COLORS.fgDefault
|
||||
},
|
||||
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',
|
||||
background: !disabled ? APP_COLORS.bgInput : APP_COLORS.bgDefault,
|
||||
foreground: APP_COLORS.fgDefault,
|
||||
selection: APP_COLORS.bgHover,
|
||||
caret: APP_COLORS.fgDefault
|
||||
},
|
||||
styles: [
|
||||
|
@ -184,7 +183,7 @@ export const RSInput = forwardRef<ReactCodeMirrorRef, RSInputProps>(
|
|||
const editorSetup: BasicSetupOptions = {
|
||||
highlightSpecialChars: false,
|
||||
history: true,
|
||||
drawSelection: true,
|
||||
drawSelection: false,
|
||||
syntaxHighlighting: false,
|
||||
defaultKeymap: true,
|
||||
historyKeymap: true,
|
||||
|
|
|
@ -113,7 +113,7 @@ export function FormCreateCst({ schema }: FormCreateCstProps) {
|
|||
id='dlg_cst_show_comment'
|
||||
tabIndex={-1}
|
||||
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)}
|
||||
>
|
||||
Добавить комментарий
|
||||
|
|
|
@ -264,7 +264,7 @@ export function FormConstituenta({ disabled, id, toggleReset, schema, activeCst,
|
|||
<button
|
||||
type='button'
|
||||
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)}
|
||||
>
|
||||
Добавить комментарий
|
||||
|
|
|
@ -41,9 +41,7 @@ export const APP_COLORS = {
|
|||
fgOrange: 'var(--acc-fg-orange)'
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents Select component theme.
|
||||
*/
|
||||
/** Represents Select component theme. */
|
||||
export const SELECT_THEME = {
|
||||
primary: APP_COLORS.bgPrimary,
|
||||
primary75: APP_COLORS.bgSelected,
|
||||
|
|
|
@ -19,6 +19,15 @@
|
|||
z-index: 100;
|
||||
}
|
||||
|
||||
.cm-selectionBackground {
|
||||
background: highlight !important;
|
||||
}
|
||||
|
||||
.cm-content ::selection {
|
||||
background: highlight !important;
|
||||
color: highlighttext !important;
|
||||
}
|
||||
|
||||
.cm-editor {
|
||||
resize: vertical;
|
||||
overflow-y: auto;
|
||||
|
@ -43,6 +52,8 @@
|
|||
.cm-editor .cm-placeholder {
|
||||
font-family: var(--font-main);
|
||||
color: var(--clr-prim-600);
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
}
|
||||
|
||||
.react-flow__handle {
|
||||
|
|
|
@ -94,16 +94,9 @@
|
|||
outline-color: transparent;
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: var(--clr-sec-100);
|
||||
}
|
||||
|
||||
tr:hover ::selection {
|
||||
background: var(--clr-warn-100);
|
||||
}
|
||||
|
||||
::placeholder {
|
||||
color: var(--clr-prim-600);
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* Wrapping headers */
|
||||
|
|
Loading…
Reference in New Issue
Block a user