@llumi/design-system 1.0.1 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +51 -0
- package/NOTICE +66 -0
- package/README.md +15 -205
- package/custom-elements.json +1135 -18
- package/dist/LICENSE +51 -0
- package/dist/NOTICE +66 -0
- package/dist/README.md +29 -0
- package/dist/adopt-global-styles-DykTxdm8.js +15 -0
- package/dist/base.css +2 -0
- package/dist/base.md +59 -0
- package/dist/bpmn.md +113 -0
- package/dist/bpmn.mjs +5076 -0
- package/dist/copy-button.md +128 -0
- package/dist/copy-button.mjs +161 -0
- package/dist/download-button.md +106 -0
- package/dist/download-button.mjs +177 -0
- package/dist/highlighter.md +45 -0
- package/dist/highlighter.mjs +403 -0
- package/dist/icon-button-BeLaqJmK.js +5 -0
- package/dist/icons-DBLWcA83.js +42 -0
- package/dist/index-elWLeWLs.js +7733 -0
- package/dist/llumi-element-DTeRDxao.js +22 -0
- package/dist/mermaid.md +58 -0
- package/dist/mermaid.mjs +254 -0
- package/dist/review.md +141 -0
- package/dist/review.mjs +1030 -696
- package/dist/slot-text-DW3pDxNK.js +51 -0
- package/dist/theme.css +2 -0
- package/package.json +73 -49
- package/dist/review.cjs +0 -172
- package/dist/review.css +0 -98
- package/dist/review.js +0 -172
- package/dist/types/components/review/comment-dialog.element.d.ts +0 -29
- package/dist/types/components/review/custom-target.utils.d.ts +0 -16
- package/dist/types/components/review/default-editor.element.d.ts +0 -19
- package/dist/types/components/review/highlight-manager.d.ts +0 -21
- package/dist/types/components/review/index.d.ts +0 -8
- package/dist/types/components/review/overall-comment-dialog.element.d.ts +0 -22
- package/dist/types/components/review/review-bar.element.d.ts +0 -26
- package/dist/types/components/review/review.element.d.ts +0 -60
- package/dist/types/components/review/review.machine.d.ts +0 -234
- package/dist/types/components/review/review.persistence.d.ts +0 -16
- package/dist/types/components/review/review.type.d.ts +0 -37
- package/dist/types/components/review/selection-comment-icons.element.d.ts +0 -17
- package/dist/types/components/review/selection-range.utils.d.ts +0 -6
- package/dist/types/components/review/sort-comments.utils.d.ts +0 -6
- package/dist/types/index.d.ts +0 -1
- package/dist/types/shared/cn.d.ts +0 -2
- package/dist/types/shared/icons.d.ts +0 -7
- package/dist/types/shared/tailwind-element.d.ts +0 -4
package/dist/review.mjs
CHANGED
|
@@ -1,185 +1,187 @@
|
|
|
1
|
-
import { fromCallback as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { fromCallback as rt, setup as xt, emit as st, assign as E, stateIn as yt, enqueueActions as It, createActor as St } from "https://cdn.jsdelivr.net/npm/xstate@5.32.2";
|
|
2
|
+
import { a as Tt } from "./adopt-global-styles-DykTxdm8.js";
|
|
3
|
+
import { tinykeys as Lt } from "https://cdn.jsdelivr.net/npm/tinykeys@3.1.0";
|
|
4
|
+
import { html as w, css as F } from "https://cdn.jsdelivr.net/npm/lit@3.3.3";
|
|
5
|
+
import { property as v, query as U, state as Ot, customElement as k } from "https://cdn.jsdelivr.net/npm/lit@3.3.3/decorators.js";
|
|
6
|
+
import { classMap as A } from "https://cdn.jsdelivr.net/npm/lit@3.3.3/directives/class-map.js";
|
|
7
|
+
import { i as M } from "./icons-DBLWcA83.js";
|
|
8
|
+
import { L as C } from "./llumi-element-DTeRDxao.js";
|
|
9
|
+
import { autoUpdate as gt, computePosition as ut, offset as pt, flip as ft, shift as vt, size as bt } from "https://cdn.jsdelivr.net/npm/@floating-ui/dom@1.7.6";
|
|
10
|
+
import { repeat as At } from "https://cdn.jsdelivr.net/npm/lit@3.3.3/directives/repeat.js";
|
|
11
|
+
import { styleMap as Dt } from "https://cdn.jsdelivr.net/npm/lit@3.3.3/directives/style-map.js";
|
|
12
|
+
/*! @llumi/design-system v2.0.0 | (c) 2026 pAIrprog SAS | license: https://cdn.jsdelivr.net/npm/@llumi/design-system@2.0.0/LICENSE | bundled third-party components under MIT, see NOTICE | @license */
|
|
13
|
+
function at(o, e) {
|
|
14
|
+
const t = o.getAttribute("data-review-id");
|
|
13
15
|
if (t) return t;
|
|
14
|
-
for (const
|
|
15
|
-
if (
|
|
16
|
-
const
|
|
17
|
-
if (
|
|
16
|
+
for (const n of e ?? [])
|
|
17
|
+
if (o.matches(n.selector)) {
|
|
18
|
+
const i = n.toId(o);
|
|
19
|
+
if (i) return i;
|
|
18
20
|
}
|
|
19
21
|
return null;
|
|
20
22
|
}
|
|
21
|
-
function
|
|
22
|
-
const t =
|
|
23
|
+
function _(o, e) {
|
|
24
|
+
const t = o.closest("[data-review-id]");
|
|
23
25
|
if (t) {
|
|
24
|
-
const
|
|
25
|
-
if (
|
|
26
|
-
}
|
|
27
|
-
for (const
|
|
28
|
-
const
|
|
29
|
-
if (
|
|
30
|
-
const r =
|
|
31
|
-
if (r) return { element:
|
|
26
|
+
const n = t.getAttribute("data-review-id");
|
|
27
|
+
if (n) return { element: t, targetId: n };
|
|
28
|
+
}
|
|
29
|
+
for (const n of e ?? []) {
|
|
30
|
+
const i = o.closest(n.selector);
|
|
31
|
+
if (i) {
|
|
32
|
+
const r = n.toId(i);
|
|
33
|
+
if (r) return { element: i, targetId: r };
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
return null;
|
|
35
37
|
}
|
|
36
|
-
function
|
|
37
|
-
const t = /* @__PURE__ */ new Set(),
|
|
38
|
-
for (const
|
|
39
|
-
|
|
38
|
+
function D(o, e) {
|
|
39
|
+
const t = /* @__PURE__ */ new Set(), n = [];
|
|
40
|
+
for (const i of Array.from(
|
|
41
|
+
o.querySelectorAll("[data-review-id]")
|
|
40
42
|
)) {
|
|
41
|
-
const r =
|
|
43
|
+
const r = i.getAttribute("data-review-id");
|
|
42
44
|
if (!r) continue;
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
element:
|
|
45
|
+
const s = i.hasAttribute("data-review-selectable");
|
|
46
|
+
n.push({
|
|
47
|
+
element: i,
|
|
46
48
|
targetId: r,
|
|
47
|
-
kind:
|
|
48
|
-
}), t.add(
|
|
49
|
+
kind: s ? "both" : "element"
|
|
50
|
+
}), t.add(i);
|
|
49
51
|
}
|
|
50
|
-
for (const
|
|
52
|
+
for (const i of e ?? [])
|
|
51
53
|
for (const r of Array.from(
|
|
52
|
-
|
|
54
|
+
o.querySelectorAll(i.selector)
|
|
53
55
|
)) {
|
|
54
56
|
if (t.has(r)) continue;
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
57
|
-
const
|
|
58
|
-
|
|
57
|
+
const s = i.toId(r);
|
|
58
|
+
if (!s) continue;
|
|
59
|
+
const a = r.hasAttribute("data-review-selectable");
|
|
60
|
+
n.push({
|
|
59
61
|
element: r,
|
|
60
|
-
targetId:
|
|
61
|
-
kind:
|
|
62
|
+
targetId: s,
|
|
63
|
+
kind: a ? "both" : "element"
|
|
62
64
|
}), t.add(r);
|
|
63
65
|
}
|
|
64
|
-
for (const
|
|
65
|
-
|
|
66
|
+
for (const i of Array.from(
|
|
67
|
+
o.querySelectorAll("[data-review-selectable]")
|
|
66
68
|
)) {
|
|
67
|
-
if (t.has(
|
|
68
|
-
const r =
|
|
69
|
-
r && (
|
|
69
|
+
if (t.has(i)) continue;
|
|
70
|
+
const r = i.getAttribute("data-review-selectable");
|
|
71
|
+
r && (n.push({ element: i, targetId: r, kind: "selectable" }), t.add(i));
|
|
70
72
|
}
|
|
71
|
-
return
|
|
73
|
+
return n;
|
|
72
74
|
}
|
|
73
|
-
const
|
|
74
|
-
function
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
const J = "review-highlight-hover", y = "review-highlight-commented", $ = "review-highlight-editing", H = "review-highlight-uncommented", j = "review-target", lt = "review-active";
|
|
76
|
+
function q(o) {
|
|
77
|
+
o.classList.remove(
|
|
78
|
+
J,
|
|
79
|
+
y,
|
|
80
|
+
$,
|
|
81
|
+
H
|
|
80
82
|
);
|
|
81
83
|
}
|
|
82
|
-
function
|
|
83
|
-
let t = null,
|
|
84
|
+
function kt(o, e) {
|
|
85
|
+
let t = null, n = null, i = null;
|
|
84
86
|
function r(c) {
|
|
85
|
-
|
|
86
|
-
const
|
|
87
|
-
for (const { element:
|
|
88
|
-
(
|
|
89
|
-
}
|
|
90
|
-
function
|
|
91
|
-
|
|
92
|
-
const c =
|
|
93
|
-
for (const { element:
|
|
94
|
-
|
|
95
|
-
}
|
|
96
|
-
function
|
|
97
|
-
const
|
|
98
|
-
for (const { element: d } of
|
|
99
|
-
!d.classList.contains(
|
|
87
|
+
o.classList.add(lt);
|
|
88
|
+
const m = D(o, e);
|
|
89
|
+
for (const { element: f, targetId: d, kind: O } of m)
|
|
90
|
+
(O === "element" || O === "both") && (f.hasAttribute("data-review-id") || f.classList.add(j), c.has(d) && f.classList.add(y));
|
|
91
|
+
}
|
|
92
|
+
function s() {
|
|
93
|
+
o.classList.remove(lt), t && (clearTimeout(t), t = null);
|
|
94
|
+
const c = D(o, e);
|
|
95
|
+
for (const { element: m } of c)
|
|
96
|
+
q(m), m.classList.remove(j);
|
|
97
|
+
}
|
|
98
|
+
function a(c) {
|
|
99
|
+
const m = D(o, e), f = [];
|
|
100
|
+
for (const { element: d } of m)
|
|
101
|
+
!d.classList.contains(y) && !d.classList.contains($) && (d.classList.add(H), f.push(d));
|
|
100
102
|
c && (t && clearTimeout(t), t = setTimeout(() => {
|
|
101
103
|
t = null;
|
|
102
|
-
for (const d of
|
|
103
|
-
d.classList.contains(
|
|
104
|
+
for (const d of f)
|
|
105
|
+
d.classList.contains($) || d.classList.remove(H);
|
|
104
106
|
}, 500));
|
|
105
107
|
}
|
|
106
108
|
function l() {
|
|
107
109
|
t && (clearTimeout(t), t = null);
|
|
108
|
-
const c =
|
|
109
|
-
for (const { element:
|
|
110
|
-
|
|
110
|
+
const c = D(o, e);
|
|
111
|
+
for (const { element: m } of c)
|
|
112
|
+
m.classList.remove(H);
|
|
111
113
|
}
|
|
112
|
-
function
|
|
113
|
-
|
|
114
|
+
function h(c, m) {
|
|
115
|
+
m || (q(c), c.classList.add($));
|
|
114
116
|
}
|
|
115
|
-
function
|
|
116
|
-
|
|
117
|
+
function u(c, m) {
|
|
118
|
+
q(c), m && c.classList.add(y);
|
|
117
119
|
}
|
|
118
|
-
function
|
|
119
|
-
(
|
|
120
|
+
function p(c, m) {
|
|
121
|
+
(at(c, e) ?? c.getAttribute("data-review-selectable")) !== m && c.classList.add(J);
|
|
120
122
|
}
|
|
121
|
-
function g(c,
|
|
122
|
-
const d =
|
|
123
|
-
d !==
|
|
123
|
+
function g(c, m, f) {
|
|
124
|
+
const d = at(c, e) ?? c.getAttribute("data-review-selectable");
|
|
125
|
+
d !== m && (c.classList.remove(J), d && (f != null && f.has(d)) && c.classList.add(y));
|
|
124
126
|
}
|
|
125
|
-
function
|
|
126
|
-
|
|
127
|
-
for (const
|
|
128
|
-
for (const d of Array.from(
|
|
127
|
+
function Et(c) {
|
|
128
|
+
W(), i = c.editingTarget ?? null, n = new MutationObserver((m) => {
|
|
129
|
+
for (const f of m) {
|
|
130
|
+
for (const d of Array.from(f.removedNodes)) {
|
|
129
131
|
if (!(d instanceof HTMLElement)) continue;
|
|
130
|
-
|
|
132
|
+
i && (d === i || d.contains(i)) && (i = null, c.onTargetDisconnected()), (d.hasAttribute("data-review-selectable") || d.querySelector("[data-review-selectable]") !== null) && c.onSelectableReconnected();
|
|
131
133
|
}
|
|
132
|
-
for (const d of Array.from(
|
|
134
|
+
for (const d of Array.from(f.addedNodes)) {
|
|
133
135
|
if (!(d instanceof HTMLElement)) continue;
|
|
134
|
-
const
|
|
136
|
+
const O = [
|
|
135
137
|
...d.matches("[data-review-id]") ? [d] : [],
|
|
136
138
|
...Array.from(
|
|
137
139
|
d.querySelectorAll("[data-review-id]")
|
|
138
140
|
)
|
|
139
141
|
];
|
|
140
|
-
for (const
|
|
141
|
-
const
|
|
142
|
-
|
|
142
|
+
for (const T of O) {
|
|
143
|
+
const R = T.getAttribute("data-review-id");
|
|
144
|
+
R && c.commentedIds.has(R) && T.classList.add(y);
|
|
143
145
|
}
|
|
144
|
-
for (const
|
|
145
|
-
const
|
|
146
|
-
...d.matches(
|
|
147
|
-
...Array.from(d.querySelectorAll(
|
|
146
|
+
for (const T of e ?? []) {
|
|
147
|
+
const R = [
|
|
148
|
+
...d.matches(T.selector) ? [d] : [],
|
|
149
|
+
...Array.from(d.querySelectorAll(T.selector))
|
|
148
150
|
];
|
|
149
|
-
for (const
|
|
150
|
-
const
|
|
151
|
-
|
|
151
|
+
for (const X of R) {
|
|
152
|
+
const ot = T.toId(X);
|
|
153
|
+
X.classList.add(j), ot && c.commentedIds.has(ot) && X.classList.add(y);
|
|
152
154
|
}
|
|
153
155
|
}
|
|
154
156
|
(d.hasAttribute("data-review-selectable") || d.querySelector("[data-review-selectable]") !== null) && c.onSelectableReconnected();
|
|
155
157
|
}
|
|
156
158
|
}
|
|
157
|
-
}),
|
|
159
|
+
}), n.observe(o, { childList: !0, subtree: !0 });
|
|
158
160
|
}
|
|
159
|
-
function
|
|
160
|
-
|
|
161
|
+
function W() {
|
|
162
|
+
n && (n.disconnect(), n = null), i = null;
|
|
161
163
|
}
|
|
162
|
-
function
|
|
163
|
-
|
|
164
|
+
function wt() {
|
|
165
|
+
s(), W();
|
|
164
166
|
}
|
|
165
167
|
return {
|
|
166
168
|
activate: r,
|
|
167
|
-
deactivate:
|
|
168
|
-
reveal:
|
|
169
|
+
deactivate: s,
|
|
170
|
+
reveal: a,
|
|
169
171
|
unreveal: l,
|
|
170
|
-
setEditing:
|
|
171
|
-
clearEditing:
|
|
172
|
-
applyHover:
|
|
172
|
+
setEditing: h,
|
|
173
|
+
clearEditing: u,
|
|
174
|
+
applyHover: p,
|
|
173
175
|
clearHover: g,
|
|
174
|
-
startObserving:
|
|
175
|
-
stopObserving:
|
|
176
|
-
destroy:
|
|
176
|
+
startObserving: Et,
|
|
177
|
+
stopObserving: W,
|
|
178
|
+
destroy: wt
|
|
177
179
|
};
|
|
178
180
|
}
|
|
179
|
-
const
|
|
180
|
-
function
|
|
181
|
-
const t =
|
|
182
|
-
(
|
|
181
|
+
const Nt = `: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}`;
|
|
182
|
+
function Pt(o, e) {
|
|
183
|
+
const t = o.find(
|
|
184
|
+
(i) => i.targetId === e && !i.selection
|
|
183
185
|
);
|
|
184
186
|
return t ? { comment: t, isNew: !1 } : { comment: {
|
|
185
187
|
commentId: crypto.randomUUID(),
|
|
@@ -188,14 +190,14 @@ function jt(n, e) {
|
|
|
188
190
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
189
191
|
}, isNew: !0 };
|
|
190
192
|
}
|
|
191
|
-
function
|
|
192
|
-
let e =
|
|
193
|
-
if (
|
|
193
|
+
function Rt(o) {
|
|
194
|
+
let e = o.comments;
|
|
195
|
+
if (o.editingCommentId !== null) {
|
|
194
196
|
const t = e.find(
|
|
195
|
-
(
|
|
197
|
+
(n) => n.commentId === o.editingCommentId
|
|
196
198
|
);
|
|
197
199
|
t && t.content === "" && (e = e.filter(
|
|
198
|
-
(
|
|
200
|
+
(n) => n.commentId !== o.editingCommentId
|
|
199
201
|
));
|
|
200
202
|
}
|
|
201
203
|
return {
|
|
@@ -205,29 +207,29 @@ function Ut(n) {
|
|
|
205
207
|
selectionRange: null
|
|
206
208
|
};
|
|
207
209
|
}
|
|
208
|
-
function
|
|
209
|
-
const e =
|
|
210
|
-
return !t && !
|
|
210
|
+
function B(o) {
|
|
211
|
+
const e = o.comments.filter((i) => i.content.trim()), t = e.length > 0, n = o.overallComment.trim().length > 0;
|
|
212
|
+
return !t && !n ? { status: "approved" } : {
|
|
211
213
|
status: "commented",
|
|
212
214
|
comments: e,
|
|
213
|
-
overallComment:
|
|
215
|
+
overallComment: n ? o.overallComment.trim() : void 0
|
|
214
216
|
};
|
|
215
217
|
}
|
|
216
|
-
function
|
|
218
|
+
function _t(o) {
|
|
217
219
|
const e = /* @__PURE__ */ new Set();
|
|
218
|
-
for (const t of
|
|
220
|
+
for (const t of o.comments)
|
|
219
221
|
!t.selection && t.content.trim() && e.add(t.targetId);
|
|
220
222
|
return e;
|
|
221
223
|
}
|
|
222
|
-
function
|
|
223
|
-
const
|
|
224
|
-
({ sendBack: t, input:
|
|
225
|
-
const
|
|
224
|
+
function Mt() {
|
|
225
|
+
const o = rt(
|
|
226
|
+
({ sendBack: t, input: n }) => {
|
|
227
|
+
const i = () => t({ type: "RELEASE_ANNOTATE" }), r = (l) => {
|
|
226
228
|
l.key === "Alt" && (l.preventDefault(), t({ type: "HOLD_ANNOTATE" }));
|
|
227
|
-
},
|
|
229
|
+
}, s = (l) => {
|
|
228
230
|
l.key === "Alt" && t({ type: "RELEASE_ANNOTATE" });
|
|
229
|
-
},
|
|
230
|
-
[
|
|
231
|
+
}, a = Lt(window, {
|
|
232
|
+
[n.shortcut]: (l) => {
|
|
231
233
|
l.preventDefault(), t({ type: "TOGGLE" });
|
|
232
234
|
},
|
|
233
235
|
"$mod+Enter": (l) => {
|
|
@@ -240,22 +242,22 @@ function Kt() {
|
|
|
240
242
|
l.preventDefault(), t({ type: "CLOSE" });
|
|
241
243
|
}
|
|
242
244
|
});
|
|
243
|
-
return window.addEventListener("keydown", r), window.addEventListener("keyup",
|
|
244
|
-
|
|
245
|
+
return window.addEventListener("keydown", r), window.addEventListener("keyup", s), window.addEventListener("blur", i), () => {
|
|
246
|
+
a(), window.removeEventListener("keydown", r), window.removeEventListener("keyup", s), window.removeEventListener("blur", i);
|
|
245
247
|
};
|
|
246
248
|
}
|
|
247
|
-
), e =
|
|
248
|
-
const
|
|
249
|
-
for (const
|
|
250
|
-
for (const
|
|
251
|
-
if (
|
|
249
|
+
), e = rt(({ sendBack: t, input: n }) => {
|
|
250
|
+
const i = new MutationObserver((r) => {
|
|
251
|
+
for (const s of r)
|
|
252
|
+
for (const a of Array.from(s.removedNodes))
|
|
253
|
+
if (a instanceof HTMLElement && (a === n.targetElement || a.contains(n.targetElement))) {
|
|
252
254
|
t({ type: "TARGET_DISCONNECTED" });
|
|
253
255
|
return;
|
|
254
256
|
}
|
|
255
257
|
});
|
|
256
|
-
return
|
|
258
|
+
return i.observe(n.wrapperElement, { childList: !0, subtree: !0 }), () => i.disconnect();
|
|
257
259
|
});
|
|
258
|
-
return
|
|
260
|
+
return xt({
|
|
259
261
|
types: {
|
|
260
262
|
context: {},
|
|
261
263
|
events: {},
|
|
@@ -263,23 +265,23 @@ function Kt() {
|
|
|
263
265
|
emitted: {}
|
|
264
266
|
},
|
|
265
267
|
actors: {
|
|
266
|
-
keyboardActor:
|
|
268
|
+
keyboardActor: o,
|
|
267
269
|
mutationObserverActor: e
|
|
268
270
|
},
|
|
269
271
|
guards: {
|
|
270
|
-
isCommentingEditing:
|
|
272
|
+
isCommentingEditing: yt({ commenting: "editing" }),
|
|
271
273
|
hasSelectionCommentId: ({ event: t }) => t.type !== "CLICK" ? !1 : !!t.selectionCommentId,
|
|
272
274
|
hasTargetId: ({ event: t }) => t.type !== "CLICK" ? !1 : !!t.targetId && !t.selectionCommentId,
|
|
273
275
|
hasNoTarget: ({ event: t }) => t.type !== "CLICK" ? !1 : !t.targetId && !t.selectionCommentId,
|
|
274
|
-
isSameComment: ({ context: t, event:
|
|
275
|
-
if (
|
|
276
|
-
if (
|
|
277
|
-
return t.editingCommentId ===
|
|
278
|
-
if (
|
|
279
|
-
const
|
|
276
|
+
isSameComment: ({ context: t, event: n }) => {
|
|
277
|
+
if (n.type !== "CLICK") return !1;
|
|
278
|
+
if (n.selectionCommentId)
|
|
279
|
+
return t.editingCommentId === n.selectionCommentId;
|
|
280
|
+
if (n.targetId) {
|
|
281
|
+
const i = t.comments.find(
|
|
280
282
|
(r) => r.commentId === t.editingCommentId
|
|
281
283
|
);
|
|
282
|
-
return !!
|
|
284
|
+
return !!i && i.targetId === n.targetId && !i.selection;
|
|
283
285
|
}
|
|
284
286
|
return !1;
|
|
285
287
|
}
|
|
@@ -288,64 +290,64 @@ function Kt() {
|
|
|
288
290
|
flashDuration: 500
|
|
289
291
|
},
|
|
290
292
|
actions: {
|
|
291
|
-
openElementComment:
|
|
292
|
-
if (
|
|
293
|
-
const { comment:
|
|
293
|
+
openElementComment: E(({ context: t, event: n }) => {
|
|
294
|
+
if (n.type !== "CLICK" || !n.targetId) return {};
|
|
295
|
+
const { comment: i, isNew: r } = Pt(
|
|
294
296
|
t.comments,
|
|
295
|
-
|
|
297
|
+
n.targetId
|
|
296
298
|
);
|
|
297
299
|
return {
|
|
298
|
-
comments: r ? [...t.comments,
|
|
299
|
-
editingCommentId:
|
|
300
|
-
targetElement:
|
|
300
|
+
comments: r ? [...t.comments, i] : t.comments,
|
|
301
|
+
editingCommentId: i.commentId,
|
|
302
|
+
targetElement: n.element ?? null,
|
|
301
303
|
selectionRange: null
|
|
302
304
|
};
|
|
303
305
|
}),
|
|
304
|
-
openSelectionComment:
|
|
306
|
+
openSelectionComment: E(({ event: t }) => t.type !== "CLICK" || !t.selectionCommentId ? {} : {
|
|
305
307
|
editingCommentId: t.selectionCommentId,
|
|
306
308
|
targetElement: t.element ?? null,
|
|
307
309
|
selectionRange: null
|
|
308
310
|
}),
|
|
309
|
-
createSelectionComment:
|
|
310
|
-
if (
|
|
311
|
-
const
|
|
311
|
+
createSelectionComment: E(({ context: t, event: n }) => {
|
|
312
|
+
if (n.type !== "SELECT_TEXT") return {};
|
|
313
|
+
const i = {
|
|
312
314
|
commentId: crypto.randomUUID(),
|
|
313
|
-
targetId:
|
|
315
|
+
targetId: n.targetId,
|
|
314
316
|
content: "",
|
|
315
317
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
316
|
-
selection:
|
|
318
|
+
selection: n.selectionRange
|
|
317
319
|
};
|
|
318
320
|
return {
|
|
319
|
-
comments: [...t.comments,
|
|
320
|
-
editingCommentId:
|
|
321
|
-
targetElement:
|
|
322
|
-
selectionRange:
|
|
321
|
+
comments: [...t.comments, i],
|
|
322
|
+
editingCommentId: i.commentId,
|
|
323
|
+
targetElement: n.targetElement,
|
|
324
|
+
selectionRange: n.selectionRange
|
|
323
325
|
};
|
|
324
326
|
}),
|
|
325
|
-
updateContent:
|
|
327
|
+
updateContent: E(({ context: t, event: n }) => n.type !== "COMMENT_CHANGE" ? {} : t.editingCommentId === null ? { overallComment: n.content } : {
|
|
326
328
|
comments: t.comments.map(
|
|
327
|
-
(
|
|
329
|
+
(i) => i.commentId === t.editingCommentId ? { ...i, content: n.content } : i
|
|
328
330
|
)
|
|
329
331
|
}),
|
|
330
|
-
deleteComment:
|
|
332
|
+
deleteComment: E(({ context: t }) => ({
|
|
331
333
|
comments: t.comments.filter(
|
|
332
|
-
(
|
|
334
|
+
(n) => n.commentId !== t.editingCommentId
|
|
333
335
|
),
|
|
334
336
|
editingCommentId: null,
|
|
335
337
|
targetElement: null,
|
|
336
338
|
selectionRange: null
|
|
337
339
|
})),
|
|
338
|
-
cleanup:
|
|
339
|
-
emitChanged:
|
|
340
|
+
cleanup: E(({ context: t }) => Rt(t)),
|
|
341
|
+
emitChanged: st(({ context: t }) => ({
|
|
340
342
|
type: "REVIEW_CHANGED",
|
|
341
|
-
result:
|
|
343
|
+
result: B(t)
|
|
342
344
|
})),
|
|
343
345
|
persistSave: ({ context: t }) => {
|
|
344
|
-
t.persistence.save(
|
|
346
|
+
t.persistence.save(B(t));
|
|
345
347
|
},
|
|
346
|
-
emitSubmitted:
|
|
348
|
+
emitSubmitted: st(({ context: t }) => ({
|
|
347
349
|
type: "REVIEW_SUBMITTED",
|
|
348
|
-
result:
|
|
350
|
+
result: B(t)
|
|
349
351
|
})),
|
|
350
352
|
// Highlight lifecycle actions — call manager methods directly via
|
|
351
353
|
// callbacks passed through input. The machine owns WHEN highlights
|
|
@@ -353,7 +355,7 @@ function Kt() {
|
|
|
353
355
|
// Actions run synchronously during transitions — no timing gap.
|
|
354
356
|
// Never add useEffects that react to derived machine state.
|
|
355
357
|
highlightsActivate: ({ context: t }) => {
|
|
356
|
-
t.highlights.activate(
|
|
358
|
+
t.highlights.activate(_t(t));
|
|
357
359
|
},
|
|
358
360
|
highlightsDeactivate: ({ context: t }) => {
|
|
359
361
|
t.highlights.deactivate();
|
|
@@ -368,21 +370,21 @@ function Kt() {
|
|
|
368
370
|
t.highlights.unreveal();
|
|
369
371
|
},
|
|
370
372
|
editingTargetSet: ({ context: t }) => {
|
|
371
|
-
var
|
|
373
|
+
var i;
|
|
372
374
|
if (!t.targetElement) return;
|
|
373
|
-
const
|
|
375
|
+
const n = !!((i = t.comments.find(
|
|
374
376
|
(r) => r.commentId === t.editingCommentId
|
|
375
|
-
)) != null &&
|
|
376
|
-
t.highlights.setEditing(t.targetElement,
|
|
377
|
+
)) != null && i.selection);
|
|
378
|
+
t.highlights.setEditing(t.targetElement, n);
|
|
377
379
|
},
|
|
378
380
|
editingTargetCleared: ({ context: t }) => {
|
|
379
381
|
if (!t.targetElement) return;
|
|
380
|
-
const
|
|
381
|
-
(
|
|
382
|
+
const n = t.comments.find(
|
|
383
|
+
(i) => i.commentId === t.editingCommentId
|
|
382
384
|
);
|
|
383
385
|
t.highlights.clearEditing(
|
|
384
386
|
t.targetElement,
|
|
385
|
-
!!(
|
|
387
|
+
!!(n != null && n.content.trim())
|
|
386
388
|
);
|
|
387
389
|
}
|
|
388
390
|
}
|
|
@@ -390,9 +392,9 @@ function Kt() {
|
|
|
390
392
|
id: "review",
|
|
391
393
|
type: "parallel",
|
|
392
394
|
context: ({ input: t }) => {
|
|
393
|
-
const
|
|
395
|
+
const n = t.persistence.load() ?? t.initialData, i = (n == null ? void 0 : n.status) === "commented" ? n.comments ?? [] : [], r = (n == null ? void 0 : n.status) === "commented" ? n.overallComment ?? "" : "";
|
|
394
396
|
return {
|
|
395
|
-
comments:
|
|
397
|
+
comments: i,
|
|
396
398
|
overallComment: r,
|
|
397
399
|
editingCommentId: null,
|
|
398
400
|
targetElement: null,
|
|
@@ -439,8 +441,8 @@ function Kt() {
|
|
|
439
441
|
on: {
|
|
440
442
|
TOGGLE: {
|
|
441
443
|
target: "inactive",
|
|
442
|
-
actions:
|
|
443
|
-
|
|
444
|
+
actions: It(({ enqueue: t, check: n }) => {
|
|
445
|
+
n("isCommentingEditing") && t.raise({ type: "CLOSE" });
|
|
444
446
|
})
|
|
445
447
|
}
|
|
446
448
|
},
|
|
@@ -517,7 +519,7 @@ function Kt() {
|
|
|
517
519
|
},
|
|
518
520
|
OPEN_OVERALL: {
|
|
519
521
|
target: "editing.element",
|
|
520
|
-
actions:
|
|
522
|
+
actions: E({
|
|
521
523
|
editingCommentId: null,
|
|
522
524
|
targetElement: null,
|
|
523
525
|
selectionRange: null
|
|
@@ -616,7 +618,7 @@ function Kt() {
|
|
|
616
618
|
actions: [
|
|
617
619
|
"editingTargetCleared",
|
|
618
620
|
"cleanup",
|
|
619
|
-
|
|
621
|
+
E({
|
|
620
622
|
editingCommentId: null,
|
|
621
623
|
targetElement: null,
|
|
622
624
|
selectionRange: null
|
|
@@ -634,7 +636,7 @@ function Kt() {
|
|
|
634
636
|
}
|
|
635
637
|
});
|
|
636
638
|
}
|
|
637
|
-
const
|
|
639
|
+
const ct = {
|
|
638
640
|
load: () => {
|
|
639
641
|
},
|
|
640
642
|
save: () => {
|
|
@@ -642,210 +644,180 @@ const mt = {
|
|
|
642
644
|
clear: () => {
|
|
643
645
|
}
|
|
644
646
|
};
|
|
645
|
-
function
|
|
647
|
+
function V() {
|
|
646
648
|
try {
|
|
647
649
|
return typeof localStorage > "u" ? void 0 : localStorage;
|
|
648
650
|
} catch {
|
|
649
651
|
return;
|
|
650
652
|
}
|
|
651
653
|
}
|
|
652
|
-
function
|
|
653
|
-
if (typeof
|
|
654
|
-
const e =
|
|
654
|
+
function $t(o) {
|
|
655
|
+
if (typeof o != "object" || o === null) return !1;
|
|
656
|
+
const e = o.status;
|
|
655
657
|
return e === "approved" || e === "commented";
|
|
656
658
|
}
|
|
657
|
-
function
|
|
659
|
+
function Ht(o) {
|
|
658
660
|
return {
|
|
659
661
|
load() {
|
|
660
|
-
const e =
|
|
662
|
+
const e = V();
|
|
661
663
|
if (e)
|
|
662
664
|
try {
|
|
663
|
-
const t = e.getItem(
|
|
665
|
+
const t = e.getItem(o);
|
|
664
666
|
if (t === null) return;
|
|
665
|
-
const
|
|
666
|
-
return
|
|
667
|
+
const n = JSON.parse(t);
|
|
668
|
+
return $t(n) ? n : void 0;
|
|
667
669
|
} catch {
|
|
668
670
|
return;
|
|
669
671
|
}
|
|
670
672
|
},
|
|
671
673
|
save(e) {
|
|
672
|
-
const t =
|
|
674
|
+
const t = V();
|
|
673
675
|
if (t)
|
|
674
676
|
try {
|
|
675
677
|
if (e.status === "approved") {
|
|
676
|
-
t.removeItem(
|
|
678
|
+
t.removeItem(o);
|
|
677
679
|
return;
|
|
678
680
|
}
|
|
679
|
-
t.setItem(
|
|
681
|
+
t.setItem(o, JSON.stringify(e));
|
|
680
682
|
} catch {
|
|
681
683
|
}
|
|
682
684
|
},
|
|
683
685
|
clear() {
|
|
684
|
-
const e =
|
|
686
|
+
const e = V();
|
|
685
687
|
if (e)
|
|
686
688
|
try {
|
|
687
|
-
e.removeItem(
|
|
689
|
+
e.removeItem(o);
|
|
688
690
|
} catch {
|
|
689
691
|
}
|
|
690
692
|
}
|
|
691
693
|
};
|
|
692
694
|
}
|
|
693
|
-
const
|
|
694
|
-
function
|
|
695
|
+
const Gt = 3;
|
|
696
|
+
function zt(o) {
|
|
695
697
|
const e = window.getSelection();
|
|
696
698
|
if (!e || e.isCollapsed || e.rangeCount === 0)
|
|
697
699
|
return null;
|
|
698
|
-
const t = e.getRangeAt(0),
|
|
699
|
-
if (
|
|
700
|
-
const
|
|
701
|
-
|
|
700
|
+
const t = e.getRangeAt(0), n = t.toString();
|
|
701
|
+
if (n.length < Gt) return null;
|
|
702
|
+
const i = Kt(
|
|
703
|
+
o,
|
|
702
704
|
t.startContainer,
|
|
703
705
|
t.startOffset
|
|
704
|
-
), r =
|
|
705
|
-
if (
|
|
706
|
-
const
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
706
|
+
), r = i + n.length;
|
|
707
|
+
if (i < 0) return null;
|
|
708
|
+
const s = Wt(
|
|
709
|
+
o.textContent ?? "",
|
|
710
|
+
n,
|
|
711
|
+
i
|
|
710
712
|
);
|
|
711
|
-
return { startOffset:
|
|
713
|
+
return { startOffset: i, endOffset: r, selectedText: n, matchIndex: s };
|
|
712
714
|
}
|
|
713
|
-
function Q(
|
|
714
|
-
const t =
|
|
715
|
+
function Q(o, e) {
|
|
716
|
+
const t = o.textContent ?? "";
|
|
715
717
|
if (t.slice(
|
|
716
718
|
e.startOffset,
|
|
717
719
|
e.endOffset
|
|
718
720
|
) === e.selectedText)
|
|
719
|
-
return
|
|
720
|
-
|
|
721
|
+
return dt(
|
|
722
|
+
o,
|
|
721
723
|
e.startOffset,
|
|
722
724
|
e.endOffset
|
|
723
725
|
);
|
|
724
|
-
const
|
|
726
|
+
const i = Xt(
|
|
725
727
|
t,
|
|
726
728
|
e.selectedText,
|
|
727
729
|
e.matchIndex
|
|
728
730
|
);
|
|
729
|
-
return
|
|
730
|
-
n,
|
|
731
|
+
return i < 0 ? null : dt(
|
|
731
732
|
o,
|
|
732
|
-
|
|
733
|
+
i,
|
|
734
|
+
i + e.selectedText.length
|
|
733
735
|
);
|
|
734
736
|
}
|
|
735
|
-
function
|
|
736
|
-
if (
|
|
737
|
-
const t =
|
|
737
|
+
function Ft(o, e) {
|
|
738
|
+
if (o.isCollapsed || o.rangeCount === 0) return !1;
|
|
739
|
+
const t = o.getRangeAt(0);
|
|
738
740
|
return e.contains(t.startContainer) && e.contains(t.endContainer);
|
|
739
741
|
}
|
|
740
|
-
function
|
|
741
|
-
const e =
|
|
742
|
+
function Y(o) {
|
|
743
|
+
const e = o instanceof HTMLElement ? o : o.parentElement;
|
|
742
744
|
return (e == null ? void 0 : e.closest("[data-review-selectable]")) ?? null;
|
|
743
745
|
}
|
|
744
|
-
function
|
|
745
|
-
var
|
|
746
|
-
if (
|
|
747
|
-
const t =
|
|
748
|
-
if (
|
|
749
|
-
if (
|
|
750
|
-
const
|
|
751
|
-
return
|
|
746
|
+
function Ut(o, e) {
|
|
747
|
+
var s;
|
|
748
|
+
if (o.isCollapsed || o.rangeCount === 0) return null;
|
|
749
|
+
const t = o.getRangeAt(0), n = t.cloneRange(), i = e.contains(t.startContainer), r = e.contains(t.endContainer);
|
|
750
|
+
if (i && r) return n;
|
|
751
|
+
if (i && !r) {
|
|
752
|
+
const a = jt(e);
|
|
753
|
+
return a && n.setEnd(a, ((s = a.textContent) == null ? void 0 : s.length) ?? 0), n;
|
|
752
754
|
}
|
|
753
755
|
return null;
|
|
754
756
|
}
|
|
755
|
-
function
|
|
757
|
+
function Kt(o, e, t) {
|
|
756
758
|
var r;
|
|
757
|
-
const
|
|
758
|
-
let
|
|
759
|
-
for (;
|
|
760
|
-
if (
|
|
761
|
-
|
|
759
|
+
const n = document.createTreeWalker(o, NodeFilter.SHOW_TEXT);
|
|
760
|
+
let i = 0;
|
|
761
|
+
for (; n.nextNode(); ) {
|
|
762
|
+
if (n.currentNode === e) return i + t;
|
|
763
|
+
i += ((r = n.currentNode.textContent) == null ? void 0 : r.length) ?? 0;
|
|
762
764
|
}
|
|
763
765
|
return -1;
|
|
764
766
|
}
|
|
765
|
-
function
|
|
766
|
-
var
|
|
767
|
-
const
|
|
768
|
-
let r = 0,
|
|
769
|
-
for (;
|
|
770
|
-
const l = ((
|
|
771
|
-
if (!
|
|
772
|
-
return
|
|
767
|
+
function dt(o, e, t) {
|
|
768
|
+
var a;
|
|
769
|
+
const n = document.createTreeWalker(o, NodeFilter.SHOW_TEXT), i = document.createRange();
|
|
770
|
+
let r = 0, s = !1;
|
|
771
|
+
for (; n.nextNode(); ) {
|
|
772
|
+
const l = ((a = n.currentNode.textContent) == null ? void 0 : a.length) ?? 0;
|
|
773
|
+
if (!s && r + l > e && (i.setStart(n.currentNode, e - r), s = !0), s && r + l >= t)
|
|
774
|
+
return i.setEnd(n.currentNode, t - r), i;
|
|
773
775
|
r += l;
|
|
774
776
|
}
|
|
775
777
|
return null;
|
|
776
778
|
}
|
|
777
|
-
function
|
|
778
|
-
let
|
|
779
|
+
function Wt(o, e, t) {
|
|
780
|
+
let n = 0, i = 0;
|
|
779
781
|
for (; ; ) {
|
|
780
|
-
const r =
|
|
781
|
-
if (r < 0 || r === t) return
|
|
782
|
-
|
|
782
|
+
const r = o.indexOf(e, i);
|
|
783
|
+
if (r < 0 || r === t) return n;
|
|
784
|
+
i = r + 1, n++;
|
|
783
785
|
}
|
|
784
786
|
}
|
|
785
|
-
function
|
|
786
|
-
let
|
|
787
|
+
function Xt(o, e, t) {
|
|
788
|
+
let n = 0, i = 0;
|
|
787
789
|
for (; ; ) {
|
|
788
|
-
const r =
|
|
790
|
+
const r = o.indexOf(e, i);
|
|
789
791
|
if (r < 0) return -1;
|
|
790
|
-
if (
|
|
791
|
-
|
|
792
|
+
if (n === t) return r;
|
|
793
|
+
i = r + 1, n++;
|
|
792
794
|
}
|
|
793
795
|
}
|
|
794
|
-
function
|
|
795
|
-
const e = document.createTreeWalker(
|
|
796
|
+
function jt(o) {
|
|
797
|
+
const e = document.createTreeWalker(o, NodeFilter.SHOW_TEXT);
|
|
796
798
|
let t = null;
|
|
797
799
|
for (; e.nextNode(); )
|
|
798
800
|
t = e.currentNode;
|
|
799
801
|
return t;
|
|
800
802
|
}
|
|
801
|
-
function
|
|
802
|
-
const
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
803
|
+
function qt(o, e, t) {
|
|
804
|
+
const n = /* @__PURE__ */ new Map(), i = D(e, t).sort((r, s) => {
|
|
805
|
+
const a = r.element.compareDocumentPosition(s.element);
|
|
806
|
+
return a & Node.DOCUMENT_POSITION_PRECEDING ? 1 : a & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 0;
|
|
807
|
+
});
|
|
808
|
+
for (const [r, s] of i.entries())
|
|
809
|
+
n.set(s.targetId, r);
|
|
810
|
+
return [...o].sort((r, s) => {
|
|
811
|
+
const a = n.get(r.targetId) ?? Number.MAX_SAFE_INTEGER, l = n.get(s.targetId) ?? Number.MAX_SAFE_INTEGER;
|
|
812
|
+
return a - l;
|
|
809
813
|
});
|
|
810
814
|
}
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
return v`<svg
|
|
816
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
817
|
-
viewBox="0 0 24 24"
|
|
818
|
-
fill="none"
|
|
819
|
-
stroke="currentColor"
|
|
820
|
-
stroke-width="2"
|
|
821
|
-
stroke-linecap="round"
|
|
822
|
-
stroke-linejoin="round"
|
|
823
|
-
aria-hidden="true"
|
|
824
|
-
>
|
|
825
|
-
${n}
|
|
826
|
-
</svg>`;
|
|
827
|
-
}
|
|
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" />`
|
|
832
|
-
),
|
|
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" />`
|
|
835
|
-
),
|
|
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" />`
|
|
838
|
-
)
|
|
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 {
|
|
815
|
+
var Bt = Object.defineProperty, Vt = Object.getOwnPropertyDescriptor, x = (o, e, t, n) => {
|
|
816
|
+
for (var i = n > 1 ? void 0 : n ? Vt(e, t) : e, r = o.length - 1, s; r >= 0; r--)
|
|
817
|
+
(s = o[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
|
|
818
|
+
return n && i && Bt(e, t, i), i;
|
|
840
819
|
};
|
|
841
|
-
|
|
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;
|
|
847
|
-
};
|
|
848
|
-
const ae = {
|
|
820
|
+
const Yt = {
|
|
849
821
|
"top-left": { top: "16px", left: "16px" },
|
|
850
822
|
"top-center": { top: "16px", left: "50%", translateX: "-50%" },
|
|
851
823
|
"top-right": { top: "16px", right: "16px" },
|
|
@@ -853,22 +825,22 @@ const ae = {
|
|
|
853
825
|
"bottom-center": { bottom: "16px", left: "50%", translateX: "-50%" },
|
|
854
826
|
"bottom-right": { bottom: "16px", right: "16px" }
|
|
855
827
|
};
|
|
856
|
-
let
|
|
828
|
+
let b = class extends C {
|
|
857
829
|
constructor() {
|
|
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 = (
|
|
830
|
+
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 = (o) => {
|
|
859
831
|
const e = this.bar.getBoundingClientRect();
|
|
860
832
|
this.dragStart = {
|
|
861
|
-
px:
|
|
862
|
-
py:
|
|
833
|
+
px: o.clientX,
|
|
834
|
+
py: o.clientY,
|
|
863
835
|
ox: e.left,
|
|
864
836
|
oy: e.top
|
|
865
837
|
}, window.addEventListener("pointermove", this.onDragMove), window.addEventListener("pointerup", this.onDragEnd);
|
|
866
|
-
}, this.onDragMove = (
|
|
838
|
+
}, this.onDragMove = (o) => {
|
|
867
839
|
if (!this.dragStart) return;
|
|
868
|
-
const e = this.dragStart.ox + (
|
|
840
|
+
const e = this.dragStart.ox + (o.clientX - this.dragStart.px), t = this.dragStart.oy + (o.clientY - this.dragStart.py), n = 16, i = window.innerWidth - this.bar.offsetWidth - n, r = window.innerHeight - this.bar.offsetHeight - n;
|
|
869
841
|
this.dragOffset = {
|
|
870
|
-
x: Math.max(
|
|
871
|
-
y: Math.max(
|
|
842
|
+
x: Math.max(n, Math.min(e, i)),
|
|
843
|
+
y: Math.max(n, Math.min(t, r))
|
|
872
844
|
};
|
|
873
845
|
}, this.onDragEnd = () => {
|
|
874
846
|
this.dragStart = null, window.removeEventListener("pointermove", this.onDragMove), window.removeEventListener("pointerup", this.onDragEnd);
|
|
@@ -878,65 +850,73 @@ let w = class extends E {
|
|
|
878
850
|
return this.bar ?? null;
|
|
879
851
|
}
|
|
880
852
|
render() {
|
|
881
|
-
const
|
|
882
|
-
return
|
|
853
|
+
const o = this.mode !== "idle", e = this.commentCount + (this.hasOverallComment ? 1 : 0), t = e > 0, n = Yt[this.barPosition], i = this.dragOffset ? `position:fixed;left:${this.dragOffset.x}px;top:${this.dragOffset.y}px;z-index:var(--review-z-index,9998);` : `position:fixed;${n.top ? `top:${n.top};` : ""}${n.bottom ? `bottom:${n.bottom};` : ""}${n.left ? `left:${n.left};` : ""}${n.right ? `right:${n.right};` : ""}${n.translateX ? `transform:translateX(${n.translateX});` : ""}z-index:var(--review-z-index,9998);`;
|
|
854
|
+
return w`<div
|
|
883
855
|
data-bar
|
|
884
|
-
class=${
|
|
885
|
-
|
|
886
|
-
n && "ring-1 ring-zinc-400/20"
|
|
887
|
-
)}
|
|
888
|
-
style=${o}
|
|
856
|
+
class=${A({ bar: !0, "bar--active": o })}
|
|
857
|
+
style=${i}
|
|
889
858
|
>
|
|
890
859
|
<div
|
|
891
|
-
class="
|
|
860
|
+
class="grip"
|
|
892
861
|
@pointerdown=${this.onDragStart}
|
|
893
862
|
>
|
|
894
|
-
<span class="
|
|
863
|
+
<span class="icon icon-12">${M.gripVertical}</span>
|
|
895
864
|
</div>
|
|
896
865
|
|
|
897
|
-
<label class="
|
|
898
|
-
<span class=${
|
|
866
|
+
<label class="label">
|
|
867
|
+
<span class=${A({
|
|
868
|
+
"label-text": !0,
|
|
869
|
+
"label-text--active": o,
|
|
870
|
+
"label-text--idle": !o
|
|
871
|
+
})}>Annotate</span>
|
|
899
872
|
<button
|
|
900
873
|
type="button"
|
|
901
874
|
role="switch"
|
|
902
|
-
aria-checked=${
|
|
875
|
+
aria-checked=${o ? "true" : "false"}
|
|
903
876
|
data-toggle
|
|
904
877
|
@click=${this.onToggle}
|
|
905
|
-
class=${
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
878
|
+
class=${A({
|
|
879
|
+
toggle: !0,
|
|
880
|
+
"toggle--active": o,
|
|
881
|
+
"toggle--idle": !o
|
|
882
|
+
})}
|
|
909
883
|
>
|
|
910
|
-
<span class=${
|
|
884
|
+
<span class=${A({
|
|
885
|
+
knob: !0,
|
|
886
|
+
"knob--active": o,
|
|
887
|
+
"knob--idle": !o
|
|
888
|
+
})}></span>
|
|
911
889
|
</button>
|
|
912
890
|
</label>
|
|
913
891
|
|
|
914
|
-
<div class="
|
|
892
|
+
<div class="divider"></div>
|
|
915
893
|
|
|
916
894
|
<button
|
|
917
895
|
type="button"
|
|
918
896
|
data-overall
|
|
919
897
|
@click=${this.onOverallToggle}
|
|
920
|
-
class=${
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
898
|
+
class=${A({
|
|
899
|
+
overall: !0,
|
|
900
|
+
"overall--has": this.hasOverallComment,
|
|
901
|
+
"overall--open": !this.hasOverallComment && this.overallCommentOpen,
|
|
902
|
+
"overall--idle": !this.hasOverallComment && !this.overallCommentOpen
|
|
903
|
+
})}
|
|
924
904
|
>
|
|
925
905
|
Comment
|
|
926
|
-
<span class="
|
|
906
|
+
<span class="icon icon-14">${M.messageSquare}</span>
|
|
927
907
|
</button>
|
|
928
908
|
|
|
929
|
-
<div class="
|
|
909
|
+
<div class="divider"></div>
|
|
930
910
|
|
|
931
911
|
<button
|
|
932
912
|
type="button"
|
|
933
913
|
data-submit
|
|
934
914
|
@click=${this.onSubmit}
|
|
935
|
-
class="
|
|
915
|
+
class="submit"
|
|
936
916
|
>
|
|
937
917
|
${t ? "Submit" : "Approve"}
|
|
938
|
-
<span class="
|
|
939
|
-
${t ? e :
|
|
918
|
+
<span class="badge">
|
|
919
|
+
${t ? e : w`<span class="icon icon-12">${M.check}</span>`}
|
|
940
920
|
</span>
|
|
941
921
|
</button>
|
|
942
922
|
</div>`;
|
|
@@ -960,55 +940,245 @@ let w = class extends E {
|
|
|
960
940
|
super.disconnectedCallback(), window.removeEventListener("pointermove", this.onDragMove), window.removeEventListener("pointerup", this.onDragEnd);
|
|
961
941
|
}
|
|
962
942
|
};
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
943
|
+
b.styles = [
|
|
944
|
+
C.styles,
|
|
945
|
+
F`
|
|
946
|
+
:host {
|
|
947
|
+
color-scheme: light;
|
|
948
|
+
color: #18181b;
|
|
949
|
+
}
|
|
950
|
+
.bar {
|
|
951
|
+
display: flex;
|
|
952
|
+
align-items: center;
|
|
953
|
+
gap: 8px;
|
|
954
|
+
border-radius: 9999px;
|
|
955
|
+
border: 1px solid #e4e4e7;
|
|
956
|
+
background-color: #fff;
|
|
957
|
+
padding: 4px;
|
|
958
|
+
box-shadow:
|
|
959
|
+
0 10px 15px -3px rgb(0 0 0 / 0.1),
|
|
960
|
+
0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
961
|
+
}
|
|
962
|
+
.bar--active {
|
|
963
|
+
box-shadow:
|
|
964
|
+
0 0 0 1px rgb(161 161 170 / 0.2),
|
|
965
|
+
0 10px 15px -3px rgb(0 0 0 / 0.1),
|
|
966
|
+
0 4px 6px -4px rgb(0 0 0 / 0.1);
|
|
967
|
+
}
|
|
968
|
+
.grip {
|
|
969
|
+
display: flex;
|
|
970
|
+
height: 28px;
|
|
971
|
+
width: 28px;
|
|
972
|
+
align-items: center;
|
|
973
|
+
justify-content: center;
|
|
974
|
+
color: #a1a1aa;
|
|
975
|
+
cursor: grab;
|
|
976
|
+
}
|
|
977
|
+
.grip:active {
|
|
978
|
+
cursor: grabbing;
|
|
979
|
+
}
|
|
980
|
+
.icon {
|
|
981
|
+
display: block;
|
|
982
|
+
}
|
|
983
|
+
.icon svg {
|
|
984
|
+
display: block;
|
|
985
|
+
width: 100%;
|
|
986
|
+
height: 100%;
|
|
987
|
+
}
|
|
988
|
+
.icon-12 {
|
|
989
|
+
width: 12px;
|
|
990
|
+
height: 12px;
|
|
991
|
+
}
|
|
992
|
+
.icon-14 {
|
|
993
|
+
width: 14px;
|
|
994
|
+
height: 14px;
|
|
995
|
+
}
|
|
996
|
+
.label {
|
|
997
|
+
display: flex;
|
|
998
|
+
cursor: pointer;
|
|
999
|
+
align-items: center;
|
|
1000
|
+
gap: 8px;
|
|
1001
|
+
padding: 0 4px;
|
|
1002
|
+
}
|
|
1003
|
+
.label-text {
|
|
1004
|
+
user-select: none;
|
|
1005
|
+
font-size: 12px;
|
|
1006
|
+
line-height: 16px;
|
|
1007
|
+
font-weight: 500;
|
|
1008
|
+
transition: color 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
1009
|
+
}
|
|
1010
|
+
.label-text--active {
|
|
1011
|
+
color: #18181b;
|
|
1012
|
+
}
|
|
1013
|
+
.label-text--idle {
|
|
1014
|
+
color: #71717a;
|
|
1015
|
+
}
|
|
1016
|
+
.toggle {
|
|
1017
|
+
position: relative;
|
|
1018
|
+
display: inline-flex;
|
|
1019
|
+
height: 16px;
|
|
1020
|
+
width: 28px;
|
|
1021
|
+
align-items: center;
|
|
1022
|
+
border-radius: 9999px;
|
|
1023
|
+
border: 0;
|
|
1024
|
+
margin: 0;
|
|
1025
|
+
padding: 0;
|
|
1026
|
+
font-family: inherit;
|
|
1027
|
+
color: inherit;
|
|
1028
|
+
cursor: pointer;
|
|
1029
|
+
transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
1030
|
+
}
|
|
1031
|
+
.toggle--active {
|
|
1032
|
+
background-color: #18181b;
|
|
1033
|
+
}
|
|
1034
|
+
.toggle--idle {
|
|
1035
|
+
background-color: #d4d4d8;
|
|
1036
|
+
}
|
|
1037
|
+
.knob {
|
|
1038
|
+
display: inline-block;
|
|
1039
|
+
width: 12px;
|
|
1040
|
+
height: 12px;
|
|
1041
|
+
border-radius: 9999px;
|
|
1042
|
+
background-color: #fff;
|
|
1043
|
+
transition: translate 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
1044
|
+
}
|
|
1045
|
+
.knob--active {
|
|
1046
|
+
translate: 14px 0;
|
|
1047
|
+
}
|
|
1048
|
+
.knob--idle {
|
|
1049
|
+
translate: 2px 0;
|
|
1050
|
+
}
|
|
1051
|
+
.divider {
|
|
1052
|
+
height: 16px;
|
|
1053
|
+
width: 1px;
|
|
1054
|
+
background-color: #e4e4e7;
|
|
1055
|
+
}
|
|
1056
|
+
.overall {
|
|
1057
|
+
position: relative;
|
|
1058
|
+
display: flex;
|
|
1059
|
+
height: 28px;
|
|
1060
|
+
align-items: center;
|
|
1061
|
+
gap: 6px;
|
|
1062
|
+
border-radius: 9999px;
|
|
1063
|
+
padding: 0 12px;
|
|
1064
|
+
font-family: inherit;
|
|
1065
|
+
font-size: 12px;
|
|
1066
|
+
line-height: 16px;
|
|
1067
|
+
font-weight: 500;
|
|
1068
|
+
color: inherit;
|
|
1069
|
+
background-color: transparent;
|
|
1070
|
+
border: 0;
|
|
1071
|
+
margin: 0;
|
|
1072
|
+
cursor: pointer;
|
|
1073
|
+
}
|
|
1074
|
+
.overall--has {
|
|
1075
|
+
background-color: #18181b;
|
|
1076
|
+
color: #fff;
|
|
1077
|
+
}
|
|
1078
|
+
.overall--has:hover {
|
|
1079
|
+
background-color: #27272a;
|
|
1080
|
+
}
|
|
1081
|
+
.overall--has:active {
|
|
1082
|
+
background-color: #09090b;
|
|
1083
|
+
}
|
|
1084
|
+
.overall--open {
|
|
1085
|
+
background-color: #f4f4f5;
|
|
1086
|
+
}
|
|
1087
|
+
.overall--open:hover {
|
|
1088
|
+
background-color: #e4e4e7;
|
|
1089
|
+
}
|
|
1090
|
+
.overall--idle {
|
|
1091
|
+
border: 1px solid #e4e4e7;
|
|
1092
|
+
}
|
|
1093
|
+
.overall--idle:hover {
|
|
1094
|
+
background-color: #fafafa;
|
|
1095
|
+
}
|
|
1096
|
+
.submit {
|
|
1097
|
+
display: flex;
|
|
1098
|
+
height: 28px;
|
|
1099
|
+
align-items: center;
|
|
1100
|
+
gap: 6px;
|
|
1101
|
+
border-radius: 9999px;
|
|
1102
|
+
padding: 0 8px 0 12px;
|
|
1103
|
+
background-color: #18181b;
|
|
1104
|
+
color: #fff;
|
|
1105
|
+
font-family: inherit;
|
|
1106
|
+
font-size: 12px;
|
|
1107
|
+
line-height: 16px;
|
|
1108
|
+
font-weight: 500;
|
|
1109
|
+
border: 0;
|
|
1110
|
+
margin: 0;
|
|
1111
|
+
cursor: pointer;
|
|
1112
|
+
}
|
|
1113
|
+
.submit:hover {
|
|
1114
|
+
background-color: #27272a;
|
|
1115
|
+
}
|
|
1116
|
+
.submit:active {
|
|
1117
|
+
background-color: #09090b;
|
|
1118
|
+
}
|
|
1119
|
+
.badge {
|
|
1120
|
+
display: flex;
|
|
1121
|
+
height: 18px;
|
|
1122
|
+
min-width: 18px;
|
|
1123
|
+
align-items: center;
|
|
1124
|
+
justify-content: center;
|
|
1125
|
+
border-radius: 9999px;
|
|
1126
|
+
background-color: rgb(255 255 255 / 0.25);
|
|
1127
|
+
padding: 0 4px;
|
|
1128
|
+
font-size: 11px;
|
|
1129
|
+
line-height: 16px;
|
|
1130
|
+
font-weight: 600;
|
|
1131
|
+
}
|
|
1132
|
+
`
|
|
1133
|
+
];
|
|
1134
|
+
x([
|
|
1135
|
+
v()
|
|
1136
|
+
], b.prototype, "mode", 2);
|
|
1137
|
+
x([
|
|
1138
|
+
v({ type: Number })
|
|
1139
|
+
], b.prototype, "commentCount", 2);
|
|
1140
|
+
x([
|
|
1141
|
+
v({ type: Boolean })
|
|
1142
|
+
], b.prototype, "hasOverallComment", 2);
|
|
1143
|
+
x([
|
|
1144
|
+
v({ type: Boolean })
|
|
1145
|
+
], b.prototype, "overallCommentOpen", 2);
|
|
1146
|
+
x([
|
|
1147
|
+
v()
|
|
1148
|
+
], b.prototype, "barPosition", 2);
|
|
1149
|
+
x([
|
|
1150
|
+
U("[data-bar]")
|
|
1151
|
+
], b.prototype, "bar", 2);
|
|
1152
|
+
x([
|
|
1153
|
+
Ot()
|
|
1154
|
+
], b.prototype, "dragOffset", 2);
|
|
1155
|
+
b = x([
|
|
1156
|
+
k("llumi-review-bar")
|
|
1157
|
+
], b);
|
|
1158
|
+
var Jt = Object.defineProperty, Qt = Object.getOwnPropertyDescriptor, N = (o, e, t, n) => {
|
|
1159
|
+
for (var i = n > 1 ? void 0 : n ? Qt(e, t) : e, r = o.length - 1, s; r >= 0; r--)
|
|
1160
|
+
(s = o[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
|
|
1161
|
+
return n && i && Jt(e, t, i), i;
|
|
991
1162
|
};
|
|
992
|
-
let
|
|
1163
|
+
let I = class extends C {
|
|
993
1164
|
constructor() {
|
|
994
1165
|
super(...arguments), this.value = "", this.autoFocus = !1, this.placeholder = "Write a comment...";
|
|
995
1166
|
}
|
|
996
1167
|
/** Focus the inner textarea (the element itself isn't focusable). */
|
|
997
1168
|
focus() {
|
|
998
|
-
var
|
|
999
|
-
(
|
|
1169
|
+
var o;
|
|
1170
|
+
(o = this.textarea) == null || o.focus();
|
|
1000
1171
|
}
|
|
1001
1172
|
render() {
|
|
1002
|
-
return
|
|
1173
|
+
return w`<textarea
|
|
1003
1174
|
rows="1"
|
|
1004
1175
|
placeholder=${this.placeholder}
|
|
1005
1176
|
.value=${this.value}
|
|
1006
|
-
class="w-full resize-none bg-transparent text-sm text-zinc-900 placeholder:text-zinc-400 focus:outline-none max-h-[200px] overflow-y-auto"
|
|
1007
1177
|
@input=${this.onInput}
|
|
1008
1178
|
></textarea>`;
|
|
1009
1179
|
}
|
|
1010
|
-
onInput(
|
|
1011
|
-
const e =
|
|
1180
|
+
onInput(o) {
|
|
1181
|
+
const e = o.target.value;
|
|
1012
1182
|
this.autoGrow(), this.dispatchEvent(
|
|
1013
1183
|
new CustomEvent("change", {
|
|
1014
1184
|
detail: e,
|
|
@@ -1018,8 +1188,8 @@ let S = class extends E {
|
|
|
1018
1188
|
);
|
|
1019
1189
|
}
|
|
1020
1190
|
autoGrow() {
|
|
1021
|
-
const
|
|
1022
|
-
|
|
1191
|
+
const o = this.textarea;
|
|
1192
|
+
o && (o.style.height = "auto", o.style.height = `${o.scrollHeight}px`);
|
|
1023
1193
|
}
|
|
1024
1194
|
firstUpdated() {
|
|
1025
1195
|
this.autoFocus && this.textarea.focus(), this.autoGrow();
|
|
@@ -1028,53 +1198,73 @@ let S = class extends E {
|
|
|
1028
1198
|
this.autoGrow();
|
|
1029
1199
|
}
|
|
1030
1200
|
};
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1201
|
+
I.styles = [
|
|
1202
|
+
C.styles,
|
|
1203
|
+
F`
|
|
1204
|
+
textarea {
|
|
1205
|
+
width: 100%;
|
|
1206
|
+
resize: none;
|
|
1207
|
+
background-color: transparent;
|
|
1208
|
+
color: #18181b;
|
|
1209
|
+
font-family: inherit;
|
|
1210
|
+
font-size: 0.875rem;
|
|
1211
|
+
line-height: 1.25rem;
|
|
1212
|
+
max-height: 200px;
|
|
1213
|
+
overflow-y: auto;
|
|
1214
|
+
margin: 0;
|
|
1215
|
+
padding: 0;
|
|
1216
|
+
border: 0;
|
|
1217
|
+
}
|
|
1218
|
+
textarea::placeholder {
|
|
1219
|
+
color: #a1a1aa;
|
|
1220
|
+
}
|
|
1221
|
+
textarea:focus {
|
|
1222
|
+
outline: none;
|
|
1223
|
+
}
|
|
1224
|
+
`
|
|
1225
|
+
];
|
|
1226
|
+
N([
|
|
1227
|
+
v()
|
|
1228
|
+
], I.prototype, "value", 2);
|
|
1229
|
+
N([
|
|
1230
|
+
v({ type: Boolean })
|
|
1231
|
+
], I.prototype, "autoFocus", 2);
|
|
1232
|
+
N([
|
|
1233
|
+
v()
|
|
1234
|
+
], I.prototype, "placeholder", 2);
|
|
1235
|
+
N([
|
|
1236
|
+
U("textarea")
|
|
1237
|
+
], I.prototype, "textarea", 2);
|
|
1238
|
+
I = N([
|
|
1239
|
+
k("llumi-default-editor")
|
|
1240
|
+
], I);
|
|
1241
|
+
var Zt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, P = (o, e, t, n) => {
|
|
1242
|
+
for (var i = n > 1 ? void 0 : n ? te(e, t) : e, r = o.length - 1, s; r >= 0; r--)
|
|
1243
|
+
(s = o[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
|
|
1244
|
+
return n && i && Zt(e, t, i), i;
|
|
1050
1245
|
};
|
|
1051
|
-
let
|
|
1246
|
+
let S = class extends C {
|
|
1052
1247
|
constructor() {
|
|
1053
1248
|
super(...arguments), this.targetElement = null, this.anchor = null, this.value = "";
|
|
1054
1249
|
}
|
|
1055
1250
|
render() {
|
|
1056
|
-
const
|
|
1057
|
-
return
|
|
1251
|
+
const o = this.value.trim().length > 0;
|
|
1252
|
+
return w`<div
|
|
1058
1253
|
data-floating
|
|
1059
|
-
class="
|
|
1254
|
+
class="floating"
|
|
1060
1255
|
style="position:absolute;top:0;left:0;"
|
|
1061
1256
|
>
|
|
1062
|
-
<div
|
|
1063
|
-
|
|
1064
|
-
"relative w-[400px] rounded-lg border border-zinc-200 bg-white shadow-xl": !0,
|
|
1065
|
-
"animate-[llumi-fade-in_0.15s_ease-out]": !0
|
|
1066
|
-
})}
|
|
1067
|
-
>
|
|
1068
|
-
${n ? v`<button
|
|
1257
|
+
<div class="panel">
|
|
1258
|
+
${o ? w`<button
|
|
1069
1259
|
type="button"
|
|
1070
1260
|
data-delete
|
|
1261
|
+
class="delete-btn"
|
|
1071
1262
|
@click=${this.onDelete}
|
|
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"
|
|
1073
1263
|
>
|
|
1074
|
-
<span class="
|
|
1075
|
-
<span class="
|
|
1264
|
+
<span class="icon icon-14">${M.trash}</span>
|
|
1265
|
+
<span class="delete-label">Delete</span>
|
|
1076
1266
|
</button>` : null}
|
|
1077
|
-
<div class="
|
|
1267
|
+
<div class="editor-wrap" @change=${this.onEditorChange} @cancel=${this.onCancel} @delete=${this.onDelete}>
|
|
1078
1268
|
<slot name="editor">
|
|
1079
1269
|
<llumi-default-editor .value=${this.value} autoFocus></llumi-default-editor>
|
|
1080
1270
|
</slot>
|
|
@@ -1082,98 +1272,174 @@ let T = class extends E {
|
|
|
1082
1272
|
</div>
|
|
1083
1273
|
</div>`;
|
|
1084
1274
|
}
|
|
1085
|
-
onEditorChange(
|
|
1086
|
-
if (typeof
|
|
1087
|
-
const e =
|
|
1088
|
-
|
|
1275
|
+
onEditorChange(o) {
|
|
1276
|
+
if (typeof o.detail != "string") return;
|
|
1277
|
+
const e = o.detail;
|
|
1278
|
+
o.stopPropagation(), this.dispatchEvent(
|
|
1089
1279
|
new CustomEvent("change", { detail: e, bubbles: !0, composed: !0 })
|
|
1090
1280
|
);
|
|
1091
1281
|
}
|
|
1092
|
-
onCancel(
|
|
1093
|
-
|
|
1282
|
+
onCancel(o) {
|
|
1283
|
+
o.stopPropagation(), this.dispatchEvent(
|
|
1094
1284
|
new CustomEvent("close", { bubbles: !0, composed: !0 })
|
|
1095
1285
|
);
|
|
1096
1286
|
}
|
|
1097
|
-
onDelete(
|
|
1098
|
-
|
|
1287
|
+
onDelete(o) {
|
|
1288
|
+
o.stopPropagation(), this.dispatchEvent(
|
|
1099
1289
|
new CustomEvent("delete", { bubbles: !0, composed: !0 })
|
|
1100
1290
|
);
|
|
1101
1291
|
}
|
|
1102
1292
|
startPositioning() {
|
|
1103
1293
|
var t;
|
|
1104
|
-
const
|
|
1105
|
-
!
|
|
1106
|
-
|
|
1294
|
+
const o = this.anchor ?? this.targetElement, e = this.floating;
|
|
1295
|
+
!o || !e || ((t = this.cleanup) == null || t.call(this), this.cleanup = gt(o, e, () => {
|
|
1296
|
+
ut(o, e, {
|
|
1107
1297
|
placement: "right",
|
|
1108
1298
|
middleware: [
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1299
|
+
pt(12),
|
|
1300
|
+
ft({ padding: 16 }),
|
|
1301
|
+
vt({ padding: 16, crossAxis: !0 }),
|
|
1302
|
+
bt({
|
|
1113
1303
|
padding: 16,
|
|
1114
|
-
apply({ availableWidth:
|
|
1115
|
-
Object.assign(
|
|
1116
|
-
maxWidth: `${Math.min(400,
|
|
1304
|
+
apply({ availableWidth: n, elements: i }) {
|
|
1305
|
+
Object.assign(i.floating.style, {
|
|
1306
|
+
maxWidth: `${Math.min(400, n)}px`
|
|
1117
1307
|
});
|
|
1118
1308
|
}
|
|
1119
1309
|
})
|
|
1120
1310
|
]
|
|
1121
|
-
}).then(({ x:
|
|
1122
|
-
Object.assign(e.style, { left: `${
|
|
1311
|
+
}).then(({ x: n, y: i }) => {
|
|
1312
|
+
Object.assign(e.style, { left: `${n}px`, top: `${i}px` });
|
|
1123
1313
|
});
|
|
1124
1314
|
}));
|
|
1125
1315
|
}
|
|
1126
|
-
updated(
|
|
1127
|
-
|
|
1316
|
+
updated(o) {
|
|
1317
|
+
(o.has("targetElement") || o.has("anchor")) && (this.startPositioning(), this.focusEditor());
|
|
1128
1318
|
}
|
|
1129
1319
|
focusEditor() {
|
|
1130
|
-
const
|
|
1320
|
+
const o = this.renderRoot.querySelector(
|
|
1131
1321
|
'slot[name="editor"]'
|
|
1132
|
-
), t = ((
|
|
1322
|
+
), t = ((o == null ? void 0 : o.assignedElements()) ?? [])[0] ?? this.renderRoot.querySelector("llumi-default-editor");
|
|
1133
1323
|
t == null || t.focus();
|
|
1134
1324
|
}
|
|
1135
1325
|
disconnectedCallback() {
|
|
1136
|
-
var
|
|
1137
|
-
super.disconnectedCallback(), (
|
|
1326
|
+
var o;
|
|
1327
|
+
super.disconnectedCallback(), (o = this.cleanup) == null || o.call(this), this.cleanup = void 0;
|
|
1138
1328
|
}
|
|
1139
1329
|
};
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1330
|
+
S.styles = [
|
|
1331
|
+
C.styles,
|
|
1332
|
+
F`
|
|
1333
|
+
.floating {
|
|
1334
|
+
z-index: calc(var(--review-z-index, 9998) + 1);
|
|
1335
|
+
}
|
|
1336
|
+
.panel {
|
|
1337
|
+
position: relative;
|
|
1338
|
+
width: 400px;
|
|
1339
|
+
border-radius: 8px;
|
|
1340
|
+
border: 1px solid #e4e4e7;
|
|
1341
|
+
background-color: #fff;
|
|
1342
|
+
box-shadow:
|
|
1343
|
+
0 20px 25px -5px rgb(0 0 0 / 0.1),
|
|
1344
|
+
0 8px 10px -6px rgb(0 0 0 / 0.1);
|
|
1345
|
+
animation: llumi-fade-in 0.15s ease-out;
|
|
1346
|
+
}
|
|
1347
|
+
.delete-btn {
|
|
1348
|
+
position: absolute;
|
|
1349
|
+
top: 8px;
|
|
1350
|
+
right: 8px;
|
|
1351
|
+
z-index: 10;
|
|
1352
|
+
display: flex;
|
|
1353
|
+
align-items: center;
|
|
1354
|
+
gap: 4px;
|
|
1355
|
+
border-radius: 6px;
|
|
1356
|
+
padding: 4px 6px;
|
|
1357
|
+
color: #a1a1aa;
|
|
1358
|
+
background-color: transparent;
|
|
1359
|
+
border: 0;
|
|
1360
|
+
margin: 0;
|
|
1361
|
+
font-family: inherit;
|
|
1362
|
+
cursor: pointer;
|
|
1363
|
+
transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
1364
|
+
}
|
|
1365
|
+
.delete-btn:hover {
|
|
1366
|
+
background-color: #18181b;
|
|
1367
|
+
color: #fff;
|
|
1368
|
+
}
|
|
1369
|
+
.icon {
|
|
1370
|
+
display: block;
|
|
1371
|
+
}
|
|
1372
|
+
.icon svg {
|
|
1373
|
+
display: block;
|
|
1374
|
+
width: 100%;
|
|
1375
|
+
height: 100%;
|
|
1376
|
+
}
|
|
1377
|
+
.icon-14 {
|
|
1378
|
+
width: 14px;
|
|
1379
|
+
height: 14px;
|
|
1380
|
+
}
|
|
1381
|
+
.delete-label {
|
|
1382
|
+
font-size: 0.75rem;
|
|
1383
|
+
line-height: 1rem;
|
|
1384
|
+
max-width: 0;
|
|
1385
|
+
overflow: hidden;
|
|
1386
|
+
transition: all 150ms cubic-bezier(0.4, 0, 0.2, 1);
|
|
1387
|
+
}
|
|
1388
|
+
.delete-btn:hover .delete-label {
|
|
1389
|
+
max-width: 60px;
|
|
1390
|
+
}
|
|
1391
|
+
.editor-wrap {
|
|
1392
|
+
padding: 12px;
|
|
1393
|
+
}
|
|
1394
|
+
@keyframes llumi-fade-in {
|
|
1395
|
+
from {
|
|
1396
|
+
opacity: 0;
|
|
1397
|
+
transform: translateY(4px);
|
|
1398
|
+
}
|
|
1399
|
+
to {
|
|
1400
|
+
opacity: 1;
|
|
1401
|
+
transform: translateY(0);
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
`
|
|
1405
|
+
];
|
|
1406
|
+
P([
|
|
1407
|
+
v({ attribute: !1 })
|
|
1408
|
+
], S.prototype, "targetElement", 2);
|
|
1409
|
+
P([
|
|
1410
|
+
v({ attribute: !1 })
|
|
1411
|
+
], S.prototype, "anchor", 2);
|
|
1412
|
+
P([
|
|
1413
|
+
v()
|
|
1414
|
+
], S.prototype, "value", 2);
|
|
1415
|
+
P([
|
|
1416
|
+
U("[data-floating]")
|
|
1417
|
+
], S.prototype, "floating", 2);
|
|
1418
|
+
S = P([
|
|
1419
|
+
k("llumi-comment-dialog")
|
|
1420
|
+
], S);
|
|
1421
|
+
var ee = Object.defineProperty, ne = Object.getOwnPropertyDescriptor, K = (o, e, t, n) => {
|
|
1422
|
+
for (var i = n > 1 ? void 0 : n ? ne(e, t) : e, r = o.length - 1, s; r >= 0; r--)
|
|
1423
|
+
(s = o[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
|
|
1424
|
+
return n && i && ee(e, t, i), i;
|
|
1159
1425
|
};
|
|
1160
|
-
let
|
|
1426
|
+
let L = class extends C {
|
|
1161
1427
|
constructor() {
|
|
1162
|
-
super(...arguments), this.barElement = null, this.value = "", this.onDocKeydown = (
|
|
1163
|
-
|
|
1164
|
-
}, this.onDocPointerdown = (
|
|
1165
|
-
const e =
|
|
1428
|
+
super(...arguments), this.barElement = null, this.value = "", this.onDocKeydown = (o) => {
|
|
1429
|
+
o.key === "Escape" && (o.preventDefault(), this.emitClose());
|
|
1430
|
+
}, this.onDocPointerdown = (o) => {
|
|
1431
|
+
const e = o.composedPath();
|
|
1166
1432
|
this.floating && !e.includes(this.floating) && !e.includes(this) && this.emitClose();
|
|
1167
1433
|
};
|
|
1168
1434
|
}
|
|
1169
1435
|
render() {
|
|
1170
|
-
return
|
|
1436
|
+
return w`<div
|
|
1171
1437
|
data-floating
|
|
1172
|
-
class="
|
|
1438
|
+
class="floating"
|
|
1173
1439
|
style="position:absolute;top:0;left:0;"
|
|
1174
1440
|
>
|
|
1175
|
-
<div class="
|
|
1176
|
-
<div class="
|
|
1441
|
+
<div class="panel">
|
|
1442
|
+
<div class="editor-wrap" @change=${this.onEditorChange}>
|
|
1177
1443
|
<slot name="editor">
|
|
1178
1444
|
<llumi-default-editor
|
|
1179
1445
|
.value=${this.value}
|
|
@@ -1185,10 +1451,10 @@ let O = class extends E {
|
|
|
1185
1451
|
</div>
|
|
1186
1452
|
</div>`;
|
|
1187
1453
|
}
|
|
1188
|
-
onEditorChange(
|
|
1189
|
-
if (typeof
|
|
1190
|
-
const e =
|
|
1191
|
-
|
|
1454
|
+
onEditorChange(o) {
|
|
1455
|
+
if (typeof o.detail != "string") return;
|
|
1456
|
+
const e = o.detail;
|
|
1457
|
+
o.stopPropagation(), this.dispatchEvent(
|
|
1192
1458
|
new CustomEvent("change", { detail: e, bubbles: !0, composed: !0 })
|
|
1193
1459
|
);
|
|
1194
1460
|
}
|
|
@@ -1199,77 +1465,108 @@ let O = class extends E {
|
|
|
1199
1465
|
}
|
|
1200
1466
|
startPositioning() {
|
|
1201
1467
|
var t;
|
|
1202
|
-
const
|
|
1203
|
-
!
|
|
1204
|
-
|
|
1468
|
+
const o = this.barElement, e = this.floating;
|
|
1469
|
+
!o || !e || ((t = this.cleanup) == null || t.call(this), this.cleanup = gt(o, e, () => {
|
|
1470
|
+
ut(o, e, {
|
|
1205
1471
|
placement: "top",
|
|
1206
1472
|
middleware: [
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1473
|
+
pt(12),
|
|
1474
|
+
ft({ padding: 16 }),
|
|
1475
|
+
vt({ padding: 16, crossAxis: !0 }),
|
|
1476
|
+
bt({
|
|
1211
1477
|
padding: 16,
|
|
1212
|
-
apply({ availableWidth:
|
|
1213
|
-
Object.assign(
|
|
1214
|
-
maxWidth: `${Math.min(400,
|
|
1478
|
+
apply({ availableWidth: n, elements: i }) {
|
|
1479
|
+
Object.assign(i.floating.style, {
|
|
1480
|
+
maxWidth: `${Math.min(400, n)}px`
|
|
1215
1481
|
});
|
|
1216
1482
|
}
|
|
1217
1483
|
})
|
|
1218
1484
|
]
|
|
1219
|
-
}).then(({ x:
|
|
1220
|
-
Object.assign(e.style, { left: `${
|
|
1485
|
+
}).then(({ x: n, y: i }) => {
|
|
1486
|
+
Object.assign(e.style, { left: `${n}px`, top: `${i}px` });
|
|
1221
1487
|
});
|
|
1222
1488
|
}));
|
|
1223
1489
|
}
|
|
1224
1490
|
connectedCallback() {
|
|
1225
1491
|
super.connectedCallback(), document.addEventListener("keydown", this.onDocKeydown), document.addEventListener("pointerdown", this.onDocPointerdown, !0);
|
|
1226
1492
|
}
|
|
1227
|
-
updated(
|
|
1228
|
-
|
|
1493
|
+
updated(o) {
|
|
1494
|
+
o.has("barElement") && this.startPositioning();
|
|
1229
1495
|
}
|
|
1230
1496
|
disconnectedCallback() {
|
|
1231
|
-
var
|
|
1232
|
-
super.disconnectedCallback(), (
|
|
1497
|
+
var o;
|
|
1498
|
+
super.disconnectedCallback(), (o = this.cleanup) == null || o.call(this), this.cleanup = void 0, document.removeEventListener("keydown", this.onDocKeydown), document.removeEventListener("pointerdown", this.onDocPointerdown, !0);
|
|
1233
1499
|
}
|
|
1234
1500
|
};
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1501
|
+
L.styles = [
|
|
1502
|
+
C.styles,
|
|
1503
|
+
F`
|
|
1504
|
+
.floating {
|
|
1505
|
+
z-index: calc(var(--review-z-index, 9998) + 1);
|
|
1506
|
+
}
|
|
1507
|
+
.panel {
|
|
1508
|
+
width: 400px;
|
|
1509
|
+
border-radius: 8px;
|
|
1510
|
+
border: 1px solid #e4e4e7;
|
|
1511
|
+
background-color: #fff;
|
|
1512
|
+
box-shadow:
|
|
1513
|
+
0 20px 25px -5px rgb(0 0 0 / 0.1),
|
|
1514
|
+
0 8px 10px -6px rgb(0 0 0 / 0.1);
|
|
1515
|
+
animation: llumi-fade-in 0.15s ease-out;
|
|
1516
|
+
}
|
|
1517
|
+
.editor-wrap {
|
|
1518
|
+
padding: 12px;
|
|
1519
|
+
}
|
|
1520
|
+
@keyframes llumi-fade-in {
|
|
1521
|
+
from {
|
|
1522
|
+
opacity: 0;
|
|
1523
|
+
transform: translateY(4px);
|
|
1524
|
+
}
|
|
1525
|
+
to {
|
|
1526
|
+
opacity: 1;
|
|
1527
|
+
transform: translateY(0);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
`
|
|
1531
|
+
];
|
|
1532
|
+
K([
|
|
1533
|
+
v({ attribute: !1 })
|
|
1534
|
+
], L.prototype, "barElement", 2);
|
|
1535
|
+
K([
|
|
1536
|
+
v()
|
|
1537
|
+
], L.prototype, "value", 2);
|
|
1538
|
+
K([
|
|
1539
|
+
U("[data-floating]")
|
|
1540
|
+
], L.prototype, "floating", 2);
|
|
1541
|
+
L = K([
|
|
1542
|
+
k("llumi-overall-comment-dialog")
|
|
1543
|
+
], L);
|
|
1544
|
+
var ie = Object.defineProperty, oe = Object.getOwnPropertyDescriptor, Ct = (o, e, t, n) => {
|
|
1545
|
+
for (var i = n > 1 ? void 0 : n ? oe(e, t) : e, r = o.length - 1, s; r >= 0; r--)
|
|
1546
|
+
(s = o[r]) && (i = (n ? s(e, t, i) : s(i)) || i);
|
|
1547
|
+
return n && i && ie(e, t, i), i;
|
|
1251
1548
|
};
|
|
1252
|
-
const
|
|
1253
|
-
let
|
|
1549
|
+
const re = "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";
|
|
1550
|
+
let Z = class extends C {
|
|
1254
1551
|
constructor() {
|
|
1255
1552
|
super(...arguments), this.positions = [];
|
|
1256
1553
|
}
|
|
1257
1554
|
render() {
|
|
1258
|
-
return
|
|
1555
|
+
return w`${At(
|
|
1259
1556
|
this.positions,
|
|
1260
|
-
(
|
|
1261
|
-
(
|
|
1557
|
+
(o) => o.commentId,
|
|
1558
|
+
(o) => w`<button
|
|
1262
1559
|
type="button"
|
|
1263
|
-
@click=${(e) => this.onClick(e,
|
|
1264
|
-
style=${
|
|
1560
|
+
@click=${(e) => this.onClick(e, o.commentId)}
|
|
1561
|
+
style=${Dt({
|
|
1265
1562
|
position: "absolute",
|
|
1266
|
-
top: `${
|
|
1267
|
-
left: `${
|
|
1563
|
+
top: `${o.top - 10}px`,
|
|
1564
|
+
left: `${o.left + 2}px`,
|
|
1268
1565
|
width: "20px",
|
|
1269
1566
|
height: "20px",
|
|
1270
1567
|
borderRadius: "50%",
|
|
1271
1568
|
backgroundColor: "white",
|
|
1272
|
-
backgroundImage: `url("${
|
|
1569
|
+
backgroundImage: `url("${re}")`,
|
|
1273
1570
|
backgroundSize: "12px 12px",
|
|
1274
1571
|
backgroundRepeat: "no-repeat",
|
|
1275
1572
|
backgroundPosition: "center",
|
|
@@ -1282,8 +1579,8 @@ let rt = class extends E {
|
|
|
1282
1579
|
></button>`
|
|
1283
1580
|
)}`;
|
|
1284
1581
|
}
|
|
1285
|
-
onClick(
|
|
1286
|
-
|
|
1582
|
+
onClick(o, e) {
|
|
1583
|
+
o.stopPropagation(), this.dispatchEvent(
|
|
1287
1584
|
new CustomEvent("icon-click", {
|
|
1288
1585
|
detail: e,
|
|
1289
1586
|
bubbles: !0,
|
|
@@ -1292,84 +1589,158 @@ let rt = class extends E {
|
|
|
1292
1589
|
);
|
|
1293
1590
|
}
|
|
1294
1591
|
};
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
],
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
],
|
|
1301
|
-
const
|
|
1302
|
-
|
|
1303
|
-
function ve() {
|
|
1304
|
-
if (it) return;
|
|
1305
|
-
if (document.querySelector(`style[${ft}]`)) {
|
|
1306
|
-
it = !0;
|
|
1307
|
-
return;
|
|
1308
|
-
}
|
|
1309
|
-
const n = document.createElement("style");
|
|
1310
|
-
n.setAttribute(ft, ""), n.textContent = Gt, document.head.append(n), it = !0;
|
|
1311
|
-
}
|
|
1312
|
-
function G() {
|
|
1592
|
+
Ct([
|
|
1593
|
+
v({ attribute: !1 })
|
|
1594
|
+
], Z.prototype, "positions", 2);
|
|
1595
|
+
Z = Ct([
|
|
1596
|
+
k("llumi-selection-comment-icons")
|
|
1597
|
+
], Z);
|
|
1598
|
+
const z = "data-review-selectable", ht = "review-selection-commented", mt = "review-selection-editing", G = "review-selection-hover";
|
|
1599
|
+
function tt() {
|
|
1313
1600
|
if (!(typeof CSS > "u"))
|
|
1314
1601
|
return CSS.highlights;
|
|
1315
1602
|
}
|
|
1316
|
-
function
|
|
1603
|
+
function et(...o) {
|
|
1317
1604
|
return new Highlight(
|
|
1318
|
-
...
|
|
1605
|
+
...o
|
|
1319
1606
|
);
|
|
1320
1607
|
}
|
|
1321
|
-
|
|
1608
|
+
class se {
|
|
1609
|
+
constructor(e) {
|
|
1610
|
+
this.ranges = /* @__PURE__ */ new Map(), this.repositionRaf = 0, this.reposition = () => {
|
|
1611
|
+
this.repositionRaf || (this.repositionRaf = requestAnimationFrame(() => {
|
|
1612
|
+
if (this.repositionRaf = 0, !this.ctx.isAnnotating() || this.ranges.size === 0) return;
|
|
1613
|
+
const t = [];
|
|
1614
|
+
for (const [n, i] of this.ranges) {
|
|
1615
|
+
const r = this.iconPositionForRange(n, i);
|
|
1616
|
+
r && t.push(r);
|
|
1617
|
+
}
|
|
1618
|
+
this.ctx.icons.positions = t;
|
|
1619
|
+
}));
|
|
1620
|
+
}, this.ctx = e;
|
|
1621
|
+
}
|
|
1622
|
+
/** Read accessor: the element's pointer hit-testing iterates this. */
|
|
1623
|
+
get rangeMap() {
|
|
1624
|
+
return this.ranges;
|
|
1625
|
+
}
|
|
1626
|
+
/**
|
|
1627
|
+
* Rebuild the commented/editing highlight registries, the `rangeMap`, and
|
|
1628
|
+
* the icon positions from the given selection comments + the machine
|
|
1629
|
+
* snapshot's `editingCommentId` / `comments` (the editing range may belong
|
|
1630
|
+
* to a comment whose content is not yet committed, hence the fallback).
|
|
1631
|
+
*/
|
|
1632
|
+
update(e) {
|
|
1633
|
+
const t = tt();
|
|
1634
|
+
if (!t) return;
|
|
1635
|
+
const n = et(), i = et(), r = /* @__PURE__ */ new Map(), s = [], a = this.ctx.getSnapshot();
|
|
1636
|
+
for (const h of e) {
|
|
1637
|
+
if (!h.selection) continue;
|
|
1638
|
+
const u = this.ctx.host.querySelector(
|
|
1639
|
+
`[${z}="${h.targetId}"]`
|
|
1640
|
+
);
|
|
1641
|
+
if (!u) continue;
|
|
1642
|
+
const p = Q(u, h.selection);
|
|
1643
|
+
if (!p) continue;
|
|
1644
|
+
r.set(h.commentId, p), h.commentId === a.editingCommentId ? i.add(p) : n.add(p);
|
|
1645
|
+
const g = this.iconPositionForRange(h.commentId, p);
|
|
1646
|
+
g && s.push(g);
|
|
1647
|
+
}
|
|
1648
|
+
const l = a.editingCommentId;
|
|
1649
|
+
if (l && !r.has(l)) {
|
|
1650
|
+
const h = a.comments.find(
|
|
1651
|
+
(u) => u.commentId === l
|
|
1652
|
+
);
|
|
1653
|
+
if (h != null && h.selection) {
|
|
1654
|
+
const u = this.ctx.host.querySelector(
|
|
1655
|
+
`[${z}="${h.targetId}"]`
|
|
1656
|
+
);
|
|
1657
|
+
if (u) {
|
|
1658
|
+
const p = Q(u, h.selection);
|
|
1659
|
+
p && i.add(p);
|
|
1660
|
+
}
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
this.ranges = r, t.set(
|
|
1664
|
+
ht,
|
|
1665
|
+
n
|
|
1666
|
+
), t.set(mt, i), this.ctx.icons.positions = s;
|
|
1667
|
+
}
|
|
1668
|
+
// Page-coordinate position of a selection comment's icon, anchored to the
|
|
1669
|
+
// end of its range (so it sits just past the selected text).
|
|
1670
|
+
iconPositionForRange(e, t) {
|
|
1671
|
+
const n = t.getClientRects(), i = n[n.length - 1];
|
|
1672
|
+
return i ? {
|
|
1673
|
+
commentId: e,
|
|
1674
|
+
top: i.top + window.scrollY,
|
|
1675
|
+
left: i.right + window.scrollX
|
|
1676
|
+
} : null;
|
|
1677
|
+
}
|
|
1678
|
+
/** Clear all three highlight registries, the `rangeMap`, and icon positions. */
|
|
1679
|
+
clear() {
|
|
1680
|
+
const e = tt();
|
|
1681
|
+
e && (e.delete(ht), e.delete(mt), e.delete(G)), this.ranges.clear(), this.ctx.icons.positions = [];
|
|
1682
|
+
}
|
|
1683
|
+
/** Capture-phase scroll + resize listeners, so icons recompute on any scroll. */
|
|
1684
|
+
attachListeners() {
|
|
1685
|
+
window.addEventListener("scroll", this.reposition, !0), window.addEventListener("resize", this.reposition);
|
|
1686
|
+
}
|
|
1687
|
+
/** Remove listeners and cancel any pending rAF. */
|
|
1688
|
+
detachListeners() {
|
|
1689
|
+
window.removeEventListener("scroll", this.reposition, !0), window.removeEventListener("resize", this.reposition), this.repositionRaf && cancelAnimationFrame(this.repositionRaf);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
const ae = "$mod+Shift+M", it = class it extends HTMLElement {
|
|
1322
1693
|
constructor() {
|
|
1323
|
-
super(...arguments), this.persistence =
|
|
1694
|
+
super(...arguments), this.persistence = ct, this.manager = null, this.hoveredComment = null, this.selectionJustHandled = !1, this.selectionComments = [], this.commentDialog = null, this.commentDialogAnchorId = null, this.overallDialog = null, this.onPointerUp = () => {
|
|
1324
1695
|
if (!this.isAnnotating()) return;
|
|
1325
1696
|
const e = window.getSelection();
|
|
1326
1697
|
if (!e || e.isCollapsed || e.rangeCount === 0)
|
|
1327
1698
|
return;
|
|
1328
|
-
const t = e.getRangeAt(0),
|
|
1329
|
-
if (!
|
|
1330
|
-
const
|
|
1331
|
-
if (
|
|
1699
|
+
const t = e.getRangeAt(0), n = Y(t.startContainer);
|
|
1700
|
+
if (!n) return;
|
|
1701
|
+
const i = Y(t.endContainer);
|
|
1702
|
+
if (i && i !== n) {
|
|
1332
1703
|
e.removeAllRanges();
|
|
1333
1704
|
return;
|
|
1334
1705
|
}
|
|
1335
|
-
if (!
|
|
1336
|
-
const
|
|
1337
|
-
if (!
|
|
1338
|
-
e.removeAllRanges(), e.addRange(
|
|
1706
|
+
if (!i || !Ft(e, n)) {
|
|
1707
|
+
const a = Ut(e, n);
|
|
1708
|
+
if (!a) return;
|
|
1709
|
+
e.removeAllRanges(), e.addRange(a);
|
|
1339
1710
|
}
|
|
1340
|
-
const r =
|
|
1711
|
+
const r = n.getAttribute(z);
|
|
1341
1712
|
if (!r) return;
|
|
1342
|
-
const
|
|
1343
|
-
|
|
1713
|
+
const s = zt(n);
|
|
1714
|
+
s && (e.removeAllRanges(), this.selectionJustHandled = !0, this.actor.send({
|
|
1344
1715
|
type: "SELECT_TEXT",
|
|
1345
1716
|
targetId: r,
|
|
1346
|
-
targetElement:
|
|
1347
|
-
selectionRange:
|
|
1717
|
+
targetElement: n,
|
|
1718
|
+
selectionRange: s
|
|
1348
1719
|
}));
|
|
1349
1720
|
}, this.onPointerMove = (e) => {
|
|
1350
1721
|
if (!this.isAnnotating()) return;
|
|
1351
|
-
const t =
|
|
1722
|
+
const t = tt();
|
|
1352
1723
|
if (!t) return;
|
|
1353
|
-
const
|
|
1354
|
-
if (!
|
|
1355
|
-
this.hoveredComment && (t.delete(
|
|
1724
|
+
const n = this.caretPosition(e.clientX, e.clientY);
|
|
1725
|
+
if (!n) {
|
|
1726
|
+
this.hoveredComment && (t.delete(G), this.hoveredComment = null);
|
|
1356
1727
|
return;
|
|
1357
1728
|
}
|
|
1358
|
-
let
|
|
1359
|
-
for (const [r,
|
|
1360
|
-
if (
|
|
1361
|
-
|
|
1729
|
+
let i = null;
|
|
1730
|
+
for (const [r, s] of this.painter.rangeMap)
|
|
1731
|
+
if (s.isPointInRange(n.offsetNode, n.offset)) {
|
|
1732
|
+
i = r;
|
|
1362
1733
|
break;
|
|
1363
1734
|
}
|
|
1364
|
-
if (
|
|
1365
|
-
if (this.hoveredComment =
|
|
1366
|
-
const r = this.rangeMap.get(
|
|
1735
|
+
if (i !== this.hoveredComment)
|
|
1736
|
+
if (this.hoveredComment = i, i) {
|
|
1737
|
+
const r = this.painter.rangeMap.get(i);
|
|
1367
1738
|
r && t.set(
|
|
1368
|
-
|
|
1369
|
-
|
|
1739
|
+
G,
|
|
1740
|
+
et(r)
|
|
1370
1741
|
);
|
|
1371
1742
|
} else
|
|
1372
|
-
t.delete(
|
|
1743
|
+
t.delete(G);
|
|
1373
1744
|
}, this.onClickCapture = (e) => {
|
|
1374
1745
|
if (!this.isAnnotating() || e.defaultPrevented) return;
|
|
1375
1746
|
if (this.selectionJustHandled) {
|
|
@@ -1378,40 +1749,40 @@ const lt = class lt extends HTMLElement {
|
|
|
1378
1749
|
}
|
|
1379
1750
|
const t = window.getSelection();
|
|
1380
1751
|
if (t && !t.isCollapsed) return;
|
|
1381
|
-
const
|
|
1382
|
-
if (
|
|
1383
|
-
for (const [
|
|
1384
|
-
if (l.isPointInRange(
|
|
1385
|
-
const
|
|
1386
|
-
(
|
|
1752
|
+
const n = this.caretPosition(e.clientX, e.clientY);
|
|
1753
|
+
if (n) {
|
|
1754
|
+
for (const [a, l] of this.painter.rangeMap)
|
|
1755
|
+
if (l.isPointInRange(n.offsetNode, n.offset)) {
|
|
1756
|
+
const h = this.selectionComments.find(
|
|
1757
|
+
(p) => p.commentId === a
|
|
1387
1758
|
);
|
|
1759
|
+
if (!h) continue;
|
|
1760
|
+
const u = Y(n.offsetNode);
|
|
1388
1761
|
if (!u) continue;
|
|
1389
|
-
const m = Z(i.offsetNode);
|
|
1390
|
-
if (!m) continue;
|
|
1391
1762
|
e.stopPropagation(), e.preventDefault(), this.actor.send({
|
|
1392
1763
|
type: "CLICK",
|
|
1393
|
-
targetId:
|
|
1394
|
-
element:
|
|
1395
|
-
selectionCommentId:
|
|
1764
|
+
targetId: h.targetId,
|
|
1765
|
+
element: u,
|
|
1766
|
+
selectionCommentId: a
|
|
1396
1767
|
});
|
|
1397
1768
|
return;
|
|
1398
1769
|
}
|
|
1399
1770
|
}
|
|
1400
|
-
const
|
|
1771
|
+
const i = e.target, s = i.closest(
|
|
1401
1772
|
".review-highlight-hover, .review-highlight-commented, .review-highlight-editing"
|
|
1402
1773
|
);
|
|
1403
|
-
if (
|
|
1774
|
+
if (s && this.contains(s)) {
|
|
1404
1775
|
e.stopPropagation(), e.preventDefault();
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1776
|
+
const a = _(i, this.customTargets);
|
|
1777
|
+
a ? this.actor.send({
|
|
1407
1778
|
type: "CLICK",
|
|
1408
|
-
targetId:
|
|
1409
|
-
element:
|
|
1779
|
+
targetId: a.targetId,
|
|
1780
|
+
element: a.element
|
|
1410
1781
|
}) : this.actor.send({ type: "CLICK" });
|
|
1411
1782
|
}
|
|
1412
1783
|
}, this.onWrapperClick = (e) => {
|
|
1413
1784
|
if (!this.contains(e.target) || !this.isAnnotating()) return;
|
|
1414
|
-
const t =
|
|
1785
|
+
const t = _(e.target, this.customTargets);
|
|
1415
1786
|
t ? (e.stopPropagation(), e.preventDefault(), this.actor.send({
|
|
1416
1787
|
type: "CLICK",
|
|
1417
1788
|
targetId: t.targetId,
|
|
@@ -1420,40 +1791,40 @@ const lt = class lt extends HTMLElement {
|
|
|
1420
1791
|
}, this.onMouseOver = (e) => {
|
|
1421
1792
|
const t = this.manager;
|
|
1422
1793
|
if (!t || !this.isAnnotating()) return;
|
|
1423
|
-
const
|
|
1794
|
+
const n = this.currentEditingTargetId(), i = _(
|
|
1424
1795
|
e.target,
|
|
1425
1796
|
this.customTargets
|
|
1426
1797
|
);
|
|
1427
|
-
if (
|
|
1428
|
-
t.applyHover(
|
|
1798
|
+
if (i) {
|
|
1799
|
+
t.applyHover(i.element, n);
|
|
1429
1800
|
return;
|
|
1430
1801
|
}
|
|
1431
1802
|
const r = e.target.closest(
|
|
1432
1803
|
"[data-review-selectable]"
|
|
1433
1804
|
);
|
|
1434
|
-
r && t.applyHover(r,
|
|
1805
|
+
r && t.applyHover(r, n);
|
|
1435
1806
|
}, this.onMouseOut = (e) => {
|
|
1436
1807
|
const t = this.manager;
|
|
1437
1808
|
if (!t || !this.isAnnotating()) return;
|
|
1438
|
-
const
|
|
1439
|
-
for (const
|
|
1440
|
-
!
|
|
1441
|
-
const r =
|
|
1809
|
+
const n = this.currentEditingTargetId(), i = /* @__PURE__ */ new Set();
|
|
1810
|
+
for (const a of this.actor.getSnapshot().context.comments)
|
|
1811
|
+
!a.selection && a.content.trim() && i.add(a.targetId);
|
|
1812
|
+
const r = _(
|
|
1442
1813
|
e.target,
|
|
1443
1814
|
this.customTargets
|
|
1444
1815
|
);
|
|
1445
1816
|
if (r) {
|
|
1446
|
-
t.clearHover(r.element,
|
|
1817
|
+
t.clearHover(r.element, n, i);
|
|
1447
1818
|
return;
|
|
1448
1819
|
}
|
|
1449
|
-
const
|
|
1820
|
+
const s = e.target.closest(
|
|
1450
1821
|
"[data-review-selectable]"
|
|
1451
1822
|
);
|
|
1452
|
-
|
|
1823
|
+
s && t.clearHover(s, n, i);
|
|
1453
1824
|
};
|
|
1454
1825
|
}
|
|
1455
1826
|
get shortcut() {
|
|
1456
|
-
return this.getAttribute("shortcut") ??
|
|
1827
|
+
return this.getAttribute("shortcut") ?? ae;
|
|
1457
1828
|
}
|
|
1458
1829
|
get barPosition() {
|
|
1459
1830
|
return this.getAttribute("bar-position") ?? "bottom-center";
|
|
@@ -1466,11 +1837,11 @@ const lt = class lt extends HTMLElement {
|
|
|
1466
1837
|
return e != null && e.trim() ? e : null;
|
|
1467
1838
|
}
|
|
1468
1839
|
connectedCallback() {
|
|
1469
|
-
|
|
1840
|
+
Tt("review", Nt), this.style.position === "" && (this.style.position = "relative"), this.style.display === "" && (this.style.display = "block");
|
|
1470
1841
|
const e = this.buildHighlightCallbacks();
|
|
1471
|
-
this.persistence = this.persistKey ?
|
|
1472
|
-
const t =
|
|
1473
|
-
this.actor =
|
|
1842
|
+
this.persistence = this.persistKey ? Ht(this.persistKey) : ct;
|
|
1843
|
+
const t = Mt();
|
|
1844
|
+
this.actor = St(t, {
|
|
1474
1845
|
input: {
|
|
1475
1846
|
shortcut: this.shortcut,
|
|
1476
1847
|
initialData: this.initialData,
|
|
@@ -1478,13 +1849,16 @@ const lt = class lt extends HTMLElement {
|
|
|
1478
1849
|
highlights: e,
|
|
1479
1850
|
persistence: this.persistence
|
|
1480
1851
|
}
|
|
1481
|
-
}), this.actor.on("REVIEW_CHANGED", (
|
|
1852
|
+
}), this.actor.on("REVIEW_CHANGED", (n) => this.emitChange(n.result)), this.actor.on("REVIEW_SUBMITTED", (n) => this.emitSubmit(n.result)), this.mountChrome(), this.painter = new se({
|
|
1853
|
+
host: this,
|
|
1854
|
+
icons: this.icons,
|
|
1855
|
+
getSnapshot: () => this.actor.getSnapshot().context,
|
|
1856
|
+
isAnnotating: () => this.isAnnotating()
|
|
1857
|
+
}), this.actor.subscribe(() => this.syncFromSnapshot()), this.actor.start(), this.manager = kt(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.painter.attachListeners(), this.syncFromSnapshot();
|
|
1482
1858
|
}
|
|
1483
1859
|
disconnectedCallback() {
|
|
1484
|
-
var t,
|
|
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);
|
|
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();
|
|
1860
|
+
var e, t, n, i, r, s, a, l;
|
|
1861
|
+
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), (e = this.painter) == null || e.detachListeners(), (t = this.painter) == null || t.clear(), (n = this.manager) == null || n.destroy(), this.manager = null, (i = this.actor) == null || i.stop(), (r = this.bar) == null || r.remove(), (s = this.commentDialog) == null || s.remove(), (a = this.overallDialog) == null || a.remove(), (l = this.icons) == null || l.remove();
|
|
1488
1862
|
}
|
|
1489
1863
|
attributeChangedCallback() {
|
|
1490
1864
|
this.bar && (this.bar.barPosition = this.barPosition);
|
|
@@ -1492,7 +1866,11 @@ const lt = class lt extends HTMLElement {
|
|
|
1492
1866
|
buildDetailResult(e) {
|
|
1493
1867
|
return e.status === "commented" ? {
|
|
1494
1868
|
...e,
|
|
1495
|
-
comments:
|
|
1869
|
+
comments: qt(
|
|
1870
|
+
e.comments,
|
|
1871
|
+
this,
|
|
1872
|
+
this.customTargets
|
|
1873
|
+
)
|
|
1496
1874
|
} : e;
|
|
1497
1875
|
}
|
|
1498
1876
|
emitChange(e) {
|
|
@@ -1525,10 +1903,10 @@ const lt = class lt extends HTMLElement {
|
|
|
1525
1903
|
// null when the range can't be restored, so the dialog falls back to anchoring
|
|
1526
1904
|
// on the whole element.
|
|
1527
1905
|
selectionAnchor(e, t) {
|
|
1528
|
-
const
|
|
1529
|
-
return
|
|
1530
|
-
getBoundingClientRect: () =>
|
|
1531
|
-
getClientRects: () =>
|
|
1906
|
+
const n = Q(e, t);
|
|
1907
|
+
return n ? {
|
|
1908
|
+
getBoundingClientRect: () => n.getBoundingClientRect(),
|
|
1909
|
+
getClientRects: () => n.getClientRects(),
|
|
1532
1910
|
contextElement: e
|
|
1533
1911
|
} : null;
|
|
1534
1912
|
}
|
|
@@ -1553,26 +1931,26 @@ const lt = class lt extends HTMLElement {
|
|
|
1553
1931
|
), document.body.append(this.icons);
|
|
1554
1932
|
}
|
|
1555
1933
|
onIconClick(e) {
|
|
1556
|
-
const t = this.actor.getSnapshot().context.comments.find((
|
|
1934
|
+
const t = this.actor.getSnapshot().context.comments.find((i) => i.commentId === e);
|
|
1557
1935
|
if (!t) return;
|
|
1558
|
-
const
|
|
1559
|
-
`[${
|
|
1936
|
+
const n = this.querySelector(
|
|
1937
|
+
`[${z}="${t.targetId}"]`
|
|
1560
1938
|
);
|
|
1561
|
-
|
|
1939
|
+
n && this.actor.send({
|
|
1562
1940
|
type: "CLICK",
|
|
1563
1941
|
targetId: t.targetId,
|
|
1564
|
-
element:
|
|
1942
|
+
element: n,
|
|
1565
1943
|
selectionCommentId: e
|
|
1566
1944
|
});
|
|
1567
1945
|
}
|
|
1568
|
-
// --- snapshot → UI sync
|
|
1946
|
+
// --- snapshot → UI sync ---
|
|
1569
1947
|
syncFromSnapshot() {
|
|
1570
|
-
const e = this.actor.getSnapshot(), { comments: t, overallComment:
|
|
1948
|
+
const e = this.actor.getSnapshot(), { comments: t, overallComment: n, editingCommentId: i, targetElement: r } = e.context;
|
|
1571
1949
|
this.selectionComments = t.filter(
|
|
1572
1950
|
(g) => g.selection && g.content.trim()
|
|
1573
1951
|
);
|
|
1574
|
-
const
|
|
1575
|
-
this.bar.mode =
|
|
1952
|
+
const s = !e.matches({ annotating: "inactive" }), a = e.matches({ commenting: "editing" }), l = i ? t.find((g) => g.commentId === i) : null, h = a && i === null, u = t.filter((g) => g.content.trim()).length, p = n.trim().length > 0;
|
|
1953
|
+
this.bar.mode = s ? l ? "editing" : "commenting" : "idle", this.bar.commentCount = u, this.bar.hasOverallComment = p, this.bar.overallCommentOpen = h, this.icons.style.display = s ? "" : "none", a && l && r ? (this.commentDialog || (this.commentDialog = document.createElement(
|
|
1576
1954
|
"llumi-comment-dialog"
|
|
1577
1955
|
), this.commentDialog.addEventListener(
|
|
1578
1956
|
"change",
|
|
@@ -1586,7 +1964,7 @@ const lt = class lt extends HTMLElement {
|
|
|
1586
1964
|
), this.commentDialog.addEventListener(
|
|
1587
1965
|
"close",
|
|
1588
1966
|
() => this.actor.send({ type: "CLOSE" })
|
|
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),
|
|
1967
|
+
), 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), h ? (this.overallDialog || (this.overallDialog = document.createElement(
|
|
1590
1968
|
"llumi-overall-comment-dialog"
|
|
1591
1969
|
), this.overallDialog.addEventListener(
|
|
1592
1970
|
"change",
|
|
@@ -1597,9 +1975,9 @@ const lt = class lt extends HTMLElement {
|
|
|
1597
1975
|
), this.overallDialog.addEventListener(
|
|
1598
1976
|
"close",
|
|
1599
1977
|
() => this.actor.send({ type: "CLOSE" })
|
|
1600
|
-
), document.body.append(this.overallDialog)), this.overallDialog.barElement = this.bar.barRoot, this.overallDialog.value =
|
|
1978
|
+
), document.body.append(this.overallDialog)), this.overallDialog.barElement = this.bar.barRoot, this.overallDialog.value = n) : this.overallDialog && (this.overallDialog.remove(), this.overallDialog = null), s && this.painter.update(this.selectionComments);
|
|
1601
1979
|
}
|
|
1602
|
-
// --- highlight callbacks
|
|
1980
|
+
// --- highlight callbacks ---
|
|
1603
1981
|
buildHighlightCallbacks() {
|
|
1604
1982
|
return {
|
|
1605
1983
|
activate: (e) => {
|
|
@@ -1607,16 +1985,13 @@ const lt = class lt extends HTMLElement {
|
|
|
1607
1985
|
t && (t.activate(e), t.startObserving({
|
|
1608
1986
|
editingTarget: this.actor.getSnapshot().context.targetElement,
|
|
1609
1987
|
onTargetDisconnected: () => this.actor.send({ type: "CLOSE" }),
|
|
1610
|
-
onSelectableReconnected: () => this.
|
|
1988
|
+
onSelectableReconnected: () => this.painter.update(this.selectionComments),
|
|
1611
1989
|
commentedIds: e
|
|
1612
1990
|
}));
|
|
1613
1991
|
},
|
|
1614
1992
|
deactivate: () => {
|
|
1615
1993
|
const e = this.manager;
|
|
1616
|
-
|
|
1617
|
-
e.deactivate(), e.stopObserving();
|
|
1618
|
-
const t = G();
|
|
1619
|
-
t && (t.delete(tt), t.delete(et), t.delete(L)), this.rangeMap.clear(), this.icons.positions = [];
|
|
1994
|
+
e && (e.deactivate(), e.stopObserving(), this.painter.clear());
|
|
1620
1995
|
},
|
|
1621
1996
|
reveal: (e) => {
|
|
1622
1997
|
var t;
|
|
@@ -1627,66 +2002,25 @@ const lt = class lt extends HTMLElement {
|
|
|
1627
2002
|
return (e = this.manager) == null ? void 0 : e.unreveal();
|
|
1628
2003
|
},
|
|
1629
2004
|
setEditing: (e, t) => {
|
|
1630
|
-
var
|
|
1631
|
-
(
|
|
2005
|
+
var n;
|
|
2006
|
+
(n = this.manager) == null || n.setEditing(e, t), this.painter.update(this.selectionComments);
|
|
1632
2007
|
},
|
|
1633
2008
|
clearEditing: (e, t) => {
|
|
1634
|
-
var
|
|
1635
|
-
(
|
|
2009
|
+
var n;
|
|
2010
|
+
(n = this.manager) == null || n.clearEditing(e, t), this.painter.update(this.selectionComments);
|
|
1636
2011
|
}
|
|
1637
2012
|
};
|
|
1638
2013
|
}
|
|
1639
|
-
// --- selection highlight painting (port of updateSelectionHighlights) ---
|
|
1640
|
-
updateSelectionHighlights() {
|
|
1641
|
-
const e = G();
|
|
1642
|
-
if (!e) return;
|
|
1643
|
-
const t = nt(), i = nt(), o = /* @__PURE__ */ new Map(), r = [], a = this.actor.getSnapshot().context;
|
|
1644
|
-
for (const l of this.selectionComments) {
|
|
1645
|
-
if (!l.selection) continue;
|
|
1646
|
-
const u = this.querySelector(
|
|
1647
|
-
`[${H}="${l.targetId}"]`
|
|
1648
|
-
);
|
|
1649
|
-
if (!u) continue;
|
|
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];
|
|
1654
|
-
g && r.push({
|
|
1655
|
-
commentId: l.commentId,
|
|
1656
|
-
top: g.top + window.scrollY,
|
|
1657
|
-
left: g.right + window.scrollX
|
|
1658
|
-
});
|
|
1659
|
-
}
|
|
1660
|
-
const s = a.editingCommentId;
|
|
1661
|
-
if (s && !o.has(s)) {
|
|
1662
|
-
const l = a.comments.find(
|
|
1663
|
-
(u) => u.commentId === s
|
|
1664
|
-
);
|
|
1665
|
-
if (l != null && l.selection) {
|
|
1666
|
-
const u = this.querySelector(
|
|
1667
|
-
`[${H}="${l.targetId}"]`
|
|
1668
|
-
);
|
|
1669
|
-
if (u) {
|
|
1670
|
-
const m = Q(u, l.selection);
|
|
1671
|
-
m && i.add(m);
|
|
1672
|
-
}
|
|
1673
|
-
}
|
|
1674
|
-
}
|
|
1675
|
-
this.rangeMap = o, e.set(
|
|
1676
|
-
tt,
|
|
1677
|
-
t
|
|
1678
|
-
), e.set(et, i), this.icons.positions = r;
|
|
1679
|
-
}
|
|
1680
2014
|
isAnnotating() {
|
|
1681
2015
|
return !this.actor.getSnapshot().matches({ annotating: "inactive" });
|
|
1682
2016
|
}
|
|
1683
2017
|
caretPosition(e, t) {
|
|
1684
2018
|
if ("caretPositionFromPoint" in document) {
|
|
1685
|
-
const
|
|
1686
|
-
if (
|
|
2019
|
+
const n = document.caretPositionFromPoint(e, t);
|
|
2020
|
+
if (n) return n;
|
|
1687
2021
|
} else if ("caretRangeFromPoint" in document) {
|
|
1688
|
-
const
|
|
1689
|
-
if (
|
|
2022
|
+
const n = document.caretRangeFromPoint(e, t);
|
|
2023
|
+
if (n) return { offsetNode: n.startContainer, offset: n.startOffset };
|
|
1690
2024
|
}
|
|
1691
2025
|
return null;
|
|
1692
2026
|
}
|
|
@@ -1694,17 +2028,17 @@ const lt = class lt extends HTMLElement {
|
|
|
1694
2028
|
var t;
|
|
1695
2029
|
const e = this.actor.getSnapshot().context;
|
|
1696
2030
|
if (e.editingCommentId)
|
|
1697
|
-
return ((t = e.comments.find((
|
|
2031
|
+
return ((t = e.comments.find((n) => n.commentId === e.editingCommentId)) == null ? void 0 : t.targetId) ?? void 0;
|
|
1698
2032
|
}
|
|
1699
2033
|
};
|
|
1700
|
-
|
|
1701
|
-
let
|
|
1702
|
-
customElements.get("llumi-review") || customElements.define("llumi-review",
|
|
2034
|
+
it.observedAttributes = ["bar-position", "shortcut", "default-mode"];
|
|
2035
|
+
let nt = it;
|
|
2036
|
+
customElements.get("llumi-review") || customElements.define("llumi-review", nt);
|
|
1703
2037
|
export {
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
2038
|
+
S as LlumiCommentDialog,
|
|
2039
|
+
I as LlumiDefaultEditor,
|
|
2040
|
+
L as LlumiOverallCommentDialog,
|
|
2041
|
+
nt as LlumiReview,
|
|
2042
|
+
b as LlumiReviewBar,
|
|
2043
|
+
Z as LlumiSelectionCommentIcons
|
|
1710
2044
|
};
|