@burdenoff/fe-libs 2026.526.1 → 2026.527.1
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.
|
@@ -146,4 +146,4 @@ function y(e) {
|
|
|
146
146
|
return d.attempted.has(e);
|
|
147
147
|
}
|
|
148
148
|
//#endregion
|
|
149
|
-
export { g as I18nProvider, v as clearTranslationCache, y as isTranslationAttempted, _ as useI18n };
|
|
149
|
+
export { g as I18nProvider, v as clearTranslationCache, y as isTranslationAttempted, h as mergeTranslationDictionaries, _ as useI18n };
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { graphqlFetch as e } from "../../graphql/fetch.js";
|
|
2
2
|
import "../../../shared-graphql.js";
|
|
3
3
|
import { useAuth as t } from "./AuthProvider.js";
|
|
4
|
-
import { I18nProvider as n } from "./I18nProvider.js";
|
|
5
|
-
import { useCallback as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { useLocation as
|
|
4
|
+
import { I18nProvider as n, mergeTranslationDictionaries as r } from "./I18nProvider.js";
|
|
5
|
+
import { useCallback as i, useMemo as a } from "react";
|
|
6
|
+
import { jsx as o } from "react/jsx-runtime";
|
|
7
|
+
import { useLocation as s } from "react-router-dom";
|
|
8
8
|
//#region src/shared/providers/shell/ProfileI18nBridge.tsx
|
|
9
|
-
var
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
|
|
9
|
+
var c = "\n query ExportTranslations($productId: String!, $languageCode: String!, $format: ImportJobFormat!) {\n exportTranslations(productId: $productId, languageCode: $languageCode, format: $format) {\n format\n url\n }\n }\n";
|
|
10
|
+
function l({ children: l, i18nProductId: u, defaultLocale: d = "en", fallbackTranslations: f, disableDynamicFetch: p = !1 }) {
|
|
11
|
+
let m = s(), { user: h } = t(), g = h?.id ?? null, _ = !p && !m.pathname.startsWith("/auth/") && !m.pathname.startsWith("/devportal") && !m.pathname.startsWith("/organizations"), v = i(async (t) => {
|
|
12
|
+
let n = f?.[t] ?? {};
|
|
13
|
+
if (!_) return n;
|
|
13
14
|
try {
|
|
14
|
-
let
|
|
15
|
+
let i = await e({
|
|
15
16
|
gateway: "global",
|
|
16
|
-
query:
|
|
17
|
+
query: c,
|
|
17
18
|
variables: {
|
|
18
|
-
productId:
|
|
19
|
+
productId: u,
|
|
19
20
|
languageCode: t,
|
|
20
21
|
format: "JSON"
|
|
21
22
|
},
|
|
@@ -24,20 +25,20 @@ function c({ children: c, i18nProductId: l, defaultLocale: u = "en", fallbackTra
|
|
|
24
25
|
"x-actor-type": "service"
|
|
25
26
|
}
|
|
26
27
|
});
|
|
27
|
-
if (
|
|
28
|
-
let
|
|
29
|
-
return JSON.parse(
|
|
28
|
+
if (i.errors?.length || !i.data?.exportTranslations?.url) return {};
|
|
29
|
+
let a = i.data.exportTranslations.url, o = decodeURIComponent(a.replace("data:application/json;charset=utf-8,", ""));
|
|
30
|
+
return r(n, JSON.parse(o));
|
|
30
31
|
} catch {
|
|
31
32
|
return {};
|
|
32
33
|
}
|
|
33
34
|
}, [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
f,
|
|
36
|
+
u,
|
|
37
|
+
_
|
|
37
38
|
]);
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
defaultLocale:
|
|
40
|
-
translations:
|
|
39
|
+
return /* @__PURE__ */ o(n, {
|
|
40
|
+
defaultLocale: d,
|
|
41
|
+
translations: a(() => f ?? {
|
|
41
42
|
en: {},
|
|
42
43
|
es: {},
|
|
43
44
|
fr: {},
|
|
@@ -46,12 +47,12 @@ function c({ children: c, i18nProductId: l, defaultLocale: u = "en", fallbackTra
|
|
|
46
47
|
zh: {},
|
|
47
48
|
ta: {},
|
|
48
49
|
hi: {}
|
|
49
|
-
}, [
|
|
50
|
-
fetchTranslations:
|
|
51
|
-
profileId:
|
|
50
|
+
}, [f]),
|
|
51
|
+
fetchTranslations: _ ? v : void 0,
|
|
52
|
+
profileId: g,
|
|
52
53
|
showChildrenWhileLoading: !0,
|
|
53
|
-
children:
|
|
54
|
+
children: l
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
57
|
//#endregion
|
|
57
|
-
export {
|
|
58
|
+
export { l as ProfileI18nBridge };
|