@rivm-loculus-tools/common-frontend 0.9.0 → 0.10.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/_chunks/LoculusService.js +1049 -0
- package/dist/_chunks/LoculusService.js.map +1 -0
- package/dist/_chunks/decorateParam.js +7 -0
- package/dist/_chunks/keycloak-dpop.js +241 -0
- package/dist/_chunks/keycloak-dpop.js.map +1 -0
- package/dist/classes/services/EmotionCacheService/index.js +27 -1
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -0
- package/dist/classes/services/LoculusService/LoculusService.d.ts +26 -0
- package/dist/classes/services/LoculusService/index.d.ts +1 -0
- package/dist/classes/services/LoculusService/index.js +1 -0
- package/dist/classes/services/UrlService/UrlService.d.ts +18 -0
- package/dist/classes/services/UrlService/index.d.ts +1 -0
- package/dist/classes/services/UrlService/index.js +45 -0
- package/dist/classes/services/UrlService/index.js.map +1 -0
- package/dist/components/app/App/App.d.ts +4 -2
- package/dist/components/app/App/index.js +35 -34
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/authentication/AuthenticationLoader/AuthenticationLoader.d.ts +3 -0
- package/dist/components/authentication/AuthenticationLoader/index.d.ts +1 -0
- package/dist/components/authentication/AuthenticationLoader/index.js +31 -0
- package/dist/components/authentication/AuthenticationLoader/index.js.map +1 -0
- package/dist/components/fasta/FastaDataImportDialog/FastaDataImportDialog.d.ts +1 -0
- package/dist/components/fasta/FastaDataImportDialog/index.js +77 -77
- package/dist/components/fasta/FastaDataImportDialog/index.js.map +1 -1
- package/dist/components/fasta/FastaDataImportDialogLoader/FastaDataImportDialogLoader.d.ts +2 -1
- package/dist/components/fasta/FastaDataImportDialogLoader/index.js +61 -52
- package/dist/components/fasta/FastaDataImportDialogLoader/index.js.map +1 -1
- package/dist/components/fasta/FastaPageHeaderResetButton/index.js +27 -24
- package/dist/components/fasta/FastaPageHeaderResetButton/index.js.map +1 -1
- package/dist/components/loculus/UploadToLoculusModal/UploadToLoculusModal.d.ts +11 -0
- package/dist/components/loculus/UploadToLoculusModal/index.d.ts +1 -0
- package/dist/components/loculus/UploadToLoculusModal/index.js +159 -0
- package/dist/components/loculus/UploadToLoculusModal/index.js.map +1 -0
- package/dist/components/ui/ButtonWithMenu/ButtonWithMenu.d.ts +1 -0
- package/dist/components/ui/ButtonWithMenu/index.js +5 -4
- package/dist/components/ui/ButtonWithMenu/index.js.map +1 -1
- package/dist/components/ui/PageCommon/index.js +1 -1
- package/dist/components/ui/PageCommon/index.js.map +1 -1
- package/dist/components/ui/SearchBar/index.js +1 -0
- package/dist/components/ui/SearchBar/index.js.map +1 -1
- package/dist/models/url.models.d.ts +9 -0
- package/dist/models/url.models.js +0 -0
- package/dist/utils/MetaDataUtil/MetaDataUtil.d.ts +2 -1
- package/dist/utils/MetaDataUtil/index.js +5 -2
- package/dist/utils/MetaDataUtil/index.js.map +1 -1
- package/dist/utils/UrlUtil/UrlUtil.d.ts +1 -1
- package/dist/utils/UrlUtil/index.js +5 -6
- package/dist/utils/UrlUtil/index.js.map +1 -1
- package/package.json +23 -2
- package/dist/_chunks/EmotionCacheService.js +0 -32
- package/dist/_chunks/EmotionCacheService.js.map +0 -1
|
@@ -1 +1,27 @@
|
|
|
1
|
-
|
|
1
|
+
import { CONFIG_TOKEN as e } from "../../../constants/config.constants.js";
|
|
2
|
+
import { t } from "../../../_chunks/decorate.js";
|
|
3
|
+
import { t as n } from "../../../_chunks/decorateParam.js";
|
|
4
|
+
import { inject as r, singleton as i } from "tsyringe";
|
|
5
|
+
import { WindowService as a } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
6
|
+
import o from "@emotion/cache";
|
|
7
|
+
// src/classes/services/EmotionCacheService/EmotionCacheService.ts
|
|
8
|
+
var s = class {
|
|
9
|
+
emotionCache;
|
|
10
|
+
constructor(e, t) {
|
|
11
|
+
this.emotionCache = o({
|
|
12
|
+
container: t.document.head,
|
|
13
|
+
key: "loculus-tools",
|
|
14
|
+
nonce: e.nonce,
|
|
15
|
+
prepend: !!e.nonce,
|
|
16
|
+
stylisPlugins: []
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
s = t([
|
|
21
|
+
i(),
|
|
22
|
+
n(0, r(e)),
|
|
23
|
+
n(1, r(a))
|
|
24
|
+
], s);
|
|
25
|
+
export { s as EmotionCacheService };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_decorate","_decorateParam","__decorateParam","createCache","EmotionCacheService","windowService","config","__decorate","singleton","inject","CONFIG_TOKEN","WindowService"],"sources":["../../../../src/classes/services/EmotionCacheService/EmotionCacheService.ts"],"sourcesContent":["import type { EmotionCache } from '@emotion/cache';\nimport createCache from '@emotion/cache';\nimport {\n inject,\n singleton,\n} from 'tsyringe';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\n\nimport { CONFIG_TOKEN } from '../../../constants/config.constants';\nimport type { ConfigBase } from '../../../models/config.models';\n\n\n@singleton()\nexport class EmotionCacheService {\n public readonly emotionCache: EmotionCache;\n\n public constructor(\n @inject(CONFIG_TOKEN) config: ConfigBase,\n @inject(WindowService) windowService: WindowService,\n ) {\n this.emotionCache = createCache({\n container: windowService.document.head,\n key: 'loculus-tools',\n nonce: config.nonce,\n prepend: !!config.nonce,\n stylisPlugins: [],\n });\n }\n}\n"],"mappings":";;;;;;;AAaO,IAAMI,IAAN,MAA0B;CAC/B;CAEA,YACE,GACA,GACA;EACA,KAAK,eAAeD,EAAY;GAC9B,WAAWE,EAAc,SAAS;GAClC,KAAK;GACL,OAAOC,EAAO;GACd,SAAS,CAAC,CAACA,EAAO;GAClB,eAAe,CAAC;EAClB,CAAC;CACH;AACF;;CAhBCE,EAAU;CAKNP,EAAA,GAAAQ,EAAOC,CAAY,CAAA;CACnBT,EAAA,GAAAQ,EAAOE,CAAa,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SubscribableAbstract } from '@gen-epix/ui-core/classes/abstracts/SubscribableAbstract';
|
|
2
|
+
import { MetadataParseResult } from '../../../models/metadata.models';
|
|
3
|
+
export type LoculusServiceSubject = {
|
|
4
|
+
authenticated: boolean;
|
|
5
|
+
};
|
|
6
|
+
export type RevisedSequences = {
|
|
7
|
+
addedSequencesWithoutMetadata: string[];
|
|
8
|
+
fasta: string;
|
|
9
|
+
groupId: string;
|
|
10
|
+
metadata: string;
|
|
11
|
+
removedSequences: string[];
|
|
12
|
+
sequenceCount: number;
|
|
13
|
+
};
|
|
14
|
+
export declare class LoculusService extends SubscribableAbstract<LoculusServiceSubject> {
|
|
15
|
+
get code(): null | string;
|
|
16
|
+
private keycloak;
|
|
17
|
+
constructor();
|
|
18
|
+
static createRevisedSequences(fasta: string, metaData: MetadataParseResult, rawFasta?: string): RevisedSequences;
|
|
19
|
+
clear(): void;
|
|
20
|
+
init(kwArgs: {
|
|
21
|
+
authClientId: string;
|
|
22
|
+
authEndpoint: string;
|
|
23
|
+
authRealm: string;
|
|
24
|
+
}): Promise<void>;
|
|
25
|
+
reviseSequences(fasta: string, metaData: MetadataParseResult, returnUrl: string, organism: string, abortController: AbortController): Promise<void>;
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LoculusService';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as LoculusService } from "../../../_chunks/LoculusService.js";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SubscribableAbstract } from '@gen-epix/ui-core/classes/abstracts/SubscribableAbstract';
|
|
2
|
+
import { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';
|
|
3
|
+
import { UrlParams } from '../../../models/url.models';
|
|
4
|
+
type UrlParamsWithAuth = Required<Pick<UrlParams, 'authClientId' | 'authEndpoint' | 'authRealm'>> & UrlParams;
|
|
5
|
+
type UrlParamsWithReturn = Required<Pick<UrlParams, 'organism' | 'returnUrl'>> & UrlParams;
|
|
6
|
+
export declare class UrlService extends SubscribableAbstract<UrlParams> {
|
|
7
|
+
private readonly windowService;
|
|
8
|
+
constructor(windowService: WindowService);
|
|
9
|
+
static getParamsFromUrl(url: string): UrlParams;
|
|
10
|
+
hasAuthParams(): this is {
|
|
11
|
+
data: UrlParamsWithAuth;
|
|
12
|
+
} & this;
|
|
13
|
+
hasReturnParams(): this is {
|
|
14
|
+
data: UrlParamsWithReturn;
|
|
15
|
+
} & this;
|
|
16
|
+
private readonly updateParams;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './UrlService';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { UrlUtil as e } from "../../../utils/UrlUtil/index.js";
|
|
2
|
+
import { t } from "../../../_chunks/decorate.js";
|
|
3
|
+
import { t as n } from "../../../_chunks/decorateParam.js";
|
|
4
|
+
import { inject as r, singleton as i } from "tsyringe";
|
|
5
|
+
import { WindowService as a } from "@gen-epix/ui-core/classes/services/WindowService";
|
|
6
|
+
import { SubscribableAbstract as o } from "@gen-epix/ui-core/classes/abstracts/SubscribableAbstract";
|
|
7
|
+
import { Subject as s } from "@gen-epix/ui-core/classes/Subject";
|
|
8
|
+
// src/classes/services/UrlService/UrlService.ts
|
|
9
|
+
var c, l = c = class extends o {
|
|
10
|
+
windowService;
|
|
11
|
+
constructor(e) {
|
|
12
|
+
super(new s({})), this.windowService = e, this.windowService.window.addEventListener("hashchange", this.updateParams), this.windowService.window.addEventListener("popstate", this.updateParams), this.windowService.window.addEventListener("loculus:urlparamschange", this.updateParams), this.updateParams();
|
|
13
|
+
}
|
|
14
|
+
static getParamsFromUrl(t) {
|
|
15
|
+
let n = new URL(t), r = new URLSearchParams(n.search), i = r.get("auth-endpoint"), a = r.get("input-fasta"), o = r.get("input-metadata"), s = r.get("return-url"), c = i && e.isValidResourceUrl(i) ? i : void 0, l = a && e.isValidResourceUrl(a) ? a : void 0, u = o && e.isValidResourceUrl(o) ? o : void 0, d = s && e.isValidResourceUrl(s) ? s : void 0, f = [c, d].filter((e) => e !== void 0).map((e) => {
|
|
16
|
+
try {
|
|
17
|
+
return new URL(e).hostname.split(".").slice(-2).join(".");
|
|
18
|
+
} catch {
|
|
19
|
+
return "";
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
return f.length > 1 && new Set(f).size > 1 && (console.warn("URLs have mismatched top-level domains. Clearing all URL parameters."), c = void 0, l = void 0, u = void 0, d = void 0), {
|
|
23
|
+
authClientId: r.get("auth-client-id") ?? void 0,
|
|
24
|
+
authEndpoint: c,
|
|
25
|
+
authRealm: r.get("auth-realm") ?? void 0,
|
|
26
|
+
inputFastaUrl: l,
|
|
27
|
+
inputMetadataUrl: u,
|
|
28
|
+
organism: r.get("organism") ?? void 0,
|
|
29
|
+
returnUrl: d
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
hasAuthParams() {
|
|
33
|
+
return this.data.authClientId !== void 0 && this.data.authEndpoint !== void 0 && this.data.authRealm !== void 0;
|
|
34
|
+
}
|
|
35
|
+
hasReturnParams() {
|
|
36
|
+
return this.data.returnUrl !== void 0 && this.data.organism !== void 0;
|
|
37
|
+
}
|
|
38
|
+
updateParams = () => {
|
|
39
|
+
this.next(c.getParamsFromUrl(this.windowService.document.location.href));
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
l = c = t([i(), n(0, r(a))], l);
|
|
43
|
+
export { l as UrlService };
|
|
44
|
+
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_decorate","_decorateParam","__decorateParam","_UrlService","UrlService","SubscribableAbstract","Subject","windowService","urlObject","url","urlParams","authEndpointFromUrl","inputFastaUrlFromUrl","inputMetadataUrlFromUrl","returnUrlFromUrl","authEndpoint","UrlUtil","inputFastaUrl","inputMetadataUrl","returnUrl","topLevelDomains","u","__decorate","singleton","inject","WindowService"],"sources":["../../../../src/classes/services/UrlService/UrlService.ts"],"sourcesContent":["import { SubscribableAbstract } from '@gen-epix/ui-core/classes/abstracts/SubscribableAbstract';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport {\n inject,\n singleton,\n} from 'tsyringe';\nimport { Subject } from '@gen-epix/ui-core/classes/Subject';\n\nimport type { UrlParams } from '../../../models/url.models';\nimport { UrlUtil } from '../../../utils/UrlUtil';\n\ntype UrlParamsWithAuth = Required<Pick<UrlParams, 'authClientId' | 'authEndpoint' | 'authRealm'>> & UrlParams;\ntype UrlParamsWithReturn = Required<Pick<UrlParams, 'organism' | 'returnUrl'>> & UrlParams;\n\n@singleton()\nexport class UrlService extends SubscribableAbstract<UrlParams> {\n private readonly windowService: WindowService;\n\n public constructor(\n @inject(WindowService) windowService: WindowService,\n ) {\n super(new Subject<UrlParams>({}));\n this.windowService = windowService;\n\n this.windowService.window.addEventListener('hashchange', this.updateParams);\n this.windowService.window.addEventListener('popstate', this.updateParams);\n this.windowService.window.addEventListener('loculus:urlparamschange', this.updateParams);\n this.updateParams();\n }\n\n public static getParamsFromUrl(url: string): UrlParams {\n const urlObject = new URL(url);\n const urlParams = new URLSearchParams(urlObject.search);\n const authEndpointFromUrl = urlParams.get('auth-endpoint');\n const inputFastaUrlFromUrl = urlParams.get('input-fasta');\n const inputMetadataUrlFromUrl = urlParams.get('input-metadata');\n const returnUrlFromUrl = urlParams.get('return-url');\n\n let authEndpoint = authEndpointFromUrl && UrlUtil.isValidResourceUrl(authEndpointFromUrl) ? authEndpointFromUrl : undefined;\n let inputFastaUrl = inputFastaUrlFromUrl && UrlUtil.isValidResourceUrl(inputFastaUrlFromUrl) ? inputFastaUrlFromUrl : undefined;\n let inputMetadataUrl = inputMetadataUrlFromUrl && UrlUtil.isValidResourceUrl(inputMetadataUrlFromUrl) ? inputMetadataUrlFromUrl : undefined;\n let returnUrl = returnUrlFromUrl && UrlUtil.isValidResourceUrl(returnUrlFromUrl) ? returnUrlFromUrl : undefined;\n\n // validate that each URL has the same top-level domain:\n const topLevelDomains = [authEndpoint, returnUrl]\n .filter((u): u is string => u !== undefined)\n .map((u) => {\n try {\n const hostname = new URL(u).hostname;\n const parts = hostname.split('.');\n return parts.slice(-2).join('.');\n } catch {\n return '';\n }\n });\n if (topLevelDomains.length > 1 && new Set(topLevelDomains).size > 1) {\n console.warn('URLs have mismatched top-level domains. Clearing all URL parameters.');\n authEndpoint = undefined;\n inputFastaUrl = undefined;\n inputMetadataUrl = undefined;\n returnUrl = undefined;\n }\n\n return {\n authClientId: urlParams.get('auth-client-id') ?? undefined,\n authEndpoint,\n authRealm: urlParams.get('auth-realm') ?? undefined,\n inputFastaUrl,\n inputMetadataUrl,\n organism: urlParams.get('organism') ?? undefined,\n returnUrl,\n };\n }\n\n public hasAuthParams(): this is { data: UrlParamsWithAuth } & this {\n return this.data.authClientId !== undefined &&\n this.data.authEndpoint !== undefined &&\n this.data.authRealm !== undefined;\n }\n\n public hasReturnParams(): this is { data: UrlParamsWithReturn } & this {\n return this.data.returnUrl !== undefined &&\n this.data.organism !== undefined;\n }\n\n private readonly updateParams = (): void => {\n this.next(UrlService.getParamsFromUrl(this.windowService.document.location.href));\n };\n}\n"],"mappings":";;;;;;;;A,OAeaI,IAAA,IAAN,cAAyBC,EAAgC;CAC9D;CAEA,YACE,GACA;EAOA,AANA,MAAM,IAAIC,EAAmB,CAAC,CAAC,CAAC,GAChC,KAAK,gBAAgBC,GAErB,KAAK,cAAc,OAAO,iBAAiB,cAAc,KAAK,YAAY,GAC1E,KAAK,cAAc,OAAO,iBAAiB,YAAY,KAAK,YAAY,GACxE,KAAK,cAAc,OAAO,iBAAiB,2BAA2B,KAAK,YAAY,GACvF,KAAK,aAAa;CACpB;CAEA,OAAc,iBAAiB,GAAwB;EACrD,IAAMC,IAAY,IAAI,IAAIC,CAAG,GACvBC,IAAY,IAAI,gBAAgBF,EAAU,MAAM,GAChDG,IAAsBD,EAAU,IAAI,eAAe,GACnDE,IAAuBF,EAAU,I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cAAc,SAAS,SAAS,IAAI,CAAC;CAClF;AACF;AA1EC,IAAA,IAAAH,EAAA,CAAAuB,EAAU,GAAAtB,EAAA,GAKNuB,EAAOC,CAAa,CAAA,CAAA,GAAArB,CAAA"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
|
-
export type AppProps = PropsWithChildren
|
|
3
|
-
|
|
2
|
+
export type AppProps = PropsWithChildren<{
|
|
3
|
+
useAuthentication?: boolean;
|
|
4
|
+
}>;
|
|
5
|
+
export declare const App: ({ children, useAuthentication }: AppProps) => import('react').JSX.Element;
|
|
@@ -2,17 +2,18 @@ import { DependencyContainerUtil as e } from "../../../utils/DependencyContainer
|
|
|
2
2
|
import { PageCommonContextProvider as t } from "../../../context/pageCommonContext/index.js";
|
|
3
3
|
import { ErrorPage as n } from "../../../pages/ErrorPage/index.js";
|
|
4
4
|
import { I18nWrapper as r } from "../../ui/I18nWrapper/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
5
|
+
import { AuthenticationLoader as i } from "../../authentication/AuthenticationLoader/index.js";
|
|
6
|
+
import { EmotionCacheService as a } from "../../../classes/services/EmotionCacheService/index.js";
|
|
7
|
+
import { container as o } from "tsyringe";
|
|
8
|
+
import { CssBaseline as s, ThemeProvider as c } from "@mui/material";
|
|
9
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
10
|
+
import { Component as d, createContext as f, createElement as p, useMemo as m } from "react";
|
|
11
|
+
import { CacheProvider as h } from "@emotion/react";
|
|
12
|
+
import { setupUiCore as g } from "@gen-epix/ui-core/setup/setup";
|
|
12
13
|
// ../../../node_modules/.pnpm/react-error-boundary@6.1.6_@types+react@19.3.0_react@19.3.1/node_modules/react-error-boundary/dist/react-error-boundary.js
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
let i =
|
|
14
|
+
var _ = f(null);
|
|
15
|
+
function v({ children: e, didCatch: t, error: n, resetErrorBoundary: r }) {
|
|
16
|
+
let i = m(() => ({
|
|
16
17
|
didCatch: t,
|
|
17
18
|
error: n,
|
|
18
19
|
resetErrorBoundary: r
|
|
@@ -21,14 +22,14 @@ function _({ children: e, didCatch: t, error: n, resetErrorBoundary: r }) {
|
|
|
21
22
|
n,
|
|
22
23
|
r
|
|
23
24
|
]);
|
|
24
|
-
return
|
|
25
|
+
return p(_.Provider, { value: i }, e);
|
|
25
26
|
}
|
|
26
|
-
var
|
|
27
|
+
var y = {
|
|
27
28
|
didCatch: !1,
|
|
28
29
|
error: null
|
|
29
|
-
},
|
|
30
|
+
}, b = class extends d {
|
|
30
31
|
constructor(e) {
|
|
31
|
-
super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state =
|
|
32
|
+
super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = y;
|
|
32
33
|
}
|
|
33
34
|
static getDerivedStateFromError(e) {
|
|
34
35
|
return {
|
|
@@ -41,18 +42,18 @@ var v = {
|
|
|
41
42
|
t && (this.props.onReset?.({
|
|
42
43
|
args: e,
|
|
43
44
|
reason: "imperative-api"
|
|
44
|
-
}), this.setState(
|
|
45
|
+
}), this.setState(y));
|
|
45
46
|
}
|
|
46
47
|
componentDidCatch(e, t) {
|
|
47
48
|
this.props.onError?.(e, t);
|
|
48
49
|
}
|
|
49
50
|
componentDidUpdate(e, t) {
|
|
50
51
|
let { didCatch: n } = this.state, { resetKeys: r } = this.props;
|
|
51
|
-
n && t.didCatch &&
|
|
52
|
+
n && t.didCatch && x(e.resetKeys, r) && (this.props.onReset?.({
|
|
52
53
|
next: r,
|
|
53
54
|
prev: e.resetKeys,
|
|
54
55
|
reason: "keys"
|
|
55
|
-
}), this.setState(
|
|
56
|
+
}), this.setState(y));
|
|
56
57
|
}
|
|
57
58
|
render() {
|
|
58
59
|
let { children: e, fallbackRender: t, FallbackComponent: n, fallback: r } = this.props, { didCatch: i, error: a } = this.state, o = e;
|
|
@@ -62,40 +63,40 @@ var v = {
|
|
|
62
63
|
resetErrorBoundary: this.resetErrorBoundary
|
|
63
64
|
};
|
|
64
65
|
if (typeof t == "function") o = t(e);
|
|
65
|
-
else if (n) o =
|
|
66
|
+
else if (n) o = p(n, e);
|
|
66
67
|
else if ("fallback" in this.props) o = r;
|
|
67
68
|
else throw a;
|
|
68
69
|
}
|
|
69
|
-
return
|
|
70
|
+
return p(v, {
|
|
70
71
|
didCatch: i,
|
|
71
72
|
error: a,
|
|
72
73
|
resetErrorBoundary: this.resetErrorBoundary
|
|
73
74
|
}, o);
|
|
74
75
|
}
|
|
75
76
|
};
|
|
76
|
-
function
|
|
77
|
+
function x(e = [], t = []) {
|
|
77
78
|
return e.length !== t.length || e.some((e, n) => !Object.is(e, t[n]));
|
|
78
79
|
}
|
|
79
80
|
// src/components/app/App/App.tsx
|
|
80
|
-
var
|
|
81
|
-
|
|
82
|
-
let
|
|
83
|
-
|
|
84
|
-
let
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
value:
|
|
87
|
-
children: /* @__PURE__ */
|
|
88
|
-
theme:
|
|
89
|
-
children: [/* @__PURE__ */
|
|
81
|
+
var S = ({ children: d, useAuthentication: f }) => {
|
|
82
|
+
g();
|
|
83
|
+
let p = e.resolveConfig(), { pageConfig: m } = p, _ = p.getTouchIconUrl?.();
|
|
84
|
+
_ && document.querySelector("link[rel=\"icon\"]")?.setAttribute("href", _);
|
|
85
|
+
let v = o.resolve(a).emotionCache;
|
|
86
|
+
return /* @__PURE__ */ l(h, {
|
|
87
|
+
value: v,
|
|
88
|
+
children: /* @__PURE__ */ u(c, {
|
|
89
|
+
theme: p.theme,
|
|
90
|
+
children: [/* @__PURE__ */ l(s, {}), /* @__PURE__ */ l(b, {
|
|
90
91
|
FallbackComponent: n,
|
|
91
|
-
children: /* @__PURE__ */
|
|
92
|
-
...
|
|
93
|
-
children:
|
|
92
|
+
children: /* @__PURE__ */ l(r, { children: /* @__PURE__ */ l(t, {
|
|
93
|
+
...m,
|
|
94
|
+
children: f ? /* @__PURE__ */ l(i, { children: d }) : d
|
|
94
95
|
}) })
|
|
95
96
|
})]
|
|
96
97
|
})
|
|
97
98
|
});
|
|
98
99
|
};
|
|
99
|
-
export {
|
|
100
|
+
export { S as App };
|
|
100
101
|
|
|
101
102
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["l","h","i","y","ErrorBoundary","
|
|
1
|
+
{"version":3,"file":"index.js","names":["l","h","i","y","ErrorBoundary","f","createContext","m","r","e","t","o","n","useMemo","createElement","d","C","Component","g","s","c","u","App","config","DependencyContainerUtil","touchIconUrl","emotionCache","container","EmotionCacheService","CacheProvider","ThemeProvider","CssBaseline","ErrorPage","I18nWrapper","PageCommonContextProvider","pageConfig","useAuthentication","AuthenticationLoader","children"],"sources":["../../../../../../../node_modules/.pnpm/react-error-boundary@6.1.6_@types+react@19.3.0_react@19.3.1/node_modules/react-error-boundary/dist/react-error-boundary.js","../../../../src/components/app/App/App.tsx"],"sourcesContent":["\"use client\";\nimport { createContext as l, useMemo as h, createElement as i, Component as y, useContext as p, useState as E, forwardRef as B } from \"react\";\nconst f = l(null);\nfunction m({\n children: r,\n didCatch: e,\n error: t,\n resetErrorBoundary: o\n}) {\n const n = h(\n () => ({ didCatch: e, error: t, resetErrorBoundary: o }),\n [e, t, o]\n );\n return i(f.Provider, { value: n }, r);\n}\nconst d = {\n didCatch: !1,\n error: null\n};\nclass C extends y {\n constructor(e) {\n super(e), this.resetErrorBoundary = this.resetErrorBoundary.bind(this), this.state = d;\n }\n static getDerivedStateFromError(e) {\n return { didCatch: !0, error: e };\n }\n resetErrorBoundary(...e) {\n const { didCatch: t } = this.state;\n t && (this.props.onReset?.({\n args: e,\n reason: \"imperative-api\"\n }), this.setState(d));\n }\n componentDidCatch(e, t) {\n this.props.onError?.(e, t);\n }\n componentDidUpdate(e, t) {\n const { didCatch: o } = this.state, { resetKeys: n } = this.props;\n o && t.didCatch && g(e.resetKeys, n) && (this.props.onReset?.({\n next: n,\n prev: e.resetKeys,\n reason: \"keys\"\n }), this.setState(d));\n }\n render() {\n const { children: e, fallbackRender: t, FallbackComponent: o, fallback: n } = this.props, { didCatch: s, error: a } = this.state;\n let c = e;\n if (s) {\n const u = {\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n };\n if (typeof t == \"function\")\n c = t(u);\n else if (o)\n c = i(o, u);\n else if (\"fallback\" in this.props)\n c = n;\n else\n throw a;\n }\n return i(\n m,\n {\n didCatch: s,\n error: a,\n resetErrorBoundary: this.resetErrorBoundary\n },\n c\n );\n }\n}\nfunction g(r = [], e = []) {\n return r.length !== e.length || r.some((t, o) => !Object.is(t, e[o]));\n}\nfunction x(r) {\n return r !== null && typeof r == \"object\" && \"didCatch\" in r && typeof r.didCatch == \"boolean\" && \"error\" in r && \"resetErrorBoundary\" in r && typeof r.resetErrorBoundary == \"function\";\n}\nfunction b(r) {\n if (!x(r))\n throw new Error(\"ErrorBoundaryContext not found\");\n}\nfunction S() {\n const r = p(f);\n b(r);\n const { error: e, resetErrorBoundary: t } = r, [o, n] = E({\n error: null,\n hasError: !1\n }), s = h(\n () => ({\n error: e,\n resetBoundary: () => {\n t(), n({ error: null, hasError: !1 });\n },\n showBoundary: (a) => n({\n error: a,\n hasError: !0\n })\n }),\n [e, t]\n );\n if (o.hasError)\n throw o.error;\n return s;\n}\nfunction w(r) {\n switch (typeof r) {\n case \"object\": {\n if (r !== null && \"message\" in r && typeof r.message == \"string\")\n return r.message;\n break;\n }\n case \"string\":\n return r;\n }\n}\nfunction R(r, e) {\n const t = B(\n (n, s) => i(\n C,\n e,\n i(r, { ...n, ref: s })\n )\n ), o = r.displayName || r.name || \"Unknown\";\n return t.displayName = `withErrorBoundary(${o})`, t;\n}\nexport {\n C as ErrorBoundary,\n f as ErrorBoundaryContext,\n w as getErrorMessage,\n S as useErrorBoundary,\n R as withErrorBoundary\n};\n//# sourceMappingURL=react-error-boundary.js.map\n","import { container } from 'tsyringe';\nimport { CacheProvider } from '@emotion/react';\nimport { setupUiCore } from '@gen-epix/ui-core/setup/setup';\nimport {\n CssBaseline,\n ThemeProvider,\n} from '@mui/material';\nimport { ErrorBoundary } from 'react-error-boundary';\nimport type { PropsWithChildren } from 'react';\n\nimport { EmotionCacheService } from '../../../classes/services/EmotionCacheService';\nimport type { ConfigBase } from '../../../models/config.models';\nimport { DependencyContainerUtil } from '../../../utils/DependencyContainerUtil';\nimport { ErrorPage } from '../../../pages/ErrorPage';\nimport { I18nWrapper } from '../../ui/I18nWrapper';\nimport { PageCommonContextProvider } from '../../../context/pageCommonContext';\nimport { AuthenticationLoader } from '../../authentication/AuthenticationLoader';\n\nexport type AppProps = PropsWithChildren<{\n useAuthentication?: boolean;\n}>;\n\nexport const App = ({ children, useAuthentication }: AppProps) => {\n setupUiCore();\n const config = DependencyContainerUtil.resolveConfig<ConfigBase>();\n const { pageConfig } = config;\n const touchIconUrl = config.getTouchIconUrl?.();\n if (touchIconUrl) {\n document.querySelector('link[rel=\"icon\"]')?.setAttribute('href', touchIconUrl);\n }\n\n const emotionCache = container.resolve(EmotionCacheService).emotionCache;\n\n return (\n <CacheProvider value={emotionCache}>\n <ThemeProvider theme={config.theme}>\n <CssBaseline />\n <ErrorBoundary FallbackComponent={ErrorPage}>\n <I18nWrapper>\n <PageCommonContextProvider {...pageConfig}>\n {useAuthentication ? (\n <AuthenticationLoader>\n {children}\n </AuthenticationLoader>\n ) : (\n children\n )}\n </PageCommonContextProvider>\n </I18nWrapper>\n </ErrorBoundary>\n </ThemeProvider>\n </CacheProvider>\n );\n};\n"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;AAEA,IAAMK,IAAIL,EAAE,IAAI;AAChB,SAASO,EAAE,EACT,UAAUC,GACV,UAAUC,GACV,OAAOC,GACP,oBAAoBC,KACnB;CACD,IAAMC,IAAIX,SACD;EAAE,UAAUQ;E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;QAEJ,MAAM;EACV;EACA,OAAOV,EACLK,GACA;GACE,UAAUY;GACV,OAAO;GACP,oBAAoB,KAAK;EAC3B,GACAC,CACF;CACF;AACF;AACA,SAASF,EAAE,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG;CACzB,OAAOV,EAAE,WAAWC,EAAE,UAAUD,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,GAAGE,GAAGD,EAAEE,EAAE,CAAC;AACtE;;ACpDA,IAAaW,KAAO,EAAE,aAAU,2BAAkC;CAChE,EAAY;CACZ,IAAMC,IAASC,EAAwB,cAA0B,GAC3D,EAAE,kBAAeD,GACjBE,IAAeF,EAAO,kBAAkB;CAC9C,AAAIE,KACF,SAAS,cAAc,oBAAkB,CAAC,EAAE,aAAa,QAAQA,CAAY;CAG/E,IAAMC,IAAeC,EAAU,QAAQC,CAAmB,CAAC,CAAC;CAE5D,OACE,kBAACC,GAAD;EAAe,OAAOH;EACpB,UAAA,kBAACI,GAAD;GAAe,OAAOP,EAAO;GAA7B,UAAA,CACE,kBAACQ,GAAD,CAAc,CAAA,GACd,kBAAC3B,GAAD;IAAe,mBAAmB4B;IAChC,UAAA,kBAACC,GAAD,EAAA,UACE,kBAACC,GAAD;KAA2B,GAAIC;KAC5B,UAAAC,IACC,kBAACC,GAAD,EACG,YACmB,CAAA,IAEtBC;IAEuB,CAAA,EAChB,CAAA;GACA,CAAA,CACF;;CACF,CAAA;AAEnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AuthenticationLoader';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { t as e } from "../../../_chunks/LoculusService.js";
|
|
2
|
+
import { UrlService as t } from "../../../classes/services/UrlService/index.js";
|
|
3
|
+
import { container as n } from "tsyringe";
|
|
4
|
+
import { Fragment as r, jsx as i } from "react/jsx-runtime";
|
|
5
|
+
import { useEffect as a, useRef as o } from "react";
|
|
6
|
+
// src/components/authentication/AuthenticationLoader/AuthenticationLoader.tsx
|
|
7
|
+
var s = ({ children: s }) => {
|
|
8
|
+
let c = o(!1);
|
|
9
|
+
return a(() => {
|
|
10
|
+
c.current || (c.current = !0, (async () => {
|
|
11
|
+
try {
|
|
12
|
+
let r = n.resolve(t);
|
|
13
|
+
if (!r.hasAuthParams()) {
|
|
14
|
+
console.error("Missing authentication parameters in URL.");
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
let { authClientId: i, authEndpoint: a, authRealm: o } = r.data;
|
|
18
|
+
await n.resolve(e).init({
|
|
19
|
+
authClientId: i,
|
|
20
|
+
authEndpoint: a,
|
|
21
|
+
authRealm: o
|
|
22
|
+
});
|
|
23
|
+
} catch (e) {
|
|
24
|
+
console.error("Failed to initialize authentication:", e);
|
|
25
|
+
}
|
|
26
|
+
})());
|
|
27
|
+
}, []), /* @__PURE__ */ i(r, { children: s });
|
|
28
|
+
};
|
|
29
|
+
export { s as AuthenticationLoader };
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_Fragment","LoculusService","AuthenticationLoader","authenticationStartedRef","useRef","useEffect","urlService","container","UrlService","error","Fragment"],"sources":["../../../../src/components/authentication/AuthenticationLoader/AuthenticationLoader.tsx"],"sourcesContent":["import {\n useEffect,\n useRef,\n} from 'react';\nimport type { PropsWithChildren } from 'react';\nimport { container } from 'tsyringe';\n\nimport { LoculusService } from '../../../classes/services/LoculusService';\nimport { UrlService } from '../../../classes/services/UrlService';\n\nexport type AuthenticationLoaderProps = PropsWithChildren;\n\nexport const AuthenticationLoader = ({ children }: AuthenticationLoaderProps) => {\n const authenticationStartedRef = useRef(false);\n\n useEffect(() => {\n if (authenticationStartedRef.current) {\n return;\n }\n authenticationStartedRef.current = true;\n\n const initializeAuthentication = async () => {\n try {\n const urlService = container.resolve(UrlService);\n\n if (!urlService.hasAuthParams()) {\n console.error('Missing authentication parameters in URL.');\n return;\n }\n\n const { authClientId, authEndpoint, authRealm } = urlService.data;\n await container.resolve(LoculusService).init({\n authClientId,\n authEndpoint,\n authRealm,\n });\n } catch (error) {\n console.error('Failed to initialize authentication:', error);\n }\n };\n\n void initializeAuthentication();\n }, []);\n\n return (\n <>\n {children}\n </>\n );\n};\n"],"mappings":";;;;;;AAYA,IAAaE,KAAwB,EAAE,kBAA0C;CAC/E,IAAMC,IAA2BC,EAAO,EAAK;CA+B7C,OA7BAC,QAAgB;EACd,AAAIF,EAAyB,YAG7B,EAAyB,UAAU,KAsBnC,YApB6C;GAC3C,IAAI;IACF,IAAMG,IAAaC,EAAU,QAAQC,CAAU;IAE/C,IAAI,CAACF,EAAW,cAAc,GAAG;KAC/B,QAAQ,MAAM,2CAA2C;KACzD;IACF;IAEA,IAAM,EAAE,iBAAc,iBAAc,iBAAcA,EAAW;IAC7D,MAAMC,EAAU,QAAQN,CAAc,CAAC,CAAC,KAAK;KAC3C;KACA;KACA;IACF,CAAC;GACH,SAASQ,GAAO;IACd,QAAQ,MAAM,wCAAwCA,CAAK;GAC7D;EACF,EAEK,CAAyB;CAChC,GAAG,CAAC,CAAC,GAGH,kBAAAT,GAAA,EACG,YACD,CAAA;AAEN"}
|
|
@@ -5,6 +5,7 @@ export interface FastaDataImportDialogOpenProps {
|
|
|
5
5
|
}
|
|
6
6
|
export interface FastaDataImportDialogProps extends WithDialogRenderProps<FastaDataImportDialogOpenProps> {
|
|
7
7
|
extraActions?: DialogAction[];
|
|
8
|
+
fastaDescription?: string;
|
|
8
9
|
onDataChange: (fasta: string, metaData?: string) => void;
|
|
9
10
|
onError: (error: unknown) => void;
|
|
10
11
|
}
|