@burdenoff/microfe-i18n 2026.1126.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.
- package/dist/generated/global-operations.d.ts +299 -0
- package/dist/generated/global-operations.js +135 -0
- package/dist/generated/global-types.d.ts +34021 -0
- package/dist/generated/global-types.js +11 -0
- package/dist/i18n/I18nRoutes.d.ts +11 -0
- package/dist/i18n/I18nRoutes.js +54 -41
- package/dist/i18n/v2/LanguagesPage.d.ts +3 -0
- package/dist/i18n/v2/LanguagesPage.js +82 -0
- package/dist/i18n/v2/LanguagesTab.d.ts +8 -0
- package/dist/i18n/v2/LanguagesTab.js +102 -0
- package/dist/i18n/v2/ProductsTab.d.ts +4 -0
- package/dist/i18n/v2/ProductsTab.js +60 -0
- package/dist/i18n/v2/ReviewRows.d.ts +9 -0
- package/dist/i18n/v2/ReviewRows.js +71 -0
- package/dist/i18n/v2/ReviewTab.d.ts +6 -0
- package/dist/i18n/v2/ReviewTab.js +121 -0
- package/dist/i18n/v2/ShareBar.d.ts +5 -0
- package/dist/i18n/v2/ShareBar.js +28 -0
- package/dist/i18n/v2/TabRedirect.d.ts +4 -0
- package/dist/i18n/v2/TabRedirect.js +14 -0
- package/dist/i18n/v2/__tests__/routeShapes.d.ts +7 -0
- package/dist/i18n/v2/formats.d.ts +3 -0
- package/dist/i18n/v2/formats.js +6 -0
- package/dist/i18n/v2/links.d.ts +13 -0
- package/dist/i18n/v2/links.js +16 -0
- package/dist/i18n/v2/model.d.ts +76 -0
- package/dist/i18n/v2/model.js +87 -0
- package/dist/i18n/v2/reviewMessages.d.ts +9 -0
- package/dist/i18n/v2/reviewMessages.js +40 -0
- package/dist/i18n/v2/useLanguagesData.d.ts +35 -0
- package/dist/i18n/v2/useLanguagesData.js +62 -0
- package/dist/i18n/v2/useReviewActions.d.ts +9 -0
- package/dist/i18n/v2/useReviewActions.js +56 -0
- package/dist/i18n/v2/useReviewQueue.d.ts +44 -0
- package/dist/i18n/v2/useReviewQueue.js +60 -0
- package/dist/node_modules/@apollo/client/react/context/ApolloContext.js +15 -0
- package/dist/node_modules/@apollo/client/react/hooks/constants.js +3 -0
- package/dist/node_modules/@apollo/client/react/hooks/internal/useDeepMemo.js +11 -0
- package/dist/node_modules/@apollo/client/react/hooks/internal/useIsomorphicLayoutEffect.js +5 -0
- package/dist/node_modules/@apollo/client/react/hooks/internal/wrapHook.js +13 -0
- package/dist/node_modules/@apollo/client/react/hooks/useApolloClient.js +9 -0
- package/dist/node_modules/@apollo/client/react/hooks/useMutation.js +96 -0
- package/dist/node_modules/@apollo/client/react/hooks/useQuery.js +125 -0
- package/dist/node_modules/@apollo/client/react/hooks/useSyncExternalStore.js +34 -0
- package/dist/node_modules/@apollo/client/react/internal/index.js +3 -0
- package/dist/node_modules/@apollo/client/utilities/internal/canUseDOM.js +4 -0
- package/dist/node_modules/@apollo/client/utilities/internal/compact.js +11 -0
- package/dist/node_modules/@apollo/client/utilities/internal/constants.js +3 -0
- package/dist/node_modules/@apollo/client/utilities/internal/deepFreeze.js +14 -0
- package/dist/node_modules/@apollo/client/utilities/internal/globals/global.js +6 -0
- package/dist/node_modules/@apollo/client/utilities/internal/globals/maybe.js +7 -0
- package/dist/node_modules/@apollo/client/utilities/internal/isNonNullObject.js +5 -0
- package/dist/node_modules/@apollo/client/utilities/internal/makeUniqueId.js +7 -0
- package/dist/node_modules/@apollo/client/utilities/internal/maybeDeepFreeze.js +6 -0
- package/dist/node_modules/@apollo/client/utilities/internal/mergeOptions.js +9 -0
- package/dist/node_modules/@apollo/client/utilities/internal/preventUnhandledRejection.js +5 -0
- package/dist/node_modules/@apollo/client/utilities/internal/stringifyForDisplay.js +7 -0
- package/dist/node_modules/@apollo/client/utilities/invariant/index.js +54 -0
- package/dist/node_modules/@apollo/client/version.js +3 -0
- package/dist/node_modules/@wry/equality/lib/index.js +86 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check-check.js +10 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/check.js +7 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/pencil.js +10 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/NotificationFactories.js +18 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Scheduler.js +11 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscriber.js +114 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/Subscription.js +94 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/config.js +9 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/OperatorSubscriber.js +43 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/operators/observeOn.js +22 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/Action.js +13 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsapAction.js +19 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsapScheduler.js +24 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncAction.js +43 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/AsyncScheduler.js +27 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/asap.js +5 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/dateTimestampProvider.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/immediateProvider.js +14 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/intervalProvider.js +13 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/scheduler/timeoutProvider.js +13 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/Immediate.js +17 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/UnsubscriptionError.js +10 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/arrRemove.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/createErrorClass.js +8 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/errorContext.js +5 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/executeSchedule.js +9 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/isFunction.js +5 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/lift.js +18 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/noop.js +3 -0
- package/dist/node_modules/rxjs/dist/esm5/internal/util/reportUnhandledError.js +11 -0
- package/dist/node_modules/tslib/tslib.es6.js +49 -0
- package/package.json +12 -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 };
|
|
@@ -29,3 +29,14 @@
|
|
|
29
29
|
export declare function I18nRoutes({ basePath }: {
|
|
30
30
|
basePath?: string;
|
|
31
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.
|
|
38
|
+
*/
|
|
39
|
+
export declare function I18nRouteTable({ basePath, v2, }: {
|
|
40
|
+
basePath: string;
|
|
41
|
+
v2: boolean;
|
|
42
|
+
}): import('react').JSX.Element;
|
package/dist/i18n/I18nRoutes.js
CHANGED
|
@@ -6,85 +6,98 @@ 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
8
|
import { joinPath as s } from "./utils/paths.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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";
|
|
11
14
|
// src/i18n/I18nRoutes.tsx
|
|
12
|
-
function
|
|
13
|
-
let
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
|
|
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, {
|
|
16
29
|
index: !0,
|
|
17
|
-
element: /* @__PURE__ */
|
|
18
|
-
to:
|
|
30
|
+
element: /* @__PURE__ */ p(u, {
|
|
31
|
+
to: _,
|
|
19
32
|
replace: !0
|
|
20
33
|
})
|
|
21
34
|
}),
|
|
22
|
-
/* @__PURE__ */ d
|
|
35
|
+
/* @__PURE__ */ p(d, {
|
|
23
36
|
path: "languages",
|
|
24
|
-
element: /* @__PURE__ */
|
|
37
|
+
element: g ? /* @__PURE__ */ p(c, { basePath: h }) : /* @__PURE__ */ p(e, {})
|
|
25
38
|
}),
|
|
26
|
-
/* @__PURE__ */ d
|
|
39
|
+
/* @__PURE__ */ p(d, {
|
|
27
40
|
path: "languages/new",
|
|
28
|
-
element: /* @__PURE__ */
|
|
41
|
+
element: /* @__PURE__ */ p(o, {})
|
|
29
42
|
}),
|
|
30
|
-
/* @__PURE__ */ d
|
|
43
|
+
/* @__PURE__ */ p(d, {
|
|
31
44
|
path: "languages/:code",
|
|
32
|
-
element: /* @__PURE__ */
|
|
45
|
+
element: /* @__PURE__ */ p(o, {})
|
|
33
46
|
}),
|
|
34
|
-
/* @__PURE__ */ d
|
|
47
|
+
/* @__PURE__ */ p(d, {
|
|
35
48
|
path: "products",
|
|
36
|
-
element: /* @__PURE__ */
|
|
49
|
+
element: g ? y("products") : /* @__PURE__ */ p(t, {})
|
|
37
50
|
}),
|
|
38
|
-
/* @__PURE__ */ d
|
|
51
|
+
/* @__PURE__ */ p(d, {
|
|
39
52
|
path: "products/*",
|
|
40
|
-
element: /* @__PURE__ */
|
|
41
|
-
to:
|
|
53
|
+
element: g ? y("products") : /* @__PURE__ */ p(u, {
|
|
54
|
+
to: v,
|
|
42
55
|
replace: !0
|
|
43
56
|
})
|
|
44
57
|
}),
|
|
45
|
-
/* @__PURE__ */ d
|
|
58
|
+
/* @__PURE__ */ p(d, {
|
|
46
59
|
path: "editor",
|
|
47
|
-
element: /* @__PURE__ */
|
|
60
|
+
element: /* @__PURE__ */ p(n, {})
|
|
48
61
|
}),
|
|
49
|
-
/* @__PURE__ */ d
|
|
62
|
+
/* @__PURE__ */ p(d, {
|
|
50
63
|
path: "editor/:keyId",
|
|
51
|
-
element: /* @__PURE__ */
|
|
64
|
+
element: /* @__PURE__ */ p(n, {})
|
|
52
65
|
}),
|
|
53
|
-
/* @__PURE__ */ d
|
|
66
|
+
/* @__PURE__ */ p(d, {
|
|
54
67
|
path: "editor/:keyId/:languageCode",
|
|
55
|
-
element: /* @__PURE__ */
|
|
68
|
+
element: /* @__PURE__ */ p(n, {})
|
|
56
69
|
}),
|
|
57
|
-
/* @__PURE__ */ d
|
|
70
|
+
/* @__PURE__ */ p(d, {
|
|
58
71
|
path: "progress",
|
|
59
|
-
element: /* @__PURE__ */
|
|
72
|
+
element: g ? y("languages") : /* @__PURE__ */ p(r, {})
|
|
60
73
|
}),
|
|
61
|
-
/* @__PURE__ */ d
|
|
74
|
+
/* @__PURE__ */ p(d, {
|
|
62
75
|
path: "review",
|
|
63
|
-
element: /* @__PURE__ */
|
|
76
|
+
element: g ? y("review") : /* @__PURE__ */ p(i, {})
|
|
64
77
|
}),
|
|
65
|
-
/* @__PURE__ */ d
|
|
78
|
+
/* @__PURE__ */ p(d, {
|
|
66
79
|
path: "import",
|
|
67
|
-
element: /* @__PURE__ */
|
|
80
|
+
element: /* @__PURE__ */ p(a, { mode: "import" })
|
|
68
81
|
}),
|
|
69
|
-
/* @__PURE__ */ d
|
|
82
|
+
/* @__PURE__ */ p(d, {
|
|
70
83
|
path: "export",
|
|
71
|
-
element: /* @__PURE__ */
|
|
84
|
+
element: /* @__PURE__ */ p(a, { mode: "export" })
|
|
72
85
|
}),
|
|
73
|
-
/* @__PURE__ */ d
|
|
86
|
+
/* @__PURE__ */ p(d, {
|
|
74
87
|
path: "locales",
|
|
75
|
-
element: /* @__PURE__ */
|
|
88
|
+
element: g ? y("languages") : /* @__PURE__ */ p(e, {})
|
|
76
89
|
}),
|
|
77
|
-
/* @__PURE__ */ d
|
|
90
|
+
/* @__PURE__ */ p(d, {
|
|
78
91
|
path: "locales/:code",
|
|
79
|
-
element: /* @__PURE__ */
|
|
92
|
+
element: /* @__PURE__ */ p(o, {})
|
|
80
93
|
}),
|
|
81
|
-
/* @__PURE__ */ d
|
|
94
|
+
/* @__PURE__ */ p(d, {
|
|
82
95
|
path: "*",
|
|
83
|
-
element: /* @__PURE__ */
|
|
84
|
-
to:
|
|
96
|
+
element: /* @__PURE__ */ p(u, {
|
|
97
|
+
to: _,
|
|
85
98
|
replace: !0
|
|
86
99
|
})
|
|
87
100
|
})
|
|
88
101
|
] });
|
|
89
102
|
}
|
|
90
|
-
export {
|
|
103
|
+
export { _ as I18nRouteTable, g as I18nRoutes };
|
|
@@ -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,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;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import e from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
2
|
+
import { useTr as t } from "../hooks/useTr.js";
|
|
3
|
+
import { LanguageDirection as n } from "../../generated/global-types.js";
|
|
4
|
+
import { whereItAppears as r } from "./model.js";
|
|
5
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
6
|
+
import { Button as o, DataRows as s } from "@burdenoff/fe-libs/ui";
|
|
7
|
+
// src/i18n/v2/ReviewRows.tsx
|
|
8
|
+
function c({ row: e }) {
|
|
9
|
+
return e.key.defaultValue ? /* @__PURE__ */ i("span", {
|
|
10
|
+
className: "text-sm text-text-primary",
|
|
11
|
+
children: e.key.defaultValue
|
|
12
|
+
}) : /* @__PURE__ */ i("span", {
|
|
13
|
+
className: "text-sm text-text-secondary",
|
|
14
|
+
children: "—"
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function l({ row: e, language: t }) {
|
|
18
|
+
return /* @__PURE__ */ i("span", {
|
|
19
|
+
className: "text-sm text-text-primary",
|
|
20
|
+
lang: e.languageCode,
|
|
21
|
+
dir: t?.direction === n.Rtl ? "rtl" : void 0,
|
|
22
|
+
children: e.value
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function u({ queue: n, actions: u, byCode: d, sourceName: f }) {
|
|
26
|
+
let p = t(), m = (e) => d.get(e)?.name ?? e;
|
|
27
|
+
return /* @__PURE__ */ i(s, {
|
|
28
|
+
items: n.rows,
|
|
29
|
+
getId: (e) => e.id,
|
|
30
|
+
label: p("i18n.v3.tab.review", "Review queue"),
|
|
31
|
+
loading: n.loading,
|
|
32
|
+
skeletonRows: 4,
|
|
33
|
+
lead: {
|
|
34
|
+
header: p("i18n.v3.col.where", "Where"),
|
|
35
|
+
width: "minmax(0,1.2fr)",
|
|
36
|
+
title: (e) => r(e.key),
|
|
37
|
+
subtitle: (e) => e.key.namespace?.displayName ? `${e.key.product.displayName} · ${m(e.languageCode)}` : m(e.languageCode)
|
|
38
|
+
},
|
|
39
|
+
columns: [{
|
|
40
|
+
id: "source",
|
|
41
|
+
header: f,
|
|
42
|
+
width: "minmax(0,1.4fr)",
|
|
43
|
+
cell: (e) => /* @__PURE__ */ i(c, { row: e })
|
|
44
|
+
}, {
|
|
45
|
+
id: "translation",
|
|
46
|
+
header: p("i18n.v3.col.translation", "Translation"),
|
|
47
|
+
width: "minmax(0,1.4fr)",
|
|
48
|
+
cell: (e) => /* @__PURE__ */ i(l, {
|
|
49
|
+
row: e,
|
|
50
|
+
language: d.get(e.languageCode)
|
|
51
|
+
})
|
|
52
|
+
}],
|
|
53
|
+
actions: (t) => /* @__PURE__ */ a(o, {
|
|
54
|
+
size: "sm",
|
|
55
|
+
onClick: () => void u.approveOne(t),
|
|
56
|
+
disabled: u.bulk || u.busy.has(t.id),
|
|
57
|
+
"aria-busy": u.busy.has(t.id) || void 0,
|
|
58
|
+
"aria-label": p("i18n.v3.approveWhere", "Approve: {{where}}", { where: r(t.key) }),
|
|
59
|
+
children: [/* @__PURE__ */ i(e, { "aria-hidden": "true" }), p("i18n.v3.approve", "Approve")]
|
|
60
|
+
}),
|
|
61
|
+
footer: n.hasMore ? /* @__PURE__ */ i(o, {
|
|
62
|
+
variant: "outline",
|
|
63
|
+
size: "sm",
|
|
64
|
+
onClick: n.showMore,
|
|
65
|
+
disabled: n.loadingMore,
|
|
66
|
+
"aria-busy": n.loadingMore || void 0,
|
|
67
|
+
children: p("i18n.v3.showMore", "Show more")
|
|
68
|
+
}) : void 0
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
export { u as ReviewRows };
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import e from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
2
|
+
import t from "../../node_modules/lucide-react/dist/esm/icons/check-check.js";
|
|
3
|
+
import { useTr as n } from "../hooks/useTr.js";
|
|
4
|
+
import { COUNT as r } from "./formats.js";
|
|
5
|
+
import { LANGUAGE_PARAM as i } from "./model.js";
|
|
6
|
+
import { ReviewRows as a } from "./ReviewRows.js";
|
|
7
|
+
import { useReviewActions as o } from "./useReviewActions.js";
|
|
8
|
+
import { useReviewQueue as s } from "./useReviewQueue.js";
|
|
9
|
+
import { useSearchParams as c } from "react-router";
|
|
10
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
11
|
+
import { Button as d, EmptyState as f, LoadError as p, Notice as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y } from "@burdenoff/fe-libs/ui";
|
|
12
|
+
// src/i18n/v2/ReviewTab.tsx
|
|
13
|
+
var b = "all";
|
|
14
|
+
function x({ languageCode: e, languages: t }) {
|
|
15
|
+
let r = n(), [a, o] = c(), s = (e) => {
|
|
16
|
+
let t = new URLSearchParams(a);
|
|
17
|
+
e === b ? t.delete(i) : t.set(i, e), o(t, { replace: !0 });
|
|
18
|
+
}, d = t.filter((e) => !e.isDefault), f = e && !d.some((t) => t.code === e) ? e : null;
|
|
19
|
+
return /* @__PURE__ */ u(h, {
|
|
20
|
+
value: e ?? b,
|
|
21
|
+
onValueChange: s,
|
|
22
|
+
children: [/* @__PURE__ */ l(v, {
|
|
23
|
+
className: "w-auto min-w-44",
|
|
24
|
+
"aria-label": r("i18n.v3.reviewLanguage", "Language"),
|
|
25
|
+
"data-testid": "review-language",
|
|
26
|
+
children: /* @__PURE__ */ l(y, {})
|
|
27
|
+
}), /* @__PURE__ */ u(g, { children: [
|
|
28
|
+
/* @__PURE__ */ l(_, {
|
|
29
|
+
value: b,
|
|
30
|
+
children: r("i18n.v3.allLanguages", "All languages")
|
|
31
|
+
}),
|
|
32
|
+
d.map((e) => /* @__PURE__ */ l(_, {
|
|
33
|
+
value: e.code,
|
|
34
|
+
children: e.name
|
|
35
|
+
}, e.code)),
|
|
36
|
+
f ? /* @__PURE__ */ l(_, {
|
|
37
|
+
value: f,
|
|
38
|
+
children: f
|
|
39
|
+
}) : null
|
|
40
|
+
] })]
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function S({ queue: e, actions: t }) {
|
|
44
|
+
let i = n();
|
|
45
|
+
return e.notLiveTotal === 0 ? null : /* @__PURE__ */ l(m, {
|
|
46
|
+
tone: "info",
|
|
47
|
+
action: /* @__PURE__ */ l(d, {
|
|
48
|
+
size: "sm",
|
|
49
|
+
variant: "outline",
|
|
50
|
+
onClick: () => void t.putLive(),
|
|
51
|
+
disabled: t.bulk,
|
|
52
|
+
children: i("i18n.v3.putLive", "Put them live")
|
|
53
|
+
}),
|
|
54
|
+
children: e.notLiveTotal === 1 ? i("i18n.v3.oneNotLive", "One approved translation isn’t live yet.") : i("i18n.v3.someNotLive", "{{count}} approved translations aren’t live yet.", { count: r.format(e.notLiveTotal) })
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
function C({ languageName: t }) {
|
|
58
|
+
let r = n();
|
|
59
|
+
return /* @__PURE__ */ l(f, {
|
|
60
|
+
kind: "all-done",
|
|
61
|
+
icon: /* @__PURE__ */ l(e, { "aria-hidden": "true" }),
|
|
62
|
+
title: r("i18n.v3.nothingToReview", "Nothing to review"),
|
|
63
|
+
description: t ? r("i18n.v3.nothingToReviewIn", "Nothing in {{name}} waits for review. New translations wait here until someone checks them.", { name: t }) : r("i18n.v3.nothingToReviewBody", "New translations wait here until someone checks them.")
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function w({ languageCode: e, languages: i, sourceName: c, onReviewed: f }) {
|
|
67
|
+
let m = n(), h = s(e), g = o(h, f), _ = new Map(i.map((e) => [e.code, e])), v = h.rows.length === 0, y = /* @__PURE__ */ l(a, {
|
|
68
|
+
queue: h,
|
|
69
|
+
actions: g,
|
|
70
|
+
byCode: _,
|
|
71
|
+
sourceName: c
|
|
72
|
+
});
|
|
73
|
+
return h.error && v ? y = /* @__PURE__ */ l(p, {
|
|
74
|
+
what: m("i18n.v3.tab.review", "Review queue"),
|
|
75
|
+
error: h.error,
|
|
76
|
+
onRetry: h.retry
|
|
77
|
+
}) : !h.loading && v && (y = /* @__PURE__ */ l(C, { languageName: e ? _.get(e)?.name ?? e : null })), /* @__PURE__ */ u("div", {
|
|
78
|
+
className: "flex flex-col gap-3",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ l(S, {
|
|
81
|
+
queue: h,
|
|
82
|
+
actions: g
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ u("div", {
|
|
85
|
+
className: "flex flex-wrap items-center gap-2",
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ l("b", {
|
|
88
|
+
className: "text-sm font-semibold text-text-primary",
|
|
89
|
+
"data-testid": "review-waiting",
|
|
90
|
+
children: m("i18n.v3.waitingCount", "{{count}} waiting", { count: r.format(h.total) })
|
|
91
|
+
}),
|
|
92
|
+
/* @__PURE__ */ l(x, {
|
|
93
|
+
languageCode: e,
|
|
94
|
+
languages: i
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ l("span", { className: "flex-1" }),
|
|
97
|
+
v ? null : /* @__PURE__ */ u(d, {
|
|
98
|
+
variant: "outline",
|
|
99
|
+
size: "sm",
|
|
100
|
+
onClick: () => void g.approveShown(),
|
|
101
|
+
disabled: g.bulk,
|
|
102
|
+
"aria-busy": g.bulk || void 0,
|
|
103
|
+
"data-testid": "review-approve-all",
|
|
104
|
+
children: [/* @__PURE__ */ l(t, { "aria-hidden": "true" }), m("i18n.v3.approveAll", "Approve all shown")]
|
|
105
|
+
})
|
|
106
|
+
]
|
|
107
|
+
}),
|
|
108
|
+
y
|
|
109
|
+
]
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
function T({ languages: e, sourceName: t, onReviewed: n }) {
|
|
113
|
+
let [r] = c(), i = r.get("language") || null;
|
|
114
|
+
return /* @__PURE__ */ l(w, {
|
|
115
|
+
languageCode: i,
|
|
116
|
+
languages: e,
|
|
117
|
+
sourceName: t,
|
|
118
|
+
onReviewed: n
|
|
119
|
+
}, i ?? b);
|
|
120
|
+
}
|
|
121
|
+
export { T as ReviewTab };
|