tycho-components 0.42.5 → 0.43.0
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/configs/index.d.ts +1 -1
- package/dist/configs/types/Corpus.d.ts +0 -10
- package/dist/shell/Header/Header.d.ts +7 -1
- package/dist/shell/Header/Header.js +2 -2
- package/dist/shell/Header/HeaderApps/HeaderApps.d.ts +3 -1
- package/dist/shell/Header/HeaderApps/HeaderApps.js +20 -18
- package/package.json +1 -1
package/dist/configs/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { ApplyAuthErrorHandlingOptions, AuthErrorHandling, CreateApiClientO
|
|
|
7
7
|
export { getCommonDispatch, registerCommonDispatch, } from "./store/commonDispatchBridge";
|
|
8
8
|
export { commonResources, featureResources, mergeResources, commonLocalization, } from "./Localization";
|
|
9
9
|
export { default as ProfileService } from "./services/ProfileService";
|
|
10
|
-
export type { Corpus, CorpusRequest
|
|
10
|
+
export type { Corpus, CorpusRequest } from "./types/Corpus";
|
|
11
11
|
export { CorpusStatusNames } from "./types/CorpusStatus";
|
|
12
12
|
export type { CorpusStatus } from "./types/CorpusStatus";
|
|
13
13
|
export { DocumentStatusNames, DocumentEditableStatusNames, DocumentStatusTagColors, } from "./types/Document";
|
|
@@ -16,7 +16,6 @@ export type Corpus = {
|
|
|
16
16
|
opened: boolean;
|
|
17
17
|
featured?: boolean;
|
|
18
18
|
owner?: User;
|
|
19
|
-
github?: Github;
|
|
20
19
|
images?: CorpusImage[];
|
|
21
20
|
keyboardLayout?: string;
|
|
22
21
|
catalog?: string[];
|
|
@@ -49,14 +48,5 @@ export type CorpusRequest = {
|
|
|
49
48
|
rejectedDate: string | null;
|
|
50
49
|
confirmedDate: string | null;
|
|
51
50
|
};
|
|
52
|
-
export type Github = {
|
|
53
|
-
username: string;
|
|
54
|
-
token: string;
|
|
55
|
-
remote: string;
|
|
56
|
-
path: string;
|
|
57
|
-
branch: string;
|
|
58
|
-
commit: string;
|
|
59
|
-
isPublic: boolean;
|
|
60
|
-
};
|
|
61
51
|
export declare const EMPTY_CORPUS: Corpus;
|
|
62
52
|
export {};
|
|
@@ -22,6 +22,12 @@ type Props = {
|
|
|
22
22
|
hideNotifications?: boolean;
|
|
23
23
|
hideLanguageSelector?: boolean;
|
|
24
24
|
hideHelpButton?: boolean;
|
|
25
|
+
/** Overrides i18n `label.platform` (e.g. CorpusHub whitelabel). */
|
|
26
|
+
platformName?: string;
|
|
27
|
+
/** Overrides i18n `label.platform.complete` in the apps drawer. */
|
|
28
|
+
platformCompleteName?: string;
|
|
29
|
+
/** Overrides the apps-drawer platform tile image. */
|
|
30
|
+
platformLogo?: string;
|
|
25
31
|
};
|
|
26
|
-
export default function Header({ tool, redirect, autoload, hideKeyboard, customHeader, notifications, keyboardLayout, navigateHome, navigateCorpora, navigateLogout, navigateNotLogged, helpActions, useOpenCorpora, hideCorpora, hideNotifications, hideLanguageSelector, hideHelpButton, }: Props): import("react").JSX.Element;
|
|
32
|
+
export default function Header({ tool, redirect, autoload, hideKeyboard, customHeader, notifications, keyboardLayout, navigateHome, navigateCorpora, navigateLogout, navigateNotLogged, helpActions, useOpenCorpora, hideCorpora, hideNotifications, hideLanguageSelector, hideHelpButton, platformName, platformCompleteName, platformLogo, }: Props): import("react").JSX.Element;
|
|
27
33
|
export {};
|
|
@@ -8,10 +8,10 @@ import HeaderUser from './HeaderUser';
|
|
|
8
8
|
import './styles.scss';
|
|
9
9
|
export default function Header({ tool, redirect, autoload, hideKeyboard, customHeader, notifications, keyboardLayout, navigateHome, navigateCorpora, navigateLogout, navigateNotLogged = () => {
|
|
10
10
|
location.href = '/auth';
|
|
11
|
-
}, helpActions, useOpenCorpora = true, hideCorpora = false, hideNotifications = false, hideLanguageSelector = false, hideHelpButton = false, }) {
|
|
11
|
+
}, helpActions, useOpenCorpora = true, hideCorpora = false, hideNotifications = false, hideLanguageSelector = false, hideHelpButton = false, platformName, platformCompleteName, platformLogo, }) {
|
|
12
12
|
const { t } = useTranslation('header');
|
|
13
13
|
const homeTextsClass = cx('app-title', {
|
|
14
14
|
pointer: navigateHome !== undefined,
|
|
15
15
|
});
|
|
16
|
-
return (_jsxs("div", { className: "ds-header", children: [_jsxs("div", { className: "header-left", children: [_jsx(HeaderApps, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged, hideKeyboard: hideKeyboard, notifications: notifications, keyboardLayout: keyboardLayout, helpActions: helpActions }), _jsxs("div", { className: homeTextsClass, onClick: () => navigateHome && navigateHome(), children: [_jsx("span", { className: "title", children: t('label.platform') }), _jsx("span", { className: "subtitle", children: tool })] }), _jsxs("div", { className: "header-corpus", children: [!hideCorpora && (_jsx(HeaderCorpora, { redirect: redirect, autoload: autoload, navigateCorpora: navigateCorpora, useOpenCorpora: useOpenCorpora })), customHeader && customHeader] })] }), _jsxs("div", { className: "header-right", children: [_jsx(HeaderButtons, { hideKeyboard: hideKeyboard, notifications: notifications, keyboardLayout: keyboardLayout, helpActions: helpActions, hideNotifications: hideNotifications, hideLanguageSelector: hideLanguageSelector, hideHelpButton: hideHelpButton }), _jsx(HeaderUser, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged })] })] }));
|
|
16
|
+
return (_jsxs("div", { className: "ds-header", children: [_jsxs("div", { className: "header-left", children: [_jsx(HeaderApps, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged, hideKeyboard: hideKeyboard, notifications: notifications, keyboardLayout: keyboardLayout, helpActions: helpActions, platformCompleteName: platformCompleteName, platformLogo: platformLogo }), _jsxs("div", { className: homeTextsClass, onClick: () => navigateHome && navigateHome(), children: [_jsx("span", { className: "title", children: platformName ?? t('label.platform') }), _jsx("span", { className: "subtitle", children: tool })] }), _jsxs("div", { className: "header-corpus", children: [!hideCorpora && (_jsx(HeaderCorpora, { redirect: redirect, autoload: autoload, navigateCorpora: navigateCorpora, useOpenCorpora: useOpenCorpora })), customHeader && customHeader] })] }), _jsxs("div", { className: "header-right", children: [_jsx(HeaderButtons, { hideKeyboard: hideKeyboard, notifications: notifications, keyboardLayout: keyboardLayout, helpActions: helpActions, hideNotifications: hideNotifications, hideLanguageSelector: hideLanguageSelector, hideHelpButton: hideHelpButton }), _jsx(HeaderUser, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged })] })] }));
|
|
17
17
|
}
|
|
@@ -10,6 +10,8 @@ type Props = {
|
|
|
10
10
|
};
|
|
11
11
|
keyboardLayout?: string;
|
|
12
12
|
helpActions?: HelpAction[];
|
|
13
|
+
platformCompleteName?: string;
|
|
14
|
+
platformLogo?: string;
|
|
13
15
|
};
|
|
14
|
-
export default function HeaderApps({ navigateLogout, navigateNotLogged, hideKeyboard, notifications, keyboardLayout, helpActions, }: Props): import("react").JSX.Element;
|
|
16
|
+
export default function HeaderApps({ navigateLogout, navigateNotLogged, hideKeyboard, notifications, keyboardLayout, helpActions, platformCompleteName, platformLogo, }: Props): import("react").JSX.Element;
|
|
15
17
|
export {};
|
|
@@ -11,11 +11,26 @@ import { AvailableApps } from "../types/App";
|
|
|
11
11
|
import logo from "./logo.png";
|
|
12
12
|
import youtube from "./youtube.png";
|
|
13
13
|
import "./style.scss";
|
|
14
|
-
export default function HeaderApps({ navigateLogout, navigateNotLogged, hideKeyboard, notifications, keyboardLayout, helpActions, }) {
|
|
14
|
+
export default function HeaderApps({ navigateLogout, navigateNotLogged, hideKeyboard, notifications, keyboardLayout, helpActions, platformCompleteName, platformLogo, }) {
|
|
15
15
|
const { t } = useTranslation("header-app");
|
|
16
16
|
const { getCorpus, hasCorpus } = useCorpusUtils();
|
|
17
17
|
const { isAdminOfAnyCorpus, isEditorOfAnyCorpus, isLogged } = useLoggedUtils();
|
|
18
18
|
const [open, setOpen] = useState(false);
|
|
19
|
+
const platformOrigin = (import.meta.env.VITE_APP_ORIGIN ?? "").replace(/\/+$/, "");
|
|
20
|
+
const resources = [
|
|
21
|
+
{
|
|
22
|
+
code: "platform",
|
|
23
|
+
image: platformLogo || logo,
|
|
24
|
+
visibility: "public",
|
|
25
|
+
external: platformOrigin || undefined,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
code: "youtube",
|
|
29
|
+
image: youtube,
|
|
30
|
+
visibility: "public",
|
|
31
|
+
external: "https://www.youtube.com/@tychoplatform",
|
|
32
|
+
},
|
|
33
|
+
];
|
|
19
34
|
const goto = (app, blank) => {
|
|
20
35
|
const shouldAppendCorpusUid = app.appendCorpusUid !== false;
|
|
21
36
|
const url = hasCorpus() && shouldAppendCorpusUid
|
|
@@ -35,25 +50,12 @@ export default function HeaderApps({ navigateLogout, navigateNotLogged, hideKeyb
|
|
|
35
50
|
return null;
|
|
36
51
|
if (item.editor && !isEditorOfAnyCorpus())
|
|
37
52
|
return null;
|
|
38
|
-
return (_jsxs("div", { className: "item", title: t(`${item.code}.desc`), onClick: () => goto(item, item.external ? true : false), children: [item.icon && _jsx(Icon, { name: item.icon, size: "medium" }), item.image && _jsx("img", { src: item.image }), _jsx("span", { className: "title-app", children:
|
|
53
|
+
return (_jsxs("div", { className: "item", title: t(`${item.code}.desc`), onClick: () => goto(item, item.external ? true : false), children: [item.icon && _jsx(Icon, { name: item.icon, size: "medium" }), item.image && _jsx("img", { src: item.image }), _jsx("span", { className: "title-app", children: item.code === "platform" && platformCompleteName
|
|
54
|
+
? platformCompleteName
|
|
55
|
+
: t(`${item.code}.name`) }), _jsxs("div", { className: "options", children: [item.visibility && (_jsx(Tag, { text: t(`common:label.${item.visibility}`), size: "small", color: "green", className: "d-none" })), _jsx(IconButton, { name: "open_in_new", size: "x-small", className: "icon-open", mode: "ghost", onClick: (e) => {
|
|
39
56
|
e.stopPropagation();
|
|
40
57
|
goto(item, true);
|
|
41
58
|
}, title: t("label.open.tab") })] })] }, idx.valueOf()));
|
|
42
59
|
};
|
|
43
|
-
return (_jsxs("div", { className: "header-apps-container", children: [_jsx(IconButton, { name: "apps", className: "icon-apps", size: "large", onClick: () => setOpen(!open), filledIcon: true, "data-tour": "header-apps" }), open && (_jsxs(Drawer, { anchor: "left", open: true, onClose: () => setOpen(false), className: "offcanvas-apps", children: [_jsxs("div", { className: "header", children: [_jsx(IconButton, { name: "close", size: "medium", mode: "ghost", iconSize: "medium", onClick: () => setOpen(false) }), _jsx("span", { className: "header-apps-title", children: t("header:label.platform.complete") }), _jsx("div", { className: "header-profile-apps", children: _jsx(HeaderUser, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged }) })] }), _jsxs("div", { className: "body", children: [_jsx("div", { className: "title", children: t("label.tools") }), AvailableApps.map((item, idx) => renderItem(item, idx)), _jsx("div", { className: "title", children: t("label.quick") }), resources.map((item, idx) => renderItem(item, idx))] }), _jsx("div", { className: "footer", children: _jsx("div", { className: "header-apps-buttons", children: _jsx(HeaderButtons, { hideKeyboard: hideKeyboard, notifications: notifications, keyboardLayout: keyboardLayout, helpActions: helpActions, mobile: true }) }) })] }))] }));
|
|
60
|
+
return (_jsxs("div", { className: "header-apps-container", children: [_jsx(IconButton, { name: "apps", className: "icon-apps", size: "large", onClick: () => setOpen(!open), filledIcon: true, "data-tour": "header-apps" }), open && (_jsxs(Drawer, { anchor: "left", open: true, onClose: () => setOpen(false), className: "offcanvas-apps", children: [_jsxs("div", { className: "header", children: [_jsx(IconButton, { name: "close", size: "medium", mode: "ghost", iconSize: "medium", onClick: () => setOpen(false) }), _jsx("span", { className: "header-apps-title", children: platformCompleteName ?? t("header:label.platform.complete") }), _jsx("div", { className: "header-profile-apps", children: _jsx(HeaderUser, { navigateLogout: navigateLogout, navigateNotLogged: navigateNotLogged }) })] }), _jsxs("div", { className: "body", children: [_jsx("div", { className: "title", children: t("label.tools") }), AvailableApps.map((item, idx) => renderItem(item, idx)), _jsx("div", { className: "title", children: t("label.quick") }), resources.map((item, idx) => renderItem(item, idx))] }), _jsx("div", { className: "footer", children: _jsx("div", { className: "header-apps-buttons", children: _jsx(HeaderButtons, { hideKeyboard: hideKeyboard, notifications: notifications, keyboardLayout: keyboardLayout, helpActions: helpActions, mobile: true }) }) })] }))] }));
|
|
44
61
|
}
|
|
45
|
-
const platformOrigin = (import.meta.env.VITE_APP_ORIGIN ?? "").replace(/\/+$/, "");
|
|
46
|
-
const resources = [
|
|
47
|
-
{
|
|
48
|
-
code: "platform",
|
|
49
|
-
image: logo,
|
|
50
|
-
visibility: "public",
|
|
51
|
-
external: platformOrigin || undefined,
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
code: "youtube",
|
|
55
|
-
image: youtube,
|
|
56
|
-
visibility: "public",
|
|
57
|
-
external: "https://www.youtube.com/@tychoplatform",
|
|
58
|
-
},
|
|
59
|
-
];
|