mesurer-solid 0.2.0-beta.0 → 0.2.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +141 -144
- package/dist/inject-script.js +4 -4
- package/dist/inject.js +147 -150
- package/dist/plugins.js +337 -336
- package/package.json +1 -1
package/dist/plugins.js
CHANGED
|
@@ -127,21 +127,21 @@ function ee(e, t) {
|
|
|
127
127
|
}
|
|
128
128
|
function N() {
|
|
129
129
|
if (E) {
|
|
130
|
-
|
|
130
|
+
F();
|
|
131
131
|
return;
|
|
132
132
|
}
|
|
133
133
|
T || (T = !0, !O && !U.gt && queueMicrotask(W));
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function P(e) {
|
|
136
136
|
if (E) return;
|
|
137
137
|
E = !0;
|
|
138
138
|
let t = "[REACTIVITY_HALTED]";
|
|
139
139
|
e === void 0 ? console.error(t) : console.error(t, e);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function F() {
|
|
142
142
|
D || (D = !0, console.error("[REACTIVITY_HALTED]"));
|
|
143
143
|
}
|
|
144
|
-
var
|
|
144
|
+
var te = 0, I = class {
|
|
145
145
|
ke = null;
|
|
146
146
|
bt = [[], []];
|
|
147
147
|
vt = [];
|
|
@@ -162,7 +162,7 @@ var ne = 0, F = class {
|
|
|
162
162
|
let t = this.bt[e - 1];
|
|
163
163
|
this.bt[e - 1] = [], oe(t, e);
|
|
164
164
|
}
|
|
165
|
-
let t = this.vt, n = ++
|
|
165
|
+
let t = this.vt, n = ++te;
|
|
166
166
|
for (let r = 0; r < t.length;) {
|
|
167
167
|
let i = t[r];
|
|
168
168
|
if (i.kt !== n && (i.kt = n, i.run?.(e), t[r] !== i)) {
|
|
@@ -192,7 +192,7 @@ var ne = 0, F = class {
|
|
|
192
192
|
r && r.restoreQueues(n);
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
},
|
|
195
|
+
}, L = class e extends I {
|
|
196
196
|
gt = !1;
|
|
197
197
|
m = M();
|
|
198
198
|
static Ce;
|
|
@@ -242,7 +242,7 @@ var ne = 0, F = class {
|
|
|
242
242
|
let e = M();
|
|
243
243
|
e.Qt = n.Qt, e.Me = n.Me, e.A = n.A, e.cn = n.cn, ae = this.m = e;
|
|
244
244
|
}
|
|
245
|
-
} else A(this) ? (
|
|
245
|
+
} else A(this) ? (ne(), b.EE >= b.Ve && (ye(b, e.Ce), ne())) : (y.size && ye(x, e.Ce), re());
|
|
246
246
|
C++, T = b.EE >= b.Ve, f.size && e.In(1), this.run(1), f.size && e.In(2), this.run(2);
|
|
247
247
|
} finally {
|
|
248
248
|
this.gt = !1;
|
|
@@ -294,12 +294,12 @@ var ne = 0, F = class {
|
|
|
294
294
|
for (let e of f) e.Ne ||= w;
|
|
295
295
|
}
|
|
296
296
|
};
|
|
297
|
-
function
|
|
297
|
+
function R(e) {
|
|
298
298
|
ae.Qt.push(e);
|
|
299
299
|
}
|
|
300
|
-
var
|
|
301
|
-
function
|
|
302
|
-
let n = e.Ke || tt, r = e.Le !== void 0, i =
|
|
300
|
+
var z = !1;
|
|
301
|
+
function B(e, t = !1) {
|
|
302
|
+
let n = e.Ke || tt, r = e.Le !== void 0, i = z;
|
|
303
303
|
for (let o = e.o; o !== null; o = o.le) {
|
|
304
304
|
if (i && (o.fe.se &= ~a), r && o.fe.T & 8) {
|
|
305
305
|
o.fe.se |= 256;
|
|
@@ -308,31 +308,31 @@ function z(e, t = !1) {
|
|
|
308
308
|
t && n ? (o.fe.se |= 128, v(o.fe, n)) : t && (o.fe.se |= 128, o.fe.Ke = void 0), fe(o.fe);
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
|
-
function
|
|
311
|
+
function V(e) {
|
|
312
312
|
let t = e;
|
|
313
313
|
if (!t.ce) {
|
|
314
|
-
e.De !== o && (e.Ue = e.De, e.De = o), (e.ge || e.pe) &&
|
|
314
|
+
e.De !== o && (e.Ue = e.De, e.De = o), (e.ge || e.pe) && L.un(e);
|
|
315
315
|
return;
|
|
316
316
|
}
|
|
317
|
-
e.De !== o && (e.Ue = e.De, e.De = o, e.Re && e.Re !== 3 && (e.Je = !0)), t.Ee = !1, t.se &= ~i, t.S & 1 || (t.S &= -5), (t.We !== null || t.Qe !== null) &&
|
|
317
|
+
e.De !== o && (e.Ue = e.De, e.De = o, e.Re && e.Re !== 3 && (e.Je = !0)), t.Ee = !1, t.se &= ~i, t.S & 1 || (t.S &= -5), (t.We !== null || t.Qe !== null) && L.me(t, !1, !0), (e.ge || e.pe) && L.un(e);
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function ne() {
|
|
320
320
|
let e = ae.Qt;
|
|
321
|
-
for (let t = 0; t < e.length; t++)
|
|
321
|
+
for (let t = 0; t < e.length; t++) V(e[t]);
|
|
322
322
|
e.length = 0;
|
|
323
323
|
}
|
|
324
324
|
function re(e = null, t = !1) {
|
|
325
325
|
let n = !t;
|
|
326
|
-
n &&
|
|
326
|
+
n && ne(), !t && U.vt.length && H(U);
|
|
327
327
|
let r = b.EE >= b.Ve;
|
|
328
|
-
if (r && ye(b,
|
|
329
|
-
r &&
|
|
328
|
+
if (r && ye(b, L.Ce), n) {
|
|
329
|
+
r && ne();
|
|
330
330
|
let t = e ?? U.m;
|
|
331
|
-
if (t.Me.length &&
|
|
331
|
+
if (t.Me.length && L.En(t.Me), t.ln.size) {
|
|
332
332
|
for (let e of t.ln) e.se & 64 || fe(e);
|
|
333
333
|
t.ln.clear(), N();
|
|
334
334
|
}
|
|
335
|
-
t.A.length && (
|
|
335
|
+
t.A.length && (L.G(t.A), U.vt.length && H(U)), t.cn.size && L.Dt(t.cn, e), j(), f.size && L.dn(e);
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
338
|
function H(e) {
|
|
@@ -341,7 +341,7 @@ function H(e) {
|
|
|
341
341
|
function ie(e) {
|
|
342
342
|
for (let t = 0; t < e.length; t++) e[t].Ne = w;
|
|
343
343
|
}
|
|
344
|
-
var U = new
|
|
344
|
+
var U = new L(), ae = U.m;
|
|
345
345
|
function W(e) {
|
|
346
346
|
if (e) {
|
|
347
347
|
O++;
|
|
@@ -391,7 +391,7 @@ function ce(e) {
|
|
|
391
391
|
break;
|
|
392
392
|
}
|
|
393
393
|
}
|
|
394
|
-
return t &&
|
|
394
|
+
return t && L.Tn?.(e) && (t = !1), t && (e.fn = !0), t;
|
|
395
395
|
}
|
|
396
396
|
function le(e) {
|
|
397
397
|
for (; e.fn && typeof e.fn == "object";) e = e.fn;
|
|
@@ -498,7 +498,7 @@ function Se(e, t = !1, n) {
|
|
|
498
498
|
if (t) {
|
|
499
499
|
e.se = r | 64;
|
|
500
500
|
let t = e;
|
|
501
|
-
(t.ge || t.pe) &&
|
|
501
|
+
(t.ge || t.pe) && L.un(t);
|
|
502
502
|
}
|
|
503
503
|
t && e.ce && (e.Te = null);
|
|
504
504
|
let i = n ? e.We : e.Fe;
|
|
@@ -686,7 +686,7 @@ function Ge(e, t) {
|
|
|
686
686
|
He(e, i), n && N();
|
|
687
687
|
}
|
|
688
688
|
function Ke(e) {
|
|
689
|
-
let t = !1, n, r = /* @__PURE__ */ new Set(), i =
|
|
689
|
+
let t = !1, n, r = /* @__PURE__ */ new Set(), i = L.Se, a = (o) => {
|
|
690
690
|
if (r.has(o) || !Re(o, e)) return;
|
|
691
691
|
r.add(o), o.de = C;
|
|
692
692
|
let s = o.oe?.values().next().value, c = o.S & 2;
|
|
@@ -726,11 +726,11 @@ function Je(t, n, r) {
|
|
|
726
726
|
Pe(t), Ye(t);
|
|
727
727
|
let s = h(t);
|
|
728
728
|
if (s && s.Ae.delete(t), r) r(e), a && Ye(t, !0);
|
|
729
|
-
else if (t._e !== void 0) t.De === o &&
|
|
729
|
+
else if (t._e !== void 0) t.De === o && R(t), t.De = e, L.Pe !== null && L.Pe(t, e), _(t) || B(t), t.de = C;
|
|
730
730
|
else if (s) {
|
|
731
731
|
let n = t.Re, r = t.Ue, i = t.be;
|
|
732
732
|
try {
|
|
733
|
-
(!n && a || !i || !i(e, r)) && (t.Ue = e, t.de = C,
|
|
733
|
+
(!n && a || !i || !i(e, r)) && (t.Ue = e, t.de = C, L.Pe !== null && L.Pe(t, e), B(t, !0));
|
|
734
734
|
} catch (e) {
|
|
735
735
|
Xe(t, 2, e);
|
|
736
736
|
}
|
|
@@ -790,12 +790,12 @@ function Je(t, n, r) {
|
|
|
790
790
|
return s;
|
|
791
791
|
}
|
|
792
792
|
function Ye(e, t = !1) {
|
|
793
|
-
e.oe && ze(e), e.ue &&= !1, e.he = !1, e.S = t ? 0 : e.S & 4, e._ && Ve(e), (e.ge || e.pe) &&
|
|
793
|
+
e.oe && ze(e), e.ue &&= !1, e.he = !1, e.S = t ? 0 : e.S & 4, e._ && Ve(e), (e.ge || e.pe) && L.Se(e), e.u && L.Oe !== null && L.Oe(e), e.i && e.i();
|
|
794
794
|
}
|
|
795
795
|
function Xe(n, r, i, a, o) {
|
|
796
796
|
r === 2 && !(i instanceof t) && !(i instanceof e) && (i = new t(n, i));
|
|
797
797
|
let s = r === 1 && i instanceof e ? i.source : void 0, c = s === n, l = r === 1 && n._e !== void 0 && !c, u = l && _(n);
|
|
798
|
-
a || (r === 1 && s ? (Le(n, s), n.S = 1 | n.S & 4, Ve(n, s, i)) : (ze(n), n.S = r | (r === 2 ? 0 : n.S & 4), n._ = i),
|
|
798
|
+
a || (r === 1 && s ? (Le(n, s), n.S = 1 | n.S & 4, Ve(n, s, i)) : (ze(n), n.S = r | (r === 2 ? 0 : n.S & 4), n._ = i), L.Se !== null && L.Se(n), n.u && L.Oe !== null && L.Oe(n)), o && !a && v(n, o);
|
|
799
799
|
let d = a || u, f = a || l ? void 0 : o;
|
|
800
800
|
if (n.i) {
|
|
801
801
|
if (a && r === 1) return;
|
|
@@ -808,11 +808,11 @@ function Xe(n, r, i, a, o) {
|
|
|
808
808
|
fe(t), N();
|
|
809
809
|
return;
|
|
810
810
|
}
|
|
811
|
-
!d && !t.Ne &&
|
|
811
|
+
!d && !t.Ne && R(t), Xe(t, r, i, d, f);
|
|
812
812
|
}
|
|
813
813
|
});
|
|
814
814
|
}
|
|
815
|
-
|
|
815
|
+
L.Ce = nt, L.me = Se;
|
|
816
816
|
var Ze = !1, Qe = !1, $e = !1, et = !1, G = null, tt = null;
|
|
817
817
|
function nt(t, n = !1) {
|
|
818
818
|
let r = t.Re;
|
|
@@ -823,10 +823,10 @@ function nt(t, n = !1) {
|
|
|
823
823
|
Ze = !0;
|
|
824
824
|
let y = et;
|
|
825
825
|
if (et = !1, i) {
|
|
826
|
-
let e =
|
|
826
|
+
let e = L.je(t, !0);
|
|
827
827
|
e && (tt = e);
|
|
828
828
|
} else if (w && !n && w.Me.length) {
|
|
829
|
-
let e =
|
|
829
|
+
let e = L.je(t, !1);
|
|
830
830
|
e && (i = !0, tt = e);
|
|
831
831
|
}
|
|
832
832
|
let b = r && r !== 2, x = Qe;
|
|
@@ -837,14 +837,14 @@ function nt(t, n = !1) {
|
|
|
837
837
|
let e = t.Te, n = t.ce(h), r = typeof n == "object" && !!n, i = t.Te !== e;
|
|
838
838
|
h = i || !r ? n : Je(t, n), !i && !r && (t.Te = null, t.Ee = !1);
|
|
839
839
|
}
|
|
840
|
-
(t.S !== 0 || t.i !== void 0 || t._ || t.he || t.ue || t.oe !== void 0 || t.ge !== void 0 || t.pe !== void 0 || t.u !== null) && Ye(t, n), t.Ke &&
|
|
840
|
+
(t.S !== 0 || t.i !== void 0 || t._ || t.he || t.ue || t.oe !== void 0 || t.ge !== void 0 || t.pe !== void 0 || t.u !== null) && Ye(t, n), t.Ke && L.ze(t);
|
|
841
841
|
} catch (n) {
|
|
842
842
|
let r = n instanceof e;
|
|
843
843
|
if (r && t.Ee) Be(t, n);
|
|
844
844
|
else {
|
|
845
|
-
r && tt &&
|
|
845
|
+
r && tt && L.$e(t);
|
|
846
846
|
let e = !1;
|
|
847
|
-
r && (t.ue = !0,
|
|
847
|
+
r && (t.ue = !0, L.Be !== null && (e = L.Be(t, f))), Xe(t, r ? 1 : 2, n, void 0, r ? t.Ke : void 0), e && L.k(t);
|
|
848
848
|
}
|
|
849
849
|
} finally {
|
|
850
850
|
Ze = _, et = y, b && (Qe = x), t.se = 0 | (n ? t.se & 256 : 0), G = m;
|
|
@@ -857,16 +857,16 @@ function nt(t, n = !1) {
|
|
|
857
857
|
} catch (e) {
|
|
858
858
|
Xe(t, 2, e);
|
|
859
859
|
}
|
|
860
|
-
if (r && a && (t.Je = !t._, n || t.C.enqueue(r, t.Xe ??=
|
|
860
|
+
if (r && a && (t.Je = !t._, n || t.C.enqueue(r, t.Xe ??= L.et.bind(null, t))), !t._) {
|
|
861
861
|
if (a) {
|
|
862
862
|
let e = l ? t._e : void 0;
|
|
863
|
-
n || r && (w !== t.Ne || w === null) || i ? (t.Ue = h, l && i && (t._e = h === void 0 ? s : h, t.De = o)) : (t.De = h, p && (t.Ee = !0), (w || t.Ne) &&
|
|
864
|
-
} else if (l) t.De === o &&
|
|
863
|
+
n || r && (w !== t.Ne || w === null) || i ? (t.Ue = h, l && i && (t._e = h === void 0 ? s : h, t.De = o)) : (t.De = h, p && (t.Ee = !0), (w || t.Ne) && L.Pe !== null && L.Pe(t, h)), t.o !== null && (!l || i || t._e !== e) && B(t, i || l);
|
|
864
|
+
} else if (l) t.De === o && R(t), t.De = h, p && (t.Ee = !0);
|
|
865
865
|
else if (t.xe != g) for (let e = t.o; e !== null; e = e.le) he(e.fe, de(e.fe));
|
|
866
866
|
}
|
|
867
867
|
d !== void 0 && !a && !t._ && Ge(t, d);
|
|
868
868
|
}
|
|
869
|
-
tt = v, (t.De !== o || t.We !== null || t.Qe !== null || t.S & 5) && (!n || t.S & 1) && (!t.Ne || l) &&
|
|
869
|
+
tt = v, (t.De !== o || t.We !== null || t.Qe !== null || t.S & 5) && (!n || t.S & 1) && (!t.Ne || l) && R(t), t.Ne && r && w !== t.Ne && ue(t.Ne, () => nt(t));
|
|
870
870
|
}
|
|
871
871
|
function rt(e) {
|
|
872
872
|
if (e.se & 1) for (let t = e.tt; t; t = t.nt) {
|
|
@@ -966,7 +966,7 @@ function st(e, t) {
|
|
|
966
966
|
let t = G.Fe;
|
|
967
967
|
t === null ? G.Fe = e : (e.He = t, t.ct = e, G.Fe = e);
|
|
968
968
|
}
|
|
969
|
-
n && (e.xe = n.xe + 1),
|
|
969
|
+
n && (e.xe = n.xe + 1), L.It !== null && L.It(e), !t?.lazy && nt(e, !0);
|
|
970
970
|
}
|
|
971
971
|
function ct(e, t, n = null) {
|
|
972
972
|
let r = {
|
|
@@ -987,11 +987,11 @@ function lt(e, t) {
|
|
|
987
987
|
return e === t;
|
|
988
988
|
}
|
|
989
989
|
function ut(e, t) {
|
|
990
|
-
if (
|
|
990
|
+
if (L.St === null && !Ze) return e();
|
|
991
991
|
let n = Ze;
|
|
992
992
|
Ze = !1;
|
|
993
993
|
try {
|
|
994
|
-
return
|
|
994
|
+
return L.St === null ? e() : L.St(e);
|
|
995
995
|
} finally {
|
|
996
996
|
Ze = n;
|
|
997
997
|
}
|
|
@@ -1000,7 +1000,7 @@ function dt(e, t) {
|
|
|
1000
1000
|
e.se & 512 ? (e.se &= -513, nt(e, !0)) : e.se & 64 ? nt(e, !0) : t && rt(e);
|
|
1001
1001
|
}
|
|
1002
1002
|
function ft(e) {
|
|
1003
|
-
if (et) return
|
|
1003
|
+
if (et) return L.At(e);
|
|
1004
1004
|
let t = G;
|
|
1005
1005
|
t?.Nt && (t = t.dt);
|
|
1006
1006
|
let n = e, r = e.lt || e;
|
|
@@ -1013,7 +1013,7 @@ function ft(e) {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
if (r.S & 1) {
|
|
1015
1015
|
if (t && !(Qe && r.Ne && w !== r.Ne)) {
|
|
1016
|
-
if (tt === null ||
|
|
1016
|
+
if (tt === null || L.Ot(r)) throw !Ze && e !== t && Ie(e, t), r._;
|
|
1017
1017
|
} else if (t && r !== e && r.S & 4) throw !Ze && e !== t && Ie(e, t), r._;
|
|
1018
1018
|
else if (!t && r.S & 4) throw r._;
|
|
1019
1019
|
}
|
|
@@ -1022,17 +1022,17 @@ function ft(e) {
|
|
|
1022
1022
|
throw r._;
|
|
1023
1023
|
}
|
|
1024
1024
|
if (e._e !== void 0 && e._e !== o) return c(e._e);
|
|
1025
|
-
if (tt !== null && w !== null && t !== null &&
|
|
1026
|
-
let i = !t || tt !== null &&
|
|
1025
|
+
if (tt !== null && w !== null && t !== null && L.Rt(e, r, t)) return e.Ue;
|
|
1026
|
+
let i = !t || tt !== null && L.Pt(e, r, t) || e.De === o || Qe && e.Ne && w !== e.Ne ? e.Ue : e.De;
|
|
1027
1027
|
return !t && r === e && typeof n.ce == "function" && e.T & 32 && !(r.S & 1) && !e.o && Fe(e), i;
|
|
1028
1028
|
}
|
|
1029
1029
|
function pt(e, t) {
|
|
1030
|
-
if (e.Ne && w !== e.Ne && U.initTransition(e.Ne), e._e !== void 0) return
|
|
1030
|
+
if (e.Ne && w !== e.Ne && U.initTransition(e.Ne), e._e !== void 0) return L.Gt(e, t);
|
|
1031
1031
|
let n = e.De === o ? e.Ue : e.De;
|
|
1032
|
-
return typeof t == "function" && (t = t(n)), e.S & 4 || !e.be || !e.be(n, t) ? (e.De === o &&
|
|
1032
|
+
return typeof t == "function" && (t = t(n)), e.S & 4 || !e.be || !e.be(n, t) ? (e.De === o && R(e), e.De = t, (e.ge !== void 0 || e.pe !== void 0) && L.Pe !== null && L.Pe(e, t), e.de = C, B(e), N(), t) : t;
|
|
1033
1033
|
}
|
|
1034
1034
|
function mt(e) {
|
|
1035
|
-
ge(e, de(e)), !(e.se & 1024) && e.De === o && (
|
|
1035
|
+
ge(e, de(e)), !(e.se & 1024) && e.De === o && (R(e), N()), e.se = e.se & -4 | i;
|
|
1036
1036
|
}
|
|
1037
1037
|
function ht(e, t) {
|
|
1038
1038
|
let n = pt(e, t);
|
|
@@ -1072,7 +1072,7 @@ function bt(e, t) {
|
|
|
1072
1072
|
this.S & 2 && (this.Je = !0, this.C.enqueue(this.Re, this.Xe ??= xt.bind(null, this)));
|
|
1073
1073
|
return;
|
|
1074
1074
|
}
|
|
1075
|
-
if (!this.C.notify(this, 2, 2)) throw
|
|
1075
|
+
if (!this.C.notify(this, 2, 2)) throw P(n(i)), i;
|
|
1076
1076
|
} else this.Re === 1 && this.C.notify(this, 3, r, i);
|
|
1077
1077
|
}
|
|
1078
1078
|
function xt(e) {
|
|
@@ -1086,7 +1086,7 @@ function xt(e) {
|
|
|
1086
1086
|
e.Tt = void 0, t?.();
|
|
1087
1087
|
}) : console.error(t);
|
|
1088
1088
|
} catch (t) {
|
|
1089
|
-
if (!e.C.notify(e, 2, 2)) throw
|
|
1089
|
+
if (!e.C.notify(e, 2, 2)) throw P(t), t;
|
|
1090
1090
|
}
|
|
1091
1091
|
return;
|
|
1092
1092
|
}
|
|
@@ -1095,12 +1095,12 @@ function xt(e) {
|
|
|
1095
1095
|
try {
|
|
1096
1096
|
r?.(), e.Tt = e.ft(e.Ue, e._t);
|
|
1097
1097
|
} catch (n) {
|
|
1098
|
-
if (e._ = new t(e, n), e.S |= 2, !e.C.notify(e, 2, 2)) throw
|
|
1098
|
+
if (e._ = new t(e, n), e.S |= 2, !e.C.notify(e, 2, 2)) throw P(n), n;
|
|
1099
1099
|
} finally {
|
|
1100
1100
|
e._t = e.Ue, e.Je = !1;
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
|
-
|
|
1103
|
+
L.et = xt;
|
|
1104
1104
|
//#endregion
|
|
1105
1105
|
//#region ../../node_modules/.bun/@solidjs+signals@2.0.0-rc.0/node_modules/@solidjs/signals/dist/prod/signals.js
|
|
1106
1106
|
function St(e) {
|
|
@@ -3132,10 +3132,10 @@ function fa(e = {}, t = !1) {
|
|
|
3132
3132
|
}, ee = () => {
|
|
3133
3133
|
let e = j();
|
|
3134
3134
|
g ??= Ui(n, aa, oa), _ ??= Gi(n, !1), g.parentNode || e.append(g), _.parentNode || e.append(_);
|
|
3135
|
-
}, N = (e) => Array.from(e.childNodes).some((e) => e.nodeType === p.TEXT_NODE && !!e.nodeValue?.trim()),
|
|
3135
|
+
}, N = (e) => Array.from(e.childNodes).some((e) => e.nodeType === p.TEXT_NODE && !!e.nodeValue?.trim()), P = (e) => !!e && e instanceof d && !(e instanceof f) && !c.has(e.tagName) && N(e) && !e.closest("[data-mesurer-root]"), F = (e, t) => n.elementsFromPoint(e, t).find((e) => P(e)) ?? null, te = () => {
|
|
3136
3136
|
v = null, M(g, !1), M(_, !1);
|
|
3137
|
-
},
|
|
3138
|
-
if (!m || !
|
|
3137
|
+
}, I = (t) => {
|
|
3138
|
+
if (!m || !P(t)) return !1;
|
|
3139
3139
|
ee();
|
|
3140
3140
|
let i = t.getBoundingClientRect(), a = u.getFast(t);
|
|
3141
3141
|
return v = t, Ki(n, _, a, !1), Wi(g, i), qi(r, _, i), M(g, !0), M(_, !0), r.clearTimeout(x), x = r.setTimeout(() => {
|
|
@@ -3143,23 +3143,23 @@ function fa(e = {}, t = !1) {
|
|
|
3143
3143
|
let i = u.getFull(t, a);
|
|
3144
3144
|
Ki(n, _, i, !1), qi(r, _, t.getBoundingClientRect()), e.onInspect?.(t, i);
|
|
3145
3145
|
}, 24), !0;
|
|
3146
|
-
},
|
|
3146
|
+
}, L = () => E.map((e) => ({
|
|
3147
3147
|
sourceEl: e.sourceEl,
|
|
3148
3148
|
left: e.userPlaced ? e.card.getBoundingClientRect().left + e.card.getBoundingClientRect().width / 2 : 0,
|
|
3149
3149
|
top: e.userPlaced ? e.card.getBoundingClientRect().top : 0,
|
|
3150
3150
|
userPlaced: e.userPlaced
|
|
3151
|
-
})),
|
|
3152
|
-
D.push(
|
|
3153
|
-
},
|
|
3151
|
+
})), R = () => {
|
|
3152
|
+
D.push(L()), D.length > 100 && D.shift(), O.length = 0;
|
|
3153
|
+
}, z = (t, n = !0, r = !0) => {
|
|
3154
3154
|
let i = E.indexOf(t);
|
|
3155
|
-
i < 0 || (n &&
|
|
3156
|
-
},
|
|
3157
|
-
for (; E.length;)
|
|
3158
|
-
},
|
|
3155
|
+
i < 0 || (n && R(), E.splice(i, 1), t.detach(), t.box.remove(), t.card.remove(), r && e.onUnpin?.(t.sourceEl));
|
|
3156
|
+
}, B = (e = !1) => {
|
|
3157
|
+
for (; E.length;) z(E[E.length - 1], !1, e);
|
|
3158
|
+
}, V = (e) => {
|
|
3159
3159
|
let t = -1, n = 0, i = 0, a = 0, o = 0, s = !1, c = !1, l = (l) => {
|
|
3160
3160
|
if (l.pointerId !== t) return;
|
|
3161
3161
|
let u = l.clientX - n, d = l.clientY - i;
|
|
3162
|
-
!s && Math.abs(u) <= 6 && Math.abs(d) <= 6 || (s || (s = !0, e.card.classList.add("mesurer-ti-card--pinned"), delete e.card.dataset.mesurerNativeScrollAnchor, delete e.card.dataset.mesurerNativeScrollOwner, e.card.style.removeProperty("position-anchor")), c ||= (
|
|
3162
|
+
!s && Math.abs(u) <= 6 && Math.abs(d) <= 6 || (s || (s = !0, e.card.classList.add("mesurer-ti-card--pinned"), delete e.card.dataset.mesurerNativeScrollAnchor, delete e.card.dataset.mesurerNativeScrollOwner, e.card.style.removeProperty("position-anchor")), c ||= (R(), !0), e.userPlaced = !0, e.card.style.left = `${Math.min(r.innerWidth - 8, Math.max(8, a + u))}px`, e.card.style.top = `${Math.min(r.innerHeight - 8, Math.max(8, o + d))}px`);
|
|
3163
3163
|
}, u = (e) => {
|
|
3164
3164
|
(t === -1 || e.pointerId === t) && (r.removeEventListener("pointermove", l), r.removeEventListener("pointerup", u), r.removeEventListener("pointercancel", u), t = -1, s = !1, c = !1);
|
|
3165
3165
|
}, f = (s) => {
|
|
@@ -3170,9 +3170,9 @@ function fa(e = {}, t = !1) {
|
|
|
3170
3170
|
return e.card.addEventListener("pointerdown", f), () => {
|
|
3171
3171
|
e.card.removeEventListener("pointerdown", f), r.removeEventListener("pointermove", l), r.removeEventListener("pointerup", u), r.removeEventListener("pointercancel", u);
|
|
3172
3172
|
};
|
|
3173
|
-
},
|
|
3173
|
+
}, ne = (t, i, a = !0, o = !0) => {
|
|
3174
3174
|
if (E.find((e) => e.sourceEl === t)) return;
|
|
3175
|
-
a &&
|
|
3175
|
+
a && R(), E.length >= l && z(E[0], !1, !0);
|
|
3176
3176
|
let s = j(), c = Ui(n, sa, ca), d = Gi(n, !0);
|
|
3177
3177
|
d.classList.add("mesurer-ti-card--draggable"), d.classList.remove("mesurer-ti-card--pinned");
|
|
3178
3178
|
let f = u.getFull(t);
|
|
@@ -3188,24 +3188,24 @@ function fa(e = {}, t = !1) {
|
|
|
3188
3188
|
userPlaced: i?.userPlaced ?? !1,
|
|
3189
3189
|
detach: () => {}
|
|
3190
3190
|
};
|
|
3191
|
-
E.push(m), m.detach =
|
|
3192
|
-
e.preventDefault(), e.stopPropagation(),
|
|
3191
|
+
E.push(m), m.detach = V(m), d.querySelector(".mesurer-ti-close")?.addEventListener("click", (e) => {
|
|
3192
|
+
e.preventDefault(), e.stopPropagation(), z(m);
|
|
3193
3193
|
}), o && e.onPin?.(t, f);
|
|
3194
3194
|
}, re = (e) => {
|
|
3195
|
-
|
|
3196
|
-
for (let t of e) t.sourceEl.isConnected &&
|
|
3195
|
+
B(!1);
|
|
3196
|
+
for (let t of e) t.sourceEl.isConnected && ne(t.sourceEl, t, !1, !1);
|
|
3197
3197
|
}, H = () => {
|
|
3198
3198
|
let e = D.pop();
|
|
3199
|
-
return e ? (O.push(
|
|
3199
|
+
return e ? (O.push(L()), re(e), !0) : !1;
|
|
3200
3200
|
}, ie = () => {
|
|
3201
3201
|
let e = O.pop();
|
|
3202
|
-
return e ? (D.push(
|
|
3202
|
+
return e ? (D.push(L()), re(e), !0) : !1;
|
|
3203
3203
|
}, U = () => {
|
|
3204
|
-
E.length && (
|
|
3204
|
+
E.length && (R(), B(!0));
|
|
3205
3205
|
}, ae = () => {
|
|
3206
3206
|
for (let e of E.slice()) {
|
|
3207
3207
|
if (!e.sourceEl.isConnected) {
|
|
3208
|
-
|
|
3208
|
+
z(e, !1, !1);
|
|
3209
3209
|
continue;
|
|
3210
3210
|
}
|
|
3211
3211
|
let t = e.sourceEl.getBoundingClientRect();
|
|
@@ -3216,7 +3216,7 @@ function fa(e = {}, t = !1) {
|
|
|
3216
3216
|
}, W = () => {
|
|
3217
3217
|
if (m) {
|
|
3218
3218
|
if (v && g && _) {
|
|
3219
|
-
if (!v.isConnected)
|
|
3219
|
+
if (!v.isConnected) te();
|
|
3220
3220
|
else {
|
|
3221
3221
|
let e = v.getBoundingClientRect();
|
|
3222
3222
|
Wi(g, e), qi(r, _, e);
|
|
@@ -3228,9 +3228,9 @@ function fa(e = {}, t = !1) {
|
|
|
3228
3228
|
}
|
|
3229
3229
|
}, oe = () => {
|
|
3230
3230
|
if (!m) return;
|
|
3231
|
-
let e =
|
|
3232
|
-
if (!e)
|
|
3233
|
-
else if (e !== v)
|
|
3231
|
+
let e = F(y.x, y.y);
|
|
3232
|
+
if (!e) te();
|
|
3233
|
+
else if (e !== v) I(e);
|
|
3234
3234
|
else if (g && _) {
|
|
3235
3235
|
let t = e.getBoundingClientRect();
|
|
3236
3236
|
Wi(g, t), qi(r, _, t);
|
|
@@ -3263,11 +3263,11 @@ function fa(e = {}, t = !1) {
|
|
|
3263
3263
|
}
|
|
3264
3264
|
W(), se();
|
|
3265
3265
|
}, de = (e) => {
|
|
3266
|
-
e.relatedTarget ||
|
|
3266
|
+
e.relatedTarget || te();
|
|
3267
3267
|
}, fe = (e) => e.composedPath().some((e) => e instanceof d && (e.id === a || e.hasAttribute("data-mesurer-root") || e.classList.contains("mesurer-ti-card") || e.classList.contains("mesurer-ti-close"))), pe = (e) => {
|
|
3268
3268
|
if (!fe(e) && (e.preventDefault(), e.stopImmediatePropagation(), e.button === 0)) {
|
|
3269
|
-
let t =
|
|
3270
|
-
t &&
|
|
3269
|
+
let t = F(e.clientX, e.clientY);
|
|
3270
|
+
t && ne(t);
|
|
3271
3271
|
}
|
|
3272
3272
|
}, me = (e) => {
|
|
3273
3273
|
fe(e) || (e.preventDefault(), e.stopImmediatePropagation());
|
|
@@ -3277,7 +3277,7 @@ function fa(e = {}, t = !1) {
|
|
|
3277
3277
|
passive: !0
|
|
3278
3278
|
}), r.addEventListener("resize", se, !0));
|
|
3279
3279
|
}, ge = () => {
|
|
3280
|
-
m && (m = !1, r.cancelAnimationFrame(b), b = 0, r.clearTimeout(x), r.clearTimeout(S), S = 0, r.removeEventListener("mousemove", ce, !0), r.removeEventListener("mouseout", de, !0), r.removeEventListener("click", pe, !0), r.removeEventListener("auxclick", me, !0), r.removeEventListener("scroll", ue, !0), r.removeEventListener("resize", se, !0),
|
|
3280
|
+
m && (m = !1, r.cancelAnimationFrame(b), b = 0, r.clearTimeout(x), r.clearTimeout(S), S = 0, r.removeEventListener("mousemove", ce, !0), r.removeEventListener("mouseout", de, !0), r.removeEventListener("click", pe, !0), r.removeEventListener("auxclick", me, !0), r.removeEventListener("scroll", ue, !0), r.removeEventListener("resize", se, !0), te(), B(), g?.remove(), _?.remove(), g = null, _ = null, D.length = 0, O.length = 0, n.body.classList.remove(s));
|
|
3281
3281
|
}, _e = () => {
|
|
3282
3282
|
ge(), T?.(), T = null, h?.remove(), h = null, n.getElementById(o)?.remove(), k instanceof r.ShadowRoot && k.querySelector(`#${o}`)?.remove();
|
|
3283
3283
|
};
|
|
@@ -3287,7 +3287,7 @@ function fa(e = {}, t = !1) {
|
|
|
3287
3287
|
undo: H,
|
|
3288
3288
|
redo: ie,
|
|
3289
3289
|
clear: U,
|
|
3290
|
-
inspect:
|
|
3290
|
+
inspect: I,
|
|
3291
3291
|
isEnabled: () => m,
|
|
3292
3292
|
canUndo: () => D.length > 0,
|
|
3293
3293
|
canRedo: () => O.length > 0,
|
|
@@ -3498,10 +3498,10 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3498
3498
|
value: e.style.getPropertyValue("visibility"),
|
|
3499
3499
|
priority: e.style.getPropertyPriority("visibility")
|
|
3500
3500
|
}), e.style.setProperty("visibility", "hidden", "important"));
|
|
3501
|
-
},
|
|
3501
|
+
}, P = () => {
|
|
3502
3502
|
for (let [e, t] of m) t.value || t.priority ? e.style.setProperty("visibility", t.value, t.priority) : e.style.removeProperty("visibility");
|
|
3503
3503
|
m.clear();
|
|
3504
|
-
},
|
|
3504
|
+
}, F = (e = E()) => {
|
|
3505
3505
|
let t = /* @__PURE__ */ new Map();
|
|
3506
3506
|
for (let n of e) for (let e of n.targets) {
|
|
3507
3507
|
let n = A(e);
|
|
@@ -3511,11 +3511,11 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3511
3511
|
});
|
|
3512
3512
|
}
|
|
3513
3513
|
return t;
|
|
3514
|
-
},
|
|
3514
|
+
}, te = () => {
|
|
3515
3515
|
if (h.state === "live") return /* @__PURE__ */ new Map();
|
|
3516
|
-
if (!h.intentId) return
|
|
3516
|
+
if (!h.intentId) return F();
|
|
3517
3517
|
let e = x().intents.find((e) => e.id === h.intentId);
|
|
3518
|
-
if (!e) return
|
|
3518
|
+
if (!e) return F();
|
|
3519
3519
|
let t = /* @__PURE__ */ new Map();
|
|
3520
3520
|
for (let n of e.targets) {
|
|
3521
3521
|
let e = A(n);
|
|
@@ -3528,7 +3528,7 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3528
3528
|
});
|
|
3529
3529
|
}
|
|
3530
3530
|
return t;
|
|
3531
|
-
},
|
|
3531
|
+
}, I = (e) => {
|
|
3532
3532
|
j();
|
|
3533
3533
|
for (let [t, n] of e) {
|
|
3534
3534
|
if (!t.isConnected || !O(t) || n.x === 0 && n.y === 0) continue;
|
|
@@ -3539,22 +3539,22 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3539
3539
|
appliedTransform: Ka(t)
|
|
3540
3540
|
});
|
|
3541
3541
|
}
|
|
3542
|
-
},
|
|
3542
|
+
}, L = () => I(te()), R = (e) => {
|
|
3543
3543
|
j();
|
|
3544
3544
|
try {
|
|
3545
3545
|
return e();
|
|
3546
3546
|
} finally {
|
|
3547
|
-
!v && !g &&
|
|
3547
|
+
!v && !g && L();
|
|
3548
3548
|
}
|
|
3549
|
-
},
|
|
3549
|
+
}, z = () => i.currentSelection().elements.filter((e) => e instanceof c.HTMLElement && e.isConnected && O(e));
|
|
3550
3550
|
e.state.register({
|
|
3551
3551
|
id: Ea,
|
|
3552
|
-
initial:
|
|
3552
|
+
initial: z().length > 0
|
|
3553
3553
|
});
|
|
3554
|
-
let
|
|
3555
|
-
let t =
|
|
3556
|
-
t !==
|
|
3557
|
-
},
|
|
3554
|
+
let B = () => e.state.get(Ea) ?? !1, V = () => {
|
|
3555
|
+
let t = z().length > 0;
|
|
3556
|
+
t !== B() && e.state.update(Ea, () => t);
|
|
3557
|
+
}, ne = () => Fa(z().map((e) => Ei(e))), re = (e) => {
|
|
3558
3558
|
let t = C();
|
|
3559
3559
|
if (!t.snapping) return [];
|
|
3560
3560
|
let n = [], a = new Set(e), s = i.snapshot(), l = s.xrayVisible && t.preferXrayEdges && t.elementEdges, u = 0, d = (i) => {
|
|
@@ -3631,7 +3631,7 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3631
3631
|
f.style.display = "none";
|
|
3632
3632
|
return;
|
|
3633
3633
|
}
|
|
3634
|
-
let t = e === void 0 ?
|
|
3634
|
+
let t = e === void 0 ? ne() : e;
|
|
3635
3635
|
if (!t) {
|
|
3636
3636
|
f.style.display = "none";
|
|
3637
3637
|
return;
|
|
@@ -3641,14 +3641,14 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3641
3641
|
h = {
|
|
3642
3642
|
intentId: null,
|
|
3643
3643
|
state: "desired"
|
|
3644
|
-
},
|
|
3644
|
+
}, L(), M(), S() ? N() : P();
|
|
3645
3645
|
}, U = () => {
|
|
3646
3646
|
h = {
|
|
3647
3647
|
intentId: null,
|
|
3648
3648
|
state: "live"
|
|
3649
|
-
}, j(), M(),
|
|
3649
|
+
}, j(), M(), P();
|
|
3650
3650
|
}, ae = () => {
|
|
3651
|
-
v || g || (
|
|
3651
|
+
v || g || (L(), M(), S() ? N() : P(), H());
|
|
3652
3652
|
}, W = () => {
|
|
3653
3653
|
y || v || (y = r.requestAnimationFrame(() => {
|
|
3654
3654
|
y = 0, ae();
|
|
@@ -3657,13 +3657,13 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3657
3657
|
s.querySelector("[data-mesurer-builtin='select'] button")?.getAttribute("aria-pressed") !== "true" && await e.command.execute(Sa, void 0, { source: "arrange" });
|
|
3658
3658
|
}, se = (e) => {
|
|
3659
3659
|
if (!S() || e.button !== 0) return;
|
|
3660
|
-
let t =
|
|
3660
|
+
let t = z();
|
|
3661
3661
|
if (!t.length) return;
|
|
3662
3662
|
e.preventDefault(), e.stopPropagation(), h = {
|
|
3663
3663
|
intentId: null,
|
|
3664
3664
|
state: "desired"
|
|
3665
|
-
},
|
|
3666
|
-
let n =
|
|
3665
|
+
}, L();
|
|
3666
|
+
let n = F(E());
|
|
3667
3667
|
j();
|
|
3668
3668
|
let r = t.map((e, t) => {
|
|
3669
3669
|
let r = Ei(e), i = n.get(e) ?? {
|
|
@@ -3703,10 +3703,10 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3703
3703
|
height: e.beforeHeight
|
|
3704
3704
|
})));
|
|
3705
3705
|
if (!i) {
|
|
3706
|
-
|
|
3706
|
+
L();
|
|
3707
3707
|
return;
|
|
3708
3708
|
}
|
|
3709
|
-
|
|
3709
|
+
L(), N(), M(), g = {
|
|
3710
3710
|
pointerId: e.pointerId,
|
|
3711
3711
|
originX: e.clientX,
|
|
3712
3712
|
originY: e.clientY,
|
|
@@ -3725,12 +3725,12 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3725
3725
|
y: n
|
|
3726
3726
|
}), a = r === "y" ? null : Ba("x", i, g.snapCandidates), o = r === "x" ? null : Ba("y", i, g.snapCandidates);
|
|
3727
3727
|
t += a?.delta ?? 0, n += o?.delta ?? 0, g.dx = t, g.dy = n;
|
|
3728
|
-
let s =
|
|
3728
|
+
let s = F(E());
|
|
3729
3729
|
for (let e of g.targets) s.set(e.element, {
|
|
3730
3730
|
x: e.target.beforeOffsetX + t,
|
|
3731
3731
|
y: e.target.beforeOffsetY + n
|
|
3732
3732
|
});
|
|
3733
|
-
|
|
3733
|
+
I(s);
|
|
3734
3734
|
let c = Na(g.groupBefore, {
|
|
3735
3735
|
x: t,
|
|
3736
3736
|
y: n
|
|
@@ -3768,7 +3768,7 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3768
3768
|
t.key !== "Escape" || !S() && !g || Ya(t.target) || s.querySelector("[data-mesurer-tool-menu]") || (t.preventDefault(), t.stopImmediatePropagation(), g ? le() : (e.state.update("mesurer.arrange.active", () => !1), U(), H()));
|
|
3769
3769
|
};
|
|
3770
3770
|
f.addEventListener("pointerdown", se), f.addEventListener("pointermove", ce), f.addEventListener("pointerup", ue), f.addEventListener("pointercancel", de), r.addEventListener("keydown", fe, !0), r.addEventListener("resize", W), r.addEventListener("scroll", W, !0), o.addEventListener("scroll", W, !0), b = new c.MutationObserver(() => {
|
|
3771
|
-
|
|
3771
|
+
V(), W();
|
|
3772
3772
|
}), b.observe(o, {
|
|
3773
3773
|
childList: !0,
|
|
3774
3774
|
subtree: !0,
|
|
@@ -3782,7 +3782,7 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3782
3782
|
]
|
|
3783
3783
|
});
|
|
3784
3784
|
let pe = i.subscribe(() => {
|
|
3785
|
-
|
|
3785
|
+
V(), W();
|
|
3786
3786
|
}), me = e.state.subscribe(W), he = (e) => x().intents.find((t) => t.id === e) ?? null, ge = (e, t) => {
|
|
3787
3787
|
let n = null;
|
|
3788
3788
|
if (n = t === "before" ? Fa(e.targets.map((e) => ({
|
|
@@ -3795,7 +3795,7 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3795
3795
|
top: e.desiredTop,
|
|
3796
3796
|
width: e.desiredWidth,
|
|
3797
3797
|
height: e.desiredHeight
|
|
3798
|
-
}))) :
|
|
3798
|
+
}))) : R(() => Fa(e.targets.map((e) => A(e)).filter((e) => e !== null).map((e) => Ei(e)))), !n) throw Error(`Arrange intent has no resolvable capture region: ${e.id}`);
|
|
3799
3799
|
let i = Math.max(0, n.left - Oa), a = Math.max(0, n.top - Oa), o = Math.min(r.innerWidth, n.left + n.width + Oa), s = Math.min(r.innerHeight, n.top + n.height + Oa);
|
|
3800
3800
|
return {
|
|
3801
3801
|
left: i,
|
|
@@ -3844,7 +3844,7 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
3844
3844
|
review: (e, t = Da) => {
|
|
3845
3845
|
let n = he(e);
|
|
3846
3846
|
if (!n) throw Error(`Arrange intent not found: ${e}`);
|
|
3847
|
-
let r =
|
|
3847
|
+
let r = R(() => n.targets.map((e) => {
|
|
3848
3848
|
let n = A(e), r = {
|
|
3849
3849
|
left: e.desiredLeft,
|
|
3850
3850
|
top: e.desiredTop,
|
|
@@ -4009,9 +4009,9 @@ var pa = "/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@la
|
|
|
4009
4009
|
e.state.update(va, () => ({ intents: [] })), h = {
|
|
4010
4010
|
intentId: null,
|
|
4011
4011
|
state: "desired"
|
|
4012
|
-
}, j(), M(), S() ? N() :
|
|
4013
|
-
}), e.service.provide(_a, _e),
|
|
4014
|
-
v = !0, y && r.cancelAnimationFrame(y), b?.disconnect(), b = null, f.removeEventListener("pointerdown", se), f.removeEventListener("pointermove", ce), f.removeEventListener("pointerup", ue), f.removeEventListener("pointercancel", de), r.removeEventListener("keydown", fe, !0), r.removeEventListener("resize", W), r.removeEventListener("scroll", W, !0), o.removeEventListener("scroll", W, !0), pe(), me.dispose(), j(), M(),
|
|
4012
|
+
}, j(), M(), S() ? N() : P(), H();
|
|
4013
|
+
}), e.service.provide(_a, _e), L(), H(), e.lifecycle.onDispose(() => {
|
|
4014
|
+
v = !0, y && r.cancelAnimationFrame(y), b?.disconnect(), b = null, f.removeEventListener("pointerdown", se), f.removeEventListener("pointermove", ce), f.removeEventListener("pointerup", ue), f.removeEventListener("pointercancel", de), r.removeEventListener("keydown", fe, !0), r.removeEventListener("resize", W), r.removeEventListener("scroll", W, !0), o.removeEventListener("scroll", W, !0), pe(), me.dispose(), j(), M(), P(), i.dispose(), a.dispose();
|
|
4015
4015
|
});
|
|
4016
4016
|
}
|
|
4017
4017
|
}), Za = (e, t, n) => {
|
|
@@ -4307,9 +4307,9 @@ var bo = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), xo = 0, So = (e)
|
|
|
4307
4307
|
} : Eo(e, t, n, r, i);
|
|
4308
4308
|
};
|
|
4309
4309
|
function Oo(e) {
|
|
4310
|
-
let [t, n] = K(0), [r, i] = K(0), [a, o] = K(null), [s, c] = K(null), [l, u] = K(null), [d, f] = K({}), [p, m] = K(null), [h, g] = K(!1), [_, v] = K(""), [y, b] = K(null), [x, S] = K(!1), [C, w] = K(null), [T, E] = K(null), D = `--mesurer-annotation-trigger-${++xo}`, O = null, k = e.initialTriggerFallback === "current-and-next", A = null, j = null, M = null, ee, N,
|
|
4311
|
-
if (
|
|
4312
|
-
let t =
|
|
4310
|
+
let [t, n] = K(0), [r, i] = K(0), [a, o] = K(null), [s, c] = K(null), [l, u] = K(null), [d, f] = K({}), [p, m] = K(null), [h, g] = K(!1), [_, v] = K(""), [y, b] = K(null), [x, S] = K(!1), [C, w] = K(null), [T, E] = K(null), D = `--mesurer-annotation-trigger-${++xo}`, O = null, k = e.initialTriggerFallback === "current-and-next", A = null, j = null, M = null, ee, N, P = null, F = null, te = null, I = null, L = null, R = null, z = /* @__PURE__ */ new Map(), B = () => ee?.ownerDocument.defaultView ?? window, V = () => e.coordinateSpace === "viewport", ne = (e) => e ? "native-anchor" : V() ? "cached-delta" : "document", re = (e) => {
|
|
4311
|
+
if (V()) return e;
|
|
4312
|
+
let t = B();
|
|
4313
4313
|
return {
|
|
4314
4314
|
left: e.left + t.scrollX,
|
|
4315
4315
|
top: e.top + t.scrollY
|
|
@@ -4323,7 +4323,7 @@ function Oo(e) {
|
|
|
4323
4323
|
}, ie = (e, t) => e.elements.length !== t.elements.length || e.elements.some((e, n) => e !== t.elements[n]) ? !1 : e.region === t.region ? !0 : !e.region || !t.region ? !1 : e.region.left === t.region.left && e.region.top === t.region.top && e.region.width === t.region.width && e.region.height === t.region.height, U = () => {
|
|
4324
4324
|
A = null, v(""), g(!1), b(null), m(null);
|
|
4325
4325
|
}, ae = () => {
|
|
4326
|
-
let e =
|
|
4326
|
+
let e = B();
|
|
4327
4327
|
return !!(e.CSS?.supports("anchor-name: --mesurer-annotation-trigger") && e.CSS.supports("position-anchor: --mesurer-annotation-trigger") && e.CSS.supports("left: anchor(left)"));
|
|
4328
4328
|
}, W = () => {
|
|
4329
4329
|
let t = e.runtime.currentSelection().elements;
|
|
@@ -4332,18 +4332,18 @@ function Oo(e) {
|
|
|
4332
4332
|
return t.find((e) => e === n) ?? t.find((e) => n && e.contains(n)) ?? t[0];
|
|
4333
4333
|
}, oe = () => ee?.parentElement, se = () => {
|
|
4334
4334
|
let e = oe();
|
|
4335
|
-
return e ? [...e.querySelectorAll("[data-mesurer-annotation-trigger='true'], [data-mesurer-annotation-composer='true']")].filter((e) => e !== N ||
|
|
4335
|
+
return e ? [...e.querySelectorAll("[data-mesurer-annotation-trigger='true'], [data-mesurer-annotation-composer='true']")].filter((e) => e !== N || F === null) : [];
|
|
4336
4336
|
}, ce = (e) => {
|
|
4337
4337
|
let t = oe();
|
|
4338
4338
|
return t ? [...t.querySelectorAll("[data-mesurer-annotation-id]")].filter((t) => t.dataset.mesurerAnnotationId === e) : [];
|
|
4339
4339
|
}, le = (e) => {
|
|
4340
|
-
let t =
|
|
4341
|
-
t && (t.scroll.release(), t.releaseAnchor?.(),
|
|
4340
|
+
let t = z.get(e);
|
|
4341
|
+
t && (t.scroll.release(), t.releaseAnchor?.(), z.delete(e));
|
|
4342
4342
|
}, ue = (t) => {
|
|
4343
4343
|
let n = e.runtime.annotation(t);
|
|
4344
4344
|
return !n || n.anchor.kind !== "elements" ? null : n.resolvedTargets.find(({ element: e }) => e?.isConnected)?.element ?? null;
|
|
4345
|
-
}, de = (e) => !!(Co(e) &&
|
|
4346
|
-
let t = ue(e), n =
|
|
4345
|
+
}, de = (e) => !!(Co(e) && V() && ee && ae() && e.getRootNode() === ee.getRootNode()), fe = (e) => {
|
|
4346
|
+
let t = ue(e), n = z.get(e);
|
|
4347
4347
|
if (!t) {
|
|
4348
4348
|
n && (le(e), i((e) => e + 1));
|
|
4349
4349
|
return;
|
|
@@ -4358,63 +4358,63 @@ function Oo(e) {
|
|
|
4358
4358
|
if (a) {
|
|
4359
4359
|
if (r && Co(t)) {
|
|
4360
4360
|
let n = `--mesurer-annotation-${++xo}`;
|
|
4361
|
-
|
|
4361
|
+
z.set(e, {
|
|
4362
4362
|
target: t,
|
|
4363
4363
|
anchorName: n,
|
|
4364
4364
|
releaseAnchor: wo(t, n),
|
|
4365
4365
|
scroll: ti(a, t, () => ce(e), { trackWindow: !1 })
|
|
4366
4366
|
});
|
|
4367
|
-
} else
|
|
4367
|
+
} else z.set(e, {
|
|
4368
4368
|
target: t,
|
|
4369
4369
|
anchorName: null,
|
|
4370
4370
|
releaseAnchor: null,
|
|
4371
|
-
scroll: ti(a, t, () => ce(e), { trackWindow:
|
|
4371
|
+
scroll: ti(a, t, () => ce(e), { trackWindow: V() })
|
|
4372
4372
|
});
|
|
4373
4373
|
i((e) => e + 1);
|
|
4374
4374
|
}
|
|
4375
4375
|
}, pe = () => {
|
|
4376
4376
|
let t = new Set(e.runtime.annotations().map((e) => e.id));
|
|
4377
|
-
for (let e of
|
|
4377
|
+
for (let e of z.keys()) t.has(e) || le(e);
|
|
4378
4378
|
for (let e of t) fe(e);
|
|
4379
4379
|
}, me = (e) => {
|
|
4380
|
-
|
|
4380
|
+
B().queueMicrotask(() => fe(e));
|
|
4381
4381
|
}, he = () => {
|
|
4382
|
-
|
|
4382
|
+
B().queueMicrotask(() => {
|
|
4383
4383
|
pe();
|
|
4384
|
-
for (let e of
|
|
4384
|
+
for (let e of z.values()) e.anchorName || e.scroll.rebase();
|
|
4385
4385
|
});
|
|
4386
4386
|
};
|
|
4387
4387
|
e.initialTriggerFallback && (O = W());
|
|
4388
4388
|
let ge = () => {
|
|
4389
|
-
|
|
4390
|
-
}, _e = (e) => !!(Co(e) &&
|
|
4389
|
+
I?.release(), I = null, te?.(), te = null, P = null, F = null;
|
|
4390
|
+
}, _e = (e) => !!(Co(e) && V() && ee && e !== O && ae() && e.getRootNode() === ee.getRootNode()), ve = () => {
|
|
4391
4391
|
let e = W();
|
|
4392
4392
|
O && e !== O && (O = null);
|
|
4393
|
-
let t =
|
|
4394
|
-
if (e ===
|
|
4395
|
-
|
|
4393
|
+
let t = P, n = !!(e?.isConnected && _e(e)), r = F === e;
|
|
4394
|
+
if (e === P && e?.isConnected && n === r) {
|
|
4395
|
+
I?.sync();
|
|
4396
4396
|
return;
|
|
4397
4397
|
}
|
|
4398
4398
|
let i = e === t ? D : `--mesurer-annotation-trigger-${++xo}`;
|
|
4399
4399
|
if (ge(), !e?.isConnected) return;
|
|
4400
|
-
|
|
4400
|
+
P = e;
|
|
4401
4401
|
let a = e.ownerDocument.defaultView;
|
|
4402
4402
|
if (a) {
|
|
4403
4403
|
if (n && Co(e)) {
|
|
4404
|
-
|
|
4404
|
+
te = wo(e, i), F = e, D = i, I = ti(a, e, se, { trackWindow: !1 });
|
|
4405
4405
|
return;
|
|
4406
4406
|
}
|
|
4407
|
-
D = i,
|
|
4407
|
+
D = i, I = ti(a, e, se, { trackWindow: V() });
|
|
4408
4408
|
}
|
|
4409
4409
|
}, ye = (e) => {
|
|
4410
|
-
if (
|
|
4410
|
+
if (L?.disconnect(), L = null, !e?.isConnected) return;
|
|
4411
4411
|
let t = e.ownerDocument.defaultView;
|
|
4412
|
-
t && (
|
|
4412
|
+
t && (L = new t.ResizeObserver(() => {
|
|
4413
4413
|
i((e) => e + 1);
|
|
4414
|
-
}),
|
|
4414
|
+
}), L.observe(e));
|
|
4415
4415
|
}, be = () => {
|
|
4416
|
-
let e =
|
|
4417
|
-
|
|
4416
|
+
let e = B();
|
|
4417
|
+
R !== e && (R?.removeEventListener("resize", xe), R = e, R.addEventListener("resize", xe, { passive: !0 }));
|
|
4418
4418
|
};
|
|
4419
4419
|
function xe() {
|
|
4420
4420
|
i((e) => e + 1);
|
|
@@ -4427,9 +4427,9 @@ function Oo(e) {
|
|
|
4427
4427
|
let r = W(), i = r !== Se;
|
|
4428
4428
|
i && (Se = r, ye(Se), k && (k = !1, O = r)), ve(), i && xe(), n((e) => e + 1), he();
|
|
4429
4429
|
});
|
|
4430
|
-
ve(),
|
|
4431
|
-
|
|
4432
|
-
for (let e of
|
|
4430
|
+
ve(), B().queueMicrotask(pe), St(() => {
|
|
4431
|
+
L?.disconnect(), L = null, R?.removeEventListener("resize", xe), R = null, ge();
|
|
4432
|
+
for (let e of z.keys()) le(e);
|
|
4433
4433
|
Ce();
|
|
4434
4434
|
});
|
|
4435
4435
|
let we = Gt(() => (t(), e.runtime.currentSelection())), Te = Gt(() => (t(), e.runtime.annotations())), Ee = Gt(() => {
|
|
@@ -4487,7 +4487,7 @@ function Oo(e) {
|
|
|
4487
4487
|
top: t.top,
|
|
4488
4488
|
width: t.width,
|
|
4489
4489
|
height: t.height
|
|
4490
|
-
}, r =
|
|
4490
|
+
}, r = B(), i = [...ut(Re).values()].map((e) => ({
|
|
4491
4491
|
left: e.left,
|
|
4492
4492
|
top: e.top,
|
|
4493
4493
|
width: 24,
|
|
@@ -4501,7 +4501,7 @@ function Oo(e) {
|
|
|
4501
4501
|
}, {
|
|
4502
4502
|
obstacles: i,
|
|
4503
4503
|
maxShiftRings: 1
|
|
4504
|
-
}), o = a?.left ?? bo(n.left + n.width + 6, 4, r.innerWidth - 24 - 4), s = a?.top ?? bo(n.top, 4, r.innerHeight - 24 - 4), c =
|
|
4504
|
+
}), o = a?.left ?? bo(n.left + n.width + 6, 4, r.innerWidth - 24 - 4), s = a?.top ?? bo(n.top, 4, r.innerHeight - 24 - 4), c = F === e, l = V() && !c;
|
|
4505
4505
|
return {
|
|
4506
4506
|
left: c || l ? o : o + r.scrollX,
|
|
4507
4507
|
top: c || l ? s : s + r.scrollY,
|
|
@@ -4512,7 +4512,7 @@ function Oo(e) {
|
|
|
4512
4512
|
};
|
|
4513
4513
|
}, Re = Gt(() => {
|
|
4514
4514
|
t(), r();
|
|
4515
|
-
let n =
|
|
4515
|
+
let n = B(), i = Te().flatMap((t) => {
|
|
4516
4516
|
let n = e.runtime.annotationRect(t.id);
|
|
4517
4517
|
return n ? [{
|
|
4518
4518
|
id: t.id,
|
|
@@ -4525,7 +4525,7 @@ function Oo(e) {
|
|
|
4525
4525
|
}, { obstacles: Me() }).map((e) => [e.id, e]));
|
|
4526
4526
|
}), ze = (e) => Re().get(e) ?? null, Be = (e, t) => {
|
|
4527
4527
|
r();
|
|
4528
|
-
let n =
|
|
4528
|
+
let n = z.get(e);
|
|
4529
4529
|
if (!n?.anchorName || !n.target.isConnected) return {
|
|
4530
4530
|
...re(t),
|
|
4531
4531
|
nativeAnchor: !1
|
|
@@ -4539,7 +4539,7 @@ function Oo(e) {
|
|
|
4539
4539
|
anchorY: t.top - i.top
|
|
4540
4540
|
};
|
|
4541
4541
|
}, Ve = () => {
|
|
4542
|
-
let e = Ne(), t =
|
|
4542
|
+
let e = Ne(), t = B(), n = p();
|
|
4543
4543
|
return n && e ? {
|
|
4544
4544
|
left: e.left + n.left,
|
|
4545
4545
|
top: e.top + n.top
|
|
@@ -4550,7 +4550,7 @@ function Oo(e) {
|
|
|
4550
4550
|
}, He = () => {
|
|
4551
4551
|
r();
|
|
4552
4552
|
let e = Ve(), t = Ie();
|
|
4553
|
-
if (!t?.isConnected ||
|
|
4553
|
+
if (!t?.isConnected || F !== t) return {
|
|
4554
4554
|
...re(e),
|
|
4555
4555
|
nativeAnchor: !1
|
|
4556
4556
|
};
|
|
@@ -4563,7 +4563,7 @@ function Oo(e) {
|
|
|
4563
4563
|
anchorY: e.top - n.top
|
|
4564
4564
|
};
|
|
4565
4565
|
}, Ue = (e, t) => {
|
|
4566
|
-
let n =
|
|
4566
|
+
let n = B(), r = Re(), i = r.get(e);
|
|
4567
4567
|
if (!i) return Eo(t, 272, 176, n);
|
|
4568
4568
|
let a = n.innerWidth - 272 - 8, o = n.innerHeight - 176 - 8, s = [...r.values()].map((e) => ({
|
|
4569
4569
|
left: e.left,
|
|
@@ -4620,7 +4620,7 @@ function Oo(e) {
|
|
|
4620
4620
|
top: n.top + r.top
|
|
4621
4621
|
} : Ue(t, n);
|
|
4622
4622
|
}, Ge = (t) => {
|
|
4623
|
-
|
|
4623
|
+
B().queueMicrotask(() => {
|
|
4624
4624
|
let n = e.runtime.annotationRect(t);
|
|
4625
4625
|
n && f((e) => {
|
|
4626
4626
|
if (e[t]) return e;
|
|
@@ -4641,7 +4641,7 @@ function Oo(e) {
|
|
|
4641
4641
|
if (t.button !== 0 || r && i instanceof r && i.closest("button")) return;
|
|
4642
4642
|
let a = t.currentTarget.parentElement;
|
|
4643
4643
|
if (!a) return;
|
|
4644
|
-
let o = a.getBoundingClientRect(), s =
|
|
4644
|
+
let o = a.getBoundingClientRect(), s = B(), c = s.document.documentElement, l = c.style.userSelect;
|
|
4645
4645
|
c.style.setProperty("user-select", "none", "important"), j = {
|
|
4646
4646
|
surfaceId: n,
|
|
4647
4647
|
pointerId: t.pointerId,
|
|
@@ -4701,13 +4701,13 @@ function Oo(e) {
|
|
|
4701
4701
|
k = !1, A = H(), v(""), b(null), w(null), o(null);
|
|
4702
4702
|
let e = Ne();
|
|
4703
4703
|
if (e) {
|
|
4704
|
-
let t = Do(e, 272, 168,
|
|
4704
|
+
let t = Do(e, 272, 168, B());
|
|
4705
4705
|
m({
|
|
4706
4706
|
left: t.left - e.left,
|
|
4707
4707
|
top: t.top - e.top
|
|
4708
4708
|
});
|
|
4709
4709
|
} else m(null);
|
|
4710
|
-
g(!0),
|
|
4710
|
+
g(!0), B().queueMicrotask(() => I?.sync());
|
|
4711
4711
|
}, Qe = () => {
|
|
4712
4712
|
let e = h();
|
|
4713
4713
|
A !== null && !ie(A, H()) ? (O = W(), k = !1, ve(), xe()) : e && (k = !1), Xe();
|
|
@@ -4764,10 +4764,10 @@ function Oo(e) {
|
|
|
4764
4764
|
}
|
|
4765
4765
|
});
|
|
4766
4766
|
return nr(() => (e) => {
|
|
4767
|
-
N = e,
|
|
4767
|
+
N = e, I?.sync();
|
|
4768
4768
|
}, t), Z(t, J(yi, { size: 14 })), q(() => ({
|
|
4769
|
-
e:
|
|
4770
|
-
t:
|
|
4769
|
+
e: V() ? "viewport" : "document",
|
|
4770
|
+
t: ne(e().nativeAnchor),
|
|
4771
4771
|
a: {
|
|
4772
4772
|
position: e().nativeAnchor || e().viewportOwned ? "fixed" : "absolute",
|
|
4773
4773
|
left: e().nativeAnchor ? `calc(anchor(left) + ${e().anchorX}px)` : `${e().left}px`,
|
|
@@ -4842,10 +4842,10 @@ function Oo(e) {
|
|
|
4842
4842
|
return Z(t, e), t;
|
|
4843
4843
|
})()
|
|
4844
4844
|
}), c), X(c, l), X(c, u), X(l, Qn("⌘/Ctrl ↵")), X(u, d), X(u, f), X(d, Qn("Cancel")), X(f, Qn("Add note")), q(() => ({
|
|
4845
|
-
e:
|
|
4846
|
-
t:
|
|
4845
|
+
e: V() ? "viewport" : "document",
|
|
4846
|
+
t: ne(e().nativeAnchor),
|
|
4847
4847
|
a: {
|
|
4848
|
-
position: e().nativeAnchor ||
|
|
4848
|
+
position: e().nativeAnchor || V() ? "fixed" : "absolute",
|
|
4849
4849
|
left: e().nativeAnchor ? `calc(anchor(left) + ${e().anchorX}px)` : `${e().left}px`,
|
|
4850
4850
|
top: e().nativeAnchor ? `calc(anchor(top) + ${e().anchorY}px)` : `${e().top}px`,
|
|
4851
4851
|
translate: "var(--mesurer-nested-scroll-x, 0px) var(--mesurer-nested-scroll-y, 0px)",
|
|
@@ -4888,9 +4888,9 @@ function Oo(e) {
|
|
|
4888
4888
|
});
|
|
4889
4889
|
return q(() => ({
|
|
4890
4890
|
e: t() ?? void 0,
|
|
4891
|
-
t:
|
|
4891
|
+
t: ne(n().nativeAnchor),
|
|
4892
4892
|
a: {
|
|
4893
|
-
position: n().nativeAnchor ||
|
|
4893
|
+
position: n().nativeAnchor || V() ? "fixed" : "absolute",
|
|
4894
4894
|
left: n().nativeAnchor ? `calc(anchor(left) + ${n().anchorX}px)` : `${n().left}px`,
|
|
4895
4895
|
top: n().nativeAnchor ? `calc(anchor(top) + ${n().anchorY}px)` : `${n().top}px`,
|
|
4896
4896
|
width: `${e.width}px`,
|
|
@@ -4950,13 +4950,13 @@ function Oo(e) {
|
|
|
4950
4950
|
t: t() + 1,
|
|
4951
4951
|
a: i() ? "true" : void 0,
|
|
4952
4952
|
o: o() ? "true" : void 0,
|
|
4953
|
-
i:
|
|
4954
|
-
n:
|
|
4953
|
+
i: ne(n().nativeAnchor),
|
|
4954
|
+
n: V() ? "viewport" : "document",
|
|
4955
4955
|
s: `Mesurer annotation ${t() + 1}: ${e.note}`,
|
|
4956
4956
|
h: e.note,
|
|
4957
4957
|
r: a() === e.id ? "true" : "false",
|
|
4958
4958
|
d: {
|
|
4959
|
-
position: n().nativeAnchor ||
|
|
4959
|
+
position: n().nativeAnchor || V() ? "fixed" : "absolute",
|
|
4960
4960
|
left: n().nativeAnchor ? `calc(anchor(left) + ${n().anchorX}px)` : `${n().left}px`,
|
|
4961
4961
|
top: n().nativeAnchor ? `calc(anchor(top) + ${n().anchorY}px)` : `${n().top}px`,
|
|
4962
4962
|
opacity: o() ? "0.36" : "1",
|
|
@@ -5046,10 +5046,10 @@ function Oo(e) {
|
|
|
5046
5046
|
})()
|
|
5047
5047
|
}), null), q(() => ({
|
|
5048
5048
|
e: t().id,
|
|
5049
|
-
t:
|
|
5050
|
-
a:
|
|
5049
|
+
t: ne(n().nativeAnchor),
|
|
5050
|
+
a: V() ? "viewport" : "document",
|
|
5051
5051
|
o: {
|
|
5052
|
-
position: n().nativeAnchor ||
|
|
5052
|
+
position: n().nativeAnchor || V() ? "fixed" : "absolute",
|
|
5053
5053
|
left: n().nativeAnchor ? `calc(anchor(left) + ${n().anchorX}px)` : `${n().left}px`,
|
|
5054
5054
|
top: n().nativeAnchor ? `calc(anchor(top) + ${n().anchorY}px)` : `${n().top}px`,
|
|
5055
5055
|
translate: "var(--mesurer-nested-scroll-x, 0px) var(--mesurer-nested-scroll-y, 0px)",
|
|
@@ -5919,14 +5919,14 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
5919
5919
|
} catch {
|
|
5920
5920
|
D("Could not copy screenshot", !0);
|
|
5921
5921
|
}
|
|
5922
|
-
},
|
|
5922
|
+
}, P = () => {
|
|
5923
5923
|
let n = v;
|
|
5924
5924
|
if (n) try {
|
|
5925
5925
|
Sr(n, xr(), e, t), D("Saved screenshot");
|
|
5926
5926
|
} catch {
|
|
5927
5927
|
D("Could not save screenshot", !0);
|
|
5928
5928
|
}
|
|
5929
|
-
},
|
|
5929
|
+
}, F = (e, t, n) => {
|
|
5930
5930
|
if (!v) return !1;
|
|
5931
5931
|
T();
|
|
5932
5932
|
let r = o.getBoundingClientRect();
|
|
@@ -5938,7 +5938,7 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
5938
5938
|
top: r.top,
|
|
5939
5939
|
moved: !1
|
|
5940
5940
|
}, o.style.cursor = "grabbing", !0;
|
|
5941
|
-
},
|
|
5941
|
+
}, te = (e, t) => {
|
|
5942
5942
|
let n = x;
|
|
5943
5943
|
if (!n) return;
|
|
5944
5944
|
let r = e - n.startX, i = t - n.startY;
|
|
@@ -5946,28 +5946,28 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
5946
5946
|
left: n.left + r,
|
|
5947
5947
|
top: n.top + i
|
|
5948
5948
|
});
|
|
5949
|
-
},
|
|
5949
|
+
}, I = () => {
|
|
5950
5950
|
let e = x;
|
|
5951
5951
|
e && (x = null, o.style.cursor = "grab", e.moved || ee());
|
|
5952
|
-
},
|
|
5952
|
+
}, L = () => {
|
|
5953
5953
|
x && (x = null, o.style.cursor = "grab");
|
|
5954
|
-
}, L = (e) => {
|
|
5955
|
-
e.button !== 0 || !P(e.clientX, e.clientY, null) || e.preventDefault();
|
|
5956
5954
|
}, R = (e) => {
|
|
5957
|
-
|
|
5955
|
+
e.button !== 0 || !F(e.clientX, e.clientY, null) || e.preventDefault();
|
|
5958
5956
|
}, z = (e) => {
|
|
5959
|
-
|
|
5957
|
+
x?.pointerId === null && te(e.clientX, e.clientY);
|
|
5960
5958
|
}, B = (e) => {
|
|
5961
|
-
e.
|
|
5959
|
+
e.button === 0 && x?.pointerId === null && I();
|
|
5962
5960
|
}, V = (e) => {
|
|
5961
|
+
e.pointerType !== "mouse" && e.button === 0 && F(e.clientX, e.clientY, e.pointerId) && (o.setPointerCapture?.(e.pointerId), e.preventDefault());
|
|
5962
|
+
}, ne = (e) => {
|
|
5963
5963
|
let t = x?.pointerId;
|
|
5964
|
-
t != null && t === e.pointerId &&
|
|
5964
|
+
t != null && t === e.pointerId && te(e.clientX, e.clientY);
|
|
5965
5965
|
}, re = (e) => {
|
|
5966
5966
|
let t = x?.pointerId;
|
|
5967
|
-
t != null && t === e.pointerId && (o.hasPointerCapture?.(e.pointerId) && o.releasePointerCapture(e.pointerId),
|
|
5967
|
+
t != null && t === e.pointerId && (o.hasPointerCapture?.(e.pointerId) && o.releasePointerCapture(e.pointerId), I());
|
|
5968
5968
|
}, H = (e) => {
|
|
5969
5969
|
let t = x?.pointerId;
|
|
5970
|
-
t != null && t === e.pointerId && (o.hasPointerCapture?.(e.pointerId) && o.releasePointerCapture(e.pointerId),
|
|
5970
|
+
t != null && t === e.pointerId && (o.hasPointerCapture?.(e.pointerId) && o.releasePointerCapture(e.pointerId), L());
|
|
5971
5971
|
}, ie = (e) => {
|
|
5972
5972
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), ee());
|
|
5973
5973
|
}, U = (e) => {
|
|
@@ -5979,9 +5979,9 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
5979
5979
|
};
|
|
5980
5980
|
return c.addEventListener("pointerdown", (e) => e.stopPropagation()), c.addEventListener("mousedown", (e) => e.stopPropagation()), c.addEventListener("click", (e) => {
|
|
5981
5981
|
e.stopPropagation(), A();
|
|
5982
|
-
}), o.addEventListener("mousedown",
|
|
5982
|
+
}), o.addEventListener("mousedown", R), o.addEventListener("pointerdown", V), o.addEventListener("keydown", ie), o.addEventListener("contextmenu", U), d.addEventListener("click", ae), m.addEventListener("click", () => {
|
|
5983
5983
|
N();
|
|
5984
|
-
}), h.addEventListener("click",
|
|
5984
|
+
}), h.addEventListener("click", P), g.addEventListener("click", O), t.addEventListener("mousemove", z, !0), t.addEventListener("mouseup", B, !0), t.addEventListener("pointermove", ne, !0), t.addEventListener("pointerup", re, !0), t.addEventListener("pointercancel", H, !0), t.addEventListener("keydown", W, !0), {
|
|
5985
5985
|
show(e, n) {
|
|
5986
5986
|
if (w) return;
|
|
5987
5987
|
T(), O(), k(), v = e;
|
|
@@ -5990,7 +5990,7 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
5990
5990
|
},
|
|
5991
5991
|
dismiss: A,
|
|
5992
5992
|
dispose() {
|
|
5993
|
-
w || (w = !0, T(), E(), A(), t.removeEventListener("mousemove",
|
|
5993
|
+
w || (w = !0, T(), E(), A(), t.removeEventListener("mousemove", z, !0), t.removeEventListener("mouseup", B, !0), t.removeEventListener("pointermove", ne, !0), t.removeEventListener("pointerup", re, !0), t.removeEventListener("pointercancel", H, !0), t.removeEventListener("keydown", W, !0), o.removeEventListener("mousedown", R), o.removeEventListener("pointerdown", V), o.removeEventListener("keydown", ie), o.removeEventListener("contextmenu", U), d.removeEventListener("click", ae), a.remove());
|
|
5994
5994
|
}
|
|
5995
5995
|
};
|
|
5996
5996
|
}, Hs = "mesurer.screenshot", Us = "screenshot", Ws = "mesurer.screenshot.settings", Gs = "mesurer.screenshot.active", Ks = "runtime:solid", qs = "screenshot.toggle", Js = 2500, Ys = 0, Xs = [
|
|
@@ -6232,11 +6232,11 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
6232
6232
|
y && i.clearTimeout(y), g.style.display = "block", ee(g), y = i.setTimeout(() => {
|
|
6233
6233
|
y = 0, g.style.display = "none";
|
|
6234
6234
|
}, Js);
|
|
6235
|
-
}, te = () => {
|
|
6236
|
-
_ = null, A(null), d.style.visibility = "", d.style.display = "none", u.style.pointerEvents = "none", D(!1), k();
|
|
6237
6235
|
}, P = () => {
|
|
6238
|
-
|
|
6239
|
-
},
|
|
6236
|
+
_ = null, A(null), d.style.visibility = "", d.style.display = "none", u.style.pointerEvents = "none", D(!1), k();
|
|
6237
|
+
}, F = () => {
|
|
6238
|
+
b += 1, P(), Hr(i);
|
|
6239
|
+
}, te = async (e) => {
|
|
6240
6240
|
if (x) throw Error("A screenshot capture is already running.");
|
|
6241
6241
|
if (e.width < 4 || e.height < 4) throw Error("Screenshot selection must be at least 4px by 4px.");
|
|
6242
6242
|
x = !0;
|
|
@@ -6278,10 +6278,10 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
6278
6278
|
} finally {
|
|
6279
6279
|
d.style.visibility = "", u(), a.finishCapture(), x = !1;
|
|
6280
6280
|
}
|
|
6281
|
-
},
|
|
6281
|
+
}, I = async () => {
|
|
6282
6282
|
if (T().toolEnabled) {
|
|
6283
6283
|
if (w()) {
|
|
6284
|
-
|
|
6284
|
+
F();
|
|
6285
6285
|
return;
|
|
6286
6286
|
}
|
|
6287
6287
|
if (!S) {
|
|
@@ -6296,7 +6296,7 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
6296
6296
|
}
|
|
6297
6297
|
}
|
|
6298
6298
|
}
|
|
6299
|
-
},
|
|
6299
|
+
}, L = (e) => {
|
|
6300
6300
|
!w() || e.button !== 0 || (e.preventDefault(), e.stopPropagation(), _ = {
|
|
6301
6301
|
x: e.clientX,
|
|
6302
6302
|
y: e.clientY
|
|
@@ -6304,7 +6304,7 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
6304
6304
|
width: i.innerWidth,
|
|
6305
6305
|
height: i.innerHeight
|
|
6306
6306
|
})), d.setPointerCapture?.(e.pointerId));
|
|
6307
|
-
},
|
|
6307
|
+
}, R = (e) => {
|
|
6308
6308
|
!w() || !_ || A(vr(_, {
|
|
6309
6309
|
x: e.clientX,
|
|
6310
6310
|
y: e.clientY
|
|
@@ -6312,7 +6312,7 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
6312
6312
|
width: i.innerWidth,
|
|
6313
6313
|
height: i.innerHeight
|
|
6314
6314
|
}));
|
|
6315
|
-
},
|
|
6315
|
+
}, z = (e) => {
|
|
6316
6316
|
let t = _;
|
|
6317
6317
|
if (_ = null, !w() || !t) return;
|
|
6318
6318
|
d.hasPointerCapture?.(e.pointerId) && d.releasePointerCapture(e.pointerId);
|
|
@@ -6327,22 +6327,22 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
6327
6327
|
A(null);
|
|
6328
6328
|
return;
|
|
6329
6329
|
}
|
|
6330
|
-
|
|
6331
|
-
w() &&
|
|
6330
|
+
te(n).catch(() => void 0).finally(() => {
|
|
6331
|
+
w() && P();
|
|
6332
6332
|
});
|
|
6333
|
-
}, z = (e) => {
|
|
6334
|
-
_ = null, d.hasPointerCapture?.(e.pointerId) && d.releasePointerCapture(e.pointerId), A(null);
|
|
6335
6333
|
}, B = (e) => {
|
|
6336
|
-
|
|
6334
|
+
_ = null, d.hasPointerCapture?.(e.pointerId) && d.releasePointerCapture(e.pointerId), A(null);
|
|
6335
|
+
}, V = (e) => {
|
|
6336
|
+
e.key !== "Escape" || !w() || (e.preventDefault(), e.stopImmediatePropagation(), F());
|
|
6337
6337
|
};
|
|
6338
|
-
d.addEventListener("pointerdown",
|
|
6339
|
-
let
|
|
6338
|
+
d.addEventListener("pointerdown", L), d.addEventListener("pointermove", R), d.addEventListener("pointerup", z), d.addEventListener("pointercancel", B), i.addEventListener("keydown", V, !0);
|
|
6339
|
+
let ne = {
|
|
6340
6340
|
active: w,
|
|
6341
6341
|
settings: T,
|
|
6342
6342
|
setSettings: E,
|
|
6343
|
-
start:
|
|
6344
|
-
cancel:
|
|
6345
|
-
capture:
|
|
6343
|
+
start: I,
|
|
6344
|
+
cancel: F,
|
|
6345
|
+
capture: te
|
|
6346
6346
|
};
|
|
6347
6347
|
t.tool.register({
|
|
6348
6348
|
id: "screenshot",
|
|
@@ -6388,7 +6388,7 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
6388
6388
|
description: "Show the camera tool in the toolbar.",
|
|
6389
6389
|
value: () => T().toolEnabled,
|
|
6390
6390
|
set: (e) => {
|
|
6391
|
-
E({ toolEnabled: e }), !e && w() &&
|
|
6391
|
+
E({ toolEnabled: e }), !e && w() && F();
|
|
6392
6392
|
}
|
|
6393
6393
|
},
|
|
6394
6394
|
{
|
|
@@ -6416,11 +6416,11 @@ var rs = "mesurer.layout-guides", is = "layout-guides:v1", as = "mesurer.layout-
|
|
|
6416
6416
|
set: (e) => E({ includeMeasurements: e })
|
|
6417
6417
|
}
|
|
6418
6418
|
]
|
|
6419
|
-
}), t.command.register(qs,
|
|
6420
|
-
C = !0, b += 1, d.removeEventListener("pointerdown",
|
|
6419
|
+
}), t.command.register(qs, I), t.service.provide(Us, ne), t.lifecycle.onDispose(() => {
|
|
6420
|
+
C = !0, b += 1, d.removeEventListener("pointerdown", L), d.removeEventListener("pointermove", R), d.removeEventListener("pointerup", z), d.removeEventListener("pointercancel", B), i.removeEventListener("keydown", V, !0), y && i.clearTimeout(y), M.dispose(), k(), Hr(i), a.finishCapture(), a.dispose(), o.dispose();
|
|
6421
6421
|
});
|
|
6422
6422
|
}
|
|
6423
|
-
}), lc = "0.2.0-beta.
|
|
6423
|
+
}), lc = "0.2.0-beta.2", uc = ya, dc = ga, fc = _a, pc = ba, mc = va, hc = () => ({
|
|
6424
6424
|
...no(),
|
|
6425
6425
|
version: lc
|
|
6426
6426
|
}), gc = (e, t) => e.left <= t.left + t.width && e.left + e.width >= t.left && e.top <= t.top + t.height && e.top + e.height >= t.top, _c = (e) => {
|
|
@@ -6794,8 +6794,8 @@ var Lc = (e, t, n, r, i) => {
|
|
|
6794
6794
|
evidence: t,
|
|
6795
6795
|
id: n,
|
|
6796
6796
|
label: r
|
|
6797
|
-
});
|
|
6798
|
-
function
|
|
6797
|
+
}), zc = (e, t) => Math.abs(e.left - t.left) < .01 && Math.abs(e.top - t.top) < .01 && Math.abs(e.width - t.width) < .01 && Math.abs(e.height - t.height) < .01;
|
|
6798
|
+
function Bc(e) {
|
|
6799
6799
|
let t = e.runtime.annotation(e.annotationId);
|
|
6800
6800
|
if (!t) throw Error(`Mesurer annotation not found: ${e.annotationId}`);
|
|
6801
6801
|
let n = Nc({
|
|
@@ -6829,12 +6829,13 @@ function zc(e) {
|
|
|
6829
6829
|
Lc(a, "guide", `${e.orientation} guide ${e.id}`, e.position, t.position);
|
|
6830
6830
|
}
|
|
6831
6831
|
for (let e of t.baseline.measurements) {
|
|
6832
|
-
let
|
|
6833
|
-
if (!
|
|
6834
|
-
|
|
6832
|
+
let r = n.visualContext.measurements.find((t) => t.id === e.id) ?? i.find((t) => t.id === e.id);
|
|
6833
|
+
if (!r) {
|
|
6834
|
+
let r = t.baseline.targets.find((t) => zc(t.rect, e.rect));
|
|
6835
|
+
r && n.targets.some((e) => e.ref === r.id) || Rc(a, "measurement", e.id, e.id);
|
|
6835
6836
|
continue;
|
|
6836
6837
|
}
|
|
6837
|
-
Lc(a, "measurement", `${e.id} width`, e.rect.width,
|
|
6838
|
+
Lc(a, "measurement", `${e.id} width`, e.rect.width, r.rect.width), Lc(a, "measurement", `${e.id} height`, e.rect.height, r.rect.height);
|
|
6838
6839
|
}
|
|
6839
6840
|
for (let e of t.baseline.distances) {
|
|
6840
6841
|
let t = n.visualContext.distances.find((t) => t.id === e.id) ?? r.heldDistances.find((t) => t.id === e.id);
|
|
@@ -6854,7 +6855,7 @@ function zc(e) {
|
|
|
6854
6855
|
changes: a
|
|
6855
6856
|
};
|
|
6856
6857
|
}
|
|
6857
|
-
async function
|
|
6858
|
+
async function Vc(e, t, n) {
|
|
6858
6859
|
try {
|
|
6859
6860
|
if (t.navigator.clipboard?.writeText) {
|
|
6860
6861
|
await t.navigator.clipboard.writeText(n);
|
|
@@ -6868,22 +6869,22 @@ async function Bc(e, t, n) {
|
|
|
6868
6869
|
}
|
|
6869
6870
|
//#endregion
|
|
6870
6871
|
//#region src/layout-guides.ts
|
|
6871
|
-
var
|
|
6872
|
+
var Hc = rs, Uc = is, Wc = as, Gc = os, Kc = () => ({
|
|
6872
6873
|
...As(),
|
|
6873
6874
|
version: lc
|
|
6874
|
-
}),
|
|
6875
|
+
}), qc = "mesurer.context", Jc = "context:v1", Yc = "mesurer.context.settings", Xc = "context.ui", Zc = "data-mesurer-direct-text-edit-active", Qc = {
|
|
6875
6876
|
viewBox: "0 0 256 256",
|
|
6876
6877
|
paths: ["M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"]
|
|
6877
|
-
},
|
|
6878
|
+
}, $c = {
|
|
6878
6879
|
viewBox: "0 0 256 256",
|
|
6879
6880
|
paths: ["M152,40a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,40Zm-8,168H112a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM208,32H184a8,8,0,0,0,0,16h24V72a8,8,0,0,0,16,0V48A16,16,0,0,0,208,32Zm8,72a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V112A8,8,0,0,0,216,104Zm0,72a8,8,0,0,0-8,8v24H184a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V184A8,8,0,0,0,216,176ZM40,152a8,8,0,0,0,8-8V112a8,8,0,0,0-16,0v32A8,8,0,0,0,40,152Zm32,56H48V184a8,8,0,0,0-16,0v24a16,16,0,0,0,16,16H72a8,8,0,0,0,0-16ZM72,32H48A16,16,0,0,0,32,48V72a8,8,0,0,0,16,0V48H72a8,8,0,0,0,0-16Z"]
|
|
6880
|
-
},
|
|
6881
|
+
}, el = {
|
|
6881
6882
|
viewBox: "0 0 256 256",
|
|
6882
6883
|
paths: ["M229.66,58.34l-32-32a8,8,0,0,0-11.32,0l-96,96A8,8,0,0,0,88,128v32a8,8,0,0,0,8,8h32a8,8,0,0,0,5.66-2.34l96-96A8,8,0,0,0,229.66,58.34ZM124.69,152H104V131.31l64-64L188.69,88ZM200,76.69,179.31,56,192,43.31,212.69,64ZM224,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h80a8,8,0,0,1,0,16H48V208H208V128a8,8,0,0,1,16,0Z"]
|
|
6883
|
-
},
|
|
6884
|
+
}, tl = async (e, t, n = 1) => {
|
|
6884
6885
|
await e.fonts?.ready;
|
|
6885
6886
|
for (let e = 0; e < Math.max(1, n); e += 1) await new Promise((e) => t.requestAnimationFrame(() => e()));
|
|
6886
|
-
},
|
|
6887
|
+
}, nl = (e, t, n, r) => {
|
|
6887
6888
|
let i = async (i) => Nc({
|
|
6888
6889
|
runtime: e,
|
|
6889
6890
|
ownerDocument: t,
|
|
@@ -6894,17 +6895,17 @@ var Vc = rs, Hc = is, Uc = as, Wc = os, Gc = () => ({
|
|
|
6894
6895
|
return {
|
|
6895
6896
|
context: i,
|
|
6896
6897
|
contextText: a,
|
|
6897
|
-
copyContext: async (e) =>
|
|
6898
|
+
copyContext: async (e) => Vc(t, n, await a(e)),
|
|
6898
6899
|
select: async (r) => {
|
|
6899
6900
|
let a = Array.isArray(r) ? [...r] : [String(r)];
|
|
6900
|
-
return e.select(a), await
|
|
6901
|
+
return e.select(a), await tl(t, n), i({ scope: "selection" });
|
|
6901
6902
|
},
|
|
6902
6903
|
annotations: async () => e.annotations(),
|
|
6903
6904
|
removeAnnotation: async (r) => {
|
|
6904
|
-
e.removeAnnotation(r), await
|
|
6905
|
+
e.removeAnnotation(r), await tl(t, n);
|
|
6905
6906
|
},
|
|
6906
6907
|
review: async (i) => {
|
|
6907
|
-
if (await
|
|
6908
|
+
if (await tl(t, n), i) return Bc({
|
|
6908
6909
|
runtime: e,
|
|
6909
6910
|
ownerDocument: t,
|
|
6910
6911
|
ownerWindow: n,
|
|
@@ -6912,7 +6913,7 @@ var Vc = rs, Hc = is, Uc = as, Wc = os, Gc = () => ({
|
|
|
6912
6913
|
layoutGuides: r()
|
|
6913
6914
|
});
|
|
6914
6915
|
let a = r();
|
|
6915
|
-
return e.annotations().map((r) =>
|
|
6916
|
+
return e.annotations().map((r) => Bc({
|
|
6916
6917
|
runtime: e,
|
|
6917
6918
|
ownerDocument: t,
|
|
6918
6919
|
ownerWindow: n,
|
|
@@ -6922,36 +6923,36 @@ var Vc = rs, Hc = is, Uc = as, Wc = os, Gc = () => ({
|
|
|
6922
6923
|
},
|
|
6923
6924
|
capturePlan: async (e) => Ic(await i(e)),
|
|
6924
6925
|
prepareCapture: async () => {
|
|
6925
|
-
e.prepareCapture(), await
|
|
6926
|
+
e.prepareCapture(), await tl(t, n);
|
|
6926
6927
|
},
|
|
6927
6928
|
finishCapture: async () => {
|
|
6928
|
-
e.finishCapture(), await
|
|
6929
|
+
e.finishCapture(), await tl(t, n);
|
|
6929
6930
|
}
|
|
6930
6931
|
};
|
|
6931
|
-
},
|
|
6932
|
+
}, rl = (e) => {
|
|
6932
6933
|
let t = e.currentSelection();
|
|
6933
6934
|
return t.elements.length > 0 || t.region !== null;
|
|
6934
6935
|
};
|
|
6935
|
-
function
|
|
6936
|
+
function il(e = {}) {
|
|
6936
6937
|
return {
|
|
6937
|
-
id:
|
|
6938
|
+
id: qc,
|
|
6938
6939
|
version: lc,
|
|
6939
6940
|
requires: ["runtime:solid"],
|
|
6940
|
-
provides: [
|
|
6941
|
+
provides: [Jc],
|
|
6941
6942
|
setup(t) {
|
|
6942
6943
|
let n = t.service.get("runtime:solid");
|
|
6943
6944
|
if (!n) throw Error("Mesurer context plugin requires the renderer runtime service.");
|
|
6944
|
-
let r = n.createWorkspaceRuntime(
|
|
6945
|
-
t.service.provide(
|
|
6946
|
-
id:
|
|
6945
|
+
let r = n.createWorkspaceRuntime(qc), i = nl(r, n.ownerDocument, n.ownerWindow, () => t.service.get(Uc)?.list() ?? []);
|
|
6946
|
+
t.service.provide(Jc, i), t.state.register({
|
|
6947
|
+
id: Yc,
|
|
6947
6948
|
initial: { ui: e.ui ?? !0 },
|
|
6948
6949
|
persist: !0
|
|
6949
6950
|
}), t.state.register({
|
|
6950
|
-
id:
|
|
6951
|
-
initial: { hasSelection:
|
|
6951
|
+
id: Xc,
|
|
6952
|
+
initial: { hasSelection: rl(r) }
|
|
6952
6953
|
});
|
|
6953
|
-
let a = () => t.state.get("mesurer.context.settings")?.ui ?? !0, o = () => t.state.get(
|
|
6954
|
-
t.state.update(
|
|
6954
|
+
let a = () => t.state.get("mesurer.context.settings")?.ui ?? !0, o = () => t.state.get(Xc)?.hasSelection === !0, s = (e) => {
|
|
6955
|
+
t.state.update(Yc, (t) => ({
|
|
6955
6956
|
...t,
|
|
6956
6957
|
ui: e
|
|
6957
6958
|
}));
|
|
@@ -6965,12 +6966,12 @@ function rl(e = {}) {
|
|
|
6965
6966
|
region: e.region ? { ...e.region } : null
|
|
6966
6967
|
}, r.selectGestureActive() ? c?.abandonNoteComposer() : n && c?.closeNoteComposer();
|
|
6967
6968
|
let i = e.elements.length > 0 || e.region !== null;
|
|
6968
|
-
i !== (t.state.get(
|
|
6969
|
+
i !== (t.state.get(Xc)?.hasSelection ?? !1) && t.state.update(Xc, () => ({ hasSelection: i }));
|
|
6969
6970
|
});
|
|
6970
6971
|
t.command.register("context.copy", () => i.copyContext()), t.command.register("context.copy-selection", () => i.copyContext({ scope: "selection" }));
|
|
6971
6972
|
let g = () => {
|
|
6972
6973
|
let e = u?.element;
|
|
6973
|
-
e && (n.rendererRoot?.hasAttribute(
|
|
6974
|
+
e && (n.rendererRoot?.hasAttribute(Zc) ? e.setAttribute(Zc, "true") : e.removeAttribute(Zc));
|
|
6974
6975
|
}, _ = () => {
|
|
6975
6976
|
d?.disconnect(), d = null, c = null, l?.(), l = null, u?.dispose(), u = null;
|
|
6976
6977
|
}, v = () => {
|
|
@@ -6979,7 +6980,7 @@ function rl(e = {}) {
|
|
|
6979
6980
|
let e = new n.ownerWindow.MutationObserver(g);
|
|
6980
6981
|
d = e, e.observe(n.rendererRoot, {
|
|
6981
6982
|
attributes: !0,
|
|
6982
|
-
attributeFilter: [
|
|
6983
|
+
attributeFilter: [Zc]
|
|
6983
6984
|
}), g();
|
|
6984
6985
|
}
|
|
6985
6986
|
let e = {
|
|
@@ -7002,7 +7003,7 @@ function rl(e = {}) {
|
|
|
7002
7003
|
shortcut: "C",
|
|
7003
7004
|
command: "context.copy",
|
|
7004
7005
|
order: 70,
|
|
7005
|
-
icon:
|
|
7006
|
+
icon: Qc,
|
|
7006
7007
|
hidden: () => !a()
|
|
7007
7008
|
}), t.tool.register({
|
|
7008
7009
|
id: "context.copy-selection",
|
|
@@ -7010,7 +7011,7 @@ function rl(e = {}) {
|
|
|
7010
7011
|
shortcut: "Shift+C",
|
|
7011
7012
|
command: "context.copy-selection",
|
|
7012
7013
|
order: 71,
|
|
7013
|
-
icon:
|
|
7014
|
+
icon: $c,
|
|
7014
7015
|
hidden: () => !a(),
|
|
7015
7016
|
disabled: () => !o()
|
|
7016
7017
|
}), t.tool.register({
|
|
@@ -7019,7 +7020,7 @@ function rl(e = {}) {
|
|
|
7019
7020
|
shortcut: "N",
|
|
7020
7021
|
command: "context.add-note",
|
|
7021
7022
|
order: 72,
|
|
7022
|
-
icon:
|
|
7023
|
+
icon: el,
|
|
7023
7024
|
hidden: () => !a(),
|
|
7024
7025
|
disabled: () => !o()
|
|
7025
7026
|
}), t.settings.register({
|
|
@@ -7042,28 +7043,28 @@ function rl(e = {}) {
|
|
|
7042
7043
|
}
|
|
7043
7044
|
//#endregion
|
|
7044
7045
|
//#region src/codex-plugin.ts
|
|
7045
|
-
var
|
|
7046
|
+
var al = "mesurer.codex", ol = "codex:v1", sl = "http://127.0.0.1:47365", cl = 2e3, ll = 750, ul = 1800, dl = 2e3, fl = 12e4, pl = 10, ml = 5, hl = [
|
|
7046
7047
|
"Implement the current human feedback from Mesurer in this project.",
|
|
7047
7048
|
"Treat the rendered page as the source of truth, preserve unrelated Mesurer review state,",
|
|
7048
7049
|
"and verify the affected UI in the live page with Mesurer before claiming completion."
|
|
7049
|
-
].join(" "),
|
|
7050
|
+
].join(" "), gl = {
|
|
7050
7051
|
viewBox: "0 0 256 256",
|
|
7051
7052
|
paths: ["M224,48,32,120l88,32,32,88Z M120,152l104-104"]
|
|
7052
|
-
},
|
|
7053
|
+
}, _l = {
|
|
7053
7054
|
viewBox: "0 0 256 256",
|
|
7054
7055
|
paths: ["M72,32H184a8,8,0,0,1,0,16h-8v20.69a40,40,0,0,1-11.72,28.28L137.25,124l27.03,27.03A40,40,0,0,1,176,179.31V208h8a8,8,0,0,1,0,16H72a8,8,0,0,1,0-16h8V179.31a40,40,0,0,1,11.72-28.28L118.75,124,91.72,96.97A40,40,0,0,1,80,68.69V48H72a8,8,0,0,1,0-16Zm24,16V68.69a24,24,0,0,0,7.03,16.97L128,110.63l24.97-24.97A24,24,0,0,0,160,68.69V48Zm32,90.63-24.97,24.97A24,24,0,0,0,96,180.57V208h64V180.57a24,24,0,0,0-7.03-16.97Z"]
|
|
7055
|
-
},
|
|
7056
|
+
}, vl = {
|
|
7056
7057
|
viewBox: "0 0 256 256",
|
|
7057
7058
|
paths: ["M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"]
|
|
7058
|
-
},
|
|
7059
|
+
}, yl = (e) => {
|
|
7059
7060
|
try {
|
|
7060
7061
|
let t = globalThis.location;
|
|
7061
7062
|
return t?.origin ? `mesurer-codex-ui:v1:${e}:${t.origin}${t.pathname}` : null;
|
|
7062
7063
|
} catch {
|
|
7063
7064
|
return null;
|
|
7064
7065
|
}
|
|
7065
|
-
},
|
|
7066
|
-
let t =
|
|
7066
|
+
}, bl = (e) => {
|
|
7067
|
+
let t = yl(e);
|
|
7067
7068
|
if (!t) return null;
|
|
7068
7069
|
try {
|
|
7069
7070
|
let e = globalThis.sessionStorage?.getItem(t);
|
|
@@ -7088,18 +7089,18 @@ var il = "mesurer.codex", al = "codex:v1", ol = "http://127.0.0.1:47365", sl = 2
|
|
|
7088
7089
|
} catch {
|
|
7089
7090
|
return null;
|
|
7090
7091
|
}
|
|
7091
|
-
},
|
|
7092
|
-
let n =
|
|
7092
|
+
}, xl = (e, t) => {
|
|
7093
|
+
let n = yl(e);
|
|
7093
7094
|
if (n) try {
|
|
7094
7095
|
globalThis.sessionStorage?.setItem(n, JSON.stringify(t));
|
|
7095
7096
|
} catch {}
|
|
7096
|
-
},
|
|
7097
|
+
}, Sl = (e, t) => {
|
|
7097
7098
|
let n = e.endsWith("/") ? e : `${e}/`;
|
|
7098
7099
|
return new URL(t, n).toString();
|
|
7099
|
-
},
|
|
7100
|
+
}, Cl = async (e, t, n) => {
|
|
7100
7101
|
let r = new AbortController(), i = setTimeout(() => r.abort(), 15e3);
|
|
7101
7102
|
try {
|
|
7102
|
-
let i = await fetch(
|
|
7103
|
+
let i = await fetch(Sl(e, t), {
|
|
7103
7104
|
...n,
|
|
7104
7105
|
signal: r.signal
|
|
7105
7106
|
}), a = await i.text(), o = {};
|
|
@@ -7115,10 +7116,10 @@ var il = "mesurer.codex", al = "codex:v1", ol = "http://127.0.0.1:47365", sl = 2
|
|
|
7115
7116
|
} finally {
|
|
7116
7117
|
clearTimeout(i);
|
|
7117
7118
|
}
|
|
7118
|
-
},
|
|
7119
|
+
}, wl = (e) => ({
|
|
7119
7120
|
thread: e.thread?.trim() || null,
|
|
7120
7121
|
threads: Array.isArray(e.threads) ? e.threads.filter((e) => e.trim().length > 0) : []
|
|
7121
|
-
}),
|
|
7122
|
+
}), Tl = (e) => {
|
|
7122
7123
|
let t = e.deliveryId?.trim(), n = e.thread?.trim(), r = e.status;
|
|
7123
7124
|
if (!t || !n || !r) throw Error("Mesurer Codex bridge returned an invalid delivery state.");
|
|
7124
7125
|
let i = {
|
|
@@ -7130,7 +7131,7 @@ var il = "mesurer.codex", al = "codex:v1", ol = "http://127.0.0.1:47365", sl = 2
|
|
|
7130
7131
|
updatedAt: Number.isFinite(e.updatedAt) ? Number(e.updatedAt) : 0
|
|
7131
7132
|
};
|
|
7132
7133
|
return e.queuedSubmissionId !== void 0 && (i.queuedSubmissionId = e.queuedSubmissionId?.trim() || null), e.dispatch !== void 0 && (i.dispatch = e.dispatch), e.dispatchError !== void 0 && (i.dispatchError = e.dispatchError?.trim() || null), i;
|
|
7133
|
-
},
|
|
7134
|
+
}, El = (e) => ({
|
|
7134
7135
|
thread: e.thread?.trim() || null,
|
|
7135
7136
|
threads: Array.isArray(e.threadDetails) ? e.threadDetails.flatMap((e) => {
|
|
7136
7137
|
let t = e.id?.trim() ?? "";
|
|
@@ -7142,7 +7143,7 @@ var il = "mesurer.codex", al = "codex:v1", ol = "http://127.0.0.1:47365", sl = 2
|
|
|
7142
7143
|
}] : [];
|
|
7143
7144
|
}) : [],
|
|
7144
7145
|
hasMore: e.hasMore === !0
|
|
7145
|
-
}),
|
|
7146
|
+
}), Dl = async (e, t, n) => {
|
|
7146
7147
|
let r = t?.instruction?.trim() || n, i = await e.annotations(), a = t?.annotationIds, o = a ? a.flatMap((e) => {
|
|
7147
7148
|
let t = i.find((t) => t.id === e);
|
|
7148
7149
|
return t ? [t] : [];
|
|
@@ -7165,18 +7166,18 @@ var il = "mesurer.codex", al = "codex:v1", ol = "http://127.0.0.1:47365", sl = 2
|
|
|
7165
7166
|
])
|
|
7166
7167
|
].join("\n").trimEnd()
|
|
7167
7168
|
};
|
|
7168
|
-
},
|
|
7169
|
-
function
|
|
7170
|
-
let t = e.endpoint ??
|
|
7169
|
+
}, Ol = (e) => e.length > 16 ? `${e.slice(0, 8)}…${e.slice(-4)}` : e, kl = (e, t = 42) => e.length > t ? `${e.slice(0, t - 1)}…` : e, Al = (e, t) => e instanceof Error && e.message === `Mesurer Codex bridge is unavailable at ${t}. Start the local bridge before queueing feedback.`;
|
|
7170
|
+
function jl(e = {}) {
|
|
7171
|
+
let t = e.endpoint ?? sl, n = e.instruction?.trim() || hl, r = e.ui ?? !0, i = e.clearCompletedAnnotations ?? !0;
|
|
7171
7172
|
return {
|
|
7172
|
-
id:
|
|
7173
|
+
id: al,
|
|
7173
7174
|
version: lc,
|
|
7174
|
-
requires: [
|
|
7175
|
-
provides: [
|
|
7175
|
+
requires: [Jc],
|
|
7176
|
+
provides: [ol],
|
|
7176
7177
|
setup(e) {
|
|
7177
|
-
let a = e.service.get(
|
|
7178
|
+
let a = e.service.get(Jc);
|
|
7178
7179
|
if (!a) throw Error("Mesurer Codex plugin requires context() from mesurer-solid/plugins.");
|
|
7179
|
-
let o = r ?
|
|
7180
|
+
let o = r ? bl(t) : null, s = "unknown", c = !1, l = o?.originThread ?? null, u = o?.selectedThread ?? o?.originThread ?? null, d = !1, f = null, p = [], m = [], h = !1, g = ml, _, v = "", y = null, b = o?.delivery ? {
|
|
7180
7181
|
id: o.delivery.id,
|
|
7181
7182
|
thread: o.delivery.thread,
|
|
7182
7183
|
status: o.delivery.status,
|
|
@@ -7184,22 +7185,22 @@ function Al(e = {}) {
|
|
|
7184
7185
|
queuedSubmissionId: o.delivery.queuedSubmissionId ?? null,
|
|
7185
7186
|
dispatch: o.delivery.dispatch ?? null,
|
|
7186
7187
|
dispatchError: o.delivery.dispatchError ?? null
|
|
7187
|
-
} : null, x = 0, S = 0, C = null, w = !1, T = async () =>
|
|
7188
|
+
} : null, x = 0, S = 0, C = null, w = !1, T = async () => wl(await Cl(t, "health")), E = async (e) => Tl(await Cl(t, `deliveries/${encodeURIComponent(e)}`)), D = async (e) => {
|
|
7188
7189
|
if (!e.id || !e.thread) throw Error("Cannot restore a Codex delivery without its id and thread.");
|
|
7189
7190
|
let n = {
|
|
7190
7191
|
deliveryId: e.id,
|
|
7191
7192
|
thread: e.thread
|
|
7192
7193
|
};
|
|
7193
|
-
return e.queuedSubmissionId && (n.queuedSubmissionId = e.queuedSubmissionId),
|
|
7194
|
+
return e.queuedSubmissionId && (n.queuedSubmissionId = e.queuedSubmissionId), Tl(await Cl(t, "deliveries/restore", {
|
|
7194
7195
|
method: "POST",
|
|
7195
7196
|
headers: { "Content-Type": "application/json" },
|
|
7196
7197
|
body: JSON.stringify(n)
|
|
7197
7198
|
}));
|
|
7198
7199
|
}, O = async (e = {}) => {
|
|
7199
7200
|
let n = new URLSearchParams();
|
|
7200
|
-
n.set("limit", String(e.limit ??
|
|
7201
|
+
n.set("limit", String(e.limit ?? pl));
|
|
7201
7202
|
let r = e.thread?.trim();
|
|
7202
|
-
return r && n.set("thread", r),
|
|
7203
|
+
return r && n.set("thread", r), El(await Cl(t, `threads?${n.toString()}`));
|
|
7203
7204
|
}, k = () => u ?? l ?? (d ? null : f), A = () => {
|
|
7204
7205
|
if (!r) return;
|
|
7205
7206
|
let e = b?.id && (b.status === "queued" || b.status === "working" || b.status === "interrupted") ? {
|
|
@@ -7211,7 +7212,7 @@ function Al(e = {}) {
|
|
|
7211
7212
|
dispatch: b.dispatch,
|
|
7212
7213
|
dispatchError: b.dispatchError
|
|
7213
7214
|
} : null;
|
|
7214
|
-
|
|
7215
|
+
xl(t, {
|
|
7215
7216
|
version: 1,
|
|
7216
7217
|
originThread: l,
|
|
7217
7218
|
selectedThread: u,
|
|
@@ -7225,16 +7226,16 @@ function Al(e = {}) {
|
|
|
7225
7226
|
"queued",
|
|
7226
7227
|
"working",
|
|
7227
7228
|
"completed"
|
|
7228
|
-
].includes(b.status), ee = () => b?.status === "queued" && (b.dispatch === "desktop-send-uncertain" || b.dispatch === "desktop-wait-failed"), N = (e) => e === "queueing" ? "Queueing…" : e === "queued" ? "Queued" : e === "working" ? "Working…" : e === "completed" ? "Done" : e === "interrupted" ? "Interrupted" : "Failed",
|
|
7229
|
+
].includes(b.status), ee = () => b?.status === "queued" && (b.dispatch === "desktop-send-uncertain" || b.dispatch === "desktop-wait-failed"), N = (e) => e === "queueing" ? "Queueing…" : e === "queued" ? "Queued" : e === "working" ? "Working…" : e === "completed" ? "Done" : e === "interrupted" ? "Interrupted" : "Failed", P = () => b ? b.status === "queueing" ? "Queueing to Codex…" : ee() ? "Codex delivery blocked" : b.status === "queued" ? "Queued for Codex" : b.status === "working" ? "Codex working…" : b.status === "completed" ? "Codex finished" : b.status === "interrupted" ? "Codex interrupted" : "Queue failed" : null, F = () => b ? [
|
|
7229
7230
|
"queueing",
|
|
7230
7231
|
"queued",
|
|
7231
7232
|
"working"
|
|
7232
|
-
].includes(b.status) ?
|
|
7233
|
+
].includes(b.status) ? _l : b.status === "completed" ? vl : gl : gl, te = () => {
|
|
7233
7234
|
let e = [], t = /* @__PURE__ */ new Set(), n = (n) => {
|
|
7234
7235
|
t.has(n.id) || (t.add(n.id), e.push(n));
|
|
7235
7236
|
}, r = (e) => ({
|
|
7236
7237
|
id: e,
|
|
7237
|
-
title: `Codex ${
|
|
7238
|
+
title: `Codex ${Ol(e)}`,
|
|
7238
7239
|
updatedAt: null,
|
|
7239
7240
|
connected: !0
|
|
7240
7241
|
});
|
|
@@ -7244,34 +7245,34 @@ function Al(e = {}) {
|
|
|
7244
7245
|
for (let e of m) n(e);
|
|
7245
7246
|
for (let e of p) n(m.find((t) => t.id === e) ?? r(e));
|
|
7246
7247
|
return e;
|
|
7247
|
-
},
|
|
7248
|
+
}, I = (e = !1) => Promise.resolve(), L = () => {
|
|
7248
7249
|
if (s !== "available") return [{
|
|
7249
7250
|
id: "codex.thread.connect",
|
|
7250
7251
|
label: s === "unavailable" ? "Retry Codex connection" : "Choose Codex thread…",
|
|
7251
|
-
run: () =>
|
|
7252
|
+
run: () => I(!0)
|
|
7252
7253
|
}];
|
|
7253
|
-
let e =
|
|
7254
|
+
let e = te(), t = e.slice(0, g), n = k(), r = t.map((e) => {
|
|
7254
7255
|
let t = e.id === l ? "Current · " : e.connected ? "Connected · " : "", r = b?.thread === e.id ? ` · ${ee() ? "Blocked" : N(b.status)}` : "";
|
|
7255
7256
|
return {
|
|
7256
7257
|
id: `codex.thread.${e.id}`,
|
|
7257
|
-
label: `${t}${
|
|
7258
|
+
label: `${t}${kl(e.title)}${r}`,
|
|
7258
7259
|
checked: () => n === e.id,
|
|
7259
7260
|
disabled: () => M(),
|
|
7260
7261
|
run() {
|
|
7261
|
-
M() || (j(e.id, !l),
|
|
7262
|
+
M() || (j(e.id, !l), R());
|
|
7262
7263
|
}
|
|
7263
7264
|
};
|
|
7264
7265
|
});
|
|
7265
|
-
return g <
|
|
7266
|
+
return g < pl && (e.length > g || h) && r.push({
|
|
7266
7267
|
id: "codex.thread.show-more",
|
|
7267
7268
|
label: "Show 5 more…",
|
|
7268
7269
|
run() {
|
|
7269
|
-
g =
|
|
7270
|
+
g = pl, R();
|
|
7270
7271
|
}
|
|
7271
7272
|
}), r;
|
|
7272
|
-
},
|
|
7273
|
+
}, R = () => {
|
|
7273
7274
|
if (!r || w) return;
|
|
7274
|
-
let t = k(), n =
|
|
7275
|
+
let t = k(), n = L(), i = !M() && !d && s !== "unavailable" && (s === "unknown" || !!t), a = P() ?? (s === "unavailable" ? "Codex unavailable" : d || s === "available" && !t ? "Choose Codex thread" : "Queue to Codex"), o = JSON.stringify({
|
|
7275
7276
|
bridgeAvailability: s,
|
|
7276
7277
|
routeNeedsSelection: d,
|
|
7277
7278
|
target: t,
|
|
@@ -7290,50 +7291,50 @@ function Al(e = {}) {
|
|
|
7290
7291
|
label: a,
|
|
7291
7292
|
command: "codex.queue",
|
|
7292
7293
|
order: 73,
|
|
7293
|
-
icon:
|
|
7294
|
+
icon: F(),
|
|
7294
7295
|
disabled: () => !i,
|
|
7295
7296
|
menu: n.length ? {
|
|
7296
7297
|
label: "Codex destination",
|
|
7297
7298
|
items: n
|
|
7298
7299
|
} : void 0
|
|
7299
7300
|
}));
|
|
7300
|
-
},
|
|
7301
|
+
}, z = async () => {
|
|
7301
7302
|
if (s !== "available") return;
|
|
7302
7303
|
let e = l && p.includes(l) ? l : f;
|
|
7303
7304
|
try {
|
|
7304
7305
|
let t = await O({
|
|
7305
|
-
limit:
|
|
7306
|
+
limit: pl,
|
|
7306
7307
|
thread: e ?? void 0
|
|
7307
7308
|
});
|
|
7308
7309
|
m = t.threads, h = t.hasMore;
|
|
7309
7310
|
} catch {
|
|
7310
7311
|
m = p.map((e) => ({
|
|
7311
7312
|
id: e,
|
|
7312
|
-
title: `Codex ${
|
|
7313
|
+
title: `Codex ${Ol(e)}`,
|
|
7313
7314
|
updatedAt: null,
|
|
7314
7315
|
connected: !0
|
|
7315
7316
|
})), h = !1;
|
|
7316
7317
|
}
|
|
7317
7318
|
};
|
|
7318
|
-
|
|
7319
|
+
I = (e = !1) => w || s === "unknown" && !e ? Promise.resolve() : y || (y = (async () => {
|
|
7319
7320
|
try {
|
|
7320
7321
|
let e = await T(), t = e.thread !== f;
|
|
7321
7322
|
s = "available", c = !0, f = e.thread, p = e.threads;
|
|
7322
7323
|
let n = u ?? l;
|
|
7323
|
-
n ? d = !e.threads.includes(n) : e.threads.length === 1 ? j(e.threads[0], !0) : d = (e.threads.length, !0), (t || m.length === 0 || d) && await
|
|
7324
|
+
n ? d = !e.threads.includes(n) : e.threads.length === 1 ? j(e.threads[0], !0) : d = (e.threads.length, !0), (t || m.length === 0 || d) && await z(), d && n && m.some((e) => e.id === n) && (d = !1, A());
|
|
7324
7325
|
} catch (e) {
|
|
7325
7326
|
throw s = "unavailable", e;
|
|
7326
7327
|
} finally {
|
|
7327
|
-
y = null,
|
|
7328
|
+
y = null, R();
|
|
7328
7329
|
}
|
|
7329
7330
|
})(), y);
|
|
7330
|
-
let
|
|
7331
|
+
let B = () => {
|
|
7331
7332
|
x &&= (globalThis.clearTimeout(x), 0), S &&= (globalThis.clearTimeout(S), 0);
|
|
7332
|
-
},
|
|
7333
|
+
}, V = () => {
|
|
7333
7334
|
S && globalThis.clearTimeout(S), S = globalThis.setTimeout(() => {
|
|
7334
|
-
S = 0, b?.status === "completed" && (b = null, A(),
|
|
7335
|
-
},
|
|
7336
|
-
},
|
|
7335
|
+
S = 0, b?.status === "completed" && (b = null, A(), R());
|
|
7336
|
+
}, ul);
|
|
7337
|
+
}, ne = async (e) => {
|
|
7337
7338
|
if (!(!b || b.id !== e.id)) {
|
|
7338
7339
|
if (b = {
|
|
7339
7340
|
...b,
|
|
@@ -7344,44 +7345,44 @@ function Al(e = {}) {
|
|
|
7344
7345
|
dispatchError: e.dispatchError ?? b.dispatchError
|
|
7345
7346
|
}, A(), e.status === "completed") {
|
|
7346
7347
|
if (i) for (let e of b.annotationIds) await a.removeAnnotation(e);
|
|
7347
|
-
A(),
|
|
7348
|
+
A(), R(), V();
|
|
7348
7349
|
return;
|
|
7349
7350
|
}
|
|
7350
7351
|
if (e.status === "interrupted") {
|
|
7351
|
-
A(),
|
|
7352
|
+
A(), R();
|
|
7352
7353
|
let t = e.updatedAt > 0 ? e.updatedAt : Date.now();
|
|
7353
|
-
Date.now() - t <
|
|
7354
|
+
Date.now() - t < fl && (x = globalThis.setTimeout(() => {
|
|
7354
7355
|
x = 0, re(e.id);
|
|
7355
|
-
},
|
|
7356
|
+
}, dl));
|
|
7356
7357
|
return;
|
|
7357
7358
|
}
|
|
7358
|
-
|
|
7359
|
+
R(), x = globalThis.setTimeout(() => {
|
|
7359
7360
|
x = 0, re(e.id);
|
|
7360
|
-
},
|
|
7361
|
+
}, ll);
|
|
7361
7362
|
}
|
|
7362
7363
|
}, re = async (e) => {
|
|
7363
7364
|
if (!(w || b?.id !== e)) try {
|
|
7364
|
-
await
|
|
7365
|
+
await ne(await E(e));
|
|
7365
7366
|
} catch (n) {
|
|
7366
7367
|
if (b?.id !== e) return;
|
|
7367
7368
|
let r = n;
|
|
7368
7369
|
if (b.status === "queued" && b.thread) try {
|
|
7369
|
-
s !== "available" && await
|
|
7370
|
+
s !== "available" && await I(!0);
|
|
7370
7371
|
let e = await D(b);
|
|
7371
|
-
await
|
|
7372
|
+
await ne(e);
|
|
7372
7373
|
return;
|
|
7373
7374
|
} catch (e) {
|
|
7374
7375
|
r = e;
|
|
7375
7376
|
}
|
|
7376
7377
|
if (b?.id !== e) return;
|
|
7377
7378
|
if (b.status === "interrupted") {
|
|
7378
|
-
|
|
7379
|
+
R();
|
|
7379
7380
|
return;
|
|
7380
7381
|
}
|
|
7381
7382
|
b = {
|
|
7382
7383
|
...b,
|
|
7383
7384
|
status: "failed"
|
|
7384
|
-
}, A(),
|
|
7385
|
+
}, A(), Al(r, t) && (s = "unavailable"), R();
|
|
7385
7386
|
}
|
|
7386
7387
|
}, H = {
|
|
7387
7388
|
health: T,
|
|
@@ -7390,20 +7391,20 @@ function Al(e = {}) {
|
|
|
7390
7391
|
async useThread(e) {
|
|
7391
7392
|
let n = e.trim();
|
|
7392
7393
|
if (!n) throw Error("Codex thread must be a non-empty string.");
|
|
7393
|
-
let r =
|
|
7394
|
+
let r = wl(await Cl(t, "target", {
|
|
7394
7395
|
method: "POST",
|
|
7395
7396
|
headers: { "Content-Type": "application/json" },
|
|
7396
7397
|
body: JSON.stringify({ thread: n })
|
|
7397
7398
|
}));
|
|
7398
|
-
return j(n, !l), f = r.thread, p = r.threads, s = "available", c = !0,
|
|
7399
|
+
return j(n, !l), f = r.thread, p = r.threads, s = "available", c = !0, R(), r;
|
|
7399
7400
|
},
|
|
7400
7401
|
async queue(e) {
|
|
7401
|
-
let i = await
|
|
7402
|
+
let i = await Dl(a, e, n), o = e?.thread?.trim(), c = o || (r ? k() : null);
|
|
7402
7403
|
if (r && !o && (d || !c)) throw Error("Choose a Codex thread before queueing feedback.");
|
|
7403
7404
|
let l = { message: i.message };
|
|
7404
7405
|
c && (l.thread = c);
|
|
7405
7406
|
try {
|
|
7406
|
-
let e = await
|
|
7407
|
+
let e = await Cl(t, "send", {
|
|
7407
7408
|
method: "POST",
|
|
7408
7409
|
headers: { "Content-Type": "application/json" },
|
|
7409
7410
|
body: JSON.stringify(l)
|
|
@@ -7419,16 +7420,16 @@ function Al(e = {}) {
|
|
|
7419
7420
|
};
|
|
7420
7421
|
return e.queuedSubmissionId !== void 0 && (r.queuedSubmissionId = e.queuedSubmissionId?.trim() || null), e.dispatch !== void 0 && (r.dispatch = e.dispatch), e.dispatchError !== void 0 && (r.dispatchError = e.dispatchError?.trim() || null), r;
|
|
7421
7422
|
} catch (e) {
|
|
7422
|
-
throw r &&
|
|
7423
|
+
throw r && Al(e, t) && (s = "unavailable", R()), e;
|
|
7423
7424
|
}
|
|
7424
7425
|
},
|
|
7425
7426
|
send(e) {
|
|
7426
7427
|
return H.queue(e);
|
|
7427
7428
|
}
|
|
7428
7429
|
};
|
|
7429
|
-
e.service.provide(
|
|
7430
|
+
e.service.provide(ol, H);
|
|
7430
7431
|
let ie = async () => {
|
|
7431
|
-
if (!(C || M())) return
|
|
7432
|
+
if (!(C || M())) return B(), b = {
|
|
7432
7433
|
id: null,
|
|
7433
7434
|
thread: k(),
|
|
7434
7435
|
status: "queueing",
|
|
@@ -7436,9 +7437,9 @@ function Al(e = {}) {
|
|
|
7436
7437
|
queuedSubmissionId: null,
|
|
7437
7438
|
dispatch: null,
|
|
7438
7439
|
dispatchError: null
|
|
7439
|
-
},
|
|
7440
|
+
}, R(), C = (async () => {
|
|
7440
7441
|
try {
|
|
7441
|
-
r && s !== "available" && await
|
|
7442
|
+
r && s !== "available" && await I(!0);
|
|
7442
7443
|
let e = await H.queue();
|
|
7443
7444
|
b = {
|
|
7444
7445
|
id: e.deliveryId,
|
|
@@ -7448,7 +7449,7 @@ function Al(e = {}) {
|
|
|
7448
7449
|
queuedSubmissionId: e.queuedSubmissionId ?? null,
|
|
7449
7450
|
dispatch: e.dispatch ?? null,
|
|
7450
7451
|
dispatchError: e.dispatchError ?? null
|
|
7451
|
-
}, j(e.thread, !l), A(),
|
|
7452
|
+
}, j(e.thread, !l), A(), R(), console.info(`[Mesurer] Queued feedback for Codex thread ${e.thread}.`), e.deliveryId ? e.status === "completed" || e.status === "interrupted" ? await ne({
|
|
7452
7453
|
id: e.deliveryId,
|
|
7453
7454
|
thread: e.thread,
|
|
7454
7455
|
status: e.status,
|
|
@@ -7457,11 +7458,11 @@ function Al(e = {}) {
|
|
|
7457
7458
|
updatedAt: 0
|
|
7458
7459
|
}) : x = globalThis.setTimeout(() => {
|
|
7459
7460
|
x = 0, re(e.deliveryId);
|
|
7460
|
-
},
|
|
7461
|
-
S = 0, b?.id === null && b?.status === "queued" && (b = null, A(),
|
|
7462
|
-
},
|
|
7461
|
+
}, ll) : S = globalThis.setTimeout(() => {
|
|
7462
|
+
S = 0, b?.id === null && b?.status === "queued" && (b = null, A(), R());
|
|
7463
|
+
}, ul);
|
|
7463
7464
|
} catch (e) {
|
|
7464
|
-
b = null, A(),
|
|
7465
|
+
b = null, A(), R();
|
|
7465
7466
|
let t = e instanceof Error ? e.message : String(e);
|
|
7466
7467
|
throw console.error(`[Mesurer] Failed to queue feedback for Codex: ${t}`), e;
|
|
7467
7468
|
} finally {
|
|
@@ -7470,14 +7471,14 @@ function Al(e = {}) {
|
|
|
7470
7471
|
})(), C;
|
|
7471
7472
|
};
|
|
7472
7473
|
if (e.command.register("codex.queue", ie), e.command.register("codex.send", ie), r) {
|
|
7473
|
-
|
|
7474
|
+
R(), b?.id && (c = !0, x = globalThis.setTimeout(() => {
|
|
7474
7475
|
x = 0, b?.id && re(b.id);
|
|
7475
7476
|
}, 0));
|
|
7476
7477
|
let t = globalThis.setInterval(() => {
|
|
7477
|
-
c &&
|
|
7478
|
-
},
|
|
7478
|
+
c && I().catch(() => void 0);
|
|
7479
|
+
}, cl);
|
|
7479
7480
|
e.lifecycle.onDispose(() => {
|
|
7480
|
-
w = !0,
|
|
7481
|
+
w = !0, B(), globalThis.clearInterval(t), _?.dispose(), _ = void 0;
|
|
7481
7482
|
});
|
|
7482
7483
|
}
|
|
7483
7484
|
}
|
|
@@ -7485,12 +7486,12 @@ function Al(e = {}) {
|
|
|
7485
7486
|
}
|
|
7486
7487
|
//#endregion
|
|
7487
7488
|
//#region src/screenshot.ts
|
|
7488
|
-
var
|
|
7489
|
+
var Ml = Gs, Nl = Hs, Pl = Us, Fl = Ws, Il = 4, Ll = Ur, Rl = (e, t) => br(e, t), zl = (e = /* @__PURE__ */ new Date()) => xr(e), Bl = (e, t, n, r) => yr(e, t, n, r), Vl = (e, t, n) => vr(e, t, n), Hl = (e, t) => Br(e, t), Ul = (e) => Hr(e), Wl = (e = {}) => ({
|
|
7489
7490
|
...cc(e),
|
|
7490
7491
|
version: lc
|
|
7491
|
-
}),
|
|
7492
|
+
}), Gl = (e) => Cr(e), Kl = (e) => ({
|
|
7492
7493
|
...e,
|
|
7493
7494
|
version: lc
|
|
7494
|
-
}),
|
|
7495
|
+
}), ql = () => Kl(io()), Jl = () => Kl(ao()), Yl = () => Kl(oo()), Xl = () => Kl(so()), Zl = () => Kl(co()), Ql = () => Kl(lo()), $l = () => Kl(fo()), eu = () => Kl(uo()), tu = () => po().map(Kl), nu = (e = [], t = []) => mo(e, t).map((e) => e.id.startsWith("mesurer.") ? Kl(e) : e);
|
|
7495
7496
|
//#endregion
|
|
7496
|
-
export { uc as MESURER_ARRANGE_ACTIVE_STATE_ID, dc as MESURER_ARRANGE_PLUGIN_ID, fc as MESURER_ARRANGE_SERVICE_ID, pc as MESURER_ARRANGE_SETTINGS_STATE_ID, mc as MESURER_ARRANGE_STATE_ID,
|
|
7497
|
+
export { uc as MESURER_ARRANGE_ACTIVE_STATE_ID, dc as MESURER_ARRANGE_PLUGIN_ID, fc as MESURER_ARRANGE_SERVICE_ID, pc as MESURER_ARRANGE_SETTINGS_STATE_ID, mc as MESURER_ARRANGE_STATE_ID, al as MESURER_CODEX_PLUGIN_ID, ol as MESURER_CODEX_SERVICE_ID, qc as MESURER_CONTEXT_PLUGIN_ID, Jc as MESURER_CONTEXT_SERVICE_ID, Yc as MESURER_CONTEXT_SETTINGS_STATE_ID, Gc as MESURER_LAYOUT_GUIDES_ACTIVE_STATE_ID, Hc as MESURER_LAYOUT_GUIDES_PLUGIN_ID, Uc as MESURER_LAYOUT_GUIDES_SERVICE_ID, Wc as MESURER_LAYOUT_GUIDES_STATE_ID, Ml as MESURER_SCREENSHOT_ACTIVE_STATE_ID, Nl as MESURER_SCREENSHOT_PLUGIN_ID, Pl as MESURER_SCREENSHOT_SERVICE_ID, Fl as MESURER_SCREENSHOT_SETTINGS_STATE_ID, Il as MIN_SCREENSHOT_SELECTION, hc as arrange, Ll as captureVisibleTabPng, jl as codex, Yl as colorPicker, nu as compose, il as context, Rl as copyPngToClipboard, zl as createScreenshotFilename, Bl as cropPngToViewportRect, tu as defaults, $l as distance, Ql as guides, Kc as layoutGuides, Vl as normalizeScreenshotRect, Hl as prepareScreenshotCapture, Ul as releaseScreenshotCapture, Xl as rulers, Wl as screenshot, ql as select, eu as settings, Zl as typography, Gl as waitForNextPaint, Jl as xray };
|