Compare commits
6 Commits
d7ee1db6a9
...
b24a3a568b
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b24a3a568b | ||
![]() |
636e20aae4 | ||
![]() |
99a08da2e6 | ||
![]() |
e1d99c47ca | ||
![]() |
a10cd42f6b | ||
![]() |
b0e836406f |
|
@ -3,6 +3,7 @@
|
|||
import clsx from 'clsx';
|
||||
import { AnimatePresence, motion } from 'framer-motion';
|
||||
import { useCallback, useLayoutEffect, useMemo, useState } from 'react';
|
||||
import { toast } from 'react-toastify';
|
||||
|
||||
import { IconFolder, IconFolderClosed, IconFolderEmpty, IconFolderOpened, IconFolderTree } from '@/components/Icons';
|
||||
import BadgeHelp from '@/components/info/BadgeHelp';
|
||||
|
@ -11,8 +12,8 @@ import MiniButton from '@/components/ui/MiniButton';
|
|||
import { FolderNode, FolderTree } from '@/models/FolderTree';
|
||||
import { HelpTopic } from '@/models/miscellaneous';
|
||||
import { animateSideAppear, animateSideView } from '@/styling/animations';
|
||||
import { globals, PARAMETER, prefixes } from '@/utils/constants';
|
||||
import { describeFolderNode, labelFolderNode } from '@/utils/labels';
|
||||
import { PARAMETER, prefixes } from '@/utils/constants';
|
||||
import { information, labelFolderNode } from '@/utils/labels';
|
||||
|
||||
interface LibraryTableProps {
|
||||
folders: FolderTree;
|
||||
|
@ -49,11 +50,18 @@ function LibraryFolders({ folders, currentFolder, setFolder, toggleFolderMode }:
|
|||
[items]
|
||||
);
|
||||
|
||||
const handleSetValue = useCallback(
|
||||
const handleClickFolder = useCallback(
|
||||
(event: CProps.EventMouse, target: FolderNode) => {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
setFolder(target.getPath());
|
||||
if (event.ctrlKey) {
|
||||
navigator.clipboard
|
||||
.writeText(target.getPath())
|
||||
.then(() => toast.success(information.pathReady))
|
||||
.catch(console.error);
|
||||
} else {
|
||||
setFolder(target.getPath());
|
||||
}
|
||||
},
|
||||
[setFolder]
|
||||
);
|
||||
|
@ -69,7 +77,7 @@ function LibraryFolders({ folders, currentFolder, setFolder, toggleFolderMode }:
|
|||
|
||||
return (
|
||||
<motion.div
|
||||
className='flex flex-col text:xs sm:text-sm'
|
||||
className='flex flex-col select-none text:xs sm:text-sm'
|
||||
initial={{ ...animateSideView.initial }}
|
||||
animate={{ ...animateSideView.animate }}
|
||||
exit={{ ...animateSideView.exit }}
|
||||
|
@ -109,9 +117,7 @@ function LibraryFolders({ folders, currentFolder, setFolder, toggleFolderMode }:
|
|||
activeNode === item && 'clr-selected'
|
||||
)}
|
||||
style={{ paddingLeft: `${(item.rank > 5 ? 5 : item.rank) * 0.5 + 0.5}rem` }}
|
||||
data-tooltip-id={globals.tooltip}
|
||||
data-tooltip-html={describeFolderNode(item)}
|
||||
onClick={event => handleSetValue(event, item)}
|
||||
onClick={event => handleClickFolder(event, item)}
|
||||
initial={{ ...animateSideAppear.initial }}
|
||||
animate={{ ...animateSideAppear.animate }}
|
||||
exit={{ ...animateSideAppear.exit }}
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {
|
||||
IconFilterReset,
|
||||
IconFolder,
|
||||
IconFolderClosed,
|
||||
IconFolderEmpty,
|
||||
|
@ -16,8 +17,9 @@ function HelpLibrary() {
|
|||
<h1>Библиотека схем</h1>
|
||||
<p>В библиотеке собраны концептуальные схемы, эксплицированные в родоструктурном аппарате</p>
|
||||
|
||||
<h2>Интерфейс</h2>
|
||||
<li>клик по строке - переход к редактированию схемы</li>
|
||||
<li>Ctrl + клик по строке откроет схему в новой вкладке</li>
|
||||
<li>Фильтры атрибутов три позиции: да/нет/не применять</li>
|
||||
<li>
|
||||
<IconShow size='1rem' className='inline-icon' /> фильтры атрибутов применяются по клику
|
||||
</li>
|
||||
|
@ -31,13 +33,17 @@ function HelpLibrary() {
|
|||
<li>
|
||||
<IconFolder size='1rem' className='inline-icon' /> фильтр по расположению
|
||||
</li>
|
||||
|
||||
<h2>Проводник</h2>
|
||||
<li>клик по папке отображает справа файлы в ней</li>
|
||||
<li>клик по иконке сворачивает/разворачивает вложенные</li>
|
||||
<li>
|
||||
<IconFilterReset size='1rem' className='inline-icon' /> сбросить фильтры
|
||||
</li>
|
||||
<li>
|
||||
<IconFolderTree size='1rem' className='inline-icon' /> переключение между Проводник и Поиск
|
||||
</li>
|
||||
|
||||
<h2>Режим: Проводник</h2>
|
||||
<li>клик по папке отображает справа файлы в ней</li>
|
||||
<li>Ctrl + клик по папке копирует путь в буфер обмена</li>
|
||||
<li>клик по иконке сворачивает/разворачивает вложенные</li>
|
||||
<li>
|
||||
<IconFolderEmpty size='1rem' className='inline-icon clr-text-default' /> папка без файлов
|
||||
</li>
|
||||
|
|
|
@ -115,7 +115,7 @@ function EditorConstituenta({ activeCst, isModified, setIsModified, onOpenEdit }
|
|||
onRename={controller.renameCst}
|
||||
onOpenEdit={onOpenEdit}
|
||||
/>
|
||||
<AnimatePresence>
|
||||
<AnimatePresence initial={false}>
|
||||
{showList ? (
|
||||
<ViewConstituents
|
||||
schema={controller.schema}
|
||||
|
|
|
@ -188,22 +188,32 @@ export const animateParseResults: Variants = {
|
|||
|
||||
export const animateSideView = {
|
||||
initial: {
|
||||
clipPath: 'inset(0% 100% 0% 0%)'
|
||||
width: 0,
|
||||
opacity: 0
|
||||
},
|
||||
animate: {
|
||||
clipPath: 'inset(0% 0% 0% 0%)',
|
||||
width: 'auto',
|
||||
opacity: 1,
|
||||
transition: {
|
||||
type: 'spring',
|
||||
bounce: 0,
|
||||
duration: 1
|
||||
width: {
|
||||
duration: 0.4
|
||||
},
|
||||
opacity: {
|
||||
delay: 0.4,
|
||||
duration: 0
|
||||
}
|
||||
}
|
||||
},
|
||||
exit: {
|
||||
clipPath: 'inset(0% 100% 0% 0%)',
|
||||
width: 0,
|
||||
opacity: 0,
|
||||
transition: {
|
||||
type: 'spring',
|
||||
bounce: 0,
|
||||
duration: 1
|
||||
width: {
|
||||
duration: 0.4
|
||||
},
|
||||
opacity: {
|
||||
duration: 0
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -898,6 +898,7 @@ export const information = {
|
|||
subscribed: 'Отслеживание отключено',
|
||||
unsubscribed: 'Отслеживание выключено',
|
||||
|
||||
pathReady: 'Путь скопирован',
|
||||
substituteSingle: 'Отождествление завершено',
|
||||
reorderComplete: 'Упорядочение завершено',
|
||||
reindexComplete: 'Имена конституент обновлены',
|
||||
|
|
Loading…
Reference in New Issue
Block a user