@seliseblocks/genesis-os 4.4.6 → 4.4.7

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 (127) hide show
  1. package/dist/{all-OJ5YSNAN.js → all-DOPVVJD5.js} +41 -41
  2. package/dist/all-DOPVVJD5.js.map +1 -0
  3. package/dist/{all-2UHIE3HU.cjs → all-U2EMOAAN.cjs} +41 -41
  4. package/dist/all-U2EMOAAN.cjs.map +1 -0
  5. package/dist/chunk-2MP66EX3.cjs +16 -0
  6. package/dist/chunk-2MP66EX3.cjs.map +1 -0
  7. package/dist/chunk-3LBTW4A3.cjs +70 -0
  8. package/dist/chunk-3LBTW4A3.cjs.map +1 -0
  9. package/dist/{chunk-ZR6LRRN6.js → chunk-3OO2YVXW.js} +13 -7
  10. package/dist/chunk-3OO2YVXW.js.map +1 -0
  11. package/dist/chunk-3V7O45KN.js +86 -0
  12. package/dist/chunk-3V7O45KN.js.map +1 -0
  13. package/dist/{chunk-QTSTAWK3.cjs → chunk-4RZMYO3F.cjs} +8 -7
  14. package/dist/chunk-4RZMYO3F.cjs.map +1 -0
  15. package/dist/{chunk-356ZGDMJ.cjs → chunk-5IOXQBUO.cjs} +3 -3
  16. package/dist/{chunk-356ZGDMJ.cjs.map → chunk-5IOXQBUO.cjs.map} +1 -1
  17. package/dist/{chunk-JQ4U53QV.cjs → chunk-5JLLXRMI.cjs} +41 -41
  18. package/dist/{chunk-JQ4U53QV.cjs.map → chunk-5JLLXRMI.cjs.map} +1 -1
  19. package/dist/chunk-6QSPMPJD.js +3 -0
  20. package/dist/chunk-6QSPMPJD.js.map +1 -0
  21. package/dist/chunk-7ZZ3KLZD.js +14 -0
  22. package/dist/chunk-7ZZ3KLZD.js.map +1 -0
  23. package/dist/{chunk-WL6LTNZN.js → chunk-ASX5UGE4.js} +40 -40
  24. package/dist/{chunk-WL6LTNZN.js.map → chunk-ASX5UGE4.js.map} +1 -1
  25. package/dist/{chunk-CGVT7IFM.cjs → chunk-CSFOG5YH.cjs} +875 -682
  26. package/dist/chunk-CSFOG5YH.cjs.map +1 -0
  27. package/dist/{chunk-NPMO67H6.js → chunk-F2IEUFPT.js} +709 -516
  28. package/dist/chunk-F2IEUFPT.js.map +1 -0
  29. package/dist/chunk-GAQGM46C.cjs +4 -0
  30. package/dist/chunk-GAQGM46C.cjs.map +1 -0
  31. package/dist/chunk-GSCW3WIQ.cjs +90 -0
  32. package/dist/chunk-GSCW3WIQ.cjs.map +1 -0
  33. package/dist/{chunk-4CMIWUZW.cjs → chunk-IPMRZNNS.cjs} +25 -24
  34. package/dist/chunk-IPMRZNNS.cjs.map +1 -0
  35. package/dist/{chunk-JITR3QYC.js → chunk-JYA5S4XN.js} +3 -64
  36. package/dist/chunk-JYA5S4XN.js.map +1 -0
  37. package/dist/chunk-KZ3NZCXZ.cjs +859 -0
  38. package/dist/chunk-KZ3NZCXZ.cjs.map +1 -0
  39. package/dist/{chunk-XRAO7JBH.js → chunk-KZOSD6FO.js} +11 -4
  40. package/dist/chunk-KZOSD6FO.js.map +1 -0
  41. package/dist/{chunk-R5OAGX3J.js → chunk-ND6E3LWI.js} +3 -3
  42. package/dist/{chunk-R5OAGX3J.js.map → chunk-ND6E3LWI.js.map} +1 -1
  43. package/dist/chunk-O2MGCS3O.js +830 -0
  44. package/dist/chunk-O2MGCS3O.js.map +1 -0
  45. package/dist/{chunk-JSXAKNHQ.js → chunk-O7TJN754.js} +7 -6
  46. package/dist/chunk-O7TJN754.js.map +1 -0
  47. package/dist/{chunk-JUVLHPQI.js → chunk-POJIHGRY.js} +3 -14
  48. package/dist/chunk-POJIHGRY.js.map +1 -0
  49. package/dist/{chunk-4QN4CYSC.cjs → chunk-RO55MFZA.cjs} +2 -64
  50. package/dist/chunk-RO55MFZA.cjs.map +1 -0
  51. package/dist/chunk-SQG7DJNY.js +68 -0
  52. package/dist/chunk-SQG7DJNY.js.map +1 -0
  53. package/dist/{chunk-X4YCRWXO.cjs → chunk-TSRDXJUG.cjs} +2 -14
  54. package/dist/chunk-TSRDXJUG.cjs.map +1 -0
  55. package/dist/{chunk-6GCU5LM7.cjs → chunk-U2LA7LBX.cjs} +2 -84
  56. package/dist/chunk-U2LA7LBX.cjs.map +1 -0
  57. package/dist/{chunk-O5ACQLWB.js → chunk-UDFH7SJI.js} +5 -4
  58. package/dist/chunk-UDFH7SJI.js.map +1 -0
  59. package/dist/{chunk-IRIDGVV2.cjs → chunk-VLZJP6FH.cjs} +70 -64
  60. package/dist/chunk-VLZJP6FH.cjs.map +1 -0
  61. package/dist/{chunk-IJMKS4XG.cjs → chunk-X3GPJW7R.cjs} +15 -8
  62. package/dist/chunk-X3GPJW7R.cjs.map +1 -0
  63. package/dist/{chunk-4UHGGHI6.js → chunk-Z4ZDSA2A.js} +3 -82
  64. package/dist/chunk-Z4ZDSA2A.js.map +1 -0
  65. package/dist/components/index.cjs +399 -394
  66. package/dist/components/index.d.cts +5 -1
  67. package/dist/components/index.d.ts +5 -1
  68. package/dist/components/index.js +52 -47
  69. package/dist/guards/index.cjs +58 -53
  70. package/dist/guards/index.js +52 -47
  71. package/dist/hooks/index.cjs +65 -62
  72. package/dist/hooks/index.d.cts +1 -1
  73. package/dist/hooks/index.d.ts +1 -1
  74. package/dist/hooks/index.js +8 -5
  75. package/dist/i18n/index.cjs +125 -0
  76. package/dist/i18n/index.cjs.map +1 -0
  77. package/dist/i18n/index.d.cts +137 -0
  78. package/dist/i18n/index.d.ts +137 -0
  79. package/dist/i18n/index.js +8 -0
  80. package/dist/i18n/index.js.map +1 -0
  81. package/dist/index.cjs +708 -591
  82. package/dist/index.d.cts +1 -0
  83. package/dist/index.d.ts +1 -0
  84. package/dist/index.js +52 -47
  85. package/dist/layouts/index.cjs +59 -54
  86. package/dist/layouts/index.js +52 -47
  87. package/dist/lib/index.cjs +38 -36
  88. package/dist/lib/index.js +5 -3
  89. package/dist/observability/index.cjs +75 -4
  90. package/dist/observability/index.cjs.map +1 -1
  91. package/dist/observability/index.d.cts +47 -5
  92. package/dist/observability/index.d.ts +47 -5
  93. package/dist/observability/index.js +71 -2
  94. package/dist/observability/index.js.map +1 -1
  95. package/dist/pages/index.cjs +57 -52
  96. package/dist/pages/index.js +52 -47
  97. package/dist/providers/index.cjs +11 -7
  98. package/dist/providers/index.js +7 -3
  99. package/dist/store/index.cjs +15 -13
  100. package/dist/store/index.js +4 -2
  101. package/dist/{tsx-PN3P5NJP.cjs → tsx-MALMUEWS.cjs} +5 -5
  102. package/dist/tsx-MALMUEWS.cjs.map +1 -0
  103. package/dist/{tsx-UJQQBLY4.js → tsx-MJR7GSNC.js} +4 -4
  104. package/dist/tsx-MJR7GSNC.js.map +1 -0
  105. package/dist/utils/index.cjs +77 -72
  106. package/dist/utils/index.js +9 -4
  107. package/package.json +6 -1
  108. package/dist/all-2UHIE3HU.cjs.map +0 -1
  109. package/dist/all-OJ5YSNAN.js.map +0 -1
  110. package/dist/chunk-4CMIWUZW.cjs.map +0 -1
  111. package/dist/chunk-4QN4CYSC.cjs.map +0 -1
  112. package/dist/chunk-4UHGGHI6.js.map +0 -1
  113. package/dist/chunk-6GCU5LM7.cjs.map +0 -1
  114. package/dist/chunk-CGVT7IFM.cjs.map +0 -1
  115. package/dist/chunk-IJMKS4XG.cjs.map +0 -1
  116. package/dist/chunk-IRIDGVV2.cjs.map +0 -1
  117. package/dist/chunk-JITR3QYC.js.map +0 -1
  118. package/dist/chunk-JSXAKNHQ.js.map +0 -1
  119. package/dist/chunk-JUVLHPQI.js.map +0 -1
  120. package/dist/chunk-NPMO67H6.js.map +0 -1
  121. package/dist/chunk-O5ACQLWB.js.map +0 -1
  122. package/dist/chunk-QTSTAWK3.cjs.map +0 -1
  123. package/dist/chunk-X4YCRWXO.cjs.map +0 -1
  124. package/dist/chunk-XRAO7JBH.js.map +0 -1
  125. package/dist/chunk-ZR6LRRN6.js.map +0 -1
  126. package/dist/tsx-PN3P5NJP.cjs.map +0 -1
  127. package/dist/tsx-UJQQBLY4.js.map +0 -1
