@rivm-loculus-tools/common-frontend 0.4.0 → 0.6.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.
Files changed (53) hide show
  1. package/dist/_chunks/EmotionCacheService.js +10 -11
  2. package/dist/_chunks/EmotionCacheService.js.map +1 -1
  3. package/dist/_chunks/decorate.js +1 -2
  4. package/dist/_chunks/react.js +2 -3
  5. package/dist/_chunks/react.js.map +1 -1
  6. package/dist/classes/services/FastaDataEventBusService/index.js +1 -2
  7. package/dist/components/SearchBar/index.js +1 -2
  8. package/dist/components/app/App/App.d.ts +2 -5
  9. package/dist/components/app/App/index.js +35 -38
  10. package/dist/components/app/App/index.js.map +1 -1
  11. package/dist/components/fasta/FastaDataImportDialog/index.js +1 -2
  12. package/dist/components/fasta/FastaDataImportDialogLoader/index.js +1 -2
  13. package/dist/components/fasta/FastaNotLoaded/index.js +1 -2
  14. package/dist/components/fasta/FastaPageHeaderCenterComponent/index.js +1 -2
  15. package/dist/components/fasta/FastaPageHeaderImportButton/index.js +1 -2
  16. package/dist/components/fasta/FastaPageHeaderResetButton/index.js +1 -2
  17. package/dist/components/ui/ButtonWithMenu/index.js +1 -2
  18. package/dist/components/ui/GenericErrorMessage/index.js +1 -2
  19. package/dist/components/ui/I18nWrapper/index.js +1 -2
  20. package/dist/components/ui/PageCommon/index.js +1 -2
  21. package/dist/components/ui/PageCommonDrawer/index.js +1 -2
  22. package/dist/components/ui/PageCommonHeader/index.js +1 -2
  23. package/dist/constants/config.constants.d.ts +0 -6
  24. package/dist/constants/config.constants.js +3 -4
  25. package/dist/constants/config.constants.js.map +1 -1
  26. package/dist/constants/page.constants.js +1 -2
  27. package/dist/context/pageCommonContext/index.js +1 -2
  28. package/dist/hooks/useConfig/index.js +3 -4
  29. package/dist/hooks/useConfig/index.js.map +1 -1
  30. package/dist/hooks/useUpdateDocumentTitle/index.js +1 -2
  31. package/dist/models/fasta.models.js +1 -2
  32. package/dist/models/fasta.models.js.map +1 -1
  33. package/dist/pages/ErrorPage/index.js +1 -2
  34. package/dist/stores/fastaDataStore/index.js +1 -2
  35. package/dist/theme/index.js +1 -2
  36. package/dist/utils/DependencyContainerUtil/DependencyContainerUtil.d.ts +1 -1
  37. package/dist/utils/DependencyContainerUtil/index.js +9 -13
  38. package/dist/utils/DependencyContainerUtil/index.js.map +1 -1
  39. package/dist/utils/DownloadUtil/index.js +1 -2
  40. package/dist/utils/ErrorUtil/index.js +1 -2
  41. package/dist/utils/ExportUtil/index.js +1 -2
  42. package/dist/utils/FastaUtil/index.js +1 -2
  43. package/dist/utils/MetaDataUtil/index.js +1 -2
  44. package/dist/utils/StandardConfigUtil/index.js +1 -2
  45. package/dist/utils/UrlUtil/index.js +5 -6
  46. package/dist/utils/UrlUtil/index.js.map +1 -1
  47. package/package.json +16 -20
  48. package/dist/context/commonConfigContext/CommonConfigContext.d.ts +0 -9
  49. package/dist/context/commonConfigContext/CommonConfigContextProvider.d.ts +0 -6
  50. package/dist/context/commonConfigContext/index.d.ts +0 -3
  51. package/dist/context/commonConfigContext/index.js +0 -34
  52. package/dist/context/commonConfigContext/index.js.map +0 -1
  53. package/dist/context/commonConfigContext/useCommonConfigContext.d.ts +0 -3
