@burdenoff/microfe-i18n 2026.1125.1 → 2026.1129.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.
Files changed (95) hide show
  1. package/dist/generated/global-operations.d.ts +299 -0
  2. package/dist/generated/global-operations.js +135 -0
  3. package/dist/generated/global-types.d.ts +34021 -0
  4. package/dist/generated/global-types.js +11 -0
  5. package/dist/i18n/I18nRoot.js +43 -42
  6. package/dist/i18n/I18nRoutes.d.ts +20 -1
  7. package/dist/i18n/I18nRoutes.js +59 -37
  8. package/dist/i18n/utils/paths.d.ts +6 -0
  9. package/dist/i18n/utils/paths.js +5 -0
  10. package/dist/i18n/v2/LanguagesPage.d.ts +3 -0
  11. package/dist/i18n/v2/LanguagesPage.js +82 -0
  12. package/dist/i18n/v2/LanguagesTab.d.ts +8 -0
  13. package/dist/i18n/v2/LanguagesTab.js +102 -0
  14. package/dist/i18n/v2/ProductsTab.d.ts +4 -0
  15. package/dist/i18n/v2/ProductsTab.js +60 -0
  16. package/dist/i18n/v2/ReviewRows.d.ts +9 -0
  17. package/dist/i18n/v2/ReviewRows.js +71 -0
  18. package/dist/i18n/v2/ReviewTab.d.ts +6 -0
  19. package/dist/i18n/v2/ReviewTab.js +121 -0
  20. package/dist/i18n/v2/ShareBar.d.ts +5 -0
  21. package/dist/i18n/v2/ShareBar.js +28 -0
  22. package/dist/i18n/v2/TabRedirect.d.ts +4 -0
  23. package/dist/i18n/v2/TabRedirect.js +14 -0
  24. package/dist/i18n/v2/__tests__/routeShapes.d.ts +7 -0
  25. package/dist/i18n/v2/formats.d.ts +3 -0
  26. package/dist/i18n/v2/formats.js +6 -0
  27. package/dist/i18n/v2/links.d.ts +13 -0
  28. package/dist/i18n/v2/links.js +16 -0
  29. package/dist/i18n/v2/model.d.ts +76 -0
  30. package/dist/i18n/v2/model.js +87 -0
  31. package/dist/i18n/v2/reviewMessages.d.ts +9 -0
  32. package/dist/i18n/v2/reviewMessages.js +40 -0
  33. package/dist/i18n/v2/useLanguagesData.d.ts +35 -0
  34. package/dist/i18n/v2/useLanguagesData.js +62 -0
  35. package/dist/i18n/v2/useReviewActions.d.ts +9 -0
  36. package/dist/i18n/v2/useReviewActions.js +56 -0
  37. package/dist/i18n/v2/useReviewQueue.d.ts +44 -0
  38. package/dist/i18n/v2/useReviewQueue.js +60 -0
  39. package/dist/node_modules/@apollo/client/react/context/ApolloContext.js +15 -0
  40. package/dist/node_modules/@apollo/client/react/hooks/constants.js +3 -0
  41. package/dist/node_modules/@apollo/client/react/hooks/internal/useDeepMemo.js +11 -0
  42. package/dist/node_modules/@apollo/client/react/hooks/internal/useIsomorphicLayoutEffect.js +5 -0
  43. package/dist/node_modules/@apollo/client/react/hooks/internal/wrapHook.js +13 -0
  44. package/dist/node_modules/@apollo/client/react/hooks/useApolloClient.js +9 -0
  45. package/dist/node_modules/@apollo/client/react/hooks/useMutation.js +96 -0
  46. package/dist/node_modules/@apollo/client/react/hooks/useQuery.js +125 -0
  47. package/dist/node_modules/@apollo/client/react/hooks/useSyncExternalStore.js +34 -0
  48. package/dist/node_modules/@apollo/client/react/internal/index.js +3 -0
  49. package/dist/node_modules/@apollo/client/utilities/internal/canUseDOM.js +4 -0
  50. package/dist/node_modules/@apollo/client/utilities/internal/compact.js +11 -0
  51. package/dist/node_modules/@apollo/client/utilities/internal/constants.js +3 -0
  52. package/dist/node_modules/@apollo/client/utilities/internal/deepFreeze.js +14 -0
  53. package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +6 -0
  54. package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +7 -0
  55. package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +5 -0
  56. package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +7 -0
  57. package/dist/node_modules/@apollo/client/utilities/internal/maybeDeepFreeze.js +6 -0
  58. package/dist/node_modules/@apollo/client/utilities/internal/mergeOptions.js +9 -0
  59. package/dist/node_modules/@apollo/client/utilities/internal/preventUnhandledRejection.js +5 -0
  60. package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +7 -0
  61. package/dist/node_modules/@apollo/client/utilities/invariant/index.js +54 -0
  62. package/dist/node_modules/@apollo/client/version.js +3 -0
  63. package/dist/node_modules/@wry/equality/lib/index.js +86 -0
  64. package/dist/node_modules/lucide-react/dist/esm/icons/check-check.js +10 -0
  65. package/dist/node_modules/lucide-react/dist/esm/icons/check.js +7 -0
  66. package/dist/node_modules/lucide-react/dist/esm/icons/pencil.js +10 -0
  67. package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +18 -0
  68. package/dist/node_modules/rxjs/dist/esm5/internal/Scheduler.js +11 -0
  69. package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +114 -0
  70. package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +94 -0
  71. package/dist/node_modules/rxjs/dist/esm5/internal/config.js +9 -0
  72. package/dist/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js +43 -0
  73. package/dist/node_modules/rxjs/dist/esm5/internal/operators/observeOn.js +22 -0
  74. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/Action.js +13 -0
  75. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsapAction.js +19 -0
  76. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsapScheduler.js +24 -0
  77. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js +43 -0
  78. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js +27 -0
  79. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/asap.js +5 -0
  80. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js +8 -0
  81. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/immediateProvider.js +14 -0
  82. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js +13 -0
  83. package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +13 -0
  84. package/dist/node_modules/rxjs/dist/esm5/internal/util/Immediate.js +17 -0
  85. package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +10 -0
  86. package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +8 -0
  87. package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +8 -0
  88. package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +5 -0
  89. package/dist/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js +9 -0
  90. package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +5 -0
  91. package/dist/node_modules/rxjs/dist/esm5/internal/util/lift.js +18 -0
  92. package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +3 -0
  93. package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +11 -0
  94. package/dist/node_modules/tslib/tslib.es6.js +49 -0
  95. package/package.json +13 -5
