R: Remove unused symbols
This commit is contained in:
parent
5f524e2e6b
commit
8bf829513f
|
@ -22,7 +22,7 @@ interface INavigationContext {
|
|||
setRequireConfirmation: (value: boolean) => void;
|
||||
}
|
||||
|
||||
export const NavigationContext = createContext<INavigationContext | null>(null);
|
||||
const NavigationContext = createContext<INavigationContext | null>(null);
|
||||
export const useConceptNavigation = () => {
|
||||
const context = use(NavigationContext);
|
||||
if (!context) {
|
||||
|
|
|
@ -33,19 +33,19 @@ axiosInstance.interceptors.request.use(config => {
|
|||
});
|
||||
|
||||
// ================ Data transfer types ================
|
||||
export interface IFrontRequest<RequestData, ResponseData> {
|
||||
interface IFrontRequest<RequestData, ResponseData> {
|
||||
data?: RequestData;
|
||||
successMessage?: string | ((data: ResponseData) => string);
|
||||
}
|
||||
|
||||
export interface IAxiosRequest<RequestData, ResponseData> {
|
||||
interface IAxiosRequest<RequestData, ResponseData> {
|
||||
endpoint: string;
|
||||
request?: IFrontRequest<RequestData, ResponseData>;
|
||||
options?: AxiosRequestConfig;
|
||||
schema?: z.ZodType;
|
||||
}
|
||||
|
||||
export interface IAxiosGetRequest {
|
||||
interface IAxiosGetRequest {
|
||||
endpoint: string;
|
||||
options?: AxiosRequestConfig;
|
||||
signal?: AbortSignal;
|
||||
|
|
|
@ -21,7 +21,7 @@ import { TableFooter } from './table-footer';
|
|||
import { TableHeader } from './table-header';
|
||||
import { useDataTable } from './use-data-table';
|
||||
|
||||
export { type ColumnSort, createColumnHelper, type RowSelectionState, type VisibilityState };
|
||||
export { createColumnHelper, type RowSelectionState, type VisibilityState };
|
||||
|
||||
/** Style to conditionally apply to rows. */
|
||||
export interface IConditionalStyle<TData> {
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
import { useCallback, useState } from 'react';
|
||||
import {
|
||||
type ColumnSort,
|
||||
createColumnHelper,
|
||||
getCoreRowModel,
|
||||
getPaginationRowModel,
|
||||
getSortedRowModel,
|
||||
|
@ -17,8 +16,6 @@ import {
|
|||
type VisibilityState
|
||||
} from '@tanstack/react-table';
|
||||
|
||||
export { type ColumnSort, createColumnHelper, type RowSelectionState, type VisibilityState };
|
||||
|
||||
/** Style to conditionally apply to rows. */
|
||||
export interface IConditionalStyle<TData> {
|
||||
/** Callback to determine if the style should be applied. */
|
||||
|
@ -28,7 +25,7 @@ export interface IConditionalStyle<TData> {
|
|||
style: React.CSSProperties;
|
||||
}
|
||||
|
||||
export interface UseDataTableProps<TData extends RowData>
|
||||
interface UseDataTableProps<TData extends RowData>
|
||||
extends Pick<TableOptions<TData>, 'data' | 'columns' | 'onRowSelectionChange' | 'onColumnVisibilityChange'> {
|
||||
/** Enable row selection. */
|
||||
enableRowSelection?: boolean;
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
import clsx from 'clsx';
|
||||
|
||||
import { Checkbox, type CheckboxProps } from '../input';
|
||||
|
||||
/** Animated {@link Checkbox} inside a {@link Dropdown} item. */
|
||||
export function DropdownCheckbox({ onChange: setValue, disabled, ...restProps }: CheckboxProps) {
|
||||
return (
|
||||
<div
|
||||
className={clsx(
|
||||
'px-3 py-1',
|
||||
'text-left text-ellipsis whitespace-nowrap',
|
||||
'disabled:clr-text-controls cc-animate-color',
|
||||
!!setValue && !disabled && 'clr-hover'
|
||||
)}
|
||||
>
|
||||
<Checkbox tabIndex={-1} disabled={disabled} onChange={setValue} {...restProps} />
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -1,4 +1,3 @@
|
|||
export { Dropdown } from './dropdown';
|
||||
export { DropdownButton } from './dropdown-button';
|
||||
export { DropdownCheckbox } from './dropdown-checkbox';
|
||||
export { useDropdown } from './use-dropdown';
|
||||
|
|
|
@ -6,7 +6,7 @@ import { CheckboxChecked, CheckboxNull } from '../icons';
|
|||
|
||||
import { type CheckboxProps } from './checkbox';
|
||||
|
||||
export interface CheckboxTristateProps extends Omit<CheckboxProps, 'value' | 'onChange'> {
|
||||
interface CheckboxTristateProps extends Omit<CheckboxProps, 'value' | 'onChange'> {
|
||||
/** Current value - `null`, `true` or `false`. */
|
||||
value: boolean | null;
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ export { FileInput } from './file-input';
|
|||
export { Label } from './label';
|
||||
export { SearchBar } from './search-bar';
|
||||
export { SelectMulti, type SelectMultiProps } from './select-multi';
|
||||
export { SelectSingle, type SelectSingleProps } from './select-single';
|
||||
export { SelectSingle } from './select-single';
|
||||
export { SelectTree } from './select-tree';
|
||||
export { TextArea } from './text-area';
|
||||
export { TextInput } from './text-input';
|
||||
|
|
|
@ -38,7 +38,7 @@ function ClearIndicator<Option, Group extends GroupBase<Option> = GroupBase<Opti
|
|||
);
|
||||
}
|
||||
|
||||
export interface SelectSingleProps<Option, Group extends GroupBase<Option> = GroupBase<Option>>
|
||||
interface SelectSingleProps<Option, Group extends GroupBase<Option> = GroupBase<Option>>
|
||||
extends Omit<Props<Option, false, Group>, 'theme' | 'menuPortalTarget'> {
|
||||
noPortal?: boolean;
|
||||
noBorder?: boolean;
|
||||
|
|
|
@ -5,7 +5,7 @@ import { type Editor, type ErrorProcessing, type Titled } from '../props';
|
|||
import { ErrorField } from './error-field';
|
||||
import { Label } from './label';
|
||||
|
||||
export interface TextAreaProps extends Editor, ErrorProcessing, Titled, React.ComponentProps<'textarea'> {
|
||||
interface TextAreaProps extends Editor, ErrorProcessing, Titled, React.ComponentProps<'textarea'> {
|
||||
/** Indicates that the input should be transparent. */
|
||||
transparent?: boolean;
|
||||
|
||||
|
|
|
@ -5,5 +5,4 @@ export { PDFViewer } from './pdf-viewer';
|
|||
export { PrettyJson } from './pretty-json';
|
||||
export { TextContent } from './text-content';
|
||||
export { ValueIcon } from './value-icon';
|
||||
export { ValueLabeled } from './value-labeled';
|
||||
export { ValueStats } from './value-stats';
|
||||
|
|
|
@ -5,7 +5,7 @@ import { truncateToLastWord } from '@/utils/utils';
|
|||
|
||||
import { type Styling } from '../props';
|
||||
|
||||
export interface TextContentProps extends Styling {
|
||||
interface TextContentProps extends Styling {
|
||||
/** Text to display. */
|
||||
text: string;
|
||||
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
import clsx from 'clsx';
|
||||
|
||||
import { type Styling } from '@/components/props';
|
||||
|
||||
interface ValueLabeledProps extends Styling {
|
||||
/** Id of the component. */
|
||||
id?: string;
|
||||
|
||||
/** Label to display. */
|
||||
label: string;
|
||||
|
||||
/** Value to display. */
|
||||
text: string | number;
|
||||
|
||||
/** Tooltip for the component. */
|
||||
title?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a labeled value.
|
||||
*/
|
||||
export function ValueLabeled({ id, label, text, title, className, ...restProps }: ValueLabeledProps) {
|
||||
return (
|
||||
<div className={clsx('flex justify-between gap-6', className)} {...restProps}>
|
||||
<span title={title}>{label}</span>
|
||||
<span id={id}>{text}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -1,53 +1,55 @@
|
|||
/**
|
||||
* Represents manuals topic.
|
||||
*/
|
||||
export enum HelpTopic {
|
||||
MAIN = 'main',
|
||||
export const HelpTopic = {
|
||||
MAIN: 'main',
|
||||
|
||||
THESAURUS = 'thesaurus',
|
||||
THESAURUS: 'thesaurus',
|
||||
|
||||
INTERFACE = 'user-interface',
|
||||
UI_LIBRARY = 'ui-library',
|
||||
UI_RS_MENU = 'ui-rsform-menu',
|
||||
UI_RS_CARD = 'ui-rsform-card',
|
||||
UI_RS_LIST = 'ui-rsform-list',
|
||||
UI_RS_EDITOR = 'ui-rsform-editor',
|
||||
UI_GRAPH_TERM = 'ui-graph-term',
|
||||
UI_FORMULA_TREE = 'ui-formula-tree',
|
||||
UI_TYPE_GRAPH = 'ui-type-graph',
|
||||
UI_CST_STATUS = 'ui-rsform-cst-status',
|
||||
UI_CST_CLASS = 'ui-rsform-cst-class',
|
||||
UI_OSS_GRAPH = 'ui-oss-graph',
|
||||
UI_SUBSTITUTIONS = 'ui-substitutions',
|
||||
UI_RELOCATE_CST = 'ui-relocate-cst',
|
||||
INTERFACE: 'user-interface',
|
||||
UI_LIBRARY: 'ui-library',
|
||||
UI_RS_MENU: 'ui-rsform-menu',
|
||||
UI_RS_CARD: 'ui-rsform-card',
|
||||
UI_RS_LIST: 'ui-rsform-list',
|
||||
UI_RS_EDITOR: 'ui-rsform-editor',
|
||||
UI_GRAPH_TERM: 'ui-graph-term',
|
||||
UI_FORMULA_TREE: 'ui-formula-tree',
|
||||
UI_TYPE_GRAPH: 'ui-type-graph',
|
||||
UI_CST_STATUS: 'ui-rsform-cst-status',
|
||||
UI_CST_CLASS: 'ui-rsform-cst-class',
|
||||
UI_OSS_GRAPH: 'ui-oss-graph',
|
||||
UI_SUBSTITUTIONS: 'ui-substitutions',
|
||||
UI_RELOCATE_CST: 'ui-relocate-cst',
|
||||
|
||||
CONCEPTUAL = 'concept',
|
||||
CC_SYSTEM = 'concept-rsform',
|
||||
CC_CONSTITUENTA = 'concept-constituenta',
|
||||
CC_RELATIONS = 'concept-relations',
|
||||
CC_SYNTHESIS = 'concept-synthesis',
|
||||
CC_OSS = 'concept-operations-schema',
|
||||
CC_PROPAGATION = 'concept-change-propagation',
|
||||
CONCEPTUAL: 'concept',
|
||||
CC_SYSTEM: 'concept-rsform',
|
||||
CC_CONSTITUENTA: 'concept-constituenta',
|
||||
CC_RELATIONS: 'concept-relations',
|
||||
CC_SYNTHESIS: 'concept-synthesis',
|
||||
CC_OSS: 'concept-operations-schema',
|
||||
CC_PROPAGATION: 'concept-change-propagation',
|
||||
|
||||
RSLANG = 'rslang',
|
||||
RSL_TYPES = 'rslang-types',
|
||||
RSL_CORRECT = 'rslang-correctness',
|
||||
RSL_INTERPRET = 'rslang-interpretation',
|
||||
RSL_OPERATIONS = 'rslang-operations',
|
||||
RSL_TEMPLATES = 'rslang-templates',
|
||||
RSLANG: 'rslang',
|
||||
RSL_TYPES: 'rslang-types',
|
||||
RSL_CORRECT: 'rslang-correctness',
|
||||
RSL_INTERPRET: 'rslang-interpretation',
|
||||
RSL_OPERATIONS: 'rslang-operations',
|
||||
RSL_TEMPLATES: 'rslang-templates',
|
||||
|
||||
TERM_CONTROL = 'terminology-control',
|
||||
ACCESS = 'access',
|
||||
VERSIONS = 'versions',
|
||||
TERM_CONTROL: 'terminology-control',
|
||||
ACCESS: 'access',
|
||||
VERSIONS: 'versions',
|
||||
|
||||
INFO = 'documentation',
|
||||
INFO_RULES = 'rules',
|
||||
INFO_CONTRIB = 'contributors',
|
||||
INFO_PRIVACY = 'privacy',
|
||||
INFO_API = 'api',
|
||||
INFO: 'documentation',
|
||||
INFO_RULES: 'rules',
|
||||
INFO_CONTRIB: 'contributors',
|
||||
INFO_PRIVACY: 'privacy',
|
||||
INFO_API: 'api',
|
||||
|
||||
EXTEOR = 'exteor'
|
||||
}
|
||||
EXTEOR: 'exteor'
|
||||
} as const;
|
||||
|
||||
export type HelpTopic = (typeof HelpTopic)[keyof typeof HelpTopic];
|
||||
|
||||
/**
|
||||
* Manual topics hierarchy.
|
||||
|
@ -99,8 +101,3 @@ export const topicParent = new Map<HelpTopic, HelpTopic>([
|
|||
|
||||
[HelpTopic.EXTEOR, HelpTopic.EXTEOR]
|
||||
]);
|
||||
|
||||
/**
|
||||
* Topics that can be folded.
|
||||
*/
|
||||
export const foldableTopics = [HelpTopic.INTERFACE, HelpTopic.RSLANG, HelpTopic.CONCEPTUAL, HelpTopic.INFO];
|
||||
|
|
|
@ -40,13 +40,6 @@ export function labelFolderNode(node: FolderNode): string {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves description for {@link FolderNode}.
|
||||
*/
|
||||
export function describeFolderNode(node: FolderNode): string {
|
||||
return `${node.filesInside} | ${node.filesTotal}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves label for {@link AccessPolicy}.
|
||||
*/
|
||||
|
|
|
@ -33,7 +33,7 @@ export interface DlgCreateOperationProps {
|
|||
onCreate?: (newID: number) => void;
|
||||
}
|
||||
|
||||
export enum TabID {
|
||||
enum TabID {
|
||||
INPUT = 0,
|
||||
SYNTHESIS = 1
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ export interface DlgEditOperationProps {
|
|||
positions: IOperationPosition[];
|
||||
}
|
||||
|
||||
export enum TabID {
|
||||
enum TabID {
|
||||
CARD = 0,
|
||||
ARGUMENTS = 1,
|
||||
SUBSTITUTION = 2
|
||||
|
|
|
@ -12,7 +12,7 @@ import { useRoleStore, UserRole } from '@/features/users';
|
|||
import { usePreferencesStore } from '@/stores/preferences';
|
||||
import { promptText } from '@/utils/labels';
|
||||
|
||||
import { type IOperationPosition, OperationType } from '../../backend/types';
|
||||
import { OperationType } from '../../backend/types';
|
||||
import { useOssSuspense } from '../../backend/use-oss';
|
||||
import { type IOperation, type IOperationSchema } from '../../models/oss';
|
||||
|
||||
|
@ -21,14 +21,6 @@ export enum OssTabID {
|
|||
GRAPH = 1
|
||||
}
|
||||
|
||||
export interface ICreateOperationPrompt {
|
||||
defaultX: number;
|
||||
defaultY: number;
|
||||
inputs: number[];
|
||||
positions: IOperationPosition[];
|
||||
callback: (newID: number) => void;
|
||||
}
|
||||
|
||||
export interface IOssEditContext {
|
||||
schema: IOperationSchema;
|
||||
selected: number[];
|
||||
|
@ -44,7 +36,7 @@ export interface IOssEditContext {
|
|||
setSelected: React.Dispatch<React.SetStateAction<number[]>>;
|
||||
}
|
||||
|
||||
export const OssEditContext = createContext<IOssEditContext | null>(null);
|
||||
const OssEditContext = createContext<IOssEditContext | null>(null);
|
||||
export const useOssEdit = () => {
|
||||
const context = use(OssEditContext);
|
||||
if (context === null) {
|
||||
|
|
|
@ -233,22 +233,6 @@ export function colorBgSchemas(schema_index: number): string {
|
|||
return APP_COLORS.bgBlue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines background color for {@link GramData}.
|
||||
*/
|
||||
export function colorBgGrammeme(gram: GramData): string {
|
||||
if (PartOfSpeech.includes(gram as Grammeme)) {
|
||||
return APP_COLORS.bgBlue;
|
||||
}
|
||||
if (NounGrams.includes(gram as Grammeme)) {
|
||||
return APP_COLORS.bgGreen;
|
||||
}
|
||||
if (VerbGrams.includes(gram as Grammeme)) {
|
||||
return APP_COLORS.bgTeal;
|
||||
}
|
||||
return APP_COLORS.bgInput;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines foreground color for {@link GramData}.
|
||||
*/
|
||||
|
|
|
@ -27,7 +27,7 @@ export interface DlgCstTemplateProps {
|
|||
insertAfter?: number;
|
||||
}
|
||||
|
||||
export enum TabID {
|
||||
enum TabID {
|
||||
TEMPLATE = 0,
|
||||
ARGUMENTS = 1,
|
||||
CONSTITUENTA = 2
|
||||
|
|
|
@ -25,7 +25,7 @@ export interface ITemplateContext {
|
|||
onChangeFilterCategory: (newFilterCategory: IConstituenta | null) => void;
|
||||
}
|
||||
|
||||
export const TemplateContext = createContext<ITemplateContext | null>(null);
|
||||
const TemplateContext = createContext<ITemplateContext | null>(null);
|
||||
export const useTemplateContext = () => {
|
||||
const context = use(TemplateContext);
|
||||
if (context === null) {
|
||||
|
|
|
@ -56,7 +56,7 @@ export interface DlgEditReferenceProps {
|
|||
onCancel: () => void;
|
||||
}
|
||||
|
||||
export enum TabID {
|
||||
enum TabID {
|
||||
ENTITY = 0,
|
||||
SYNTACTIC = 1
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ export interface DlgInlineSynthesisProps {
|
|||
onSynthesis: () => void;
|
||||
}
|
||||
|
||||
export enum TabID {
|
||||
enum TabID {
|
||||
SCHEMA = 0,
|
||||
SELECTIONS = 1,
|
||||
SUBSTITUTIONS = 2
|
||||
|
|
|
@ -260,14 +260,6 @@ export interface ISyntacticReference {
|
|||
nominal: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents text 0-indexed position inside another text.
|
||||
*/
|
||||
export interface ITextPosition {
|
||||
start: number;
|
||||
finish: number;
|
||||
}
|
||||
|
||||
export const schemaReference = z.strictObject({
|
||||
type: z.nativeEnum(ReferenceType),
|
||||
data: z.union([
|
||||
|
|
|
@ -32,8 +32,8 @@ import { ToolbarTermGraph } from './toolbar-term-graph';
|
|||
import { useFilteredGraph } from './use-filtered-graph';
|
||||
import { ViewHidden } from './view-hidden';
|
||||
|
||||
export const ZOOM_MAX = 3;
|
||||
export const ZOOM_MIN = 0.25;
|
||||
const ZOOM_MAX = 3;
|
||||
const ZOOM_MIN = 0.25;
|
||||
export const VIEW_PADDING = 0.3;
|
||||
|
||||
export function TGFlow() {
|
||||
|
|
|
@ -66,7 +66,7 @@ export interface IRSEditContext {
|
|||
promptTemplate: () => void;
|
||||
}
|
||||
|
||||
export const RSEditContext = createContext<IRSEditContext | null>(null);
|
||||
const RSEditContext = createContext<IRSEditContext | null>(null);
|
||||
export const useRSEdit = () => {
|
||||
const context = use(RSEditContext);
|
||||
if (context === null) {
|
||||
|
|
|
@ -3,13 +3,7 @@ import { z } from 'zod';
|
|||
import { patterns } from '@/utils/constants';
|
||||
import { errorMsg } from '@/utils/labels';
|
||||
|
||||
/**
|
||||
* Represents user detailed information.
|
||||
* Some information should only be accessible to authorized users
|
||||
*/
|
||||
export type IUser = z.infer<typeof schemaUser>;
|
||||
|
||||
/** Represents user profile for viewing and editing {@link IUser}. */
|
||||
/** Represents user profile for viewing and editing. */
|
||||
export type IUserProfile = z.infer<typeof schemaUserProfile>;
|
||||
|
||||
/** Represents user reference information. */
|
||||
|
|
|
@ -52,7 +52,7 @@ export enum DialogType {
|
|||
UPLOAD_RSFORM
|
||||
}
|
||||
|
||||
export interface GenericDialogProps {
|
||||
interface DialogProps {
|
||||
onHide?: () => void;
|
||||
}
|
||||
|
||||
|
@ -91,7 +91,7 @@ export const useDialogsStore = create<DialogsStore>()(set => ({
|
|||
props: null,
|
||||
hideDialog: () => {
|
||||
set(state => {
|
||||
(state.props as GenericDialogProps | null)?.onHide?.();
|
||||
(state.props as DialogProps | null)?.onHide?.();
|
||||
return { active: null, props: null };
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue
Block a user