review-lens-react 1.0.1 → 1.0.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.
|
@@ -1,153 +1,184 @@
|
|
|
1
|
-
import { jsx as i, jsxs as
|
|
2
|
-
import { createContext as
|
|
1
|
+
import { jsx as i, jsxs as s, Fragment as ae } from "react/jsx-runtime";
|
|
2
|
+
import { createContext as gt, useMemo as oe, useState as x, useCallback as W, useEffect as P, useContext as ft, useRef as re, useLayoutEffect as wt } from "react";
|
|
3
3
|
const Be = [
|
|
4
4
|
"https://www.googleapis.com/auth/spreadsheets",
|
|
5
5
|
"https://www.googleapis.com/auth/userinfo.email"
|
|
6
|
-
],
|
|
7
|
-
function
|
|
8
|
-
const t = e.feedbackSheetName ?? "Feedback", n = e.messagesSheetName ?? "Messages", r = e.usersSheetName ?? "Users",
|
|
9
|
-
let
|
|
10
|
-
async function
|
|
11
|
-
|
|
6
|
+
], vt = "https://www.googleapis.com/auth/gmail.send", Pe = "https://www.googleapis.com/oauth2/v3/userinfo", bt = "https://gmail.googleapis.com/gmail/v1/users/me/messages/send", yt = "review-lens-google-token", kt = 6e4;
|
|
7
|
+
function St(e) {
|
|
8
|
+
const t = e.feedbackSheetName ?? "Feedback", n = e.messagesSheetName ?? "Messages", r = e.usersSheetName ?? "Users", o = e.enableEmailNotifications ? [...Be, vt].join(" ") : Be.join(" "), c = $t(e.googleClientId, o);
|
|
9
|
+
let u, w;
|
|
10
|
+
async function g() {
|
|
11
|
+
const p = Mt(c);
|
|
12
|
+
if (p)
|
|
13
|
+
return p.accessToken;
|
|
14
|
+
u ?? (u = Tt(e.googleClientId, o).then((h) => (Bt(c, h), h)));
|
|
15
|
+
const v = await u;
|
|
16
|
+
return Date.now() >= v.expiresAt ? (u = void 0, g()) : v.accessToken;
|
|
12
17
|
}
|
|
13
|
-
async function p
|
|
14
|
-
const
|
|
15
|
-
`https://sheets.googleapis.com/v4/spreadsheets/${
|
|
18
|
+
async function b(p, v, h) {
|
|
19
|
+
const k = await g(), l = await fetch(
|
|
20
|
+
`https://sheets.googleapis.com/v4/spreadsheets/${p}${v}`,
|
|
16
21
|
{
|
|
17
|
-
...
|
|
22
|
+
...h,
|
|
18
23
|
headers: {
|
|
19
|
-
Authorization: `Bearer ${
|
|
24
|
+
Authorization: `Bearer ${k}`,
|
|
20
25
|
"Content-Type": "application/json",
|
|
21
|
-
...
|
|
26
|
+
...h == null ? void 0 : h.headers
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
);
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
if (l.status === 401) {
|
|
31
|
+
We(c), u = void 0;
|
|
32
|
+
const C = await g(), f = await fetch(
|
|
33
|
+
`https://sheets.googleapis.com/v4/spreadsheets/${p}${v}`,
|
|
34
|
+
{
|
|
35
|
+
...h,
|
|
36
|
+
headers: {
|
|
37
|
+
Authorization: `Bearer ${C}`,
|
|
38
|
+
"Content-Type": "application/json",
|
|
39
|
+
...h == null ? void 0 : h.headers
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
if (!f.ok)
|
|
44
|
+
throw new Error(`Google Sheets request failed with ${f.status}`);
|
|
45
|
+
return f.json();
|
|
46
|
+
}
|
|
47
|
+
if (!l.ok)
|
|
48
|
+
throw new Error(`Google Sheets request failed with ${l.status}`);
|
|
49
|
+
return l.json();
|
|
28
50
|
}
|
|
29
|
-
async function
|
|
30
|
-
return (await
|
|
31
|
-
|
|
32
|
-
`/values/${encodeURIComponent(
|
|
51
|
+
async function A(p, v) {
|
|
52
|
+
return (await b(
|
|
53
|
+
p,
|
|
54
|
+
`/values/${encodeURIComponent(v)}`
|
|
33
55
|
)).values ?? [];
|
|
34
56
|
}
|
|
35
57
|
return {
|
|
36
58
|
async getCurrentUser() {
|
|
37
|
-
if (!
|
|
38
|
-
const g = await w(), f = await fetch(wt, {
|
|
39
|
-
headers: { Authorization: `Bearer ${g}` }
|
|
40
|
-
});
|
|
41
|
-
if (!f.ok)
|
|
42
|
-
throw new Error(`Google userinfo request failed with ${f.status}`);
|
|
43
|
-
h = (await f.json()).email;
|
|
44
|
-
}
|
|
45
|
-
if (!h)
|
|
59
|
+
if (w || (w = await L()), !w)
|
|
46
60
|
throw new Error("Google account did not return an email address");
|
|
47
|
-
return { email:
|
|
61
|
+
return { email: w };
|
|
48
62
|
},
|
|
49
|
-
async getPermissions(
|
|
50
|
-
const [{ email:
|
|
63
|
+
async getPermissions(p) {
|
|
64
|
+
const [{ email: v }, h] = await Promise.all([
|
|
51
65
|
this.getCurrentUser(),
|
|
52
|
-
|
|
53
|
-
]),
|
|
54
|
-
(
|
|
55
|
-
var
|
|
56
|
-
return ((
|
|
66
|
+
A(e.usersSpreadsheetId, r)
|
|
67
|
+
]), k = ue(h), l = v.toLowerCase(), C = k.find(
|
|
68
|
+
(f) => {
|
|
69
|
+
var y;
|
|
70
|
+
return ((y = f.email) == null ? void 0 : y.toLowerCase()) === l && f.active !== "false" && (!f.projectKey || f.projectKey === p);
|
|
57
71
|
}
|
|
58
72
|
);
|
|
59
|
-
return
|
|
73
|
+
return Et((C == null ? void 0 : C.role) ?? "designer");
|
|
60
74
|
},
|
|
61
|
-
async listFeedback(
|
|
62
|
-
return ue(await
|
|
63
|
-
(
|
|
64
|
-
).sort((
|
|
75
|
+
async listFeedback(p) {
|
|
76
|
+
return ue(await A(e.contentSpreadsheetId, t)).map(Ue).filter((h) => h !== null).filter(
|
|
77
|
+
(h) => h.projectKey === p.projectKey && h.contentId === p.contentId && h.normalizedPath === p.normalizedPath
|
|
78
|
+
).sort((h, k) => k.createdAt.localeCompare(h.createdAt));
|
|
65
79
|
},
|
|
66
|
-
async createFeedback(
|
|
67
|
-
const
|
|
68
|
-
...
|
|
80
|
+
async createFeedback(p) {
|
|
81
|
+
const v = (/* @__PURE__ */ new Date()).toISOString(), h = {
|
|
82
|
+
...p,
|
|
69
83
|
id: crypto.randomUUID(),
|
|
70
84
|
attachments: [],
|
|
71
|
-
createdAt:
|
|
72
|
-
updatedAt:
|
|
85
|
+
createdAt: v,
|
|
86
|
+
updatedAt: v
|
|
73
87
|
};
|
|
74
|
-
return await
|
|
88
|
+
return await b(
|
|
75
89
|
e.contentSpreadsheetId,
|
|
76
90
|
`/values/${encodeURIComponent(t)}:append?valueInputOption=RAW`,
|
|
77
91
|
{
|
|
78
92
|
method: "POST",
|
|
79
|
-
body: JSON.stringify({ values: [
|
|
93
|
+
body: JSON.stringify({ values: [je(h)] })
|
|
80
94
|
}
|
|
81
|
-
),
|
|
95
|
+
), h;
|
|
82
96
|
},
|
|
83
|
-
async updateFeedback(
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
97
|
+
async updateFeedback(p, v) {
|
|
98
|
+
const h = await A(e.contentSpreadsheetId, t), k = h[0] ?? _e, l = k.indexOf("id");
|
|
99
|
+
if (l === -1)
|
|
86
100
|
throw new Error(`Sheet ${t} is missing an id column`);
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
throw new Error(`Feedback ${
|
|
90
|
-
const
|
|
91
|
-
if (!
|
|
92
|
-
throw new Error(`Feedback ${
|
|
93
|
-
const
|
|
94
|
-
...
|
|
95
|
-
...
|
|
96
|
-
updatedAt:
|
|
97
|
-
},
|
|
98
|
-
return await
|
|
101
|
+
const C = h.findIndex((M, j) => j > 0 && M[l] === p);
|
|
102
|
+
if (C < 1)
|
|
103
|
+
throw new Error(`Feedback ${p} was not found`);
|
|
104
|
+
const f = (/* @__PURE__ */ new Date()).toISOString(), y = Ue(Oe(k, h[C]));
|
|
105
|
+
if (!y)
|
|
106
|
+
throw new Error(`Feedback ${p} could not be parsed before updating`);
|
|
107
|
+
const N = {
|
|
108
|
+
...y,
|
|
109
|
+
...v,
|
|
110
|
+
updatedAt: f
|
|
111
|
+
}, F = je(N);
|
|
112
|
+
return await b(
|
|
99
113
|
e.contentSpreadsheetId,
|
|
100
|
-
`/values/${encodeURIComponent(t)}!A${
|
|
101
|
-
|
|
102
|
-
)}${
|
|
114
|
+
`/values/${encodeURIComponent(t)}!A${C + 1}:${It(
|
|
115
|
+
_e.length
|
|
116
|
+
)}${C + 1}?valueInputOption=RAW`,
|
|
103
117
|
{
|
|
104
118
|
method: "PUT",
|
|
105
|
-
body: JSON.stringify({ values: [
|
|
119
|
+
body: JSON.stringify({ values: [F] })
|
|
106
120
|
}
|
|
107
|
-
),
|
|
121
|
+
), N;
|
|
108
122
|
},
|
|
109
|
-
async listMessages(
|
|
110
|
-
return ue(await
|
|
123
|
+
async listMessages(p) {
|
|
124
|
+
return ue(await A(e.contentSpreadsheetId, n)).map(Ct).filter((h) => h !== null).filter((h) => h.feedbackId === p).sort((h, k) => h.createdAt.localeCompare(k.createdAt));
|
|
111
125
|
},
|
|
112
|
-
async createMessage(
|
|
113
|
-
const
|
|
114
|
-
...
|
|
126
|
+
async createMessage(p) {
|
|
127
|
+
const v = {
|
|
128
|
+
...p,
|
|
115
129
|
id: crypto.randomUUID(),
|
|
116
130
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
117
131
|
};
|
|
118
|
-
return await
|
|
132
|
+
return await b(
|
|
119
133
|
e.contentSpreadsheetId,
|
|
120
134
|
`/values/${encodeURIComponent(n)}:append?valueInputOption=RAW`,
|
|
121
135
|
{
|
|
122
136
|
method: "POST",
|
|
123
|
-
body: JSON.stringify({ values: [
|
|
137
|
+
body: JSON.stringify({ values: [Nt(v)] })
|
|
124
138
|
}
|
|
125
|
-
),
|
|
139
|
+
), v;
|
|
126
140
|
},
|
|
127
|
-
async sendEmail(
|
|
128
|
-
if (!e.enableEmailNotifications ||
|
|
141
|
+
async sendEmail(p) {
|
|
142
|
+
if (!e.enableEmailNotifications || p.to.length === 0)
|
|
129
143
|
return;
|
|
130
|
-
const
|
|
144
|
+
const v = await g(), h = await this.getCurrentUser(), k = await fetch(bt, {
|
|
131
145
|
method: "POST",
|
|
132
146
|
headers: {
|
|
133
|
-
Authorization: `Bearer ${
|
|
147
|
+
Authorization: `Bearer ${v}`,
|
|
134
148
|
"Content-Type": "application/json"
|
|
135
149
|
},
|
|
136
150
|
body: JSON.stringify({
|
|
137
|
-
raw:
|
|
138
|
-
from:
|
|
139
|
-
to:
|
|
140
|
-
subject:
|
|
141
|
-
text:
|
|
151
|
+
raw: _t({
|
|
152
|
+
from: h.email,
|
|
153
|
+
to: p.to,
|
|
154
|
+
subject: p.subject,
|
|
155
|
+
text: p.text
|
|
142
156
|
})
|
|
143
157
|
})
|
|
144
158
|
});
|
|
145
|
-
if (!
|
|
146
|
-
throw new Error(`Gmail send request failed with ${
|
|
159
|
+
if (!k.ok)
|
|
160
|
+
throw new Error(`Gmail send request failed with ${k.status}`);
|
|
147
161
|
}
|
|
148
162
|
};
|
|
163
|
+
async function L() {
|
|
164
|
+
const p = await fetch(Pe, {
|
|
165
|
+
headers: { Authorization: `Bearer ${await g()}` }
|
|
166
|
+
});
|
|
167
|
+
if (p.status === 401) {
|
|
168
|
+
We(c), u = void 0;
|
|
169
|
+
const h = await fetch(Pe, {
|
|
170
|
+
headers: { Authorization: `Bearer ${await g()}` }
|
|
171
|
+
});
|
|
172
|
+
if (!h.ok)
|
|
173
|
+
throw new Error(`Google userinfo request failed with ${h.status}`);
|
|
174
|
+
return (await h.json()).email;
|
|
175
|
+
}
|
|
176
|
+
if (!p.ok)
|
|
177
|
+
throw new Error(`Google userinfo request failed with ${p.status}`);
|
|
178
|
+
return (await p.json()).email;
|
|
179
|
+
}
|
|
149
180
|
}
|
|
150
|
-
const
|
|
181
|
+
const _e = [
|
|
151
182
|
"id",
|
|
152
183
|
"projectKey",
|
|
153
184
|
"contentId",
|
|
@@ -176,8 +207,8 @@ const Pe = [
|
|
|
176
207
|
"fixedBy",
|
|
177
208
|
"resolvedAt",
|
|
178
209
|
"resolvedBy"
|
|
179
|
-
],
|
|
180
|
-
function
|
|
210
|
+
], xt = ["id", "feedbackId", "body", "authorEmail", "createdAt"];
|
|
211
|
+
function je(e) {
|
|
181
212
|
return [
|
|
182
213
|
e.id,
|
|
183
214
|
e.projectKey,
|
|
@@ -209,17 +240,17 @@ function _e(e) {
|
|
|
209
240
|
e.resolvedBy ?? ""
|
|
210
241
|
];
|
|
211
242
|
}
|
|
212
|
-
function
|
|
213
|
-
return
|
|
243
|
+
function Nt(e) {
|
|
244
|
+
return xt.map((t) => e[t]);
|
|
214
245
|
}
|
|
215
246
|
function ue(e) {
|
|
216
247
|
const [t, ...n] = e;
|
|
217
|
-
return t ? n.map((r) =>
|
|
248
|
+
return t ? n.map((r) => Oe(t, r)) : [];
|
|
218
249
|
}
|
|
219
|
-
function
|
|
250
|
+
function Oe(e, t) {
|
|
220
251
|
return Object.fromEntries(e.map((n, r) => [n, t[r] ?? ""]));
|
|
221
252
|
}
|
|
222
|
-
function
|
|
253
|
+
function Ue(e) {
|
|
223
254
|
return e.id ? {
|
|
224
255
|
id: e.id,
|
|
225
256
|
projectKey: e.projectKey,
|
|
@@ -233,16 +264,16 @@ function je(e) {
|
|
|
233
264
|
width: 0,
|
|
234
265
|
height: 0
|
|
235
266
|
}),
|
|
236
|
-
createdCssSnapshot:
|
|
237
|
-
fixedCssSnapshot: e.fixedCssSnapshotJson ?
|
|
267
|
+
createdCssSnapshot: De(e.createdCssSnapshotJson),
|
|
268
|
+
fixedCssSnapshot: e.fixedCssSnapshotJson ? De(e.fixedCssSnapshotJson) : void 0,
|
|
238
269
|
comment: e.comment,
|
|
239
|
-
status:
|
|
240
|
-
severity:
|
|
241
|
-
category:
|
|
270
|
+
status: Lt(e.status),
|
|
271
|
+
severity: At(e.severity),
|
|
272
|
+
category: Ft(e.category),
|
|
242
273
|
assigneeEmail: e.assigneeEmail || void 0,
|
|
243
274
|
viewportWidth: Number(e.viewportWidth) || 0,
|
|
244
275
|
viewportHeight: Number(e.viewportHeight) || 0,
|
|
245
|
-
viewportPreset:
|
|
276
|
+
viewportPreset: Rt(e.viewportPreset),
|
|
246
277
|
screenshotUrl: e.screenshotUrl || void 0,
|
|
247
278
|
screenshotThumbnailUrl: e.screenshotThumbnailUrl || void 0,
|
|
248
279
|
attachments: fe(e.attachmentJson, []),
|
|
@@ -255,7 +286,7 @@ function je(e) {
|
|
|
255
286
|
resolvedBy: e.resolvedBy || void 0
|
|
256
287
|
} : null;
|
|
257
288
|
}
|
|
258
|
-
function
|
|
289
|
+
function Ct(e) {
|
|
259
290
|
return !e.id || !e.feedbackId ? null : {
|
|
260
291
|
id: e.id,
|
|
261
292
|
feedbackId: e.feedbackId,
|
|
@@ -271,7 +302,7 @@ function fe(e, t) {
|
|
|
271
302
|
return t;
|
|
272
303
|
}
|
|
273
304
|
}
|
|
274
|
-
function
|
|
305
|
+
function De(e) {
|
|
275
306
|
const t = fe(e, {});
|
|
276
307
|
return {
|
|
277
308
|
margin: t.margin ?? "",
|
|
@@ -299,22 +330,22 @@ function Ue(e) {
|
|
|
299
330
|
height: t.height ?? 0
|
|
300
331
|
};
|
|
301
332
|
}
|
|
302
|
-
function
|
|
333
|
+
function Et(e) {
|
|
303
334
|
return e === "admin" ? ["create", "read", "reply", "update", "assign"] : e === "developer" ? ["read", "reply", "update", "assign"] : ["create", "read", "reply"];
|
|
304
335
|
}
|
|
305
|
-
function
|
|
336
|
+
function Lt(e) {
|
|
306
337
|
return e === "in_progress" || e === "needs_clarification" || e === "fixed" || e === "wontfix" || e === "resolved" ? e : "open";
|
|
307
338
|
}
|
|
308
|
-
function
|
|
339
|
+
function At(e) {
|
|
309
340
|
return e === "low" || e === "high" ? e : "medium";
|
|
310
341
|
}
|
|
311
|
-
function
|
|
342
|
+
function Ft(e) {
|
|
312
343
|
return e === "visual" || e === "copy" || e === "accessibility" || e === "responsive" ? e : "bug";
|
|
313
344
|
}
|
|
314
|
-
function
|
|
345
|
+
function Rt(e) {
|
|
315
346
|
return e === "mobile" || e === "tablet" || e === "desktop" ? e : "custom";
|
|
316
347
|
}
|
|
317
|
-
function
|
|
348
|
+
function It(e) {
|
|
318
349
|
let t = e, n = "";
|
|
319
350
|
for (; t > 0; ) {
|
|
320
351
|
const r = (t - 1) % 26;
|
|
@@ -322,24 +353,58 @@ function Ft(e) {
|
|
|
322
353
|
}
|
|
323
354
|
return n;
|
|
324
355
|
}
|
|
325
|
-
async function
|
|
326
|
-
return await
|
|
356
|
+
async function Tt(e, t) {
|
|
357
|
+
return await Pt(), new Promise((n, r) => {
|
|
327
358
|
var c;
|
|
328
|
-
const
|
|
359
|
+
const o = (c = window.google) == null ? void 0 : c.accounts.oauth2.initTokenClient({
|
|
329
360
|
client_id: e,
|
|
330
361
|
scope: t,
|
|
331
|
-
callback: (
|
|
332
|
-
if (
|
|
333
|
-
r(new Error(
|
|
362
|
+
callback: (u) => {
|
|
363
|
+
if (u.error || !u.access_token) {
|
|
364
|
+
r(new Error(u.error ?? "Google OAuth did not return an access token"));
|
|
334
365
|
return;
|
|
335
366
|
}
|
|
336
|
-
|
|
367
|
+
const w = u.expires_in ?? 3600;
|
|
368
|
+
n({
|
|
369
|
+
accessToken: u.access_token,
|
|
370
|
+
expiresAt: Date.now() + w * 1e3
|
|
371
|
+
});
|
|
337
372
|
}
|
|
338
373
|
});
|
|
339
|
-
|
|
374
|
+
o == null || o.requestAccessToken({ prompt: "" });
|
|
340
375
|
});
|
|
341
376
|
}
|
|
342
|
-
function
|
|
377
|
+
function $t(e, t) {
|
|
378
|
+
return `${yt}:${e}:${t}`;
|
|
379
|
+
}
|
|
380
|
+
function Mt(e) {
|
|
381
|
+
try {
|
|
382
|
+
const t = window.localStorage.getItem(e);
|
|
383
|
+
if (!t)
|
|
384
|
+
return;
|
|
385
|
+
const n = JSON.parse(t);
|
|
386
|
+
if (typeof n.accessToken != "string" || typeof n.expiresAt != "number" || Date.now() >= n.expiresAt - kt) {
|
|
387
|
+
window.localStorage.removeItem(e);
|
|
388
|
+
return;
|
|
389
|
+
}
|
|
390
|
+
return n;
|
|
391
|
+
} catch {
|
|
392
|
+
return;
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
function Bt(e, t) {
|
|
396
|
+
try {
|
|
397
|
+
window.localStorage.setItem(e, JSON.stringify(t));
|
|
398
|
+
} catch {
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
function We(e) {
|
|
402
|
+
try {
|
|
403
|
+
window.localStorage.removeItem(e);
|
|
404
|
+
} catch {
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
function Pt() {
|
|
343
408
|
var e;
|
|
344
409
|
return (e = window.google) != null && e.accounts.oauth2 ? Promise.resolve() : new Promise((t, n) => {
|
|
345
410
|
const r = document.querySelector(
|
|
@@ -351,11 +416,11 @@ function Rt() {
|
|
|
351
416
|
});
|
|
352
417
|
return;
|
|
353
418
|
}
|
|
354
|
-
const
|
|
355
|
-
|
|
419
|
+
const o = document.createElement("script");
|
|
420
|
+
o.src = "https://accounts.google.com/gsi/client", o.async = !0, o.defer = !0, o.onload = () => t(), o.onerror = () => n(new Error("Google Identity failed to load")), document.head.append(o);
|
|
356
421
|
});
|
|
357
422
|
}
|
|
358
|
-
function
|
|
423
|
+
function _t(e) {
|
|
359
424
|
const t = [
|
|
360
425
|
`From: ${e.from}`,
|
|
361
426
|
`To: ${e.to.join(", ")}`,
|
|
@@ -365,26 +430,26 @@ function It(e) {
|
|
|
365
430
|
e.text
|
|
366
431
|
].join(`\r
|
|
367
432
|
`);
|
|
368
|
-
return
|
|
433
|
+
return jt(t);
|
|
369
434
|
}
|
|
370
|
-
function
|
|
435
|
+
function jt(e) {
|
|
371
436
|
const t = new TextEncoder().encode(e);
|
|
372
437
|
let n = "";
|
|
373
438
|
return t.forEach((r) => {
|
|
374
439
|
n += String.fromCharCode(r);
|
|
375
440
|
}), btoa(n).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
|
|
376
441
|
}
|
|
377
|
-
function
|
|
442
|
+
function Ut(e) {
|
|
378
443
|
return new URL(e, window.location.href).pathname.replace(/\/+$/, "") || "/";
|
|
379
444
|
}
|
|
380
|
-
const
|
|
381
|
-
function
|
|
382
|
-
const n =
|
|
445
|
+
const Ge = gt(null);
|
|
446
|
+
function xn({ config: e, children: t }) {
|
|
447
|
+
const n = oe(() => e.adapter ? e.adapter : St({
|
|
383
448
|
googleClientId: me(e.googleClientId, "googleClientId"),
|
|
384
449
|
contentSpreadsheetId: me(e.contentSpreadsheetId, "contentSpreadsheetId"),
|
|
385
450
|
usersSpreadsheetId: me(e.usersSpreadsheetId, "usersSpreadsheetId"),
|
|
386
451
|
feedbackSheetName: e.sheetName ?? "Feedback",
|
|
387
|
-
enableEmailNotifications:
|
|
452
|
+
enableEmailNotifications: qe(e)
|
|
388
453
|
}), [
|
|
389
454
|
e.adapter,
|
|
390
455
|
e.contentSpreadsheetId,
|
|
@@ -392,106 +457,106 @@ function wn({ config: e, children: t }) {
|
|
|
392
457
|
e.googleClientId,
|
|
393
458
|
e.sheetName,
|
|
394
459
|
e.usersSpreadsheetId
|
|
395
|
-
]), r = e.currentUrl ?? window.location.href,
|
|
396
|
-
const
|
|
460
|
+
]), r = e.currentUrl ?? window.location.href, o = (e.normalizeUrl ?? Ut)(r), [c, u] = x(), [w, g] = x([]), [b, A] = x([]), L = W(async () => {
|
|
461
|
+
const f = await n.listFeedback({
|
|
397
462
|
projectKey: e.projectKey,
|
|
398
463
|
contentId: e.contentId,
|
|
399
|
-
normalizedPath:
|
|
464
|
+
normalizedPath: o
|
|
400
465
|
});
|
|
401
|
-
|
|
402
|
-
}, [n, e.contentId, e.projectKey,
|
|
403
|
-
|
|
404
|
-
let
|
|
466
|
+
A(f);
|
|
467
|
+
}, [n, e.contentId, e.projectKey, o]);
|
|
468
|
+
P(() => {
|
|
469
|
+
let f = !0;
|
|
405
470
|
async function y() {
|
|
406
|
-
const [
|
|
471
|
+
const [N, F] = await Promise.all([
|
|
407
472
|
n.getCurrentUser(),
|
|
408
473
|
n.getPermissions(e.projectKey)
|
|
409
474
|
]);
|
|
410
|
-
|
|
475
|
+
f && (u(N), g(F), await L());
|
|
411
476
|
}
|
|
412
477
|
return y(), () => {
|
|
413
|
-
|
|
478
|
+
f = !1;
|
|
414
479
|
};
|
|
415
|
-
}, [n, e.projectKey,
|
|
416
|
-
const
|
|
417
|
-
async (
|
|
418
|
-
const y = await n.createFeedback(
|
|
419
|
-
return
|
|
420
|
-
actorEmail: (c == null ? void 0 : c.email) ??
|
|
480
|
+
}, [n, e.projectKey, L]);
|
|
481
|
+
const p = W(
|
|
482
|
+
async (f) => {
|
|
483
|
+
const y = await n.createFeedback(f);
|
|
484
|
+
return A((N) => [y, ...N]), pe(e, n, {
|
|
485
|
+
actorEmail: (c == null ? void 0 : c.email) ?? f.authorEmail,
|
|
421
486
|
item: y,
|
|
422
487
|
kind: "created"
|
|
423
488
|
}), y;
|
|
424
489
|
},
|
|
425
490
|
[n, e, c == null ? void 0 : c.email]
|
|
426
|
-
),
|
|
427
|
-
async (
|
|
428
|
-
const
|
|
429
|
-
return
|
|
430
|
-
(
|
|
491
|
+
), v = W(
|
|
492
|
+
async (f, y) => {
|
|
493
|
+
const N = b.find((M) => M.id === f), F = await n.updateFeedback(f, y);
|
|
494
|
+
return A(
|
|
495
|
+
(M) => M.map((j) => j.id === f ? F : j)
|
|
431
496
|
), pe(e, n, {
|
|
432
497
|
actorEmail: c == null ? void 0 : c.email,
|
|
433
498
|
item: F,
|
|
434
|
-
kind:
|
|
435
|
-
previousItem:
|
|
499
|
+
kind: Wt(y),
|
|
500
|
+
previousItem: N
|
|
436
501
|
}), F;
|
|
437
502
|
},
|
|
438
503
|
[n, e, c == null ? void 0 : c.email, b]
|
|
439
|
-
),
|
|
440
|
-
(
|
|
504
|
+
), h = W(
|
|
505
|
+
(f) => n.listMessages(f),
|
|
441
506
|
[n]
|
|
442
|
-
),
|
|
443
|
-
async (
|
|
444
|
-
const y = await n.createMessage(
|
|
445
|
-
return
|
|
446
|
-
actorEmail:
|
|
447
|
-
item:
|
|
507
|
+
), k = W(
|
|
508
|
+
async (f) => {
|
|
509
|
+
const y = await n.createMessage(f), N = b.find((F) => F.id === f.feedbackId);
|
|
510
|
+
return N && pe(e, n, {
|
|
511
|
+
actorEmail: f.authorEmail,
|
|
512
|
+
item: N,
|
|
448
513
|
kind: "reply",
|
|
449
|
-
replyBody:
|
|
514
|
+
replyBody: f.body
|
|
450
515
|
}), y;
|
|
451
516
|
},
|
|
452
517
|
[n, e, b]
|
|
453
518
|
), l = W(
|
|
454
|
-
async (
|
|
455
|
-
const
|
|
456
|
-
if (!
|
|
519
|
+
async (f, y) => {
|
|
520
|
+
const N = e.uploadAttachment ?? n.uploadAttachment;
|
|
521
|
+
if (!N)
|
|
457
522
|
throw new Error("Review Lens attachment upload is not configured");
|
|
458
|
-
return
|
|
523
|
+
return N(f, y);
|
|
459
524
|
},
|
|
460
525
|
[n, e]
|
|
461
|
-
),
|
|
526
|
+
), C = oe(
|
|
462
527
|
() => ({
|
|
463
528
|
config: e,
|
|
464
529
|
adapter: n,
|
|
465
530
|
currentUser: c,
|
|
466
531
|
permissions: w,
|
|
467
532
|
feedback: b,
|
|
468
|
-
normalizedPath:
|
|
469
|
-
refreshFeedback:
|
|
470
|
-
createFeedback:
|
|
471
|
-
updateFeedback:
|
|
472
|
-
listMessages:
|
|
473
|
-
createMessage:
|
|
533
|
+
normalizedPath: o,
|
|
534
|
+
refreshFeedback: L,
|
|
535
|
+
createFeedback: p,
|
|
536
|
+
updateFeedback: v,
|
|
537
|
+
listMessages: h,
|
|
538
|
+
createMessage: k,
|
|
474
539
|
uploadAttachment: l
|
|
475
540
|
}),
|
|
476
541
|
[
|
|
477
542
|
n,
|
|
478
543
|
e,
|
|
479
|
-
|
|
544
|
+
p,
|
|
480
545
|
c,
|
|
481
546
|
b,
|
|
482
|
-
|
|
547
|
+
o,
|
|
483
548
|
w,
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
549
|
+
L,
|
|
550
|
+
v,
|
|
551
|
+
h,
|
|
552
|
+
k,
|
|
488
553
|
l
|
|
489
554
|
]
|
|
490
555
|
);
|
|
491
|
-
return /* @__PURE__ */ i(
|
|
556
|
+
return /* @__PURE__ */ i(Ge.Provider, { value: C, children: t });
|
|
492
557
|
}
|
|
493
|
-
function
|
|
494
|
-
const e =
|
|
558
|
+
function Dt() {
|
|
559
|
+
const e = ft(Ge);
|
|
495
560
|
if (!e)
|
|
496
561
|
throw new Error("useReviewLens must be used inside ReviewLensProvider");
|
|
497
562
|
return e;
|
|
@@ -501,60 +566,60 @@ function me(e, t) {
|
|
|
501
566
|
throw new Error(`review-lens-react requires config.${t} when no adapter is provided`);
|
|
502
567
|
return e;
|
|
503
568
|
}
|
|
504
|
-
function
|
|
569
|
+
function qe(e) {
|
|
505
570
|
return typeof e.emailNotifications == "object" ? e.emailNotifications.enabled !== !1 : !!e.emailNotifications;
|
|
506
571
|
}
|
|
507
|
-
function
|
|
572
|
+
function Wt(e) {
|
|
508
573
|
return e.status === "resolved" ? "resolved" : e.status === "fixed" || e.fixedAt || e.fixedBy ? "fixed" : e.status ? "status" : "assigneeEmail" in e ? "assigned" : "updated";
|
|
509
574
|
}
|
|
510
575
|
async function pe(e, t, n) {
|
|
511
|
-
if (!
|
|
576
|
+
if (!qe(e) || !t.sendEmail)
|
|
512
577
|
return;
|
|
513
|
-
const r =
|
|
578
|
+
const r = zt(n);
|
|
514
579
|
if (r.length !== 0)
|
|
515
580
|
try {
|
|
516
581
|
await t.sendEmail({
|
|
517
582
|
to: r,
|
|
518
|
-
subject:
|
|
519
|
-
text:
|
|
583
|
+
subject: Ht(e, n),
|
|
584
|
+
text: Kt(n)
|
|
520
585
|
});
|
|
521
|
-
} catch (
|
|
522
|
-
console.warn("Review Lens email notification failed",
|
|
586
|
+
} catch (o) {
|
|
587
|
+
console.warn("Review Lens email notification failed", o);
|
|
523
588
|
}
|
|
524
589
|
}
|
|
525
|
-
function
|
|
590
|
+
function zt(e) {
|
|
526
591
|
var n;
|
|
527
592
|
const t = /* @__PURE__ */ new Set();
|
|
528
593
|
return t.add(e.item.authorEmail), (n = e.previousItem) != null && n.assigneeEmail && t.add(e.previousItem.assigneeEmail), e.item.assigneeEmail && t.add(e.item.assigneeEmail), [...t].filter((r) => {
|
|
529
|
-
var
|
|
530
|
-
return r ? r.toLowerCase() !== ((
|
|
594
|
+
var o;
|
|
595
|
+
return r ? r.toLowerCase() !== ((o = e.actorEmail) == null ? void 0 : o.toLowerCase()) : !1;
|
|
531
596
|
});
|
|
532
597
|
}
|
|
533
|
-
function
|
|
534
|
-
return `${(typeof e.emailNotifications == "object" ? e.emailNotifications : {}).subjectPrefix ?? "Review Lens"}: ${
|
|
598
|
+
function Ht(e, t) {
|
|
599
|
+
return `${(typeof e.emailNotifications == "object" ? e.emailNotifications : {}).subjectPrefix ?? "Review Lens"}: ${Ve(t)}`;
|
|
535
600
|
}
|
|
536
|
-
function
|
|
601
|
+
function Kt(e) {
|
|
537
602
|
const t = [
|
|
538
603
|
"[Review Lens]",
|
|
539
|
-
|
|
540
|
-
|
|
604
|
+
Ve(e),
|
|
605
|
+
Jt(e),
|
|
541
606
|
"",
|
|
542
607
|
`Review: ${e.item.comment}`,
|
|
543
|
-
`Status: ${
|
|
608
|
+
`Status: ${Ye(e.item.status)}`,
|
|
544
609
|
`Author: ${e.item.authorEmail}`,
|
|
545
610
|
`Assignee: ${e.item.assigneeEmail ?? "Unassigned"}`,
|
|
546
|
-
`Link: ${
|
|
611
|
+
`Link: ${Ot(e.item)}`
|
|
547
612
|
];
|
|
548
613
|
return e.replyBody && t.splice(2, 0, `Reply: ${e.replyBody}`, ""), t.join(`
|
|
549
614
|
`);
|
|
550
615
|
}
|
|
551
|
-
function
|
|
616
|
+
function Jt(e) {
|
|
552
617
|
return e.actorEmail ? `Sent by Review Lens on behalf of ${e.actorEmail}.` : "Sent by Review Lens on behalf of the signed-in Google user.";
|
|
553
618
|
}
|
|
554
|
-
function
|
|
555
|
-
return e.kind === "created" ? "New review feedback" : e.kind === "assigned" ? `Review assignment changed to ${e.item.assigneeEmail ?? "unassigned"}` : e.kind === "status" ? `Review status changed to ${
|
|
619
|
+
function Ve(e) {
|
|
620
|
+
return e.kind === "created" ? "New review feedback" : e.kind === "assigned" ? `Review assignment changed to ${e.item.assigneeEmail ?? "unassigned"}` : e.kind === "status" ? `Review status changed to ${Ye(e.item.status)}` : e.kind === "fixed" ? "Review marked fixed" : e.kind === "resolved" ? "Review resolved" : e.kind === "reply" ? "New review reply" : "Review updated";
|
|
556
621
|
}
|
|
557
|
-
function
|
|
622
|
+
function Ot(e) {
|
|
558
623
|
try {
|
|
559
624
|
const t = new URL(e.originalUrl);
|
|
560
625
|
return t.searchParams.set("reviewLensFeedback", e.id), t.toString();
|
|
@@ -562,10 +627,10 @@ function Wt(e) {
|
|
|
562
627
|
return e.originalUrl;
|
|
563
628
|
}
|
|
564
629
|
}
|
|
565
|
-
function
|
|
630
|
+
function Ye(e) {
|
|
566
631
|
return e.replace(/_/g, " ");
|
|
567
632
|
}
|
|
568
|
-
const
|
|
633
|
+
const Gt = [
|
|
569
634
|
"data-review-id",
|
|
570
635
|
"data-testid",
|
|
571
636
|
"data-test-id",
|
|
@@ -573,43 +638,43 @@ const Dt = [
|
|
|
573
638
|
"name"
|
|
574
639
|
];
|
|
575
640
|
function Q(e) {
|
|
576
|
-
const t = e.getBoundingClientRect(), n =
|
|
641
|
+
const t = e.getBoundingClientRect(), n = qt(e);
|
|
577
642
|
return {
|
|
578
643
|
selector: n.selector,
|
|
579
644
|
selectorStrategy: n.strategy,
|
|
580
|
-
fingerprint:
|
|
581
|
-
cssSnapshot:
|
|
645
|
+
fingerprint: Yt(e, t),
|
|
646
|
+
cssSnapshot: Xt(e, t),
|
|
582
647
|
rect: t
|
|
583
648
|
};
|
|
584
649
|
}
|
|
585
|
-
function
|
|
586
|
-
for (const t of
|
|
650
|
+
function qt(e) {
|
|
651
|
+
for (const t of Gt) {
|
|
587
652
|
const n = e.getAttribute(t);
|
|
588
653
|
if (n)
|
|
589
654
|
return {
|
|
590
|
-
selector: `[${t}="${
|
|
655
|
+
selector: `[${t}="${ze(n)}"]`,
|
|
591
656
|
strategy: "stable-attribute"
|
|
592
657
|
};
|
|
593
658
|
}
|
|
594
|
-
return e.id ? { selector: `#${
|
|
659
|
+
return e.id ? { selector: `#${ze(e.id)}`, strategy: "stable-attribute" } : { selector: Vt(e), strategy: "css-path" };
|
|
595
660
|
}
|
|
596
|
-
function
|
|
661
|
+
function Vt(e) {
|
|
597
662
|
const t = [];
|
|
598
663
|
let n = e;
|
|
599
664
|
for (; n && n.nodeType === Node.ELEMENT_NODE && n !== document.body; ) {
|
|
600
|
-
const r = n.parentElement,
|
|
665
|
+
const r = n.parentElement, o = n.tagName.toLowerCase();
|
|
601
666
|
if (!r) {
|
|
602
|
-
t.unshift(
|
|
667
|
+
t.unshift(o);
|
|
603
668
|
break;
|
|
604
669
|
}
|
|
605
|
-
const c = n.tagName,
|
|
606
|
-
(
|
|
607
|
-
), w =
|
|
608
|
-
t.unshift(
|
|
670
|
+
const c = n.tagName, u = Array.from(r.children).filter(
|
|
671
|
+
(g) => g.tagName === c
|
|
672
|
+
), w = u.indexOf(n) + 1;
|
|
673
|
+
t.unshift(u.length > 1 ? `${o}:nth-of-type(${w})` : o), n = r;
|
|
609
674
|
}
|
|
610
675
|
return t.join(" > ");
|
|
611
676
|
}
|
|
612
|
-
function
|
|
677
|
+
function Yt(e, t) {
|
|
613
678
|
var n;
|
|
614
679
|
return {
|
|
615
680
|
tagName: e.tagName.toLowerCase(),
|
|
@@ -621,7 +686,7 @@ function Kt(e, t) {
|
|
|
621
686
|
height: Math.round(t.height)
|
|
622
687
|
};
|
|
623
688
|
}
|
|
624
|
-
function
|
|
689
|
+
function Xt(e, t) {
|
|
625
690
|
const n = window.getComputedStyle(e);
|
|
626
691
|
return {
|
|
627
692
|
margin: ge(n.marginTop, n.marginRight, n.marginBottom, n.marginLeft),
|
|
@@ -662,11 +727,11 @@ function Jt(e, t) {
|
|
|
662
727
|
function ge(e, t, n, r) {
|
|
663
728
|
return e === t && t === n && n === r ? e : `${e} ${t} ${n} ${r}`;
|
|
664
729
|
}
|
|
665
|
-
function
|
|
730
|
+
function ze(e) {
|
|
666
731
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\]/g, "\\$&");
|
|
667
732
|
}
|
|
668
|
-
function
|
|
669
|
-
return /* @__PURE__ */
|
|
733
|
+
function Qt({ className: e, title: t = "Review Lens logo" }) {
|
|
734
|
+
return /* @__PURE__ */ s(
|
|
670
735
|
"svg",
|
|
671
736
|
{
|
|
672
737
|
className: e,
|
|
@@ -676,44 +741,53 @@ function Ot({ className: e, title: t = "Review Lens logo" }) {
|
|
|
676
741
|
fill: "none",
|
|
677
742
|
xmlns: "http://www.w3.org/2000/svg",
|
|
678
743
|
children: [
|
|
679
|
-
/* @__PURE__ */ i("rect", { x: "
|
|
744
|
+
/* @__PURE__ */ i("rect", { x: "5", y: "5", width: "30", height: "30", rx: "9", fill: "#111827" }),
|
|
680
745
|
/* @__PURE__ */ i(
|
|
681
746
|
"path",
|
|
682
747
|
{
|
|
683
|
-
d: "
|
|
684
|
-
stroke: "#
|
|
685
|
-
strokeWidth: "2.
|
|
748
|
+
d: "M11.5 20C14.2 15.7 17.4 13.6 20 13.6C22.6 13.6 25.8 15.7 28.5 20C25.8 24.3 22.6 26.4 20 26.4C17.4 26.4 14.2 24.3 11.5 20Z",
|
|
749
|
+
stroke: "#F8FAFC",
|
|
750
|
+
strokeWidth: "2.4",
|
|
686
751
|
strokeLinecap: "round",
|
|
687
752
|
strokeLinejoin: "round"
|
|
688
753
|
}
|
|
689
754
|
),
|
|
690
|
-
/* @__PURE__ */ i("circle", { cx: "20", cy: "18", r: "3.4", fill: "#F97316" }),
|
|
691
755
|
/* @__PURE__ */ i(
|
|
692
756
|
"path",
|
|
693
757
|
{
|
|
694
|
-
d: "
|
|
695
|
-
stroke: "#
|
|
696
|
-
strokeWidth: "
|
|
758
|
+
d: "M24.7 24.7L31.5 31.5",
|
|
759
|
+
stroke: "#22D3EE",
|
|
760
|
+
strokeWidth: "3.6",
|
|
697
761
|
strokeLinecap: "round"
|
|
698
762
|
}
|
|
699
763
|
),
|
|
700
|
-
/* @__PURE__ */ i("circle", { cx: "
|
|
764
|
+
/* @__PURE__ */ i("circle", { cx: "20", cy: "20", r: "4.6", fill: "#F8FAFC" }),
|
|
765
|
+
/* @__PURE__ */ i("circle", { cx: "20", cy: "20", r: "2.2", fill: "#2563EB" }),
|
|
766
|
+
/* @__PURE__ */ i(
|
|
767
|
+
"path",
|
|
768
|
+
{
|
|
769
|
+
d: "M14.2 11.6L17 11.6M11.6 14.2L11.6 17M28.4 14.2L28.4 17",
|
|
770
|
+
stroke: "#A7F3D0",
|
|
771
|
+
strokeWidth: "2",
|
|
772
|
+
strokeLinecap: "round"
|
|
773
|
+
}
|
|
774
|
+
)
|
|
701
775
|
]
|
|
702
776
|
}
|
|
703
777
|
);
|
|
704
778
|
}
|
|
705
|
-
const
|
|
779
|
+
const Zt = [
|
|
706
780
|
{ label: "Desktop", value: "desktop" },
|
|
707
781
|
{ label: "Tablet", value: "tablet" },
|
|
708
782
|
{ label: "Mobile", value: "mobile" }
|
|
709
|
-
],
|
|
783
|
+
], Xe = [
|
|
710
784
|
"open",
|
|
711
785
|
"in_progress",
|
|
712
786
|
"needs_clarification",
|
|
713
787
|
"fixed",
|
|
714
788
|
"wontfix",
|
|
715
789
|
"resolved"
|
|
716
|
-
],
|
|
790
|
+
], Qe = ["low", "medium", "high"], Ze = ["bug", "visual", "copy", "accessibility", "responsive"], se = {
|
|
717
791
|
open: "Open",
|
|
718
792
|
in_progress: "In progress",
|
|
719
793
|
needs_clarification: "Needs clarification",
|
|
@@ -731,156 +805,156 @@ const qt = [
|
|
|
731
805
|
accessibility: "Accessibility",
|
|
732
806
|
responsive: "Responsive"
|
|
733
807
|
};
|
|
734
|
-
function
|
|
808
|
+
function Nn({
|
|
735
809
|
open: e,
|
|
736
810
|
onOpenChange: t,
|
|
737
811
|
placement: n = "top-right",
|
|
738
812
|
showResolved: r = !1,
|
|
739
|
-
syncSelectionToUrl:
|
|
740
|
-
responsivePresets: c =
|
|
813
|
+
syncSelectionToUrl: o = !1,
|
|
814
|
+
responsivePresets: c = Zt
|
|
741
815
|
}) {
|
|
742
|
-
var
|
|
816
|
+
var Me;
|
|
743
817
|
const {
|
|
744
|
-
adapter:
|
|
818
|
+
adapter: u,
|
|
745
819
|
config: w,
|
|
746
|
-
currentUser:
|
|
820
|
+
currentUser: g,
|
|
747
821
|
feedback: b,
|
|
748
|
-
normalizedPath:
|
|
749
|
-
permissions:
|
|
750
|
-
createFeedback:
|
|
751
|
-
updateFeedback:
|
|
752
|
-
listMessages:
|
|
753
|
-
createMessage:
|
|
822
|
+
normalizedPath: A,
|
|
823
|
+
permissions: L,
|
|
824
|
+
createFeedback: p,
|
|
825
|
+
updateFeedback: v,
|
|
826
|
+
listMessages: h,
|
|
827
|
+
createMessage: k,
|
|
754
828
|
uploadAttachment: l
|
|
755
|
-
} =
|
|
756
|
-
((
|
|
757
|
-
), [
|
|
758
|
-
|
|
759
|
-
), $ = !!
|
|
760
|
-
const a = b.map((
|
|
761
|
-
return
|
|
762
|
-
}, [
|
|
763
|
-
() => b.filter((a) => r || a.status !== "resolved").filter((a) => J === "all" || a.status === J).filter((a) => O === "all" || a.severity === O).filter((a) =>
|
|
829
|
+
} = Dt(), [C, f] = x(), [y, N] = x(), [F, M] = x(""), [j, tt] = x("medium"), [we, nt] = x("visual"), [ve, be] = x(""), [ye, it] = x(
|
|
830
|
+
((Me = c[0]) == null ? void 0 : Me.value) ?? "desktop"
|
|
831
|
+
), [S, K] = x(), [T, _] = x("review"), [rt, ke] = x(!1), [J, Se] = x("all"), [O, xe] = x("all"), [G, Ne] = x("all"), [q, Ce] = x("all"), [V, Ee] = x("all"), [at, ot] = x(!1), [st, Le] = x({}), [le, ce] = x(""), te = re(null), Ae = re(e), de = re(
|
|
832
|
+
o ? new URL(window.location.href).searchParams.get("reviewLensFeedback") : null
|
|
833
|
+
), $ = !!g, B = L.includes("create"), Fe = L.includes("reply"), Re = L.includes("update"), lt = L.includes("assign"), U = C ?? y, ct = !!y, dt = !!(w.captureScreenshot && (w.uploadAttachment || u.uploadAttachment)), ht = oe(() => {
|
|
834
|
+
const a = b.map((m) => m.assigneeEmail).filter((m) => !!m);
|
|
835
|
+
return g != null && g.email && a.push(g.email), Array.from(new Set(a)).sort((m, d) => m.localeCompare(d));
|
|
836
|
+
}, [g == null ? void 0 : g.email, b]), R = oe(
|
|
837
|
+
() => b.filter((a) => r || a.status !== "resolved").filter((a) => J === "all" || a.status === J).filter((a) => O === "all" || a.severity === O).filter((a) => G === "all" || a.category === G).filter((a) => q === "all" || a.assigneeEmail === q).filter((a) => V === "all" || a.viewportPreset === V),
|
|
764
838
|
[
|
|
765
|
-
V,
|
|
766
839
|
q,
|
|
840
|
+
G,
|
|
767
841
|
b,
|
|
768
842
|
O,
|
|
769
843
|
r,
|
|
770
844
|
J,
|
|
771
|
-
|
|
845
|
+
V
|
|
772
846
|
]
|
|
773
|
-
),
|
|
847
|
+
), ut = [
|
|
774
848
|
J,
|
|
775
849
|
O,
|
|
850
|
+
G,
|
|
776
851
|
q,
|
|
777
|
-
V
|
|
778
|
-
G
|
|
852
|
+
V
|
|
779
853
|
].filter((a) => a !== "all").length;
|
|
780
|
-
|
|
854
|
+
P(() => {
|
|
781
855
|
if (e) {
|
|
782
|
-
|
|
856
|
+
Ae.current = !0;
|
|
783
857
|
return;
|
|
784
858
|
}
|
|
785
|
-
if (
|
|
859
|
+
if (f(void 0), N(void 0), M(""), ce(""), _("review"), o && Ae.current) {
|
|
786
860
|
const a = new URL(window.location.href);
|
|
787
861
|
a.searchParams.has("reviewLensFeedback") && (a.searchParams.delete("reviewLensFeedback"), window.history.replaceState({}, "", a));
|
|
788
862
|
}
|
|
789
|
-
}, [e,
|
|
790
|
-
$ || (
|
|
791
|
-
}, [$]),
|
|
792
|
-
!y ||
|
|
793
|
-
var a,
|
|
794
|
-
(
|
|
863
|
+
}, [e, o]), P(() => {
|
|
864
|
+
$ || (f(void 0), N(void 0));
|
|
865
|
+
}, [$]), P(() => {
|
|
866
|
+
!y || T !== "review" || window.requestAnimationFrame(() => {
|
|
867
|
+
var a, m, d;
|
|
868
|
+
(m = (a = te.current) == null ? void 0 : a.scrollIntoView) == null || m.call(a, { block: "nearest" }), (d = te.current) == null || d.focus();
|
|
795
869
|
});
|
|
796
|
-
}, [y,
|
|
797
|
-
if (!
|
|
870
|
+
}, [y, T]), P(() => {
|
|
871
|
+
if (!S)
|
|
798
872
|
return;
|
|
799
873
|
let a = !0;
|
|
800
|
-
return
|
|
801
|
-
a && Le((d) => ({ ...d, [
|
|
874
|
+
return h(S.id).then((m) => {
|
|
875
|
+
a && Le((d) => ({ ...d, [S.id]: m }));
|
|
802
876
|
}), () => {
|
|
803
877
|
a = !1;
|
|
804
878
|
};
|
|
805
|
-
}, [
|
|
806
|
-
if (!
|
|
879
|
+
}, [h, S]), P(() => {
|
|
880
|
+
if (!o || !de.current || b.length === 0)
|
|
807
881
|
return;
|
|
808
|
-
const a = b.find((
|
|
809
|
-
a && (
|
|
810
|
-
}, [b,
|
|
811
|
-
if (!e || !
|
|
882
|
+
const a = b.find((m) => m.id === de.current);
|
|
883
|
+
a && (de.current = null, t == null || t(!0), z(a, { syncUrl: !1 }));
|
|
884
|
+
}, [b, o]), P(() => {
|
|
885
|
+
if (!e || !o || S || b.length === 0)
|
|
812
886
|
return;
|
|
813
|
-
const a = new URL(window.location.href).searchParams.get("reviewLensFeedback"),
|
|
814
|
-
|
|
815
|
-
}, [b, e,
|
|
887
|
+
const a = new URL(window.location.href).searchParams.get("reviewLensFeedback"), m = b.find((d) => d.id === a);
|
|
888
|
+
m && z(m, { syncUrl: !1 });
|
|
889
|
+
}, [b, e, S, o]), P(() => {
|
|
816
890
|
if (!e)
|
|
817
891
|
return;
|
|
818
892
|
function a(d) {
|
|
819
|
-
var
|
|
820
|
-
if (d.key === "Shift" &&
|
|
893
|
+
var E;
|
|
894
|
+
if (d.key === "Shift" && ke(!0), d.key === "Escape") {
|
|
821
895
|
d.preventDefault(), t == null || t(!1);
|
|
822
896
|
return;
|
|
823
897
|
}
|
|
824
|
-
|
|
898
|
+
wn(d.target) || ((d.key === "n" || d.key === "ArrowDown") && (d.preventDefault(), Ie(1)), (d.key === "p" || d.key === "ArrowUp") && (d.preventDefault(), Ie(-1)), d.key === "c" && (d.preventDefault(), _("review"), (E = te.current) == null || E.focus()), d.key === "f" && S && Re && (d.preventDefault(), $e(S)));
|
|
825
899
|
}
|
|
826
|
-
function
|
|
827
|
-
d.key === "Shift" &&
|
|
900
|
+
function m(d) {
|
|
901
|
+
d.key === "Shift" && ke(!1);
|
|
828
902
|
}
|
|
829
|
-
return window.addEventListener("keydown", a), window.addEventListener("keyup",
|
|
830
|
-
window.removeEventListener("keydown", a), window.removeEventListener("keyup",
|
|
903
|
+
return window.addEventListener("keydown", a), window.addEventListener("keyup", m), () => {
|
|
904
|
+
window.removeEventListener("keydown", a), window.removeEventListener("keyup", m);
|
|
831
905
|
};
|
|
832
906
|
});
|
|
833
907
|
const he = W((a) => {
|
|
834
|
-
const
|
|
835
|
-
if (
|
|
836
|
-
return
|
|
908
|
+
const m = a.target instanceof Element ? a.target : null;
|
|
909
|
+
if (m)
|
|
910
|
+
return m.closest("[data-review-lens-ui]") ? null : m;
|
|
837
911
|
const d = document.elementFromPoint(a.clientX, a.clientY);
|
|
838
912
|
return !d || d.closest("[data-review-lens-ui]") ? null : d;
|
|
839
913
|
}, []);
|
|
840
|
-
if (
|
|
914
|
+
if (P(() => {
|
|
841
915
|
if (!e || !$)
|
|
842
916
|
return;
|
|
843
917
|
function a(d) {
|
|
844
|
-
const
|
|
845
|
-
|
|
918
|
+
const E = he(d);
|
|
919
|
+
f(E ? Q(E) : void 0);
|
|
846
920
|
}
|
|
847
|
-
function
|
|
848
|
-
const
|
|
849
|
-
|
|
921
|
+
function m(d) {
|
|
922
|
+
const E = he(d);
|
|
923
|
+
E && (d.preventDefault(), d.stopPropagation(), N(Q(E)), _("review"));
|
|
850
924
|
}
|
|
851
|
-
return window.addEventListener("mousemove", a, !0), window.addEventListener("click",
|
|
852
|
-
window.removeEventListener("mousemove", a, !0), window.removeEventListener("click",
|
|
925
|
+
return window.addEventListener("mousemove", a, !0), window.addEventListener("click", m, !0), () => {
|
|
926
|
+
window.removeEventListener("mousemove", a, !0), window.removeEventListener("click", m, !0);
|
|
853
927
|
};
|
|
854
928
|
}, [$, he, e]), !e)
|
|
855
929
|
return null;
|
|
856
|
-
function
|
|
857
|
-
var
|
|
858
|
-
if (K(a),
|
|
930
|
+
function z(a, m = { syncUrl: !0 }) {
|
|
931
|
+
var E;
|
|
932
|
+
if (K(a), N(void 0), _("feedback"), o && m.syncUrl !== !1) {
|
|
859
933
|
const ne = new URL(window.location.href);
|
|
860
934
|
ne.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", ne);
|
|
861
935
|
}
|
|
862
|
-
const d =
|
|
936
|
+
const d = H(a.selector);
|
|
863
937
|
if (!d) {
|
|
864
|
-
|
|
938
|
+
f(void 0);
|
|
865
939
|
return;
|
|
866
940
|
}
|
|
867
|
-
(
|
|
868
|
-
|
|
941
|
+
(E = d.scrollIntoView) == null || E.call(d, { behavior: "smooth", block: "center", inline: "center" }), window.requestAnimationFrame(() => {
|
|
942
|
+
f(Q(d));
|
|
869
943
|
});
|
|
870
944
|
}
|
|
871
945
|
function Ie(a) {
|
|
872
946
|
if (R.length === 0)
|
|
873
947
|
return;
|
|
874
|
-
const
|
|
875
|
-
|
|
948
|
+
const m = S ? R.findIndex((E) => E.id === S.id) : -1, d = m < 0 ? a > 0 ? 0 : R.length - 1 : (m + a + R.length) % R.length;
|
|
949
|
+
z(R[d]);
|
|
876
950
|
}
|
|
877
|
-
async function
|
|
878
|
-
if (!y || !F.trim() || !
|
|
951
|
+
async function Te() {
|
|
952
|
+
if (!y || !F.trim() || !g || !B)
|
|
879
953
|
return;
|
|
880
|
-
let a = await
|
|
954
|
+
let a = await p({
|
|
881
955
|
projectKey: w.projectKey,
|
|
882
956
|
contentId: w.contentId,
|
|
883
|
-
normalizedPath:
|
|
957
|
+
normalizedPath: A,
|
|
884
958
|
originalUrl: w.currentUrl ?? window.location.href,
|
|
885
959
|
selector: y.selector,
|
|
886
960
|
selectorStrategy: y.selectorStrategy,
|
|
@@ -888,115 +962,115 @@ function bn({
|
|
|
888
962
|
createdCssSnapshot: y.cssSnapshot,
|
|
889
963
|
comment: F.trim(),
|
|
890
964
|
status: "open",
|
|
891
|
-
severity:
|
|
965
|
+
severity: j,
|
|
892
966
|
category: we,
|
|
893
|
-
assigneeEmail:
|
|
967
|
+
assigneeEmail: ve.trim() || void 0,
|
|
894
968
|
viewportWidth: window.innerWidth,
|
|
895
969
|
viewportHeight: window.innerHeight,
|
|
896
970
|
viewportPreset: ye,
|
|
897
971
|
screenshotUrl: void 0,
|
|
898
972
|
screenshotThumbnailUrl: void 0,
|
|
899
|
-
authorEmail:
|
|
973
|
+
authorEmail: g.email
|
|
900
974
|
});
|
|
901
975
|
if (w.captureScreenshot)
|
|
902
976
|
try {
|
|
903
|
-
const
|
|
977
|
+
const m = await w.captureScreenshot(y), d = await l(a.id, {
|
|
904
978
|
type: "screenshot",
|
|
905
|
-
data:
|
|
906
|
-
createdBy:
|
|
979
|
+
data: m,
|
|
980
|
+
createdBy: g.email
|
|
907
981
|
});
|
|
908
|
-
a = await
|
|
982
|
+
a = await v(a.id, {
|
|
909
983
|
attachments: [d],
|
|
910
984
|
screenshotUrl: d.url,
|
|
911
985
|
screenshotThumbnailUrl: d.thumbnailUrl
|
|
912
986
|
});
|
|
913
987
|
} catch {
|
|
914
988
|
}
|
|
915
|
-
if (
|
|
916
|
-
const
|
|
917
|
-
|
|
989
|
+
if (M(""), be(""), N(void 0), f(void 0), _("feedback"), K(a), o) {
|
|
990
|
+
const m = new URL(window.location.href);
|
|
991
|
+
m.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", m);
|
|
918
992
|
}
|
|
919
993
|
}
|
|
920
|
-
async function
|
|
921
|
-
const d = (/* @__PURE__ */ new Date()).toISOString(),
|
|
994
|
+
async function mt(a, m) {
|
|
995
|
+
const d = (/* @__PURE__ */ new Date()).toISOString(), E = m === "resolved" ? { status: m, resolvedAt: d, resolvedBy: g == null ? void 0 : g.email } : { status: m }, ne = await v(a.id, E);
|
|
922
996
|
K(ne);
|
|
923
997
|
}
|
|
924
998
|
async function $e(a) {
|
|
925
|
-
const
|
|
926
|
-
if (!
|
|
999
|
+
const m = H(a.selector);
|
|
1000
|
+
if (!m || !g)
|
|
927
1001
|
return;
|
|
928
|
-
const d = Q(
|
|
1002
|
+
const d = Q(m), E = await v(a.id, {
|
|
929
1003
|
status: "fixed",
|
|
930
1004
|
fixedCssSnapshot: d.cssSnapshot,
|
|
931
1005
|
fixedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
932
|
-
fixedBy:
|
|
1006
|
+
fixedBy: g.email
|
|
933
1007
|
});
|
|
934
|
-
K(
|
|
1008
|
+
K(E);
|
|
935
1009
|
}
|
|
936
|
-
async function
|
|
937
|
-
if (!le.trim() || !
|
|
1010
|
+
async function pt(a) {
|
|
1011
|
+
if (!le.trim() || !g || !Fe)
|
|
938
1012
|
return;
|
|
939
|
-
const
|
|
1013
|
+
const m = await k({
|
|
940
1014
|
feedbackId: a.id,
|
|
941
1015
|
body: le.trim(),
|
|
942
|
-
authorEmail:
|
|
1016
|
+
authorEmail: g.email
|
|
943
1017
|
});
|
|
944
1018
|
Le((d) => ({
|
|
945
1019
|
...d,
|
|
946
|
-
[a.id]: [...d[a.id] ?? [],
|
|
947
|
-
})),
|
|
1020
|
+
[a.id]: [...d[a.id] ?? [], m]
|
|
1021
|
+
})), ce("");
|
|
948
1022
|
}
|
|
949
|
-
return /* @__PURE__ */
|
|
950
|
-
$ &&
|
|
951
|
-
$ && y &&
|
|
952
|
-
$ ? /* @__PURE__ */
|
|
1023
|
+
return /* @__PURE__ */ s("div", { className: "review-lens-root", "data-review-lens-ui": !0, children: [
|
|
1024
|
+
$ && U ? /* @__PURE__ */ i(on, { target: U, locked: !!y }) : null,
|
|
1025
|
+
$ && y && C && rt ? /* @__PURE__ */ i(sn, { from: y, to: C }) : null,
|
|
1026
|
+
$ ? /* @__PURE__ */ s(ae, { children: [
|
|
953
1027
|
/* @__PURE__ */ i(
|
|
954
|
-
|
|
1028
|
+
ln,
|
|
955
1029
|
{
|
|
956
1030
|
feedback: R,
|
|
957
|
-
selectedFeedback:
|
|
958
|
-
onSelect:
|
|
1031
|
+
selectedFeedback: S,
|
|
1032
|
+
onSelect: z
|
|
959
1033
|
}
|
|
960
1034
|
),
|
|
961
1035
|
/* @__PURE__ */ i(
|
|
962
|
-
|
|
1036
|
+
dn,
|
|
963
1037
|
{
|
|
964
1038
|
feedback: R,
|
|
965
|
-
selectedFeedback:
|
|
966
|
-
onSelect:
|
|
1039
|
+
selectedFeedback: S,
|
|
1040
|
+
onSelect: z
|
|
967
1041
|
}
|
|
968
1042
|
)
|
|
969
1043
|
] }) : null,
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */ i(
|
|
974
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ s("aside", { className: `review-lens-panel review-lens-panel--${n}`, "data-review-lens-ui": !0, children: [
|
|
1045
|
+
/* @__PURE__ */ s("header", { className: "review-lens-panel__header", children: [
|
|
1046
|
+
/* @__PURE__ */ s("div", { className: "review-lens-brand", children: [
|
|
1047
|
+
/* @__PURE__ */ i(Qt, { className: "review-lens-brand__mark" }),
|
|
1048
|
+
/* @__PURE__ */ s("div", { children: [
|
|
975
1049
|
/* @__PURE__ */ i("p", { className: "review-lens-kicker", children: "Review Lens" }),
|
|
976
|
-
/* @__PURE__ */ i("h2", { children:
|
|
1050
|
+
/* @__PURE__ */ i("h2", { children: T === "summary" ? "Summary" : T === "feedback" ? "Feedback" : y ? "Element locked" : "Inspecting" })
|
|
977
1051
|
] })
|
|
978
1052
|
] }),
|
|
979
1053
|
/* @__PURE__ */ i("button", { type: "button", onClick: () => t == null ? void 0 : t(!1), children: "Close" })
|
|
980
1054
|
] }),
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
/* @__PURE__ */
|
|
1055
|
+
/* @__PURE__ */ s("div", { className: "review-lens-panel__body", children: [
|
|
1056
|
+
/* @__PURE__ */ s("div", { className: "review-lens-mode-switch", role: "tablist", "aria-label": "Review Lens mode", children: [
|
|
983
1057
|
/* @__PURE__ */ i(
|
|
984
1058
|
"button",
|
|
985
1059
|
{
|
|
986
1060
|
type: "button",
|
|
987
1061
|
role: "tab",
|
|
988
|
-
"aria-selected":
|
|
989
|
-
onClick: () =>
|
|
1062
|
+
"aria-selected": T === "review",
|
|
1063
|
+
onClick: () => _("review"),
|
|
990
1064
|
children: "Review"
|
|
991
1065
|
}
|
|
992
1066
|
),
|
|
993
|
-
/* @__PURE__ */
|
|
1067
|
+
/* @__PURE__ */ s(
|
|
994
1068
|
"button",
|
|
995
1069
|
{
|
|
996
1070
|
type: "button",
|
|
997
1071
|
role: "tab",
|
|
998
|
-
"aria-selected":
|
|
999
|
-
onClick: () =>
|
|
1072
|
+
"aria-selected": T === "feedback",
|
|
1073
|
+
onClick: () => _("feedback"),
|
|
1000
1074
|
children: [
|
|
1001
1075
|
"Feedback ",
|
|
1002
1076
|
/* @__PURE__ */ i("span", { children: R.length })
|
|
@@ -1008,34 +1082,34 @@ function bn({
|
|
|
1008
1082
|
{
|
|
1009
1083
|
type: "button",
|
|
1010
1084
|
role: "tab",
|
|
1011
|
-
"aria-selected":
|
|
1012
|
-
onClick: () =>
|
|
1085
|
+
"aria-selected": T === "summary",
|
|
1086
|
+
onClick: () => _("summary"),
|
|
1013
1087
|
children: "Summary"
|
|
1014
1088
|
}
|
|
1015
1089
|
)
|
|
1016
1090
|
] }),
|
|
1017
|
-
|
|
1018
|
-
/* @__PURE__ */
|
|
1091
|
+
T === "review" ? /* @__PURE__ */ s("div", { className: "review-lens-review-pane", role: "tabpanel", children: [
|
|
1092
|
+
/* @__PURE__ */ s("div", { className: "review-lens-inspection", children: [
|
|
1019
1093
|
$ ? null : /* @__PURE__ */ i("p", { children: "Authenticate with Google to inspect this page." }),
|
|
1020
|
-
$ &&
|
|
1021
|
-
/* @__PURE__ */ i(
|
|
1022
|
-
/* @__PURE__ */ i(
|
|
1094
|
+
$ && U ? /* @__PURE__ */ s(ae, { children: [
|
|
1095
|
+
/* @__PURE__ */ i(hn, { target: U }),
|
|
1096
|
+
/* @__PURE__ */ i(He, { title: "Accessibility", items: un(U) }),
|
|
1023
1097
|
/* @__PURE__ */ i(
|
|
1024
|
-
|
|
1098
|
+
He,
|
|
1025
1099
|
{
|
|
1026
1100
|
title: "Design tokens",
|
|
1027
|
-
items:
|
|
1101
|
+
items: mn(U.cssSnapshot, w.designTokens)
|
|
1028
1102
|
}
|
|
1029
1103
|
)
|
|
1030
1104
|
] }) : null,
|
|
1031
|
-
$ && !
|
|
1105
|
+
$ && !U ? /* @__PURE__ */ i("p", { children: "Move over the app to inspect." }) : null
|
|
1032
1106
|
] }),
|
|
1033
|
-
|
|
1107
|
+
ct ? /* @__PURE__ */ i("div", { className: "review-lens-composer-panel", children: /* @__PURE__ */ s(
|
|
1034
1108
|
"form",
|
|
1035
1109
|
{
|
|
1036
1110
|
className: "review-lens-feedback-form",
|
|
1037
1111
|
onSubmit: (a) => {
|
|
1038
|
-
a.preventDefault(),
|
|
1112
|
+
a.preventDefault(), Te();
|
|
1039
1113
|
},
|
|
1040
1114
|
children: [
|
|
1041
1115
|
/* @__PURE__ */ i("label", { htmlFor: "review-lens-comment", children: "New feedback" }),
|
|
@@ -1045,181 +1119,181 @@ function bn({
|
|
|
1045
1119
|
ref: te,
|
|
1046
1120
|
id: "review-lens-comment",
|
|
1047
1121
|
value: F,
|
|
1048
|
-
disabled: !
|
|
1049
|
-
onChange: (a) =>
|
|
1122
|
+
disabled: !B,
|
|
1123
|
+
onChange: (a) => M(a.target.value),
|
|
1050
1124
|
onKeyDown: (a) => {
|
|
1051
|
-
a.key === "Enter" && a.metaKey && (a.preventDefault(),
|
|
1125
|
+
a.key === "Enter" && a.metaKey && (a.preventDefault(), Te());
|
|
1052
1126
|
},
|
|
1053
|
-
placeholder:
|
|
1127
|
+
placeholder: B ? "Describe the UX issue..." : "You do not have permission to comment."
|
|
1054
1128
|
}
|
|
1055
1129
|
),
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
/* @__PURE__ */
|
|
1130
|
+
/* @__PURE__ */ s("div", { className: "review-lens-form-grid", children: [
|
|
1131
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1058
1132
|
"Severity",
|
|
1059
1133
|
/* @__PURE__ */ i(
|
|
1060
1134
|
"select",
|
|
1061
1135
|
{
|
|
1062
|
-
value:
|
|
1063
|
-
onChange: (a) =>
|
|
1064
|
-
disabled: !
|
|
1065
|
-
children:
|
|
1136
|
+
value: j,
|
|
1137
|
+
onChange: (a) => tt(a.target.value),
|
|
1138
|
+
disabled: !B,
|
|
1139
|
+
children: Qe.map((a) => /* @__PURE__ */ i("option", { value: a, children: Z[a] }, a))
|
|
1066
1140
|
}
|
|
1067
1141
|
)
|
|
1068
1142
|
] }),
|
|
1069
|
-
/* @__PURE__ */
|
|
1143
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1070
1144
|
"Type",
|
|
1071
1145
|
/* @__PURE__ */ i(
|
|
1072
1146
|
"select",
|
|
1073
1147
|
{
|
|
1074
1148
|
value: we,
|
|
1075
|
-
onChange: (a) =>
|
|
1076
|
-
disabled: !
|
|
1077
|
-
children:
|
|
1149
|
+
onChange: (a) => nt(a.target.value),
|
|
1150
|
+
disabled: !B,
|
|
1151
|
+
children: Ze.map((a) => /* @__PURE__ */ i("option", { value: a, children: ee[a] }, a))
|
|
1078
1152
|
}
|
|
1079
1153
|
)
|
|
1080
1154
|
] }),
|
|
1081
|
-
/* @__PURE__ */
|
|
1155
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1082
1156
|
"Assignee",
|
|
1083
1157
|
/* @__PURE__ */ i(
|
|
1084
1158
|
"input",
|
|
1085
1159
|
{
|
|
1086
|
-
value:
|
|
1087
|
-
onChange: (a) =>
|
|
1088
|
-
disabled: !
|
|
1160
|
+
value: ve,
|
|
1161
|
+
onChange: (a) => be(a.target.value),
|
|
1162
|
+
disabled: !B,
|
|
1089
1163
|
placeholder: "optional@email.com"
|
|
1090
1164
|
}
|
|
1091
1165
|
)
|
|
1092
1166
|
] }),
|
|
1093
|
-
/* @__PURE__ */
|
|
1167
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1094
1168
|
"Viewport",
|
|
1095
1169
|
/* @__PURE__ */ i(
|
|
1096
1170
|
"select",
|
|
1097
1171
|
{
|
|
1098
1172
|
value: ye,
|
|
1099
|
-
onChange: (a) =>
|
|
1100
|
-
disabled: !
|
|
1173
|
+
onChange: (a) => it(a.target.value),
|
|
1174
|
+
disabled: !B,
|
|
1101
1175
|
children: c.map((a) => /* @__PURE__ */ i("option", { value: a.value, children: a.label }, a.value))
|
|
1102
1176
|
}
|
|
1103
1177
|
)
|
|
1104
1178
|
] })
|
|
1105
1179
|
] }),
|
|
1106
|
-
|
|
1180
|
+
B ? /* @__PURE__ */ s("p", { className: "review-lens-feedback-form__hint", children: [
|
|
1107
1181
|
"Press ",
|
|
1108
1182
|
/* @__PURE__ */ i("kbd", { children: "Command" }),
|
|
1109
1183
|
" + ",
|
|
1110
1184
|
/* @__PURE__ */ i("kbd", { children: "Enter" }),
|
|
1111
1185
|
" to submit.",
|
|
1112
|
-
|
|
1186
|
+
dt ? " Screenshot capture runs after save." : ""
|
|
1113
1187
|
] }) : null,
|
|
1114
|
-
/* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "submit", disabled: !F.trim() || !
|
|
1188
|
+
/* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "submit", disabled: !F.trim() || !B, children: "Save feedback" }) })
|
|
1115
1189
|
]
|
|
1116
1190
|
}
|
|
1117
1191
|
) }) : null
|
|
1118
1192
|
] }) : null,
|
|
1119
|
-
|
|
1193
|
+
T === "feedback" ? /* @__PURE__ */ s("div", { className: "review-lens-comments", children: [
|
|
1120
1194
|
/* @__PURE__ */ i(
|
|
1121
|
-
|
|
1195
|
+
en,
|
|
1122
1196
|
{
|
|
1123
|
-
open:
|
|
1124
|
-
activeCount:
|
|
1197
|
+
open: at,
|
|
1198
|
+
activeCount: ut,
|
|
1125
1199
|
statusFilter: J,
|
|
1126
1200
|
severityFilter: O,
|
|
1127
|
-
categoryFilter:
|
|
1128
|
-
assigneeFilter:
|
|
1129
|
-
viewportFilter:
|
|
1130
|
-
assignees:
|
|
1201
|
+
categoryFilter: G,
|
|
1202
|
+
assigneeFilter: q,
|
|
1203
|
+
viewportFilter: V,
|
|
1204
|
+
assignees: ht,
|
|
1131
1205
|
responsivePresets: c,
|
|
1132
|
-
onStatusChange:
|
|
1133
|
-
onSeverityChange:
|
|
1134
|
-
onCategoryChange:
|
|
1135
|
-
onAssigneeChange:
|
|
1206
|
+
onStatusChange: Se,
|
|
1207
|
+
onSeverityChange: xe,
|
|
1208
|
+
onCategoryChange: Ne,
|
|
1209
|
+
onAssigneeChange: Ce,
|
|
1136
1210
|
onViewportChange: Ee,
|
|
1137
|
-
onToggle: () =>
|
|
1211
|
+
onToggle: () => ot((a) => !a),
|
|
1138
1212
|
onClear: () => {
|
|
1139
|
-
|
|
1213
|
+
Se("all"), xe("all"), Ne("all"), Ce("all"), Ee("all");
|
|
1140
1214
|
}
|
|
1141
1215
|
}
|
|
1142
1216
|
),
|
|
1143
|
-
/* @__PURE__ */
|
|
1144
|
-
/* @__PURE__ */
|
|
1217
|
+
/* @__PURE__ */ s("div", { className: "review-lens-list-panel", children: [
|
|
1218
|
+
/* @__PURE__ */ s("div", { className: "review-lens-comments__header", children: [
|
|
1145
1219
|
/* @__PURE__ */ i("h3", { children: "All feedback" }),
|
|
1146
1220
|
/* @__PURE__ */ i("span", { children: R.length })
|
|
1147
1221
|
] }),
|
|
1148
|
-
/* @__PURE__ */
|
|
1222
|
+
/* @__PURE__ */ s("div", { className: "review-lens-comments__list", children: [
|
|
1149
1223
|
R.length === 0 ? /* @__PURE__ */ i("p", { children: "No feedback for this view." }) : null,
|
|
1150
1224
|
R.map((a) => /* @__PURE__ */ i(
|
|
1151
|
-
|
|
1225
|
+
tn,
|
|
1152
1226
|
{
|
|
1153
1227
|
item: a,
|
|
1154
|
-
selected: (
|
|
1155
|
-
onSelect:
|
|
1228
|
+
selected: (S == null ? void 0 : S.id) === a.id,
|
|
1229
|
+
onSelect: z
|
|
1156
1230
|
},
|
|
1157
1231
|
a.id
|
|
1158
1232
|
))
|
|
1159
1233
|
] })
|
|
1160
1234
|
] }),
|
|
1161
|
-
|
|
1235
|
+
S ? /* @__PURE__ */ s("div", { className: "review-lens-selected-panel", children: [
|
|
1162
1236
|
/* @__PURE__ */ i("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
|
|
1163
1237
|
/* @__PURE__ */ i(
|
|
1164
|
-
|
|
1238
|
+
nn,
|
|
1165
1239
|
{
|
|
1166
|
-
item:
|
|
1167
|
-
messages:
|
|
1240
|
+
item: S,
|
|
1241
|
+
messages: st[S.id] ?? [],
|
|
1168
1242
|
messageDraft: le,
|
|
1169
|
-
canReply:
|
|
1243
|
+
canReply: Fe,
|
|
1170
1244
|
canUpdate: Re,
|
|
1171
|
-
canAssign:
|
|
1172
|
-
syncSelectionToUrl:
|
|
1173
|
-
onMessageDraftChange:
|
|
1174
|
-
onSubmitMessage: () => void
|
|
1175
|
-
onStatusChange: (a) => void
|
|
1176
|
-
onAssigneeChange: (a) => void S
|
|
1245
|
+
canAssign: lt,
|
|
1246
|
+
syncSelectionToUrl: o,
|
|
1247
|
+
onMessageDraftChange: ce,
|
|
1248
|
+
onSubmitMessage: () => void pt(S),
|
|
1249
|
+
onStatusChange: (a) => void mt(S, a),
|
|
1250
|
+
onAssigneeChange: (a) => void v(S.id, {
|
|
1177
1251
|
assigneeEmail: a.trim() || void 0
|
|
1178
1252
|
}).then(K),
|
|
1179
|
-
onMarkFixed: () => void $e(
|
|
1253
|
+
onMarkFixed: () => void $e(S)
|
|
1180
1254
|
},
|
|
1181
|
-
|
|
1255
|
+
S.id
|
|
1182
1256
|
)
|
|
1183
|
-
] }) : /* @__PURE__ */
|
|
1257
|
+
] }) : /* @__PURE__ */ s("div", { className: "review-lens-selected-panel review-lens-selected-panel--empty", children: [
|
|
1184
1258
|
/* @__PURE__ */ i("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
|
|
1185
1259
|
/* @__PURE__ */ i("p", { children: "Select a feedback item above to review status, assignment, drift, and replies." })
|
|
1186
1260
|
] })
|
|
1187
1261
|
] }) : null,
|
|
1188
|
-
|
|
1262
|
+
T === "summary" ? /* @__PURE__ */ i(an, { feedback: b }) : null
|
|
1189
1263
|
] })
|
|
1190
1264
|
] })
|
|
1191
1265
|
] });
|
|
1192
1266
|
}
|
|
1193
|
-
function
|
|
1267
|
+
function en({
|
|
1194
1268
|
open: e,
|
|
1195
1269
|
activeCount: t,
|
|
1196
1270
|
statusFilter: n,
|
|
1197
1271
|
severityFilter: r,
|
|
1198
|
-
categoryFilter:
|
|
1272
|
+
categoryFilter: o,
|
|
1199
1273
|
assigneeFilter: c,
|
|
1200
|
-
viewportFilter:
|
|
1274
|
+
viewportFilter: u,
|
|
1201
1275
|
assignees: w,
|
|
1202
|
-
responsivePresets:
|
|
1276
|
+
responsivePresets: g,
|
|
1203
1277
|
onStatusChange: b,
|
|
1204
|
-
onSeverityChange:
|
|
1205
|
-
onCategoryChange:
|
|
1206
|
-
onAssigneeChange:
|
|
1207
|
-
onViewportChange:
|
|
1208
|
-
onToggle:
|
|
1209
|
-
onClear:
|
|
1278
|
+
onSeverityChange: A,
|
|
1279
|
+
onCategoryChange: L,
|
|
1280
|
+
onAssigneeChange: p,
|
|
1281
|
+
onViewportChange: v,
|
|
1282
|
+
onToggle: h,
|
|
1283
|
+
onClear: k
|
|
1210
1284
|
}) {
|
|
1211
|
-
return /* @__PURE__ */
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
/* @__PURE__ */
|
|
1285
|
+
return /* @__PURE__ */ s("div", { className: "review-lens-filter-shell", children: [
|
|
1286
|
+
/* @__PURE__ */ s("div", { className: "review-lens-filter-bar", children: [
|
|
1287
|
+
/* @__PURE__ */ s("button", { type: "button", "aria-expanded": e, onClick: h, children: [
|
|
1214
1288
|
"Filters",
|
|
1215
1289
|
t > 0 ? /* @__PURE__ */ i("span", { children: t }) : null
|
|
1216
1290
|
] }),
|
|
1217
|
-
t > 0 ? /* @__PURE__ */ i("button", { type: "button", onClick:
|
|
1291
|
+
t > 0 ? /* @__PURE__ */ i("button", { type: "button", onClick: k, children: "Clear" }) : null
|
|
1218
1292
|
] }),
|
|
1219
|
-
e ? /* @__PURE__ */
|
|
1220
|
-
/* @__PURE__ */
|
|
1293
|
+
e ? /* @__PURE__ */ s("div", { className: "review-lens-filters", children: [
|
|
1294
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1221
1295
|
"Status",
|
|
1222
|
-
/* @__PURE__ */
|
|
1296
|
+
/* @__PURE__ */ s(
|
|
1223
1297
|
"select",
|
|
1224
1298
|
{
|
|
1225
1299
|
"aria-label": "Filter status",
|
|
@@ -1227,49 +1301,49 @@ function Vt({
|
|
|
1227
1301
|
onChange: (l) => b(l.target.value),
|
|
1228
1302
|
children: [
|
|
1229
1303
|
/* @__PURE__ */ i("option", { value: "all", children: "All statuses" }),
|
|
1230
|
-
|
|
1304
|
+
Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: se[l] }, l))
|
|
1231
1305
|
]
|
|
1232
1306
|
}
|
|
1233
1307
|
)
|
|
1234
1308
|
] }),
|
|
1235
|
-
/* @__PURE__ */
|
|
1309
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1236
1310
|
"Priority",
|
|
1237
|
-
/* @__PURE__ */
|
|
1311
|
+
/* @__PURE__ */ s(
|
|
1238
1312
|
"select",
|
|
1239
1313
|
{
|
|
1240
1314
|
"aria-label": "Filter severity",
|
|
1241
1315
|
value: r,
|
|
1242
|
-
onChange: (l) =>
|
|
1316
|
+
onChange: (l) => A(l.target.value),
|
|
1243
1317
|
children: [
|
|
1244
1318
|
/* @__PURE__ */ i("option", { value: "all", children: "All priorities" }),
|
|
1245
|
-
|
|
1319
|
+
Qe.map((l) => /* @__PURE__ */ i("option", { value: l, children: Z[l] }, l))
|
|
1246
1320
|
]
|
|
1247
1321
|
}
|
|
1248
1322
|
)
|
|
1249
1323
|
] }),
|
|
1250
|
-
/* @__PURE__ */
|
|
1324
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1251
1325
|
"Type",
|
|
1252
|
-
/* @__PURE__ */
|
|
1326
|
+
/* @__PURE__ */ s(
|
|
1253
1327
|
"select",
|
|
1254
1328
|
{
|
|
1255
1329
|
"aria-label": "Filter type",
|
|
1256
|
-
value:
|
|
1257
|
-
onChange: (l) =>
|
|
1330
|
+
value: o,
|
|
1331
|
+
onChange: (l) => L(l.target.value),
|
|
1258
1332
|
children: [
|
|
1259
1333
|
/* @__PURE__ */ i("option", { value: "all", children: "All types" }),
|
|
1260
|
-
|
|
1334
|
+
Ze.map((l) => /* @__PURE__ */ i("option", { value: l, children: ee[l] }, l))
|
|
1261
1335
|
]
|
|
1262
1336
|
}
|
|
1263
1337
|
)
|
|
1264
1338
|
] }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1339
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1266
1340
|
"Assignee",
|
|
1267
|
-
/* @__PURE__ */
|
|
1341
|
+
/* @__PURE__ */ s(
|
|
1268
1342
|
"select",
|
|
1269
1343
|
{
|
|
1270
1344
|
"aria-label": "Filter assignee",
|
|
1271
1345
|
value: c,
|
|
1272
|
-
onChange: (l) =>
|
|
1346
|
+
onChange: (l) => p(l.target.value),
|
|
1273
1347
|
children: [
|
|
1274
1348
|
/* @__PURE__ */ i("option", { value: "all", children: "All assignees" }),
|
|
1275
1349
|
w.map((l) => /* @__PURE__ */ i("option", { value: l, children: l }, l))
|
|
@@ -1277,17 +1351,17 @@ function Vt({
|
|
|
1277
1351
|
}
|
|
1278
1352
|
)
|
|
1279
1353
|
] }),
|
|
1280
|
-
/* @__PURE__ */
|
|
1354
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1281
1355
|
"Viewport",
|
|
1282
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ s(
|
|
1283
1357
|
"select",
|
|
1284
1358
|
{
|
|
1285
1359
|
"aria-label": "Filter viewport",
|
|
1286
|
-
value:
|
|
1287
|
-
onChange: (l) =>
|
|
1360
|
+
value: u,
|
|
1361
|
+
onChange: (l) => v(l.target.value),
|
|
1288
1362
|
children: [
|
|
1289
1363
|
/* @__PURE__ */ i("option", { value: "all", children: "All viewports" }),
|
|
1290
|
-
|
|
1364
|
+
g.map((l) => /* @__PURE__ */ i("option", { value: l.value, children: l.label }, l.value))
|
|
1291
1365
|
]
|
|
1292
1366
|
}
|
|
1293
1367
|
)
|
|
@@ -1295,13 +1369,13 @@ function Vt({
|
|
|
1295
1369
|
] }) : null
|
|
1296
1370
|
] });
|
|
1297
1371
|
}
|
|
1298
|
-
function
|
|
1372
|
+
function tn({
|
|
1299
1373
|
item: e,
|
|
1300
1374
|
selected: t,
|
|
1301
1375
|
onSelect: n
|
|
1302
1376
|
}) {
|
|
1303
|
-
const r =
|
|
1304
|
-
return /* @__PURE__ */
|
|
1377
|
+
const r = et(e);
|
|
1378
|
+
return /* @__PURE__ */ s(
|
|
1305
1379
|
"article",
|
|
1306
1380
|
{
|
|
1307
1381
|
tabIndex: 0,
|
|
@@ -1311,22 +1385,22 @@ function Gt({
|
|
|
1311
1385
|
t ? "review-lens-comment--selected" : ""
|
|
1312
1386
|
].filter(Boolean).join(" "),
|
|
1313
1387
|
onClick: () => n(e),
|
|
1314
|
-
onKeyDown: (
|
|
1315
|
-
(
|
|
1388
|
+
onKeyDown: (o) => {
|
|
1389
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), n(e));
|
|
1316
1390
|
},
|
|
1317
1391
|
children: [
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */ i("span", { children:
|
|
1392
|
+
/* @__PURE__ */ s("div", { className: "review-lens-comment__header", children: [
|
|
1393
|
+
/* @__PURE__ */ i("span", { children: se[e.status] }),
|
|
1320
1394
|
/* @__PURE__ */ i("strong", { children: Z[e.severity] })
|
|
1321
1395
|
] }),
|
|
1322
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ s("div", { className: "review-lens-comment__content", children: [
|
|
1323
1397
|
/* @__PURE__ */ i("p", { children: e.comment }),
|
|
1324
|
-
/* @__PURE__ */
|
|
1398
|
+
/* @__PURE__ */ s("span", { children: [
|
|
1325
1399
|
e.authorEmail,
|
|
1326
1400
|
e.assigneeEmail ? ` -> ${e.assigneeEmail}` : ""
|
|
1327
1401
|
] })
|
|
1328
1402
|
] }),
|
|
1329
|
-
/* @__PURE__ */
|
|
1403
|
+
/* @__PURE__ */ s("div", { className: "review-lens-tags", children: [
|
|
1330
1404
|
/* @__PURE__ */ i("span", { children: ee[e.category] }),
|
|
1331
1405
|
/* @__PURE__ */ i("span", { children: e.viewportPreset }),
|
|
1332
1406
|
/* @__PURE__ */ i("span", { children: r.label })
|
|
@@ -1335,96 +1409,96 @@ function Gt({
|
|
|
1335
1409
|
}
|
|
1336
1410
|
);
|
|
1337
1411
|
}
|
|
1338
|
-
function
|
|
1412
|
+
function nn({
|
|
1339
1413
|
item: e,
|
|
1340
1414
|
messages: t,
|
|
1341
1415
|
messageDraft: n,
|
|
1342
1416
|
canReply: r,
|
|
1343
|
-
canUpdate:
|
|
1417
|
+
canUpdate: o,
|
|
1344
1418
|
canAssign: c,
|
|
1345
|
-
syncSelectionToUrl:
|
|
1419
|
+
syncSelectionToUrl: u,
|
|
1346
1420
|
onMessageDraftChange: w,
|
|
1347
|
-
onSubmitMessage:
|
|
1421
|
+
onSubmitMessage: g,
|
|
1348
1422
|
onStatusChange: b,
|
|
1349
|
-
onAssigneeChange:
|
|
1350
|
-
onMarkFixed:
|
|
1423
|
+
onAssigneeChange: A,
|
|
1424
|
+
onMarkFixed: L
|
|
1351
1425
|
}) {
|
|
1352
|
-
const [
|
|
1353
|
-
function
|
|
1426
|
+
const [p, v] = x(!1), h = et(e);
|
|
1427
|
+
function k() {
|
|
1354
1428
|
const l = new URL(window.location.href);
|
|
1355
|
-
l.searchParams.set("reviewLensFeedback", e.id),
|
|
1356
|
-
|
|
1429
|
+
l.searchParams.set("reviewLensFeedback", e.id), rn(l.toString()).then((C) => {
|
|
1430
|
+
C && (v(!0), setTimeout(() => v(!1), 2e3));
|
|
1357
1431
|
});
|
|
1358
1432
|
}
|
|
1359
|
-
return /* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1433
|
+
return /* @__PURE__ */ s("section", { className: "review-lens-detail", "aria-label": "Selected feedback detail", children: [
|
|
1434
|
+
/* @__PURE__ */ s("div", { className: "review-lens-detail__header", children: [
|
|
1435
|
+
/* @__PURE__ */ s("h3", { children: [
|
|
1362
1436
|
ee[e.category],
|
|
1363
1437
|
" feedback"
|
|
1364
1438
|
] }),
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
-
|
|
1439
|
+
/* @__PURE__ */ s("div", { className: "review-lens-detail__header-actions", children: [
|
|
1440
|
+
u ? /* @__PURE__ */ i(
|
|
1367
1441
|
"button",
|
|
1368
1442
|
{
|
|
1369
1443
|
type: "button",
|
|
1370
1444
|
className: "review-lens-copy-link",
|
|
1371
|
-
onClick:
|
|
1445
|
+
onClick: k,
|
|
1372
1446
|
"aria-label": "Copy link to this feedback",
|
|
1373
|
-
children:
|
|
1447
|
+
children: p ? "Copied!" : "Copy link"
|
|
1374
1448
|
}
|
|
1375
1449
|
) : null,
|
|
1376
1450
|
/* @__PURE__ */ i("strong", { children: Z[e.severity] })
|
|
1377
1451
|
] })
|
|
1378
1452
|
] }),
|
|
1379
1453
|
/* @__PURE__ */ i("blockquote", { children: e.comment }),
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1454
|
+
/* @__PURE__ */ s("dl", { className: "review-lens-detail-meta", children: [
|
|
1455
|
+
/* @__PURE__ */ s("div", { children: [
|
|
1382
1456
|
/* @__PURE__ */ i("dt", { children: "Target" }),
|
|
1383
|
-
/* @__PURE__ */ i("dd", { children:
|
|
1457
|
+
/* @__PURE__ */ i("dd", { children: h.label })
|
|
1384
1458
|
] }),
|
|
1385
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ s("div", { children: [
|
|
1386
1460
|
/* @__PURE__ */ i("dt", { children: "Viewport" }),
|
|
1387
1461
|
/* @__PURE__ */ i("dd", { children: e.viewportPreset })
|
|
1388
1462
|
] }),
|
|
1389
|
-
e.screenshotUrl ? /* @__PURE__ */
|
|
1463
|
+
e.screenshotUrl ? /* @__PURE__ */ s("div", { children: [
|
|
1390
1464
|
/* @__PURE__ */ i("dt", { children: "Evidence" }),
|
|
1391
1465
|
/* @__PURE__ */ i("dd", { children: /* @__PURE__ */ i("a", { href: e.screenshotUrl, target: "_blank", rel: "noreferrer", children: "Screenshot" }) })
|
|
1392
1466
|
] }) : null
|
|
1393
1467
|
] }),
|
|
1394
|
-
/* @__PURE__ */
|
|
1395
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ s("div", { className: "review-lens-form-grid", children: [
|
|
1469
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1396
1470
|
"Status",
|
|
1397
1471
|
/* @__PURE__ */ i(
|
|
1398
1472
|
"select",
|
|
1399
1473
|
{
|
|
1400
1474
|
value: e.status,
|
|
1401
|
-
disabled: !
|
|
1475
|
+
disabled: !o,
|
|
1402
1476
|
onChange: (l) => b(l.target.value),
|
|
1403
|
-
children:
|
|
1477
|
+
children: Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: se[l] }, l))
|
|
1404
1478
|
}
|
|
1405
1479
|
)
|
|
1406
1480
|
] }),
|
|
1407
|
-
/* @__PURE__ */
|
|
1481
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1408
1482
|
"Assignee",
|
|
1409
1483
|
/* @__PURE__ */ i(
|
|
1410
1484
|
"input",
|
|
1411
1485
|
{
|
|
1412
1486
|
defaultValue: e.assigneeEmail ?? "",
|
|
1413
1487
|
disabled: !c,
|
|
1414
|
-
onBlur: (l) =>
|
|
1488
|
+
onBlur: (l) => A(l.target.value),
|
|
1415
1489
|
placeholder: "optional@email.com"
|
|
1416
1490
|
}
|
|
1417
1491
|
)
|
|
1418
1492
|
] })
|
|
1419
1493
|
] }),
|
|
1420
|
-
/* @__PURE__ */
|
|
1494
|
+
/* @__PURE__ */ s("div", { className: "review-lens-status-actions", children: [
|
|
1421
1495
|
/* @__PURE__ */ i(
|
|
1422
1496
|
"button",
|
|
1423
1497
|
{
|
|
1424
1498
|
type: "button",
|
|
1425
1499
|
className: "review-lens-button-secondary",
|
|
1426
|
-
disabled: !
|
|
1427
|
-
onClick:
|
|
1500
|
+
disabled: !o,
|
|
1501
|
+
onClick: L,
|
|
1428
1502
|
children: "Mark fixed"
|
|
1429
1503
|
}
|
|
1430
1504
|
),
|
|
@@ -1433,19 +1507,19 @@ function Yt({
|
|
|
1433
1507
|
{
|
|
1434
1508
|
type: "button",
|
|
1435
1509
|
className: "review-lens-button-primary",
|
|
1436
|
-
disabled: !
|
|
1510
|
+
disabled: !o,
|
|
1437
1511
|
onClick: () => b("resolved"),
|
|
1438
1512
|
children: "Resolve"
|
|
1439
1513
|
}
|
|
1440
1514
|
)
|
|
1441
1515
|
] }),
|
|
1442
|
-
/* @__PURE__ */
|
|
1443
|
-
/* @__PURE__ */
|
|
1516
|
+
/* @__PURE__ */ s("div", { className: "review-lens-thread", children: [
|
|
1517
|
+
/* @__PURE__ */ s("div", { className: "review-lens-thread__header", children: [
|
|
1444
1518
|
/* @__PURE__ */ i("h3", { children: "Thread" }),
|
|
1445
1519
|
/* @__PURE__ */ i("span", { children: t.length })
|
|
1446
1520
|
] }),
|
|
1447
1521
|
t.length === 0 ? /* @__PURE__ */ i("p", { children: "No replies yet." }) : null,
|
|
1448
|
-
t.map((l) => /* @__PURE__ */
|
|
1522
|
+
t.map((l) => /* @__PURE__ */ s("div", { className: "review-lens-thread__message", children: [
|
|
1449
1523
|
/* @__PURE__ */ i("p", { children: l.body }),
|
|
1450
1524
|
/* @__PURE__ */ i("span", { children: l.authorEmail })
|
|
1451
1525
|
] }, l.id)),
|
|
@@ -1459,11 +1533,11 @@ function Yt({
|
|
|
1459
1533
|
placeholder: r ? "Reply..." : "You do not have permission to reply."
|
|
1460
1534
|
}
|
|
1461
1535
|
),
|
|
1462
|
-
/* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "button", disabled: !n.trim() || !r, onClick:
|
|
1536
|
+
/* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "button", disabled: !n.trim() || !r, onClick: g, children: "Reply" }) })
|
|
1463
1537
|
] })
|
|
1464
1538
|
] });
|
|
1465
1539
|
}
|
|
1466
|
-
async function
|
|
1540
|
+
async function rn(e) {
|
|
1467
1541
|
var n;
|
|
1468
1542
|
if ((n = navigator.clipboard) != null && n.writeText)
|
|
1469
1543
|
return await navigator.clipboard.writeText(e), !0;
|
|
@@ -1475,9 +1549,9 @@ async function Xt(e) {
|
|
|
1475
1549
|
t.remove();
|
|
1476
1550
|
}
|
|
1477
1551
|
}
|
|
1478
|
-
function
|
|
1479
|
-
return /* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */ i(Y, { title: "Status", values: X(e, (t) =>
|
|
1552
|
+
function an({ feedback: e }) {
|
|
1553
|
+
return /* @__PURE__ */ s("div", { className: "review-lens-summary", role: "tabpanel", children: [
|
|
1554
|
+
/* @__PURE__ */ i(Y, { title: "Status", values: X(e, (t) => se[t.status]) }),
|
|
1481
1555
|
/* @__PURE__ */ i(Y, { title: "Severity", values: X(e, (t) => Z[t.severity]) }),
|
|
1482
1556
|
/* @__PURE__ */ i(Y, { title: "Type", values: X(e, (t) => ee[t.category]) }),
|
|
1483
1557
|
/* @__PURE__ */ i(Y, { title: "Assignee", values: X(e, (t) => t.assigneeEmail ?? "Unassigned") }),
|
|
@@ -1485,17 +1559,17 @@ function Qt({ feedback: e }) {
|
|
|
1485
1559
|
] });
|
|
1486
1560
|
}
|
|
1487
1561
|
function Y({ title: e, values: t }) {
|
|
1488
|
-
return /* @__PURE__ */
|
|
1562
|
+
return /* @__PURE__ */ s("section", { children: [
|
|
1489
1563
|
/* @__PURE__ */ i("h3", { children: e }),
|
|
1490
|
-
/* @__PURE__ */ i("dl", { children: t.map(([n, r]) => /* @__PURE__ */
|
|
1564
|
+
/* @__PURE__ */ i("dl", { children: t.map(([n, r]) => /* @__PURE__ */ s("div", { children: [
|
|
1491
1565
|
/* @__PURE__ */ i("dt", { children: n }),
|
|
1492
1566
|
/* @__PURE__ */ i("dd", { children: r })
|
|
1493
1567
|
] }, n)) })
|
|
1494
1568
|
] });
|
|
1495
1569
|
}
|
|
1496
|
-
function
|
|
1497
|
-
const n =
|
|
1498
|
-
return /* @__PURE__ */
|
|
1570
|
+
function on({ target: e, locked: t }) {
|
|
1571
|
+
const n = yn(e), r = gn(e.fingerprint);
|
|
1572
|
+
return /* @__PURE__ */ s(
|
|
1499
1573
|
"div",
|
|
1500
1574
|
{
|
|
1501
1575
|
className: t ? "review-lens-highlight review-lens-highlight--locked" : "review-lens-highlight",
|
|
@@ -1542,9 +1616,9 @@ function Zt({ target: e, locked: t }) {
|
|
|
1542
1616
|
}
|
|
1543
1617
|
}
|
|
1544
1618
|
),
|
|
1545
|
-
/* @__PURE__ */
|
|
1619
|
+
/* @__PURE__ */ s("div", { className: "review-lens-highlight__label", children: [
|
|
1546
1620
|
/* @__PURE__ */ i("strong", { children: r }),
|
|
1547
|
-
/* @__PURE__ */
|
|
1621
|
+
/* @__PURE__ */ s("span", { children: [
|
|
1548
1622
|
Math.round(e.rect.width),
|
|
1549
1623
|
" x ",
|
|
1550
1624
|
Math.round(e.rect.height)
|
|
@@ -1554,8 +1628,8 @@ function Zt({ target: e, locked: t }) {
|
|
|
1554
1628
|
}
|
|
1555
1629
|
);
|
|
1556
1630
|
}
|
|
1557
|
-
function
|
|
1558
|
-
const n =
|
|
1631
|
+
function sn({ from: e, to: t }) {
|
|
1632
|
+
const n = fn(e.rect, t.rect);
|
|
1559
1633
|
return n.length === 0 ? null : /* @__PURE__ */ i(ae, { children: n.map((r) => /* @__PURE__ */ i(
|
|
1560
1634
|
"div",
|
|
1561
1635
|
{
|
|
@@ -1571,13 +1645,13 @@ function en({ from: e, to: t }) {
|
|
|
1571
1645
|
r.key
|
|
1572
1646
|
)) });
|
|
1573
1647
|
}
|
|
1574
|
-
function
|
|
1648
|
+
function ln({
|
|
1575
1649
|
feedback: e,
|
|
1576
1650
|
selectedFeedback: t,
|
|
1577
1651
|
onSelect: n
|
|
1578
1652
|
}) {
|
|
1579
1653
|
return /* @__PURE__ */ i(ae, { children: e.map((r) => /* @__PURE__ */ i(
|
|
1580
|
-
|
|
1654
|
+
cn,
|
|
1581
1655
|
{
|
|
1582
1656
|
feedback: r,
|
|
1583
1657
|
selected: (t == null ? void 0 : t.id) === r.id,
|
|
@@ -1586,23 +1660,23 @@ function tn({
|
|
|
1586
1660
|
r.id
|
|
1587
1661
|
)) });
|
|
1588
1662
|
}
|
|
1589
|
-
function
|
|
1663
|
+
function cn({
|
|
1590
1664
|
feedback: e,
|
|
1591
1665
|
selected: t,
|
|
1592
1666
|
onSelect: n
|
|
1593
1667
|
}) {
|
|
1594
1668
|
const r = re(null);
|
|
1595
|
-
return
|
|
1596
|
-
let
|
|
1669
|
+
return wt(() => {
|
|
1670
|
+
let o = 0;
|
|
1597
1671
|
const c = () => {
|
|
1598
|
-
|
|
1599
|
-
const w = r.current,
|
|
1672
|
+
o = 0;
|
|
1673
|
+
const w = r.current, g = H(e.selector), b = g == null ? void 0 : g.getBoundingClientRect();
|
|
1600
1674
|
!w || !b || (w.style.top = `${b.top}px`, w.style.left = `${b.right}px`, w.hidden = b.bottom < 0 || b.top > window.innerHeight);
|
|
1601
|
-
},
|
|
1602
|
-
|
|
1675
|
+
}, u = () => {
|
|
1676
|
+
o || (o = window.requestAnimationFrame(c));
|
|
1603
1677
|
};
|
|
1604
|
-
return c(), window.addEventListener("scroll",
|
|
1605
|
-
|
|
1678
|
+
return c(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
1679
|
+
o && window.cancelAnimationFrame(o), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
1606
1680
|
};
|
|
1607
1681
|
}, [e.selector]), /* @__PURE__ */ i(
|
|
1608
1682
|
"button",
|
|
@@ -1615,35 +1689,35 @@ function nn({
|
|
|
1615
1689
|
}
|
|
1616
1690
|
);
|
|
1617
1691
|
}
|
|
1618
|
-
function
|
|
1692
|
+
function dn({
|
|
1619
1693
|
feedback: e,
|
|
1620
1694
|
selectedFeedback: t,
|
|
1621
1695
|
onSelect: n
|
|
1622
1696
|
}) {
|
|
1623
|
-
const r = e.map((
|
|
1624
|
-
const c =
|
|
1697
|
+
const r = e.map((o) => {
|
|
1698
|
+
const c = H(o.selector), u = c == null ? void 0 : c.getBoundingClientRect(), w = Math.max(
|
|
1625
1699
|
document.documentElement.scrollHeight,
|
|
1626
1700
|
document.body.scrollHeight,
|
|
1627
1701
|
window.innerHeight
|
|
1628
1702
|
);
|
|
1629
|
-
return !
|
|
1630
|
-
item:
|
|
1631
|
-
top: Math.min(100, Math.max(0, (
|
|
1703
|
+
return !u || w <= 0 ? null : {
|
|
1704
|
+
item: o,
|
|
1705
|
+
top: Math.min(100, Math.max(0, (u.top + window.scrollY) / w * 100))
|
|
1632
1706
|
};
|
|
1633
|
-
}).filter((
|
|
1634
|
-
return r.length === 0 ? null : /* @__PURE__ */ i("div", { className: "review-lens-minimap", "data-review-lens-ui": !0, "aria-label": "Feedback map", children: r.map((
|
|
1707
|
+
}).filter((o) => o !== null);
|
|
1708
|
+
return r.length === 0 ? null : /* @__PURE__ */ i("div", { className: "review-lens-minimap", "data-review-lens-ui": !0, "aria-label": "Feedback map", children: r.map((o) => /* @__PURE__ */ i(
|
|
1635
1709
|
"button",
|
|
1636
1710
|
{
|
|
1637
1711
|
type: "button",
|
|
1638
|
-
className: (t == null ? void 0 : t.id) ===
|
|
1639
|
-
style: { top: `${
|
|
1640
|
-
onClick: () => n(
|
|
1641
|
-
"aria-label": `Jump to feedback from ${
|
|
1712
|
+
className: (t == null ? void 0 : t.id) === o.item.id ? "review-lens-minimap__point review-lens-minimap__point--selected" : "review-lens-minimap__point",
|
|
1713
|
+
style: { top: `${o.top}%` },
|
|
1714
|
+
onClick: () => n(o.item),
|
|
1715
|
+
"aria-label": `Jump to feedback from ${o.item.authorEmail}`
|
|
1642
1716
|
},
|
|
1643
|
-
|
|
1717
|
+
o.item.id
|
|
1644
1718
|
)) });
|
|
1645
1719
|
}
|
|
1646
|
-
function
|
|
1720
|
+
function hn({ target: e }) {
|
|
1647
1721
|
const t = [
|
|
1648
1722
|
["Selector", e.selector],
|
|
1649
1723
|
["Size", `${e.cssSnapshot.width} x ${e.cssSnapshot.height}`],
|
|
@@ -1656,120 +1730,120 @@ function an({ target: e }) {
|
|
|
1656
1730
|
["Color", e.cssSnapshot.color],
|
|
1657
1731
|
["Background", e.cssSnapshot.backgroundColor]
|
|
1658
1732
|
];
|
|
1659
|
-
return /* @__PURE__ */ i("dl", { className: "review-lens-metrics", children: t.map(([n, r]) => /* @__PURE__ */
|
|
1733
|
+
return /* @__PURE__ */ i("dl", { className: "review-lens-metrics", children: t.map(([n, r]) => /* @__PURE__ */ s("div", { children: [
|
|
1660
1734
|
/* @__PURE__ */ i("dt", { children: n }),
|
|
1661
1735
|
/* @__PURE__ */ i("dd", { children: r })
|
|
1662
1736
|
] }, n)) });
|
|
1663
1737
|
}
|
|
1664
|
-
function
|
|
1665
|
-
return /* @__PURE__ */
|
|
1738
|
+
function He({ title: e, items: t }) {
|
|
1739
|
+
return /* @__PURE__ */ s("section", { className: "review-lens-insights", children: [
|
|
1666
1740
|
/* @__PURE__ */ i("h3", { children: e }),
|
|
1667
1741
|
t.length === 0 ? /* @__PURE__ */ i("p", { children: "No issues detected." }) : null,
|
|
1668
1742
|
t.length > 0 ? /* @__PURE__ */ i("ul", { children: t.map((n) => /* @__PURE__ */ i("li", { children: n }, n)) }) : null
|
|
1669
1743
|
] });
|
|
1670
1744
|
}
|
|
1671
|
-
function
|
|
1745
|
+
function H(e) {
|
|
1672
1746
|
try {
|
|
1673
1747
|
return document.querySelector(e);
|
|
1674
1748
|
} catch {
|
|
1675
1749
|
return null;
|
|
1676
1750
|
}
|
|
1677
1751
|
}
|
|
1678
|
-
function
|
|
1679
|
-
const t =
|
|
1752
|
+
function et(e) {
|
|
1753
|
+
const t = H(e.selector);
|
|
1680
1754
|
if (!t)
|
|
1681
1755
|
return { label: "Target missing", level: "warning" };
|
|
1682
1756
|
const n = Q(t);
|
|
1683
1757
|
return n.fingerprint.tagName !== e.elementFingerprint.tagName ? { label: "Element changed", level: "warning" } : Math.abs(n.fingerprint.width - e.elementFingerprint.width) > 2 || Math.abs(n.fingerprint.height - e.elementFingerprint.height) > 2 ? { label: "Size changed", level: "warning" } : n.cssSnapshot.fontSize !== e.createdCssSnapshot.fontSize || n.cssSnapshot.color !== e.createdCssSnapshot.color || n.cssSnapshot.padding !== e.createdCssSnapshot.padding ? { label: "Style changed", level: "warning" } : { label: "Target unchanged", level: "ok" };
|
|
1684
1758
|
}
|
|
1685
|
-
function
|
|
1686
|
-
var
|
|
1687
|
-
const t =
|
|
1759
|
+
function un(e) {
|
|
1760
|
+
var g;
|
|
1761
|
+
const t = H(e.selector);
|
|
1688
1762
|
if (!t)
|
|
1689
1763
|
return ["Selected element is no longer available."];
|
|
1690
|
-
const n = [], r = t.tagName.toLowerCase(),
|
|
1691
|
-
c && !
|
|
1764
|
+
const n = [], r = t.tagName.toLowerCase(), o = t.getAttribute("role"), c = ["button", "a", "input", "select", "textarea"].includes(r) || o === "button" || o === "link", u = t.getAttribute("aria-label") || t.getAttribute("title") || ((g = t.textContent) == null ? void 0 : g.trim());
|
|
1765
|
+
c && !u && n.push("Interactive element has no accessible name."), c && (e.rect.width < 44 || e.rect.height < 44) && n.push("Tap target is smaller than 44 x 44."), r === "img" && !t.getAttribute("alt") && n.push("Image is missing alt text.");
|
|
1692
1766
|
const w = /^h[1-6]$/.test(r) ? Number(r.slice(1)) : 0;
|
|
1693
|
-
return w > 1 && !document.querySelector(`h${w - 1}`) && n.push("Heading may skip the previous level."),
|
|
1767
|
+
return w > 1 && !document.querySelector(`h${w - 1}`) && n.push("Heading may skip the previous level."), vn(e.cssSnapshot.color, e.cssSnapshot.backgroundColor) && n.push("Text contrast may be low."), n;
|
|
1694
1768
|
}
|
|
1695
|
-
function
|
|
1769
|
+
function mn(e, t = {}) {
|
|
1696
1770
|
const n = [];
|
|
1697
|
-
return
|
|
1771
|
+
return D("Padding", e.padding, t.spacing, n, { allowComposite: !0 }), D("Margin", e.margin, t.spacing, n, { allowComposite: !0 }), D("Font size", e.fontSize, t.fontSize, n), D("Line height", e.lineHeight, t.lineHeight, n), D("Text color", e.color, t.color, n), D("Background", e.backgroundColor, t.color, n), D("Radius", e.borderRadius, t.radius, n, { allowComposite: !0 }), n;
|
|
1698
1772
|
}
|
|
1699
|
-
function
|
|
1700
|
-
!n || n.length === 0 || !t ||
|
|
1773
|
+
function D(e, t, n, r, o = {}) {
|
|
1774
|
+
!n || n.length === 0 || !t || pn(t, n, o) || r.push(`${e} ${t} is outside configured tokens.`);
|
|
1701
1775
|
}
|
|
1702
|
-
function
|
|
1776
|
+
function pn(e, t, n = {}) {
|
|
1703
1777
|
if (t.includes(e))
|
|
1704
1778
|
return !0;
|
|
1705
1779
|
if (!n.allowComposite)
|
|
1706
1780
|
return !1;
|
|
1707
1781
|
const r = e.trim().split(/\s+/);
|
|
1708
|
-
return r.length > 1 && r.every((
|
|
1782
|
+
return r.length > 1 && r.every((o) => t.includes(o));
|
|
1709
1783
|
}
|
|
1710
|
-
function
|
|
1784
|
+
function gn(e) {
|
|
1711
1785
|
const t = e.id ? `#${e.id}` : "", n = e.className ? `.${e.className.split(/\s+/).filter(Boolean).slice(0, 2).join(".")}` : "", r = e.ariaLabel ? `[aria-label="${e.ariaLabel}"]` : "";
|
|
1712
1786
|
return `${e.tagName}${t}${n}${r}` || e.tagName;
|
|
1713
1787
|
}
|
|
1714
|
-
function
|
|
1715
|
-
const n = [], r = (Math.max(e.left, t.left) + Math.min(e.right, t.right)) / 2,
|
|
1788
|
+
function fn(e, t) {
|
|
1789
|
+
const n = [], r = (Math.max(e.left, t.left) + Math.min(e.right, t.right)) / 2, o = (Math.max(e.top, t.top) + Math.min(e.bottom, t.bottom)) / 2;
|
|
1716
1790
|
if (e.right <= t.left || t.right <= e.left) {
|
|
1717
|
-
const c = e.right <= t.left ? e.right : t.right,
|
|
1791
|
+
const c = e.right <= t.left ? e.right : t.right, u = e.right <= t.left ? t.left : e.left;
|
|
1718
1792
|
n.push({
|
|
1719
1793
|
key: "horizontal",
|
|
1720
1794
|
axis: "horizontal",
|
|
1721
|
-
top:
|
|
1795
|
+
top: Ke(o, 0, window.innerHeight),
|
|
1722
1796
|
left: c,
|
|
1723
|
-
width: Math.max(
|
|
1797
|
+
width: Math.max(u - c, 1),
|
|
1724
1798
|
height: 1,
|
|
1725
|
-
label: `${Math.round(
|
|
1799
|
+
label: `${Math.round(u - c)}px`
|
|
1726
1800
|
});
|
|
1727
1801
|
}
|
|
1728
1802
|
if (e.bottom <= t.top || t.bottom <= e.top) {
|
|
1729
|
-
const c = e.bottom <= t.top ? e.bottom : t.bottom,
|
|
1803
|
+
const c = e.bottom <= t.top ? e.bottom : t.bottom, u = e.bottom <= t.top ? t.top : e.top;
|
|
1730
1804
|
n.push({
|
|
1731
1805
|
key: "vertical",
|
|
1732
1806
|
axis: "vertical",
|
|
1733
1807
|
top: c,
|
|
1734
|
-
left:
|
|
1808
|
+
left: Ke(r, 0, window.innerWidth),
|
|
1735
1809
|
width: 1,
|
|
1736
|
-
height: Math.max(
|
|
1737
|
-
label: `${Math.round(
|
|
1810
|
+
height: Math.max(u - c, 1),
|
|
1811
|
+
label: `${Math.round(u - c)}px`
|
|
1738
1812
|
});
|
|
1739
1813
|
}
|
|
1740
1814
|
return n;
|
|
1741
1815
|
}
|
|
1742
|
-
function
|
|
1816
|
+
function Ke(e, t, n) {
|
|
1743
1817
|
return Math.min(Math.max(e, t), n);
|
|
1744
1818
|
}
|
|
1745
1819
|
function X(e, t) {
|
|
1746
1820
|
const n = /* @__PURE__ */ new Map();
|
|
1747
1821
|
for (const r of e) {
|
|
1748
|
-
const
|
|
1749
|
-
n.set(
|
|
1822
|
+
const o = t(r);
|
|
1823
|
+
n.set(o, (n.get(o) ?? 0) + 1);
|
|
1750
1824
|
}
|
|
1751
|
-
return Array.from(n.entries()).sort((r,
|
|
1825
|
+
return Array.from(n.entries()).sort((r, o) => o[1] - r[1] || r[0].localeCompare(o[0]));
|
|
1752
1826
|
}
|
|
1753
|
-
function
|
|
1827
|
+
function wn(e) {
|
|
1754
1828
|
return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement || e instanceof HTMLElement && e.isContentEditable;
|
|
1755
1829
|
}
|
|
1756
|
-
function
|
|
1757
|
-
const n =
|
|
1758
|
-
return !n || !r || r.alpha === 0 ? !1 :
|
|
1830
|
+
function vn(e, t) {
|
|
1831
|
+
const n = Je(e), r = Je(t);
|
|
1832
|
+
return !n || !r || r.alpha === 0 ? !1 : bn(n, r) < 4.5;
|
|
1759
1833
|
}
|
|
1760
|
-
function
|
|
1834
|
+
function Je(e) {
|
|
1761
1835
|
const t = e.match(/rgba?\(([^)]+)\)/);
|
|
1762
1836
|
if (!t)
|
|
1763
1837
|
return null;
|
|
1764
|
-
const [n, r,
|
|
1838
|
+
const [n, r, o, c = "1"] = t[1].split(",").map((u) => u.trim());
|
|
1765
1839
|
return {
|
|
1766
1840
|
red: Number(n),
|
|
1767
1841
|
green: Number(r),
|
|
1768
|
-
blue: Number(
|
|
1842
|
+
blue: Number(o),
|
|
1769
1843
|
alpha: Number(c)
|
|
1770
1844
|
};
|
|
1771
1845
|
}
|
|
1772
|
-
function
|
|
1846
|
+
function bn(e, t) {
|
|
1773
1847
|
const n = Math.max(ie(e), ie(t)), r = Math.min(ie(e), ie(t));
|
|
1774
1848
|
return (n + 0.05) / (r + 0.05);
|
|
1775
1849
|
}
|
|
@@ -1780,7 +1854,7 @@ function ie(e) {
|
|
|
1780
1854
|
});
|
|
1781
1855
|
return t[0] * 0.2126 + t[1] * 0.7152 + t[2] * 0.0722;
|
|
1782
1856
|
}
|
|
1783
|
-
function
|
|
1857
|
+
function yn(e) {
|
|
1784
1858
|
const t = {
|
|
1785
1859
|
top: I(e.cssSnapshot.marginTop),
|
|
1786
1860
|
right: I(e.cssSnapshot.marginRight),
|
|
@@ -1796,31 +1870,31 @@ function pn(e) {
|
|
|
1796
1870
|
right: I(e.cssSnapshot.paddingRight),
|
|
1797
1871
|
bottom: I(e.cssSnapshot.paddingBottom),
|
|
1798
1872
|
left: I(e.cssSnapshot.paddingLeft)
|
|
1799
|
-
},
|
|
1873
|
+
}, o = {
|
|
1800
1874
|
top: e.rect.top,
|
|
1801
1875
|
left: e.rect.left,
|
|
1802
1876
|
width: Math.max(e.rect.width, 0),
|
|
1803
1877
|
height: Math.max(e.rect.height, 0)
|
|
1804
1878
|
}, c = {
|
|
1805
|
-
top:
|
|
1806
|
-
left:
|
|
1807
|
-
width:
|
|
1808
|
-
height:
|
|
1809
|
-
},
|
|
1810
|
-
top:
|
|
1811
|
-
left:
|
|
1812
|
-
width: Math.max(
|
|
1813
|
-
height: Math.max(
|
|
1879
|
+
top: o.top - t.top,
|
|
1880
|
+
left: o.left - t.left,
|
|
1881
|
+
width: o.width + t.left + t.right,
|
|
1882
|
+
height: o.height + t.top + t.bottom
|
|
1883
|
+
}, u = {
|
|
1884
|
+
top: o.top + n.top,
|
|
1885
|
+
left: o.left + n.left,
|
|
1886
|
+
width: Math.max(o.width - n.left - n.right, 0),
|
|
1887
|
+
height: Math.max(o.height - n.top - n.bottom, 0)
|
|
1814
1888
|
}, w = {
|
|
1815
|
-
top:
|
|
1816
|
-
left:
|
|
1817
|
-
width: Math.max(
|
|
1818
|
-
height: Math.max(
|
|
1889
|
+
top: u.top + r.top,
|
|
1890
|
+
left: u.left + r.left,
|
|
1891
|
+
width: Math.max(u.width - r.left - r.right, 0),
|
|
1892
|
+
height: Math.max(u.height - r.top - r.bottom, 0)
|
|
1819
1893
|
};
|
|
1820
1894
|
return {
|
|
1821
1895
|
margin: c,
|
|
1822
|
-
border:
|
|
1823
|
-
padding:
|
|
1896
|
+
border: o,
|
|
1897
|
+
padding: u,
|
|
1824
1898
|
content: w
|
|
1825
1899
|
};
|
|
1826
1900
|
}
|
|
@@ -1829,11 +1903,11 @@ function I(e) {
|
|
|
1829
1903
|
return Number.isFinite(t) ? t : 0;
|
|
1830
1904
|
}
|
|
1831
1905
|
export {
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1906
|
+
Qt as ReviewLensLogo,
|
|
1907
|
+
Nn as ReviewLensOverlay,
|
|
1908
|
+
xn as ReviewLensProvider,
|
|
1835
1909
|
Q as buildElementTarget,
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1910
|
+
St as createGoogleSheetsAdapter,
|
|
1911
|
+
Ut as normalizeReviewUrl,
|
|
1912
|
+
Dt as useReviewLens
|
|
1839
1913
|
};
|