@rivm-loculus-tools/common-frontend 0.5.0 → 0.7.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,6 +1,6 @@
1
1
  import { DependencyContainer } from 'tsyringe';
2
2
  import { ConfigBase } from '../../models/config.models';
3
3
  export declare class DependencyContainerUtil {
4
- static createContainer(): DependencyContainer;
4
+ static registerConfig<TConfig extends ConfigBase>(config: TConfig): void;
5
5
  static resolveConfig<TConfig extends ConfigBase = ConfigBase>(dependencyContainer?: DependencyContainer): TConfig;
6
6
  }
@@ -1,17 +1,14 @@
1
- import { CONFIG_TOKEN as e, DEVICE_PIXEL_RATIO_SERVICE_TOKEN as t, KEYBOARD_SHORTCUT_SERVICE_TOKEN as n, WINDOW_SERVICE_TOKEN as r } from "../../constants/config.constants.js";
2
- import { container as i } from "tsyringe";
3
- import { WindowService as a } from "@gen-epix/ui-core/classes/services/WindowService";
4
- import { DevicePixelRatioService as o } from "@gen-epix/ui-core/classes/services/DevicePixelRatioService";
5
- import { KeyboardShortcutService as s } from "@gen-epix/ui-core/classes/services/KeyboardShortcutService";
1
+ import { CONFIG_TOKEN as e } from "../../constants/config.constants.js";
2
+ import { container as t } from "tsyringe";
6
3
  // src/utils/DependencyContainerUtil/DependencyContainerUtil.ts
