@burdenoff/microfe-i18n 2026.1129.1 → 2026.1129.3

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 (46) hide show
  1. package/dist/generated/global-operations.d.ts +292 -0
  2. package/dist/generated/global-operations.js +143 -15
  3. package/dist/generated/global-types.js +3 -1
  4. package/dist/i18n/I18nRoutes.d.ts +5 -3
  5. package/dist/i18n/I18nRoutes.js +48 -47
  6. package/dist/i18n/v2/LanguageDialog.d.ts +17 -0
  7. package/dist/i18n/v2/LanguageDialog.js +193 -0
  8. package/dist/i18n/v2/LanguagesPage.js +82 -53
  9. package/dist/i18n/v2/LanguagesTab.d.ts +3 -1
  10. package/dist/i18n/v2/LanguagesTab.js +31 -26
  11. package/dist/i18n/v2/ReviewRows.js +2 -2
  12. package/dist/i18n/v2/ReviewTab.d.ts +3 -1
  13. package/dist/i18n/v2/ReviewTab.js +27 -26
  14. package/dist/i18n/v2/TabRedirect.d.ts +8 -0
  15. package/dist/i18n/v2/TabRedirect.js +26 -9
  16. package/dist/i18n/v2/language/FormatsTab.d.ts +6 -0
  17. package/dist/i18n/v2/language/FormatsTab.js +93 -0
  18. package/dist/i18n/v2/language/LanguagePage.d.ts +3 -0
  19. package/dist/i18n/v2/language/LanguagePage.js +245 -0
  20. package/dist/i18n/v2/language/TranslateDialog.d.ts +18 -0
  21. package/dist/i18n/v2/language/TranslateDialog.js +101 -0
  22. package/dist/i18n/v2/language/WordsTab.d.ts +11 -0
  23. package/dist/i18n/v2/language/WordsTab.js +190 -0
  24. package/dist/i18n/v2/language/useLanguage.d.ts +23 -0
  25. package/dist/i18n/v2/language/useLanguage.js +22 -0
  26. package/dist/i18n/v2/language/useWords.d.ts +31 -0
  27. package/dist/i18n/v2/language/useWords.js +51 -0
  28. package/dist/i18n/v2/languageModel.d.ts +61 -0
  29. package/dist/i18n/v2/languageModel.js +120 -0
  30. package/dist/i18n/v2/links.d.ts +4 -1
  31. package/dist/i18n/v2/links.js +11 -10
  32. package/dist/i18n/v2/model.d.ts +12 -2
  33. package/dist/i18n/v2/model.js +17 -14
  34. package/dist/i18n/v2/reviewMessages.d.ts +1 -1
  35. package/dist/i18n/v2/useAddLanguage.d.ts +10 -0
  36. package/dist/i18n/v2/useAddLanguage.js +30 -0
  37. package/dist/i18n/v2/useDebouncedValue.d.ts +1 -0
  38. package/dist/i18n/v2/useDebouncedValue.js +10 -0
  39. package/dist/i18n/v2/useReviewActions.d.ts +3 -1
  40. package/dist/i18n/v2/useReviewActions.js +24 -24
  41. package/dist/i18n/v2/useReviewQueue.d.ts +5 -2
  42. package/dist/i18n/v2/useReviewQueue.js +9 -6
  43. package/dist/node_modules/lucide-react/dist/esm/icons/calendar-days.js +49 -0
  44. package/dist/node_modules/lucide-react/dist/esm/icons/eye-off.js +21 -0
  45. package/dist/node_modules/lucide-react/dist/esm/icons/eye.js +12 -0
  46. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ import { useApolloClient as e } from "../../node_modules/@apollo/client/react/hooks/useApolloClient.js";
2
+ import { useCreateI18nLanguageMutation as t } from "../../generated/global-operations.js";
3
+ import { useCallback as n } from "react";
4
+ import { CombinedGraphQLErrors as r } from "@apollo/client";
5
+ // src/i18n/v2/useAddLanguage.ts
6
+ function i(e) {
7
+ return r.is(e) && e.errors.some((e) => e.extensions?.code === "CONFLICT");
8
+ }
9
+ function a() {
10
+ let r = e(), [a] = t();
11
+ return n(async (e) => {
12
+ try {
13
+ let t = await a({ variables: { input: {
14
+ code: e.code,
15
+ name: e.name,
16
+ nativeName: e.nativeName,
17
+ direction: e.direction
18
+ } } });
19
+ if (t.error) throw t.error;
20
+ let n = t.data?.createLanguage.code ?? e.code;
21
+ return await r.refetchQueries({ include: ["GetI18nLanguages"] }), {
22
+ outcome: "saved",
23
+ code: n
24
+ };
25
+ } catch (e) {
26
+ return { outcome: i(e) ? "taken" : "failed" };
27
+ }
28
+ }, [r, a]);
29
+ }
30
+ export { i as isTaken, a as useAddLanguage };
@@ -0,0 +1 @@
1
+ export declare function useDebouncedValue<T>(value: T, delayMs: number): T;
@@ -0,0 +1,10 @@
1
+ import { useEffect as e, useState as t } from "react";
2
+ // src/i18n/v2/useDebouncedValue.ts
3
+ function n(n, r) {
4
+ let [i, a] = t(n);
5
+ return e(() => {
6
+ let e = window.setTimeout(() => a(n), r);
7
+ return () => window.clearTimeout(e);
8
+ }, [n, r]), i;
9
+ }
10
+ export { n as useDebouncedValue };
@@ -1,5 +1,7 @@
1
1
  import { ReviewQueue, ReviewRow } from './useReviewQueue';