@@ -699,7 +699,7 @@ declare const useGetAllServices: (options: IGetAllServicesPayload) => _tanstack_
699
699
  declare function useTheme(): {
700
700
  theme: Theme;
701
701
  setTheme: (newTheme: Theme) => void;
702
- resolvedTheme: "dark" | "light";
702
+ resolvedTheme: "light" | "dark";
703
703
  };
704
704
 
705
705
  declare const useImpersonationStatusChecker: () => _tanstack_react_query.UseQueryResult<NoInfer<ImpersonationStatusResponse>, Error>;
@@ -699,7 +699,7 @@ declare const useGetAllServices: (options: IGetAllServicesPayload) => _tanstack_
699
699
  declare function useTheme(): {
700
700
  theme: Theme;
701
701
  setTheme: (newTheme: Theme) => void;
702
- resolvedTheme: "dark" | "light";
702
+ resolvedTheme: "light" | "dark";
703
703
  };
704
704
 
705
705
  declare const useImpersonationStatusChecker: () => _tanstack_react_query.UseQueryResult<NoInfer<ImpersonationStatusResponse>, Error>;
@@ -1,12 +1,15 @@
1
- export { PROJECTS_STALE_TIME_MS, applyColumnFuseFilters, createFuseSearcher, createQueryKeyFactory, defaultFuseSearchOptions, defaultPathSegmentFormatter, fuseFilter, fuseSearch, fuseSearchWithIndex, getPathSegments, useBlocksAppConfigStore, useBoolean, useCopyToClipboard, useCountDown, useDebounce, useDebouncedFuseFilter, useDisableProject, useFuseIndex, useFuseSearch, useGetAllServices, useGetBlocksNotificationConfig, useGetEnvRepositories, useGetMyOrganizations, useGetNotifications, useGetProject, useGetProjects, useIcon, useImpersonationStatusChecker, useInitiateRedirect, useKeyboardShortcut, useLanguage, useLanguageSwitcher, useLogin, useLogo, useLogout, useMarkAllAsRead, useMarkAsRead, useMediaQuery, usePathSegments, usePopoverWidth, usePrefetchRedirect, useQueryClientKit, useQueryStatesKit, useRecordClaimedTenant, useScopedPath, useSessionTenantGuard, useSignOut, useSignUpAffordance, useSignUpRedirect, useStartImpersonation, useStatusFirstOnTabReturn, useStopImpersonation, useTheme, useUpdateProject, useUpdateRepositories, useUpdateTenantGroup, useValidateCNameProject } from '../chunk-ZR6LRRN6.js';
2
- import '../chunk-O5ACQLWB.js';
3
- import '../chunk-JUVLHPQI.js';
1
+ export { PROJECTS_STALE_TIME_MS, applyColumnFuseFilters, createFuseSearcher, createQueryKeyFactory, defaultFuseSearchOptions, defaultPathSegmentFormatter, fuseFilter, fuseSearch, fuseSearchWithIndex, getPathSegments, useBlocksAppConfigStore, useBoolean, useCopyToClipboard, useCountDown, useDebounce, useDebouncedFuseFilter, useDisableProject, useFuseIndex, useFuseSearch, useGetAllServices, useGetBlocksNotificationConfig, useGetEnvRepositories, useGetMyOrganizations, useGetNotifications, useGetProject, useGetProjects, useIcon, useImpersonationStatusChecker, useInitiateRedirect, useKeyboardShortcut, useLanguage, useLanguageSwitcher, useLogin, useLogo, useLogout, useMarkAllAsRead, useMarkAsRead, useMediaQuery, usePathSegments, usePopoverWidth, usePrefetchRedirect, useQueryClientKit, useQueryStatesKit, useRecordClaimedTenant, useScopedPath, useSessionTenantGuard, useSignOut, useSignUpAffordance, useSignUpRedirect, useStartImpersonation, useStatusFirstOnTabReturn, useStopImpersonation, useTheme, useUpdateProject, useUpdateRepositories, useUpdateTenantGroup, useValidateCNameProject } from '../chunk-3OO2YVXW.js';
2
+ import '../chunk-UDFH7SJI.js';
3
+ import '../chunk-7ZZ3KLZD.js';
4
4
  export { useFilteredMenus, useIsActiveMenu, useIsMobile } from '../chunk-AHCHUUXM.js';
