@alfadocs/ui-kit 0.41.0 → 0.41.2

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
  {
2
2
  "schemaVersion": 1,
3
- "packageVersion": "0.41.0",
3
+ "packageVersion": "0.41.2",
4
4
  "components": [
5
5
  {
6
6
  "kind": "component",
@@ -1,7 +1,7 @@
1
- import t from "i18next";
1
+ import i from "i18next";
2
2
  import { default as v } from "i18next";
3
- import { initReactI18next as u } from "react-i18next";
4
- import { enUi as p } from "./locales/en.js";
3
+ import { initReactI18next as p } from "react-i18next";
4
+ import { enUi as o } from "./locales/en.js";
5
5
  const c = [
6
6
  "en",
7
7
  "it",
@@ -22,18 +22,18 @@ const c = [
22
22
  "zh",
23
23
  "hi"
24
24
  ];
25
- function d(e, i) {
26
- t.addResourceBundle(
25
+ function U(e, t) {
26
+ i.addResourceBundle(
27
27
  e,
28
28
  "ui",
29
- i,
29
+ t,
30
30
  /* deep */
31
31
  !0,
32
32
  /* overwrite */
33
33
  !1
34
34
  );
35
35
  }
36
- const l = {}, r = typeof import.meta < "u" && typeof l < "u" && !1, o = {
36
+ const m = {}, r = typeof import.meta < "u" && typeof m < "u" && !1, s = {
37
37
  it: () => import("./locales/it.js").then((e) => e.itUi),
38
38
  de: () => import("./locales/de.js").then((e) => e.deUi),
39
39
  ar: () => import("./locales/ar.js").then((e) => e.arUi),
@@ -52,11 +52,25 @@ const l = {}, r = typeof import.meta < "u" && typeof l < "u" && !1, o = {
52
52
  zh: () => import("./locales/zh.js").then((e) => e.zhUi),
53
53
  hi: () => import("./locales/hi.js").then((e) => e.hiUi)
54
54
  };
55
- t.use(u).init({
55
+ function u() {
56
+ i.addResourceBundle(
57
+ "en",
58
+ "ui",
59
+ o,
60
+ /* deep */
61
+ !0,
62
+ /* overwrite */
63
+ !1
64
+ );
65
+ }
66
+ i.isInitialized ? u() : i.use(p).init({
56
67
  lng: "en",
57
68
  fallbackLng: "en",
58
69
  ns: ["ui"],
59
70
  defaultNS: "ui",
71
+ // The kit bundles only `en` eagerly and lazy-loads the rest, so the store
72
+ // is partially bundled — let a later consumer `init()` / backend coexist.
73
+ partialBundledLanguages: !0,
60
74
  debug: r,
61
75
  saveMissing: r,
62
76
  missingKeyHandler: void 0,
@@ -67,39 +81,40 @@ t.use(u).init({
67
81
  // changeLanguage wrapper below (or the explicit `loadLocale` /
68
82
  // `setLocale` / `loadAllLocales` helpers).
69
83
  resources: {
70
- en: { ui: p }
84
+ en: { ui: o }
71
85
  }
72
86
  });
87
+ i.on("initialized", u);
73
88
  async function n(e) {
74
- if (e === "en" || t.hasResourceBundle(e, "ui")) return;
75
- const i = o[e];
76
- if (!i)
89
+ if (e === "en" || i.hasResourceBundle(e, "ui")) return;
90
+ const t = s[e];
91
+ if (!t)
77
92
  return;
78
- const s = await i();
79
- t.addResourceBundle(
93
+ const l = await t();
94
+ i.addResourceBundle(
80
95
  e,
81
96
  "ui",
82
- s,
97
+ l,
83
98
  /* deep */
84
99
  !0,
85
100
  /* overwrite */
86
101
  !1
87
102
  );
88
103
  }
89
- async function U(e) {
90
- await n(e), await t.changeLanguage(e);
104
+ async function g(e) {
105
+ await n(e), await i.changeLanguage(e);
91
106
  }
92
- async function g() {
93
- await Promise.all(Object.keys(o).map((e) => n(e)));
107
+ async function L() {
108
+ await Promise.all(Object.keys(s).map((e) => n(e)));
94
109
  }
95
- const a = t.changeLanguage.bind(t);
96
- t.changeLanguage = ((e, i) => e ? n(e).then(() => a(e, i)) : a(e, i));
110
+ const a = i.changeLanguage.bind(i);
111
+ i.changeLanguage = ((e, t) => e ? n(e).then(() => a(e, t)) : a(e, t));
97
112
  export {
98
113
  c as LOCALES_WITH_BUNDLES,
99
114
  v as default,
100
- g as loadAllLocales,
115
+ L as loadAllLocales,
101
116
  n as loadLocale,
102
- d as registerUiBundle,
103
- U as setLocale
117
+ U as registerUiBundle,
118
+ g as setLocale
104
119
  };
105
120
  //# sourceMappingURL=config.js.map