@llumi/design-system 0.1.0 → 1.0.0
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 +15 -6
- package/custom-elements.json +68 -9
- package/dist/review.cjs +26 -26
- package/dist/review.js +26 -26
- package/dist/review.mjs +485 -391
- package/dist/types/components/review/review.element.d.ts +10 -4
- package/dist/types/components/review/review.machine.d.ts +6 -0
- package/dist/types/components/review/review.persistence.d.ts +16 -0
- package/dist/types/components/review/review.type.d.ts +5 -0
- package/package.json +1 -1
package/dist/review.mjs
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { fromCallback as
|
|
2
|
-
import { tinykeys as
|
|
3
|
-
import { svg as _, html as v, LitElement as
|
|
4
|
-
import { property as f, query as F, state as
|
|
5
|
-
import { clsx as
|
|
6
|
-
import { twMerge as
|
|
7
|
-
import { autoUpdate as
|
|
8
|
-
import { classMap as
|
|
9
|
-
import { repeat as
|
|
10
|
-
import { styleMap as
|
|
11
|
-
function
|
|
12
|
-
const t =
|
|
1
|
+
import { fromCallback as ct, setup as Tt, emit as dt, assign as x, stateIn as kt, enqueueActions as Lt, createActor as zt } from "xstate";
|
|
2
|
+
import { tinykeys as Ot } from "tinykeys";
|
|
3
|
+
import { svg as _, html as v, LitElement as At, unsafeCSS as Dt } from "lit";
|
|
4
|
+
import { property as f, query as F, state as Mt, customElement as A } from "lit/decorators.js";
|
|
5
|
+
import { clsx as _t } from "clsx";
|
|
6
|
+
import { twMerge as Nt } from "tailwind-merge";
|
|
7
|
+
import { autoUpdate as vt, computePosition as wt, offset as bt, flip as xt, shift as yt, size as Ct } from "@floating-ui/dom";
|
|
8
|
+
import { classMap as Pt } from "lit/directives/class-map.js";
|
|
9
|
+
import { repeat as $t } from "lit/directives/repeat.js";
|
|
10
|
+
import { styleMap as Rt } from "lit/directives/style-map.js";
|
|
11
|
+
function ht(n, e) {
|
|
12
|
+
const t = n.getAttribute("data-review-id");
|
|
13
13
|
if (t) return t;
|
|
14
14
|
for (const i of e ?? [])
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
15
|
+
if (n.matches(i.selector)) {
|
|
16
|
+
const o = i.toId(n);
|
|
17
|
+
if (o) return o;
|
|
18
18
|
}
|
|
19
19
|
return null;
|
|
20
20
|
}
|
|
21
|
-
function N(
|
|
22
|
-
const t =
|
|
21
|
+
function N(n, e) {
|
|
22
|
+
const t = n.closest("[data-review-id]");
|
|
23
23
|
if (t) {
|
|
24
24
|
const i = t.getAttribute("data-review-id");
|
|
25
25
|
if (i) return { element: t, targetId: i };
|
|
26
26
|
}
|
|
27
27
|
for (const i of e ?? []) {
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const r = i.toId(
|
|
31
|
-
if (r) return { element:
|
|
28
|
+
const o = n.closest(i.selector);
|
|
29
|
+
if (o) {
|
|
30
|
+
const r = i.toId(o);
|
|
31
|
+
if (r) return { element: o, targetId: r };
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
return null;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function P(n, e) {
|
|
37
37
|
const t = /* @__PURE__ */ new Set(), i = [];
|
|
38
|
-
for (const
|
|
39
|
-
|
|
38
|
+
for (const o of Array.from(
|
|
39
|
+
n.querySelectorAll("[data-review-id]")
|
|
40
40
|
)) {
|
|
41
|
-
const r =
|
|
41
|
+
const r = o.getAttribute("data-review-id");
|
|
42
42
|
if (!r) continue;
|
|
43
|
-
const a =
|
|
43
|
+
const a = o.hasAttribute("data-review-selectable");
|
|
44
44
|
i.push({
|
|
45
|
-
element:
|
|
45
|
+
element: o,
|
|
46
46
|
targetId: r,
|
|
47
47
|
kind: a ? "both" : "element"
|
|
48
|
-
}), t.add(
|
|
48
|
+
}), t.add(o);
|
|
49
49
|
}
|
|
50
|
-
for (const
|
|
50
|
+
for (const o of e ?? [])
|
|
51
51
|
for (const r of Array.from(
|
|
52
|
-
|
|
52
|
+
n.querySelectorAll(o.selector)
|
|
53
53
|
)) {
|
|
54
54
|
if (t.has(r)) continue;
|
|
55
|
-
const a =
|
|
55
|
+
const a = o.toId(r);
|
|
56
56
|
if (!a) continue;
|
|
57
57
|
const s = r.hasAttribute("data-review-selectable");
|
|
58
58
|
i.push({
|
|
@@ -61,40 +61,40 @@ function $(o, e) {
|
|
|
61
61
|
kind: s ? "both" : "element"
|
|
62
62
|
}), t.add(r);
|
|
63
63
|
}
|
|
64
|
-
for (const
|
|
65
|
-
|
|
64
|
+
for (const o of Array.from(
|
|
65
|
+
n.querySelectorAll("[data-review-selectable]")
|
|
66
66
|
)) {
|
|
67
|
-
if (t.has(
|
|
68
|
-
const r =
|
|
69
|
-
r && (i.push({ element:
|
|
67
|
+
if (t.has(o)) continue;
|
|
68
|
+
const r = o.getAttribute("data-review-selectable");
|
|
69
|
+
r && (i.push({ element: o, targetId: r, kind: "selectable" }), t.add(o));
|
|
70
70
|
}
|
|
71
71
|
return i;
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
function B(
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
const nt = "review-highlight-hover", C = "review-highlight-commented", G = "review-highlight-editing", j = "review-highlight-uncommented", V = "review-target", gt = "review-active";
|
|
74
|
+
function B(n) {
|
|
75
|
+
n.classList.remove(
|
|
76
|
+
nt,
|
|
77
77
|
C,
|
|
78
78
|
G,
|
|
79
79
|
j
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
let t = null, i = null,
|
|
82
|
+
function Ht(n, e) {
|
|
83
|
+
let t = null, i = null, o = null;
|
|
84
84
|
function r(c) {
|
|
85
|
-
|
|
86
|
-
const h =
|
|
85
|
+
n.classList.add(gt);
|
|
86
|
+
const h = P(n, e);
|
|
87
87
|
for (const { element: p, targetId: d, kind: T } of h)
|
|
88
88
|
(T === "element" || T === "both") && (p.hasAttribute("data-review-id") || p.classList.add(V), c.has(d) && p.classList.add(C));
|
|
89
89
|
}
|
|
90
90
|
function a() {
|
|
91
|
-
|
|
92
|
-
const c =
|
|
91
|
+
n.classList.remove(gt), t && (clearTimeout(t), t = null);
|
|
92
|
+
const c = P(n, e);
|
|
93
93
|
for (const { element: h } of c)
|
|
94
94
|
B(h), h.classList.remove(V);
|
|
95
95
|
}
|
|
96
96
|
function s(c) {
|
|
97
|
-
const h =
|
|
97
|
+
const h = P(n, e), p = [];
|
|
98
98
|
for (const { element: d } of h)
|
|
99
99
|
!d.classList.contains(C) && !d.classList.contains(G) && (d.classList.add(j), p.push(d));
|
|
100
100
|
c && (t && clearTimeout(t), t = setTimeout(() => {
|
|
@@ -105,29 +105,29 @@ function Pt(o, e) {
|
|
|
105
105
|
}
|
|
106
106
|
function l() {
|
|
107
107
|
t && (clearTimeout(t), t = null);
|
|
108
|
-
const c =
|
|
108
|
+
const c = P(n, e);
|
|
109
109
|
for (const { element: h } of c)
|
|
110
110
|
h.classList.remove(j);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
112
|
+
function u(c, h) {
|
|
113
113
|
h || (B(c), c.classList.add(G));
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function m(c, h) {
|
|
116
116
|
B(c), h && c.classList.add(C);
|
|
117
117
|
}
|
|
118
118
|
function b(c, h) {
|
|
119
|
-
(
|
|
119
|
+
(ht(c, e) ?? c.getAttribute("data-review-selectable")) !== h && c.classList.add(nt);
|
|
120
120
|
}
|
|
121
121
|
function g(c, h, p) {
|
|
122
|
-
const d =
|
|
123
|
-
d !== h && (c.classList.remove(
|
|
122
|
+
const d = ht(c, e) ?? c.getAttribute("data-review-selectable");
|
|
123
|
+
d !== h && (c.classList.remove(nt), d && (p != null && p.has(d)) && c.classList.add(C));
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
125
|
+
function It(c) {
|
|
126
|
+
q(), o = c.editingTarget ?? null, i = new MutationObserver((h) => {
|
|
127
127
|
for (const p of h) {
|
|
128
128
|
for (const d of Array.from(p.removedNodes)) {
|
|
129
129
|
if (!(d instanceof HTMLElement)) continue;
|
|
130
|
-
|
|
130
|
+
o && (d === o || d.contains(o)) && (o = null, c.onTargetDisconnected()), (d.hasAttribute("data-review-selectable") || d.querySelector("[data-review-selectable]") !== null) && c.onSelectableReconnected();
|
|
131
131
|
}
|
|
132
132
|
for (const d of Array.from(p.addedNodes)) {
|
|
133
133
|
if (!(d instanceof HTMLElement)) continue;
|
|
@@ -146,40 +146,40 @@ function Pt(o, e) {
|
|
|
146
146
|
...d.matches(I.selector) ? [d] : [],
|
|
147
147
|
...Array.from(d.querySelectorAll(I.selector))
|
|
148
148
|
];
|
|
149
|
-
for (const
|
|
150
|
-
const
|
|
151
|
-
|
|
149
|
+
for (const W of M) {
|
|
150
|
+
const lt = I.toId(W);
|
|
151
|
+
W.classList.add(V), lt && c.commentedIds.has(lt) && W.classList.add(C);
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
154
|
(d.hasAttribute("data-review-selectable") || d.querySelector("[data-review-selectable]") !== null) && c.onSelectableReconnected();
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
}), i.observe(
|
|
157
|
+
}), i.observe(n, { childList: !0, subtree: !0 });
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
i && (i.disconnect(), i = null),
|
|
159
|
+
function q() {
|
|
160
|
+
i && (i.disconnect(), i = null), o = null;
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
a(),
|
|
162
|
+
function St() {
|
|
163
|
+
a(), q();
|
|
164
164
|
}
|
|
165
165
|
return {
|
|
166
166
|
activate: r,
|
|
167
167
|
deactivate: a,
|
|
168
168
|
reveal: s,
|
|
169
169
|
unreveal: l,
|
|
170
|
-
setEditing:
|
|
171
|
-
clearEditing:
|
|
170
|
+
setEditing: u,
|
|
171
|
+
clearEditing: m,
|
|
172
172
|
applyHover: b,
|
|
173
173
|
clearHover: g,
|
|
174
|
-
startObserving:
|
|
175
|
-
stopObserving:
|
|
176
|
-
destroy:
|
|
174
|
+
startObserving: It,
|
|
175
|
+
stopObserving: q,
|
|
176
|
+
destroy: St
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
|
-
const
|
|
180
|
-
function
|
|
181
|
-
const t =
|
|
182
|
-
(
|
|
179
|
+
const Gt = `:root{--review-highlight-uncommented-color: oklch(.7 0 0 / .15);--review-highlight-commented-color: oklch(.7 0 0 / .3);--review-highlight-color: oklch(.7 0 0 / .5);--review-highlight-editing-color: oklch(.6 0 0 / .7);--review-badge-icon-color: oklch(.35 0 0);--review-z-index: 9998;--review-selection-commented-color: oklch(.85 .08 250 / .4);--review-selection-editing-color: oklch(.75 .12 250 / .6);--review-selection-hover-color: oklch(.8 .1 250 / .5)}[data-review-id],[data-review-selectable],.review-target{outline:2px solid transparent;outline-offset:2px;transition:outline-color .15s ease}.review-highlight-uncommented{outline-color:var(--review-highlight-uncommented-color)}.review-highlight-commented{outline-color:var(--review-highlight-commented-color);position:relative}.review-highlight-hover{outline-color:var(--review-highlight-color)}.review-highlight-commented:after{content:"";position:absolute;top:-12px;right:-14px;width:20px;height:20px;border-radius:50%;background-color:#fff;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23404040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z'/%3E%3C/svg%3E");background-size:12px 12px;background-repeat:no-repeat;background-position:center;box-shadow:0 1px 3px #0000001a;pointer-events:none}.review-highlight-editing:after{display:none}[data-review-selectable]:not([data-review-id]).review-highlight-commented:after{display:none}.review-highlight-editing{outline-color:var(--review-highlight-editing-color)}::highlight(review-selection-commented){background-color:var(--review-selection-commented-color)}::highlight(review-selection-editing){background-color:var(--review-selection-editing-color)}::highlight(review-selection-hover){background-color:var(--review-selection-hover-color)}.review-active [data-review-id],.review-active .review-target{cursor:pointer}.review-active [data-review-selectable]{cursor:text}`;
|
|
180
|
+
function jt(n, e) {
|
|
181
|
+
const t = n.find(
|
|
182
|
+
(o) => o.targetId === e && !o.selection
|
|
183
183
|
);
|
|
184
184
|
return t ? { comment: t, isNew: !1 } : { comment: {
|
|
185
185
|
commentId: crypto.randomUUID(),
|
|
@@ -188,14 +188,14 @@ function Ht(o, e) {
|
|
|
188
188
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
189
189
|
}, isNew: !0 };
|
|
190
190
|
}
|
|
191
|
-
function
|
|
192
|
-
let e =
|
|
193
|
-
if (
|
|
191
|
+
function Ut(n) {
|
|
192
|
+
let e = n.comments;
|
|
193
|
+
if (n.editingCommentId !== null) {
|
|
194
194
|
const t = e.find(
|
|
195
|
-
(i) => i.commentId ===
|
|
195
|
+
(i) => i.commentId === n.editingCommentId
|
|
196
196
|
);
|
|
197
197
|
t && t.content === "" && (e = e.filter(
|
|
198
|
-
(i) => i.commentId !==
|
|
198
|
+
(i) => i.commentId !== n.editingCommentId
|
|
199
199
|
));
|
|
200
200
|
}
|
|
201
201
|
return {
|
|
@@ -205,28 +205,28 @@ function Gt(o) {
|
|
|
205
205
|
selectionRange: null
|
|
206
206
|
};
|
|
207
207
|
}
|
|
208
|
-
function
|
|
209
|
-
const e =
|
|
208
|
+
function Y(n) {
|
|
209
|
+
const e = n.comments.filter((o) => o.content.trim()), t = e.length > 0, i = n.overallComment.trim().length > 0;
|
|
210
210
|
return !t && !i ? { status: "approved" } : {
|
|
211
211
|
status: "commented",
|
|
212
212
|
comments: e,
|
|
213
|
-
overallComment: i ?
|
|
213
|
+
overallComment: i ? n.overallComment.trim() : void 0
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
function
|
|
216
|
+
function Ft(n) {
|
|
217
217
|
const e = /* @__PURE__ */ new Set();
|
|
218
|
-
for (const t of
|
|
218
|
+
for (const t of n.comments)
|
|
219
219
|
!t.selection && t.content.trim() && e.add(t.targetId);
|
|
220
220
|
return e;
|
|
221
221
|
}
|
|
222
|
-
function
|
|
223
|
-
const
|
|
222
|
+
function Kt() {
|
|
223
|
+
const n = ct(
|
|
224
224
|
({ sendBack: t, input: i }) => {
|
|
225
|
-
const
|
|
225
|
+
const o = () => t({ type: "RELEASE_ANNOTATE" }), r = (l) => {
|
|
226
226
|
l.key === "Alt" && (l.preventDefault(), t({ type: "HOLD_ANNOTATE" }));
|
|
227
227
|
}, a = (l) => {
|
|
228
228
|
l.key === "Alt" && t({ type: "RELEASE_ANNOTATE" });
|
|
229
|
-
}, s =
|
|
229
|
+
}, s = Ot(window, {
|
|
230
230
|
[i.shortcut]: (l) => {
|
|
231
231
|
l.preventDefault(), t({ type: "TOGGLE" });
|
|
232
232
|
},
|
|
@@ -240,12 +240,12 @@ function Ut() {
|
|
|
240
240
|
l.preventDefault(), t({ type: "CLOSE" });
|
|
241
241
|
}
|
|
242
242
|
});
|
|
243
|
-
return window.addEventListener("keydown", r), window.addEventListener("keyup", a), window.addEventListener("blur",
|
|
244
|
-
s(), window.removeEventListener("keydown", r), window.removeEventListener("keyup", a), window.removeEventListener("blur",
|
|
243
|
+
return window.addEventListener("keydown", r), window.addEventListener("keyup", a), window.addEventListener("blur", o), () => {
|
|
244
|
+
s(), window.removeEventListener("keydown", r), window.removeEventListener("keyup", a), window.removeEventListener("blur", o);
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
|
-
), e =
|
|
248
|
-
const
|
|
247
|
+
), e = ct(({ sendBack: t, input: i }) => {
|
|
248
|
+
const o = new MutationObserver((r) => {
|
|
249
249
|
for (const a of r)
|
|
250
250
|
for (const s of Array.from(a.removedNodes))
|
|
251
251
|
if (s instanceof HTMLElement && (s === i.targetElement || s.contains(i.targetElement))) {
|
|
@@ -253,9 +253,9 @@ function Ut() {
|
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
255
|
});
|
|
256
|
-
return
|
|
256
|
+
return o.observe(i.wrapperElement, { childList: !0, subtree: !0 }), () => o.disconnect();
|
|
257
257
|
});
|
|
258
|
-
return
|
|
258
|
+
return Tt({
|
|
259
259
|
types: {
|
|
260
260
|
context: {},
|
|
261
261
|
events: {},
|
|
@@ -263,11 +263,11 @@ function Ut() {
|
|
|
263
263
|
emitted: {}
|
|
264
264
|
},
|
|
265
265
|
actors: {
|
|
266
|
-
keyboardActor:
|
|
266
|
+
keyboardActor: n,
|
|
267
267
|
mutationObserverActor: e
|
|
268
268
|
},
|
|
269
269
|
guards: {
|
|
270
|
-
isCommentingEditing:
|
|
270
|
+
isCommentingEditing: kt({ commenting: "editing" }),
|
|
271
271
|
hasSelectionCommentId: ({ event: t }) => t.type !== "CLICK" ? !1 : !!t.selectionCommentId,
|
|
272
272
|
hasTargetId: ({ event: t }) => t.type !== "CLICK" ? !1 : !!t.targetId && !t.selectionCommentId,
|
|
273
273
|
hasNoTarget: ({ event: t }) => t.type !== "CLICK" ? !1 : !t.targetId && !t.selectionCommentId,
|
|
@@ -276,10 +276,10 @@ function Ut() {
|
|
|
276
276
|
if (i.selectionCommentId)
|
|
277
277
|
return t.editingCommentId === i.selectionCommentId;
|
|
278
278
|
if (i.targetId) {
|
|
279
|
-
const
|
|
279
|
+
const o = t.comments.find(
|
|
280
280
|
(r) => r.commentId === t.editingCommentId
|
|
281
281
|
);
|
|
282
|
-
return !!
|
|
282
|
+
return !!o && o.targetId === i.targetId && !o.selection;
|
|
283
283
|
}
|
|
284
284
|
return !1;
|
|
285
285
|
}
|
|
@@ -290,13 +290,13 @@ function Ut() {
|
|
|
290
290
|
actions: {
|
|
291
291
|
openElementComment: x(({ context: t, event: i }) => {
|
|
292
292
|
if (i.type !== "CLICK" || !i.targetId) return {};
|
|
293
|
-
const { comment:
|
|
293
|
+
const { comment: o, isNew: r } = jt(
|
|
294
294
|
t.comments,
|
|
295
295
|
i.targetId
|
|
296
296
|
);
|
|
297
297
|
return {
|
|
298
|
-
comments: r ? [...t.comments,
|
|
299
|
-
editingCommentId:
|
|
298
|
+
comments: r ? [...t.comments, o] : t.comments,
|
|
299
|
+
editingCommentId: o.commentId,
|
|
300
300
|
targetElement: i.element ?? null,
|
|
301
301
|
selectionRange: null
|
|
302
302
|
};
|
|
@@ -308,7 +308,7 @@ function Ut() {
|
|
|
308
308
|
}),
|
|
309
309
|
createSelectionComment: x(({ context: t, event: i }) => {
|
|
310
310
|
if (i.type !== "SELECT_TEXT") return {};
|
|
311
|
-
const
|
|
311
|
+
const o = {
|
|
312
312
|
commentId: crypto.randomUUID(),
|
|
313
313
|
targetId: i.targetId,
|
|
314
314
|
content: "",
|
|
@@ -316,15 +316,15 @@ function Ut() {
|
|
|
316
316
|
selection: i.selectionRange
|
|
317
317
|
};
|
|
318
318
|
return {
|
|
319
|
-
comments: [...t.comments,
|
|
320
|
-
editingCommentId:
|
|
319
|
+
comments: [...t.comments, o],
|
|
320
|
+
editingCommentId: o.commentId,
|
|
321
321
|
targetElement: i.targetElement,
|
|
322
322
|
selectionRange: i.selectionRange
|
|
323
323
|
};
|
|
324
324
|
}),
|
|
325
325
|
updateContent: x(({ context: t, event: i }) => i.type !== "COMMENT_CHANGE" ? {} : t.editingCommentId === null ? { overallComment: i.content } : {
|
|
326
326
|
comments: t.comments.map(
|
|
327
|
-
(
|
|
327
|
+
(o) => o.commentId === t.editingCommentId ? { ...o, content: i.content } : o
|
|
328
328
|
)
|
|
329
329
|
}),
|
|
330
330
|
deleteComment: x(({ context: t }) => ({
|
|
@@ -335,14 +335,17 @@ function Ut() {
|
|
|
335
335
|
targetElement: null,
|
|
336
336
|
selectionRange: null
|
|
337
337
|
})),
|
|
338
|
-
cleanup: x(({ context: t }) =>
|
|
339
|
-
emitChanged:
|
|
338
|
+
cleanup: x(({ context: t }) => Ut(t)),
|
|
339
|
+
emitChanged: dt(({ context: t }) => ({
|
|
340
340
|
type: "REVIEW_CHANGED",
|
|
341
|
-
result:
|
|
341
|
+
result: Y(t)
|
|
342
342
|
})),
|
|
343
|
-
|
|
343
|
+
persistSave: ({ context: t }) => {
|
|
344
|
+
t.persistence.save(Y(t));
|
|
345
|
+
},
|
|
346
|
+
emitSubmitted: dt(({ context: t }) => ({
|
|
344
347
|
type: "REVIEW_SUBMITTED",
|
|
345
|
-
result:
|
|
348
|
+
result: Y(t)
|
|
346
349
|
})),
|
|
347
350
|
// Highlight lifecycle actions — call manager methods directly via
|
|
348
351
|
// callbacks passed through input. The machine owns WHEN highlights
|
|
@@ -350,7 +353,7 @@ function Ut() {
|
|
|
350
353
|
// Actions run synchronously during transitions — no timing gap.
|
|
351
354
|
// Never add useEffects that react to derived machine state.
|
|
352
355
|
highlightsActivate: ({ context: t }) => {
|
|
353
|
-
t.highlights.activate(
|
|
356
|
+
t.highlights.activate(Ft(t));
|
|
354
357
|
},
|
|
355
358
|
highlightsDeactivate: ({ context: t }) => {
|
|
356
359
|
t.highlights.deactivate();
|
|
@@ -365,17 +368,17 @@ function Ut() {
|
|
|
365
368
|
t.highlights.unreveal();
|
|
366
369
|
},
|
|
367
370
|
editingTargetSet: ({ context: t }) => {
|
|
368
|
-
var
|
|
371
|
+
var o;
|
|
369
372
|
if (!t.targetElement) return;
|
|
370
|
-
const i = !!((
|
|
373
|
+
const i = !!((o = t.comments.find(
|
|
371
374
|
(r) => r.commentId === t.editingCommentId
|
|
372
|
-
)) != null &&
|
|
375
|
+
)) != null && o.selection);
|
|
373
376
|
t.highlights.setEditing(t.targetElement, i);
|
|
374
377
|
},
|
|
375
378
|
editingTargetCleared: ({ context: t }) => {
|
|
376
379
|
if (!t.targetElement) return;
|
|
377
380
|
const i = t.comments.find(
|
|
378
|
-
(
|
|
381
|
+
(o) => o.commentId === t.editingCommentId
|
|
379
382
|
);
|
|
380
383
|
t.highlights.clearEditing(
|
|
381
384
|
t.targetElement,
|
|
@@ -387,17 +390,17 @@ function Ut() {
|
|
|
387
390
|
id: "review",
|
|
388
391
|
type: "parallel",
|
|
389
392
|
context: ({ input: t }) => {
|
|
390
|
-
|
|
391
|
-
const i = ((r = t.initialData) == null ? void 0 : r.status) === "commented" ? t.initialData.comments ?? [] : [], n = ((a = t.initialData) == null ? void 0 : a.status) === "commented" ? t.initialData.overallComment ?? "" : "";
|
|
393
|
+
const i = t.persistence.load() ?? t.initialData, o = (i == null ? void 0 : i.status) === "commented" ? i.comments ?? [] : [], r = (i == null ? void 0 : i.status) === "commented" ? i.overallComment ?? "" : "";
|
|
392
394
|
return {
|
|
393
|
-
comments:
|
|
394
|
-
overallComment:
|
|
395
|
+
comments: o,
|
|
396
|
+
overallComment: r,
|
|
395
397
|
editingCommentId: null,
|
|
396
398
|
targetElement: null,
|
|
397
399
|
selectionRange: null,
|
|
398
400
|
shortcut: t.shortcut,
|
|
399
401
|
defaultMode: t.defaultMode,
|
|
400
|
-
highlights: t.highlights
|
|
402
|
+
highlights: t.highlights,
|
|
403
|
+
persistence: t.persistence
|
|
401
404
|
};
|
|
402
405
|
},
|
|
403
406
|
invoke: {
|
|
@@ -436,7 +439,7 @@ function Ut() {
|
|
|
436
439
|
on: {
|
|
437
440
|
TOGGLE: {
|
|
438
441
|
target: "inactive",
|
|
439
|
-
actions:
|
|
442
|
+
actions: Lt(({ enqueue: t, check: i }) => {
|
|
440
443
|
i("isCommentingEditing") && t.raise({ type: "CLOSE" });
|
|
441
444
|
})
|
|
442
445
|
}
|
|
@@ -555,7 +558,12 @@ function Ut() {
|
|
|
555
558
|
{
|
|
556
559
|
guard: "hasNoTarget",
|
|
557
560
|
target: "idle",
|
|
558
|
-
actions: [
|
|
561
|
+
actions: [
|
|
562
|
+
"editingTargetCleared",
|
|
563
|
+
"cleanup",
|
|
564
|
+
"emitChanged",
|
|
565
|
+
"persistSave"
|
|
566
|
+
]
|
|
559
567
|
}
|
|
560
568
|
],
|
|
561
569
|
SELECT_TEXT: {
|
|
@@ -569,23 +577,34 @@ function Ut() {
|
|
|
569
577
|
]
|
|
570
578
|
},
|
|
571
579
|
COMMENT_CHANGE: {
|
|
572
|
-
actions: ["updateContent", "emitChanged"]
|
|
580
|
+
actions: ["updateContent", "emitChanged", "persistSave"]
|
|
573
581
|
},
|
|
574
582
|
DELETE: {
|
|
575
583
|
target: "idle",
|
|
576
584
|
actions: [
|
|
577
585
|
"editingTargetCleared",
|
|
578
586
|
"deleteComment",
|
|
579
|
-
"emitChanged"
|
|
587
|
+
"emitChanged",
|
|
588
|
+
"persistSave"
|
|
580
589
|
]
|
|
581
590
|
},
|
|
582
591
|
CLOSE: {
|
|
583
592
|
target: "idle",
|
|
584
|
-
actions: [
|
|
593
|
+
actions: [
|
|
594
|
+
"editingTargetCleared",
|
|
595
|
+
"cleanup",
|
|
596
|
+
"emitChanged",
|
|
597
|
+
"persistSave"
|
|
598
|
+
]
|
|
585
599
|
},
|
|
586
600
|
TARGET_DISCONNECTED: {
|
|
587
601
|
target: "idle",
|
|
588
|
-
actions: [
|
|
602
|
+
actions: [
|
|
603
|
+
"editingTargetCleared",
|
|
604
|
+
"cleanup",
|
|
605
|
+
"emitChanged",
|
|
606
|
+
"persistSave"
|
|
607
|
+
]
|
|
589
608
|
},
|
|
590
609
|
SUBMIT: {
|
|
591
610
|
target: "idle",
|
|
@@ -615,128 +634,184 @@ function Ut() {
|
|
|
615
634
|
}
|
|
616
635
|
});
|
|
617
636
|
}
|
|
618
|
-
const
|
|
619
|
-
|
|
637
|
+
const ut = {
|
|
638
|
+
load: () => {
|
|
639
|
+
},
|
|
640
|
+
save: () => {
|
|
641
|
+
},
|
|
642
|
+
clear: () => {
|
|
643
|
+
}
|
|
644
|
+
};
|
|
645
|
+
function J() {
|
|
646
|
+
try {
|
|
647
|
+
return typeof localStorage > "u" ? void 0 : localStorage;
|
|
648
|
+
} catch {
|
|
649
|
+
return;
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
function Xt(n) {
|
|
653
|
+
if (typeof n != "object" || n === null) return !1;
|
|
654
|
+
const e = n.status;
|
|
655
|
+
return e === "approved" || e === "commented";
|
|
656
|
+
}
|
|
657
|
+
function qt(n) {
|
|
658
|
+
return {
|
|
659
|
+
load() {
|
|
660
|
+
const e = J();
|
|
661
|
+
if (e)
|
|
662
|
+
try {
|
|
663
|
+
const t = e.getItem(n);
|
|
664
|
+
if (t === null) return;
|
|
665
|
+
const i = JSON.parse(t);
|
|
666
|
+
return Xt(i) ? i : void 0;
|
|
667
|
+
} catch {
|
|
668
|
+
return;
|
|
669
|
+
}
|
|
670
|
+
},
|
|
671
|
+
save(e) {
|
|
672
|
+
const t = J();
|
|
673
|
+
if (t)
|
|
674
|
+
try {
|
|
675
|
+
if (e.status === "approved") {
|
|
676
|
+
t.removeItem(n);
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
t.setItem(n, JSON.stringify(e));
|
|
680
|
+
} catch {
|
|
681
|
+
}
|
|
682
|
+
},
|
|
683
|
+
clear() {
|
|
684
|
+
const e = J();
|
|
685
|
+
if (e)
|
|
686
|
+
try {
|
|
687
|
+
e.removeItem(n);
|
|
688
|
+
} catch {
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
const Wt = 3;
|
|
694
|
+
function Vt(n) {
|
|
620
695
|
const e = window.getSelection();
|
|
621
696
|
if (!e || e.isCollapsed || e.rangeCount === 0)
|
|
622
697
|
return null;
|
|
623
698
|
const t = e.getRangeAt(0), i = t.toString();
|
|
624
|
-
if (i.length <
|
|
625
|
-
const
|
|
626
|
-
|
|
699
|
+
if (i.length < Wt) return null;
|
|
700
|
+
const o = Jt(
|
|
701
|
+
n,
|
|
627
702
|
t.startContainer,
|
|
628
703
|
t.startOffset
|
|
629
|
-
), r =
|
|
630
|
-
if (
|
|
631
|
-
const a =
|
|
632
|
-
|
|
704
|
+
), r = o + i.length;
|
|
705
|
+
if (o < 0) return null;
|
|
706
|
+
const a = Qt(
|
|
707
|
+
n.textContent ?? "",
|
|
633
708
|
i,
|
|
634
|
-
|
|
709
|
+
o
|
|
635
710
|
);
|
|
636
|
-
return { startOffset:
|
|
711
|
+
return { startOffset: o, endOffset: r, selectedText: i, matchIndex: a };
|
|
637
712
|
}
|
|
638
|
-
function
|
|
639
|
-
const t =
|
|
713
|
+
function mt(n, e) {
|
|
714
|
+
const t = n.textContent ?? "";
|
|
640
715
|
if (t.slice(
|
|
641
716
|
e.startOffset,
|
|
642
717
|
e.endOffset
|
|
643
718
|
) === e.selectedText)
|
|
644
|
-
return
|
|
645
|
-
|
|
719
|
+
return pt(
|
|
720
|
+
n,
|
|
646
721
|
e.startOffset,
|
|
647
722
|
e.endOffset
|
|
648
723
|
);
|
|
649
|
-
const
|
|
724
|
+
const o = Zt(
|
|
650
725
|
t,
|
|
651
726
|
e.selectedText,
|
|
652
727
|
e.matchIndex
|
|
653
728
|
);
|
|
654
|
-
return
|
|
655
|
-
o,
|
|
729
|
+
return o < 0 ? null : pt(
|
|
656
730
|
n,
|
|
657
|
-
|
|
731
|
+
o,
|
|
732
|
+
o + e.selectedText.length
|
|
658
733
|
);
|
|
659
734
|
}
|
|
660
|
-
function
|
|
661
|
-
if (
|
|
662
|
-
const t =
|
|
735
|
+
function Bt(n, e) {
|
|
736
|
+
if (n.isCollapsed || n.rangeCount === 0) return !1;
|
|
737
|
+
const t = n.getRangeAt(0);
|
|
663
738
|
return e.contains(t.startContainer) && e.contains(t.endContainer);
|
|
664
739
|
}
|
|
665
|
-
function
|
|
666
|
-
const e =
|
|
740
|
+
function Q(n) {
|
|
741
|
+
const e = n instanceof HTMLElement ? n : n.parentElement;
|
|
667
742
|
return (e == null ? void 0 : e.closest("[data-review-selectable]")) ?? null;
|
|
668
743
|
}
|
|
669
|
-
function
|
|
744
|
+
function Yt(n, e) {
|
|
670
745
|
var a;
|
|
671
|
-
if (
|
|
672
|
-
const t =
|
|
673
|
-
if (
|
|
674
|
-
if (
|
|
675
|
-
const s =
|
|
746
|
+
if (n.isCollapsed || n.rangeCount === 0) return null;
|
|
747
|
+
const t = n.getRangeAt(0), i = t.cloneRange(), o = e.contains(t.startContainer), r = e.contains(t.endContainer);
|
|
748
|
+
if (o && r) return i;
|
|
749
|
+
if (o && !r) {
|
|
750
|
+
const s = te(e);
|
|
676
751
|
return s && i.setEnd(s, ((a = s.textContent) == null ? void 0 : a.length) ?? 0), i;
|
|
677
752
|
}
|
|
678
753
|
return null;
|
|
679
754
|
}
|
|
680
|
-
function
|
|
755
|
+
function Jt(n, e, t) {
|
|
681
756
|
var r;
|
|
682
|
-
const i = document.createTreeWalker(
|
|
683
|
-
let
|
|
757
|
+
const i = document.createTreeWalker(n, NodeFilter.SHOW_TEXT);
|
|
758
|
+
let o = 0;
|
|
684
759
|
for (; i.nextNode(); ) {
|
|
685
|
-
if (i.currentNode === e) return
|
|
686
|
-
|
|
760
|
+
if (i.currentNode === e) return o + t;
|
|
761
|
+
o += ((r = i.currentNode.textContent) == null ? void 0 : r.length) ?? 0;
|
|
687
762
|
}
|
|
688
763
|
return -1;
|
|
689
764
|
}
|
|
690
|
-
function
|
|
765
|
+
function pt(n, e, t) {
|
|
691
766
|
var s;
|
|
692
|
-
const i = document.createTreeWalker(
|
|
767
|
+
const i = document.createTreeWalker(n, NodeFilter.SHOW_TEXT), o = document.createRange();
|
|
693
768
|
let r = 0, a = !1;
|
|
694
769
|
for (; i.nextNode(); ) {
|
|
695
770
|
const l = ((s = i.currentNode.textContent) == null ? void 0 : s.length) ?? 0;
|
|
696
|
-
if (!a && r + l > e && (
|
|
697
|
-
return
|
|
771
|
+
if (!a && r + l > e && (o.setStart(i.currentNode, e - r), a = !0), a && r + l >= t)
|
|
772
|
+
return o.setEnd(i.currentNode, t - r), o;
|
|
698
773
|
r += l;
|
|
699
774
|
}
|
|
700
775
|
return null;
|
|
701
776
|
}
|
|
702
|
-
function
|
|
703
|
-
let i = 0,
|
|
777
|
+
function Qt(n, e, t) {
|
|
778
|
+
let i = 0, o = 0;
|
|
704
779
|
for (; ; ) {
|
|
705
|
-
const r =
|
|
780
|
+
const r = n.indexOf(e, o);
|
|
706
781
|
if (r < 0 || r === t) return i;
|
|
707
|
-
|
|
782
|
+
o = r + 1, i++;
|
|
708
783
|
}
|
|
709
784
|
}
|
|
710
|
-
function
|
|
711
|
-
let i = 0,
|
|
785
|
+
function Zt(n, e, t) {
|
|
786
|
+
let i = 0, o = 0;
|
|
712
787
|
for (; ; ) {
|
|
713
|
-
const r =
|
|
788
|
+
const r = n.indexOf(e, o);
|
|
714
789
|
if (r < 0) return -1;
|
|
715
790
|
if (i === t) return r;
|
|
716
|
-
|
|
791
|
+
o = r + 1, i++;
|
|
717
792
|
}
|
|
718
793
|
}
|
|
719
|
-
function
|
|
720
|
-
const e = document.createTreeWalker(
|
|
794
|
+
function te(n) {
|
|
795
|
+
const e = document.createTreeWalker(n, NodeFilter.SHOW_TEXT);
|
|
721
796
|
let t = null;
|
|
722
797
|
for (; e.nextNode(); )
|
|
723
798
|
t = e.currentNode;
|
|
724
799
|
return t;
|
|
725
800
|
}
|
|
726
|
-
function
|
|
801
|
+
function ee(n, e) {
|
|
727
802
|
const t = /* @__PURE__ */ new Map();
|
|
728
|
-
return e.querySelectorAll("[data-review-id]").forEach((
|
|
729
|
-
const a =
|
|
803
|
+
return e.querySelectorAll("[data-review-id]").forEach((o, r) => {
|
|
804
|
+
const a = o.getAttribute("data-review-id");
|
|
730
805
|
a && t.set(a, r);
|
|
731
|
-
}), [...
|
|
732
|
-
const a = t.get(
|
|
806
|
+
}), [...n].sort((o, r) => {
|
|
807
|
+
const a = t.get(o.targetId) ?? Number.MAX_SAFE_INTEGER, s = t.get(r.targetId) ?? Number.MAX_SAFE_INTEGER;
|
|
733
808
|
return a - s;
|
|
734
809
|
});
|
|
735
810
|
}
|
|
736
|
-
function k(...
|
|
737
|
-
return
|
|
811
|
+
function k(...n) {
|
|
812
|
+
return Nt(_t(n));
|
|
738
813
|
}
|
|
739
|
-
function
|
|
814
|
+
function $(n) {
|
|
740
815
|
return v`<svg
|
|
741
816
|
xmlns="http://www.w3.org/2000/svg"
|
|
742
817
|
viewBox="0 0 24 24"
|
|
@@ -747,30 +822,30 @@ function P(o) {
|
|
|
747
822
|
stroke-linejoin="round"
|
|
748
823
|
aria-hidden="true"
|
|
749
824
|
>
|
|
750
|
-
${
|
|
825
|
+
${n}
|
|
751
826
|
</svg>`;
|
|
752
827
|
}
|
|
753
828
|
const U = {
|
|
754
|
-
check:
|
|
755
|
-
gripVertical:
|
|
829
|
+
check: $(_`<path d="M20 6 9 17l-5-5" />`),
|
|
830
|
+
gripVertical: $(
|
|
756
831
|
_`<circle cx="9" cy="12" r="1" /><circle cx="9" cy="5" r="1" /><circle cx="9" cy="19" r="1" /><circle cx="15" cy="12" r="1" /><circle cx="15" cy="5" r="1" /><circle cx="15" cy="19" r="1" />`
|
|
757
832
|
),
|
|
758
|
-
messageSquare:
|
|
833
|
+
messageSquare: $(
|
|
759
834
|
_`<path d="M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" />`
|
|
760
835
|
),
|
|
761
|
-
trash:
|
|
836
|
+
trash: $(
|
|
762
837
|
_`<path d="M3 6h18" /><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2" />`
|
|
763
838
|
)
|
|
764
|
-
}, Qt = '/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-zinc-50:oklch(98.5% 0 0);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-white:#fff;--spacing:.25rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.top-2{top:calc(var(--spacing) * 2)}.right-2{right:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-\\[calc\\(var\\(--review-z-index\\,9998\\)\\+1\\)\\]{z-index:calc(var(--review-z-index,9998) + 1)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-7{height:calc(var(--spacing) * 7)}.h-\\[18px\\]{height:18px}.max-h-\\[200px\\]{max-height:200px}.w-7{width:calc(var(--spacing) * 7)}.w-\\[400px\\]{width:400px}.w-full{width:100%}.w-px{width:1px}.max-w-0{max-width:0}.max-w-2xl{max-width:var(--container-2xl)}.min-w-\\[18px\\]{min-width:18px}.flex-1{flex:1}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-3\\.5{--tw-translate-x:calc(var(--spacing) * 3.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[llumi-fade-in_0\\.15s_ease-out\\]{animation:.15s ease-out llumi-fade-in}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-zinc-200{border-color:var(--color-zinc-200)}.border-zinc-300{border-color:var(--color-zinc-300)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\\/25{background-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.bg-zinc-100{background-color:var(--color-zinc-100)}.bg-zinc-200{background-color:var(--color-zinc-200)}.bg-zinc-300{background-color:var(--color-zinc-300)}.bg-zinc-900{background-color:var(--color-zinc-900)}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-white{color:var(--color-white)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-700{color:var(--color-zinc-700)}.text-zinc-900{color:var(--color-zinc-900)}.italic{font-style:italic}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-zinc-400\\/20{--tw-ring-color:#9f9fa933}@supports (color:color-mix(in lab,red,red)){.ring-zinc-400\\/20{--tw-ring-color:color-mix(in oklab, var(--color-zinc-400) 20%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:max-w-\\[60px\\]:is(:where(.group):hover *){max-width:60px}}.placeholder\\:text-zinc-400::placeholder{color:var(--color-zinc-400)}@media(hover:hover){.hover\\:bg-zinc-50:hover{background-color:var(--color-zinc-50)}.hover\\:bg-zinc-200:hover{background-color:var(--color-zinc-200)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-white:hover{color:var(--color-white)}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-zinc-950:active{background-color:var(--color-zinc-950)}}@keyframes llumi-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}', Zt = Ot(Qt), ot = class ot extends zt {
|
|
839
|
+
}, ie = '/*! tailwindcss v4.3.1 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0;--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-space-y-reverse:0;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono:ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-zinc-50:oklch(98.5% 0 0);--color-zinc-100:oklch(96.7% .001 286.375);--color-zinc-200:oklch(92% .004 286.32);--color-zinc-300:oklch(87.1% .006 286.286);--color-zinc-400:oklch(70.5% .015 286.067);--color-zinc-500:oklch(55.2% .016 285.938);--color-zinc-600:oklch(44.2% .017 285.786);--color-zinc-700:oklch(37% .013 285.805);--color-zinc-800:oklch(27.4% .006 286.033);--color-zinc-900:oklch(21% .006 285.885);--color-zinc-950:oklch(14.1% .005 285.823);--color-white:#fff;--spacing:.25rem;--container-2xl:42rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-lg:1.125rem;--text-lg--line-height:calc(1.75 / 1.125);--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.static{position:static}.top-2{top:calc(var(--spacing) * 2)}.right-2{right:calc(var(--spacing) * 2)}.z-10{z-index:10}.z-\\[calc\\(var\\(--review-z-index\\,9998\\)\\+1\\)\\]{z-index:calc(var(--review-z-index,9998) + 1)}.container{width:100%}@media(min-width:40rem){.container{max-width:40rem}}@media(min-width:48rem){.container{max-width:48rem}}@media(min-width:64rem){.container{max-width:64rem}}@media(min-width:80rem){.container{max-width:80rem}}@media(min-width:96rem){.container{max-width:96rem}}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.block{display:block}.flex{display:flex}.inline-block{display:inline-block}.inline-flex{display:inline-flex}.size-3{width:calc(var(--spacing) * 3);height:calc(var(--spacing) * 3)}.size-3\\.5{width:calc(var(--spacing) * 3.5);height:calc(var(--spacing) * 3.5)}.h-4{height:calc(var(--spacing) * 4)}.h-7{height:calc(var(--spacing) * 7)}.h-\\[18px\\]{height:18px}.max-h-\\[200px\\]{max-height:200px}.w-7{width:calc(var(--spacing) * 7)}.w-\\[400px\\]{width:400px}.w-full{width:100%}.w-px{width:1px}.max-w-0{max-width:0}.max-w-2xl{max-width:var(--container-2xl)}.min-w-\\[18px\\]{min-width:18px}.flex-1{flex:1}.translate-x-0\\.5{--tw-translate-x:calc(var(--spacing) * .5);translate:var(--tw-translate-x) var(--tw-translate-y)}.translate-x-3\\.5{--tw-translate-x:calc(var(--spacing) * 3.5);translate:var(--tw-translate-x) var(--tw-translate-y)}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-\\[llumi-fade-in_0\\.15s_ease-out\\]{animation:.15s ease-out llumi-fade-in}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize-none{resize:none}.items-center{align-items:center}.justify-center{justify-content:center}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}:where(.space-y-6>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-zinc-200{border-color:var(--color-zinc-200)}.border-zinc-300{border-color:var(--color-zinc-300)}.bg-transparent{background-color:#0000}.bg-white{background-color:var(--color-white)}.bg-white\\/25{background-color:#ffffff40}@supports (color:color-mix(in lab,red,red)){.bg-white\\/25{background-color:color-mix(in oklab,var(--color-white) 25%,transparent)}}.bg-zinc-100{background-color:var(--color-zinc-100)}.bg-zinc-200{background-color:var(--color-zinc-200)}.bg-zinc-300{background-color:var(--color-zinc-300)}.bg-zinc-900{background-color:var(--color-zinc-900)}.p-1{padding:var(--spacing)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-8{padding:calc(var(--spacing) * 8)}.px-1{padding-inline:var(--spacing)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-1{padding-block:var(--spacing)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.pr-2{padding-right:calc(var(--spacing) * 2)}.pl-3{padding-left:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading,var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.text-white{color:var(--color-white)}.text-zinc-400{color:var(--color-zinc-400)}.text-zinc-500{color:var(--color-zinc-500)}.text-zinc-600{color:var(--color-zinc-600)}.text-zinc-700{color:var(--color-zinc-700)}.text-zinc-900{color:var(--color-zinc-900)}.italic{font-style:italic}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a), 0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow:0 20px 25px -5px var(--tw-shadow-color,#0000001a), 0 8px 10px -6px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.ring-zinc-400\\/20{--tw-ring-color:#9f9fa933}@supports (color:color-mix(in lab,red,red)){.ring-zinc-400\\/20{--tw-ring-color:color-mix(in oklab, var(--color-zinc-400) 20%, transparent)}}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.blur{--tw-blur:blur(8px);filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.select-none{-webkit-user-select:none;user-select:none}@media(hover:hover){.group-hover\\:max-w-\\[60px\\]:is(:where(.group):hover *){max-width:60px}}.placeholder\\:text-zinc-400::placeholder{color:var(--color-zinc-400)}@media(hover:hover){.hover\\:bg-zinc-50:hover{background-color:var(--color-zinc-50)}.hover\\:bg-zinc-200:hover{background-color:var(--color-zinc-200)}.hover\\:bg-zinc-800:hover{background-color:var(--color-zinc-800)}.hover\\:bg-zinc-900:hover{background-color:var(--color-zinc-900)}.hover\\:text-white:hover{color:var(--color-white)}}.focus\\:outline-none:focus{--tw-outline-style:none;outline-style:none}.active\\:cursor-grabbing:active{cursor:grabbing}.active\\:bg-zinc-950:active{background-color:var(--color-zinc-950)}}@keyframes llumi-fade-in{0%{opacity:0;transform:translateY(4px)}to{opacity:1;transform:translateY(0)}}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-space-y-reverse{syntax:"*";inherits:false;initial-value:0}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}', ne = Dt(ie), at = class at extends At {
|
|
765
840
|
};
|
|
766
|
-
|
|
767
|
-
let E =
|
|
768
|
-
var
|
|
769
|
-
for (var
|
|
770
|
-
(a =
|
|
771
|
-
return i &&
|
|
841
|
+
at.styles = ne;
|
|
842
|
+
let E = at;
|
|
843
|
+
var oe = Object.defineProperty, re = Object.getOwnPropertyDescriptor, y = (n, e, t, i) => {
|
|
844
|
+
for (var o = i > 1 ? void 0 : i ? re(e, t) : e, r = n.length - 1, a; r >= 0; r--)
|
|
845
|
+
(a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
|
|
846
|
+
return i && o && oe(e, t, o), o;
|
|
772
847
|
};
|
|
773
|
-
const
|
|
848
|
+
const ae = {
|
|
774
849
|
"top-left": { top: "16px", left: "16px" },
|
|
775
850
|
"top-center": { top: "16px", left: "50%", translateX: "-50%" },
|
|
776
851
|
"top-right": { top: "16px", right: "16px" },
|
|
@@ -780,19 +855,19 @@ const ie = {
|
|
|
780
855
|
};
|
|
781
856
|
let w = class extends E {
|
|
782
857
|
constructor() {
|
|
783
|
-
super(...arguments), this.mode = "idle", this.commentCount = 0, this.hasOverallComment = !1, this.overallCommentOpen = !1, this.barPosition = "bottom-center", this.dragOffset = null, this.dragStart = null, this.onDragStart = (
|
|
858
|
+
super(...arguments), this.mode = "idle", this.commentCount = 0, this.hasOverallComment = !1, this.overallCommentOpen = !1, this.barPosition = "bottom-center", this.dragOffset = null, this.dragStart = null, this.onDragStart = (n) => {
|
|
784
859
|
const e = this.bar.getBoundingClientRect();
|
|
785
860
|
this.dragStart = {
|
|
786
|
-
px:
|
|
787
|
-
py:
|
|
861
|
+
px: n.clientX,
|
|
862
|
+
py: n.clientY,
|
|
788
863
|
ox: e.left,
|
|
789
864
|
oy: e.top
|
|
790
865
|
}, window.addEventListener("pointermove", this.onDragMove), window.addEventListener("pointerup", this.onDragEnd);
|
|
791
|
-
}, this.onDragMove = (
|
|
866
|
+
}, this.onDragMove = (n) => {
|
|
792
867
|
if (!this.dragStart) return;
|
|
793
|
-
const e = this.dragStart.ox + (
|
|
868
|
+
const e = this.dragStart.ox + (n.clientX - this.dragStart.px), t = this.dragStart.oy + (n.clientY - this.dragStart.py), i = 16, o = window.innerWidth - this.bar.offsetWidth - i, r = window.innerHeight - this.bar.offsetHeight - i;
|
|
794
869
|
this.dragOffset = {
|
|
795
|
-
x: Math.max(i, Math.min(e,
|
|
870
|
+
x: Math.max(i, Math.min(e, o)),
|
|
796
871
|
y: Math.max(i, Math.min(t, r))
|
|
797
872
|
};
|
|
798
873
|
}, this.onDragEnd = () => {
|
|
@@ -803,14 +878,14 @@ let w = class extends E {
|
|
|
803
878
|
return this.bar ?? null;
|
|
804
879
|
}
|
|
805
880
|
render() {
|
|
806
|
-
const
|
|
881
|
+
const n = this.mode !== "idle", e = this.commentCount + (this.hasOverallComment ? 1 : 0), t = e > 0, i = ae[this.barPosition], o = this.dragOffset ? `position:fixed;left:${this.dragOffset.x}px;top:${this.dragOffset.y}px;z-index:var(--review-z-index,9998);` : `position:fixed;${i.top ? `top:${i.top};` : ""}${i.bottom ? `bottom:${i.bottom};` : ""}${i.left ? `left:${i.left};` : ""}${i.right ? `right:${i.right};` : ""}${i.translateX ? `transform:translateX(${i.translateX});` : ""}z-index:var(--review-z-index,9998);`;
|
|
807
882
|
return v`<div
|
|
808
883
|
data-bar
|
|
809
884
|
class=${k(
|
|
810
885
|
"flex items-center gap-2 rounded-full border border-zinc-200 bg-white p-1 shadow-lg",
|
|
811
|
-
|
|
886
|
+
n && "ring-1 ring-zinc-400/20"
|
|
812
887
|
)}
|
|
813
|
-
style=${
|
|
888
|
+
style=${o}
|
|
814
889
|
>
|
|
815
890
|
<div
|
|
816
891
|
class="flex h-7 w-7 cursor-grab items-center justify-center text-zinc-400 active:cursor-grabbing"
|
|
@@ -820,19 +895,19 @@ let w = class extends E {
|
|
|
820
895
|
</div>
|
|
821
896
|
|
|
822
897
|
<label class="flex cursor-pointer items-center gap-2 px-1">
|
|
823
|
-
<span class=${k("select-none text-xs font-medium transition-colors duration-150",
|
|
898
|
+
<span class=${k("select-none text-xs font-medium transition-colors duration-150", n ? "text-zinc-900" : "text-zinc-500")}>Annotate</span>
|
|
824
899
|
<button
|
|
825
900
|
type="button"
|
|
826
901
|
role="switch"
|
|
827
|
-
aria-checked=${
|
|
902
|
+
aria-checked=${n ? "true" : "false"}
|
|
828
903
|
data-toggle
|
|
829
904
|
@click=${this.onToggle}
|
|
830
905
|
class=${k(
|
|
831
906
|
"relative inline-flex h-4 w-7 items-center rounded-full transition-colors",
|
|
832
|
-
|
|
907
|
+
n ? "bg-zinc-900" : "bg-zinc-300"
|
|
833
908
|
)}
|
|
834
909
|
>
|
|
835
|
-
<span class=${k("inline-block size-3 transform rounded-full bg-white transition-transform",
|
|
910
|
+
<span class=${k("inline-block size-3 transform rounded-full bg-white transition-transform", n ? "translate-x-3.5" : "translate-x-0.5")}></span>
|
|
836
911
|
</button>
|
|
837
912
|
</label>
|
|
838
913
|
|
|
@@ -904,15 +979,15 @@ y([
|
|
|
904
979
|
F("[data-bar]")
|
|
905
980
|
], w.prototype, "bar", 2);
|
|
906
981
|
y([
|
|
907
|
-
|
|
982
|
+
Mt()
|
|
908
983
|
], w.prototype, "dragOffset", 2);
|
|
909
984
|
w = y([
|
|
910
985
|
A("llumi-review-bar")
|
|
911
986
|
], w);
|
|
912
|
-
var
|
|
913
|
-
for (var
|
|
914
|
-
(a =
|
|
915
|
-
return i &&
|
|
987
|
+
var se = Object.defineProperty, le = Object.getOwnPropertyDescriptor, D = (n, e, t, i) => {
|
|
988
|
+
for (var o = i > 1 ? void 0 : i ? le(e, t) : e, r = n.length - 1, a; r >= 0; r--)
|
|
989
|
+
(a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
|
|
990
|
+
return i && o && se(e, t, o), o;
|
|
916
991
|
};
|
|
917
992
|
let S = class extends E {
|
|
918
993
|
constructor() {
|
|
@@ -920,8 +995,8 @@ let S = class extends E {
|
|
|
920
995
|
}
|
|
921
996
|
/** Focus the inner textarea (the element itself isn't focusable). */
|
|
922
997
|
focus() {
|
|
923
|
-
var
|
|
924
|
-
(
|
|
998
|
+
var n;
|
|
999
|
+
(n = this.textarea) == null || n.focus();
|
|
925
1000
|
}
|
|
926
1001
|
render() {
|
|
927
1002
|
return v`<textarea
|
|
@@ -932,8 +1007,8 @@ let S = class extends E {
|
|
|
932
1007
|
@input=${this.onInput}
|
|
933
1008
|
></textarea>`;
|
|
934
1009
|
}
|
|
935
|
-
onInput(
|
|
936
|
-
const e =
|
|
1010
|
+
onInput(n) {
|
|
1011
|
+
const e = n.target.value;
|
|
937
1012
|
this.autoGrow(), this.dispatchEvent(
|
|
938
1013
|
new CustomEvent("change", {
|
|
939
1014
|
detail: e,
|
|
@@ -943,8 +1018,8 @@ let S = class extends E {
|
|
|
943
1018
|
);
|
|
944
1019
|
}
|
|
945
1020
|
autoGrow() {
|
|
946
|
-
const
|
|
947
|
-
|
|
1021
|
+
const n = this.textarea;
|
|
1022
|
+
n && (n.style.height = "auto", n.style.height = `${n.scrollHeight}px`);
|
|
948
1023
|
}
|
|
949
1024
|
firstUpdated() {
|
|
950
1025
|
this.autoFocus && this.textarea.focus(), this.autoGrow();
|
|
@@ -968,29 +1043,29 @@ D([
|
|
|
968
1043
|
S = D([
|
|
969
1044
|
A("llumi-default-editor")
|
|
970
1045
|
], S);
|
|
971
|
-
var
|
|
972
|
-
for (var
|
|
973
|
-
(a =
|
|
974
|
-
return i &&
|
|
1046
|
+
var ce = Object.defineProperty, de = Object.getOwnPropertyDescriptor, K = (n, e, t, i) => {
|
|
1047
|
+
for (var o = i > 1 ? void 0 : i ? de(e, t) : e, r = n.length - 1, a; r >= 0; r--)
|
|
1048
|
+
(a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
|
|
1049
|
+
return i && o && ce(e, t, o), o;
|
|
975
1050
|
};
|
|
976
1051
|
let z = class extends E {
|
|
977
1052
|
constructor() {
|
|
978
1053
|
super(...arguments), this.targetElement = null, this.value = "";
|
|
979
1054
|
}
|
|
980
1055
|
render() {
|
|
981
|
-
const
|
|
1056
|
+
const n = this.value.trim().length > 0;
|
|
982
1057
|
return v`<div
|
|
983
1058
|
data-floating
|
|
984
1059
|
class="z-[calc(var(--review-z-index,9998)+1)]"
|
|
985
1060
|
style="position:absolute;top:0;left:0;"
|
|
986
1061
|
>
|
|
987
1062
|
<div
|
|
988
|
-
class=${
|
|
1063
|
+
class=${Pt({
|
|
989
1064
|
"relative w-[400px] rounded-lg border border-zinc-200 bg-white shadow-xl": !0,
|
|
990
1065
|
"animate-[llumi-fade-in_0.15s_ease-out]": !0
|
|
991
1066
|
})}
|
|
992
1067
|
>
|
|
993
|
-
${
|
|
1068
|
+
${n ? v`<button
|
|
994
1069
|
type="button"
|
|
995
1070
|
data-delete
|
|
996
1071
|
@click=${this.onDelete}
|
|
@@ -1007,84 +1082,84 @@ let z = class extends E {
|
|
|
1007
1082
|
</div>
|
|
1008
1083
|
</div>`;
|
|
1009
1084
|
}
|
|
1010
|
-
onEditorChange(
|
|
1011
|
-
if (typeof
|
|
1012
|
-
const e =
|
|
1013
|
-
|
|
1085
|
+
onEditorChange(n) {
|
|
1086
|
+
if (typeof n.detail != "string") return;
|
|
1087
|
+
const e = n.detail;
|
|
1088
|
+
n.stopPropagation(), this.dispatchEvent(
|
|
1014
1089
|
new CustomEvent("change", { detail: e, bubbles: !0, composed: !0 })
|
|
1015
1090
|
);
|
|
1016
1091
|
}
|
|
1017
|
-
onCancel(
|
|
1018
|
-
|
|
1092
|
+
onCancel(n) {
|
|
1093
|
+
n.stopPropagation(), this.dispatchEvent(
|
|
1019
1094
|
new CustomEvent("close", { bubbles: !0, composed: !0 })
|
|
1020
1095
|
);
|
|
1021
1096
|
}
|
|
1022
|
-
onDelete(
|
|
1023
|
-
|
|
1097
|
+
onDelete(n) {
|
|
1098
|
+
n.stopPropagation(), this.dispatchEvent(
|
|
1024
1099
|
new CustomEvent("delete", { bubbles: !0, composed: !0 })
|
|
1025
1100
|
);
|
|
1026
1101
|
}
|
|
1027
1102
|
startPositioning() {
|
|
1028
1103
|
var t;
|
|
1029
|
-
const
|
|
1030
|
-
!
|
|
1031
|
-
|
|
1104
|
+
const n = this.targetElement, e = this.floating;
|
|
1105
|
+
!n || !e || ((t = this.cleanup) == null || t.call(this), this.cleanup = vt(n, e, () => {
|
|
1106
|
+
wt(n, e, {
|
|
1032
1107
|
placement: "right",
|
|
1033
1108
|
middleware: [
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1109
|
+
bt(12),
|
|
1110
|
+
xt({ padding: 16 }),
|
|
1111
|
+
yt({ padding: 16, crossAxis: !0 }),
|
|
1112
|
+
Ct({
|
|
1038
1113
|
padding: 16,
|
|
1039
|
-
apply({ availableWidth: i, elements:
|
|
1040
|
-
Object.assign(
|
|
1114
|
+
apply({ availableWidth: i, elements: o }) {
|
|
1115
|
+
Object.assign(o.floating.style, {
|
|
1041
1116
|
maxWidth: `${Math.min(400, i)}px`
|
|
1042
1117
|
});
|
|
1043
1118
|
}
|
|
1044
1119
|
})
|
|
1045
1120
|
]
|
|
1046
|
-
}).then(({ x: i, y:
|
|
1047
|
-
Object.assign(e.style, { left: `${i}px`, top: `${
|
|
1121
|
+
}).then(({ x: i, y: o }) => {
|
|
1122
|
+
Object.assign(e.style, { left: `${i}px`, top: `${o}px` });
|
|
1048
1123
|
});
|
|
1049
1124
|
}));
|
|
1050
1125
|
}
|
|
1051
|
-
updated(
|
|
1052
|
-
|
|
1126
|
+
updated(n) {
|
|
1127
|
+
n.has("targetElement") && (this.startPositioning(), this.focusEditor());
|
|
1053
1128
|
}
|
|
1054
1129
|
focusEditor() {
|
|
1055
|
-
const
|
|
1130
|
+
const n = this.renderRoot.querySelector(
|
|
1056
1131
|
'slot[name="editor"]'
|
|
1057
|
-
), t = ((
|
|
1132
|
+
), t = ((n == null ? void 0 : n.assignedElements()) ?? [])[0] ?? this.renderRoot.querySelector("llumi-default-editor");
|
|
1058
1133
|
t == null || t.focus();
|
|
1059
1134
|
}
|
|
1060
1135
|
disconnectedCallback() {
|
|
1061
|
-
var
|
|
1062
|
-
super.disconnectedCallback(), (
|
|
1136
|
+
var n;
|
|
1137
|
+
super.disconnectedCallback(), (n = this.cleanup) == null || n.call(this), this.cleanup = void 0;
|
|
1063
1138
|
}
|
|
1064
1139
|
};
|
|
1065
|
-
|
|
1140
|
+
K([
|
|
1066
1141
|
f({ attribute: !1 })
|
|
1067
1142
|
], z.prototype, "targetElement", 2);
|
|
1068
|
-
|
|
1143
|
+
K([
|
|
1069
1144
|
f()
|
|
1070
1145
|
], z.prototype, "value", 2);
|
|
1071
|
-
|
|
1146
|
+
K([
|
|
1072
1147
|
F("[data-floating]")
|
|
1073
1148
|
], z.prototype, "floating", 2);
|
|
1074
|
-
z =
|
|
1149
|
+
z = K([
|
|
1075
1150
|
A("llumi-comment-dialog")
|
|
1076
1151
|
], z);
|
|
1077
|
-
var
|
|
1078
|
-
for (var
|
|
1079
|
-
(a =
|
|
1080
|
-
return i &&
|
|
1152
|
+
var he = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, X = (n, e, t, i) => {
|
|
1153
|
+
for (var o = i > 1 ? void 0 : i ? ge(e, t) : e, r = n.length - 1, a; r >= 0; r--)
|
|
1154
|
+
(a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
|
|
1155
|
+
return i && o && he(e, t, o), o;
|
|
1081
1156
|
};
|
|
1082
1157
|
let O = class extends E {
|
|
1083
1158
|
constructor() {
|
|
1084
|
-
super(...arguments), this.barElement = null, this.value = "", this.onDocKeydown = (
|
|
1085
|
-
|
|
1086
|
-
}, this.onDocPointerdown = (
|
|
1087
|
-
const e =
|
|
1159
|
+
super(...arguments), this.barElement = null, this.value = "", this.onDocKeydown = (n) => {
|
|
1160
|
+
n.key === "Escape" && (n.preventDefault(), this.emitClose());
|
|
1161
|
+
}, this.onDocPointerdown = (n) => {
|
|
1162
|
+
const e = n.composedPath();
|
|
1088
1163
|
this.floating && !e.includes(this.floating) && !e.includes(this) && this.emitClose();
|
|
1089
1164
|
};
|
|
1090
1165
|
}
|
|
@@ -1107,10 +1182,10 @@ let O = class extends E {
|
|
|
1107
1182
|
</div>
|
|
1108
1183
|
</div>`;
|
|
1109
1184
|
}
|
|
1110
|
-
onEditorChange(
|
|
1111
|
-
if (typeof
|
|
1112
|
-
const e =
|
|
1113
|
-
|
|
1185
|
+
onEditorChange(n) {
|
|
1186
|
+
if (typeof n.detail != "string") return;
|
|
1187
|
+
const e = n.detail;
|
|
1188
|
+
n.stopPropagation(), this.dispatchEvent(
|
|
1114
1189
|
new CustomEvent("change", { detail: e, bubbles: !0, composed: !0 })
|
|
1115
1190
|
);
|
|
1116
1191
|
}
|
|
@@ -1121,77 +1196,77 @@ let O = class extends E {
|
|
|
1121
1196
|
}
|
|
1122
1197
|
startPositioning() {
|
|
1123
1198
|
var t;
|
|
1124
|
-
const
|
|
1125
|
-
!
|
|
1126
|
-
|
|
1199
|
+
const n = this.barElement, e = this.floating;
|
|
1200
|
+
!n || !e || ((t = this.cleanup) == null || t.call(this), this.cleanup = vt(n, e, () => {
|
|
1201
|
+
wt(n, e, {
|
|
1127
1202
|
placement: "top",
|
|
1128
1203
|
middleware: [
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1204
|
+
bt(12),
|
|
1205
|
+
xt({ padding: 16 }),
|
|
1206
|
+
yt({ padding: 16, crossAxis: !0 }),
|
|
1207
|
+
Ct({
|
|
1133
1208
|
padding: 16,
|
|
1134
|
-
apply({ availableWidth: i, elements:
|
|
1135
|
-
Object.assign(
|
|
1209
|
+
apply({ availableWidth: i, elements: o }) {
|
|
1210
|
+
Object.assign(o.floating.style, {
|
|
1136
1211
|
maxWidth: `${Math.min(400, i)}px`
|
|
1137
1212
|
});
|
|
1138
1213
|
}
|
|
1139
1214
|
})
|
|
1140
1215
|
]
|
|
1141
|
-
}).then(({ x: i, y:
|
|
1142
|
-
Object.assign(e.style, { left: `${i}px`, top: `${
|
|
1216
|
+
}).then(({ x: i, y: o }) => {
|
|
1217
|
+
Object.assign(e.style, { left: `${i}px`, top: `${o}px` });
|
|
1143
1218
|
});
|
|
1144
1219
|
}));
|
|
1145
1220
|
}
|
|
1146
1221
|
connectedCallback() {
|
|
1147
1222
|
super.connectedCallback(), document.addEventListener("keydown", this.onDocKeydown), document.addEventListener("pointerdown", this.onDocPointerdown, !0);
|
|
1148
1223
|
}
|
|
1149
|
-
updated(
|
|
1150
|
-
|
|
1224
|
+
updated(n) {
|
|
1225
|
+
n.has("barElement") && this.startPositioning();
|
|
1151
1226
|
}
|
|
1152
1227
|
disconnectedCallback() {
|
|
1153
|
-
var
|
|
1154
|
-
super.disconnectedCallback(), (
|
|
1228
|
+
var n;
|
|
1229
|
+
super.disconnectedCallback(), (n = this.cleanup) == null || n.call(this), this.cleanup = void 0, document.removeEventListener("keydown", this.onDocKeydown), document.removeEventListener("pointerdown", this.onDocPointerdown, !0);
|
|
1155
1230
|
}
|
|
1156
1231
|
};
|
|
1157
|
-
|
|
1232
|
+
X([
|
|
1158
1233
|
f({ attribute: !1 })
|
|
1159
1234
|
], O.prototype, "barElement", 2);
|
|
1160
|
-
|
|
1235
|
+
X([
|
|
1161
1236
|
f()
|
|
1162
1237
|
], O.prototype, "value", 2);
|
|
1163
|
-
|
|
1238
|
+
X([
|
|
1164
1239
|
F("[data-floating]")
|
|
1165
1240
|
], O.prototype, "floating", 2);
|
|
1166
|
-
O =
|
|
1241
|
+
O = X([
|
|
1167
1242
|
A("llumi-overall-comment-dialog")
|
|
1168
1243
|
], O);
|
|
1169
|
-
var
|
|
1170
|
-
for (var
|
|
1171
|
-
(a =
|
|
1172
|
-
return i &&
|
|
1244
|
+
var ue = Object.defineProperty, me = Object.getOwnPropertyDescriptor, Et = (n, e, t, i) => {
|
|
1245
|
+
for (var o = i > 1 ? void 0 : i ? me(e, t) : e, r = n.length - 1, a; r >= 0; r--)
|
|
1246
|
+
(a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
|
|
1247
|
+
return i && o && ue(e, t, o), o;
|
|
1173
1248
|
};
|
|
1174
|
-
const
|
|
1175
|
-
let
|
|
1249
|
+
const pe = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23404040' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z'/%3E%3C/svg%3E";
|
|
1250
|
+
let ot = class extends E {
|
|
1176
1251
|
constructor() {
|
|
1177
1252
|
super(...arguments), this.positions = [];
|
|
1178
1253
|
}
|
|
1179
1254
|
render() {
|
|
1180
|
-
return v`${
|
|
1255
|
+
return v`${$t(
|
|
1181
1256
|
this.positions,
|
|
1182
|
-
(
|
|
1183
|
-
(
|
|
1257
|
+
(n) => n.commentId,
|
|
1258
|
+
(n) => v`<button
|
|
1184
1259
|
type="button"
|
|
1185
|
-
@click=${(e) => this.onClick(e,
|
|
1186
|
-
style=${
|
|
1260
|
+
@click=${(e) => this.onClick(e, n.commentId)}
|
|
1261
|
+
style=${Rt({
|
|
1187
1262
|
position: "absolute",
|
|
1188
|
-
top: `${
|
|
1189
|
-
left: `${
|
|
1263
|
+
top: `${n.top - 10}px`,
|
|
1264
|
+
left: `${n.left + 2}px`,
|
|
1190
1265
|
width: "20px",
|
|
1191
1266
|
height: "20px",
|
|
1192
1267
|
borderRadius: "50%",
|
|
1193
1268
|
backgroundColor: "white",
|
|
1194
|
-
backgroundImage: `url("${
|
|
1269
|
+
backgroundImage: `url("${pe}")`,
|
|
1195
1270
|
backgroundSize: "12px 12px",
|
|
1196
1271
|
backgroundRepeat: "no-repeat",
|
|
1197
1272
|
backgroundPosition: "center",
|
|
@@ -1204,8 +1279,8 @@ let it = class extends E {
|
|
|
1204
1279
|
></button>`
|
|
1205
1280
|
)}`;
|
|
1206
1281
|
}
|
|
1207
|
-
onClick(
|
|
1208
|
-
|
|
1282
|
+
onClick(n, e) {
|
|
1283
|
+
n.stopPropagation(), this.dispatchEvent(
|
|
1209
1284
|
new CustomEvent("icon-click", {
|
|
1210
1285
|
detail: e,
|
|
1211
1286
|
bubbles: !0,
|
|
@@ -1214,54 +1289,54 @@ let it = class extends E {
|
|
|
1214
1289
|
);
|
|
1215
1290
|
}
|
|
1216
1291
|
};
|
|
1217
|
-
|
|
1292
|
+
Et([
|
|
1218
1293
|
f({ attribute: !1 })
|
|
1219
|
-
],
|
|
1220
|
-
|
|
1294
|
+
], ot.prototype, "positions", 2);
|
|
1295
|
+
ot = Et([
|
|
1221
1296
|
A("llumi-selection-comment-icons")
|
|
1222
|
-
],
|
|
1223
|
-
const R = "data-review-selectable",
|
|
1224
|
-
let
|
|
1225
|
-
function
|
|
1226
|
-
if (
|
|
1227
|
-
if (document.querySelector(`style[${
|
|
1228
|
-
|
|
1297
|
+
], ot);
|
|
1298
|
+
const R = "data-review-selectable", Z = "review-selection-commented", tt = "review-selection-editing", L = "review-selection-hover", fe = "$mod+Shift+M", ft = "data-llumi-review";
|
|
1299
|
+
let et = !1;
|
|
1300
|
+
function ve() {
|
|
1301
|
+
if (et) return;
|
|
1302
|
+
if (document.querySelector(`style[${ft}]`)) {
|
|
1303
|
+
et = !0;
|
|
1229
1304
|
return;
|
|
1230
1305
|
}
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1306
|
+
const n = document.createElement("style");
|
|
1307
|
+
n.setAttribute(ft, ""), n.textContent = Gt, document.head.append(n), et = !0;
|
|
1233
1308
|
}
|
|
1234
1309
|
function H() {
|
|
1235
1310
|
if (!(typeof CSS > "u"))
|
|
1236
1311
|
return CSS.highlights;
|
|
1237
1312
|
}
|
|
1238
|
-
function
|
|
1313
|
+
function it(...n) {
|
|
1239
1314
|
return new Highlight(
|
|
1240
|
-
...
|
|
1315
|
+
...n
|
|
1241
1316
|
);
|
|
1242
1317
|
}
|
|
1243
|
-
const
|
|
1318
|
+
const st = class st extends HTMLElement {
|
|
1244
1319
|
constructor() {
|
|
1245
|
-
super(...arguments), this.manager = null, this.rangeMap = /* @__PURE__ */ new Map(), this.hoveredComment = null, this.selectionJustHandled = !1, this.selectionComments = [], this.commentDialog = null, this.overallDialog = null, this.onPointerUp = () => {
|
|
1320
|
+
super(...arguments), this.persistence = ut, this.manager = null, this.rangeMap = /* @__PURE__ */ new Map(), this.hoveredComment = null, this.selectionJustHandled = !1, this.selectionComments = [], this.commentDialog = null, this.overallDialog = null, this.onPointerUp = () => {
|
|
1246
1321
|
if (!this.isAnnotating()) return;
|
|
1247
1322
|
const e = window.getSelection();
|
|
1248
1323
|
if (!e || e.isCollapsed || e.rangeCount === 0)
|
|
1249
1324
|
return;
|
|
1250
|
-
const t = e.getRangeAt(0), i =
|
|
1325
|
+
const t = e.getRangeAt(0), i = Q(t.startContainer);
|
|
1251
1326
|
if (!i) return;
|
|
1252
|
-
const
|
|
1253
|
-
if (
|
|
1327
|
+
const o = Q(t.endContainer);
|
|
1328
|
+
if (o && o !== i) {
|
|
1254
1329
|
e.removeAllRanges();
|
|
1255
1330
|
return;
|
|
1256
1331
|
}
|
|
1257
|
-
if (!
|
|
1258
|
-
const s =
|
|
1332
|
+
if (!o || !Bt(e, i)) {
|
|
1333
|
+
const s = Yt(e, i);
|
|
1259
1334
|
if (!s) return;
|
|
1260
1335
|
e.removeAllRanges(), e.addRange(s);
|
|
1261
1336
|
}
|
|
1262
1337
|
const r = i.getAttribute(R);
|
|
1263
1338
|
if (!r) return;
|
|
1264
|
-
const a =
|
|
1339
|
+
const a = Vt(i);
|
|
1265
1340
|
a && (e.removeAllRanges(), this.selectionJustHandled = !0, this.actor.send({
|
|
1266
1341
|
type: "SELECT_TEXT",
|
|
1267
1342
|
targetId: r,
|
|
@@ -1277,18 +1352,18 @@ const rt = class rt extends HTMLElement {
|
|
|
1277
1352
|
this.hoveredComment && (t.delete(L), this.hoveredComment = null);
|
|
1278
1353
|
return;
|
|
1279
1354
|
}
|
|
1280
|
-
let
|
|
1355
|
+
let o = null;
|
|
1281
1356
|
for (const [r, a] of this.rangeMap)
|
|
1282
1357
|
if (a.isPointInRange(i.offsetNode, i.offset)) {
|
|
1283
|
-
|
|
1358
|
+
o = r;
|
|
1284
1359
|
break;
|
|
1285
1360
|
}
|
|
1286
|
-
if (
|
|
1287
|
-
if (this.hoveredComment =
|
|
1288
|
-
const r = this.rangeMap.get(
|
|
1361
|
+
if (o !== this.hoveredComment)
|
|
1362
|
+
if (this.hoveredComment = o, o) {
|
|
1363
|
+
const r = this.rangeMap.get(o);
|
|
1289
1364
|
r && t.set(
|
|
1290
1365
|
L,
|
|
1291
|
-
|
|
1366
|
+
it(r)
|
|
1292
1367
|
);
|
|
1293
1368
|
} else
|
|
1294
1369
|
t.delete(L);
|
|
@@ -1304,27 +1379,27 @@ const rt = class rt extends HTMLElement {
|
|
|
1304
1379
|
if (i) {
|
|
1305
1380
|
for (const [s, l] of this.rangeMap)
|
|
1306
1381
|
if (l.isPointInRange(i.offsetNode, i.offset)) {
|
|
1307
|
-
const
|
|
1382
|
+
const u = this.selectionComments.find(
|
|
1308
1383
|
(b) => b.commentId === s
|
|
1309
1384
|
);
|
|
1310
|
-
if (!m) continue;
|
|
1311
|
-
const u = Y(i.offsetNode);
|
|
1312
1385
|
if (!u) continue;
|
|
1386
|
+
const m = Q(i.offsetNode);
|
|
1387
|
+
if (!m) continue;
|
|
1313
1388
|
e.stopPropagation(), e.preventDefault(), this.actor.send({
|
|
1314
1389
|
type: "CLICK",
|
|
1315
|
-
targetId:
|
|
1316
|
-
element:
|
|
1390
|
+
targetId: u.targetId,
|
|
1391
|
+
element: m,
|
|
1317
1392
|
selectionCommentId: s
|
|
1318
1393
|
});
|
|
1319
1394
|
return;
|
|
1320
1395
|
}
|
|
1321
1396
|
}
|
|
1322
|
-
const
|
|
1397
|
+
const o = e.target, a = o.closest(
|
|
1323
1398
|
".review-highlight-hover, .review-highlight-commented, .review-highlight-editing"
|
|
1324
1399
|
);
|
|
1325
1400
|
if (a && this.contains(a)) {
|
|
1326
1401
|
e.stopPropagation(), e.preventDefault();
|
|
1327
|
-
const s = N(
|
|
1402
|
+
const s = N(o, this.customTargets);
|
|
1328
1403
|
s ? this.actor.send({
|
|
1329
1404
|
type: "CLICK",
|
|
1330
1405
|
targetId: s.targetId,
|
|
@@ -1342,12 +1417,12 @@ const rt = class rt extends HTMLElement {
|
|
|
1342
1417
|
}, this.onMouseOver = (e) => {
|
|
1343
1418
|
const t = this.manager;
|
|
1344
1419
|
if (!t || !this.isAnnotating()) return;
|
|
1345
|
-
const i = this.currentEditingTargetId(),
|
|
1420
|
+
const i = this.currentEditingTargetId(), o = N(
|
|
1346
1421
|
e.target,
|
|
1347
1422
|
this.customTargets
|
|
1348
1423
|
);
|
|
1349
|
-
if (
|
|
1350
|
-
t.applyHover(
|
|
1424
|
+
if (o) {
|
|
1425
|
+
t.applyHover(o.element, i);
|
|
1351
1426
|
return;
|
|
1352
1427
|
}
|
|
1353
1428
|
const r = e.target.closest(
|
|
@@ -1357,15 +1432,15 @@ const rt = class rt extends HTMLElement {
|
|
|
1357
1432
|
}, this.onMouseOut = (e) => {
|
|
1358
1433
|
const t = this.manager;
|
|
1359
1434
|
if (!t || !this.isAnnotating()) return;
|
|
1360
|
-
const i = this.currentEditingTargetId(),
|
|
1435
|
+
const i = this.currentEditingTargetId(), o = /* @__PURE__ */ new Set();
|
|
1361
1436
|
for (const s of this.actor.getSnapshot().context.comments)
|
|
1362
|
-
!s.selection && s.content.trim() &&
|
|
1437
|
+
!s.selection && s.content.trim() && o.add(s.targetId);
|
|
1363
1438
|
const r = N(
|
|
1364
1439
|
e.target,
|
|
1365
1440
|
this.customTargets
|
|
1366
1441
|
);
|
|
1367
1442
|
if (r) {
|
|
1368
|
-
t.clearHover(r.element, i,
|
|
1443
|
+
t.clearHover(r.element, i, o);
|
|
1369
1444
|
return;
|
|
1370
1445
|
}
|
|
1371
1446
|
const a = e.target.closest(
|
|
@@ -1375,7 +1450,7 @@ const rt = class rt extends HTMLElement {
|
|
|
1375
1450
|
};
|
|
1376
1451
|
}
|
|
1377
1452
|
get shortcut() {
|
|
1378
|
-
return this.getAttribute("shortcut") ??
|
|
1453
|
+
return this.getAttribute("shortcut") ?? fe;
|
|
1379
1454
|
}
|
|
1380
1455
|
get barPosition() {
|
|
1381
1456
|
return this.getAttribute("bar-position") ?? "bottom-center";
|
|
@@ -1383,46 +1458,65 @@ const rt = class rt extends HTMLElement {
|
|
|
1383
1458
|
get defaultMode() {
|
|
1384
1459
|
return this.getAttribute("default-mode") === "annotating" ? "annotating" : "idle";
|
|
1385
1460
|
}
|
|
1461
|
+
get persistKey() {
|
|
1462
|
+
const e = this.getAttribute("persist");
|
|
1463
|
+
return e != null && e.trim() ? e : null;
|
|
1464
|
+
}
|
|
1386
1465
|
connectedCallback() {
|
|
1387
|
-
|
|
1388
|
-
const e = this.buildHighlightCallbacks()
|
|
1389
|
-
this.
|
|
1466
|
+
ve(), this.style.position === "" && (this.style.position = "relative"), this.style.display === "" && (this.style.display = "block");
|
|
1467
|
+
const e = this.buildHighlightCallbacks();
|
|
1468
|
+
this.persistence = this.persistKey ? qt(this.persistKey) : ut;
|
|
1469
|
+
const t = Kt();
|
|
1470
|
+
this.actor = zt(t, {
|
|
1390
1471
|
input: {
|
|
1391
1472
|
shortcut: this.shortcut,
|
|
1392
1473
|
initialData: this.initialData,
|
|
1393
1474
|
defaultMode: this.defaultMode,
|
|
1394
|
-
highlights: e
|
|
1475
|
+
highlights: e,
|
|
1476
|
+
persistence: this.persistence
|
|
1395
1477
|
}
|
|
1396
|
-
}), this.actor.on(
|
|
1397
|
-
"REVIEW_CHANGED",
|
|
1398
|
-
(i) => this.emitResult("llumi-review-change", i.result)
|
|
1399
|
-
), this.actor.on(
|
|
1400
|
-
"REVIEW_SUBMITTED",
|
|
1401
|
-
(i) => this.emitResult("llumi-review-submit", i.result)
|
|
1402
|
-
), this.mountChrome(), this.actor.subscribe(() => this.syncFromSnapshot()), this.actor.start(), this.manager = Pt(this, this.customTargets), this.actor.send({ type: "MOUNTED" }), this.addEventListener("pointerup", this.onPointerUp), this.addEventListener("pointermove", this.onPointerMove), this.addEventListener("click", this.onClickCapture, !0), this.addEventListener("click", this.onWrapperClick), this.addEventListener("mouseover", this.onMouseOver), this.addEventListener("mouseout", this.onMouseOut), this.syncFromSnapshot();
|
|
1478
|
+
}), this.actor.on("REVIEW_CHANGED", (i) => this.emitChange(i.result)), this.actor.on("REVIEW_SUBMITTED", (i) => this.emitSubmit(i.result)), this.mountChrome(), this.actor.subscribe(() => this.syncFromSnapshot()), this.actor.start(), this.manager = Ht(this, this.customTargets), this.actor.send({ type: "MOUNTED" }), this.addEventListener("pointerup", this.onPointerUp), this.addEventListener("pointermove", this.onPointerMove), this.addEventListener("click", this.onClickCapture, !0), this.addEventListener("click", this.onWrapperClick), this.addEventListener("mouseover", this.onMouseOver), this.addEventListener("mouseout", this.onMouseOut), this.syncFromSnapshot();
|
|
1403
1479
|
}
|
|
1404
1480
|
disconnectedCallback() {
|
|
1405
|
-
var t, i,
|
|
1481
|
+
var t, i, o, r, a, s;
|
|
1406
1482
|
this.removeEventListener("pointerup", this.onPointerUp), this.removeEventListener("pointermove", this.onPointerMove), this.removeEventListener("click", this.onClickCapture, !0), this.removeEventListener("click", this.onWrapperClick), this.removeEventListener("mouseover", this.onMouseOver), this.removeEventListener("mouseout", this.onMouseOut);
|
|
1407
1483
|
const e = H();
|
|
1408
|
-
e && (e.delete(
|
|
1484
|
+
e && (e.delete(Z), e.delete(tt), e.delete(L)), this.icons && (this.icons.positions = []), (t = this.manager) == null || t.destroy(), this.manager = null, (i = this.actor) == null || i.stop(), (o = this.bar) == null || o.remove(), (r = this.commentDialog) == null || r.remove(), (a = this.overallDialog) == null || a.remove(), (s = this.icons) == null || s.remove();
|
|
1409
1485
|
}
|
|
1410
1486
|
attributeChangedCallback() {
|
|
1411
1487
|
this.bar && (this.bar.barPosition = this.barPosition);
|
|
1412
1488
|
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1489
|
+
buildDetailResult(e) {
|
|
1490
|
+
return e.status === "commented" ? {
|
|
1491
|
+
...e,
|
|
1492
|
+
comments: ee(e.comments, this)
|
|
1493
|
+
} : e;
|
|
1494
|
+
}
|
|
1495
|
+
emitChange(e) {
|
|
1496
|
+
this.dispatchEvent(
|
|
1497
|
+
new CustomEvent("llumi-review-change", {
|
|
1498
|
+
detail: this.buildDetailResult(e),
|
|
1499
|
+
bubbles: !0,
|
|
1500
|
+
composed: !0
|
|
1501
|
+
})
|
|
1502
|
+
);
|
|
1503
|
+
}
|
|
1504
|
+
emitSubmit(e) {
|
|
1505
|
+
this.dispatchEvent(
|
|
1506
|
+
new CustomEvent("llumi-review-submit", {
|
|
1507
|
+
detail: {
|
|
1508
|
+
result: this.buildDetailResult(e),
|
|
1509
|
+
clearPersisted: () => this.clearPersisted()
|
|
1510
|
+
},
|
|
1421
1511
|
bubbles: !0,
|
|
1422
1512
|
composed: !0
|
|
1423
1513
|
})
|
|
1424
1514
|
);
|
|
1425
1515
|
}
|
|
1516
|
+
/** Clears the persisted draft for this element. No-op when persistence is off. */
|
|
1517
|
+
clearPersisted() {
|
|
1518
|
+
this.persistence.clear();
|
|
1519
|
+
}
|
|
1426
1520
|
// --- chrome lifecycle ---
|
|
1427
1521
|
mountChrome() {
|
|
1428
1522
|
this.bar = document.createElement("llumi-review-bar"), this.bar.barPosition = this.barPosition, this.bar.addEventListener(
|
|
@@ -1444,7 +1538,7 @@ const rt = class rt extends HTMLElement {
|
|
|
1444
1538
|
), document.body.append(this.icons);
|
|
1445
1539
|
}
|
|
1446
1540
|
onIconClick(e) {
|
|
1447
|
-
const t = this.actor.getSnapshot().context.comments.find((
|
|
1541
|
+
const t = this.actor.getSnapshot().context.comments.find((o) => o.commentId === e);
|
|
1448
1542
|
if (!t) return;
|
|
1449
1543
|
const i = this.querySelector(
|
|
1450
1544
|
`[${R}="${t.targetId}"]`
|
|
@@ -1458,12 +1552,12 @@ const rt = class rt extends HTMLElement {
|
|
|
1458
1552
|
}
|
|
1459
1553
|
// --- snapshot → UI sync (replaces review.component.tsx render) ---
|
|
1460
1554
|
syncFromSnapshot() {
|
|
1461
|
-
const e = this.actor.getSnapshot(), { comments: t, overallComment: i, editingCommentId:
|
|
1555
|
+
const e = this.actor.getSnapshot(), { comments: t, overallComment: i, editingCommentId: o, targetElement: r } = e.context;
|
|
1462
1556
|
this.selectionComments = t.filter(
|
|
1463
1557
|
(g) => g.selection && g.content.trim()
|
|
1464
1558
|
);
|
|
1465
|
-
const a = !e.matches({ annotating: "inactive" }), s = e.matches({ commenting: "editing" }), l =
|
|
1466
|
-
this.bar.mode = a ? l ? "editing" : "commenting" : "idle", this.bar.commentCount =
|
|
1559
|
+
const a = !e.matches({ annotating: "inactive" }), s = e.matches({ commenting: "editing" }), l = o ? t.find((g) => g.commentId === o) : null, u = s && o === null, m = t.filter((g) => g.content.trim()).length, b = i.trim().length > 0;
|
|
1560
|
+
this.bar.mode = a ? l ? "editing" : "commenting" : "idle", this.bar.commentCount = m, this.bar.hasOverallComment = b, this.bar.overallCommentOpen = u, this.icons.style.display = a ? "" : "none", s && l && r ? (this.commentDialog || (this.commentDialog = document.createElement(
|
|
1467
1561
|
"llumi-comment-dialog"
|
|
1468
1562
|
), this.commentDialog.addEventListener(
|
|
1469
1563
|
"change",
|
|
@@ -1477,7 +1571,7 @@ const rt = class rt extends HTMLElement {
|
|
|
1477
1571
|
), this.commentDialog.addEventListener(
|
|
1478
1572
|
"close",
|
|
1479
1573
|
() => this.actor.send({ type: "CLOSE" })
|
|
1480
|
-
), document.body.append(this.commentDialog)), this.commentDialog.targetElement = r, this.commentDialog.value = l.content) : this.commentDialog && (this.commentDialog.remove(), this.commentDialog = null),
|
|
1574
|
+
), document.body.append(this.commentDialog)), this.commentDialog.targetElement = r, this.commentDialog.value = l.content) : this.commentDialog && (this.commentDialog.remove(), this.commentDialog = null), u ? (this.overallDialog || (this.overallDialog = document.createElement(
|
|
1481
1575
|
"llumi-overall-comment-dialog"
|
|
1482
1576
|
), this.overallDialog.addEventListener(
|
|
1483
1577
|
"change",
|
|
@@ -1507,7 +1601,7 @@ const rt = class rt extends HTMLElement {
|
|
|
1507
1601
|
if (!e) return;
|
|
1508
1602
|
e.deactivate(), e.stopObserving();
|
|
1509
1603
|
const t = H();
|
|
1510
|
-
t && (t.delete(
|
|
1604
|
+
t && (t.delete(Z), t.delete(tt), t.delete(L)), this.rangeMap.clear(), this.icons.positions = [];
|
|
1511
1605
|
},
|
|
1512
1606
|
reveal: (e) => {
|
|
1513
1607
|
var t;
|
|
@@ -1531,17 +1625,17 @@ const rt = class rt extends HTMLElement {
|
|
|
1531
1625
|
updateSelectionHighlights() {
|
|
1532
1626
|
const e = H();
|
|
1533
1627
|
if (!e) return;
|
|
1534
|
-
const t =
|
|
1628
|
+
const t = it(), i = it(), o = /* @__PURE__ */ new Map(), r = [], a = this.actor.getSnapshot().context;
|
|
1535
1629
|
for (const l of this.selectionComments) {
|
|
1536
1630
|
if (!l.selection) continue;
|
|
1537
|
-
const
|
|
1631
|
+
const u = this.querySelector(
|
|
1538
1632
|
`[${R}="${l.targetId}"]`
|
|
1539
1633
|
);
|
|
1540
|
-
if (!m) continue;
|
|
1541
|
-
const u = gt(m, l.selection);
|
|
1542
1634
|
if (!u) continue;
|
|
1543
|
-
|
|
1544
|
-
|
|
1635
|
+
const m = mt(u, l.selection);
|
|
1636
|
+
if (!m) continue;
|
|
1637
|
+
o.set(l.commentId, m), l.commentId === a.editingCommentId ? i.add(m) : t.add(m);
|
|
1638
|
+
const b = m.getClientRects(), g = b[b.length - 1];
|
|
1545
1639
|
g && r.push({
|
|
1546
1640
|
commentId: l.commentId,
|
|
1547
1641
|
top: g.top + window.scrollY,
|
|
@@ -1549,24 +1643,24 @@ const rt = class rt extends HTMLElement {
|
|
|
1549
1643
|
});
|
|
1550
1644
|
}
|
|
1551
1645
|
const s = a.editingCommentId;
|
|
1552
|
-
if (s && !
|
|
1646
|
+
if (s && !o.has(s)) {
|
|
1553
1647
|
const l = a.comments.find(
|
|
1554
|
-
(
|
|
1648
|
+
(u) => u.commentId === s
|
|
1555
1649
|
);
|
|
1556
1650
|
if (l != null && l.selection) {
|
|
1557
|
-
const
|
|
1651
|
+
const u = this.querySelector(
|
|
1558
1652
|
`[${R}="${l.targetId}"]`
|
|
1559
1653
|
);
|
|
1560
|
-
if (
|
|
1561
|
-
const
|
|
1562
|
-
|
|
1654
|
+
if (u) {
|
|
1655
|
+
const m = mt(u, l.selection);
|
|
1656
|
+
m && i.add(m);
|
|
1563
1657
|
}
|
|
1564
1658
|
}
|
|
1565
1659
|
}
|
|
1566
|
-
this.rangeMap =
|
|
1567
|
-
|
|
1660
|
+
this.rangeMap = o, e.set(
|
|
1661
|
+
Z,
|
|
1568
1662
|
t
|
|
1569
|
-
), e.set(
|
|
1663
|
+
), e.set(tt, i), this.icons.positions = r;
|
|
1570
1664
|
}
|
|
1571
1665
|
isAnnotating() {
|
|
1572
1666
|
return !this.actor.getSnapshot().matches({ annotating: "inactive" });
|
|
@@ -1588,14 +1682,14 @@ const rt = class rt extends HTMLElement {
|
|
|
1588
1682
|
return ((t = e.comments.find((i) => i.commentId === e.editingCommentId)) == null ? void 0 : t.targetId) ?? void 0;
|
|
1589
1683
|
}
|
|
1590
1684
|
};
|
|
1591
|
-
|
|
1592
|
-
let
|
|
1593
|
-
customElements.get("llumi-review") || customElements.define("llumi-review",
|
|
1685
|
+
st.observedAttributes = ["bar-position", "shortcut", "default-mode"];
|
|
1686
|
+
let rt = st;
|
|
1687
|
+
customElements.get("llumi-review") || customElements.define("llumi-review", rt);
|
|
1594
1688
|
export {
|
|
1595
1689
|
z as LlumiCommentDialog,
|
|
1596
1690
|
S as LlumiDefaultEditor,
|
|
1597
1691
|
O as LlumiOverallCommentDialog,
|
|
1598
|
-
|
|
1692
|
+
rt as LlumiReview,
|
|
1599
1693
|
w as LlumiReviewBar,
|
|
1600
|
-
|
|
1694
|
+
ot as LlumiSelectionCommentIcons
|
|
1601
1695
|
};
|