tycho-components 0.42.4 → 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.
@@ -1,13 +1,14 @@
1
1
  .dropzone-container {
2
2
  display: flex;
3
3
  flex-direction: column;
4
- align-items: center;
4
+ align-items: stretch;
5
5
  justify-content: center;
6
6
  gap: var(--spacing-200);
7
7
  box-sizing: border-box;
8
8
  width: 100%;
9
9
  max-width: 100%;
10
10
  min-width: 0;
11
+ overflow: hidden;
11
12
 
12
13
  .dropzone {
13
14
  display: flex;
@@ -17,6 +18,7 @@
17
18
  box-sizing: border-box;
18
19
  width: 100%;
19
20
  max-width: 100%;
21
+ min-width: 0;
20
22
  padding: var(--spacing-700);
21
23
  border-radius: var(--radius-100);
22
24
  border: 2px dashed var(--border-subtle-3);
@@ -25,9 +27,13 @@
25
27
  }
26
28
 
27
29
  .preview {
30
+ display: block;
28
31
  margin: 0 auto;
29
- width: 400px;
30
- height: 400px;
32
+ width: 100%;
33
+ max-width: 400px;
34
+ height: auto;
35
+ aspect-ratio: 1;
36
+ object-fit: contain;
31
37
  }
32
38
 
33
39
  .uploaded-file {
@@ -37,11 +43,13 @@
37
43
  box-sizing: border-box;
38
44
  width: 100%;
39
45
  max-width: 100%;
46
+ min-width: 0;
40
47
  text-align: center;
41
48
  border: 1px solid var(--border-subtle-3);
42
49
  border-radius: var(--radius-100);
43
50
  padding: var(--spacing-200);
44
51
  gap: var(--spacing-200);
52
+ overflow-wrap: anywhere;
45
53
 
46
54
  .buttons {
47
55
  display: flex;
@@ -52,6 +60,8 @@
52
60
 
53
61
  .keep-name-checkbox {
54
62
  align-self: flex-start;
63
+ max-width: 100%;
64
+ min-width: 0;
55
65
 
56
66
  > .MuiCheckbox-root {
57
67
  padding: 0px 8px;
@@ -28,6 +28,10 @@
28
28
  }
29
29
 
30
30
  > .body {
31
+ box-sizing: border-box;
32
+ min-width: 0;
33
+ max-width: 100%;
34
+ overflow-x: hidden;
31
35
  padding: var(--spacing-300) var(--spacing-200) var(--spacing-150);
32
36
  }
33
37
 
@@ -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, Github } from "./types/Corpus";
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: 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) => {
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
- ];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tycho-components",
3
3
  "private": false,
4
- "version": "0.42.4",
4
+ "version": "0.43.0",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "exports": {