M: Small UI layout fixes
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run

This commit is contained in:
Ivan 2024-09-21 20:04:07 +03:00
parent 02b6a53d00
commit 7f88d030d4
26 changed files with 72 additions and 96 deletions

View File

@ -28,10 +28,7 @@ function ApplicationLayout() {
maxHeight: viewportHeight maxHeight: viewportHeight
}} }}
> >
<main <main className='cc-scroll-y' style={{ overflowY: showScroll ? 'scroll' : 'auto', minHeight: mainHeight }}>
className='w-full h-full cc-scroll-y'
style={{ overflowY: showScroll ? 'scroll' : 'auto', minHeight: mainHeight }}
>
<Outlet /> <Outlet />
</main> </main>
<Footer /> <Footer />

View File

@ -28,7 +28,6 @@ function Navigation() {
className={clsx( className={clsx(
'z-navigation', // prettier: split lines 'z-navigation', // prettier: split lines
'sticky top-0 left-0 right-0', 'sticky top-0 left-0 right-0',
'w-full',
'clr-app', 'clr-app',
'select-none' 'select-none'
)} )}
@ -36,7 +35,7 @@ function Navigation() {
<ToggleNavigation /> <ToggleNavigation />
<motion.div <motion.div
className={clsx( className={clsx(
'pl-2 pr-[1.5rem] sm:pr-[0.9rem] h-[3rem] w-full', // prettier: split lines 'pl-2 pr-[1.5rem] sm:pr-[0.9rem] h-[3rem]', // prettier: split lines
'flex', 'flex',
'cc-shadow-border' 'cc-shadow-border'
)} )}

View File

@ -61,7 +61,7 @@ function InfoError({ error }: InfoErrorProps) {
return ( return (
<AnimateFade <AnimateFade
className={clsx( className={clsx(
'min-w-[25rem] w-full', 'min-w-[25rem]',
'px-3 py-2 flex flex-col', 'px-3 py-2 flex flex-col',
'clr-text-red', 'clr-text-red',
'text-sm font-semibold', 'text-sm font-semibold',

View File

@ -53,7 +53,7 @@ function TooltipOperation({ node, anchor }: TooltipOperationProps) {
dense dense
noHeader noHeader
noFooter noFooter
className='w-full text-sm border select-none mb-2' className='text-sm border select-none mb-2'
data={node.data.operation.substitutions} data={node.data.operation.substitutions}
columns={columns} columns={columns}
/> />

View File

@ -130,7 +130,6 @@ function PickMultiOperation({ rows, items, selected, setSelected }: PickMultiOpe
items={nonSelectedItems} // prettier: split-line items={nonSelectedItems} // prettier: split-line
value={lastSelected} value={lastSelected}
onSelectValue={handleSelect} onSelectValue={handleSelect}
className='w-full'
/> />
<DataTable <DataTable
dense dense

View File

@ -124,7 +124,7 @@ function PickSchema({
<div className='flex justify-between clr-input items-center pr-1'> <div className='flex justify-between clr-input items-center pr-1'>
<SearchBar <SearchBar
id={id ? `${id}__search` : undefined} id={id ? `${id}__search` : undefined}
className='clr-input w-full' className='clr-input flex-grow'
noBorder noBorder
value={filterText} value={filterText}
onChange={newValue => setFilterText(newValue)} onChange={newValue => setFilterText(newValue)}

View File

@ -257,10 +257,9 @@ function PickSubstitutions({
); );
return ( return (
<div className='flex flex-col w-full'> <div className='flex flex-col'>
<div className='flex items-end gap-3 justify-stretch'> <div className='flex items-end gap-3 justify-stretch'>
<div className='flex-grow flex flex-col basis-1/2'> <div className='flex-grow flex flex-col basis-1/2 gap-[0.125rem] border-x border-t clr-input'>
<div className='flex flex-col gap-[0.125rem] border-x border-t clr-input'>
<SelectLibraryItem <SelectLibraryItem
noBorder noBorder
placeholder='Выберите аргумент' placeholder='Выберите аргумент'
@ -277,7 +276,6 @@ function PickSubstitutions({
onSelectValue={setLeftCst} onSelectValue={setLeftCst}
/> />
</div> </div>
</div>
<div className='flex flex-col gap-1'> <div className='flex flex-col gap-1'>
<MiniButton <MiniButton
title={deleteRight ? 'Заменить правую' : 'Заменить левую'} title={deleteRight ? 'Заменить правую' : 'Заменить левую'}
@ -290,7 +288,6 @@ function PickSubstitutions({
) )
} }
/> />
<MiniButton <MiniButton
title='Добавить в таблицу отождествлений' title='Добавить в таблицу отождествлений'
className='mb-[0.375rem] grow-0' className='mb-[0.375rem] grow-0'
@ -300,8 +297,7 @@ function PickSubstitutions({
/> />
</div> </div>
<div className='flex-grow basis-1/2'> <div className='flex-grow basis-1/2 flex flex-col gap-[0.125rem] border-x border-t clr-input'>
<div className='flex flex-col gap-[0.125rem] border-x border-t clr-input'>
<SelectLibraryItem <SelectLibraryItem
noBorder noBorder
placeholder='Выберите аргумент' placeholder='Выберите аргумент'
@ -319,13 +315,12 @@ function PickSubstitutions({
/> />
</div> </div>
</div> </div>
</div>
<DataTable <DataTable
dense dense
noHeader noHeader
noFooter noFooter
className='w-full text-sm border select-none cc-scroll-y' className='text-sm border select-none cc-scroll-y'
rows={rows} rows={rows}
contentHeight='1.3rem' contentHeight='1.3rem'
data={substitutionData} data={substitutionData}

View File

@ -40,7 +40,7 @@ function SelectVersion({ id, className, items, value, onSelectValue, ...restProp
return ( return (
<SelectSingle <SelectSingle
id={id} id={id}
className={clsx('w-full min-w-[12rem] text-ellipsis', className)} className={clsx('min-w-[12rem] text-ellipsis', className)}
options={options} options={options}
value={{ value: value, label: valueLabel }} value={{ value: value, label: valueLabel }}
onChange={data => onSelectValue(data?.value)} onChange={data => onSelectValue(data?.value)}

View File

@ -27,7 +27,7 @@ function SearchBar({ id, value, noIcon, onChange, noBorder, placeholder = 'По
noOutline noOutline
placeholder={placeholder} placeholder={placeholder}
type='search' type='search'
className={clsx('w-full outline-none bg-transparent', !noIcon && 'pl-10')} className={clsx('outline-none bg-transparent', !noIcon && 'pl-10')}
noBorder={noBorder} noBorder={noBorder}
value={value} value={value}
onChange={event => (onChange ? onChange(event.target.value) : undefined)} onChange={event => (onChange ? onChange(event.target.value) : undefined)}

View File

@ -113,7 +113,7 @@ function SelectSingle<Option, Group extends GroupBase<Option> = GroupBase<Option
spacing: { spacing: {
...theme.spacing, // prettier: split-lines ...theme.spacing, // prettier: split-lines
baseUnit: size.isSmall ? 2 : 4, baseUnit: size.isSmall ? 2 : 4,
menuGutter: size.isSmall ? 4 : 8, menuGutter: 2,
controlHeight: size.isSmall ? 28 : 38 controlHeight: size.isSmall ? 28 : 38
}, },
colors: { colors: {

View File

@ -53,7 +53,7 @@ function FormCreateCst({ schema, state, partialUpdate, setValidated }: FormCreat
<SelectSingle <SelectSingle
id='dlg_cst_type' id='dlg_cst_type'
placeholder='Выберите тип' placeholder='Выберите тип'
className='w-[15rem]' className='w-[16rem]'
options={SelectorCstType} options={SelectorCstType}
value={{ value: state.cst_type, label: labelCstType(state.cst_type) }} value={{ value: state.cst_type, label: labelCstType(state.cst_type) }}
onChange={data => handleTypeChange(data?.value ?? CstType.BASE)} onChange={data => handleTypeChange(data?.value ?? CstType.BASE)}

View File

@ -43,15 +43,7 @@ function DlgDeleteOperation({ hideWindow, target, onSubmit }: DlgDeleteOperation
/> />
</Overlay> </Overlay>
<TextInput <TextInput disabled dense noBorder id='operation_alias' label='Операция' value={target.alias} />
disabled
dense
noBorder
id='operation_alias'
label='Операция'
className='w-full'
value={target.alias}
/>
<Checkbox <Checkbox
label='Сохранить наследованные конституенты' label='Сохранить наследованные конституенты'
titleHtml='Наследованные конституенты <br/>превратятся в дописанные' titleHtml='Наследованные конституенты <br/>превратятся в дописанные'

View File

@ -201,9 +201,7 @@ function DlgEditWordForms({ hideWindow, target, onSave }: DlgEditWordFormsProps)
onClick={handleGenerateLexeme} onClick={handleGenerateLexeme}
/> />
</div> </div>
<div <div className={clsx('mt-3 mb-2 mx-auto', 'flex items-center', 'text-sm text-center font-semibold')}>
className={clsx('mt-3 mb-2', 'w-full flex justify-center items-center', 'text-sm text-center font-semibold')}
>
<div>Заданные вручную словоформы [{forms.length}]</div> <div>Заданные вручную словоформы [{forms.length}]</div>
<MiniButton <MiniButton
noHover noHover

View File

@ -37,8 +37,8 @@ function TabSchema({ selected, receiver, setSelected }: TabSchemaProps) {
id='dlg_selected_schema_title' id='dlg_selected_schema_title'
disabled disabled
noBorder noBorder
className='w-full' className='flex-grow'
placeholder='Выберите из списка ниже' placeholder='Схема не выбрана'
value={selectedInfo?.title ?? ''} value={selectedInfo?.title ?? ''}
dense dense
/> />

View File

@ -52,7 +52,7 @@ function DlgRenameCst({ hideWindow, initial, allowChangeType, onRename }: DlgRen
<SelectSingle <SelectSingle
id='dlg_cst_type' id='dlg_cst_type'
placeholder='Выберите тип' placeholder='Выберите тип'
className='min-w-[16rem] self-center' className='min-w-[16rem]'
isDisabled={!allowChangeType} isDisabled={!allowChangeType}
options={SelectorCstType} options={SelectorCstType}
value={{ value={{

View File

@ -26,7 +26,7 @@ function ManualsPage() {
); );
return ( return (
<div className='flex w-full gap-2' style={{ minHeight: mainHeight }}> <div className='flex gap-2' style={{ minHeight: mainHeight }}>
<TopicsList activeTopic={activeTopic} onChangeTopic={topic => onSelectTopic(topic)} /> <TopicsList activeTopic={activeTopic} onChangeTopic={topic => onSelectTopic(topic)} />
<ViewTopic topic={activeTopic} /> <ViewTopic topic={activeTopic} />
</div> </div>

View File

@ -28,12 +28,10 @@ function HelpRSLang() {
<p>2. <a className='underline' href={external_urls.ponomarev}>Текст: Учебник И. Н. Пономарева</a></p> <p>2. <a className='underline' href={external_urls.ponomarev}>Текст: Учебник И. Н. Пономарева</a></p>
<p>3. <a className='underline' href={external_urls.full_course}>Видео: лекции для 4 курса (второй семестр 2022-23 год)</a></p> <p>3. <a className='underline' href={external_urls.full_course}>Видео: лекции для 4 курса (второй семестр 2022-23 год)</a></p>
</div> </div>
<div className='justify-center w-full'>
<EmbedYoutube <EmbedYoutube
videoID={youtube.intro} videoID={youtube.intro}
pxHeight={videoHeight} pxHeight={videoHeight}
/> />
</div>
<div className='dense'> <div className='dense'>
<Subtopics headTopic={HelpTopic.RSLANG} /> <Subtopics headTopic={HelpTopic.RSLANG} />
</div> </div>

View File

@ -26,7 +26,7 @@ function HelpOssGraph() {
<div className='flex flex-col'> <div className='flex flex-col'>
<h1 className='sm:pr-[6rem]'>Граф синтеза</h1> <h1 className='sm:pr-[6rem]'>Граф синтеза</h1>
<div className='flex flex-col sm:flex-row'> <div className='flex flex-col sm:flex-row'>
<div className='w-full sm:w-[14rem]'> <div className='sm:w-[14rem]'>
<h1>Настройка графа</h1> <h1>Настройка графа</h1>
<li> <li>
<IconFitImage className='inline-icon' /> Вписать в экран <IconFitImage className='inline-icon' /> Вписать в экран
@ -50,7 +50,7 @@ function HelpOssGraph() {
<Divider vertical margins='mx-3 mt-3' className='hidden sm:block' /> <Divider vertical margins='mx-3 mt-3' className='hidden sm:block' />
<div className='w-full sm:w-[21rem]'> <div className='sm:w-[21rem]'>
<h1>Изменение узлов</h1> <h1>Изменение узлов</h1>
<li>Клик на операцию выделение</li> <li>Клик на операцию выделение</li>
<li>Esc сбросить выделение</li> <li>Esc сбросить выделение</li>
@ -72,7 +72,7 @@ function HelpOssGraph() {
<Divider margins='my-3' className='hidden sm:block' /> <Divider margins='my-3' className='hidden sm:block' />
<div className='flex flex-col-reverse mb-3 sm:flex-row'> <div className='flex flex-col-reverse mb-3 sm:flex-row'>
<div className='w-full sm:w-[14rem]'> <div className='sm:w-[14rem]'>
<h1>Общие</h1> <h1>Общие</h1>
<li> <li>
<IconReset className='inline-icon' /> Сбросить изменения <IconReset className='inline-icon' /> Сбросить изменения

View File

@ -28,7 +28,7 @@ function HelpRSGraphTerm() {
<div className='flex flex-col'> <div className='flex flex-col'>
<h1>Граф термов</h1> <h1>Граф термов</h1>
<div className='flex flex-col sm:flex-row'> <div className='flex flex-col sm:flex-row'>
<div className='w-full sm:w-[14rem]'> <div className='sm:w-[14rem]'>
<h1>Настройка графа</h1> <h1>Настройка графа</h1>
<li>Цвет покраска узлов</li> <li>Цвет покраска узлов</li>
<li>Граф расположение</li> <li>Граф расположение</li>
@ -46,7 +46,7 @@ function HelpRSGraphTerm() {
<Divider vertical margins='mx-3 mt-3' className='hidden sm:block' /> <Divider vertical margins='mx-3 mt-3' className='hidden sm:block' />
<div className='w-full sm:w-[21rem]'> <div className='sm:w-[21rem]'>
<h1>Изменение узлов</h1> <h1>Изменение узлов</h1>
<li>Клик на конституенту выделение</li> <li>Клик на конституенту выделение</li>
<li> <li>
@ -70,7 +70,7 @@ function HelpRSGraphTerm() {
<Divider margins='my-3' className='hidden sm:block' /> <Divider margins='my-3' className='hidden sm:block' />
<div className='flex flex-col-reverse mb-3 sm:flex-row'> <div className='flex flex-col-reverse mb-3 sm:flex-row'>
<div className='w-full sm:w-[14rem]'> <div className='sm:w-[14rem]'>
<h1>Общие</h1> <h1>Общие</h1>
<li> <li>
<IconOSS className='inline-icon' /> переход к связанной <LinkTopic text='ОСС' topic={HelpTopic.CC_OSS} /> <IconOSS className='inline-icon' /> переход к связанной <LinkTopic text='ОСС' topic={HelpTopic.CC_OSS} />

View File

@ -95,7 +95,7 @@ function FormOSS({ id, isModified, setIsModified }: FormOSSProps) {
disabled={!controller.isMutable} disabled={!controller.isMutable}
onChange={event => setTitle(event.target.value)} onChange={event => setTitle(event.target.value)}
/> />
<div className='flex justify-between w-full gap-3 mb-3'> <div className='flex justify-between gap-3 mb-3'>
<TextInput <TextInput
id='schema_alias' id='schema_alias'
required required

View File

@ -139,11 +139,7 @@ function FormConstituenta({
onRename={onRename} onRename={onRename}
/> />
) : null} ) : null}
<form <form id={id} className={clsx('cc-column', 'mt-1 md:w-[48.8rem] shrink-0', 'px-6 py-1')} onSubmit={handleSubmit}>
id={id}
className={clsx('cc-column', 'mt-1 w-full md:w-[48.8rem] shrink-0', 'px-6 py-1')}
onSubmit={handleSubmit}
>
<RefsInput <RefsInput
key='cst_term' key='cst_term'
id='cst_term' id='cst_term'

View File

@ -166,9 +166,9 @@ function EditorRSExpression({
/> />
<Overlay <Overlay
position='top-[-0.5rem]' position='top-[-0.5rem] right-1/2 translate-x-1/2'
layer='z-pop' layer='z-pop'
className='pl-[8.5rem] xs:pl-[2rem] flex justify-center w-full gap-1' className='w-fit pl-[8.5rem] xs:pl-[2rem] flex gap-1'
> >
<StatusBar <StatusBar
processing={parser.processing} processing={parser.processing}

View File

@ -15,7 +15,7 @@ function ToolbarRSExpression({ disabled, showControls, toggleControls, showAST }
const model = useRSForm(); const model = useRSForm();
return ( return (
<Overlay position='top-[-0.5rem] right-0' layer='z-sticky' className='cc-icons'> <Overlay position='top-[-0.5rem] right-0' layer='z-pop' className='cc-icons'>
{!disabled || model.processing ? ( {!disabled || model.processing ? (
<MiniButton <MiniButton
title='Отображение специальной клавиатуры' title='Отображение специальной клавиатуры'

View File

@ -95,7 +95,7 @@ function FormRSForm({ id, isModified, setIsModified }: FormRSFormProps) {
disabled={!controller.isContentEditable} disabled={!controller.isContentEditable}
onChange={event => setTitle(event.target.value)} onChange={event => setTitle(event.target.value)}
/> />
<div className='flex justify-between w-full gap-3 mb-3'> <div className='flex justify-between gap-3 mb-3'>
<TextInput <TextInput
id='schema_alias' id='schema_alias'
required required

View File

@ -35,6 +35,7 @@
.cm-editor .cm-placeholder { .cm-editor .cm-placeholder {
color: var(--cl-fg-60); color: var(--cl-fg-60);
@apply font-main;
.dark & { .dark & {
color: var(--cd-fg-60); color: var(--cd-fg-60);
} }
@ -72,7 +73,8 @@
} }
} }
:is(.react-flow__node-input, .react-flow__node-synthesis) { .react-flow__node-input,
.react-flow__node-synthesis {
cursor: pointer; cursor: pointer;
border: 1px solid; border: 1px solid;

View File

@ -229,7 +229,7 @@ export function domTooltipConstituenta(cst?: IConstituenta, canClick?: boolean):
if (canClick) { if (canClick) {
const clickTip = document.createElement('p'); const clickTip = document.createElement('p');
clickTip.className = 'w-full text-center text-xs mt-2'; clickTip.className = 'text-center text-xs mt-1';
clickTip.innerText = 'Ctrl + клик для перехода'; clickTip.innerText = 'Ctrl + клик для перехода';
dom.appendChild(clickTip); dom.appendChild(clickTip);
} }
@ -288,7 +288,7 @@ export function domTooltipEntityReference(
if (canClick) { if (canClick) {
const clickTip = document.createElement('p'); const clickTip = document.createElement('p');
clickTip.className = 'w-full text-center text-xs mt-2'; clickTip.className = 'text-center text-xs mt-1';
clickTip.innerHTML = 'Ctrl + клик для перехода</br>Ctrl + пробел для редактирования'; clickTip.innerHTML = 'Ctrl + клик для перехода</br>Ctrl + пробел для редактирования';
dom.appendChild(clickTip); dom.appendChild(clickTip);
} }
@ -333,7 +333,7 @@ export function domTooltipSyntacticReference(
if (canClick) { if (canClick) {
const clickTip = document.createElement('p'); const clickTip = document.createElement('p');
clickTip.className = 'w-full text-center text-xs mt-2'; clickTip.className = 'text-center text-xs mt-1';
clickTip.innerHTML = 'Ctrl + пробел для редактирования'; clickTip.innerHTML = 'Ctrl + пробел для редактирования';
dom.appendChild(clickTip); dom.appendChild(clickTip);
} }