7
- var c = class {
8
- static createContainer() {
9
- return i.registerInstance(r, a.getInstance()), i.registerInstance(t, o.getInstance()), i.registerInstance(n, s.getInstance()), i;
4
+ var n = class {
5
+ static registerConfig(n) {
6
+ t.register(e, { useValue: n });
10
7
  }
11
- static resolveConfig(t = i) {
12
- return t.resolve(e);
8
+ static resolveConfig(n = t) {
9
+ return n.resolve(e);
13
10
  }
14
11
  };
15
- export { c as DependencyContainerUtil };
12
+ export { n as DependencyContainerUtil };
16
13
 
17
14
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["DependencyContainerUtil","container","WINDOW_SERVICE_TOKEN","WindowService","DEVICE_PIXEL_RATIO_SERVICE_TOKEN","DevicePixelRatioService","KEYBOARD_SHORTCUT_SERVICE_TOKEN","KeyboardShortcutService","dependencyContainer","CONFIG_TOKEN"],"sources":["../../../src/utils/DependencyContainerUtil/DependencyContainerUtil.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport type { DependencyContainer } from 'tsyringe';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\nimport { DevicePixelRatioService } from '@gen-epix/ui-core/classes/services/DevicePixelRatioService';\nimport { KeyboardShortcutService } from '@gen-epix/ui-core/classes/services/KeyboardShortcutService';\n\nimport {\n CONFIG_TOKEN,\n DEVICE_PIXEL_RATIO_SERVICE_TOKEN,\n KEYBOARD_SHORTCUT_SERVICE_TOKEN,\n WINDOW_SERVICE_TOKEN,\n} from '../../constants/config.constants';\nimport type { ConfigBase } from '../../models/config.models';\n\nexport class DependencyContainerUtil {\n public static createContainer(): DependencyContainer {\n container.registerInstance(WINDOW_SERVICE_TOKEN, WindowService.getInstance());\n container.registerInstance(DEVICE_PIXEL_RATIO_SERVICE_TOKEN, DevicePixelRatioService.getInstance());\n container.registerInstance(KEYBOARD_SHORTCUT_SERVICE_TOKEN, KeyboardShortcutService.getInstance());\n\n return container;\n }\n\n public static resolveConfig<TConfig extends ConfigBase = ConfigBase>(dependencyContainer: DependencyContainer = container): TConfig {\n return dependencyContainer.resolve(CONFIG_TOKEN) as TConfig;\n }\n}\n"],"mappings":";;;;;;AAcA,IAAaA,IAAb,MAAqC;CACnC,OAAc,kBAAuC;EAKnD,OAJAC,EAAU,iBAAiBC,GAAsBC,EAAc,YAAY,CAAC,GAC5EF,EAAU,iBAAiBG,GAAkCC,EAAwB,YAAY,CAAC,GAClGJ,EAAU,iBAAiBK,GAAiCC,EAAwB,YAAY,CAAC,GAE1FN;CACT;CAEA,OAAc,cAAuD,IAA2CA,GAAoB;EAClI,OAAOO,EAAoB,QAAQC,CAAY;CACjD;AACF"}
1
+ {"version":3,"file":"index.js","names":["DependencyContainerUtil","CONFIG_TOKEN","config","container","dependencyContainer"],"sources":["../../../src/utils/DependencyContainerUtil/DependencyContainerUtil.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport type { DependencyContainer } from 'tsyringe';\n\nimport type { ConfigBase } from '../../models/config.models';\nimport { CONFIG_TOKEN } from '../../constants/config.constants';\n\nexport class DependencyContainerUtil {\n public static registerConfig<TConfig extends ConfigBase>(config: TConfig): void {\n container.register(CONFIG_TOKEN, { useValue: config });\n }\n\n public static resolveConfig<TConfig extends ConfigBase = ConfigBase>(dependencyContainer: DependencyContainer = container): TConfig {\n return dependencyContainer.resolve(CONFIG_TOKEN) as TConfig;\n }\n}\n"],"mappings":";;;AAMA,IAAaA,IAAb,MAAqC;CACnC,OAAc,eAA2C,GAAuB;EAC9E,EAAU,SAASC,GAAc,EAAE,UAAUC,EAAO,CAAC;CACvD;CAEA,OAAc,cAAuD,IAA2CC,GAAoB;EAClI,OAAOC,EAAoB,QAAQH,CAAY;CACjD;AACF"}
@@ -1,4 +1,4 @@
1
1
  import { ConfigBase } from '../../models/config.models';
2
2
  export declare class StandardConfigUtil {
3
- static createConfig(): Pick<ConfigBase, 'nonce' | 'pageConfig' | 'spinner'>;
3
+ static createConfig(): Pick<ConfigBase, 'nonce' | 'pageConfig'>;
4
4
  }
@@ -4,11 +4,7 @@ var t = class {
4
4
  static createConfig() {
5
5
  return {
6
6
  nonce: e.getInstance().document.querySelector("meta[name=\"csp-nonce\"]")?.getAttribute("content") ?? void 0,
7
- pageConfig: { appBarHeight: 48 },
8
- spinner: {
9
- DEFAULT_CIRCULAR_PROGRESS_SIZE: 40,
10
- DEFAULT_TAKING_LONGER_TIMEOUT_MS: 5e3
11
- }
7
+ pageConfig: { appBarHeight: 48 }
12
8
  };
13
9
  }
14
10
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["StandardConfigUtil","WindowService"],"sources":["../../../src/utils/StandardConfigUtil/StandardConfigUtil.ts"],"sourcesContent":["import { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\n\nimport type { ConfigBase } from '../../models/config.models';\n\nexport class StandardConfigUtil {\n public static createConfig(): Pick<ConfigBase, 'nonce' | 'pageConfig' | 'spinner'> {\n return {\n nonce: WindowService.getInstance().document.querySelector('meta[name=\"csp-nonce\"]')?.getAttribute('content') ?? undefined,\n pageConfig: {\n appBarHeight: 48,\n },\n spinner: {\n DEFAULT_CIRCULAR_PROGRESS_SIZE: 40,\n DEFAULT_TAKING_LONGER_TIMEOUT_MS: 5000,\n },\n };\n }\n}\n"],"mappings":";;AAIA,IAAaA,IAAb,MAAgC;CAC9B,OAAc,eAAqE;EACjF,OAAO;GACL,OAAOC,EAAc,YAAY,CAAC,CAAC,SAAS,cAAc,0BAAwB,CAAC,EAAE,aAAa,SAAS,KAAK,KAAA;GAChH,YAAY,EACV,cAAc,GAChB;GACA,SAAS;IACP,gCAAgC;IAChC,kCAAkC;GACpC;EACF;CACF;AACF"}
1
+ {"version":3,"file":"index.js","names":["StandardConfigUtil","WindowService"],"sources":["../../../src/utils/StandardConfigUtil/StandardConfigUtil.ts"],"sourcesContent":["import { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\n\nimport type { ConfigBase } from '../../models/config.models';\n\nexport class StandardConfigUtil {\n public static createConfig(): Pick<ConfigBase, 'nonce' | 'pageConfig'> {\n return {\n nonce: WindowService.getInstance().document.querySelector('meta[name=\"csp-nonce\"]')?.getAttribute('content') ?? undefined,\n pageConfig: {\n appBarHeight: 48,\n },\n };\n }\n}\n"],"mappings":";;AAIA,IAAaA,IAAb,MAAgC;CAC9B,OAAc,eAAyD;EACrE,OAAO;GACL,OAAOC,EAAc,YAAY,CAAC,CAAC,SAAS,cAAc,0BAAwB,CAAC,EAAE,aAAa,SAAS,KAAK,KAAA;GAChH,YAAY,EACV,cAAc,GAChB;EACF;CACF;AACF"}
@@ -1,10 +1,10 @@
1
- import { WINDOW_SERVICE_TOKEN as e } from "../../constants/config.constants.js";
2
- import { container as t } from "tsyringe";
1
+ import { container as e } from "tsyringe";
2
+ import { WindowService as t } from "@gen-epix/ui-core/classes/services/WindowService";
3
3
  // src/utils/UrlUtil/UrlUtil.ts
4
4
  var n = class {
5
5
  static clearSearchParams() {
6
- let n = new URL(t.resolve(e).window.location.href);
7
- n.search = "", t.resolve(e).window.history.replaceState(null, "", n.toString());
6
+ let n = new URL(e.resolve(t).window.location.href);
7
+ n.search = "", e.resolve(t).window.history.replaceState(null, "", n.toString());
8
8
  }
9
9
  static fastaLabelFromUrl(e) {
10
10
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["UrlUtil","url","container","WINDOW_SERVICE_TOKEN","urlObject","segment"],"sources":["../../../src/utils/UrlUtil/UrlUtil.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport type { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\n\nimport { WINDOW_SERVICE_TOKEN } from '../../constants/config.constants';\n\nexport class UrlUtil {\n public static clearSearchParams(): void {\n const url = new URL(container.resolve<WindowService>(WINDOW_SERVICE_TOKEN).window.location.href);\n url.search = '';\n container.resolve<WindowService>(WINDOW_SERVICE_TOKEN).window.history.replaceState(null, '', url.toString());\n }\n\n public static fastaLabelFromUrl(url: string): string {\n try {\n const urlObject = new URL(url);\n const segment = urlObject.pathname.split('/').filter(Boolean).pop();\n if (segment) {\n return decodeURIComponent(segment);\n }\n return `${urlObject.hostname}.fasta`;\n } catch {\n return 'remote-alignment.fasta';\n }\n }\n\n public static validateFastaUrl(url: string): string {\n let urlObject: URL;\n try {\n urlObject = new URL(url.trim());\n } catch {\n throw new Error('Enter a valid FASTA URL.');\n }\n if (urlObject.protocol !== 'http:' && urlObject.protocol !== 'https:') {\n throw new Error('FASTA URLs must use HTTP or HTTPS.');\n }\n return urlObject.href;\n }\n}\n"],"mappings":";;;AAKA,IAAaA,IAAb,MAAqB;CACnB,OAAc,oBAA0B;EACtC,IAAMC,IAAM,IAAI,IAAIC,EAAU,QAAuBC,CAAoB,CAAC,CAAC,OAAO,SAAS,IAAI;EAE/F,AADA,EAAI,SAAS,IACbD,EAAU,QAAuBC,CAAoB,CAAC,CAAC,OAAO,QAAQ,aAAa,MAAM,IAAIF,EAAI,SAAS,CAAC;CAC7G;CAEA,OAAc,kBAAkB,GAAqB;EACnD,IAAI;GACF,IAAMG,IAAY,IAAI,IAAIH,CAAG,GACvBI,IAAUD,EAAU,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI;GAIlE,OAHIC,IACK,mBAAmBA,CAAO,IAE5B,GAAGD,EAAU,SAAS;EAC/B,QAAQ;GACN,OAAO;EACT;CACF;CAEA,OAAc,iBAAiB,GAAqB;EAClD,IAAIA;EACJ,IAAI;GACF,IAAY,IAAI,IAAIH,EAAI,KAAK,CAAC;EAChC,QAAQ;GACN,MAAU,MAAM,0BAA0B;EAC5C;EACA,IAAIG,EAAU,aAAa,WAAWA,EAAU,aAAa,UAC3D,MAAU,MAAM,oCAAoC;EAEtD,OAAOA,EAAU;CACnB;AACF"}
1
+ {"version":3,"file":"index.js","names":["UrlUtil","url","container","WindowService","urlObject","segment"],"sources":["../../../src/utils/UrlUtil/UrlUtil.ts"],"sourcesContent":["import { container } from 'tsyringe';\nimport { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';\n\n\nexport class UrlUtil {\n public static clearSearchParams(): void {\n const url = new URL(container.resolve(WindowService).window.location.href);\n url.search = '';\n container.resolve(WindowService).window.history.replaceState(null, '', url.toString());\n }\n\n public static fastaLabelFromUrl(url: string): string {\n try {\n const urlObject = new URL(url);\n const segment = urlObject.pathname.split('/').filter(Boolean).pop();\n if (segment) {\n return decodeURIComponent(segment);\n }\n return `${urlObject.hostname}.fasta`;\n } catch {\n return 'remote-alignment.fasta';\n }\n }\n\n public static validateFastaUrl(url: string): string {\n let urlObject: URL;\n try {\n urlObject = new URL(url.trim());\n } catch {\n throw new Error('Enter a valid FASTA URL.');\n }\n if (urlObject.protocol !== 'http:' && urlObject.protocol !== 'https:') {\n throw new Error('FASTA URLs must use HTTP or HTTPS.');\n }\n return urlObject.href;\n }\n}\n"],"mappings":";;;AAIA,IAAaA,IAAb,MAAqB;CACnB,OAAc,oBAA0B;EACtC,IAAMC,IAAM,IAAI,IAAIC,EAAU,QAAQC,CAAa,CAAC,CAAC,OAAO,SAAS,IAAI;EAEzE,AADA,EAAI,SAAS,IACbD,EAAU,QAAQC,CAAa,CAAC,CAAC,OAAO,QAAQ,aAAa,MAAM,IAAIF,EAAI,SAAS,CAAC;CACvF;CAEA,OAAc,kBAAkB,GAAqB;EACnD,IAAI;GACF,IAAMG,IAAY,IAAI,IAAIH,CAAG,GACvBI,IAAUD,EAAU,SAAS,MAAM,GAAG,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,IAAI;GAIlE,OAHIC,IACK,mBAAmBA,CAAO,IAE5B,GAAGD,EAAU,SAAS;EAC/B,QAAQ;GACN,OAAO;EACT;CACF;CAEA,OAAc,iBAAiB,GAAqB;EAClD,IAAIA;EACJ,IAAI;GACF,IAAY,IAAI,IAAIH,EAAI,KAAK,CAAC;EAChC,QAAQ;GACN,MAAU,MAAM,0BAA0B;EAC5C;EACA,IAAIG,EAAU,aAAa,WAAWA,EAAU,aAAa,UAC3D,MAAU,MAAM,oCAAoC;EAEtD,OAAOA,EAAU;CACnB;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rivm-loculus-tools/common-frontend",
3
- "version": "0.5.0",
3
+ "version": "0.7.0",
4
4
  "license": "EUPL-1.2",
5
5
  "repository": {
6
6
  "type": "git",
@@ -12,7 +12,7 @@
12
12
  "@emotion/react": "*",
13
13
  "@emotion/styled": "*",
14
14
  "@gen-epix/ui-core-components": "^4.6.0",
15
- "@gen-epix/ui-core-form": "^4.5.0",
15
+ "@gen-epix/ui-core-form": "^4.5.1",
16
16
  "@gen-epix/ui-core": "^3.10.0",
17
17
  "@mui/icons-material": "*",
18
18
  "@mui/material": "*",
@@ -35,9 +35,9 @@
35
35
  "@emotion/cache": "11.14.0",
36
36
  "@emotion/react": "11.14.0",
37
37
  "@emotion/styled": "11.14.1",
38
- "@gen-epix/eslint-config": "0.8.0",
38
+ "@gen-epix/eslint-config": "0.9.0",
39
39
  "@gen-epix/ui-core-components": "4.6.0",
40
- "@gen-epix/ui-core-form": "4.5.0",
40
+ "@gen-epix/ui-core-form": "4.5.1",
41
41
  "@gen-epix/ui-core": "3.10.0",
42
42
  "@mui/icons-material": "9.5.0",
43
43
  "@mui/material": "9.5.0",
@@ -45,7 +45,7 @@
45
45
  "@mui/system": "9.5.0",
46
46
  "@mui/utils": "9.5.0",
47
47
  "@types/lodash": "4.17.27",
48
- "@types/node": "26.6.5",
48
+ "@types/node": "26.6.6",
49
49
  "@types/react-dom": "19.3.0",
50
50
  "@types/react": "19.3.0",
51
51
  "@vitejs/plugin-react": "6.1.2",
@@ -171,9 +171,9 @@
171
171
  "types": "./dist/stores/fastaDataStore/index.d.ts",
172
172
  "import": "./dist/stores/fastaDataStore/index.js"
173
173
  },
174
- "./theme": {
175
- "types": "./dist/theme/index.d.ts",
176
- "import": "./dist/theme/index.js"
174
+ "./theme/demoTheme": {
175
+ "types": "./dist/theme/demoTheme/index.d.ts",
176
+ "import": "./dist/theme/demoTheme/index.js"
177
177
  },
178
178
  "./utils/DependencyContainerUtil": {
179
179
  "types": "./dist/utils/DependencyContainerUtil/index.d.ts",
@@ -1 +0,0 @@
1
- export * from './theme';