tycho-components 0.12.4 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Header/Header.d.ts +1 -2
- package/dist/Header/Header.js +2 -2
- package/dist/Header/HeaderApps/HeaderApps.d.ts +1 -5
- package/dist/Header/HeaderApps/HeaderApps.js +3 -3
- package/dist/Header/HeaderCorpora/HeaderCorpora.d.ts +2 -3
- package/dist/Header/HeaderCorpora/HeaderCorpora.js +15 -13
- package/dist/Header/types/App.d.ts +1 -1
- package/dist/Header/types/App.js +30 -30
- package/package.json +1 -1
package/dist/Header/Header.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ type Props = {
|
|
|
4
4
|
tool: string;
|
|
5
5
|
redirect?: string;
|
|
6
6
|
autoload?: boolean;
|
|
7
|
-
freeAccess?: boolean;
|
|
8
7
|
hideKeyboard?: boolean;
|
|
9
8
|
hideReplaceAll?: boolean;
|
|
10
9
|
parser?: boolean;
|
|
@@ -20,5 +19,5 @@ type Props = {
|
|
|
20
19
|
navigateNotLogged?: () => void;
|
|
21
20
|
helpActions?: HelpAction[];
|
|
22
21
|
};
|
|
23
|
-
export default function Header({ tool, redirect, autoload,
|
|
22
|
+
export default function Header({ tool, redirect, autoload, hideKeyboard, hideReplaceAll, customHeader, notifications, keyboardLayout, navigateHome, navigateCorpora, navigateLogout, navigateNotLogged, helpActions, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
24
23
|
export {};
|
package/dist/Header/Header.js
CHANGED
|
@@ -14,7 +14,7 @@ import HeaderReplaceAll from './HeaderReplaceAll';
|
|
|
14
14
|
import HeaderUser from './HeaderUser';
|
|
15
15
|
import HelpButton from './HelpButton';
|
|
16
16
|
import './styles.scss';
|
|
17
|
-
export default function Header({ tool, redirect, autoload,
|
|
17
|
+
export default function Header({ tool, redirect, autoload, hideKeyboard, hideReplaceAll, customHeader, notifications, keyboardLayout, navigateHome, navigateCorpora, navigateLogout, navigateNotLogged = () => {
|
|
18
18
|
location.href = '/auth';
|
|
19
19
|
}, helpActions, }) {
|
|
20
20
|
const { t } = useTranslation('header');
|
|
@@ -24,5 +24,5 @@ export default function Header({ tool, redirect, autoload, freeAccess, hideKeybo
|
|
|
24
24
|
const homeTextsClass = cx('app-title', {
|
|
25
25
|
pointer: navigateHome !== undefined,
|
|
26
26
|
});
|
|
27
|
-
return (_jsxs("div", { className: "ds-header", children: [_jsxs("div", { className: "header-left", children: [_jsx(HeaderApps, {
|
|
27
|
+
return (_jsxs("div", { className: "ds-header", children: [_jsxs("div", { className: "header-left", children: [_jsx(HeaderApps, {}), _jsxs("div", { className: homeTextsClass, onClick: () => navigateHome && navigateHome(), children: [_jsx("span", { className: "title", children: t('label.platform') }), _jsx("span", { className: "subtitle", children: tool })] })] }), _jsx("div", { className: "header-center", children: customHeader ? (customHeader) : (_jsx(HeaderCorpora, { redirect: redirect, autoload: autoload, navigateCorpora: navigateCorpora })) }), _jsxs("div", { className: "header-right", children: [!hideReplaceAll && _jsx(HeaderReplaceAll, {}), !hideKeyboard && (_jsx(IconButton, { onClick: () => setOpenKeyboard(!openKeyboard), name: "keyboard", size: "medium", title: t('tooltip.keyboard') })), _jsx(HelpButton, { helpActions: helpActions }), notifications && isLogged() && (_jsx(HeaderNotifications, { uid: notifications.ref, mode: notifications.mode })), _jsx(LanguageSelector, {}), _jsx(HeaderUser, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged })] }), openKeyboard && (_jsx(VirtualKeyboard, { onClose: () => setOpenKeyboard(false), closeLabel: t('button.close'), defaultLayout: keyboardLayout || getCorpus().keyboardLayout || 'english' }))] }));
|
|
28
28
|
}
|
|
@@ -8,10 +8,10 @@ import { useLoggedUtils } from '../../configs/useLoggedUtils';
|
|
|
8
8
|
import { AvailableApps } from '../types/App';
|
|
9
9
|
import logo from './logo.png';
|
|
10
10
|
import './style.scss';
|
|
11
|
-
export default function HeaderApps(
|
|
11
|
+
export default function HeaderApps() {
|
|
12
12
|
const { t } = useTranslation('header-app');
|
|
13
13
|
const { getCorpus, hasCorpus } = useCorpusUtils();
|
|
14
|
-
const { hasLexiconAccess, hasParserAccess, isAdminOfAnyCorpus } = useLoggedUtils();
|
|
14
|
+
const { hasLexiconAccess, hasParserAccess, isAdminOfAnyCorpus, isLogged } = useLoggedUtils();
|
|
15
15
|
const [open, setOpen] = useState(false);
|
|
16
16
|
const goto = (app, blank) => {
|
|
17
17
|
const shouldAppendCorpusUid = app.appendCorpusUid !== false;
|
|
@@ -26,7 +26,7 @@ export default function HeaderApps({ freeAccess }) {
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
const renderItem = (item, idx) => {
|
|
29
|
-
if (
|
|
29
|
+
if (item.visibility === 'private' && !isLogged())
|
|
30
30
|
return null;
|
|
31
31
|
if (item.admin && !isAdminOfAnyCorpus())
|
|
32
32
|
return null;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import './style.scss';
|
|
2
2
|
type Props = {
|
|
3
3
|
navigateCorpora?: (uid: string) => void;
|
|
4
4
|
autoload?: boolean;
|
|
5
5
|
redirect?: string;
|
|
6
|
-
freeAccess?: boolean;
|
|
7
6
|
};
|
|
8
|
-
export default function HeaderCorpora({ navigateCorpora, redirect, autoload,
|
|
7
|
+
export default function HeaderCorpora({ navigateCorpora, redirect, autoload, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useState } from
|
|
3
|
-
import { useTranslation } from
|
|
4
|
-
import { useParams } from
|
|
5
|
-
import AppModal from
|
|
6
|
-
import AppPicture from
|
|
7
|
-
import { useCorpusUtils } from
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { useTranslation } from 'react-i18next';
|
|
4
|
+
import { useParams } from 'react-router-dom';
|
|
5
|
+
import AppModal from '../../AppModal';
|
|
6
|
+
import AppPicture from '../../AppPicture';
|
|
7
|
+
import { useCorpusUtils } from '../../configs/useCorpusUtils';
|
|
8
|
+
import { useLoggedUtils } from '../../configs/useLoggedUtils';
|
|
9
|
+
import CorpusService from '../types/CorpusService';
|
|
10
|
+
import HeaderCorpus from './HeaderCorpus';
|
|
11
|
+
import './style.scss';
|
|
12
|
+
export default function HeaderCorpora({ navigateCorpora, redirect, autoload, }) {
|
|
13
|
+
const { t } = useTranslation('header');
|
|
13
14
|
const { setCorpus, getCorpus, hasCorpus } = useCorpusUtils();
|
|
15
|
+
const { isLogged } = useLoggedUtils();
|
|
14
16
|
const { uid } = useParams();
|
|
15
17
|
const [corpora, setCorpora] = useState([]);
|
|
16
18
|
const [openCorpora, setOpenCorpora] = useState(false);
|
|
@@ -56,7 +58,7 @@ export default function HeaderCorpora({ navigateCorpora, redirect, autoload, fre
|
|
|
56
58
|
}
|
|
57
59
|
};
|
|
58
60
|
const handleCorpusClick = () => {
|
|
59
|
-
if (
|
|
61
|
+
if (isLogged() && hasCorpus()) {
|
|
60
62
|
navigateCorpora && navigateCorpora(getCorpus().uid);
|
|
61
63
|
}
|
|
62
64
|
else {
|
|
@@ -69,5 +71,5 @@ export default function HeaderCorpora({ navigateCorpora, redirect, autoload, fre
|
|
|
69
71
|
useEffect(() => {
|
|
70
72
|
autoload && loadAndApply();
|
|
71
73
|
}, [autoload]);
|
|
72
|
-
return (_jsxs(_Fragment, { children: [hasCorpus() && _jsx(HeaderCorpus, { onClick: handleCorpusClick }), openCorpora && (_jsx(AppModal, { className: "modal-corpora", title: t(
|
|
74
|
+
return (_jsxs(_Fragment, { children: [hasCorpus() && _jsx(HeaderCorpus, { onClick: handleCorpusClick }), openCorpora && (_jsx(AppModal, { className: "modal-corpora", title: t('label.choose'), close: () => setOpenCorpora(false), children: corpora.map((corpus) => (_jsxs("div", { className: "item", onClick: () => handleChooseCorpus(corpus), children: [_jsx(AppPicture, { src: corpus.picture, title: corpus.name, className: "modal-corpus-image" }), _jsx("span", { children: corpus.name })] }, corpus.uid))) }))] }));
|
|
73
75
|
}
|
package/dist/Header/types/App.js
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
export const AvailableApps = [
|
|
2
2
|
{
|
|
3
|
-
code:
|
|
4
|
-
icon:
|
|
5
|
-
visibility:
|
|
3
|
+
code: 'reserved',
|
|
4
|
+
icon: 'lock',
|
|
5
|
+
visibility: 'private',
|
|
6
6
|
appendCorpusUid: false,
|
|
7
7
|
},
|
|
8
8
|
{
|
|
9
|
-
code:
|
|
10
|
-
icon:
|
|
11
|
-
visibility:
|
|
9
|
+
code: 'catalog',
|
|
10
|
+
icon: 'auto_stories',
|
|
11
|
+
visibility: 'private',
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
code:
|
|
15
|
-
icon:
|
|
16
|
-
visibility:
|
|
14
|
+
code: 'admin',
|
|
15
|
+
icon: 'folder_managed',
|
|
16
|
+
visibility: 'private',
|
|
17
17
|
admin: true,
|
|
18
18
|
},
|
|
19
19
|
{
|
|
20
|
-
code:
|
|
21
|
-
icon:
|
|
22
|
-
visibility:
|
|
20
|
+
code: 'parser',
|
|
21
|
+
icon: 'settings',
|
|
22
|
+
visibility: 'private',
|
|
23
23
|
parser: true,
|
|
24
24
|
appendCorpusUid: false,
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
|
-
code:
|
|
28
|
-
icon:
|
|
29
|
-
visibility:
|
|
27
|
+
code: 'io',
|
|
28
|
+
icon: 'swap_vert',
|
|
29
|
+
visibility: 'private',
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
|
-
code:
|
|
33
|
-
icon:
|
|
34
|
-
visibility:
|
|
32
|
+
code: 'lexicon',
|
|
33
|
+
icon: 'book_3',
|
|
34
|
+
visibility: 'private',
|
|
35
35
|
lexicon: true,
|
|
36
36
|
appendCorpusUid: false,
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
|
-
code:
|
|
40
|
-
icon:
|
|
41
|
-
visibility:
|
|
39
|
+
code: 'search',
|
|
40
|
+
icon: 'match_word',
|
|
41
|
+
visibility: 'public',
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
|
-
code:
|
|
45
|
-
icon:
|
|
46
|
-
visibility:
|
|
44
|
+
code: 'viewer',
|
|
45
|
+
icon: 'news',
|
|
46
|
+
visibility: 'public',
|
|
47
47
|
appendCorpusUid: false,
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
|
-
code:
|
|
51
|
-
icon:
|
|
52
|
-
visibility:
|
|
50
|
+
code: 'syntrees',
|
|
51
|
+
icon: 'graph_4',
|
|
52
|
+
visibility: 'public',
|
|
53
53
|
appendCorpusUid: false,
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
|
-
code:
|
|
57
|
-
icon:
|
|
58
|
-
visibility:
|
|
56
|
+
code: 'psd-reindexer',
|
|
57
|
+
icon: '123',
|
|
58
|
+
visibility: 'public',
|
|
59
59
|
appendCorpusUid: false,
|
|
60
60
|
},
|
|
61
61
|
];
|