@lokalise/harmony 1.18.0 → 1.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/harmony.cjs +1 -1
- package/dist/harmony.mjs +493 -471
- package/dist/types/src/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/types/src/components/Sidebar/Sidebar.test.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/Avatar/Avatar.d.ts +1 -1
- package/dist/types/src/components/Sidebar/Widgets/Tasks/TaskOverview/TaskOverview.d.ts +1 -1
- package/dist/types/src/components/Sidebar/Widgets/Tasks/types.d.ts +1 -1
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/content.test.d.ts +1 -0
- package/dist/types/src/components/Sidebar/Widgets/Tasks/utils/taskEvents.test.d.ts +1 -0
- package/dist/types/src/features/auth/core/headers/createHeaderBuilderMiddleware.d.ts +3 -3
- package/dist/types/src/features/auth/core/headers/headerBuilder.d.ts +13 -13
- package/dist/types/src/features/auth/core/middleware/jwtAuthHeaderBuilderMiddleware.d.ts +1 -1
- package/dist/types/src/features/publicApi/contributors.d.ts +0 -6
- package/dist/types/src/features/publicApi/languages.d.ts +0 -12
- package/dist/types/src/features/publicApi/projects.d.ts +0 -24
- package/dist/types/src/features/publicApi/teamUsers.d.ts +0 -6
- package/dist/types/src/features/publicApi/types/contributorTypes.d.ts +0 -6
- package/dist/types/src/features/publicApi/types/projectTypes.d.ts +0 -6
- package/dist/types/src/features/publicApi/types/sharedTypes.d.ts +0 -18
- package/dist/types/src/features/publicApi/types/teamUserTypes.d.ts +0 -6
- package/dist/types/src/features/publicApi/types/userTokenTypes.d.ts +0 -6
- package/dist/types/src/features/publicApi/userToken.d.ts +0 -6
- package/dist/types/tests/mocks/sidebar/tasks.d.ts +3 -1
- package/package.json +1 -1
package/dist/harmony.mjs
CHANGED
@@ -3,8 +3,8 @@ var Zt = (e, t, n) => t in e ? Vt(e, t, { enumerable: !0, configurable: !0, writ
|
|
3
3
|
var ne = (e, t, n) => Zt(e, typeof t != "symbol" ? t + "" : t, n);
|
4
4
|
import { jsx as s, jsxs as h, Fragment as Ue } from "react/jsx-runtime";
|
5
5
|
import * as G from "react";
|
6
|
-
import { useRef as wt, useState as R, useCallback as We, useEffect as
|
7
|
-
import { Tooltip as q, Link as L, Menu as ce, MenuList as le, CaretUpIcon as nn, UserIcon as
|
6
|
+
import { useRef as wt, useState as R, useCallback as We, useEffect as z, useContext as Ct, createContext as kt, cloneElement as en, Fragment as Pt, forwardRef as tn } from "react";
|
7
|
+
import { Tooltip as q, Link as L, Menu as ce, MenuList as le, CaretUpIcon as nn, UserIcon as It, MenuItem as J, MenuDivider as At, ConfirmModal as rn, Alert as an, Tag as je, Button as xe, Loading as on, Popover as sn, JobIcon as cn } from "@lokalise/louis";
|
8
8
|
import { format as Rt, parseISO as ln, isThisSecond as dn } from "date-fns";
|
9
9
|
import { toZonedTime as un } from "date-fns-tz";
|
10
10
|
import { z as r } from "zod";
|
@@ -17,7 +17,7 @@ const Oe = {
|
|
17
17
|
InProgress: "in_progress",
|
18
18
|
Created: "created",
|
19
19
|
Queued: "queued"
|
20
|
-
},
|
20
|
+
}, P = {
|
21
21
|
...Oe,
|
22
22
|
NotStarted: "not_started"
|
23
23
|
}, re = {
|
@@ -26,7 +26,7 @@ const Oe = {
|
|
26
26
|
lqa_by_ai: "lqa_by_ai",
|
27
27
|
automatic_translation: "automatic_translation"
|
28
28
|
};
|
29
|
-
var
|
29
|
+
var ae = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
30
30
|
function Nt(e) {
|
31
31
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
32
32
|
}
|
@@ -44,7 +44,7 @@ var ge, Xe;
|
|
44
44
|
function fn() {
|
45
45
|
if (Xe) return ge;
|
46
46
|
Xe = 1;
|
47
|
-
var e = typeof
|
47
|
+
var e = typeof ae == "object" && ae && ae.Object === Object && ae;
|
48
48
|
return ge = e, ge;
|
49
49
|
}
|
50
50
|
var he, Ye;
|
@@ -69,9 +69,9 @@ function gn() {
|
|
69
69
|
Ze = 1;
|
70
70
|
var e = /\s/;
|
71
71
|
function t(n) {
|
72
|
-
for (var
|
72
|
+
for (var a = n.length; a-- && e.test(n.charAt(a)); )
|
73
73
|
;
|
74
|
-
return
|
74
|
+
return a;
|
75
75
|
}
|
76
76
|
return be = t, be;
|
77
77
|
}
|
@@ -80,8 +80,8 @@ function hn() {
|
|
80
80
|
if (et) return ve;
|
81
81
|
et = 1;
|
82
82
|
var e = gn(), t = /^\s+/;
|
83
|
-
function n(
|
84
|
-
return
|
83
|
+
function n(a) {
|
84
|
+
return a && a.slice(0, e(a) + 1).replace(t, "");
|
85
85
|
}
|
86
86
|
return ve = n, ve;
|
87
87
|
}
|
@@ -96,16 +96,16 @@ var ye, nt;
|
|
96
96
|
function pn() {
|
97
97
|
if (nt) return ye;
|
98
98
|
nt = 1;
|
99
|
-
var e = xt(), t = Object.prototype, n = t.hasOwnProperty,
|
99
|
+
var e = xt(), t = Object.prototype, n = t.hasOwnProperty, a = t.toString, o = e ? e.toStringTag : void 0;
|
100
100
|
function i(c) {
|
101
|
-
var d = n.call(c,
|
101
|
+
var d = n.call(c, o), u = c[o];
|
102
102
|
try {
|
103
|
-
c[
|
103
|
+
c[o] = void 0;
|
104
104
|
var l = !0;
|
105
105
|
} catch {
|
106
106
|
}
|
107
|
-
var m =
|
108
|
-
return l && (d ? c[
|
107
|
+
var m = a.call(c);
|
108
|
+
return l && (d ? c[o] = u : delete c[o]), m;
|
109
109
|
}
|
110
110
|
return ye = i, ye;
|
111
111
|
}
|
@@ -114,25 +114,25 @@ function bn() {
|
|
114
114
|
if (rt) return Se;
|
115
115
|
rt = 1;
|
116
116
|
var e = Object.prototype, t = e.toString;
|
117
|
-
function n(
|
118
|
-
return t.call(
|
117
|
+
function n(a) {
|
118
|
+
return t.call(a);
|
119
119
|
}
|
120
120
|
return Se = n, Se;
|
121
121
|
}
|
122
|
-
var Ee,
|
122
|
+
var Ee, at;
|
123
123
|
function vn() {
|
124
|
-
if (
|
125
|
-
|
126
|
-
var e = xt(), t = pn(), n = bn(),
|
124
|
+
if (at) return Ee;
|
125
|
+
at = 1;
|
126
|
+
var e = xt(), t = pn(), n = bn(), a = "[object Null]", o = "[object Undefined]", i = e ? e.toStringTag : void 0;
|
127
127
|
function c(d) {
|
128
|
-
return d == null ? d === void 0 ?
|
128
|
+
return d == null ? d === void 0 ? o : a : i && i in Object(d) ? t(d) : n(d);
|
129
129
|
}
|
130
130
|
return Ee = c, Ee;
|
131
131
|
}
|
132
|
-
var we,
|
132
|
+
var we, ot;
|
133
133
|
function Tn() {
|
134
|
-
if (
|
135
|
-
|
134
|
+
if (ot) return we;
|
135
|
+
ot = 1;
|
136
136
|
function e(t) {
|
137
137
|
return t != null && typeof t == "object";
|
138
138
|
}
|
@@ -143,21 +143,21 @@ function yn() {
|
|
143
143
|
if (st) return Ce;
|
144
144
|
st = 1;
|
145
145
|
var e = vn(), t = Tn(), n = "[object Symbol]";
|
146
|
-
function o
|
147
|
-
return typeof
|
146
|
+
function a(o) {
|
147
|
+
return typeof o == "symbol" || t(o) && e(o) == n;
|
148
148
|
}
|
149
|
-
return Ce =
|
149
|
+
return Ce = a, Ce;
|
150
150
|
}
|
151
|
-
var
|
151
|
+
var ke, it;
|
152
152
|
function Sn() {
|
153
|
-
if (it) return
|
153
|
+
if (it) return ke;
|
154
154
|
it = 1;
|
155
|
-
var e = hn(), t = Be(), n = yn(),
|
155
|
+
var e = hn(), t = Be(), n = yn(), a = NaN, o = /^[-+]0x[0-9a-f]+$/i, i = /^0b[01]+$/i, c = /^0o[0-7]+$/i, d = parseInt;
|
156
156
|
function u(l) {
|
157
157
|
if (typeof l == "number")
|
158
158
|
return l;
|
159
159
|
if (n(l))
|
160
|
-
return
|
160
|
+
return a;
|
161
161
|
if (t(l)) {
|
162
162
|
var m = typeof l.valueOf == "function" ? l.valueOf() : l;
|
163
163
|
l = t(m) ? m + "" : m;
|
@@ -166,20 +166,20 @@ function Sn() {
|
|
166
166
|
return l === 0 ? l : +l;
|
167
167
|
l = e(l);
|
168
168
|
var _ = i.test(l);
|
169
|
-
return _ || c.test(l) ? d(l.slice(2), _ ? 2 : 8) :
|
169
|
+
return _ || c.test(l) ? d(l.slice(2), _ ? 2 : 8) : o.test(l) ? a : +l;
|
170
170
|
}
|
171
|
-
return
|
171
|
+
return ke = u, ke;
|
172
172
|
}
|
173
|
-
var
|
173
|
+
var Pe, ct;
|
174
174
|
function Ot() {
|
175
|
-
if (ct) return
|
175
|
+
if (ct) return Pe;
|
176
176
|
ct = 1;
|
177
|
-
var e = Be(), t = _n(), n = Sn(),
|
177
|
+
var e = Be(), t = _n(), n = Sn(), a = "Expected a function", o = Math.max, i = Math.min;
|
178
178
|
function c(d, u, l) {
|
179
179
|
var m, _, T, y, f, E, b = 0, g = !1, p = !1, v = !0;
|
180
180
|
if (typeof d != "function")
|
181
|
-
throw new TypeError(
|
182
|
-
u = n(u) || 0, e(l) && (g = !!l.leading, p = "maxWait" in l, T = p ?
|
181
|
+
throw new TypeError(a);
|
182
|
+
u = n(u) || 0, e(l) && (g = !!l.leading, p = "maxWait" in l, T = p ? o(n(l.maxWait) || 0, u) : T, v = "trailing" in l ? !!l.trailing : v);
|
183
183
|
function C(S) {
|
184
184
|
var j = m, $ = _;
|
185
185
|
return m = _ = void 0, b = S, y = d.apply($, j), y;
|
@@ -191,27 +191,27 @@ function Ot() {
|
|
191
191
|
var j = S - E, $ = S - b, Je = u - j;
|
192
192
|
return p ? i(Je, T - $) : Je;
|
193
193
|
}
|
194
|
-
function
|
194
|
+
function Ke(S) {
|
195
195
|
var j = S - E, $ = S - b;
|
196
196
|
return E === void 0 || j >= u || j < 0 || p && $ >= T;
|
197
197
|
}
|
198
198
|
function te() {
|
199
199
|
var S = t();
|
200
|
-
if (
|
201
|
-
return
|
200
|
+
if (Ke(S))
|
201
|
+
return ze(S);
|
202
202
|
f = setTimeout(te, ee(S));
|
203
203
|
}
|
204
|
-
function
|
204
|
+
function ze(S) {
|
205
205
|
return f = void 0, v && m ? C(S) : (m = _ = void 0, y);
|
206
206
|
}
|
207
207
|
function Xt() {
|
208
208
|
f !== void 0 && clearTimeout(f), b = 0, m = E = _ = f = void 0;
|
209
209
|
}
|
210
210
|
function Yt() {
|
211
|
-
return f === void 0 ? y :
|
211
|
+
return f === void 0 ? y : ze(t());
|
212
212
|
}
|
213
213
|
function fe() {
|
214
|
-
var S = t(), j =
|
214
|
+
var S = t(), j = Ke(S);
|
215
215
|
if (m = arguments, _ = this, E = S, j) {
|
216
216
|
if (f === void 0)
|
217
217
|
return w(E);
|
@@ -222,46 +222,46 @@ function Ot() {
|
|
222
222
|
}
|
223
223
|
return fe.cancel = Xt, fe.flush = Yt, fe;
|
224
224
|
}
|
225
|
-
return
|
225
|
+
return Pe = c, Pe;
|
226
226
|
}
|
227
227
|
var En = Ot();
|
228
228
|
const wn = /* @__PURE__ */ Nt(En);
|
229
|
-
var
|
229
|
+
var Ie, lt;
|
230
230
|
function Cn() {
|
231
|
-
if (lt) return
|
231
|
+
if (lt) return Ie;
|
232
232
|
lt = 1;
|
233
233
|
var e = Ot(), t = Be(), n = "Expected a function";
|
234
|
-
function o
|
234
|
+
function a(o, i, c) {
|
235
235
|
var d = !0, u = !0;
|
236
|
-
if (typeof
|
236
|
+
if (typeof o != "function")
|
237
237
|
throw new TypeError(n);
|
238
|
-
return t(c) && (d = "leading" in c ? !!c.leading : d, u = "trailing" in c ? !!c.trailing : u), e(
|
238
|
+
return t(c) && (d = "leading" in c ? !!c.leading : d, u = "trailing" in c ? !!c.trailing : u), e(o, i, {
|
239
239
|
leading: d,
|
240
240
|
maxWait: i,
|
241
241
|
trailing: u
|
242
242
|
});
|
243
243
|
}
|
244
|
-
return
|
244
|
+
return Ie = a, Ie;
|
245
245
|
}
|
246
|
-
var
|
247
|
-
const
|
246
|
+
var kn = Cn();
|
247
|
+
const Pn = /* @__PURE__ */ Nt(kn), In = (e, t, n, a) => {
|
248
248
|
switch (t) {
|
249
249
|
case "debounce":
|
250
|
-
return wn(e, n,
|
250
|
+
return wn(e, n, a);
|
251
251
|
case "throttle":
|
252
|
-
return
|
252
|
+
return Pn(e, n, a);
|
253
253
|
default:
|
254
254
|
return e;
|
255
255
|
}
|
256
|
-
},
|
256
|
+
}, An = (
|
257
257
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
258
258
|
(e) => {
|
259
259
|
const t = G.useRef(e);
|
260
260
|
return G.useEffect(() => {
|
261
261
|
t.current = e;
|
262
262
|
}), G.useMemo(() => (...n) => {
|
263
|
-
var
|
264
|
-
return (
|
263
|
+
var a;
|
264
|
+
return (a = t.current) === null || a === void 0 ? void 0 : a.call(t, ...n);
|
265
265
|
}, []);
|
266
266
|
}
|
267
267
|
), Rn = (
|
@@ -270,14 +270,14 @@ const kn = /* @__PURE__ */ Nt(Pn), An = (e, t, n, o) => {
|
|
270
270
|
const [t, n] = G.useState((e == null ? void 0 : e.current) || null);
|
271
271
|
return e && setTimeout(() => {
|
272
272
|
e.current !== t && n(e.current);
|
273
|
-
}, 0), { refProxy: G.useMemo(() => new Proxy((
|
274
|
-
|
273
|
+
}, 0), { refProxy: G.useMemo(() => new Proxy((o) => {
|
274
|
+
o !== t && n(o);
|
275
275
|
}, {
|
276
|
-
get(
|
277
|
-
return i === "current" ? t :
|
276
|
+
get(o, i) {
|
277
|
+
return i === "current" ? t : o[i];
|
278
278
|
},
|
279
|
-
set(
|
280
|
-
return i === "current" ? n(c) :
|
279
|
+
set(o, i, c) {
|
280
|
+
return i === "current" ? n(c) : o[i] = c, !0;
|
281
281
|
}
|
282
282
|
}), [t]), refElement: t, setRefElement: n };
|
283
283
|
}
|
@@ -291,18 +291,18 @@ const kn = /* @__PURE__ */ Nt(Pn), An = (e, t, n, o) => {
|
|
291
291
|
width: e.contentRect.width,
|
292
292
|
height: e.contentRect.height
|
293
293
|
};
|
294
|
-
function jn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refreshOptions:
|
295
|
-
const l = wt(e), m =
|
294
|
+
function jn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refreshOptions: a, handleWidth: o = !0, handleHeight: i = !0, targetRef: c, observerOptions: d, onResize: u } = {}) {
|
295
|
+
const l = wt(e), m = An(u), [_, T] = R({
|
296
296
|
width: void 0,
|
297
297
|
height: void 0
|
298
298
|
}), { refProxy: y, refElement: f } = Rn(c), { box: E } = d || {}, b = We((p) => {
|
299
|
-
if (!
|
299
|
+
if (!o && !i)
|
300
300
|
return;
|
301
301
|
if (l.current) {
|
302
302
|
l.current = !1;
|
303
303
|
return;
|
304
304
|
}
|
305
|
-
const v = (C, w) =>
|
305
|
+
const v = (C, w) => o && C.width !== w.width || i && C.height !== w.height;
|
306
306
|
p.forEach((C) => {
|
307
307
|
const w = Nn(C, E);
|
308
308
|
T((ee) => v(ee, w) ? (m == null || m({
|
@@ -311,13 +311,13 @@ function jn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refresh
|
|
311
311
|
entry: C
|
312
312
|
}), w) : ee);
|
313
313
|
});
|
314
|
-
}, [
|
314
|
+
}, [o, i, l, E]), g = We(In(b, t, n, a), [
|
315
315
|
b,
|
316
316
|
t,
|
317
317
|
n,
|
318
|
-
|
318
|
+
a
|
319
319
|
]);
|
320
|
-
return
|
320
|
+
return z(() => {
|
321
321
|
let p;
|
322
322
|
return f ? (p = new window.ResizeObserver(g), p.observe(f, d)) : (_.width || _.height) && (m == null || m({
|
323
323
|
width: null,
|
@@ -330,17 +330,17 @@ function jn({ skipOnMount: e = !1, refreshMode: t, refreshRate: n = 1e3, refresh
|
|
330
330
|
}, [g, f]), Object.assign({ ref: y }, _);
|
331
331
|
}
|
332
332
|
function Lt(e) {
|
333
|
-
var t, n,
|
334
|
-
if (typeof e == "string" || typeof e == "number")
|
333
|
+
var t, n, a = "";
|
334
|
+
if (typeof e == "string" || typeof e == "number") a += e;
|
335
335
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
336
|
-
var
|
337
|
-
for (t = 0; t <
|
338
|
-
} else for (n in e) e[n] && (
|
339
|
-
return
|
336
|
+
var o = e.length;
|
337
|
+
for (t = 0; t < o; t++) e[t] && (n = Lt(e[t])) && (a && (a += " "), a += n);
|
338
|
+
} else for (n in e) e[n] && (a && (a += " "), a += n);
|
339
|
+
return a;
|
340
340
|
}
|
341
341
|
function N() {
|
342
|
-
for (var e, t, n = 0,
|
343
|
-
return
|
342
|
+
for (var e, t, n = 0, a = "", o = arguments.length; n < o; n++) (e = arguments[n]) && (t = Lt(e)) && (a && (a += " "), a += t);
|
343
|
+
return a;
|
344
344
|
}
|
345
345
|
const xn = "_headerContainer_1cubo_1", On = "_navigationTabList_1cubo_8", Ln = "_navigationTab_1cubo_8", Mn = "_headerContent_1cubo_34", Un = "_staticEnabled_1cubo_50", H = {
|
346
346
|
headerContainer: xn,
|
@@ -348,18 +348,18 @@ const xn = "_headerContainer_1cubo_1", On = "_navigationTabList_1cubo_8", Ln = "
|
|
348
348
|
navigationTab: Ln,
|
349
349
|
headerContent: Mn,
|
350
350
|
staticEnabled: Un
|
351
|
-
}, Hn = 77,
|
352
|
-
const { ref: n, height:
|
351
|
+
}, Hn = 77, oe = ({ sticky: e, children: t }) => {
|
352
|
+
const { ref: n, height: a } = jn({
|
353
353
|
refreshMode: "debounce",
|
354
354
|
refreshRate: 0
|
355
|
-
}), [
|
356
|
-
|
355
|
+
}), [o, i] = R(!1), c = () => o ? !e : !0;
|
356
|
+
z(() => {
|
357
357
|
const u = () => {
|
358
358
|
i(window.scrollY > 0);
|
359
359
|
};
|
360
360
|
return window.addEventListener("scroll", u), () => window.removeEventListener("scroll", u);
|
361
361
|
}, []);
|
362
|
-
const d = `${
|
362
|
+
const d = `${a || Hn}px`;
|
363
363
|
return /* @__PURE__ */ s("div", { style: { minHeight: d }, children: /* @__PURE__ */ s("div", { children: /* @__PURE__ */ h(
|
364
364
|
"div",
|
365
365
|
{
|
@@ -368,23 +368,28 @@ const xn = "_headerContainer_1cubo_1", On = "_navigationTabList_1cubo_8", Ln = "
|
|
368
368
|
[H.staticEnabled]: c()
|
369
369
|
}),
|
370
370
|
children: [
|
371
|
-
/* @__PURE__ */ s(
|
372
|
-
/* @__PURE__ */ s(
|
371
|
+
/* @__PURE__ */ s(oe.Header, {}),
|
372
|
+
/* @__PURE__ */ s(oe.Tabs, {}),
|
373
373
|
t
|
374
374
|
]
|
375
375
|
}
|
376
376
|
) }) });
|
377
377
|
};
|
378
|
-
|
379
|
-
|
378
|
+
oe.Header = ({ children: e }) => /* @__PURE__ */ s("div", { className: H.headerContainer, children: e });
|
379
|
+
oe.Tabs = ({ children: e }) => /* @__PURE__ */ s("div", { className: "flex justify-between gap-2 nowrap", children: e });
|
380
380
|
const qn = "_sidebarContainer_bmdti_1", Bn = {
|
381
381
|
sidebarContainer: qn
|
382
382
|
}, Dn = "_logoLink_1baxb_1", $n = {
|
383
383
|
logoLink: Dn
|
384
|
-
}, Fn = ({
|
384
|
+
}, Fn = ({
|
385
|
+
src: e,
|
386
|
+
href: t = "/",
|
387
|
+
ariaLabel: n = "Lokalise App Home",
|
388
|
+
alt: a = "Lokalise Logo"
|
389
|
+
}) => /* @__PURE__ */ s("a", { className: $n.logoLink, href: t, "aria-label": n, children: /* @__PURE__ */ s("img", { src: e, alt: a }) }), Gn = "_link_18vhx_1", Kn = "_active_18vhx_18", dt = {
|
385
390
|
link: Gn,
|
386
|
-
active:
|
387
|
-
},
|
391
|
+
active: Kn
|
392
|
+
}, zn = ({ label: e, to: t, icon: n }) => /* @__PURE__ */ s(q, { placement: "right", tooltip: e, children: /* @__PURE__ */ s(
|
388
393
|
L,
|
389
394
|
{
|
390
395
|
className: N(dt.link, {
|
@@ -433,12 +438,12 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
433
438
|
profileImageHighlight: tr,
|
434
439
|
profileImageUpgradeIcon: nr,
|
435
440
|
userIconWrapper: rr
|
436
|
-
}, Ut =
|
441
|
+
}, Ut = kt({}), X = () => Ct(Ut), ar = ({ children: e }) => {
|
437
442
|
const {
|
438
443
|
currentTeam: t,
|
439
444
|
otherTeams: n,
|
440
|
-
showUpgradeCta:
|
441
|
-
showBillingButton:
|
445
|
+
showUpgradeCta: a,
|
446
|
+
showBillingButton: o,
|
442
447
|
allowTeamCreation: i,
|
443
448
|
isProviderAlpha: c,
|
444
449
|
canAccessTeamSettings: d,
|
@@ -455,7 +460,7 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
455
460
|
{
|
456
461
|
src: t.logoUrl,
|
457
462
|
className: N(x.profileImage, {
|
458
|
-
[x.profileImageHighlight]:
|
463
|
+
[x.profileImageHighlight]: a
|
459
464
|
}),
|
460
465
|
alt: "Team Logo"
|
461
466
|
}
|
@@ -463,12 +468,12 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
463
468
|
"div",
|
464
469
|
{
|
465
470
|
className: N(x.userIconWrapper, "flex-row", "align-center", "items-center", {
|
466
|
-
[x.profileImageHighlight]:
|
471
|
+
[x.profileImageHighlight]: a
|
467
472
|
}),
|
468
|
-
children: /* @__PURE__ */ s(
|
473
|
+
children: /* @__PURE__ */ s(It, { size: "25px" })
|
469
474
|
}
|
470
475
|
),
|
471
|
-
|
476
|
+
a && /* @__PURE__ */ s(Mt, { className: x.profileImageUpgradeIcon })
|
472
477
|
] }),
|
473
478
|
children: /* @__PURE__ */ s(le, { placement: "right-end", className: x.menuContainer, children: e({
|
474
479
|
allowTeamCreation: i,
|
@@ -476,25 +481,25 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
476
481
|
canAccessTeamSettings: d,
|
477
482
|
isEndOfTrialActive: u,
|
478
483
|
isTeamSuspended: l,
|
479
|
-
showBillingButton:
|
484
|
+
showBillingButton: o,
|
480
485
|
isProviderAlpha: c,
|
481
486
|
isFullyAuthenticated: m
|
482
487
|
}) })
|
483
488
|
}
|
484
489
|
);
|
485
|
-
}, Ht = 0,
|
486
|
-
const
|
487
|
-
if (
|
490
|
+
}, Ht = 0, or = 9999, sr = [150, 151, 250, 251], ir = [152, 153, 252, 253], cr = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], lr = [156, 159, 160, 256, 259, 260], qt = 9998, De = (e) => e === Ht, Bt = (e) => e === or, Lo = (e) => sr.includes(e), Mo = (e) => ir.includes(e), Uo = (e) => cr.includes(e), Ho = (e) => lr.includes(e), qo = (e) => e > Ht && e < qt, Bo = (e) => e === qt, dr = /\n/, mt = (e, t, n) => e.split(t).flatMap((a, o) => o !== 0 ? [en(n, { key: Math.random().toString(32).slice(0, 10) }), a] : a), ur = (e, t, n) => typeof e == "string" ? mt(e, t, n) : e.flatMap((a) => typeof a == "string" ? mt(a, t, n) : a), mr = (e) => ur(e, dr, /* @__PURE__ */ s("br", {})), fr = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, _r = (e) => e.match(fr) ?? [], ft = (e, t, n) => {
|
491
|
+
const a = e.split(t);
|
492
|
+
if (a.length === 1)
|
488
493
|
return e;
|
489
|
-
const
|
490
|
-
return
|
494
|
+
const o = [];
|
495
|
+
return a[0] !== "" && o.push(a[0]), a.shift(), a[a.length - 1] === "" && a.pop(), o.push(
|
491
496
|
/* @__PURE__ */ s("a", { href: t, target: "_blank", rel: "noreferrer noopener", children: t }, t + n)
|
492
|
-
),
|
497
|
+
), o.push(a.join(t)), o.filter((i) => i !== "");
|
493
498
|
}, _t = (e) => {
|
494
499
|
const t = _r(e);
|
495
|
-
return t != null && t.length ? t.reduce((n,
|
496
|
-
}, gr = (e) => typeof e == "string" ? _t(e) : e.flatMap((t) => typeof t == "string" ? _t(t) : t, e), hr = (e, t = "PP") => Rt(e, t),
|
497
|
-
|
500
|
+
return t != null && t.length ? t.reduce((n, a, o) => typeof n == "string" ? ft(n, a, o) : n.flatMap((i) => typeof i == "string" ? ft(i, a, o) : i), e) : e;
|
501
|
+
}, gr = (e) => typeof e == "string" ? _t(e) : e.flatMap((t) => typeof t == "string" ? _t(t) : t, e), hr = (e, t = "PP") => Rt(e, t), Do = (e, t, n = "PP") => Rt(un(e, t), n), $e = (e) => {
|
502
|
+
z(e, []);
|
498
503
|
}, gt = {
|
499
504
|
biller: "biller",
|
500
505
|
owner: "owner"
|
@@ -502,7 +507,7 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
502
507
|
gt.biller,
|
503
508
|
gt.owner
|
504
509
|
], pr = ({ children: e, config: t }) => {
|
505
|
-
const { teams: n, currentTeamId:
|
510
|
+
const { teams: n, currentTeamId: a, planId: o, isEndOfTrialActive: i, isFullyAuthenticated: c, userTeamRole: d } = t, u = n.find((g) => g.id === a), l = n.filter((g) => g.id !== a), m = ht.includes(d), _ = ht.includes(d), T = De(o) || Bt(o), b = {
|
506
511
|
...t,
|
507
512
|
currentTeam: u,
|
508
513
|
otherTeams: l,
|
@@ -514,17 +519,17 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
514
519
|
allowTeamCreation: c && !i
|
515
520
|
};
|
516
521
|
return /* @__PURE__ */ s(Ut.Provider, { value: b, children: e });
|
517
|
-
}, br = ({ config: e, children: t }) => /* @__PURE__ */ s(pr, { config: e, children: /* @__PURE__ */ s(
|
522
|
+
}, br = ({ config: e, children: t }) => /* @__PURE__ */ s(pr, { config: e, children: /* @__PURE__ */ s(ar, { children: t }) }), vr = "_container_q5pot_1", Tr = "_profileEmail_q5pot_5", pt = {
|
518
523
|
container: vr,
|
519
524
|
profileEmail: Tr
|
520
525
|
}, yr = ({
|
521
526
|
href: e,
|
522
527
|
onClick: t,
|
523
528
|
userEmail: n,
|
524
|
-
hideBottomDivider:
|
529
|
+
hideBottomDivider: a
|
525
530
|
}) => {
|
526
|
-
const { isEndOfTrialActive:
|
527
|
-
return
|
531
|
+
const { isEndOfTrialActive: o, isTeamSuspended: i } = X();
|
532
|
+
return o || i ? null : /* @__PURE__ */ h(Ue, { children: [
|
528
533
|
/* @__PURE__ */ s(
|
529
534
|
J,
|
530
535
|
{
|
@@ -538,27 +543,27 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
538
543
|
] })
|
539
544
|
}
|
540
545
|
),
|
541
|
-
!
|
546
|
+
!a && /* @__PURE__ */ s(At, {})
|
542
547
|
] });
|
543
|
-
}, Sr = "_wrapper_15d85_1", Er = "_profileImage_15d85_14", wr = "_teamName_15d85_22", Cr = "_planLabel_15d85_29",
|
548
|
+
}, Sr = "_wrapper_15d85_1", Er = "_profileImage_15d85_14", wr = "_teamName_15d85_22", Cr = "_planLabel_15d85_29", kr = "_membership_15d85_38", Pr = "_defaultProfileImage_15d85_44", M = {
|
544
549
|
wrapper: Sr,
|
545
550
|
profileImage: Er,
|
546
551
|
teamName: wr,
|
547
552
|
planLabel: Cr,
|
548
|
-
membership:
|
549
|
-
defaultProfileImage:
|
553
|
+
membership: kr,
|
554
|
+
defaultProfileImage: Pr
|
550
555
|
}, Dt = ({ team: e, onClick: t, hidePlanLabel: n }) => {
|
551
|
-
const { currentTeam:
|
556
|
+
const { currentTeam: a, planId: o } = X(), i = e || a;
|
552
557
|
if (!i)
|
553
558
|
return null;
|
554
|
-
const c = De(
|
559
|
+
const c = De(o) ? "Free" : Bt(o) ? "Trial" : void 0;
|
555
560
|
return /* @__PURE__ */ h(
|
556
561
|
t ? J : "div",
|
557
562
|
{
|
558
563
|
className: `flex-row gap-2 flex-nowrap items-center ${M.wrapper}`,
|
559
564
|
...t && { onClick: () => t(i) },
|
560
565
|
children: [
|
561
|
-
i.logoUrl ? /* @__PURE__ */ s("img", { className: M.profileImage, src: i.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ s("span", { className: `flex-row justify-center items-center ${M.defaultProfileImage}`, children: /* @__PURE__ */ s(
|
566
|
+
i.logoUrl ? /* @__PURE__ */ s("img", { className: M.profileImage, src: i.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ s("span", { className: `flex-row justify-center items-center ${M.defaultProfileImage}`, children: /* @__PURE__ */ s(It, { size: "25px" }) }),
|
562
567
|
/* @__PURE__ */ h("div", { className: "flex-col items-start", children: [
|
563
568
|
/* @__PURE__ */ h("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
|
564
569
|
/* @__PURE__ */ s("span", { title: i.name, className: M.teamName, children: i.name }),
|
@@ -569,27 +574,42 @@ const qn = "_sidebarContainer_bmdti_1", Bn = {
|
|
569
574
|
]
|
570
575
|
}
|
571
576
|
);
|
572
|
-
},
|
573
|
-
teamsContainer:
|
577
|
+
}, Ir = "_teamsContainer_1t68g_1", Ar = {
|
578
|
+
teamsContainer: Ir
|
574
579
|
}, Rr = ({ onSwitchTeam: e }) => {
|
575
580
|
const { otherTeams: t } = X();
|
576
|
-
return t.length === 0 ? null : /* @__PURE__ */ s(
|
577
|
-
|
581
|
+
return t.length === 0 ? null : /* @__PURE__ */ s(
|
582
|
+
"div",
|
583
|
+
{
|
584
|
+
"data-testid": "sidebar-team-switch",
|
585
|
+
className: `flex-col items-stretch ${Ar.teamsContainer}`,
|
586
|
+
children: t.map((n) => /* @__PURE__ */ s(Dt, { team: n, onClick: e, hidePlanLabel: !0 }, n.id))
|
587
|
+
}
|
588
|
+
);
|
589
|
+
}, Nr = "_container_1u995_1", jr = "_planCta_1u995_15", xr = "_upgradeIconWrapper_1u995_19", Ae = {
|
578
590
|
container: Nr,
|
579
591
|
planCta: jr,
|
580
592
|
upgradeIconWrapper: xr
|
581
593
|
}, Or = ({ upgradeOptionHref: e }) => {
|
582
|
-
const { planId: t, trialDaysLeft: n, showUpgradeCta:
|
583
|
-
if (!
|
594
|
+
const { planId: t, trialDaysLeft: n, showUpgradeCta: a } = X();
|
595
|
+
if (!a)
|
584
596
|
return null;
|
585
597
|
const c = De(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${n} ${n === 1 ? "day" : "days"}`;
|
586
|
-
return /* @__PURE__ */ h(
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
598
|
+
return /* @__PURE__ */ h(
|
599
|
+
J,
|
600
|
+
{
|
601
|
+
"data-testid": "sidebar-upgrade-menu-item",
|
602
|
+
href: e,
|
603
|
+
className: `flex-col gap-1 items-start ${Ae.container}`,
|
604
|
+
children: [
|
605
|
+
/* @__PURE__ */ s("span", { className: Ae.planCta, children: c }),
|
606
|
+
/* @__PURE__ */ h("div", { className: `flex-row items-center gap-1 ${Ae.upgradeIconWrapper}`, children: [
|
607
|
+
/* @__PURE__ */ s(Mt, {}),
|
608
|
+
/* @__PURE__ */ s("span", { children: "See upgrade options" })
|
609
|
+
] })
|
610
|
+
]
|
611
|
+
}
|
612
|
+
);
|
593
613
|
}, Lr = Math.min, Mr = Math.max;
|
594
614
|
function bt(e, t, n) {
|
595
615
|
return Mr(e, Lr(t, n));
|
@@ -627,16 +647,16 @@ function vt(e) {
|
|
627
647
|
const {
|
628
648
|
x: t,
|
629
649
|
y: n,
|
630
|
-
width:
|
631
|
-
height:
|
650
|
+
width: a,
|
651
|
+
height: o
|
632
652
|
} = e;
|
633
653
|
return {
|
634
|
-
width:
|
635
|
-
height:
|
654
|
+
width: a,
|
655
|
+
height: o,
|
636
656
|
top: n,
|
637
657
|
left: t,
|
638
|
-
right: t +
|
639
|
-
bottom: n +
|
658
|
+
right: t + a,
|
659
|
+
bottom: n + o,
|
640
660
|
x: t,
|
641
661
|
y: n
|
642
662
|
};
|
@@ -645,8 +665,8 @@ async function Dr(e, t) {
|
|
645
665
|
var n;
|
646
666
|
t === void 0 && (t = {});
|
647
667
|
const {
|
648
|
-
x:
|
649
|
-
y:
|
668
|
+
x: a,
|
669
|
+
y: o,
|
650
670
|
platform: i,
|
651
671
|
rects: c,
|
652
672
|
elements: d,
|
@@ -663,8 +683,8 @@ async function Dr(e, t) {
|
|
663
683
|
rootBoundary: m,
|
664
684
|
strategy: u
|
665
685
|
})), p = _ === "floating" ? {
|
666
|
-
x:
|
667
|
-
y:
|
686
|
+
x: a,
|
687
|
+
y: o,
|
668
688
|
width: c.floating.width,
|
669
689
|
height: c.floating.height
|
670
690
|
} : c.reference, v = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(d.floating)), C = await (i.isElement == null ? void 0 : i.isElement(v)) ? await (i.getScale == null ? void 0 : i.getScale(v)) || {
|
@@ -693,8 +713,8 @@ const $r = function(e) {
|
|
693
713
|
async fn(t) {
|
694
714
|
const {
|
695
715
|
x: n,
|
696
|
-
y:
|
697
|
-
placement:
|
716
|
+
y: a,
|
717
|
+
placement: o
|
698
718
|
} = t, {
|
699
719
|
mainAxis: i = !0,
|
700
720
|
crossAxis: c = !1,
|
@@ -713,8 +733,8 @@ const $r = function(e) {
|
|
713
733
|
...u
|
714
734
|
} = $t(e, t), l = {
|
715
735
|
x: n,
|
716
|
-
y:
|
717
|
-
}, m = await Dr(t, u), _ = Hr(Ft(
|
736
|
+
y: a
|
737
|
+
}, m = await Dr(t, u), _ = Hr(Ft(o)), T = Ur(_);
|
718
738
|
let y = l[T], f = l[_];
|
719
739
|
if (i) {
|
720
740
|
const b = T === "y" ? "top" : "left", g = T === "y" ? "bottom" : "right", p = y + m[b], v = y - m[g];
|
@@ -733,7 +753,7 @@ const $r = function(e) {
|
|
733
753
|
...E,
|
734
754
|
data: {
|
735
755
|
x: E.x - n,
|
736
|
-
y: E.y -
|
756
|
+
y: E.y - a,
|
737
757
|
enabled: {
|
738
758
|
[T]: i,
|
739
759
|
[_]: c
|
@@ -742,31 +762,31 @@ const $r = function(e) {
|
|
742
762
|
};
|
743
763
|
}
|
744
764
|
};
|
745
|
-
}, Fr = "_navItem_1dudv_1", Gr = "_activeNavItem_1dudv_18",
|
765
|
+
}, Fr = "_navItem_1dudv_1", Gr = "_activeNavItem_1dudv_18", Kr = "_badge_1dudv_23", Re = {
|
746
766
|
navItem: Fr,
|
747
767
|
activeNavItem: Gr,
|
748
|
-
badge:
|
749
|
-
}, Gt =
|
750
|
-
const t = e.lastIndexOf("."), n = e.slice(0, t),
|
751
|
-
return { name: n, extension:
|
768
|
+
badge: Kr
|
769
|
+
}, Gt = kt({}), Y = () => Ct(Gt), zr = (e) => {
|
770
|
+
const t = e.lastIndexOf("."), n = e.slice(0, t), a = e.slice(t + 1);
|
771
|
+
return { name: n, extension: a };
|
752
772
|
}, Jr = (e, t) => {
|
753
773
|
switch (e) {
|
754
|
-
case
|
774
|
+
case P.Completed:
|
755
775
|
return t < 100 ? "Closed" : "Completed";
|
756
|
-
case
|
776
|
+
case P.Created:
|
757
777
|
return t > 0 ? "In progress" : "Not started";
|
758
|
-
case
|
778
|
+
case P.InProgress:
|
759
779
|
return "In progress";
|
760
|
-
case
|
780
|
+
case P.Queued:
|
761
781
|
return "Queued";
|
762
|
-
case
|
782
|
+
case P.NotStarted:
|
763
783
|
return "Not started";
|
764
784
|
default:
|
765
785
|
return "-";
|
766
786
|
}
|
767
787
|
}, Wr = (e) => {
|
768
788
|
const t = e.progress ?? 0;
|
769
|
-
return e.status ===
|
789
|
+
return e.status === P.Created && t > 0 ? P.InProgress : e.status;
|
770
790
|
}, Qr = {
|
771
791
|
[re.translation]: "#0891B2",
|
772
792
|
[re.review]: "#16922D",
|
@@ -774,17 +794,17 @@ const $r = function(e) {
|
|
774
794
|
[re.automatic_translation]: "#60A5FA"
|
775
795
|
}, Xr = (e) => {
|
776
796
|
const t = [
|
777
|
-
|
778
|
-
|
779
|
-
|
797
|
+
P.InProgress,
|
798
|
+
P.Created,
|
799
|
+
P.Completed
|
780
800
|
];
|
781
|
-
return e.filter((n) => n.status !== "queued").map((n) => ({ ...n, status: Wr(n) })).sort((n,
|
782
|
-
}, Tt = (e) =>
|
783
|
-
const [n,
|
801
|
+
return e.filter((n) => n.status !== "queued").map((n) => ({ ...n, status: Wr(n) })).sort((n, a) => n.status === P.InProgress && n.progress === 100 ? -1 : a.status === P.InProgress && a.progress === 100 ? 1 : n.status === a.status ? n.name < a.name ? 1 : -1 : t.indexOf(n.status) - t.indexOf(a.status));
|
802
|
+
}, Tt = (e) => [Oe.InProgress, Oe.Created].includes(e), Yr = (e, t) => Tt(e.status) && Tt(t.status) && (t.progress ?? 0) >= 100, Vr = ({ task: e, language: t }) => {
|
803
|
+
const [n, a] = R(!1), [o, i] = R(!1), { onLanguageCompleteConfirm: c, fetchTasks: d } = Y(), u = () => {
|
784
804
|
i(!1);
|
785
805
|
};
|
786
806
|
return /* @__PURE__ */ h(Ue, { children: [
|
787
|
-
|
807
|
+
o && /* @__PURE__ */ s(
|
788
808
|
rn,
|
789
809
|
{
|
790
810
|
opened: !0,
|
@@ -794,9 +814,9 @@ const $r = function(e) {
|
|
794
814
|
closeText: "Cancel",
|
795
815
|
onClose: u,
|
796
816
|
onConfirm: async () => {
|
797
|
-
|
817
|
+
a(!0), await c({ task: e, language: t, closePrompt: u }), d();
|
798
818
|
},
|
799
|
-
children: /* @__PURE__ */ h(
|
819
|
+
children: /* @__PURE__ */ h(an, { status: "info", children: [
|
800
820
|
"Make sure you are finished and ",
|
801
821
|
/* @__PURE__ */ s("strong", { children: "mark it as done" }),
|
802
822
|
" to notify your team admin. This action cannot be undone, and the language might no longer be available for you to edit."
|
@@ -814,12 +834,12 @@ const $r = function(e) {
|
|
814
834
|
}
|
815
835
|
)
|
816
836
|
] });
|
817
|
-
}, Zr = "_langRowCompleted_vpgdi_1",
|
837
|
+
}, Zr = "_langRowCompleted_vpgdi_1", ea = "_langCellSecondary_vpgdi_15", ta = "_langStatus_vpgdi_20", Ne = {
|
818
838
|
langRowCompleted: Zr,
|
819
|
-
langCellSecondary:
|
820
|
-
langStatus:
|
821
|
-
},
|
822
|
-
const { getProjectUrl: n, langNameOnClick:
|
839
|
+
langCellSecondary: ea,
|
840
|
+
langStatus: ta
|
841
|
+
}, na = ({ language: e, task: t }) => {
|
842
|
+
const { getProjectUrl: n, langNameOnClick: a, langProgressOnClick: o } = Y(), i = e.progress ?? 0, c = e.status === P.Completed, d = Yr(t, e);
|
823
843
|
return /* @__PURE__ */ h(
|
824
844
|
"tr",
|
825
845
|
{
|
@@ -832,7 +852,7 @@ const $r = function(e) {
|
|
832
852
|
{
|
833
853
|
href: n({ task: t, language: e }),
|
834
854
|
onClick: () => {
|
835
|
-
|
855
|
+
a == null || a({ task: t, language: e });
|
836
856
|
},
|
837
857
|
children: e.name
|
838
858
|
}
|
@@ -842,7 +862,7 @@ const $r = function(e) {
|
|
842
862
|
{
|
843
863
|
href: n({ task: t, language: e, taskUncompleted: !0 }),
|
844
864
|
onClick: () => {
|
845
|
-
|
865
|
+
o == null || o({ task: t, language: e });
|
846
866
|
},
|
847
867
|
children: e.base_words_total - e.base_words_done
|
848
868
|
}
|
@@ -862,21 +882,21 @@ const $r = function(e) {
|
|
862
882
|
]
|
863
883
|
}
|
864
884
|
);
|
865
|
-
},
|
866
|
-
taskContainer:
|
867
|
-
taskTitle:
|
868
|
-
taskDescription:
|
869
|
-
languagesTable:
|
870
|
-
metadata:
|
871
|
-
},
|
872
|
-
const {
|
873
|
-
|
874
|
-
`/style-guide/${e.team_id}/download/${
|
885
|
+
}, ra = "_taskContainer_mt2or_1", aa = "_taskTitle_mt2or_21", oa = "_taskDescription_mt2or_28", sa = "_languagesTable_mt2or_35", ia = "_metadata_mt2or_87", U = {
|
886
|
+
taskContainer: ra,
|
887
|
+
taskTitle: aa,
|
888
|
+
taskDescription: oa,
|
889
|
+
languagesTable: sa,
|
890
|
+
metadata: ia
|
891
|
+
}, ca = ({ task: e }) => {
|
892
|
+
const { getProjectUrl: t, taskTitleOnClick: n } = Y(), a = Xr(e.langs), o = (i) => {
|
893
|
+
window.open(
|
894
|
+
`/style-guide/${e.team_id}/download/${i.id}/link`,
|
875
895
|
"_blank",
|
876
896
|
"noopener,noreferrer"
|
877
897
|
);
|
878
898
|
};
|
879
|
-
return
|
899
|
+
return /* @__PURE__ */ h("div", { className: U.taskContainer, children: [
|
880
900
|
/* @__PURE__ */ h("div", { className: "flex-row gap-1 items-center", children: [
|
881
901
|
/* @__PURE__ */ h("div", { className: "flex-row gap-1 items-start flex-wrap", children: [
|
882
902
|
/* @__PURE__ */ s(je, { color: Qr[e.task_type], variant: "solid", children: e.task_type.toLocaleUpperCase() }),
|
@@ -890,20 +910,20 @@ const $r = function(e) {
|
|
890
910
|
{
|
891
911
|
size: "sm",
|
892
912
|
variant: "secondary",
|
893
|
-
onClick: () =>
|
913
|
+
onClick: () => o(e.style_guides[0]),
|
894
914
|
children: "Download style guide"
|
895
915
|
}
|
896
916
|
) : /* @__PURE__ */ s(
|
897
917
|
ce,
|
898
918
|
{
|
899
919
|
menuButton: /* @__PURE__ */ s(xe, { variant: "secondary", size: "sm", children: "Download style guide" }),
|
900
|
-
children: /* @__PURE__ */ s(le, { children: e.style_guides.map((
|
920
|
+
children: /* @__PURE__ */ s(le, { children: e.style_guides.map((i) => /* @__PURE__ */ s(
|
901
921
|
J,
|
902
922
|
{
|
903
|
-
onClick: () => i
|
904
|
-
children:
|
923
|
+
onClick: () => o(i),
|
924
|
+
children: zr(i.name).name
|
905
925
|
},
|
906
|
-
|
926
|
+
i.id
|
907
927
|
)) })
|
908
928
|
}
|
909
929
|
) })
|
@@ -911,9 +931,9 @@ const $r = function(e) {
|
|
911
931
|
/* @__PURE__ */ s("h4", { className: U.taskTitle, children: /* @__PURE__ */ s(
|
912
932
|
L,
|
913
933
|
{
|
914
|
-
href:
|
934
|
+
href: t({ task: e, view: "multi" }),
|
915
935
|
onClick: () => {
|
916
|
-
|
936
|
+
n == null || n({ task: e });
|
917
937
|
},
|
918
938
|
children: e.title
|
919
939
|
}
|
@@ -926,9 +946,9 @@ const $r = function(e) {
|
|
926
946
|
/* @__PURE__ */ s("th", { children: "Progress" }),
|
927
947
|
/* @__PURE__ */ s("th", { children: "Status" })
|
928
948
|
] }) }),
|
929
|
-
/* @__PURE__ */ s("tbody", { children: a.map((
|
949
|
+
/* @__PURE__ */ s("tbody", { children: a.map((i) => /* @__PURE__ */ s(na, { language: i, task: e }, i.lang_id)) })
|
930
950
|
] }),
|
931
|
-
/* @__PURE__ */ h("div", { className: U.metadata, children: [
|
951
|
+
/* @__PURE__ */ h("div", { "data-testid": "sidebar-task-overview-metadata", className: U.metadata, children: [
|
932
952
|
/* @__PURE__ */ h("span", { children: [
|
933
953
|
"Source: ",
|
934
954
|
e.source_lang_name
|
@@ -940,32 +960,35 @@ const $r = function(e) {
|
|
940
960
|
e.master_branching_enabled === "1" && /* @__PURE__ */ s("div", { className: U.tag, children: e.branch_name ? e.branch_name : "master" })
|
941
961
|
] })
|
942
962
|
] })
|
943
|
-
] })
|
944
|
-
},
|
963
|
+
] });
|
964
|
+
}, k = {
|
945
965
|
TaskCompleted: "task_completed",
|
946
966
|
TaskClosed: "task_closed",
|
947
967
|
Refresh: "refresh",
|
948
968
|
ShowDialog: "show_dialog"
|
949
|
-
},
|
950
|
-
loadingContainer:
|
951
|
-
noTasksContainer:
|
952
|
-
noTasksHeading:
|
953
|
-
noTasksText:
|
954
|
-
tasksContainer:
|
955
|
-
},
|
956
|
-
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: n, fetchTasks:
|
957
|
-
return $e(() => (
|
958
|
-
|
959
|
-
|
969
|
+
}, la = "_loadingContainer_19d6m_1", da = "_noTasksContainer_19d6m_7", ua = "_noTasksHeading_19d6m_14", ma = "_noTasksText_19d6m_18", fa = "_tasksContainer_19d6m_23", F = {
|
970
|
+
loadingContainer: la,
|
971
|
+
noTasksContainer: da,
|
972
|
+
noTasksHeading: ua,
|
973
|
+
noTasksText: ma,
|
974
|
+
tasksContainer: fa
|
975
|
+
}, _a = () => {
|
976
|
+
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: n, fetchTasks: a } = Y();
|
977
|
+
return $e(() => ((async () => {
|
978
|
+
const i = await a();
|
979
|
+
t == null || t({ tasks: i });
|
980
|
+
})(), document.addEventListener(k.TaskCompleted, a), document.addEventListener(k.TaskClosed, a), document.addEventListener(k.Refresh, a), () => {
|
981
|
+
document.removeEventListener(k.TaskCompleted, a), document.removeEventListener(k.TaskClosed, a), document.removeEventListener(k.Refresh, a);
|
982
|
+
})), n ? /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-loading-popover", className: F.loadingContainer, children: /* @__PURE__ */ s(on, {}) }) : e.length === 0 ? /* @__PURE__ */ h("div", { "data-testid": "sidebar-no-tasks-popover", className: F.noTasksContainer, children: [
|
960
983
|
/* @__PURE__ */ s("h3", { className: F.noTasksHeading, children: "No tasks" }),
|
961
984
|
/* @__PURE__ */ h("div", { className: F.noTasksText, children: [
|
962
985
|
"Your incoming tasks will appear here.",
|
963
986
|
/* @__PURE__ */ s("br", {}),
|
964
987
|
/* @__PURE__ */ s(L, { href: "https://docs.lokalise.com/translation-workflow/tasks", target: "_new", children: "Learn more" })
|
965
988
|
] })
|
966
|
-
] }) : /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-popover", className: F.tasksContainer, children: e.map((
|
967
|
-
},
|
968
|
-
const [n,
|
989
|
+
] }) : /* @__PURE__ */ s("div", { "data-testid": "sidebar-tasks-popover", className: F.tasksContainer, children: e.map((o) => /* @__PURE__ */ s(ca, { task: o }, o.id)) });
|
990
|
+
}, ga = ({ children: e, config: t }) => {
|
991
|
+
const [n, a] = R([]), [o, i] = R(!0), [c, d] = R(0), {
|
969
992
|
getProjectUrl: u,
|
970
993
|
onLanguageCompleteConfirm: l,
|
971
994
|
onTasksWidgetOpen: m,
|
@@ -975,19 +998,19 @@ const $r = function(e) {
|
|
975
998
|
} = t, { getTasks: f, getTasksCount: E } = t, b = async () => {
|
976
999
|
i(!0);
|
977
1000
|
const v = await f();
|
978
|
-
|
1001
|
+
return a(v), i(!1), v;
|
979
1002
|
}, g = async () => {
|
980
1003
|
const v = await E();
|
981
1004
|
d(v);
|
982
1005
|
};
|
983
|
-
$e(() => (g(), document.addEventListener(
|
984
|
-
document.removeEventListener(
|
1006
|
+
$e(() => (g(), document.addEventListener(k.TaskCompleted, g), document.addEventListener(k.TaskClosed, g), document.addEventListener(k.Refresh, g), () => {
|
1007
|
+
document.removeEventListener(k.TaskCompleted, g), document.removeEventListener(k.TaskClosed, g), document.removeEventListener(k.Refresh, g);
|
985
1008
|
}));
|
986
1009
|
const p = {
|
987
1010
|
fetchTasks: b,
|
988
1011
|
tasks: n,
|
989
1012
|
tasksCount: c,
|
990
|
-
loadingTasks:
|
1013
|
+
loadingTasks: o,
|
991
1014
|
getProjectUrl: u,
|
992
1015
|
onLanguageCompleteConfirm: l,
|
993
1016
|
onTasksWidgetOpen: m,
|
@@ -996,22 +1019,22 @@ const $r = function(e) {
|
|
996
1019
|
taskTitleOnClick: y
|
997
1020
|
};
|
998
1021
|
return /* @__PURE__ */ s(Gt.Provider, { value: p, children: e });
|
999
|
-
},
|
1000
|
-
const { config:
|
1001
|
-
return /* @__PURE__ */ s(
|
1002
|
-
},
|
1022
|
+
}, ha = (e) => function(n) {
|
1023
|
+
const { config: a, ...o } = n;
|
1024
|
+
return /* @__PURE__ */ s(ga, { config: a, children: /* @__PURE__ */ s(e, { ...o }) });
|
1025
|
+
}, pa = ha(() => {
|
1003
1026
|
const [e, t] = R(!1), { tasksCount: n } = Y();
|
1004
1027
|
return $e(() => {
|
1005
|
-
const
|
1028
|
+
const a = () => {
|
1006
1029
|
t(!0);
|
1007
1030
|
};
|
1008
|
-
return document.addEventListener(
|
1009
|
-
document.removeEventListener(
|
1031
|
+
return document.addEventListener(k.ShowDialog, a), () => {
|
1032
|
+
document.removeEventListener(k.ShowDialog, a);
|
1010
1033
|
};
|
1011
1034
|
}), /* @__PURE__ */ s(q, { tooltip: "Tasks", placement: "right", children: /* @__PURE__ */ s(
|
1012
1035
|
sn,
|
1013
1036
|
{
|
1014
|
-
content: /* @__PURE__ */ s(
|
1037
|
+
content: /* @__PURE__ */ s(_a, {}),
|
1015
1038
|
placement: "right",
|
1016
1039
|
open: e,
|
1017
1040
|
onOpenChange: t,
|
@@ -1025,14 +1048,14 @@ const $r = function(e) {
|
|
1025
1048
|
}
|
1026
1049
|
})
|
1027
1050
|
],
|
1028
|
-
children: (
|
1051
|
+
children: (a) => /* @__PURE__ */ h(
|
1029
1052
|
xe,
|
1030
1053
|
{
|
1031
1054
|
type: "button",
|
1032
1055
|
"data-testid": "sidebar-tasks-widget-button",
|
1033
1056
|
"aria-label": "Tasks",
|
1034
1057
|
className: N(Re.navItem, {
|
1035
|
-
[Re.activeNavItem]:
|
1058
|
+
[Re.activeNavItem]: a
|
1036
1059
|
}),
|
1037
1060
|
children: [
|
1038
1061
|
/* @__PURE__ */ s(cn, { size: "25px" }),
|
@@ -1042,35 +1065,35 @@ const $r = function(e) {
|
|
1042
1065
|
)
|
1043
1066
|
}
|
1044
1067
|
) });
|
1045
|
-
}),
|
1046
|
-
|
1047
|
-
const
|
1048
|
-
|
1049
|
-
|
1050
|
-
|
1051
|
-
|
1052
|
-
|
1053
|
-
|
1054
|
-
|
1055
|
-
|
1056
|
-
|
1057
|
-
|
1058
|
-
const
|
1059
|
-
breadcrumbsItem:
|
1060
|
-
breadcrumbs:
|
1061
|
-
}, $
|
1068
|
+
}), I = ({ children: e, ...t }) => /* @__PURE__ */ s("nav", { ...t, className: Bn.sidebarContainer, children: e }), ba = ({ children: e }) => /* @__PURE__ */ s("div", { children: e });
|
1069
|
+
I.Top = ba;
|
1070
|
+
const va = ({ children: e }) => /* @__PURE__ */ s("div", { children: e });
|
1071
|
+
I.Bottom = va;
|
1072
|
+
I.Avatar = Fn;
|
1073
|
+
I.IconLink = zn;
|
1074
|
+
I.Menu = Qn;
|
1075
|
+
I.ProfileMenu = br;
|
1076
|
+
I.TeamSwitch = Rr;
|
1077
|
+
I.TeamMenuItem = Dt;
|
1078
|
+
I.UpgradeMenuItem = Or;
|
1079
|
+
I.ProfileSettingsMenuItem = yr;
|
1080
|
+
I.Tasks = pa;
|
1081
|
+
const Ta = "_breadcrumbsItem_1hm6a_1", ya = "_breadcrumbs_1hm6a_1", yt = {
|
1082
|
+
breadcrumbsItem: Ta,
|
1083
|
+
breadcrumbs: ya
|
1084
|
+
}, $o = ({ items: e }) => /* @__PURE__ */ s("nav", { "aria-label": "breadcrumb", className: yt.breadcrumbs, children: e.map((t, n) => /* @__PURE__ */ h(Pt, { children: [
|
1062
1085
|
/* @__PURE__ */ s(L, { className: yt.breadcrumbsItem, href: t.link, rel: "noreferrer", children: t.name }),
|
1063
1086
|
n < e.length - 1 && /* @__PURE__ */ s("span", { children: " — " })
|
1064
|
-
] }, `${t.link}-${t.name}`)) }),
|
1065
|
-
!!n && t.some((
|
1066
|
-
t.filter(({ visible:
|
1067
|
-
] }, t[0].label)) }),
|
1068
|
-
badge:
|
1069
|
-
tag:
|
1070
|
-
withNavLinkStyle:
|
1071
|
-
disabled:
|
1072
|
-
projectNavigationItem:
|
1073
|
-
projectNavigationItemDisabled:
|
1087
|
+
] }, `${t.link}-${t.name}`)) }), Sa = ({ items: e }) => /* @__PURE__ */ s(Ue, { children: e.map((t, n) => /* @__PURE__ */ h(Pt, { children: [
|
1088
|
+
!!n && t.some((a) => a.visible) && /* @__PURE__ */ s(At, {}),
|
1089
|
+
t.filter(({ visible: a }) => a).map(({ link: a, label: o, onClick: i }) => /* @__PURE__ */ s(J, { href: a || "#", "aria-label": o, onClick: i, children: o }, o))
|
1090
|
+
] }, t[0].label)) }), Ea = "_badge_1pc1v_1", wa = "_tag_1pc1v_15", Ca = "_withNavLinkStyle_1pc1v_42 _withLinkStyle_1pc1v_21", ka = "_disabled_1pc1v_57", Pa = "_projectNavigationItem_1pc1v_61", Ia = "_projectNavigationItemDisabled_1pc1v_67", O = {
|
1091
|
+
badge: Ea,
|
1092
|
+
tag: wa,
|
1093
|
+
withNavLinkStyle: Ca,
|
1094
|
+
disabled: ka,
|
1095
|
+
projectNavigationItem: Pa,
|
1096
|
+
projectNavigationItemDisabled: Ia
|
1074
1097
|
}, St = ({ label: e, badge: t, novel: n }) => /* @__PURE__ */ h("div", { className: "flex gap-1", children: [
|
1075
1098
|
/* @__PURE__ */ h("div", { children: [
|
1076
1099
|
/* @__PURE__ */ s("span", { children: e }),
|
@@ -1078,11 +1101,11 @@ const yo = "_breadcrumbsItem_1hm6a_1", So = "_breadcrumbs_1hm6a_1", yt = {
|
|
1078
1101
|
] }),
|
1079
1102
|
!!n && /* @__PURE__ */ s(je, { className: O.tag, children: n })
|
1080
1103
|
] }), Le = tn(
|
1081
|
-
({ label: e, href: t = "", disabled: n = !1, badge:
|
1104
|
+
({ label: e, href: t = "", disabled: n = !1, badge: a, onClick: o, novel: i }, c) => /* @__PURE__ */ s(q, { tooltip: "You do not have access to this function", show: n, children: /* @__PURE__ */ s(
|
1082
1105
|
"div",
|
1083
1106
|
{
|
1084
1107
|
className: n ? O.projectNavigationItemDisabled : O.projectNavigationItem,
|
1085
|
-
children:
|
1108
|
+
children: o || n || !t ? /* @__PURE__ */ s(
|
1086
1109
|
"button",
|
1087
1110
|
{
|
1088
1111
|
type: "button",
|
@@ -1091,27 +1114,27 @@ const yo = "_breadcrumbsItem_1hm6a_1", So = "_breadcrumbs_1hm6a_1", yt = {
|
|
1091
1114
|
[O.disabled]: n
|
1092
1115
|
}),
|
1093
1116
|
disabled: n,
|
1094
|
-
onClick:
|
1095
|
-
children: /* @__PURE__ */ s(St, { label: e, badge:
|
1117
|
+
onClick: o,
|
1118
|
+
children: /* @__PURE__ */ s(St, { label: e, badge: a, novel: i })
|
1096
1119
|
}
|
1097
|
-
) : /* @__PURE__ */ s("a", { href: t, className: O.withNavLinkStyle, children: /* @__PURE__ */ s(St, { label: e, badge:
|
1120
|
+
) : /* @__PURE__ */ s("a", { href: t, className: O.withNavLinkStyle, children: /* @__PURE__ */ s(St, { label: e, badge: a, novel: i }) })
|
1098
1121
|
}
|
1099
1122
|
) })
|
1100
1123
|
);
|
1101
1124
|
Le.displayName = "NavigationTabsItem";
|
1102
|
-
const
|
1103
|
-
var
|
1125
|
+
const Aa = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible))) ?? !1, Ra = (e) => e.visible && (!e.dropdown || Aa(e.dropdown)), Fo = ({ navigation: e, activeItem: t }) => /* @__PURE__ */ s("nav", { "aria-label": "Project", children: /* @__PURE__ */ s("ul", { className: H.navigationTabList, "aria-orientation": "horizontal", children: e.filter(Ra).map((n) => {
|
1126
|
+
var a, o, i;
|
1104
1127
|
return n.dropdown ? /* @__PURE__ */ s(
|
1105
1128
|
"li",
|
1106
1129
|
{
|
1107
1130
|
className: H.navigationTab,
|
1108
1131
|
"data-testid": n.key,
|
1109
|
-
"aria-selected": (
|
1132
|
+
"aria-selected": (a = n.isActive) == null ? void 0 : a.call(n, t),
|
1110
1133
|
children: /* @__PURE__ */ s(
|
1111
1134
|
ce,
|
1112
1135
|
{
|
1113
1136
|
menuButton: ({ opened: c }) => /* @__PURE__ */ s(Le, { label: n.label, disabled: n.disabled, active: c }),
|
1114
|
-
children: /* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(
|
1137
|
+
children: /* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(Sa, { items: n.dropdown }) })
|
1115
1138
|
}
|
1116
1139
|
)
|
1117
1140
|
},
|
@@ -1121,7 +1144,7 @@ const Ro = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
1121
1144
|
{
|
1122
1145
|
className: H.navigationTab,
|
1123
1146
|
"data-testid": n.key,
|
1124
|
-
"aria-selected": (
|
1147
|
+
"aria-selected": (o = n.isActive) == null ? void 0 : o.call(n, t),
|
1125
1148
|
children: /* @__PURE__ */ s(
|
1126
1149
|
Le,
|
1127
1150
|
{
|
@@ -1138,7 +1161,7 @@ const Ro = (e) => (e == null ? void 0 : e.some((t) => t.some((n) => n.visible)))
|
|
1138
1161
|
n.key
|
1139
1162
|
);
|
1140
1163
|
}) }) });
|
1141
|
-
class
|
1164
|
+
class A {
|
1142
1165
|
/**
|
1143
1166
|
* This constructor is private to prevent the creation of a HeaderBuilder, it's an implementation detail
|
1144
1167
|
* that users of this class should not be aware of. The only way to create a HeaderBuilder is through the
|
@@ -1150,7 +1173,7 @@ class I {
|
|
1150
1173
|
this.factories = t;
|
1151
1174
|
}
|
1152
1175
|
static create(t = {}) {
|
1153
|
-
return new
|
1176
|
+
return new A([() => t]);
|
1154
1177
|
}
|
1155
1178
|
/**
|
1156
1179
|
* Adds a single header to the builder by providing a key and a value.
|
@@ -1159,18 +1182,18 @@ class I {
|
|
1159
1182
|
* ```typescript
|
1160
1183
|
* const builder = HeaderBuilder.create()
|
1161
1184
|
* .add('Content-Type', 'application/json')
|
1162
|
-
* .add('
|
1185
|
+
* .add('authorization', 'Bearer token')
|
1163
1186
|
*
|
1164
1187
|
* const headers = await builder.resolve()
|
1165
1188
|
* console.log(headers)
|
1166
|
-
* // { 'Content-Type': 'application/json', '
|
1189
|
+
* // { 'Content-Type': 'application/json', 'authorization': 'Bearer token' }
|
1167
1190
|
* ```
|
1168
1191
|
*
|
1169
1192
|
* @param key - The key of the header
|
1170
1193
|
* @param value - The value of the header
|
1171
1194
|
*/
|
1172
1195
|
add(t, n) {
|
1173
|
-
return new
|
1196
|
+
return new A([...this.factories, () => ({ [t]: n })]);
|
1174
1197
|
}
|
1175
1198
|
/**
|
1176
1199
|
* Adds multiple headers to the builder by providing an object or a promise of an object with the headers.
|
@@ -1178,14 +1201,14 @@ class I {
|
|
1178
1201
|
* @example
|
1179
1202
|
* ```typescript
|
1180
1203
|
* const builder = HeaderBuilder.create()
|
1181
|
-
* .and({ 'Content-Type': 'application/json', '
|
1204
|
+
* .and({ 'Content-Type': 'application/json', 'authorization': 'Bearer token' })
|
1182
1205
|
* .and(Promise.resolve({ 'X-Custom-Header': 'custom', 'X-Another-Header': 'another' }))
|
1183
1206
|
*
|
1184
1207
|
* const headers = await builder.resolve()
|
1185
1208
|
* console.log(headers)
|
1186
1209
|
* // Prints: {
|
1187
1210
|
* // 'Content-Type': 'application/json',
|
1188
|
-
* // '
|
1211
|
+
* // 'authorization': 'Bearer token',
|
1189
1212
|
* // 'X-Custom-Header': 'custom',
|
1190
1213
|
* // 'X-Another-Header': 'another'
|
1191
1214
|
* // }
|
@@ -1194,7 +1217,7 @@ class I {
|
|
1194
1217
|
* @param extension - An object with the headers to add
|
1195
1218
|
*/
|
1196
1219
|
and(t) {
|
1197
|
-
return new
|
1220
|
+
return new A([...this.factories, () => t]);
|
1198
1221
|
}
|
1199
1222
|
/**
|
1200
1223
|
* Adds a factory function that returns a promise of headers to the builder.
|
@@ -1205,17 +1228,17 @@ class I {
|
|
1205
1228
|
* const builder = HeaderBuilder.create()
|
1206
1229
|
* .from(async () => {
|
1207
1230
|
* const token = await fetchToken()
|
1208
|
-
* return { '
|
1231
|
+
* return { 'authorization': `Bearer ${token}` }
|
1209
1232
|
* })
|
1210
1233
|
*
|
1211
1234
|
* const headers = await builder.resolve()
|
1212
|
-
* console.log(headers) // { '
|
1235
|
+
* console.log(headers) // { 'authorization': 'Bearer <token>' }
|
1213
1236
|
* ```
|
1214
1237
|
*
|
1215
1238
|
* @param factory - A function that returns a promise of headers
|
1216
1239
|
*/
|
1217
1240
|
from(t) {
|
1218
|
-
return new
|
1241
|
+
return new A([...this.factories, t]);
|
1219
1242
|
}
|
1220
1243
|
/**
|
1221
1244
|
* Takes a middleware function that receives the current builder and returns a new, modified, builder.
|
@@ -1224,14 +1247,14 @@ class I {
|
|
1224
1247
|
* ```typescript
|
1225
1248
|
* const authMiddleware = createHeaderBuilderMiddleware(async (builder) => {
|
1226
1249
|
* const token = await fetchToken()
|
1227
|
-
* return builder.add('
|
1250
|
+
* return builder.add('authorization', `Bearer ${token}`)
|
1228
1251
|
* })
|
1229
1252
|
*
|
1230
1253
|
* const builder = HeaderBuilder.create()
|
1231
1254
|
* .with(authMiddleware)
|
1232
1255
|
*
|
1233
|
-
* const headers = await builder.resolve() // Type of headers is { '
|
1234
|
-
* console.log(headers) // { '
|
1256
|
+
* const headers = await builder.resolve() // Type of headers is { 'authorization': string }
|
1257
|
+
* console.log(headers) // { 'authorization': 'Bearer <token>' }
|
1235
1258
|
* ```
|
1236
1259
|
*
|
1237
1260
|
* @param middleware
|
@@ -1248,19 +1271,19 @@ class I {
|
|
1248
1271
|
* .add('Content-Type', 'application/json')
|
1249
1272
|
*
|
1250
1273
|
* const builderB = HeaderBuilder.create()
|
1251
|
-
* .add('
|
1274
|
+
* .add('authorization', 'Bearer token')
|
1252
1275
|
*
|
1253
1276
|
* const mergedBuilder = builderA.merge(builderB)
|
1254
1277
|
*
|
1255
1278
|
* const headers = await mergedBuilder.resolve()
|
1256
1279
|
* console.log(headers)
|
1257
|
-
* // { 'Content-Type': 'application/json', '
|
1280
|
+
* // { 'Content-Type': 'application/json', 'authorization': 'Bearer token' }
|
1258
1281
|
* ```
|
1259
1282
|
*
|
1260
1283
|
* @param builder - The builder to merge with
|
1261
1284
|
*/
|
1262
1285
|
merge(t) {
|
1263
|
-
return new
|
1286
|
+
return new A([...this.factories, ...t.factories]);
|
1264
1287
|
}
|
1265
1288
|
/**
|
1266
1289
|
* Resolves the headers by waiting for all the promises to resolve and merging them together.
|
@@ -1274,34 +1297,34 @@ class I {
|
|
1274
1297
|
* console.log(headers) // { 'Content-Type': 'application/json' }
|
1275
1298
|
*/
|
1276
1299
|
async resolve() {
|
1277
|
-
const t = this.factories.map((
|
1300
|
+
const t = this.factories.map((a) => a()), n = await Promise.all(t);
|
1278
1301
|
return Object.assign({}, ...n);
|
1279
1302
|
}
|
1280
1303
|
}
|
1281
|
-
function
|
1282
|
-
return new
|
1304
|
+
function Kt(e) {
|
1305
|
+
return new Na(e);
|
1283
1306
|
}
|
1284
|
-
class
|
1307
|
+
class Na {
|
1285
1308
|
constructor(t) {
|
1286
1309
|
this.middleware = t;
|
1287
1310
|
}
|
1288
1311
|
apply(t) {
|
1289
1312
|
return t.from(async () => {
|
1290
|
-
const n = this.middleware(
|
1291
|
-
return n instanceof Promise ? n.then((
|
1313
|
+
const n = this.middleware(A.create());
|
1314
|
+
return n instanceof Promise ? n.then((a) => a.resolve()) : n.resolve();
|
1292
1315
|
});
|
1293
1316
|
}
|
1294
1317
|
}
|
1295
|
-
const
|
1318
|
+
const zt = r.union([
|
1296
1319
|
r.literal("owner"),
|
1297
1320
|
r.literal("admin"),
|
1298
1321
|
r.literal("biller"),
|
1299
1322
|
r.literal("member")
|
1300
|
-
]),
|
1323
|
+
]), ja = r.object({
|
1301
1324
|
userId: r.number(),
|
1302
1325
|
userUuid: r.string(),
|
1303
1326
|
teamId: r.number(),
|
1304
|
-
userTeamRole:
|
1327
|
+
userTeamRole: zt,
|
1305
1328
|
userEmail: r.string().email(),
|
1306
1329
|
userName: r.string(),
|
1307
1330
|
userCurrentTeamId: r.number(),
|
@@ -1314,7 +1337,7 @@ const Kt = r.union([
|
|
1314
1337
|
function V(e) {
|
1315
1338
|
try {
|
1316
1339
|
const t = e.split(".")[1], n = atob(t);
|
1317
|
-
return
|
1340
|
+
return ja.parse(JSON.parse(n));
|
1318
1341
|
} catch {
|
1319
1342
|
return;
|
1320
1343
|
}
|
@@ -1326,36 +1349,36 @@ class se extends Error {
|
|
1326
1349
|
ne(this, "status", 401);
|
1327
1350
|
}
|
1328
1351
|
}
|
1329
|
-
function
|
1330
|
-
return
|
1352
|
+
function Go(e) {
|
1353
|
+
return Kt(async (t) => {
|
1331
1354
|
var i, c;
|
1332
1355
|
const n = e.getCurrentToken() ?? await ((i = e.generateNewToken) == null ? void 0 : i.call(e));
|
1333
1356
|
if (!n)
|
1334
1357
|
throw new se();
|
1335
|
-
const { exp:
|
1336
|
-
if (!dn(new Date(
|
1337
|
-
return t.add("
|
1338
|
-
const
|
1339
|
-
if (!
|
1358
|
+
const { exp: a } = V(n.accessToken) ?? { exp: 0 };
|
1359
|
+
if (!dn(new Date(a)))
|
1360
|
+
return t.add("authorization", `Bearer ${n.accessToken}`);
|
1361
|
+
const o = await e.refreshToken(n);
|
1362
|
+
if (!o)
|
1340
1363
|
throw new se();
|
1341
|
-
return (c = e.onNewTokenIssued) == null || c.call(e,
|
1364
|
+
return (c = e.onNewTokenIssued) == null || c.call(e, o), t.add("authorization", `Bearer ${o.accessToken}`);
|
1342
1365
|
});
|
1343
1366
|
}
|
1344
|
-
const
|
1367
|
+
const Ko = Kt(
|
1345
1368
|
(e) => e.and({ "x-lokalise-plugin": "true" })
|
1346
1369
|
);
|
1347
1370
|
function Jt() {
|
1348
1371
|
const e = Me(document.cookie, "accessToken"), t = Me(document.cookie, "refreshToken");
|
1349
1372
|
return !e || !t ? null : { accessToken: e, refreshToken: t };
|
1350
1373
|
}
|
1351
|
-
function
|
1374
|
+
function xa() {
|
1352
1375
|
return Me(document.cookie, "csrf_token") ?? null;
|
1353
1376
|
}
|
1354
1377
|
function Me(e, t) {
|
1355
|
-
var n,
|
1356
|
-
return (
|
1378
|
+
var n, a;
|
1379
|
+
return (a = (n = e.split(";").find((o) => o.trim().startsWith(`${t}=`))) == null ? void 0 : n.trim()) == null ? void 0 : a.substring(t.length + 1);
|
1357
1380
|
}
|
1358
|
-
function
|
1381
|
+
function zo() {
|
1359
1382
|
const e = Jt();
|
1360
1383
|
if (!e)
|
1361
1384
|
return;
|
@@ -1364,71 +1387,70 @@ function Ka() {
|
|
1364
1387
|
return { ...e, payload: t };
|
1365
1388
|
}
|
1366
1389
|
const Wt = r.union([
|
1367
|
-
r.object({ Authorization: r.string() }),
|
1368
1390
|
r.object({ authorization: r.string() }),
|
1369
1391
|
r.object({ AUTHORIZATION: r.string() })
|
1370
|
-
]),
|
1392
|
+
]), Oa = r.union([
|
1371
1393
|
r.object({ "X-API-Token": r.string() }),
|
1372
1394
|
r.object({ "X-Api-Token": r.string() }),
|
1373
1395
|
r.object({ "x-api-token": r.string() }),
|
1374
1396
|
r.object({ "X-API-TOKEN": r.string() })
|
1375
|
-
]),
|
1397
|
+
]), La = r.union([
|
1376
1398
|
Wt,
|
1377
|
-
|
1378
|
-
]),
|
1399
|
+
Oa
|
1400
|
+
]), Ma = r.union([
|
1379
1401
|
r.object({ "X-Lokalise-Plugin": r.string() }),
|
1380
1402
|
r.object({ "x-lokalise-plugin": r.string() }),
|
1381
1403
|
r.object({ "X-LOKALISE-PLUGIN": r.string() })
|
1382
|
-
]), Z =
|
1404
|
+
]), Z = La.and(Ma), Ua = r.object({
|
1383
1405
|
accessToken: r.string(),
|
1384
1406
|
refreshToken: r.string()
|
1385
|
-
}),
|
1407
|
+
}), Ha = r.union([
|
1386
1408
|
r.object({ "X-Csrf-Token": r.string() }),
|
1387
1409
|
r.object({ "X-CSRF-Token": r.string() }),
|
1388
1410
|
r.object({ "x-csrf-token": r.string() }),
|
1389
1411
|
r.object({ "X-CSRF-TOKEN": r.string() })
|
1390
|
-
]),
|
1412
|
+
]), qa = r.union([
|
1391
1413
|
Wt,
|
1392
|
-
|
1414
|
+
Ha
|
1393
1415
|
]), Fe = He({
|
1394
1416
|
description: "Takes a teamId and returns a JWT token access and refresh token for the user",
|
1395
1417
|
method: "post",
|
1396
1418
|
requestPathParamsSchema: r.object({ teamId: r.number() }),
|
1397
1419
|
pathResolver: (e) => `/team/${e.teamId}/actions/get-user-token`,
|
1398
|
-
requestHeaderSchema:
|
1420
|
+
requestHeaderSchema: qa,
|
1399
1421
|
requestBodySchema: r.undefined(),
|
1400
1422
|
isEmptyResponseExpected: !0,
|
1401
|
-
successResponseBodySchema:
|
1423
|
+
successResponseBodySchema: Ua
|
1402
1424
|
});
|
1403
|
-
function
|
1425
|
+
function Jo(e, t, n) {
|
1404
1426
|
return async () => {
|
1405
|
-
const
|
1406
|
-
if (!
|
1427
|
+
const a = t();
|
1428
|
+
if (!a)
|
1407
1429
|
throw new se();
|
1408
1430
|
return B(e, Fe, {
|
1409
1431
|
pathParams: { teamId: Number(await n()) },
|
1410
|
-
headers: await
|
1432
|
+
headers: await A.create().add("x-csrf-token", a).resolve()
|
1411
1433
|
});
|
1412
1434
|
};
|
1413
1435
|
}
|
1414
|
-
function
|
1436
|
+
function Wo(e) {
|
1415
1437
|
return async ({ accessToken: t, refreshToken: n }) => {
|
1416
|
-
const
|
1417
|
-
if (!
|
1438
|
+
const a = V(t);
|
1439
|
+
if (!a)
|
1418
1440
|
throw new se();
|
1419
1441
|
return B(e, Fe, {
|
1420
|
-
pathParams: { teamId:
|
1421
|
-
headers: await
|
1442
|
+
pathParams: { teamId: a.teamId },
|
1443
|
+
headers: await A.create().add("authorization", `Bearer ${n}`).resolve()
|
1422
1444
|
});
|
1423
1445
|
};
|
1424
1446
|
}
|
1425
|
-
const
|
1447
|
+
const Ba = {
|
1426
1448
|
teamKey: (e) => ["getUserToken", e]
|
1427
|
-
},
|
1449
|
+
}, Da = (e, t, n) => D({
|
1428
1450
|
...n,
|
1429
|
-
queryFn: async ({ queryKey: [
|
1451
|
+
queryFn: async ({ queryKey: [a, o] }) => B(e, Fe, {
|
1430
1452
|
headers: await t.resolve(),
|
1431
|
-
pathParams: { teamId:
|
1453
|
+
pathParams: { teamId: o }
|
1432
1454
|
})
|
1433
1455
|
}), ie = class ie extends CustomEvent {
|
1434
1456
|
constructor(t) {
|
@@ -1438,149 +1460,149 @@ const Do = {
|
|
1438
1460
|
}
|
1439
1461
|
};
|
1440
1462
|
ne(ie, "eventName", "new-jwt-issued");
|
1441
|
-
let
|
1442
|
-
function
|
1443
|
-
const
|
1444
|
-
queryKey:
|
1445
|
-
enabled:
|
1463
|
+
let K = ie;
|
1464
|
+
function Qo(e, t, n) {
|
1465
|
+
const a = xa(), o = Da(e, t.add("x-csrf-token", a ?? ""), {
|
1466
|
+
queryKey: Ba.teamKey(n),
|
1467
|
+
enabled: a !== void 0
|
1446
1468
|
}), i = wt();
|
1447
|
-
return
|
1448
|
-
|
1449
|
-
}, [
|
1469
|
+
return z(() => {
|
1470
|
+
o.data && o.data.accessToken !== i.current && (window.dispatchEvent(new K(o.data)), i.current = o.data.accessToken);
|
1471
|
+
}, [o.data]), o;
|
1450
1472
|
}
|
1451
1473
|
function Qt() {
|
1452
1474
|
const [e, t] = R();
|
1453
|
-
return
|
1454
|
-
const n = (
|
1455
|
-
t(
|
1456
|
-
},
|
1457
|
-
return t(
|
1458
|
-
window.removeEventListener(
|
1475
|
+
return z(() => {
|
1476
|
+
const n = (o) => {
|
1477
|
+
t(o.detail.payload);
|
1478
|
+
}, a = Jt();
|
1479
|
+
return t(a ? V(a.accessToken) : void 0), window.addEventListener(K.eventName, n), () => {
|
1480
|
+
window.removeEventListener(K.eventName, n);
|
1459
1481
|
};
|
1460
1482
|
}, []), e;
|
1461
1483
|
}
|
1462
|
-
const
|
1484
|
+
const $a = Z, Fa = r.object({
|
1463
1485
|
user_id: r.number(),
|
1464
1486
|
email: r.string().email(),
|
1465
1487
|
fullname: r.string(),
|
1466
1488
|
created_at: r.string(),
|
1467
1489
|
created_at_timestamp: r.number(),
|
1468
|
-
role:
|
1469
|
-
}),
|
1490
|
+
role: zt
|
1491
|
+
}), Ga = r.object({
|
1470
1492
|
team_id: r.number(),
|
1471
|
-
team_user:
|
1472
|
-
}),
|
1493
|
+
team_user: Fa
|
1494
|
+
}), Ka = Q({
|
1473
1495
|
description: "Get the details of a team user",
|
1474
|
-
requestHeaderSchema:
|
1496
|
+
requestHeaderSchema: $a,
|
1475
1497
|
requestPathParamsSchema: r.object({ teamId: r.number(), userId: r.number() }),
|
1476
1498
|
pathResolver: ({ teamId: e, userId: t }) => `/teams/${e}/users/${t}`,
|
1477
|
-
successResponseBodySchema:
|
1478
|
-
}),
|
1499
|
+
successResponseBodySchema: Ga
|
1500
|
+
}), za = {
|
1479
1501
|
teamUserKey: (e, t) => ["GetTeamUsers", e, t]
|
1480
|
-
},
|
1502
|
+
}, Ja = (e, t, n) => D({
|
1481
1503
|
...n,
|
1482
|
-
queryFn: async ({ queryKey: [
|
1504
|
+
queryFn: async ({ queryKey: [a, o, i] }) => W(e, Ka, {
|
1483
1505
|
headers: await t.resolve(),
|
1484
|
-
pathParams: { teamId:
|
1506
|
+
pathParams: { teamId: o, userId: i }
|
1485
1507
|
})
|
1486
1508
|
});
|
1487
|
-
function
|
1509
|
+
function Xo(e, t) {
|
1488
1510
|
const n = Qt();
|
1489
|
-
return
|
1490
|
-
queryKey:
|
1511
|
+
return Ja(e, t, {
|
1512
|
+
queryKey: za.teamUserKey((n == null ? void 0 : n.teamId) ?? 0, (n == null ? void 0 : n.userId) ?? 0),
|
1491
1513
|
enabled: (n == null ? void 0 : n.userId) !== void 0 && n.teamId !== void 0
|
1492
1514
|
});
|
1493
1515
|
}
|
1494
|
-
const
|
1516
|
+
const Wa = r.object({
|
1495
1517
|
lang_id: r.number(),
|
1496
1518
|
lang_iso: r.string(),
|
1497
1519
|
lang_name: r.string(),
|
1498
1520
|
is_writable: r.union([r.literal(0), r.literal(1)])
|
1499
|
-
}),
|
1521
|
+
}), Qa = r.object({
|
1500
1522
|
user_id: r.number(),
|
1501
1523
|
email: r.string().email(),
|
1502
1524
|
fullname: r.string(),
|
1503
1525
|
created_at: r.string(),
|
1504
1526
|
created_at_timestamp: r.number(),
|
1505
1527
|
admin_rights: r.array(r.string()),
|
1506
|
-
languages: r.array(
|
1528
|
+
languages: r.array(Wa),
|
1507
1529
|
is_admin: r.boolean(),
|
1508
1530
|
is_reviewer: r.boolean()
|
1509
|
-
}),
|
1531
|
+
}), Xa = r.object({
|
1510
1532
|
project_id: r.string(),
|
1511
|
-
contributors: r.array(
|
1512
|
-
}),
|
1533
|
+
contributors: r.array(Qa)
|
1534
|
+
}), Ya = Q({
|
1513
1535
|
description: "Get the details of a project contributor",
|
1514
1536
|
requestHeaderSchema: Z,
|
1515
1537
|
requestPathParamsSchema: r.object({ projectId: r.string(), contributorId: r.number() }),
|
1516
1538
|
pathResolver: ({ projectId: e, contributorId: t }) => `/projects/${e}/contributors/${t}`,
|
1517
|
-
successResponseBodySchema:
|
1518
|
-
}),
|
1539
|
+
successResponseBodySchema: Xa
|
1540
|
+
}), Va = {
|
1519
1541
|
projectUserKey: (e, t) => ["RetrieveContributor", e, t]
|
1520
|
-
},
|
1542
|
+
}, Za = (e, t, n) => D({
|
1521
1543
|
...n,
|
1522
|
-
queryFn: async ({ queryKey: [
|
1523
|
-
pathParams: { projectId:
|
1544
|
+
queryFn: async ({ queryKey: [a, o, i] }) => W(e, Ya, {
|
1545
|
+
pathParams: { projectId: o, contributorId: i },
|
1524
1546
|
headers: await t.resolve()
|
1525
1547
|
})
|
1526
1548
|
});
|
1527
|
-
function
|
1528
|
-
const
|
1529
|
-
return
|
1530
|
-
queryKey:
|
1531
|
-
enabled:
|
1549
|
+
function Yo(e, t, n) {
|
1550
|
+
const a = Qt();
|
1551
|
+
return Za(e, t, {
|
1552
|
+
queryKey: Va.projectUserKey(n, (a == null ? void 0 : a.userId) ?? 0),
|
1553
|
+
enabled: a !== void 0
|
1532
1554
|
});
|
1533
1555
|
}
|
1534
|
-
const
|
1556
|
+
const eo = r.object({
|
1535
1557
|
lang_iso: r.string(),
|
1536
1558
|
custom_iso: r.string().optional()
|
1537
|
-
}),
|
1559
|
+
}), to = r.object({
|
1538
1560
|
language_id: r.number(),
|
1539
1561
|
language_iso: r.string(),
|
1540
1562
|
progress: r.number(),
|
1541
1563
|
words_to_do: r.number()
|
1542
|
-
}),
|
1564
|
+
}), no = r.object({
|
1543
1565
|
projectId: r.string()
|
1544
|
-
}),
|
1566
|
+
}), ro = r.object({
|
1545
1567
|
lang_id: r.number(),
|
1546
1568
|
lang_iso: r.string(),
|
1547
1569
|
lang_name: r.string(),
|
1548
1570
|
is_rtl: r.boolean(),
|
1549
1571
|
plural_forms: r.array(r.string().optional())
|
1550
|
-
}),
|
1572
|
+
}), ao = r.object({
|
1551
1573
|
project_id: r.string(),
|
1552
1574
|
project_uuid: r.string().uuid(),
|
1553
|
-
languages: r.array(
|
1554
|
-
}),
|
1575
|
+
languages: r.array(ro)
|
1576
|
+
}), oo = r.object({
|
1555
1577
|
projectId: r.string()
|
1556
|
-
}),
|
1578
|
+
}), so = r.object({
|
1557
1579
|
langs: r.array(
|
1558
1580
|
r.object({
|
1559
1581
|
lang_iso: r.string(),
|
1560
1582
|
base_lang: r.boolean()
|
1561
1583
|
})
|
1562
1584
|
)
|
1563
|
-
}),
|
1585
|
+
}), io = r.object({
|
1564
1586
|
success: r.boolean()
|
1565
|
-
}),
|
1587
|
+
}), co = Q({
|
1566
1588
|
description: "List of project languages",
|
1567
1589
|
requestHeaderSchema: Z,
|
1568
|
-
requestPathParamsSchema:
|
1590
|
+
requestPathParamsSchema: no,
|
1569
1591
|
pathResolver: ({ projectId: e }) => `/projects/${e}/languages`,
|
1570
|
-
successResponseBodySchema:
|
1571
|
-
}),
|
1592
|
+
successResponseBodySchema: ao
|
1593
|
+
}), lo = mn({
|
1572
1594
|
description: "Bulk update project languages",
|
1573
1595
|
requestHeaderSchema: Z,
|
1574
1596
|
method: "put",
|
1575
|
-
requestPathParamsSchema:
|
1597
|
+
requestPathParamsSchema: oo,
|
1576
1598
|
pathResolver: ({ projectId: e }) => `/projects/${e}/languages/bulk-update`,
|
1577
|
-
requestBodySchema:
|
1578
|
-
successResponseBodySchema:
|
1599
|
+
requestBodySchema: so,
|
1600
|
+
successResponseBodySchema: io
|
1579
1601
|
}), de = Z, Ge = r.union([
|
1580
1602
|
r.literal("localization_files"),
|
1581
1603
|
r.literal("paged_documents"),
|
1582
1604
|
r.literal("marketing")
|
1583
|
-
]),
|
1605
|
+
]), uo = r.object({
|
1584
1606
|
per_platform_key_names: r.boolean(),
|
1585
1607
|
reviewing: r.boolean(),
|
1586
1608
|
auto_toggle_unverified: r.boolean(),
|
@@ -1591,7 +1613,7 @@ const ta = r.object({
|
|
1591
1613
|
custom_translation_statuses_allow_multiple: r.boolean(),
|
1592
1614
|
segmentation: r.boolean(),
|
1593
1615
|
contributor_preview_download_enabled: r.boolean()
|
1594
|
-
}),
|
1616
|
+
}), mo = r.object({
|
1595
1617
|
not_reviewed: r.number(),
|
1596
1618
|
unverified: r.number(),
|
1597
1619
|
spelling_grammar: r.number(),
|
@@ -1608,14 +1630,14 @@ const ta = r.object({
|
|
1608
1630
|
double_space: r.number(),
|
1609
1631
|
special_placeholder: r.number(),
|
1610
1632
|
unbalanced_brackets: r.number()
|
1611
|
-
}),
|
1633
|
+
}), fo = r.object({
|
1612
1634
|
progress_total: r.number(),
|
1613
1635
|
keys_total: r.number(),
|
1614
1636
|
team: r.number(),
|
1615
1637
|
base_words: r.number(),
|
1616
1638
|
qa_issues_total: r.number(),
|
1617
|
-
qa_issues:
|
1618
|
-
languages: r.array(
|
1639
|
+
qa_issues: mo,
|
1640
|
+
languages: r.array(to)
|
1619
1641
|
}), ue = r.object({
|
1620
1642
|
project_id: r.string(),
|
1621
1643
|
uuid: r.string().uuid(),
|
@@ -1629,16 +1651,16 @@ const ta = r.object({
|
|
1629
1651
|
team_id: r.number(),
|
1630
1652
|
base_language_id: r.number(),
|
1631
1653
|
base_language_iso: r.string(),
|
1632
|
-
settings:
|
1633
|
-
statistics:
|
1634
|
-
}),
|
1654
|
+
settings: uo.optional(),
|
1655
|
+
statistics: fo.optional()
|
1656
|
+
}), _o = r.object({
|
1635
1657
|
name: r.string(),
|
1636
1658
|
team_id: r.string(),
|
1637
1659
|
base_lang_iso: r.string(),
|
1638
|
-
languages: r.array(
|
1660
|
+
languages: r.array(eo),
|
1639
1661
|
project_type: Ge,
|
1640
1662
|
is_segmentation_enabled: r.boolean()
|
1641
|
-
}), Et = r.union([r.literal(0), r.literal(1)]),
|
1663
|
+
}), Et = r.union([r.literal(0), r.literal(1)]), go = r.object({
|
1642
1664
|
filter_type: Ge.optional(),
|
1643
1665
|
filter_team_id: r.number().optional(),
|
1644
1666
|
filter_names: r.string().optional(),
|
@@ -1646,61 +1668,61 @@ const ta = r.object({
|
|
1646
1668
|
include_settings: Et.optional(),
|
1647
1669
|
limit: r.number().optional(),
|
1648
1670
|
page: r.number().optional()
|
1649
|
-
}),
|
1671
|
+
}), ho = r.object({
|
1650
1672
|
projects: r.array(ue)
|
1651
|
-
}),
|
1673
|
+
}), po = r.object({
|
1652
1674
|
project_id: r.string()
|
1653
|
-
}),
|
1675
|
+
}), bo = r.object({
|
1654
1676
|
project_id: r.string()
|
1655
|
-
}),
|
1677
|
+
}), vo = r.object({
|
1656
1678
|
name: r.string().min(1),
|
1657
1679
|
description: r.string().optional()
|
1658
|
-
}), me = () => "/projects",
|
1680
|
+
}), me = () => "/projects", To = He({
|
1659
1681
|
description: "Create a new project",
|
1660
1682
|
requestHeaderSchema: de,
|
1661
1683
|
method: "post",
|
1662
1684
|
pathResolver: me,
|
1663
|
-
requestBodySchema:
|
1685
|
+
requestBodySchema: _o,
|
1664
1686
|
successResponseBodySchema: ue
|
1665
|
-
}),
|
1687
|
+
}), yo = Q({
|
1666
1688
|
description: "List all projects",
|
1667
1689
|
requestHeaderSchema: de,
|
1668
1690
|
pathResolver: me,
|
1669
|
-
requestQuerySchema:
|
1670
|
-
successResponseBodySchema:
|
1671
|
-
}),
|
1691
|
+
requestQuerySchema: go,
|
1692
|
+
successResponseBodySchema: ho
|
1693
|
+
}), So = Q({
|
1672
1694
|
description: "Retrieve a project",
|
1673
1695
|
requestHeaderSchema: de,
|
1674
|
-
requestPathParamsSchema:
|
1696
|
+
requestPathParamsSchema: po,
|
1675
1697
|
pathResolver: ({ project_id: e }) => `${me()}/${e}`,
|
1676
1698
|
successResponseBodySchema: ue
|
1677
|
-
}),
|
1699
|
+
}), Eo = He({
|
1678
1700
|
description: "Update a project",
|
1679
1701
|
requestHeaderSchema: de,
|
1680
1702
|
method: "put",
|
1681
|
-
requestPathParamsSchema:
|
1703
|
+
requestPathParamsSchema: bo,
|
1682
1704
|
pathResolver: ({ project_id: e }) => `${me()}/${e}`,
|
1683
|
-
requestBodySchema:
|
1705
|
+
requestBodySchema: vo,
|
1684
1706
|
successResponseBodySchema: ue
|
1685
1707
|
});
|
1686
|
-
function
|
1708
|
+
function Vo(e, t, n = {}) {
|
1687
1709
|
return qe({
|
1688
1710
|
...n,
|
1689
|
-
mutationFn: async (
|
1711
|
+
mutationFn: async (a) => B(e, To, {
|
1690
1712
|
headers: await t.resolve(),
|
1691
|
-
body:
|
1713
|
+
body: a
|
1692
1714
|
})
|
1693
1715
|
});
|
1694
1716
|
}
|
1695
|
-
const
|
1717
|
+
const Zo = {
|
1696
1718
|
projectIdKey: (e) => ["listProjectLanguages", e]
|
1697
1719
|
};
|
1698
1720
|
function es(e, t, n) {
|
1699
1721
|
return D({
|
1700
1722
|
...n,
|
1701
|
-
queryFn: async ({ queryKey: [
|
1723
|
+
queryFn: async ({ queryKey: [a, o] }) => W(e, co, {
|
1702
1724
|
headers: await t.resolve(),
|
1703
|
-
pathParams: { projectId:
|
1725
|
+
pathParams: { projectId: o }
|
1704
1726
|
})
|
1705
1727
|
});
|
1706
1728
|
}
|
@@ -1710,109 +1732,109 @@ const ts = {
|
|
1710
1732
|
function ns(e, t, n) {
|
1711
1733
|
return D({
|
1712
1734
|
...n,
|
1713
|
-
queryFn: async ({ queryKey: [
|
1735
|
+
queryFn: async ({ queryKey: [a, o] }) => W(e, yo, {
|
1714
1736
|
headers: await t.resolve(),
|
1715
|
-
queryParams:
|
1737
|
+
queryParams: o
|
1716
1738
|
})
|
1717
1739
|
});
|
1718
1740
|
}
|
1719
1741
|
const rs = {
|
1720
1742
|
projectIdKey: (e) => ["retrieveProject", e]
|
1721
1743
|
};
|
1722
|
-
function
|
1744
|
+
function as(e, t, n) {
|
1723
1745
|
return D({
|
1724
1746
|
...n,
|
1725
|
-
queryFn: async ({ queryKey: [
|
1747
|
+
queryFn: async ({ queryKey: [a, o] }) => W(e, So, {
|
1726
1748
|
headers: await t.resolve(),
|
1727
|
-
pathParams: { project_id:
|
1749
|
+
pathParams: { project_id: o }
|
1728
1750
|
})
|
1729
1751
|
});
|
1730
1752
|
}
|
1731
|
-
function
|
1753
|
+
function os(e, t, n, a = {}) {
|
1732
1754
|
return qe({
|
1733
|
-
...
|
1734
|
-
mutationFn: async (
|
1755
|
+
...a,
|
1756
|
+
mutationFn: async (o) => B(e, Eo, {
|
1735
1757
|
headers: await t.resolve(),
|
1736
|
-
body:
|
1758
|
+
body: o,
|
1737
1759
|
pathParams: n
|
1738
1760
|
})
|
1739
1761
|
});
|
1740
1762
|
}
|
1741
|
-
function ss(e, t, n,
|
1763
|
+
function ss(e, t, n, a = {}) {
|
1742
1764
|
return qe({
|
1743
|
-
...
|
1744
|
-
mutationFn: async (
|
1765
|
+
...a,
|
1766
|
+
mutationFn: async (o) => B(e, lo, {
|
1745
1767
|
pathParams: t,
|
1746
1768
|
headers: await n.resolve(),
|
1747
|
-
body:
|
1769
|
+
body: o
|
1748
1770
|
})
|
1749
1771
|
});
|
1750
1772
|
}
|
1751
1773
|
export {
|
1752
|
-
$
|
1774
|
+
$o as Breadcrumbs,
|
1753
1775
|
qt as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
1754
1776
|
lr as ENTERPRISE_PLAN_IDS,
|
1755
1777
|
ir as ESSENTIAL_PLAN_IDS,
|
1756
1778
|
Ht as FREE_PLAN_ID,
|
1757
|
-
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1779
|
+
A as HeaderBuilder,
|
1780
|
+
Go as JwtAuthHeaderBuilderMiddleware,
|
1781
|
+
oe as NavigationPanel,
|
1782
|
+
Fo as NavigationTabs,
|
1761
1783
|
cr as PRO_PLAN_IDS,
|
1762
|
-
|
1784
|
+
Ko as PublicApiHeaderBuilderMiddleware,
|
1763
1785
|
sr as START_PLAN_IDS,
|
1764
|
-
|
1765
|
-
|
1786
|
+
I as Sidebar,
|
1787
|
+
P as SidebarTaskLanguageStatuses,
|
1766
1788
|
Oe as SidebarTaskStatuses,
|
1767
1789
|
re as SidebarTaskTypeOptions,
|
1768
|
-
|
1790
|
+
or as TRIAL_PLAN_ID,
|
1769
1791
|
se as UnauthorizedError,
|
1770
|
-
|
1792
|
+
lo as bulkUpdateProjectLanguages,
|
1771
1793
|
mr as convertNewLineToBreakTag,
|
1772
|
-
|
1773
|
-
|
1794
|
+
Kt as createHeaderBuilderMiddleware,
|
1795
|
+
To as createProject,
|
1774
1796
|
hr as formatDate,
|
1775
|
-
|
1776
|
-
|
1777
|
-
|
1778
|
-
|
1797
|
+
Do as formatDateTz,
|
1798
|
+
Jo as generateTokenFromClassicSession,
|
1799
|
+
zo as getAuthenticatedSessionDetailFromRequest,
|
1800
|
+
xa as getCsrfTokenFromCookie,
|
1779
1801
|
Jt as getJwtTokenFromCookie,
|
1780
|
-
|
1781
|
-
|
1802
|
+
Ka as getTeamUser,
|
1803
|
+
za as getTeamUsersQueryKey,
|
1782
1804
|
Fe as getUserToken,
|
1783
|
-
|
1784
|
-
|
1785
|
-
|
1786
|
-
|
1805
|
+
Ba as getUserTokenKey,
|
1806
|
+
Bo as isEnterpriseOpenSourcePlan,
|
1807
|
+
Ho as isEnterprisePlan,
|
1808
|
+
Mo as isEssentialPlan,
|
1787
1809
|
De as isFreePlan,
|
1788
|
-
|
1789
|
-
|
1790
|
-
|
1810
|
+
qo as isPaidPlan,
|
1811
|
+
Uo as isProPlan,
|
1812
|
+
Lo as isStartPlan,
|
1791
1813
|
Bt as isTrialPlan,
|
1792
|
-
|
1793
|
-
|
1794
|
-
|
1814
|
+
co as listProjectLanguages,
|
1815
|
+
Zo as listProjectLanguagesKey,
|
1816
|
+
yo as listProjects,
|
1795
1817
|
ts as listProjectsKey,
|
1796
1818
|
gr as makeUrlClickable,
|
1797
1819
|
V as parseJwtTokenPayload,
|
1798
|
-
|
1799
|
-
|
1800
|
-
|
1801
|
-
|
1820
|
+
Wo as refreshExpiredToken,
|
1821
|
+
Ya as retrieveContributor,
|
1822
|
+
Va as retrieveContributorKeys,
|
1823
|
+
So as retrieveProject,
|
1802
1824
|
rs as retrieveProjectQueryKey,
|
1803
|
-
|
1804
|
-
|
1825
|
+
Eo as updateProject,
|
1826
|
+
Yo as useAuthenticatedProjectContributor,
|
1805
1827
|
Qt as useAuthenticatedSessionPayload,
|
1806
|
-
|
1828
|
+
Xo as useAuthenticatedUser,
|
1807
1829
|
ss as useBulkUpdateProjectLanguagesMutation,
|
1808
|
-
|
1830
|
+
Vo as useCreateProjectMutation,
|
1809
1831
|
$e as useEffectOnce,
|
1810
|
-
|
1811
|
-
|
1812
|
-
|
1832
|
+
Qo as useGetPromotedClassicSessionJwtQuery,
|
1833
|
+
Ja as useGetTeamUsersQuery,
|
1834
|
+
Da as useGetUserTokenQuery,
|
1813
1835
|
es as useListProjectLanguagesQuery,
|
1814
1836
|
ns as useListProjectsQuery,
|
1815
|
-
|
1816
|
-
|
1817
|
-
|
1837
|
+
Za as useRetrieveContributorQuery,
|
1838
|
+
as as useRetrieveProjectQuery,
|
1839
|
+
os as useUpdateProjectMutation
|
1818
1840
|
};
|