5
5
  export { reducer, toast, useToast } from '../chunk-XUQVWFG5.js';
6
6
  import '../chunk-3MLPBMH2.js';
7
7
  import '../chunk-BRHE44FE.js';
8
- import '../chunk-JITR3QYC.js';
9
- import '../chunk-4UHGGHI6.js';
8
+ import '../chunk-POJIHGRY.js';
9
+ import '../chunk-JYA5S4XN.js';
10
+ import '../chunk-SQG7DJNY.js';
11
+ import '../chunk-Z4ZDSA2A.js';
12
+ import '../chunk-3V7O45KN.js';
10
13
  import '../chunk-PL4HS6R6.js';
11
14
  //# sourceMappingURL=index.js.map
12
15
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,125 @@
1
+ 'use strict';
2
+
3
+ require('../chunk-GAQGM46C.cjs');
4
+ var chunkKZ3NZCXZ_cjs = require('../chunk-KZ3NZCXZ.cjs');
5
+ require('../chunk-TSRDXJUG.cjs');
6
+ require('../chunk-3LBTW4A3.cjs');
7
+ require('../chunk-GSCW3WIQ.cjs');
8
+ require('../chunk-QJOVCH5A.cjs');
9
+
10
+
11
+
12
+ Object.defineProperty(exports, "COMMON_MODULE", {
13
+ enumerable: true,
14
+ get: function () { return chunkKZ3NZCXZ_cjs.COMMON_MODULE; }
15
+ });
16
+ Object.defineProperty(exports, "DEFAULT_LANGUAGE", {
17
+ enumerable: true,
18
+ get: function () { return chunkKZ3NZCXZ_cjs.DEFAULT_LANGUAGE; }
19
+ });
20
+ Object.defineProperty(exports, "FALLBACK_LANGUAGES", {
21
+ enumerable: true,
22
+ get: function () { return chunkKZ3NZCXZ_cjs.FALLBACK_LANGUAGES; }
23
+ });
24
+ Object.defineProperty(exports, "MISSING_VALUE", {
25
+ enumerable: true,
26
+ get: function () { return chunkKZ3NZCXZ_cjs.MISSING_VALUE; }
27
+ });
28
+ Object.defineProperty(exports, "SUPPORTED_LANGUAGES", {
29
+ enumerable: true,
30
+ get: function () { return chunkKZ3NZCXZ_cjs.SUPPORTED_LANGUAGES; }
31
+ });
32
+ Object.defineProperty(exports, "configureI18n", {
33
+ enumerable: true,
34
+ get: function () { return chunkKZ3NZCXZ_cjs.configureI18n; }
35
+ });
36
+ Object.defineProperty(exports, "cultureOf", {
37
+ enumerable: true,
38
+ get: function () { return chunkKZ3NZCXZ_cjs.cultureOf; }
39
+ });
40
+ Object.defineProperty(exports, "defaultLanguageIn", {
41
+ enumerable: true,
42
+ get: function () { return chunkKZ3NZCXZ_cjs.defaultLanguageIn; }
43
+ });
44
+ Object.defineProperty(exports, "getLanguageCode", {
45
+ enumerable: true,
46
+ get: function () { return chunkKZ3NZCXZ_cjs.getLanguageCode; }
47
+ });
48
+ Object.defineProperty(exports, "interpolate", {
49
+ enumerable: true,
50
+ get: function () { return chunkKZ3NZCXZ_cjs.interpolate; }
51
+ });
52
+ Object.defineProperty(exports, "loadLanguages", {
53
+ enumerable: true,
54
+ get: function () { return chunkKZ3NZCXZ_cjs.loadLanguages; }
55
+ });
56
+ Object.defineProperty(exports, "loadModule", {
57
+ enumerable: true,
58
+ get: function () { return chunkKZ3NZCXZ_cjs.loadModule; }
59
+ });
60
+ Object.defineProperty(exports, "registerTranslations", {
61
+ enumerable: true,
62
+ get: function () { return chunkKZ3NZCXZ_cjs.registerTranslations; }
63
+ });
64
+ Object.defineProperty(exports, "remoteKey", {
65
+ enumerable: true,
66
+ get: function () { return chunkKZ3NZCXZ_cjs.remoteKey; }
67
+ });
68
+ Object.defineProperty(exports, "resetI18nRequests", {
69
+ enumerable: true,
70
+ get: function () { return chunkKZ3NZCXZ_cjs.resetI18nRequests; }
71
+ });
72
+ Object.defineProperty(exports, "resetLanguages", {
73
+ enumerable: true,
74
+ get: function () { return chunkKZ3NZCXZ_cjs.resetLanguages; }
75
+ });
76
+ Object.defineProperty(exports, "resolveLanguage", {
77
+ enumerable: true,
78
+ get: function () { return chunkKZ3NZCXZ_cjs.resolveLanguage; }
79
+ });
80
+ Object.defineProperty(exports, "resolveLanguageIn", {
81
+ enumerable: true,
82
+ get: function () { return chunkKZ3NZCXZ_cjs.resolveLanguageIn; }
83
+ });
84
+ Object.defineProperty(exports, "splitKey", {
85
+ enumerable: true,
86
+ get: function () { return chunkKZ3NZCXZ_cjs.splitKey; }
87
+ });
88
+ Object.defineProperty(exports, "tStatic", {
89
+ enumerable: true,
90
+ get: function () { return chunkKZ3NZCXZ_cjs.tStatic; }
91
+ });
92
+ Object.defineProperty(exports, "toLanguageCode", {
93
+ enumerable: true,
94
+ get: function () { return chunkKZ3NZCXZ_cjs.toLanguageCode; }
95
+ });
96
+ Object.defineProperty(exports, "toProjectLanguages", {
97
+ enumerable: true,
98
+ get: function () { return chunkKZ3NZCXZ_cjs.toProjectLanguages; }
99
+ });
100
+ Object.defineProperty(exports, "translate", {
101
+ enumerable: true,
102
+ get: function () { return chunkKZ3NZCXZ_cjs.translate; }
103
+ });
104
+ Object.defineProperty(exports, "useDocumentLanguage", {
105
+ enumerable: true,
106
+ get: function () { return chunkKZ3NZCXZ_cjs.useDocumentLanguage; }
107
+ });
108
+ Object.defineProperty(exports, "useI18nStore", {
109
+ enumerable: true,
110
+ get: function () { return chunkKZ3NZCXZ_cjs.useI18nStore; }
111
+ });
112
+ Object.defineProperty(exports, "useLanguageCode", {
113
+ enumerable: true,
114
+ get: function () { return chunkKZ3NZCXZ_cjs.useLanguageCode; }
115
+ });
116
+ Object.defineProperty(exports, "useLanguagesStore", {
117
+ enumerable: true,
118
+ get: function () { return chunkKZ3NZCXZ_cjs.useLanguagesStore; }
119
+ });
120
+ Object.defineProperty(exports, "useT", {
121
+ enumerable: true,
122
+ get: function () { return chunkKZ3NZCXZ_cjs.useT; }
123
+ });
124
+ //# sourceMappingURL=index.cjs.map
125
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,137 @@
1
+ import * as zustand from 'zustand';
2
+
3
+ interface SupportedLanguage {
4
+ /** Code the apps store and show (`en`, `de`): the culture's language part. */
5
+ code: string;
6
+ /** Culture code of the language in the localization service (`de-DE`). */
7
+ culture: string;
8
+ title: string;
9
+ /** The project's default language. */
10
+ isDefault?: boolean;
11
+ }
12
+ /** Language of the text bundled in the apps; it is never fetched. */
13
+ declare const DEFAULT_LANGUAGE = "en";
14
+ declare const COMMON_MODULE = "common";
15
+ /** Shown until the project's languages are known, and when the service cannot be reached. */
16
+ declare const FALLBACK_LANGUAGES: readonly SupportedLanguage[];
17
+ /**
18
+ * @deprecated The languages come from the project (`useLanguagesStore`). Kept for apps
19
+ * that still render their own selector from it.
20
+ */
21
+ declare const SUPPORTED_LANGUAGES: readonly SupportedLanguage[];
22
+ /** `de-DE` → `de`. */
23
+ declare const toLanguageCode: (culture: string) => string;
24
+ interface LanguagesState {
25
+ languages: readonly SupportedLanguage[];
26
+ /** True once the project's list is known (from the service or the cache). */
27
+ loaded: boolean;
28
+ setLanguages: (languages: readonly SupportedLanguage[]) => void;
29
+ }
30
+ declare const useLanguagesStore: zustand.UseBoundStore<zustand.StoreApi<LanguagesState>>;
31
+ /**
32
+ * Turns the service's languages (`{ languageName, languageCode, isDefault }`, either casing)
33
+ * into the app list: one entry per language code (the project's default culture wins, then
34
+ * the first one), English always present because the apps ship English.
35
+ */
36
+ declare const toProjectLanguages: (value: unknown) => SupportedLanguage[] | null;
37
+ /** Test helper: forgets the loaded list. */
38
+ declare const resetLanguages: () => void;
39
+ /**
40
+ * Loads the project's languages (`/api/Language/Gets` with the project key) once per page
41
+ * session. The cached list shows at once; a failed request keeps the cache or English only,
42
+ * and is tried again later.
43
+ */
44
+ declare const loadLanguages: () => Promise<void>;
45
+ /** The language the UI starts in: the project's default, else English. */
46
+ declare const defaultLanguageIn: (languages: readonly SupportedLanguage[]) => string;
47
+ /**
48
+ * The language to show for a stored choice. Before the project's list is known any code is
49
+ * kept (its text falls back to English if missing); afterwards a language the project does
50
+ * not offer, or no choice at all, gives the project's default.
51
+ */
52
+ declare const resolveLanguageIn: (language: string | null | undefined, languages: readonly SupportedLanguage[], loaded: boolean) => string;
53
+ declare const resolveLanguage: (language?: string | null) => string;
54
+ /** Culture code the localization service uses for an app language (`de` → `de-DE`). */
55
+ declare const cultureOf: (language: string) => string;
56
+
57
+ type Dictionary = Readonly<Record<string, string>>;
58
+ type TranslateValues = Readonly<Record<string, string | number>>;
59
+ interface DictionarySource {
60
+ language: string;
61
+ dictionary?: Dictionary;
62
+ }
63
+ declare const MISSING_VALUE = "[ KEY MISSING ]";
64
+ declare const interpolate: (template: string, values?: TranslateValues) => string;
65
+ /**
66
+ * Finds the text for a key in the first source that has it (chosen language
67
+ * first, bundled English last) and fills `{{name}}` placeholders with the
68
+ * given values. A `count` value picks the plural form (`KEY_one`,
69
+ * `KEY_other`). Returns the key itself only when no source has it, which the
70
+ * key check reports as a bug.
71
+ */
72
+ declare const translate: (sources: readonly DictionarySource[], key: string, values?: TranslateValues) => string;
73
+
74
+ interface I18nState {
75
+ /** English text shipped with the app, per module. Source of truth for English. */
76
+ bundled: Record<string, Dictionary>;
77
+ /** Published text loaded from the localization service, keyed `<language>:<module>`. */
78
+ remote: Record<string, Dictionary>;
79
+ registerBundle: (module: string, dictionary: Dictionary) => void;
80
+ setRemote: (language: string, module: string, dictionary: Dictionary) => void;
81
+ }
82
+ declare const remoteKey: (language: string, module: string) => string;
83
+ declare const useI18nStore: zustand.UseBoundStore<zustand.StoreApi<I18nState>>;
84
+ /**
85
+ * Registers the bundled English text of a module. Call once per module at app
86
+ * start (for example from `app/i18n/index.ts`), before the first render.
87
+ */
88
+ declare const registerTranslations: (module: string, dictionary: Dictionary) => void;
89
+
90
+ interface I18nConfig {
91
+ /** Origin of the localization service; `/api/Key/GetUilmFile` and `/api/Language/Gets` are called on it. */
92
+ baseUrl?: () => string;
93
+ /** Project key sent as `X-Blocks-Key`. */
94
+ blocksKey?: () => string;
95
+ /** Request timeout in ms. */
96
+ timeoutMs?: number;
97
+ /** Wait before a failed request is tried again, in ms. */
98
+ retryAfterMs?: number;
99
+ }
100
+ declare const configureI18n: (next: I18nConfig) => void;
101
+
102
+ /** Test helper: forgets which modules were requested. */
103
+ declare const resetI18nRequests: () => void;
104
+ /**
105
+ * Loads the published text of one module in one language. English is never
106
+ * fetched: the bundled English in the app is the source of truth. Safe to call
107
+ * on every render; a module is requested once per page session.
108
+ */
109
+ declare const loadModule: (language: string, module: string) => Promise<void>;
110
+
111
+ type TFunction = (key: string, values?: TranslateValues) => string;
112
+ /** `common:SAVE` → module `common`, key `SAVE`; `SAVE` → the given module. */
113
+ declare const splitKey: (module: string, key: string) => {
114
+ module: string;
115
+ key: string;
116
+ };
117
+ /** The language the UI shows now (`en`, `de`, …): the user's choice if the project offers it, else the project's default. */
118
+ declare const useLanguageCode: () => string;
119
+ /** Keeps `<html lang>` on the language the UI shows, for screen readers and browser translation. */
120
+ declare const useDocumentLanguage: () => string;
121
+ declare const getLanguageCode: () => string;
122
+ /**
123
+ * Text for one module (`<repo>.<feature>`). Keys of the shared module are
124
+ * written `common:KEY`. Loads the published text for the chosen language and
125
+ * falls back to the bundled English while it loads or when it fails.
126
+ */
127
+ declare const useT: (module: string) => {
128
+ t: TFunction;
129
+ language: string;
130
+ };
131
+ /**
132
+ * Text outside React (constants, schemas, table columns). Call it when the
133
+ * value is used, never at import time, or a language change is missed.
134
+ */
135
+ declare const tStatic: (module: string, key: string, values?: TranslateValues) => string;
136
+
137
+ export { COMMON_MODULE, DEFAULT_LANGUAGE, type Dictionary, type DictionarySource, FALLBACK_LANGUAGES, type I18nConfig, MISSING_VALUE, SUPPORTED_LANGUAGES, type SupportedLanguage, type TFunction, type TranslateValues, configureI18n, cultureOf, defaultLanguageIn, getLanguageCode, interpolate, loadLanguages, loadModule, registerTranslations, remoteKey, resetI18nRequests, resetLanguages, resolveLanguage, resolveLanguageIn, splitKey, tStatic, toLanguageCode, toProjectLanguages, translate, useDocumentLanguage, useI18nStore, useLanguageCode, useLanguagesStore, useT };
@@ -0,0 +1,137 @@
1
+ import * as zustand from 'zustand';
2
+
3
+ interface SupportedLanguage {
4
+ /** Code the apps store and show (`en`, `de`): the culture's language part. */
5
+ code: string;
6
+ /** Culture code of the language in the localization service (`de-DE`). */
7
+ culture: string;
8
+ title: string;
9
+ /** The project's default language. */
10
+ isDefault?: boolean;
11
+ }
12
+ /** Language of the text bundled in the apps; it is never fetched. */
13
+ declare const DEFAULT_LANGUAGE = "en";
14
+ declare const COMMON_MODULE = "common";
15
+ /** Shown until the project's languages are known, and when the service cannot be reached. */
16
+ declare const FALLBACK_LANGUAGES: readonly SupportedLanguage[];
17
+ /**
18
+ * @deprecated The languages come from the project (`useLanguagesStore`). Kept for apps
19
+ * that still render their own selector from it.
20
+ */
21
+ declare const SUPPORTED_LANGUAGES: readonly SupportedLanguage[];
22
+ /** `de-DE` → `de`. */
23
+ declare const toLanguageCode: (culture: string) => string;
24
+ interface LanguagesState {
25
+ languages: readonly SupportedLanguage[];
26
+ /** True once the project's list is known (from the service or the cache). */
27
+ loaded: boolean;
28
+ setLanguages: (languages: readonly SupportedLanguage[]) => void;
29
+ }
30
+ declare const useLanguagesStore: zustand.UseBoundStore<zustand.StoreApi<LanguagesState>>;
31
+ /**
32
+ * Turns the service's languages (`{ languageName, languageCode, isDefault }`, either casing)
33
+ * into the app list: one entry per language code (the project's default culture wins, then
34
+ * the first one), English always present because the apps ship English.
35
+ */
36
+ declare const toProjectLanguages: (value: unknown) => SupportedLanguage[] | null;
37
+ /** Test helper: forgets the loaded list. */
38
+ declare const resetLanguages: () => void;
39
+ /**
40
+ * Loads the project's languages (`/api/Language/Gets` with the project key) once per page
41
+ * session. The cached list shows at once; a failed request keeps the cache or English only,
42
+ * and is tried again later.
43
+ */
44
+ declare const loadLanguages: () => Promise<void>;
45
+ /** The language the UI starts in: the project's default, else English. */
46
+ declare const defaultLanguageIn: (languages: readonly SupportedLanguage[]) => string;
47
+ /**
48
+ * The language to show for a stored choice. Before the project's list is known any code is
49
+ * kept (its text falls back to English if missing); afterwards a language the project does
50
+ * not offer, or no choice at all, gives the project's default.
51
+ */
52
+ declare const resolveLanguageIn: (language: string | null | undefined, languages: readonly SupportedLanguage[], loaded: boolean) => string;
53
+ declare const resolveLanguage: (language?: string | null) => string;
54
+ /** Culture code the localization service uses for an app language (`de` → `de-DE`). */
55
+ declare const cultureOf: (language: string) => string;
56
+
57
+ type Dictionary = Readonly<Record<string, string>>;
58
+ type TranslateValues = Readonly<Record<string, string | number>>;
59
+ interface DictionarySource {
60
+ language: string;
61
+ dictionary?: Dictionary;
62
+ }
63
+ declare const MISSING_VALUE = "[ KEY MISSING ]";
64
+ declare const interpolate: (template: string, values?: TranslateValues) => string;
65
+ /**
66
+ * Finds the text for a key in the first source that has it (chosen language
67
+ * first, bundled English last) and fills `{{name}}` placeholders with the
68
+ * given values. A `count` value picks the plural form (`KEY_one`,
69
+ * `KEY_other`). Returns the key itself only when no source has it, which the
70
+ * key check reports as a bug.
71
+ */
72
+ declare const translate: (sources: readonly DictionarySource[], key: string, values?: TranslateValues) => string;
73
+
74
+ interface I18nState {
75
+ /** English text shipped with the app, per module. Source of truth for English. */
76
+ bundled: Record<string, Dictionary>;
77
+ /** Published text loaded from the localization service, keyed `<language>:<module>`. */
78
+ remote: Record<string, Dictionary>;
79
+ registerBundle: (module: string, dictionary: Dictionary) => void;
80
+ setRemote: (language: string, module: string, dictionary: Dictionary) => void;
81
+ }
82
+ declare const remoteKey: (language: string, module: string) => string;
83
+ declare const useI18nStore: zustand.UseBoundStore<zustand.StoreApi<I18nState>>;
84
+ /**
85
+ * Registers the bundled English text of a module. Call once per module at app
86
+ * start (for example from `app/i18n/index.ts`), before the first render.
87
+ */
88
+ declare const registerTranslations: (module: string, dictionary: Dictionary) => void;
89
+
90
+ interface I18nConfig {
91
+ /** Origin of the localization service; `/api/Key/GetUilmFile` and `/api/Language/Gets` are called on it. */
92
+ baseUrl?: () => string;
93
+ /** Project key sent as `X-Blocks-Key`. */
94
+ blocksKey?: () => string;
95
+ /** Request timeout in ms. */
96
+ timeoutMs?: number;
97
+ /** Wait before a failed request is tried again, in ms. */
98
+ retryAfterMs?: number;
99
+ }
100
+ declare const configureI18n: (next: I18nConfig) => void;
101
+
102
+ /** Test helper: forgets which modules were requested. */
103
+ declare const resetI18nRequests: () => void;
104
+ /**
105
+ * Loads the published text of one module in one language. English is never
106
+ * fetched: the bundled English in the app is the source of truth. Safe to call
107
+ * on every render; a module is requested once per page session.
108
+ */
109
+ declare const loadModule: (language: string, module: string) => Promise<void>;
110
+
111
+ type TFunction = (key: string, values?: TranslateValues) => string;
112
+ /** `common:SAVE` → module `common`, key `SAVE`; `SAVE` → the given module. */
113
+ declare const splitKey: (module: string, key: string) => {
114
+ module: string;
115
+ key: string;
116
+ };
117
+ /** The language the UI shows now (`en`, `de`, …): the user's choice if the project offers it, else the project's default. */
118
+ declare const useLanguageCode: () => string;
119
+ /** Keeps `<html lang>` on the language the UI shows, for screen readers and browser translation. */
120
+ declare const useDocumentLanguage: () => string;
121
+ declare const getLanguageCode: () => string;
122
+ /**
123
+ * Text for one module (`<repo>.<feature>`). Keys of the shared module are
124
+ * written `common:KEY`. Loads the published text for the chosen language and
125
+ * falls back to the bundled English while it loads or when it fails.
126
+ */
127
+ declare const useT: (module: string) => {
128
+ t: TFunction;
129
+ language: string;
130
+ };
131
+ /**
132
+ * Text outside React (constants, schemas, table columns). Call it when the
133
+ * value is used, never at import time, or a language change is missed.
134
+ */
135
+ declare const tStatic: (module: string, key: string, values?: TranslateValues) => string;
136
+
137
+ export { COMMON_MODULE, DEFAULT_LANGUAGE, type Dictionary, type DictionarySource, FALLBACK_LANGUAGES, type I18nConfig, MISSING_VALUE, SUPPORTED_LANGUAGES, type SupportedLanguage, type TFunction, type TranslateValues, configureI18n, cultureOf, defaultLanguageIn, getLanguageCode, interpolate, loadLanguages, loadModule, registerTranslations, remoteKey, resetI18nRequests, resetLanguages, resolveLanguage, resolveLanguageIn, splitKey, tStatic, toLanguageCode, toProjectLanguages, translate, useDocumentLanguage, useI18nStore, useLanguageCode, useLanguagesStore, useT };
@@ -0,0 +1,8 @@
1
+ import '../chunk-6QSPMPJD.js';
2
+ export { COMMON_MODULE, DEFAULT_LANGUAGE, FALLBACK_LANGUAGES, MISSING_VALUE, SUPPORTED_LANGUAGES, configureI18n, cultureOf, defaultLanguageIn, getLanguageCode, interpolate, loadLanguages, loadModule, registerTranslations, remoteKey, resetI18nRequests, resetLanguages, resolveLanguage, resolveLanguageIn, splitKey, tStatic, toLanguageCode, toProjectLanguages, translate, useDocumentLanguage, useI18nStore, useLanguageCode, useLanguagesStore, useT } from '../chunk-O2MGCS3O.js';
3
+ import '../chunk-POJIHGRY.js';
4
+ import '../chunk-SQG7DJNY.js';
5
+ import '../chunk-3V7O45KN.js';
6
+ import '../chunk-PL4HS6R6.js';
7
+ //# sourceMappingURL=index.js.map
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}