@@ -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,18 +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";
6
- //#region 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;
1
+ import { CONFIG_TOKEN as e } from "../../constants/config.constants.js";
2
+ import { container as t } from "tsyringe";
3
+ // src/utils/DependencyContainerUtil/DependencyContainerUtil.ts
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
- //#endregion
16
- export { c as DependencyContainerUtil };
12
+ export { n as DependencyContainerUtil };
17
13
 
18
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,10 +1,9 @@
1
- //#region src/utils/DownloadUtil/DownloadUtil.ts
1
+ // src/utils/DownloadUtil/DownloadUtil.ts
2
2
  var e = class {
3
3
  static datasetFilename(e) {
4
4
  return `${e.trim().replace(/\.[^.]+$/, "").replace(/[^a-zA-Z0-9._-]+/g, "_").replace(/^\.+|\.+$/g, "").slice(0, 80) || "alignment"}.fasta`;
5
5
  }
6
6
  };
7
- //#endregion
8
7
  export { e as DownloadUtil };
9
8
 
10
9
  //# sourceMappingURL=index.js.map
@@ -1,10 +1,9 @@
1
- //#region src/utils/ErrorUtil/ErrorUtil.ts
1
+ // src/utils/ErrorUtil/ErrorUtil.ts
2
2
  var e = class {
3
3
  static getErrorMessage(e, t) {
4
4
  return e instanceof Error ? e.message : t;
5
5
  }
6
6
  };
7
- //#endregion
8
7
  export { e as ErrorUtil };
9
8
 
