mesurer-solid 0.2.1-beta.11 → 0.2.1-beta.12
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 +904 -898
- package/dist/inject-script.js +9 -9
- package/dist/inject.js +899 -893
- package/dist/plugins.js +863 -857
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -88,14 +88,14 @@ function F(e) {
|
|
|
88
88
|
e.se & 16 ? e.se &= -12 : (Ae(e, P), e.se &= -4);
|
|
89
89
|
}
|
|
90
90
|
var I = 0, L = null, R = !1, z = !1, B = !1, V = 0, H = !1, U = /* @__PURE__ */ new Set();
|
|
91
|
-
function
|
|
91
|
+
function W(e) {
|
|
92
92
|
U.add(e);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function ee(e) {
|
|
95
95
|
let t = e.m;
|
|
96
96
|
return M.size === 0 && T.size === 0 && e.vt.length === 0 && t.Me.length === 0 && t.A.length === 0 && t.cn.size === 0 && U.size === 0;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function te() {
|
|
99
99
|
if (U.size !== 0) for (let e of U) {
|
|
100
100
|
if (e.o !== null) {
|
|
101
101
|
U.delete(e);
|
|
@@ -104,10 +104,10 @@ function ne() {
|
|
|
104
104
|
e.De === v && (e._e === void 0 || e._e === v) && (e.t || (U.delete(e), e.ut?.()));
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function G(e) {
|
|
108
108
|
H = e;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function ne() {
|
|
111
111
|
return {
|
|
112
112
|
de: I,
|
|
113
113
|
Qt: [],
|
|
@@ -124,7 +124,7 @@ function re() {
|
|
|
124
124
|
ln: /* @__PURE__ */ new Set()
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function re(e, t) {
|
|
128
128
|
t.fn = e, e.ie.push(...t.ie);
|
|
129
129
|
for (let n of T) n.Ne === t && (n.Ne = e);
|
|
130
130
|
t.Me.length && (e.Me.push(...t.Me), t.Me.length = 0), t.A.length && (e.A.push(...t.A), t.A.length = 0);
|
|
@@ -136,7 +136,7 @@ function ie(e, t) {
|
|
|
136
136
|
}
|
|
137
137
|
for (let n of t.ln) e.ln.add(n);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function ie() {
|
|
140
140
|
if (z) {
|
|
141
141
|
oe();
|
|
142
142
|
return;
|
|
@@ -184,7 +184,7 @@ var se = 0, ce = class {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
enqueue(e, t) {
|
|
187
|
-
e && (vt ? E(vt).rn[e - 1].push(t) : this.bt[e - 1].push(t)),
|
|
187
|
+
e && (vt ? E(vt).rn[e - 1].push(t) : this.bt[e - 1].push(t)), ie();
|
|
188
188
|
}
|
|
189
189
|
stashQueues(e) {
|
|
190
190
|
e.bt[0].push(...this.bt[0]), e.bt[1].push(...this.bt[1]), this.bt = [[], []];
|
|
@@ -205,7 +205,7 @@ var se = 0, ce = class {
|
|
|
205
205
|
}
|
|
206
206
|
}, K = class e extends ce {
|
|
207
207
|
gt = !1;
|
|
208
|
-
m =
|
|
208
|
+
m = ne();
|
|
209
209
|
static Ce;
|
|
210
210
|
static me;
|
|
211
211
|
static et;
|
|
@@ -245,15 +245,15 @@ var se = 0, ce = class {
|
|
|
245
245
|
if (Ne(N, e.Ce), L) {
|
|
246
246
|
if (!Se(L)) {
|
|
247
247
|
let t = L;
|
|
248
|
-
Ne(P, this.m === t ? F : e.Ce), this.m === t && (ve = this.m =
|
|
248
|
+
Ne(P, this.m === t ? F : e.Ce), this.m === t && (ve = this.m = ne()), T.size && (e.In(1), e.In(2)), this.stashQueues(t.yt), I++, R = N.EE >= N.Ve || this.m.Qt.length > 0, ge(t.Qt), L = null, me(null, !0);
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
251
|
let t = L, n = this.m;
|
|
252
252
|
if (n !== t && n.Qt.push(...t.Qt), this.restoreQueues(t.yt), M.delete(t), L = null, ge(n.Qt), me(t), n === t) {
|
|
253
|
-
let e =
|
|
253
|
+
let e = ne();
|
|
254
254
|
e.Qt = n.Qt, e.Me = n.Me, e.A = n.A, e.cn = n.cn, ve = this.m = e;
|
|
255
255
|
}
|
|
256
|
-
} else
|
|
256
|
+
} else ee(this) ? (pe(), N.EE >= N.Ve && (Ne(N, e.Ce), pe())) : (M.size && Ne(P, e.Ce), me());
|
|
257
257
|
I++, R = N.EE >= N.Ve, T.size && e.In(1), this.run(1), T.size && e.In(2), this.run(2);
|
|
258
258
|
} finally {
|
|
259
259
|
this.gt = !1;
|
|
@@ -269,7 +269,7 @@ var se = 0, ce = class {
|
|
|
269
269
|
let n = t.source, r = L.Ie.get(n);
|
|
270
270
|
r || L.Ie.set(n, r = /* @__PURE__ */ new Set());
|
|
271
271
|
let i = r.size;
|
|
272
|
-
r.add(e), r.size !== i &&
|
|
272
|
+
r.add(e), r.size !== i && ie();
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
return !0;
|
|
@@ -278,10 +278,10 @@ var se = 0, ce = class {
|
|
|
278
278
|
}
|
|
279
279
|
initTransition(e) {
|
|
280
280
|
if (e &&= Ce(e), e && e === L || !e && L && L.de === I) return;
|
|
281
|
-
if (!L) L = e ??
|
|
281
|
+
if (!L) L = e ?? ne();
|
|
282
282
|
else if (e) {
|
|
283
283
|
let t = L;
|
|
284
|
-
|
|
284
|
+
re(e, t), M.delete(t), L = e;
|
|
285
285
|
}
|
|
286
286
|
M.add(L), L.de = I;
|
|
287
287
|
let t = this.m;
|
|
@@ -341,9 +341,9 @@ function me(e = null, t = !1) {
|
|
|
341
341
|
let t = e ?? _e.m;
|
|
342
342
|
if (t.Me.length && K.En(t.Me), t.ln.size) {
|
|
343
343
|
for (let e of t.ln) e.se & 64 || Ee(e);
|
|
344
|
-
t.ln.clear(),
|
|
344
|
+
t.ln.clear(), ie();
|
|
345
345
|
}
|
|
346
|
-
t.A.length && (K.G(t.A), _e.vt.length && he(_e)), t.cn.size && K.Dt(t.cn, e),
|
|
346
|
+
t.A.length && (K.G(t.A), _e.vt.length && he(_e)), t.cn.size && K.Dt(t.cn, e), te(), T.size && K.dn(e);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
function he(e) {
|
|
@@ -698,7 +698,7 @@ function st(e, t) {
|
|
|
698
698
|
let n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
699
699
|
r.has(e) || (r.add(e), e._ === t && (Ee(e), n = !0), it(e, i));
|
|
700
700
|
};
|
|
701
|
-
it(e, i), n &&
|
|
701
|
+
it(e, i), n && ie();
|
|
702
702
|
}
|
|
703
703
|
function ct(e) {
|
|
704
704
|
let t = !1, n, r = /* @__PURE__ */ new Set(), i = K.Se, a = (o) => {
|
|
@@ -708,7 +708,7 @@ function ct(e) {
|
|
|
708
708
|
s ? (c || rt(o, s), i !== null && i(o)) : (o.S &= -2, c || rt(o), i !== null && i(o), o.ue && (Ee(o), t = !0), o.ue = !1, !o.o && o.T & 32 && (n ??= []).push(o)), it(o, a);
|
|
709
709
|
};
|
|
710
710
|
if (it(e, a), n) for (let e of n) at(e);
|
|
711
|
-
t &&
|
|
711
|
+
t && ie();
|
|
712
712
|
}
|
|
713
713
|
function lt(e) {
|
|
714
714
|
return typeof e == "object" && !!e && typeof e.then == "function";
|
|
@@ -754,7 +754,7 @@ function ut(e, t, n) {
|
|
|
754
754
|
} catch (t) {
|
|
755
755
|
ft(e, 2, t);
|
|
756
756
|
}
|
|
757
|
-
e.De === v && (e.Ee = !1), ct(e),
|
|
757
|
+
e.De === v && (e.Ee = !1), ct(e), ie(), ye(), i?.();
|
|
758
758
|
}, l = () => e.T & 32 && !e.o && !(e.S & 1) ? (Ze(e), !0) : !1;
|
|
759
759
|
if (i) {
|
|
760
760
|
let n = !1, r = !1, i, o = !0;
|
|
@@ -787,7 +787,7 @@ function ut(e, t, n) {
|
|
|
787
787
|
if ((lt(_) ? _ : { then: (e) => void e(_) }).then((n) => {
|
|
788
788
|
if (g && o) d = n, m = !0, n.done && (i = !0);
|
|
789
789
|
else if (e.Te !== t) return;
|
|
790
|
-
else n.done ? (i = !0, r ? (
|
|
790
|
+
else n.done ? (i = !0, r ? (ie(), ye()) : c(void 0), l()) : (r = !0, c(n.value, u));
|
|
791
791
|
}, (n) => {
|
|
792
792
|
g ? (p = n, h = !0) : e.Te === t && (i = !0, s(n), l());
|
|
793
793
|
}), g = !1, h) {
|
|
@@ -820,7 +820,7 @@ function ft(e, t, n, r, i) {
|
|
|
820
820
|
it(e, (e, r) => {
|
|
821
821
|
if (e.de = I, t === 1 && a && !e.oe?.has(a) || t !== 1 && (e._ !== n || e.oe)) {
|
|
822
822
|
if (r.Ge && t !== 1 && !(n instanceof d)) {
|
|
823
|
-
Ee(e),
|
|
823
|
+
Ee(e), ie();
|
|
824
824
|
return;
|
|
825
825
|
}
|
|
826
826
|
!l && !e.Ne && le(e), ft(e, t, n, l, u);
|
|
@@ -1050,10 +1050,10 @@ function Mt(e) {
|
|
|
1050
1050
|
function Nt(e, t) {
|
|
1051
1051
|
if (e.Ne && L !== e.Ne && _e.initTransition(e.Ne), e._e !== void 0 && !H) return K.Gt(e, t);
|
|
1052
1052
|
let n = e.De === v ? e.Ue : e.De;
|
|
1053
|
-
return typeof t == "function" && (t = t(n)), e.S & 4 || !e.be || !e.be(n, t) ? (e.De === v && le(e), e.De = t, (e.ge !== void 0 || e.pe !== void 0) && K.Pe !== null && K.Pe(e, t), e.de = I, de(e),
|
|
1053
|
+
return typeof t == "function" && (t = t(n)), e.S & 4 || !e.be || !e.be(n, t) ? (e.De === v && le(e), e.De = t, (e.ge !== void 0 || e.pe !== void 0) && K.Pe !== null && K.Pe(e, t), e.de = I, de(e), ie(), t) : t;
|
|
1054
1054
|
}
|
|
1055
1055
|
function Pt(e) {
|
|
1056
|
-
Ae(e, Te(e)), !(e.se & 1024) && e.De === v && (le(e),
|
|
1056
|
+
Ae(e, Te(e)), !(e.se & 1024) && e.De === v && (le(e), ie()), e.se = e.se & -4 | g;
|
|
1057
1057
|
}
|
|
1058
1058
|
function Ft(e, t) {
|
|
1059
1059
|
let n = Nt(e, t);
|
|
@@ -1516,41 +1516,41 @@ function Tn(e, t) {
|
|
|
1516
1516
|
let n = {
|
|
1517
1517
|
get(e, t) {
|
|
1518
1518
|
let r;
|
|
1519
|
-
Jn(!0),
|
|
1519
|
+
Jn(!0), G(!0);
|
|
1520
1520
|
try {
|
|
1521
1521
|
r = e[t];
|
|
1522
1522
|
} finally {
|
|
1523
|
-
Jn(!1),
|
|
1523
|
+
Jn(!1), G(!1);
|
|
1524
1524
|
}
|
|
1525
1525
|
return t === Dn ? r : typeof r == "object" && r ? new Proxy(r, n) : r;
|
|
1526
1526
|
},
|
|
1527
1527
|
has(e, t) {
|
|
1528
1528
|
let n;
|
|
1529
|
-
Jn(!0),
|
|
1529
|
+
Jn(!0), G(!0);
|
|
1530
1530
|
try {
|
|
1531
1531
|
n = t in e;
|
|
1532
1532
|
} finally {
|
|
1533
|
-
Jn(!1),
|
|
1533
|
+
Jn(!1), G(!1);
|
|
1534
1534
|
}
|
|
1535
1535
|
return n;
|
|
1536
1536
|
},
|
|
1537
1537
|
set(n, r, i) {
|
|
1538
1538
|
if (e && !e()) return !0;
|
|
1539
|
-
Jn(!0),
|
|
1539
|
+
Jn(!0), G(!0);
|
|
1540
1540
|
try {
|
|
1541
1541
|
n[r] = i, t?.();
|
|
1542
1542
|
} finally {
|
|
1543
|
-
Jn(!1),
|
|
1543
|
+
Jn(!1), G(!1);
|
|
1544
1544
|
}
|
|
1545
1545
|
return !0;
|
|
1546
1546
|
},
|
|
1547
1547
|
deleteProperty(n, r) {
|
|
1548
1548
|
if (e && !e()) return !0;
|
|
1549
|
-
Jn(!0),
|
|
1549
|
+
Jn(!0), G(!0);
|
|
1550
1550
|
try {
|
|
1551
1551
|
delete n[r], t?.();
|
|
1552
1552
|
} finally {
|
|
1553
|
-
Jn(!1),
|
|
1553
|
+
Jn(!1), G(!1);
|
|
1554
1554
|
}
|
|
1555
1555
|
return !0;
|
|
1556
1556
|
}
|
|
@@ -1775,7 +1775,7 @@ function yr(e, t, n) {
|
|
|
1775
1775
|
function br(e, t, n, r, i) {
|
|
1776
1776
|
if (t[n]) return t[n];
|
|
1777
1777
|
let a = or(e, t, n, Kn(r) ? Hn(r, e) : r, Dt, i);
|
|
1778
|
-
return
|
|
1778
|
+
return W(a), a;
|
|
1779
1779
|
}
|
|
1780
1780
|
function xr(e, t, n, r, i, a) {
|
|
1781
1781
|
let o = H || e.p, s = n !== "delete", c = e.h?.[t];
|
|
@@ -8144,7 +8144,7 @@ function Hu(e) {
|
|
|
8144
8144
|
D = e.setTimeout(() => {
|
|
8145
8145
|
D = 0, t === A && M(Sl(j()), t);
|
|
8146
8146
|
}, 100);
|
|
8147
|
-
}, P = () => e.model.state.toolMode === "select", F = () => e.model.state.xrayVisible, I = () => e.model.state.colorPickerActive, L = () => e.model.state.rulersVisible, R = () => e.model.state.toolMode === "text-inspector" || (e.typographyContextActive ?? !1), z = () => e.model.state.toolMode === "guides", B = () => e.model.state.settingsOpen, V = () => (e.pluginTools ?? []).find((e) => e.modeSwitch === !0 && e.toolbarMode === "edit"), H = () => V()?.active?.() ? "edit" : "select", U = () => (e.pluginTools ?? []).filter((e) => e.toolbarMode === "select" && !e.modeSwitch),
|
|
8147
|
+
}, P = () => e.model.state.toolMode === "select", F = () => e.model.state.xrayVisible, I = () => e.model.state.colorPickerActive, L = () => e.model.state.rulersVisible, R = () => e.model.state.toolMode === "text-inspector" || (e.typographyContextActive ?? !1), z = () => e.model.state.toolMode === "guides", B = () => e.model.state.settingsOpen, V = () => (e.pluginTools ?? []).find((e) => e.modeSwitch === !0 && e.toolbarMode === "edit"), H = () => V()?.active?.() ? "edit" : "select", U = () => (e.pluginTools ?? []).filter((e) => e.toolbarMode === "select" && !e.modeSwitch), W = () => (e.pluginTools ?? []).filter((e) => e.toolbarMode === "edit" && !e.modeSwitch), ee = () => (e.pluginTools ?? []).filter((e) => e.toolbarMode === "always" || e.toolbarMode === void 0), te = () => ee().some((e) => e.active?.() ?? !1), G = () => P() || F() || I() || L() || R() || z(), ne = (e, t = !1) => t || !d() || e, re = () => ee().length > 0 && (!d() || G() || te()), ie = () => !d() || G() || te() || B(), ae = () => !r() && !a() && !e.model.state.settingsOpen, oe = (t) => e.isBuiltinActionDisabled?.(t) ?? !1, se = () => e.ownerWindow.innerHeight || 0, ce = () => t().y < 56, K = () => se() > 0 && t().y > se() - 56, le = () => ce() && !K() ? "bottom" : "top", ue = () => {
|
|
8148
8148
|
t();
|
|
8149
8149
|
let e = v?.getBoundingClientRect();
|
|
8150
8150
|
if (!e) return K() ? "top" : "bottom";
|
|
@@ -8316,7 +8316,7 @@ function Hu(e) {
|
|
|
8316
8316
|
}
|
|
8317
8317
|
}), Ee = (t, n = !1) => Y(Ru, {
|
|
8318
8318
|
get visible() {
|
|
8319
|
-
return
|
|
8319
|
+
return ne(t.active?.() ?? !1, n);
|
|
8320
8320
|
},
|
|
8321
8321
|
get children() {
|
|
8322
8322
|
return Y(q, {
|
|
@@ -8515,7 +8515,7 @@ function Hu(e) {
|
|
|
8515
8515
|
b = e;
|
|
8516
8516
|
}, je), Q(Me, Y(Ru, {
|
|
8517
8517
|
get visible() {
|
|
8518
|
-
return
|
|
8518
|
+
return ne(P());
|
|
8519
8519
|
},
|
|
8520
8520
|
get children() {
|
|
8521
8521
|
return Y(Lu, ra({
|
|
@@ -8533,7 +8533,7 @@ function Hu(e) {
|
|
|
8533
8533
|
}
|
|
8534
8534
|
}), null), Q(Me, Y(Ru, {
|
|
8535
8535
|
get visible() {
|
|
8536
|
-
return
|
|
8536
|
+
return ne(F());
|
|
8537
8537
|
},
|
|
8538
8538
|
get children() {
|
|
8539
8539
|
return Y(Lu, ra({
|
|
@@ -8556,7 +8556,7 @@ function Hu(e) {
|
|
|
8556
8556
|
get children() {
|
|
8557
8557
|
return Y(Ru, {
|
|
8558
8558
|
get visible() {
|
|
8559
|
-
return
|
|
8559
|
+
return ne(I());
|
|
8560
8560
|
},
|
|
8561
8561
|
get children() {
|
|
8562
8562
|
return Y(Lu, ra({
|
|
@@ -8579,7 +8579,7 @@ function Hu(e) {
|
|
|
8579
8579
|
}
|
|
8580
8580
|
}), null), Q(Me, Y(Ru, {
|
|
8581
8581
|
get visible() {
|
|
8582
|
-
return
|
|
8582
|
+
return ne(L(), !0);
|
|
8583
8583
|
},
|
|
8584
8584
|
get children() {
|
|
8585
8585
|
return Y(Lu, ra({
|
|
@@ -8597,7 +8597,7 @@ function Hu(e) {
|
|
|
8597
8597
|
}
|
|
8598
8598
|
}), null), Q(Me, Y(Ru, {
|
|
8599
8599
|
get visible() {
|
|
8600
|
-
return
|
|
8600
|
+
return ne(R());
|
|
8601
8601
|
},
|
|
8602
8602
|
get children() {
|
|
8603
8603
|
return Y(Lu, ra({
|
|
@@ -8618,7 +8618,7 @@ function Hu(e) {
|
|
|
8618
8618
|
}
|
|
8619
8619
|
}), null), Q(Me, Y(Ru, {
|
|
8620
8620
|
get visible() {
|
|
8621
|
-
return
|
|
8621
|
+
return ne(z(), !0);
|
|
8622
8622
|
},
|
|
8623
8623
|
get children() {
|
|
8624
8624
|
return [Y(Lu, ra({
|
|
@@ -8739,7 +8739,7 @@ function Hu(e) {
|
|
|
8739
8739
|
x = e;
|
|
8740
8740
|
}, Pe), Q(Pe, Y(q, {
|
|
8741
8741
|
get when() {
|
|
8742
|
-
return
|
|
8742
|
+
return W().length > 0;
|
|
8743
8743
|
},
|
|
8744
8744
|
get children() {
|
|
8745
8745
|
var e = X("div", {
|
|
@@ -8749,19 +8749,19 @@ function Hu(e) {
|
|
|
8749
8749
|
});
|
|
8750
8750
|
return Q(e, Y(Zr, {
|
|
8751
8751
|
get each() {
|
|
8752
|
-
return
|
|
8752
|
+
return W();
|
|
8753
8753
|
},
|
|
8754
8754
|
children: (e) => Ee(e)
|
|
8755
8755
|
})), e;
|
|
8756
8756
|
}
|
|
8757
8757
|
})), Q(De, Y(q, {
|
|
8758
8758
|
get when() {
|
|
8759
|
-
return
|
|
8759
|
+
return ee().length > 0;
|
|
8760
8760
|
},
|
|
8761
8761
|
get children() {
|
|
8762
8762
|
return [Y(zu, {
|
|
8763
8763
|
get visible() {
|
|
8764
|
-
return
|
|
8764
|
+
return re();
|
|
8765
8765
|
},
|
|
8766
8766
|
marker: "plugins"
|
|
8767
8767
|
}), (() => {
|
|
@@ -8772,7 +8772,7 @@ function Hu(e) {
|
|
|
8772
8772
|
});
|
|
8773
8773
|
return Q(e, Y(Zr, {
|
|
8774
8774
|
get each() {
|
|
8775
|
-
return
|
|
8775
|
+
return ee();
|
|
8776
8776
|
},
|
|
8777
8777
|
children: (e) => Ee(e, e.toolbarMode === "always")
|
|
8778
8778
|
})), e;
|
|
@@ -8780,7 +8780,7 @@ function Hu(e) {
|
|
|
8780
8780
|
}
|
|
8781
8781
|
}), Fe), Q(Fe, Y(Ru, {
|
|
8782
8782
|
get visible() {
|
|
8783
|
-
return
|
|
8783
|
+
return ne(B());
|
|
8784
8784
|
},
|
|
8785
8785
|
get children() {
|
|
8786
8786
|
var t = X("div", {
|
|
@@ -8846,7 +8846,7 @@ function Hu(e) {
|
|
|
8846
8846
|
}
|
|
8847
8847
|
})), Q(De, Y(zu, {
|
|
8848
8848
|
get visible() {
|
|
8849
|
-
return
|
|
8849
|
+
return ie();
|
|
8850
8850
|
},
|
|
8851
8851
|
marker: "compact"
|
|
8852
8852
|
}), Ie), Z(Ie, Le), Q(Le, Y(Kl, {
|
|
@@ -10088,9 +10088,9 @@ function op(e = {}, t = !1) {
|
|
|
10088
10088
|
}, U = (t, n = !0, r = !0) => {
|
|
10089
10089
|
let i = E.indexOf(t);
|
|
10090
10090
|
i < 0 || (n && H(), E.splice(i, 1), t.detach(), t.box.remove(), t.card.remove(), r && e.onUnpin?.(t.sourceEl));
|
|
10091
|
-
},
|
|
10091
|
+
}, W = (e = !1) => {
|
|
10092
10092
|
for (; E.length;) U(E[E.length - 1], !1, e);
|
|
10093
|
-
},
|
|
10093
|
+
}, ee = (e) => {
|
|
10094
10094
|
let t = -1, n = 0, i = 0, a = 0, o = 0, s = !1, c = !1, l = (l) => {
|
|
10095
10095
|
if (l.pointerId !== t) return;
|
|
10096
10096
|
let u = l.clientX - n, d = l.clientY - i;
|
|
@@ -10105,7 +10105,7 @@ function op(e = {}, t = !1) {
|
|
|
10105
10105
|
return e.card.addEventListener("pointerdown", f), () => {
|
|
10106
10106
|
e.card.removeEventListener("pointerdown", f), r.removeEventListener("pointermove", l), r.removeEventListener("pointerup", u), r.removeEventListener("pointercancel", u);
|
|
10107
10107
|
};
|
|
10108
|
-
},
|
|
10108
|
+
}, te = (t, i, a = !0, o = !0) => {
|
|
10109
10109
|
if (E.find((e) => e.sourceEl === t)) return;
|
|
10110
10110
|
a && H(), E.length >= l && U(E[0], !1, !0);
|
|
10111
10111
|
let s = j(), c = Lf(n, tp, np), d = zf(n, !0);
|
|
@@ -10123,20 +10123,20 @@ function op(e = {}, t = !1) {
|
|
|
10123
10123
|
userPlaced: i?.userPlaced ?? !1,
|
|
10124
10124
|
detach: () => {}
|
|
10125
10125
|
};
|
|
10126
|
-
E.push(m), m.detach =
|
|
10126
|
+
E.push(m), m.detach = ee(m), d.querySelector(".mesurer-ti-close")?.addEventListener("click", (e) => {
|
|
10127
10127
|
e.preventDefault(), e.stopPropagation(), U(m);
|
|
10128
10128
|
}), o && e.onPin?.(t, f);
|
|
10129
|
-
},
|
|
10130
|
-
|
|
10131
|
-
for (let t of e) t.sourceEl.isConnected &&
|
|
10132
|
-
},
|
|
10129
|
+
}, G = (e) => {
|
|
10130
|
+
W(!1);
|
|
10131
|
+
for (let t of e) t.sourceEl.isConnected && te(t.sourceEl, t, !1, !1);
|
|
10132
|
+
}, ne = () => {
|
|
10133
10133
|
let e = D.pop();
|
|
10134
|
-
return e ? (O.push(V()),
|
|
10135
|
-
},
|
|
10134
|
+
return e ? (O.push(V()), G(e), !0) : !1;
|
|
10135
|
+
}, re = () => {
|
|
10136
10136
|
let e = O.pop();
|
|
10137
|
-
return e ? (D.push(V()),
|
|
10138
|
-
},
|
|
10139
|
-
E.length && (H(),
|
|
10137
|
+
return e ? (D.push(V()), G(e), !0) : !1;
|
|
10138
|
+
}, ie = () => {
|
|
10139
|
+
E.length && (H(), W(!0));
|
|
10140
10140
|
}, ae = () => {
|
|
10141
10141
|
for (let e of E.slice()) {
|
|
10142
10142
|
if (!e.sourceEl.isConnected) {
|
|
@@ -10211,7 +10211,7 @@ function op(e = {}, t = !1) {
|
|
|
10211
10211
|
}
|
|
10212
10212
|
if (e.preventDefault(), e.stopImmediatePropagation(), e.button === 0) {
|
|
10213
10213
|
let t = I(e.clientX, e.clientY);
|
|
10214
|
-
t &&
|
|
10214
|
+
t && te(t);
|
|
10215
10215
|
}
|
|
10216
10216
|
}
|
|
10217
10217
|
}, me = (e) => {
|
|
@@ -10228,16 +10228,16 @@ function op(e = {}, t = !1) {
|
|
|
10228
10228
|
passive: !0
|
|
10229
10229
|
}), r.addEventListener("resize", ce, !0));
|
|
10230
10230
|
}, ge = () => {
|
|
10231
|
-
m && (m = !1, r.cancelAnimationFrame(b), b = 0, r.clearTimeout(x), r.clearTimeout(S), S = 0, r.removeEventListener("mousemove", le, !0), r.removeEventListener("mouseout", fe, !0), r.removeEventListener("click", pe, !0), r.removeEventListener("auxclick", me, !0), r.removeEventListener("scroll", de, !0), r.removeEventListener("resize", ce, !0), L(),
|
|
10231
|
+
m && (m = !1, r.cancelAnimationFrame(b), b = 0, r.clearTimeout(x), r.clearTimeout(S), S = 0, r.removeEventListener("mousemove", le, !0), r.removeEventListener("mouseout", fe, !0), r.removeEventListener("click", pe, !0), r.removeEventListener("auxclick", me, !0), r.removeEventListener("scroll", de, !0), r.removeEventListener("resize", ce, !0), L(), W(), g?.remove(), _?.remove(), g = null, _ = null, D.length = 0, O.length = 0, n.body.classList.remove(s));
|
|
10232
10232
|
}, _e = () => {
|
|
10233
10233
|
ge(), T?.(), T = null, h?.remove(), h = null, n.getElementById(o)?.remove(), k instanceof r.ShadowRoot && k.querySelector(`#${o}`)?.remove();
|
|
10234
10234
|
};
|
|
10235
10235
|
return {
|
|
10236
10236
|
enable: he,
|
|
10237
10237
|
disable: ge,
|
|
10238
|
-
undo:
|
|
10239
|
-
redo:
|
|
10240
|
-
clear:
|
|
10238
|
+
undo: ne,
|
|
10239
|
+
redo: re,
|
|
10240
|
+
clear: ie,
|
|
10241
10241
|
inspect: B,
|
|
10242
10242
|
isEnabled: () => m,
|
|
10243
10243
|
canUndo: () => D.length > 0,
|
|
@@ -10449,7 +10449,7 @@ function Tp(e) {
|
|
|
10449
10449
|
H(), w = e, C = s.setTimeout(() => {
|
|
10450
10450
|
C = 0, w === e && t.setTransient({ draggingGuideId: e });
|
|
10451
10451
|
}, 220);
|
|
10452
|
-
},
|
|
10452
|
+
}, W = () => {
|
|
10453
10453
|
t.setTransient({
|
|
10454
10454
|
start: null,
|
|
10455
10455
|
end: null,
|
|
@@ -10457,7 +10457,7 @@ function Tp(e) {
|
|
|
10457
10457
|
draggingGuideId: null,
|
|
10458
10458
|
guidePreview: null
|
|
10459
10459
|
}), x = null, S = !1, d.key = "", t.endAction();
|
|
10460
|
-
},
|
|
10460
|
+
}, ee = (e) => {
|
|
10461
10461
|
if (t.current.settingsOpen || !t.current.enabled || e.button !== 0 || t.current.toolMode === "none") return;
|
|
10462
10462
|
let n = {
|
|
10463
10463
|
x: e.clientX,
|
|
@@ -10500,7 +10500,7 @@ function Tp(e) {
|
|
|
10500
10500
|
isDragging: !1,
|
|
10501
10501
|
selectionOriginRect: null
|
|
10502
10502
|
}), ms(e.currentTarget, e.pointerId);
|
|
10503
|
-
},
|
|
10503
|
+
}, te = (e) => {
|
|
10504
10504
|
if (!t.current.enabled || t.current.settingsOpen) return;
|
|
10505
10505
|
let n = {
|
|
10506
10506
|
x: e.clientX,
|
|
@@ -10530,19 +10530,19 @@ function Tp(e) {
|
|
|
10530
10530
|
end: n,
|
|
10531
10531
|
isDragging: a
|
|
10532
10532
|
});
|
|
10533
|
-
},
|
|
10533
|
+
}, G = (e) => {
|
|
10534
10534
|
if (!t.current.enabled) return;
|
|
10535
10535
|
if (t.current.toolMode === "guides") {
|
|
10536
|
-
H(), e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture?.(e.pointerId),
|
|
10536
|
+
H(), e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture?.(e.pointerId), W();
|
|
10537
10537
|
return;
|
|
10538
10538
|
}
|
|
10539
10539
|
if (t.current.toolMode !== "select") {
|
|
10540
|
-
|
|
10540
|
+
W();
|
|
10541
10541
|
return;
|
|
10542
10542
|
}
|
|
10543
10543
|
let n = t.current.start;
|
|
10544
10544
|
if (!n) {
|
|
10545
|
-
|
|
10545
|
+
W();
|
|
10546
10546
|
return;
|
|
10547
10547
|
}
|
|
10548
10548
|
let i = {
|
|
@@ -10560,7 +10560,7 @@ function Tp(e) {
|
|
|
10560
10560
|
for (let n of [...t.current.selectedMeasurements, ...a]) n.elementRef && e.set(n.elementRef, n);
|
|
10561
10561
|
l = [...e.values()];
|
|
10562
10562
|
}
|
|
10563
|
-
t.checkpoint(), t.setSelectedMeasurements(l, l.at(-1) ?? null), t.setTransient({ selectionOriginRect: r }),
|
|
10563
|
+
t.checkpoint(), t.setSelectedMeasurements(l, l.at(-1) ?? null), t.setTransient({ selectionOriginRect: r }), W();
|
|
10564
10564
|
return;
|
|
10565
10565
|
}
|
|
10566
10566
|
let a = x ? t.current.selectedMeasurements.find((e) => e.elementRef === x) ?? null : df({
|
|
@@ -10573,7 +10573,7 @@ function Tp(e) {
|
|
|
10573
10573
|
if ((e.shiftKey || !t.current.settings.hoverHighlightEnabled) && a) {
|
|
10574
10574
|
f = null, t.checkpoint();
|
|
10575
10575
|
let e = t.current.selectedMeasurements.filter((e) => e.elementRef !== a.elementRef);
|
|
10576
|
-
t.setSelectedMeasurements(e, e.at(-1) ?? null),
|
|
10576
|
+
t.setSelectedMeasurements(e, e.at(-1) ?? null), W();
|
|
10577
10577
|
return;
|
|
10578
10578
|
}
|
|
10579
10579
|
let l;
|
|
@@ -10599,10 +10599,10 @@ function Tp(e) {
|
|
|
10599
10599
|
};
|
|
10600
10600
|
t.setActiveMeasurement(r);
|
|
10601
10601
|
} else e.shiftKey || (t.checkpoint(), t.setSelectedMeasurements([], null));
|
|
10602
|
-
|
|
10603
|
-
},
|
|
10604
|
-
H(), t.current.draggingGuideId ||
|
|
10605
|
-
},
|
|
10602
|
+
W();
|
|
10603
|
+
}, ne = () => {
|
|
10604
|
+
H(), t.current.draggingGuideId || W(), t.setTransient({ guidePreview: null });
|
|
10605
|
+
}, re = (e, n) => {
|
|
10606
10606
|
if (!(!t.current.enabled || n.button !== 0 || t.current.settingsOpen)) {
|
|
10607
10607
|
if (n.preventDefault(), n.stopPropagation(), t.checkpoint(), n.shiftKey) {
|
|
10608
10608
|
let n = t.current.selectedGuideIds.includes(e.id) ? t.current.selectedGuideIds.filter((t) => t !== e.id) : [...t.current.selectedGuideIds, e.id];
|
|
@@ -10611,7 +10611,7 @@ function Tp(e) {
|
|
|
10611
10611
|
}
|
|
10612
10612
|
t.setSelectedGuideIds([e.id]), t.setTransient({ draggingGuideId: e.id }), ms(n.currentTarget, n.pointerId);
|
|
10613
10613
|
}
|
|
10614
|
-
},
|
|
10614
|
+
}, ie = (e, n) => {
|
|
10615
10615
|
n.stopPropagation(), t.setTransient({ draggingGuideId: null }), n.currentTarget.hasPointerCapture?.(n.pointerId) && n.currentTarget.releasePointerCapture?.(n.pointerId);
|
|
10616
10616
|
}, ae = (e, n, r = null) => Nd({
|
|
10617
10617
|
orientation: e,
|
|
@@ -10921,12 +10921,12 @@ function Tp(e) {
|
|
|
10921
10921
|
return ea(() => !!t.state.enabled)() ? !t.state.settingsOpen : t.state.enabled;
|
|
10922
10922
|
},
|
|
10923
10923
|
editSelectionHover: () => r.editSelectionHover?.() ?? !1,
|
|
10924
|
-
onPointerDown:
|
|
10925
|
-
onPointerMove:
|
|
10926
|
-
onPointerUp:
|
|
10927
|
-
onPointerLeave:
|
|
10928
|
-
onGuidePointerDown:
|
|
10929
|
-
onGuidePointerUp:
|
|
10924
|
+
onPointerDown: ee,
|
|
10925
|
+
onPointerMove: te,
|
|
10926
|
+
onPointerUp: G,
|
|
10927
|
+
onPointerLeave: ne,
|
|
10928
|
+
onGuidePointerDown: re,
|
|
10929
|
+
onGuidePointerUp: ie
|
|
10930
10930
|
}), null), Q(n, Y(So, {
|
|
10931
10931
|
model: t,
|
|
10932
10932
|
ownerWindow: s,
|
|
@@ -11263,7 +11263,7 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
11263
11263
|
V(), B();
|
|
11264
11264
|
}, U = () => {
|
|
11265
11265
|
u.style.display = "none", d.style.display = "none";
|
|
11266
|
-
},
|
|
11266
|
+
}, W = (e, t, n) => {
|
|
11267
11267
|
if (U(), D().snapLines) {
|
|
11268
11268
|
if (e) {
|
|
11269
11269
|
let t = Math.min(n.top, e.start), r = Math.max(n.top + n.height, e.end);
|
|
@@ -11274,34 +11274,34 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
11274
11274
|
d.style.display = "block", d.style.left = `${e}px`, d.style.top = `${t.position}px`, d.style.width = `${Math.max(1, r - e)}px`;
|
|
11275
11275
|
}
|
|
11276
11276
|
}
|
|
11277
|
-
},
|
|
11277
|
+
}, ee = () => !!(n.querySelector(nm) || s.querySelector(nm)), te = () => {
|
|
11278
11278
|
for (let [e, t] of g) t.value || t.priority ? e.style.setProperty("visibility", t.value, t.priority) : e.style.removeProperty("visibility");
|
|
11279
11279
|
g.clear();
|
|
11280
|
-
},
|
|
11281
|
-
if (
|
|
11282
|
-
|
|
11280
|
+
}, G = () => {
|
|
11281
|
+
if (ee()) {
|
|
11282
|
+
te();
|
|
11283
11283
|
return;
|
|
11284
11284
|
}
|
|
11285
11285
|
if (!(g.size > 0)) for (let e of s.querySelectorAll("[data-mesurer-measurement='true']")) e instanceof c.HTMLElement && (e.matches("[data-mesurer-selected-measurement='true'][data-mesurer-inspector-ui='true']") && e.getRootNode() === n && e.parentElement === n.body || (g.set(e, {
|
|
11286
11286
|
value: e.style.getPropertyValue("visibility"),
|
|
11287
11287
|
priority: e.style.getPropertyPriority("visibility")
|
|
11288
11288
|
}), e.style.setProperty("visibility", "hidden", "important")));
|
|
11289
|
-
},
|
|
11289
|
+
}, ne = (e) => {
|
|
11290
11290
|
if (e.parentElement instanceof c.HTMLElement) return e.parentElement;
|
|
11291
11291
|
let t = e.getRootNode();
|
|
11292
11292
|
return t instanceof c.ShadowRoot && t.host instanceof c.HTMLElement ? t.host : null;
|
|
11293
|
-
},
|
|
11294
|
-
let n =
|
|
11293
|
+
}, re = (e, t) => {
|
|
11294
|
+
let n = ne(e);
|
|
11295
11295
|
for (; n;) {
|
|
11296
11296
|
let e = t.get(n);
|
|
11297
11297
|
if (e) return e;
|
|
11298
|
-
n =
|
|
11298
|
+
n = ne(n);
|
|
11299
11299
|
}
|
|
11300
11300
|
return {
|
|
11301
11301
|
x: 0,
|
|
11302
11302
|
y: 0
|
|
11303
11303
|
};
|
|
11304
|
-
},
|
|
11304
|
+
}, ie = (e = A()) => {
|
|
11305
11305
|
let t = /* @__PURE__ */ new Map();
|
|
11306
11306
|
for (let n of e) for (let e of n.targets) {
|
|
11307
11307
|
let n = F(e);
|
|
@@ -11312,14 +11312,14 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
11312
11312
|
x: e.desiredLocalOffsetX,
|
|
11313
11313
|
y: e.desiredLocalOffsetY
|
|
11314
11314
|
}, oe = (e, t) => {
|
|
11315
|
-
let n =
|
|
11315
|
+
let n = ne(e);
|
|
11316
11316
|
for (; n;) {
|
|
11317
11317
|
if (t.has(n)) return n;
|
|
11318
|
-
n =
|
|
11318
|
+
n = ne(n);
|
|
11319
11319
|
}
|
|
11320
11320
|
return null;
|
|
11321
11321
|
}, se = (e = A(), t = /* @__PURE__ */ new Map()) => {
|
|
11322
|
-
let n =
|
|
11322
|
+
let n = ie(e), r = /* @__PURE__ */ new Set([...n.keys(), ...t.keys()]), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = (e) => {
|
|
11323
11323
|
let s = i.get(e);
|
|
11324
11324
|
if (s) return s;
|
|
11325
11325
|
let c = n.get(e), l = t.get(e) ?? (c ? ae(c) : null);
|
|
@@ -11367,7 +11367,7 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
11367
11367
|
}, K = (e) => {
|
|
11368
11368
|
let t = [...e].flatMap(([t, n]) => {
|
|
11369
11369
|
if (!t.isConnected || !M(t)) return [];
|
|
11370
|
-
let r =
|
|
11370
|
+
let r = re(t, e), i = {
|
|
11371
11371
|
x: n.x - r.x,
|
|
11372
11372
|
y: n.y - r.y
|
|
11373
11373
|
};
|
|
@@ -11418,13 +11418,13 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
11418
11418
|
he();
|
|
11419
11419
|
return;
|
|
11420
11420
|
}
|
|
11421
|
-
let t = A(), r =
|
|
11421
|
+
let t = A(), r = ie(t), i = se(t), a = /* @__PURE__ */ new Set();
|
|
11422
11422
|
for (let t of de()) {
|
|
11423
11423
|
let o = r.get(t);
|
|
11424
11424
|
if (!o) continue;
|
|
11425
11425
|
let s = i.get(t);
|
|
11426
11426
|
if (!s) continue;
|
|
11427
|
-
let c =
|
|
11427
|
+
let c = re(t, i), u = ae(o) ?? {
|
|
11428
11428
|
x: s.x - c.x,
|
|
11429
11429
|
y: s.y - c.y
|
|
11430
11430
|
};
|
|
@@ -11548,14 +11548,14 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
11548
11548
|
v = {
|
|
11549
11549
|
intentId: null,
|
|
11550
11550
|
state: "desired"
|
|
11551
|
-
}, le(), U(), E() ?
|
|
11551
|
+
}, le(), U(), E() ? G() : te();
|
|
11552
11552
|
}, Ce = () => {
|
|
11553
11553
|
v = {
|
|
11554
11554
|
intentId: null,
|
|
11555
11555
|
state: "live"
|
|
11556
|
-
}, H(), U(),
|
|
11556
|
+
}, H(), U(), te();
|
|
11557
11557
|
}, we = () => {
|
|
11558
|
-
S || y || (le(), U(), E() ?
|
|
11558
|
+
S || y || (le(), U(), E() ? G() : te(), xe());
|
|
11559
11559
|
}, Te = () => {
|
|
11560
11560
|
C || S || (C = r.requestAnimationFrame(() => {
|
|
11561
11561
|
C = 0, we();
|
|
@@ -11582,10 +11582,10 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
11582
11582
|
intentId: null,
|
|
11583
11583
|
state: "desired"
|
|
11584
11584
|
}, le();
|
|
11585
|
-
let u =
|
|
11585
|
+
let u = ie(A()), d = se(A()), p = new Set(r);
|
|
11586
11586
|
V();
|
|
11587
11587
|
let m = r.map((e, t) => {
|
|
11588
|
-
let n = Yu(e), r =
|
|
11588
|
+
let n = Yu(e), r = re(e, d), i = d.get(e) ?? r, a = u.get(e), o = (a ? ae(a) : null) ?? {
|
|
11589
11589
|
x: i.x - r.x,
|
|
11590
11590
|
y: i.y - r.y
|
|
11591
11591
|
}, s = im(n, i), c = gd(e);
|
|
@@ -11631,7 +11631,7 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
11631
11631
|
le();
|
|
11632
11632
|
return;
|
|
11633
11633
|
}
|
|
11634
|
-
le(),
|
|
11634
|
+
le(), G(), U(), y = {
|
|
11635
11635
|
pointerId: e.pointerId,
|
|
11636
11636
|
originX: e.clientX,
|
|
11637
11637
|
originY: e.clientY,
|
|
@@ -11676,7 +11676,7 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
11676
11676
|
x: t,
|
|
11677
11677
|
y: n
|
|
11678
11678
|
});
|
|
11679
|
-
xe(c),
|
|
11679
|
+
xe(c), W(a, o, c);
|
|
11680
11680
|
}, Ae = () => {
|
|
11681
11681
|
if (!y) return;
|
|
11682
11682
|
let e = y.pointerId;
|
|
@@ -11733,7 +11733,7 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
11733
11733
|
y: e.clientY
|
|
11734
11734
|
}, t.rendererRoot ?? null, n, o)), Pe = (e) => {
|
|
11735
11735
|
if (!E()) return;
|
|
11736
|
-
if (y || e.buttons !== 0 ||
|
|
11736
|
+
if (y || e.buttons !== 0 || ee()) {
|
|
11737
11737
|
i.clearHover();
|
|
11738
11738
|
return;
|
|
11739
11739
|
}
|
|
@@ -12015,9 +12015,9 @@ var Dp = "mesurer.presentation.preferences", Op = "presentation", kp = {
|
|
|
12015
12015
|
e.state.update(Fp, () => ({ intents: [] })), v = {
|
|
12016
12016
|
intentId: null,
|
|
12017
12017
|
state: "desired"
|
|
12018
|
-
}, H(), U(), E() ?
|
|
12018
|
+
}, H(), U(), E() ? G() : te(), xe();
|
|
12019
12019
|
}), e.service.provide(Pp, Be), le(), xe(), e.lifecycle.onDispose(() => {
|
|
12020
|
-
S = !0, C && r.cancelAnimationFrame(C), w?.disconnect(), w = null, f.removeEventListener("pointerdown", De), f.removeEventListener("pointermove", ke), f.removeEventListener("pointerup", je), f.removeEventListener("pointercancel", Me), r.removeEventListener("pointermove", Pe, !0), r.removeEventListener("keydown", Fe, !0), r.removeEventListener("resize", Te), r.removeEventListener("scroll", Te, !0), o.removeEventListener("scroll", Te, !0), Ie(), Le.dispose(), H(), he(), U(),
|
|
12020
|
+
S = !0, C && r.cancelAnimationFrame(C), w?.disconnect(), w = null, f.removeEventListener("pointerdown", De), f.removeEventListener("pointermove", ke), f.removeEventListener("pointerup", je), f.removeEventListener("pointercancel", Me), r.removeEventListener("pointermove", Pe, !0), r.removeEventListener("keydown", Fe, !0), r.removeEventListener("resize", Te), r.removeEventListener("scroll", Te, !0), o.removeEventListener("scroll", Te, !0), Ie(), Le.dispose(), H(), he(), U(), te(), i.dispose(), a.dispose();
|
|
12021
12021
|
});
|
|
12022
12022
|
}
|
|
12023
12023
|
}), wm = (e, t, n) => {
|
|
@@ -12483,30 +12483,30 @@ function oh(e, t) {
|
|
|
12483
12483
|
g || b || y || (y = r.requestAnimationFrame(() => {
|
|
12484
12484
|
y = 0, !(g || b) && F();
|
|
12485
12485
|
}));
|
|
12486
|
-
},
|
|
12486
|
+
}, W = new o.MutationObserver(() => {
|
|
12487
12487
|
b || H();
|
|
12488
12488
|
});
|
|
12489
|
-
|
|
12489
|
+
W.observe(a, {
|
|
12490
12490
|
subtree: !0,
|
|
12491
12491
|
childList: !0,
|
|
12492
12492
|
attributes: !0,
|
|
12493
12493
|
attributeFilter: ["data-state"]
|
|
12494
|
-
}), C &&
|
|
12494
|
+
}), C && W.observe(C, {
|
|
12495
12495
|
subtree: !0,
|
|
12496
12496
|
childList: !0,
|
|
12497
12497
|
attributes: !0,
|
|
12498
12498
|
attributeFilter: ["data-state"]
|
|
12499
12499
|
});
|
|
12500
|
-
let
|
|
12500
|
+
let ee = () => {
|
|
12501
12501
|
b = !0, x && r.clearTimeout(x), x = r.setTimeout(() => {
|
|
12502
12502
|
x = 0, b = !1, H(!0);
|
|
12503
12503
|
}, Wm);
|
|
12504
|
-
},
|
|
12505
|
-
r.addEventListener("scroll",
|
|
12504
|
+
}, te = () => H(!0);
|
|
12505
|
+
r.addEventListener("scroll", ee, {
|
|
12506
12506
|
capture: !0,
|
|
12507
12507
|
passive: !0
|
|
12508
|
-
}), r.addEventListener("resize",
|
|
12509
|
-
g = !0,
|
|
12508
|
+
}), r.addEventListener("resize", te, !0), r.addEventListener("pointermove", U, !0), r.addEventListener("pointerup", te, !0), r.addEventListener("dblclick", te, !0), H(!0), e.lifecycle.onDispose(() => {
|
|
12509
|
+
g = !0, W.disconnect(), v && r.cancelAnimationFrame(v), y && r.cancelAnimationFrame(y), x && r.clearTimeout(x), r.removeEventListener("scroll", ee, !0), r.removeEventListener("resize", te, !0), r.removeEventListener("pointermove", U, !0), r.removeEventListener("pointerup", te, !0), r.removeEventListener("dblclick", te, !0);
|
|
12510
12510
|
for (let e of u.values()) A(e);
|
|
12511
12511
|
u.clear(), P(), I();
|
|
12512
12512
|
for (let [e, t] of d) eh(e), t.release();
|
|
@@ -12965,38 +12965,38 @@ function Yh(e, t) {
|
|
|
12965
12965
|
}, H = (e, t) => {
|
|
12966
12966
|
for (let [n, r] of t) V(e, n, r);
|
|
12967
12967
|
de(e), z(e, !0), fe();
|
|
12968
|
-
}, U = (e, t, n) => H(e, [[t, n]]),
|
|
12968
|
+
}, U = (e, t, n) => H(e, [[t, n]]), W = (e, t) => Fh.every((n) => {
|
|
12969
12969
|
let r = t.styles[n];
|
|
12970
12970
|
return r === void 0 || B(e, n) === D(n, r);
|
|
12971
|
-
}),
|
|
12971
|
+
}), ee = (e) => e.catalog.presets.find((t) => W(e, t)) ?? null, te = (e, t) => {
|
|
12972
12972
|
e.menuOpen = !1;
|
|
12973
12973
|
let n = Fh.flatMap((e) => {
|
|
12974
12974
|
let n = t.styles[e];
|
|
12975
12975
|
return n === void 0 ? [] : [[e, n]];
|
|
12976
12976
|
});
|
|
12977
12977
|
H(e, n), e.editor.focus({ preventScroll: !0 });
|
|
12978
|
-
},
|
|
12978
|
+
}, G = (e) => {
|
|
12979
12979
|
let t = B(e, "font-weight"), n = R(e, "font-weight");
|
|
12980
12980
|
if (n && Wh(n.desired) >= 600 && Wh(n.before) < 600) {
|
|
12981
12981
|
U(e, "font-weight", n.before);
|
|
12982
12982
|
return;
|
|
12983
12983
|
}
|
|
12984
12984
|
U(e, "font-weight", Wh(t) >= 600 ? "400" : "700");
|
|
12985
|
-
},
|
|
12985
|
+
}, ne = (e) => {
|
|
12986
12986
|
let t = B(e, "font-style"), n = R(e, "font-style");
|
|
12987
12987
|
if (n && n.desired !== "normal" && n.before === "normal") {
|
|
12988
12988
|
U(e, "font-style", n.before);
|
|
12989
12989
|
return;
|
|
12990
12990
|
}
|
|
12991
12991
|
U(e, "font-style", t === "normal" ? "italic" : "normal");
|
|
12992
|
-
},
|
|
12992
|
+
}, re = (e) => {
|
|
12993
12993
|
let t = B(e, "text-decoration-line"), n = R(e, "text-decoration-line");
|
|
12994
12994
|
if (n && n.desired.includes("underline") && !n.before.includes("underline")) {
|
|
12995
12995
|
U(e, "text-decoration-line", n.before);
|
|
12996
12996
|
return;
|
|
12997
12997
|
}
|
|
12998
12998
|
U(e, "text-decoration-line", t.includes("underline") ? "none" : "underline");
|
|
12999
|
-
},
|
|
12999
|
+
}, ie = (e, t, r, i, a) => {
|
|
13000
13000
|
let o = n.createElement("button");
|
|
13001
13001
|
return o.type = "button", o.textContent = t, o.title = r, o.setAttribute("aria-label", r), o.setAttribute("aria-pressed", i ? "true" : "false"), o.dataset.mesurerTextStyleButton = r.toLowerCase(), Object.assign(o.style, {
|
|
13002
13002
|
width: "32px",
|
|
@@ -13126,7 +13126,7 @@ function Yh(e, t) {
|
|
|
13126
13126
|
}), i.addEventListener("mouseleave", () => {
|
|
13127
13127
|
i.style.background = r ? "rgba(0, 0, 0, 0.05)" : "transparent";
|
|
13128
13128
|
}), i.addEventListener("click", (n) => {
|
|
13129
|
-
n.preventDefault(), n.stopPropagation(), m === e &&
|
|
13129
|
+
n.preventDefault(), n.stopPropagation(), m === e && te(e, t);
|
|
13130
13130
|
}), i;
|
|
13131
13131
|
}, K = () => {
|
|
13132
13132
|
let e = n.createElement("div");
|
|
@@ -13138,7 +13138,7 @@ function Yh(e, t) {
|
|
|
13138
13138
|
}, le = (e) => {
|
|
13139
13139
|
let t = e.menu;
|
|
13140
13140
|
t.replaceChildren();
|
|
13141
|
-
let r =
|
|
13141
|
+
let r = ee(e);
|
|
13142
13142
|
for (let n of e.catalog.presets) t.append(ce(e, n, r?.id === n.id));
|
|
13143
13143
|
t.append(K());
|
|
13144
13144
|
let i = B(e, "font-family"), a = B(e, "font-size"), o = B(e, "font-weight"), s = B(e, "line-height"), c = B(e, "letter-spacing"), l = B(e, "color");
|
|
@@ -13189,7 +13189,7 @@ function Yh(e, t) {
|
|
|
13189
13189
|
m === e && U(e, "color", p.value);
|
|
13190
13190
|
}), f.append(p), u.append(d, f), t.append(u), t.hidden = !e.menuOpen, t.style.display = e.menuOpen ? "block" : "none";
|
|
13191
13191
|
}, ue = (e) => {
|
|
13192
|
-
let t =
|
|
13192
|
+
let t = ee(e), r = n.createElement("button");
|
|
13193
13193
|
r.type = "button", r.dataset.mesurerTextStyleMenuButton = "true", r.setAttribute("aria-label", "Text style"), r.setAttribute("aria-haspopup", "menu"), r.setAttribute("aria-expanded", e.menuOpen ? "true" : "false"), Object.assign(r.style, {
|
|
13194
13194
|
minWidth: "96px",
|
|
13195
13195
|
height: "32px",
|
|
@@ -13225,7 +13225,7 @@ function Yh(e, t) {
|
|
|
13225
13225
|
let t = e.toolbar;
|
|
13226
13226
|
t.replaceChildren();
|
|
13227
13227
|
let n = B(e, "font-weight"), r = B(e, "font-style"), i = B(e, "text-decoration-line");
|
|
13228
|
-
t.append(
|
|
13228
|
+
t.append(ie(e, "B", "Bold", Wh(n) >= 600, () => G(e)), ie(e, "I", "Italic", r === "italic" || r === "oblique", () => ne(e)), ie(e, "U", "Underline", i.includes("underline"), () => re(e)), ue(e)), le(e);
|
|
13229
13229
|
}, fe = () => {
|
|
13230
13230
|
let e = m;
|
|
13231
13231
|
if (!e || !e.element.isConnected) return;
|
|
@@ -13497,14 +13497,14 @@ function Yh(e, t) {
|
|
|
13497
13497
|
if (e && t.altKey && (t.metaKey || t.ctrlKey) && !t.shiftKey) {
|
|
13498
13498
|
let e = t.key === "0" ? "text" : t.key === "1" ? "heading-1" : t.key === "2" ? "heading-2" : t.key === "3" ? "heading-3" : null, r = e ? n.catalog.presets.find((t) => t.id === e) : null;
|
|
13499
13499
|
if (r) {
|
|
13500
|
-
t.preventDefault(), t.stopImmediatePropagation(),
|
|
13500
|
+
t.preventDefault(), t.stopImmediatePropagation(), te(n, r);
|
|
13501
13501
|
return;
|
|
13502
13502
|
}
|
|
13503
13503
|
}
|
|
13504
13504
|
if (e && (t.metaKey || t.ctrlKey) && !t.altKey && !t.shiftKey) {
|
|
13505
13505
|
let e = t.key.toLowerCase();
|
|
13506
13506
|
if (e === "b" || e === "i" || e === "u") {
|
|
13507
|
-
t.preventDefault(), t.stopImmediatePropagation(), e === "b" ?
|
|
13507
|
+
t.preventDefault(), t.stopImmediatePropagation(), e === "b" ? G(n) : e === "i" ? ne(n) : re(n), n.editor.focus({ preventScroll: !0 });
|
|
13508
13508
|
return;
|
|
13509
13509
|
}
|
|
13510
13510
|
}
|
|
@@ -15491,7 +15491,7 @@ function J_(e) {
|
|
|
15491
15491
|
region: i
|
|
15492
15492
|
})
|
|
15493
15493
|
});
|
|
15494
|
-
},
|
|
15494
|
+
}, W = (e) => {
|
|
15495
15495
|
let n = e.trim();
|
|
15496
15496
|
if (!n) throw Error("Annotation note cannot be empty.");
|
|
15497
15497
|
let i = q_(t).filter(E), a = t.current.selectionOriginRect ? oa(t.current.selectionOriginRect) : null;
|
|
@@ -15514,7 +15514,7 @@ function J_(e) {
|
|
|
15514
15514
|
elements: i
|
|
15515
15515
|
})
|
|
15516
15516
|
}, i);
|
|
15517
|
-
},
|
|
15517
|
+
}, ee = () => {
|
|
15518
15518
|
for (let [e, t] of v) t.value || t.priority ? e.style.setProperty("display", t.value, t.priority) : e.style.removeProperty("display");
|
|
15519
15519
|
v.clear();
|
|
15520
15520
|
};
|
|
@@ -15611,7 +15611,7 @@ function J_(e) {
|
|
|
15611
15611
|
height: e.height
|
|
15612
15612
|
})));
|
|
15613
15613
|
},
|
|
15614
|
-
addSelectionAnnotation:
|
|
15614
|
+
addSelectionAnnotation: W,
|
|
15615
15615
|
addRegionAnnotation: U,
|
|
15616
15616
|
removeAnnotation(e) {
|
|
15617
15617
|
let t = h.findIndex((t) => t.id === e);
|
|
@@ -15641,10 +15641,10 @@ function J_(e) {
|
|
|
15641
15641
|
}), t.style.setProperty("display", "none", "important"));
|
|
15642
15642
|
},
|
|
15643
15643
|
finishCapture() {
|
|
15644
|
-
|
|
15644
|
+
ee();
|
|
15645
15645
|
},
|
|
15646
15646
|
dispose() {
|
|
15647
|
-
x || (x = !0, F(), I(), L(),
|
|
15647
|
+
x || (x = !0, F(), I(), L(), ee(), y.clear(), b.clear(), h.length = 0, _.clear());
|
|
15648
15648
|
}
|
|
15649
15649
|
};
|
|
15650
15650
|
}
|
|
@@ -15781,26 +15781,26 @@ function rv(e) {
|
|
|
15781
15781
|
let t = !0, o = 0, b = !1, k = Promise.resolve(), A = /* @__PURE__ */ new Set(), N = n, P = e, I = P.portalTarget ?? document.body, z = I.ownerDocument ?? document, B = z.defaultView ?? window, V = P.pageTarget ?? z.body, U = () => {
|
|
15782
15782
|
if (!g) throw Error("Mesurer renderer model is unavailable for runtime bridge setup.");
|
|
15783
15783
|
return g;
|
|
15784
|
-
},
|
|
15784
|
+
}, W = () => {
|
|
15785
15785
|
let e = U().rendererRoot;
|
|
15786
15786
|
if (!e?.isConnected) throw Error("Mesurer renderer root is unavailable for runtime bridge setup.");
|
|
15787
15787
|
return e;
|
|
15788
|
-
},
|
|
15788
|
+
}, ee = () => {
|
|
15789
15789
|
if (!_) throw Error("Mesurer built-in controller is unavailable for runtime bridge setup.");
|
|
15790
15790
|
return _;
|
|
15791
|
-
},
|
|
15792
|
-
let t =
|
|
15791
|
+
}, te = () => U().current.settings.theme, G = (e) => {
|
|
15792
|
+
let t = te();
|
|
15793
15793
|
return e(t), U().subscribe(() => {
|
|
15794
|
-
let n =
|
|
15794
|
+
let n = te();
|
|
15795
15795
|
n !== t && (t = n, e(n));
|
|
15796
15796
|
});
|
|
15797
|
-
},
|
|
15797
|
+
}, ne = () => {
|
|
15798
15798
|
let e = z.createElement("div");
|
|
15799
15799
|
e.dataset.mesurerInspectorUi = "true";
|
|
15800
|
-
let t =
|
|
15800
|
+
let t = G((t) => {
|
|
15801
15801
|
e.dataset.theme = t;
|
|
15802
15802
|
});
|
|
15803
|
-
|
|
15803
|
+
W().append(e);
|
|
15804
15804
|
let n = !1;
|
|
15805
15805
|
return {
|
|
15806
15806
|
element: e,
|
|
@@ -15808,15 +15808,15 @@ function rv(e) {
|
|
|
15808
15808
|
n || (n = !0, t(), e.remove());
|
|
15809
15809
|
}
|
|
15810
15810
|
};
|
|
15811
|
-
},
|
|
15811
|
+
}, re = (e) => J_({
|
|
15812
15812
|
model: U(),
|
|
15813
15813
|
ownerDocument: z,
|
|
15814
15814
|
ownerWindow: B,
|
|
15815
15815
|
uiRoot: I,
|
|
15816
15816
|
pageTarget: V,
|
|
15817
15817
|
persistenceKey: e ? `${P.persistKey ?? X_}:${e}:${B.location.origin}` : void 0
|
|
15818
|
-
}),
|
|
15819
|
-
|
|
15818
|
+
}), ie = z.createElement("style");
|
|
15819
|
+
ie.dataset.mesurerPluginVisibility = "true", ie.dataset.mesurerInspectorUi = "true", ie.textContent = j(), I.append(ie);
|
|
15820
15820
|
let ae = P.persistKey ? `${P.persistKey}:plugins` : X_, oe = `${ae}:availability`, se = /* @__PURE__ */ new Map();
|
|
15821
15821
|
try {
|
|
15822
15822
|
let e = B.localStorage.getItem(oe);
|
|
@@ -15855,7 +15855,7 @@ function rv(e) {
|
|
|
15855
15855
|
}, de = () => ue();
|
|
15856
15856
|
B.addEventListener("pagehide", de);
|
|
15857
15857
|
let fe = N.subscribe((e) => {
|
|
15858
|
-
if (x((e) => e + 1),
|
|
15858
|
+
if (x((e) => e + 1), ie.textContent = j(), (e.reason === "state" || e.reason === "history" || e.reason === "remove" || e.reason === "replace") && le(), S() && !b && (e.reason === "load" || e.reason === "remove" || e.reason === "replace") && ce(), e.reason === "remove" && e.pluginId?.startsWith("mesurer.")) {
|
|
15859
15859
|
let t = e.pluginId.slice(8);
|
|
15860
15860
|
ev(t) && _?.deactivate(t);
|
|
15861
15861
|
}
|
|
@@ -15943,7 +15943,7 @@ function rv(e) {
|
|
|
15943
15943
|
});
|
|
15944
15944
|
return;
|
|
15945
15945
|
}
|
|
15946
|
-
T(e) && await
|
|
15946
|
+
T(e) && await ee().run(e);
|
|
15947
15947
|
};
|
|
15948
15948
|
(async () => {
|
|
15949
15949
|
for (let e of s) await me(e);
|
|
@@ -15957,13 +15957,13 @@ function rv(e) {
|
|
|
15957
15957
|
ownerWindow: B,
|
|
15958
15958
|
portalTarget: I,
|
|
15959
15959
|
pageTarget: V,
|
|
15960
|
-
rendererRoot:
|
|
15960
|
+
rendererRoot: W(),
|
|
15961
15961
|
currentToolMode: () => U().current.toolMode,
|
|
15962
15962
|
currentToolbarMode: () => E() ? "edit" : "select",
|
|
15963
|
-
theme:
|
|
15964
|
-
subscribeTheme:
|
|
15965
|
-
createWorkspaceRuntime:
|
|
15966
|
-
createInspectorMount:
|
|
15963
|
+
theme: te,
|
|
15964
|
+
subscribeTheme: G,
|
|
15965
|
+
createWorkspaceRuntime: re,
|
|
15966
|
+
createInspectorMount: ne
|
|
15967
15967
|
};
|
|
15968
15968
|
e.service.provide("runtime:solid", t), Mp(e), Um(e, t), H_(e, t);
|
|
15969
15969
|
for (let t of Y_) e.command.register(tv(t), () => Se(t));
|
|
@@ -15988,7 +15988,7 @@ function rv(e) {
|
|
|
15988
15988
|
} catch (e) {
|
|
15989
15989
|
P.onPluginError?.(e, "plugin-persistence");
|
|
15990
15990
|
}
|
|
15991
|
-
t && (C(!0),
|
|
15991
|
+
t && (C(!0), ie.textContent = j(), P.onPluginsReady?.(N));
|
|
15992
15992
|
}
|
|
15993
15993
|
})();
|
|
15994
15994
|
let Ce = (e) => {
|
|
@@ -16047,7 +16047,7 @@ function rv(e) {
|
|
|
16047
16047
|
return B.addEventListener("keydown", we, !0), () => {
|
|
16048
16048
|
t = !1;
|
|
16049
16049
|
for (let e of A) N.cancelLoad(e);
|
|
16050
|
-
A.clear(), ue(), B.removeEventListener("pagehide", de), B.removeEventListener("keydown", we, !0), fe(),
|
|
16050
|
+
A.clear(), ue(), B.removeEventListener("pagehide", de), B.removeEventListener("keydown", we, !0), fe(), ie.remove(), g = null, _ = null, v = () => void 0, y = async () => void 0, r && N.dispose();
|
|
16051
16051
|
};
|
|
16052
16052
|
}), Y(Nl, {
|
|
16053
16053
|
runtime: {
|
|
@@ -16245,25 +16245,25 @@ var lv = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), uv = 0, dv = (e)
|
|
|
16245
16245
|
} : hv(e, t, n, r, i);
|
|
16246
16246
|
};
|
|
16247
16247
|
function _v(e) {
|
|
16248
|
-
let [t, n] = Gr(0), [r, i] = Gr(0), [a, o] = Gr(null), [s, c] = Gr(null), [l, u] = Gr(null), [d, f] = Gr({}), [p, m] = Gr(null), [h, g] = Gr(!1), [_, v] = Gr(""), [y, b] = Gr(null), [x, S] = Gr(!1), [C, w] = Gr(null), [T, E] = Gr(null), D = `--mesurer-annotation-trigger-${++uv}`, O = null, k = e.initialTriggerFallback === "current-and-next", A = null, j = null, M = null, N, P, F = null, I = null, L = null, R = null, z = null, B = null, V = /* @__PURE__ */ new Map(), H = () => N?.ownerDocument.defaultView ?? window, U = () => e.coordinateSpace === "viewport",
|
|
16248
|
+
let [t, n] = Gr(0), [r, i] = Gr(0), [a, o] = Gr(null), [s, c] = Gr(null), [l, u] = Gr(null), [d, f] = Gr({}), [p, m] = Gr(null), [h, g] = Gr(!1), [_, v] = Gr(""), [y, b] = Gr(null), [x, S] = Gr(!1), [C, w] = Gr(null), [T, E] = Gr(null), D = `--mesurer-annotation-trigger-${++uv}`, O = null, k = e.initialTriggerFallback === "current-and-next", A = null, j = null, M = null, N, P, F = null, I = null, L = null, R = null, z = null, B = null, V = /* @__PURE__ */ new Map(), H = () => N?.ownerDocument.defaultView ?? window, U = () => e.coordinateSpace === "viewport", W = (e) => e ? "native-anchor" : U() ? "cached-delta" : "document", ee = (e) => {
|
|
16249
16249
|
if (U()) return e;
|
|
16250
16250
|
let t = H();
|
|
16251
16251
|
return {
|
|
16252
16252
|
left: e.left + t.scrollX,
|
|
16253
16253
|
top: e.top + t.scrollY
|
|
16254
16254
|
};
|
|
16255
|
-
},
|
|
16255
|
+
}, te = () => {
|
|
16256
16256
|
let t = e.runtime.currentSelection();
|
|
16257
16257
|
return {
|
|
16258
16258
|
elements: [...t.elements],
|
|
16259
16259
|
region: t.region ? { ...t.region } : null
|
|
16260
16260
|
};
|
|
16261
|
-
},
|
|
16261
|
+
}, G = (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, ne = () => {
|
|
16262
16262
|
A = null, v(""), g(!1), b(null), m(null);
|
|
16263
|
-
},
|
|
16263
|
+
}, re = () => {
|
|
16264
16264
|
let e = H();
|
|
16265
16265
|
return !!(e.CSS?.supports("anchor-name: --mesurer-annotation-trigger") && e.CSS.supports("position-anchor: --mesurer-annotation-trigger") && e.CSS.supports("left: anchor(left)"));
|
|
16266
|
-
},
|
|
16266
|
+
}, ie = () => {
|
|
16267
16267
|
let t = e.runtime.currentSelection().elements;
|
|
16268
16268
|
if (!t.length) return null;
|
|
16269
16269
|
let n = e.runtime.hoveredElement();
|
|
@@ -16280,7 +16280,7 @@ function _v(e) {
|
|
|
16280
16280
|
}, K = (t) => {
|
|
16281
16281
|
let n = e.runtime.annotation(t);
|
|
16282
16282
|
return !n || n.anchor.kind !== "elements" ? null : n.resolvedTargets.find(({ element: e }) => e?.isConnected)?.element ?? null;
|
|
16283
|
-
}, le = (e) => !!(fv(e) && U() && N &&
|
|
16283
|
+
}, le = (e) => !!(fv(e) && U() && N && re() && e.getRootNode() === N.getRootNode()), ue = (e) => {
|
|
16284
16284
|
let t = K(e), n = V.get(e);
|
|
16285
16285
|
if (!t) {
|
|
16286
16286
|
n && (ce(e), i((e) => e + 1));
|
|
@@ -16322,11 +16322,11 @@ function _v(e) {
|
|
|
16322
16322
|
for (let e of V.values()) e.anchorName || e.scroll.rebase();
|
|
16323
16323
|
});
|
|
16324
16324
|
};
|
|
16325
|
-
e.initialTriggerFallback && (O =
|
|
16325
|
+
e.initialTriggerFallback && (O = ie());
|
|
16326
16326
|
let me = () => {
|
|
16327
16327
|
R?.release(), R = null, L?.(), L = null, F = null, I = null;
|
|
16328
|
-
}, he = (e) => !!(fv(e) && U() && N && e !== O &&
|
|
16329
|
-
let e =
|
|
16328
|
+
}, he = (e) => !!(fv(e) && U() && N && e !== O && re() && e.getRootNode() === N.getRootNode()), ge = () => {
|
|
16329
|
+
let e = ie();
|
|
16330
16330
|
O && e !== O && (O = null);
|
|
16331
16331
|
let t = F, n = !!(e?.isConnected && he(e)), r = I === e;
|
|
16332
16332
|
if (e === F && e?.isConnected && n === r) {
|
|
@@ -16357,12 +16357,12 @@ function _v(e) {
|
|
|
16357
16357
|
function ye() {
|
|
16358
16358
|
i((e) => e + 1);
|
|
16359
16359
|
}
|
|
16360
|
-
let be =
|
|
16360
|
+
let be = ie();
|
|
16361
16361
|
_e(be);
|
|
16362
16362
|
let xe = e.runtime.subscribe(() => {
|
|
16363
16363
|
let t = e.runtime.selectGestureActive();
|
|
16364
|
-
h() && t ? (k = !0,
|
|
16365
|
-
let r =
|
|
16364
|
+
h() && t ? (k = !0, ne()) : h() && A !== null && !G(A, te()) && (O = ie(), k = !1, ne());
|
|
16365
|
+
let r = ie(), i = r !== be;
|
|
16366
16366
|
i && (be = r, _e(be), k && (k = !1, O = r)), ge(), i && ye(), n((e) => e + 1), pe();
|
|
16367
16367
|
});
|
|
16368
16368
|
ge(), H().queueMicrotask(de), Kt(() => {
|
|
@@ -16396,7 +16396,7 @@ function _v(e) {
|
|
|
16396
16396
|
}), Oe = () => Se().elements.length > 0 || Se().region !== null, ke = () => {
|
|
16397
16397
|
t();
|
|
16398
16398
|
let e = A;
|
|
16399
|
-
return e !== null &&
|
|
16399
|
+
return e !== null && G(e, te());
|
|
16400
16400
|
}, Ae = Wr(() => {
|
|
16401
16401
|
let e = Se(), t = e.elements.filter((e) => e.isConnected).map((e) => {
|
|
16402
16402
|
let t = e.getBoundingClientRect();
|
|
@@ -16465,7 +16465,7 @@ function _v(e) {
|
|
|
16465
16465
|
r();
|
|
16466
16466
|
let n = V.get(e);
|
|
16467
16467
|
if (!n?.anchorName || !n.target.isConnected) return {
|
|
16468
|
-
...
|
|
16468
|
+
...ee(t),
|
|
16469
16469
|
nativeAnchor: !1
|
|
16470
16470
|
};
|
|
16471
16471
|
let i = n.target.getBoundingClientRect();
|
|
@@ -16489,7 +16489,7 @@ function _v(e) {
|
|
|
16489
16489
|
r();
|
|
16490
16490
|
let e = ze(), t = Pe();
|
|
16491
16491
|
if (!t?.isConnected || I !== t) return {
|
|
16492
|
-
...
|
|
16492
|
+
...ee(e),
|
|
16493
16493
|
nativeAnchor: !1
|
|
16494
16494
|
};
|
|
16495
16495
|
let n = t.getBoundingClientRect();
|
|
@@ -16634,9 +16634,9 @@ function _v(e) {
|
|
|
16634
16634
|
S(!1);
|
|
16635
16635
|
}
|
|
16636
16636
|
}
|
|
16637
|
-
}, Je =
|
|
16637
|
+
}, Je = ne, Ye = () => {
|
|
16638
16638
|
if (!Oe()) return;
|
|
16639
|
-
k = !1, A =
|
|
16639
|
+
k = !1, A = te(), v(""), b(null), w(null), o(null);
|
|
16640
16640
|
let e = je();
|
|
16641
16641
|
if (e) {
|
|
16642
16642
|
let t = gv(e, 272, 168, H());
|
|
@@ -16648,7 +16648,7 @@ function _v(e) {
|
|
|
16648
16648
|
g(!0), H().queueMicrotask(() => R?.sync());
|
|
16649
16649
|
}, Xe = () => {
|
|
16650
16650
|
let e = h();
|
|
16651
|
-
A !== null && !
|
|
16651
|
+
A !== null && !G(A, te()) ? (O = ie(), k = !1, ge(), ye()) : e && (k = !1), Je();
|
|
16652
16652
|
}, Ze = () => {
|
|
16653
16653
|
h() && (k = !0, Je());
|
|
16654
16654
|
}, Qe = () => {
|
|
@@ -16705,7 +16705,7 @@ function _v(e) {
|
|
|
16705
16705
|
P = e, R?.sync();
|
|
16706
16706
|
}, t), Q(t, Y(su, { size: 14 })), J(() => ({
|
|
16707
16707
|
e: U() ? "viewport" : "document",
|
|
16708
|
-
t:
|
|
16708
|
+
t: W(e().nativeAnchor),
|
|
16709
16709
|
a: {
|
|
16710
16710
|
position: e().nativeAnchor || e().viewportOwned ? "fixed" : "absolute",
|
|
16711
16711
|
left: e().nativeAnchor ? `calc(anchor(left) + ${e().anchorX}px)` : `${e().left}px`,
|
|
@@ -16781,7 +16781,7 @@ function _v(e) {
|
|
|
16781
16781
|
})()
|
|
16782
16782
|
}), c), Z(c, l), Z(c, u), Z(l, ta("⌘/Ctrl ↵")), Z(u, d), Z(u, f), Z(d, ta("Cancel")), Z(f, ta("Add note")), J(() => ({
|
|
16783
16783
|
e: U() ? "viewport" : "document",
|
|
16784
|
-
t:
|
|
16784
|
+
t: W(e().nativeAnchor),
|
|
16785
16785
|
a: {
|
|
16786
16786
|
position: e().nativeAnchor || U() ? "fixed" : "absolute",
|
|
16787
16787
|
left: e().nativeAnchor ? `calc(anchor(left) + ${e().anchorX}px)` : `${e().left}px`,
|
|
@@ -16810,7 +16810,7 @@ function _v(e) {
|
|
|
16810
16810
|
left: e.left,
|
|
16811
16811
|
top: e.top
|
|
16812
16812
|
}) : {
|
|
16813
|
-
...
|
|
16813
|
+
...ee({
|
|
16814
16814
|
left: e.left,
|
|
16815
16815
|
top: e.top
|
|
16816
16816
|
}),
|
|
@@ -16826,7 +16826,7 @@ function _v(e) {
|
|
|
16826
16826
|
});
|
|
16827
16827
|
return J(() => ({
|
|
16828
16828
|
e: t() ?? void 0,
|
|
16829
|
-
t:
|
|
16829
|
+
t: W(n().nativeAnchor),
|
|
16830
16830
|
a: {
|
|
16831
16831
|
position: n().nativeAnchor || U() ? "fixed" : "absolute",
|
|
16832
16832
|
left: n().nativeAnchor ? `calc(anchor(left) + ${n().anchorX}px)` : `${n().left}px`,
|
|
@@ -16888,7 +16888,7 @@ function _v(e) {
|
|
|
16888
16888
|
t: t() + 1,
|
|
16889
16889
|
a: i() ? "true" : void 0,
|
|
16890
16890
|
o: o() ? "true" : void 0,
|
|
16891
|
-
i:
|
|
16891
|
+
i: W(n().nativeAnchor),
|
|
16892
16892
|
n: U() ? "viewport" : "document",
|
|
16893
16893
|
s: `Mesurer annotation ${t() + 1}: ${e.note}`,
|
|
16894
16894
|
h: e.note,
|
|
@@ -16984,7 +16984,7 @@ function _v(e) {
|
|
|
16984
16984
|
})()
|
|
16985
16985
|
}), null), J(() => ({
|
|
16986
16986
|
e: t().id,
|
|
16987
|
-
t:
|
|
16987
|
+
t: W(n().nativeAnchor),
|
|
16988
16988
|
a: U() ? "viewport" : "document",
|
|
16989
16989
|
o: {
|
|
16990
16990
|
position: n().nativeAnchor || U() ? "fixed" : "absolute",
|
|
@@ -17985,14 +17985,14 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
17985
17985
|
} finally {
|
|
17986
17986
|
f.dispose();
|
|
17987
17987
|
}
|
|
17988
|
-
}, ib = (e, t = /* @__PURE__ */ new Date()) => `mesurer-recording-${t.toISOString().replace(/[:.]/g, "-")}.${e}`, ab = 352, ob = 576, sb = 8, cb = 8, lb = .05, ub = 200, db = (e, t) => {
|
|
17988
|
+
}, ib = (e, t = /* @__PURE__ */ new Date()) => `mesurer-recording-${t.toISOString().replace(/[:.]/g, "-")}.${e}`, ab = 352, ob = 576, sb = 8, cb = 8, lb = .05, ub = 200, db = 10, fb = (e, t) => {
|
|
17989
17989
|
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
17990
|
-
},
|
|
17990
|
+
}, pb = (e) => {
|
|
17991
17991
|
let t = Number.isFinite(e) ? Math.max(0, e) : 0, n = Math.floor(t / 60);
|
|
17992
17992
|
return `${n}:${(t - n * 60).toFixed(2).padStart(5, "0")}`;
|
|
17993
|
-
},
|
|
17993
|
+
}, mb = (e, t, n) => {
|
|
17994
17994
|
let r = e.createElement("button");
|
|
17995
|
-
return r.type = "button", r.setAttribute("aria-label", t), r.title = t, r.textContent = n,
|
|
17995
|
+
return r.type = "button", r.setAttribute("aria-label", t), r.title = t, r.textContent = n, fb(r, {
|
|
17996
17996
|
display: "inline-flex",
|
|
17997
17997
|
width: "20px",
|
|
17998
17998
|
height: "20px",
|
|
@@ -18008,9 +18008,9 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18008
18008
|
"line-height": "1",
|
|
18009
18009
|
cursor: "pointer"
|
|
18010
18010
|
}), r;
|
|
18011
|
-
},
|
|
18011
|
+
}, hb = (e, t) => {
|
|
18012
18012
|
let n = e.createElement("button");
|
|
18013
|
-
n.type = "button", n.setAttribute("role", "menuitemradio"),
|
|
18013
|
+
n.type = "button", n.setAttribute("role", "menuitemradio"), fb(n, {
|
|
18014
18014
|
display: "grid",
|
|
18015
18015
|
width: "100%",
|
|
18016
18016
|
height: "28px",
|
|
@@ -18035,12 +18035,12 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18035
18035
|
check: r,
|
|
18036
18036
|
text: i
|
|
18037
18037
|
};
|
|
18038
|
-
},
|
|
18038
|
+
}, gb = (e, t, n, r) => {
|
|
18039
18039
|
let i = globalThis.URL.createObjectURL(e), a = n.createElement("a");
|
|
18040
18040
|
a.href = i, a.download = t, a.rel = "noopener", n.documentElement.append(a), a.click(), a.remove(), r.setTimeout(() => globalThis.URL.revokeObjectURL(i), 1e3);
|
|
18041
|
-
},
|
|
18041
|
+
}, _b = ({ ownerDocument: e, ownerWindow: t, root: n, formats: r, onDiscard: i, onExport: a }) => {
|
|
18042
18042
|
let o = e.createElement("section");
|
|
18043
|
-
o.dataset.mesurerRecordingPreview = "true", o.dataset.mesurerInspectorUi = "true", o.setAttribute("role", "dialog"), o.setAttribute("aria-label", "Screen recording editor"), o.tabIndex = 0,
|
|
18043
|
+
o.dataset.mesurerRecordingPreview = "true", o.dataset.mesurerInspectorUi = "true", o.setAttribute("role", "dialog"), o.setAttribute("aria-label", "Screen recording editor"), o.tabIndex = 0, fb(o, {
|
|
18044
18044
|
position: "fixed",
|
|
18045
18045
|
display: "none",
|
|
18046
18046
|
width: `${ab}px`,
|
|
@@ -18058,10 +18058,10 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18058
18058
|
"pointer-events": "auto",
|
|
18059
18059
|
outline: "none",
|
|
18060
18060
|
transform: "translateX(-50%)",
|
|
18061
|
-
transition: "width 200ms ease
|
|
18061
|
+
transition: "width 200ms ease"
|
|
18062
18062
|
}), n.append(o);
|
|
18063
18063
|
let s = e.createElement("div");
|
|
18064
|
-
|
|
18064
|
+
fb(s, {
|
|
18065
18065
|
position: "relative",
|
|
18066
18066
|
display: "flex",
|
|
18067
18067
|
width: "100%",
|
|
@@ -18076,7 +18076,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18076
18076
|
cursor: "default"
|
|
18077
18077
|
}), o.append(s);
|
|
18078
18078
|
let c = e.createElement("video");
|
|
18079
|
-
c.muted = !0, c.playsInline = !0, c.preload = "auto",
|
|
18079
|
+
c.muted = !0, c.playsInline = !0, c.preload = "auto", fb(c, {
|
|
18080
18080
|
display: "block",
|
|
18081
18081
|
width: "100%",
|
|
18082
18082
|
height: "100%",
|
|
@@ -18086,7 +18086,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18086
18086
|
transition: "max-height 200ms ease"
|
|
18087
18087
|
}), s.append(c);
|
|
18088
18088
|
let l = e.createElement("div");
|
|
18089
|
-
l.dataset.mesurerRecordingExporting = "true", l.textContent = "Exporting…",
|
|
18089
|
+
l.dataset.mesurerRecordingExporting = "true", l.textContent = "Exporting…", fb(l, {
|
|
18090
18090
|
position: "absolute",
|
|
18091
18091
|
inset: "0",
|
|
18092
18092
|
display: "none",
|
|
@@ -18098,8 +18098,8 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18098
18098
|
"font-size": "11px",
|
|
18099
18099
|
"pointer-events": "none"
|
|
18100
18100
|
}), s.append(l);
|
|
18101
|
-
let u =
|
|
18102
|
-
u.dataset.mesurerRecordingDiscard = "true",
|
|
18101
|
+
let u = mb(e, "Close", "×");
|
|
18102
|
+
u.dataset.mesurerRecordingDiscard = "true", fb(u, {
|
|
18103
18103
|
position: "absolute",
|
|
18104
18104
|
top: "6px",
|
|
18105
18105
|
right: "6px",
|
|
@@ -18121,63 +18121,73 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18121
18121
|
u.style.opacity = "0", u.style.pointerEvents = "none";
|
|
18122
18122
|
});
|
|
18123
18123
|
let d = e.createElement("div");
|
|
18124
|
-
|
|
18124
|
+
fb(d, {
|
|
18125
18125
|
display: "flex",
|
|
18126
|
-
height: "
|
|
18126
|
+
height: "28px",
|
|
18127
18127
|
"align-items": "center",
|
|
18128
|
-
gap: "
|
|
18128
|
+
gap: "8px",
|
|
18129
18129
|
"margin-top": "8px"
|
|
18130
18130
|
}), o.append(d);
|
|
18131
|
-
let f =
|
|
18131
|
+
let f = mb(e, "Play", "▶");
|
|
18132
18132
|
f.dataset.mesurerRecordingPlay = "true", d.append(f);
|
|
18133
18133
|
let p = e.createElement("span");
|
|
18134
|
-
p.textContent = "0:00.00",
|
|
18134
|
+
p.dataset.mesurerRecordingCurrentTime = "true", p.textContent = "0:00.00", fb(p, {
|
|
18135
18135
|
display: "flex",
|
|
18136
|
-
width: "
|
|
18136
|
+
width: "8ch",
|
|
18137
|
+
"min-width": "8ch",
|
|
18137
18138
|
height: "20px",
|
|
18138
18139
|
"align-items": "center",
|
|
18139
18140
|
"flex-shrink": "0",
|
|
18140
18141
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
18141
18142
|
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
18142
18143
|
"font-size": "10px",
|
|
18143
|
-
"font-variant-numeric": "tabular-nums"
|
|
18144
|
+
"font-variant-numeric": "tabular-nums",
|
|
18145
|
+
"white-space": "nowrap"
|
|
18144
18146
|
}), d.append(p);
|
|
18145
18147
|
let m = e.createElement("div");
|
|
18146
|
-
m.dataset.mesurerRecordingTimeline = "true",
|
|
18148
|
+
m.dataset.mesurerRecordingTimeline = "true", fb(m, {
|
|
18147
18149
|
position: "relative",
|
|
18148
|
-
height: "
|
|
18150
|
+
height: "28px",
|
|
18149
18151
|
"min-width": "0",
|
|
18150
18152
|
flex: "1 1 0",
|
|
18151
18153
|
cursor: "pointer",
|
|
18152
18154
|
"user-select": "none"
|
|
18153
18155
|
}), d.append(m);
|
|
18154
18156
|
let h = e.createElement("div");
|
|
18155
|
-
h.dataset.
|
|
18157
|
+
h.dataset.mesurerRecordingTimelineTrack = "true", fb(h, {
|
|
18158
|
+
position: "absolute",
|
|
18159
|
+
left: `${db}px`,
|
|
18160
|
+
right: `${db}px`,
|
|
18161
|
+
top: "0",
|
|
18162
|
+
bottom: "0"
|
|
18163
|
+
}), m.append(h);
|
|
18164
|
+
let g = e.createElement("div");
|
|
18165
|
+
g.dataset.mesurerRecordingTimelineRail = "true", fb(g, {
|
|
18156
18166
|
position: "absolute",
|
|
18157
18167
|
left: "0",
|
|
18158
18168
|
right: "0",
|
|
18159
|
-
top: "
|
|
18169
|
+
top: "21px",
|
|
18160
18170
|
height: "3px",
|
|
18161
18171
|
transform: "translateY(-50%)",
|
|
18162
18172
|
"border-radius": "999px",
|
|
18163
18173
|
background: "var(--msr-color-ink-200, #e2e8f0)",
|
|
18164
18174
|
"pointer-events": "none"
|
|
18165
|
-
}),
|
|
18166
|
-
let
|
|
18167
|
-
|
|
18175
|
+
}), h.append(g);
|
|
18176
|
+
let _ = e.createElement("div");
|
|
18177
|
+
_.dataset.mesurerRecordingTimelineClip = "true", fb(_, {
|
|
18168
18178
|
position: "absolute",
|
|
18169
|
-
top: "
|
|
18179
|
+
top: "21px",
|
|
18170
18180
|
height: "3px",
|
|
18171
18181
|
transform: "translateY(-50%)",
|
|
18172
18182
|
"border-radius": "999px",
|
|
18173
18183
|
background: "var(--msr-color-ink-300, #cbd5e1)",
|
|
18174
18184
|
"pointer-events": "none"
|
|
18175
|
-
}),
|
|
18176
|
-
let
|
|
18177
|
-
|
|
18185
|
+
}), h.append(_);
|
|
18186
|
+
let v = e.createElement("div");
|
|
18187
|
+
fb(v, {
|
|
18178
18188
|
position: "absolute",
|
|
18179
18189
|
display: "none",
|
|
18180
|
-
top: "
|
|
18190
|
+
top: "21px",
|
|
18181
18191
|
width: "2px",
|
|
18182
18192
|
height: "10px",
|
|
18183
18193
|
transform: "translate(-50%, -50%)",
|
|
@@ -18185,11 +18195,11 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18185
18195
|
background: "var(--msr-color-ink-500, #64748b)",
|
|
18186
18196
|
opacity: "0.5",
|
|
18187
18197
|
"pointer-events": "none"
|
|
18188
|
-
}),
|
|
18189
|
-
let
|
|
18190
|
-
|
|
18198
|
+
}), h.append(v);
|
|
18199
|
+
let y = e.createElement("div");
|
|
18200
|
+
y.dataset.mesurerRecordingPlayhead = "true", fb(y, {
|
|
18191
18201
|
position: "absolute",
|
|
18192
|
-
top: "
|
|
18202
|
+
top: "21px",
|
|
18193
18203
|
left: "0",
|
|
18194
18204
|
width: "2px",
|
|
18195
18205
|
height: "9px",
|
|
@@ -18199,15 +18209,15 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18199
18209
|
"z-index": "25",
|
|
18200
18210
|
"pointer-events": "none",
|
|
18201
18211
|
transition: "height 150ms ease"
|
|
18202
|
-
}),
|
|
18203
|
-
let
|
|
18212
|
+
}), h.append(y);
|
|
18213
|
+
let b = (t, n) => {
|
|
18204
18214
|
let r = e.createElement("button");
|
|
18205
|
-
r.type = "button", r.dataset.mesurerRecordingTrimHandle = t, r.setAttribute("role", "slider"), r.setAttribute("aria-label", n), r.setAttribute("aria-valuemin", "0"),
|
|
18215
|
+
r.type = "button", r.dataset.mesurerRecordingTrimHandle = t, r.setAttribute("role", "slider"), r.setAttribute("aria-label", n), r.setAttribute("aria-valuemin", "0"), fb(r, {
|
|
18206
18216
|
position: "absolute",
|
|
18207
18217
|
top: "0",
|
|
18208
18218
|
display: "flex",
|
|
18209
|
-
width: "
|
|
18210
|
-
height: "
|
|
18219
|
+
width: "20px",
|
|
18220
|
+
height: "16px",
|
|
18211
18221
|
padding: "0",
|
|
18212
18222
|
border: "0",
|
|
18213
18223
|
"border-radius": "4px",
|
|
@@ -18215,32 +18225,31 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18215
18225
|
color: "var(--msr-content, #18181b)",
|
|
18216
18226
|
transform: "translateX(-50%)",
|
|
18217
18227
|
"z-index": "30",
|
|
18218
|
-
"align-items": "
|
|
18228
|
+
"align-items": "center",
|
|
18219
18229
|
"justify-content": "center",
|
|
18220
|
-
"font-family": "ui-sans-serif, system-ui, sans-serif",
|
|
18221
|
-
"font-size": "10px",
|
|
18222
|
-
"font-weight": "700",
|
|
18223
|
-
"line-height": "8px",
|
|
18224
18230
|
cursor: "ew-resize",
|
|
18225
18231
|
"touch-action": "none"
|
|
18226
18232
|
});
|
|
18227
|
-
let i = e.
|
|
18228
|
-
i.dataset.mesurerRecordingTrimChevron = t, i.setAttribute("aria-hidden", "true"), i.
|
|
18229
|
-
let a = e.
|
|
18230
|
-
|
|
18233
|
+
let i = e.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
18234
|
+
i.dataset.mesurerRecordingTrimChevron = t, i.setAttribute("aria-hidden", "true"), i.setAttribute("viewBox", "0 0 12 14"), i.setAttribute("width", "12"), i.setAttribute("height", "14");
|
|
18235
|
+
let a = e.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
18236
|
+
a.setAttribute("d", t === "start" ? "M3.5 2.5L8.5 7L3.5 11.5" : "M8.5 2.5L3.5 7L8.5 11.5"), a.setAttribute("fill", "none"), a.setAttribute("stroke", "currentColor"), a.setAttribute("stroke-width", "2"), a.setAttribute("stroke-linecap", "round"), a.setAttribute("stroke-linejoin", "round"), i.append(a), r.append(i);
|
|
18237
|
+
let o = e.createElement("span");
|
|
18238
|
+
return o.setAttribute("aria-hidden", "true"), fb(o, {
|
|
18231
18239
|
position: "absolute",
|
|
18232
18240
|
left: "50%",
|
|
18233
|
-
top: "
|
|
18241
|
+
top: "15px",
|
|
18234
18242
|
width: "1px",
|
|
18235
|
-
height: "
|
|
18243
|
+
height: "4px",
|
|
18236
18244
|
background: "var(--msr-content, #18181b)",
|
|
18237
18245
|
transform: "translateX(-50%)",
|
|
18238
18246
|
"pointer-events": "none"
|
|
18239
|
-
}), r.append(
|
|
18240
|
-
},
|
|
18241
|
-
|
|
18247
|
+
}), r.append(o), h.append(r), r;
|
|
18248
|
+
}, x = b("start", "Trim start"), S = b("end", "Trim end"), C = e.createElement("span");
|
|
18249
|
+
C.dataset.mesurerRecordingDuration = "true", fb(C, {
|
|
18242
18250
|
display: "flex",
|
|
18243
|
-
width: "
|
|
18251
|
+
width: "8ch",
|
|
18252
|
+
"min-width": "8ch",
|
|
18244
18253
|
height: "20px",
|
|
18245
18254
|
"align-items": "center",
|
|
18246
18255
|
"justify-content": "flex-end",
|
|
@@ -18248,23 +18257,24 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18248
18257
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
18249
18258
|
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
18250
18259
|
"font-size": "10px",
|
|
18251
|
-
"font-variant-numeric": "tabular-nums"
|
|
18252
|
-
|
|
18253
|
-
|
|
18254
|
-
|
|
18260
|
+
"font-variant-numeric": "tabular-nums",
|
|
18261
|
+
"white-space": "nowrap"
|
|
18262
|
+
}), d.append(C);
|
|
18263
|
+
let w = e.createElement("div");
|
|
18264
|
+
fb(w, {
|
|
18255
18265
|
position: "relative",
|
|
18256
18266
|
display: "flex",
|
|
18257
18267
|
height: "20px",
|
|
18258
18268
|
"align-items": "center"
|
|
18259
|
-
}), d.append(
|
|
18260
|
-
let
|
|
18261
|
-
|
|
18269
|
+
}), d.append(w);
|
|
18270
|
+
let T = mb(e, "Export options", "1×");
|
|
18271
|
+
T.dataset.mesurerRecordingExportOptions = "true", T.setAttribute("aria-haspopup", "menu"), T.setAttribute("aria-expanded", "false"), fb(T, {
|
|
18262
18272
|
width: "28px",
|
|
18263
18273
|
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
18264
18274
|
"font-size": "10px"
|
|
18265
|
-
}),
|
|
18266
|
-
let
|
|
18267
|
-
|
|
18275
|
+
}), w.append(T);
|
|
18276
|
+
let E = e.createElement("div");
|
|
18277
|
+
E.dataset.mesurerRecordingExportMenu = "true", E.setAttribute("role", "menu"), fb(E, {
|
|
18268
18278
|
position: "absolute",
|
|
18269
18279
|
display: "none",
|
|
18270
18280
|
right: "0",
|
|
@@ -18278,247 +18288,243 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18278
18288
|
color: "var(--msr-content, #18181b)",
|
|
18279
18289
|
"box-shadow": "var(--msr-shadow-floating, 0 10px 30px rgba(0, 0, 0, 0.12))",
|
|
18280
18290
|
"pointer-events": "auto"
|
|
18281
|
-
}),
|
|
18282
|
-
let
|
|
18283
|
-
|
|
18291
|
+
}), w.append(E);
|
|
18292
|
+
let D = e.createElement("p");
|
|
18293
|
+
D.textContent = "Format", fb(D, {
|
|
18284
18294
|
margin: "0",
|
|
18285
18295
|
padding: "4px 8px",
|
|
18286
18296
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
18287
18297
|
"font-size": "10px",
|
|
18288
18298
|
"font-weight": "500"
|
|
18289
|
-
}),
|
|
18290
|
-
let
|
|
18291
|
-
|
|
18292
|
-
let
|
|
18293
|
-
|
|
18299
|
+
}), E.append(D);
|
|
18300
|
+
let O = e.createElement("div");
|
|
18301
|
+
E.append(O);
|
|
18302
|
+
let k = e.createElement("p");
|
|
18303
|
+
k.textContent = "Size", fb(k, {
|
|
18294
18304
|
margin: "0",
|
|
18295
18305
|
padding: "6px 8px 4px",
|
|
18296
18306
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
18297
18307
|
"font-size": "10px",
|
|
18298
18308
|
"font-weight": "500"
|
|
18299
|
-
}),
|
|
18300
|
-
let
|
|
18301
|
-
|
|
18302
|
-
let
|
|
18309
|
+
}), E.append(k);
|
|
18310
|
+
let A = e.createElement("div");
|
|
18311
|
+
E.append(A);
|
|
18312
|
+
let j = [
|
|
18303
18313
|
1,
|
|
18304
18314
|
2,
|
|
18305
18315
|
3
|
|
18306
18316
|
].map((t) => {
|
|
18307
|
-
let n =
|
|
18308
|
-
return n.button.dataset.mesurerRecordingScale = String(t),
|
|
18317
|
+
let n = hb(e, `${t}×`);
|
|
18318
|
+
return n.button.dataset.mesurerRecordingScale = String(t), A.append(n.button), {
|
|
18309
18319
|
scale: t,
|
|
18310
18320
|
...n
|
|
18311
18321
|
};
|
|
18312
|
-
}),
|
|
18313
|
-
|
|
18314
|
-
let
|
|
18315
|
-
|
|
18316
|
-
let
|
|
18317
|
-
|
|
18322
|
+
}), M = mb(e, "Download", "↓");
|
|
18323
|
+
M.dataset.mesurerRecordingExport = "true", d.append(M);
|
|
18324
|
+
let N = mb(e, "Grow preview", "↗");
|
|
18325
|
+
N.dataset.mesurerRecordingExpand = "true", d.append(N);
|
|
18326
|
+
let P = e.createElement("p");
|
|
18327
|
+
P.dataset.mesurerRecordingPreviewStatus = "true", P.setAttribute("role", "status"), fb(P, {
|
|
18318
18328
|
display: "none",
|
|
18319
18329
|
margin: "8px 0 0",
|
|
18320
18330
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
18321
18331
|
"font-size": "11px",
|
|
18322
18332
|
"line-height": "16px"
|
|
18323
|
-
}), o.append(
|
|
18324
|
-
let
|
|
18325
|
-
let t =
|
|
18333
|
+
}), o.append(P);
|
|
18334
|
+
let F = null, I = null, L = !1, R = !1, z = 0, B = ["webm"], V = "webm", H = 1, U = 0, W = 0, ee = null, te = null, G = null, ne = (e) => {
|
|
18335
|
+
let t = F?.duration ?? 0;
|
|
18326
18336
|
return t <= 0 ? 0 : Math.min(1, Math.max(0, e / t));
|
|
18327
18337
|
}, re = () => ({
|
|
18328
|
-
start:
|
|
18329
|
-
end:
|
|
18338
|
+
start: U,
|
|
18339
|
+
end: W
|
|
18330
18340
|
}), ie = (e) => {
|
|
18331
|
-
let t =
|
|
18341
|
+
let t = F?.duration ?? 0, n = h.getBoundingClientRect();
|
|
18332
18342
|
return t <= 0 || n.width <= 0 ? 0 : Math.min(t, Math.max(0, (e - n.left) / n.width * t));
|
|
18333
|
-
},
|
|
18334
|
-
let e =
|
|
18335
|
-
|
|
18336
|
-
},
|
|
18337
|
-
if (!
|
|
18338
|
-
let n = Math.min(
|
|
18339
|
-
t && !c.paused && c.pause(), c.currentTime = n,
|
|
18340
|
-
}, oe = (e, t = !1) => {
|
|
18341
|
-
P && (H = Math.min(Math.max(0, e), Math.max(0, U - lb)), (t || c.currentTime < H) && ae(H), G());
|
|
18343
|
+
}, ae = () => {
|
|
18344
|
+
let e = F?.duration ?? 0, t = Math.min(e, Math.max(0, c.currentTime || 0)), n = ne(U) * 100, r = ne(W) * 100;
|
|
18345
|
+
x.style.left = `${n}%`, S.style.left = `${r}%`, _.style.left = `${n}%`, _.style.width = `${Math.max(0, r - n)}%`, y.style.left = `${ne(t) * 100}%`, x.setAttribute("aria-valuemax", String(Math.max(0, W - lb))), x.setAttribute("aria-valuenow", String(U)), x.setAttribute("aria-valuetext", pb(U)), S.setAttribute("aria-valuemin", String(Math.min(e, U + lb))), S.setAttribute("aria-valuemax", String(e)), S.setAttribute("aria-valuenow", String(W)), S.setAttribute("aria-valuetext", pb(W)), p.textContent = pb(t), C.textContent = pb(e);
|
|
18346
|
+
}, oe = (e, t = !0) => {
|
|
18347
|
+
if (!F) return;
|
|
18348
|
+
let n = Math.min(W, Math.max(U, e));
|
|
18349
|
+
t && !c.paused && c.pause(), c.currentTime = n, ae();
|
|
18342
18350
|
}, se = (e, t = !1) => {
|
|
18343
|
-
|
|
18344
|
-
}, ce = () => {
|
|
18345
|
-
|
|
18346
|
-
for (let e of A) {
|
|
18347
|
-
let t = e.scale === V;
|
|
18348
|
-
e.button.setAttribute("aria-checked", t ? "true" : "false"), e.check.style.opacity = t ? "1" : "0", e.text.textContent = P ? `${e.scale}× ${Math.round(P.width * e.scale)} × ${Math.round(P.height * e.scale)}` : `${e.scale}×`;
|
|
18349
|
-
}
|
|
18351
|
+
F && (U = Math.min(Math.max(0, e), Math.max(0, W - lb)), (t || c.currentTime < U) && oe(U), ae());
|
|
18352
|
+
}, ce = (e, t = !1) => {
|
|
18353
|
+
F && (W = Math.max(Math.min(F.duration, e), Math.min(F.duration, U + lb)), t ? oe(W) : c.currentTime > W && oe(U), ae());
|
|
18350
18354
|
}, K = () => {
|
|
18351
|
-
|
|
18352
|
-
for (let
|
|
18353
|
-
let
|
|
18354
|
-
|
|
18355
|
-
B = t, K();
|
|
18356
|
-
}), D.append(n.button);
|
|
18355
|
+
T.textContent = `${H}×`;
|
|
18356
|
+
for (let e of j) {
|
|
18357
|
+
let t = e.scale === H;
|
|
18358
|
+
e.button.setAttribute("aria-checked", t ? "true" : "false"), e.check.style.opacity = t ? "1" : "0", e.text.textContent = F ? `${e.scale}× ${Math.round(F.width * e.scale)} × ${Math.round(F.height * e.scale)}` : `${e.scale}×`;
|
|
18357
18359
|
}
|
|
18358
18360
|
}, le = () => {
|
|
18359
|
-
|
|
18360
|
-
|
|
18361
|
-
|
|
18362
|
-
|
|
18363
|
-
|
|
18361
|
+
O.replaceChildren();
|
|
18362
|
+
for (let t of B) {
|
|
18363
|
+
let n = hb(e, t === "mp4" ? "MP4" : "WebM"), r = t === V;
|
|
18364
|
+
n.button.dataset.mesurerRecordingFormat = t, n.button.setAttribute("aria-checked", r ? "true" : "false"), n.check.style.opacity = r ? "1" : "0", n.button.addEventListener("click", () => {
|
|
18365
|
+
V = t, le();
|
|
18366
|
+
}), O.append(n.button);
|
|
18367
|
+
}
|
|
18368
|
+
}, ue = () => {
|
|
18369
|
+
if (E.style.display === "none") return;
|
|
18370
|
+
let e = w.getBoundingClientRect(), n = Math.max(1, E.offsetHeight), r = e.top - sb, i = t.innerHeight - e.bottom - sb;
|
|
18371
|
+
r >= n || r >= i ? (E.style.top = "auto", E.style.bottom = "24px") : (E.style.top = "24px", E.style.bottom = "auto");
|
|
18364
18372
|
}, de = (e) => {
|
|
18365
|
-
|
|
18373
|
+
E.style.display = e ? "block" : "none", T.setAttribute("aria-expanded", e ? "true" : "false"), e && ue();
|
|
18374
|
+
}, fe = (e) => {
|
|
18375
|
+
R = e, l.style.display = e ? "flex" : "none";
|
|
18366
18376
|
for (let t of [
|
|
18367
18377
|
f,
|
|
18368
18378
|
u,
|
|
18369
|
-
b,
|
|
18370
18379
|
x,
|
|
18371
|
-
|
|
18372
|
-
|
|
18380
|
+
S,
|
|
18381
|
+
T,
|
|
18373
18382
|
M,
|
|
18374
|
-
|
|
18383
|
+
N,
|
|
18384
|
+
...j.map((e) => e.button)
|
|
18375
18385
|
]) t.toggleAttribute("disabled", e);
|
|
18376
|
-
},
|
|
18386
|
+
}, pe = () => n.closest("[data-mesurer-root='true']")?.querySelector("[data-mesurer-tool-id='recording']") ?? e.querySelector("[data-mesurer-tool-id='recording']"), me = () => {
|
|
18377
18387
|
if (o.style.display === "none") return;
|
|
18378
|
-
let e = Math.min(
|
|
18379
|
-
l + n > t.innerHeight - sb && (l = r ? r.top - n - cb : t.innerHeight - n - sb), o.style.left = `${c}px`, o.style.top = `${Math.max(sb, l)}px`,
|
|
18380
|
-
}, me = () => {
|
|
18381
|
-
c.pause(), c.removeAttribute("src"), c.load(), F &&= (globalThis.URL.revokeObjectURL(F), null);
|
|
18388
|
+
let e = Math.min(L ? ob : ab, Math.max(1, t.innerWidth - 16)), n = Math.max(180, o.offsetHeight), r = pe()?.getBoundingClientRect(), i = r ? r.left + r.width / 2 : t.innerWidth - sb - e / 2, a = sb + e / 2, s = Math.max(a, t.innerWidth - sb - e / 2), c = Math.min(Math.max(a, i), s), l = r ? r.bottom + cb : sb;
|
|
18389
|
+
l + n > t.innerHeight - sb && (l = r ? r.top - n - cb : t.innerHeight - n - sb), o.style.left = `${c}px`, o.style.top = `${Math.max(sb, l)}px`, E.style.display !== "none" && ue();
|
|
18382
18390
|
}, he = () => {
|
|
18383
|
-
|
|
18391
|
+
c.pause(), c.removeAttribute("src"), c.load(), I &&= (globalThis.URL.revokeObjectURL(I), null);
|
|
18384
18392
|
}, ge = () => {
|
|
18385
|
-
|
|
18386
|
-
|
|
18387
|
-
|
|
18393
|
+
z += 1, G &&= (G.cancel(), null), he(), F = null, ee = null, te = null, de(!1), o.style.display = "none", o.style.pointerEvents = "auto", o.style.opacity = "1", o.style.transform = "translateX(-50%)", o.style.removeProperty("transform-origin"), o.style.removeProperty("will-change"), P.style.display = "none", fe(!1);
|
|
18394
|
+
}, _e = () => {
|
|
18395
|
+
if (!F || o.style.display === "none" || G) return;
|
|
18396
|
+
let e = o.getBoundingClientRect(), t = pe()?.getBoundingClientRect(), n = t ? t.left + t.width / 2 : e.left + e.width / 2, r = t ? t.top + t.height / 2 : e.top + e.height / 2;
|
|
18397
|
+
c.pause(), de(!1), o.style.pointerEvents = "none", o.style.left = `${e.left}px`, o.style.top = `${e.top}px`, o.style.transform = "none", o.style.transformOrigin = `${n - e.left}px ${r - e.top}px`, o.style.willChange = "transform, opacity";
|
|
18388
18398
|
let a = o.animate([{
|
|
18389
|
-
|
|
18390
|
-
top: `${e.top}px`,
|
|
18391
|
-
transform: "translateX(-50%) scale(1)",
|
|
18399
|
+
transform: "scale(1)",
|
|
18392
18400
|
opacity: 1
|
|
18393
18401
|
}, {
|
|
18394
|
-
|
|
18395
|
-
top: `${r}px`,
|
|
18396
|
-
transform: "translateX(-50%) scale(0.08)",
|
|
18402
|
+
transform: "scale(0.08)",
|
|
18397
18403
|
opacity: 0
|
|
18398
18404
|
}], {
|
|
18399
18405
|
duration: ub,
|
|
18400
18406
|
easing: "ease",
|
|
18401
18407
|
fill: "forwards"
|
|
18402
18408
|
});
|
|
18403
|
-
|
|
18404
|
-
|
|
18409
|
+
G = a, a.finished.catch(() => void 0).then(() => {
|
|
18410
|
+
G === a && (a.cancel(), G = null, o.style.removeProperty("will-change"), i());
|
|
18405
18411
|
});
|
|
18406
|
-
},
|
|
18407
|
-
if (!(!
|
|
18412
|
+
}, ve = () => {
|
|
18413
|
+
if (!(!F || R)) {
|
|
18408
18414
|
if (!c.paused) {
|
|
18409
18415
|
c.pause();
|
|
18410
18416
|
return;
|
|
18411
18417
|
}
|
|
18412
|
-
(c.currentTime <
|
|
18418
|
+
(c.currentTime < U || c.currentTime >= W) && (c.currentTime = U), c.play();
|
|
18413
18419
|
}
|
|
18414
|
-
},
|
|
18415
|
-
ee = null, te = null,
|
|
18416
|
-
},
|
|
18420
|
+
}, ye = () => {
|
|
18421
|
+
ee = null, te = null, y.style.height = "8px";
|
|
18422
|
+
}, be = (e) => {
|
|
18417
18423
|
if (!ee) return;
|
|
18418
18424
|
let t = ie(e);
|
|
18419
|
-
ee === "start" ?
|
|
18420
|
-
},
|
|
18421
|
-
!
|
|
18422
|
-
}, xe = (e) => {
|
|
18423
|
-
te !== null && e.pointerId === te && ye(e.clientX);
|
|
18425
|
+
ee === "start" ? se(t, !0) : ee === "end" ? ce(t, !0) : oe(t);
|
|
18426
|
+
}, xe = (e, t) => {
|
|
18427
|
+
!F || R || t.button !== 0 || (t.preventDefault(), t.stopPropagation(), ee = e, te = t.pointerId, y.style.height = "10px", be(t.clientX));
|
|
18424
18428
|
}, Se = (e) => {
|
|
18425
|
-
te !== null && e.pointerId === te &&
|
|
18429
|
+
te !== null && e.pointerId === te && be(e.clientX);
|
|
18430
|
+
}, Ce = (e) => {
|
|
18431
|
+
te !== null && e.pointerId === te && ye();
|
|
18426
18432
|
};
|
|
18427
|
-
|
|
18433
|
+
x.addEventListener("pointerdown", (e) => xe("start", e)), S.addEventListener("pointerdown", (e) => xe("end", e)), m.addEventListener("pointerdown", (e) => {
|
|
18428
18434
|
let t = e.target;
|
|
18429
|
-
t instanceof Element && t.closest("[data-mesurer-recording-trim-handle]") ||
|
|
18435
|
+
t instanceof Element && t.closest("[data-mesurer-recording-trim-handle]") || xe("playhead", e);
|
|
18430
18436
|
}), m.addEventListener("pointermove", (e) => {
|
|
18431
|
-
te === null && (
|
|
18437
|
+
te === null && (v.style.display = "block", v.style.left = `${ne(ie(e.clientX)) * 100}%`);
|
|
18432
18438
|
}), m.addEventListener("pointerleave", () => {
|
|
18433
|
-
|
|
18439
|
+
v.style.display = "none";
|
|
18434
18440
|
});
|
|
18435
|
-
for (let [e, t] of [["start",
|
|
18436
|
-
if (!
|
|
18441
|
+
for (let [e, t] of [["start", x], ["end", S]]) t.addEventListener("keydown", (t) => {
|
|
18442
|
+
if (!F || t.key !== "ArrowLeft" && t.key !== "ArrowRight") return;
|
|
18437
18443
|
t.preventDefault();
|
|
18438
|
-
let n = t.key === "ArrowLeft" ? -1 : 1, r = (e === "start" ?
|
|
18439
|
-
e === "start" ?
|
|
18444
|
+
let n = t.key === "ArrowLeft" ? -1 : 1, r = (e === "start" ? U : W) + n * .05;
|
|
18445
|
+
e === "start" ? se(r, !0) : ce(r, !0);
|
|
18440
18446
|
});
|
|
18441
|
-
t.addEventListener("pointermove",
|
|
18442
|
-
e.stopPropagation(),
|
|
18447
|
+
t.addEventListener("pointermove", Se, !0), t.addEventListener("pointerup", Ce, !0), t.addEventListener("pointercancel", Ce, !0), u.addEventListener("click", (e) => {
|
|
18448
|
+
e.stopPropagation(), _e();
|
|
18443
18449
|
}), s.addEventListener("click", (e) => {
|
|
18444
18450
|
let t = e.target;
|
|
18445
|
-
t instanceof Element && t.closest("button") ||
|
|
18446
|
-
}), f.addEventListener("click",
|
|
18451
|
+
t instanceof Element && t.closest("button") || ve();
|
|
18452
|
+
}), f.addEventListener("click", ve), c.addEventListener("play", () => {
|
|
18447
18453
|
f.textContent = "Ⅱ", f.setAttribute("aria-label", "Pause"), f.title = "Pause";
|
|
18448
18454
|
}), c.addEventListener("pause", () => {
|
|
18449
18455
|
f.textContent = "▶", f.setAttribute("aria-label", "Play"), f.title = "Play";
|
|
18450
18456
|
}), c.addEventListener("timeupdate", () => {
|
|
18451
|
-
|
|
18457
|
+
F && (c.currentTime >= W - .01 ? (c.pause(), c.currentTime = U) : c.currentTime < U && (c.currentTime = U), ae());
|
|
18452
18458
|
}), c.addEventListener("loadedmetadata", () => {
|
|
18453
|
-
|
|
18454
|
-
}),
|
|
18455
|
-
|
|
18459
|
+
ae();
|
|
18460
|
+
}), T.addEventListener("click", () => {
|
|
18461
|
+
R || de(E.style.display === "none");
|
|
18456
18462
|
});
|
|
18457
|
-
for (let e of
|
|
18458
|
-
|
|
18463
|
+
for (let e of j) e.button.addEventListener("click", () => {
|
|
18464
|
+
H = e.scale, K();
|
|
18459
18465
|
});
|
|
18460
|
-
let
|
|
18461
|
-
|
|
18466
|
+
let we = (e) => {
|
|
18467
|
+
E.style.display !== "none" && (e.composedPath().includes(w) || de(!1));
|
|
18462
18468
|
};
|
|
18463
|
-
e.addEventListener("pointerdown",
|
|
18464
|
-
|
|
18465
|
-
}),
|
|
18466
|
-
if (!
|
|
18467
|
-
let n = ++
|
|
18468
|
-
|
|
18469
|
-
format:
|
|
18469
|
+
e.addEventListener("pointerdown", we, !0), N.addEventListener("click", () => {
|
|
18470
|
+
L = !L, o.style.width = `${L ? ob : ab}px`, s.style.maxHeight = L ? "448px" : "144px", c.style.maxHeight = L ? "448px" : "144px", N.textContent = L ? "↙" : "↗", N.setAttribute("aria-label", L ? "Shrink preview" : "Grow preview"), N.title = L ? "Shrink preview" : "Grow preview", t.requestAnimationFrame(me);
|
|
18471
|
+
}), M.addEventListener("click", () => {
|
|
18472
|
+
if (!F || R || B.length === 0) return;
|
|
18473
|
+
let n = ++z, { start: r, end: i } = re();
|
|
18474
|
+
fe(!0), de(!1), P.style.display = "none", a({
|
|
18475
|
+
format: V,
|
|
18470
18476
|
startTime: r,
|
|
18471
18477
|
endTime: i,
|
|
18472
|
-
scale:
|
|
18478
|
+
scale: H
|
|
18473
18479
|
}).then((r) => {
|
|
18474
|
-
n ===
|
|
18480
|
+
n === z && gb(r.blob, r.filename, e, t);
|
|
18475
18481
|
}).catch((e) => {
|
|
18476
|
-
n ===
|
|
18482
|
+
n === z && (P.style.display = "block", P.style.color = "var(--msr-danger-text, #dc2626)", P.textContent = e instanceof Error ? e.message : "Could not export the recording.");
|
|
18477
18483
|
}).finally(() => {
|
|
18478
|
-
n ===
|
|
18484
|
+
n === z && fe(!1);
|
|
18479
18485
|
});
|
|
18480
18486
|
}), o.addEventListener("keydown", (e) => {
|
|
18481
18487
|
if (e.key === "Escape") {
|
|
18482
|
-
if (
|
|
18483
|
-
e.preventDefault(),
|
|
18488
|
+
if (E.style.display !== "none") {
|
|
18489
|
+
e.preventDefault(), de(!1);
|
|
18484
18490
|
return;
|
|
18485
18491
|
}
|
|
18486
|
-
e.preventDefault(),
|
|
18492
|
+
e.preventDefault(), _e();
|
|
18487
18493
|
return;
|
|
18488
18494
|
}
|
|
18489
|
-
(e.key === " " || e.code === "Space") && e.target === o && (e.preventDefault(),
|
|
18495
|
+
(e.key === " " || e.code === "Space") && e.target === o && (e.preventDefault(), ve());
|
|
18490
18496
|
});
|
|
18491
|
-
let
|
|
18492
|
-
return t.addEventListener("resize",
|
|
18497
|
+
let Te = () => me();
|
|
18498
|
+
return t.addEventListener("resize", Te), {
|
|
18493
18499
|
show(e) {
|
|
18494
|
-
|
|
18500
|
+
z += 1, G &&= (G.cancel(), null), o.style.pointerEvents = "auto", o.style.opacity = "1", o.style.transform = "translateX(-50%)", o.style.removeProperty("transform-origin"), o.style.removeProperty("will-change"), he(), F = e, L = !1, H = 1, V = "webm", B = ["webm"], U = 0, W = e.duration, ee = null, te = null;
|
|
18495
18501
|
let n = globalThis.URL.createObjectURL(e.blob);
|
|
18496
|
-
|
|
18497
|
-
let i =
|
|
18502
|
+
I = n, c.src = n, c.currentTime = 0, s.style.aspectRatio = e.width > 0 && e.height > 0 ? `${e.width} / ${e.height}` : "16 / 9", o.style.width = `${ab}px`, s.style.maxHeight = "144px", c.style.maxHeight = "144px", N.textContent = "↗", N.setAttribute("aria-label", "Grow preview"), N.title = "Grow preview", p.textContent = "0:00.00", C.textContent = pb(e.duration), P.style.display = "none", P.style.color = "var(--msr-color-ink-500, #64748b)", de(!1), le(), K(), ae(), fe(!1), o.style.display = "block", me(), o.focus({ preventScroll: !0 });
|
|
18503
|
+
let i = z;
|
|
18498
18504
|
r(e).then((e) => {
|
|
18499
|
-
i !==
|
|
18505
|
+
i !== z || !F || (B = e, V = e.includes(V) ? V : e[0] ?? "webm", le(), M.disabled = e.length === 0, e.length === 0 && (P.style.display = "block", P.style.color = "var(--msr-danger-text, #dc2626)", P.textContent = "No MediaBunny video encoder is available in this runtime."));
|
|
18500
18506
|
}).catch((e) => {
|
|
18501
|
-
i ===
|
|
18502
|
-
}), t.requestAnimationFrame(
|
|
18507
|
+
i === z && (B = [], le(), M.disabled = !0, P.style.display = "block", P.style.color = "var(--msr-danger-text, #dc2626)", P.textContent = e instanceof Error ? e.message : "Could not inspect export support.");
|
|
18508
|
+
}), t.requestAnimationFrame(me);
|
|
18503
18509
|
},
|
|
18504
|
-
dismiss:
|
|
18510
|
+
dismiss: ge,
|
|
18505
18511
|
dispose() {
|
|
18506
|
-
|
|
18512
|
+
ge(), t.removeEventListener("resize", Te), t.removeEventListener("pointermove", Se, !0), t.removeEventListener("pointerup", Ce, !0), t.removeEventListener("pointercancel", Ce, !0), e.removeEventListener("pointerdown", we, !0), o.remove();
|
|
18507
18513
|
}
|
|
18508
18514
|
};
|
|
18509
|
-
},
|
|
18515
|
+
}, vb = "mesurer.recording", yb = "recording:v1", bb = "mesurer.recording.settings", xb = "runtime:solid", Sb = "recording.toggle", Cb = "recording.stop", wb = "recording.discard", Tb = "recording.export", Eb = 60, Db = 60, Ob = 3e3, kb = {
|
|
18510
18516
|
viewBox: "0 0 24 24",
|
|
18511
18517
|
paths: ["M7 5.75A3.25 3.25 0 0 0 3.75 9v6A3.25 3.25 0 0 0 7 18.25h7A3.25 3.25 0 0 0 17.25 15v-1.03l2.13 1.42a.75.75 0 0 0 1.17-.624V9.234a.75.75 0 0 0-1.17-.624l-2.13 1.42V9A3.25 3.25 0 0 0 14 5.75H7Zm10.25 6.082 1.8-1.2v2.736l-1.8-1.2v-.336Z", "M10.5 9.25a2.75 2.75 0 1 0 0 5.5 2.75 2.75 0 0 0 0-5.5Z"]
|
|
18512
|
-
},
|
|
18518
|
+
}, Ab = (e) => e ? { ...e } : null, jb = (e) => ({
|
|
18513
18519
|
...e,
|
|
18514
|
-
rect:
|
|
18515
|
-
}),
|
|
18520
|
+
rect: Ab(e.rect)
|
|
18521
|
+
}), Mb = (e, t) => {
|
|
18516
18522
|
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
18517
|
-
},
|
|
18518
|
-
if (!
|
|
18523
|
+
}, Nb = (e) => e != null && !Array.isArray(e) && typeof e == "object", Pb = (e) => typeof e == "number" && Number.isFinite(e), Fb = (e) => {
|
|
18524
|
+
if (!Nb(e)) return {};
|
|
18519
18525
|
let t = {};
|
|
18520
|
-
return (e.format === "webm" || e.format === "mp4") && (t.format = e.format),
|
|
18521
|
-
},
|
|
18526
|
+
return (e.format === "webm" || e.format === "mp4") && (t.format = e.format), Pb(e.startTime) && (t.startTime = e.startTime), Pb(e.endTime) && (t.endTime = e.endTime), (e.scale === 1 || e.scale === 2 || e.scale === 3) && (t.scale = e.scale), t;
|
|
18527
|
+
}, Ib = (e) => ({
|
|
18522
18528
|
status: e.status,
|
|
18523
18529
|
elapsed: e.elapsed,
|
|
18524
18530
|
rect: e.rect ? { ...e.rect } : null,
|
|
@@ -18526,71 +18532,71 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18526
18532
|
width: e.width,
|
|
18527
18533
|
height: e.height,
|
|
18528
18534
|
error: e.error
|
|
18529
|
-
}),
|
|
18535
|
+
}), Lb = (e) => ({
|
|
18530
18536
|
filename: e.filename,
|
|
18531
18537
|
format: e.format,
|
|
18532
18538
|
duration: e.duration,
|
|
18533
18539
|
width: e.width,
|
|
18534
18540
|
height: e.height,
|
|
18535
18541
|
bytes: e.blob.size
|
|
18536
|
-
}),
|
|
18542
|
+
}), Rb = (e) => ({
|
|
18537
18543
|
format: e.format,
|
|
18538
18544
|
duration: e.duration,
|
|
18539
18545
|
width: e.width,
|
|
18540
18546
|
height: e.height,
|
|
18541
18547
|
bytes: e.blob.size,
|
|
18542
18548
|
createdAt: e.createdAt
|
|
18543
|
-
}),
|
|
18549
|
+
}), zb = (e, t, n) => {
|
|
18544
18550
|
let r = globalThis.URL.createObjectURL(e.blob), i = t.createElement("a");
|
|
18545
18551
|
i.href = r, i.download = e.filename, i.rel = "noopener", t.documentElement.append(i), i.click(), i.remove(), n.setTimeout(() => globalThis.URL.revokeObjectURL(r), 1e3);
|
|
18546
|
-
},
|
|
18547
|
-
id:
|
|
18552
|
+
}, Bb = (e = {}) => Ta({
|
|
18553
|
+
id: vb,
|
|
18548
18554
|
version: "0.1.0",
|
|
18549
|
-
requires: [
|
|
18550
|
-
provides: ["tool:recording",
|
|
18555
|
+
requires: [xb],
|
|
18556
|
+
provides: ["tool:recording", yb],
|
|
18551
18557
|
setup(t) {
|
|
18552
|
-
let n = t.service.get(
|
|
18558
|
+
let n = t.service.get(xb);
|
|
18553
18559
|
if (!n) throw Error("Recording plugin requires the Solid renderer runtime.");
|
|
18554
18560
|
let { ownerDocument: r, ownerWindow: i } = n, a = n.createInspectorMount(), o = a.element, s = n.createInspectorMount(), c = s.element, l = n.rendererRoot ?? n.portalTarget.querySelector("[data-mesurer-root='true']"), u = (e) => {
|
|
18555
18561
|
l?.toggleAttribute("data-mesurer-recording-active", e);
|
|
18556
18562
|
let t = l?.querySelector("[data-mesurer-interaction-overlay='true']");
|
|
18557
18563
|
t && (e ? (t.style.setProperty("pointer-events", "none", "important"), t.style.setProperty("cursor", "default", "important")) : (t.style.removeProperty("pointer-events"), t.style.removeProperty("cursor")));
|
|
18558
18564
|
};
|
|
18559
|
-
o.dataset.mesurerRecording = "true", c.dataset.mesurerRecordingStatusRoot = "true",
|
|
18565
|
+
o.dataset.mesurerRecording = "true", c.dataset.mesurerRecordingStatusRoot = "true", Mb(o, {
|
|
18560
18566
|
position: "fixed",
|
|
18561
18567
|
inset: "0",
|
|
18562
18568
|
"z-index": "86",
|
|
18563
18569
|
"pointer-events": "none",
|
|
18564
18570
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
18565
|
-
}),
|
|
18571
|
+
}), Mb(c, {
|
|
18566
18572
|
position: "fixed",
|
|
18567
18573
|
inset: "0",
|
|
18568
18574
|
"z-index": "96",
|
|
18569
18575
|
"pointer-events": "none",
|
|
18570
18576
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
18571
18577
|
});
|
|
18572
|
-
let d = Math.max(1, Math.min(600, e.maxDurationSeconds ??
|
|
18578
|
+
let d = Math.max(1, Math.min(600, e.maxDurationSeconds ?? Db)), f = e.quality ?? "medium";
|
|
18573
18579
|
t.state.register({
|
|
18574
|
-
id:
|
|
18580
|
+
id: bb,
|
|
18575
18581
|
initial: {
|
|
18576
18582
|
toolEnabled: e.toolEnabled ?? !0,
|
|
18577
|
-
frameRate: e.frameRate ??
|
|
18583
|
+
frameRate: e.frameRate ?? Eb
|
|
18578
18584
|
},
|
|
18579
18585
|
persist: !0
|
|
18580
18586
|
});
|
|
18581
18587
|
let p = () => {
|
|
18582
|
-
let e = t.state.get(
|
|
18588
|
+
let e = t.state.get(bb);
|
|
18583
18589
|
return {
|
|
18584
18590
|
toolEnabled: e?.toolEnabled ?? !0,
|
|
18585
18591
|
frameRate: e?.frameRate === 120 ? 120 : 60
|
|
18586
18592
|
};
|
|
18587
18593
|
}, m = (e) => {
|
|
18588
|
-
t.state.update(
|
|
18594
|
+
t.state.update(bb, (t) => {
|
|
18589
18595
|
let n = { ...t };
|
|
18590
18596
|
return e.toolEnabled !== void 0 && (n.toolEnabled = e.toolEnabled), (e.frameRate === 60 || e.frameRate === 120) && (n.frameRate = e.frameRate), n;
|
|
18591
18597
|
});
|
|
18592
18598
|
}, h = r.createElement("div");
|
|
18593
|
-
h.dataset.mesurerRecordingSelect = "true", h.dataset.mesurerInspectorUi = "true", h.setAttribute("role", "application"), h.setAttribute("aria-label", "Recording selection"),
|
|
18599
|
+
h.dataset.mesurerRecordingSelect = "true", h.dataset.mesurerInspectorUi = "true", h.setAttribute("role", "application"), h.setAttribute("aria-label", "Recording selection"), Mb(h, {
|
|
18594
18600
|
position: "fixed",
|
|
18595
18601
|
inset: "0",
|
|
18596
18602
|
display: "none",
|
|
@@ -18602,13 +18608,13 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18602
18608
|
}), o.append(h);
|
|
18603
18609
|
let g = Array.from({ length: 4 }, () => {
|
|
18604
18610
|
let e = r.createElement("div");
|
|
18605
|
-
return e.dataset.mesurerRecordingShade = "true",
|
|
18611
|
+
return e.dataset.mesurerRecordingShade = "true", Mb(e, {
|
|
18606
18612
|
position: "fixed",
|
|
18607
18613
|
background: "rgb(0 0 0 / 40%)",
|
|
18608
18614
|
"pointer-events": "none"
|
|
18609
18615
|
}), h.append(e), e;
|
|
18610
18616
|
}), _ = r.createElement("div");
|
|
18611
|
-
_.dataset.mesurerRecordingMask = "true",
|
|
18617
|
+
_.dataset.mesurerRecordingMask = "true", Mb(_, {
|
|
18612
18618
|
position: "fixed",
|
|
18613
18619
|
display: "none",
|
|
18614
18620
|
background: "transparent",
|
|
@@ -18616,7 +18622,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18616
18622
|
"pointer-events": "none"
|
|
18617
18623
|
}), h.append(_);
|
|
18618
18624
|
let v = r.createElement("div");
|
|
18619
|
-
v.dataset.mesurerRecordingSelection = "true",
|
|
18625
|
+
v.dataset.mesurerRecordingSelection = "true", Mb(v, {
|
|
18620
18626
|
position: "fixed",
|
|
18621
18627
|
display: "none",
|
|
18622
18628
|
border: "1px solid var(--msr-accent, #0d99ff)",
|
|
@@ -18624,7 +18630,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18624
18630
|
"pointer-events": "none"
|
|
18625
18631
|
}), h.append(v);
|
|
18626
18632
|
let y = r.createElement("div");
|
|
18627
|
-
|
|
18633
|
+
Mb(y, {
|
|
18628
18634
|
position: "fixed",
|
|
18629
18635
|
display: "none",
|
|
18630
18636
|
transform: "translateX(-50%)",
|
|
@@ -18637,7 +18643,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18637
18643
|
"pointer-events": "none"
|
|
18638
18644
|
}), h.append(y);
|
|
18639
18645
|
let b = r.createElement("div");
|
|
18640
|
-
b.textContent = "Drag a region to record · Esc to cancel",
|
|
18646
|
+
b.textContent = "Drag a region to record · Esc to cancel", Mb(b, {
|
|
18641
18647
|
position: "fixed",
|
|
18642
18648
|
left: "50%",
|
|
18643
18649
|
bottom: "16px",
|
|
@@ -18650,7 +18656,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18650
18656
|
"pointer-events": "none"
|
|
18651
18657
|
}), h.append(b);
|
|
18652
18658
|
let x = r.createElement("div");
|
|
18653
|
-
x.dataset.mesurerRecordingRegion = "true", x.dataset.mesurerInspectorUi = "true", x.setAttribute("role", "dialog"), x.setAttribute("aria-label", "Recording region"),
|
|
18659
|
+
x.dataset.mesurerRecordingRegion = "true", x.dataset.mesurerInspectorUi = "true", x.setAttribute("role", "dialog"), x.setAttribute("aria-label", "Recording region"), Mb(x, {
|
|
18654
18660
|
position: "fixed",
|
|
18655
18661
|
display: "none",
|
|
18656
18662
|
width: "220px",
|
|
@@ -18668,7 +18674,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18668
18674
|
}), h.append(x);
|
|
18669
18675
|
let S = (e) => {
|
|
18670
18676
|
let t = r.createElement("label");
|
|
18671
|
-
|
|
18677
|
+
Mb(t, {
|
|
18672
18678
|
display: "grid",
|
|
18673
18679
|
"grid-template-columns": "44px minmax(0,1fr)",
|
|
18674
18680
|
"align-items": "center",
|
|
@@ -18677,7 +18683,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18677
18683
|
let n = r.createElement("span");
|
|
18678
18684
|
n.textContent = e, n.style.color = "var(--msr-color-ink-500, #64748b)", t.append(n);
|
|
18679
18685
|
let i = r.createElement("div");
|
|
18680
|
-
return
|
|
18686
|
+
return Mb(i, {
|
|
18681
18687
|
display: "flex",
|
|
18682
18688
|
"align-items": "center",
|
|
18683
18689
|
gap: "4px",
|
|
@@ -18685,7 +18691,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18685
18691
|
}), t.append(i), x.append(t), i;
|
|
18686
18692
|
}, C = (e) => {
|
|
18687
18693
|
let t = r.createElement("input");
|
|
18688
|
-
return t.type = "number", t.setAttribute("aria-label", e), t.step = "1",
|
|
18694
|
+
return t.type = "number", t.setAttribute("aria-label", e), t.step = "1", Mb(t, {
|
|
18689
18695
|
width: "0",
|
|
18690
18696
|
"min-width": "0",
|
|
18691
18697
|
flex: "1 1 0",
|
|
@@ -18712,7 +18718,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18712
18718
|
let M = r.createElement("span");
|
|
18713
18719
|
M.textContent = "px", M.style.color = "var(--msr-color-ink-500, #64748b)", k.append(M);
|
|
18714
18720
|
let N = r.createElement("button");
|
|
18715
|
-
N.type = "button", N.dataset.mesurerRecordingStart = "true", N.textContent = "● Start recording",
|
|
18721
|
+
N.type = "button", N.dataset.mesurerRecordingStart = "true", N.textContent = "● Start recording", Mb(N, {
|
|
18716
18722
|
width: "100%",
|
|
18717
18723
|
height: "28px",
|
|
18718
18724
|
"margin-top": "8px",
|
|
@@ -18726,7 +18732,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18726
18732
|
cursor: "pointer"
|
|
18727
18733
|
}), x.append(N);
|
|
18728
18734
|
let P = r.createElement("div");
|
|
18729
|
-
P.dataset.mesurerRecordingGrid = "true",
|
|
18735
|
+
P.dataset.mesurerRecordingGrid = "true", Mb(P, {
|
|
18730
18736
|
position: "absolute",
|
|
18731
18737
|
inset: "0",
|
|
18732
18738
|
display: "none",
|
|
@@ -18734,7 +18740,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18734
18740
|
}), v.append(P);
|
|
18735
18741
|
let F = (e) => {
|
|
18736
18742
|
let t = r.createElement("div");
|
|
18737
|
-
|
|
18743
|
+
Mb(t, {
|
|
18738
18744
|
position: "absolute",
|
|
18739
18745
|
opacity: "0.3",
|
|
18740
18746
|
...e
|
|
@@ -18796,7 +18802,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18796
18802
|
}
|
|
18797
18803
|
}).map(([e, t]) => {
|
|
18798
18804
|
let n = r.createElement("button");
|
|
18799
|
-
return n.type = "button", n.dataset.mesurerRecordingResize = e, n.setAttribute("aria-label", `Resize ${e}`),
|
|
18805
|
+
return n.type = "button", n.dataset.mesurerRecordingResize = e, n.setAttribute("aria-label", `Resize ${e}`), Mb(n, {
|
|
18800
18806
|
position: "absolute",
|
|
18801
18807
|
display: "none",
|
|
18802
18808
|
left: t.left,
|
|
@@ -18813,7 +18819,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18813
18819
|
"pointer-events": "auto"
|
|
18814
18820
|
}), v.append(n), n;
|
|
18815
18821
|
}), L = r.createElement("section");
|
|
18816
|
-
L.dataset.mesurerRecordingStatus = "true", L.dataset.mesurerInspectorUi = "true", L.setAttribute("aria-label", "Screen recording"),
|
|
18822
|
+
L.dataset.mesurerRecordingStatus = "true", L.dataset.mesurerInspectorUi = "true", L.setAttribute("aria-label", "Screen recording"), Mb(L, {
|
|
18817
18823
|
position: "fixed",
|
|
18818
18824
|
display: "none",
|
|
18819
18825
|
height: "34px",
|
|
@@ -18830,7 +18836,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18830
18836
|
"pointer-events": "auto"
|
|
18831
18837
|
});
|
|
18832
18838
|
let R = r.createElement("span");
|
|
18833
|
-
R.setAttribute("aria-hidden", "true"),
|
|
18839
|
+
R.setAttribute("aria-hidden", "true"), Mb(R, {
|
|
18834
18840
|
width: "6px",
|
|
18835
18841
|
height: "6px",
|
|
18836
18842
|
"border-radius": "999px",
|
|
@@ -18838,14 +18844,14 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18838
18844
|
"flex-shrink": "0"
|
|
18839
18845
|
}), L.append(R);
|
|
18840
18846
|
let z = r.createElement("span");
|
|
18841
|
-
z.dataset.mesurerRecordingTime = "true", z.textContent = "00:00",
|
|
18847
|
+
z.dataset.mesurerRecordingTime = "true", z.textContent = "00:00", Mb(z, {
|
|
18842
18848
|
color: "var(--msr-content, #18181b)",
|
|
18843
18849
|
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
18844
18850
|
"font-size": "11px",
|
|
18845
18851
|
"font-variant-numeric": "tabular-nums"
|
|
18846
18852
|
}), L.append(z);
|
|
18847
18853
|
let B = r.createElement("button");
|
|
18848
|
-
B.type = "button", B.dataset.mesurerRecordingStop = "true", B.textContent = "Stop", B.setAttribute("aria-label", "Stop recording"),
|
|
18854
|
+
B.type = "button", B.dataset.mesurerRecordingStop = "true", B.textContent = "Stop", B.setAttribute("aria-label", "Stop recording"), Mb(B, {
|
|
18849
18855
|
height: "24px",
|
|
18850
18856
|
padding: "0 8px",
|
|
18851
18857
|
border: "0",
|
|
@@ -18858,7 +18864,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18858
18864
|
cursor: "pointer"
|
|
18859
18865
|
}), L.append(B), c.append(L);
|
|
18860
18866
|
let V = r.createElement("div");
|
|
18861
|
-
V.dataset.mesurerRecordingError = "true", V.dataset.mesurerInspectorUi = "true", V.setAttribute("role", "status"),
|
|
18867
|
+
V.dataset.mesurerRecordingError = "true", V.dataset.mesurerInspectorUi = "true", V.setAttribute("role", "status"), Mb(V, {
|
|
18862
18868
|
position: "fixed",
|
|
18863
18869
|
display: "none",
|
|
18864
18870
|
left: "8px",
|
|
@@ -18879,14 +18885,14 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18879
18885
|
width: null,
|
|
18880
18886
|
height: null,
|
|
18881
18887
|
error: null
|
|
18882
|
-
}, U = /* @__PURE__ */ new Set(),
|
|
18883
|
-
let e =
|
|
18888
|
+
}, U = /* @__PURE__ */ new Set(), W = null, ee = null, te = null, G = null, ne = null, re = null, ie = !1, ae = null, oe = null, se = 0, ce = 0, K = 0, le = 0, ue = 0, de = -1, fe = !1, pe = null, me = () => {
|
|
18889
|
+
let e = jb(H);
|
|
18884
18890
|
for (let t of U) t(e);
|
|
18885
18891
|
}, he = (e) => {
|
|
18886
18892
|
H = {
|
|
18887
18893
|
...H,
|
|
18888
18894
|
...e,
|
|
18889
|
-
rect: e.rect === void 0 ? H.rect :
|
|
18895
|
+
rect: e.rect === void 0 ? H.rect : Ab(e.rect)
|
|
18890
18896
|
}, me();
|
|
18891
18897
|
}, ge = () => H.status === "selecting" || H.status === "recording" || H.status === "exporting", _e = () => {
|
|
18892
18898
|
if (oe) return;
|
|
@@ -18958,7 +18964,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18958
18964
|
top: e.top + e.height,
|
|
18959
18965
|
width: t,
|
|
18960
18966
|
height: Math.max(0, n - e.top - e.height)
|
|
18961
|
-
}), v.style.display = "block", ye(v, e),
|
|
18967
|
+
}), v.style.display = "block", ye(v, e), ie) {
|
|
18962
18968
|
v.style.pointerEvents = "auto", v.style.cursor = "move", P.style.display = "block";
|
|
18963
18969
|
for (let e of I) e.style.display = "block";
|
|
18964
18970
|
y.style.display = "none", T.value = String(Math.round(e.width)), E.value = String(Math.round(e.height)), A.value = String(Math.round(e.left)), j.value = String(Math.round(e.top)), T.max = String(t), E.max = String(n), A.max = String(Math.max(0, t - e.width)), j.max = String(Math.max(0, n - e.height));
|
|
@@ -18974,7 +18980,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18974
18980
|
}
|
|
18975
18981
|
}, Ce = (e) => {
|
|
18976
18982
|
let t = be(e);
|
|
18977
|
-
|
|
18983
|
+
re = t, he({ rect: t }), Se(t);
|
|
18978
18984
|
}, we = (e) => {
|
|
18979
18985
|
for (let e of g) ye(e, {
|
|
18980
18986
|
left: 0,
|
|
@@ -18988,7 +18994,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18988
18994
|
}, Te = () => {
|
|
18989
18995
|
u(!1), _.style.display = "none", h.style.display = "none", h.style.pointerEvents = "auto", h.style.cursor = "crosshair", b.style.removeProperty("display");
|
|
18990
18996
|
}, Ee = () => {
|
|
18991
|
-
|
|
18997
|
+
ne = null, re = null, ie = !1, ae = null, Se(null), h.style.display = "none", h.style.cursor = "crosshair", o.style.pointerEvents = "none";
|
|
18992
18998
|
}, De = (e) => {
|
|
18993
18999
|
let t = i.innerHeight, n = i.innerWidth;
|
|
18994
19000
|
L.style.visibility = "hidden", L.style.display = "flex";
|
|
@@ -19005,19 +19011,19 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19005
19011
|
let t = e instanceof Error ? e.message : "Could not record this region.";
|
|
19006
19012
|
V.textContent = t, V.style.display = "block", K = i.setTimeout(() => {
|
|
19007
19013
|
K = 0, V.style.display = "none";
|
|
19008
|
-
},
|
|
19014
|
+
}, Ob);
|
|
19009
19015
|
}, Ae = async (e) => {
|
|
19010
19016
|
se && i.cancelAnimationFrame(se), se = 0, ce && i.clearTimeout(ce), ce = 0;
|
|
19011
|
-
let t =
|
|
19012
|
-
if (
|
|
19017
|
+
let t = G;
|
|
19018
|
+
if (G = null, t) try {
|
|
19013
19019
|
await t;
|
|
19014
19020
|
} catch {}
|
|
19015
|
-
let n =
|
|
19016
|
-
|
|
19017
|
-
let r =
|
|
19018
|
-
|
|
19021
|
+
let n = te;
|
|
19022
|
+
te = null, e && await n?.cancel();
|
|
19023
|
+
let r = ee;
|
|
19024
|
+
ee = null, r && Uy(r), Te(), Oe();
|
|
19019
19025
|
}, je = () => {
|
|
19020
|
-
|
|
19026
|
+
W = null, Pe.dismiss(), he({
|
|
19021
19027
|
status: "idle",
|
|
19022
19028
|
elapsed: 0,
|
|
19023
19029
|
rect: null,
|
|
@@ -19027,10 +19033,10 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19027
19033
|
error: null
|
|
19028
19034
|
}), t.hook.emit("recording:discard", {});
|
|
19029
19035
|
}, Me = async () => {
|
|
19030
|
-
let e =
|
|
19036
|
+
let e = W;
|
|
19031
19037
|
return $y(e?.width ?? Math.max(2, Math.round(i.innerWidth)), e?.height ?? Math.max(2, Math.round(i.innerHeight)), p().frameRate);
|
|
19032
19038
|
}, Ne = async (e = {}) => {
|
|
19033
|
-
let n =
|
|
19039
|
+
let n = W;
|
|
19034
19040
|
if (!n) throw Error("No recording is ready to export.");
|
|
19035
19041
|
let r = H.status;
|
|
19036
19042
|
he({
|
|
@@ -19062,7 +19068,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19062
19068
|
error: e instanceof Error ? e.message : "Could not export the recording."
|
|
19063
19069
|
}), e;
|
|
19064
19070
|
}
|
|
19065
|
-
}, Pe =
|
|
19071
|
+
}, Pe = _b({
|
|
19066
19072
|
ownerDocument: r,
|
|
19067
19073
|
ownerWindow: i,
|
|
19068
19074
|
root: o,
|
|
@@ -19071,15 +19077,15 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19071
19077
|
onExport: Ne
|
|
19072
19078
|
}), Fe = async () => {
|
|
19073
19079
|
if (pe) return pe;
|
|
19074
|
-
if (H.status !== "recording" || !
|
|
19075
|
-
let e = le, n =
|
|
19080
|
+
if (H.status !== "recording" || !te || !ee) throw Error("No recording is active.");
|
|
19081
|
+
let e = le, n = te, r = ee, a = Ab(H.rect);
|
|
19076
19082
|
if (!a) throw Error("Recording region is unavailable.");
|
|
19077
19083
|
return pe = (async () => {
|
|
19078
19084
|
se && i.cancelAnimationFrame(se), se = 0, ce && i.clearTimeout(ce), ce = 0;
|
|
19079
|
-
let s =
|
|
19080
|
-
|
|
19085
|
+
let s = G;
|
|
19086
|
+
G = null, s && await s;
|
|
19081
19087
|
let c = await n.finalize();
|
|
19082
|
-
if (
|
|
19088
|
+
if (te = null, ee = null, Uy(r), le !== e || fe) throw Error("Recording was cancelled.");
|
|
19083
19089
|
let l = await nb(c), u = {
|
|
19084
19090
|
blob: c,
|
|
19085
19091
|
format: "webm",
|
|
@@ -19088,7 +19094,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19088
19094
|
height: l.height,
|
|
19089
19095
|
createdAt: Date.now()
|
|
19090
19096
|
};
|
|
19091
|
-
return
|
|
19097
|
+
return W = u, Te(), Oe(), ve(), o.style.pointerEvents = "none", he({
|
|
19092
19098
|
status: "ready",
|
|
19093
19099
|
elapsed: l.duration,
|
|
19094
19100
|
duration: l.duration,
|
|
@@ -19116,16 +19122,16 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19116
19122
|
}), pe;
|
|
19117
19123
|
}, Ie = (e, t, n, r) => {
|
|
19118
19124
|
let a = 1 / r, o = (r) => {
|
|
19119
|
-
if (fe || le !== n || H.status !== "recording" ||
|
|
19125
|
+
if (fe || le !== n || H.status !== "recording" || te !== t || ee !== e) return;
|
|
19120
19126
|
let s = Math.max(0, (r - ue) / 1e3);
|
|
19121
19127
|
he({ elapsed: s }), z.textContent = `${String(Math.floor(s / 60)).padStart(2, "0")}:${String(Math.floor(s % 60)).padStart(2, "0")}`;
|
|
19122
19128
|
let c = s;
|
|
19123
|
-
!
|
|
19129
|
+
!G && c - de >= a * .8 && (Hy(e, H.rect ?? {
|
|
19124
19130
|
left: 0,
|
|
19125
19131
|
top: 0,
|
|
19126
19132
|
width: i.innerWidth,
|
|
19127
19133
|
height: i.innerHeight
|
|
19128
|
-
}, Ty(i)), de = c,
|
|
19134
|
+
}, Ty(i)), de = c, G = t.addFrame(c, a).catch((e) => {
|
|
19129
19135
|
throw le === n && !fe && Ae(!0).then(() => {
|
|
19130
19136
|
ve();
|
|
19131
19137
|
let t = e instanceof Error ? e.message : "MediaBunny could not encode the recording.";
|
|
@@ -19135,13 +19141,13 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19135
19141
|
}), ke(e);
|
|
19136
19142
|
}), e;
|
|
19137
19143
|
}).finally(() => {
|
|
19138
|
-
|
|
19144
|
+
G = null;
|
|
19139
19145
|
})), se = i.requestAnimationFrame(o);
|
|
19140
19146
|
};
|
|
19141
19147
|
se = i.requestAnimationFrame(o);
|
|
19142
19148
|
}, Le = async (e) => {
|
|
19143
19149
|
let n = ++le, a = p().frameRate;
|
|
19144
|
-
Pe.dismiss(),
|
|
19150
|
+
Pe.dismiss(), W = null, ne = null, re = null, ie = !1, ae = null, we(e), o.style.pointerEvents = "none", u(!0), ve(), he({
|
|
19145
19151
|
status: "selecting",
|
|
19146
19152
|
elapsed: 0,
|
|
19147
19153
|
rect: e,
|
|
@@ -19165,7 +19171,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19165
19171
|
await c.cancel(), Uy(s);
|
|
19166
19172
|
return;
|
|
19167
19173
|
}
|
|
19168
|
-
if (
|
|
19174
|
+
if (ee = s, te = c, ue = i.performance.now(), de = 0, Hy(s, e, Ty(i)), await c.addFrame(0, 1 / a), fe || le !== n) {
|
|
19169
19175
|
await Ae(!0);
|
|
19170
19176
|
return;
|
|
19171
19177
|
}
|
|
@@ -19191,7 +19197,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19191
19197
|
}), r || ke(t), t;
|
|
19192
19198
|
}
|
|
19193
19199
|
}, Re = () => {
|
|
19194
|
-
H.status !== "selecting" && (++le, Pe.dismiss(),
|
|
19200
|
+
H.status !== "selecting" && (++le, Pe.dismiss(), W = null, re = null, ie = !1, ae = null, _e(), Se(null), h.style.display = "block", h.style.pointerEvents = "auto", b.style.removeProperty("display"), o.style.pointerEvents = "auto", he({
|
|
19195
19201
|
status: "selecting",
|
|
19196
19202
|
elapsed: 0,
|
|
19197
19203
|
rect: null,
|
|
@@ -19226,8 +19232,8 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19226
19232
|
error: null
|
|
19227
19233
|
});
|
|
19228
19234
|
}, Ve = (e, t, n) => {
|
|
19229
|
-
let r =
|
|
19230
|
-
!
|
|
19235
|
+
let r = re;
|
|
19236
|
+
!ie || !r || e.button !== 0 || (e.preventDefault(), e.stopPropagation(), ae = {
|
|
19231
19237
|
kind: t,
|
|
19232
19238
|
handle: n,
|
|
19233
19239
|
pointerId: e.pointerId,
|
|
@@ -19236,13 +19242,13 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19236
19242
|
rect: { ...r }
|
|
19237
19243
|
}, h.setPointerCapture?.(e.pointerId));
|
|
19238
19244
|
}, He = (e) => {
|
|
19239
|
-
H.status === "selecting" && e.button === 0 && (
|
|
19245
|
+
H.status === "selecting" && e.button === 0 && (ie && re && xe(re, {
|
|
19240
19246
|
x: e.clientX,
|
|
19241
19247
|
y: e.clientY
|
|
19242
|
-
}) || (e.preventDefault(), e.stopPropagation(),
|
|
19248
|
+
}) || (e.preventDefault(), e.stopPropagation(), ie = !1, re = null, he({ rect: null }), h.style.cursor = "crosshair", ne = {
|
|
19243
19249
|
x: e.clientX,
|
|
19244
19250
|
y: e.clientY
|
|
19245
|
-
}, Se(qa(
|
|
19251
|
+
}, Se(qa(ne, ne, {
|
|
19246
19252
|
width: i.innerWidth,
|
|
19247
19253
|
height: i.innerHeight
|
|
19248
19254
|
})), h.setPointerCapture?.(e.pointerId)));
|
|
@@ -19267,7 +19273,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19267
19273
|
});
|
|
19268
19274
|
return;
|
|
19269
19275
|
}
|
|
19270
|
-
|
|
19276
|
+
ne && Se(qa(ne, {
|
|
19271
19277
|
x: e.clientX,
|
|
19272
19278
|
y: e.clientY
|
|
19273
19279
|
}, {
|
|
@@ -19277,11 +19283,11 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19277
19283
|
}
|
|
19278
19284
|
}, We = (e) => {
|
|
19279
19285
|
if (ae) {
|
|
19280
|
-
ae = null, h.hasPointerCapture?.(e.pointerId) && h.releasePointerCapture(e.pointerId),
|
|
19286
|
+
ae = null, h.hasPointerCapture?.(e.pointerId) && h.releasePointerCapture(e.pointerId), re && Se(re);
|
|
19281
19287
|
return;
|
|
19282
19288
|
}
|
|
19283
|
-
let t =
|
|
19284
|
-
if (
|
|
19289
|
+
let t = ne;
|
|
19290
|
+
if (ne = null, H.status !== "selecting" || !t) return;
|
|
19285
19291
|
h.hasPointerCapture?.(e.pointerId) && h.releasePointerCapture(e.pointerId);
|
|
19286
19292
|
let n = qa(t, {
|
|
19287
19293
|
x: e.clientX,
|
|
@@ -19291,15 +19297,15 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19291
19297
|
height: i.innerHeight
|
|
19292
19298
|
});
|
|
19293
19299
|
if (n.width < 4 || n.height < 4) {
|
|
19294
|
-
|
|
19300
|
+
re = null, ie = !1, he({ rect: null }), Se(null);
|
|
19295
19301
|
return;
|
|
19296
19302
|
}
|
|
19297
|
-
|
|
19303
|
+
re = be(n), ie = !0, h.style.cursor = "default", he({ rect: re }), Se(re);
|
|
19298
19304
|
}, Ge = (e) => {
|
|
19299
|
-
|
|
19305
|
+
ne = null, ae = null, h.hasPointerCapture?.(e.pointerId) && h.releasePointerCapture(e.pointerId), Se(re && ie ? re : null);
|
|
19300
19306
|
}, Ke = (e) => {
|
|
19301
|
-
if (e.key === "Enter" && H.status === "selecting" &&
|
|
19302
|
-
e.preventDefault(), e.stopImmediatePropagation(), Le(
|
|
19307
|
+
if (e.key === "Enter" && H.status === "selecting" && ie && re) {
|
|
19308
|
+
e.preventDefault(), e.stopImmediatePropagation(), Le(re).catch(() => void 0);
|
|
19303
19309
|
return;
|
|
19304
19310
|
}
|
|
19305
19311
|
if (e.key === "Escape") {
|
|
@@ -19323,14 +19329,14 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19323
19329
|
e.stopPropagation();
|
|
19324
19330
|
});
|
|
19325
19331
|
let qe = (e, t) => {
|
|
19326
|
-
let n =
|
|
19332
|
+
let n = re, r = Number(e.value);
|
|
19327
19333
|
!n || !Number.isFinite(r) || Ce({
|
|
19328
19334
|
...n,
|
|
19329
19335
|
[t]: r
|
|
19330
19336
|
});
|
|
19331
19337
|
};
|
|
19332
19338
|
T.addEventListener("change", () => qe(T, "width")), E.addEventListener("change", () => qe(E, "height")), A.addEventListener("change", () => qe(A, "left")), j.addEventListener("change", () => qe(j, "top")), N.addEventListener("click", () => {
|
|
19333
|
-
H.status === "selecting" &&
|
|
19339
|
+
H.status === "selecting" && ie && re && Le(re).catch(() => void 0);
|
|
19334
19340
|
}), B.addEventListener("click", () => {
|
|
19335
19341
|
if (H.status === "recording") {
|
|
19336
19342
|
Fe().catch(() => void 0);
|
|
@@ -19339,7 +19345,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19339
19345
|
H.status === "selecting" && L.style.display !== "none" && Be().catch(() => void 0);
|
|
19340
19346
|
});
|
|
19341
19347
|
let Je = {
|
|
19342
|
-
snapshot: () =>
|
|
19348
|
+
snapshot: () => jb(H),
|
|
19343
19349
|
subscribe(e) {
|
|
19344
19350
|
return U.add(e), () => U.delete(e);
|
|
19345
19351
|
},
|
|
@@ -19357,10 +19363,10 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19357
19363
|
label: "Record",
|
|
19358
19364
|
shortcut: "Shift+R",
|
|
19359
19365
|
order: 72,
|
|
19360
|
-
command:
|
|
19366
|
+
command: Sb,
|
|
19361
19367
|
toolbarMode: "select",
|
|
19362
19368
|
compactPinned: !0,
|
|
19363
|
-
icon:
|
|
19369
|
+
icon: kb,
|
|
19364
19370
|
active: ge,
|
|
19365
19371
|
hidden: () => !p().toolEnabled,
|
|
19366
19372
|
menu: {
|
|
@@ -19381,7 +19387,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19381
19387
|
{
|
|
19382
19388
|
id: "discard",
|
|
19383
19389
|
label: "Discard clip",
|
|
19384
|
-
disabled: () =>
|
|
19390
|
+
disabled: () => W === null,
|
|
19385
19391
|
run: je
|
|
19386
19392
|
}
|
|
19387
19393
|
]
|
|
@@ -19410,21 +19416,21 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19410
19416
|
m({ frameRate: e ? 120 : 60 });
|
|
19411
19417
|
}
|
|
19412
19418
|
}]
|
|
19413
|
-
}), t.command.register(
|
|
19414
|
-
let t = await Ne(
|
|
19415
|
-
return
|
|
19416
|
-
}), t.service.provide(
|
|
19419
|
+
}), t.command.register(Sb, async () => (await ze(), Ib(H))), t.command.register(Cb, async () => Rb(await Fe())), t.command.register(wb, () => (je(), Ib(H))), t.command.register(Tb, async (e) => {
|
|
19420
|
+
let t = await Ne(Fb(e));
|
|
19421
|
+
return zb(t, r, i), Lb(t);
|
|
19422
|
+
}), t.service.provide(yb, Je), t.lifecycle.onDispose(() => {
|
|
19417
19423
|
fe = !0, ++le, U.clear(), h.removeEventListener("pointerdown", He), h.removeEventListener("pointermove", Ue), h.removeEventListener("pointerup", We), h.removeEventListener("pointercancel", Ge), i.removeEventListener("keydown", Ke, !0), K && i.clearTimeout(K), Pe.dispose(), Ee(), ve(), Ae(!0), s.dispose(), a.dispose();
|
|
19418
19424
|
});
|
|
19419
19425
|
}
|
|
19420
|
-
}),
|
|
19426
|
+
}), Vb = 144, Hb = 96, Ub = 8, Wb = 4, Gb = 1800, Kb = (e, t) => {
|
|
19421
19427
|
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
19422
|
-
},
|
|
19423
|
-
left: Math.min(Math.max(
|
|
19424
|
-
top: Math.min(Math.max(
|
|
19425
|
-
}),
|
|
19428
|
+
}, qb = (e, t) => ({
|
|
19429
|
+
left: Math.min(Math.max(Ub, e.left), Math.max(Ub, t.innerWidth - Vb - Ub)),
|
|
19430
|
+
top: Math.min(Math.max(Ub, e.top), Math.max(Ub, t.innerHeight - Hb - Ub))
|
|
19431
|
+
}), Jb = (e, t) => {
|
|
19426
19432
|
let n = e.createElement("button");
|
|
19427
|
-
return n.type = "button", n.textContent = t,
|
|
19433
|
+
return n.type = "button", n.textContent = t, Kb(n, {
|
|
19428
19434
|
height: "32px",
|
|
19429
19435
|
padding: "0 12px",
|
|
19430
19436
|
border: "1px solid rgb(255 255 255 / 18%)",
|
|
@@ -19436,11 +19442,11 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19436
19442
|
"font-weight": "500",
|
|
19437
19443
|
cursor: "pointer"
|
|
19438
19444
|
}), n;
|
|
19439
|
-
},
|
|
19445
|
+
}, Yb = ({ copied: e, downloaded: t, copyFailed: n, downloadFailed: r }) => e && t ? "Copied and saved screenshot" : e && r ? "Copied screenshot · Save unavailable" : t && n ? "Saved screenshot · Copy unavailable" : e ? "Copied screenshot" : t ? "Saved screenshot" : n && r ? "Screenshot captured · Copy and save unavailable" : n ? "Screenshot captured · Copy unavailable" : r ? "Screenshot captured · Save unavailable" : "Screenshot captured", Xb = (e) => e !== null && (e.nodeType === 1 || e.nodeType === 11), Zb = ({ ownerDocument: e, ownerWindow: t, root: n, previewDurationMs: r }) => {
|
|
19440
19446
|
let i = n.closest("[data-mesurer-root='true']")?.parentNode ?? n.parentNode;
|
|
19441
|
-
if (!
|
|
19447
|
+
if (!Xb(i)) throw Error("Screenshot preview requires a mounted Mesurer host.");
|
|
19442
19448
|
let a = e.createElement("div");
|
|
19443
|
-
a.dataset.mesurerInspectorUi = "true", a.dataset.mesurerScreenshotInteractive = "true",
|
|
19449
|
+
a.dataset.mesurerInspectorUi = "true", a.dataset.mesurerScreenshotInteractive = "true", Kb(a, {
|
|
19444
19450
|
position: "fixed",
|
|
19445
19451
|
left: "0",
|
|
19446
19452
|
top: "0",
|
|
@@ -19452,12 +19458,12 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19452
19458
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
19453
19459
|
}), i.append(a);
|
|
19454
19460
|
let o = e.createElement("div");
|
|
19455
|
-
o.dataset.mesurerScreenshotPreview = "true", o.setAttribute("role", "button"), o.setAttribute("aria-label", "Open captured screenshot"), o.tabIndex = 0,
|
|
19461
|
+
o.dataset.mesurerScreenshotPreview = "true", o.setAttribute("role", "button"), o.setAttribute("aria-label", "Open captured screenshot"), o.tabIndex = 0, Kb(o, {
|
|
19456
19462
|
position: "fixed",
|
|
19457
19463
|
display: "none",
|
|
19458
19464
|
"z-index": "96",
|
|
19459
|
-
width: `${
|
|
19460
|
-
height: `${
|
|
19465
|
+
width: `${Vb}px`,
|
|
19466
|
+
height: `${Hb}px`,
|
|
19461
19467
|
"box-sizing": "border-box",
|
|
19462
19468
|
overflow: "hidden",
|
|
19463
19469
|
"border-radius": "10px",
|
|
@@ -19470,7 +19476,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19470
19476
|
"touch-action": "none"
|
|
19471
19477
|
});
|
|
19472
19478
|
let s = e.createElement("img");
|
|
19473
|
-
s.dataset.mesurerScreenshotPreviewImage = "true", s.alt = "Captured screenshot", s.draggable = !1, s.title = "Click to open · Right-click for browser image actions",
|
|
19479
|
+
s.dataset.mesurerScreenshotPreviewImage = "true", s.alt = "Captured screenshot", s.draggable = !1, s.title = "Click to open · Right-click for browser image actions", Kb(s, {
|
|
19474
19480
|
display: "block",
|
|
19475
19481
|
width: "100%",
|
|
19476
19482
|
height: "100%",
|
|
@@ -19478,7 +19484,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19478
19484
|
"background-color": "white"
|
|
19479
19485
|
}), o.append(s);
|
|
19480
19486
|
let c = e.createElement("button");
|
|
19481
|
-
c.dataset.mesurerScreenshotPreviewDismiss = "true", c.type = "button", c.setAttribute("aria-label", "Dismiss screenshot preview"), c.title = "Dismiss",
|
|
19487
|
+
c.dataset.mesurerScreenshotPreviewDismiss = "true", c.type = "button", c.setAttribute("aria-label", "Dismiss screenshot preview"), c.title = "Dismiss", Kb(c, {
|
|
19482
19488
|
position: "absolute",
|
|
19483
19489
|
top: "8px",
|
|
19484
19490
|
right: "8px",
|
|
@@ -19504,7 +19510,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19504
19510
|
let u = e.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
19505
19511
|
u.setAttribute("d", "m4 4 8 8M12 4l-8 8"), u.setAttribute("stroke", "currentColor"), u.setAttribute("stroke-width", "1.75"), u.setAttribute("stroke-linecap", "round"), l.append(u), c.append(l), o.append(c), a.append(o);
|
|
19506
19512
|
let d = e.createElement("div");
|
|
19507
|
-
d.dataset.mesurerScreenshotViewer = "true", d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "true"), d.setAttribute("aria-label", "Screenshot viewer"),
|
|
19513
|
+
d.dataset.mesurerScreenshotViewer = "true", d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "true"), d.setAttribute("aria-label", "Screenshot viewer"), Kb(d, {
|
|
19508
19514
|
position: "fixed",
|
|
19509
19515
|
inset: "0",
|
|
19510
19516
|
display: "none",
|
|
@@ -19518,7 +19524,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19518
19524
|
"pointer-events": "auto"
|
|
19519
19525
|
});
|
|
19520
19526
|
let f = e.createElement("img");
|
|
19521
|
-
f.dataset.mesurerScreenshotViewerImage = "true", f.alt = "Captured screenshot",
|
|
19527
|
+
f.dataset.mesurerScreenshotViewerImage = "true", f.alt = "Captured screenshot", Kb(f, {
|
|
19522
19528
|
display: "block",
|
|
19523
19529
|
"max-width": "calc(100vw - 96px)",
|
|
19524
19530
|
"max-height": "calc(100vh - 112px)",
|
|
@@ -19529,7 +19535,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19529
19535
|
"box-shadow": "0 8px 30px rgb(0 0 0 / 28%)"
|
|
19530
19536
|
}), d.append(f);
|
|
19531
19537
|
let p = e.createElement("div");
|
|
19532
|
-
p.dataset.mesurerScreenshotViewerControls = "true",
|
|
19538
|
+
p.dataset.mesurerScreenshotViewerControls = "true", Kb(p, {
|
|
19533
19539
|
position: "fixed",
|
|
19534
19540
|
top: "16px",
|
|
19535
19541
|
right: "16px",
|
|
@@ -19537,14 +19543,14 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19537
19543
|
gap: "8px",
|
|
19538
19544
|
"pointer-events": "auto"
|
|
19539
19545
|
});
|
|
19540
|
-
let m =
|
|
19546
|
+
let m = Jb(e, "Copy");
|
|
19541
19547
|
m.dataset.mesurerScreenshotViewerCopy = "true", m.setAttribute("aria-label", "Copy screenshot");
|
|
19542
|
-
let h =
|
|
19548
|
+
let h = Jb(e, "Save");
|
|
19543
19549
|
h.dataset.mesurerScreenshotViewerSave = "true", h.setAttribute("aria-label", "Save screenshot");
|
|
19544
|
-
let g =
|
|
19550
|
+
let g = Jb(e, "Close");
|
|
19545
19551
|
g.dataset.mesurerScreenshotViewerClose = "true", g.setAttribute("aria-label", "Close screenshot viewer"), p.append(m, h, g), d.append(p), a.append(d);
|
|
19546
19552
|
let _ = e.createElement("div");
|
|
19547
|
-
_.dataset.mesurerScreenshotToast = "true", _.setAttribute("role", "status"),
|
|
19553
|
+
_.dataset.mesurerScreenshotToast = "true", _.setAttribute("role", "status"), Kb(_, {
|
|
19548
19554
|
position: "fixed",
|
|
19549
19555
|
left: "50%",
|
|
19550
19556
|
bottom: "20px",
|
|
@@ -19566,18 +19572,18 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19566
19572
|
}, D = (e, n = !1) => {
|
|
19567
19573
|
E(), _.textContent = e, _.style.backgroundColor = n ? "#b42318" : "rgb(28 28 30 / 90%)", _.style.display = "block", C = t.setTimeout(() => {
|
|
19568
19574
|
C = 0, _.style.display = "none";
|
|
19569
|
-
},
|
|
19575
|
+
}, Gb);
|
|
19570
19576
|
}, O = () => {
|
|
19571
19577
|
d.style.display = "none";
|
|
19572
19578
|
}, k = () => {
|
|
19573
19579
|
y && globalThis.URL.revokeObjectURL(y), y = null, v = null, s.removeAttribute("src"), f.removeAttribute("src");
|
|
19574
19580
|
}, A = () => {
|
|
19575
19581
|
T(), O(), o.style.display = "none", k();
|
|
19576
|
-
}, j = () =>
|
|
19577
|
-
left: t.innerWidth -
|
|
19578
|
-
top: t.innerHeight -
|
|
19582
|
+
}, j = () => qb({
|
|
19583
|
+
left: t.innerWidth - Vb - Ub,
|
|
19584
|
+
top: t.innerHeight - Hb - Ub
|
|
19579
19585
|
}, t), M = (e) => {
|
|
19580
|
-
let n =
|
|
19586
|
+
let n = qb(e, t);
|
|
19581
19587
|
b = n, o.style.left = `${n.left}px`, o.style.top = `${n.top}px`;
|
|
19582
19588
|
}, N = () => {
|
|
19583
19589
|
!v || !y || (T(), d.style.display = "flex", g.focus());
|
|
@@ -19611,7 +19617,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19611
19617
|
let n = x;
|
|
19612
19618
|
if (!n) return;
|
|
19613
19619
|
let r = e - n.startX, i = t - n.startY;
|
|
19614
|
-
!n.moved && Math.hypot(r, i) >=
|
|
19620
|
+
!n.moved && Math.hypot(r, i) >= Wb && (n.moved = !0), n.moved && M({
|
|
19615
19621
|
left: n.left + r,
|
|
19616
19622
|
top: n.top + i
|
|
19617
19623
|
});
|
|
@@ -19628,52 +19634,52 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19628
19634
|
e.button === 0 && x?.pointerId === null && R();
|
|
19629
19635
|
}, U = (e) => {
|
|
19630
19636
|
e.pointerType !== "mouse" && e.button === 0 && I(e.clientX, e.clientY, e.pointerId) && (o.setPointerCapture?.(e.pointerId), e.preventDefault());
|
|
19631
|
-
},
|
|
19637
|
+
}, W = (e) => {
|
|
19632
19638
|
let t = x?.pointerId;
|
|
19633
19639
|
t != null && t === e.pointerId && L(e.clientX, e.clientY);
|
|
19634
|
-
},
|
|
19640
|
+
}, ee = (e) => {
|
|
19635
19641
|
let t = x?.pointerId;
|
|
19636
19642
|
t != null && t === e.pointerId && (o.hasPointerCapture?.(e.pointerId) && o.releasePointerCapture(e.pointerId), R());
|
|
19637
|
-
},
|
|
19643
|
+
}, te = (e) => {
|
|
19638
19644
|
let t = x?.pointerId;
|
|
19639
19645
|
t != null && t === e.pointerId && (o.hasPointerCapture?.(e.pointerId) && o.releasePointerCapture(e.pointerId), z());
|
|
19640
|
-
},
|
|
19646
|
+
}, G = (e) => {
|
|
19641
19647
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), N());
|
|
19642
|
-
},
|
|
19648
|
+
}, ne = (e) => {
|
|
19643
19649
|
e.target !== s && e.preventDefault();
|
|
19644
|
-
},
|
|
19650
|
+
}, re = (e) => {
|
|
19645
19651
|
e.target === d && O();
|
|
19646
|
-
},
|
|
19652
|
+
}, ie = (e) => {
|
|
19647
19653
|
e.key === "Escape" && d.style.display !== "none" && (e.preventDefault(), e.stopImmediatePropagation(), O());
|
|
19648
19654
|
};
|
|
19649
19655
|
return c.addEventListener("pointerdown", (e) => e.stopPropagation()), c.addEventListener("mousedown", (e) => e.stopPropagation()), c.addEventListener("click", (e) => {
|
|
19650
19656
|
e.stopPropagation(), A();
|
|
19651
|
-
}), o.addEventListener("mousedown", B), o.addEventListener("pointerdown", U), o.addEventListener("keydown",
|
|
19657
|
+
}), o.addEventListener("mousedown", B), o.addEventListener("pointerdown", U), o.addEventListener("keydown", G), o.addEventListener("contextmenu", ne), d.addEventListener("click", re), m.addEventListener("click", () => {
|
|
19652
19658
|
P();
|
|
19653
|
-
}), h.addEventListener("click", F), g.addEventListener("click", O), t.addEventListener("mousemove", V, !0), t.addEventListener("mouseup", H, !0), t.addEventListener("pointermove",
|
|
19659
|
+
}), h.addEventListener("click", F), g.addEventListener("click", O), t.addEventListener("mousemove", V, !0), t.addEventListener("mouseup", H, !0), t.addEventListener("pointermove", W, !0), t.addEventListener("pointerup", ee, !0), t.addEventListener("pointercancel", te, !0), t.addEventListener("keydown", ie, !0), {
|
|
19654
19660
|
show(e, n) {
|
|
19655
19661
|
if (w) return;
|
|
19656
19662
|
T(), O(), k(), v = e;
|
|
19657
19663
|
let i = globalThis.URL.createObjectURL(e);
|
|
19658
|
-
y = i, s.src = i, f.src = i, o.style.display = "block", M(b ?? j()), D(
|
|
19664
|
+
y = i, s.src = i, f.src = i, o.style.display = "block", M(b ?? j()), D(Yb(n)), r > 0 && (S = t.setTimeout(A, r));
|
|
19659
19665
|
},
|
|
19660
19666
|
dismiss: A,
|
|
19661
19667
|
dispose() {
|
|
19662
|
-
w || (w = !0, T(), E(), A(), t.removeEventListener("mousemove", V, !0), t.removeEventListener("mouseup", H, !0), t.removeEventListener("pointermove",
|
|
19668
|
+
w || (w = !0, T(), E(), A(), t.removeEventListener("mousemove", V, !0), t.removeEventListener("mouseup", H, !0), t.removeEventListener("pointermove", W, !0), t.removeEventListener("pointerup", ee, !0), t.removeEventListener("pointercancel", te, !0), t.removeEventListener("keydown", ie, !0), o.removeEventListener("mousedown", B), o.removeEventListener("pointerdown", U), o.removeEventListener("keydown", G), o.removeEventListener("contextmenu", ne), d.removeEventListener("click", re), a.remove());
|
|
19663
19669
|
}
|
|
19664
19670
|
};
|
|
19665
|
-
},
|
|
19671
|
+
}, Qb = "mesurer.screenshot", $b = "screenshot", ex = "mesurer.screenshot.settings", tx = "mesurer.screenshot.active", nx = "runtime:solid", rx = "screenshot.toggle", ix = 2500, ax = 0, ox = [
|
|
19666
19672
|
"[data-mesurer-measurement='true']",
|
|
19667
19673
|
"[data-mesurer-selected-measurement='true']",
|
|
19668
19674
|
"[data-mesurer-selection-spacing-target='true']",
|
|
19669
19675
|
"[data-mesurer-guide='true']",
|
|
19670
19676
|
"[data-mesurer-distance='true']"
|
|
19671
|
-
].join(","),
|
|
19677
|
+
].join(","), sx = `${ox},[data-mesurer-rulers='true']`, cx = {
|
|
19672
19678
|
viewBox: "0 0 256 256",
|
|
19673
19679
|
paths: ["m 96,50 a 6.0006,6.0006 0 0 0 -4.992188,2.671875 L 76.789062,74 H 40 C 27.920803,74 18,83.920803 18,96 v 96 c 0,12.0792 9.920803,22 22,22 h 176 c 12.0792,0 22,-9.9208 22,-22 V 96 C 238,83.920803 228.0792,74 216,74 H 179.21094 L 164.99219,52.671875 A 6.0006,6.0006 0 0 0 160,50 Z m 3.210937,12 h 57.578123 l 14.21875,21.328125 A 6.0006,6.0006 0 0 0 176,86 h 40 c 5.59392,0 10,4.406085 10,10 v 96 c 0,5.59392 -4.40608,10 -10,10 H 40 c -5.593915,0 -10,-4.40608 -10,-10 V 96 c 0,-5.593915 4.406085,-10 10,-10 h 40 a 6.0006,6.0006 0 0 0 4.992187,-2.671875 z", "m 128,94 c -23.12489,0 -42,18.87511 -42,42 0,23.12489 18.87511,42 42,42 23.12489,0 42,-18.87511 42,-42 0,-23.12489 -18.87511,-42 -42,-42 z m 0,12 c 16.63961,0 30,13.36039 30,30 0,16.63961 -13.36039,30 -30,30 -16.63961,0 -30,-13.36039 -30,-30 0,-16.63961 13.36039,-30 30,-30 z"]
|
|
19674
|
-
}, cx = (e, t) => {
|
|
19675
|
-
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
19676
19680
|
}, lx = (e, t) => {
|
|
19681
|
+
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
19682
|
+
}, ux = (e, t) => {
|
|
19677
19683
|
for (let n of [
|
|
19678
19684
|
"left",
|
|
19679
19685
|
"top",
|
|
@@ -19685,63 +19691,63 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19685
19691
|
let r = t[n];
|
|
19686
19692
|
r === void 0 ? e.style.removeProperty(n) : e.style.setProperty(n, `${r}px`);
|
|
19687
19693
|
}
|
|
19688
|
-
},
|
|
19689
|
-
let t = e(
|
|
19694
|
+
}, dx = (e) => {
|
|
19695
|
+
let t = e(ex);
|
|
19690
19696
|
return {
|
|
19691
19697
|
toolEnabled: t?.toolEnabled ?? !0,
|
|
19692
19698
|
copy: t?.copy ?? !0,
|
|
19693
19699
|
download: t?.download ?? !1,
|
|
19694
19700
|
includeMeasurements: t?.includeMeasurements ?? !1
|
|
19695
19701
|
};
|
|
19696
|
-
},
|
|
19702
|
+
}, fx = (e) => ({
|
|
19697
19703
|
value: e.style.getPropertyValue("display"),
|
|
19698
19704
|
priority: e.style.getPropertyPriority("display")
|
|
19699
|
-
}),
|
|
19705
|
+
}), px = (e, t) => {
|
|
19700
19706
|
t.value || t.priority ? e.style.setProperty("display", t.value, t.priority) : e.style.removeProperty("display");
|
|
19701
|
-
},
|
|
19707
|
+
}, mx = (e, t) => {
|
|
19702
19708
|
let n = e;
|
|
19703
19709
|
for (; n.parentElement && n.parentElement !== t;) n = n.parentElement;
|
|
19704
19710
|
return n.parentElement === t ? n : null;
|
|
19705
|
-
},
|
|
19711
|
+
}, hx = (e) => {
|
|
19706
19712
|
let t = e.querySelector("[data-mesurer-root='true']");
|
|
19707
19713
|
if (!t) return () => void 0;
|
|
19708
19714
|
let n = /* @__PURE__ */ new Set();
|
|
19709
19715
|
for (let e of t.querySelectorAll("[data-mesurer-rulers='true']")) {
|
|
19710
|
-
let r =
|
|
19716
|
+
let r = mx(e, t);
|
|
19711
19717
|
r && n.add(r);
|
|
19712
19718
|
}
|
|
19713
|
-
for (let e of t.querySelectorAll(
|
|
19714
|
-
let r =
|
|
19719
|
+
for (let e of t.querySelectorAll(ox)) {
|
|
19720
|
+
let r = mx(e, t);
|
|
19715
19721
|
r && n.add(r);
|
|
19716
19722
|
}
|
|
19717
19723
|
let r = [];
|
|
19718
19724
|
for (let e of n) e.dataset.mesurerInspectorUi !== "true" && (r.push({
|
|
19719
19725
|
element: e,
|
|
19720
|
-
display:
|
|
19726
|
+
display: fx(e)
|
|
19721
19727
|
}), e.style.setProperty("display", "none", "important"));
|
|
19722
19728
|
return () => {
|
|
19723
|
-
for (let e of r)
|
|
19729
|
+
for (let e of r) px(e.element, e.display);
|
|
19724
19730
|
};
|
|
19725
|
-
},
|
|
19731
|
+
}, gx = (e) => Array.from(e.querySelectorAll(sx)).filter((e) => e.dataset.mesurerInspectorUi === "true").map((e) => ({
|
|
19726
19732
|
element: e,
|
|
19727
|
-
display:
|
|
19728
|
-
})),
|
|
19729
|
-
for (let t of e) t.element.isConnected &&
|
|
19730
|
-
},
|
|
19731
|
-
id:
|
|
19733
|
+
display: fx(e)
|
|
19734
|
+
})), _x = (e) => {
|
|
19735
|
+
for (let t of e) t.element.isConnected && px(t.element, t.display);
|
|
19736
|
+
}, vx = (e = {}) => Ta({
|
|
19737
|
+
id: Qb,
|
|
19732
19738
|
version: "0.1.0",
|
|
19733
|
-
requires: [
|
|
19739
|
+
requires: [nx],
|
|
19734
19740
|
provides: [
|
|
19735
19741
|
"tool:screenshot",
|
|
19736
19742
|
"capture:screenshot",
|
|
19737
19743
|
"settings:screenshot"
|
|
19738
19744
|
],
|
|
19739
19745
|
setup(t) {
|
|
19740
|
-
let n = t.service.get(
|
|
19746
|
+
let n = t.service.get(nx);
|
|
19741
19747
|
if (!n) throw Error("Screenshot plugin requires the Solid renderer runtime.");
|
|
19742
|
-
let { ownerDocument: r, ownerWindow: i } = n, a = n.createWorkspaceRuntime(), o = n.createInspectorMount(), s = e.capture ?? e.captureVisibleTab, c = s ?? _o, l = e.previewDurationMs ??
|
|
19748
|
+
let { ownerDocument: r, ownerWindow: i } = n, a = n.createWorkspaceRuntime(), o = n.createInspectorMount(), s = e.capture ?? e.captureVisibleTab, c = s ?? _o, l = e.previewDurationMs ?? ax;
|
|
19743
19749
|
t.state.register({
|
|
19744
|
-
id:
|
|
19750
|
+
id: ex,
|
|
19745
19751
|
initial: {
|
|
19746
19752
|
toolEnabled: e.toolEnabled ?? !0,
|
|
19747
19753
|
copy: e.copy ?? !0,
|
|
@@ -19750,11 +19756,11 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19750
19756
|
},
|
|
19751
19757
|
persist: !0
|
|
19752
19758
|
}), t.state.register({
|
|
19753
|
-
id:
|
|
19759
|
+
id: tx,
|
|
19754
19760
|
initial: !1
|
|
19755
19761
|
});
|
|
19756
19762
|
let u = o.element;
|
|
19757
|
-
u.dataset.mesurerScreenshot = "true",
|
|
19763
|
+
u.dataset.mesurerScreenshot = "true", lx(u, {
|
|
19758
19764
|
position: "fixed",
|
|
19759
19765
|
inset: "0",
|
|
19760
19766
|
"z-index": "85",
|
|
@@ -19762,7 +19768,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19762
19768
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
19763
19769
|
});
|
|
19764
19770
|
let d = r.createElement("div");
|
|
19765
|
-
d.dataset.mesurerScreenshotSelect = "true", d.setAttribute("role", "application"), d.setAttribute("aria-label", "Screenshot selection"),
|
|
19771
|
+
d.dataset.mesurerScreenshotSelect = "true", d.setAttribute("role", "application"), d.setAttribute("aria-label", "Screenshot selection"), lx(d, {
|
|
19766
19772
|
position: "fixed",
|
|
19767
19773
|
inset: "0",
|
|
19768
19774
|
display: "none",
|
|
@@ -19774,13 +19780,13 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19774
19780
|
}), u.append(d);
|
|
19775
19781
|
let f = Array.from({ length: 4 }, () => {
|
|
19776
19782
|
let e = r.createElement("div");
|
|
19777
|
-
return
|
|
19783
|
+
return lx(e, {
|
|
19778
19784
|
position: "fixed",
|
|
19779
19785
|
"background-color": "rgb(0 0 0 / 40%)",
|
|
19780
19786
|
"pointer-events": "none"
|
|
19781
19787
|
}), d.append(e), e;
|
|
19782
19788
|
}), p = r.createElement("div");
|
|
19783
|
-
|
|
19789
|
+
lx(p, {
|
|
19784
19790
|
position: "fixed",
|
|
19785
19791
|
display: "none",
|
|
19786
19792
|
border: "1px solid #0d99ff",
|
|
@@ -19788,7 +19794,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19788
19794
|
"pointer-events": "none"
|
|
19789
19795
|
}), d.append(p);
|
|
19790
19796
|
let m = r.createElement("div");
|
|
19791
|
-
|
|
19797
|
+
lx(m, {
|
|
19792
19798
|
position: "fixed",
|
|
19793
19799
|
display: "none",
|
|
19794
19800
|
"z-index": "86",
|
|
@@ -19802,7 +19808,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19802
19808
|
"pointer-events": "none"
|
|
19803
19809
|
}), d.append(m);
|
|
19804
19810
|
let h = r.createElement("div");
|
|
19805
|
-
h.textContent = "Drag to select · Esc to cancel",
|
|
19811
|
+
h.textContent = "Drag to select · Esc to cancel", lx(h, {
|
|
19806
19812
|
position: "fixed",
|
|
19807
19813
|
left: "50%",
|
|
19808
19814
|
bottom: "16px",
|
|
@@ -19815,7 +19821,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19815
19821
|
"pointer-events": "none"
|
|
19816
19822
|
}), d.append(h);
|
|
19817
19823
|
let g = r.createElement("div");
|
|
19818
|
-
g.dataset.mesurerScreenshotError = "true", g.setAttribute("role", "status"), g.textContent = "Could not save screenshot",
|
|
19824
|
+
g.dataset.mesurerScreenshotError = "true", g.setAttribute("role", "status"), g.textContent = "Could not save screenshot", lx(g, {
|
|
19819
19825
|
position: "fixed",
|
|
19820
19826
|
display: "none",
|
|
19821
19827
|
"z-index": "97",
|
|
@@ -19826,8 +19832,8 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19826
19832
|
"font-size": "11px",
|
|
19827
19833
|
"pointer-events": "none"
|
|
19828
19834
|
}), u.append(g);
|
|
19829
|
-
let _ = null, v = null, y = 0, b = 0, x = !1, S = !1, C = !1, w = () => t.state.get("mesurer.screenshot.active") ?? !1, T = () =>
|
|
19830
|
-
t.state.update(
|
|
19835
|
+
let _ = null, v = null, y = 0, b = 0, x = !1, S = !1, C = !1, w = () => t.state.get("mesurer.screenshot.active") ?? !1, T = () => dx(t.state.get), E = (e) => {
|
|
19836
|
+
t.state.update(ex, (t) => {
|
|
19831
19837
|
let n = { ...t };
|
|
19832
19838
|
return e.toolEnabled !== void 0 && (n.toolEnabled = e.toolEnabled), e.copy !== void 0 && (n.copy = e.copy), e.download !== void 0 && (n.download = e.download), e.includeMeasurements !== void 0 && (n.includeMeasurements = e.includeMeasurements), n;
|
|
19833
19839
|
});
|
|
@@ -19850,13 +19856,13 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19850
19856
|
}, A = (e) => {
|
|
19851
19857
|
let t = i.innerWidth, n = i.innerHeight;
|
|
19852
19858
|
if (!e || e.width <= 0 || e.height <= 0) {
|
|
19853
|
-
|
|
19859
|
+
ux(f[0], {
|
|
19854
19860
|
left: 0,
|
|
19855
19861
|
top: 0,
|
|
19856
19862
|
width: t,
|
|
19857
19863
|
height: n
|
|
19858
19864
|
});
|
|
19859
|
-
for (let e of f.slice(1))
|
|
19865
|
+
for (let e of f.slice(1)) ux(e, {
|
|
19860
19866
|
left: 0,
|
|
19861
19867
|
top: 0,
|
|
19862
19868
|
width: 0,
|
|
@@ -19865,31 +19871,31 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19865
19871
|
p.style.display = "none", m.style.display = "none";
|
|
19866
19872
|
return;
|
|
19867
19873
|
}
|
|
19868
|
-
|
|
19874
|
+
ux(f[0], {
|
|
19869
19875
|
left: 0,
|
|
19870
19876
|
top: 0,
|
|
19871
19877
|
width: t,
|
|
19872
19878
|
height: e.top
|
|
19873
|
-
}),
|
|
19879
|
+
}), ux(f[1], {
|
|
19874
19880
|
left: 0,
|
|
19875
19881
|
top: e.top,
|
|
19876
19882
|
width: e.left,
|
|
19877
19883
|
height: e.height
|
|
19878
|
-
}),
|
|
19884
|
+
}), ux(f[2], {
|
|
19879
19885
|
left: e.left + e.width,
|
|
19880
19886
|
top: e.top,
|
|
19881
19887
|
width: Math.max(0, t - e.left - e.width),
|
|
19882
19888
|
height: e.height
|
|
19883
|
-
}),
|
|
19889
|
+
}), ux(f[3], {
|
|
19884
19890
|
left: 0,
|
|
19885
19891
|
top: e.top + e.height,
|
|
19886
19892
|
width: t,
|
|
19887
19893
|
height: Math.max(0, n - e.top - e.height)
|
|
19888
|
-
}), p.style.display = "block",
|
|
19894
|
+
}), p.style.display = "block", ux(p, e), m.style.display = "block", m.textContent = `${Math.round(e.width)} × ${Math.round(e.height)}`, ux(m, {
|
|
19889
19895
|
left: e.left + e.width / 2,
|
|
19890
19896
|
top: Math.min(n - 22, e.top + e.height + 6)
|
|
19891
19897
|
});
|
|
19892
|
-
}, j = () => n.portalTarget.querySelector("[data-mesurer-tool-id='screenshot']")?.getBoundingClientRect() ?? null, M =
|
|
19898
|
+
}, j = () => n.portalTarget.querySelector("[data-mesurer-tool-id='screenshot']")?.getBoundingClientRect() ?? null, M = Zb({
|
|
19893
19899
|
ownerDocument: r,
|
|
19894
19900
|
ownerWindow: i,
|
|
19895
19901
|
root: u,
|
|
@@ -19900,7 +19906,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19900
19906
|
}, P = () => {
|
|
19901
19907
|
y && i.clearTimeout(y), g.style.display = "block", N(g), y = i.setTimeout(() => {
|
|
19902
19908
|
y = 0, g.style.display = "none";
|
|
19903
|
-
},
|
|
19909
|
+
}, ix);
|
|
19904
19910
|
}, F = () => {
|
|
19905
19911
|
_ = null, A(null), d.style.visibility = "", d.style.display = "none", u.style.pointerEvents = "none", D(!1), k();
|
|
19906
19912
|
}, I = () => {
|
|
@@ -19909,8 +19915,8 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19909
19915
|
if (x) throw Error("A screenshot capture is already running.");
|
|
19910
19916
|
if (e.width < 4 || e.height < 4) throw Error("Screenshot selection must be at least 4px by 4px.");
|
|
19911
19917
|
x = !0;
|
|
19912
|
-
let o = ++b, s = T(), l = s.includeMeasurements ?
|
|
19913
|
-
a.prepareCapture(), s.includeMeasurements &&
|
|
19918
|
+
let o = ++b, s = T(), l = s.includeMeasurements ? gx(r) : [], u = s.includeMeasurements ? () => void 0 : hx(n.portalTarget);
|
|
19919
|
+
a.prepareCapture(), s.includeMeasurements && _x(l);
|
|
19914
19920
|
try {
|
|
19915
19921
|
d.style.visibility = "hidden", await Qa(i);
|
|
19916
19922
|
let n = await Ja(await c({
|
|
@@ -20005,7 +20011,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
20005
20011
|
e.key !== "Escape" || !w() || (e.preventDefault(), e.stopImmediatePropagation(), I());
|
|
20006
20012
|
};
|
|
20007
20013
|
d.addEventListener("pointerdown", z), d.addEventListener("pointermove", B), d.addEventListener("pointerup", V), d.addEventListener("pointercancel", H), i.addEventListener("keydown", U, !0);
|
|
20008
|
-
let
|
|
20014
|
+
let W = {
|
|
20009
20015
|
active: w,
|
|
20010
20016
|
settings: T,
|
|
20011
20017
|
setSettings: E,
|
|
@@ -20018,10 +20024,10 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
20018
20024
|
label: "Screenshot",
|
|
20019
20025
|
shortcut: "Shift+S",
|
|
20020
20026
|
order: 70,
|
|
20021
|
-
command:
|
|
20027
|
+
command: rx,
|
|
20022
20028
|
toolbarMode: "select",
|
|
20023
20029
|
compactPinned: !0,
|
|
20024
|
-
icon:
|
|
20030
|
+
icon: cx,
|
|
20025
20031
|
active: w,
|
|
20026
20032
|
hidden: () => !T().toolEnabled,
|
|
20027
20033
|
menu: {
|
|
@@ -20087,31 +20093,31 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
20087
20093
|
set: (e) => E({ includeMeasurements: e })
|
|
20088
20094
|
}
|
|
20089
20095
|
]
|
|
20090
|
-
}), t.command.register(
|
|
20096
|
+
}), t.command.register(rx, R), t.service.provide($b, W), t.lifecycle.onDispose(() => {
|
|
20091
20097
|
C = !0, b += 1, d.removeEventListener("pointerdown", z), d.removeEventListener("pointermove", B), d.removeEventListener("pointerup", V), d.removeEventListener("pointercancel", H), i.removeEventListener("keydown", U, !0), y && i.clearTimeout(y), M.dispose(), k(), vo(i), a.finishCapture(), a.dispose(), o.dispose();
|
|
20092
20098
|
});
|
|
20093
20099
|
}
|
|
20094
|
-
}),
|
|
20100
|
+
}), yx = (e) => Number.parseFloat(e) || 0, bx = 0, xx = (e, t) => {
|
|
20095
20101
|
let n = t.CSS;
|
|
20096
20102
|
return n?.escape ? n.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
20097
|
-
},
|
|
20098
|
-
function
|
|
20103
|
+
}, Sx = (e) => e.nodeType === 9, Cx = (e) => e.nodeType === 11;
|
|
20104
|
+
function wx(e) {
|
|
20099
20105
|
let t = e.getRootNode();
|
|
20100
|
-
return
|
|
20106
|
+
return Cx(t) ? t : e.ownerDocument;
|
|
20101
20107
|
}
|
|
20102
|
-
var
|
|
20103
|
-
if (
|
|
20104
|
-
let n =
|
|
20105
|
-
return
|
|
20106
|
-
},
|
|
20108
|
+
var Tx = (e, t) => {
|
|
20109
|
+
if (Sx(e) || Cx(e)) return e;
|
|
20110
|
+
let n = wx(e);
|
|
20111
|
+
return Cx(n) ? n : t;
|
|
20112
|
+
}, Ex = 600, Dx = "audio, canvas, embed, iframe, img, input, object, picture, select, textarea, video", Ox = /* @__PURE__ */ new WeakMap(), kx = (e) => {
|
|
20107
20113
|
let t = e;
|
|
20108
20114
|
for (; t;) {
|
|
20109
|
-
if ((
|
|
20115
|
+
if ((Ox.get(t) ?? 0) > 0) return !0;
|
|
20110
20116
|
let e = t.getRootNode();
|
|
20111
|
-
t =
|
|
20117
|
+
t = Cx(e) ? e.host : t.parentElement;
|
|
20112
20118
|
}
|
|
20113
20119
|
return !1;
|
|
20114
|
-
},
|
|
20120
|
+
}, Ax = (e, t) => t.x >= e.left && t.x <= e.right && t.y >= e.top && t.y <= e.bottom, jx = (e, t) => Array.from(e.getClientRects()).some((e) => Ax(e, t)), Mx = (e, t, n) => {
|
|
20115
20121
|
let r = e;
|
|
20116
20122
|
for (; r;) {
|
|
20117
20123
|
let e = n.getComputedStyle(r);
|
|
@@ -20120,7 +20126,7 @@ var wx = (e, t) => {
|
|
|
20120
20126
|
r = r.parentElement;
|
|
20121
20127
|
}
|
|
20122
20128
|
return !0;
|
|
20123
|
-
},
|
|
20129
|
+
}, Nx = (e, t) => {
|
|
20124
20130
|
if (e.matches("img, picture, video, canvas, svg image, path, circle, ellipse, line, polygon, polyline, rect, text, use")) return !0;
|
|
20125
20131
|
let n = t.getComputedStyle(e), r = n.backgroundImage !== "none" || n.backgroundColor !== "transparent" && n.backgroundColor !== "rgba(0, 0, 0, 0)", i = [
|
|
20126
20132
|
"top",
|
|
@@ -20129,7 +20135,7 @@ var wx = (e, t) => {
|
|
|
20129
20135
|
"left"
|
|
20130
20136
|
].some((e) => Number.parseFloat(n.getPropertyValue(`border-${e}-width`)) > 0 && n.getPropertyValue(`border-${e}-style`) !== "none");
|
|
20131
20137
|
return r || i || n.boxShadow !== "none" || n.outlineStyle !== "none";
|
|
20132
|
-
},
|
|
20138
|
+
}, Px = (e, t) => !!e.textContent?.trim() || Nx(e, t), Fx = (e, t, n) => {
|
|
20133
20139
|
let r = t, i = r.caretRangeFromPoint?.(e.x, e.y)?.startContainer ?? r.caretPositionFromPoint?.(e.x, e.y)?.offsetNode;
|
|
20134
20140
|
if (!i) return null;
|
|
20135
20141
|
let a = t.defaultView?.Element;
|
|
@@ -20140,11 +20146,11 @@ var wx = (e, t) => {
|
|
|
20140
20146
|
o = o.parentElement;
|
|
20141
20147
|
}
|
|
20142
20148
|
return o === n ? n : null;
|
|
20143
|
-
},
|
|
20149
|
+
}, Ix = (e, t, n) => {
|
|
20144
20150
|
let r = n.defaultView, i = r?.Element;
|
|
20145
20151
|
if (!r || !i) return [];
|
|
20146
20152
|
let a = [], o = /* @__PURE__ */ new Set(), s = (n, i, s) => {
|
|
20147
|
-
if (o.has(n) ||
|
|
20153
|
+
if (o.has(n) || kx(n) || r.getComputedStyle(n).pointerEvents !== "none" || Mx(n, e, r) || !jx(n, t)) return;
|
|
20148
20154
|
let c = n.getBoundingClientRect();
|
|
20149
20155
|
o.add(n), a.push({
|
|
20150
20156
|
element: n,
|
|
@@ -20153,7 +20159,7 @@ var wx = (e, t) => {
|
|
|
20153
20159
|
order: s
|
|
20154
20160
|
});
|
|
20155
20161
|
}, c = n.createTreeWalker(e, 1), l = c.nextNode(), u = 1;
|
|
20156
|
-
for (; l && u <=
|
|
20162
|
+
for (; l && u <= Ex;) {
|
|
20157
20163
|
if (l instanceof i) {
|
|
20158
20164
|
let t = l;
|
|
20159
20165
|
if (r.getComputedStyle(t).pointerEvents === "none") {
|
|
@@ -20164,9 +20170,9 @@ var wx = (e, t) => {
|
|
|
20164
20170
|
}
|
|
20165
20171
|
u += 1, l = c.nextNode();
|
|
20166
20172
|
}
|
|
20167
|
-
let d =
|
|
20173
|
+
let d = Fx(t, n, e);
|
|
20168
20174
|
return d && r.getComputedStyle(d).pointerEvents === "none" && s(d, 1e4, u), a.sort((e, t) => t.depth - e.depth || e.area - t.area || t.order - e.order).map(({ element: e }) => e);
|
|
20169
|
-
},
|
|
20175
|
+
}, Lx = (e, t, n) => {
|
|
20170
20176
|
let r = t.ownerDocument.defaultView;
|
|
20171
20177
|
if (!r) return [];
|
|
20172
20178
|
let i = [...new Set(e)], a = /* @__PURE__ */ new Map();
|
|
@@ -20175,7 +20181,7 @@ var wx = (e, t) => {
|
|
|
20175
20181
|
t && (a.set(e, e.getAttribute("style")), t.style.setProperty("pointer-events", "auto", "important"));
|
|
20176
20182
|
}
|
|
20177
20183
|
try {
|
|
20178
|
-
let e =
|
|
20184
|
+
let e = wx(t).elementsFromPoint(n.x, n.y), r = e.findIndex((e) => e === t), a = new Map(e.map((e, t) => [e, t]));
|
|
20179
20185
|
return i.filter((e) => {
|
|
20180
20186
|
let t = a.get(e);
|
|
20181
20187
|
return t !== void 0 && (r < 0 || t < r);
|
|
@@ -20183,31 +20189,31 @@ var wx = (e, t) => {
|
|
|
20183
20189
|
} finally {
|
|
20184
20190
|
for (let [e, t] of a) t === null ? e.removeAttribute("style") : e.setAttribute("style", t);
|
|
20185
20191
|
}
|
|
20186
|
-
},
|
|
20192
|
+
}, Rx = (e, t) => {
|
|
20187
20193
|
let n = e;
|
|
20188
20194
|
for (; n.parentElement && n.parentElement !== t;) n = n.parentElement;
|
|
20189
20195
|
return n.parentElement === t ? n : null;
|
|
20190
|
-
},
|
|
20196
|
+
}, zx = (e, t, n, r) => {
|
|
20191
20197
|
let i = r.defaultView;
|
|
20192
20198
|
if (!i) return [];
|
|
20193
|
-
let a = Ix(
|
|
20199
|
+
let a = Lx(Ix(e, t, r).filter((e) => Px(e, i)), e, t);
|
|
20194
20200
|
if (a.length > 0) return a;
|
|
20195
|
-
if (e.textContent?.trim() && !e.matches(
|
|
20196
|
-
let o = [], s = /* @__PURE__ */ new Set(), c = !
|
|
20201
|
+
if (e.textContent?.trim() && !e.matches(Dx) || e.matches("a, button, input, select, textarea, label, summary, [contenteditable='true']")) return [];
|
|
20202
|
+
let o = [], s = /* @__PURE__ */ new Set(), c = !Sx(n) && !Cx(n) ? n : null, l = e.parentElement;
|
|
20197
20203
|
for (; l && l !== r.body && l !== r.documentElement && !(c && l !== c && !c.contains(l));) {
|
|
20198
|
-
let a = l, u =
|
|
20199
|
-
if (!
|
|
20200
|
-
let t =
|
|
20204
|
+
let a = l, u = Rx(e, a), d = Ix(a, t, r).filter((e) => {
|
|
20205
|
+
if (!Vx(e, n) || e.closest("[aria-hidden='true'], [inert]")) return !1;
|
|
20206
|
+
let t = Rx(e, a);
|
|
20201
20207
|
return t === null || t !== u;
|
|
20202
20208
|
});
|
|
20203
|
-
for (let e of d) s.has(e) || !
|
|
20209
|
+
for (let e of d) s.has(e) || !Px(e, i) || (s.add(e), o.push(e));
|
|
20204
20210
|
if (a === c) break;
|
|
20205
20211
|
l = a.parentElement;
|
|
20206
20212
|
}
|
|
20207
|
-
return
|
|
20213
|
+
return Lx(o, e, t);
|
|
20208
20214
|
};
|
|
20209
|
-
function
|
|
20210
|
-
let r =
|
|
20215
|
+
function Bx(e, t, n = Sx(t) ? t : t.ownerDocument ?? document) {
|
|
20216
|
+
let r = Tx(t, n), i = n.defaultView;
|
|
20211
20217
|
if (!i) return null;
|
|
20212
20218
|
let a = r.elementsFromPoint(e.x, e.y);
|
|
20213
20219
|
for (let r of a) {
|
|
@@ -20217,28 +20223,28 @@ function zx(e, t, n = xx(t) ? t : t.ownerDocument ?? document) {
|
|
|
20217
20223
|
if (!t || t === a) break;
|
|
20218
20224
|
a = t;
|
|
20219
20225
|
}
|
|
20220
|
-
if (!a || !
|
|
20221
|
-
let o =
|
|
20226
|
+
if (!a || !Vx(a, t)) continue;
|
|
20227
|
+
let o = zx(a, e, t, n);
|
|
20222
20228
|
if (o.length > 0) return o[0];
|
|
20223
20229
|
if (i.getComputedStyle(a).pointerEvents !== "none") return a;
|
|
20224
20230
|
}
|
|
20225
20231
|
return null;
|
|
20226
20232
|
}
|
|
20227
|
-
function
|
|
20228
|
-
if (
|
|
20233
|
+
function Vx(e, t) {
|
|
20234
|
+
if (Sx(t)) return !0;
|
|
20229
20235
|
let n = e;
|
|
20230
20236
|
for (; n;) {
|
|
20231
20237
|
if (t === n || t.contains(n)) return !0;
|
|
20232
20238
|
let e = n.getRootNode();
|
|
20233
|
-
if (!
|
|
20239
|
+
if (!Cx(e)) return !1;
|
|
20234
20240
|
n = e.host;
|
|
20235
20241
|
}
|
|
20236
20242
|
return !1;
|
|
20237
20243
|
}
|
|
20238
|
-
function
|
|
20244
|
+
function Hx(e, t) {
|
|
20239
20245
|
if (!e) return t();
|
|
20240
|
-
let n =
|
|
20241
|
-
|
|
20246
|
+
let n = Ox.get(e) ?? 0;
|
|
20247
|
+
Ox.set(e, n + 1);
|
|
20242
20248
|
let r = [e, ...e.querySelectorAll("*")], i = r.map((e) => [
|
|
20243
20249
|
e,
|
|
20244
20250
|
e.style.getPropertyValue("pointer-events"),
|
|
@@ -20248,13 +20254,13 @@ function Vx(e, t) {
|
|
|
20248
20254
|
try {
|
|
20249
20255
|
return t();
|
|
20250
20256
|
} finally {
|
|
20251
|
-
n === 0 ?
|
|
20257
|
+
n === 0 ? Ox.delete(e) : Ox.set(e, n);
|
|
20252
20258
|
for (let [e, t, n] of i) t ? e.style.setProperty("pointer-events", t, n) : e.style.removeProperty("pointer-events");
|
|
20253
20259
|
}
|
|
20254
20260
|
}
|
|
20255
|
-
function
|
|
20261
|
+
function Ux(e) {
|
|
20256
20262
|
let t = e.ownerDocument.defaultView ?? window;
|
|
20257
|
-
if (e.id) return `#${
|
|
20263
|
+
if (e.id) return `#${xx(e.id, t)}`;
|
|
20258
20264
|
let n = e.getAttribute("data-testid");
|
|
20259
20265
|
if (n) return `[data-testid=${JSON.stringify(n)}]`;
|
|
20260
20266
|
let r = [], i = e;
|
|
@@ -20268,17 +20274,17 @@ function Hx(e) {
|
|
|
20268
20274
|
}
|
|
20269
20275
|
return r.join(" > ");
|
|
20270
20276
|
}
|
|
20271
|
-
function
|
|
20277
|
+
function Wx(e, t, n = `dom-inspection-${++bx}`) {
|
|
20272
20278
|
let r = e.getBoundingClientRect(), i = t.getComputedStyle(e), a = {
|
|
20273
|
-
top:
|
|
20274
|
-
right:
|
|
20275
|
-
bottom:
|
|
20276
|
-
left:
|
|
20279
|
+
top: yx(i.paddingTop),
|
|
20280
|
+
right: yx(i.paddingRight),
|
|
20281
|
+
bottom: yx(i.paddingBottom),
|
|
20282
|
+
left: yx(i.paddingLeft)
|
|
20277
20283
|
}, o = {
|
|
20278
|
-
top:
|
|
20279
|
-
right:
|
|
20280
|
-
bottom:
|
|
20281
|
-
left:
|
|
20284
|
+
top: yx(i.marginTop),
|
|
20285
|
+
right: yx(i.marginRight),
|
|
20286
|
+
bottom: yx(i.marginBottom),
|
|
20287
|
+
left: yx(i.marginLeft)
|
|
20282
20288
|
}, s = {
|
|
20283
20289
|
left: r.left + a.left,
|
|
20284
20290
|
top: r.top + a.top,
|
|
@@ -20306,8 +20312,8 @@ function Ux(e, t, n = `dom-inspection-${++yx}`) {
|
|
|
20306
20312
|
elementRef: e
|
|
20307
20313
|
};
|
|
20308
20314
|
}
|
|
20309
|
-
function
|
|
20310
|
-
let t = e.ownerDocument.defaultView ?? window, n = t.getComputedStyle(e), r = e instanceof t.HTMLElement ? e : null, i = e.getBoundingClientRect(), a = r ?
|
|
20315
|
+
function Gx(e) {
|
|
20316
|
+
let t = e.ownerDocument.defaultView ?? window, n = t.getComputedStyle(e), r = e instanceof t.HTMLElement ? e : null, i = e.getBoundingClientRect(), a = r ? Wx(r, t) : null, o = (e) => {
|
|
20311
20317
|
let t = Number.parseFloat(e);
|
|
20312
20318
|
return Number.isFinite(t) ? t : 0;
|
|
20313
20319
|
}, s = (e) => ({
|
|
@@ -20317,7 +20323,7 @@ function Wx(e) {
|
|
|
20317
20323
|
left: o(n.getPropertyValue(`${e}-left${e === "border" ? "-width" : ""}`))
|
|
20318
20324
|
});
|
|
20319
20325
|
return {
|
|
20320
|
-
selector:
|
|
20326
|
+
selector: Ux(e),
|
|
20321
20327
|
tag: e.localName,
|
|
20322
20328
|
id: e.id || null,
|
|
20323
20329
|
classes: [...e.classList],
|
|
@@ -20379,10 +20385,10 @@ function Wx(e) {
|
|
|
20379
20385
|
}
|
|
20380
20386
|
//#endregion
|
|
20381
20387
|
//#region src/agent.ts
|
|
20382
|
-
var
|
|
20383
|
-
function
|
|
20384
|
-
let t = e.root ?? e.ownerDocument, n = e.ownerDocument.defaultView ?? window, r = (e, n = 0) => t.querySelectorAll(e).item(n) || null, i = (n) => t === e.ownerDocument ||
|
|
20385
|
-
let t = (e.getPluginHost() ?? await e.waitForPluginHost()).service.get(
|
|
20388
|
+
var Kx = "text-edit", qx = (e) => Gx(e);
|
|
20389
|
+
function Jx(e) {
|
|
20390
|
+
let t = e.root ?? e.ownerDocument, n = e.ownerDocument.defaultView ?? window, r = (e, n = 0) => t.querySelectorAll(e).item(n) || null, i = (n) => t === e.ownerDocument || Vx(n, t), a = async () => {
|
|
20391
|
+
let t = (e.getPluginHost() ?? await e.waitForPluginHost()).service.get(Kx);
|
|
20386
20392
|
if (!t) throw Error("Mesurer text editing service is unavailable.");
|
|
20387
20393
|
return t;
|
|
20388
20394
|
}, o = () => {
|
|
@@ -20411,25 +20417,25 @@ function qx(e) {
|
|
|
20411
20417
|
},
|
|
20412
20418
|
inspect(e, t = 0) {
|
|
20413
20419
|
let n = r(e, t);
|
|
20414
|
-
return n ?
|
|
20420
|
+
return n ? qx(n) : null;
|
|
20415
20421
|
},
|
|
20416
20422
|
inspectAll(e, n = 50) {
|
|
20417
|
-
return [...t.querySelectorAll(e)].slice(0, Math.max(0, n)).map(
|
|
20423
|
+
return [...t.querySelectorAll(e)].slice(0, Math.max(0, n)).map(qx);
|
|
20418
20424
|
},
|
|
20419
20425
|
at(n, r) {
|
|
20420
20426
|
let a = t.querySelector?.("[data-mesurer-island]") ?? null;
|
|
20421
|
-
return
|
|
20422
|
-
let a =
|
|
20427
|
+
return Hx(a?.shadowRoot?.querySelector("[data-mesurer-root='true']") ?? a, () => {
|
|
20428
|
+
let a = Bx({
|
|
20423
20429
|
x: n,
|
|
20424
20430
|
y: r
|
|
20425
20431
|
}, t, e.ownerDocument);
|
|
20426
|
-
return a && i(a) ?
|
|
20432
|
+
return a && i(a) ? qx(a) : null;
|
|
20427
20433
|
});
|
|
20428
20434
|
},
|
|
20429
20435
|
distance(e, t) {
|
|
20430
20436
|
let n = r(e), i = r(t);
|
|
20431
20437
|
if (!n || !i) return null;
|
|
20432
|
-
let a =
|
|
20438
|
+
let a = qx(n), o = qx(i), s = a.rect, c = o.rect;
|
|
20433
20439
|
return {
|
|
20434
20440
|
a,
|
|
20435
20441
|
b: o,
|
|
@@ -20445,7 +20451,7 @@ function qx(e) {
|
|
|
20445
20451
|
let r = e.getPluginHost() ?? await e.waitForPluginHost();
|
|
20446
20452
|
return {
|
|
20447
20453
|
viewport: o(),
|
|
20448
|
-
elements: n.flatMap((e) => [...t.querySelectorAll(e)].slice(0, 50).map(
|
|
20454
|
+
elements: n.flatMap((e) => [...t.querySelectorAll(e)].slice(0, 50).map(qx)),
|
|
20449
20455
|
plugins: r.describe(),
|
|
20450
20456
|
pluginState: r.state.serialize("all")
|
|
20451
20457
|
};
|
|
@@ -20470,10 +20476,10 @@ function qx(e) {
|
|
|
20470
20476
|
}
|
|
20471
20477
|
//#endregion
|
|
20472
20478
|
//#region src/version.ts
|
|
20473
|
-
var
|
|
20479
|
+
var Yx = "0.2.1-beta.12", Xx = Np, Zx = Pp, Qx = () => ({
|
|
20474
20480
|
...km(),
|
|
20475
|
-
version:
|
|
20476
|
-
}),
|
|
20481
|
+
version: Yx
|
|
20482
|
+
}), $x = Zx, eS = (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, tS = (e) => {
|
|
20477
20483
|
if (!e.length) return null;
|
|
20478
20484
|
let t = Math.min(...e.map((e) => e.left)), n = Math.min(...e.map((e) => e.top)), r = Math.max(...e.map((e) => e.left + e.width)), i = Math.max(...e.map((e) => e.top + e.height));
|
|
20479
20485
|
return {
|
|
@@ -20482,36 +20488,36 @@ var Jx = "0.2.1-beta.11", Yx = Np, Xx = Pp, Zx = () => ({
|
|
|
20482
20488
|
width: r - t,
|
|
20483
20489
|
height: i - n
|
|
20484
20490
|
};
|
|
20485
|
-
},
|
|
20486
|
-
function
|
|
20491
|
+
}, nS = (e, t, n) => t.some((t) => e.orientation === "vertical" ? e.position >= t.left - n && e.position <= t.left + t.width + n : e.position >= t.top - n && e.position <= t.top + t.height + n), rS = (e) => [...e.measurements, ...e.activeMeasurement && !e.measurements.some((t) => t.id === e.activeMeasurement?.id) ? [e.activeMeasurement] : []];
|
|
20492
|
+
function iS(e) {
|
|
20487
20493
|
let { workspace: t, scope: n, guideTolerance: r } = e;
|
|
20488
20494
|
if (n.kind === "workspace") return {
|
|
20489
20495
|
guides: t.guides.map((e) => ({ ...e })),
|
|
20490
|
-
measurements:
|
|
20496
|
+
measurements: rS(t),
|
|
20491
20497
|
distances: [...t.distances]
|
|
20492
20498
|
};
|
|
20493
|
-
let i = new Set(n.elements), a = (e) => e != null && i.has(e), o = (e) => n.regions.some((t) =>
|
|
20499
|
+
let i = new Set(n.elements), a = (e) => e != null && i.has(e), o = (e) => n.regions.some((t) => eS(e, t));
|
|
20494
20500
|
return {
|
|
20495
|
-
guides: t.guides.filter((e) =>
|
|
20496
|
-
measurements:
|
|
20501
|
+
guides: t.guides.filter((e) => nS(e, n.regions, r)).map((e) => ({ ...e })),
|
|
20502
|
+
measurements: rS(t).filter((e) => a(e.elementRef) || o(e.rect)),
|
|
20497
20503
|
distances: t.distances.filter((e) => a(e.elementRefA) || a(e.elementRefB) || o(e.rectA) || o(e.rectB))
|
|
20498
20504
|
};
|
|
20499
20505
|
}
|
|
20500
20506
|
//#endregion
|
|
20501
20507
|
//#region ../mesurer-core/dist/domain.js
|
|
20502
|
-
var
|
|
20508
|
+
var aS = {
|
|
20503
20509
|
opacity: 1,
|
|
20504
20510
|
width: 1,
|
|
20505
20511
|
pattern: "solid",
|
|
20506
20512
|
dashLength: 6,
|
|
20507
20513
|
gap: 4
|
|
20508
|
-
},
|
|
20514
|
+
}, oS = {
|
|
20509
20515
|
opacity: 1,
|
|
20510
20516
|
edgeReveal: !1
|
|
20511
20517
|
};
|
|
20512
20518
|
//#endregion
|
|
20513
20519
|
//#region ../mesurer-core/dist/events.js
|
|
20514
|
-
function
|
|
20520
|
+
function sS() {
|
|
20515
20521
|
let e = /* @__PURE__ */ new Map();
|
|
20516
20522
|
return {
|
|
20517
20523
|
on(t, n) {
|
|
@@ -20529,12 +20535,12 @@ function oS() {
|
|
|
20529
20535
|
}
|
|
20530
20536
|
};
|
|
20531
20537
|
}
|
|
20532
|
-
({ ...
|
|
20538
|
+
({ ...aS }), { ...oS };
|
|
20533
20539
|
//#endregion
|
|
20534
20540
|
//#region ../mesurer-core/dist/plugins.js
|
|
20535
|
-
var
|
|
20536
|
-
function
|
|
20537
|
-
let e = 1, t = 0, n =
|
|
20541
|
+
var cS = 50;
|
|
20542
|
+
function lS() {
|
|
20543
|
+
let e = 1, t = 0, n = sS(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), p = [], m = [], h = (e, t) => {
|
|
20538
20544
|
n.emit("changed", {
|
|
20539
20545
|
pluginId: e,
|
|
20540
20546
|
reason: t
|
|
@@ -20597,15 +20603,15 @@ function cS() {
|
|
|
20597
20603
|
}
|
|
20598
20604
|
if (o && s) {
|
|
20599
20605
|
let e = y("history");
|
|
20600
|
-
x(s, e) || (p.push(s), p.length >
|
|
20606
|
+
x(s, e) || (p.push(s), p.length > cS && p.shift(), m.length = 0);
|
|
20601
20607
|
}
|
|
20602
20608
|
return l;
|
|
20603
20609
|
}, w = () => {
|
|
20604
20610
|
let e = p.pop();
|
|
20605
|
-
return e ? (m.push(y("history")), m.length >
|
|
20611
|
+
return e ? (m.push(y("history")), m.length > cS && m.shift(), b(e, "history"), h(void 0, "history"), !0) : !1;
|
|
20606
20612
|
}, T = () => {
|
|
20607
20613
|
let e = m.pop();
|
|
20608
|
-
return e ? (p.push(y("history")), p.length >
|
|
20614
|
+
return e ? (p.push(y("history")), p.length > cS && p.shift(), b(e, "history"), h(void 0, "history"), !0) : !1;
|
|
20609
20615
|
}, E = async (e, t) => {
|
|
20610
20616
|
for (let n of [...l.values()].filter((t) => t.name === e)) await n.handler(t);
|
|
20611
20617
|
}, D = (e) => [...u.values()].reverse().find((t) => t.id === e)?.value, O = {
|
|
@@ -20762,8 +20768,8 @@ function cS() {
|
|
|
20762
20768
|
}
|
|
20763
20769
|
//#endregion
|
|
20764
20770
|
//#region ../mesurer-core/dist/runtime.js
|
|
20765
|
-
async function
|
|
20766
|
-
let t =
|
|
20771
|
+
async function uS(e = {}) {
|
|
20772
|
+
let t = lS();
|
|
20767
20773
|
try {
|
|
20768
20774
|
for (let n of e.plugins ?? []) await t.load(n);
|
|
20769
20775
|
return t;
|
|
@@ -20773,17 +20779,17 @@ async function lS(e = {}) {
|
|
|
20773
20779
|
}
|
|
20774
20780
|
//#endregion
|
|
20775
20781
|
//#region src/context.ts
|
|
20776
|
-
var
|
|
20782
|
+
var dS = 10, fS = (e) => ({
|
|
20777
20783
|
left: e.left,
|
|
20778
20784
|
top: e.top,
|
|
20779
20785
|
width: e.width,
|
|
20780
20786
|
height: e.height
|
|
20781
|
-
}),
|
|
20787
|
+
}), pS = (e) => {
|
|
20782
20788
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
20783
20789
|
for (let r of e) !r?.isConnected || t.has(r) || (t.add(r), n.push(r));
|
|
20784
20790
|
return n;
|
|
20785
|
-
},
|
|
20786
|
-
function
|
|
20791
|
+
}, mS = (e) => e.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
20792
|
+
function hS(e) {
|
|
20787
20793
|
let { runtime: t, ownerDocument: n, ownerWindow: r } = e, i = e.request ?? { scope: "workspace" }, a = t.snapshot();
|
|
20788
20794
|
if (!a) throw Error("Mesurer workspace is not ready yet.");
|
|
20789
20795
|
let o = [], s = [], c = { kind: "workspace" }, l = /* @__PURE__ */ new Map();
|
|
@@ -20791,7 +20797,7 @@ function mS(e) {
|
|
|
20791
20797
|
let e = t.annotation(i.annotation);
|
|
20792
20798
|
if (!e) throw Error(`Mesurer annotation not found: ${i.annotation}`);
|
|
20793
20799
|
for (let t of e.resolvedTargets) t.element?.isConnected && l.set(t.element, t.target.id);
|
|
20794
|
-
o =
|
|
20800
|
+
o = pS(e.resolvedTargets.map((e) => e.element));
|
|
20795
20801
|
let n = t.annotationRect(e.id);
|
|
20796
20802
|
n && (s = [n]);
|
|
20797
20803
|
let r = e.resolvedTargets.length, a = e.resolvedTargets.filter((e) => e.element?.isConnected).length, u = e.anchor.kind === "region" ? "connected" : r === 0 || a === 0 ? "stale" : a === r ? "connected" : "partial";
|
|
@@ -20803,15 +20809,15 @@ function mS(e) {
|
|
|
20803
20809
|
};
|
|
20804
20810
|
} else if (i.scope === "selection") {
|
|
20805
20811
|
let e = t.currentSelection();
|
|
20806
|
-
if (o =
|
|
20807
|
-
s = e.region ? [e.region] : o.map((e) =>
|
|
20808
|
-
} else o =
|
|
20812
|
+
if (o = pS(e.elements), !o.length && !e.region) throw Error("Mesurer has no current selection.");
|
|
20813
|
+
s = e.region ? [e.region] : o.map((e) => fS(e.getBoundingClientRect())), c = { kind: "selection" };
|
|
20814
|
+
} else o = pS([
|
|
20809
20815
|
...t.currentSelection().elements,
|
|
20810
20816
|
...a.measurements.map((e) => e.elementRef),
|
|
20811
20817
|
a.activeMeasurement?.elementRef,
|
|
20812
20818
|
...a.heldDistances.flatMap((e) => [e.elementRefA, e.elementRefB])
|
|
20813
20819
|
]);
|
|
20814
|
-
let u = c.kind === "workspace" ? [] : s.length ? s : o.map((e) =>
|
|
20820
|
+
let u = c.kind === "workspace" ? [] : s.length ? s : o.map((e) => fS(e.getBoundingClientRect())), d = iS({
|
|
20815
20821
|
workspace: {
|
|
20816
20822
|
guides: a.guides,
|
|
20817
20823
|
measurements: a.measurements,
|
|
@@ -20823,8 +20829,8 @@ function mS(e) {
|
|
|
20823
20829
|
elements: o,
|
|
20824
20830
|
regions: u
|
|
20825
20831
|
},
|
|
20826
|
-
guideTolerance: a.guideRelevanceTolerance ??
|
|
20827
|
-
}), f = d.measurements, p = d.distances, m = d.guides, h =
|
|
20832
|
+
guideTolerance: a.guideRelevanceTolerance ?? dS
|
|
20833
|
+
}), f = d.measurements, p = d.distances, m = d.guides, h = pS([
|
|
20828
20834
|
...o,
|
|
20829
20835
|
...f.map((e) => e.elementRef),
|
|
20830
20836
|
...p.flatMap((e) => [e.elementRefA, e.elementRefB])
|
|
@@ -20836,12 +20842,12 @@ function mS(e) {
|
|
|
20836
20842
|
let t = l.get(e) ?? y();
|
|
20837
20843
|
return g.set(e, t), {
|
|
20838
20844
|
ref: t,
|
|
20839
|
-
inspection:
|
|
20845
|
+
inspection: Gx(e)
|
|
20840
20846
|
};
|
|
20841
20847
|
}), x = f.map((e) => {
|
|
20842
20848
|
let t = {
|
|
20843
20849
|
id: e.id,
|
|
20844
|
-
rect:
|
|
20850
|
+
rect: fS(e.rect),
|
|
20845
20851
|
deltaX: e.deltaX,
|
|
20846
20852
|
deltaY: e.deltaY
|
|
20847
20853
|
};
|
|
@@ -20851,8 +20857,8 @@ function mS(e) {
|
|
|
20851
20857
|
}), S = p.map((e) => {
|
|
20852
20858
|
let t = {
|
|
20853
20859
|
id: e.id,
|
|
20854
|
-
rectA:
|
|
20855
|
-
rectB:
|
|
20860
|
+
rectA: fS(e.rectA),
|
|
20861
|
+
rectB: fS(e.rectB),
|
|
20856
20862
|
horizontal: e.horizontal ? { ...e.horizontal } : null,
|
|
20857
20863
|
vertical: e.vertical ? { ...e.vertical } : null
|
|
20858
20864
|
}, n = e.elementRefA ? g.get(e.elementRefA) : void 0, r = e.elementRefB ? g.get(e.elementRefB) : void 0;
|
|
@@ -20860,7 +20866,7 @@ function mS(e) {
|
|
|
20860
20866
|
});
|
|
20861
20867
|
return {
|
|
20862
20868
|
schema: "mesurer.context/v1",
|
|
20863
|
-
id:
|
|
20869
|
+
id: mS(r),
|
|
20864
20870
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
20865
20871
|
scope: c,
|
|
20866
20872
|
page: {
|
|
@@ -20875,7 +20881,7 @@ function mS(e) {
|
|
|
20875
20881
|
scrollY: r.scrollY
|
|
20876
20882
|
},
|
|
20877
20883
|
coordinateSpace: "viewport-css-px",
|
|
20878
|
-
regions: c.kind === "workspace" ? [] : s.map(
|
|
20884
|
+
regions: c.kind === "workspace" ? [] : s.map(fS),
|
|
20879
20885
|
visualState: {
|
|
20880
20886
|
rulersVisible: a.rulersVisible,
|
|
20881
20887
|
xrayVisible: a.xrayVisible
|
|
@@ -20889,48 +20895,48 @@ function mS(e) {
|
|
|
20889
20895
|
}
|
|
20890
20896
|
};
|
|
20891
20897
|
}
|
|
20892
|
-
var
|
|
20893
|
-
function
|
|
20898
|
+
var gS = (e) => `${Math.round(e * 100) / 100}px`, _S = (e) => `x=${gS(e.left)} y=${gS(e.top)} w=${gS(e.width)} h=${gS(e.height)}`;
|
|
20899
|
+
function vS(e) {
|
|
20894
20900
|
let t = [
|
|
20895
20901
|
"Mesurer visual context",
|
|
20896
20902
|
"",
|
|
20897
20903
|
`Page: ${e.page.url}`,
|
|
20898
20904
|
`Viewport: ${e.viewport.width} × ${e.viewport.height} CSS px; scroll x=${e.viewport.scrollX} y=${e.viewport.scrollY}`
|
|
20899
20905
|
];
|
|
20900
|
-
if (e.scope.kind === "annotation" ? t.push("", "Annotation", e.scope.note, `Target status: ${e.scope.targetStatus}`) : t.push("", `Scope: ${e.scope.kind}`), e.regions.length && (t.push("", "Requested regions"), e.regions.forEach((e, n) => t.push(`- region-${n + 1}: ${
|
|
20906
|
+
if (e.scope.kind === "annotation" ? t.push("", "Annotation", e.scope.note, `Target status: ${e.scope.targetStatus}`) : t.push("", `Scope: ${e.scope.kind}`), e.regions.length && (t.push("", "Requested regions"), e.regions.forEach((e, n) => t.push(`- region-${n + 1}: ${_S(e)}`))), (e.visualState.rulersVisible || e.visualState.xrayVisible) && t.push("", `Visual state: rulers=${e.visualState.rulersVisible ? "on" : "off"}; x-ray=${e.visualState.xrayVisible ? "on" : "off"}`), e.targets.length) {
|
|
20901
20907
|
t.push("", "Targets");
|
|
20902
20908
|
for (let n of e.targets) {
|
|
20903
20909
|
let e = n.inspection;
|
|
20904
|
-
t.push(`[${n.ref}] ${e.selector}`, ` rect: ${
|
|
20910
|
+
t.push(`[${n.ref}] ${e.selector}`, ` rect: ${_S(e.rect)}`, ` margin: ${gS(e.margin.top)} ${gS(e.margin.right)} ${gS(e.margin.bottom)} ${gS(e.margin.left)}`, ` padding: ${gS(e.padding.top)} ${gS(e.padding.right)} ${gS(e.padding.bottom)} ${gS(e.padding.left)}`, ` layout: display=${e.layout.display}; position=${e.layout.position}; gap=${e.layout.gap}`, ` typography: ${e.typography.fontSize} / ${e.typography.lineHeight}; weight=${e.typography.fontWeight}; align=${e.typography.textAlign}`), e.text && t.push(` text: ${JSON.stringify(e.text)}`);
|
|
20905
20911
|
}
|
|
20906
20912
|
}
|
|
20907
20913
|
if (e.visualContext.guides.length) {
|
|
20908
20914
|
t.push("", "Relevant guides");
|
|
20909
|
-
for (let n of e.visualContext.guides) t.push(`- ${n.orientation} ${n.orientation === "vertical" ? "x" : "y"}=${
|
|
20915
|
+
for (let n of e.visualContext.guides) t.push(`- ${n.orientation} ${n.orientation === "vertical" ? "x" : "y"}=${gS(n.position)}`);
|
|
20910
20916
|
}
|
|
20911
20917
|
if (e.visualContext.layoutGuides.length) {
|
|
20912
20918
|
t.push("", "Layout guides");
|
|
20913
20919
|
for (let n of e.visualContext.layoutGuides) {
|
|
20914
20920
|
if (!n.visible) continue;
|
|
20915
|
-
let e = n.kind === "grid" ? `grid ${
|
|
20921
|
+
let e = n.kind === "grid" ? `grid ${gS(n.size)}` : `${n.count} ${n.kind}; gutter=${gS(n.gutter)}; offset=${gS(n.offset)}; align=${n.align}`;
|
|
20916
20922
|
t.push(`- ${e}; color=${n.color}; opacity=${Math.round(n.opacity * 100)}%`);
|
|
20917
20923
|
}
|
|
20918
20924
|
}
|
|
20919
20925
|
if (e.visualContext.measurements.length) {
|
|
20920
20926
|
t.push("", "Relevant measurements");
|
|
20921
|
-
for (let n of e.visualContext.measurements) t.push(`- ${n.targetRef ? `${n.targetRef}: ` : ""}${
|
|
20927
|
+
for (let n of e.visualContext.measurements) t.push(`- ${n.targetRef ? `${n.targetRef}: ` : ""}${_S(n.rect)}; delta=${gS(n.deltaX)} × ${gS(n.deltaY)}`);
|
|
20922
20928
|
}
|
|
20923
20929
|
if (e.visualContext.distances.length) {
|
|
20924
20930
|
t.push("", "Relevant distances");
|
|
20925
20931
|
for (let n of e.visualContext.distances) {
|
|
20926
|
-
let e = [n.targetARef, n.targetBRef].filter(Boolean).join(" → "), r = [n.horizontal ? `horizontal=${
|
|
20932
|
+
let e = [n.targetARef, n.targetBRef].filter(Boolean).join(" → "), r = [n.horizontal ? `horizontal=${gS(n.horizontal.value)}` : null, n.vertical ? `vertical=${gS(n.vertical.value)}` : null].filter(Boolean).join("; ");
|
|
20927
20933
|
t.push(`- ${e ? `${e}: ` : ""}${r || "overlapping"}`);
|
|
20928
20934
|
}
|
|
20929
20935
|
}
|
|
20930
20936
|
return t.join("\n").trimEnd();
|
|
20931
20937
|
}
|
|
20932
|
-
function
|
|
20933
|
-
let t =
|
|
20938
|
+
function yS(e) {
|
|
20939
|
+
let t = tS([
|
|
20934
20940
|
...e.regions,
|
|
20935
20941
|
...e.targets.map((e) => e.inspection.rect),
|
|
20936
20942
|
...e.visualContext.measurements.map((e) => e.rect),
|
|
@@ -20960,7 +20966,7 @@ function vS(e) {
|
|
|
20960
20966
|
captures: n
|
|
20961
20967
|
};
|
|
20962
20968
|
}
|
|
20963
|
-
var
|
|
20969
|
+
var bS = (e, t, n, r, i) => {
|
|
20964
20970
|
!Number.isFinite(r) || !Number.isFinite(i) || Math.abs(r - i) < .01 || e.push({
|
|
20965
20971
|
kind: t,
|
|
20966
20972
|
label: n,
|
|
@@ -20969,16 +20975,16 @@ var yS = (e, t, n, r, i) => {
|
|
|
20969
20975
|
delta: i - r,
|
|
20970
20976
|
unit: "px"
|
|
20971
20977
|
});
|
|
20972
|
-
},
|
|
20978
|
+
}, xS = (e, t, n, r) => e.push({
|
|
20973
20979
|
kind: "missing",
|
|
20974
20980
|
evidence: t,
|
|
20975
20981
|
id: n,
|
|
20976
20982
|
label: r
|
|
20977
|
-
}),
|
|
20978
|
-
function
|
|
20983
|
+
}), SS = (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;
|
|
20984
|
+
function CS(e) {
|
|
20979
20985
|
let t = e.runtime.annotation(e.annotationId);
|
|
20980
20986
|
if (!t) throw Error(`Mesurer annotation not found: ${e.annotationId}`);
|
|
20981
|
-
let n =
|
|
20987
|
+
let n = hS({
|
|
20982
20988
|
runtime: e.runtime,
|
|
20983
20989
|
ownerDocument: e.ownerDocument,
|
|
20984
20990
|
ownerWindow: e.ownerWindow,
|
|
@@ -20988,42 +20994,42 @@ function SS(e) {
|
|
|
20988
20994
|
if (n.scope.kind !== "annotation") throw Error("Mesurer annotation context invariant failed.");
|
|
20989
20995
|
let r = e.runtime.snapshot();
|
|
20990
20996
|
if (!r) throw Error("Mesurer workspace is not ready yet.");
|
|
20991
|
-
let i =
|
|
20997
|
+
let i = rS({
|
|
20992
20998
|
measurements: r.measurements,
|
|
20993
20999
|
activeMeasurement: r.activeMeasurement
|
|
20994
21000
|
}), a = [];
|
|
20995
21001
|
for (let e of t.baseline.targets) {
|
|
20996
21002
|
let t = n.targets.find((t) => t.ref === e.id);
|
|
20997
21003
|
if (!t) {
|
|
20998
|
-
|
|
21004
|
+
xS(a, "target", e.id, e.selector);
|
|
20999
21005
|
continue;
|
|
21000
21006
|
}
|
|
21001
|
-
|
|
21007
|
+
bS(a, "target-rect", `${t.inspection.selector} left`, e.rect.left, t.inspection.rect.left), bS(a, "target-rect", `${t.inspection.selector} top`, e.rect.top, t.inspection.rect.top), bS(a, "target-rect", `${t.inspection.selector} width`, e.rect.width, t.inspection.rect.width), bS(a, "target-rect", `${t.inspection.selector} height`, e.rect.height, t.inspection.rect.height);
|
|
21002
21008
|
}
|
|
21003
21009
|
for (let e of t.baseline.guides) {
|
|
21004
21010
|
let t = n.visualContext.guides.find((t) => t.id === e.id) ?? r.guides.find((t) => t.id === e.id);
|
|
21005
21011
|
if (!t) {
|
|
21006
|
-
|
|
21012
|
+
xS(a, "guide", e.id, `${e.orientation} guide ${e.id}`);
|
|
21007
21013
|
continue;
|
|
21008
21014
|
}
|
|
21009
|
-
|
|
21015
|
+
bS(a, "guide", `${e.orientation} guide ${e.id}`, e.position, t.position);
|
|
21010
21016
|
}
|
|
21011
21017
|
for (let e of t.baseline.measurements) {
|
|
21012
21018
|
let r = n.visualContext.measurements.find((t) => t.id === e.id) ?? i.find((t) => t.id === e.id);
|
|
21013
21019
|
if (!r) {
|
|
21014
|
-
let r = t.baseline.targets.find((t) =>
|
|
21015
|
-
r && n.targets.some((e) => e.ref === r.id) ||
|
|
21020
|
+
let r = t.baseline.targets.find((t) => SS(t.rect, e.rect));
|
|
21021
|
+
r && n.targets.some((e) => e.ref === r.id) || xS(a, "measurement", e.id, e.id);
|
|
21016
21022
|
continue;
|
|
21017
21023
|
}
|
|
21018
|
-
|
|
21024
|
+
bS(a, "measurement", `${e.id} width`, e.rect.width, r.rect.width), bS(a, "measurement", `${e.id} height`, e.rect.height, r.rect.height);
|
|
21019
21025
|
}
|
|
21020
21026
|
for (let e of t.baseline.distances) {
|
|
21021
21027
|
let t = n.visualContext.distances.find((t) => t.id === e.id) ?? r.heldDistances.find((t) => t.id === e.id);
|
|
21022
21028
|
if (!t) {
|
|
21023
|
-
|
|
21029
|
+
xS(a, "distance", e.id, e.id);
|
|
21024
21030
|
continue;
|
|
21025
21031
|
}
|
|
21026
|
-
e.horizontal && t.horizontal ?
|
|
21032
|
+
e.horizontal && t.horizontal ? bS(a, "distance", `${e.id} horizontal`, e.horizontal.value, t.horizontal.value) : e.horizontal && !t.horizontal && xS(a, "distance", e.id, `${e.id} horizontal`), e.vertical && t.vertical ? bS(a, "distance", `${e.id} vertical`, e.vertical.value, t.vertical.value) : e.vertical && !t.vertical && xS(a, "distance", e.id, `${e.id} vertical`);
|
|
21027
21033
|
}
|
|
21028
21034
|
return {
|
|
21029
21035
|
schema: "mesurer.review/v1",
|
|
@@ -21035,7 +21041,7 @@ function SS(e) {
|
|
|
21035
21041
|
changes: a
|
|
21036
21042
|
};
|
|
21037
21043
|
}
|
|
21038
|
-
async function
|
|
21044
|
+
async function wS(e, t, n) {
|
|
21039
21045
|
try {
|
|
21040
21046
|
if (t.navigator.clipboard?.writeText) {
|
|
21041
21047
|
await t.navigator.clipboard.writeText(n);
|
|
@@ -21049,43 +21055,43 @@ async function CS(e, t, n) {
|
|
|
21049
21055
|
}
|
|
21050
21056
|
//#endregion
|
|
21051
21057
|
//#region src/layout-guides.ts
|
|
21052
|
-
var
|
|
21058
|
+
var TS = Kv, ES = qv, DS = () => ({
|
|
21053
21059
|
...yy(),
|
|
21054
|
-
version:
|
|
21055
|
-
}),
|
|
21060
|
+
version: Yx
|
|
21061
|
+
}), OS = "mesurer.context", kS = "context:v1", AS = "mesurer.context.settings", jS = "context.ui", MS = "data-mesurer-direct-text-edit-active", NS = {
|
|
21056
21062
|
viewBox: "0 0 256 256",
|
|
21057
21063
|
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"]
|
|
21058
|
-
},
|
|
21064
|
+
}, PS = {
|
|
21059
21065
|
viewBox: "0 0 256 256",
|
|
21060
21066
|
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"]
|
|
21061
|
-
},
|
|
21067
|
+
}, FS = {
|
|
21062
21068
|
viewBox: "0 0 256 256",
|
|
21063
21069
|
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"]
|
|
21064
|
-
},
|
|
21070
|
+
}, IS = async (e, t, n = 1) => {
|
|
21065
21071
|
await e.fonts?.ready;
|
|
21066
21072
|
for (let e = 0; e < Math.max(1, n); e += 1) await new Promise((e) => t.requestAnimationFrame(() => e()));
|
|
21067
|
-
},
|
|
21068
|
-
let i = async (i) =>
|
|
21073
|
+
}, LS = (e, t, n, r) => {
|
|
21074
|
+
let i = async (i) => hS({
|
|
21069
21075
|
runtime: e,
|
|
21070
21076
|
ownerDocument: t,
|
|
21071
21077
|
ownerWindow: n,
|
|
21072
21078
|
request: i,
|
|
21073
21079
|
layoutGuides: r()
|
|
21074
|
-
}), a = async (e) =>
|
|
21080
|
+
}), a = async (e) => vS(await i(e));
|
|
21075
21081
|
return {
|
|
21076
21082
|
context: i,
|
|
21077
21083
|
contextText: a,
|
|
21078
|
-
copyContext: async (e) =>
|
|
21084
|
+
copyContext: async (e) => wS(t, n, await a(e)),
|
|
21079
21085
|
select: async (r) => {
|
|
21080
21086
|
let a = Array.isArray(r) ? [...r] : [String(r)];
|
|
21081
|
-
return e.select(a), await
|
|
21087
|
+
return e.select(a), await IS(t, n), i({ scope: "selection" });
|
|
21082
21088
|
},
|
|
21083
21089
|
annotations: async () => e.annotations(),
|
|
21084
21090
|
removeAnnotation: async (r) => {
|
|
21085
|
-
e.removeAnnotation(r), await
|
|
21091
|
+
e.removeAnnotation(r), await IS(t, n);
|
|
21086
21092
|
},
|
|
21087
21093
|
review: async (i) => {
|
|
21088
|
-
if (await
|
|
21094
|
+
if (await IS(t, n), i) return CS({
|
|
21089
21095
|
runtime: e,
|
|
21090
21096
|
ownerDocument: t,
|
|
21091
21097
|
ownerWindow: n,
|
|
@@ -21093,7 +21099,7 @@ var wS = Kv, TS = qv, ES = () => ({
|
|
|
21093
21099
|
layoutGuides: r()
|
|
21094
21100
|
});
|
|
21095
21101
|
let a = r();
|
|
21096
|
-
return e.annotations().map((r) =>
|
|
21102
|
+
return e.annotations().map((r) => CS({
|
|
21097
21103
|
runtime: e,
|
|
21098
21104
|
ownerDocument: t,
|
|
21099
21105
|
ownerWindow: n,
|
|
@@ -21101,38 +21107,38 @@ var wS = Kv, TS = qv, ES = () => ({
|
|
|
21101
21107
|
layoutGuides: a
|
|
21102
21108
|
}));
|
|
21103
21109
|
},
|
|
21104
|
-
capturePlan: async (e) =>
|
|
21110
|
+
capturePlan: async (e) => yS(await i(e)),
|
|
21105
21111
|
prepareCapture: async () => {
|
|
21106
|
-
e.prepareCapture(), await
|
|
21112
|
+
e.prepareCapture(), await IS(t, n);
|
|
21107
21113
|
},
|
|
21108
21114
|
finishCapture: async () => {
|
|
21109
|
-
e.finishCapture(), await
|
|
21115
|
+
e.finishCapture(), await IS(t, n);
|
|
21110
21116
|
}
|
|
21111
21117
|
};
|
|
21112
|
-
},
|
|
21118
|
+
}, RS = (e) => {
|
|
21113
21119
|
let t = e.currentSelection();
|
|
21114
21120
|
return t.elements.length > 0 || t.region !== null;
|
|
21115
21121
|
};
|
|
21116
|
-
function
|
|
21122
|
+
function zS(e = {}) {
|
|
21117
21123
|
return {
|
|
21118
|
-
id:
|
|
21119
|
-
version:
|
|
21124
|
+
id: OS,
|
|
21125
|
+
version: Yx,
|
|
21120
21126
|
requires: ["runtime:solid"],
|
|
21121
|
-
provides: [
|
|
21127
|
+
provides: [kS],
|
|
21122
21128
|
setup(t) {
|
|
21123
21129
|
let n = t.service.get("runtime:solid");
|
|
21124
21130
|
if (!n) throw Error("Mesurer context plugin requires the renderer runtime service.");
|
|
21125
|
-
let r = n.createWorkspaceRuntime(
|
|
21126
|
-
t.service.provide(
|
|
21127
|
-
id:
|
|
21131
|
+
let r = n.createWorkspaceRuntime(OS), i = LS(r, n.ownerDocument, n.ownerWindow, () => t.service.get(ES)?.list() ?? []);
|
|
21132
|
+
t.service.provide(kS, i), t.state.register({
|
|
21133
|
+
id: AS,
|
|
21128
21134
|
initial: { ui: e.ui ?? !0 },
|
|
21129
21135
|
persist: !0
|
|
21130
21136
|
}), t.state.register({
|
|
21131
|
-
id:
|
|
21132
|
-
initial: { hasSelection:
|
|
21137
|
+
id: jS,
|
|
21138
|
+
initial: { hasSelection: RS(r) }
|
|
21133
21139
|
});
|
|
21134
|
-
let a = () => t.state.get("mesurer.context.settings")?.ui ?? !0, o = () => t.state.get(
|
|
21135
|
-
t.state.update(
|
|
21140
|
+
let a = () => t.state.get("mesurer.context.settings")?.ui ?? !0, o = () => t.state.get(jS)?.hasSelection === !0, s = (e) => {
|
|
21141
|
+
t.state.update(AS, (t) => ({
|
|
21136
21142
|
...t,
|
|
21137
21143
|
ui: e
|
|
21138
21144
|
}));
|
|
@@ -21146,12 +21152,12 @@ function RS(e = {}) {
|
|
|
21146
21152
|
region: e.region ? { ...e.region } : null
|
|
21147
21153
|
}, r.selectGestureActive() ? c?.abandonNoteComposer() : n && c?.closeNoteComposer();
|
|
21148
21154
|
let i = e.elements.length > 0 || e.region !== null;
|
|
21149
|
-
i !== (t.state.get(
|
|
21155
|
+
i !== (t.state.get(jS)?.hasSelection ?? !1) && t.state.update(jS, () => ({ hasSelection: i }));
|
|
21150
21156
|
});
|
|
21151
21157
|
t.command.register("context.copy", () => i.copyContext()), t.command.register("context.copy-selection", () => i.copyContext({ scope: "selection" }));
|
|
21152
21158
|
let g = () => {
|
|
21153
21159
|
let e = u?.element;
|
|
21154
|
-
e && (n.rendererRoot?.hasAttribute(
|
|
21160
|
+
e && (n.rendererRoot?.hasAttribute(MS) ? e.setAttribute(MS, "true") : e.removeAttribute(MS));
|
|
21155
21161
|
}, _ = () => {
|
|
21156
21162
|
d?.disconnect(), d = null, c = null, l?.(), l = null, u?.dispose(), u = null;
|
|
21157
21163
|
}, v = () => {
|
|
@@ -21160,7 +21166,7 @@ function RS(e = {}) {
|
|
|
21160
21166
|
let e = new n.ownerWindow.MutationObserver(g);
|
|
21161
21167
|
d = e, e.observe(n.rendererRoot, {
|
|
21162
21168
|
attributes: !0,
|
|
21163
|
-
attributeFilter: [
|
|
21169
|
+
attributeFilter: [MS]
|
|
21164
21170
|
}), g();
|
|
21165
21171
|
}
|
|
21166
21172
|
let e = {
|
|
@@ -21184,7 +21190,7 @@ function RS(e = {}) {
|
|
|
21184
21190
|
command: "context.copy",
|
|
21185
21191
|
order: 70,
|
|
21186
21192
|
toolbarMode: "always",
|
|
21187
|
-
icon:
|
|
21193
|
+
icon: NS,
|
|
21188
21194
|
hidden: () => !a()
|
|
21189
21195
|
}), t.tool.register({
|
|
21190
21196
|
id: "context.copy-selection",
|
|
@@ -21193,7 +21199,7 @@ function RS(e = {}) {
|
|
|
21193
21199
|
command: "context.copy-selection",
|
|
21194
21200
|
order: 71,
|
|
21195
21201
|
toolbarMode: "always",
|
|
21196
|
-
icon:
|
|
21202
|
+
icon: PS,
|
|
21197
21203
|
hidden: () => !a(),
|
|
21198
21204
|
disabled: () => !o()
|
|
21199
21205
|
}), t.tool.register({
|
|
@@ -21203,7 +21209,7 @@ function RS(e = {}) {
|
|
|
21203
21209
|
command: "context.add-note",
|
|
21204
21210
|
order: 72,
|
|
21205
21211
|
toolbarMode: "always",
|
|
21206
|
-
icon:
|
|
21212
|
+
icon: FS,
|
|
21207
21213
|
hidden: () => !a(),
|
|
21208
21214
|
disabled: () => !o()
|
|
21209
21215
|
}), t.settings.register({
|
|
@@ -21226,7 +21232,7 @@ function RS(e = {}) {
|
|
|
21226
21232
|
}
|
|
21227
21233
|
//#endregion
|
|
21228
21234
|
//#region src/host-layer.ts
|
|
21229
|
-
var
|
|
21235
|
+
var BS = {
|
|
21230
21236
|
display: "block",
|
|
21231
21237
|
position: "fixed",
|
|
21232
21238
|
inset: "0",
|
|
@@ -21268,48 +21274,48 @@ var zS = {
|
|
|
21268
21274
|
"letter-spacing": "normal",
|
|
21269
21275
|
direction: "ltr"
|
|
21270
21276
|
};
|
|
21271
|
-
function BS(e) {
|
|
21272
|
-
for (let [t, n] of Object.entries(zS)) e.style.setProperty(t, n, "important");
|
|
21273
|
-
}
|
|
21274
21277
|
function VS(e) {
|
|
21278
|
+
for (let [t, n] of Object.entries(BS)) e.style.setProperty(t, n, "important");
|
|
21279
|
+
}
|
|
21280
|
+
function HS(e) {
|
|
21275
21281
|
return "popover" in e && "showPopover" in e && typeof e.showPopover == "function" && "hidePopover" in e && typeof e.hidePopover == "function";
|
|
21276
21282
|
}
|
|
21277
|
-
var
|
|
21278
|
-
function
|
|
21279
|
-
if (!
|
|
21283
|
+
var US = (e) => "newState" in e, WS = (e) => e.localName === "dialog";
|
|
21284
|
+
function GS(e) {
|
|
21285
|
+
if (!WS(e) || !e.open) return !1;
|
|
21280
21286
|
try {
|
|
21281
21287
|
return e.matches(":modal");
|
|
21282
21288
|
} catch {
|
|
21283
21289
|
return !1;
|
|
21284
21290
|
}
|
|
21285
21291
|
}
|
|
21286
|
-
function
|
|
21287
|
-
|
|
21292
|
+
function KS(e, t, n = !0) {
|
|
21293
|
+
VS(e);
|
|
21288
21294
|
let r = e.ownerDocument, i = r.defaultView ?? window, a = t, o = !1, s = "fixed", c = !1, l = 0, u = [];
|
|
21289
|
-
if (n &&
|
|
21295
|
+
if (n && HS(e) && (e.popover = "manual"), t.append(e), n && HS(e)) try {
|
|
21290
21296
|
e.showPopover(), c = e.matches(":popover-open"), c && (s = "top-layer");
|
|
21291
21297
|
} catch {
|
|
21292
21298
|
e.removeAttribute("popover");
|
|
21293
21299
|
}
|
|
21294
21300
|
let d = () => {
|
|
21295
|
-
if (!(!c || !
|
|
21301
|
+
if (!(!c || !HS(e))) try {
|
|
21296
21302
|
e.matches(":popover-open") || e.showPopover();
|
|
21297
21303
|
} catch {}
|
|
21298
21304
|
}, f = (t) => {
|
|
21299
21305
|
if (e.parentNode === t) return;
|
|
21300
|
-
let n = c &&
|
|
21301
|
-
if (n &&
|
|
21306
|
+
let n = c && HS(e) && e.matches(":popover-open");
|
|
21307
|
+
if (n && HS(e)) try {
|
|
21302
21308
|
e.hidePopover();
|
|
21303
21309
|
} catch {}
|
|
21304
|
-
t.append(e),
|
|
21310
|
+
t.append(e), VS(e), n && d();
|
|
21305
21311
|
}, p = () => {
|
|
21306
|
-
u = u.filter((e) => e.isConnected &&
|
|
21312
|
+
u = u.filter((e) => e.isConnected && GS(e)), f(u.at(-1) ?? a);
|
|
21307
21313
|
}, m = (e) => {
|
|
21308
21314
|
u = u.filter((t) => t !== e), u.push(e), p();
|
|
21309
21315
|
}, h = (e) => {
|
|
21310
21316
|
u = u.filter((t) => t !== e), p();
|
|
21311
21317
|
}, g = () => {
|
|
21312
|
-
if (!(o || !c || !
|
|
21318
|
+
if (!(o || !c || !HS(e))) try {
|
|
21313
21319
|
e.matches(":popover-open") && e.hidePopover(), e.showPopover();
|
|
21314
21320
|
} catch {}
|
|
21315
21321
|
}, _ = () => {
|
|
@@ -21318,27 +21324,27 @@ function GS(e, t, n = !0) {
|
|
|
21318
21324
|
}));
|
|
21319
21325
|
}, v = (t) => {
|
|
21320
21326
|
if (!c || t.target === e) return;
|
|
21321
|
-
let n =
|
|
21327
|
+
let n = US(t) ? t.newState : void 0, r = t.target;
|
|
21322
21328
|
if (r instanceof i.Element) {
|
|
21323
|
-
if (
|
|
21324
|
-
n === "open" &&
|
|
21329
|
+
if (WS(r)) {
|
|
21330
|
+
n === "open" && GS(r) ? (m(r), _()) : n === "closed" ? h(r) : n === "open" && _();
|
|
21325
21331
|
return;
|
|
21326
21332
|
}
|
|
21327
21333
|
n === "open" && r.hasAttribute("popover") && _();
|
|
21328
21334
|
}
|
|
21329
21335
|
}, y = (e) => {
|
|
21330
21336
|
let t = e.target;
|
|
21331
|
-
t instanceof i.Element &&
|
|
21337
|
+
t instanceof i.Element && WS(t) && h(t);
|
|
21332
21338
|
}, b = () => {
|
|
21333
21339
|
r.fullscreenElement && _();
|
|
21334
21340
|
}, x = (e) => {
|
|
21335
|
-
|
|
21336
|
-
for (let t of e.querySelectorAll("dialog"))
|
|
21341
|
+
GS(e) && m(e);
|
|
21342
|
+
for (let t of e.querySelectorAll("dialog")) GS(t) && m(t);
|
|
21337
21343
|
}, S = new i.MutationObserver((e) => {
|
|
21338
21344
|
if (c) for (let t of e) {
|
|
21339
21345
|
if (t.type === "attributes") {
|
|
21340
21346
|
let e = t.target;
|
|
21341
|
-
e instanceof i.Element &&
|
|
21347
|
+
e instanceof i.Element && WS(e) && (GS(e) ? m(e) : h(e));
|
|
21342
21348
|
}
|
|
21343
21349
|
for (let e of t.addedNodes) e instanceof i.Element && x(e);
|
|
21344
21350
|
u.some((e) => !e.isConnected) && p();
|
|
@@ -21354,7 +21360,7 @@ function GS(e, t, n = !0) {
|
|
|
21354
21360
|
bringToFront: g,
|
|
21355
21361
|
dispose() {
|
|
21356
21362
|
if (!o) {
|
|
21357
|
-
if (o = !0, l && i.cancelAnimationFrame(l), r.removeEventListener("toggle", v, !0), r.removeEventListener("close", y, !0), r.removeEventListener("fullscreenchange", b, !0), S.disconnect(), c &&
|
|
21363
|
+
if (o = !0, l && i.cancelAnimationFrame(l), r.removeEventListener("toggle", v, !0), r.removeEventListener("close", y, !0), r.removeEventListener("fullscreenchange", b, !0), S.disconnect(), c && HS(e) && e.matches(":popover-open")) try {
|
|
21358
21364
|
e.hidePopover();
|
|
21359
21365
|
} catch {}
|
|
21360
21366
|
u = [];
|
|
@@ -21364,28 +21370,28 @@ function GS(e, t, n = !0) {
|
|
|
21364
21370
|
}
|
|
21365
21371
|
//#endregion
|
|
21366
21372
|
//#region src/plugins/codex/index.ts
|
|
21367
|
-
var
|
|
21373
|
+
var qS = "mesurer.codex", JS = "codex:v1", YS = "mesurer.plugin.before-disable", XS = 2e3, ZS = 750, QS = 1800, $S = 2e3, eC = 12e4, tC = 10, nC = 5, rC = "Codex host connection is unavailable. Electron apps must expose window.__MESURER_HOST__.codexBridge from preload.", iC = [
|
|
21368
21374
|
"Implement the current human feedback from Mesurer in this project.",
|
|
21369
21375
|
"Treat the rendered page as the source of truth, preserve unrelated Mesurer review state,",
|
|
21370
21376
|
"and verify the affected UI in the live page with Mesurer before claiming completion."
|
|
21371
|
-
].join(" "),
|
|
21377
|
+
].join(" "), aC = {
|
|
21372
21378
|
viewBox: "0 0 256 256",
|
|
21373
21379
|
paths: ["M224,48,32,120l88,32,32,88Z M120,152l104-104"]
|
|
21374
|
-
},
|
|
21380
|
+
}, oC = {
|
|
21375
21381
|
viewBox: "0 0 256 256",
|
|
21376
21382
|
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"]
|
|
21377
|
-
},
|
|
21383
|
+
}, sC = {
|
|
21378
21384
|
viewBox: "0 0 256 256",
|
|
21379
21385
|
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"]
|
|
21380
|
-
},
|
|
21386
|
+
}, cC = () => {
|
|
21381
21387
|
try {
|
|
21382
21388
|
let e = globalThis.location;
|
|
21383
21389
|
return e?.origin ? `mesurer-codex-ui:v2:${e.origin}${e.pathname}` : null;
|
|
21384
21390
|
} catch {
|
|
21385
21391
|
return null;
|
|
21386
21392
|
}
|
|
21387
|
-
},
|
|
21388
|
-
let e =
|
|
21393
|
+
}, lC = () => {
|
|
21394
|
+
let e = cC();
|
|
21389
21395
|
if (!e) return null;
|
|
21390
21396
|
try {
|
|
21391
21397
|
let t = globalThis.sessionStorage?.getItem(e);
|
|
@@ -21410,18 +21416,18 @@ var KS = "mesurer.codex", qS = "codex:v1", JS = "mesurer.plugin.before-disable",
|
|
|
21410
21416
|
} catch {
|
|
21411
21417
|
return null;
|
|
21412
21418
|
}
|
|
21413
|
-
},
|
|
21414
|
-
let t =
|
|
21419
|
+
}, uC = (e) => {
|
|
21420
|
+
let t = cC();
|
|
21415
21421
|
if (t) try {
|
|
21416
21422
|
globalThis.sessionStorage?.setItem(t, JSON.stringify(e));
|
|
21417
21423
|
} catch {}
|
|
21418
|
-
},
|
|
21424
|
+
}, dC = async (e) => {
|
|
21419
21425
|
let t = window.__MESURER_HOST__?.codexBridge;
|
|
21420
|
-
if (!t) throw Error(
|
|
21426
|
+
if (!t) throw Error(rC);
|
|
21421
21427
|
let n = await t(e);
|
|
21422
21428
|
if (n.ok === !1) throw Error(n.error ?? "Codex Bridge request failed.");
|
|
21423
21429
|
return n;
|
|
21424
|
-
},
|
|
21430
|
+
}, fC = (e) => {
|
|
21425
21431
|
let t = e.runtime;
|
|
21426
21432
|
return !t || ![
|
|
21427
21433
|
"shared",
|
|
@@ -21439,10 +21445,10 @@ var KS = "mesurer.codex", qS = "codex:v1", JS = "mesurer.plugin.before-disable",
|
|
|
21439
21445
|
available: t.available === !0,
|
|
21440
21446
|
reason: t.reason
|
|
21441
21447
|
};
|
|
21442
|
-
},
|
|
21448
|
+
}, pC = (e) => ({
|
|
21443
21449
|
thread: e.thread?.trim() || null,
|
|
21444
21450
|
threads: Array.isArray(e.threads) ? e.threads.filter((e) => e.trim().length > 0) : []
|
|
21445
|
-
}),
|
|
21451
|
+
}), mC = (e) => {
|
|
21446
21452
|
let t = e.deliveryId?.trim(), n = e.thread?.trim(), r = e.status;
|
|
21447
21453
|
if (!t || !n || !r) throw Error("Codex Bridge returned an invalid delivery state.");
|
|
21448
21454
|
let i = {
|
|
@@ -21454,7 +21460,7 @@ var KS = "mesurer.codex", qS = "codex:v1", JS = "mesurer.plugin.before-disable",
|
|
|
21454
21460
|
updatedAt: Number.isFinite(e.updatedAt) ? Number(e.updatedAt) : 0
|
|
21455
21461
|
};
|
|
21456
21462
|
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;
|
|
21457
|
-
},
|
|
21463
|
+
}, hC = (e) => ({
|
|
21458
21464
|
thread: e.thread?.trim() || null,
|
|
21459
21465
|
threads: Array.isArray(e.threadDetails) ? e.threadDetails.flatMap((e) => {
|
|
21460
21466
|
let t = e.id?.trim() ?? "";
|
|
@@ -21466,7 +21472,7 @@ var KS = "mesurer.codex", qS = "codex:v1", JS = "mesurer.plugin.before-disable",
|
|
|
21466
21472
|
}] : [];
|
|
21467
21473
|
}) : [],
|
|
21468
21474
|
hasMore: e.hasMore === !0
|
|
21469
|
-
}),
|
|
21475
|
+
}), gC = async (e, t, n) => {
|
|
21470
21476
|
let r = t?.instruction?.trim() || n, i = await e.annotations(), a = t?.annotationIds, o = a ? a.flatMap((e) => {
|
|
21471
21477
|
let t = i.find((t) => t.id === e);
|
|
21472
21478
|
return t ? [t] : [];
|
|
@@ -21489,18 +21495,18 @@ var KS = "mesurer.codex", qS = "codex:v1", JS = "mesurer.plugin.before-disable",
|
|
|
21489
21495
|
])
|
|
21490
21496
|
].join("\n").trimEnd()
|
|
21491
21497
|
};
|
|
21492
|
-
},
|
|
21493
|
-
function
|
|
21494
|
-
let t = e.instruction?.trim() ||
|
|
21498
|
+
}, _C = (e) => e.length > 16 ? `${e.slice(0, 8)}…${e.slice(-4)}` : e, vC = (e, t = 42) => e.length > t ? `${e.slice(0, t - 1)}…` : e, yC = (e) => e instanceof Error && (e.message === rC || e.message === "Codex Bridge is unavailable in this host." || e.message.includes("Codex Bridge lease"));
|
|
21499
|
+
function bC(e = {}) {
|
|
21500
|
+
let t = e.instruction?.trim() || iC, n = e.ui ?? !0, r = e.clearCompletedAnnotations ?? !0;
|
|
21495
21501
|
return {
|
|
21496
|
-
id:
|
|
21497
|
-
version:
|
|
21498
|
-
requires: [
|
|
21499
|
-
provides: [
|
|
21502
|
+
id: qS,
|
|
21503
|
+
version: Yx,
|
|
21504
|
+
requires: [kS],
|
|
21505
|
+
provides: [JS],
|
|
21500
21506
|
async setup(e) {
|
|
21501
|
-
let i = e.service.get(
|
|
21507
|
+
let i = e.service.get(kS);
|
|
21502
21508
|
if (!i) throw Error("Mesurer Codex plugin requires context() from mesurer-solid/plugins.");
|
|
21503
|
-
let a = n ?
|
|
21509
|
+
let a = n ? lC() : null, o = "unknown", s = null, c = !1, l = a?.originThread ?? null, u = a?.selectedThread ?? a?.originThread ?? null, d = !1, f = null, p = [], m = [], h = !1, g = nC, _, v = "", y = null, b = a?.delivery ? {
|
|
21504
21510
|
id: a.delivery.id,
|
|
21505
21511
|
thread: a.delivery.thread,
|
|
21506
21512
|
status: a.delivery.status,
|
|
@@ -21509,38 +21515,38 @@ function yC(e = {}) {
|
|
|
21509
21515
|
dispatch: a.delivery.dispatch ?? null,
|
|
21510
21516
|
dispatchError: a.delivery.dispatchError ?? null
|
|
21511
21517
|
} : null, x = 0, S = 0, C = null, w = !1, T = null, E = async (e) => {
|
|
21512
|
-
if (e.action === "activate" || e.action === "runtime") return
|
|
21518
|
+
if (e.action === "activate" || e.action === "runtime") return dC(e);
|
|
21513
21519
|
if (!T) throw Error("Codex Bridge lease is not active for this plugin.");
|
|
21514
|
-
return
|
|
21520
|
+
return dC({
|
|
21515
21521
|
...e,
|
|
21516
21522
|
leaseId: T
|
|
21517
21523
|
});
|
|
21518
21524
|
}, D = async () => {
|
|
21519
21525
|
let e = T;
|
|
21520
21526
|
if (e) {
|
|
21521
|
-
if ((await
|
|
21527
|
+
if ((await dC({
|
|
21522
21528
|
action: "deactivate",
|
|
21523
21529
|
leaseId: e
|
|
21524
21530
|
})).released !== !0) throw Error("Codex Bridge did not confirm lease release.");
|
|
21525
21531
|
T = null;
|
|
21526
21532
|
}
|
|
21527
|
-
}, O = await
|
|
21533
|
+
}, O = await dC({
|
|
21528
21534
|
action: "activate",
|
|
21529
21535
|
thread: u ?? l ?? void 0
|
|
21530
21536
|
}), k = O.leaseId?.trim();
|
|
21531
21537
|
if (!k) throw Error("Codex Bridge did not return an activation lease.");
|
|
21532
|
-
T = k, o = "available", s =
|
|
21533
|
-
let A =
|
|
21538
|
+
T = k, o = "available", s = fC(O);
|
|
21539
|
+
let A = pC(O);
|
|
21534
21540
|
c = !0, f = A.thread, p = A.threads, e.lifecycle.onDispose(() => {
|
|
21535
21541
|
T && D().catch((e) => {
|
|
21536
21542
|
let t = e instanceof Error ? e.message : String(e);
|
|
21537
21543
|
console.error(`[Mesurer] Failed to release Codex host lease: ${t}`);
|
|
21538
21544
|
});
|
|
21539
|
-
}), e.hook.on(
|
|
21545
|
+
}), e.hook.on(YS, async (e) => {
|
|
21540
21546
|
e === "mesurer.codex" && await D();
|
|
21541
21547
|
});
|
|
21542
21548
|
let j = async () => {
|
|
21543
|
-
let e =
|
|
21549
|
+
let e = fC(await E({ action: "runtime" }));
|
|
21544
21550
|
if (!e) throw Error("Codex Bridge returned an invalid runtime state.");
|
|
21545
21551
|
return s = e, e;
|
|
21546
21552
|
}, M = async () => {
|
|
@@ -21548,8 +21554,8 @@ function yC(e = {}) {
|
|
|
21548
21554
|
action: "health",
|
|
21549
21555
|
thread: u ?? l ?? void 0
|
|
21550
21556
|
});
|
|
21551
|
-
return s =
|
|
21552
|
-
}, N = M, P = async (e) =>
|
|
21557
|
+
return s = fC(e) ?? s, pC(e);
|
|
21558
|
+
}, N = M, P = async (e) => mC(await E({
|
|
21553
21559
|
action: "delivery",
|
|
21554
21560
|
deliveryId: e
|
|
21555
21561
|
})), F = async (e) => {
|
|
@@ -21559,13 +21565,13 @@ function yC(e = {}) {
|
|
|
21559
21565
|
deliveryId: e.id,
|
|
21560
21566
|
thread: e.thread
|
|
21561
21567
|
};
|
|
21562
|
-
return e.queuedSubmissionId && (t.queuedSubmissionId = e.queuedSubmissionId),
|
|
21568
|
+
return e.queuedSubmissionId && (t.queuedSubmissionId = e.queuedSubmissionId), mC(await E(t));
|
|
21563
21569
|
}, I = async (e = {}) => {
|
|
21564
21570
|
let t = {
|
|
21565
21571
|
action: "threads",
|
|
21566
|
-
limit: e.limit ??
|
|
21572
|
+
limit: e.limit ?? tC
|
|
21567
21573
|
}, n = e.thread?.trim();
|
|
21568
|
-
return n && (t.thread = n),
|
|
21574
|
+
return n && (t.thread = n), hC(await E(t));
|
|
21569
21575
|
}, L = () => u ?? l ?? (d ? null : f), R = () => {
|
|
21570
21576
|
if (!n) return;
|
|
21571
21577
|
let e = b?.id && (b.status === "queued" || b.status === "working" || b.status === "interrupted") ? {
|
|
@@ -21577,7 +21583,7 @@ function yC(e = {}) {
|
|
|
21577
21583
|
dispatch: b.dispatch,
|
|
21578
21584
|
dispatchError: b.dispatchError
|
|
21579
21585
|
} : null;
|
|
21580
|
-
|
|
21586
|
+
uC({
|
|
21581
21587
|
version: 1,
|
|
21582
21588
|
originThread: l,
|
|
21583
21589
|
selectedThread: u,
|
|
@@ -21595,12 +21601,12 @@ function yC(e = {}) {
|
|
|
21595
21601
|
"queueing",
|
|
21596
21602
|
"queued",
|
|
21597
21603
|
"working"
|
|
21598
|
-
].includes(b.status) ?
|
|
21604
|
+
].includes(b.status) ? oC : b.status === "completed" ? sC : aC : aC, W = () => {
|
|
21599
21605
|
let e = [], t = /* @__PURE__ */ new Set(), n = (n) => {
|
|
21600
21606
|
t.has(n.id) || (t.add(n.id), e.push(n));
|
|
21601
21607
|
}, r = (e) => ({
|
|
21602
21608
|
id: e,
|
|
21603
|
-
title: `Codex ${
|
|
21609
|
+
title: `Codex ${_C(e)}`,
|
|
21604
21610
|
updatedAt: null,
|
|
21605
21611
|
connected: !0
|
|
21606
21612
|
});
|
|
@@ -21610,7 +21616,7 @@ function yC(e = {}) {
|
|
|
21610
21616
|
for (let e of m) n(e);
|
|
21611
21617
|
for (let e of p) n(m.find((t) => t.id === e) ?? r(e));
|
|
21612
21618
|
return e;
|
|
21613
|
-
},
|
|
21619
|
+
}, ee = (e = !1) => Promise.resolve(), te = () => {
|
|
21614
21620
|
if (o !== "available") {
|
|
21615
21621
|
let e = s?.source === "desktop" && s.reason === "desktop-private-transport", t = !window.__MESURER_HOST__?.codexBridge, n = [];
|
|
21616
21622
|
return o === "unavailable" && t && n.push({
|
|
@@ -21621,36 +21627,36 @@ function yC(e = {}) {
|
|
|
21621
21627
|
}), n.push({
|
|
21622
21628
|
id: "codex.thread.connect",
|
|
21623
21629
|
label: o === "unavailable" ? t ? "Retry host connection" : e ? "Retry Codex Desktop" : "Retry Codex connection" : "Choose Codex thread…",
|
|
21624
|
-
run: () =>
|
|
21630
|
+
run: () => ee(!0)
|
|
21625
21631
|
}), n;
|
|
21626
21632
|
}
|
|
21627
|
-
let e =
|
|
21633
|
+
let e = W(), t = e.slice(0, g), n = L(), r = t.map((e) => {
|
|
21628
21634
|
let t = e.id === l ? "Current · " : e.connected ? "Loaded · " : "", r = b?.thread === e.id ? ` · ${V(b.status)}` : "";
|
|
21629
21635
|
return {
|
|
21630
21636
|
id: `codex.thread.${e.id}`,
|
|
21631
|
-
label: `${t}${
|
|
21637
|
+
label: `${t}${vC(e.title)}${r}`,
|
|
21632
21638
|
checked: () => n === e.id,
|
|
21633
21639
|
disabled: () => B(),
|
|
21634
21640
|
run() {
|
|
21635
|
-
B() || (z(e.id, !l),
|
|
21641
|
+
B() || (z(e.id, !l), G());
|
|
21636
21642
|
}
|
|
21637
21643
|
};
|
|
21638
21644
|
});
|
|
21639
|
-
return g <
|
|
21645
|
+
return g < tC && (e.length > g || h) && r.push({
|
|
21640
21646
|
id: "codex.thread.show-more",
|
|
21641
21647
|
label: "Show 5 more…",
|
|
21642
21648
|
run() {
|
|
21643
|
-
g =
|
|
21649
|
+
g = tC, G();
|
|
21644
21650
|
}
|
|
21645
21651
|
}), b?.queuedSubmissionId && b.status === "queued" && (b.dispatch === "desktop-opened" || b.dispatch === "desktop-wake-failed") && r.push({
|
|
21646
21652
|
id: "codex.delivery.receipt",
|
|
21647
|
-
label: `Receipt · ${
|
|
21653
|
+
label: `Receipt · ${_C(b.queuedSubmissionId)}`,
|
|
21648
21654
|
disabled: () => !0,
|
|
21649
21655
|
run: () => void 0
|
|
21650
21656
|
}), r;
|
|
21651
|
-
},
|
|
21657
|
+
}, G = () => {
|
|
21652
21658
|
if (!n || w) return;
|
|
21653
|
-
let t = L(), r =
|
|
21659
|
+
let t = L(), r = te(), i = !B() && !d && o !== "unavailable" && (o === "unknown" || !!t), a = s?.source === "desktop" && s.reason === "desktop-private-transport", c = !window.__MESURER_HOST__?.codexBridge, l = H() ?? (o === "unavailable" ? c ? "Codex host not connected" : a ? "Codex Desktop not connected" : "Codex unavailable" : d || o === "available" && !t ? "Choose Codex thread" : "Queue to Codex"), u = JSON.stringify({
|
|
21654
21660
|
bridgeAvailability: o,
|
|
21655
21661
|
codexRuntime: s,
|
|
21656
21662
|
routeNeedsSelection: d,
|
|
@@ -21678,32 +21684,32 @@ function yC(e = {}) {
|
|
|
21678
21684
|
items: r
|
|
21679
21685
|
} : void 0
|
|
21680
21686
|
}));
|
|
21681
|
-
},
|
|
21687
|
+
}, ne = async (e) => {
|
|
21682
21688
|
if (o !== "available") return;
|
|
21683
21689
|
let t = await I({
|
|
21684
|
-
limit:
|
|
21690
|
+
limit: tC,
|
|
21685
21691
|
thread: e ?? void 0
|
|
21686
21692
|
});
|
|
21687
21693
|
m = t.threads, h = t.hasMore, p = t.threads.filter((e) => e.connected).map((e) => e.id), f = t.thread;
|
|
21688
21694
|
};
|
|
21689
|
-
|
|
21695
|
+
ee = (e = !1) => w || o === "unknown" && !e ? Promise.resolve() : y || (y = (async () => {
|
|
21690
21696
|
try {
|
|
21691
21697
|
let e = await N();
|
|
21692
|
-
o = "available", c = !0, f = e.thread, await
|
|
21698
|
+
o = "available", c = !0, f = e.thread, await ne(u ?? l ?? e.thread);
|
|
21693
21699
|
let t = u ?? l;
|
|
21694
21700
|
t && p.includes(t) ? d = !1 : p.length === 1 ? z(p[0], !0) : d = !0, !d && t && R();
|
|
21695
21701
|
} catch (e) {
|
|
21696
21702
|
throw o = "unavailable", s = await j().catch(() => s), e;
|
|
21697
21703
|
} finally {
|
|
21698
|
-
y = null,
|
|
21704
|
+
y = null, G();
|
|
21699
21705
|
}
|
|
21700
21706
|
})(), y);
|
|
21701
|
-
let
|
|
21707
|
+
let re = () => {
|
|
21702
21708
|
x &&= (globalThis.clearTimeout(x), 0), S &&= (globalThis.clearTimeout(S), 0);
|
|
21703
|
-
},
|
|
21709
|
+
}, ie = () => {
|
|
21704
21710
|
S && globalThis.clearTimeout(S), S = globalThis.setTimeout(() => {
|
|
21705
|
-
S = 0, b?.status === "completed" && (b = null, R(),
|
|
21706
|
-
},
|
|
21711
|
+
S = 0, b?.status === "completed" && (b = null, R(), G());
|
|
21712
|
+
}, QS);
|
|
21707
21713
|
}, ae = async (e) => {
|
|
21708
21714
|
if (!(!b || b.id !== e.id)) {
|
|
21709
21715
|
if (b = {
|
|
@@ -21714,25 +21720,25 @@ function yC(e = {}) {
|
|
|
21714
21720
|
dispatch: e.dispatch ?? b.dispatch,
|
|
21715
21721
|
dispatchError: e.dispatchError ?? b.dispatchError
|
|
21716
21722
|
}, R(), e.status === "queued" && (e.dispatch === "desktop-opened" || e.dispatch === "desktop-wake-failed")) {
|
|
21717
|
-
|
|
21723
|
+
G();
|
|
21718
21724
|
return;
|
|
21719
21725
|
}
|
|
21720
21726
|
if (e.status === "completed") {
|
|
21721
21727
|
if (r) for (let e of b.annotationIds) await i.removeAnnotation(e);
|
|
21722
|
-
R(),
|
|
21728
|
+
R(), G(), ie();
|
|
21723
21729
|
return;
|
|
21724
21730
|
}
|
|
21725
21731
|
if (e.status === "interrupted") {
|
|
21726
|
-
R(),
|
|
21732
|
+
R(), G();
|
|
21727
21733
|
let t = e.updatedAt > 0 ? e.updatedAt : Date.now();
|
|
21728
|
-
Date.now() - t <
|
|
21734
|
+
Date.now() - t < eC && (x = globalThis.setTimeout(() => {
|
|
21729
21735
|
x = 0, oe(e.id);
|
|
21730
|
-
},
|
|
21736
|
+
}, $S));
|
|
21731
21737
|
return;
|
|
21732
21738
|
}
|
|
21733
|
-
|
|
21739
|
+
G(), x = globalThis.setTimeout(() => {
|
|
21734
21740
|
x = 0, oe(e.id);
|
|
21735
|
-
},
|
|
21741
|
+
}, ZS);
|
|
21736
21742
|
}
|
|
21737
21743
|
}, oe = async (e) => {
|
|
21738
21744
|
if (!(w || b?.id !== e)) try {
|
|
@@ -21741,7 +21747,7 @@ function yC(e = {}) {
|
|
|
21741
21747
|
if (b?.id !== e) return;
|
|
21742
21748
|
let n = t;
|
|
21743
21749
|
if (b.status === "queued" && b.thread) try {
|
|
21744
|
-
o !== "available" && await
|
|
21750
|
+
o !== "available" && await ee(!0);
|
|
21745
21751
|
let e = await F(b);
|
|
21746
21752
|
await ae(e);
|
|
21747
21753
|
return;
|
|
@@ -21750,13 +21756,13 @@ function yC(e = {}) {
|
|
|
21750
21756
|
}
|
|
21751
21757
|
if (b?.id !== e) return;
|
|
21752
21758
|
if (b.status === "interrupted") {
|
|
21753
|
-
|
|
21759
|
+
G();
|
|
21754
21760
|
return;
|
|
21755
21761
|
}
|
|
21756
21762
|
b = {
|
|
21757
21763
|
...b,
|
|
21758
21764
|
status: "failed"
|
|
21759
|
-
}, R(),
|
|
21765
|
+
}, R(), yC(n) && (o = "unavailable"), G();
|
|
21760
21766
|
}
|
|
21761
21767
|
}, se = {
|
|
21762
21768
|
health: M,
|
|
@@ -21768,11 +21774,11 @@ function yC(e = {}) {
|
|
|
21768
21774
|
let n = await E({
|
|
21769
21775
|
action: "target",
|
|
21770
21776
|
thread: t
|
|
21771
|
-
}), r =
|
|
21772
|
-
return s =
|
|
21777
|
+
}), r = pC(n);
|
|
21778
|
+
return s = fC(n) ?? s, z(t, !l), f = r.thread, p = r.threads, o = "available", c = !0, G(), r;
|
|
21773
21779
|
},
|
|
21774
21780
|
async queue(e) {
|
|
21775
|
-
let r = await
|
|
21781
|
+
let r = await gC(i, e, t), a = e?.thread?.trim(), s = a || (n ? L() : null);
|
|
21776
21782
|
if (n && !a && (d || !s)) throw Error("Choose a Codex thread before queueing feedback.");
|
|
21777
21783
|
let c = { message: r.message };
|
|
21778
21784
|
s && (c.thread = s);
|
|
@@ -21792,16 +21798,16 @@ function yC(e = {}) {
|
|
|
21792
21798
|
};
|
|
21793
21799
|
return e.queuedSubmissionId !== void 0 && (n.queuedSubmissionId = e.queuedSubmissionId?.trim() || null), e.dispatch !== void 0 && (n.dispatch = e.dispatch), e.dispatchError !== void 0 && (n.dispatchError = e.dispatchError?.trim() || null), n;
|
|
21794
21800
|
} catch (e) {
|
|
21795
|
-
throw n &&
|
|
21801
|
+
throw n && yC(e) && (o = "unavailable", G()), e;
|
|
21796
21802
|
}
|
|
21797
21803
|
},
|
|
21798
21804
|
send(e) {
|
|
21799
21805
|
return se.queue(e);
|
|
21800
21806
|
}
|
|
21801
21807
|
};
|
|
21802
|
-
e.service.provide(
|
|
21808
|
+
e.service.provide(JS, se);
|
|
21803
21809
|
let ce = async () => {
|
|
21804
|
-
if (!(C || B())) return
|
|
21810
|
+
if (!(C || B())) return re(), b = {
|
|
21805
21811
|
id: null,
|
|
21806
21812
|
thread: L(),
|
|
21807
21813
|
status: "queueing",
|
|
@@ -21809,9 +21815,9 @@ function yC(e = {}) {
|
|
|
21809
21815
|
queuedSubmissionId: null,
|
|
21810
21816
|
dispatch: null,
|
|
21811
21817
|
dispatchError: null
|
|
21812
|
-
},
|
|
21818
|
+
}, G(), C = (async () => {
|
|
21813
21819
|
try {
|
|
21814
|
-
n && o !== "available" && await
|
|
21820
|
+
n && o !== "available" && await ee(!0);
|
|
21815
21821
|
let e = await se.queue();
|
|
21816
21822
|
b = {
|
|
21817
21823
|
id: e.deliveryId,
|
|
@@ -21821,7 +21827,7 @@ function yC(e = {}) {
|
|
|
21821
21827
|
queuedSubmissionId: e.queuedSubmissionId ?? null,
|
|
21822
21828
|
dispatch: e.dispatch ?? null,
|
|
21823
21829
|
dispatchError: e.dispatchError ?? null
|
|
21824
|
-
}, z(e.thread, !l), R(),
|
|
21830
|
+
}, z(e.thread, !l), R(), G(), console.info(`[Mesurer] Queued feedback for Codex thread ${e.thread}.`), e.deliveryId ? e.status === "completed" || e.status === "interrupted" ? await ae({
|
|
21825
21831
|
id: e.deliveryId,
|
|
21826
21832
|
thread: e.thread,
|
|
21827
21833
|
status: e.status,
|
|
@@ -21830,11 +21836,11 @@ function yC(e = {}) {
|
|
|
21830
21836
|
updatedAt: 0
|
|
21831
21837
|
}) : x = globalThis.setTimeout(() => {
|
|
21832
21838
|
x = 0, oe(e.deliveryId);
|
|
21833
|
-
},
|
|
21834
|
-
S = 0, b?.id === null && b?.status === "queued" && (b = null, R(),
|
|
21835
|
-
},
|
|
21839
|
+
}, ZS) : S = globalThis.setTimeout(() => {
|
|
21840
|
+
S = 0, b?.id === null && b?.status === "queued" && (b = null, R(), G());
|
|
21841
|
+
}, QS);
|
|
21836
21842
|
} catch (e) {
|
|
21837
|
-
b = null, R(),
|
|
21843
|
+
b = null, R(), G();
|
|
21838
21844
|
let t = e instanceof Error ? e.message : String(e);
|
|
21839
21845
|
throw console.error(`[Mesurer] Failed to queue feedback for Codex: ${t}`), e;
|
|
21840
21846
|
} finally {
|
|
@@ -21843,9 +21849,9 @@ function yC(e = {}) {
|
|
|
21843
21849
|
})(), C;
|
|
21844
21850
|
};
|
|
21845
21851
|
if (e.command.register("codex.queue", ce), e.command.register("codex.send", ce), n) {
|
|
21846
|
-
|
|
21852
|
+
G();
|
|
21847
21853
|
try {
|
|
21848
|
-
await
|
|
21854
|
+
await ee(!0);
|
|
21849
21855
|
} catch (e) {
|
|
21850
21856
|
try {
|
|
21851
21857
|
await D();
|
|
@@ -21859,10 +21865,10 @@ function yC(e = {}) {
|
|
|
21859
21865
|
x = 0, b?.id && oe(b.id);
|
|
21860
21866
|
}, 0));
|
|
21861
21867
|
let t = globalThis.setInterval(() => {
|
|
21862
|
-
c &&
|
|
21863
|
-
},
|
|
21868
|
+
c && ee().catch(() => void 0);
|
|
21869
|
+
}, XS);
|
|
21864
21870
|
e.lifecycle.onDispose(() => {
|
|
21865
|
-
w = !0,
|
|
21871
|
+
w = !0, re(), globalThis.clearInterval(t), _?.dispose(), _ = void 0;
|
|
21866
21872
|
});
|
|
21867
21873
|
}
|
|
21868
21874
|
}
|
|
@@ -21870,64 +21876,64 @@ function yC(e = {}) {
|
|
|
21870
21876
|
}
|
|
21871
21877
|
//#endregion
|
|
21872
21878
|
//#region src/recording.ts
|
|
21873
|
-
var
|
|
21874
|
-
...
|
|
21875
|
-
version:
|
|
21876
|
-
}),
|
|
21877
|
-
...
|
|
21878
|
-
version:
|
|
21879
|
-
}),
|
|
21879
|
+
var xC = vb, SC = (e = {}) => ({
|
|
21880
|
+
...Bb(e),
|
|
21881
|
+
version: Yx
|
|
21882
|
+
}), CC = Qb, wC = (e = {}) => ({
|
|
21883
|
+
...vx(e),
|
|
21884
|
+
version: Yx
|
|
21885
|
+
}), TC = () => globalThis.window?.__MESURER_HOST__?.codexBridge !== void 0, EC = [
|
|
21880
21886
|
{
|
|
21881
|
-
id:
|
|
21887
|
+
id: OS,
|
|
21882
21888
|
label: "Context",
|
|
21883
21889
|
order: 30,
|
|
21884
|
-
create:
|
|
21890
|
+
create: zS,
|
|
21885
21891
|
settingsIds: ["context"],
|
|
21886
21892
|
hiddenSettingsControlIds: ["ui"]
|
|
21887
21893
|
},
|
|
21888
21894
|
{
|
|
21889
|
-
id:
|
|
21895
|
+
id: Xx,
|
|
21890
21896
|
label: "Edit",
|
|
21891
21897
|
order: 35,
|
|
21892
|
-
create:
|
|
21898
|
+
create: Qx,
|
|
21893
21899
|
settingsIds: ["arrange"]
|
|
21894
21900
|
},
|
|
21895
21901
|
{
|
|
21896
|
-
id:
|
|
21902
|
+
id: TS,
|
|
21897
21903
|
label: "Layout Guides",
|
|
21898
21904
|
order: 38,
|
|
21899
|
-
create:
|
|
21905
|
+
create: DS
|
|
21900
21906
|
},
|
|
21901
21907
|
{
|
|
21902
|
-
id:
|
|
21908
|
+
id: CC,
|
|
21903
21909
|
label: "Screenshot",
|
|
21904
21910
|
order: 40,
|
|
21905
|
-
create:
|
|
21911
|
+
create: wC,
|
|
21906
21912
|
settingsIds: ["screenshot"],
|
|
21907
21913
|
hiddenSettingsControlIds: ["tool"]
|
|
21908
21914
|
},
|
|
21909
21915
|
{
|
|
21910
|
-
id:
|
|
21916
|
+
id: xC,
|
|
21911
21917
|
label: "Recording",
|
|
21912
21918
|
order: 42,
|
|
21913
|
-
create:
|
|
21919
|
+
create: SC,
|
|
21914
21920
|
settingsIds: ["recording"],
|
|
21915
21921
|
hiddenSettingsControlIds: ["tool"]
|
|
21916
21922
|
},
|
|
21917
21923
|
{
|
|
21918
|
-
id:
|
|
21924
|
+
id: qS,
|
|
21919
21925
|
label: "Codex",
|
|
21920
21926
|
order: 45,
|
|
21921
|
-
create:
|
|
21927
|
+
create: bC
|
|
21922
21928
|
}
|
|
21923
|
-
],
|
|
21924
|
-
let t = e !== void 0, n = new Map((e ?? []).map((e) => [e.id, e])), r = new Set(
|
|
21929
|
+
], DC = (e) => {
|
|
21930
|
+
let t = e !== void 0, n = new Map((e ?? []).map((e) => [e.id, e])), r = new Set(EC.map((e) => e.id)), i = EC.map((e) => {
|
|
21925
21931
|
let r = n.get(e.id);
|
|
21926
21932
|
return {
|
|
21927
21933
|
...e,
|
|
21928
21934
|
settingsIds: e.settingsIds ? [...e.settingsIds] : void 0,
|
|
21929
21935
|
hiddenSettingsControlIds: e.hiddenSettingsControlIds ? [...e.hiddenSettingsControlIds] : void 0,
|
|
21930
|
-
enabled: t ? !!r : e.id === "mesurer.codex" ?
|
|
21936
|
+
enabled: t ? !!r : e.id === "mesurer.codex" ? TC() : e.enabled !== !1,
|
|
21931
21937
|
create: r ? () => r : e.create
|
|
21932
21938
|
};
|
|
21933
21939
|
});
|
|
@@ -21938,16 +21944,16 @@ var bC = _b, xC = (e = {}) => ({
|
|
|
21938
21944
|
create: () => n
|
|
21939
21945
|
});
|
|
21940
21946
|
return i;
|
|
21941
|
-
},
|
|
21942
|
-
function
|
|
21943
|
-
return
|
|
21947
|
+
}, OC = (e) => e;
|
|
21948
|
+
function kC() {
|
|
21949
|
+
return lS();
|
|
21944
21950
|
}
|
|
21945
|
-
async function
|
|
21946
|
-
return
|
|
21951
|
+
async function AC(e = {}) {
|
|
21952
|
+
return uS(e);
|
|
21947
21953
|
}
|
|
21948
21954
|
//#endregion
|
|
21949
21955
|
//#region src/index.tsx
|
|
21950
|
-
var
|
|
21956
|
+
var jC = {
|
|
21951
21957
|
select: "select",
|
|
21952
21958
|
xray: "xray",
|
|
21953
21959
|
colorPicker: "color-picker",
|
|
@@ -21957,14 +21963,14 @@ var AC = {
|
|
|
21957
21963
|
distance: "distance",
|
|
21958
21964
|
settings: "settings"
|
|
21959
21965
|
};
|
|
21960
|
-
function
|
|
21966
|
+
function MC(e = {}) {
|
|
21961
21967
|
if (!("document" in globalThis)) throw Error("mountMesurer() requires a browser or Electron renderer document.");
|
|
21962
21968
|
let { target: t = document.body, isolate: n = !0, shadowMode: r = "open", topLayer: i = !0, agent: a = !1, signal: o, onPluginHost: s, onPluginsReady: c, plugins: l, excludeBuiltins: u, excludePlugins: d, ...f } = e;
|
|
21963
21969
|
if (o?.aborted) throw o.reason ?? new DOMException("Mesurer mount aborted.", "AbortError");
|
|
21964
21970
|
if (!t) throw Error("mountMesurer() requires document.body to exist or an explicit target.");
|
|
21965
21971
|
let p = t.ownerDocument ?? document, m = p.defaultView ?? window, h = p.createElement("div");
|
|
21966
21972
|
h.dataset.mesurerIsland = "true";
|
|
21967
|
-
let g =
|
|
21973
|
+
let g = KS(h, t, i), _ = h, v = h, y = h;
|
|
21968
21974
|
if (n) {
|
|
21969
21975
|
let e = h.attachShadow({ mode: r });
|
|
21970
21976
|
v = p.createElement("div"), v.dataset.mesurerIslandMount = "true", e.append(v), _ = e, y = e;
|
|
@@ -21975,7 +21981,7 @@ function jC(e = {}) {
|
|
|
21975
21981
|
C = e, w = t;
|
|
21976
21982
|
});
|
|
21977
21983
|
D.catch(() => void 0), O.catch(() => void 0);
|
|
21978
|
-
let k = async () => (await (b ? Promise.resolve(b) : D), O), A = a === !0 ? {} : a === !1 ? null : a, j =
|
|
21984
|
+
let k = async () => (await (b ? Promise.resolve(b) : D), O), A = a === !0 ? {} : a === !1 ? null : a, j = Jx({
|
|
21979
21985
|
ownerDocument: p,
|
|
21980
21986
|
root: A?.root ?? (t.nodeType === 11 ? t : p),
|
|
21981
21987
|
getPluginHost: () => b,
|
|
@@ -21987,23 +21993,23 @@ function jC(e = {}) {
|
|
|
21987
21993
|
return t;
|
|
21988
21994
|
}, N = async () => {
|
|
21989
21995
|
await j.ready();
|
|
21990
|
-
let e = b?.service.get(
|
|
21996
|
+
let e = b?.service.get(kS);
|
|
21991
21997
|
if (!e) throw Error("Mesurer Context is disabled. Enable it in Settings or include context() in plugins.");
|
|
21992
21998
|
return e;
|
|
21993
21999
|
}, P = async () => {
|
|
21994
22000
|
await j.ready();
|
|
21995
|
-
let e = b?.service.get(
|
|
22001
|
+
let e = b?.service.get($x);
|
|
21996
22002
|
if (!e) throw Error("Mesurer Edit is disabled. Enable it in Settings or include edit() in plugins.");
|
|
21997
22003
|
return e;
|
|
21998
|
-
}, F = async (e) => (await N()).context(e), I = async (e) => (await N()).contextText(e), L = async (e) => (await N()).copyContext(e), R = async (e) => (await N()).select(e), z = async () => (await N()).annotations(), B = async (e) => (await N()).review(e), V = async (e) => (await N()).capturePlan(e), H = async () => (await N()).prepareCapture(), U = async () => (await N()).finishCapture(),
|
|
22004
|
+
}, F = async (e) => (await N()).context(e), I = async (e) => (await N()).contextText(e), L = async (e) => (await N()).copyContext(e), R = async (e) => (await N()).select(e), z = async () => (await N()).annotations(), B = async (e) => (await N()).review(e), V = async (e) => (await N()).capturePlan(e), H = async () => (await N()).prepareCapture(), U = async () => (await N()).finishCapture(), W = async () => (await P()).intents(), ee = async (e) => {
|
|
21999
22005
|
let t = (await P()).intent(e);
|
|
22000
22006
|
if (!t) throw Error(`Edit movement intent not found: ${e}`);
|
|
22001
22007
|
return t;
|
|
22002
|
-
},
|
|
22008
|
+
}, te = async (e, t) => {
|
|
22003
22009
|
(await P()).show(e, t);
|
|
22004
|
-
},
|
|
22010
|
+
}, G = async (e, t) => (await P()).capturePlan(e, t), ne = async (e, t) => (await P()).review(e, t), re = () => j.textEdits(), ie = (e) => j.textEdit(e), ae = Object.assign(j, {
|
|
22005
22011
|
capabilities: () => {
|
|
22006
|
-
let e = !!b?.service.get(
|
|
22012
|
+
let e = !!b?.service.get(kS);
|
|
22007
22013
|
return {
|
|
22008
22014
|
protocol: "mesurer.agent/v1",
|
|
22009
22015
|
contextSchema: "mesurer.context/v1",
|
|
@@ -22013,8 +22019,8 @@ function jC(e = {}) {
|
|
|
22013
22019
|
annotations: e,
|
|
22014
22020
|
review: e,
|
|
22015
22021
|
capturePlan: e,
|
|
22016
|
-
arrange: !!b?.service.get(
|
|
22017
|
-
textEdit: !!b?.service.get(
|
|
22022
|
+
arrange: !!b?.service.get($x),
|
|
22023
|
+
textEdit: !!b?.service.get(Kx)
|
|
22018
22024
|
}
|
|
22019
22025
|
};
|
|
22020
22026
|
},
|
|
@@ -22026,16 +22032,16 @@ function jC(e = {}) {
|
|
|
22026
22032
|
capturePlan: V,
|
|
22027
22033
|
prepareCapture: H,
|
|
22028
22034
|
finishCapture: U,
|
|
22029
|
-
arrangements:
|
|
22030
|
-
arrange:
|
|
22031
|
-
showArrange:
|
|
22032
|
-
arrangeCapturePlan:
|
|
22033
|
-
reviewArrange:
|
|
22035
|
+
arrangements: W,
|
|
22036
|
+
arrange: ee,
|
|
22037
|
+
showArrange: te,
|
|
22038
|
+
arrangeCapturePlan: G,
|
|
22039
|
+
reviewArrange: ne
|
|
22034
22040
|
}), oe = {
|
|
22035
22041
|
...f,
|
|
22036
|
-
version:
|
|
22037
|
-
plugins:
|
|
22038
|
-
excludePlugins: u ? u.map((e) =>
|
|
22042
|
+
version: Yx,
|
|
22043
|
+
plugins: DC(l),
|
|
22044
|
+
excludePlugins: u ? u.map((e) => jC[e]) : [...d ?? []]
|
|
22039
22045
|
}, se = Oi(() => Yr(rv, Di(oe, {
|
|
22040
22046
|
portalTarget: y,
|
|
22041
22047
|
pageTarget: t,
|
|
@@ -22079,13 +22085,13 @@ function jC(e = {}) {
|
|
|
22079
22085
|
capturePlan: V,
|
|
22080
22086
|
prepareCapture: H,
|
|
22081
22087
|
finishCapture: U,
|
|
22082
|
-
arrangements:
|
|
22083
|
-
arrange:
|
|
22084
|
-
showArrange:
|
|
22085
|
-
arrangeCapturePlan:
|
|
22086
|
-
reviewArrange:
|
|
22087
|
-
textEdits:
|
|
22088
|
-
textEdit:
|
|
22088
|
+
arrangements: W,
|
|
22089
|
+
arrange: ee,
|
|
22090
|
+
showArrange: te,
|
|
22091
|
+
arrangeCapturePlan: G,
|
|
22092
|
+
reviewArrange: ne,
|
|
22093
|
+
textEdits: re,
|
|
22094
|
+
textEdit: ie,
|
|
22089
22095
|
bringToFront: g.bringToFront,
|
|
22090
22096
|
describe: async () => (await le).describe(),
|
|
22091
22097
|
dispose() {
|
|
@@ -22104,6 +22110,6 @@ function jC(e = {}) {
|
|
|
22104
22110
|
}
|
|
22105
22111
|
return me;
|
|
22106
22112
|
}
|
|
22107
|
-
var
|
|
22113
|
+
var NC = MC;
|
|
22108
22114
|
//#endregion
|
|
22109
|
-
export {
|
|
22115
|
+
export { Kx as MESURER_TEXT_EDIT_SERVICE_ID, Yx as MESURER_VERSION, hS as captureMesurerContext, wS as copyTextToClipboard, Jx as createMesurerAgentHarness, yS as createMesurerCapturePlan, kC as createMesurerPluginHost, AC as createMesurerRuntime, OC as defineMesurerPlugin, vS as formatMesurerContext, NC as mountMeasurer, MC as mountMesurer, CS as reviewMesurerAnnotation };
|