@@ -0,0 +1,11 @@
1
+ // src/generated/global-types.ts
2
+ var e = /* @__PURE__ */ function(e) {
3
+ return e.Active = "ACTIVE", e.Archived = "ARCHIVED", e.Deprecated = "DEPRECATED", e;
4
+ }({}), t = /* @__PURE__ */ function(e) {
5
+ return e.Ltr = "LTR", e.Rtl = "RTL", e;
6
+ }({}), n = /* @__PURE__ */ function(e) {
7
+ return e.Active = "ACTIVE", e.Deprecated = "DEPRECATED", e.Draft = "DRAFT", e;
8
+ }({}), r = /* @__PURE__ */ function(e) {
9
+ return e.Approved = "APPROVED", e.Draft = "DRAFT", e.PendingReview = "PENDING_REVIEW", e.Published = "PUBLISHED", e;
10
+ }({});
11
+ export { e as I18nProductStatus, t as LanguageDirection, n as LanguageStatus, r as TranslationStatus };
@@ -9,101 +9,102 @@ import s from "../node_modules/lucide-react/dist/esm/icons/settings.js";
9
9
  import { I18nProvider as c } from "./providers/I18nProvider.js";
10
10
  import { useTr as l } from "./hooks/useTr.js";
11
11
  import { I18nRoutes as u } from "./I18nRoutes.js";
12
- import { useEffect as d } from "react";
13
- import { jsx as f } from "react/jsx-runtime";
14
- import { FeatureFlagProvider as p } from "@burdenoff/fe-libs/shared/feature-flags";
12
+ import { joinPath as d } from "./utils/paths.js";
13
+ import { useEffect as f } from "react";
14
+ import { jsx as p } from "react/jsx-runtime";
15
+ import { FeatureFlagProvider as m } from "@burdenoff/fe-libs/shared/feature-flags";
15
16
  // src/i18n/I18nRoot.tsx
