@lokalise/harmony 1.4.0-exp-sidebarComponent.1 → 1.4.0-exp-sidebarComponent.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.css +1 -1
- package/dist/harmony.mjs +927 -286
- package/dist/types/src/node.d.ts +1 -0
- package/package.json +4 -3
package/dist/harmony.mjs
CHANGED
@@ -1,391 +1,1032 @@
|
|
1
|
-
import { jsx as
|
2
|
-
import * as
|
3
|
-
import { useRef as
|
4
|
-
import {
|
5
|
-
import {
|
6
|
-
|
7
|
-
|
1
|
+
import { jsx as o, jsxs as g, Fragment as ht } from "react/jsx-runtime";
|
2
|
+
import * as M from "react";
|
3
|
+
import { useRef as pt, useState as E, useCallback as ue, useEffect as me, cloneElement as gt, createContext as Ye, useContext as Ze } from "react";
|
4
|
+
import { Tooltip as q, Link as j, Menu as he, MenuList as pe, HelpCenterIcon as _t, ConfirmModal as vt, Alert as bt, Tag as we, Button as Ce, MenuItem as W, Spacer as Tt, Loading as yt, Popover as wt, DeprecatedTaskIcon as Ct, CaretUpIcon as kt, UserIcon as Xe } from "@lokalise/louis";
|
5
|
+
import { format as Qe, parseISO as xt } from "date-fns";
|
6
|
+
import { toZonedTime as St } from "date-fns-tz";
|
7
|
+
var z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
8
|
+
function Je(e) {
|
8
9
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
9
10
|
}
|
10
|
-
var
|
11
|
-
function
|
12
|
-
if (
|
13
|
-
|
14
|
-
function e(
|
15
|
-
var
|
16
|
-
return
|
11
|
+
var V, ke;
|
12
|
+
function ge() {
|
13
|
+
if (ke) return V;
|
14
|
+
ke = 1;
|
15
|
+
function e(t) {
|
16
|
+
var r = typeof t;
|
17
|
+
return t != null && (r == "object" || r == "function");
|
17
18
|
}
|
18
|
-
return
|
19
|
+
return V = e, V;
|
19
20
|
}
|
20
|
-
var
|
21
|
-
function
|
22
|
-
if (
|
23
|
-
|
24
|
-
var e = typeof
|
25
|
-
return
|
21
|
+
var Y, xe;
|
22
|
+
function It() {
|
23
|
+
if (xe) return Y;
|
24
|
+
xe = 1;
|
25
|
+
var e = typeof z == "object" && z && z.Object === Object && z;
|
26
|
+
return Y = e, Y;
|
26
27
|
}
|
27
|
-
var
|
28
|
-
function
|
29
|
-
if (
|
30
|
-
|
31
|
-
var e =
|
32
|
-
return
|
28
|
+
var Z, Se;
|
29
|
+
function Ke() {
|
30
|
+
if (Se) return Z;
|
31
|
+
Se = 1;
|
32
|
+
var e = It(), t = typeof self == "object" && self && self.Object === Object && self, r = e || t || Function("return this")();
|
33
|
+
return Z = r, Z;
|
33
34
|
}
|
34
|
-
var
|
35
|
-
function
|
36
|
-
if (
|
37
|
-
|
38
|
-
var e =
|
35
|
+
var X, Ie;
|
36
|
+
function Et() {
|
37
|
+
if (Ie) return X;
|
38
|
+
Ie = 1;
|
39
|
+
var e = Ke(), t = function() {
|
39
40
|
return e.Date.now();
|
40
41
|
};
|
41
|
-
return
|
42
|
+
return X = t, X;
|
42
43
|
}
|
43
|
-
var
|
44
|
-
function
|
45
|
-
if (
|
46
|
-
|
44
|
+
var Q, Ee;
|
45
|
+
function Nt() {
|
46
|
+
if (Ee) return Q;
|
47
|
+
Ee = 1;
|
47
48
|
var e = /\s/;
|
48
|
-
function r
|
49
|
-
for (var
|
49
|
+
function t(r) {
|
50
|
+
for (var n = r.length; n-- && e.test(r.charAt(n)); )
|
50
51
|
;
|
51
|
-
return
|
52
|
+
return n;
|
52
53
|
}
|
53
|
-
return
|
54
|
+
return Q = t, Q;
|
54
55
|
}
|
55
|
-
var
|
56
|
-
function
|
57
|
-
if (
|
58
|
-
|
59
|
-
var e =
|
60
|
-
function n
|
61
|
-
return
|
56
|
+
var J, Ne;
|
57
|
+
function Pt() {
|
58
|
+
if (Ne) return J;
|
59
|
+
Ne = 1;
|
60
|
+
var e = Nt(), t = /^\s+/;
|
61
|
+
function r(n) {
|
62
|
+
return n && n.slice(0, e(n) + 1).replace(t, "");
|
62
63
|
}
|
63
|
-
return
|
64
|
+
return J = r, J;
|
64
65
|
}
|
65
|
-
var
|
66
|
-
function
|
67
|
-
if (
|
68
|
-
|
69
|
-
var e =
|
70
|
-
return
|
66
|
+
var K, Pe;
|
67
|
+
function et() {
|
68
|
+
if (Pe) return K;
|
69
|
+
Pe = 1;
|
70
|
+
var e = Ke(), t = e.Symbol;
|
71
|
+
return K = t, K;
|
71
72
|
}
|
72
|
-
var
|
73
|
-
function
|
74
|
-
if (
|
75
|
-
|
76
|
-
var e =
|
77
|
-
function a
|
78
|
-
var
|
73
|
+
var ee, Le;
|
74
|
+
function Lt() {
|
75
|
+
if (Le) return ee;
|
76
|
+
Le = 1;
|
77
|
+
var e = et(), t = Object.prototype, r = t.hasOwnProperty, n = t.toString, i = e ? e.toStringTag : void 0;
|
78
|
+
function s(a) {
|
79
|
+
var l = r.call(a, i), d = a[i];
|
79
80
|
try {
|
80
|
-
|
81
|
-
var
|
81
|
+
a[i] = void 0;
|
82
|
+
var c = !0;
|
82
83
|
} catch {
|
83
84
|
}
|
84
|
-
var
|
85
|
-
return
|
85
|
+
var u = n.call(a);
|
86
|
+
return c && (l ? a[i] = d : delete a[i]), u;
|
86
87
|
}
|
87
|
-
return
|
88
|
+
return ee = s, ee;
|
88
89
|
}
|
89
|
-
var
|
90
|
-
function
|
91
|
-
if (
|
92
|
-
|
93
|
-
var e = Object.prototype,
|
94
|
-
function n
|
95
|
-
return
|
90
|
+
var te, Re;
|
91
|
+
function Rt() {
|
92
|
+
if (Re) return te;
|
93
|
+
Re = 1;
|
94
|
+
var e = Object.prototype, t = e.toString;
|
95
|
+
function r(n) {
|
96
|
+
return t.call(n);
|
96
97
|
}
|
97
|
-
return
|
98
|
+
return te = r, te;
|
98
99
|
}
|
99
|
-
var
|
100
|
-
function
|
101
|
-
if (
|
102
|
-
|
103
|
-
var e =
|
104
|
-
function
|
105
|
-
return
|
100
|
+
var ne, je;
|
101
|
+
function jt() {
|
102
|
+
if (je) return ne;
|
103
|
+
je = 1;
|
104
|
+
var e = et(), t = Lt(), r = Rt(), n = "[object Null]", i = "[object Undefined]", s = e ? e.toStringTag : void 0;
|
105
|
+
function a(l) {
|
106
|
+
return l == null ? l === void 0 ? i : n : s && s in Object(l) ? t(l) : r(l);
|
106
107
|
}
|
107
|
-
return
|
108
|
+
return ne = a, ne;
|
108
109
|
}
|
109
|
-
var
|
110
|
-
function
|
111
|
-
if (
|
112
|
-
|
113
|
-
function e(
|
114
|
-
return
|
110
|
+
var re, Oe;
|
111
|
+
function Ot() {
|
112
|
+
if (Oe) return re;
|
113
|
+
Oe = 1;
|
114
|
+
function e(t) {
|
115
|
+
return t != null && typeof t == "object";
|
115
116
|
}
|
116
|
-
return
|
117
|
+
return re = e, re;
|
117
118
|
}
|
118
|
-
var
|
119
|
-
function
|
120
|
-
if (
|
121
|
-
|
122
|
-
var e =
|
123
|
-
function
|
124
|
-
return typeof i == "symbol" ||
|
119
|
+
var oe, Ae;
|
120
|
+
function At() {
|
121
|
+
if (Ae) return oe;
|
122
|
+
Ae = 1;
|
123
|
+
var e = jt(), t = Ot(), r = "[object Symbol]";
|
124
|
+
function n(i) {
|
125
|
+
return typeof i == "symbol" || t(i) && e(i) == r;
|
125
126
|
}
|
126
|
-
return
|
127
|
+
return oe = n, oe;
|
127
128
|
}
|
128
|
-
var
|
129
|
-
function
|
130
|
-
if (
|
131
|
-
|
132
|
-
var e =
|
133
|
-
function c
|
134
|
-
if (typeof
|
135
|
-
return
|
136
|
-
if (
|
137
|
-
return
|
138
|
-
if (
|
139
|
-
var
|
140
|
-
|
129
|
+
var ie, Me;
|
130
|
+
function Mt() {
|
131
|
+
if (Me) return ie;
|
132
|
+
Me = 1;
|
133
|
+
var e = Pt(), t = ge(), r = At(), n = NaN, i = /^[-+]0x[0-9a-f]+$/i, s = /^0b[01]+$/i, a = /^0o[0-7]+$/i, l = parseInt;
|
134
|
+
function d(c) {
|
135
|
+
if (typeof c == "number")
|
136
|
+
return c;
|
137
|
+
if (r(c))
|
138
|
+
return n;
|
139
|
+
if (t(c)) {
|
140
|
+
var u = typeof c.valueOf == "function" ? c.valueOf() : c;
|
141
|
+
c = t(u) ? u + "" : u;
|
141
142
|
}
|
142
|
-
if (typeof
|
143
|
-
return
|
144
|
-
|
145
|
-
var h =
|
146
|
-
return h ||
|
143
|
+
if (typeof c != "string")
|
144
|
+
return c === 0 ? c : +c;
|
145
|
+
c = e(c);
|
146
|
+
var h = s.test(c);
|
147
|
+
return h || a.test(c) ? l(c.slice(2), h ? 2 : 8) : i.test(c) ? n : +c;
|
147
148
|
}
|
148
|
-
return
|
149
|
+
return ie = d, ie;
|
149
150
|
}
|
150
|
-
var
|
151
|
-
function
|
152
|
-
if (
|
153
|
-
|
154
|
-
var e =
|
155
|
-
function
|
156
|
-
var
|
157
|
-
if (typeof
|
158
|
-
throw new TypeError(
|
159
|
-
|
160
|
-
function
|
161
|
-
var
|
162
|
-
return
|
151
|
+
var se, qe;
|
152
|
+
function tt() {
|
153
|
+
if (qe) return se;
|
154
|
+
qe = 1;
|
155
|
+
var e = ge(), t = Et(), r = Mt(), n = "Expected a function", i = Math.max, s = Math.min;
|
156
|
+
function a(l, d, c) {
|
157
|
+
var u, h, _, v, f, w, b = 0, p = !1, m = !1, T = !0;
|
158
|
+
if (typeof l != "function")
|
159
|
+
throw new TypeError(n);
|
160
|
+
d = r(d) || 0, e(c) && (p = !!c.leading, m = "maxWait" in c, _ = m ? i(r(c.maxWait) || 0, d) : _, T = "trailing" in c ? !!c.trailing : T);
|
161
|
+
function k(y) {
|
162
|
+
var I = u, O = h;
|
163
|
+
return u = h = void 0, b = y, v = l.apply(O, I), v;
|
163
164
|
}
|
164
|
-
function
|
165
|
-
return
|
165
|
+
function C(y) {
|
166
|
+
return b = y, f = setTimeout(U, d), p ? k(y) : v;
|
166
167
|
}
|
167
|
-
function
|
168
|
-
var
|
169
|
-
return
|
168
|
+
function $(y) {
|
169
|
+
var I = y - w, O = y - b, ye = d - I;
|
170
|
+
return m ? s(ye, _ - O) : ye;
|
170
171
|
}
|
171
|
-
function
|
172
|
-
var
|
173
|
-
return
|
172
|
+
function be(y) {
|
173
|
+
var I = y - w, O = y - b;
|
174
|
+
return w === void 0 || I >= d || I < 0 || m && O >= _;
|
174
175
|
}
|
175
|
-
function
|
176
|
-
var
|
177
|
-
if (
|
178
|
-
return
|
179
|
-
|
176
|
+
function U() {
|
177
|
+
var y = t();
|
178
|
+
if (be(y))
|
179
|
+
return Te(y);
|
180
|
+
f = setTimeout(U, $(y));
|
180
181
|
}
|
181
|
-
function
|
182
|
-
return
|
182
|
+
function Te(y) {
|
183
|
+
return f = void 0, T && u ? k(y) : (u = h = void 0, v);
|
183
184
|
}
|
184
|
-
function
|
185
|
-
|
185
|
+
function ft() {
|
186
|
+
f !== void 0 && clearTimeout(f), b = 0, u = w = h = f = void 0;
|
186
187
|
}
|
187
|
-
function
|
188
|
-
return
|
188
|
+
function mt() {
|
189
|
+
return f === void 0 ? v : Te(t());
|
189
190
|
}
|
190
|
-
function
|
191
|
-
var
|
192
|
-
if (
|
193
|
-
if (
|
194
|
-
return
|
195
|
-
if (
|
196
|
-
return clearTimeout(
|
191
|
+
function G() {
|
192
|
+
var y = t(), I = be(y);
|
193
|
+
if (u = arguments, h = this, w = y, I) {
|
194
|
+
if (f === void 0)
|
195
|
+
return C(w);
|
196
|
+
if (m)
|
197
|
+
return clearTimeout(f), f = setTimeout(U, d), k(w);
|
197
198
|
}
|
198
|
-
return
|
199
|
+
return f === void 0 && (f = setTimeout(U, d)), v;
|
199
200
|
}
|
200
|
-
return
|
201
|
+
return G.cancel = ft, G.flush = mt, G;
|
201
202
|
}
|
202
|
-
return
|
203
|
+
return se = a, se;
|
203
204
|
}
|
204
|
-
var
|
205
|
-
const
|
206
|
-
var
|
207
|
-
function
|
208
|
-
if (
|
209
|
-
|
210
|
-
var e =
|
211
|
-
function
|
212
|
-
var
|
205
|
+
var qt = tt();
|
206
|
+
const Dt = /* @__PURE__ */ Je(qt);
|
207
|
+
var ae, De;
|
208
|
+
function Bt() {
|
209
|
+
if (De) return ae;
|
210
|
+
De = 1;
|
211
|
+
var e = tt(), t = ge(), r = "Expected a function";
|
212
|
+
function n(i, s, a) {
|
213
|
+
var l = !0, d = !0;
|
213
214
|
if (typeof i != "function")
|
214
|
-
throw new TypeError(
|
215
|
-
return
|
216
|
-
leading:
|
217
|
-
maxWait:
|
218
|
-
trailing:
|
215
|
+
throw new TypeError(r);
|
216
|
+
return t(a) && (l = "leading" in a ? !!a.leading : l, d = "trailing" in a ? !!a.trailing : d), e(i, s, {
|
217
|
+
leading: l,
|
218
|
+
maxWait: s,
|
219
|
+
trailing: d
|
219
220
|
});
|
220
221
|
}
|
221
|
-
return
|
222
|
+
return ae = n, ae;
|
222
223
|
}
|
223
|
-
var $
|
224
|
-
const
|
225
|
-
switch (
|
224
|
+
var $t = Bt();
|
225
|
+
const Ut = /* @__PURE__ */ Je($t), zt = (e, t, r, n) => {
|
226
|
+
switch (t) {
|
226
227
|
case "debounce":
|
227
|
-
return
|
228
|
+
return Dt(e, r, n);
|
228
229
|
case "throttle":
|
229
|
-
return
|
230
|
+
return Ut(e, r, n);
|
230
231
|
default:
|
231
232
|
return e;
|
232
233
|
}
|
233
|
-
},
|
234
|
+
}, Ft = (
|
234
235
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
235
236
|
(e) => {
|
236
|
-
const
|
237
|
-
return
|
238
|
-
|
239
|
-
}),
|
240
|
-
var
|
241
|
-
return (
|
237
|
+
const t = M.useRef(e);
|
238
|
+
return M.useEffect(() => {
|
239
|
+
t.current = e;
|
240
|
+
}), M.useMemo(() => (...r) => {
|
241
|
+
var n;
|
242
|
+
return (n = t.current) === null || n === void 0 ? void 0 : n.call(t, ...r);
|
242
243
|
}, []);
|
243
244
|
}
|
244
|
-
),
|
245
|
+
), Ht = (
|
245
246
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
246
247
|
(e) => {
|
247
|
-
const [
|
248
|
+
const [t, r] = M.useState((e == null ? void 0 : e.current) || null);
|
248
249
|
return e && setTimeout(() => {
|
249
|
-
e.current !==
|
250
|
-
}, 0), { refProxy:
|
251
|
-
i !==
|
250
|
+
e.current !== t && r(e.current);
|
251
|
+
}, 0), { refProxy: M.useMemo(() => new Proxy((i) => {
|
252
|
+
i !== t && r(i);
|
252
253
|
}, {
|
253
|
-
get(i,
|
254
|
-
return
|
254
|
+
get(i, s) {
|
255
|
+
return s === "current" ? t : i[s];
|
255
256
|
},
|
256
|
-
set(i,
|
257
|
-
return
|
257
|
+
set(i, s, a) {
|
258
|
+
return s === "current" ? r(a) : i[s] = a, !0;
|
258
259
|
}
|
259
|
-
}), [
|
260
|
+
}), [t]), refElement: t, setRefElement: r };
|
260
261
|
}
|
261
|
-
),
|
262
|
+
), Wt = (e, t) => t === "border-box" ? {
|
262
263
|
width: e.borderBoxSize[0].inlineSize,
|
263
264
|
height: e.borderBoxSize[0].blockSize
|
264
|
-
} :
|
265
|
+
} : t === "content-box" ? {
|
265
266
|
width: e.contentBoxSize[0].inlineSize,
|
266
267
|
height: e.contentBoxSize[0].blockSize
|
267
268
|
} : {
|
268
269
|
width: e.contentRect.width,
|
269
270
|
height: e.contentRect.height
|
270
271
|
};
|
271
|
-
function
|
272
|
-
const
|
272
|
+
function Gt({ skipOnMount: e = !1, refreshMode: t, refreshRate: r = 1e3, refreshOptions: n, handleWidth: i = !0, handleHeight: s = !0, targetRef: a, observerOptions: l, onResize: d } = {}) {
|
273
|
+
const c = pt(e), u = Ft(d), [h, _] = E({
|
273
274
|
width: void 0,
|
274
275
|
height: void 0
|
275
|
-
}), { refProxy:
|
276
|
-
if (!i && !
|
276
|
+
}), { refProxy: v, refElement: f } = Ht(a), { box: w } = l || {}, b = ue((m) => {
|
277
|
+
if (!i && !s)
|
277
278
|
return;
|
278
|
-
if (
|
279
|
-
|
279
|
+
if (c.current) {
|
280
|
+
c.current = !1;
|
280
281
|
return;
|
281
282
|
}
|
282
|
-
const
|
283
|
-
|
284
|
-
const
|
285
|
-
|
286
|
-
width:
|
287
|
-
height:
|
288
|
-
entry:
|
289
|
-
}),
|
283
|
+
const T = (k, C) => i && k.width !== C.width || s && k.height !== C.height;
|
284
|
+
m.forEach((k) => {
|
285
|
+
const C = Wt(k, w);
|
286
|
+
_(($) => T($, C) ? (u == null || u({
|
287
|
+
width: C.width,
|
288
|
+
height: C.height,
|
289
|
+
entry: k
|
290
|
+
}), C) : $);
|
290
291
|
});
|
291
|
-
}, [i,
|
292
|
-
|
292
|
+
}, [i, s, c, w]), p = ue(zt(b, t, r, n), [
|
293
|
+
b,
|
294
|
+
t,
|
293
295
|
r,
|
294
|
-
n
|
295
|
-
t
|
296
|
+
n
|
296
297
|
]);
|
297
|
-
return
|
298
|
-
let
|
299
|
-
return
|
298
|
+
return me(() => {
|
299
|
+
let m;
|
300
|
+
return f ? (m = new window.ResizeObserver(p), m.observe(f, l)) : (h.width || h.height) && (u == null || u({
|
300
301
|
width: null,
|
301
302
|
height: null,
|
302
303
|
entry: null
|
303
|
-
}),
|
304
|
-
var
|
305
|
-
(
|
304
|
+
}), _({ width: void 0, height: void 0 })), () => {
|
305
|
+
var T, k, C;
|
306
|
+
(T = m == null ? void 0 : m.disconnect) === null || T === void 0 || T.call(m), (C = (k = p).cancel) === null || C === void 0 || C.call(k);
|
306
307
|
};
|
307
|
-
}, [
|
308
|
+
}, [p, f]), Object.assign({ ref: v }, h);
|
308
309
|
}
|
309
|
-
function
|
310
|
-
var r, n
|
311
|
-
if (typeof e == "string" || typeof e == "number")
|
310
|
+
function nt(e) {
|
311
|
+
var t, r, n = "";
|
312
|
+
if (typeof e == "string" || typeof e == "number") n += e;
|
312
313
|
else if (typeof e == "object") if (Array.isArray(e)) {
|
313
314
|
var i = e.length;
|
314
|
-
for (
|
315
|
-
} else for (
|
316
|
-
return
|
315
|
+
for (t = 0; t < i; t++) e[t] && (r = nt(e[t])) && (n && (n += " "), n += r);
|
316
|
+
} else for (r in e) e[r] && (n && (n += " "), n += r);
|
317
|
+
return n;
|
317
318
|
}
|
318
|
-
function
|
319
|
-
for (var e,
|
320
|
-
return
|
319
|
+
function N() {
|
320
|
+
for (var e, t, r = 0, n = "", i = arguments.length; r < i; r++) (e = arguments[r]) && (t = nt(e)) && (n && (n += " "), n += t);
|
321
|
+
return n;
|
321
322
|
}
|
322
|
-
const
|
323
|
-
headerContainer:
|
324
|
-
headerContent:
|
325
|
-
staticEnabled:
|
326
|
-
},
|
327
|
-
const { ref:
|
323
|
+
const Vt = "_headerContainer_1cubo_1", Yt = "_headerContent_1cubo_34", Zt = "_staticEnabled_1cubo_50", fe = {
|
324
|
+
headerContainer: Vt,
|
325
|
+
headerContent: Yt,
|
326
|
+
staticEnabled: Zt
|
327
|
+
}, Xt = 77, H = ({ sticky: e, children: t }) => {
|
328
|
+
const { ref: r, height: n } = Gt({
|
328
329
|
refreshMode: "debounce",
|
329
330
|
refreshRate: 0
|
330
|
-
}), [i,
|
331
|
-
|
332
|
-
const
|
333
|
-
|
331
|
+
}), [i, s] = E(!1), a = () => i ? !e : !0;
|
332
|
+
me(() => {
|
333
|
+
const d = () => {
|
334
|
+
s(window.scrollY > 0);
|
334
335
|
};
|
335
|
-
return window.addEventListener("scroll",
|
336
|
+
return window.addEventListener("scroll", d), () => window.removeEventListener("scroll", d);
|
336
337
|
}, []);
|
337
|
-
const
|
338
|
-
return /* @__PURE__ */
|
338
|
+
const l = `${n || Xt}px`;
|
339
|
+
return /* @__PURE__ */ o("div", { style: { minHeight: l }, children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ g(
|
339
340
|
"div",
|
340
341
|
{
|
341
|
-
ref:
|
342
|
-
className:
|
343
|
-
[
|
342
|
+
ref: r,
|
343
|
+
className: N(fe.headerContent, {
|
344
|
+
[fe.staticEnabled]: a()
|
344
345
|
}),
|
345
346
|
children: [
|
346
|
-
/* @__PURE__ */
|
347
|
-
/* @__PURE__ */
|
348
|
-
|
347
|
+
/* @__PURE__ */ o(H.Header, {}),
|
348
|
+
/* @__PURE__ */ o(H.Tabs, {}),
|
349
|
+
t
|
349
350
|
]
|
350
351
|
}
|
351
352
|
) }) });
|
352
353
|
};
|
353
|
-
|
354
|
-
|
355
|
-
const
|
356
|
-
|
357
|
-
|
354
|
+
H.Header = ({ children: e }) => /* @__PURE__ */ o("div", { className: fe.headerContainer, children: e });
|
355
|
+
H.Tabs = ({ children: e }) => /* @__PURE__ */ o("div", { className: "flex justify-between gap-2 nowrap", children: e });
|
356
|
+
const Qt = "_sidebarContainer_1qc9v_1", Jt = {
|
357
|
+
sidebarContainer: Qt
|
358
|
+
}, Kt = "_logoLink_1tgpl_1", en = {
|
359
|
+
logoLink: Kt
|
360
|
+
}, tn = ({ src: e, href: t = "/", ariaLabel: r = "Home", alt: n = "Lokalise" }) => /* @__PURE__ */ o("a", { className: en.logoLink, href: t, "aria-label": r, children: /* @__PURE__ */ o("img", { src: e, alt: n }) }), nn = "_link_2ptl6_1", rn = "_active_2ptl6_18", Be = {
|
361
|
+
link: nn,
|
362
|
+
active: rn
|
363
|
+
}, on = ({ label: e, to: t, icon: r }) => /* @__PURE__ */ o(q, { placement: "right", tooltip: e, children: /* @__PURE__ */ o(
|
364
|
+
j,
|
365
|
+
{
|
366
|
+
className: N(Be.link, {
|
367
|
+
[Be.active]: window.location.pathname.startsWith(t)
|
368
|
+
}),
|
369
|
+
href: t,
|
370
|
+
children: r
|
371
|
+
}
|
372
|
+
) }), sn = "_dropdownButton_t7otz_1", an = "_dropdownButtonActive_t7otz_18", $e = {
|
373
|
+
dropdownButton: sn,
|
374
|
+
dropdownButtonActive: an
|
375
|
+
}, cn = ({ children: e }) => /* @__PURE__ */ o(
|
376
|
+
he,
|
377
|
+
{
|
378
|
+
menuButton: ({ opened: t }) => /* @__PURE__ */ o(q, { placement: "right", tooltip: "Help", children: /* @__PURE__ */ o(
|
379
|
+
"button",
|
380
|
+
{
|
381
|
+
className: N($e.dropdownButton, {
|
382
|
+
[$e.dropdownButtonActive]: t
|
383
|
+
}),
|
384
|
+
children: /* @__PURE__ */ o(_t, { size: "24px" })
|
385
|
+
}
|
386
|
+
) }),
|
387
|
+
children: /* @__PURE__ */ o(pe, { placement: "right-start", children: e })
|
388
|
+
}
|
389
|
+
), x = {
|
390
|
+
TaskCompleted: "task_completed",
|
391
|
+
TaskClosed: "task_closed",
|
392
|
+
Refresh: "refresh",
|
393
|
+
ShowDialog: "show_dialog"
|
394
|
+
}, rt = 0, ln = 9999, dn = [150, 151, 250, 251], un = [152, 153, 252, 253], fn = [154, 155, 157, 158, 254, 255, 258, 354, 355, 358], mn = [156, 159, 160, 256, 259, 260], ot = 9998, _e = (e) => e === rt, it = (e) => e === ln, Ar = (e) => dn.includes(e), Mr = (e) => un.includes(e), qr = (e) => fn.includes(e), Dr = (e) => mn.includes(e), Br = (e) => e > rt && e < ot, $r = (e) => e === ot, hn = /\n/, Ue = (e, t, r) => e.split(t).flatMap((n, i) => i !== 0 ? [gt(r, { key: Math.random().toString(32).slice(0, 10) }), n] : n), pn = (e, t, r) => typeof e == "string" ? Ue(e, t, r) : e.flatMap((n) => typeof n == "string" ? Ue(n, t, r) : n), gn = (e) => pn(e, hn, /* @__PURE__ */ o("br", {})), _n = /(\b(https?|):\/\/[-a-zA-Zа-яА-Я0-9+&@#/%?=~_|!:,.;]*[-a-zA-Zа-яА-Я0-9+&@#/%=~_|])/gi, vn = (e) => e.match(_n) ?? [], ze = (e, t, r) => {
|
395
|
+
const n = e.split(t);
|
396
|
+
if (n.length === 1)
|
358
397
|
return e;
|
359
398
|
const i = [];
|
360
|
-
return
|
361
|
-
/* @__PURE__ */
|
362
|
-
), i.push(
|
363
|
-
},
|
364
|
-
const
|
365
|
-
return
|
366
|
-
},
|
367
|
-
|
368
|
-
};
|
399
|
+
return n[0] !== "" && i.push(n[0]), n.shift(), n[n.length - 1] === "" && n.pop(), i.push(
|
400
|
+
/* @__PURE__ */ o("a", { href: t, target: "_blank", rel: "noreferrer noopener", children: t }, t + r)
|
401
|
+
), i.push(n.join(t)), i.filter((s) => s !== "");
|
402
|
+
}, Fe = (e) => {
|
403
|
+
const t = vn(e);
|
404
|
+
return t != null && t.length ? t.reduce((r, n, i) => typeof r == "string" ? ze(r, n, i) : r.flatMap((s) => typeof s == "string" ? ze(s, n, i) : s), e) : e;
|
405
|
+
}, bn = (e) => typeof e == "string" ? Fe(e) : e.flatMap((t) => typeof t == "string" ? Fe(t) : t, e), Tn = (e, t = "PP") => Qe(e, t), Ur = (e, t, r = "PP") => Qe(St(e, t), r), ve = (e) => {
|
406
|
+
me(e, []);
|
407
|
+
}, yn = Math.min, wn = Math.max;
|
408
|
+
function He(e, t, r) {
|
409
|
+
return wn(e, yn(t, r));
|
410
|
+
}
|
411
|
+
function st(e, t) {
|
412
|
+
return typeof e == "function" ? e(t) : e;
|
413
|
+
}
|
414
|
+
function at(e) {
|
415
|
+
return e.split("-")[0];
|
416
|
+
}
|
417
|
+
function Cn(e) {
|
418
|
+
return e === "x" ? "y" : "x";
|
419
|
+
}
|
420
|
+
function kn(e) {
|
421
|
+
return ["top", "bottom"].includes(at(e)) ? "y" : "x";
|
422
|
+
}
|
423
|
+
function xn(e) {
|
424
|
+
return {
|
425
|
+
top: 0,
|
426
|
+
right: 0,
|
427
|
+
bottom: 0,
|
428
|
+
left: 0,
|
429
|
+
...e
|
430
|
+
};
|
431
|
+
}
|
432
|
+
function Sn(e) {
|
433
|
+
return typeof e != "number" ? xn(e) : {
|
434
|
+
top: e,
|
435
|
+
right: e,
|
436
|
+
bottom: e,
|
437
|
+
left: e
|
438
|
+
};
|
439
|
+
}
|
440
|
+
function We(e) {
|
441
|
+
const {
|
442
|
+
x: t,
|
443
|
+
y: r,
|
444
|
+
width: n,
|
445
|
+
height: i
|
446
|
+
} = e;
|
447
|
+
return {
|
448
|
+
width: n,
|
449
|
+
height: i,
|
450
|
+
top: r,
|
451
|
+
left: t,
|
452
|
+
right: t + n,
|
453
|
+
bottom: r + i,
|
454
|
+
x: t,
|
455
|
+
y: r
|
456
|
+
};
|
457
|
+
}
|
458
|
+
async function In(e, t) {
|
459
|
+
var r;
|
460
|
+
t === void 0 && (t = {});
|
461
|
+
const {
|
462
|
+
x: n,
|
463
|
+
y: i,
|
464
|
+
platform: s,
|
465
|
+
rects: a,
|
466
|
+
elements: l,
|
467
|
+
strategy: d
|
468
|
+
} = e, {
|
469
|
+
boundary: c = "clippingAncestors",
|
470
|
+
rootBoundary: u = "viewport",
|
471
|
+
elementContext: h = "floating",
|
472
|
+
altBoundary: _ = !1,
|
473
|
+
padding: v = 0
|
474
|
+
} = st(t, e), f = Sn(v), b = l[_ ? h === "floating" ? "reference" : "floating" : h], p = We(await s.getClippingRect({
|
475
|
+
element: (r = await (s.isElement == null ? void 0 : s.isElement(b))) == null || r ? b : b.contextElement || await (s.getDocumentElement == null ? void 0 : s.getDocumentElement(l.floating)),
|
476
|
+
boundary: c,
|
477
|
+
rootBoundary: u,
|
478
|
+
strategy: d
|
479
|
+
})), m = h === "floating" ? {
|
480
|
+
x: n,
|
481
|
+
y: i,
|
482
|
+
width: a.floating.width,
|
483
|
+
height: a.floating.height
|
484
|
+
} : a.reference, T = await (s.getOffsetParent == null ? void 0 : s.getOffsetParent(l.floating)), k = await (s.isElement == null ? void 0 : s.isElement(T)) ? await (s.getScale == null ? void 0 : s.getScale(T)) || {
|
485
|
+
x: 1,
|
486
|
+
y: 1
|
487
|
+
} : {
|
488
|
+
x: 1,
|
489
|
+
y: 1
|
490
|
+
}, C = We(s.convertOffsetParentRelativeRectToViewportRelativeRect ? await s.convertOffsetParentRelativeRectToViewportRelativeRect({
|
491
|
+
elements: l,
|
492
|
+
rect: m,
|
493
|
+
offsetParent: T,
|
494
|
+
strategy: d
|
495
|
+
}) : m);
|
496
|
+
return {
|
497
|
+
top: (p.top - C.top + f.top) / k.y,
|
498
|
+
bottom: (C.bottom - p.bottom + f.bottom) / k.y,
|
499
|
+
left: (p.left - C.left + f.left) / k.x,
|
500
|
+
right: (C.right - p.right + f.right) / k.x
|
501
|
+
};
|
502
|
+
}
|
503
|
+
const En = function(e) {
|
504
|
+
return e === void 0 && (e = {}), {
|
505
|
+
name: "shift",
|
506
|
+
options: e,
|
507
|
+
async fn(t) {
|
508
|
+
const {
|
509
|
+
x: r,
|
510
|
+
y: n,
|
511
|
+
placement: i
|
512
|
+
} = t, {
|
513
|
+
mainAxis: s = !0,
|
514
|
+
crossAxis: a = !1,
|
515
|
+
limiter: l = {
|
516
|
+
fn: (b) => {
|
517
|
+
let {
|
518
|
+
x: p,
|
519
|
+
y: m
|
520
|
+
} = b;
|
521
|
+
return {
|
522
|
+
x: p,
|
523
|
+
y: m
|
524
|
+
};
|
525
|
+
}
|
526
|
+
},
|
527
|
+
...d
|
528
|
+
} = st(e, t), c = {
|
529
|
+
x: r,
|
530
|
+
y: n
|
531
|
+
}, u = await In(t, d), h = kn(at(i)), _ = Cn(h);
|
532
|
+
let v = c[_], f = c[h];
|
533
|
+
if (s) {
|
534
|
+
const b = _ === "y" ? "top" : "left", p = _ === "y" ? "bottom" : "right", m = v + u[b], T = v - u[p];
|
535
|
+
v = He(m, v, T);
|
536
|
+
}
|
537
|
+
if (a) {
|
538
|
+
const b = h === "y" ? "top" : "left", p = h === "y" ? "bottom" : "right", m = f + u[b], T = f - u[p];
|
539
|
+
f = He(m, f, T);
|
540
|
+
}
|
541
|
+
const w = l.fn({
|
542
|
+
...t,
|
543
|
+
[_]: v,
|
544
|
+
[h]: f
|
545
|
+
});
|
546
|
+
return {
|
547
|
+
...w,
|
548
|
+
data: {
|
549
|
+
x: w.x - r,
|
550
|
+
y: w.y - n,
|
551
|
+
enabled: {
|
552
|
+
[_]: s,
|
553
|
+
[h]: a
|
554
|
+
}
|
555
|
+
}
|
556
|
+
};
|
557
|
+
}
|
558
|
+
};
|
559
|
+
}, Nn = "_navItem_1jmyj_1", Pn = "_activeNavItem_1jmyj_19", Ln = "_badge_1jmyj_24", ce = {
|
560
|
+
navItem: Nn,
|
561
|
+
activeNavItem: Pn,
|
562
|
+
badge: Ln
|
563
|
+
}, ct = Ye({}), D = () => Ze(ct), Rn = (e) => {
|
564
|
+
const t = e.lastIndexOf("."), r = e.slice(0, t), n = e.slice(t + 1);
|
565
|
+
return { name: r, extension: n };
|
566
|
+
}, F = {
|
567
|
+
translation: "translation",
|
568
|
+
review: "review",
|
569
|
+
lqa_by_ai: "lqa_by_ai",
|
570
|
+
automatic_translation: "automatic_translation"
|
571
|
+
}, jn = (e, t) => {
|
572
|
+
switch (e) {
|
573
|
+
case "completed":
|
574
|
+
return t < 100 ? "Closed" : "Completed";
|
575
|
+
case "created":
|
576
|
+
return t > 0 ? "In progress" : "Not started";
|
577
|
+
case "in_progress":
|
578
|
+
return "In progress";
|
579
|
+
case "queued":
|
580
|
+
return "Queued";
|
581
|
+
default:
|
582
|
+
return "-";
|
583
|
+
}
|
584
|
+
}, On = (e) => {
|
585
|
+
const t = e.progress || 0;
|
586
|
+
return e.status === "created" && t > 0 ? "in_progress" : e.status;
|
587
|
+
}, Ge = ["in_progress", "created", "completed"], An = {
|
588
|
+
[F.translation]: "#76BEDB",
|
589
|
+
[F.review]: "#74B766",
|
590
|
+
[F.lqa_by_ai]: "#F6F2FF",
|
591
|
+
[F.automatic_translation]: "#F6F2FF"
|
592
|
+
}, Mn = (e) => e.filter((t) => t.status !== "queued").map((t) => ({ ...t, status: On(t) })).sort((t, r) => t.status === "in_progress" && t.progress === 100 ? -1 : r.status === "in_progress" && r.progress === 100 ? 1 : t.status === r.status ? t.name < r.name ? 1 : -1 : Ge.indexOf(t.status) - Ge.indexOf(r.status)), qn = ({ task: e, language: t }) => {
|
593
|
+
const [r, n] = E(!1), [i, s] = E(!1), { onLanguageCompleteConfirm: a, fetchTasks: l } = D(), d = () => {
|
594
|
+
s(!1);
|
595
|
+
};
|
596
|
+
return /* @__PURE__ */ g(ht, { children: [
|
597
|
+
i && /* @__PURE__ */ o(
|
598
|
+
vt,
|
599
|
+
{
|
600
|
+
opened: i,
|
601
|
+
loading: r,
|
602
|
+
title: `Are you finished with ${t.name}?`,
|
603
|
+
confirmText: "Mark as done",
|
604
|
+
closeText: "Cancel",
|
605
|
+
onClose: () => {
|
606
|
+
s(!1);
|
607
|
+
},
|
608
|
+
onConfirm: async () => {
|
609
|
+
n(!0), await a({ task: e, language: t, closePrompt: d }), l();
|
610
|
+
},
|
611
|
+
children: /* @__PURE__ */ g(bt, { status: "info", children: [
|
612
|
+
"Make sure you are finished and ",
|
613
|
+
/* @__PURE__ */ o("strong", { style: { display: "inline" }, children: "mark it as done" }),
|
614
|
+
" to notify your team admin. This action cannot be undone, and the language might no longer be available for you to edit."
|
615
|
+
] })
|
616
|
+
}
|
617
|
+
),
|
618
|
+
/* @__PURE__ */ o(
|
619
|
+
j,
|
620
|
+
{
|
621
|
+
disabled: r,
|
622
|
+
onClick: () => {
|
623
|
+
s(!0);
|
624
|
+
},
|
625
|
+
children: "Mark as done"
|
626
|
+
}
|
627
|
+
)
|
628
|
+
] });
|
629
|
+
}, Dn = "_langRowCompleted_1aukv_1", Bn = "_langCellSecondary_1aukv_14", $n = "_langStatus_1aukv_19", le = {
|
630
|
+
langRowCompleted: Dn,
|
631
|
+
langCellSecondary: Bn,
|
632
|
+
langStatus: $n
|
633
|
+
}, Un = ({ language: e, task: t }) => {
|
634
|
+
const { getProjectUrl: r, langNameOnClick: n, langProgressOnClick: i } = D(), s = e.progress || 0, a = e.status === "completed", l = [t.status, e.status].every((d) => ["in_progress", "created"].includes(d)) && s >= 100;
|
635
|
+
return /* @__PURE__ */ g(
|
636
|
+
"tr",
|
637
|
+
{
|
638
|
+
className: N({
|
639
|
+
[le.langRowCompleted]: l
|
640
|
+
}),
|
641
|
+
children: [
|
642
|
+
/* @__PURE__ */ o("td", { children: /* @__PURE__ */ o(q, { tooltip: "Open in bilingual view", children: /* @__PURE__ */ o(
|
643
|
+
j,
|
644
|
+
{
|
645
|
+
href: r({ task: t, language: e }),
|
646
|
+
onClick: () => {
|
647
|
+
n == null || n({ task: t, language: e });
|
648
|
+
},
|
649
|
+
children: e.name
|
650
|
+
}
|
651
|
+
) }) }),
|
652
|
+
/* @__PURE__ */ o("td", { className: le.langCellSecondary, children: l || a ? "0" : /* @__PURE__ */ o(q, { tooltip: "Open uncompleted items", children: /* @__PURE__ */ o(
|
653
|
+
j,
|
654
|
+
{
|
655
|
+
href: r({ task: t, language: e, taskUncompleted: !0 }),
|
656
|
+
onClick: () => {
|
657
|
+
i == null || i({ task: t, language: e });
|
658
|
+
},
|
659
|
+
children: Number.parseInt(e.base_words_total, 10) - Number.parseInt(e.base_words_done, 10)
|
660
|
+
}
|
661
|
+
) }) }),
|
662
|
+
/* @__PURE__ */ g("td", { children: [
|
663
|
+
s,
|
664
|
+
"%"
|
665
|
+
] }),
|
666
|
+
/* @__PURE__ */ o("td", { children: l ? /* @__PURE__ */ o(qn, { task: t, language: e }) : /* @__PURE__ */ o(
|
667
|
+
"span",
|
668
|
+
{
|
669
|
+
className: `${le.langStatus} flex-row items-center justify-start`,
|
670
|
+
"data-status": e.status,
|
671
|
+
children: jn(e.status, s)
|
672
|
+
}
|
673
|
+
) })
|
674
|
+
]
|
675
|
+
}
|
676
|
+
);
|
677
|
+
}, zn = "_taskContainer_1e51j_1", Fn = "_taskTitle_1e51j_21", Hn = "_taskDescription_1e51j_27", Wn = "_languagesTable_1e51j_33", Gn = "_metadata_1e51j_85", L = {
|
678
|
+
taskContainer: zn,
|
679
|
+
taskTitle: Fn,
|
680
|
+
taskDescription: Hn,
|
681
|
+
languagesTable: Wn,
|
682
|
+
metadata: Gn
|
683
|
+
}, Vn = ({ task: e }) => {
|
684
|
+
const { tasks: t, getProjectUrl: r, taskTitleOnClick: n } = D(), i = Mn(e.langs), s = ue(
|
685
|
+
(a) => {
|
686
|
+
a !== void 0 && window.open(`/style-guide/${e.team_id}/download/${a.id}/link`, "_blank", "noopener,noreferrer");
|
687
|
+
},
|
688
|
+
[e.team_id]
|
689
|
+
);
|
690
|
+
return t ? /* @__PURE__ */ g("article", { className: L.taskContainer, children: [
|
691
|
+
/* @__PURE__ */ g("div", { className: "flex-row gap-1 items-center", children: [
|
692
|
+
/* @__PURE__ */ g("div", { className: "flex-row gap-1 items-start flex-wrap", children: [
|
693
|
+
/* @__PURE__ */ o(we, { color: An[e.task_type], variant: "solid", children: e.task_type.toLocaleUpperCase() }),
|
694
|
+
e.due_date && /* @__PURE__ */ g(we, { color: "#DEA829", children: [
|
695
|
+
"DUE ",
|
696
|
+
Tn(xt(e.due_date), "yyyy-MM-dd")
|
697
|
+
] })
|
698
|
+
] }),
|
699
|
+
e.style_guides.length > 0 && /* @__PURE__ */ o("div", { className: "flex-row", children: e.style_guides.length === 1 ? /* @__PURE__ */ o(
|
700
|
+
Ce,
|
701
|
+
{
|
702
|
+
size: "sm",
|
703
|
+
variant: "secondary",
|
704
|
+
onClick: () => s(e.style_guides[0]),
|
705
|
+
children: "Download style guide"
|
706
|
+
}
|
707
|
+
) : /* @__PURE__ */ o(
|
708
|
+
he,
|
709
|
+
{
|
710
|
+
menuButton: /* @__PURE__ */ o(Ce, { variant: "secondary", size: "sm", children: "Download style guide" }),
|
711
|
+
children: /* @__PURE__ */ o(pe, { children: e.style_guides.map((a) => /* @__PURE__ */ o(W, { onClick: () => s(a), children: Rn(a.name).name }, a.id)) })
|
712
|
+
}
|
713
|
+
) })
|
714
|
+
] }),
|
715
|
+
/* @__PURE__ */ g(Tt, { top: 1, children: [
|
716
|
+
/* @__PURE__ */ o("h4", { className: L.taskTitle, children: /* @__PURE__ */ o(
|
717
|
+
j,
|
718
|
+
{
|
719
|
+
href: r({ task: e, view: "multi" }),
|
720
|
+
onClick: () => {
|
721
|
+
n == null || n({ task: e });
|
722
|
+
},
|
723
|
+
children: e.title
|
724
|
+
}
|
725
|
+
) }),
|
726
|
+
e.description && /* @__PURE__ */ o("div", { className: L.taskDescription, children: gn(bn(e.description)) })
|
727
|
+
] }),
|
728
|
+
/* @__PURE__ */ g("table", { className: L.languagesTable, children: [
|
729
|
+
/* @__PURE__ */ o("thead", { children: /* @__PURE__ */ g("tr", { children: [
|
730
|
+
/* @__PURE__ */ o("th", { children: "Languages" }),
|
731
|
+
/* @__PURE__ */ o("th", { children: "Words to do" }),
|
732
|
+
/* @__PURE__ */ o("th", { children: "Progress" }),
|
733
|
+
/* @__PURE__ */ o("th", { children: "Status" })
|
734
|
+
] }) }),
|
735
|
+
/* @__PURE__ */ o("tbody", { children: i.map((a) => /* @__PURE__ */ o(Un, { language: a, task: e }, a.lang_id)) })
|
736
|
+
] }),
|
737
|
+
/* @__PURE__ */ g("p", { className: L.metadata, children: [
|
738
|
+
/* @__PURE__ */ g("span", { "data-test-id": "source-lang", children: [
|
739
|
+
"Source: ",
|
740
|
+
e.source_lang_name
|
741
|
+
] }),
|
742
|
+
/* @__PURE__ */ o("span", { "data-test-id": "author-name", children: e.created_by_fullname }),
|
743
|
+
/* @__PURE__ */ g("span", { "data-test-id": "project-name", children: [
|
744
|
+
"In ",
|
745
|
+
e.project_name,
|
746
|
+
e.master_branching_enabled === "1" && /* @__PURE__ */ o("div", { className: L.tag, children: e.branch_name ? e.branch_name : "master" })
|
747
|
+
] })
|
748
|
+
] })
|
749
|
+
] }) : null;
|
750
|
+
}, Yn = "_loadingContainer_1l6uh_1", Zn = "_noTasksContainer_1l6uh_6", Xn = "_noTasksHeading_1l6uh_12", Qn = "_noTasksText_1l6uh_16", Jn = "_tasksContainer_1l6uh_21", A = {
|
751
|
+
loadingContainer: Yn,
|
752
|
+
noTasksContainer: Zn,
|
753
|
+
noTasksHeading: Xn,
|
754
|
+
noTasksText: Qn,
|
755
|
+
tasksContainer: Jn
|
756
|
+
}, Kn = () => {
|
757
|
+
const { tasks: e, onTasksWidgetOpen: t, loadingTasks: r, fetchTasks: n } = D();
|
758
|
+
return ve(() => (n(), t == null || t({ tasks: e }), document.addEventListener(x.TaskCompleted, n), document.addEventListener(x.TaskClosed, n), document.addEventListener(x.Refresh, n), () => {
|
759
|
+
document.removeEventListener(x.TaskCompleted, n), document.removeEventListener(x.TaskClosed, n), document.removeEventListener(x.Refresh, n);
|
760
|
+
})), r ? /* @__PURE__ */ o("div", { className: A.loadingContainer, children: /* @__PURE__ */ o(yt, {}) }) : e.length === 0 ? /* @__PURE__ */ g("div", { className: A.noTasksContainer, children: [
|
761
|
+
/* @__PURE__ */ o("h3", { className: A.noTasksHeading, children: "No tasks" }),
|
762
|
+
/* @__PURE__ */ g("div", { className: A.noTasksText, children: [
|
763
|
+
"Your incoming tasks will appear here.",
|
764
|
+
/* @__PURE__ */ o("br", {}),
|
765
|
+
/* @__PURE__ */ o(j, { href: "https://docs.lokalise.com/translation-workflow/tasks", target: "_new", children: "Learn more" })
|
766
|
+
] })
|
767
|
+
] }) : /* @__PURE__ */ o("section", { className: A.tasksContainer, children: e.map((i) => /* @__PURE__ */ o(Vn, { task: i }, i.id)) });
|
768
|
+
}, er = ({ children: e, config: t }) => {
|
769
|
+
const [r, n] = E([]), [i, s] = E(!0), [a, l] = E(0), {
|
770
|
+
getProjectUrl: d,
|
771
|
+
onLanguageCompleteConfirm: c,
|
772
|
+
onTasksWidgetOpen: u,
|
773
|
+
langNameOnClick: h,
|
774
|
+
langProgressOnClick: _,
|
775
|
+
taskTitleOnClick: v
|
776
|
+
} = t, { getTasks: f, getTasksCount: w } = t, b = async () => {
|
777
|
+
s(!0);
|
778
|
+
const T = await f();
|
779
|
+
n(T), s(!1);
|
780
|
+
}, p = async () => {
|
781
|
+
const T = await w();
|
782
|
+
l(T);
|
783
|
+
};
|
784
|
+
ve(() => (p(), document.addEventListener(x.TaskCompleted, p), document.addEventListener(x.TaskClosed, p), document.addEventListener(x.Refresh, p), () => {
|
785
|
+
document.removeEventListener(x.TaskCompleted, p), document.removeEventListener(x.TaskClosed, p), document.removeEventListener(x.Refresh, p);
|
786
|
+
}));
|
787
|
+
const m = {
|
788
|
+
fetchTasks: b,
|
789
|
+
tasks: r,
|
790
|
+
tasksCount: a,
|
791
|
+
loadingTasks: i,
|
792
|
+
getProjectUrl: d,
|
793
|
+
onLanguageCompleteConfirm: c,
|
794
|
+
onTasksWidgetOpen: u,
|
795
|
+
langNameOnClick: h,
|
796
|
+
langProgressOnClick: _,
|
797
|
+
taskTitleOnClick: v
|
798
|
+
};
|
799
|
+
return /* @__PURE__ */ o(ct.Provider, { value: m, children: e });
|
800
|
+
}, tr = (e) => function(r) {
|
801
|
+
const { config: n, ...i } = r;
|
802
|
+
return /* @__PURE__ */ o(er, { config: n, children: /* @__PURE__ */ o(e, { ...i }) });
|
803
|
+
}, nr = tr(() => {
|
804
|
+
const [e, t] = E(!1), { tasksCount: r } = D();
|
805
|
+
return ve(() => {
|
806
|
+
const n = () => {
|
807
|
+
t(!0);
|
808
|
+
};
|
809
|
+
return document.addEventListener(x.ShowDialog, n), () => {
|
810
|
+
document.removeEventListener(x.ShowDialog, n);
|
811
|
+
};
|
812
|
+
}), /* @__PURE__ */ o(q, { tooltip: "Tasks", placement: "right", children: /* @__PURE__ */ o(
|
813
|
+
wt,
|
814
|
+
{
|
815
|
+
content: /* @__PURE__ */ o(Kn, {}),
|
816
|
+
placement: "right",
|
817
|
+
open: e,
|
818
|
+
onOpenChange: t,
|
819
|
+
middlewares: [
|
820
|
+
En({
|
821
|
+
// Adding some spacing to the top and bottom so the popover
|
822
|
+
// doesn't extend to the edges of the screen.
|
823
|
+
padding: {
|
824
|
+
top: 32,
|
825
|
+
bottom: 32
|
826
|
+
}
|
827
|
+
})
|
828
|
+
],
|
829
|
+
children: (n) => /* @__PURE__ */ g(
|
830
|
+
"button",
|
831
|
+
{
|
832
|
+
type: "button",
|
833
|
+
"aria-label": "Tasks",
|
834
|
+
className: N(ce.navItem, {
|
835
|
+
[ce.activeNavItem]: n
|
836
|
+
}),
|
837
|
+
children: [
|
838
|
+
/* @__PURE__ */ o(Ct, { size: "24px" }),
|
839
|
+
r > 0 && /* @__PURE__ */ o(
|
840
|
+
"div",
|
841
|
+
{
|
842
|
+
className: ce.badge,
|
843
|
+
"aria-label": `${r} items requiring attention`,
|
844
|
+
children: r > 9 ? "9+" : r
|
845
|
+
}
|
846
|
+
)
|
847
|
+
]
|
848
|
+
}
|
849
|
+
)
|
850
|
+
}
|
851
|
+
) });
|
852
|
+
}), rr = "_iconContainer_18sqh_1", or = {
|
853
|
+
iconContainer: rr
|
854
|
+
}, lt = ({ className: e = "" }) => /* @__PURE__ */ o(
|
855
|
+
"div",
|
856
|
+
{
|
857
|
+
"aria-label": "Upgrade Icon",
|
858
|
+
className: N(or.iconContainer, "flex-row", "items-center", "justify-center", e),
|
859
|
+
children: /* @__PURE__ */ o(kt, {})
|
860
|
+
}
|
861
|
+
), ir = "_menuContainer_1dcf5_5", sr = "_profileButton_1dcf5_16", ar = "_profileImage_1dcf5_29", cr = "_profileImageHighlight_1dcf5_37", lr = "_profileImageUpgradeIcon_1dcf5_41", dr = "_userIconWrapper_1dcf5_47", P = {
|
862
|
+
menuContainer: ir,
|
863
|
+
profileButton: sr,
|
864
|
+
profileImage: ar,
|
865
|
+
profileImageHighlight: cr,
|
866
|
+
profileImageUpgradeIcon: lr,
|
867
|
+
userIconWrapper: dr
|
868
|
+
}, dt = Ye({}), B = () => Ze(dt), ur = ({ children: e }) => {
|
869
|
+
const {
|
870
|
+
currentTeam: t,
|
871
|
+
otherTeams: r,
|
872
|
+
showUpgradeCta: n,
|
873
|
+
showBillingButton: i,
|
874
|
+
allowTeamCreation: s,
|
875
|
+
isLimitedView: a,
|
876
|
+
isProviderAlpha: l,
|
877
|
+
canAccessTeamSettings: d,
|
878
|
+
isEndOfTrialActive: c,
|
879
|
+
isTeamSuspended: u
|
880
|
+
} = B();
|
881
|
+
return /* @__PURE__ */ o(
|
882
|
+
he,
|
883
|
+
{
|
884
|
+
menuButton: () => /* @__PURE__ */ g("button", { className: P.profileButton, "aria-label": "Profile menu", type: "button", children: [
|
885
|
+
t != null && t.logoUrl ? /* @__PURE__ */ o(
|
886
|
+
"img",
|
887
|
+
{
|
888
|
+
src: t.logoUrl,
|
889
|
+
className: N(P.profileImage, {
|
890
|
+
[P.profileImageHighlight]: n
|
891
|
+
}),
|
892
|
+
alt: "Team Logo"
|
893
|
+
}
|
894
|
+
) : /* @__PURE__ */ o(
|
895
|
+
"div",
|
896
|
+
{
|
897
|
+
className: N(P.userIconWrapper, "flex-row", "align-center", "items-center", {
|
898
|
+
[P.profileImageHighlight]: n
|
899
|
+
}),
|
900
|
+
children: /* @__PURE__ */ o(Xe, { size: "24px" })
|
901
|
+
}
|
902
|
+
),
|
903
|
+
n && /* @__PURE__ */ o(lt, { className: P.profileImageUpgradeIcon })
|
904
|
+
] }),
|
905
|
+
children: /* @__PURE__ */ o(pe, { placement: "right-end", className: P.menuContainer, children: e({
|
906
|
+
allowTeamCreation: s,
|
907
|
+
otherTeams: r,
|
908
|
+
isLimitedView: a,
|
909
|
+
canAccessTeamSettings: d,
|
910
|
+
isEndOfTrialActive: c,
|
911
|
+
isTeamSuspended: u,
|
912
|
+
showBillingButton: i,
|
913
|
+
isProviderAlpha: l
|
914
|
+
}) })
|
915
|
+
}
|
916
|
+
);
|
917
|
+
}, fr = ({ children: e, config: t }) => {
|
918
|
+
const { teams: r, currentTeamId: n, planId: i, isLimitedView: s, isTeamSuspended: a, canAccessTeamSettings: l, isEndOfTrialActive: d } = t, c = r.find((m) => m.id === n), u = r.filter((m) => m.id !== n), h = (c == null ? void 0 : c.role) ?? "", _ = ["biller", "owner"].includes(h), v = _e(i) || it(i), p = {
|
919
|
+
...t,
|
920
|
+
currentTeam: c,
|
921
|
+
otherTeams: u,
|
922
|
+
canChangeBilling: _,
|
923
|
+
isOnFreeOrTrialPlan: v,
|
924
|
+
showUpgradeCta: !s && v && _ && !a,
|
925
|
+
showBillingButton: !s && l && _,
|
926
|
+
allowTeamCreation: !s && !d
|
927
|
+
};
|
928
|
+
return /* @__PURE__ */ o(dt.Provider, { value: p, children: e });
|
929
|
+
}, mr = ({ config: e, children: t }) => /* @__PURE__ */ o(fr, { config: e, children: /* @__PURE__ */ o(ur, { children: t }) }), hr = "_container_k7g5r_1", pr = "_profileEmail_k7g5r_5", Ve = {
|
930
|
+
container: hr,
|
931
|
+
profileEmail: pr
|
932
|
+
}, gr = ({ href: e, onClick: t, userEmail: r }) => {
|
933
|
+
const { isEndOfTrialActive: n, isTeamSuspended: i } = B();
|
934
|
+
return n || i ? null : /* @__PURE__ */ o(
|
935
|
+
W,
|
936
|
+
{
|
937
|
+
href: e,
|
938
|
+
onClick: () => {
|
939
|
+
t == null || t();
|
940
|
+
},
|
941
|
+
children: /* @__PURE__ */ g("div", { className: `flex-col ${Ve.container}`, children: [
|
942
|
+
/* @__PURE__ */ o("span", { children: "Profile Settings" }),
|
943
|
+
/* @__PURE__ */ o("span", { className: Ve.profileEmail, children: r })
|
944
|
+
] })
|
945
|
+
}
|
946
|
+
);
|
947
|
+
}, _r = "_wrapper_1d834_1", vr = "_profileImage_1d834_14", br = "_teamName_1d834_22", Tr = "_planLabel_1d834_29", yr = "_membership_1d834_38", wr = "_defaultProfileImage_1d834_44", R = {
|
948
|
+
wrapper: _r,
|
949
|
+
profileImage: vr,
|
950
|
+
teamName: br,
|
951
|
+
planLabel: Tr,
|
952
|
+
membership: yr,
|
953
|
+
defaultProfileImage: wr
|
954
|
+
}, ut = ({ team: e, onClick: t, hidePlanLabel: r }) => {
|
955
|
+
const { currentTeam: n, planId: i } = B(), s = e || n;
|
956
|
+
if (!s)
|
957
|
+
return null;
|
958
|
+
const a = _e(i) ? "Free" : it(i) ? "Trial" : void 0;
|
959
|
+
return /* @__PURE__ */ g(
|
960
|
+
t ? W : "div",
|
961
|
+
{
|
962
|
+
className: `flex-row gap-2 flex-nowrap items-center ${R.wrapper}`,
|
963
|
+
...t && { onClick: () => t(s) },
|
964
|
+
children: [
|
965
|
+
s.logoUrl ? /* @__PURE__ */ o("img", { className: R.profileImage, src: s.logoUrl, alt: "Team Logo" }) : /* @__PURE__ */ o("div", { className: `flex-row justify-center items-center ${R.defaultProfileImage}`, children: /* @__PURE__ */ o(Xe, { size: "24px" }) }),
|
966
|
+
/* @__PURE__ */ g("div", { className: "flex-col items-start", children: [
|
967
|
+
/* @__PURE__ */ g("div", { className: "flex-row items-center flex-nowrap gap-2", children: [
|
968
|
+
/* @__PURE__ */ o("span", { title: s.name, className: R.teamName, children: s.name }),
|
969
|
+
a && !r && /* @__PURE__ */ o("span", { className: `flex-row justify-center items-center ${R.planLabel}`, children: a })
|
970
|
+
] }),
|
971
|
+
/* @__PURE__ */ o("span", { className: R.membership, children: s.role })
|
972
|
+
] })
|
973
|
+
]
|
974
|
+
}
|
975
|
+
);
|
976
|
+
}, Cr = "_teamsContainer_l4r3v_1", kr = {
|
977
|
+
teamsContainer: Cr
|
978
|
+
}, xr = ({ onSwitchTeam: e }) => {
|
979
|
+
const { otherTeams: t } = B();
|
980
|
+
return t.length === 0 ? null : /* @__PURE__ */ o("div", { className: `flex-col items-stretch ${kr.teamsContainer}`, children: t.map((r) => /* @__PURE__ */ o(ut, { team: r, onClick: e, hidePlanLabel: !0 }, r.id)) });
|
981
|
+
}, Sr = "_container_jmnsf_1", Ir = "_planCta_jmnsf_15", Er = "_upgradeIconWrapper_jmnsf_19", de = {
|
982
|
+
container: Sr,
|
983
|
+
planCta: Ir,
|
984
|
+
upgradeIconWrapper: Er
|
985
|
+
}, Nr = ({ upgradeOptionHref: e }) => {
|
986
|
+
const { planId: t, trialDaysLeft: r, showUpgradeCta: n } = B();
|
987
|
+
if (!n)
|
988
|
+
return null;
|
989
|
+
const a = _e(t) ? "Your team is currently on the Free plan" : `Free trial ends in ${r} ${r === 1 ? "day" : "days"}`;
|
990
|
+
return /* @__PURE__ */ g(W, { href: e, className: `flex-col gap-1 items-start ${de.container}`, children: [
|
991
|
+
/* @__PURE__ */ o("span", { className: de.planCta, children: a }),
|
992
|
+
/* @__PURE__ */ g("div", { className: `flex-row items-center gap-1 ${de.upgradeIconWrapper}`, children: [
|
993
|
+
/* @__PURE__ */ o(lt, {}),
|
994
|
+
/* @__PURE__ */ o("span", { children: "See upgrade options" })
|
995
|
+
] })
|
996
|
+
] });
|
997
|
+
}, S = ({ children: e, ...t }) => /* @__PURE__ */ o("nav", { ...t, className: Jt.sidebarContainer, children: e });
|
998
|
+
S.Top = ({ children: e }) => /* @__PURE__ */ o("div", { children: e });
|
999
|
+
S.Bottom = ({ children: e }) => /* @__PURE__ */ o("div", { children: e });
|
1000
|
+
S.Avatar = tn;
|
1001
|
+
S.IconLink = on;
|
1002
|
+
S.Menu = cn;
|
1003
|
+
S.Tasks = nr;
|
1004
|
+
S.ProfileMenu = mr;
|
1005
|
+
S.TeamSwitch = xr;
|
1006
|
+
S.TeamMenuItem = ut;
|
1007
|
+
S.UpgradeMenuItem = Nr;
|
1008
|
+
S.ProfileSettingsMenuItem = gr;
|
369
1009
|
export {
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
1010
|
+
ot as ENTERPRISE_OPENSOURCE_PLAN_ID,
|
1011
|
+
mn as ENTERPRISE_PLAN_IDS,
|
1012
|
+
un as ESSENTIAL_PLAN_IDS,
|
1013
|
+
rt as FREE_PLAN_ID,
|
1014
|
+
H as NavigationPanel,
|
1015
|
+
fn as PRO_PLAN_IDS,
|
1016
|
+
dn as START_PLAN_IDS,
|
1017
|
+
S as Sidebar,
|
1018
|
+
ln as TRIAL_PLAN_ID,
|
1019
|
+
gn as convertNewLineToBreakTag,
|
1020
|
+
Tn as formatDate,
|
1021
|
+
Ur as formatDateTz,
|
1022
|
+
$r as isEnterpriseOpenSourcePlan,
|
1023
|
+
Dr as isEnterprisePlan,
|
1024
|
+
Mr as isEssentialPlan,
|
1025
|
+
_e as isFreePlan,
|
1026
|
+
Br as isPaidPlan,
|
1027
|
+
qr as isProPlan,
|
1028
|
+
Ar as isStartPlan,
|
1029
|
+
it as isTrialPlan,
|
1030
|
+
bn as makeUrlClickable,
|
1031
|
+
ve as useEffectOnce
|
391
1032
|
};
|