10
9
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import { DownloadUtil as e } from "@gen-epix/ui-core/utils/DownloadUtil";
2
- //#region src/utils/ExportUtil/ExportUtil.ts
2
+ // src/utils/ExportUtil/ExportUtil.ts
3
3
  var t = class {
4
4
  static downloadCanvasAsImage(t, n, r = "phylogenetic_tree") {
5
5
  if (!t) {
@@ -36,7 +36,6 @@ var t = class {
36
36
  e.createDownloadUrl(i, n), URL.revokeObjectURL(i);
37
37
  }
38
38
  };
39
- //#endregion
40
39
  export { t as ExportUtil };
41
40
 
42
41
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- //#region src/utils/FastaUtil/FastaUtil.ts
1
+ // src/utils/FastaUtil/FastaUtil.ts
2
2
  var e = class e {
3
3
  static parseFasta(t) {
4
4
  if (!t?.trim()) return e.createErrorResult("The FASTA input is empty.");
@@ -50,7 +50,6 @@ var e = class e {
50
50
  };
51
51
  }
52
52
  };
53
- //#endregion
54
53
  export { e as FastaUtil };
55
54
 
56
55
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- //#region src/utils/MetaDataUtil/MetaDataUtil.ts
1
+ // src/utils/MetaDataUtil/MetaDataUtil.ts
2
2
  var e = class e {
3
3
  static findBestMatchingColumn = (t, n, r) => {
4
4
  let i = e.getMatchCounts(t, n, r), a = null, o = -1;
@@ -127,7 +127,6 @@ var e = class e {
127
127
  };
128
128
  };
129
129
  };
130
- //#endregion
131
130
  export { e as MetaDataUtil };
132
131
 
133
132
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import { WindowService as e } from "@gen-epix/ui-core/classes/services/WindowService";
2
- //#region src/utils/StandardConfigUtil/StandardConfigUtil.ts
2
+ // src/utils/StandardConfigUtil/StandardConfigUtil.ts
3
3
  var t = class {
4
4
  static createConfig() {
5
5
  return {
@@ -12,7 +12,6 @@ var t = class {
12
12
  };
13
13
  }
14
14
  };
15
- //#endregion
16
15
  export { t as StandardConfigUtil };
17
16
 
18
17
  //# sourceMappingURL=index.js.map
@@ -1,10 +1,10 @@
1
- import { WINDOW_SERVICE_TOKEN as e } from "../../constants/config.constants.js";
2
- import { container as t } from "tsyringe";
3
- //#region src/utils/UrlUtil/UrlUtil.ts
1
+ import { container as e } from "tsyringe";
2
+ import { WindowService as t } from "@gen-epix/ui-core/classes/services/WindowService";
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 {
@@ -25,7 +25,6 @@ var n = class {
25
25
  return t.href;
26
26
  }
27
27
  };
28
- //#endregion
29
28
  export { n as UrlUtil };
30
29
 
31
30
  //# sourceMappingURL=index.js.map
@@ -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.4.0",
3
+ "version": "0.6.0",
4
4
  "license": "EUPL-1.2",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,9 +11,9 @@
11
11
  "@emotion/cache": "*",
12
12
  "@emotion/react": "*",
13
13
  "@emotion/styled": "*",
14
- "@gen-epix/ui-core-components": "^4.5.0",
15
- "@gen-epix/ui-core-form": "^4.4.1",
16
- "@gen-epix/ui-core": "^3.9.1",
14
+ "@gen-epix/ui-core-components": "^4.6.0",
15
+ "@gen-epix/ui-core-form": "^4.5.0",
16
+ "@gen-epix/ui-core": "^3.10.0",
17
17
  "@mui/icons-material": "*",
18
18
  "@mui/material": "*",
19
19
  "@mui/styled-engine": "*",
@@ -29,39 +29,39 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "lodash": "4.18.1",
32
- "zustand": "5.0.15"
32
+ "zustand": "5.0.16"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@emotion/cache": "11.14.0",
36
36
  "@emotion/react": "11.14.0",
37
37
  "@emotion/styled": "11.14.1",
38
38
  "@gen-epix/eslint-config": "0.8.0",
39
- "@gen-epix/ui-core-components": "4.5.0",
40
- "@gen-epix/ui-core-form": "4.4.1",
41
- "@gen-epix/ui-core": "3.9.1",
39
+ "@gen-epix/ui-core-components": "4.6.0",
40
+ "@gen-epix/ui-core-form": "4.5.0",
41
+ "@gen-epix/ui-core": "3.10.0",
42
42
  "@mui/icons-material": "9.5.0",
43
43
  "@mui/material": "9.5.0",
44
44
  "@mui/styled-engine": "9.5.0",
45
45
  "@mui/system": "9.5.0",
46
46
  "@mui/utils": "9.5.0",
47
- "@types/lodash": "4.17.26",
47
+ "@types/lodash": "4.17.27",
48
48
  "@types/node": "26.6.5",
49
49
  "@types/react-dom": "19.3.0",
50
50
  "@types/react": "19.3.0",
51
51
  "@vitejs/plugin-react": "6.1.2",
52
- "eslint": "10.12.0",
53
- "i18next": "26.4.4",
54
- "react-dom": "19.3.0",
52
+ "eslint": "10.13.0",
53
+ "i18next": "26.5.11",
54
+ "react-dom": "19.3.1",
55
55
  "react-error-boundary": "6.1.6",
56
- "react-hook-form": "7.90.0",
57
- "react-i18next": "17.0.16",
58
- "react": "19.3.0",
56
+ "react-hook-form": "7.91.0",
57
+ "react-i18next": "17.1.9",
58
+ "react": "19.3.1",
59
59
  "reflect-metadata": "0.2.2",
60
60
  "tsyringe": "4.10.0",
61
61
  "typescript": "6.0.3",
62
62
  "vite-plugin-dts": "5.1.2",
63
63
  "vite-plugin-static-copy": "4.1.1",
64
- "vite": "8.3.4"
64
+ "vite": "8.3.5"
65
65
  },
66
66
  "files": [
67
67
  "dist"
@@ -139,10 +139,6 @@
139
139
  "types": "./dist/constants/page.constants.d.ts",
140
140
  "import": "./dist/constants/page.constants.js"
141
141
  },
142
- "./context/commonConfigContext": {
143
- "types": "./dist/context/commonConfigContext/index.d.ts",
144
- "import": "./dist/context/commonConfigContext/index.js"
145
- },
146
142
  "./context/pageCommonContext": {
147
143
  "types": "./dist/context/pageCommonContext/index.d.ts",
148
144
  "import": "./dist/context/pageCommonContext/index.js"
@@ -1,9 +0,0 @@
1
- import { CoreComponentsConfig } from '@gen-epix/ui-core-components/context/CoreComponentsConfigContext';
2
- import { DependencyContainer } from 'tsyringe';
3
- import { ConfigBase } from '../../models/config.models';
4
- export type CommonConfig<TConfig extends ConfigBase = ConfigBase> = {
5
- config: TConfig;
6
- container: DependencyContainer;
7
- genEpixCoreComponentsConfig: CoreComponentsConfig;
8
- };
9
- export declare const CommonConfigContext: import('react').Context<CommonConfig<ConfigBase> | null>;
@@ -1,6 +0,0 @@
1
- import { PropsWithChildren } from 'react';
2
- import { DependencyContainer } from 'tsyringe';
3
- export type CommonConfigContextProviderProps = PropsWithChildren<{
4
- readonly container: DependencyContainer;
5
- }>;
6
- export declare const CommonConfigContextProvider: (props: CommonConfigContextProviderProps) => import('react').JSX.Element;
@@ -1,3 +0,0 @@
1
- export * from './CommonConfigContext';
2
- export * from './CommonConfigContextProvider';
3
- export * from './useCommonConfigContext';
@@ -1,34 +0,0 @@
1
- import { DependencyContainerUtil as e } from "../../utils/DependencyContainerUtil/index.js";
2
- import { jsx as t } from "react/jsx-runtime";
3
- import { createContext as n, use as r, useMemo as i } from "react";
4
- import { CoreComponentsConfigContext as a } from "@gen-epix/ui-core-components/context/CoreComponentsConfigContext";
5
- //#region src/context/commonConfigContext/CommonConfigContext.tsx
6
- var o = n(null), s = (n) => {
7
- let { children: r, container: s } = n, c = e.resolveConfig(s), l = i(() => ({ spinner: {
8
- defaultCircularProgressSize: c.spinner.DEFAULT_CIRCULAR_PROGRESS_SIZE,
9
- defaultTakingLongerTimeoutMs: c.spinner.DEFAULT_TAKING_LONGER_TIMEOUT_MS
10
- } }), [c.spinner]), u = i(() => ({
11
- config: c,
12
- container: s,
13
- genEpixCoreComponentsConfig: l
14
- }), [
15
- c,
16
- s,
17
- l
18
- ]);
19
- return /* @__PURE__ */ t(a, {
20
- value: l,
21
- children: /* @__PURE__ */ t(o, {
22
- value: u,
23
- children: r
24
- })
25
- });
26
- }, c = () => {
27
- let e = r(o);
28
- if (!e) throw Error("CommonConfigContext is not available");
29
- return e;
30
- };
31
- //#endregion
32
- export { o as CommonConfigContext, s as CommonConfigContextProvider, c as useCommonConfigContext };
33
-
34
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["CommonConfigContext","createContext","CommonConfigContextProvider","props","config","DependencyContainerUtil","container","genEpixCoreComponentsConfig","useMemo","CommonConfig","CoreComponentsConfigContext","useCommonConfigContext","use"],"sources":["../../../src/context/commonConfigContext/CommonConfigContext.tsx","../../../src/context/commonConfigContext/CommonConfigContextProvider.tsx","../../../src/context/commonConfigContext/useCommonConfigContext.tsx"],"sourcesContent":["import type { CoreComponentsConfig } from '@gen-epix/ui-core-components/context/CoreComponentsConfigContext';\nimport { createContext } from 'react';\nimport type { DependencyContainer } from 'tsyringe';\n\nimport type { ConfigBase } from '../../models/config.models';\n\nexport type CommonConfig<TConfig extends ConfigBase = ConfigBase> = {\n config: TConfig;\n container: DependencyContainer;\n genEpixCoreComponentsConfig: CoreComponentsConfig;\n};\n\nexport const CommonConfigContext = createContext<CommonConfig | null>(null);\n","import { useMemo } from 'react';\nimport type { PropsWithChildren } from 'react';\nimport { CoreComponentsConfigContext } from '@gen-epix/ui-core-components/context/CoreComponentsConfigContext';\nimport type { DependencyContainer } from 'tsyringe';\n\nimport { DependencyContainerUtil } from '../../utils/DependencyContainerUtil';\nimport type { ConfigBase } from '../../models/config.models';\n\nimport type { CommonConfig } from './CommonConfigContext';\nimport { CommonConfigContext } from './CommonConfigContext';\n\n\nexport type CommonConfigContextProviderProps = PropsWithChildren<{\n readonly container: DependencyContainer;\n}>;\n\nexport const CommonConfigContextProvider = (\n props: CommonConfigContextProviderProps,\n) => {\n const { children, container } = props;\n const config = DependencyContainerUtil.resolveConfig<ConfigBase>(container);\n const genEpixCoreComponentsConfig = useMemo<CommonConfig['genEpixCoreComponentsConfig']>(() => ({\n spinner: {\n defaultCircularProgressSize: config.spinner.DEFAULT_CIRCULAR_PROGRESS_SIZE!,\n defaultTakingLongerTimeoutMs: config.spinner.DEFAULT_TAKING_LONGER_TIMEOUT_MS,\n },\n }), [config.spinner]);\n const CommonConfig = useMemo(() => ({ config, container, genEpixCoreComponentsConfig }), [config, container, genEpixCoreComponentsConfig]);\n\n return (\n <CoreComponentsConfigContext value={genEpixCoreComponentsConfig}>\n <CommonConfigContext value={CommonConfig}>\n {children}\n </CommonConfigContext>\n </CoreComponentsConfigContext>\n );\n};\n","import { use } from 'react';\n\nimport type { ConfigBase } from '../../models/config.models';\n\nimport type { CommonConfig } from './CommonConfigContext';\nimport { CommonConfigContext } from './CommonConfigContext';\n\nexport const useCommonConfigContext = <TConfig extends ConfigBase = ConfigBase>(): CommonConfig<TConfig> => {\n const config = use(CommonConfigContext);\n if (!config) {\n throw new Error('CommonConfigContext is not available');\n }\n return config as CommonConfig<TConfig>;\n};\n"],"mappings":";;;;;AAYA,IAAaA,IAAsBC,EAAmC,IAAI,GCI7DC,KACX,MACG;CACH,IAAM,EAAE,aAAU,iBAAcC,GAC1BC,IAASC,EAAwB,cAA0BC,CAAS,GACpEC,IAA8BC,SAA4D,EAC9F,SAAS;EACP,6BAA6BJ,EAAO,QAAQ;EAC5C,8BAA8BA,EAAO,QAAQ;CAC/C,EACF,IAAI,CAACA,EAAO,OAAO,CAAC,GACdK,IAAeD,SAAe;EAAE;EAAQ;EAAW;CAA4B,IAAI;EAACJ;EAAQE;EAAWC;CAA2B,CAAC;CAEzI,OACE,kBAACG,GAAD;EAA6B,OAAOH;EAClC,UAAA,kBAACP,GAAD;GAAqB,OAAOS;GACzB;EACkB,CAAA;CACM,CAAA;AAEjC,GC7BaE,UAA+F;CAC1G,IAAMP,IAASQ,EAAIZ,CAAmB;CACtC,IAAI,CAACI,GACH,MAAU,MAAM,sCAAsC;CAExD,OAAOA;AACT"}
@@ -1,3 +0,0 @@
1
- import { ConfigBase } from '../../models/config.models';
2
- import { CommonConfig } from './CommonConfigContext';
3
- export declare const useCommonConfigContext: <TConfig extends ConfigBase = ConfigBase>() => CommonConfig<TConfig>;