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