@llumi/design-system 0.1.0 → 1.0.1
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 +117 -9
- package/dist/review.cjs +30 -30
- package/dist/review.js +30 -30
- package/dist/review.mjs +544 -435
- package/dist/types/components/review/comment-dialog.element.d.ts +8 -0
- package/dist/types/components/review/review.element.d.ts +14 -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 +50 -51
package/dist/review.mjs
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { fromCallback as
|
|
2
|
-
import { tinykeys as
|
|
3
|
-
import { svg as
|
|
4
|
-
import { property as f, query as
|
|
5
|
-
import { clsx as
|
|
6
|
-
import { twMerge as
|
|
7
|
-
import { autoUpdate as
|
|
8
|
-
import { classMap as
|
|
9
|
-
import { repeat as
|
|
1
|
+
import { fromCallback as dt, setup as Tt, emit as ht, assign as x, stateIn as kt, enqueueActions as zt, createActor as Lt } from "xstate";
|
|
2
|
+
import { tinykeys as Ot } from "tinykeys";
|
|
3
|
+
import { svg as N, html as v, LitElement as At, unsafeCSS as Dt } from "lit";
|
|
4
|
+
import { property as f, query as K, 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 Rt } from "lit/directives/repeat.js";
|
|
10
10
|
import { styleMap as $t } from "lit/directives/style-map.js";
|
|
11
|
-
function
|
|
12
|
-
const t =
|
|
11
|
+
function gt(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
|
|
22
|
-
const t =
|
|
21
|
+
function P(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 R(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,125 +61,125 @@ 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 ot = "review-highlight-hover", C = "review-highlight-commented", j = "review-highlight-editing", U = "review-highlight-uncommented", V = "review-target", ut = "review-active";
|
|
74
|
+
function B(n) {
|
|
75
|
+
n.classList.remove(
|
|
76
|
+
ot,
|
|
77
77
|
C,
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
j,
|
|
79
|
+
U
|
|
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 =
|
|
87
|
-
for (const { element: p, targetId: d, kind:
|
|
88
|
-
(
|
|
85
|
+
n.classList.add(ut);
|
|
86
|
+
const h = R(n, e);
|
|
87
|
+
for (const { element: p, targetId: d, kind: k } of h)
|
|
88
|
+
(k === "element" || k === "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(ut), t && (clearTimeout(t), t = null);
|
|
92
|
+
const c = R(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 = R(n, e), p = [];
|
|
98
98
|
for (const { element: d } of h)
|
|
99
|
-
!d.classList.contains(C) && !d.classList.contains(
|
|
99
|
+
!d.classList.contains(C) && !d.classList.contains(j) && (d.classList.add(U), p.push(d));
|
|
100
100
|
c && (t && clearTimeout(t), t = setTimeout(() => {
|
|
101
101
|
t = null;
|
|
102
102
|
for (const d of p)
|
|
103
|
-
d.classList.contains(
|
|
103
|
+
d.classList.contains(j) || d.classList.remove(U);
|
|
104
104
|
}, 500));
|
|
105
105
|
}
|
|
106
106
|
function l() {
|
|
107
107
|
t && (clearTimeout(t), t = null);
|
|
108
|
-
const c =
|
|
108
|
+
const c = R(n, e);
|
|
109
109
|
for (const { element: h } of c)
|
|
110
|
-
h.classList.remove(
|
|
111
|
-
}
|
|
112
|
-
function m(c, h) {
|
|
113
|
-
h || (B(c), c.classList.add(G));
|
|
110
|
+
h.classList.remove(U);
|
|
114
111
|
}
|
|
115
112
|
function u(c, h) {
|
|
113
|
+
h || (B(c), c.classList.add(j));
|
|
114
|
+
}
|
|
115
|
+
function m(c, h) {
|
|
116
116
|
B(c), h && c.classList.add(C);
|
|
117
117
|
}
|
|
118
118
|
function b(c, h) {
|
|
119
|
-
(
|
|
119
|
+
(gt(c, e) ?? c.getAttribute("data-review-selectable")) !== h && c.classList.add(ot);
|
|
120
120
|
}
|
|
121
121
|
function g(c, h, p) {
|
|
122
|
-
const d =
|
|
123
|
-
d !== h && (c.classList.remove(
|
|
122
|
+
const d = gt(c, e) ?? c.getAttribute("data-review-selectable");
|
|
123
|
+
d !== h && (c.classList.remove(ot), 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;
|
|
134
|
-
const
|
|
134
|
+
const k = [
|
|
135
135
|
...d.matches("[data-review-id]") ? [d] : [],
|
|
136
136
|
...Array.from(
|
|
137
137
|
d.querySelectorAll("[data-review-id]")
|
|
138
138
|
)
|
|
139
139
|
];
|
|
140
|
-
for (const I of
|
|
141
|
-
const
|
|
142
|
-
|
|
140
|
+
for (const I of k) {
|
|
141
|
+
const _ = I.getAttribute("data-review-id");
|
|
142
|
+
_ && c.commentedIds.has(_) && I.classList.add(C);
|
|
143
143
|
}
|
|
144
144
|
for (const I of e ?? []) {
|
|
145
|
-
const
|
|
145
|
+
const _ = [
|
|
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 _) {
|
|
150
|
+
const ct = I.toId(W);
|
|
151
|
+
W.classList.add(V), ct && c.commentedIds.has(ct) && 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 = dt(
|
|
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 = dt(({ 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: ht(({ 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: ht(({ 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: zt(({ 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 mt = {
|
|
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 Q(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 Z(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
|
|
737
|
-
return
|
|
811
|
+
function z(...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
|
-
const
|
|
754
|
-
check:
|
|
755
|
-
gripVertical:
|
|
756
|
-
|
|
828
|
+
const F = {
|
|
829
|
+
check: $(N`<path d="M20 6 9 17l-5-5" />`),
|
|
830
|
+
gripVertical: $(
|
|
831
|
+
N`<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:
|
|
759
|
-
|
|
833
|
+
messageSquare: $(
|
|
834
|
+
N`<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:
|
|
762
|
-
|
|
836
|
+
trash: $(
|
|
837
|
+
N`<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-4>:not(:last-child)){--tw-space-y-reverse:0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}: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)}}:host{--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}@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), st = class st extends At {
|
|
765
840
|
};
|
|
766
|
-
|
|
767
|
-
let E =
|
|
768
|
-
var
|
|
769
|
-
for (var
|
|
770
|
-
(a =
|
|
771
|
-
return i &&
|
|
841
|
+
st.styles = ne;
|
|
842
|
+
let E = st;
|
|
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,36 +878,36 @@ 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
|
-
class=${
|
|
884
|
+
class=${z(
|
|
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"
|
|
817
892
|
@pointerdown=${this.onDragStart}
|
|
818
893
|
>
|
|
819
|
-
<span class="size-3">${
|
|
894
|
+
<span class="size-3">${F.gripVertical}</span>
|
|
820
895
|
</div>
|
|
821
896
|
|
|
822
897
|
<label class="flex cursor-pointer items-center gap-2 px-1">
|
|
823
|
-
<span class=${
|
|
898
|
+
<span class=${z("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
|
-
class=${
|
|
905
|
+
class=${z(
|
|
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=${
|
|
910
|
+
<span class=${z("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
|
|
|
@@ -842,13 +917,13 @@ let w = class extends E {
|
|
|
842
917
|
type="button"
|
|
843
918
|
data-overall
|
|
844
919
|
@click=${this.onOverallToggle}
|
|
845
|
-
class=${
|
|
920
|
+
class=${z(
|
|
846
921
|
"relative flex h-7 items-center gap-1.5 rounded-full px-3 text-xs font-medium",
|
|
847
922
|
this.hasOverallComment ? "bg-zinc-900 text-white hover:bg-zinc-800 active:bg-zinc-950" : this.overallCommentOpen ? "bg-zinc-100 hover:bg-zinc-200" : "border border-zinc-200 hover:bg-zinc-50"
|
|
848
923
|
)}
|
|
849
924
|
>
|
|
850
925
|
Comment
|
|
851
|
-
<span class="size-3.5">${
|
|
926
|
+
<span class="size-3.5">${F.messageSquare}</span>
|
|
852
927
|
</button>
|
|
853
928
|
|
|
854
929
|
<div class="h-4 w-px bg-zinc-200"></div>
|
|
@@ -861,7 +936,7 @@ let w = class extends E {
|
|
|
861
936
|
>
|
|
862
937
|
${t ? "Submit" : "Approve"}
|
|
863
938
|
<span class="flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-white/25 px-1 text-[11px] font-semibold">
|
|
864
|
-
${t ? e : v`<span class="size-3">${
|
|
939
|
+
${t ? e : v`<span class="size-3">${F.check}</span>`}
|
|
865
940
|
</span>
|
|
866
941
|
</button>
|
|
867
942
|
</div>`;
|
|
@@ -901,18 +976,18 @@ y([
|
|
|
901
976
|
f()
|
|
902
977
|
], w.prototype, "barPosition", 2);
|
|
903
978
|
y([
|
|
904
|
-
|
|
979
|
+
K("[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();
|
|
@@ -963,40 +1038,40 @@ D([
|
|
|
963
1038
|
f()
|
|
964
1039
|
], S.prototype, "placeholder", 2);
|
|
965
1040
|
D([
|
|
966
|
-
|
|
1041
|
+
K("textarea")
|
|
967
1042
|
], S.prototype, "textarea", 2);
|
|
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, M = (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
|
-
let
|
|
1051
|
+
let T = class extends E {
|
|
977
1052
|
constructor() {
|
|
978
|
-
super(...arguments), this.targetElement = null, this.value = "";
|
|
1053
|
+
super(...arguments), this.targetElement = null, this.anchor = 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}
|
|
997
1072
|
class="group absolute top-2 right-2 z-10 flex items-center gap-1 rounded-md px-1.5 py-1 text-zinc-400 transition-all duration-150 hover:bg-zinc-900 hover:text-white"
|
|
998
1073
|
>
|
|
999
|
-
<span class="size-3.5">${
|
|
1074
|
+
<span class="size-3.5">${F.trash}</span>
|
|
1000
1075
|
<span class="max-w-0 overflow-hidden text-xs transition-all duration-150 group-hover:max-w-[60px]">Delete</span>
|
|
1001
1076
|
</button>` : null}
|
|
1002
1077
|
<div class="p-3" @change=${this.onEditorChange} @cancel=${this.onCancel} @delete=${this.onDelete}>
|
|
@@ -1007,84 +1082,87 @@ 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.anchor ?? 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
|
+
M([
|
|
1066
1141
|
f({ attribute: !1 })
|
|
1067
|
-
],
|
|
1068
|
-
|
|
1142
|
+
], T.prototype, "targetElement", 2);
|
|
1143
|
+
M([
|
|
1144
|
+
f({ attribute: !1 })
|
|
1145
|
+
], T.prototype, "anchor", 2);
|
|
1146
|
+
M([
|
|
1069
1147
|
f()
|
|
1070
|
-
],
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
],
|
|
1074
|
-
|
|
1148
|
+
], T.prototype, "value", 2);
|
|
1149
|
+
M([
|
|
1150
|
+
K("[data-floating]")
|
|
1151
|
+
], T.prototype, "floating", 2);
|
|
1152
|
+
T = M([
|
|
1075
1153
|
A("llumi-comment-dialog")
|
|
1076
|
-
],
|
|
1077
|
-
var
|
|
1078
|
-
for (var
|
|
1079
|
-
(a =
|
|
1080
|
-
return i &&
|
|
1154
|
+
], T);
|
|
1155
|
+
var he = Object.defineProperty, ge = Object.getOwnPropertyDescriptor, X = (n, e, t, i) => {
|
|
1156
|
+
for (var o = i > 1 ? void 0 : i ? ge(e, t) : e, r = n.length - 1, a; r >= 0; r--)
|
|
1157
|
+
(a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
|
|
1158
|
+
return i && o && he(e, t, o), o;
|
|
1081
1159
|
};
|
|
1082
1160
|
let O = class extends E {
|
|
1083
1161
|
constructor() {
|
|
1084
|
-
super(...arguments), this.barElement = null, this.value = "", this.onDocKeydown = (
|
|
1085
|
-
|
|
1086
|
-
}, this.onDocPointerdown = (
|
|
1087
|
-
const e =
|
|
1162
|
+
super(...arguments), this.barElement = null, this.value = "", this.onDocKeydown = (n) => {
|
|
1163
|
+
n.key === "Escape" && (n.preventDefault(), this.emitClose());
|
|
1164
|
+
}, this.onDocPointerdown = (n) => {
|
|
1165
|
+
const e = n.composedPath();
|
|
1088
1166
|
this.floating && !e.includes(this.floating) && !e.includes(this) && this.emitClose();
|
|
1089
1167
|
};
|
|
1090
1168
|
}
|
|
@@ -1107,10 +1185,10 @@ let O = class extends E {
|
|
|
1107
1185
|
</div>
|
|
1108
1186
|
</div>`;
|
|
1109
1187
|
}
|
|
1110
|
-
onEditorChange(
|
|
1111
|
-
if (typeof
|
|
1112
|
-
const e =
|
|
1113
|
-
|
|
1188
|
+
onEditorChange(n) {
|
|
1189
|
+
if (typeof n.detail != "string") return;
|
|
1190
|
+
const e = n.detail;
|
|
1191
|
+
n.stopPropagation(), this.dispatchEvent(
|
|
1114
1192
|
new CustomEvent("change", { detail: e, bubbles: !0, composed: !0 })
|
|
1115
1193
|
);
|
|
1116
1194
|
}
|
|
@@ -1121,77 +1199,77 @@ let O = class extends E {
|
|
|
1121
1199
|
}
|
|
1122
1200
|
startPositioning() {
|
|
1123
1201
|
var t;
|
|
1124
|
-
const
|
|
1125
|
-
!
|
|
1126
|
-
|
|
1202
|
+
const n = this.barElement, e = this.floating;
|
|
1203
|
+
!n || !e || ((t = this.cleanup) == null || t.call(this), this.cleanup = vt(n, e, () => {
|
|
1204
|
+
wt(n, e, {
|
|
1127
1205
|
placement: "top",
|
|
1128
1206
|
middleware: [
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1207
|
+
bt(12),
|
|
1208
|
+
xt({ padding: 16 }),
|
|
1209
|
+
yt({ padding: 16, crossAxis: !0 }),
|
|
1210
|
+
Ct({
|
|
1133
1211
|
padding: 16,
|
|
1134
|
-
apply({ availableWidth: i, elements:
|
|
1135
|
-
Object.assign(
|
|
1212
|
+
apply({ availableWidth: i, elements: o }) {
|
|
1213
|
+
Object.assign(o.floating.style, {
|
|
1136
1214
|
maxWidth: `${Math.min(400, i)}px`
|
|
1137
1215
|
});
|
|
1138
1216
|
}
|
|
1139
1217
|
})
|
|
1140
1218
|
]
|
|
1141
|
-
}).then(({ x: i, y:
|
|
1142
|
-
Object.assign(e.style, { left: `${i}px`, top: `${
|
|
1219
|
+
}).then(({ x: i, y: o }) => {
|
|
1220
|
+
Object.assign(e.style, { left: `${i}px`, top: `${o}px` });
|
|
1143
1221
|
});
|
|
1144
1222
|
}));
|
|
1145
1223
|
}
|
|
1146
1224
|
connectedCallback() {
|
|
1147
1225
|
super.connectedCallback(), document.addEventListener("keydown", this.onDocKeydown), document.addEventListener("pointerdown", this.onDocPointerdown, !0);
|
|
1148
1226
|
}
|
|
1149
|
-
updated(
|
|
1150
|
-
|
|
1227
|
+
updated(n) {
|
|
1228
|
+
n.has("barElement") && this.startPositioning();
|
|
1151
1229
|
}
|
|
1152
1230
|
disconnectedCallback() {
|
|
1153
|
-
var
|
|
1154
|
-
super.disconnectedCallback(), (
|
|
1231
|
+
var n;
|
|
1232
|
+
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
1233
|
}
|
|
1156
1234
|
};
|
|
1157
|
-
|
|
1235
|
+
X([
|
|
1158
1236
|
f({ attribute: !1 })
|
|
1159
1237
|
], O.prototype, "barElement", 2);
|
|
1160
|
-
|
|
1238
|
+
X([
|
|
1161
1239
|
f()
|
|
1162
1240
|
], O.prototype, "value", 2);
|
|
1163
|
-
|
|
1164
|
-
|
|
1241
|
+
X([
|
|
1242
|
+
K("[data-floating]")
|
|
1165
1243
|
], O.prototype, "floating", 2);
|
|
1166
|
-
O =
|
|
1244
|
+
O = X([
|
|
1167
1245
|
A("llumi-overall-comment-dialog")
|
|
1168
1246
|
], O);
|
|
1169
|
-
var
|
|
1170
|
-
for (var
|
|
1171
|
-
(a =
|
|
1172
|
-
return i &&
|
|
1247
|
+
var ue = Object.defineProperty, me = Object.getOwnPropertyDescriptor, Et = (n, e, t, i) => {
|
|
1248
|
+
for (var o = i > 1 ? void 0 : i ? me(e, t) : e, r = n.length - 1, a; r >= 0; r--)
|
|
1249
|
+
(a = n[r]) && (o = (i ? a(e, t, o) : a(o)) || o);
|
|
1250
|
+
return i && o && ue(e, t, o), o;
|
|
1173
1251
|
};
|
|
1174
|
-
const
|
|
1175
|
-
let
|
|
1252
|
+
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";
|
|
1253
|
+
let rt = class extends E {
|
|
1176
1254
|
constructor() {
|
|
1177
1255
|
super(...arguments), this.positions = [];
|
|
1178
1256
|
}
|
|
1179
1257
|
render() {
|
|
1180
|
-
return v`${
|
|
1258
|
+
return v`${Rt(
|
|
1181
1259
|
this.positions,
|
|
1182
|
-
(
|
|
1183
|
-
(
|
|
1260
|
+
(n) => n.commentId,
|
|
1261
|
+
(n) => v`<button
|
|
1184
1262
|
type="button"
|
|
1185
|
-
@click=${(e) => this.onClick(e,
|
|
1263
|
+
@click=${(e) => this.onClick(e, n.commentId)}
|
|
1186
1264
|
style=${$t({
|
|
1187
1265
|
position: "absolute",
|
|
1188
|
-
top: `${
|
|
1189
|
-
left: `${
|
|
1266
|
+
top: `${n.top - 10}px`,
|
|
1267
|
+
left: `${n.left + 2}px`,
|
|
1190
1268
|
width: "20px",
|
|
1191
1269
|
height: "20px",
|
|
1192
1270
|
borderRadius: "50%",
|
|
1193
1271
|
backgroundColor: "white",
|
|
1194
|
-
backgroundImage: `url("${
|
|
1272
|
+
backgroundImage: `url("${pe}")`,
|
|
1195
1273
|
backgroundSize: "12px 12px",
|
|
1196
1274
|
backgroundRepeat: "no-repeat",
|
|
1197
1275
|
backgroundPosition: "center",
|
|
@@ -1204,8 +1282,8 @@ let it = class extends E {
|
|
|
1204
1282
|
></button>`
|
|
1205
1283
|
)}`;
|
|
1206
1284
|
}
|
|
1207
|
-
onClick(
|
|
1208
|
-
|
|
1285
|
+
onClick(n, e) {
|
|
1286
|
+
n.stopPropagation(), this.dispatchEvent(
|
|
1209
1287
|
new CustomEvent("icon-click", {
|
|
1210
1288
|
detail: e,
|
|
1211
1289
|
bubbles: !0,
|
|
@@ -1214,54 +1292,54 @@ let it = class extends E {
|
|
|
1214
1292
|
);
|
|
1215
1293
|
}
|
|
1216
1294
|
};
|
|
1217
|
-
|
|
1295
|
+
Et([
|
|
1218
1296
|
f({ attribute: !1 })
|
|
1219
|
-
],
|
|
1220
|
-
|
|
1297
|
+
], rt.prototype, "positions", 2);
|
|
1298
|
+
rt = Et([
|
|
1221
1299
|
A("llumi-selection-comment-icons")
|
|
1222
|
-
],
|
|
1223
|
-
const
|
|
1224
|
-
let
|
|
1225
|
-
function
|
|
1226
|
-
if (
|
|
1227
|
-
if (document.querySelector(`style[${
|
|
1228
|
-
|
|
1300
|
+
], rt);
|
|
1301
|
+
const H = "data-review-selectable", tt = "review-selection-commented", et = "review-selection-editing", L = "review-selection-hover", fe = "$mod+Shift+M", ft = "data-llumi-review";
|
|
1302
|
+
let it = !1;
|
|
1303
|
+
function ve() {
|
|
1304
|
+
if (it) return;
|
|
1305
|
+
if (document.querySelector(`style[${ft}]`)) {
|
|
1306
|
+
it = !0;
|
|
1229
1307
|
return;
|
|
1230
1308
|
}
|
|
1231
|
-
const
|
|
1232
|
-
|
|
1309
|
+
const n = document.createElement("style");
|
|
1310
|
+
n.setAttribute(ft, ""), n.textContent = Gt, document.head.append(n), it = !0;
|
|
1233
1311
|
}
|
|
1234
|
-
function
|
|
1312
|
+
function G() {
|
|
1235
1313
|
if (!(typeof CSS > "u"))
|
|
1236
1314
|
return CSS.highlights;
|
|
1237
1315
|
}
|
|
1238
|
-
function
|
|
1316
|
+
function nt(...n) {
|
|
1239
1317
|
return new Highlight(
|
|
1240
|
-
...
|
|
1318
|
+
...n
|
|
1241
1319
|
);
|
|
1242
1320
|
}
|
|
1243
|
-
const
|
|
1321
|
+
const lt = class lt extends HTMLElement {
|
|
1244
1322
|
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 = () => {
|
|
1323
|
+
super(...arguments), this.persistence = mt, this.manager = null, this.rangeMap = /* @__PURE__ */ new Map(), this.hoveredComment = null, this.selectionJustHandled = !1, this.selectionComments = [], this.commentDialog = null, this.commentDialogAnchorId = null, this.overallDialog = null, this.onPointerUp = () => {
|
|
1246
1324
|
if (!this.isAnnotating()) return;
|
|
1247
1325
|
const e = window.getSelection();
|
|
1248
1326
|
if (!e || e.isCollapsed || e.rangeCount === 0)
|
|
1249
1327
|
return;
|
|
1250
|
-
const t = e.getRangeAt(0), i =
|
|
1328
|
+
const t = e.getRangeAt(0), i = Z(t.startContainer);
|
|
1251
1329
|
if (!i) return;
|
|
1252
|
-
const
|
|
1253
|
-
if (
|
|
1330
|
+
const o = Z(t.endContainer);
|
|
1331
|
+
if (o && o !== i) {
|
|
1254
1332
|
e.removeAllRanges();
|
|
1255
1333
|
return;
|
|
1256
1334
|
}
|
|
1257
|
-
if (!
|
|
1258
|
-
const s =
|
|
1335
|
+
if (!o || !Bt(e, i)) {
|
|
1336
|
+
const s = Yt(e, i);
|
|
1259
1337
|
if (!s) return;
|
|
1260
1338
|
e.removeAllRanges(), e.addRange(s);
|
|
1261
1339
|
}
|
|
1262
|
-
const r = i.getAttribute(
|
|
1340
|
+
const r = i.getAttribute(H);
|
|
1263
1341
|
if (!r) return;
|
|
1264
|
-
const a =
|
|
1342
|
+
const a = Vt(i);
|
|
1265
1343
|
a && (e.removeAllRanges(), this.selectionJustHandled = !0, this.actor.send({
|
|
1266
1344
|
type: "SELECT_TEXT",
|
|
1267
1345
|
targetId: r,
|
|
@@ -1270,25 +1348,25 @@ const rt = class rt extends HTMLElement {
|
|
|
1270
1348
|
}));
|
|
1271
1349
|
}, this.onPointerMove = (e) => {
|
|
1272
1350
|
if (!this.isAnnotating()) return;
|
|
1273
|
-
const t =
|
|
1351
|
+
const t = G();
|
|
1274
1352
|
if (!t) return;
|
|
1275
1353
|
const i = this.caretPosition(e.clientX, e.clientY);
|
|
1276
1354
|
if (!i) {
|
|
1277
1355
|
this.hoveredComment && (t.delete(L), this.hoveredComment = null);
|
|
1278
1356
|
return;
|
|
1279
1357
|
}
|
|
1280
|
-
let
|
|
1358
|
+
let o = null;
|
|
1281
1359
|
for (const [r, a] of this.rangeMap)
|
|
1282
1360
|
if (a.isPointInRange(i.offsetNode, i.offset)) {
|
|
1283
|
-
|
|
1361
|
+
o = r;
|
|
1284
1362
|
break;
|
|
1285
1363
|
}
|
|
1286
|
-
if (
|
|
1287
|
-
if (this.hoveredComment =
|
|
1288
|
-
const r = this.rangeMap.get(
|
|
1364
|
+
if (o !== this.hoveredComment)
|
|
1365
|
+
if (this.hoveredComment = o, o) {
|
|
1366
|
+
const r = this.rangeMap.get(o);
|
|
1289
1367
|
r && t.set(
|
|
1290
1368
|
L,
|
|
1291
|
-
|
|
1369
|
+
nt(r)
|
|
1292
1370
|
);
|
|
1293
1371
|
} else
|
|
1294
1372
|
t.delete(L);
|
|
@@ -1304,27 +1382,27 @@ const rt = class rt extends HTMLElement {
|
|
|
1304
1382
|
if (i) {
|
|
1305
1383
|
for (const [s, l] of this.rangeMap)
|
|
1306
1384
|
if (l.isPointInRange(i.offsetNode, i.offset)) {
|
|
1307
|
-
const
|
|
1385
|
+
const u = this.selectionComments.find(
|
|
1308
1386
|
(b) => b.commentId === s
|
|
1309
1387
|
);
|
|
1310
|
-
if (!m) continue;
|
|
1311
|
-
const u = Y(i.offsetNode);
|
|
1312
1388
|
if (!u) continue;
|
|
1389
|
+
const m = Z(i.offsetNode);
|
|
1390
|
+
if (!m) continue;
|
|
1313
1391
|
e.stopPropagation(), e.preventDefault(), this.actor.send({
|
|
1314
1392
|
type: "CLICK",
|
|
1315
|
-
targetId:
|
|
1316
|
-
element:
|
|
1393
|
+
targetId: u.targetId,
|
|
1394
|
+
element: m,
|
|
1317
1395
|
selectionCommentId: s
|
|
1318
1396
|
});
|
|
1319
1397
|
return;
|
|
1320
1398
|
}
|
|
1321
1399
|
}
|
|
1322
|
-
const
|
|
1400
|
+
const o = e.target, a = o.closest(
|
|
1323
1401
|
".review-highlight-hover, .review-highlight-commented, .review-highlight-editing"
|
|
1324
1402
|
);
|
|
1325
1403
|
if (a && this.contains(a)) {
|
|
1326
1404
|
e.stopPropagation(), e.preventDefault();
|
|
1327
|
-
const s =
|
|
1405
|
+
const s = P(o, this.customTargets);
|
|
1328
1406
|
s ? this.actor.send({
|
|
1329
1407
|
type: "CLICK",
|
|
1330
1408
|
targetId: s.targetId,
|
|
@@ -1333,7 +1411,7 @@ const rt = class rt extends HTMLElement {
|
|
|
1333
1411
|
}
|
|
1334
1412
|
}, this.onWrapperClick = (e) => {
|
|
1335
1413
|
if (!this.contains(e.target) || !this.isAnnotating()) return;
|
|
1336
|
-
const t =
|
|
1414
|
+
const t = P(e.target, this.customTargets);
|
|
1337
1415
|
t ? (e.stopPropagation(), e.preventDefault(), this.actor.send({
|
|
1338
1416
|
type: "CLICK",
|
|
1339
1417
|
targetId: t.targetId,
|
|
@@ -1342,12 +1420,12 @@ const rt = class rt extends HTMLElement {
|
|
|
1342
1420
|
}, this.onMouseOver = (e) => {
|
|
1343
1421
|
const t = this.manager;
|
|
1344
1422
|
if (!t || !this.isAnnotating()) return;
|
|
1345
|
-
const i = this.currentEditingTargetId(),
|
|
1423
|
+
const i = this.currentEditingTargetId(), o = P(
|
|
1346
1424
|
e.target,
|
|
1347
1425
|
this.customTargets
|
|
1348
1426
|
);
|
|
1349
|
-
if (
|
|
1350
|
-
t.applyHover(
|
|
1427
|
+
if (o) {
|
|
1428
|
+
t.applyHover(o.element, i);
|
|
1351
1429
|
return;
|
|
1352
1430
|
}
|
|
1353
1431
|
const r = e.target.closest(
|
|
@@ -1357,15 +1435,15 @@ const rt = class rt extends HTMLElement {
|
|
|
1357
1435
|
}, this.onMouseOut = (e) => {
|
|
1358
1436
|
const t = this.manager;
|
|
1359
1437
|
if (!t || !this.isAnnotating()) return;
|
|
1360
|
-
const i = this.currentEditingTargetId(),
|
|
1438
|
+
const i = this.currentEditingTargetId(), o = /* @__PURE__ */ new Set();
|
|
1361
1439
|
for (const s of this.actor.getSnapshot().context.comments)
|
|
1362
|
-
!s.selection && s.content.trim() &&
|
|
1363
|
-
const r =
|
|
1440
|
+
!s.selection && s.content.trim() && o.add(s.targetId);
|
|
1441
|
+
const r = P(
|
|
1364
1442
|
e.target,
|
|
1365
1443
|
this.customTargets
|
|
1366
1444
|
);
|
|
1367
1445
|
if (r) {
|
|
1368
|
-
t.clearHover(r.element, i,
|
|
1446
|
+
t.clearHover(r.element, i, o);
|
|
1369
1447
|
return;
|
|
1370
1448
|
}
|
|
1371
1449
|
const a = e.target.closest(
|
|
@@ -1375,7 +1453,7 @@ const rt = class rt extends HTMLElement {
|
|
|
1375
1453
|
};
|
|
1376
1454
|
}
|
|
1377
1455
|
get shortcut() {
|
|
1378
|
-
return this.getAttribute("shortcut") ??
|
|
1456
|
+
return this.getAttribute("shortcut") ?? fe;
|
|
1379
1457
|
}
|
|
1380
1458
|
get barPosition() {
|
|
1381
1459
|
return this.getAttribute("bar-position") ?? "bottom-center";
|
|
@@ -1383,46 +1461,77 @@ const rt = class rt extends HTMLElement {
|
|
|
1383
1461
|
get defaultMode() {
|
|
1384
1462
|
return this.getAttribute("default-mode") === "annotating" ? "annotating" : "idle";
|
|
1385
1463
|
}
|
|
1464
|
+
get persistKey() {
|
|
1465
|
+
const e = this.getAttribute("persist");
|
|
1466
|
+
return e != null && e.trim() ? e : null;
|
|
1467
|
+
}
|
|
1386
1468
|
connectedCallback() {
|
|
1387
|
-
|
|
1388
|
-
const e = this.buildHighlightCallbacks()
|
|
1389
|
-
this.
|
|
1469
|
+
ve(), this.style.position === "" && (this.style.position = "relative"), this.style.display === "" && (this.style.display = "block");
|
|
1470
|
+
const e = this.buildHighlightCallbacks();
|
|
1471
|
+
this.persistence = this.persistKey ? qt(this.persistKey) : mt;
|
|
1472
|
+
const t = Kt();
|
|
1473
|
+
this.actor = Lt(t, {
|
|
1390
1474
|
input: {
|
|
1391
1475
|
shortcut: this.shortcut,
|
|
1392
1476
|
initialData: this.initialData,
|
|
1393
1477
|
defaultMode: this.defaultMode,
|
|
1394
|
-
highlights: e
|
|
1478
|
+
highlights: e,
|
|
1479
|
+
persistence: this.persistence
|
|
1395
1480
|
}
|
|
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();
|
|
1481
|
+
}), 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
1482
|
}
|
|
1404
1483
|
disconnectedCallback() {
|
|
1405
|
-
var t, i,
|
|
1484
|
+
var t, i, o, r, a, s;
|
|
1406
1485
|
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
|
-
const e =
|
|
1408
|
-
e && (e.delete(
|
|
1486
|
+
const e = G();
|
|
1487
|
+
e && (e.delete(tt), e.delete(et), 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
1488
|
}
|
|
1410
1489
|
attributeChangedCallback() {
|
|
1411
1490
|
this.bar && (this.bar.barPosition = this.barPosition);
|
|
1412
1491
|
}
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1492
|
+
buildDetailResult(e) {
|
|
1493
|
+
return e.status === "commented" ? {
|
|
1494
|
+
...e,
|
|
1495
|
+
comments: ee(e.comments, this)
|
|
1496
|
+
} : e;
|
|
1497
|
+
}
|
|
1498
|
+
emitChange(e) {
|
|
1499
|
+
this.dispatchEvent(
|
|
1500
|
+
new CustomEvent("llumi-review-change", {
|
|
1501
|
+
detail: this.buildDetailResult(e),
|
|
1421
1502
|
bubbles: !0,
|
|
1422
1503
|
composed: !0
|
|
1423
1504
|
})
|
|
1424
1505
|
);
|
|
1425
1506
|
}
|
|
1507
|
+
emitSubmit(e) {
|
|
1508
|
+
this.dispatchEvent(
|
|
1509
|
+
new CustomEvent("llumi-review-submit", {
|
|
1510
|
+
detail: {
|
|
1511
|
+
result: this.buildDetailResult(e),
|
|
1512
|
+
clearPersisted: () => this.clearPersisted()
|
|
1513
|
+
},
|
|
1514
|
+
bubbles: !0,
|
|
1515
|
+
composed: !0
|
|
1516
|
+
})
|
|
1517
|
+
);
|
|
1518
|
+
}
|
|
1519
|
+
/** Clears the persisted draft for this element. No-op when persistence is off. */
|
|
1520
|
+
clearPersisted() {
|
|
1521
|
+
this.persistence.clear();
|
|
1522
|
+
}
|
|
1523
|
+
// Build a floating-ui virtual reference that tracks a selection's live rect.
|
|
1524
|
+
// `contextElement` lets autoUpdate find the right scroll ancestors. Returns
|
|
1525
|
+
// null when the range can't be restored, so the dialog falls back to anchoring
|
|
1526
|
+
// on the whole element.
|
|
1527
|
+
selectionAnchor(e, t) {
|
|
1528
|
+
const i = Q(e, t);
|
|
1529
|
+
return i ? {
|
|
1530
|
+
getBoundingClientRect: () => i.getBoundingClientRect(),
|
|
1531
|
+
getClientRects: () => i.getClientRects(),
|
|
1532
|
+
contextElement: e
|
|
1533
|
+
} : null;
|
|
1534
|
+
}
|
|
1426
1535
|
// --- chrome lifecycle ---
|
|
1427
1536
|
mountChrome() {
|
|
1428
1537
|
this.bar = document.createElement("llumi-review-bar"), this.bar.barPosition = this.barPosition, this.bar.addEventListener(
|
|
@@ -1444,10 +1553,10 @@ const rt = class rt extends HTMLElement {
|
|
|
1444
1553
|
), document.body.append(this.icons);
|
|
1445
1554
|
}
|
|
1446
1555
|
onIconClick(e) {
|
|
1447
|
-
const t = this.actor.getSnapshot().context.comments.find((
|
|
1556
|
+
const t = this.actor.getSnapshot().context.comments.find((o) => o.commentId === e);
|
|
1448
1557
|
if (!t) return;
|
|
1449
1558
|
const i = this.querySelector(
|
|
1450
|
-
`[${
|
|
1559
|
+
`[${H}="${t.targetId}"]`
|
|
1451
1560
|
);
|
|
1452
1561
|
i && this.actor.send({
|
|
1453
1562
|
type: "CLICK",
|
|
@@ -1458,12 +1567,12 @@ const rt = class rt extends HTMLElement {
|
|
|
1458
1567
|
}
|
|
1459
1568
|
// --- snapshot → UI sync (replaces review.component.tsx render) ---
|
|
1460
1569
|
syncFromSnapshot() {
|
|
1461
|
-
const e = this.actor.getSnapshot(), { comments: t, overallComment: i, editingCommentId:
|
|
1570
|
+
const e = this.actor.getSnapshot(), { comments: t, overallComment: i, editingCommentId: o, targetElement: r } = e.context;
|
|
1462
1571
|
this.selectionComments = t.filter(
|
|
1463
1572
|
(g) => g.selection && g.content.trim()
|
|
1464
1573
|
);
|
|
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 =
|
|
1574
|
+
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;
|
|
1575
|
+
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
1576
|
"llumi-comment-dialog"
|
|
1468
1577
|
), this.commentDialog.addEventListener(
|
|
1469
1578
|
"change",
|
|
@@ -1477,7 +1586,7 @@ const rt = class rt extends HTMLElement {
|
|
|
1477
1586
|
), this.commentDialog.addEventListener(
|
|
1478
1587
|
"close",
|
|
1479
1588
|
() => 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),
|
|
1589
|
+
), document.body.append(this.commentDialog)), l.commentId !== this.commentDialogAnchorId && (this.commentDialogAnchorId = l.commentId, this.commentDialog.anchor = l.selection ? this.selectionAnchor(r, l.selection) : null, this.commentDialog.targetElement = r), this.commentDialog.value = l.content) : this.commentDialog && (this.commentDialog.remove(), this.commentDialog = null, this.commentDialogAnchorId = null), u ? (this.overallDialog || (this.overallDialog = document.createElement(
|
|
1481
1590
|
"llumi-overall-comment-dialog"
|
|
1482
1591
|
), this.overallDialog.addEventListener(
|
|
1483
1592
|
"change",
|
|
@@ -1506,8 +1615,8 @@ const rt = class rt extends HTMLElement {
|
|
|
1506
1615
|
const e = this.manager;
|
|
1507
1616
|
if (!e) return;
|
|
1508
1617
|
e.deactivate(), e.stopObserving();
|
|
1509
|
-
const t =
|
|
1510
|
-
t && (t.delete(
|
|
1618
|
+
const t = G();
|
|
1619
|
+
t && (t.delete(tt), t.delete(et), t.delete(L)), this.rangeMap.clear(), this.icons.positions = [];
|
|
1511
1620
|
},
|
|
1512
1621
|
reveal: (e) => {
|
|
1513
1622
|
var t;
|
|
@@ -1529,19 +1638,19 @@ const rt = class rt extends HTMLElement {
|
|
|
1529
1638
|
}
|
|
1530
1639
|
// --- selection highlight painting (port of updateSelectionHighlights) ---
|
|
1531
1640
|
updateSelectionHighlights() {
|
|
1532
|
-
const e =
|
|
1641
|
+
const e = G();
|
|
1533
1642
|
if (!e) return;
|
|
1534
|
-
const t =
|
|
1643
|
+
const t = nt(), i = nt(), o = /* @__PURE__ */ new Map(), r = [], a = this.actor.getSnapshot().context;
|
|
1535
1644
|
for (const l of this.selectionComments) {
|
|
1536
1645
|
if (!l.selection) continue;
|
|
1537
|
-
const
|
|
1538
|
-
`[${
|
|
1646
|
+
const u = this.querySelector(
|
|
1647
|
+
`[${H}="${l.targetId}"]`
|
|
1539
1648
|
);
|
|
1540
|
-
if (!m) continue;
|
|
1541
|
-
const u = gt(m, l.selection);
|
|
1542
1649
|
if (!u) continue;
|
|
1543
|
-
|
|
1544
|
-
|
|
1650
|
+
const m = Q(u, l.selection);
|
|
1651
|
+
if (!m) continue;
|
|
1652
|
+
o.set(l.commentId, m), l.commentId === a.editingCommentId ? i.add(m) : t.add(m);
|
|
1653
|
+
const b = m.getClientRects(), g = b[b.length - 1];
|
|
1545
1654
|
g && r.push({
|
|
1546
1655
|
commentId: l.commentId,
|
|
1547
1656
|
top: g.top + window.scrollY,
|
|
@@ -1549,24 +1658,24 @@ const rt = class rt extends HTMLElement {
|
|
|
1549
1658
|
});
|
|
1550
1659
|
}
|
|
1551
1660
|
const s = a.editingCommentId;
|
|
1552
|
-
if (s && !
|
|
1661
|
+
if (s && !o.has(s)) {
|
|
1553
1662
|
const l = a.comments.find(
|
|
1554
|
-
(
|
|
1663
|
+
(u) => u.commentId === s
|
|
1555
1664
|
);
|
|
1556
1665
|
if (l != null && l.selection) {
|
|
1557
|
-
const
|
|
1558
|
-
`[${
|
|
1666
|
+
const u = this.querySelector(
|
|
1667
|
+
`[${H}="${l.targetId}"]`
|
|
1559
1668
|
);
|
|
1560
|
-
if (
|
|
1561
|
-
const
|
|
1562
|
-
|
|
1669
|
+
if (u) {
|
|
1670
|
+
const m = Q(u, l.selection);
|
|
1671
|
+
m && i.add(m);
|
|
1563
1672
|
}
|
|
1564
1673
|
}
|
|
1565
1674
|
}
|
|
1566
|
-
this.rangeMap =
|
|
1567
|
-
|
|
1675
|
+
this.rangeMap = o, e.set(
|
|
1676
|
+
tt,
|
|
1568
1677
|
t
|
|
1569
|
-
), e.set(
|
|
1678
|
+
), e.set(et, i), this.icons.positions = r;
|
|
1570
1679
|
}
|
|
1571
1680
|
isAnnotating() {
|
|
1572
1681
|
return !this.actor.getSnapshot().matches({ annotating: "inactive" });
|
|
@@ -1588,14 +1697,14 @@ const rt = class rt extends HTMLElement {
|
|
|
1588
1697
|
return ((t = e.comments.find((i) => i.commentId === e.editingCommentId)) == null ? void 0 : t.targetId) ?? void 0;
|
|
1589
1698
|
}
|
|
1590
1699
|
};
|
|
1591
|
-
|
|
1592
|
-
let
|
|
1593
|
-
customElements.get("llumi-review") || customElements.define("llumi-review",
|
|
1700
|
+
lt.observedAttributes = ["bar-position", "shortcut", "default-mode"];
|
|
1701
|
+
let at = lt;
|
|
1702
|
+
customElements.get("llumi-review") || customElements.define("llumi-review", at);
|
|
1594
1703
|
export {
|
|
1595
|
-
|
|
1704
|
+
T as LlumiCommentDialog,
|
|
1596
1705
|
S as LlumiDefaultEditor,
|
|
1597
1706
|
O as LlumiOverallCommentDialog,
|
|
1598
|
-
|
|
1707
|
+
at as LlumiReview,
|
|
1599
1708
|
w as LlumiReviewBar,
|
|
1600
|
-
|
|
1709
|
+
rt as LlumiSelectionCommentIcons
|
|
1601
1710
|
};
|