2
- export declare function useReviewActions(queue: ReviewQueue, onReviewed: () => void): {
2
+ export declare function useReviewActions(queue: ReviewQueue,
3
+ /** The queue's language, for the confirm; null for every language. */
4
+ languageName: string | null, onReviewed: () => void): {
3
5
  busy: ReadonlySet<string>;
4
6
  bulk: boolean;
5
7
  approveOne: (row: ReviewRow) => Promise<void>;
@@ -6,50 +6,50 @@ import { useState as o } from "react";
6
6
  import { useConfirm as s, useNotify as c } from "@burdenoff/fe-libs/ui";
7
7
  // src/i18n/v2/useReviewActions.ts
8
8
  var l = 4;
9
- function u(u, d) {
10
- let f = e(), p = c(), m = s(), [h, g] = o(/* @__PURE__ */ new Set()), [_, v] = o(!1), y = () => {
11
- u.refresh(), d();
9
+ function u(u, d, f) {
10
+ let p = e(), m = c(), h = s(), [g, _] = o(/* @__PURE__ */ new Set()), [v, y] = o(!1), b = () => {
11
+ u.refresh(), f();
12
12
  };
13
13
  return {
14
- busy: h,
15
- bulk: _,
14
+ busy: g,
15
+ bulk: v,
16
16
  approveOne: async (e) => {
17
- g((t) => new Set(t).add(e.id));
17
+ _((t) => new Set(t).add(e.id));
18
18
  try {
19
- p(i(f, await u.approve(e.id))), y();
19
+ m(i(p, await u.approve(e.id))), b();
20
20
  } catch {
21
- p({
22
- title: f("i18n.v3.approveFailed", "Couldn’t approve it. Try again."),
21
+ m({
22
+ title: p("i18n.v3.approveFailed", "Couldn’t approve it. Try again."),
23
23
  tone: "error"
24
24
  });
25
25
  } finally {
26
- g((t) => {
26
+ _((t) => {
27
27
  let n = new Set(t);
28
28
  return n.delete(e.id), n;
29
29
  });
30
30
  }
31
31
  },
32
32
  approveShown: async () => {
33
- let e = u.rows;
34
- if (!await m({
35
- title: f("i18n.v3.approveAllTitle", "Approve {{count}} translations?", { count: t.format(e.length) }),
36
- description: f("i18n.v3.approveAllBody", "They go live in every product straight away."),
37
- confirmLabel: f("i18n.v3.approveAll", "Approve all shown")
33
+ let e = u.rows, i = t.format(e.length);
34
+ if (!await h({
35
+ title: p("i18n.v3.approveLiveAllTitle", "Approve and put live {{count}} translations?", { count: i }),
36
+ description: d ? p("i18n.v3.approveLiveAllBodyIn", "They go live straight away for everyone using {{name}}.", { name: d }) : p("i18n.v3.approveLiveAllBody", "Each one goes live straight away for everyone using its language."),
37
+ confirmLabel: p("i18n.v3.approveLiveAll", "Approve and put live ({{count}})", { count: i })
38
38
  })) return;
39
- v(!0);
40
- let { done: i, failed: a } = await n(e, l, (e) => u.approve(e.id));
41
- v(!1), p(r(f, i.map(({ result: e }) => e), a.length)), y();
39
+ y(!0);
40
+ let { done: a, failed: o } = await n(e, l, (e) => u.approve(e.id));
41
+ y(!1), m(r(p, a.map(({ result: e }) => e), o.length)), b();
42
42
  },
43
43
  putLive: async () => {
44
44
  let e = u.notLive;
45
- if (!await m({
46
- title: f("i18n.v3.putLiveTitle", "Put {{count}} translations live?", { count: t.format(e.length) }),
47
- description: f("i18n.v3.putLiveBody", "They’re approved already. Every product shows them straight away."),
48
- confirmLabel: f("i18n.v3.putLive", "Put them live")
45
+ if (!await h({
46
+ title: p("i18n.v3.putLiveTitle", "Put {{count}} translations live?", { count: t.format(e.length) }),
47
+ description: p("i18n.v3.putLiveBody", "They’re approved already. Every product shows them straight away."),
48
+ confirmLabel: p("i18n.v3.putLive", "Put them live")
49
49
  })) return;
50
- v(!0);
50
+ y(!0);
51
51
  let { done: r, failed: i } = await n(e, l, (e) => u.publish(e.id));
52
- v(!1), p(a(f, r.length, i.length)), y();
52
+ y(!1), m(a(p, r.length, i.length)), b();
53
53
  }
54
54
  };
55
55
  }
@@ -21,8 +21,11 @@ export interface ReviewRow {
21
21
  export declare const REVIEW_PAGE = 50;
22
22
  /** What one approval ended as. */
23
23
  export type ApproveOutcome = "live" | "approvedOnly";
24
- /** How many translations wait for review, in every language (the tab's count). */
25
- export declare function useWaitingCount(): number | undefined;
24
+ /**
25
+ * How many translations wait for review, in every language (the tab's count).
26
+ * Not asked while the review queue is hidden.
27
+ */
28
+ export declare function useWaitingCount(enabled: boolean): number | undefined;
26
29
  export declare function useReviewQueue(languageCode: string | null): {
27
30
  rows: ReviewRow[];
28
31
  total: any;
@@ -6,12 +6,15 @@ var s = ["GetI18nTranslationsByStatus"];
6
6
  function c(e) {
7
7
  return e ? { languageCode: e } : {};
8
8
  }
9
- function l() {
10
- let { data: e } = n({ variables: {
11
- filter: { status: i.PendingReview },
12
- limit: 1
13
- } });
14
- return e?.translations.total;
9
+ function l(e) {
10
+ let { data: t } = n({
11
+ variables: {
12
+ filter: { status: i.PendingReview },
13
+ limit: 1
14
+ },
15
+ skip: !e
16
+ });
17
+ return t?.translations.total;
15
18
  }
16
19
  function u(l) {
17
20
  let u = e(), [d, f] = o(50), p = n({
@@ -0,0 +1,49 @@
1
+ import e from "../createLucideIcon.js";
2
+ // node_modules/lucide-react/dist/esm/icons/calendar-days.js
3
+ var t = e("CalendarDays", [
4
+ ["path", {
5
+ d: "M8 2v4",
6
+ key: "1cmpym"
7
+ }],
8
+ ["path", {
9
+ d: "M16 2v4",
10
+ key: "4m81vk"
11
+ }],
12
+ ["rect", {
13
+ width: "18",
14
+ height: "18",
15
+ x: "3",
16
+ y: "4",
17
+ rx: "2",
18
+ key: "1hopcy"
19
+ }],
20
+ ["path", {
21
+ d: "M3 10h18",
22
+ key: "8toen8"
23
+ }],
24
+ ["path", {
25
+ d: "M8 14h.01",
26
+ key: "6423bh"
27
+ }],
28
+ ["path", {
29
+ d: "M12 14h.01",
30
+ key: "1etili"
31
+ }],
32
+ ["path", {
33
+ d: "M16 14h.01",
34
+ key: "1gbofw"
35
+ }],
36
+ ["path", {
37
+ d: "M8 18h.01",
38
+ key: "lrp35t"
39
+ }],
40
+ ["path", {
41
+ d: "M12 18h.01",
42
+ key: "mhygvu"
43
+ }],
44
+ ["path", {
45
+ d: "M16 18h.01",
46
+ key: "kzsmim"
47
+ }]
48
+ ]);
49
+ export { t as default };
@@ -0,0 +1,21 @@
1
+ import e from "../createLucideIcon.js";
2
+ // node_modules/lucide-react/dist/esm/icons/eye-off.js
3
+ var t = e("EyeOff", [
4
+ ["path", {
5
+ d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
6
+ key: "ct8e1f"
7
+ }],
8
+ ["path", {
9
+ d: "M14.084 14.158a3 3 0 0 1-4.242-4.242",
10
+ key: "151rxh"
11
+ }],
12
+ ["path", {
13
+ d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
14
+ key: "13bj9a"
15
+ }],
16
+ ["path", {
17
+ d: "m2 2 20 20",
18
+ key: "1ooewy"
19
+ }]
20
+ ]);
21
+ export { t as default };
@@ -0,0 +1,12 @@
1
+ import e from "../createLucideIcon.js";
2
+ // node_modules/lucide-react/dist/esm/icons/eye.js
3
+ var t = e("Eye", [["path", {
4
+ d: "M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",
5
+ key: "1nclc0"
6
+ }], ["circle", {
7
+ cx: "12",
8
+ cy: "12",
9
+ r: "3",
10
+ key: "1v7zrd"
11
+ }]]);
12
+ export { t as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/microfe-i18n",
3
- "version": "2026.1129.1",
3
+ "version": "2026.1129.3",
4
4
  "description": "Internationalization (i18n) micro-frontend module",
5
5
  "repository": {
6
6
  "type": "git",