@lokalise/harmony 1.12.1 → 1.12.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.
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.mjs +117 -119
- package/dist/types/src/features/publicApi/hooks/useCreateProjectMutation.d.ts +4 -4
- package/dist/types/src/features/publicApi/hooks/useListProjectsQuery.d.ts +59 -58
- package/dist/types/src/features/publicApi/hooks/useRetrieveProjectQuery.d.ts +4 -4
- package/dist/types/src/features/publicApi/projects.d.ts +429 -483
- package/dist/types/src/features/publicApi/types/projectTypes.d.ts +417 -471
- package/package.json +1 -1
package/dist/harmony.mjs
CHANGED
@@ -3,12 +3,12 @@ var Nt = (e, t, n) => t in e ? Ct(e, t, { enumerable: !0, configurable: !0, writ
|
|
3
3
|
var Ne = (e, t, n) => Nt(e, typeof t != "symbol" ? t + "" : t, n);
|
4
4
|
import { jsx as i, jsxs as p, Fragment as at } from "react/jsx-runtime";
|
5
5
|
import * as M from "react";
|
6
|
-
import { useRef as ot, useState as
|
7
|
-
import { Tooltip as
|
6
|
+
import { useRef as ot, useState as be, useCallback as Re, useEffect as U, useContext as Rt, createContext as kt, cloneElement as At, Fragment as it, forwardRef as Lt } from "react";
|
7
|
+
import { Tooltip as ge, Link as st, Menu as he, MenuList as pe, CaretUpIcon as Ot, UserIcon as ct, MenuItem as J, MenuDivider as lt, Tag as qt } from "@lokalise/louis";
|
8
8
|
import { format as ut } from "date-fns";
|
9
9
|
import { toZonedTime as Mt } from "date-fns-tz";
|
10
10
|
import { z as r } from "zod";
|
11
|
-
import { sendByPayloadRoute as
|
11
|
+
import { sendByPayloadRoute as W, sendByGetRoute as x } from "@lokalise/frontend-http-client";
|
12
12
|
import { buildPayloadRoute as dt } from "@lokalise/universal-ts-utils/api-contracts/apiContracts";
|
13
13
|
import { useQuery as O, useMutation as Ut } from "@tanstack/react-query";
|
14
14
|
import { buildGetRoute as B } from "@lokalise/universal-ts-utils/node";
|
@@ -16,42 +16,42 @@ var D = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : ty
|
|
16
16
|
function mt(e) {
|
17
17
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
18
18
|
}
|
19
|
-
var
|
20
|
-
function
|
21
|
-
if (ke) return
|
19
|
+
var V, ke;
|
20
|
+
function ve() {
|
21
|
+
if (ke) return V;
|
22
22
|
ke = 1;
|
23
23
|
function e(t) {
|
24
24
|
var n = typeof t;
|
25
25
|
return t != null && (n == "object" || n == "function");
|
26
26
|
}
|
27
|
-
return
|
27
|
+
return V = e, V;
|
28
28
|
}
|
29
|
-
var
|
29
|
+
var Z, Ae;
|
30
30
|
function xt() {
|
31
|
-
if (Ae) return
|
31
|
+
if (Ae) return Z;
|
32
32
|
Ae = 1;
|
33
33
|
var e = typeof D == "object" && D && D.Object === Object && D;
|
34
|
-
return
|
34
|
+
return Z = e, Z;
|
35
35
|
}
|
36
|
-
var
|
36
|
+
var X, Le;
|
37
37
|
function ft() {
|
38
|
-
if (Le) return
|
38
|
+
if (Le) return X;
|
39
39
|
Le = 1;
|
40
40
|
var e = xt(), t = typeof self == "object" && self && self.Object === Object && self, n = e || t || Function("return this")();
|
41
|
-
return
|
41
|
+
return X = n, X;
|
42
42
|
}
|
43
|
-
var
|
43
|
+
var ee, Oe;
|
44
44
|
function Bt() {
|
45
|
-
if (Oe) return
|
45
|
+
if (Oe) return ee;
|
46
46
|
Oe = 1;
|
47
47
|
var e = ft(), t = function() {
|
48
48
|
return e.Date.now();
|
49
49
|
};
|
50
|
-
return
|
50
|
+
return ee = t, ee;
|
51
51
|
}
|
52
|
-
var
|
52
|
+
var te, qe;
|
53
53
|
function Ht() {
|
54
|
-
if (qe) return
|
54
|
+
if (qe) return te;
|
55
55
|
qe = 1;
|
56
56
|
var e = /\s/;
|
57
57
|
function t(n) {
|
@@ -59,28 +59,28 @@ function Ht() {
|
|
59
59
|
;
|
60
60
|
return a;
|
61
61
|
}
|
62
|
-
return
|
62
|
+
return te = t, te;
|
63
63
|
}
|
64
|
-
var
|
64
|
+
var ne, Me;
|
65
65
|
function $t() {
|
66
|
-
if (Me) return
|
66
|
+
if (Me) return ne;
|
67
67
|
Me = 1;
|
68
68
|
var e = Ht(), t = /^\s+/;
|
69
69
|
function n(a) {
|
70
70
|
return a && a.slice(0, e(a) + 1).replace(t, "");
|
71
71
|
}
|
72
|
-
return
|
72
|
+
return ne = n, ne;
|
73
73
|
}
|
74
|
-
var
|
74
|
+
var re, Ue;
|
75
75
|
function _t() {
|
76
|
-
if (Ue) return
|
76
|
+
if (Ue) return re;
|
77
77
|
Ue = 1;
|
78
78
|
var e = ft(), t = e.Symbol;
|
79
|
-
return
|
79
|
+
return re = t, re;
|
80
80
|
}
|
81
|
-
var
|
81
|
+
var ae, xe;
|
82
82
|
function Gt() {
|
83
|
-
if (xe) return
|
83
|
+
if (xe) return ae;
|
84
84
|
xe = 1;
|
85
85
|
var e = _t(), t = Object.prototype, n = t.hasOwnProperty, a = t.toString, o = e ? e.toStringTag : void 0;
|
86
86
|
function s(c) {
|
@@ -93,52 +93,52 @@ function Gt() {
|
|
93
93
|
var m = a.call(c);
|
94
94
|
return l && (u ? c[o] = d : delete c[o]), m;
|
95
95
|
}
|
96
|
-
return
|
96
|
+
return ae = s, ae;
|
97
97
|
}
|
98
|
-
var
|
98
|
+
var oe, Be;
|
99
99
|
function Dt() {
|
100
|
-
if (Be) return
|
100
|
+
if (Be) return oe;
|
101
101
|
Be = 1;
|
102
102
|
var e = Object.prototype, t = e.toString;
|
103
103
|
function n(a) {
|
104
104
|
return t.call(a);
|
105
105
|
}
|
106
|
-
return
|
106
|
+
return oe = n, oe;
|
107
107
|
}
|
108
|
-
var
|
108
|
+
var ie, He;
|
109
109
|
function Ft() {
|
110
|
-
if (He) return
|
110
|
+
if (He) return ie;
|
111
111
|
He = 1;
|
112
112
|
var e = _t(), t = Gt(), n = Dt(), a = "[object Null]", o = "[object Undefined]", s = e ? e.toStringTag : void 0;
|
113
113
|
function c(u) {
|
114
114
|
return u == null ? u === void 0 ? o : a : s && s in Object(u) ? t(u) : n(u);
|
115
115
|
}
|
116
|
-
return
|
116
|
+
return ie = c, ie;
|
117
117
|
}
|
118
|
-
var
|
118
|
+
var se, $e;
|
119
119
|
function zt() {
|
120
|
-
if ($e) return
|
120
|
+
if ($e) return se;
|
121
121
|
$e = 1;
|
122
122
|
function e(t) {
|
123
123
|
return t != null && typeof t == "object";
|
124
124
|
}
|
125
|
-
return
|
125
|
+
return se = e, se;
|
126
126
|
}
|
127
|
-
var
|
127
|
+
var ce, Ge;
|
128
128
|
function Kt() {
|
129
|
-
if (Ge) return
|
129
|
+
if (Ge) return ce;
|
130
130
|
Ge = 1;
|
131
131
|
var e = Ft(), t = zt(), n = "[object Symbol]";
|
132
132
|
function a(o) {
|
133
133
|
return typeof o == "symbol" || t(o) && e(o) == n;
|
134
134
|
}
|
135
|
-
return
|
135
|
+
return ce = a, ce;
|
136
136
|
}
|
137
|
-
var
|
137
|
+
var le, De;
|
138
138
|
function Jt() {
|
139
|
-
if (De) return
|
139
|
+
if (De) return le;
|
140
140
|
De = 1;
|
141
|
-
var e = $t(), t =
|
141
|
+
var e = $t(), t = ve(), n = Kt(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, c = /^0o[0-7]+$/i, u = parseInt;
|
142
142
|
function d(l) {
|
143
143
|
if (typeof l == "number")
|
144
144
|
return l;
|
@@ -154,13 +154,13 @@ function Jt() {
|
|
154
154
|
var b = s.test(l);
|
155
155
|
return b || c.test(l) ? u(l.slice(2), b ? 2 : 8) : o.test(l) ? a : +l;
|
156
156
|
}
|
157
|
-
return
|
157
|
+
return le = d, le;
|
158
158
|
}
|
159
|
-
var
|
159
|
+
var ue, Fe;
|
160
160
|
function bt() {
|
161
|
-
if (Fe) return
|
161
|
+
if (Fe) return ue;
|
162
162
|
Fe = 1;
|
163
|
-
var e =
|
163
|
+
var e = ve(), t = Bt(), n = Jt(), a = "Expected a function", o = Math.max, s = Math.min;
|
164
164
|
function c(u, d, l) {
|
165
165
|
var m, b, y, I, _, T, S = 0, w = !1, g = !1, j = !0;
|
166
166
|
if (typeof u != "function")
|
@@ -196,7 +196,7 @@ function bt() {
|
|
196
196
|
function Pt() {
|
197
197
|
return _ === void 0 ? I : Pe(t());
|
198
198
|
}
|
199
|
-
function
|
199
|
+
function Y() {
|
200
200
|
var f = t(), P = je(f);
|
201
201
|
if (m = arguments, b = this, T = f, P) {
|
202
202
|
if (_ === void 0)
|
@@ -206,17 +206,17 @@ function bt() {
|
|
206
206
|
}
|
207
207
|
return _ === void 0 && (_ = setTimeout(G, d)), I;
|
208
208
|
}
|
209
|
-
return
|
209
|
+
return Y.cancel = jt, Y.flush = Pt, Y;
|
210
210
|
}
|
211
|
-
return
|
211
|
+
return ue = c, ue;
|
212
212
|
}
|
213
213
|
var Wt = bt();
|
214
214
|
const Qt = /* @__PURE__ */ mt(Wt);
|
215
|
-
var
|
215
|
+
var de, ze;
|
216
216
|
function Yt() {
|
217
|
-
if (ze) return
|
217
|
+
if (ze) return de;
|
218
218
|
ze = 1;
|
219
|
-
var e = bt(), t =
|
219
|
+
var e = bt(), t = ve(), n = "Expected a function";
|
220
220
|
function a(o, s, c) {
|
221
221
|
var u = !0, d = !0;
|
222
222
|
if (typeof o != "function")
|
@@ -227,7 +227,7 @@ function Yt() {
|
|
227
227
|
trailing: d
|
228
228
|
});
|
229
229
|
}
|
230
|
-
return
|
230
|
+
return de = a, de;
|
231
231
|
}
|
232
232
|
var Vt = Yt();
|
233
233
|
const Zt = /* @__PURE__ */ mt(Vt), Xt = (e, t, n, a) => {
|
@@ -278,7 +278,7 @@ const Zt = /* @__PURE__ */ mt(Vt), Xt = (e, t, n, a) => {
|
|
278
278
|
height: e.contentRect.height
|
279
279
|
};
|
280
280
|
function rn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refreshOptions: a, handleWidth: o = !0, handleHeight: s = !0, targetRef: c, observerOptions: u, onResize: d } = {}) {
|
281
|
-
const l = ot(e), m = en(d), [b, y] =
|
281
|
+
const l = ot(e), m = en(d), [b, y] = be({
|
282
282
|
width: void 0,
|
283
283
|
height: void 0
|
284
284
|
}), { refProxy: I, refElement: _ } = tn(c), { box: T } = u || {}, S = Re((g) => {
|
@@ -338,7 +338,7 @@ const an = "_headerContainer_1cubo_1", on = "_navigationTabList_1cubo_8", sn = "
|
|
338
338
|
const { ref: n, height: a } = rn({
|
339
339
|
refreshMode: "debounce",
|
340
340
|
refreshRate: 0
|
341
|
-
}), [o, s] =
|
341
|
+
}), [o, s] = be(!1), c = () => o ? !e : !0;
|
342
342
|
U(() => {
|
343
343
|
const d = () => {
|
344
344
|
s(window.scrollY > 0);
|
@@ -370,7 +370,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
370
370
|
}, bn = ({ src: e, href: t = "/", ariaLabel: n = "Home", alt: a = "Lokalise" }) => /* @__PURE__ */ i("a", { className: _n.logoLink, href: t, "aria-label": n, children: /* @__PURE__ */ i("img", { src: e, alt: a }) }), gn = "_link_1weq1_1", hn = "_active_1weq1_18", Ke = {
|
371
371
|
link: gn,
|
372
372
|
active: hn
|
373
|
-
}, pn = ({ label: e, to: t, icon: n }) => /* @__PURE__ */ i(
|
373
|
+
}, pn = ({ label: e, to: t, icon: n }) => /* @__PURE__ */ i(ge, { placement: "right", tooltip: e, children: /* @__PURE__ */ i(
|
374
374
|
st,
|
375
375
|
{
|
376
376
|
className: R(Ke.link, {
|
@@ -383,9 +383,9 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
383
383
|
dropdownButton: vn,
|
384
384
|
dropdownButtonActive: Tn
|
385
385
|
}, yn = ({ children: e, icon: t }) => /* @__PURE__ */ i(
|
386
|
-
|
386
|
+
he,
|
387
387
|
{
|
388
|
-
menuButton: ({ opened: n }) => /* @__PURE__ */ i(
|
388
|
+
menuButton: ({ opened: n }) => /* @__PURE__ */ i(ge, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ i(
|
389
389
|
"button",
|
390
390
|
{
|
391
391
|
type: "button",
|
@@ -395,7 +395,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
395
395
|
children: /* @__PURE__ */ i(t, { size: "25px" })
|
396
396
|
}
|
397
397
|
) }),
|
398
|
-
children: /* @__PURE__ */ i(
|
398
|
+
children: /* @__PURE__ */ i(pe, { placement: "right-start", children: e })
|
399
399
|
}
|
400
400
|
), Sn = "_iconContainer_nz34m_1", wn = {
|
401
401
|
iconContainer: Sn
|
@@ -433,7 +433,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
433
433
|
isFullyAuthenticated: m
|
434
434
|
} = H();
|
435
435
|
return /* @__PURE__ */ i(
|
436
|
-
|
436
|
+
he,
|
437
437
|
{
|
438
438
|
menuButton: () => /* @__PURE__ */ p("button", { className: C.profileButton, "aria-label": "Profile menu", type: "button", children: [
|
439
439
|
t != null && t.logoUrl ? /* @__PURE__ */ i(
|
@@ -456,7 +456,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
456
456
|
),
|
457
457
|
a && /* @__PURE__ */ i(ht, { className: C.profileImageUpgradeIcon })
|
458
458
|
] }),
|
459
|
-
children: /* @__PURE__ */ i(
|
459
|
+
children: /* @__PURE__ */ i(pe, { placement: "right-end", className: C.menuContainer, children: e({
|
460
460
|
allowTeamCreation: s,
|
461
461
|
otherTeams: n,
|
462
462
|
canAccessTeamSettings: u,
|
@@ -468,7 +468,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
468
468
|
}) })
|
469
469
|
}
|
470
470
|
);
|
471
|
-
}, vt = 0, kn = 9999, An = [150, 151, 250, 251], Ln = [152, 153, 252, 253], On = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], qn = [156, 159, 160, 256, 259, 260], Tt = 9998,
|
471
|
+
}, vt = 0, kn = 9999, An = [150, 151, 250, 251], Ln = [152, 153, 252, 253], On = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], qn = [156, 159, 160, 256, 259, 260], Tt = 9998, Te = (e) => e === vt, yt = (e) => e === kn, la = (e) => An.includes(e), ua = (e) => Ln.includes(e), da = (e) => On.includes(e), ma = (e) => qn.includes(e), fa = (e) => e > vt && e < Tt, _a = (e) => e === Tt, Mn = /\n/, We = (e, t, n) => e.split(t).flatMap((a, o) => o !== 0 ? [At(n, { key: Math.random().toString(32).slice(0, 10) }), a] : a), Un = (e, t, n) => typeof e == "string" ? We(e, t, n) : e.flatMap((a) => typeof a == "string" ? We(a, t, n) : a), ba = (e) => Un(e, Mn, /* @__PURE__ */ i("br", {})), xn = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, Bn = (e) => e.match(xn) ?? [], Qe = (e, t, n) => {
|
472
472
|
const a = e.split(t);
|
473
473
|
if (a.length === 1)
|
474
474
|
return e;
|
@@ -488,7 +488,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
488
488
|
Ve.biller,
|
489
489
|
Ve.owner
|
490
490
|
], Hn = ({ children: e, config: t }) => {
|
491
|
-
const { teams: n, currentTeamId: a, planId: o, isEndOfTrialActive: s, isFullyAuthenticated: c, userTeamRole: u } = t, d = n.find((w) => w.id === a), l = n.filter((w) => w.id !== a), m = Ze.includes(u), b = Ze.includes(u), y =
|
491
|
+
const { teams: n, currentTeamId: a, planId: o, isEndOfTrialActive: s, isFullyAuthenticated: c, userTeamRole: u } = t, d = n.find((w) => w.id === a), l = n.filter((w) => w.id !== a), m = Ze.includes(u), b = Ze.includes(u), y = Te(o) || yt(o), S = {
|
492
492
|
...t,
|
493
493
|
currentTeam: d,
|
494
494
|
otherTeams: l,
|
@@ -512,7 +512,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
512
512
|
const { isEndOfTrialActive: o, isTeamSuspended: s } = H();
|
513
513
|
return o || s ? null : /* @__PURE__ */ p(at, { children: [
|
514
514
|
/* @__PURE__ */ i(
|
515
|
-
|
515
|
+
J,
|
516
516
|
{
|
517
517
|
href: e,
|
518
518
|
onClick: () => {
|
@@ -537,9 +537,9 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
537
537
|
const { currentTeam: a, planId: o } = H(), s = e || a;
|
538
538
|
if (!s)
|
539
539
|
return null;
|
540
|
-
const c =
|
540
|
+
const c = Te(o) ? "Free" : yt(o) ? "Trial" : void 0;
|
541
541
|
return /* @__PURE__ */ p(
|
542
|
-
t ?
|
542
|
+
t ? J : "div",
|
543
543
|
{
|
544
544
|
className: `flex-row gap-2 flex-nowrap items-center ${k.wrapper}`,
|
545
545
|
...t && { onClick: () => t(s) },
|
@@ -560,7 +560,7 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
560
560
|
}, Xn = ({ onSwitchTeam: e }) => {
|
561
561
|
const { otherTeams: t } = H();
|
562
562
|
return t.length === 0 ? null : /* @__PURE__ */ i("div", { className: `flex-col items-stretch ${Zn.teamsContainer}`, children: t.map((n) => /* @__PURE__ */ i(St, { team: n, onClick: e, hidePlanLabel: !0 }, n.id)) });
|
563
|
-
}, er = "_container_1u995_1", tr = "_planCta_1u995_15", nr = "_upgradeIconWrapper_1u995_19",
|
563
|
+
}, er = "_container_1u995_1", tr = "_planCta_1u995_15", nr = "_upgradeIconWrapper_1u995_19", me = {
|
564
564
|
container: er,
|
565
565
|
planCta: tr,
|
566
566
|
upgradeIconWrapper: nr
|
@@ -568,10 +568,10 @@ const dn = "_sidebarContainer_bmdti_1", mn = {
|
|
568
568
|
const { planId: t, trialDaysLeft: n, showUpgradeCta: a } = H();
|
569
569
|
if (!a)
|
570
570
|
return null;
|
571
|
-
const c =
|
572
|
-
return /* @__PURE__ */ p(
|
573
|
-
/* @__PURE__ */ i("span", { className:
|
574
|
-
/* @__PURE__ */ p("div", { className: `flex-row items-center gap-1 ${
|
571
|
+
const c = Te(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${n} ${n === 1 ? "day" : "days"}`;
|
572
|
+
return /* @__PURE__ */ p(J, { href: e, className: `flex-col gap-1 items-start ${me.container}`, children: [
|
573
|
+
/* @__PURE__ */ i("span", { className: me.planCta, children: c }),
|
574
|
+
/* @__PURE__ */ p("div", { className: `flex-row items-center gap-1 ${me.upgradeIconWrapper}`, children: [
|
575
575
|
/* @__PURE__ */ i(ht, {}),
|
576
576
|
/* @__PURE__ */ i("span", { children: "See upgrade options" })
|
577
577
|
] })
|
@@ -596,7 +596,7 @@ const ir = "_breadcrumbsItem_1hm6a_1", sr = "_breadcrumbs_1hm6a_1", et = {
|
|
596
596
|
n < e.length - 1 && /* @__PURE__ */ i("span", { children: " — " })
|
597
597
|
] }, `${t.link}-${t.name}`)) }), cr = ({ items: e }) => /* @__PURE__ */ i(at, { children: e.map((t, n) => /* @__PURE__ */ p(it, { children: [
|
598
598
|
!!n && t.some((a) => a.visible) && /* @__PURE__ */ i(lt, {}),
|
599
|
-
t.filter(({ visible: a }) => a).map(({ link: a, label: o, onClick: s }) => /* @__PURE__ */ i(
|
599
|
+
t.filter(({ visible: a }) => a).map(({ link: a, label: o, onClick: s }) => /* @__PURE__ */ i(J, { href: a || "#", "aria-label": o, onClick: s, children: o }, o))
|
600
600
|
] }, t[0].label)) }), lr = "_badge_1pc1v_1", ur = "_tag_1pc1v_15", dr = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", mr = "_disabled_1pc1v_57", fr = "_projectNavigationItem_1pc1v_61", _r = "_projectNavigationItemDisabled_1pc1v_67", N = {
|
601
601
|
badge: lr,
|
602
602
|
tag: ur,
|
@@ -610,8 +610,8 @@ const ir = "_breadcrumbsItem_1hm6a_1", sr = "_breadcrumbs_1hm6a_1", et = {
|
|
610
610
|
!!t && /* @__PURE__ */ i("div", { className: N.badge, "aria-label": `${t} items requiring attention`, children: t > 9 ? "9+" : t })
|
611
611
|
] }),
|
612
612
|
!!n && /* @__PURE__ */ i(qt, { className: N.tag, children: n })
|
613
|
-
] }),
|
614
|
-
({ label: e, href: t = "", disabled: n = !1, badge: a, onClick: o, novel: s }, c) => /* @__PURE__ */ i(
|
613
|
+
] }), fe = Lt(
|
614
|
+
({ label: e, href: t = "", disabled: n = !1, badge: a, onClick: o, novel: s }, c) => /* @__PURE__ */ i(ge, { tooltip: "You do not have access to this function", show: n, children: /* @__PURE__ */ i(
|
615
615
|
"div",
|
616
616
|
{
|
617
617
|
className: n ? N.projectNavigationItemDisabled : N.projectNavigationItem,
|
@@ -631,7 +631,7 @@ const ir = "_breadcrumbsItem_1hm6a_1", sr = "_breadcrumbs_1hm6a_1", et = {
|
|
631
631
|
}
|
632
632
|
) })
|
633
633
|
);
|
634
|
-
|
634
|
+
fe.displayName = "NavigationTabsItem";
|
635
635
|
const br = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible))) ?? !1, gr = (e) => e.visible && (!e.dropdown || br(e.dropdown)), ya = ({ navigation: e, activeItem: t }) => /* @__PURE__ */ i("nav", { "aria-label": "Project", children: /* @__PURE__ */ i("ul", { className: A.navigationTabList, "aria-orientation": "horizontal", children: e.filter(gr).map((n) => {
|
636
636
|
var a, o, s;
|
637
637
|
return n.dropdown ? /* @__PURE__ */ i(
|
@@ -641,10 +641,10 @@ const br = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
641
641
|
"data-testid": n.key,
|
642
642
|
"aria-selected": (a = n.isActive) == null ? void 0 : a.call(n, t),
|
643
643
|
children: /* @__PURE__ */ i(
|
644
|
-
|
644
|
+
he,
|
645
645
|
{
|
646
|
-
menuButton: ({ opened: c }) => /* @__PURE__ */ i(
|
647
|
-
children: /* @__PURE__ */ i(
|
646
|
+
menuButton: ({ opened: c }) => /* @__PURE__ */ i(fe, { label: n.label, disabled: n.disabled, active: c }),
|
647
|
+
children: /* @__PURE__ */ i(pe, { children: /* @__PURE__ */ i(cr, { items: n.dropdown }) })
|
648
648
|
}
|
649
649
|
)
|
650
650
|
},
|
@@ -656,7 +656,7 @@ const br = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
656
656
|
"data-testid": n.key,
|
657
657
|
"aria-selected": (o = n.isActive) == null ? void 0 : o.call(n, t),
|
658
658
|
children: /* @__PURE__ */ i(
|
659
|
-
|
659
|
+
fe,
|
660
660
|
{
|
661
661
|
label: n.label,
|
662
662
|
href: n.link,
|
@@ -676,7 +676,7 @@ const br = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
676
676
|
}), pr = r.union([
|
677
677
|
r.object({ Authorization: r.string().startsWith("Bearer ") }),
|
678
678
|
r.object({ "x-csrf-token": r.string() })
|
679
|
-
]),
|
679
|
+
]), ye = dt({
|
680
680
|
description: "Takes a teamId and returns a JWT token access and refresh token for the user",
|
681
681
|
method: "post",
|
682
682
|
requestPathParamsSchema: r.object({ teamId: r.number() }),
|
@@ -689,7 +689,7 @@ const br = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
689
689
|
teamKeyJwt: (e, t) => ["getUserToken", "Authorization", `Bearer ${t}`, e]
|
690
690
|
}, Tr = (e, t) => O({
|
691
691
|
...t,
|
692
|
-
queryFn: ({ queryKey: [n, a, o, s] }) =>
|
692
|
+
queryFn: ({ queryKey: [n, a, o, s] }) => W(e, ye, {
|
693
693
|
pathParams: { teamId: s },
|
694
694
|
headers: a === "x-csrf-token" ? { "x-csrf-token": o } : { Authorization: o }
|
695
695
|
})
|
@@ -712,7 +712,7 @@ const br = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
712
712
|
isFullyAuthenticated: r.boolean(),
|
713
713
|
exp: r.number()
|
714
714
|
});
|
715
|
-
function
|
715
|
+
function Q(e) {
|
716
716
|
try {
|
717
717
|
const t = e.split(".")[1], n = atob(t);
|
718
718
|
return yr.parse(JSON.parse(n));
|
@@ -720,24 +720,24 @@ function Y(e) {
|
|
720
720
|
return;
|
721
721
|
}
|
722
722
|
}
|
723
|
-
const
|
723
|
+
const K = class K extends CustomEvent {
|
724
724
|
constructor(t) {
|
725
|
-
super(
|
726
|
-
detail: { token: t, payload:
|
725
|
+
super(K.eventName, {
|
726
|
+
detail: { token: t, payload: Q(t.accessToken) }
|
727
727
|
});
|
728
728
|
}
|
729
729
|
};
|
730
|
-
Ne(
|
731
|
-
let L =
|
732
|
-
function
|
733
|
-
const e =
|
730
|
+
Ne(K, "eventName", "new-jwt-issued");
|
731
|
+
let L = K;
|
732
|
+
function Se() {
|
733
|
+
const e = _e(document.cookie, "accessToken"), t = _e(document.cookie, "refreshToken");
|
734
734
|
if (!(!e || !t))
|
735
735
|
return { accessToken: e, refreshToken: t };
|
736
736
|
}
|
737
737
|
function Et() {
|
738
|
-
return
|
738
|
+
return _e(document.cookie, "csrf_token");
|
739
739
|
}
|
740
|
-
function
|
740
|
+
function _e(e, t) {
|
741
741
|
var n, a;
|
742
742
|
return (a = (n = e.split(";").find((o) => o.trim().startsWith(`${t}=`))) == null ? void 0 : n.trim()) == null ? void 0 : a.substring(t.length + 1);
|
743
743
|
}
|
@@ -751,12 +751,12 @@ function Sa(e, t) {
|
|
751
751
|
}, [a.data]), a;
|
752
752
|
}
|
753
753
|
function It() {
|
754
|
-
const [e, t] =
|
754
|
+
const [e, t] = be();
|
755
755
|
return U(() => {
|
756
756
|
const n = (o) => {
|
757
757
|
t(o.detail.payload);
|
758
|
-
}, a =
|
759
|
-
return t(a &&
|
758
|
+
}, a = Se();
|
759
|
+
return t(a && Q(a.accessToken)), window.addEventListener(L.eventName, n), () => {
|
760
760
|
window.removeEventListener(L.eventName, n);
|
761
761
|
};
|
762
762
|
}, []), e;
|
@@ -828,10 +828,10 @@ function Ea(e, t) {
|
|
828
828
|
});
|
829
829
|
}
|
830
830
|
function Ia() {
|
831
|
-
const e =
|
831
|
+
const e = Se();
|
832
832
|
if (!e)
|
833
833
|
return;
|
834
|
-
const t =
|
834
|
+
const t = Q(e.accessToken);
|
835
835
|
if (t)
|
836
836
|
return { ...e, payload: t };
|
837
837
|
}
|
@@ -859,10 +859,10 @@ function Lr(e, t) {
|
|
859
859
|
headers: { ...o.headers, ...F(s.accessToken) }
|
860
860
|
});
|
861
861
|
if (s && (c.status === 401 || c.status === 403)) {
|
862
|
-
const d =
|
862
|
+
const d = Q(s.accessToken);
|
863
863
|
if (!d)
|
864
864
|
return c;
|
865
|
-
const l = await
|
865
|
+
const l = await W(e, ye, {
|
866
866
|
pathParams: { teamId: d.teamId },
|
867
867
|
headers: F(s.refreshToken)
|
868
868
|
});
|
@@ -889,7 +889,7 @@ function qr(e, t) {
|
|
889
889
|
const c = await t.getCsrfToken();
|
890
890
|
if (c === void 0)
|
891
891
|
return n(a, o);
|
892
|
-
const u = await
|
892
|
+
const u = await W(e, ye, {
|
893
893
|
pathParams: { teamId: await t.getTeamId() },
|
894
894
|
headers: { "x-csrf-token": c }
|
895
895
|
});
|
@@ -913,7 +913,7 @@ const Pa = {
|
|
913
913
|
function nt(e) {
|
914
914
|
return {
|
915
915
|
...e,
|
916
|
-
getCachedJwtToken: e.getCachedJwtToken ?? (async () =>
|
916
|
+
getCachedJwtToken: e.getCachedJwtToken ?? (async () => Se()),
|
917
917
|
getCsrfToken: "getCsrfToken" in e ? e.getCsrfToken : async () => Et(),
|
918
918
|
onNewJwtTokenIssued: (t) => {
|
919
919
|
var n;
|
@@ -940,7 +940,7 @@ const Mr = r.object({
|
|
940
940
|
}), Hr = r.object({
|
941
941
|
projectId: r.string(),
|
942
942
|
languages: r.array(Br)
|
943
|
-
}),
|
943
|
+
}), we = r.union([
|
944
944
|
r.literal("localization_files"),
|
945
945
|
r.literal("paged_documents"),
|
946
946
|
r.literal("marketing")
|
@@ -980,10 +980,10 @@ const Mr = r.object({
|
|
980
980
|
qa_issues_total: r.number(),
|
981
981
|
qa_issues: Gr,
|
982
982
|
languages: r.array(Ur)
|
983
|
-
}),
|
983
|
+
}), Ee = r.object({
|
984
984
|
project_id: r.string(),
|
985
985
|
uuid: r.string().uuid(),
|
986
|
-
project_type:
|
986
|
+
project_type: we,
|
987
987
|
name: r.string(),
|
988
988
|
description: r.string(),
|
989
989
|
created_at: r.string(),
|
@@ -993,35 +993,33 @@ const Mr = r.object({
|
|
993
993
|
team_id: r.number(),
|
994
994
|
base_language_id: r.number(),
|
995
995
|
base_language_iso: r.string(),
|
996
|
-
settings: $r,
|
997
|
-
statistics: Dr
|
996
|
+
settings: $r.optional(),
|
997
|
+
statistics: Dr.optional()
|
998
998
|
}), Fr = r.object({
|
999
999
|
name: r.string(),
|
1000
1000
|
team_id: r.string(),
|
1001
1001
|
base_lang_iso: r.string(),
|
1002
1002
|
languages: r.array(Mr),
|
1003
|
-
project_type:
|
1003
|
+
project_type: we,
|
1004
1004
|
is_segmentation_enabled: r.boolean()
|
1005
1005
|
}), rt = r.union([r.literal(0), r.literal(1)]), zr = r.object({
|
1006
|
-
project_type:
|
1006
|
+
project_type: we.optional(),
|
1007
1007
|
filter_team_id: r.number().optional(),
|
1008
1008
|
filter_names: r.string().optional(),
|
1009
1009
|
include_statistics: rt.optional(),
|
1010
1010
|
include_settings: rt.optional(),
|
1011
1011
|
limit: r.number().optional(),
|
1012
1012
|
page: r.number().optional()
|
1013
|
-
}), Kr = r.
|
1014
|
-
|
1015
|
-
|
1016
|
-
)
|
1017
|
-
), Jr = r.object({
|
1013
|
+
}), Kr = r.object({
|
1014
|
+
projects: r.array(Ee)
|
1015
|
+
}), Jr = r.object({
|
1018
1016
|
project_id: r.string()
|
1019
1017
|
}), Ie = () => "/projects", Wr = dt({
|
1020
1018
|
description: "Create a new project",
|
1021
1019
|
method: "post",
|
1022
1020
|
pathResolver: Ie,
|
1023
1021
|
requestBodySchema: Fr,
|
1024
|
-
successResponseBodySchema:
|
1022
|
+
successResponseBodySchema: Ee
|
1025
1023
|
}), Qr = B({
|
1026
1024
|
description: "List all projects",
|
1027
1025
|
pathResolver: Ie,
|
@@ -1031,12 +1029,12 @@ const Mr = r.object({
|
|
1031
1029
|
description: "Retrieve a project",
|
1032
1030
|
pathResolver: Ie,
|
1033
1031
|
requestQuerySchema: Jr,
|
1034
|
-
successResponseBodySchema:
|
1032
|
+
successResponseBodySchema: Ee
|
1035
1033
|
});
|
1036
1034
|
function Ca(e, t = {}) {
|
1037
1035
|
return Ut({
|
1038
1036
|
...t,
|
1039
|
-
mutationFn: (n) =>
|
1037
|
+
mutationFn: (n) => W(e, Wr, {
|
1040
1038
|
body: n
|
1041
1039
|
})
|
1042
1040
|
});
|
@@ -1100,12 +1098,12 @@ export {
|
|
1100
1098
|
Ia as getAuthenticatedSessionDetailFromRequest,
|
1101
1099
|
Er as getTeamUser,
|
1102
1100
|
Ir as getTeamUsersQueryKey,
|
1103
|
-
|
1101
|
+
ye as getUserToken,
|
1104
1102
|
vr as getUserTokenKey,
|
1105
1103
|
_a as isEnterpriseOpenSourcePlan,
|
1106
1104
|
ma as isEnterprisePlan,
|
1107
1105
|
ua as isEssentialPlan,
|
1108
|
-
|
1106
|
+
Te as isFreePlan,
|
1109
1107
|
fa as isPaidPlan,
|
1110
1108
|
da as isProPlan,
|
1111
1109
|
la as isStartPlan,
|
@@ -1114,7 +1112,7 @@ export {
|
|
1114
1112
|
Qr as listProjects,
|
1115
1113
|
ka as listProjectsKey,
|
1116
1114
|
ga as makeUrlClickable,
|
1117
|
-
|
1115
|
+
Q as parseJwtTokenPayload,
|
1118
1116
|
ja as publicApiHeadersMiddleware,
|
1119
1117
|
Rr as retrieveContributor,
|
1120
1118
|
kr as retrieveContributorKeys,
|
@@ -20,7 +20,7 @@ export declare function useCreateProjectMutation<T>(wretchClient: Wretch<T>, ove
|
|
20
20
|
created_by_email: string;
|
21
21
|
base_language_id: number;
|
22
22
|
base_language_iso: string;
|
23
|
-
settings
|
23
|
+
settings?: {
|
24
24
|
per_platform_key_names: boolean;
|
25
25
|
reviewing: boolean;
|
26
26
|
auto_toggle_unverified: boolean;
|
@@ -31,8 +31,8 @@ export declare function useCreateProjectMutation<T>(wretchClient: Wretch<T>, ove
|
|
31
31
|
custom_translation_statuses_allow_multiple: boolean;
|
32
32
|
segmentation: boolean;
|
33
33
|
contributor_preview_download_enabled: boolean;
|
34
|
-
};
|
35
|
-
statistics
|
34
|
+
} | undefined;
|
35
|
+
statistics?: {
|
36
36
|
team: number;
|
37
37
|
languages: {
|
38
38
|
progress: number;
|
@@ -62,7 +62,7 @@ export declare function useCreateProjectMutation<T>(wretchClient: Wretch<T>, ove
|
|
62
62
|
special_placeholder: number;
|
63
63
|
unbalanced_brackets: number;
|
64
64
|
};
|
65
|
-
};
|
65
|
+
} | undefined;
|
66
66
|
}, undefined, {
|
67
67
|
name: string;
|
68
68
|
team_id: string;
|