mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 21:10:38 +03:00
Decouple dialogs and pages
This commit is contained in:
parent
ce1cd7f6ca
commit
97a2585185
|
@ -1,6 +1,6 @@
|
||||||
import ConceptTooltip from '../../../components/Common/ConceptTooltip';
|
import { IConstituenta } from '../../models/rsform';
|
||||||
import InfoConstituenta from '../../../components/Help/InfoConstituenta';
|
import ConceptTooltip from '../Common/ConceptTooltip';
|
||||||
import { IConstituenta } from '../../../models/rsform';
|
import InfoConstituenta from './InfoConstituenta';
|
||||||
|
|
||||||
interface ConstituentaTooltipProps {
|
interface ConstituentaTooltipProps {
|
||||||
data: IConstituenta
|
data: IConstituenta
|
|
@ -1,6 +1,6 @@
|
||||||
|
import SwitchButton from '../../components/Common/SwitchButton';
|
||||||
import { ReferenceType } from '../../models/language';
|
import { ReferenceType } from '../../models/language';
|
||||||
import { labelReferenceType } from '../../utils/labels';
|
import { labelReferenceType } from '../../utils/labels';
|
||||||
import SwitchButton from '../Common/SwitchButton';
|
|
||||||
|
|
||||||
interface ReferenceTypeButtonProps {
|
interface ReferenceTypeButtonProps {
|
||||||
type: ReferenceType
|
type: ReferenceType
|
|
@ -1,28 +1,28 @@
|
||||||
import { createColumnHelper } from '@tanstack/react-table';
|
import { createColumnHelper } from '@tanstack/react-table';
|
||||||
import { useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react';
|
import { useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react';
|
||||||
|
|
||||||
import ConceptTooltip from '../components/Common/ConceptTooltip';
|
import ConceptTooltip from '../../components/Common/ConceptTooltip';
|
||||||
import Label from '../components/Common/Label';
|
import Label from '../../components/Common/Label';
|
||||||
import Modal from '../components/Common/Modal';
|
import Modal from '../../components/Common/Modal';
|
||||||
import SelectMulti from '../components/Common/SelectMulti';
|
import SelectMulti from '../../components/Common/SelectMulti';
|
||||||
import TextInput from '../components/Common/TextInput';
|
import TextInput from '../../components/Common/TextInput';
|
||||||
import DataTable, { IConditionalStyle } from '../components/DataTable';
|
import DataTable, { IConditionalStyle } from '../../components/DataTable';
|
||||||
import HelpTerminologyControl from '../components/Help/HelpTerminologyControl';
|
import ConstituentaTooltip from '../../components/Help/ConstituentaTooltip';
|
||||||
import { HelpIcon, MagnifyingGlassIcon } from '../components/Icons';
|
import HelpTerminologyControl from '../../components/Help/HelpTerminologyControl';
|
||||||
import ReferenceTypeButton from '../components/RefsInput/ReferenceTypeButton';
|
import { HelpIcon, MagnifyingGlassIcon } from '../../components/Icons';
|
||||||
import WordformButton from '../components/RefsInput/WordformButton';
|
import { useConceptTheme } from '../../context/ThemeContext';
|
||||||
import { useConceptTheme } from '../context/ThemeContext';
|
|
||||||
import {
|
import {
|
||||||
getCompatibleGrams, Grammeme,
|
getCompatibleGrams, Grammeme,
|
||||||
parseEntityReference, parseGrammemes,
|
parseEntityReference, parseGrammemes,
|
||||||
parseSyntacticReference, ReferenceType
|
parseSyntacticReference, ReferenceType
|
||||||
} from '../models/language';
|
} from '../../models/language';
|
||||||
import { CstMatchMode } from '../models/miscelanious';
|
import { CstMatchMode } from '../../models/miscelanious';
|
||||||
import { IConstituenta, matchConstituenta } from '../models/rsform';
|
import { IConstituenta, matchConstituenta } from '../../models/rsform';
|
||||||
import ConstituentaTooltip from '../pages/RSFormPage/elements/ConstituentaTooltip';
|
import { colorfgCstStatus } from '../../utils/color';
|
||||||
import { colorfgCstStatus } from '../utils/color';
|
import { prefixes } from '../../utils/constants';
|
||||||
import { prefixes } from '../utils/constants';
|
import { compareGrammemeOptions, IGrammemeOption, PremadeWordForms, SelectorGrammems } from '../../utils/selectors';
|
||||||
import { compareGrammemeOptions, IGrammemeOption, PremadeWordForms, SelectorGrammems } from '../utils/selectors';
|
import ReferenceTypeButton from './ReferenceTypeButton';
|
||||||
|
import WordformButton from './WordformButton';
|
||||||
|
|
||||||
export interface IReferenceInputState {
|
export interface IReferenceInputState {
|
||||||
type: ReferenceType
|
type: ReferenceType
|
|
@ -2,8 +2,8 @@ import { useLayoutEffect, useState } from 'react';
|
||||||
|
|
||||||
import Checkbox from '../components/Common/Checkbox';
|
import Checkbox from '../components/Common/Checkbox';
|
||||||
import Modal, { ModalProps } from '../components/Common/Modal';
|
import Modal, { ModalProps } from '../components/Common/Modal';
|
||||||
|
import { GraphEditorParams } from '../models/miscelanious';
|
||||||
import { CstType } from '../models/rsform';
|
import { CstType } from '../models/rsform';
|
||||||
import { GraphEditorParams } from '../pages/RSFormPage/EditorTermGraph';
|
|
||||||
import { labelCstType } from '../utils/labels';
|
import { labelCstType } from '../utils/labels';
|
||||||
|
|
||||||
interface DlgGraphOptionsProps
|
interface DlgGraphOptionsProps
|
||||||
|
|
|
@ -2,7 +2,9 @@
|
||||||
|
|
||||||
import { IConstituenta, IRSForm } from './rsform'
|
import { IConstituenta, IRSForm } from './rsform'
|
||||||
|
|
||||||
// Dependency mode for schema analysis
|
/**
|
||||||
|
* Represents graph dependency mode.
|
||||||
|
*/
|
||||||
export enum DependencyMode {
|
export enum DependencyMode {
|
||||||
ALL = 0,
|
ALL = 0,
|
||||||
EXPRESSION,
|
EXPRESSION,
|
||||||
|
@ -12,7 +14,9 @@ export enum DependencyMode {
|
||||||
EXPAND_INPUTS
|
EXPAND_INPUTS
|
||||||
}
|
}
|
||||||
|
|
||||||
// Help manual topic compare mode
|
/**
|
||||||
|
* Represents manuals topic.
|
||||||
|
*/
|
||||||
export enum HelpTopic {
|
export enum HelpTopic {
|
||||||
MAIN = 'main',
|
MAIN = 'main',
|
||||||
LIBRARY = 'library',
|
LIBRARY = 'library',
|
||||||
|
@ -27,7 +31,9 @@ export enum HelpTopic {
|
||||||
API = 'api'
|
API = 'api'
|
||||||
}
|
}
|
||||||
|
|
||||||
// Constituent compare mode
|
/**
|
||||||
|
* Represents {@link IConstituenta} matching mode.
|
||||||
|
*/
|
||||||
export enum CstMatchMode {
|
export enum CstMatchMode {
|
||||||
ALL = 1,
|
ALL = 1,
|
||||||
EXPR,
|
EXPR,
|
||||||
|
@ -36,6 +42,9 @@ export enum CstMatchMode {
|
||||||
NAME
|
NAME
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents Library filter parameters.
|
||||||
|
*/
|
||||||
export interface ILibraryFilter {
|
export interface ILibraryFilter {
|
||||||
query?: string
|
query?: string
|
||||||
is_personal?: boolean
|
is_personal?: boolean
|
||||||
|
@ -45,7 +54,9 @@ export interface ILibraryFilter {
|
||||||
is_subscribed?: boolean
|
is_subscribed?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
// Library premade filters
|
/**
|
||||||
|
* Represents filtering strategy for Library.
|
||||||
|
*/
|
||||||
export enum LibraryFilterStrategy {
|
export enum LibraryFilterStrategy {
|
||||||
MANUAL = 'manual',
|
MANUAL = 'manual',
|
||||||
PERSONAL = 'personal',
|
PERSONAL = 'personal',
|
||||||
|
@ -55,6 +66,25 @@ export enum LibraryFilterStrategy {
|
||||||
OWNED = 'owned'
|
OWNED = 'owned'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents parameters for GraphEditor.
|
||||||
|
*/
|
||||||
|
export interface GraphEditorParams {
|
||||||
|
noHermits: boolean
|
||||||
|
noTransitive: boolean
|
||||||
|
noTemplates: boolean
|
||||||
|
noTerms: boolean
|
||||||
|
|
||||||
|
allowBase: boolean
|
||||||
|
allowStruct: boolean
|
||||||
|
allowTerm: boolean
|
||||||
|
allowAxiom: boolean
|
||||||
|
allowFunction: boolean
|
||||||
|
allowPredicate: boolean
|
||||||
|
allowConstant: boolean
|
||||||
|
allowTheorem: boolean
|
||||||
|
}
|
||||||
|
|
||||||
// ================== API ====================
|
// ================== API ====================
|
||||||
export function applyGraphFilter(schema: IRSForm, start: number, mode: DependencyMode): IConstituenta[] {
|
export function applyGraphFilter(schema: IRSForm, start: number, mode: DependencyMode): IConstituenta[] {
|
||||||
if (mode === DependencyMode.ALL) {
|
if (mode === DependencyMode.ALL) {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import { GraphCanvas, GraphCanvasRef, GraphEdge,
|
||||||
import ConceptTooltip from '../../components/Common/ConceptTooltip';
|
import ConceptTooltip from '../../components/Common/ConceptTooltip';
|
||||||
import MiniButton from '../../components/Common/MiniButton';
|
import MiniButton from '../../components/Common/MiniButton';
|
||||||
import SelectSingle from '../../components/Common/SelectSingle';
|
import SelectSingle from '../../components/Common/SelectSingle';
|
||||||
|
import ConstituentaTooltip from '../../components/Help/ConstituentaTooltip';
|
||||||
import HelpTermGraph from '../../components/Help/HelpTermGraph';
|
import HelpTermGraph from '../../components/Help/HelpTermGraph';
|
||||||
import InfoConstituenta from '../../components/Help/InfoConstituenta';
|
import InfoConstituenta from '../../components/Help/InfoConstituenta';
|
||||||
import { ArrowsFocusIcon, DumpBinIcon, FilterIcon, HelpIcon, LetterAIcon, LetterALinesIcon, PlanetIcon, SmallPlusIcon } from '../../components/Icons';
|
import { ArrowsFocusIcon, DumpBinIcon, FilterIcon, HelpIcon, LetterAIcon, LetterALinesIcon, PlanetIcon, SmallPlusIcon } from '../../components/Icons';
|
||||||
|
@ -13,6 +14,7 @@ import { useRSForm } from '../../context/RSFormContext';
|
||||||
import { useConceptTheme } from '../../context/ThemeContext';
|
import { useConceptTheme } from '../../context/ThemeContext';
|
||||||
import DlgGraphOptions from '../../dialogs/DlgGraphOptions';
|
import DlgGraphOptions from '../../dialogs/DlgGraphOptions';
|
||||||
import useLocalStorage from '../../hooks/useLocalStorage';
|
import useLocalStorage from '../../hooks/useLocalStorage';
|
||||||
|
import { GraphEditorParams } from '../../models/miscelanious';
|
||||||
import { CstType, IConstituenta, ICstCreateData } from '../../models/rsform';
|
import { CstType, IConstituenta, ICstCreateData } from '../../models/rsform';
|
||||||
import { graphDarkT, graphLightT, IColorTheme } from '../../utils/color';
|
import { graphDarkT, graphLightT, IColorTheme } from '../../utils/color';
|
||||||
import { colorbgCstClass } from '../../utils/color';
|
import { colorbgCstClass } from '../../utils/color';
|
||||||
|
@ -23,7 +25,6 @@ import { mapLabelColoring } from '../../utils/labels';
|
||||||
import { mapLableLayout } from '../../utils/labels';
|
import { mapLableLayout } from '../../utils/labels';
|
||||||
import { SelectorGraphLayout } from '../../utils/selectors';
|
import { SelectorGraphLayout } from '../../utils/selectors';
|
||||||
import { SelectorGraphColoring } from '../../utils/selectors';
|
import { SelectorGraphColoring } from '../../utils/selectors';
|
||||||
import ConstituentaTooltip from './elements/ConstituentaTooltip';
|
|
||||||
|
|
||||||
export type ColoringScheme = 'none' | 'status' | 'type';
|
export type ColoringScheme = 'none' | 'status' | 'type';
|
||||||
const TREE_SIZE_MILESTONE = 50;
|
const TREE_SIZE_MILESTONE = 50;
|
||||||
|
@ -38,22 +39,6 @@ function getCstNodeColor(cst: IConstituenta, coloringScheme: ColoringScheme, col
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GraphEditorParams {
|
|
||||||
noHermits: boolean
|
|
||||||
noTransitive: boolean
|
|
||||||
noTemplates: boolean
|
|
||||||
noTerms: boolean
|
|
||||||
|
|
||||||
allowBase: boolean
|
|
||||||
allowStruct: boolean
|
|
||||||
allowTerm: boolean
|
|
||||||
allowAxiom: boolean
|
|
||||||
allowFunction: boolean
|
|
||||||
allowPredicate: boolean
|
|
||||||
allowConstant: boolean
|
|
||||||
allowTheorem: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
interface EditorTermGraphProps {
|
interface EditorTermGraphProps {
|
||||||
onOpenEdit: (cstID: number) => void
|
onOpenEdit: (cstID: number) => void
|
||||||
onCreateCst: (initial: ICstCreateData, skipDialog?: boolean) => void
|
onCreateCst: (initial: ICstCreateData, skipDialog?: boolean) => void
|
||||||
|
|
|
@ -22,7 +22,7 @@ import {
|
||||||
describeCstSource, labelCstMathchMode,
|
describeCstSource, labelCstMathchMode,
|
||||||
labelCstSource
|
labelCstSource
|
||||||
} from '../../../utils/labels';
|
} from '../../../utils/labels';
|
||||||
import ConstituentaTooltip from './ConstituentaTooltip';
|
import ConstituentaTooltip from '../../../components/Help/ConstituentaTooltip';
|
||||||
|
|
||||||
// Height that should be left to accomodate navigation panel + bottom margin
|
// Height that should be left to accomodate navigation panel + bottom margin
|
||||||
const LOCAL_NAVIGATION_H = '2.1rem';
|
const LOCAL_NAVIGATION_H = '2.1rem';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user