diff --git a/rsconcept/frontend/src/app/ApplicationLayout.tsx b/rsconcept/frontend/src/app/ApplicationLayout.tsx index f3b15914..8953f0a4 100644 --- a/rsconcept/frontend/src/app/ApplicationLayout.tsx +++ b/rsconcept/frontend/src/app/ApplicationLayout.tsx @@ -11,7 +11,7 @@ function ApplicationLayout() { const { viewportHeight, mainHeight, showScroll } = useConceptOptions(); return ( -
+
сохранить изменения: Ctrl + S
  • - кнопка переименования справа от{' '} - + сбросить несохраненные изменения +
  • +
  • + клонировать текущую: Alt + V +
  • +
  • + новая конституента +
  • +
  • + удаление текущей
  • Термин и Текстовое определение

    +
  • + кнопка переименования справа от{' '} + +
  • кнопка редактирования словоформ справа от{' '} @@ -42,9 +59,6 @@ function HelpCstEditor() {
  • специальная клавиатура и горячие клавиши
  • -
  • - отображение списка конституент -
  • отображение{' '} @@ -52,6 +66,13 @@ function HelpCstEditor() {
  • Ctrl + Пробел дополняет до незанятого имени
  • Список конституент

    +
  • + отображение списка конституент +
  • +
  • + + Alt + вверх/вниз – перемещение +
  • фильтрация в верхней части
  • при наведении на имя конституенты отображаются атрибуты
  • diff --git a/rsconcept/frontend/src/pages/ManualsPage/items/HelpRSFormItems.tsx b/rsconcept/frontend/src/pages/ManualsPage/items/HelpRSFormItems.tsx index 5c3bcbc8..ee77a8c8 100644 --- a/rsconcept/frontend/src/pages/ManualsPage/items/HelpRSFormItems.tsx +++ b/rsconcept/frontend/src/pages/ManualsPage/items/HelpRSFormItems.tsx @@ -2,7 +2,16 @@ import InfoCstStatus from '@/components/info/InfoCstStatus'; import Divider from '@/components/ui/Divider'; import { HelpTopic } from '@/models/miscellaneous'; -import { IconAlias, IconDestroy, IconMoveDown, IconMoveUp, IconOpenList, IconReset } from '../../../components/Icons'; +import { + IconAlias, + IconClone, + IconDestroy, + IconMoveDown, + IconMoveUp, + IconNewItem, + IconOpenList, + IconReset +} from '../../../components/Icons'; import LinkTopic from '../../../components/ui/LinkTopic'; function HelpRSFormItems() { @@ -26,11 +35,18 @@ function HelpRSFormItems() { Alt + вверх/вниз – перемещение
  • +
  • - удаление: Delete + клонировать выделенную: Alt + V
  • - добавление: Alt + 1-6,Q,W –{' '} + новая конституента: Alt + ` +
  • +
  • + быстрое добавление: Alt + 1-6,Q,W +
  • +
  • + удаление выделенных: Delete
  • diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/ConstituentaToolbar.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/ConstituentaToolbar.tsx index 9d9c1cb3..e58164d6 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/ConstituentaToolbar.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/ConstituentaToolbar.tsx @@ -1,4 +1,14 @@ -import { IconClone, IconDestroy, IconMoveDown, IconMoveUp, IconNewItem, IconReset, IconSave } from '@/components/Icons'; +import { + IconClone, + IconDestroy, + IconList, + IconListOff, + IconMoveDown, + IconMoveUp, + IconNewItem, + IconReset, + IconSave +} from '@/components/Icons'; import BadgeHelp from '@/components/info/BadgeHelp'; import MiniButton from '@/components/ui/MiniButton'; import Overlay from '@/components/ui/Overlay'; @@ -8,6 +18,7 @@ import { messages, prepareTooltip } from '@/utils/labels'; interface ConstituentaToolbarProps { disabled: boolean; modified: boolean; + showList: boolean; onSubmit: () => void; onReset: () => void; @@ -17,18 +28,22 @@ interface ConstituentaToolbarProps { onDelete: () => void; onClone: () => void; onCreate: () => void; + onToggleList: () => void; } function ConstituentaToolbar({ disabled, modified, + showList, + onSubmit, onReset, onMoveUp, onMoveDown, onDelete, onClone, - onCreate + onCreate, + onToggleList }: ConstituentaToolbarProps) { return ( @@ -62,6 +77,11 @@ function ConstituentaToolbar({ onClick={onDelete} icon={} /> + : } + onClick={onToggleList} + /> } diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/ControlsOverlay.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/ControlsOverlay.tsx index a9993367..22893fa2 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/ControlsOverlay.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/ControlsOverlay.tsx @@ -18,7 +18,7 @@ interface ControlsOverlayProps { function ControlsOverlay({ constituenta, disabled, modified, processing, onRename, onEditTerm }: ControlsOverlayProps) { return ( - + {!disabled || processing ? ( controller.createCst(activeCst?.cst_type, false)} + onToggleList={() => setShowList(prev => !prev)} /> ) : null}
    setShowList(prev => !prev)} setIsModified={setIsModified} onEditTerm={controller.editTermForms} onRename={controller.renameCst} diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx index 368cbce8..fba58580 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorConstituenta/FormConstituenta.tsx @@ -25,7 +25,6 @@ export const ROW_SIZE_IN_CHARACTERS = 70; interface FormConstituentaProps { disabled: boolean; - showList: boolean; id?: string; state?: IConstituenta; @@ -34,14 +33,12 @@ interface FormConstituentaProps { toggleReset: boolean; setIsModified: React.Dispatch>; - onToggleList: () => void; onRename: () => void; onEditTerm: () => void; } function FormConstituenta({ disabled, - showList, id, state, @@ -50,8 +47,7 @@ function FormConstituenta({ toggleReset, onRename, - onEditTerm, - onToggleList + onEditTerm }: FormConstituentaProps) { const { schema, cstUpdate, processing } = useRSForm(); @@ -138,7 +134,7 @@ function FormConstituenta({ />
    setExpression(newValue)} setTypification={setTypification} /> diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/EditorRSExpression.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/EditorRSExpression.tsx index 96965443..0071997c 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/EditorRSExpression.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/EditorRSExpression.tsx @@ -5,13 +5,10 @@ import { AnimatePresence } from 'framer-motion'; import { useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react'; import { toast } from 'react-toastify'; -import { IconControls, IconList, IconListOff, IconText, IconTextOff, IconTree } from '@/components/Icons'; import BadgeHelp from '@/components/info/BadgeHelp'; import RSInput from '@/components/RSInput'; import { RSTextWrapper } from '@/components/RSInput/textEditing'; -import MiniButton from '@/components/ui/MiniButton'; import Overlay from '@/components/ui/Overlay'; -import { useConceptOptions } from '@/context/OptionsContext'; import { useRSForm } from '@/context/RSFormContext'; import DlgShowAST from '@/dialogs/DlgShowAST'; import useCheckExpression from '@/hooks/useCheckExpression'; @@ -24,6 +21,7 @@ import { TokenID } from '@/models/rslang'; import { storage } from '@/utils/constants'; import { labelTypification } from '@/utils/labels'; +import ExpressionToolbar from './ExpressionToolbar'; import ParsingResult from './ParsingResult'; import RSEditorControls from './RSEditControls'; import StatusBar from './StatusBar'; @@ -37,11 +35,9 @@ interface EditorRSExpressionProps { disabled?: boolean; toggleReset?: boolean; - showList: boolean; setTypification: (typification: string) => void; onChange: (newValue: string) => void; - onToggleList: () => void; } function EditorRSExpression({ @@ -49,14 +45,11 @@ function EditorRSExpression({ disabled, value, toggleReset, - showList, setTypification, onChange, - onToggleList, ...restProps }: EditorRSExpressionProps) { const model = useRSForm(); - const { mathFont, setMathFont } = useConceptOptions(); const [isModified, setIsModified] = useState(false); const parser = useCheckExpression({ schema: model.schema }); @@ -147,10 +140,6 @@ function EditorRSExpression({ }); } - function toggleFont() { - setMathFont(mathFont === 'math' ? 'math2' : 'math'); - } - const controls = useMemo( () => ( - - : - } - /> - {!disabled || model.processing ? ( - } - onClick={() => setShowControls(prev => !prev)} - /> - ) : null} - : } - onClick={onToggleList} - /> - } - /> - + setShowControls(prev => !prev)} + /> void; + showAST: () => void; +} + +function ExpressionToolbar({ disabled, showControls, toggleControls, showAST }: ExpressionToolbarProps) { + const model = useRSForm(); + const { mathFont, setMathFont } = useConceptOptions(); + + function toggleFont() { + setMathFont(mathFont === 'math' ? 'math2' : 'math'); + } + + return ( + + : + } + /> + {!disabled || model.processing ? ( + } + onClick={toggleControls} + /> + ) : null} + } + /> + + ); +} + +export default ExpressionToolbar; diff --git a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/RSEditControls.tsx b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/RSEditControls.tsx index fbf895f1..a5409153 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/RSEditControls.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/EditorRSExpression/RSEditControls.tsx @@ -1,3 +1,4 @@ +import clsx from 'clsx'; import { motion } from 'framer-motion'; import { TokenID } from '@/models/rslang'; @@ -90,7 +91,13 @@ interface RSEditorControlsProps { function RSEditorControls({ isOpen, disabled, onEdit }: RSEditorControlsProps) { return ( 3, - 'w-[1.7rem] sm:w-[2.25rem]': label.length <= 3 + 'w-[3.7rem] md:w-[4.5rem]': label.length > 3, + 'w-[1.85rem] md:w-[2.25rem]': label.length <= 3 } )} data-tooltip-id={globals.tooltip} diff --git a/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx b/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx index dc379f66..8cd5073c 100644 --- a/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx +++ b/rsconcept/frontend/src/pages/RSFormPage/ViewConstituents/ViewConstituents.tsx @@ -30,7 +30,7 @@ function ViewConstituents({ expression, schema, activeCst, isBottom, onOpenEdit const table = useMemo( () => (