16
- var m = ({ basePath: c, registerNavItems: p, registerFooterItems: m }) => {
17
- let h = l(), g = (e, t) => (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
18
- return d(() => {
19
- if (p) return p([
17
+ var h = ({ basePath: c, registerNavItems: m, registerFooterItems: h }) => {
18
+ let g = l();
19
+ return f(() => {
20
+ if (m) return m([
20
21
  {
21
22
  id: "i18n-languages",
22
- label: h("i18n.nav.languages", "Languages"),
23
- path: g(c, "languages"),
24
- icon: /* @__PURE__ */ f(e, { size: 20 }),
23
+ label: g("i18n.nav.languages", "Languages"),
24
+ path: d(c, "languages"),
25
+ icon: /* @__PURE__ */ p(e, { size: 20 }),
25
26
  order: 10,
26
27
  group: "i18n"
27
28
  },
28
29
  {
29
30
  id: "i18n-products",
30
- label: h("i18n.nav.products", "Products"),
31
- path: g(c, "products"),
32
- icon: /* @__PURE__ */ f(t, { size: 20 }),
31
+ label: g("i18n.nav.products", "Products"),
32
+ path: d(c, "products"),
33
+ icon: /* @__PURE__ */ p(t, { size: 20 }),
33
34
  order: 20,
34
35
  group: "i18n"
35
36
  },
36
37
  {
37
38
  id: "i18n-editor",
38
- label: h("i18n.nav.translationEditor", "Translation Editor"),
39
- path: g(c, "editor"),
40
- icon: /* @__PURE__ */ f(n, { size: 20 }),
39
+ label: g("i18n.nav.translationEditor", "Translation Editor"),
40
+ path: d(c, "editor"),
41
+ icon: /* @__PURE__ */ p(n, { size: 20 }),
41
42
  order: 30,
42
43
  group: "i18n"
43
44
  },
44
45
  {
45
46
  id: "i18n-progress",
46
- label: h("i18n.nav.progress", "Progress"),
47
- path: g(c, "progress"),
48
- icon: /* @__PURE__ */ f(r, { size: 20 }),
47
+ label: g("i18n.nav.progress", "Progress"),
48
+ path: d(c, "progress"),
49
+ icon: /* @__PURE__ */ p(r, { size: 20 }),
49
50
  order: 40,
50
51
  group: "i18n"
51
52
  },
52
53
  {
53
54
  id: "i18n-review",
54
- label: h("i18n.nav.reviewQueue", "Review Queue"),
55
- path: g(c, "review"),
56
- icon: /* @__PURE__ */ f(i, { size: 20 }),
55
+ label: g("i18n.nav.reviewQueue", "Review Queue"),
56
+ path: d(c, "review"),
57
+ icon: /* @__PURE__ */ p(i, { size: 20 }),
57
58
  order: 50,
58
59
  group: "i18n"
59
60
  },
60
61
  {
61
62
  id: "i18n-import",
62
- label: h("i18n.nav.import", "Import"),
63
- path: g(c, "import"),
64
- icon: /* @__PURE__ */ f(a, { size: 20 }),
63
+ label: g("i18n.nav.import", "Import"),
64
+ path: d(c, "import"),
65
+ icon: /* @__PURE__ */ p(a, { size: 20 }),
65
66
  order: 60,
66
67
  group: "i18n"
67
68
  },
68
69
  {
69
70
  id: "i18n-export",
70
- label: h("i18n.nav.export", "Export"),
71
- path: g(c, "export"),
72
- icon: /* @__PURE__ */ f(o, { size: 20 }),
71
+ label: g("i18n.nav.export", "Export"),
72
+ path: d(c, "export"),
73
+ icon: /* @__PURE__ */ p(o, { size: 20 }),
73
74
  order: 70,
74
75
  group: "i18n"
75
76
  },
76
77
  {
77
78
  id: "i18n-locales",
78
- label: h("i18n.nav.localeSettings", "Locale Settings"),
79
- path: g(c, "locales"),
80
- icon: /* @__PURE__ */ f(s, { size: 20 }),
79
+ label: g("i18n.nav.localeSettings", "Locale Settings"),
80
+ path: d(c, "locales"),
81
+ icon: /* @__PURE__ */ p(s, { size: 20 }),
81
82
  order: 80,
82
83
  group: "i18n"
83
84
  }
84
85
  ]);
85
86
  }, [
86
- p,
87
+ m,
87
88
  c,
88
- h
89
- ]), d(() => {
90
- if (m) return m([{
89
+ g
90
+ ]), f(() => {
91
+ if (h) return h([{
91
92
  id: "i18n-status",
92
- label: h("i18n.footer.status", "I18n Ready"),
93
+ label: g("i18n.footer.status", "I18n Ready"),
93
94
  type: "status",
94
95
  order: 10,
95
96
  section: "left"
96
97
  }]);
97
- }, [m, h]), /* @__PURE__ */ f(u, {});
98
- }, h = (e) => {
98
+ }, [h, g]), /* @__PURE__ */ p(u, { basePath: c });
99
+ }, g = (e) => {
99
100
  let { registerNavItems: t, registerFooterItems: n, basePath: r = "/" } = e;
100
- return /* @__PURE__ */ f(p, {
101
+ return /* @__PURE__ */ p(m, {
101
102
  workspaceId: null,
102
103
  gateway: "global",
103
104
  defaultEnabled: !0,
104
- children: /* @__PURE__ */ f(c, {
105
+ children: /* @__PURE__ */ p(c, {
105
106
  ...e,
106
- children: /* @__PURE__ */ f(m, {
107
+ children: /* @__PURE__ */ p(h, {
107
108
  basePath: r,
108
109
  registerNavItems: t,
109
110
  registerFooterItems: n
@@ -111,4 +112,4 @@ var m = ({ basePath: c, registerNavItems: p, registerFooterItems: m }) => {
111
112
  })
112
113
  });
113
114
  };
114
- export { h as I18nRoot };
115
+ export { g as I18nRoot };
@@ -19,5 +19,24 @@
19
19
  * - /export → Export translations
20
20
  * - /locales → Locale configuration list
21
21
  * - /locales/:code → Locale configuration for specific language
22
+ *
23
+ * Redirects use ABSOLUTE paths built from `basePath` (BOFF-16781). A relative
24
+ * `to` inside the catch-all resolves against the whole unmatched address
25
+ * (React Router's splat rule), so `/i18n/products/<id>` went to
26
+ * `/i18n/products/<id>/languages`, which hit the catch-all again and grew
27
+ * "/languages" for ever.
28
+ */
29
+ export declare function I18nRoutes({ basePath }: {
30
+ basePath?: string;
31
+ }): import('react').JSX.Element;
32
+ /**
33
+ * The route table. With fe-libs' `accountPagesV2` opt-in (BOFF-16785, C5)
34
+ * Languages is one page with tabs: Products, Progress, the review queue and
35
+ * Locales open its tabs. The language settings, the editor, Import and Export
36
+ * stay today's pages until C5b. With the opt-in off, today's table, element for
37
+ * element.
22
38
  */
23
- export declare function I18nRoutes(): import('react').JSX.Element;
39
+ export declare function I18nRouteTable({ basePath, v2, }: {
40
+ basePath: string;
41
+ v2: boolean;
42
+ }): import('react').JSX.Element;
@@ -5,77 +5,99 @@ import { ProgressDashboardPage as r } from "./pages/ProgressDashboardPage.js";
5
5
  import { ReviewQueuePage as i } from "./pages/ReviewQueuePage.js";
6
6
  import { ImportExportPage as a } from "./pages/ImportExportPage.js";
7
7
  import { LocaleConfigPage as o } from "./pages/LocaleConfigPage.js";
8
- import { Navigate as s, Route as c, Routes as l } from "react-router";
9
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
+ import { joinPath as s } from "./utils/paths.js";
9
+ import { LanguagesPage as c } from "./v2/LanguagesPage.js";
10
+ import { TabRedirect as l } from "./v2/TabRedirect.js";
11
+ import { Navigate as u, Route as d, Routes as f } from "react-router";
12
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
13
+ import { useAccountPagesV2 as h } from "@burdenoff/fe-libs/ui/account-pages-v2";
10
14
  // src/i18n/I18nRoutes.tsx
11
- function f() {
12
- return /* @__PURE__ */ d(l, { children: [
13
- /* @__PURE__ */ u(c, {
15
+ function g({ basePath: e = "/" }) {
16
+ let t = h();
17
+ return /* @__PURE__ */ p(_, {
18
+ basePath: e,
19
+ v2: t
20
+ });
21
+ }
22
+ function _({ basePath: h, v2: g }) {
23
+ let _ = s(h, "languages"), v = s(h, "products"), y = (e) => /* @__PURE__ */ p(l, {
24
+ basePath: h,
25
+ tab: e
26
+ });
27
+ return /* @__PURE__ */ m(f, { children: [
28
+ /* @__PURE__ */ p(d, {
14
29
  index: !0,
15
- element: /* @__PURE__ */ u(s, {
16
- to: "languages",
30
+ element: /* @__PURE__ */ p(u, {
31
+ to: _,
17
32
  replace: !0
18
33
  })
19
34
  }),
20
- /* @__PURE__ */ u(c, {
35
+ /* @__PURE__ */ p(d, {
21
36
  path: "languages",
22
- element: /* @__PURE__ */ u(e, {})
37
+ element: g ? /* @__PURE__ */ p(c, { basePath: h }) : /* @__PURE__ */ p(e, {})
23
38
  }),
24
- /* @__PURE__ */ u(c, {
39
+ /* @__PURE__ */ p(d, {
25
40
  path: "languages/new",
26
- element: /* @__PURE__ */ u(o, {})
41
+ element: /* @__PURE__ */ p(o, {})
27
42
  }),
28
- /* @__PURE__ */ u(c, {
43
+ /* @__PURE__ */ p(d, {
29
44
  path: "languages/:code",
30
- element: /* @__PURE__ */ u(o, {})
45
+ element: /* @__PURE__ */ p(o, {})
31
46
  }),
32
- /* @__PURE__ */ u(c, {
47
+ /* @__PURE__ */ p(d, {
33
48
  path: "products",
34
- element: /* @__PURE__ */ u(t, {})
49
+ element: g ? y("products") : /* @__PURE__ */ p(t, {})
50
+ }),
51
+ /* @__PURE__ */ p(d, {
52
+ path: "products/*",
53
+ element: g ? y("products") : /* @__PURE__ */ p(u, {
54
+ to: v,
55
+ replace: !0
56
+ })
35
57
  }),
36
- /* @__PURE__ */ u(c, {
58
+ /* @__PURE__ */ p(d, {
37
59
  path: "editor",
38
- element: /* @__PURE__ */ u(n, {})
60
+ element: /* @__PURE__ */ p(n, {})
39
61
  }),
40
- /* @__PURE__ */ u(c, {
62
+ /* @__PURE__ */ p(d, {
41
63
  path: "editor/:keyId",
42
- element: /* @__PURE__ */ u(n, {})
64
+ element: /* @__PURE__ */ p(n, {})
43
65
  }),
44
- /* @__PURE__ */ u(c, {
66
+ /* @__PURE__ */ p(d, {
45
67
  path: "editor/:keyId/:languageCode",
46
- element: /* @__PURE__ */ u(n, {})
68
+ element: /* @__PURE__ */ p(n, {})
47
69
  }),
48
- /* @__PURE__ */ u(c, {
70
+ /* @__PURE__ */ p(d, {
49
71
  path: "progress",
50
- element: /* @__PURE__ */ u(r, {})
72
+ element: g ? y("languages") : /* @__PURE__ */ p(r, {})
51
73
  }),
52
- /* @__PURE__ */ u(c, {
74
+ /* @__PURE__ */ p(d, {
53
75
  path: "review",
54
- element: /* @__PURE__ */ u(i, {})
76
+ element: g ? y("review") : /* @__PURE__ */ p(i, {})
55
77
  }),
56
- /* @__PURE__ */ u(c, {
78
+ /* @__PURE__ */ p(d, {
57
79
  path: "import",
58
- element: /* @__PURE__ */ u(a, { mode: "import" })
80
+ element: /* @__PURE__ */ p(a, { mode: "import" })
59
81
  }),
60
- /* @__PURE__ */ u(c, {
82
+ /* @__PURE__ */ p(d, {
61
83
  path: "export",
62
- element: /* @__PURE__ */ u(a, { mode: "export" })
84
+ element: /* @__PURE__ */ p(a, { mode: "export" })
63
85
  }),
64
- /* @__PURE__ */ u(c, {
86
+ /* @__PURE__ */ p(d, {
65
87
  path: "locales",
66
- element: /* @__PURE__ */ u(e, {})
88
+ element: g ? y("languages") : /* @__PURE__ */ p(e, {})
67
89
  }),
68
- /* @__PURE__ */ u(c, {
90
+ /* @__PURE__ */ p(d, {
69
91
  path: "locales/:code",
70
- element: /* @__PURE__ */ u(o, {})
92
+ element: /* @__PURE__ */ p(o, {})
71
93
  }),
72
- /* @__PURE__ */ u(c, {
94
+ /* @__PURE__ */ p(d, {
73
95
  path: "*",
74
- element: /* @__PURE__ */ u(s, {
75
- to: "languages",
96
+ element: /* @__PURE__ */ p(u, {
97
+ to: _,
76
98
  replace: !0
77
99
  })
78
100
  })
79
101
  ] });
80
102
  }
81
- export { f as I18nRoutes };
103
+ export { _ as I18nRouteTable, g as I18nRoutes };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * `base` and `path` joined with exactly one slash between them:
3
+ * `joinPath("/i18n", "languages")` and `joinPath("/i18n/", "/languages")` are
4
+ * both `/i18n/languages`, and `joinPath("/", "languages")` is `/languages`.
5
+ */
6
+ export declare function joinPath(base: string, path: string): string;
@@ -0,0 +1,5 @@
1
+ // src/i18n/utils/paths.ts
2
+ function e(e, t) {
3
+ return (e.endsWith("/") ? e.slice(0, -1) : e) + (t.startsWith("/") ? t : `/${t}`);
4
+ }
5
+ export { e as joinPath };
@@ -0,0 +1,3 @@
1
+ export declare function LanguagesPage({ basePath }: {
2
+ basePath: string;
3
+ }): import('react').JSX.Element;
@@ -0,0 +1,82 @@
1
+ import e from "../../node_modules/lucide-react/dist/esm/icons/download.js";
2
+ import t from "../../node_modules/lucide-react/dist/esm/icons/plus.js";
3
+ import n from "../../node_modules/lucide-react/dist/esm/icons/upload.js";
4
+ import { useTr as r } from "../hooks/useTr.js";
5
+ import { languagesLinks as i } from "./links.js";
6
+ import { LanguagesTab as a } from "./LanguagesTab.js";
7
+ import { LANGUAGES_TABS as o, languageProgress as s, readLanguagesTab as c, sortLanguages as l } from "./model.js";
8
+ import { ProductsTab as u } from "./ProductsTab.js";
9
+ import { ReviewTab as d } from "./ReviewTab.js";
10
+ import { useLanguagesData as f } from "./useLanguagesData.js";
11
+ import { useWaitingCount as p } from "./useReviewQueue.js";
12
+ import { useMemo as m } from "react";
13
+ import { useNavigate as h, useSearchParams as g } from "react-router";
14
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
15
+ import { Button as y, PageTabs as b } from "@burdenoff/fe-libs/ui";
16
+ import { PageHeader as x } from "@burdenoff/fe-libs/chrome";
17
+ // src/i18n/v2/LanguagesPage.tsx
18
+ function S({ basePath: S }) {
19
+ let C = r(), w = h(), [T] = g(), E = c(T.get("tab")), D = i(S), O = f(), k = p(), A = m(() => s(O.coverage.byProduct), [O.coverage.byProduct]), j = m(() => l(O.languages), [O.languages]), M = {
20
+ ...O,
21
+ languages: j
22
+ }, N = j.find((e) => e.isDefault)?.name ?? C("i18n.v3.sourceText", "Source text"), P = {
23
+ languages: C("i18n.v3.tab.languages", "Languages"),
24
+ products: C("i18n.v3.tab.products", "Products"),
25
+ review: C("i18n.v3.tab.review", "Review queue")
26
+ }, F = {
27
+ languages: O.languagesLoading ? void 0 : O.languages.length,
28
+ products: O.productsLoading ? void 0 : O.products.length,
29
+ review: k
30
+ };
31
+ return /* @__PURE__ */ v("div", {
32
+ "data-account-pages-v2": "languages",
33
+ className: "flex w-full min-w-0 flex-col",
34
+ children: [
35
+ /* @__PURE__ */ _(x, {
36
+ variant: "compact",
37
+ title: C("i18n.v3.title", "Languages"),
38
+ description: C("i18n.v3.purpose", "Translations for every product, and what’s waiting for review."),
39
+ primary: /* @__PURE__ */ v(y, {
40
+ onClick: () => w(D.addLanguage),
41
+ "data-testid": "languages-add",
42
+ children: [/* @__PURE__ */ _(t, { "aria-hidden": "true" }), C("i18n.v3.addLanguage", "Add language")]
43
+ }),
44
+ more: [{
45
+ id: "import",
46
+ label: C("i18n.v3.importWords", "Import translations"),
47
+ icon: n,
48
+ onSelect: () => w(D.importWords)
49
+ }, {
50
+ id: "export",
51
+ label: C("i18n.v3.exportWords", "Export translations"),
52
+ icon: e,
53
+ onSelect: () => w(D.exportWords)
54
+ }],
55
+ moreLabel: C("i18n.v3.more", "More for languages")
56
+ }),
57
+ /* @__PURE__ */ _(b, {
58
+ ariaLabel: C("i18n.v3.title", "Languages"),
59
+ activeId: E,
60
+ tabs: o.map((e) => ({
61
+ id: e,
62
+ label: P[e],
63
+ href: D.tab(e),
64
+ badge: F[e]
65
+ }))
66
+ }),
67
+ /* @__PURE__ */ _("div", {
68
+ className: "pt-4",
69
+ children: E === "products" ? /* @__PURE__ */ _(u, { data: M }) : E === "review" ? /* @__PURE__ */ _(d, {
70
+ languages: j,
71
+ sourceName: N,
72
+ onReviewed: O.coverage.reload
73
+ }) : /* @__PURE__ */ _(a, {
74
+ data: M,
75
+ progress: A,
76
+ links: D
77
+ })
78
+ })
79
+ ]
80
+ });
81
+ }
82
+ export { S as LanguagesPage };
@@ -0,0 +1,8 @@
1
+ import { LanguagesLinks } from './links';
2
+ import { Progress } from './model';
3
+ import { LanguagesData } from './useLanguagesData';
4
+ export declare function LanguagesTab({ data, progress, links, }: {
5
+ data: LanguagesData;
6
+ progress: ReadonlyMap<string, Progress>;
7
+ links: LanguagesLinks;
8
+ }): import('react').JSX.Element;
@@ -0,0 +1,102 @@
1
+ import e from "../../node_modules/lucide-react/dist/esm/icons/download.js";
2
+ import t from "../../node_modules/lucide-react/dist/esm/icons/languages.js";
3
+ import n from "../../node_modules/lucide-react/dist/esm/icons/pencil.js";
4
+ import { useTr as r } from "../hooks/useTr.js";
5
+ import { LanguageDirection as i, LanguageStatus as a } from "../../generated/global-types.js";
6
+ import { COUNT as o } from "./formats.js";
7
+ import { ShareBar as s } from "./ShareBar.js";
8
+ import { useNavigate as c } from "react-router";
9
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
10
+ import { ActionMenu as d, Button as f, DataRows as p, EmptyState as m, IconTile as h, LoadError as g, Notice as _, StatusChip as v } from "@burdenoff/fe-libs/ui";
11
+ // src/i18n/v2/LanguagesTab.tsx
12
+ function y({ data: y, progress: b, links: x }) {
13
+ let S = r(), C = c(), w = y.productsLoading || y.coverage.loading;
14
+ return y.languagesError && y.languages.length === 0 ? /* @__PURE__ */ l(g, {
15
+ what: S("i18n.v3.tab.languages", "Languages"),
16
+ error: y.languagesError,
17
+ onRetry: y.retry
18
+ }) : !y.languagesLoading && y.languages.length === 0 ? /* @__PURE__ */ l(m, {
19
+ icon: /* @__PURE__ */ l(t, { "aria-hidden": "true" }),
20
+ title: S("i18n.v3.noLanguages", "No languages yet"),
21
+ description: S("i18n.v3.noLanguagesBody", "Add a language to start translating your products into it."),
22
+ action: /* @__PURE__ */ l(f, {
23
+ onClick: () => C(x.addLanguage),
24
+ children: S("i18n.v3.addLanguage", "Add language")
25
+ })
26
+ }) : /* @__PURE__ */ u("div", {
27
+ className: "flex flex-col gap-3",
28
+ children: [y.coverage.failed.length > 0 ? /* @__PURE__ */ l(_, {
29
+ tone: "warn",
30
+ children: y.coverage.failed.length === 1 ? S("i18n.v3.oneNotCounted", "One product couldn’t be counted, so these numbers leave it out.") : S("i18n.v3.someNotCounted", "{{count}} products couldn’t be counted, so these numbers leave them out.", { count: o.format(y.coverage.failed.length) })
31
+ }) : null, /* @__PURE__ */ l(p, {
32
+ items: y.languages,
33
+ getId: (e) => e.id,
34
+ label: S("i18n.v3.tab.languages", "Languages"),
35
+ loading: y.languagesLoading,
36
+ skeletonRows: 6,
37
+ lead: {
38
+ header: S("i18n.v3.col.language", "Language"),
39
+ media: () => /* @__PURE__ */ l(h, {
40
+ size: "sm",
41
+ children: /* @__PURE__ */ l(t, { "aria-hidden": "true" })
42
+ }),
43
+ title: (e) => e.name,
44
+ subtitle: (e) => {
45
+ let t = [e.nativeName === e.name ? "" : e.nativeName, e.code];
46
+ return e.direction === i.Rtl && t.push(S("i18n.v3.rightToLeft", "right to left")), e.isDefault && t.push(S("i18n.v3.source", "Source")), t.filter(Boolean).join(" · ");
47
+ },
48
+ href: (e) => x.language(e.code)
49
+ },
50
+ columns: [{
51
+ id: "translated",
52
+ header: S("i18n.v3.col.translated", "Translated"),
53
+ width: "220px",
54
+ cell: (e) => e.status === a.Draft ? /* @__PURE__ */ l(v, {
55
+ status: "waiting",
56
+ children: S("i18n.v3.status.draft", "Draft")
57
+ }) : e.status === a.Deprecated ? /* @__PURE__ */ l(v, {
58
+ status: "paused",
59
+ children: S("i18n.v3.status.off", "Turned off")
60
+ }) : /* @__PURE__ */ l(s, {
61
+ loading: w,
62
+ share: b.get(e.code)?.share ?? null
63
+ })
64
+ }, {
65
+ id: "waiting",
66
+ header: S("i18n.v3.col.waiting", "Waiting for review"),
67
+ width: "160px",
68
+ cell: (e) => {
69
+ if (w) return null;
70
+ let t = b.get(e.code)?.waiting ?? 0;
71
+ return t === 0 ? /* @__PURE__ */ l("span", {
72
+ className: "text-sm text-text-secondary",
73
+ children: "—"
74
+ }) : /* @__PURE__ */ l(f, {
75
+ variant: "link",
76
+ size: "sm",
77
+ className: "h-auto p-0",
78
+ onClick: () => C(x.review(e.code)),
79
+ children: S("i18n.v3.toCheck", "{{count}} to check", { count: o.format(t) })
80
+ });
81
+ },
82
+ phone: (e) => (b.get(e.code)?.waiting ?? 0) > 0 ? "label" : "hide"
83
+ }],
84
+ actions: (t) => /* @__PURE__ */ l(d, {
85
+ placement: "row",
86
+ label: S("i18n.v3.actionsFor", "Actions for {{name}}", { name: t.name }),
87
+ items: [{
88
+ id: "open",
89
+ label: S("i18n.v3.open", "Open"),
90
+ icon: n,
91
+ onSelect: () => C(x.language(t.code))
92
+ }, {
93
+ id: "export",
94
+ label: S("i18n.v3.exportWords", "Export translations"),
95
+ icon: e,
96
+ onSelect: () => C(x.exportWords)
97
+ }]
98
+ })
99
+ })]
100
+ });
101
+ }
102
+ export { y as LanguagesTab };
@@ -0,0 +1,4 @@
1
+ import { LanguagesData } from './useLanguagesData';
2
+ export declare function ProductsTab({ data }: {
3
+ data: LanguagesData;
4
+ }): import('react').JSX.Element;
@@ -0,0 +1,60 @@
1
+ import e from "../../node_modules/lucide-react/dist/esm/icons/package.js";
2
+ import { useTr as t } from "../hooks/useTr.js";
3
+ import { COUNT as n } from "./formats.js";
4
+ import { productProgress as r } from "./model.js";
5
+ import { ShareBar as i } from "./ShareBar.js";
6
+ import { jsx as a } from "react/jsx-runtime";
7
+ import { DataRows as o, EmptyState as s, IconTile as c, LoadError as l, Skeleton as u } from "@burdenoff/fe-libs/ui";
8
+ // src/i18n/v2/ProductsTab.tsx
9
+ function d({ data: d }) {
10
+ let f = t(), p = d.coverage.loading;
11
+ if (d.productsError && d.products.length === 0) return /* @__PURE__ */ a(l, {
12
+ what: f("i18n.v3.tab.products", "Products"),
13
+ error: d.productsError,
14
+ onRetry: d.retry
15
+ });
16
+ if (!d.productsLoading && d.products.length === 0) return /* @__PURE__ */ a(s, {
17
+ icon: /* @__PURE__ */ a(e, { "aria-hidden": "true" }),
18
+ title: f("i18n.v3.noProducts", "No products yet"),
19
+ description: f("i18n.v3.noProductsBody", "A product’s words show here once they are ready to translate.")
20
+ });
21
+ let m = (e) => {
22
+ let t = d.coverage.byProduct.get(e.id);
23
+ return t ? r(t, d.sourceCode) : null;
24
+ };
25
+ return /* @__PURE__ */ a(o, {
26
+ items: d.products,
27
+ getId: (e) => e.id,
28
+ label: f("i18n.v3.tab.products", "Products"),
29
+ loading: d.productsLoading,
30
+ lead: {
31
+ header: f("i18n.v3.col.product", "Product"),
32
+ media: () => /* @__PURE__ */ a(c, {
33
+ size: "sm",
34
+ children: /* @__PURE__ */ a(e, { "aria-hidden": "true" })
35
+ }),
36
+ title: (e) => e.displayName,
37
+ subtitle: (e) => e.description ?? void 0
38
+ },
39
+ columns: [{
40
+ id: "texts",
41
+ header: f("i18n.v3.col.texts", "Text to translate"),
42
+ width: "160px",
43
+ numeric: !0,
44
+ cell: (e) => {
45
+ if (p) return /* @__PURE__ */ a(u, { className: "h-4 w-16 rounded" });
46
+ let t = m(e);
47
+ return t ? n.format(t.texts) : "—";
48
+ }
49
+ }, {
50
+ id: "translated",
51
+ header: f("i18n.v3.col.translated", "Translated"),
52
+ width: "220px",
53
+ cell: (e) => /* @__PURE__ */ a(i, {
54
+ loading: p,
55
+ share: m(e)?.share ?? null
56
+ })
57
+ }]
58
+ });
59
+ }
60
+ export { d as ProductsTab };
@@ -0,0 +1,9 @@
1
+ import { LanguageRow } from './useLanguagesData';
2
+ import { ReviewActions } from './useReviewActions';
3
+ import { ReviewQueue } from './useReviewQueue';
4
+ export declare function ReviewRows({ queue, actions, byCode, sourceName, }: {
5
+ queue: ReviewQueue;
6
+ actions: ReviewActions;
7
+ byCode: ReadonlyMap<string, LanguageRow>;
8
+ sourceName: string;
9
+ }): import('react').JSX.Element;