review-lens-react 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -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 D, 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
|
+
De(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
|
+
De(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: We(e.createdCssSnapshotJson),
|
|
268
|
+
fixedCssSnapshot: e.fixedCssSnapshotJson ? We(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 We(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 De(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 = D(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 = D(
|
|
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 = D(
|
|
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: Dt(y),
|
|
500
|
+
previousItem: N
|
|
436
501
|
}), F;
|
|
437
502
|
},
|
|
438
503
|
[n, e, c == null ? void 0 : c.email, b]
|
|
439
|
-
),
|
|
440
|
-
(
|
|
504
|
+
), h = D(
|
|
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 = D(
|
|
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
|
-
), l =
|
|
454
|
-
async (
|
|
455
|
-
const
|
|
456
|
-
if (!
|
|
518
|
+
), l = D(
|
|
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 Wt() {
|
|
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 Dt(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,
|
|
@@ -702,18 +767,18 @@ function Ot({ className: e, title: t = "Review Lens logo" }) {
|
|
|
702
767
|
}
|
|
703
768
|
);
|
|
704
769
|
}
|
|
705
|
-
const
|
|
770
|
+
const Zt = [
|
|
706
771
|
{ label: "Desktop", value: "desktop" },
|
|
707
772
|
{ label: "Tablet", value: "tablet" },
|
|
708
773
|
{ label: "Mobile", value: "mobile" }
|
|
709
|
-
],
|
|
774
|
+
], Xe = [
|
|
710
775
|
"open",
|
|
711
776
|
"in_progress",
|
|
712
777
|
"needs_clarification",
|
|
713
778
|
"fixed",
|
|
714
779
|
"wontfix",
|
|
715
780
|
"resolved"
|
|
716
|
-
],
|
|
781
|
+
], Qe = ["low", "medium", "high"], Ze = ["bug", "visual", "copy", "accessibility", "responsive"], se = {
|
|
717
782
|
open: "Open",
|
|
718
783
|
in_progress: "In progress",
|
|
719
784
|
needs_clarification: "Needs clarification",
|
|
@@ -731,156 +796,156 @@ const qt = [
|
|
|
731
796
|
accessibility: "Accessibility",
|
|
732
797
|
responsive: "Responsive"
|
|
733
798
|
};
|
|
734
|
-
function
|
|
799
|
+
function Nn({
|
|
735
800
|
open: e,
|
|
736
801
|
onOpenChange: t,
|
|
737
802
|
placement: n = "top-right",
|
|
738
803
|
showResolved: r = !1,
|
|
739
|
-
syncSelectionToUrl:
|
|
740
|
-
responsivePresets: c =
|
|
804
|
+
syncSelectionToUrl: o = !1,
|
|
805
|
+
responsivePresets: c = Zt
|
|
741
806
|
}) {
|
|
742
|
-
var
|
|
807
|
+
var Me;
|
|
743
808
|
const {
|
|
744
|
-
adapter:
|
|
809
|
+
adapter: u,
|
|
745
810
|
config: w,
|
|
746
|
-
currentUser:
|
|
811
|
+
currentUser: g,
|
|
747
812
|
feedback: b,
|
|
748
|
-
normalizedPath:
|
|
749
|
-
permissions:
|
|
750
|
-
createFeedback:
|
|
751
|
-
updateFeedback:
|
|
752
|
-
listMessages:
|
|
753
|
-
createMessage:
|
|
813
|
+
normalizedPath: A,
|
|
814
|
+
permissions: L,
|
|
815
|
+
createFeedback: p,
|
|
816
|
+
updateFeedback: v,
|
|
817
|
+
listMessages: h,
|
|
818
|
+
createMessage: k,
|
|
754
819
|
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) =>
|
|
820
|
+
} = Wt(), [C, f] = x(), [y, N] = x(), [F, M] = x(""), [j, tt] = x("medium"), [we, nt] = x("visual"), [ve, be] = x(""), [ye, it] = x(
|
|
821
|
+
((Me = c[0]) == null ? void 0 : Me.value) ?? "desktop"
|
|
822
|
+
), [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(
|
|
823
|
+
o ? new URL(window.location.href).searchParams.get("reviewLensFeedback") : null
|
|
824
|
+
), $ = !!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(() => {
|
|
825
|
+
const a = b.map((m) => m.assigneeEmail).filter((m) => !!m);
|
|
826
|
+
return g != null && g.email && a.push(g.email), Array.from(new Set(a)).sort((m, d) => m.localeCompare(d));
|
|
827
|
+
}, [g == null ? void 0 : g.email, b]), R = oe(
|
|
828
|
+
() => 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
829
|
[
|
|
765
|
-
V,
|
|
766
830
|
q,
|
|
831
|
+
G,
|
|
767
832
|
b,
|
|
768
833
|
O,
|
|
769
834
|
r,
|
|
770
835
|
J,
|
|
771
|
-
|
|
836
|
+
V
|
|
772
837
|
]
|
|
773
|
-
),
|
|
838
|
+
), ut = [
|
|
774
839
|
J,
|
|
775
840
|
O,
|
|
841
|
+
G,
|
|
776
842
|
q,
|
|
777
|
-
V
|
|
778
|
-
G
|
|
843
|
+
V
|
|
779
844
|
].filter((a) => a !== "all").length;
|
|
780
|
-
|
|
845
|
+
P(() => {
|
|
781
846
|
if (e) {
|
|
782
|
-
|
|
847
|
+
Ae.current = !0;
|
|
783
848
|
return;
|
|
784
849
|
}
|
|
785
|
-
if (
|
|
850
|
+
if (f(void 0), N(void 0), M(""), ce(""), _("review"), o && Ae.current) {
|
|
786
851
|
const a = new URL(window.location.href);
|
|
787
852
|
a.searchParams.has("reviewLensFeedback") && (a.searchParams.delete("reviewLensFeedback"), window.history.replaceState({}, "", a));
|
|
788
853
|
}
|
|
789
|
-
}, [e,
|
|
790
|
-
$ || (
|
|
791
|
-
}, [$]),
|
|
792
|
-
!y ||
|
|
793
|
-
var a,
|
|
794
|
-
(
|
|
854
|
+
}, [e, o]), P(() => {
|
|
855
|
+
$ || (f(void 0), N(void 0));
|
|
856
|
+
}, [$]), P(() => {
|
|
857
|
+
!y || T !== "review" || window.requestAnimationFrame(() => {
|
|
858
|
+
var a, m, d;
|
|
859
|
+
(m = (a = te.current) == null ? void 0 : a.scrollIntoView) == null || m.call(a, { block: "nearest" }), (d = te.current) == null || d.focus();
|
|
795
860
|
});
|
|
796
|
-
}, [y,
|
|
797
|
-
if (!
|
|
861
|
+
}, [y, T]), P(() => {
|
|
862
|
+
if (!S)
|
|
798
863
|
return;
|
|
799
864
|
let a = !0;
|
|
800
|
-
return
|
|
801
|
-
a && Le((d) => ({ ...d, [
|
|
865
|
+
return h(S.id).then((m) => {
|
|
866
|
+
a && Le((d) => ({ ...d, [S.id]: m }));
|
|
802
867
|
}), () => {
|
|
803
868
|
a = !1;
|
|
804
869
|
};
|
|
805
|
-
}, [
|
|
806
|
-
if (!
|
|
870
|
+
}, [h, S]), P(() => {
|
|
871
|
+
if (!o || !de.current || b.length === 0)
|
|
807
872
|
return;
|
|
808
|
-
const a = b.find((
|
|
809
|
-
a && (
|
|
810
|
-
}, [b,
|
|
811
|
-
if (!e || !
|
|
873
|
+
const a = b.find((m) => m.id === de.current);
|
|
874
|
+
a && (de.current = null, t == null || t(!0), z(a, { syncUrl: !1 }));
|
|
875
|
+
}, [b, o]), P(() => {
|
|
876
|
+
if (!e || !o || S || b.length === 0)
|
|
812
877
|
return;
|
|
813
|
-
const a = new URL(window.location.href).searchParams.get("reviewLensFeedback"),
|
|
814
|
-
|
|
815
|
-
}, [b, e,
|
|
878
|
+
const a = new URL(window.location.href).searchParams.get("reviewLensFeedback"), m = b.find((d) => d.id === a);
|
|
879
|
+
m && z(m, { syncUrl: !1 });
|
|
880
|
+
}, [b, e, S, o]), P(() => {
|
|
816
881
|
if (!e)
|
|
817
882
|
return;
|
|
818
883
|
function a(d) {
|
|
819
|
-
var
|
|
820
|
-
if (d.key === "Shift" &&
|
|
884
|
+
var E;
|
|
885
|
+
if (d.key === "Shift" && ke(!0), d.key === "Escape") {
|
|
821
886
|
d.preventDefault(), t == null || t(!1);
|
|
822
887
|
return;
|
|
823
888
|
}
|
|
824
|
-
|
|
889
|
+
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
890
|
}
|
|
826
|
-
function
|
|
827
|
-
d.key === "Shift" &&
|
|
891
|
+
function m(d) {
|
|
892
|
+
d.key === "Shift" && ke(!1);
|
|
828
893
|
}
|
|
829
|
-
return window.addEventListener("keydown", a), window.addEventListener("keyup",
|
|
830
|
-
window.removeEventListener("keydown", a), window.removeEventListener("keyup",
|
|
894
|
+
return window.addEventListener("keydown", a), window.addEventListener("keyup", m), () => {
|
|
895
|
+
window.removeEventListener("keydown", a), window.removeEventListener("keyup", m);
|
|
831
896
|
};
|
|
832
897
|
});
|
|
833
|
-
const he =
|
|
834
|
-
const
|
|
835
|
-
if (
|
|
836
|
-
return
|
|
898
|
+
const he = D((a) => {
|
|
899
|
+
const m = a.target instanceof Element ? a.target : null;
|
|
900
|
+
if (m)
|
|
901
|
+
return m.closest("[data-review-lens-ui]") ? null : m;
|
|
837
902
|
const d = document.elementFromPoint(a.clientX, a.clientY);
|
|
838
903
|
return !d || d.closest("[data-review-lens-ui]") ? null : d;
|
|
839
904
|
}, []);
|
|
840
|
-
if (
|
|
905
|
+
if (P(() => {
|
|
841
906
|
if (!e || !$)
|
|
842
907
|
return;
|
|
843
908
|
function a(d) {
|
|
844
|
-
const
|
|
845
|
-
|
|
909
|
+
const E = he(d);
|
|
910
|
+
f(E ? Q(E) : void 0);
|
|
846
911
|
}
|
|
847
|
-
function
|
|
848
|
-
const
|
|
849
|
-
|
|
912
|
+
function m(d) {
|
|
913
|
+
const E = he(d);
|
|
914
|
+
E && (d.preventDefault(), d.stopPropagation(), N(Q(E)), _("review"));
|
|
850
915
|
}
|
|
851
|
-
return window.addEventListener("mousemove", a, !0), window.addEventListener("click",
|
|
852
|
-
window.removeEventListener("mousemove", a, !0), window.removeEventListener("click",
|
|
916
|
+
return window.addEventListener("mousemove", a, !0), window.addEventListener("click", m, !0), () => {
|
|
917
|
+
window.removeEventListener("mousemove", a, !0), window.removeEventListener("click", m, !0);
|
|
853
918
|
};
|
|
854
919
|
}, [$, he, e]), !e)
|
|
855
920
|
return null;
|
|
856
|
-
function
|
|
857
|
-
var
|
|
858
|
-
if (K(a),
|
|
921
|
+
function z(a, m = { syncUrl: !0 }) {
|
|
922
|
+
var E;
|
|
923
|
+
if (K(a), N(void 0), _("feedback"), o && m.syncUrl !== !1) {
|
|
859
924
|
const ne = new URL(window.location.href);
|
|
860
925
|
ne.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", ne);
|
|
861
926
|
}
|
|
862
|
-
const d =
|
|
927
|
+
const d = H(a.selector);
|
|
863
928
|
if (!d) {
|
|
864
|
-
|
|
929
|
+
f(void 0);
|
|
865
930
|
return;
|
|
866
931
|
}
|
|
867
|
-
(
|
|
868
|
-
|
|
932
|
+
(E = d.scrollIntoView) == null || E.call(d, { behavior: "smooth", block: "center", inline: "center" }), window.requestAnimationFrame(() => {
|
|
933
|
+
f(Q(d));
|
|
869
934
|
});
|
|
870
935
|
}
|
|
871
936
|
function Ie(a) {
|
|
872
937
|
if (R.length === 0)
|
|
873
938
|
return;
|
|
874
|
-
const
|
|
875
|
-
|
|
939
|
+
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;
|
|
940
|
+
z(R[d]);
|
|
876
941
|
}
|
|
877
|
-
async function
|
|
878
|
-
if (!y || !F.trim() || !
|
|
942
|
+
async function Te() {
|
|
943
|
+
if (!y || !F.trim() || !g || !B)
|
|
879
944
|
return;
|
|
880
|
-
let a = await
|
|
945
|
+
let a = await p({
|
|
881
946
|
projectKey: w.projectKey,
|
|
882
947
|
contentId: w.contentId,
|
|
883
|
-
normalizedPath:
|
|
948
|
+
normalizedPath: A,
|
|
884
949
|
originalUrl: w.currentUrl ?? window.location.href,
|
|
885
950
|
selector: y.selector,
|
|
886
951
|
selectorStrategy: y.selectorStrategy,
|
|
@@ -888,115 +953,115 @@ function bn({
|
|
|
888
953
|
createdCssSnapshot: y.cssSnapshot,
|
|
889
954
|
comment: F.trim(),
|
|
890
955
|
status: "open",
|
|
891
|
-
severity:
|
|
956
|
+
severity: j,
|
|
892
957
|
category: we,
|
|
893
|
-
assigneeEmail:
|
|
958
|
+
assigneeEmail: ve.trim() || void 0,
|
|
894
959
|
viewportWidth: window.innerWidth,
|
|
895
960
|
viewportHeight: window.innerHeight,
|
|
896
961
|
viewportPreset: ye,
|
|
897
962
|
screenshotUrl: void 0,
|
|
898
963
|
screenshotThumbnailUrl: void 0,
|
|
899
|
-
authorEmail:
|
|
964
|
+
authorEmail: g.email
|
|
900
965
|
});
|
|
901
966
|
if (w.captureScreenshot)
|
|
902
967
|
try {
|
|
903
|
-
const
|
|
968
|
+
const m = await w.captureScreenshot(y), d = await l(a.id, {
|
|
904
969
|
type: "screenshot",
|
|
905
|
-
data:
|
|
906
|
-
createdBy:
|
|
970
|
+
data: m,
|
|
971
|
+
createdBy: g.email
|
|
907
972
|
});
|
|
908
|
-
a = await
|
|
973
|
+
a = await v(a.id, {
|
|
909
974
|
attachments: [d],
|
|
910
975
|
screenshotUrl: d.url,
|
|
911
976
|
screenshotThumbnailUrl: d.thumbnailUrl
|
|
912
977
|
});
|
|
913
978
|
} catch {
|
|
914
979
|
}
|
|
915
|
-
if (
|
|
916
|
-
const
|
|
917
|
-
|
|
980
|
+
if (M(""), be(""), N(void 0), f(void 0), _("feedback"), K(a), o) {
|
|
981
|
+
const m = new URL(window.location.href);
|
|
982
|
+
m.searchParams.set("reviewLensFeedback", a.id), window.history.replaceState({}, "", m);
|
|
918
983
|
}
|
|
919
984
|
}
|
|
920
|
-
async function
|
|
921
|
-
const d = (/* @__PURE__ */ new Date()).toISOString(),
|
|
985
|
+
async function mt(a, m) {
|
|
986
|
+
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
987
|
K(ne);
|
|
923
988
|
}
|
|
924
989
|
async function $e(a) {
|
|
925
|
-
const
|
|
926
|
-
if (!
|
|
990
|
+
const m = H(a.selector);
|
|
991
|
+
if (!m || !g)
|
|
927
992
|
return;
|
|
928
|
-
const d = Q(
|
|
993
|
+
const d = Q(m), E = await v(a.id, {
|
|
929
994
|
status: "fixed",
|
|
930
995
|
fixedCssSnapshot: d.cssSnapshot,
|
|
931
996
|
fixedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
932
|
-
fixedBy:
|
|
997
|
+
fixedBy: g.email
|
|
933
998
|
});
|
|
934
|
-
K(
|
|
999
|
+
K(E);
|
|
935
1000
|
}
|
|
936
|
-
async function
|
|
937
|
-
if (!le.trim() || !
|
|
1001
|
+
async function pt(a) {
|
|
1002
|
+
if (!le.trim() || !g || !Fe)
|
|
938
1003
|
return;
|
|
939
|
-
const
|
|
1004
|
+
const m = await k({
|
|
940
1005
|
feedbackId: a.id,
|
|
941
1006
|
body: le.trim(),
|
|
942
|
-
authorEmail:
|
|
1007
|
+
authorEmail: g.email
|
|
943
1008
|
});
|
|
944
1009
|
Le((d) => ({
|
|
945
1010
|
...d,
|
|
946
|
-
[a.id]: [...d[a.id] ?? [],
|
|
947
|
-
})),
|
|
1011
|
+
[a.id]: [...d[a.id] ?? [], m]
|
|
1012
|
+
})), ce("");
|
|
948
1013
|
}
|
|
949
|
-
return /* @__PURE__ */
|
|
950
|
-
$ &&
|
|
951
|
-
$ && y &&
|
|
952
|
-
$ ? /* @__PURE__ */
|
|
1014
|
+
return /* @__PURE__ */ s("div", { className: "review-lens-root", "data-review-lens-ui": !0, children: [
|
|
1015
|
+
$ && U ? /* @__PURE__ */ i(on, { target: U, locked: !!y }) : null,
|
|
1016
|
+
$ && y && C && rt ? /* @__PURE__ */ i(sn, { from: y, to: C }) : null,
|
|
1017
|
+
$ ? /* @__PURE__ */ s(ae, { children: [
|
|
953
1018
|
/* @__PURE__ */ i(
|
|
954
|
-
|
|
1019
|
+
ln,
|
|
955
1020
|
{
|
|
956
1021
|
feedback: R,
|
|
957
|
-
selectedFeedback:
|
|
958
|
-
onSelect:
|
|
1022
|
+
selectedFeedback: S,
|
|
1023
|
+
onSelect: z
|
|
959
1024
|
}
|
|
960
1025
|
),
|
|
961
1026
|
/* @__PURE__ */ i(
|
|
962
|
-
|
|
1027
|
+
dn,
|
|
963
1028
|
{
|
|
964
1029
|
feedback: R,
|
|
965
|
-
selectedFeedback:
|
|
966
|
-
onSelect:
|
|
1030
|
+
selectedFeedback: S,
|
|
1031
|
+
onSelect: z
|
|
967
1032
|
}
|
|
968
1033
|
)
|
|
969
1034
|
] }) : null,
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
/* @__PURE__ */
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
/* @__PURE__ */ i(
|
|
974
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ s("aside", { className: `review-lens-panel review-lens-panel--${n}`, "data-review-lens-ui": !0, children: [
|
|
1036
|
+
/* @__PURE__ */ s("header", { className: "review-lens-panel__header", children: [
|
|
1037
|
+
/* @__PURE__ */ s("div", { className: "review-lens-brand", children: [
|
|
1038
|
+
/* @__PURE__ */ i(Qt, { className: "review-lens-brand__mark" }),
|
|
1039
|
+
/* @__PURE__ */ s("div", { children: [
|
|
975
1040
|
/* @__PURE__ */ i("p", { className: "review-lens-kicker", children: "Review Lens" }),
|
|
976
|
-
/* @__PURE__ */ i("h2", { children:
|
|
1041
|
+
/* @__PURE__ */ i("h2", { children: T === "summary" ? "Summary" : T === "feedback" ? "Feedback" : y ? "Element locked" : "Inspecting" })
|
|
977
1042
|
] })
|
|
978
1043
|
] }),
|
|
979
1044
|
/* @__PURE__ */ i("button", { type: "button", onClick: () => t == null ? void 0 : t(!1), children: "Close" })
|
|
980
1045
|
] }),
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
/* @__PURE__ */
|
|
1046
|
+
/* @__PURE__ */ s("div", { className: "review-lens-panel__body", children: [
|
|
1047
|
+
/* @__PURE__ */ s("div", { className: "review-lens-mode-switch", role: "tablist", "aria-label": "Review Lens mode", children: [
|
|
983
1048
|
/* @__PURE__ */ i(
|
|
984
1049
|
"button",
|
|
985
1050
|
{
|
|
986
1051
|
type: "button",
|
|
987
1052
|
role: "tab",
|
|
988
|
-
"aria-selected":
|
|
989
|
-
onClick: () =>
|
|
1053
|
+
"aria-selected": T === "review",
|
|
1054
|
+
onClick: () => _("review"),
|
|
990
1055
|
children: "Review"
|
|
991
1056
|
}
|
|
992
1057
|
),
|
|
993
|
-
/* @__PURE__ */
|
|
1058
|
+
/* @__PURE__ */ s(
|
|
994
1059
|
"button",
|
|
995
1060
|
{
|
|
996
1061
|
type: "button",
|
|
997
1062
|
role: "tab",
|
|
998
|
-
"aria-selected":
|
|
999
|
-
onClick: () =>
|
|
1063
|
+
"aria-selected": T === "feedback",
|
|
1064
|
+
onClick: () => _("feedback"),
|
|
1000
1065
|
children: [
|
|
1001
1066
|
"Feedback ",
|
|
1002
1067
|
/* @__PURE__ */ i("span", { children: R.length })
|
|
@@ -1008,34 +1073,34 @@ function bn({
|
|
|
1008
1073
|
{
|
|
1009
1074
|
type: "button",
|
|
1010
1075
|
role: "tab",
|
|
1011
|
-
"aria-selected":
|
|
1012
|
-
onClick: () =>
|
|
1076
|
+
"aria-selected": T === "summary",
|
|
1077
|
+
onClick: () => _("summary"),
|
|
1013
1078
|
children: "Summary"
|
|
1014
1079
|
}
|
|
1015
1080
|
)
|
|
1016
1081
|
] }),
|
|
1017
|
-
|
|
1018
|
-
/* @__PURE__ */
|
|
1082
|
+
T === "review" ? /* @__PURE__ */ s("div", { className: "review-lens-review-pane", role: "tabpanel", children: [
|
|
1083
|
+
/* @__PURE__ */ s("div", { className: "review-lens-inspection", children: [
|
|
1019
1084
|
$ ? null : /* @__PURE__ */ i("p", { children: "Authenticate with Google to inspect this page." }),
|
|
1020
|
-
$ &&
|
|
1021
|
-
/* @__PURE__ */ i(
|
|
1022
|
-
/* @__PURE__ */ i(
|
|
1085
|
+
$ && U ? /* @__PURE__ */ s(ae, { children: [
|
|
1086
|
+
/* @__PURE__ */ i(hn, { target: U }),
|
|
1087
|
+
/* @__PURE__ */ i(He, { title: "Accessibility", items: un(U) }),
|
|
1023
1088
|
/* @__PURE__ */ i(
|
|
1024
|
-
|
|
1089
|
+
He,
|
|
1025
1090
|
{
|
|
1026
1091
|
title: "Design tokens",
|
|
1027
|
-
items:
|
|
1092
|
+
items: mn(U.cssSnapshot, w.designTokens)
|
|
1028
1093
|
}
|
|
1029
1094
|
)
|
|
1030
1095
|
] }) : null,
|
|
1031
|
-
$ && !
|
|
1096
|
+
$ && !U ? /* @__PURE__ */ i("p", { children: "Move over the app to inspect." }) : null
|
|
1032
1097
|
] }),
|
|
1033
|
-
|
|
1098
|
+
ct ? /* @__PURE__ */ i("div", { className: "review-lens-composer-panel", children: /* @__PURE__ */ s(
|
|
1034
1099
|
"form",
|
|
1035
1100
|
{
|
|
1036
1101
|
className: "review-lens-feedback-form",
|
|
1037
1102
|
onSubmit: (a) => {
|
|
1038
|
-
a.preventDefault(),
|
|
1103
|
+
a.preventDefault(), Te();
|
|
1039
1104
|
},
|
|
1040
1105
|
children: [
|
|
1041
1106
|
/* @__PURE__ */ i("label", { htmlFor: "review-lens-comment", children: "New feedback" }),
|
|
@@ -1045,181 +1110,181 @@ function bn({
|
|
|
1045
1110
|
ref: te,
|
|
1046
1111
|
id: "review-lens-comment",
|
|
1047
1112
|
value: F,
|
|
1048
|
-
disabled: !
|
|
1049
|
-
onChange: (a) =>
|
|
1113
|
+
disabled: !B,
|
|
1114
|
+
onChange: (a) => M(a.target.value),
|
|
1050
1115
|
onKeyDown: (a) => {
|
|
1051
|
-
a.key === "Enter" && a.metaKey && (a.preventDefault(),
|
|
1116
|
+
a.key === "Enter" && a.metaKey && (a.preventDefault(), Te());
|
|
1052
1117
|
},
|
|
1053
|
-
placeholder:
|
|
1118
|
+
placeholder: B ? "Describe the UX issue..." : "You do not have permission to comment."
|
|
1054
1119
|
}
|
|
1055
1120
|
),
|
|
1056
|
-
/* @__PURE__ */
|
|
1057
|
-
/* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ s("div", { className: "review-lens-form-grid", children: [
|
|
1122
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1058
1123
|
"Severity",
|
|
1059
1124
|
/* @__PURE__ */ i(
|
|
1060
1125
|
"select",
|
|
1061
1126
|
{
|
|
1062
|
-
value:
|
|
1063
|
-
onChange: (a) =>
|
|
1064
|
-
disabled: !
|
|
1065
|
-
children:
|
|
1127
|
+
value: j,
|
|
1128
|
+
onChange: (a) => tt(a.target.value),
|
|
1129
|
+
disabled: !B,
|
|
1130
|
+
children: Qe.map((a) => /* @__PURE__ */ i("option", { value: a, children: Z[a] }, a))
|
|
1066
1131
|
}
|
|
1067
1132
|
)
|
|
1068
1133
|
] }),
|
|
1069
|
-
/* @__PURE__ */
|
|
1134
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1070
1135
|
"Type",
|
|
1071
1136
|
/* @__PURE__ */ i(
|
|
1072
1137
|
"select",
|
|
1073
1138
|
{
|
|
1074
1139
|
value: we,
|
|
1075
|
-
onChange: (a) =>
|
|
1076
|
-
disabled: !
|
|
1077
|
-
children:
|
|
1140
|
+
onChange: (a) => nt(a.target.value),
|
|
1141
|
+
disabled: !B,
|
|
1142
|
+
children: Ze.map((a) => /* @__PURE__ */ i("option", { value: a, children: ee[a] }, a))
|
|
1078
1143
|
}
|
|
1079
1144
|
)
|
|
1080
1145
|
] }),
|
|
1081
|
-
/* @__PURE__ */
|
|
1146
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1082
1147
|
"Assignee",
|
|
1083
1148
|
/* @__PURE__ */ i(
|
|
1084
1149
|
"input",
|
|
1085
1150
|
{
|
|
1086
|
-
value:
|
|
1087
|
-
onChange: (a) =>
|
|
1088
|
-
disabled: !
|
|
1151
|
+
value: ve,
|
|
1152
|
+
onChange: (a) => be(a.target.value),
|
|
1153
|
+
disabled: !B,
|
|
1089
1154
|
placeholder: "optional@email.com"
|
|
1090
1155
|
}
|
|
1091
1156
|
)
|
|
1092
1157
|
] }),
|
|
1093
|
-
/* @__PURE__ */
|
|
1158
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1094
1159
|
"Viewport",
|
|
1095
1160
|
/* @__PURE__ */ i(
|
|
1096
1161
|
"select",
|
|
1097
1162
|
{
|
|
1098
1163
|
value: ye,
|
|
1099
|
-
onChange: (a) =>
|
|
1100
|
-
disabled: !
|
|
1164
|
+
onChange: (a) => it(a.target.value),
|
|
1165
|
+
disabled: !B,
|
|
1101
1166
|
children: c.map((a) => /* @__PURE__ */ i("option", { value: a.value, children: a.label }, a.value))
|
|
1102
1167
|
}
|
|
1103
1168
|
)
|
|
1104
1169
|
] })
|
|
1105
1170
|
] }),
|
|
1106
|
-
|
|
1171
|
+
B ? /* @__PURE__ */ s("p", { className: "review-lens-feedback-form__hint", children: [
|
|
1107
1172
|
"Press ",
|
|
1108
1173
|
/* @__PURE__ */ i("kbd", { children: "Command" }),
|
|
1109
1174
|
" + ",
|
|
1110
1175
|
/* @__PURE__ */ i("kbd", { children: "Enter" }),
|
|
1111
1176
|
" to submit.",
|
|
1112
|
-
|
|
1177
|
+
dt ? " Screenshot capture runs after save." : ""
|
|
1113
1178
|
] }) : null,
|
|
1114
|
-
/* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "submit", disabled: !F.trim() || !
|
|
1179
|
+
/* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "submit", disabled: !F.trim() || !B, children: "Save feedback" }) })
|
|
1115
1180
|
]
|
|
1116
1181
|
}
|
|
1117
1182
|
) }) : null
|
|
1118
1183
|
] }) : null,
|
|
1119
|
-
|
|
1184
|
+
T === "feedback" ? /* @__PURE__ */ s("div", { className: "review-lens-comments", children: [
|
|
1120
1185
|
/* @__PURE__ */ i(
|
|
1121
|
-
|
|
1186
|
+
en,
|
|
1122
1187
|
{
|
|
1123
|
-
open:
|
|
1124
|
-
activeCount:
|
|
1188
|
+
open: at,
|
|
1189
|
+
activeCount: ut,
|
|
1125
1190
|
statusFilter: J,
|
|
1126
1191
|
severityFilter: O,
|
|
1127
|
-
categoryFilter:
|
|
1128
|
-
assigneeFilter:
|
|
1129
|
-
viewportFilter:
|
|
1130
|
-
assignees:
|
|
1192
|
+
categoryFilter: G,
|
|
1193
|
+
assigneeFilter: q,
|
|
1194
|
+
viewportFilter: V,
|
|
1195
|
+
assignees: ht,
|
|
1131
1196
|
responsivePresets: c,
|
|
1132
|
-
onStatusChange:
|
|
1133
|
-
onSeverityChange:
|
|
1134
|
-
onCategoryChange:
|
|
1135
|
-
onAssigneeChange:
|
|
1197
|
+
onStatusChange: Se,
|
|
1198
|
+
onSeverityChange: xe,
|
|
1199
|
+
onCategoryChange: Ne,
|
|
1200
|
+
onAssigneeChange: Ce,
|
|
1136
1201
|
onViewportChange: Ee,
|
|
1137
|
-
onToggle: () =>
|
|
1202
|
+
onToggle: () => ot((a) => !a),
|
|
1138
1203
|
onClear: () => {
|
|
1139
|
-
|
|
1204
|
+
Se("all"), xe("all"), Ne("all"), Ce("all"), Ee("all");
|
|
1140
1205
|
}
|
|
1141
1206
|
}
|
|
1142
1207
|
),
|
|
1143
|
-
/* @__PURE__ */
|
|
1144
|
-
/* @__PURE__ */
|
|
1208
|
+
/* @__PURE__ */ s("div", { className: "review-lens-list-panel", children: [
|
|
1209
|
+
/* @__PURE__ */ s("div", { className: "review-lens-comments__header", children: [
|
|
1145
1210
|
/* @__PURE__ */ i("h3", { children: "All feedback" }),
|
|
1146
1211
|
/* @__PURE__ */ i("span", { children: R.length })
|
|
1147
1212
|
] }),
|
|
1148
|
-
/* @__PURE__ */
|
|
1213
|
+
/* @__PURE__ */ s("div", { className: "review-lens-comments__list", children: [
|
|
1149
1214
|
R.length === 0 ? /* @__PURE__ */ i("p", { children: "No feedback for this view." }) : null,
|
|
1150
1215
|
R.map((a) => /* @__PURE__ */ i(
|
|
1151
|
-
|
|
1216
|
+
tn,
|
|
1152
1217
|
{
|
|
1153
1218
|
item: a,
|
|
1154
|
-
selected: (
|
|
1155
|
-
onSelect:
|
|
1219
|
+
selected: (S == null ? void 0 : S.id) === a.id,
|
|
1220
|
+
onSelect: z
|
|
1156
1221
|
},
|
|
1157
1222
|
a.id
|
|
1158
1223
|
))
|
|
1159
1224
|
] })
|
|
1160
1225
|
] }),
|
|
1161
|
-
|
|
1226
|
+
S ? /* @__PURE__ */ s("div", { className: "review-lens-selected-panel", children: [
|
|
1162
1227
|
/* @__PURE__ */ i("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
|
|
1163
1228
|
/* @__PURE__ */ i(
|
|
1164
|
-
|
|
1229
|
+
nn,
|
|
1165
1230
|
{
|
|
1166
|
-
item:
|
|
1167
|
-
messages:
|
|
1231
|
+
item: S,
|
|
1232
|
+
messages: st[S.id] ?? [],
|
|
1168
1233
|
messageDraft: le,
|
|
1169
|
-
canReply:
|
|
1234
|
+
canReply: Fe,
|
|
1170
1235
|
canUpdate: Re,
|
|
1171
|
-
canAssign:
|
|
1172
|
-
syncSelectionToUrl:
|
|
1173
|
-
onMessageDraftChange:
|
|
1174
|
-
onSubmitMessage: () => void
|
|
1175
|
-
onStatusChange: (a) => void
|
|
1176
|
-
onAssigneeChange: (a) => void S
|
|
1236
|
+
canAssign: lt,
|
|
1237
|
+
syncSelectionToUrl: o,
|
|
1238
|
+
onMessageDraftChange: ce,
|
|
1239
|
+
onSubmitMessage: () => void pt(S),
|
|
1240
|
+
onStatusChange: (a) => void mt(S, a),
|
|
1241
|
+
onAssigneeChange: (a) => void v(S.id, {
|
|
1177
1242
|
assigneeEmail: a.trim() || void 0
|
|
1178
1243
|
}).then(K),
|
|
1179
|
-
onMarkFixed: () => void $e(
|
|
1244
|
+
onMarkFixed: () => void $e(S)
|
|
1180
1245
|
},
|
|
1181
|
-
|
|
1246
|
+
S.id
|
|
1182
1247
|
)
|
|
1183
|
-
] }) : /* @__PURE__ */
|
|
1248
|
+
] }) : /* @__PURE__ */ s("div", { className: "review-lens-selected-panel review-lens-selected-panel--empty", children: [
|
|
1184
1249
|
/* @__PURE__ */ i("div", { className: "review-lens-selected-panel__label", children: "Selected feedback" }),
|
|
1185
1250
|
/* @__PURE__ */ i("p", { children: "Select a feedback item above to review status, assignment, drift, and replies." })
|
|
1186
1251
|
] })
|
|
1187
1252
|
] }) : null,
|
|
1188
|
-
|
|
1253
|
+
T === "summary" ? /* @__PURE__ */ i(an, { feedback: b }) : null
|
|
1189
1254
|
] })
|
|
1190
1255
|
] })
|
|
1191
1256
|
] });
|
|
1192
1257
|
}
|
|
1193
|
-
function
|
|
1258
|
+
function en({
|
|
1194
1259
|
open: e,
|
|
1195
1260
|
activeCount: t,
|
|
1196
1261
|
statusFilter: n,
|
|
1197
1262
|
severityFilter: r,
|
|
1198
|
-
categoryFilter:
|
|
1263
|
+
categoryFilter: o,
|
|
1199
1264
|
assigneeFilter: c,
|
|
1200
|
-
viewportFilter:
|
|
1265
|
+
viewportFilter: u,
|
|
1201
1266
|
assignees: w,
|
|
1202
|
-
responsivePresets:
|
|
1267
|
+
responsivePresets: g,
|
|
1203
1268
|
onStatusChange: b,
|
|
1204
|
-
onSeverityChange:
|
|
1205
|
-
onCategoryChange:
|
|
1206
|
-
onAssigneeChange:
|
|
1207
|
-
onViewportChange:
|
|
1208
|
-
onToggle:
|
|
1209
|
-
onClear:
|
|
1269
|
+
onSeverityChange: A,
|
|
1270
|
+
onCategoryChange: L,
|
|
1271
|
+
onAssigneeChange: p,
|
|
1272
|
+
onViewportChange: v,
|
|
1273
|
+
onToggle: h,
|
|
1274
|
+
onClear: k
|
|
1210
1275
|
}) {
|
|
1211
|
-
return /* @__PURE__ */
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
/* @__PURE__ */
|
|
1276
|
+
return /* @__PURE__ */ s("div", { className: "review-lens-filter-shell", children: [
|
|
1277
|
+
/* @__PURE__ */ s("div", { className: "review-lens-filter-bar", children: [
|
|
1278
|
+
/* @__PURE__ */ s("button", { type: "button", "aria-expanded": e, onClick: h, children: [
|
|
1214
1279
|
"Filters",
|
|
1215
1280
|
t > 0 ? /* @__PURE__ */ i("span", { children: t }) : null
|
|
1216
1281
|
] }),
|
|
1217
|
-
t > 0 ? /* @__PURE__ */ i("button", { type: "button", onClick:
|
|
1282
|
+
t > 0 ? /* @__PURE__ */ i("button", { type: "button", onClick: k, children: "Clear" }) : null
|
|
1218
1283
|
] }),
|
|
1219
|
-
e ? /* @__PURE__ */
|
|
1220
|
-
/* @__PURE__ */
|
|
1284
|
+
e ? /* @__PURE__ */ s("div", { className: "review-lens-filters", children: [
|
|
1285
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1221
1286
|
"Status",
|
|
1222
|
-
/* @__PURE__ */
|
|
1287
|
+
/* @__PURE__ */ s(
|
|
1223
1288
|
"select",
|
|
1224
1289
|
{
|
|
1225
1290
|
"aria-label": "Filter status",
|
|
@@ -1227,49 +1292,49 @@ function Vt({
|
|
|
1227
1292
|
onChange: (l) => b(l.target.value),
|
|
1228
1293
|
children: [
|
|
1229
1294
|
/* @__PURE__ */ i("option", { value: "all", children: "All statuses" }),
|
|
1230
|
-
|
|
1295
|
+
Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: se[l] }, l))
|
|
1231
1296
|
]
|
|
1232
1297
|
}
|
|
1233
1298
|
)
|
|
1234
1299
|
] }),
|
|
1235
|
-
/* @__PURE__ */
|
|
1300
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1236
1301
|
"Priority",
|
|
1237
|
-
/* @__PURE__ */
|
|
1302
|
+
/* @__PURE__ */ s(
|
|
1238
1303
|
"select",
|
|
1239
1304
|
{
|
|
1240
1305
|
"aria-label": "Filter severity",
|
|
1241
1306
|
value: r,
|
|
1242
|
-
onChange: (l) =>
|
|
1307
|
+
onChange: (l) => A(l.target.value),
|
|
1243
1308
|
children: [
|
|
1244
1309
|
/* @__PURE__ */ i("option", { value: "all", children: "All priorities" }),
|
|
1245
|
-
|
|
1310
|
+
Qe.map((l) => /* @__PURE__ */ i("option", { value: l, children: Z[l] }, l))
|
|
1246
1311
|
]
|
|
1247
1312
|
}
|
|
1248
1313
|
)
|
|
1249
1314
|
] }),
|
|
1250
|
-
/* @__PURE__ */
|
|
1315
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1251
1316
|
"Type",
|
|
1252
|
-
/* @__PURE__ */
|
|
1317
|
+
/* @__PURE__ */ s(
|
|
1253
1318
|
"select",
|
|
1254
1319
|
{
|
|
1255
1320
|
"aria-label": "Filter type",
|
|
1256
|
-
value:
|
|
1257
|
-
onChange: (l) =>
|
|
1321
|
+
value: o,
|
|
1322
|
+
onChange: (l) => L(l.target.value),
|
|
1258
1323
|
children: [
|
|
1259
1324
|
/* @__PURE__ */ i("option", { value: "all", children: "All types" }),
|
|
1260
|
-
|
|
1325
|
+
Ze.map((l) => /* @__PURE__ */ i("option", { value: l, children: ee[l] }, l))
|
|
1261
1326
|
]
|
|
1262
1327
|
}
|
|
1263
1328
|
)
|
|
1264
1329
|
] }),
|
|
1265
|
-
/* @__PURE__ */
|
|
1330
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1266
1331
|
"Assignee",
|
|
1267
|
-
/* @__PURE__ */
|
|
1332
|
+
/* @__PURE__ */ s(
|
|
1268
1333
|
"select",
|
|
1269
1334
|
{
|
|
1270
1335
|
"aria-label": "Filter assignee",
|
|
1271
1336
|
value: c,
|
|
1272
|
-
onChange: (l) =>
|
|
1337
|
+
onChange: (l) => p(l.target.value),
|
|
1273
1338
|
children: [
|
|
1274
1339
|
/* @__PURE__ */ i("option", { value: "all", children: "All assignees" }),
|
|
1275
1340
|
w.map((l) => /* @__PURE__ */ i("option", { value: l, children: l }, l))
|
|
@@ -1277,17 +1342,17 @@ function Vt({
|
|
|
1277
1342
|
}
|
|
1278
1343
|
)
|
|
1279
1344
|
] }),
|
|
1280
|
-
/* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1281
1346
|
"Viewport",
|
|
1282
|
-
/* @__PURE__ */
|
|
1347
|
+
/* @__PURE__ */ s(
|
|
1283
1348
|
"select",
|
|
1284
1349
|
{
|
|
1285
1350
|
"aria-label": "Filter viewport",
|
|
1286
|
-
value:
|
|
1287
|
-
onChange: (l) =>
|
|
1351
|
+
value: u,
|
|
1352
|
+
onChange: (l) => v(l.target.value),
|
|
1288
1353
|
children: [
|
|
1289
1354
|
/* @__PURE__ */ i("option", { value: "all", children: "All viewports" }),
|
|
1290
|
-
|
|
1355
|
+
g.map((l) => /* @__PURE__ */ i("option", { value: l.value, children: l.label }, l.value))
|
|
1291
1356
|
]
|
|
1292
1357
|
}
|
|
1293
1358
|
)
|
|
@@ -1295,13 +1360,13 @@ function Vt({
|
|
|
1295
1360
|
] }) : null
|
|
1296
1361
|
] });
|
|
1297
1362
|
}
|
|
1298
|
-
function
|
|
1363
|
+
function tn({
|
|
1299
1364
|
item: e,
|
|
1300
1365
|
selected: t,
|
|
1301
1366
|
onSelect: n
|
|
1302
1367
|
}) {
|
|
1303
|
-
const r =
|
|
1304
|
-
return /* @__PURE__ */
|
|
1368
|
+
const r = et(e);
|
|
1369
|
+
return /* @__PURE__ */ s(
|
|
1305
1370
|
"article",
|
|
1306
1371
|
{
|
|
1307
1372
|
tabIndex: 0,
|
|
@@ -1311,22 +1376,22 @@ function Gt({
|
|
|
1311
1376
|
t ? "review-lens-comment--selected" : ""
|
|
1312
1377
|
].filter(Boolean).join(" "),
|
|
1313
1378
|
onClick: () => n(e),
|
|
1314
|
-
onKeyDown: (
|
|
1315
|
-
(
|
|
1379
|
+
onKeyDown: (o) => {
|
|
1380
|
+
(o.key === "Enter" || o.key === " ") && (o.preventDefault(), n(e));
|
|
1316
1381
|
},
|
|
1317
1382
|
children: [
|
|
1318
|
-
/* @__PURE__ */
|
|
1319
|
-
/* @__PURE__ */ i("span", { children:
|
|
1383
|
+
/* @__PURE__ */ s("div", { className: "review-lens-comment__header", children: [
|
|
1384
|
+
/* @__PURE__ */ i("span", { children: se[e.status] }),
|
|
1320
1385
|
/* @__PURE__ */ i("strong", { children: Z[e.severity] })
|
|
1321
1386
|
] }),
|
|
1322
|
-
/* @__PURE__ */
|
|
1387
|
+
/* @__PURE__ */ s("div", { className: "review-lens-comment__content", children: [
|
|
1323
1388
|
/* @__PURE__ */ i("p", { children: e.comment }),
|
|
1324
|
-
/* @__PURE__ */
|
|
1389
|
+
/* @__PURE__ */ s("span", { children: [
|
|
1325
1390
|
e.authorEmail,
|
|
1326
1391
|
e.assigneeEmail ? ` -> ${e.assigneeEmail}` : ""
|
|
1327
1392
|
] })
|
|
1328
1393
|
] }),
|
|
1329
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ s("div", { className: "review-lens-tags", children: [
|
|
1330
1395
|
/* @__PURE__ */ i("span", { children: ee[e.category] }),
|
|
1331
1396
|
/* @__PURE__ */ i("span", { children: e.viewportPreset }),
|
|
1332
1397
|
/* @__PURE__ */ i("span", { children: r.label })
|
|
@@ -1335,96 +1400,96 @@ function Gt({
|
|
|
1335
1400
|
}
|
|
1336
1401
|
);
|
|
1337
1402
|
}
|
|
1338
|
-
function
|
|
1403
|
+
function nn({
|
|
1339
1404
|
item: e,
|
|
1340
1405
|
messages: t,
|
|
1341
1406
|
messageDraft: n,
|
|
1342
1407
|
canReply: r,
|
|
1343
|
-
canUpdate:
|
|
1408
|
+
canUpdate: o,
|
|
1344
1409
|
canAssign: c,
|
|
1345
|
-
syncSelectionToUrl:
|
|
1410
|
+
syncSelectionToUrl: u,
|
|
1346
1411
|
onMessageDraftChange: w,
|
|
1347
|
-
onSubmitMessage:
|
|
1412
|
+
onSubmitMessage: g,
|
|
1348
1413
|
onStatusChange: b,
|
|
1349
|
-
onAssigneeChange:
|
|
1350
|
-
onMarkFixed:
|
|
1414
|
+
onAssigneeChange: A,
|
|
1415
|
+
onMarkFixed: L
|
|
1351
1416
|
}) {
|
|
1352
|
-
const [
|
|
1353
|
-
function
|
|
1417
|
+
const [p, v] = x(!1), h = et(e);
|
|
1418
|
+
function k() {
|
|
1354
1419
|
const l = new URL(window.location.href);
|
|
1355
|
-
l.searchParams.set("reviewLensFeedback", e.id),
|
|
1356
|
-
|
|
1420
|
+
l.searchParams.set("reviewLensFeedback", e.id), rn(l.toString()).then((C) => {
|
|
1421
|
+
C && (v(!0), setTimeout(() => v(!1), 2e3));
|
|
1357
1422
|
});
|
|
1358
1423
|
}
|
|
1359
|
-
return /* @__PURE__ */
|
|
1360
|
-
/* @__PURE__ */
|
|
1361
|
-
/* @__PURE__ */
|
|
1424
|
+
return /* @__PURE__ */ s("section", { className: "review-lens-detail", "aria-label": "Selected feedback detail", children: [
|
|
1425
|
+
/* @__PURE__ */ s("div", { className: "review-lens-detail__header", children: [
|
|
1426
|
+
/* @__PURE__ */ s("h3", { children: [
|
|
1362
1427
|
ee[e.category],
|
|
1363
1428
|
" feedback"
|
|
1364
1429
|
] }),
|
|
1365
|
-
/* @__PURE__ */
|
|
1366
|
-
|
|
1430
|
+
/* @__PURE__ */ s("div", { className: "review-lens-detail__header-actions", children: [
|
|
1431
|
+
u ? /* @__PURE__ */ i(
|
|
1367
1432
|
"button",
|
|
1368
1433
|
{
|
|
1369
1434
|
type: "button",
|
|
1370
1435
|
className: "review-lens-copy-link",
|
|
1371
|
-
onClick:
|
|
1436
|
+
onClick: k,
|
|
1372
1437
|
"aria-label": "Copy link to this feedback",
|
|
1373
|
-
children:
|
|
1438
|
+
children: p ? "Copied!" : "Copy link"
|
|
1374
1439
|
}
|
|
1375
1440
|
) : null,
|
|
1376
1441
|
/* @__PURE__ */ i("strong", { children: Z[e.severity] })
|
|
1377
1442
|
] })
|
|
1378
1443
|
] }),
|
|
1379
1444
|
/* @__PURE__ */ i("blockquote", { children: e.comment }),
|
|
1380
|
-
/* @__PURE__ */
|
|
1381
|
-
/* @__PURE__ */
|
|
1445
|
+
/* @__PURE__ */ s("dl", { className: "review-lens-detail-meta", children: [
|
|
1446
|
+
/* @__PURE__ */ s("div", { children: [
|
|
1382
1447
|
/* @__PURE__ */ i("dt", { children: "Target" }),
|
|
1383
|
-
/* @__PURE__ */ i("dd", { children:
|
|
1448
|
+
/* @__PURE__ */ i("dd", { children: h.label })
|
|
1384
1449
|
] }),
|
|
1385
|
-
/* @__PURE__ */
|
|
1450
|
+
/* @__PURE__ */ s("div", { children: [
|
|
1386
1451
|
/* @__PURE__ */ i("dt", { children: "Viewport" }),
|
|
1387
1452
|
/* @__PURE__ */ i("dd", { children: e.viewportPreset })
|
|
1388
1453
|
] }),
|
|
1389
|
-
e.screenshotUrl ? /* @__PURE__ */
|
|
1454
|
+
e.screenshotUrl ? /* @__PURE__ */ s("div", { children: [
|
|
1390
1455
|
/* @__PURE__ */ i("dt", { children: "Evidence" }),
|
|
1391
1456
|
/* @__PURE__ */ i("dd", { children: /* @__PURE__ */ i("a", { href: e.screenshotUrl, target: "_blank", rel: "noreferrer", children: "Screenshot" }) })
|
|
1392
1457
|
] }) : null
|
|
1393
1458
|
] }),
|
|
1394
|
-
/* @__PURE__ */
|
|
1395
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ s("div", { className: "review-lens-form-grid", children: [
|
|
1460
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1396
1461
|
"Status",
|
|
1397
1462
|
/* @__PURE__ */ i(
|
|
1398
1463
|
"select",
|
|
1399
1464
|
{
|
|
1400
1465
|
value: e.status,
|
|
1401
|
-
disabled: !
|
|
1466
|
+
disabled: !o,
|
|
1402
1467
|
onChange: (l) => b(l.target.value),
|
|
1403
|
-
children:
|
|
1468
|
+
children: Xe.map((l) => /* @__PURE__ */ i("option", { value: l, children: se[l] }, l))
|
|
1404
1469
|
}
|
|
1405
1470
|
)
|
|
1406
1471
|
] }),
|
|
1407
|
-
/* @__PURE__ */
|
|
1472
|
+
/* @__PURE__ */ s("label", { children: [
|
|
1408
1473
|
"Assignee",
|
|
1409
1474
|
/* @__PURE__ */ i(
|
|
1410
1475
|
"input",
|
|
1411
1476
|
{
|
|
1412
1477
|
defaultValue: e.assigneeEmail ?? "",
|
|
1413
1478
|
disabled: !c,
|
|
1414
|
-
onBlur: (l) =>
|
|
1479
|
+
onBlur: (l) => A(l.target.value),
|
|
1415
1480
|
placeholder: "optional@email.com"
|
|
1416
1481
|
}
|
|
1417
1482
|
)
|
|
1418
1483
|
] })
|
|
1419
1484
|
] }),
|
|
1420
|
-
/* @__PURE__ */
|
|
1485
|
+
/* @__PURE__ */ s("div", { className: "review-lens-status-actions", children: [
|
|
1421
1486
|
/* @__PURE__ */ i(
|
|
1422
1487
|
"button",
|
|
1423
1488
|
{
|
|
1424
1489
|
type: "button",
|
|
1425
1490
|
className: "review-lens-button-secondary",
|
|
1426
|
-
disabled: !
|
|
1427
|
-
onClick:
|
|
1491
|
+
disabled: !o,
|
|
1492
|
+
onClick: L,
|
|
1428
1493
|
children: "Mark fixed"
|
|
1429
1494
|
}
|
|
1430
1495
|
),
|
|
@@ -1433,19 +1498,19 @@ function Yt({
|
|
|
1433
1498
|
{
|
|
1434
1499
|
type: "button",
|
|
1435
1500
|
className: "review-lens-button-primary",
|
|
1436
|
-
disabled: !
|
|
1501
|
+
disabled: !o,
|
|
1437
1502
|
onClick: () => b("resolved"),
|
|
1438
1503
|
children: "Resolve"
|
|
1439
1504
|
}
|
|
1440
1505
|
)
|
|
1441
1506
|
] }),
|
|
1442
|
-
/* @__PURE__ */
|
|
1443
|
-
/* @__PURE__ */
|
|
1507
|
+
/* @__PURE__ */ s("div", { className: "review-lens-thread", children: [
|
|
1508
|
+
/* @__PURE__ */ s("div", { className: "review-lens-thread__header", children: [
|
|
1444
1509
|
/* @__PURE__ */ i("h3", { children: "Thread" }),
|
|
1445
1510
|
/* @__PURE__ */ i("span", { children: t.length })
|
|
1446
1511
|
] }),
|
|
1447
1512
|
t.length === 0 ? /* @__PURE__ */ i("p", { children: "No replies yet." }) : null,
|
|
1448
|
-
t.map((l) => /* @__PURE__ */
|
|
1513
|
+
t.map((l) => /* @__PURE__ */ s("div", { className: "review-lens-thread__message", children: [
|
|
1449
1514
|
/* @__PURE__ */ i("p", { children: l.body }),
|
|
1450
1515
|
/* @__PURE__ */ i("span", { children: l.authorEmail })
|
|
1451
1516
|
] }, l.id)),
|
|
@@ -1459,11 +1524,11 @@ function Yt({
|
|
|
1459
1524
|
placeholder: r ? "Reply..." : "You do not have permission to reply."
|
|
1460
1525
|
}
|
|
1461
1526
|
),
|
|
1462
|
-
/* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "button", disabled: !n.trim() || !r, onClick:
|
|
1527
|
+
/* @__PURE__ */ i("div", { className: "review-lens-actions", children: /* @__PURE__ */ i("button", { type: "button", disabled: !n.trim() || !r, onClick: g, children: "Reply" }) })
|
|
1463
1528
|
] })
|
|
1464
1529
|
] });
|
|
1465
1530
|
}
|
|
1466
|
-
async function
|
|
1531
|
+
async function rn(e) {
|
|
1467
1532
|
var n;
|
|
1468
1533
|
if ((n = navigator.clipboard) != null && n.writeText)
|
|
1469
1534
|
return await navigator.clipboard.writeText(e), !0;
|
|
@@ -1475,9 +1540,9 @@ async function Xt(e) {
|
|
|
1475
1540
|
t.remove();
|
|
1476
1541
|
}
|
|
1477
1542
|
}
|
|
1478
|
-
function
|
|
1479
|
-
return /* @__PURE__ */
|
|
1480
|
-
/* @__PURE__ */ i(Y, { title: "Status", values: X(e, (t) =>
|
|
1543
|
+
function an({ feedback: e }) {
|
|
1544
|
+
return /* @__PURE__ */ s("div", { className: "review-lens-summary", role: "tabpanel", children: [
|
|
1545
|
+
/* @__PURE__ */ i(Y, { title: "Status", values: X(e, (t) => se[t.status]) }),
|
|
1481
1546
|
/* @__PURE__ */ i(Y, { title: "Severity", values: X(e, (t) => Z[t.severity]) }),
|
|
1482
1547
|
/* @__PURE__ */ i(Y, { title: "Type", values: X(e, (t) => ee[t.category]) }),
|
|
1483
1548
|
/* @__PURE__ */ i(Y, { title: "Assignee", values: X(e, (t) => t.assigneeEmail ?? "Unassigned") }),
|
|
@@ -1485,17 +1550,17 @@ function Qt({ feedback: e }) {
|
|
|
1485
1550
|
] });
|
|
1486
1551
|
}
|
|
1487
1552
|
function Y({ title: e, values: t }) {
|
|
1488
|
-
return /* @__PURE__ */
|
|
1553
|
+
return /* @__PURE__ */ s("section", { children: [
|
|
1489
1554
|
/* @__PURE__ */ i("h3", { children: e }),
|
|
1490
|
-
/* @__PURE__ */ i("dl", { children: t.map(([n, r]) => /* @__PURE__ */
|
|
1555
|
+
/* @__PURE__ */ i("dl", { children: t.map(([n, r]) => /* @__PURE__ */ s("div", { children: [
|
|
1491
1556
|
/* @__PURE__ */ i("dt", { children: n }),
|
|
1492
1557
|
/* @__PURE__ */ i("dd", { children: r })
|
|
1493
1558
|
] }, n)) })
|
|
1494
1559
|
] });
|
|
1495
1560
|
}
|
|
1496
|
-
function
|
|
1497
|
-
const n =
|
|
1498
|
-
return /* @__PURE__ */
|
|
1561
|
+
function on({ target: e, locked: t }) {
|
|
1562
|
+
const n = yn(e), r = gn(e.fingerprint);
|
|
1563
|
+
return /* @__PURE__ */ s(
|
|
1499
1564
|
"div",
|
|
1500
1565
|
{
|
|
1501
1566
|
className: t ? "review-lens-highlight review-lens-highlight--locked" : "review-lens-highlight",
|
|
@@ -1542,9 +1607,9 @@ function Zt({ target: e, locked: t }) {
|
|
|
1542
1607
|
}
|
|
1543
1608
|
}
|
|
1544
1609
|
),
|
|
1545
|
-
/* @__PURE__ */
|
|
1610
|
+
/* @__PURE__ */ s("div", { className: "review-lens-highlight__label", children: [
|
|
1546
1611
|
/* @__PURE__ */ i("strong", { children: r }),
|
|
1547
|
-
/* @__PURE__ */
|
|
1612
|
+
/* @__PURE__ */ s("span", { children: [
|
|
1548
1613
|
Math.round(e.rect.width),
|
|
1549
1614
|
" x ",
|
|
1550
1615
|
Math.round(e.rect.height)
|
|
@@ -1554,8 +1619,8 @@ function Zt({ target: e, locked: t }) {
|
|
|
1554
1619
|
}
|
|
1555
1620
|
);
|
|
1556
1621
|
}
|
|
1557
|
-
function
|
|
1558
|
-
const n =
|
|
1622
|
+
function sn({ from: e, to: t }) {
|
|
1623
|
+
const n = fn(e.rect, t.rect);
|
|
1559
1624
|
return n.length === 0 ? null : /* @__PURE__ */ i(ae, { children: n.map((r) => /* @__PURE__ */ i(
|
|
1560
1625
|
"div",
|
|
1561
1626
|
{
|
|
@@ -1571,13 +1636,13 @@ function en({ from: e, to: t }) {
|
|
|
1571
1636
|
r.key
|
|
1572
1637
|
)) });
|
|
1573
1638
|
}
|
|
1574
|
-
function
|
|
1639
|
+
function ln({
|
|
1575
1640
|
feedback: e,
|
|
1576
1641
|
selectedFeedback: t,
|
|
1577
1642
|
onSelect: n
|
|
1578
1643
|
}) {
|
|
1579
1644
|
return /* @__PURE__ */ i(ae, { children: e.map((r) => /* @__PURE__ */ i(
|
|
1580
|
-
|
|
1645
|
+
cn,
|
|
1581
1646
|
{
|
|
1582
1647
|
feedback: r,
|
|
1583
1648
|
selected: (t == null ? void 0 : t.id) === r.id,
|
|
@@ -1586,23 +1651,23 @@ function tn({
|
|
|
1586
1651
|
r.id
|
|
1587
1652
|
)) });
|
|
1588
1653
|
}
|
|
1589
|
-
function
|
|
1654
|
+
function cn({
|
|
1590
1655
|
feedback: e,
|
|
1591
1656
|
selected: t,
|
|
1592
1657
|
onSelect: n
|
|
1593
1658
|
}) {
|
|
1594
1659
|
const r = re(null);
|
|
1595
|
-
return
|
|
1596
|
-
let
|
|
1660
|
+
return wt(() => {
|
|
1661
|
+
let o = 0;
|
|
1597
1662
|
const c = () => {
|
|
1598
|
-
|
|
1599
|
-
const w = r.current,
|
|
1663
|
+
o = 0;
|
|
1664
|
+
const w = r.current, g = H(e.selector), b = g == null ? void 0 : g.getBoundingClientRect();
|
|
1600
1665
|
!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
|
-
|
|
1666
|
+
}, u = () => {
|
|
1667
|
+
o || (o = window.requestAnimationFrame(c));
|
|
1603
1668
|
};
|
|
1604
|
-
return c(), window.addEventListener("scroll",
|
|
1605
|
-
|
|
1669
|
+
return c(), window.addEventListener("scroll", u, !0), window.addEventListener("resize", u), () => {
|
|
1670
|
+
o && window.cancelAnimationFrame(o), window.removeEventListener("scroll", u, !0), window.removeEventListener("resize", u);
|
|
1606
1671
|
};
|
|
1607
1672
|
}, [e.selector]), /* @__PURE__ */ i(
|
|
1608
1673
|
"button",
|
|
@@ -1615,35 +1680,35 @@ function nn({
|
|
|
1615
1680
|
}
|
|
1616
1681
|
);
|
|
1617
1682
|
}
|
|
1618
|
-
function
|
|
1683
|
+
function dn({
|
|
1619
1684
|
feedback: e,
|
|
1620
1685
|
selectedFeedback: t,
|
|
1621
1686
|
onSelect: n
|
|
1622
1687
|
}) {
|
|
1623
|
-
const r = e.map((
|
|
1624
|
-
const c =
|
|
1688
|
+
const r = e.map((o) => {
|
|
1689
|
+
const c = H(o.selector), u = c == null ? void 0 : c.getBoundingClientRect(), w = Math.max(
|
|
1625
1690
|
document.documentElement.scrollHeight,
|
|
1626
1691
|
document.body.scrollHeight,
|
|
1627
1692
|
window.innerHeight
|
|
1628
1693
|
);
|
|
1629
|
-
return !
|
|
1630
|
-
item:
|
|
1631
|
-
top: Math.min(100, Math.max(0, (
|
|
1694
|
+
return !u || w <= 0 ? null : {
|
|
1695
|
+
item: o,
|
|
1696
|
+
top: Math.min(100, Math.max(0, (u.top + window.scrollY) / w * 100))
|
|
1632
1697
|
};
|
|
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((
|
|
1698
|
+
}).filter((o) => o !== null);
|
|
1699
|
+
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
1700
|
"button",
|
|
1636
1701
|
{
|
|
1637
1702
|
type: "button",
|
|
1638
|
-
className: (t == null ? void 0 : t.id) ===
|
|
1639
|
-
style: { top: `${
|
|
1640
|
-
onClick: () => n(
|
|
1641
|
-
"aria-label": `Jump to feedback from ${
|
|
1703
|
+
className: (t == null ? void 0 : t.id) === o.item.id ? "review-lens-minimap__point review-lens-minimap__point--selected" : "review-lens-minimap__point",
|
|
1704
|
+
style: { top: `${o.top}%` },
|
|
1705
|
+
onClick: () => n(o.item),
|
|
1706
|
+
"aria-label": `Jump to feedback from ${o.item.authorEmail}`
|
|
1642
1707
|
},
|
|
1643
|
-
|
|
1708
|
+
o.item.id
|
|
1644
1709
|
)) });
|
|
1645
1710
|
}
|
|
1646
|
-
function
|
|
1711
|
+
function hn({ target: e }) {
|
|
1647
1712
|
const t = [
|
|
1648
1713
|
["Selector", e.selector],
|
|
1649
1714
|
["Size", `${e.cssSnapshot.width} x ${e.cssSnapshot.height}`],
|
|
@@ -1656,120 +1721,120 @@ function an({ target: e }) {
|
|
|
1656
1721
|
["Color", e.cssSnapshot.color],
|
|
1657
1722
|
["Background", e.cssSnapshot.backgroundColor]
|
|
1658
1723
|
];
|
|
1659
|
-
return /* @__PURE__ */ i("dl", { className: "review-lens-metrics", children: t.map(([n, r]) => /* @__PURE__ */
|
|
1724
|
+
return /* @__PURE__ */ i("dl", { className: "review-lens-metrics", children: t.map(([n, r]) => /* @__PURE__ */ s("div", { children: [
|
|
1660
1725
|
/* @__PURE__ */ i("dt", { children: n }),
|
|
1661
1726
|
/* @__PURE__ */ i("dd", { children: r })
|
|
1662
1727
|
] }, n)) });
|
|
1663
1728
|
}
|
|
1664
|
-
function
|
|
1665
|
-
return /* @__PURE__ */
|
|
1729
|
+
function He({ title: e, items: t }) {
|
|
1730
|
+
return /* @__PURE__ */ s("section", { className: "review-lens-insights", children: [
|
|
1666
1731
|
/* @__PURE__ */ i("h3", { children: e }),
|
|
1667
1732
|
t.length === 0 ? /* @__PURE__ */ i("p", { children: "No issues detected." }) : null,
|
|
1668
1733
|
t.length > 0 ? /* @__PURE__ */ i("ul", { children: t.map((n) => /* @__PURE__ */ i("li", { children: n }, n)) }) : null
|
|
1669
1734
|
] });
|
|
1670
1735
|
}
|
|
1671
|
-
function
|
|
1736
|
+
function H(e) {
|
|
1672
1737
|
try {
|
|
1673
1738
|
return document.querySelector(e);
|
|
1674
1739
|
} catch {
|
|
1675
1740
|
return null;
|
|
1676
1741
|
}
|
|
1677
1742
|
}
|
|
1678
|
-
function
|
|
1679
|
-
const t =
|
|
1743
|
+
function et(e) {
|
|
1744
|
+
const t = H(e.selector);
|
|
1680
1745
|
if (!t)
|
|
1681
1746
|
return { label: "Target missing", level: "warning" };
|
|
1682
1747
|
const n = Q(t);
|
|
1683
1748
|
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
1749
|
}
|
|
1685
|
-
function
|
|
1686
|
-
var
|
|
1687
|
-
const t =
|
|
1750
|
+
function un(e) {
|
|
1751
|
+
var g;
|
|
1752
|
+
const t = H(e.selector);
|
|
1688
1753
|
if (!t)
|
|
1689
1754
|
return ["Selected element is no longer available."];
|
|
1690
|
-
const n = [], r = t.tagName.toLowerCase(),
|
|
1691
|
-
c && !
|
|
1755
|
+
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());
|
|
1756
|
+
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
1757
|
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."),
|
|
1758
|
+
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
1759
|
}
|
|
1695
|
-
function
|
|
1760
|
+
function mn(e, t = {}) {
|
|
1696
1761
|
const n = [];
|
|
1697
|
-
return
|
|
1762
|
+
return W("Padding", e.padding, t.spacing, n, { allowComposite: !0 }), W("Margin", e.margin, t.spacing, n, { allowComposite: !0 }), W("Font size", e.fontSize, t.fontSize, n), W("Line height", e.lineHeight, t.lineHeight, n), W("Text color", e.color, t.color, n), W("Background", e.backgroundColor, t.color, n), W("Radius", e.borderRadius, t.radius, n, { allowComposite: !0 }), n;
|
|
1698
1763
|
}
|
|
1699
|
-
function
|
|
1700
|
-
!n || n.length === 0 || !t ||
|
|
1764
|
+
function W(e, t, n, r, o = {}) {
|
|
1765
|
+
!n || n.length === 0 || !t || pn(t, n, o) || r.push(`${e} ${t} is outside configured tokens.`);
|
|
1701
1766
|
}
|
|
1702
|
-
function
|
|
1767
|
+
function pn(e, t, n = {}) {
|
|
1703
1768
|
if (t.includes(e))
|
|
1704
1769
|
return !0;
|
|
1705
1770
|
if (!n.allowComposite)
|
|
1706
1771
|
return !1;
|
|
1707
1772
|
const r = e.trim().split(/\s+/);
|
|
1708
|
-
return r.length > 1 && r.every((
|
|
1773
|
+
return r.length > 1 && r.every((o) => t.includes(o));
|
|
1709
1774
|
}
|
|
1710
|
-
function
|
|
1775
|
+
function gn(e) {
|
|
1711
1776
|
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
1777
|
return `${e.tagName}${t}${n}${r}` || e.tagName;
|
|
1713
1778
|
}
|
|
1714
|
-
function
|
|
1715
|
-
const n = [], r = (Math.max(e.left, t.left) + Math.min(e.right, t.right)) / 2,
|
|
1779
|
+
function fn(e, t) {
|
|
1780
|
+
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
1781
|
if (e.right <= t.left || t.right <= e.left) {
|
|
1717
|
-
const c = e.right <= t.left ? e.right : t.right,
|
|
1782
|
+
const c = e.right <= t.left ? e.right : t.right, u = e.right <= t.left ? t.left : e.left;
|
|
1718
1783
|
n.push({
|
|
1719
1784
|
key: "horizontal",
|
|
1720
1785
|
axis: "horizontal",
|
|
1721
|
-
top:
|
|
1786
|
+
top: Ke(o, 0, window.innerHeight),
|
|
1722
1787
|
left: c,
|
|
1723
|
-
width: Math.max(
|
|
1788
|
+
width: Math.max(u - c, 1),
|
|
1724
1789
|
height: 1,
|
|
1725
|
-
label: `${Math.round(
|
|
1790
|
+
label: `${Math.round(u - c)}px`
|
|
1726
1791
|
});
|
|
1727
1792
|
}
|
|
1728
1793
|
if (e.bottom <= t.top || t.bottom <= e.top) {
|
|
1729
|
-
const c = e.bottom <= t.top ? e.bottom : t.bottom,
|
|
1794
|
+
const c = e.bottom <= t.top ? e.bottom : t.bottom, u = e.bottom <= t.top ? t.top : e.top;
|
|
1730
1795
|
n.push({
|
|
1731
1796
|
key: "vertical",
|
|
1732
1797
|
axis: "vertical",
|
|
1733
1798
|
top: c,
|
|
1734
|
-
left:
|
|
1799
|
+
left: Ke(r, 0, window.innerWidth),
|
|
1735
1800
|
width: 1,
|
|
1736
|
-
height: Math.max(
|
|
1737
|
-
label: `${Math.round(
|
|
1801
|
+
height: Math.max(u - c, 1),
|
|
1802
|
+
label: `${Math.round(u - c)}px`
|
|
1738
1803
|
});
|
|
1739
1804
|
}
|
|
1740
1805
|
return n;
|
|
1741
1806
|
}
|
|
1742
|
-
function
|
|
1807
|
+
function Ke(e, t, n) {
|
|
1743
1808
|
return Math.min(Math.max(e, t), n);
|
|
1744
1809
|
}
|
|
1745
1810
|
function X(e, t) {
|
|
1746
1811
|
const n = /* @__PURE__ */ new Map();
|
|
1747
1812
|
for (const r of e) {
|
|
1748
|
-
const
|
|
1749
|
-
n.set(
|
|
1813
|
+
const o = t(r);
|
|
1814
|
+
n.set(o, (n.get(o) ?? 0) + 1);
|
|
1750
1815
|
}
|
|
1751
|
-
return Array.from(n.entries()).sort((r,
|
|
1816
|
+
return Array.from(n.entries()).sort((r, o) => o[1] - r[1] || r[0].localeCompare(o[0]));
|
|
1752
1817
|
}
|
|
1753
|
-
function
|
|
1818
|
+
function wn(e) {
|
|
1754
1819
|
return e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement || e instanceof HTMLElement && e.isContentEditable;
|
|
1755
1820
|
}
|
|
1756
|
-
function
|
|
1757
|
-
const n =
|
|
1758
|
-
return !n || !r || r.alpha === 0 ? !1 :
|
|
1821
|
+
function vn(e, t) {
|
|
1822
|
+
const n = Je(e), r = Je(t);
|
|
1823
|
+
return !n || !r || r.alpha === 0 ? !1 : bn(n, r) < 4.5;
|
|
1759
1824
|
}
|
|
1760
|
-
function
|
|
1825
|
+
function Je(e) {
|
|
1761
1826
|
const t = e.match(/rgba?\(([^)]+)\)/);
|
|
1762
1827
|
if (!t)
|
|
1763
1828
|
return null;
|
|
1764
|
-
const [n, r,
|
|
1829
|
+
const [n, r, o, c = "1"] = t[1].split(",").map((u) => u.trim());
|
|
1765
1830
|
return {
|
|
1766
1831
|
red: Number(n),
|
|
1767
1832
|
green: Number(r),
|
|
1768
|
-
blue: Number(
|
|
1833
|
+
blue: Number(o),
|
|
1769
1834
|
alpha: Number(c)
|
|
1770
1835
|
};
|
|
1771
1836
|
}
|
|
1772
|
-
function
|
|
1837
|
+
function bn(e, t) {
|
|
1773
1838
|
const n = Math.max(ie(e), ie(t)), r = Math.min(ie(e), ie(t));
|
|
1774
1839
|
return (n + 0.05) / (r + 0.05);
|
|
1775
1840
|
}
|
|
@@ -1780,7 +1845,7 @@ function ie(e) {
|
|
|
1780
1845
|
});
|
|
1781
1846
|
return t[0] * 0.2126 + t[1] * 0.7152 + t[2] * 0.0722;
|
|
1782
1847
|
}
|
|
1783
|
-
function
|
|
1848
|
+
function yn(e) {
|
|
1784
1849
|
const t = {
|
|
1785
1850
|
top: I(e.cssSnapshot.marginTop),
|
|
1786
1851
|
right: I(e.cssSnapshot.marginRight),
|
|
@@ -1796,31 +1861,31 @@ function pn(e) {
|
|
|
1796
1861
|
right: I(e.cssSnapshot.paddingRight),
|
|
1797
1862
|
bottom: I(e.cssSnapshot.paddingBottom),
|
|
1798
1863
|
left: I(e.cssSnapshot.paddingLeft)
|
|
1799
|
-
},
|
|
1864
|
+
}, o = {
|
|
1800
1865
|
top: e.rect.top,
|
|
1801
1866
|
left: e.rect.left,
|
|
1802
1867
|
width: Math.max(e.rect.width, 0),
|
|
1803
1868
|
height: Math.max(e.rect.height, 0)
|
|
1804
1869
|
}, c = {
|
|
1805
|
-
top:
|
|
1806
|
-
left:
|
|
1807
|
-
width:
|
|
1808
|
-
height:
|
|
1809
|
-
},
|
|
1810
|
-
top:
|
|
1811
|
-
left:
|
|
1812
|
-
width: Math.max(
|
|
1813
|
-
height: Math.max(
|
|
1870
|
+
top: o.top - t.top,
|
|
1871
|
+
left: o.left - t.left,
|
|
1872
|
+
width: o.width + t.left + t.right,
|
|
1873
|
+
height: o.height + t.top + t.bottom
|
|
1874
|
+
}, u = {
|
|
1875
|
+
top: o.top + n.top,
|
|
1876
|
+
left: o.left + n.left,
|
|
1877
|
+
width: Math.max(o.width - n.left - n.right, 0),
|
|
1878
|
+
height: Math.max(o.height - n.top - n.bottom, 0)
|
|
1814
1879
|
}, w = {
|
|
1815
|
-
top:
|
|
1816
|
-
left:
|
|
1817
|
-
width: Math.max(
|
|
1818
|
-
height: Math.max(
|
|
1880
|
+
top: u.top + r.top,
|
|
1881
|
+
left: u.left + r.left,
|
|
1882
|
+
width: Math.max(u.width - r.left - r.right, 0),
|
|
1883
|
+
height: Math.max(u.height - r.top - r.bottom, 0)
|
|
1819
1884
|
};
|
|
1820
1885
|
return {
|
|
1821
1886
|
margin: c,
|
|
1822
|
-
border:
|
|
1823
|
-
padding:
|
|
1887
|
+
border: o,
|
|
1888
|
+
padding: u,
|
|
1824
1889
|
content: w
|
|
1825
1890
|
};
|
|
1826
1891
|
}
|
|
@@ -1829,11 +1894,11 @@ function I(e) {
|
|
|
1829
1894
|
return Number.isFinite(t) ? t : 0;
|
|
1830
1895
|
}
|
|
1831
1896
|
export {
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1897
|
+
Qt as ReviewLensLogo,
|
|
1898
|
+
Nn as ReviewLensOverlay,
|
|
1899
|
+
xn as ReviewLensProvider,
|
|
1835
1900
|
Q as buildElementTarget,
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1901
|
+
St as createGoogleSheetsAdapter,
|
|
1902
|
+
Ut as normalizeReviewUrl,
|
|
1903
|
+
Wt as useReviewLens
|
|
1839
1904
|
};
|