mesurer-solid 0.2.2-beta.2 → 0.2.2-beta.3
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 +435 -425
- package/dist/inject-script.js +3 -3
- package/dist/inject.js +435 -425
- package/dist/plugins.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -91,11 +91,11 @@ var I = 0, L = null, R = !1, z = !1, B = !1, V = 0, H = !1, U = /* @__PURE__ */
|
|
|
91
91
|
function ee(e) {
|
|
92
92
|
U.add(e);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function W(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 ne(e) {
|
|
108
108
|
H = e;
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function re() {
|
|
111
111
|
return {
|
|
112
112
|
de: I,
|
|
113
113
|
Qt: [],
|
|
@@ -124,7 +124,7 @@ function ie() {
|
|
|
124
124
|
ln: /* @__PURE__ */ new Set()
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
function
|
|
127
|
+
function ie(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 ae(e, t) {
|
|
|
136
136
|
}
|
|
137
137
|
for (let n of t.ln) e.ln.add(n);
|
|
138
138
|
}
|
|
139
|
-
function
|
|
139
|
+
function ae() {
|
|
140
140
|
if (z) {
|
|
141
141
|
se();
|
|
142
142
|
return;
|
|
@@ -184,7 +184,7 @@ var ce = 0, le = class {
|
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
186
|
enqueue(e, t) {
|
|
187
|
-
e && (yt ? E(yt).rn[e - 1].push(t) : this.bt[e - 1].push(t)),
|
|
187
|
+
e && (yt ? E(yt).rn[e - 1].push(t) : this.bt[e - 1].push(t)), ae();
|
|
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 ce = 0, le = class {
|
|
|
205
205
|
}
|
|
206
206
|
}, G = class e extends le {
|
|
207
207
|
gt = !1;
|
|
208
|
-
m =
|
|
208
|
+
m = re();
|
|
209
209
|
static Ce;
|
|
210
210
|
static me;
|
|
211
211
|
static et;
|
|
@@ -245,15 +245,15 @@ var ce = 0, le = class {
|
|
|
245
245
|
if (Pe(N, e.Ce), L) {
|
|
246
246
|
if (!Ce(L)) {
|
|
247
247
|
let t = L;
|
|
248
|
-
Pe(P, this.m === t ? F : e.Ce), this.m === t && (ye = this.m =
|
|
248
|
+
Pe(P, this.m === t ? F : e.Ce), this.m === t && (ye = this.m = re()), T.size && (e.In(1), e.In(2)), this.stashQueues(t.yt), I++, R = N.EE >= N.Ve || this.m.Qt.length > 0, _e(t.Qt), L = null, he(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, _e(n.Qt), he(t), n === t) {
|
|
253
|
-
let e =
|
|
253
|
+
let e = re();
|
|
254
254
|
e.Qt = n.Qt, e.Me = n.Me, e.A = n.A, e.cn = n.cn, ye = this.m = e;
|
|
255
255
|
}
|
|
256
|
-
} else
|
|
256
|
+
} else W(this) ? (me(), N.EE >= N.Ve && (Pe(N, e.Ce), me())) : (M.size && Pe(P, e.Ce), he());
|
|
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 ce = 0, le = 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 && ae();
|
|
273
273
|
}
|
|
274
274
|
}
|
|
275
275
|
return !0;
|
|
@@ -278,10 +278,10 @@ var ce = 0, le = class {
|
|
|
278
278
|
}
|
|
279
279
|
initTransition(e) {
|
|
280
280
|
if (e &&= we(e), e && e === L || !e && L && L.de === I) return;
|
|
281
|
-
if (!L) L = e ??
|
|
281
|
+
if (!L) L = e ?? re();
|
|
282
282
|
else if (e) {
|
|
283
283
|
let t = L;
|
|
284
|
-
|
|
284
|
+
ie(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 he(e = null, t = !1) {
|
|
|
341
341
|
let t = e ?? ve.m;
|
|
342
342
|
if (t.Me.length && G.En(t.Me), t.ln.size) {
|
|
343
343
|
for (let e of t.ln) e.se & 64 || De(e);
|
|
344
|
-
t.ln.clear(),
|
|
344
|
+
t.ln.clear(), ae();
|
|
345
345
|
}
|
|
346
|
-
t.A.length && (G.G(t.A), ve.vt.length && ge(ve)), t.cn.size && G.Dt(t.cn, e),
|
|
346
|
+
t.A.length && (G.G(t.A), ve.vt.length && ge(ve)), t.cn.size && G.Dt(t.cn, e), te(), T.size && G.dn(e);
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
function ge(e) {
|
|
@@ -698,7 +698,7 @@ function ct(e, t) {
|
|
|
698
698
|
let n = !1, r = /* @__PURE__ */ new Set(), i = (e) => {
|
|
699
699
|
r.has(e) || (r.add(e), e._ === t && (De(e), n = !0), at(e, i));
|
|
700
700
|
};
|
|
701
|
-
at(e, i), n &&
|
|
701
|
+
at(e, i), n && ae();
|
|
702
702
|
}
|
|
703
703
|
function lt(e) {
|
|
704
704
|
let t = !1, n, r = /* @__PURE__ */ new Set(), i = G.Se, a = (o) => {
|
|
@@ -708,7 +708,7 @@ function lt(e) {
|
|
|
708
708
|
s ? (c || it(o, s), i !== null && i(o)) : (o.S &= -2, c || it(o), i !== null && i(o), o.ue && (De(o), t = !0), o.ue = !1, !o.o && o.T & 32 && (n ??= []).push(o)), at(o, a);
|
|
709
709
|
};
|
|
710
710
|
if (at(e, a), n) for (let e of n) ot(e);
|
|
711
|
-
t &&
|
|
711
|
+
t && ae();
|
|
712
712
|
}
|
|
713
713
|
function ut(e) {
|
|
714
714
|
return typeof e == "object" && !!e && typeof e.then == "function";
|
|
@@ -754,7 +754,7 @@ function dt(e, t, n) {
|
|
|
754
754
|
} catch (t) {
|
|
755
755
|
pt(e, 2, t);
|
|
756
756
|
}
|
|
757
|
-
e.De === v && (e.Ee = !1), lt(e),
|
|
757
|
+
e.De === v && (e.Ee = !1), lt(e), ae(), be(), i?.();
|
|
758
758
|
}, l = () => e.T & 32 && !e.o && !(e.S & 1) ? (Qe(e), !0) : !1;
|
|
759
759
|
if (i) {
|
|
760
760
|
let n = !1, r = !1, i, o = !0;
|
|
@@ -787,7 +787,7 @@ function dt(e, t, n) {
|
|
|
787
787
|
if ((ut(_) ? _ : { 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 ? (ae(), be()) : 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 pt(e, t, n, r, i) {
|
|
|
820
820
|
at(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
|
-
De(e),
|
|
823
|
+
De(e), ae();
|
|
824
824
|
return;
|
|
825
825
|
}
|
|
826
826
|
!l && !e.Ne && ue(e), pt(e, t, n, l, u);
|
|
@@ -1050,10 +1050,10 @@ function Nt(e) {
|
|
|
1050
1050
|
function Pt(e, t) {
|
|
1051
1051
|
if (e.Ne && L !== e.Ne && ve.initTransition(e.Ne), e._e !== void 0 && !H) return G.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 && ue(e), e.De = t, (e.ge !== void 0 || e.pe !== void 0) && G.Pe !== null && G.Pe(e, t), e.de = I, fe(e),
|
|
1053
|
+
return typeof t == "function" && (t = t(n)), e.S & 4 || !e.be || !e.be(n, t) ? (e.De === v && ue(e), e.De = t, (e.ge !== void 0 || e.pe !== void 0) && G.Pe !== null && G.Pe(e, t), e.de = I, fe(e), ae(), t) : t;
|
|
1054
1054
|
}
|
|
1055
1055
|
function Ft(e) {
|
|
1056
|
-
je(e, Ee(e)), !(e.se & 1024) && e.De === v && (ue(e),
|
|
1056
|
+
je(e, Ee(e)), !(e.se & 1024) && e.De === v && (ue(e), ae()), e.se = e.se & -4 | g;
|
|
1057
1057
|
}
|
|
1058
1058
|
function It(e, t) {
|
|
1059
1059
|
let n = Pt(e, t);
|
|
@@ -1516,41 +1516,41 @@ function En(e, t) {
|
|
|
1516
1516
|
let n = {
|
|
1517
1517
|
get(e, t) {
|
|
1518
1518
|
let r;
|
|
1519
|
-
Yn(!0),
|
|
1519
|
+
Yn(!0), ne(!0);
|
|
1520
1520
|
try {
|
|
1521
1521
|
r = e[t];
|
|
1522
1522
|
} finally {
|
|
1523
|
-
Yn(!1),
|
|
1523
|
+
Yn(!1), ne(!1);
|
|
1524
1524
|
}
|
|
1525
1525
|
return t === On ? r : typeof r == "object" && r ? new Proxy(r, n) : r;
|
|
1526
1526
|
},
|
|
1527
1527
|
has(e, t) {
|
|
1528
1528
|
let n;
|
|
1529
|
-
Yn(!0),
|
|
1529
|
+
Yn(!0), ne(!0);
|
|
1530
1530
|
try {
|
|
1531
1531
|
n = t in e;
|
|
1532
1532
|
} finally {
|
|
1533
|
-
Yn(!1),
|
|
1533
|
+
Yn(!1), ne(!1);
|
|
1534
1534
|
}
|
|
1535
1535
|
return n;
|
|
1536
1536
|
},
|
|
1537
1537
|
set(n, r, i) {
|
|
1538
1538
|
if (e && !e()) return !0;
|
|
1539
|
-
Yn(!0),
|
|
1539
|
+
Yn(!0), ne(!0);
|
|
1540
1540
|
try {
|
|
1541
1541
|
n[r] = i, t?.();
|
|
1542
1542
|
} finally {
|
|
1543
|
-
Yn(!1),
|
|
1543
|
+
Yn(!1), ne(!1);
|
|
1544
1544
|
}
|
|
1545
1545
|
return !0;
|
|
1546
1546
|
},
|
|
1547
1547
|
deleteProperty(n, r) {
|
|
1548
1548
|
if (e && !e()) return !0;
|
|
1549
|
-
Yn(!0),
|
|
1549
|
+
Yn(!0), ne(!0);
|
|
1550
1550
|
try {
|
|
1551
1551
|
delete n[r], t?.();
|
|
1552
1552
|
} finally {
|
|
1553
|
-
Yn(!1),
|
|
1553
|
+
Yn(!1), ne(!1);
|
|
1554
1554
|
}
|
|
1555
1555
|
return !0;
|
|
1556
1556
|
}
|
|
@@ -7066,15 +7066,15 @@ var Su = (e) => Object.prototype.hasOwnProperty.call(e, "__codexWebMcpModelConte
|
|
|
7066
7066
|
}, Au = (e) => e.process?.type === "renderer" || !!e.process?.versions?.electron || /\bElectron\/\d/i.test(e.navigator.userAgent), ju = (e) => {
|
|
7067
7067
|
let t = e.navigator.platform || e.navigator.userAgent;
|
|
7068
7068
|
return /^Mac/i.test(t) || /\bMacintosh\b/i.test(e.navigator.userAgent);
|
|
7069
|
-
}, Mu = (e) => Au(e) && ju(e), Nu = (e, t) => Mu(e) ? {
|
|
7070
|
-
|
|
7071
|
-
y: Math.max(
|
|
7072
|
-
} : t,
|
|
7073
|
-
let a =
|
|
7074
|
-
return {
|
|
7069
|
+
}, Mu = (e) => Au(e) && ju(e), Nu = (e) => Mu(e) ? ku : Ou, Pu = (e, t, n) => Mu(e) && t.x < ku.x && t.y < 48 ? {
|
|
7070
|
+
...t,
|
|
7071
|
+
y: Math.max(n, 48)
|
|
7072
|
+
} : t, Fu = (e, t) => Pu(e, t ?? Nu(e), 8), Iu = (e, t, n, r, i = 8) => {
|
|
7073
|
+
let a = i, o = Math.max(i, r.width - n.width - i), s = Math.max(a, r.height - n.height - i);
|
|
7074
|
+
return Pu(e, {
|
|
7075
7075
|
x: Math.min(o, Math.max(i, t.x)),
|
|
7076
7076
|
y: Math.min(s, Math.max(a, t.y))
|
|
7077
|
-
};
|
|
7077
|
+
}, i);
|
|
7078
7078
|
}, Lu = [
|
|
7079
7079
|
"transform",
|
|
7080
7080
|
"translate",
|
|
@@ -7989,9 +7989,9 @@ function Fd(e) {
|
|
|
7989
7989
|
childList: !0,
|
|
7990
7990
|
characterData: !0
|
|
7991
7991
|
});
|
|
7992
|
-
let
|
|
7992
|
+
let W = i.setInterval(L, 250);
|
|
7993
7993
|
qt(() => {
|
|
7994
|
-
w = !0, o && (o.current = null), V?.disconnect(), I?.disconnect(), ee?.disconnect(), i.clearInterval(
|
|
7994
|
+
w = !0, o && (o.current = null), V?.disconnect(), I?.disconnect(), ee?.disconnect(), i.clearInterval(W), i.cancelAnimationFrame(v), l.dispose(), c.replaceChildren();
|
|
7995
7995
|
});
|
|
7996
7996
|
});
|
|
7997
7997
|
var i = X("div", {
|
|
@@ -8264,11 +8264,11 @@ function Wd(e) {
|
|
|
8264
8264
|
if (!t) return;
|
|
8265
8265
|
let n = Math.max(1, t.width - 16), r = Math.max(0, Math.min(1, (e - t.left - 8) / n)), i = Math.round((.1 + r * 3.9 - .1) / .05) * .05 + .1;
|
|
8266
8266
|
U(i);
|
|
8267
|
-
},
|
|
8267
|
+
}, W = (e) => {
|
|
8268
8268
|
if (!B()) return;
|
|
8269
8269
|
let t = E ?? T?.getBoundingClientRect();
|
|
8270
8270
|
t?.width && V((e - t.left) / t.width);
|
|
8271
|
-
},
|
|
8271
|
+
}, te = (e) => {
|
|
8272
8272
|
D === e && (D = null, E = null, T?.hasPointerCapture(e) && T.releasePointerCapture(e));
|
|
8273
8273
|
};
|
|
8274
8274
|
return Jr(() => h(), (e) => {
|
|
@@ -8385,16 +8385,16 @@ function Wd(e) {
|
|
|
8385
8385
|
"aria-valuemin": 0,
|
|
8386
8386
|
class: "mesurer-recording-timeline msr:relative msr:h-5 msr:min-w-0 msr:flex-1 msr:cursor-pointer msr:select-none",
|
|
8387
8387
|
onPointerDown: (e) => {
|
|
8388
|
-
B() && (E = e.currentTarget.getBoundingClientRect(), D = e.pointerId, e.currentTarget.setPointerCapture(e.pointerId),
|
|
8388
|
+
B() && (E = e.currentTarget.getBoundingClientRect(), D = e.pointerId, e.currentTarget.setPointerCapture(e.pointerId), W(e.clientX));
|
|
8389
8389
|
},
|
|
8390
8390
|
onPointerMove: (e) => {
|
|
8391
|
-
e.pointerId === D &&
|
|
8391
|
+
e.pointerId === D && W(e.clientX);
|
|
8392
8392
|
},
|
|
8393
8393
|
onPointerUp: (e) => {
|
|
8394
|
-
e.pointerId === D && (
|
|
8394
|
+
e.pointerId === D && (W(e.clientX), te(e.pointerId));
|
|
8395
8395
|
},
|
|
8396
|
-
onPointerCancel: (e) =>
|
|
8397
|
-
onLostPointerCapture: (e) =>
|
|
8396
|
+
onPointerCancel: (e) => te(e.pointerId),
|
|
8397
|
+
onLostPointerCapture: (e) => te(e.pointerId),
|
|
8398
8398
|
onKeyDown: (e) => {
|
|
8399
8399
|
if (B()) {
|
|
8400
8400
|
if (e.key === "Home" || e.key === "End") {
|
|
@@ -10051,38 +10051,38 @@ function tp(e) {
|
|
|
10051
10051
|
let [t, n] = K(e.initialPosition ?? {
|
|
10052
10052
|
x: 16,
|
|
10053
10053
|
y: 16
|
|
10054
|
-
}), [r, i] = K(!1), [a, o] = K(null), [s, c] = K(0), [l, u] = K("right"), [d, f] = K(!1), [p, m] = K(0), h = wo(e.ownerWindow), g, _, v, y, b, x, S, C = !1, w = null,
|
|
10055
|
-
|
|
10056
|
-
t ===
|
|
10054
|
+
}), [r, i] = K(!1), [a, o] = K(null), [s, c] = K(0), [l, u] = K("right"), [d, f] = K(!1), [p, m] = K(0), h = wo(e.ownerWindow), g, _, v, y, b, x, S, C = !1, w = null, T = null, [E, D] = K(!1), O = 0, k = 0, A = 0, j = 0, M = () => g?.ownerDocument.defaultView ?? e.ownerWindow, N = () => (e.pluginTools ?? []).some((e) => e.id === "recording" && (e.active?.() ?? !1)), P = () => N() ? null : e.motion?.element() ?? null, F = (e, t) => {
|
|
10055
|
+
M().queueMicrotask(() => {
|
|
10056
|
+
t === j && (D(e), be());
|
|
10057
10057
|
});
|
|
10058
|
-
},
|
|
10059
|
-
let e =
|
|
10060
|
-
if (
|
|
10061
|
-
|
|
10058
|
+
}, I = () => {
|
|
10059
|
+
let e = M(), t = ++j;
|
|
10060
|
+
if (O &&= (e.clearTimeout(O), 0), !Du(e)) {
|
|
10061
|
+
F(!1, t);
|
|
10062
10062
|
return;
|
|
10063
10063
|
}
|
|
10064
|
-
|
|
10065
|
-
|
|
10064
|
+
O = e.setTimeout(() => {
|
|
10065
|
+
O = 0, t === j && F(Du(M()), t);
|
|
10066
10066
|
}, 100);
|
|
10067
|
-
},
|
|
10067
|
+
}, L = () => e.model.state.toolMode === "select", R = () => e.model.state.xrayVisible, z = () => e.model.state.colorPickerActive, B = () => e.model.state.rulersVisible, V = () => e.model.state.toolMode === "text-inspector" || (e.typographyContextActive ?? !1), H = () => e.model.state.toolMode === "guides", U = () => e.model.state.settingsOpen, ee = () => (e.pluginTools ?? []).find((e) => e.modeSwitch === !0 && e.toolbarMode === "edit"), W = () => ee()?.active?.() ? "edit" : "select", te = () => (e.pluginTools ?? []).filter((e) => e.toolbarMode === "select" && !e.modeSwitch), ne = () => (e.pluginTools ?? []).filter((e) => e.toolbarMode === "edit" && !e.modeSwitch), re = () => (e.pluginTools ?? []).filter((e) => e.toolbarMode === "always" || e.toolbarMode === void 0), ie = () => re().some((e) => e.active?.() ?? !1), ae = () => L() || R() || z() || B() || V() || H(), oe = (e, t = !1) => t || !d() || e, se = () => re().length > 0 && (!d() || ae() || ie()), ce = () => !d() || ae() || ie() || U(), le = () => !r() && !a() && !e.model.state.settingsOpen, G = () => r() || a() !== null || e.model.state.settingsOpen, ue = (t) => e.isBuiltinActionDisabled?.(t) ?? !1, de = () => e.ownerWindow.innerHeight || 0, fe = () => t().y < 56, pe = () => de() > 0 && t().y > de() - 56, me = () => fe() && !pe() ? "bottom" : "top", he = () => {
|
|
10068
10068
|
t();
|
|
10069
10069
|
let e = v?.getBoundingClientRect();
|
|
10070
|
-
if (!e) return
|
|
10071
|
-
let n = Math.max(0,
|
|
10070
|
+
if (!e) return pe() ? "top" : "bottom";
|
|
10071
|
+
let n = Math.max(0, de() - e.bottom - Yf), r = Math.max(0, e.top - Yf);
|
|
10072
10072
|
return n >= Xf || n >= r ? "bottom" : "top";
|
|
10073
|
-
},
|
|
10073
|
+
}, ge = () => {
|
|
10074
10074
|
t();
|
|
10075
10075
|
let e = g?.getBoundingClientRect();
|
|
10076
|
-
if (!e) return
|
|
10077
|
-
let n = Math.max(0,
|
|
10076
|
+
if (!e) return pe() ? "top" : "bottom";
|
|
10077
|
+
let n = Math.max(0, de() - e.bottom - Yf), r = Math.max(0, e.top - Yf);
|
|
10078
10078
|
return n >= Zf || n >= r ? "bottom" : "top";
|
|
10079
|
-
},
|
|
10080
|
-
t(), d(),
|
|
10079
|
+
}, _e = () => {
|
|
10080
|
+
t(), d(), U(), p();
|
|
10081
10081
|
let n = _?.getBoundingClientRect();
|
|
10082
10082
|
if (!n) return 0;
|
|
10083
10083
|
let r = e.ownerWindow.innerWidth || 288, i = Math.min(Jf, Math.max(0, r - 16)), a = n.right + 4 - i, o = Math.max(Yf, r - Yf - i);
|
|
10084
10084
|
return Math.min(o, Math.max(Yf, a)) - n.left;
|
|
10085
|
-
},
|
|
10085
|
+
}, ve = () => {
|
|
10086
10086
|
t(), d(), p();
|
|
10087
10087
|
let n = g?.getBoundingClientRect(), r = e.ownerWindow.innerWidth || 368, i = e.ownerWindow.innerHeight || 276, a = Math.min(Qf, Math.max(0, r - 16));
|
|
10088
10088
|
if (!n) return {
|
|
@@ -10106,7 +10106,7 @@ function tp(e) {
|
|
|
10106
10106
|
width: a,
|
|
10107
10107
|
maxHeight: c
|
|
10108
10108
|
};
|
|
10109
|
-
},
|
|
10109
|
+
}, ye = () => {
|
|
10110
10110
|
let t = v?.getBoundingClientRect();
|
|
10111
10111
|
if (!t) return;
|
|
10112
10112
|
let n = t.right - Bf, r = t.left + Bf;
|
|
@@ -10119,17 +10119,17 @@ function tp(e) {
|
|
|
10119
10119
|
return;
|
|
10120
10120
|
}
|
|
10121
10121
|
u("right");
|
|
10122
|
-
},
|
|
10122
|
+
}, xe = (t) => {
|
|
10123
10123
|
let n = (t.menu?.items ?? []).reduce((t, n) => {
|
|
10124
10124
|
let r = e.model.state.settings.shortcutsEnabled && n.shortcut ? n.shortcut.length + 2 : 0;
|
|
10125
10125
|
return Math.max(t, n.label.length + r);
|
|
10126
10126
|
}, 0);
|
|
10127
10127
|
return Math.min(Hf, Math.max(Vf, Math.ceil(n * Uf + Wf)));
|
|
10128
|
-
},
|
|
10128
|
+
}, Se = (n) => {
|
|
10129
10129
|
t(), p();
|
|
10130
|
-
let r = S?.getBoundingClientRect(), i = e.ownerWindow.innerWidth || 240, a =
|
|
10130
|
+
let r = S?.getBoundingClientRect(), i = e.ownerWindow.innerWidth || 240, a = de(), o = Math.min(xe(n), Math.max(0, i - 16));
|
|
10131
10131
|
if (!r) return {
|
|
10132
|
-
side:
|
|
10132
|
+
side: pe() ? "top" : "bottom",
|
|
10133
10133
|
left: 0,
|
|
10134
10134
|
width: o,
|
|
10135
10135
|
maxHeight: Math.max(0, a - 16)
|
|
@@ -10141,64 +10141,70 @@ function tp(e) {
|
|
|
10141
10141
|
width: o,
|
|
10142
10142
|
maxHeight: d
|
|
10143
10143
|
};
|
|
10144
|
-
},
|
|
10144
|
+
}, Ce = (e, t) => {
|
|
10145
10145
|
if (a() === e) {
|
|
10146
10146
|
o(null), S = void 0;
|
|
10147
10147
|
return;
|
|
10148
10148
|
}
|
|
10149
10149
|
S = t, o(e);
|
|
10150
|
-
},
|
|
10150
|
+
}, we = (r) => {
|
|
10151
10151
|
if (r.button !== 0) return;
|
|
10152
10152
|
let a = e.ownerWindow.Element, s = r.target;
|
|
10153
10153
|
if (s instanceof a && s.closest(zf)) return;
|
|
10154
10154
|
let c = e.ownerWindow.document.documentElement;
|
|
10155
10155
|
w === null && (w = c.style.userSelect, c.style.setProperty("user-select", "none", "important"));
|
|
10156
|
-
let l = r.clientX, u = r.clientY
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
|
|
10160
|
-
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
|
|
10164
|
-
|
|
10165
|
-
|
|
10156
|
+
let l = r.clientX, u = r.clientY;
|
|
10157
|
+
T?.();
|
|
10158
|
+
let d = t(), f = r.currentTarget, p = f.getBoundingClientRect(), m = f.style.transform, h = f.style.willChange, g = !1, _ = !1, v = 0, y = d, b = r.pointerId, x = () => {
|
|
10159
|
+
v = 0, f.style.transform = `translate3d(${y.x - d.x}px, ${y.y - d.y}px, 0)`;
|
|
10160
|
+
}, E = (t) => {
|
|
10161
|
+
if (t.pointerId !== b) return;
|
|
10162
|
+
let n = t.clientX - l, r = t.clientY - u;
|
|
10163
|
+
if (!g) {
|
|
10164
|
+
if (g = Math.abs(n) > Rf || Math.abs(r) > Rf, !g) return;
|
|
10165
|
+
i(!1), o(null), S = void 0, f.style.willChange = "transform", e.model.current.settingsOpen && e.model.setTransient({ settingsOpen: !1 });
|
|
10166
|
+
}
|
|
10167
|
+
_ = !0, y = Iu(e.ownerWindow, {
|
|
10168
|
+
x: d.x + n,
|
|
10169
|
+
y: d.y + r
|
|
10166
10170
|
}, {
|
|
10167
|
-
width:
|
|
10168
|
-
height:
|
|
10171
|
+
width: p.width,
|
|
10172
|
+
height: p.height
|
|
10169
10173
|
}, {
|
|
10170
10174
|
width: e.ownerWindow.innerWidth,
|
|
10171
10175
|
height: e.ownerWindow.innerHeight
|
|
10172
|
-
}));
|
|
10173
|
-
},
|
|
10174
|
-
|
|
10176
|
+
}), v ||= e.ownerWindow.requestAnimationFrame(x);
|
|
10177
|
+
}, D = (t) => {
|
|
10178
|
+
v && e.ownerWindow.cancelAnimationFrame(v), v = 0, _ && t && (n(y), e.onPositionChange?.(y)), f.style.transform = m, f.style.willChange = h, w !== null && (c.style.userSelect = w, w = null), e.ownerWindow.removeEventListener("pointermove", E), e.ownerWindow.removeEventListener("pointerup", O), e.ownerWindow.removeEventListener("pointercancel", O), T = null;
|
|
10179
|
+
}, O = (e) => {
|
|
10180
|
+
e.pointerId === b && (C = _, D(e.type === "pointerup"));
|
|
10175
10181
|
};
|
|
10176
|
-
e.ownerWindow.addEventListener("pointermove",
|
|
10177
|
-
},
|
|
10182
|
+
T = () => D(!1), e.ownerWindow.addEventListener("pointermove", E), e.ownerWindow.addEventListener("pointerup", O), e.ownerWindow.addEventListener("pointercancel", O);
|
|
10183
|
+
}, Te = (t) => {
|
|
10178
10184
|
e.model.setEnabled(!0), e.model.current.toolMode !== "guides" && e.model.toggleToolMode("guides"), e.model.setGuideOrientation(t, !0), i(!1);
|
|
10179
|
-
}, Te = () => {
|
|
10180
|
-
let t = !d();
|
|
10181
|
-
t && (i(!1), o(null)), O && e.ownerWindow.clearTimeout(O), y && (y.dataset.compactMotion = "true"), f(t), O = e.ownerWindow.setTimeout(() => {
|
|
10182
|
-
O = 0, y && delete y.dataset.compactMotion, m((e) => e + 1);
|
|
10183
|
-
}, 170);
|
|
10184
10185
|
}, Ee = () => {
|
|
10185
|
-
|
|
10186
|
-
|
|
10186
|
+
let t = !d();
|
|
10187
|
+
t && (i(!1), o(null)), k && e.ownerWindow.clearTimeout(k), y && (y.dataset.compactMotion = "true"), f(t), k = e.ownerWindow.setTimeout(() => {
|
|
10188
|
+
k = 0, y && delete y.dataset.compactMotion, m((e) => e + 1);
|
|
10187
10189
|
}, 170);
|
|
10188
10190
|
}, De = () => {
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
+
A && e.ownerWindow.clearTimeout(A), y && (y.dataset.modeMotion = "true"), A = e.ownerWindow.setTimeout(() => {
|
|
10192
|
+
A = 0, y && delete y.dataset.modeMotion;
|
|
10193
|
+
}, 170);
|
|
10191
10194
|
}, Oe = () => {
|
|
10192
|
-
let t =
|
|
10193
|
-
|
|
10194
|
-
}, ke = (
|
|
10195
|
+
let t = ee();
|
|
10196
|
+
t?.active?.() && (o(null), De(), e.onPluginTool?.(t));
|
|
10197
|
+
}, ke = () => {
|
|
10198
|
+
let t = ee();
|
|
10199
|
+
!t || t.disabled?.() || (i(!1), o(null), De(), e.onPluginTool?.(t));
|
|
10200
|
+
}, Ae = (t) => ({
|
|
10195
10201
|
shortcutsEnabled: e.model.state.settings.shortcutsEnabled,
|
|
10196
|
-
tooltipVisible:
|
|
10202
|
+
tooltipVisible: le() && h.visibleTooltipId() === t,
|
|
10197
10203
|
tooltipInstant: h.tooltipInstant(),
|
|
10198
|
-
tooltipSide:
|
|
10204
|
+
tooltipSide: me(),
|
|
10199
10205
|
onTooltipEnter: h.onTooltipEnter,
|
|
10200
10206
|
onTooltipLeave: h.onTooltipLeave
|
|
10201
|
-
}),
|
|
10207
|
+
}), je = (t) => Y(q, {
|
|
10202
10208
|
get when() {
|
|
10203
10209
|
return a() === t.id;
|
|
10204
10210
|
},
|
|
@@ -10245,22 +10251,22 @@ function tp(e) {
|
|
|
10245
10251
|
})()
|
|
10246
10252
|
})), J(() => ({
|
|
10247
10253
|
e: t.id,
|
|
10248
|
-
t:
|
|
10249
|
-
a: `mesurer-menu-surface msr:absolute msr:z-[70] msr:rounded-lg msr:border msr:border-ink-200 msr:bg-white msr:p-1 msr:outline-none msr:flex msr:flex-col msr:gap-px msr:overflow-x-hidden msr:overflow-y-auto ${
|
|
10254
|
+
t: Se(t).side,
|
|
10255
|
+
a: `mesurer-menu-surface msr:absolute msr:z-[70] msr:rounded-lg msr:border msr:border-ink-200 msr:bg-white msr:p-1 msr:outline-none msr:flex msr:flex-col msr:gap-px msr:overflow-x-hidden msr:overflow-y-auto ${Se(t).side === "top" ? "msr:bottom-full msr:mb-2" : "msr:top-full msr:mt-2"}`,
|
|
10250
10256
|
o: {
|
|
10251
|
-
left: `${
|
|
10257
|
+
left: `${Se(t).left}px`,
|
|
10252
10258
|
right: "auto",
|
|
10253
|
-
width: `${
|
|
10254
|
-
"max-height": `${
|
|
10259
|
+
width: `${Se(t).width}px`,
|
|
10260
|
+
"max-height": `${Se(t).maxHeight}px`
|
|
10255
10261
|
},
|
|
10256
10262
|
i: t.menu?.label ?? `${t.label} options`
|
|
10257
10263
|
}), ({ e, t, a: r, o: i, i: a }, o) => {
|
|
10258
10264
|
e !== o?.e && $(n, "data-mesurer-tool-menu", e, o?.e), t !== o?.t && $(n, "data-mesurer-menu-side", t, o?.t), r !== o?.a && $(n, "class", r, o?.a), i !== o?.o && $(n, "style", i, o?.o), a !== o?.i && $(n, "aria-label", a, o?.i);
|
|
10259
10265
|
}), n;
|
|
10260
10266
|
}
|
|
10261
|
-
}),
|
|
10267
|
+
}), Me = (t, n = !1) => Y(Pf, {
|
|
10262
10268
|
get visible() {
|
|
10263
|
-
return
|
|
10269
|
+
return oe(t.active?.() ?? !1, n);
|
|
10264
10270
|
},
|
|
10265
10271
|
get children() {
|
|
10266
10272
|
return Y(q, {
|
|
@@ -10288,7 +10294,7 @@ function tp(e) {
|
|
|
10288
10294
|
return t.shortcut;
|
|
10289
10295
|
},
|
|
10290
10296
|
onClick: () => e.onPluginTool?.(t)
|
|
10291
|
-
}, () =>
|
|
10297
|
+
}, () => Ae(`plugin:${t.id}`), { get children() {
|
|
10292
10298
|
return Y(Lf, { tool: t });
|
|
10293
10299
|
} }));
|
|
10294
10300
|
},
|
|
@@ -10299,7 +10305,7 @@ function tp(e) {
|
|
|
10299
10305
|
}), r = X("button", {
|
|
10300
10306
|
type: "button",
|
|
10301
10307
|
onMouseEnter: () => h.onTooltipEnter(`plugin-menu:${t.id}`),
|
|
10302
|
-
onClick: (e) =>
|
|
10308
|
+
onClick: (e) => Ce(t.id, e.currentTarget.parentElement ?? e.currentTarget)
|
|
10303
10309
|
});
|
|
10304
10310
|
return Z(n, r), Q(n, Y(Nf, ra({
|
|
10305
10311
|
get id() {
|
|
@@ -10321,22 +10327,22 @@ function tp(e) {
|
|
|
10321
10327
|
return t.shortcut;
|
|
10322
10328
|
},
|
|
10323
10329
|
onClick: () => e.onPluginTool?.(t)
|
|
10324
|
-
}, () =>
|
|
10330
|
+
}, () => Ae(`plugin:${t.id}`), { get children() {
|
|
10325
10331
|
return Y(Lf, { tool: t });
|
|
10326
10332
|
} })), r), Q(r, Y(tf, { size: 8 }), null), Q(r, Y(Co, {
|
|
10327
10333
|
get label() {
|
|
10328
10334
|
return `${t.label} options`;
|
|
10329
10335
|
},
|
|
10330
10336
|
get visible() {
|
|
10331
|
-
return ea(() => !!
|
|
10337
|
+
return ea(() => !!le())() ? h.visibleTooltipId() === `plugin-menu:${t.id}` : le();
|
|
10332
10338
|
},
|
|
10333
10339
|
get instant() {
|
|
10334
10340
|
return h.tooltipInstant();
|
|
10335
10341
|
},
|
|
10336
10342
|
get side() {
|
|
10337
|
-
return
|
|
10343
|
+
return me();
|
|
10338
10344
|
}
|
|
10339
|
-
}), null), Q(n, () =>
|
|
10345
|
+
}), null), Q(n, () => je(t), null), J(() => ({
|
|
10340
10346
|
e: t.id,
|
|
10341
10347
|
t: t.id,
|
|
10342
10348
|
a: `${t.label} options`,
|
|
@@ -10351,8 +10357,8 @@ function tp(e) {
|
|
|
10351
10357
|
}
|
|
10352
10358
|
});
|
|
10353
10359
|
return en(() => {
|
|
10354
|
-
|
|
10355
|
-
let t = () =>
|
|
10360
|
+
I();
|
|
10361
|
+
let t = () => I(), n = (t) => {
|
|
10356
10362
|
let n = t.composedPath();
|
|
10357
10363
|
r() && v && !n.includes(v) && i(!1);
|
|
10358
10364
|
let s = n.some((e) => e instanceof Element && e.getAttribute("data-mesurer-plugin-menu-root") === "true");
|
|
@@ -10362,10 +10368,10 @@ function tp(e) {
|
|
|
10362
10368
|
}, c = (e) => {
|
|
10363
10369
|
e.key !== "Escape" || !a() || (e.preventDefault(), e.stopPropagation(), o(null));
|
|
10364
10370
|
}, l = () => {
|
|
10365
|
-
r() &&
|
|
10371
|
+
r() && ye(), m((e) => e + 1);
|
|
10366
10372
|
}, u = e.ownerWindow.document;
|
|
10367
10373
|
return e.ownerWindow.addEventListener("pointerdown", n), e.ownerWindow.addEventListener("focus", t), e.ownerWindow.addEventListener("pageshow", t), e.ownerWindow.document.addEventListener("visibilitychange", t), u.addEventListener("keydown", c, !0), e.ownerWindow.addEventListener("resize", l), g?.addEventListener("click", s, !0), () => {
|
|
10368
|
-
|
|
10374
|
+
j += 1, O &&= (M().clearTimeout(O), 0), k &&= (e.ownerWindow.clearTimeout(k), 0), A &&= (e.ownerWindow.clearTimeout(A), 0), e.ownerWindow.removeEventListener("pointerdown", n), e.ownerWindow.removeEventListener("focus", t), e.ownerWindow.removeEventListener("pageshow", t), e.ownerWindow.document.removeEventListener("visibilitychange", t), u.removeEventListener("keydown", c, !0), e.ownerWindow.removeEventListener("resize", l), g?.removeEventListener("click", s, !0), T?.(), w !== null && (e.ownerWindow.document.documentElement.style.userSelect = w);
|
|
10369
10375
|
};
|
|
10370
10376
|
}), en(() => {
|
|
10371
10377
|
let t = y, n = b, r = x;
|
|
@@ -10383,9 +10389,9 @@ function tp(e) {
|
|
|
10383
10389
|
e.ownerWindow.cancelAnimationFrame(s), o?.disconnect();
|
|
10384
10390
|
};
|
|
10385
10391
|
}), [ea((() => {
|
|
10386
|
-
let t =
|
|
10392
|
+
let t = P();
|
|
10387
10393
|
if (!t) return null;
|
|
10388
|
-
let n =
|
|
10394
|
+
let n = ve();
|
|
10389
10395
|
var r = X("div", {
|
|
10390
10396
|
"data-mesurer-motion-surface": "true",
|
|
10391
10397
|
"data-mesurer-inspector-ui": "true",
|
|
@@ -10410,10 +10416,10 @@ function tp(e) {
|
|
|
10410
10416
|
"data-mesurer-toolbar": "true",
|
|
10411
10417
|
"data-mesurer-inspector-ui": "true",
|
|
10412
10418
|
onPointerDown: (t) => {
|
|
10413
|
-
t.stopPropagation(), e.model.setTransient({ toolbarActive: !0 }),
|
|
10419
|
+
t.stopPropagation(), e.model.setTransient({ toolbarActive: !0 }), we(t);
|
|
10414
10420
|
},
|
|
10415
10421
|
onClick: (e) => e.stopPropagation(),
|
|
10416
|
-
onMouseEnter:
|
|
10422
|
+
onMouseEnter: I
|
|
10417
10423
|
}), o = X("div", { class: "mesurer-toolbar-mode-stage" }), u = X("div", { class: "mesurer-toolbar-mode-track" }), f = X("div", {
|
|
10418
10424
|
class: "mesurer-toolbar-mode-slot",
|
|
10419
10425
|
"data-mode": "select"
|
|
@@ -10428,44 +10434,44 @@ function tp(e) {
|
|
|
10428
10434
|
role: "group",
|
|
10429
10435
|
"aria-label": "Shared guide tools",
|
|
10430
10436
|
class: "msr:flex msr:items-stretch msr:py-1"
|
|
10431
|
-
}),
|
|
10437
|
+
}), T = X("div", { class: "msr:flex msr:items-stretch msr:px-0.5 msr:py-1" }), D = X("div", { class: "msr:flex msr:items-center msr:p-1" }), O = X("button", {
|
|
10432
10438
|
type: "button",
|
|
10433
10439
|
"data-mesurer-toolbar-compact-toggle": "true",
|
|
10434
10440
|
class: "msr:flex msr:size-7 msr:select-none msr:items-center msr:justify-center msr:rounded-[7px] msr:text-black msr:outline-none msr:hover:bg-black/4",
|
|
10435
|
-
onClick:
|
|
10441
|
+
onClick: Ee
|
|
10436
10442
|
});
|
|
10437
|
-
return Z(n, o), Z(n, w), Z(n,
|
|
10443
|
+
return Z(n, o), Z(n, w), Z(n, T), Z(n, D), aa(() => (e) => {
|
|
10438
10444
|
g = e;
|
|
10439
10445
|
}, n), Q(n, Y(If, {
|
|
10440
10446
|
get value() {
|
|
10441
|
-
return
|
|
10447
|
+
return W();
|
|
10442
10448
|
},
|
|
10443
10449
|
get editDisabled() {
|
|
10444
|
-
return !
|
|
10450
|
+
return !ee() || (ee()?.disabled?.() ?? !1);
|
|
10445
10451
|
},
|
|
10446
10452
|
get editToolId() {
|
|
10447
|
-
return
|
|
10453
|
+
return ee()?.id;
|
|
10448
10454
|
},
|
|
10449
10455
|
get editOptionsAvailable() {
|
|
10450
|
-
return (
|
|
10456
|
+
return (ee()?.menu?.items.length ?? 0) > 0;
|
|
10451
10457
|
},
|
|
10452
10458
|
get editOptionsOpen() {
|
|
10453
|
-
return a() ===
|
|
10459
|
+
return a() === ee()?.id;
|
|
10454
10460
|
},
|
|
10455
10461
|
get editOptions() {
|
|
10456
|
-
return ea(() => !!
|
|
10462
|
+
return ea(() => !!ee())() ? je(ee()) : null;
|
|
10457
10463
|
},
|
|
10458
10464
|
get shortcutsEnabled() {
|
|
10459
10465
|
return e.model.state.settings.shortcutsEnabled;
|
|
10460
10466
|
},
|
|
10461
10467
|
get tooltipVisibleId() {
|
|
10462
|
-
return ea(() => !!
|
|
10468
|
+
return ea(() => !!le())() ? h.visibleTooltipId() : null;
|
|
10463
10469
|
},
|
|
10464
10470
|
get tooltipInstant() {
|
|
10465
10471
|
return h.tooltipInstant();
|
|
10466
10472
|
},
|
|
10467
10473
|
get tooltipSide() {
|
|
10468
|
-
return
|
|
10474
|
+
return me();
|
|
10469
10475
|
},
|
|
10470
10476
|
get onTooltipEnter() {
|
|
10471
10477
|
return h.onTooltipEnter;
|
|
@@ -10473,11 +10479,11 @@ function tp(e) {
|
|
|
10473
10479
|
get onTooltipLeave() {
|
|
10474
10480
|
return h.onTooltipLeave;
|
|
10475
10481
|
},
|
|
10476
|
-
onSelect:
|
|
10477
|
-
onEdit:
|
|
10482
|
+
onSelect: Oe,
|
|
10483
|
+
onEdit: ke,
|
|
10478
10484
|
onEditOptions: (e) => {
|
|
10479
|
-
let t =
|
|
10480
|
-
!t || t.disabled?.() ||
|
|
10485
|
+
let t = ee();
|
|
10486
|
+
!t || t.disabled?.() || Ce(t.id, e);
|
|
10481
10487
|
}
|
|
10482
10488
|
}), o), Q(n, Y(Ff, { marker: "mode" }), o), Z(o, u), aa(() => (e) => {
|
|
10483
10489
|
y = e;
|
|
@@ -10485,63 +10491,63 @@ function tp(e) {
|
|
|
10485
10491
|
b = e;
|
|
10486
10492
|
}, p), Q(m, Y(Pf, {
|
|
10487
10493
|
get visible() {
|
|
10488
|
-
return
|
|
10494
|
+
return oe(L());
|
|
10489
10495
|
},
|
|
10490
10496
|
get children() {
|
|
10491
10497
|
return Y(Nf, ra({
|
|
10492
10498
|
id: "select",
|
|
10493
10499
|
builtin: "select",
|
|
10494
10500
|
get active() {
|
|
10495
|
-
return
|
|
10501
|
+
return L();
|
|
10496
10502
|
},
|
|
10497
10503
|
label: "Select",
|
|
10498
10504
|
shortcut: "S",
|
|
10499
10505
|
onClick: () => e.onBuiltinAction("select")
|
|
10500
|
-
}, () =>
|
|
10506
|
+
}, () => Ae("select"), { get children() {
|
|
10501
10507
|
return Y(Yd, { size: 20 });
|
|
10502
10508
|
} }));
|
|
10503
10509
|
}
|
|
10504
10510
|
}), null), Q(m, Y(Pf, {
|
|
10505
10511
|
get visible() {
|
|
10506
|
-
return
|
|
10512
|
+
return oe(R());
|
|
10507
10513
|
},
|
|
10508
10514
|
get children() {
|
|
10509
10515
|
return Y(Nf, ra({
|
|
10510
10516
|
id: "xray",
|
|
10511
10517
|
builtin: "xray",
|
|
10512
10518
|
get active() {
|
|
10513
|
-
return
|
|
10519
|
+
return R();
|
|
10514
10520
|
},
|
|
10515
10521
|
label: "X-ray",
|
|
10516
10522
|
shortcut: "X",
|
|
10517
10523
|
onClick: () => e.onBuiltinAction("xray")
|
|
10518
|
-
}, () =>
|
|
10524
|
+
}, () => Ae("xray"), { get children() {
|
|
10519
10525
|
return Y($d, { size: 20 });
|
|
10520
10526
|
} }));
|
|
10521
10527
|
}
|
|
10522
10528
|
}), null), Q(m, Y(q, {
|
|
10523
10529
|
get when() {
|
|
10524
|
-
return
|
|
10530
|
+
return E();
|
|
10525
10531
|
},
|
|
10526
10532
|
get children() {
|
|
10527
10533
|
return Y(Pf, {
|
|
10528
10534
|
get visible() {
|
|
10529
|
-
return
|
|
10535
|
+
return oe(z());
|
|
10530
10536
|
},
|
|
10531
10537
|
get children() {
|
|
10532
10538
|
return Y(Nf, ra({
|
|
10533
10539
|
id: "color-picker",
|
|
10534
10540
|
builtin: "color-picker",
|
|
10535
10541
|
get active() {
|
|
10536
|
-
return
|
|
10542
|
+
return z();
|
|
10537
10543
|
},
|
|
10538
10544
|
get disabled() {
|
|
10539
|
-
return
|
|
10545
|
+
return ue("color-picker");
|
|
10540
10546
|
},
|
|
10541
10547
|
label: "Color picker",
|
|
10542
10548
|
shortcut: "P",
|
|
10543
10549
|
onClick: () => e.onBuiltinAction("color-picker")
|
|
10544
|
-
}, () =>
|
|
10550
|
+
}, () => Ae("color-picker"), { get children() {
|
|
10545
10551
|
return Y(of, { size: 20 });
|
|
10546
10552
|
} }));
|
|
10547
10553
|
}
|
|
@@ -10549,22 +10555,22 @@ function tp(e) {
|
|
|
10549
10555
|
}
|
|
10550
10556
|
}), null), Q(m, Y(Pf, {
|
|
10551
10557
|
get visible() {
|
|
10552
|
-
return
|
|
10558
|
+
return oe(V());
|
|
10553
10559
|
},
|
|
10554
10560
|
get children() {
|
|
10555
10561
|
return Y(Nf, ra({
|
|
10556
10562
|
id: "text-inspector",
|
|
10557
10563
|
builtin: "text-inspector",
|
|
10558
10564
|
get active() {
|
|
10559
|
-
return
|
|
10565
|
+
return V();
|
|
10560
10566
|
},
|
|
10561
10567
|
get disabled() {
|
|
10562
|
-
return
|
|
10568
|
+
return ue("text-inspector");
|
|
10563
10569
|
},
|
|
10564
10570
|
label: "Typography",
|
|
10565
10571
|
shortcut: "A",
|
|
10566
10572
|
onClick: () => e.onBuiltinAction("text-inspector")
|
|
10567
|
-
}, () =>
|
|
10573
|
+
}, () => Ae("text-inspector"), { get children() {
|
|
10568
10574
|
return Y(af, { size: 20 });
|
|
10569
10575
|
} }));
|
|
10570
10576
|
}
|
|
@@ -10583,7 +10589,7 @@ function tp(e) {
|
|
|
10583
10589
|
get each() {
|
|
10584
10590
|
return te();
|
|
10585
10591
|
},
|
|
10586
|
-
children: (e) =>
|
|
10592
|
+
children: (e) => Me(e, e.compactPinned ?? !1)
|
|
10587
10593
|
})), e;
|
|
10588
10594
|
})()];
|
|
10589
10595
|
}
|
|
@@ -10603,45 +10609,45 @@ function tp(e) {
|
|
|
10603
10609
|
get each() {
|
|
10604
10610
|
return ne();
|
|
10605
10611
|
},
|
|
10606
|
-
children: (e) =>
|
|
10612
|
+
children: (e) => Me(e)
|
|
10607
10613
|
})), e;
|
|
10608
10614
|
}
|
|
10609
10615
|
})), Q(w, Y(Pf, {
|
|
10610
10616
|
get visible() {
|
|
10611
|
-
return
|
|
10617
|
+
return oe(B(), !0);
|
|
10612
10618
|
},
|
|
10613
10619
|
get children() {
|
|
10614
10620
|
return Y(Nf, ra({
|
|
10615
10621
|
id: "rulers",
|
|
10616
10622
|
builtin: "rulers",
|
|
10617
10623
|
get active() {
|
|
10618
|
-
return
|
|
10624
|
+
return B();
|
|
10619
10625
|
},
|
|
10620
10626
|
label: "Rulers",
|
|
10621
10627
|
shortcut: "R",
|
|
10622
10628
|
onClick: () => e.onBuiltinAction("rulers")
|
|
10623
|
-
}, () =>
|
|
10629
|
+
}, () => Ae("rulers"), { get children() {
|
|
10624
10630
|
return Y(ef, { size: 20 });
|
|
10625
10631
|
} }));
|
|
10626
10632
|
}
|
|
10627
10633
|
}), null), Q(w, Y(Pf, {
|
|
10628
10634
|
get visible() {
|
|
10629
|
-
return
|
|
10635
|
+
return oe(H(), !0);
|
|
10630
10636
|
},
|
|
10631
10637
|
get children() {
|
|
10632
10638
|
return [Y(Nf, ra({
|
|
10633
10639
|
id: "guides",
|
|
10634
10640
|
builtin: "guides",
|
|
10635
10641
|
get active() {
|
|
10636
|
-
return
|
|
10642
|
+
return H();
|
|
10637
10643
|
},
|
|
10638
10644
|
get disabled() {
|
|
10639
|
-
return
|
|
10645
|
+
return ue("guides");
|
|
10640
10646
|
},
|
|
10641
10647
|
label: "Guides",
|
|
10642
10648
|
shortcut: "G",
|
|
10643
10649
|
onClick: () => e.onBuiltinAction("guides")
|
|
10644
|
-
}, () =>
|
|
10650
|
+
}, () => Ae("guides"), { get children() {
|
|
10645
10651
|
return Y(Qd, {
|
|
10646
10652
|
size: 20,
|
|
10647
10653
|
get class() {
|
|
@@ -10658,7 +10664,7 @@ function tp(e) {
|
|
|
10658
10664
|
"aria-label": "Guide orientation menu",
|
|
10659
10665
|
"aria-haspopup": "menu",
|
|
10660
10666
|
onClick: () => {
|
|
10661
|
-
i((t) => (t || (c(e.model.state.guideOrientation === "horizontal" ? 0 : 1),
|
|
10667
|
+
i((t) => (t || (c(e.model.state.guideOrientation === "horizontal" ? 0 : 1), ye()), !t));
|
|
10662
10668
|
}
|
|
10663
10669
|
});
|
|
10664
10670
|
return Z(t, n), aa(() => (e) => {
|
|
@@ -10666,13 +10672,13 @@ function tp(e) {
|
|
|
10666
10672
|
}, t), Q(n, Y(tf, { size: 8 })), Q(t, Y(Co, {
|
|
10667
10673
|
label: "Orientation Guide",
|
|
10668
10674
|
get visible() {
|
|
10669
|
-
return ea(() => !!
|
|
10675
|
+
return ea(() => !!le())() ? h.visibleTooltipId() === "guide-menu" : le();
|
|
10670
10676
|
},
|
|
10671
10677
|
get instant() {
|
|
10672
10678
|
return h.tooltipInstant();
|
|
10673
10679
|
},
|
|
10674
10680
|
get side() {
|
|
10675
|
-
return
|
|
10681
|
+
return me();
|
|
10676
10682
|
}
|
|
10677
10683
|
}), null), Q(t, Y(q, {
|
|
10678
10684
|
get when() {
|
|
@@ -10684,14 +10690,14 @@ function tp(e) {
|
|
|
10684
10690
|
tabindex: 0,
|
|
10685
10691
|
onKeyDown: (e) => {
|
|
10686
10692
|
let t = e.key.toLowerCase();
|
|
10687
|
-
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), c((e) => (e + 1) % 2)) : e.key === "Enter" ? (e.preventDefault(),
|
|
10693
|
+
e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), c((e) => (e + 1) % 2)) : e.key === "Enter" ? (e.preventDefault(), Te(s() === 0 ? "horizontal" : "vertical")) : t === "h" || t === "v" ? (e.preventDefault(), Te(t === "h" ? "horizontal" : "vertical")) : e.key === "Escape" && (e.preventDefault(), i(!1));
|
|
10688
10694
|
}
|
|
10689
10695
|
}), n = X("button", {
|
|
10690
10696
|
type: "button",
|
|
10691
|
-
onClick: () =>
|
|
10697
|
+
onClick: () => Te("horizontal")
|
|
10692
10698
|
}), r = X("span", { class: "msr:flex-1" }), a = X("span"), o = X("button", {
|
|
10693
10699
|
type: "button",
|
|
10694
|
-
onClick: () =>
|
|
10700
|
+
onClick: () => Te("vertical")
|
|
10695
10701
|
}), u = X("span", { class: "msr:flex-1" }), d = X("span");
|
|
10696
10702
|
return Z(t, n), Z(t, o), Z(n, r), Z(n, a), Q(n, Y(nf, {
|
|
10697
10703
|
size: 12,
|
|
@@ -10707,7 +10713,7 @@ function tp(e) {
|
|
|
10707
10713
|
size: 12,
|
|
10708
10714
|
class: "msr:rotate-90"
|
|
10709
10715
|
}), u), Z(u, ta("Vertical")), Z(d, ta("V")), J(() => ({
|
|
10710
|
-
e: `mesurer-menu-surface msr:absolute msr:z-[70] msr:w-44 msr:rounded-lg msr:border msr:border-ink-200 msr:bg-white msr:p-1 msr:outline-none msr:focus:outline-none msr:flex msr:flex-col msr:gap-px ${
|
|
10716
|
+
e: `mesurer-menu-surface msr:absolute msr:z-[70] msr:w-44 msr:rounded-lg msr:border msr:border-ink-200 msr:bg-white msr:p-1 msr:outline-none msr:focus:outline-none msr:flex msr:flex-col msr:gap-px ${he() === "bottom" ? "msr:top-full msr:mt-2" : "msr:bottom-full msr:mb-2"} ${l() === "left" ? "msr:left-0" : "msr:right-0"}`,
|
|
10711
10717
|
t: `msr:group msr:flex msr:w-full msr:items-center msr:gap-2 msr:rounded-md msr:px-2 msr:py-1.5 msr:text-left msr:text-[12px] ${s() === 0 || e.model.state.guideOrientation === "horizontal" ? "msr:bg-[#0d99ff] msr:text-white" : "msr:text-ink-700 msr:hover:bg-[#0d99ff] msr:hover:text-white"}`,
|
|
10712
10718
|
a: `msr:group msr:flex msr:w-full msr:items-center msr:gap-2 msr:rounded-md msr:px-2 msr:py-1.5 msr:text-left msr:text-[12px] ${s() === 1 || e.model.state.guideOrientation === "vertical" ? "msr:bg-[#0d99ff] msr:text-white" : "msr:text-ink-700 msr:hover:bg-[#0d99ff] msr:hover:text-white"}`
|
|
10713
10719
|
}), ({ e, t: r, a: i }, a) => {
|
|
@@ -10717,8 +10723,8 @@ function tp(e) {
|
|
|
10717
10723
|
}), null), J(() => ({
|
|
10718
10724
|
e: h.onTooltipLeave,
|
|
10719
10725
|
t: r() ? "true" : "false",
|
|
10720
|
-
a:
|
|
10721
|
-
o: `msr:flex msr:h-8 msr:w-4 msr:items-center msr:justify-center msr:rounded-[6px] msr:outline-none ${
|
|
10726
|
+
a: ue("guides"),
|
|
10727
|
+
o: `msr:flex msr:h-8 msr:w-4 msr:items-center msr:justify-center msr:rounded-[6px] msr:outline-none ${ue("guides") ? "msr:cursor-default msr:text-black/30" : "msr:hover:bg-black/10"} ${r() ? "msr:bg-black/10 msr:text-black" : "msr:text-black"}`
|
|
10722
10728
|
}), ({ e, t: r, a: i, o: a }, o) => {
|
|
10723
10729
|
e !== o?.e && $(t, "onMouseLeave", e, o?.e), r !== o?.t && $(n, "aria-expanded", r, o?.t), i !== o?.a && $(n, "disabled", i, o?.a), a !== o?.o && $(n, "class", a, o?.o);
|
|
10724
10730
|
}), t;
|
|
@@ -10731,7 +10737,7 @@ function tp(e) {
|
|
|
10731
10737
|
get children() {
|
|
10732
10738
|
return [Y(Ff, {
|
|
10733
10739
|
get visible() {
|
|
10734
|
-
return
|
|
10740
|
+
return se();
|
|
10735
10741
|
},
|
|
10736
10742
|
marker: "plugins"
|
|
10737
10743
|
}), (() => {
|
|
@@ -10744,13 +10750,13 @@ function tp(e) {
|
|
|
10744
10750
|
get each() {
|
|
10745
10751
|
return re();
|
|
10746
10752
|
},
|
|
10747
|
-
children: (e) =>
|
|
10753
|
+
children: (e) => Me(e, e.toolbarMode === "always")
|
|
10748
10754
|
})), e;
|
|
10749
10755
|
})()];
|
|
10750
10756
|
}
|
|
10751
|
-
}),
|
|
10757
|
+
}), T), Q(T, Y(Pf, {
|
|
10752
10758
|
get visible() {
|
|
10753
|
-
return
|
|
10759
|
+
return oe(U());
|
|
10754
10760
|
},
|
|
10755
10761
|
get children() {
|
|
10756
10762
|
var t = X("div", {
|
|
@@ -10763,12 +10769,12 @@ function tp(e) {
|
|
|
10763
10769
|
id: "settings",
|
|
10764
10770
|
builtin: "settings",
|
|
10765
10771
|
get active() {
|
|
10766
|
-
return
|
|
10772
|
+
return U();
|
|
10767
10773
|
},
|
|
10768
10774
|
label: "Settings",
|
|
10769
10775
|
shortcut: "⌘/Ctrl+,",
|
|
10770
10776
|
onClick: () => e.onBuiltinAction("settings")
|
|
10771
|
-
}, () =>
|
|
10777
|
+
}, () => Ae("settings"), { get children() {
|
|
10772
10778
|
return Y(hf, { size: 20 });
|
|
10773
10779
|
} })), null), Q(t, Y(q, {
|
|
10774
10780
|
get when() {
|
|
@@ -10803,9 +10809,9 @@ function tp(e) {
|
|
|
10803
10809
|
return e.onSelectionSpacingStyleChange;
|
|
10804
10810
|
}
|
|
10805
10811
|
})), J(() => ({
|
|
10806
|
-
e: `mesurer-menu-surface msr:absolute msr:z-[70] msr:box-border msr:w-[272px] msr:max-w-[calc(100vw-16px)] msr:max-h-[calc(100vh-16px)] msr:overflow-y-auto msr:rounded-lg msr:border msr:border-ink-200 msr:bg-white msr:p-3 ${
|
|
10812
|
+
e: `mesurer-menu-surface msr:absolute msr:z-[70] msr:box-border msr:w-[272px] msr:max-w-[calc(100vw-16px)] msr:max-h-[calc(100vh-16px)] msr:overflow-y-auto msr:rounded-lg msr:border msr:border-ink-200 msr:bg-white msr:p-3 ${ge() === "bottom" ? "msr:top-full msr:mt-2" : "msr:bottom-full msr:mb-2"}`,
|
|
10807
10813
|
t: {
|
|
10808
|
-
left: `${
|
|
10814
|
+
left: `${_e()}px`,
|
|
10809
10815
|
right: "auto"
|
|
10810
10816
|
}
|
|
10811
10817
|
}), ({ e, t: n }, r) => {
|
|
@@ -10816,7 +10822,7 @@ function tp(e) {
|
|
|
10816
10822
|
}
|
|
10817
10823
|
})), Q(n, Y(Ff, {
|
|
10818
10824
|
get visible() {
|
|
10819
|
-
return
|
|
10825
|
+
return ce();
|
|
10820
10826
|
},
|
|
10821
10827
|
marker: "compact"
|
|
10822
10828
|
}), D), Z(D, O), Q(O, Y(tf, {
|
|
@@ -10826,20 +10832,20 @@ function tp(e) {
|
|
|
10826
10832
|
}
|
|
10827
10833
|
})), J(() => ({
|
|
10828
10834
|
e: d() ? "true" : "false",
|
|
10829
|
-
t:
|
|
10830
|
-
a: `mesurer-toolbar-surface msr:pointer-events-auto msr:absolute msr:flex msr:items-stretch msr:rounded-[12px] msr:bg-[#fff] msr:outline msr:outline-transparent ${
|
|
10835
|
+
t: W(),
|
|
10836
|
+
a: `mesurer-toolbar-surface msr:pointer-events-auto msr:absolute msr:flex msr:items-stretch msr:rounded-[12px] msr:bg-[#fff] msr:outline msr:outline-transparent ${G() ? "msr:z-[110]" : "msr:z-[90]"}`,
|
|
10831
10837
|
o: {
|
|
10832
10838
|
left: `${t().x}px`,
|
|
10833
10839
|
top: `${t().y}px`
|
|
10834
10840
|
},
|
|
10835
10841
|
i: h.onTooltipContainerLeave,
|
|
10836
|
-
n:
|
|
10837
|
-
s:
|
|
10838
|
-
h:
|
|
10839
|
-
r:
|
|
10840
|
-
d:
|
|
10841
|
-
l:
|
|
10842
|
-
u:
|
|
10842
|
+
n: W(),
|
|
10843
|
+
s: W() === "select" ? "true" : "false",
|
|
10844
|
+
h: W() === "select" ? void 0 : "true",
|
|
10845
|
+
r: W() !== "select" || void 0,
|
|
10846
|
+
d: W() === "edit" ? "true" : "false",
|
|
10847
|
+
l: W() === "edit" ? void 0 : "true",
|
|
10848
|
+
u: W() !== "edit" || void 0,
|
|
10843
10849
|
c: d() ? "Expand toolbar" : "Compact toolbar",
|
|
10844
10850
|
w: d() ? "true" : "false"
|
|
10845
10851
|
}), ({ e, t, a: r, o: i, i: a, n: s, s: c, h: l, r: u, d, l: p, u: m, c: h, w: g }, _) => {
|
|
@@ -11373,6 +11379,10 @@ function rm(e) {
|
|
|
11373
11379
|
d(), t.setEnabled(!0), Yp(t), t.toggleXray();
|
|
11374
11380
|
return;
|
|
11375
11381
|
case "color-picker":
|
|
11382
|
+
if (t.current.colorPickerActive && t.current.colorPickerSample) {
|
|
11383
|
+
await _();
|
|
11384
|
+
return;
|
|
11385
|
+
}
|
|
11376
11386
|
if (t.current.colorPickerActive || o || i) {
|
|
11377
11387
|
f();
|
|
11378
11388
|
return;
|
|
@@ -11852,7 +11862,7 @@ function Im(e = {}, t = !1) {
|
|
|
11852
11862
|
i < 0 || (n && H(), E.splice(i, 1), t.detach(), t.box.remove(), t.card.remove(), r && e.onUnpin?.(t.sourceEl));
|
|
11853
11863
|
}, ee = (e = !1) => {
|
|
11854
11864
|
for (; E.length;) U(E[E.length - 1], !1, e);
|
|
11855
|
-
},
|
|
11865
|
+
}, W = (e) => {
|
|
11856
11866
|
let t = -1, n = 0, i = 0, a = 0, o = 0, s = !1, c = !1, l = (l) => {
|
|
11857
11867
|
if (l.pointerId !== t) return;
|
|
11858
11868
|
let u = l.clientX - n, d = l.clientY - i;
|
|
@@ -11867,7 +11877,7 @@ function Im(e = {}, t = !1) {
|
|
|
11867
11877
|
return e.card.addEventListener("pointerdown", f), () => {
|
|
11868
11878
|
e.card.removeEventListener("pointerdown", f), r.removeEventListener("pointermove", l), r.removeEventListener("pointerup", u), r.removeEventListener("pointercancel", u);
|
|
11869
11879
|
};
|
|
11870
|
-
},
|
|
11880
|
+
}, te = (t, i, a = !0, o = !0) => {
|
|
11871
11881
|
if (E.find((e) => e.sourceEl === t)) return;
|
|
11872
11882
|
a && H(), E.length >= l && U(E[0], !1, !0);
|
|
11873
11883
|
let s = j(), c = pm(n, jm, Mm), d = hm(n, !0);
|
|
@@ -11885,19 +11895,19 @@ function Im(e = {}, t = !1) {
|
|
|
11885
11895
|
userPlaced: i?.userPlaced ?? !1,
|
|
11886
11896
|
detach: () => {}
|
|
11887
11897
|
};
|
|
11888
|
-
E.push(m), m.detach =
|
|
11898
|
+
E.push(m), m.detach = W(m), d.querySelector(".mesurer-ti-close")?.addEventListener("click", (e) => {
|
|
11889
11899
|
e.preventDefault(), e.stopPropagation(), U(m);
|
|
11890
11900
|
}), o && e.onPin?.(t, f);
|
|
11891
|
-
},
|
|
11901
|
+
}, ne = (e) => {
|
|
11892
11902
|
ee(!1);
|
|
11893
|
-
for (let t of e) t.sourceEl.isConnected &&
|
|
11894
|
-
},
|
|
11903
|
+
for (let t of e) t.sourceEl.isConnected && te(t.sourceEl, t, !1, !1);
|
|
11904
|
+
}, re = () => {
|
|
11895
11905
|
let e = D.pop();
|
|
11896
|
-
return e ? (O.push(V()),
|
|
11897
|
-
},
|
|
11906
|
+
return e ? (O.push(V()), ne(e), !0) : !1;
|
|
11907
|
+
}, ie = () => {
|
|
11898
11908
|
let e = O.pop();
|
|
11899
|
-
return e ? (D.push(V()),
|
|
11900
|
-
},
|
|
11909
|
+
return e ? (D.push(V()), ne(e), !0) : !1;
|
|
11910
|
+
}, ae = () => {
|
|
11901
11911
|
E.length && (H(), ee(!0));
|
|
11902
11912
|
}, oe = () => {
|
|
11903
11913
|
for (let e of E.slice()) {
|
|
@@ -11973,7 +11983,7 @@ function Im(e = {}, t = !1) {
|
|
|
11973
11983
|
}
|
|
11974
11984
|
if (e.preventDefault(), e.stopImmediatePropagation(), e.button === 0) {
|
|
11975
11985
|
let t = I(e.clientX, e.clientY);
|
|
11976
|
-
t &&
|
|
11986
|
+
t && te(t);
|
|
11977
11987
|
}
|
|
11978
11988
|
}
|
|
11979
11989
|
}, he = (e) => {
|
|
@@ -11997,9 +12007,9 @@ function Im(e = {}, t = !1) {
|
|
|
11997
12007
|
return {
|
|
11998
12008
|
enable: ge,
|
|
11999
12009
|
disable: _e,
|
|
12000
|
-
undo:
|
|
12001
|
-
redo:
|
|
12002
|
-
clear:
|
|
12010
|
+
undo: re,
|
|
12011
|
+
redo: ie,
|
|
12012
|
+
clear: ae,
|
|
12003
12013
|
inspect: B,
|
|
12004
12014
|
isEnabled: () => m,
|
|
12005
12015
|
canUndo: () => D.length > 0,
|
|
@@ -12234,11 +12244,11 @@ function th(e) {
|
|
|
12234
12244
|
}));
|
|
12235
12245
|
}, ee = () => {
|
|
12236
12246
|
C && s.clearTimeout(C), C = 0, w = null;
|
|
12237
|
-
},
|
|
12247
|
+
}, W = (e) => {
|
|
12238
12248
|
ee(), w = e, C = s.setTimeout(() => {
|
|
12239
12249
|
C = 0, w === e && t.setTransient({ draggingGuideId: e });
|
|
12240
12250
|
}, 220);
|
|
12241
|
-
},
|
|
12251
|
+
}, te = () => {
|
|
12242
12252
|
t.setTransient({
|
|
12243
12253
|
start: null,
|
|
12244
12254
|
end: null,
|
|
@@ -12246,7 +12256,7 @@ function th(e) {
|
|
|
12246
12256
|
draggingGuideId: null,
|
|
12247
12257
|
guidePreview: null
|
|
12248
12258
|
}), x = null, S = !1, d.key = "", t.endAction();
|
|
12249
|
-
},
|
|
12259
|
+
}, ne = (e) => {
|
|
12250
12260
|
if (t.current.settingsOpen || !t.current.enabled || e.button !== 0 || t.current.toolMode === "none") return;
|
|
12251
12261
|
let n = {
|
|
12252
12262
|
x: e.clientX,
|
|
@@ -12274,7 +12284,7 @@ function th(e) {
|
|
|
12274
12284
|
id: i,
|
|
12275
12285
|
orientation: t.current.guideOrientation,
|
|
12276
12286
|
position: a
|
|
12277
|
-
}), t.setSelectedGuideIds(t.current.settings.selectNewGuideEnabled ? [i] : []), t.setTransient({ guidePreview: null }),
|
|
12287
|
+
}), t.setSelectedGuideIds(t.current.settings.selectNewGuideEnabled ? [i] : []), t.setTransient({ guidePreview: null }), W(i), _s(e.currentTarget, e.pointerId);
|
|
12278
12288
|
return;
|
|
12279
12289
|
}
|
|
12280
12290
|
t.current.selectedGuideIds.length > 0 && (r(), t.setSelectedGuideIds([])), S = e.shiftKey, x = e.shiftKey ? Vp({
|
|
@@ -12289,7 +12299,7 @@ function th(e) {
|
|
|
12289
12299
|
isDragging: !1,
|
|
12290
12300
|
selectionOriginRect: null
|
|
12291
12301
|
}), _s(e.currentTarget, e.pointerId);
|
|
12292
|
-
},
|
|
12302
|
+
}, re = (e) => {
|
|
12293
12303
|
if (!t.current.enabled || t.current.settingsOpen) return;
|
|
12294
12304
|
let n = {
|
|
12295
12305
|
x: e.clientX,
|
|
@@ -12319,19 +12329,19 @@ function th(e) {
|
|
|
12319
12329
|
end: n,
|
|
12320
12330
|
isDragging: a
|
|
12321
12331
|
});
|
|
12322
|
-
},
|
|
12332
|
+
}, ie = (e) => {
|
|
12323
12333
|
if (!t.current.enabled) return;
|
|
12324
12334
|
if (t.current.toolMode === "guides") {
|
|
12325
|
-
ee(), e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture?.(e.pointerId),
|
|
12335
|
+
ee(), e.currentTarget.hasPointerCapture?.(e.pointerId) && e.currentTarget.releasePointerCapture?.(e.pointerId), te();
|
|
12326
12336
|
return;
|
|
12327
12337
|
}
|
|
12328
12338
|
if (t.current.toolMode !== "select") {
|
|
12329
|
-
|
|
12339
|
+
te();
|
|
12330
12340
|
return;
|
|
12331
12341
|
}
|
|
12332
12342
|
let n = t.current.start;
|
|
12333
12343
|
if (!n) {
|
|
12334
|
-
|
|
12344
|
+
te();
|
|
12335
12345
|
return;
|
|
12336
12346
|
}
|
|
12337
12347
|
let i = {
|
|
@@ -12349,7 +12359,7 @@ function th(e) {
|
|
|
12349
12359
|
for (let n of [...t.current.selectedMeasurements, ...a]) n.elementRef && e.set(n.elementRef, n);
|
|
12350
12360
|
l = [...e.values()];
|
|
12351
12361
|
}
|
|
12352
|
-
t.checkpoint(), t.setSelectedMeasurements(l, l.at(-1) ?? null), t.setTransient({ selectionOriginRect: r }),
|
|
12362
|
+
t.checkpoint(), t.setSelectedMeasurements(l, l.at(-1) ?? null), t.setTransient({ selectionOriginRect: r }), te();
|
|
12353
12363
|
return;
|
|
12354
12364
|
}
|
|
12355
12365
|
let a = x ? t.current.selectedMeasurements.find((e) => e.elementRef === x) ?? null : Vp({
|
|
@@ -12362,7 +12372,7 @@ function th(e) {
|
|
|
12362
12372
|
if ((e.shiftKey || !t.current.settings.hoverHighlightEnabled) && a) {
|
|
12363
12373
|
f = null, t.checkpoint();
|
|
12364
12374
|
let e = t.current.selectedMeasurements.filter((e) => e.elementRef !== a.elementRef);
|
|
12365
|
-
t.setSelectedMeasurements(e, e.at(-1) ?? null),
|
|
12375
|
+
t.setSelectedMeasurements(e, e.at(-1) ?? null), te();
|
|
12366
12376
|
return;
|
|
12367
12377
|
}
|
|
12368
12378
|
let l;
|
|
@@ -12388,9 +12398,9 @@ function th(e) {
|
|
|
12388
12398
|
};
|
|
12389
12399
|
t.setActiveMeasurement(r);
|
|
12390
12400
|
} else e.shiftKey || (t.checkpoint(), t.setSelectedMeasurements([], null));
|
|
12391
|
-
|
|
12392
|
-
},
|
|
12393
|
-
ee(), t.current.draggingGuideId ||
|
|
12401
|
+
te();
|
|
12402
|
+
}, ae = () => {
|
|
12403
|
+
ee(), t.current.draggingGuideId || te(), t.setTransient({ guidePreview: null });
|
|
12394
12404
|
}, oe = (e, n) => {
|
|
12395
12405
|
if (!(!t.current.enabled || n.button !== 0 || t.current.settingsOpen)) {
|
|
12396
12406
|
if (n.preventDefault(), n.stopPropagation(), t.checkpoint(), n.shiftKey) {
|
|
@@ -12493,7 +12503,7 @@ function th(e) {
|
|
|
12493
12503
|
}, a = (e, n) => {
|
|
12494
12504
|
if (!t.current.enabled || t.current.settingsOpen || t.current.toolMode !== "select") return;
|
|
12495
12505
|
let r = i(e, n);
|
|
12496
|
-
r && (e.preventDefault(), e.stopImmediatePropagation(), e.type === "pointerdown" ?
|
|
12506
|
+
r && (e.preventDefault(), e.stopImmediatePropagation(), e.type === "pointerdown" ? ne(r) : e.type === "pointermove" ? re(r) : e.type === "pointerup" ? ie(r) : ae());
|
|
12497
12507
|
}, s = (e) => {
|
|
12498
12508
|
!t.current.enabled || t.current.settingsOpen || t.current.toolMode !== "select" || e.detail === 0 || (e.preventDefault(), e.stopImmediatePropagation());
|
|
12499
12509
|
}, c = () => {
|
|
@@ -12780,10 +12790,10 @@ function th(e) {
|
|
|
12780
12790
|
return ea(() => !!t.state.enabled)() ? !t.state.settingsOpen : t.state.enabled;
|
|
12781
12791
|
},
|
|
12782
12792
|
editSelectionHover: () => r.editSelectionHover?.() ?? !1,
|
|
12783
|
-
onPointerDown:
|
|
12784
|
-
onPointerMove:
|
|
12785
|
-
onPointerUp:
|
|
12786
|
-
onPointerLeave:
|
|
12793
|
+
onPointerDown: ne,
|
|
12794
|
+
onPointerMove: re,
|
|
12795
|
+
onPointerUp: ie,
|
|
12796
|
+
onPointerLeave: ae,
|
|
12787
12797
|
onGuidePointerDown: oe,
|
|
12788
12798
|
onGuidePointerUp: se
|
|
12789
12799
|
}), null), Q(n, Y(To, {
|
|
@@ -13134,34 +13144,34 @@ var rh = "mesurer.presentation.preferences", ih = "presentation", ah = {
|
|
|
13134
13144
|
d.style.display = "block", d.style.left = `${e}px`, d.style.top = `${t.position}px`, d.style.width = `${Math.max(1, r - e)}px`;
|
|
13135
13145
|
}
|
|
13136
13146
|
}
|
|
13137
|
-
},
|
|
13147
|
+
}, W = () => !!(n.querySelector(Mh) || s.querySelector(Mh)), te = () => {
|
|
13138
13148
|
for (let [e, t] of g) t.value || t.priority ? e.style.setProperty("visibility", t.value, t.priority) : e.style.removeProperty("visibility");
|
|
13139
13149
|
g.clear();
|
|
13140
|
-
},
|
|
13141
|
-
if (
|
|
13142
|
-
|
|
13150
|
+
}, ne = () => {
|
|
13151
|
+
if (W()) {
|
|
13152
|
+
te();
|
|
13143
13153
|
return;
|
|
13144
13154
|
}
|
|
13145
13155
|
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, {
|
|
13146
13156
|
value: e.style.getPropertyValue("visibility"),
|
|
13147
13157
|
priority: e.style.getPropertyPriority("visibility")
|
|
13148
13158
|
}), e.style.setProperty("visibility", "hidden", "important")));
|
|
13149
|
-
},
|
|
13159
|
+
}, re = (e) => {
|
|
13150
13160
|
if (e.parentElement instanceof c.HTMLElement) return e.parentElement;
|
|
13151
13161
|
let t = e.getRootNode();
|
|
13152
13162
|
return t instanceof c.ShadowRoot && t.host instanceof c.HTMLElement ? t.host : null;
|
|
13153
|
-
},
|
|
13154
|
-
let n =
|
|
13163
|
+
}, ie = (e, t) => {
|
|
13164
|
+
let n = re(e);
|
|
13155
13165
|
for (; n;) {
|
|
13156
13166
|
let e = t.get(n);
|
|
13157
13167
|
if (e) return e;
|
|
13158
|
-
n =
|
|
13168
|
+
n = re(n);
|
|
13159
13169
|
}
|
|
13160
13170
|
return {
|
|
13161
13171
|
x: 0,
|
|
13162
13172
|
y: 0
|
|
13163
13173
|
};
|
|
13164
|
-
},
|
|
13174
|
+
}, ae = (e = A()) => {
|
|
13165
13175
|
let t = /* @__PURE__ */ new Map();
|
|
13166
13176
|
for (let n of e) for (let e of n.targets) {
|
|
13167
13177
|
let n = F(e);
|
|
@@ -13172,14 +13182,14 @@ var rh = "mesurer.presentation.preferences", ih = "presentation", ah = {
|
|
|
13172
13182
|
x: e.desiredLocalOffsetX,
|
|
13173
13183
|
y: e.desiredLocalOffsetY
|
|
13174
13184
|
}, se = (e, t) => {
|
|
13175
|
-
let n =
|
|
13185
|
+
let n = re(e);
|
|
13176
13186
|
for (; n;) {
|
|
13177
13187
|
if (t.has(n)) return n;
|
|
13178
|
-
n =
|
|
13188
|
+
n = re(n);
|
|
13179
13189
|
}
|
|
13180
13190
|
return null;
|
|
13181
13191
|
}, ce = (e = A(), t = /* @__PURE__ */ new Map()) => {
|
|
13182
|
-
let n =
|
|
13192
|
+
let n = ae(e), r = /* @__PURE__ */ new Set([...n.keys(), ...t.keys()]), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = (e) => {
|
|
13183
13193
|
let s = i.get(e);
|
|
13184
13194
|
if (s) return s;
|
|
13185
13195
|
let c = n.get(e), l = t.get(e) ?? (c ? oe(c) : null);
|
|
@@ -13227,7 +13237,7 @@ var rh = "mesurer.presentation.preferences", ih = "presentation", ah = {
|
|
|
13227
13237
|
}, G = (e) => {
|
|
13228
13238
|
let t = [...e].flatMap(([t, n]) => {
|
|
13229
13239
|
if (!t.isConnected || !M(t)) return [];
|
|
13230
|
-
let r =
|
|
13240
|
+
let r = ie(t, e), i = {
|
|
13231
13241
|
x: n.x - r.x,
|
|
13232
13242
|
y: n.y - r.y
|
|
13233
13243
|
};
|
|
@@ -13278,13 +13288,13 @@ var rh = "mesurer.presentation.preferences", ih = "presentation", ah = {
|
|
|
13278
13288
|
ge();
|
|
13279
13289
|
return;
|
|
13280
13290
|
}
|
|
13281
|
-
let t = A(), r =
|
|
13291
|
+
let t = A(), r = ae(t), i = ce(t), a = /* @__PURE__ */ new Set();
|
|
13282
13292
|
for (let t of fe()) {
|
|
13283
13293
|
let o = r.get(t);
|
|
13284
13294
|
if (!o) continue;
|
|
13285
13295
|
let s = i.get(t);
|
|
13286
13296
|
if (!s) continue;
|
|
13287
|
-
let c =
|
|
13297
|
+
let c = ie(t, i), u = oe(o) ?? {
|
|
13288
13298
|
x: s.x - c.x,
|
|
13289
13299
|
y: s.y - c.y
|
|
13290
13300
|
};
|
|
@@ -13408,14 +13418,14 @@ var rh = "mesurer.presentation.preferences", ih = "presentation", ah = {
|
|
|
13408
13418
|
v = {
|
|
13409
13419
|
intentId: null,
|
|
13410
13420
|
state: "desired"
|
|
13411
|
-
}, ue(), U(), E() ?
|
|
13421
|
+
}, ue(), U(), E() ? ne() : te();
|
|
13412
13422
|
}, we = () => {
|
|
13413
13423
|
v = {
|
|
13414
13424
|
intentId: null,
|
|
13415
13425
|
state: "live"
|
|
13416
|
-
}, H(), U(),
|
|
13426
|
+
}, H(), U(), te();
|
|
13417
13427
|
}, Te = () => {
|
|
13418
|
-
S || y || (ue(), U(), E() ?
|
|
13428
|
+
S || y || (ue(), U(), E() ? ne() : te(), Se());
|
|
13419
13429
|
}, Ee = () => {
|
|
13420
13430
|
C || S || (C = r.requestAnimationFrame(() => {
|
|
13421
13431
|
C = 0, Te();
|
|
@@ -13442,10 +13452,10 @@ var rh = "mesurer.presentation.preferences", ih = "presentation", ah = {
|
|
|
13442
13452
|
intentId: null,
|
|
13443
13453
|
state: "desired"
|
|
13444
13454
|
}, ue();
|
|
13445
|
-
let u =
|
|
13455
|
+
let u = ae(A()), d = ce(A()), p = new Set(r);
|
|
13446
13456
|
V();
|
|
13447
13457
|
let m = r.map((e, t) => {
|
|
13448
|
-
let n = hl(e), r =
|
|
13458
|
+
let n = hl(e), r = ie(e, d), i = d.get(e) ?? r, a = u.get(e), o = (a ? oe(a) : null) ?? {
|
|
13449
13459
|
x: i.x - r.x,
|
|
13450
13460
|
y: i.y - r.y
|
|
13451
13461
|
}, s = Ph(n, i), c = Il(e);
|
|
@@ -13491,7 +13501,7 @@ var rh = "mesurer.presentation.preferences", ih = "presentation", ah = {
|
|
|
13491
13501
|
ue();
|
|
13492
13502
|
return;
|
|
13493
13503
|
}
|
|
13494
|
-
ue(),
|
|
13504
|
+
ue(), ne(), U(), y = {
|
|
13495
13505
|
pointerId: e.pointerId,
|
|
13496
13506
|
originX: e.clientX,
|
|
13497
13507
|
originY: e.clientY,
|
|
@@ -13593,7 +13603,7 @@ var rh = "mesurer.presentation.preferences", ih = "presentation", ah = {
|
|
|
13593
13603
|
y: e.clientY
|
|
13594
13604
|
}, t.rendererRoot ?? null, n, o)), Fe = (e) => {
|
|
13595
13605
|
if (!E()) return;
|
|
13596
|
-
if (y || e.buttons !== 0 ||
|
|
13606
|
+
if (y || e.buttons !== 0 || W()) {
|
|
13597
13607
|
i.clearHover();
|
|
13598
13608
|
return;
|
|
13599
13609
|
}
|
|
@@ -13875,9 +13885,9 @@ var rh = "mesurer.presentation.preferences", ih = "presentation", ah = {
|
|
|
13875
13885
|
e.state.update(dh, () => ({ intents: [] })), v = {
|
|
13876
13886
|
intentId: null,
|
|
13877
13887
|
state: "desired"
|
|
13878
|
-
}, H(), U(), E() ?
|
|
13888
|
+
}, H(), U(), E() ? ne() : te(), Se();
|
|
13879
13889
|
}), e.service.provide(uh, Ve), ue(), Se(), e.lifecycle.onDispose(() => {
|
|
13880
|
-
S = !0, C && r.cancelAnimationFrame(C), w?.disconnect(), w = null, f.removeEventListener("pointerdown", Oe), f.removeEventListener("pointermove", Ae), f.removeEventListener("pointerup", Me), f.removeEventListener("pointercancel", Ne), r.removeEventListener("pointermove", Fe, !0), r.removeEventListener("keydown", Ie, !0), r.removeEventListener("resize", Ee), r.removeEventListener("scroll", Ee, !0), o.removeEventListener("scroll", Ee, !0), Le(), Re.dispose(), H(), ge(), U(),
|
|
13890
|
+
S = !0, C && r.cancelAnimationFrame(C), w?.disconnect(), w = null, f.removeEventListener("pointerdown", Oe), f.removeEventListener("pointermove", Ae), f.removeEventListener("pointerup", Me), f.removeEventListener("pointercancel", Ne), r.removeEventListener("pointermove", Fe, !0), r.removeEventListener("keydown", Ie, !0), r.removeEventListener("resize", Ee), r.removeEventListener("scroll", Ee, !0), o.removeEventListener("scroll", Ee, !0), Le(), Re.dispose(), H(), ge(), U(), te(), i.dispose(), a.dispose();
|
|
13881
13891
|
});
|
|
13882
13892
|
}
|
|
13883
13893
|
}), eg = (e, t, n) => {
|
|
@@ -14357,16 +14367,16 @@ function Ig(e, t) {
|
|
|
14357
14367
|
attributes: !0,
|
|
14358
14368
|
attributeFilter: ["data-state"]
|
|
14359
14369
|
});
|
|
14360
|
-
let
|
|
14370
|
+
let W = () => {
|
|
14361
14371
|
b = !0, x && r.clearTimeout(x), x = r.setTimeout(() => {
|
|
14362
14372
|
x = 0, b = !1, H(!0);
|
|
14363
14373
|
}, bg);
|
|
14364
|
-
},
|
|
14365
|
-
r.addEventListener("scroll",
|
|
14374
|
+
}, te = () => H(!0);
|
|
14375
|
+
r.addEventListener("scroll", W, {
|
|
14366
14376
|
capture: !0,
|
|
14367
14377
|
passive: !0
|
|
14368
|
-
}), r.addEventListener("resize",
|
|
14369
|
-
g = !0, ee.disconnect(), v && r.cancelAnimationFrame(v), y && r.cancelAnimationFrame(y), x && r.clearTimeout(x), r.removeEventListener("scroll",
|
|
14378
|
+
}), 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(() => {
|
|
14379
|
+
g = !0, ee.disconnect(), v && r.cancelAnimationFrame(v), y && r.cancelAnimationFrame(y), x && r.clearTimeout(x), r.removeEventListener("scroll", W, !0), r.removeEventListener("resize", te, !0), r.removeEventListener("pointermove", U, !0), r.removeEventListener("pointerup", te, !0), r.removeEventListener("dblclick", te, !0);
|
|
14370
14380
|
for (let e of u.values()) A(e);
|
|
14371
14381
|
u.clear(), P(), I();
|
|
14372
14382
|
for (let [e, t] of d) Ag(e), t.release();
|
|
@@ -14828,35 +14838,35 @@ function T_(e, t) {
|
|
|
14828
14838
|
}, U = (e, t, n) => H(e, [[t, n]]), ee = (e, t) => d_.every((n) => {
|
|
14829
14839
|
let r = t.styles[n];
|
|
14830
14840
|
return r === void 0 || B(e, n) === D(n, r);
|
|
14831
|
-
}),
|
|
14841
|
+
}), W = (e) => e.catalog.presets.find((t) => ee(e, t)) ?? null, te = (e, t) => {
|
|
14832
14842
|
e.menuOpen = !1;
|
|
14833
14843
|
let n = d_.flatMap((e) => {
|
|
14834
14844
|
let n = t.styles[e];
|
|
14835
14845
|
return n === void 0 ? [] : [[e, n]];
|
|
14836
14846
|
});
|
|
14837
14847
|
H(e, n), e.editor.focus({ preventScroll: !0 });
|
|
14838
|
-
},
|
|
14848
|
+
}, ne = (e) => {
|
|
14839
14849
|
let t = B(e, "font-weight"), n = R(e, "font-weight");
|
|
14840
14850
|
if (n && b_(n.desired) >= 600 && b_(n.before) < 600) {
|
|
14841
14851
|
U(e, "font-weight", n.before);
|
|
14842
14852
|
return;
|
|
14843
14853
|
}
|
|
14844
14854
|
U(e, "font-weight", b_(t) >= 600 ? "400" : "700");
|
|
14845
|
-
},
|
|
14855
|
+
}, re = (e) => {
|
|
14846
14856
|
let t = B(e, "font-style"), n = R(e, "font-style");
|
|
14847
14857
|
if (n && n.desired !== "normal" && n.before === "normal") {
|
|
14848
14858
|
U(e, "font-style", n.before);
|
|
14849
14859
|
return;
|
|
14850
14860
|
}
|
|
14851
14861
|
U(e, "font-style", t === "normal" ? "italic" : "normal");
|
|
14852
|
-
},
|
|
14862
|
+
}, ie = (e) => {
|
|
14853
14863
|
let t = B(e, "text-decoration-line"), n = R(e, "text-decoration-line");
|
|
14854
14864
|
if (n && n.desired.includes("underline") && !n.before.includes("underline")) {
|
|
14855
14865
|
U(e, "text-decoration-line", n.before);
|
|
14856
14866
|
return;
|
|
14857
14867
|
}
|
|
14858
14868
|
U(e, "text-decoration-line", t.includes("underline") ? "none" : "underline");
|
|
14859
|
-
},
|
|
14869
|
+
}, ae = (e, t, r, i, a) => {
|
|
14860
14870
|
let o = n.createElement("button");
|
|
14861
14871
|
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, {
|
|
14862
14872
|
width: "32px",
|
|
@@ -14986,7 +14996,7 @@ function T_(e, t) {
|
|
|
14986
14996
|
}), i.addEventListener("mouseleave", () => {
|
|
14987
14997
|
i.style.background = r ? "rgba(0, 0, 0, 0.05)" : "transparent";
|
|
14988
14998
|
}), i.addEventListener("click", (n) => {
|
|
14989
|
-
n.preventDefault(), n.stopPropagation(), m === e &&
|
|
14999
|
+
n.preventDefault(), n.stopPropagation(), m === e && te(e, t);
|
|
14990
15000
|
}), i;
|
|
14991
15001
|
}, G = () => {
|
|
14992
15002
|
let e = n.createElement("div");
|
|
@@ -14998,7 +15008,7 @@ function T_(e, t) {
|
|
|
14998
15008
|
}, ue = (e) => {
|
|
14999
15009
|
let t = e.menu;
|
|
15000
15010
|
t.replaceChildren();
|
|
15001
|
-
let r =
|
|
15011
|
+
let r = W(e);
|
|
15002
15012
|
for (let n of e.catalog.presets) t.append(le(e, n, r?.id === n.id));
|
|
15003
15013
|
t.append(G());
|
|
15004
15014
|
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");
|
|
@@ -15049,7 +15059,7 @@ function T_(e, t) {
|
|
|
15049
15059
|
m === e && U(e, "color", p.value);
|
|
15050
15060
|
}), f.append(p), u.append(d, f), t.append(u), t.hidden = !e.menuOpen, t.style.display = e.menuOpen ? "block" : "none";
|
|
15051
15061
|
}, de = (e) => {
|
|
15052
|
-
let t =
|
|
15062
|
+
let t = W(e), r = n.createElement("button");
|
|
15053
15063
|
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, {
|
|
15054
15064
|
minWidth: "96px",
|
|
15055
15065
|
height: "32px",
|
|
@@ -15085,7 +15095,7 @@ function T_(e, t) {
|
|
|
15085
15095
|
let t = e.toolbar;
|
|
15086
15096
|
t.replaceChildren();
|
|
15087
15097
|
let n = B(e, "font-weight"), r = B(e, "font-style"), i = B(e, "text-decoration-line");
|
|
15088
|
-
t.append(
|
|
15098
|
+
t.append(ae(e, "B", "Bold", b_(n) >= 600, () => ne(e)), ae(e, "I", "Italic", r === "italic" || r === "oblique", () => re(e)), ae(e, "U", "Underline", i.includes("underline"), () => ie(e)), de(e)), ue(e);
|
|
15089
15099
|
}, pe = () => {
|
|
15090
15100
|
let e = m;
|
|
15091
15101
|
if (!e || !e.element.isConnected) return;
|
|
@@ -15357,14 +15367,14 @@ function T_(e, t) {
|
|
|
15357
15367
|
if (e && t.altKey && (t.metaKey || t.ctrlKey) && !t.shiftKey) {
|
|
15358
15368
|
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;
|
|
15359
15369
|
if (r) {
|
|
15360
|
-
t.preventDefault(), t.stopImmediatePropagation(),
|
|
15370
|
+
t.preventDefault(), t.stopImmediatePropagation(), te(n, r);
|
|
15361
15371
|
return;
|
|
15362
15372
|
}
|
|
15363
15373
|
}
|
|
15364
15374
|
if (e && (t.metaKey || t.ctrlKey) && !t.altKey && !t.shiftKey) {
|
|
15365
15375
|
let e = t.key.toLowerCase();
|
|
15366
15376
|
if (e === "b" || e === "i" || e === "u") {
|
|
15367
|
-
t.preventDefault(), t.stopImmediatePropagation(), e === "b" ?
|
|
15377
|
+
t.preventDefault(), t.stopImmediatePropagation(), e === "b" ? ne(n) : e === "i" ? re(n) : ie(n), n.editor.focus({ preventScroll: !0 });
|
|
15368
15378
|
return;
|
|
15369
15379
|
}
|
|
15370
15380
|
}
|
|
@@ -17379,7 +17389,7 @@ function wy(e) {
|
|
|
17379
17389
|
region: i
|
|
17380
17390
|
})
|
|
17381
17391
|
});
|
|
17382
|
-
},
|
|
17392
|
+
}, W = (e) => {
|
|
17383
17393
|
let n = e.trim();
|
|
17384
17394
|
if (!n) throw Error("Annotation note cannot be empty.");
|
|
17385
17395
|
let i = Cy(t).filter(T), a = t.current.selectionOriginRect ? oa(t.current.selectionOriginRect) : null;
|
|
@@ -17402,7 +17412,7 @@ function wy(e) {
|
|
|
17402
17412
|
elements: i
|
|
17403
17413
|
})
|
|
17404
17414
|
}, i);
|
|
17405
|
-
},
|
|
17415
|
+
}, te = () => {
|
|
17406
17416
|
for (let [e, t] of _) t.value || t.priority ? e.style.setProperty("display", t.value, t.priority) : e.style.removeProperty("display");
|
|
17407
17417
|
_.clear();
|
|
17408
17418
|
};
|
|
@@ -17502,7 +17512,7 @@ function wy(e) {
|
|
|
17502
17512
|
height: e.height
|
|
17503
17513
|
})));
|
|
17504
17514
|
},
|
|
17505
|
-
addSelectionAnnotation:
|
|
17515
|
+
addSelectionAnnotation: W,
|
|
17506
17516
|
addRegionAnnotation: ee,
|
|
17507
17517
|
removeAnnotation(e) {
|
|
17508
17518
|
let t = m.findIndex((t) => t.id === e);
|
|
@@ -17532,10 +17542,10 @@ function wy(e) {
|
|
|
17532
17542
|
}), t.style.setProperty("display", "none", "important"));
|
|
17533
17543
|
},
|
|
17534
17544
|
finishCapture() {
|
|
17535
|
-
|
|
17545
|
+
te();
|
|
17536
17546
|
},
|
|
17537
17547
|
dispose() {
|
|
17538
|
-
b || (b = !0, I(), L(), R(),
|
|
17548
|
+
b || (b = !0, I(), L(), R(), te(), v.clear(), y.clear(), m.length = 0, g.clear());
|
|
17539
17549
|
}
|
|
17540
17550
|
};
|
|
17541
17551
|
}
|
|
@@ -17691,19 +17701,19 @@ function Ny(e) {
|
|
|
17691
17701
|
let e = U().rendererRoot;
|
|
17692
17702
|
if (!e?.isConnected) throw Error("Mesurer renderer root is unavailable for runtime bridge setup.");
|
|
17693
17703
|
return e;
|
|
17694
|
-
},
|
|
17704
|
+
}, W = () => {
|
|
17695
17705
|
if (!_) throw Error("Mesurer built-in controller is unavailable for runtime bridge setup.");
|
|
17696
17706
|
return _;
|
|
17697
|
-
},
|
|
17698
|
-
let t =
|
|
17707
|
+
}, te = () => U().current.settings.theme, ne = (e) => {
|
|
17708
|
+
let t = te();
|
|
17699
17709
|
return e(t), U().subscribe(() => {
|
|
17700
|
-
let n =
|
|
17710
|
+
let n = te();
|
|
17701
17711
|
n !== t && (t = n, e(n));
|
|
17702
17712
|
});
|
|
17703
|
-
},
|
|
17713
|
+
}, re = () => {
|
|
17704
17714
|
let e = B.createElement("div");
|
|
17705
17715
|
e.dataset.mesurerInspectorUi = "true";
|
|
17706
|
-
let t =
|
|
17716
|
+
let t = ne((t) => {
|
|
17707
17717
|
e.dataset.theme = t;
|
|
17708
17718
|
});
|
|
17709
17719
|
ee().append(e);
|
|
@@ -17714,15 +17724,15 @@ function Ny(e) {
|
|
|
17714
17724
|
n || (n = !0, t(), e.remove());
|
|
17715
17725
|
}
|
|
17716
17726
|
};
|
|
17717
|
-
},
|
|
17727
|
+
}, ie = (e) => wy({
|
|
17718
17728
|
model: U(),
|
|
17719
17729
|
ownerDocument: B,
|
|
17720
17730
|
ownerWindow: V,
|
|
17721
17731
|
uiRoot: R,
|
|
17722
17732
|
pageTarget: H,
|
|
17723
17733
|
persistenceKey: e ? `${L.persistKey ?? "mesurer-plugin-settings"}:${e}:${V.location.origin}` : void 0
|
|
17724
|
-
}),
|
|
17725
|
-
|
|
17734
|
+
}), ae = B.createElement("style");
|
|
17735
|
+
ae.dataset.mesurerPluginVisibility = "true", ae.dataset.mesurerInspectorUi = "true", ae.textContent = j(), R.append(ae);
|
|
17726
17736
|
let oe = L.persistKey ? `${L.persistKey}:plugins` : Ey, se = `${oe}:availability`, ce = /* @__PURE__ */ new Map();
|
|
17727
17737
|
try {
|
|
17728
17738
|
let e = V.localStorage.getItem(se);
|
|
@@ -17761,7 +17771,7 @@ function Ny(e) {
|
|
|
17761
17771
|
}, fe = () => de();
|
|
17762
17772
|
V.addEventListener("pagehide", fe);
|
|
17763
17773
|
let pe = I.subscribe((e) => {
|
|
17764
|
-
if (x((e) => e + 1),
|
|
17774
|
+
if (x((e) => e + 1), ae.textContent = j(), (e.reason === "state" || e.reason === "history" || e.reason === "remove" || e.reason === "replace") && ue(), S() && !b && (e.reason === "load" || e.reason === "remove" || e.reason === "replace") && le(), e.reason === "remove" && e.pluginId?.startsWith("mesurer.")) {
|
|
17765
17775
|
let t = e.pluginId.slice(8);
|
|
17766
17776
|
ky(t) && _?.deactivate(t);
|
|
17767
17777
|
}
|
|
@@ -17853,7 +17863,7 @@ function Ny(e) {
|
|
|
17853
17863
|
return;
|
|
17854
17864
|
}
|
|
17855
17865
|
if (!T(e)) return;
|
|
17856
|
-
let n =
|
|
17866
|
+
let n = W();
|
|
17857
17867
|
if (e === "guides" && E() && Se("guides")) {
|
|
17858
17868
|
await n.run("select");
|
|
17859
17869
|
return;
|
|
@@ -17875,10 +17885,10 @@ function Ny(e) {
|
|
|
17875
17885
|
rendererRoot: ee(),
|
|
17876
17886
|
currentToolMode: () => U().current.toolMode,
|
|
17877
17887
|
currentToolbarMode: () => E() ? "edit" : "select",
|
|
17878
|
-
theme:
|
|
17879
|
-
subscribeTheme:
|
|
17880
|
-
createWorkspaceRuntime:
|
|
17881
|
-
createInspectorMount:
|
|
17888
|
+
theme: te,
|
|
17889
|
+
subscribeTheme: ne,
|
|
17890
|
+
createWorkspaceRuntime: ie,
|
|
17891
|
+
createInspectorMount: re
|
|
17882
17892
|
};
|
|
17883
17893
|
e.service.provide("runtime:solid", t), ch(e), yg(e, t), vy(e, t);
|
|
17884
17894
|
for (let t of Ty) e.command.register(Ay(t), () => Ce(t));
|
|
@@ -17903,7 +17913,7 @@ function Ny(e) {
|
|
|
17903
17913
|
} catch (e) {
|
|
17904
17914
|
L.onPluginError?.(e, "plugin-persistence");
|
|
17905
17915
|
}
|
|
17906
|
-
t && (C(!0),
|
|
17916
|
+
t && (C(!0), ae.textContent = j(), L.onPluginsReady?.(I));
|
|
17907
17917
|
}
|
|
17908
17918
|
})();
|
|
17909
17919
|
let we = (e) => {
|
|
@@ -17962,7 +17972,7 @@ function Ny(e) {
|
|
|
17962
17972
|
return V.addEventListener("keydown", Te, !0), () => {
|
|
17963
17973
|
t = !1;
|
|
17964
17974
|
for (let e of A) I.cancelLoad(e);
|
|
17965
|
-
A.clear(), de(), V.removeEventListener("pagehide", fe), V.removeEventListener("keydown", Te, !0), pe(),
|
|
17975
|
+
A.clear(), de(), V.removeEventListener("pagehide", fe), V.removeEventListener("keydown", Te, !0), pe(), ae.remove(), g = null, _ = null, v = () => void 0, y = async () => void 0, r && I.dispose();
|
|
17966
17976
|
};
|
|
17967
17977
|
}), Y(Kd, {
|
|
17968
17978
|
runtime: {
|
|
@@ -18160,20 +18170,20 @@ var zy = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), By = 0, Vy = (e)
|
|
|
18160
18170
|
} : Gy(e, t, n, r, i);
|
|
18161
18171
|
};
|
|
18162
18172
|
function qy(e) {
|
|
18163
|
-
let [t, n] = K(0), [r, i] = K(0), [a, o] = K(null), [s, c] = K(null), [l, u] = K(null), [d, f] = K({}), [p, m] = K(null), [h, g] = K(!1), [_, v] = K(""), [y, b] = K(null), [x, S] = K(!1), [C, w] = K(null), [T, E] = K(null), D = `--mesurer-annotation-trigger-${++By}`, O = null, k = e.initialTriggerFallback === "current-and-next", A = null, j = null, M = null, N, P, F = null, I = !1, L = null, R = null, z = null, B = null, V = null, H = null, U = /* @__PURE__ */ new Map(), ee = () => N?.ownerDocument.defaultView ?? window,
|
|
18164
|
-
if (
|
|
18173
|
+
let [t, n] = K(0), [r, i] = K(0), [a, o] = K(null), [s, c] = K(null), [l, u] = K(null), [d, f] = K({}), [p, m] = K(null), [h, g] = K(!1), [_, v] = K(""), [y, b] = K(null), [x, S] = K(!1), [C, w] = K(null), [T, E] = K(null), D = `--mesurer-annotation-trigger-${++By}`, O = null, k = e.initialTriggerFallback === "current-and-next", A = null, j = null, M = null, N, P, F = null, I = !1, L = null, R = null, z = null, B = null, V = null, H = null, U = /* @__PURE__ */ new Map(), ee = () => N?.ownerDocument.defaultView ?? window, W = () => e.coordinateSpace === "viewport", te = (e) => e ? "native-anchor" : W() ? "cached-delta" : "document", ne = (e) => {
|
|
18174
|
+
if (W()) return e;
|
|
18165
18175
|
let t = ee();
|
|
18166
18176
|
return {
|
|
18167
18177
|
left: e.left + t.scrollX,
|
|
18168
18178
|
top: e.top + t.scrollY
|
|
18169
18179
|
};
|
|
18170
|
-
},
|
|
18180
|
+
}, re = () => {
|
|
18171
18181
|
let t = e.runtime.currentSelection();
|
|
18172
18182
|
return {
|
|
18173
18183
|
elements: [...t.elements],
|
|
18174
18184
|
region: t.region ? { ...t.region } : null
|
|
18175
18185
|
};
|
|
18176
|
-
},
|
|
18186
|
+
}, ie = (e, t) => e.elements.length !== t.elements.length || e.elements.some((e, n) => e !== t.elements[n]) ? !1 : e.region === t.region ? !0 : !e.region || !t.region ? !1 : e.region.left === t.region.left && e.region.top === t.region.top && e.region.width === t.region.width && e.region.height === t.region.height, ae = () => {
|
|
18177
18187
|
A = null, v(""), g(!1), b(null), m(null);
|
|
18178
18188
|
}, oe = () => {
|
|
18179
18189
|
let e = ee();
|
|
@@ -18195,7 +18205,7 @@ function qy(e) {
|
|
|
18195
18205
|
}, de = (t) => {
|
|
18196
18206
|
let n = e.runtime.annotation(t);
|
|
18197
18207
|
return !n || n.anchor.kind !== "elements" ? null : n.resolvedTargets.find(({ element: e }) => e?.isConnected)?.element ?? null;
|
|
18198
|
-
}, fe = (e) => !!(Hy(e) &&
|
|
18208
|
+
}, fe = (e) => !!(Hy(e) && W() && N && oe() && e.getRootNode() === N.getRootNode()), pe = (e) => {
|
|
18199
18209
|
let t = de(e), n = U.get(e);
|
|
18200
18210
|
if (!t) {
|
|
18201
18211
|
n && (ue(e), i((e) => e + 1));
|
|
@@ -18221,7 +18231,7 @@ function qy(e) {
|
|
|
18221
18231
|
target: t,
|
|
18222
18232
|
anchorName: null,
|
|
18223
18233
|
releaseAnchor: null,
|
|
18224
|
-
scroll: cl(a, t, () => G(e), { trackWindow:
|
|
18234
|
+
scroll: cl(a, t, () => G(e), { trackWindow: W() })
|
|
18225
18235
|
});
|
|
18226
18236
|
i((e) => e + 1);
|
|
18227
18237
|
}
|
|
@@ -18240,7 +18250,7 @@ function qy(e) {
|
|
|
18240
18250
|
e.initialTriggerFallback && (O = se());
|
|
18241
18251
|
let _e = () => {
|
|
18242
18252
|
B?.release(), B = null, z?.(), z = null, L = null, R = null;
|
|
18243
|
-
}, ve = (e) => !!(Hy(e) &&
|
|
18253
|
+
}, ve = (e) => !!(Hy(e) && W() && N && e !== O && oe() && e.getRootNode() === N.getRootNode()), ye = () => {
|
|
18244
18254
|
let e = se();
|
|
18245
18255
|
O && e !== O && (O = null);
|
|
18246
18256
|
let t = L, n = !!(e?.isConnected && ve(e)), r = R === e;
|
|
@@ -18257,7 +18267,7 @@ function qy(e) {
|
|
|
18257
18267
|
z = Uy(e, i), R = e, D = i, B = cl(a, e, le, { trackWindow: !1 });
|
|
18258
18268
|
return;
|
|
18259
18269
|
}
|
|
18260
|
-
D = i, B = cl(a, e, le, { trackWindow:
|
|
18270
|
+
D = i, B = cl(a, e, le, { trackWindow: W() });
|
|
18261
18271
|
}
|
|
18262
18272
|
}, be = (e) => {
|
|
18263
18273
|
if (V?.disconnect(), V = null, !e?.isConnected) return;
|
|
@@ -18298,7 +18308,7 @@ function qy(e) {
|
|
|
18298
18308
|
be(Ae);
|
|
18299
18309
|
let je = e.runtime.subscribe(() => {
|
|
18300
18310
|
let t = e.runtime.selectGestureActive();
|
|
18301
|
-
h() && t ? (k = !0,
|
|
18311
|
+
h() && t ? (k = !0, ae()) : h() && A !== null && !ie(A, re()) && (O = se(), k = !1, ae());
|
|
18302
18312
|
let r = se(), i = r !== Ae;
|
|
18303
18313
|
i && (Ae = r, be(Ae), k && (k = !1, O = r)), ye(), i && Se(), n((e) => e + 1), ge();
|
|
18304
18314
|
});
|
|
@@ -18333,7 +18343,7 @@ function qy(e) {
|
|
|
18333
18343
|
}), Re = () => Me().elements.length > 0 || Me().region !== null, ze = () => {
|
|
18334
18344
|
t();
|
|
18335
18345
|
let e = A;
|
|
18336
|
-
return e !== null &&
|
|
18346
|
+
return e !== null && ie(e, re());
|
|
18337
18347
|
}, Be = Gr(() => {
|
|
18338
18348
|
let e = Me(), t = e.elements.filter((e) => e.isConnected).map((e) => {
|
|
18339
18349
|
let t = eu(e);
|
|
@@ -18378,7 +18388,7 @@ function qy(e) {
|
|
|
18378
18388
|
obstacles: [...a, ...Ce()],
|
|
18379
18389
|
maxShiftRings: Math.ceil(Math.max(i.innerWidth, i.innerHeight) / 28),
|
|
18380
18390
|
viewportAware: !0
|
|
18381
|
-
}), s = o?.left ?? zy(n.left + n.width + 6, 4, i.innerWidth - 24 - 4), c = o?.top ?? zy(n.top, 4, i.innerHeight - 24 - 4), l = R === e, u =
|
|
18391
|
+
}), s = o?.left ?? zy(n.left + n.width + 6, 4, i.innerWidth - 24 - 4), c = o?.top ?? zy(n.top, 4, i.innerHeight - 24 - 4), l = R === e, u = W() && !l;
|
|
18382
18392
|
return {
|
|
18383
18393
|
left: l || u ? s : s + i.scrollX,
|
|
18384
18394
|
top: l || u ? c : c + i.scrollY,
|
|
@@ -18404,7 +18414,7 @@ function qy(e) {
|
|
|
18404
18414
|
r();
|
|
18405
18415
|
let n = U.get(e);
|
|
18406
18416
|
if (!n?.anchorName || !n.target.isConnected) return {
|
|
18407
|
-
...
|
|
18417
|
+
...ne(t),
|
|
18408
18418
|
nativeAnchor: !1
|
|
18409
18419
|
};
|
|
18410
18420
|
let i = eu(n.target);
|
|
@@ -18428,7 +18438,7 @@ function qy(e) {
|
|
|
18428
18438
|
r();
|
|
18429
18439
|
let e = Ye(), t = We();
|
|
18430
18440
|
if (!t?.isConnected || R !== t) return {
|
|
18431
|
-
...
|
|
18441
|
+
...ne(e),
|
|
18432
18442
|
nativeAnchor: !1
|
|
18433
18443
|
};
|
|
18434
18444
|
let n = eu(t);
|
|
@@ -18577,9 +18587,9 @@ function qy(e) {
|
|
|
18577
18587
|
S(!1);
|
|
18578
18588
|
}
|
|
18579
18589
|
}
|
|
18580
|
-
}, at =
|
|
18590
|
+
}, at = ae, ot = () => {
|
|
18581
18591
|
if (!Re()) return;
|
|
18582
|
-
k = !1, A =
|
|
18592
|
+
k = !1, A = re(), v(""), b(null), w(null), o(null);
|
|
18583
18593
|
let e = Ve();
|
|
18584
18594
|
if (e) {
|
|
18585
18595
|
let t = Ky(e, 272, 168, ee());
|
|
@@ -18591,7 +18601,7 @@ function qy(e) {
|
|
|
18591
18601
|
g(!0), ee().queueMicrotask(() => B?.sync());
|
|
18592
18602
|
}, st = () => {
|
|
18593
18603
|
let e = h();
|
|
18594
|
-
A !== null && !
|
|
18604
|
+
A !== null && !ie(A, re()) ? (O = se(), k = !1, ye(), Se()) : e && (k = !1), at();
|
|
18595
18605
|
}, ct = () => {
|
|
18596
18606
|
h() && (k = !0, at());
|
|
18597
18607
|
}, lt = () => {
|
|
@@ -18667,8 +18677,8 @@ function qy(e) {
|
|
|
18667
18677
|
return aa(() => (e) => {
|
|
18668
18678
|
P = e, B?.sync();
|
|
18669
18679
|
}, t), Q(t, Y(_f, { size: 14 })), J(() => ({
|
|
18670
|
-
e:
|
|
18671
|
-
t:
|
|
18680
|
+
e: W() ? "viewport" : "document",
|
|
18681
|
+
t: te(e().nativeAnchor),
|
|
18672
18682
|
a: {
|
|
18673
18683
|
position: e().nativeAnchor || e().viewportOwned ? "fixed" : "absolute",
|
|
18674
18684
|
left: e().nativeAnchor ? `calc(anchor(left) + ${e().anchorX}px)` : `${e().left}px`,
|
|
@@ -18743,10 +18753,10 @@ function qy(e) {
|
|
|
18743
18753
|
return Q(t, e), t;
|
|
18744
18754
|
})()
|
|
18745
18755
|
}), 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(() => ({
|
|
18746
|
-
e:
|
|
18747
|
-
t:
|
|
18756
|
+
e: W() ? "viewport" : "document",
|
|
18757
|
+
t: te(e().nativeAnchor),
|
|
18748
18758
|
a: {
|
|
18749
|
-
position: e().nativeAnchor ||
|
|
18759
|
+
position: e().nativeAnchor || W() ? "fixed" : "absolute",
|
|
18750
18760
|
left: e().nativeAnchor ? `calc(anchor(left) + ${e().anchorX}px)` : `${e().left}px`,
|
|
18751
18761
|
top: e().nativeAnchor ? `calc(anchor(top) + ${e().anchorY}px)` : `${e().top}px`,
|
|
18752
18762
|
translate: "var(--mesurer-nested-scroll-x, 0px) var(--mesurer-nested-scroll-y, 0px)",
|
|
@@ -18773,7 +18783,7 @@ function qy(e) {
|
|
|
18773
18783
|
left: e.left,
|
|
18774
18784
|
top: e.top
|
|
18775
18785
|
}) : {
|
|
18776
|
-
...
|
|
18786
|
+
...ne({
|
|
18777
18787
|
left: e.left,
|
|
18778
18788
|
top: e.top
|
|
18779
18789
|
}),
|
|
@@ -18789,9 +18799,9 @@ function qy(e) {
|
|
|
18789
18799
|
});
|
|
18790
18800
|
return J(() => ({
|
|
18791
18801
|
e: t() ?? void 0,
|
|
18792
|
-
t:
|
|
18802
|
+
t: te(n().nativeAnchor),
|
|
18793
18803
|
a: {
|
|
18794
|
-
position: n().nativeAnchor ||
|
|
18804
|
+
position: n().nativeAnchor || W() ? "fixed" : "absolute",
|
|
18795
18805
|
left: n().nativeAnchor ? `calc(anchor(left) + ${n().anchorX}px)` : `${n().left}px`,
|
|
18796
18806
|
top: n().nativeAnchor ? `calc(anchor(top) + ${n().anchorY}px)` : `${n().top}px`,
|
|
18797
18807
|
width: `${e.width}px`,
|
|
@@ -18851,13 +18861,13 @@ function qy(e) {
|
|
|
18851
18861
|
t: t() + 1,
|
|
18852
18862
|
a: i() ? "true" : void 0,
|
|
18853
18863
|
o: o() ? "true" : void 0,
|
|
18854
|
-
i:
|
|
18855
|
-
n:
|
|
18864
|
+
i: te(n().nativeAnchor),
|
|
18865
|
+
n: W() ? "viewport" : "document",
|
|
18856
18866
|
s: `Mesurer annotation ${t() + 1}: ${e.note}`,
|
|
18857
18867
|
h: e.note,
|
|
18858
18868
|
r: a() === e.id ? "true" : "false",
|
|
18859
18869
|
d: {
|
|
18860
|
-
position: n().nativeAnchor ||
|
|
18870
|
+
position: n().nativeAnchor || W() ? "fixed" : "absolute",
|
|
18861
18871
|
left: n().nativeAnchor ? `calc(anchor(left) + ${n().anchorX}px)` : `${n().left}px`,
|
|
18862
18872
|
top: n().nativeAnchor ? `calc(anchor(top) + ${n().anchorY}px)` : `${n().top}px`,
|
|
18863
18873
|
opacity: o() ? "0.36" : "1",
|
|
@@ -18947,10 +18957,10 @@ function qy(e) {
|
|
|
18947
18957
|
})()
|
|
18948
18958
|
}), null), J(() => ({
|
|
18949
18959
|
e: t().id,
|
|
18950
|
-
t:
|
|
18951
|
-
a:
|
|
18960
|
+
t: te(n().nativeAnchor),
|
|
18961
|
+
a: W() ? "viewport" : "document",
|
|
18952
18962
|
o: {
|
|
18953
|
-
position: n().nativeAnchor ||
|
|
18963
|
+
position: n().nativeAnchor || W() ? "fixed" : "absolute",
|
|
18954
18964
|
left: n().nativeAnchor ? `calc(anchor(left) + ${n().anchorX}px)` : `${n().left}px`,
|
|
18955
18965
|
top: n().nativeAnchor ? `calc(anchor(top) + ${n().anchorY}px)` : `${n().top}px`,
|
|
18956
18966
|
translate: "var(--mesurer-nested-scroll-x, 0px) var(--mesurer-nested-scroll-y, 0px)",
|
|
@@ -20334,29 +20344,29 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20334
20344
|
}), ee = (e) => {
|
|
20335
20345
|
let t = k?.duration ?? 0, n = m.getBoundingClientRect();
|
|
20336
20346
|
return t <= 0 || n.width <= 0 ? 0 : Math.min(t, Math.max(0, (e - n.left) / n.width * t));
|
|
20337
|
-
},
|
|
20347
|
+
}, W = () => {
|
|
20338
20348
|
let e = k?.duration ?? 0, t = Math.min(e, Math.max(0, c.currentTime || 0)), n = H(L) * 100, r = H(R) * 100;
|
|
20339
20349
|
v.style.left = `${n}%`, y.style.left = `${r}%`, h.style.left = `${n}%`, h.style.width = `${Math.max(0, r - n)}%`, _.style.left = `${H(t) * 100}%`, v.setAttribute("aria-valuemax", String(Math.max(0, R - Hx))), v.setAttribute("aria-valuenow", String(L)), v.setAttribute("aria-valuetext", Wx(L)), y.setAttribute("aria-valuemin", String(Math.min(e, L + Hx))), y.setAttribute("aria-valuemax", String(e)), y.setAttribute("aria-valuenow", String(R)), y.setAttribute("aria-valuetext", Wx(R)), f.textContent = Wx(t), b.textContent = Wx(e);
|
|
20340
|
-
},
|
|
20350
|
+
}, te = (e, t = !0) => {
|
|
20341
20351
|
if (!k) return;
|
|
20342
20352
|
let n = Math.min(R, Math.max(L, e));
|
|
20343
|
-
t && !c.paused && c.pause(), c.currentTime = n,
|
|
20353
|
+
t && !c.paused && c.pause(), c.currentTime = n, W();
|
|
20354
|
+
}, ne = (e, t = !1) => {
|
|
20355
|
+
k && (L = Math.min(Math.max(0, e), Math.max(0, R - Hx)), (t || c.currentTime < L) && te(L), W());
|
|
20344
20356
|
}, re = (e, t = !1) => {
|
|
20345
|
-
k && (
|
|
20346
|
-
}, ie = (
|
|
20347
|
-
k && (R = Math.max(Math.min(k.duration, e), Math.min(k.duration, L + Hx)), t ? ne(R) : c.currentTime > R && ne(L), te());
|
|
20348
|
-
}, ae = () => {
|
|
20357
|
+
k && (R = Math.max(Math.min(k.duration, e), Math.min(k.duration, L + Hx)), t ? te(R) : c.currentTime > R && te(L), W());
|
|
20358
|
+
}, ie = () => {
|
|
20349
20359
|
S.textContent = `${I}×`;
|
|
20350
20360
|
for (let e of T) {
|
|
20351
20361
|
let t = e.scale === I;
|
|
20352
20362
|
e.button.setAttribute("aria-checked", t ? "true" : "false"), e.check.style.opacity = t ? "1" : "0", e.text.textContent = k ? `${e.scale}× ${Math.round(k.width * e.scale)} × ${Math.round(k.height * e.scale)}` : `${e.scale}×`;
|
|
20353
20363
|
}
|
|
20354
|
-
},
|
|
20364
|
+
}, ae = () => {
|
|
20355
20365
|
w.replaceChildren();
|
|
20356
20366
|
for (let t of P) {
|
|
20357
20367
|
let n = Rx(e, t === "mp4" ? "MP4" : "WebM"), r = t === F;
|
|
20358
20368
|
n.button.dataset.mesurerRecordingFormat = t, n.button.setAttribute("aria-checked", r ? "true" : "false"), n.check.style.opacity = r ? "1" : "0", n.button.addEventListener("click", () => {
|
|
20359
|
-
F = t,
|
|
20369
|
+
F = t, ae();
|
|
20360
20370
|
}), w.append(n.button);
|
|
20361
20371
|
}
|
|
20362
20372
|
}, oe = () => {
|
|
@@ -20416,7 +20426,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20416
20426
|
}, he = (e) => {
|
|
20417
20427
|
if (!z) return;
|
|
20418
20428
|
let t = ee(e);
|
|
20419
|
-
z === "start" ?
|
|
20429
|
+
z === "start" ? ne(t, !0) : z === "end" ? re(t, !0) : te(t);
|
|
20420
20430
|
}, ge = (e, t) => {
|
|
20421
20431
|
!k || M || t.button !== 0 || (t.preventDefault(), t.stopPropagation(), z = e, B = t.pointerId, _.style.height = "10px", he(t.clientX));
|
|
20422
20432
|
}, _e = (e) => {
|
|
@@ -20436,7 +20446,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20436
20446
|
if (!k || t.key !== "ArrowLeft" && t.key !== "ArrowRight") return;
|
|
20437
20447
|
t.preventDefault();
|
|
20438
20448
|
let n = t.key === "ArrowLeft" ? -1 : 1, r = (e === "start" ? L : R) + n * .05;
|
|
20439
|
-
e === "start" ?
|
|
20449
|
+
e === "start" ? ne(r, !0) : re(r, !0);
|
|
20440
20450
|
});
|
|
20441
20451
|
t.addEventListener("pointermove", _e, !0), t.addEventListener("pointerup", ve, !0), t.addEventListener("pointercancel", ve, !0), u.addEventListener("click", (e) => {
|
|
20442
20452
|
e.stopPropagation(), fe();
|
|
@@ -20448,14 +20458,14 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20448
20458
|
}), c.addEventListener("pause", () => {
|
|
20449
20459
|
d.textContent = "▶", d.setAttribute("aria-label", "Play"), d.title = "Play";
|
|
20450
20460
|
}), c.addEventListener("timeupdate", () => {
|
|
20451
|
-
k && (c.currentTime >= R - .01 ? (c.pause(), c.currentTime = L) : c.currentTime < L && (c.currentTime = L),
|
|
20461
|
+
k && (c.currentTime >= R - .01 ? (c.pause(), c.currentTime = L) : c.currentTime < L && (c.currentTime = L), W());
|
|
20452
20462
|
}), c.addEventListener("loadedmetadata", () => {
|
|
20453
|
-
|
|
20463
|
+
W();
|
|
20454
20464
|
}), S.addEventListener("click", () => {
|
|
20455
20465
|
M || se(C.style.display === "none");
|
|
20456
20466
|
});
|
|
20457
20467
|
for (let e of T) e.button.addEventListener("click", () => {
|
|
20458
|
-
I = e.scale,
|
|
20468
|
+
I = e.scale, ie();
|
|
20459
20469
|
});
|
|
20460
20470
|
let ye = (e) => {
|
|
20461
20471
|
C.style.display !== "none" && (e.composedPath().includes(x) || se(!1));
|
|
@@ -20493,12 +20503,12 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20493
20503
|
show(e) {
|
|
20494
20504
|
N += 1, V &&= (V.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"), ue(), k = e, j = !1, I = 1, F = "webm", P = ["webm"], L = 0, R = e.duration, z = null, B = null;
|
|
20495
20505
|
let n = globalThis.URL.createObjectURL(e.blob);
|
|
20496
|
-
A = 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 = "352px", s.style.maxHeight = "144px", c.style.maxHeight = "144px", D.textContent = "↗", D.setAttribute("aria-label", "Grow preview"), D.title = "Grow preview", f.textContent = "0:00.00", b.textContent = Wx(e.duration), O.style.display = "none", O.style.color = "var(--msr-color-ink-500, #64748b)", se(!1),
|
|
20506
|
+
A = 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 = "352px", s.style.maxHeight = "144px", c.style.maxHeight = "144px", D.textContent = "↗", D.setAttribute("aria-label", "Grow preview"), D.title = "Grow preview", f.textContent = "0:00.00", b.textContent = Wx(e.duration), O.style.display = "none", O.style.color = "var(--msr-color-ink-500, #64748b)", se(!1), ae(), ie(), W(), ce(!1), o.style.display = "block", G(), o.focus({ preventScroll: !0 });
|
|
20497
20507
|
let i = N;
|
|
20498
20508
|
r(e).then((e) => {
|
|
20499
|
-
i !== N || !k || (P = e, F = e.includes(F) ? F : e[0] ?? "webm",
|
|
20509
|
+
i !== N || !k || (P = e, F = e.includes(F) ? F : e[0] ?? "webm", ae(), E.disabled = e.length === 0, e.length === 0 && (O.style.display = "block", O.style.color = "var(--msr-danger-text, #dc2626)", O.textContent = "No MediaBunny video encoder is available in this runtime."));
|
|
20500
20510
|
}).catch((e) => {
|
|
20501
|
-
i === N && (P = [],
|
|
20511
|
+
i === N && (P = [], ae(), E.disabled = !0, O.style.display = "block", O.style.color = "var(--msr-danger-text, #dc2626)", O.textContent = e instanceof Error ? e.message : "Could not inspect export support.");
|
|
20502
20512
|
}), t.requestAnimationFrame(G);
|
|
20503
20513
|
},
|
|
20504
20514
|
dismiss: de,
|
|
@@ -20795,7 +20805,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20795
20805
|
}), r.append(R);
|
|
20796
20806
|
let z = null, B = null, V = !1, H = null, U = 0, ee = () => {
|
|
20797
20807
|
z = null, B = null, V = !1, H = null;
|
|
20798
|
-
},
|
|
20808
|
+
}, W = (e, t) => {
|
|
20799
20809
|
for (let n of [
|
|
20800
20810
|
"left",
|
|
20801
20811
|
"top",
|
|
@@ -20805,7 +20815,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20805
20815
|
let r = t[n];
|
|
20806
20816
|
r === void 0 ? e.style.removeProperty(n) : e.style.setProperty(n, `${r}px`);
|
|
20807
20817
|
}
|
|
20808
|
-
},
|
|
20818
|
+
}, te = (e) => {
|
|
20809
20819
|
let n = t.innerWidth, r = t.innerHeight, i = Math.min(n, Math.max(4, Math.round(e.width))), a = Math.min(r, Math.max(4, Math.round(e.height)));
|
|
20810
20820
|
return {
|
|
20811
20821
|
left: Math.min(Math.max(0, Math.round(e.left)), Math.max(0, n - i)),
|
|
@@ -20813,16 +20823,16 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20813
20823
|
width: i,
|
|
20814
20824
|
height: a
|
|
20815
20825
|
};
|
|
20816
|
-
},
|
|
20826
|
+
}, ne = (e, t) => t.x >= e.left && t.x <= e.left + e.width && t.y >= e.top && t.y <= e.top + e.height, re = (e) => {
|
|
20817
20827
|
let n = t.innerWidth, r = t.innerHeight;
|
|
20818
20828
|
if (!e || e.width <= 0 || e.height <= 0) {
|
|
20819
|
-
|
|
20829
|
+
W(p[0], {
|
|
20820
20830
|
left: 0,
|
|
20821
20831
|
top: 0,
|
|
20822
20832
|
width: n,
|
|
20823
20833
|
height: r
|
|
20824
20834
|
});
|
|
20825
|
-
for (let e of p.slice(1))
|
|
20835
|
+
for (let e of p.slice(1)) W(e, {
|
|
20826
20836
|
left: 0,
|
|
20827
20837
|
top: 0,
|
|
20828
20838
|
width: 0,
|
|
@@ -20833,27 +20843,27 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20833
20843
|
g.style.display = "none", v.style.display = "none", _.textContent = "Drag to select a region · Esc to cancel";
|
|
20834
20844
|
return;
|
|
20835
20845
|
}
|
|
20836
|
-
if (
|
|
20846
|
+
if (W(p[0], {
|
|
20837
20847
|
left: 0,
|
|
20838
20848
|
top: 0,
|
|
20839
20849
|
width: n,
|
|
20840
20850
|
height: e.top
|
|
20841
|
-
}),
|
|
20851
|
+
}), W(p[1], {
|
|
20842
20852
|
left: 0,
|
|
20843
20853
|
top: e.top,
|
|
20844
20854
|
width: e.left,
|
|
20845
20855
|
height: e.height
|
|
20846
|
-
}),
|
|
20856
|
+
}), W(p[2], {
|
|
20847
20857
|
left: e.left + e.width,
|
|
20848
20858
|
top: e.top,
|
|
20849
20859
|
width: Math.max(0, n - e.left - e.width),
|
|
20850
20860
|
height: e.height
|
|
20851
|
-
}),
|
|
20861
|
+
}), W(p[3], {
|
|
20852
20862
|
left: 0,
|
|
20853
20863
|
top: e.top + e.height,
|
|
20854
20864
|
width: n,
|
|
20855
20865
|
height: Math.max(0, r - e.top - e.height)
|
|
20856
|
-
}), h.style.display = "block",
|
|
20866
|
+
}), h.style.display = "block", W(h, e), V) {
|
|
20857
20867
|
h.style.pointerEvents = "auto", h.style.cursor = "move", j.style.display = "block";
|
|
20858
20868
|
for (let e of N) e.style.display = "block";
|
|
20859
20869
|
g.style.display = "none", S.value = String(Math.round(e.width)), C.value = String(Math.round(e.height)), D.value = String(Math.round(e.left)), O.value = String(Math.round(e.top)), S.max = String(n), C.max = String(r), D.max = String(Math.max(0, n - e.width)), O.max = String(Math.max(0, r - e.height));
|
|
@@ -20862,29 +20872,29 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20862
20872
|
} else {
|
|
20863
20873
|
h.style.pointerEvents = "none", h.style.cursor = "", j.style.display = "none";
|
|
20864
20874
|
for (let e of N) e.style.display = "none";
|
|
20865
|
-
v.style.display = "none", g.style.display = "block", g.textContent = `${Math.round(e.width)} × ${Math.round(e.height)}`,
|
|
20875
|
+
v.style.display = "none", g.style.display = "block", g.textContent = `${Math.round(e.width)} × ${Math.round(e.height)}`, W(g, {
|
|
20866
20876
|
left: e.left + e.width / 2,
|
|
20867
20877
|
top: Math.min(r - 22, e.top + e.height + 6)
|
|
20868
20878
|
}), _.textContent = "Drag to select a region · Esc to cancel";
|
|
20869
20879
|
}
|
|
20880
|
+
}, ie = (e) => {
|
|
20881
|
+
let t = te(e);
|
|
20882
|
+
B = t, s(t), re(t);
|
|
20870
20883
|
}, ae = (e) => {
|
|
20871
|
-
let t = ne(e);
|
|
20872
|
-
B = t, s(t), ie(t);
|
|
20873
|
-
}, W = (e) => {
|
|
20874
20884
|
ee();
|
|
20875
|
-
for (let e of p)
|
|
20885
|
+
for (let e of p) W(e, {
|
|
20876
20886
|
left: 0,
|
|
20877
20887
|
top: 0,
|
|
20878
20888
|
width: 0,
|
|
20879
20889
|
height: 0
|
|
20880
20890
|
});
|
|
20881
|
-
|
|
20891
|
+
W(m, e), m.style.display = "block", h.style.display = "none", g.style.display = "none", v.style.display = "none", j.style.display = "none", _.style.display = "none";
|
|
20882
20892
|
for (let e of N) e.style.display = "none";
|
|
20883
20893
|
f.style.display = "block", f.style.pointerEvents = "none", f.style.cursor = "default";
|
|
20884
20894
|
}, oe = () => {
|
|
20885
20895
|
d(!1), m.style.display = "none", f.style.display = "none", f.style.pointerEvents = "auto", f.style.cursor = "crosshair", _.style.removeProperty("display");
|
|
20886
20896
|
}, se = () => {
|
|
20887
|
-
ee(),
|
|
20897
|
+
ee(), re(null), f.style.display = "none", f.style.cursor = "crosshair", n.style.pointerEvents = "none";
|
|
20888
20898
|
}, ce = (e) => {
|
|
20889
20899
|
let n = t.innerHeight, r = t.innerWidth;
|
|
20890
20900
|
P.style.visibility = "hidden", P.style.display = "flex";
|
|
@@ -20913,13 +20923,13 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20913
20923
|
rect: { ...r }
|
|
20914
20924
|
}, f.setPointerCapture?.(e.pointerId));
|
|
20915
20925
|
}, de = (e) => {
|
|
20916
|
-
!a() || e.button !== 0 || V && B &&
|
|
20926
|
+
!a() || e.button !== 0 || V && B && ne(B, {
|
|
20917
20927
|
x: e.clientX,
|
|
20918
20928
|
y: e.clientY
|
|
20919
20929
|
}) || (e.preventDefault(), e.stopPropagation(), V = !1, B = null, s(null), f.style.cursor = "crosshair", z = {
|
|
20920
20930
|
x: e.clientX,
|
|
20921
20931
|
y: e.clientY
|
|
20922
|
-
},
|
|
20932
|
+
}, re(Xa(z, z, {
|
|
20923
20933
|
width: t.innerWidth,
|
|
20924
20934
|
height: t.innerHeight
|
|
20925
20935
|
})), f.setPointerCapture?.(e.pointerId));
|
|
@@ -20928,7 +20938,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20928
20938
|
if (H) {
|
|
20929
20939
|
let n = H, r = e.clientX - n.startX, i = e.clientY - n.startY, a = t.innerWidth, o = t.innerHeight;
|
|
20930
20940
|
if (n.kind === "move") {
|
|
20931
|
-
|
|
20941
|
+
ie({
|
|
20932
20942
|
...n.rect,
|
|
20933
20943
|
left: n.rect.left + r,
|
|
20934
20944
|
top: n.rect.top + i
|
|
@@ -20936,7 +20946,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20936
20946
|
return;
|
|
20937
20947
|
}
|
|
20938
20948
|
let s = n.handle ?? "", c = n.rect.left, l = n.rect.top, u = n.rect.left + n.rect.width, d = n.rect.top + n.rect.height;
|
|
20939
|
-
s.includes("w") && (c = Math.min(u - 4, Math.max(0, n.rect.left + r))), s.includes("e") && (u = Math.max(c + 4, Math.min(a, n.rect.left + n.rect.width + r))), s.includes("n") && (l = Math.min(d - 4, Math.max(0, n.rect.top + i))), s.includes("s") && (d = Math.max(l + 4, Math.min(o, n.rect.top + n.rect.height + i))),
|
|
20949
|
+
s.includes("w") && (c = Math.min(u - 4, Math.max(0, n.rect.left + r))), s.includes("e") && (u = Math.max(c + 4, Math.min(a, n.rect.left + n.rect.width + r))), s.includes("n") && (l = Math.min(d - 4, Math.max(0, n.rect.top + i))), s.includes("s") && (d = Math.max(l + 4, Math.min(o, n.rect.top + n.rect.height + i))), ie({
|
|
20940
20950
|
left: c,
|
|
20941
20951
|
top: l,
|
|
20942
20952
|
width: u - c,
|
|
@@ -20944,7 +20954,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20944
20954
|
});
|
|
20945
20955
|
return;
|
|
20946
20956
|
}
|
|
20947
|
-
z &&
|
|
20957
|
+
z && re(Xa(z, {
|
|
20948
20958
|
x: e.clientX,
|
|
20949
20959
|
y: e.clientY
|
|
20950
20960
|
}, {
|
|
@@ -20954,7 +20964,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20954
20964
|
}
|
|
20955
20965
|
}, pe = (e) => {
|
|
20956
20966
|
if (H) {
|
|
20957
|
-
H = null, f.hasPointerCapture?.(e.pointerId) && f.releasePointerCapture(e.pointerId), B &&
|
|
20967
|
+
H = null, f.hasPointerCapture?.(e.pointerId) && f.releasePointerCapture(e.pointerId), B && re(B);
|
|
20958
20968
|
return;
|
|
20959
20969
|
}
|
|
20960
20970
|
let n = z;
|
|
@@ -20968,12 +20978,12 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
20968
20978
|
height: t.innerHeight
|
|
20969
20979
|
});
|
|
20970
20980
|
if (r.width < 4 || r.height < 4) {
|
|
20971
|
-
B = null, V = !1, s(null),
|
|
20981
|
+
B = null, V = !1, s(null), re(null);
|
|
20972
20982
|
return;
|
|
20973
20983
|
}
|
|
20974
|
-
B =
|
|
20984
|
+
B = te(r), V = !0, f.style.cursor = "default", s(B), re(B);
|
|
20975
20985
|
}, me = (e) => {
|
|
20976
|
-
z = null, H = null, f.hasPointerCapture?.(e.pointerId) && f.releasePointerCapture(e.pointerId),
|
|
20986
|
+
z = null, H = null, f.hasPointerCapture?.(e.pointerId) && f.releasePointerCapture(e.pointerId), re(B && V ? B : null);
|
|
20977
20987
|
}, he = (e) => {
|
|
20978
20988
|
if (e.key === "Enter" && a() && V && B) {
|
|
20979
20989
|
e.preventDefault(), e.stopImmediatePropagation(), c(B).catch(() => void 0);
|
|
@@ -21001,7 +21011,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21001
21011
|
});
|
|
21002
21012
|
let ge = (e, t) => {
|
|
21003
21013
|
let n = B, r = Number(e.value);
|
|
21004
|
-
!n || !Number.isFinite(r) ||
|
|
21014
|
+
!n || !Number.isFinite(r) || ie({
|
|
21005
21015
|
...n,
|
|
21006
21016
|
[t]: r
|
|
21007
21017
|
});
|
|
@@ -21016,10 +21026,10 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21016
21026
|
a() && P.style.display !== "none" && l().catch(() => void 0);
|
|
21017
21027
|
}), {
|
|
21018
21028
|
startSelection: () => {
|
|
21019
|
-
ee(),
|
|
21029
|
+
ee(), re(null), f.style.display = "block", f.style.pointerEvents = "auto", _.style.removeProperty("display"), n.style.pointerEvents = "auto";
|
|
21020
21030
|
},
|
|
21021
21031
|
finishSelection: se,
|
|
21022
|
-
showRecordingMask:
|
|
21032
|
+
showRecordingMask: ae,
|
|
21023
21033
|
hideRecordingMask: oe,
|
|
21024
21034
|
placeRecordingStatus: ce,
|
|
21025
21035
|
hideRecordingStatus: le,
|
|
@@ -21358,7 +21368,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21358
21368
|
return;
|
|
21359
21369
|
}
|
|
21360
21370
|
if (h.status === "selecting") {
|
|
21361
|
-
await
|
|
21371
|
+
await W();
|
|
21362
21372
|
return;
|
|
21363
21373
|
}
|
|
21364
21374
|
if (!e) {
|
|
@@ -21367,7 +21377,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21367
21377
|
}
|
|
21368
21378
|
if (e.width < 4 || e.height < 4) throw Error("Recording selection must be at least 4px by 4px.");
|
|
21369
21379
|
await H(e);
|
|
21370
|
-
},
|
|
21380
|
+
}, W = async () => {
|
|
21371
21381
|
++T, x.finishSelection(), await F(!0), P(), h.status !== "ready" && j({
|
|
21372
21382
|
status: "idle",
|
|
21373
21383
|
elapsed: 0,
|
|
@@ -21388,13 +21398,13 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21388
21398
|
isRecording: () => h.status === "recording",
|
|
21389
21399
|
onRectChange: (e) => j({ rect: e }),
|
|
21390
21400
|
onConfirm: H,
|
|
21391
|
-
onCancel:
|
|
21401
|
+
onCancel: W,
|
|
21392
21402
|
onStop: async () => {
|
|
21393
21403
|
await B();
|
|
21394
21404
|
},
|
|
21395
21405
|
setRecordingInteractionActive: u.setActive
|
|
21396
21406
|
});
|
|
21397
|
-
let
|
|
21407
|
+
let te = {
|
|
21398
21408
|
snapshot: () => lS(h),
|
|
21399
21409
|
subscribe(e) {
|
|
21400
21410
|
return g.add(e), () => g.delete(e);
|
|
@@ -21404,7 +21414,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21404
21414
|
formats: L,
|
|
21405
21415
|
start: ee,
|
|
21406
21416
|
stop: B,
|
|
21407
|
-
cancel:
|
|
21417
|
+
cancel: W,
|
|
21408
21418
|
discard: I,
|
|
21409
21419
|
export: R
|
|
21410
21420
|
};
|
|
@@ -21453,7 +21463,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21453
21463
|
description: "Show selected-region video recording in the Select toolbar.",
|
|
21454
21464
|
value: () => p().toolEnabled,
|
|
21455
21465
|
set: async (e) => {
|
|
21456
|
-
m({ toolEnabled: e }), !e && M() && await
|
|
21466
|
+
m({ toolEnabled: e }), !e && M() && await W();
|
|
21457
21467
|
}
|
|
21458
21468
|
}, {
|
|
21459
21469
|
type: "toggle",
|
|
@@ -21469,7 +21479,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21469
21479
|
}), t.command.register(tS, async () => (await ee(), mS(h))), t.command.register(nS, async () => gS(await B())), t.command.register(rS, () => (I(), mS(h))), t.command.register(iS, async (e) => {
|
|
21470
21480
|
let t = await R(pS(e));
|
|
21471
21481
|
return _S(t, r, i), hS(t);
|
|
21472
|
-
}), t.service.provide(Qx,
|
|
21482
|
+
}), t.service.provide(Qx, te), t.lifecycle.onDispose(() => {
|
|
21473
21483
|
O = !0, ++T, g.clear(), z.dispose(), x.dispose(), P(), F(!0), s.dispose(), a.dispose();
|
|
21474
21484
|
});
|
|
21475
21485
|
}
|
|
@@ -21702,20 +21712,20 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21702
21712
|
x?.pointerId === null && z(e.clientX, e.clientY);
|
|
21703
21713
|
}, ee = (e) => {
|
|
21704
21714
|
e.button === 0 && x?.pointerId === null && B();
|
|
21705
|
-
},
|
|
21715
|
+
}, W = (e) => {
|
|
21706
21716
|
e.pointerType !== "mouse" && e.button === 0 && R(e.clientX, e.clientY, e.pointerId) && (o.setPointerCapture?.(e.pointerId), e.preventDefault());
|
|
21707
|
-
},
|
|
21717
|
+
}, te = (e) => {
|
|
21708
21718
|
let t = x?.pointerId;
|
|
21709
21719
|
t != null && t === e.pointerId && z(e.clientX, e.clientY);
|
|
21710
|
-
},
|
|
21720
|
+
}, ne = (e) => {
|
|
21711
21721
|
let t = x?.pointerId;
|
|
21712
21722
|
t != null && t === e.pointerId && (o.hasPointerCapture?.(e.pointerId) && o.releasePointerCapture(e.pointerId), B());
|
|
21713
|
-
},
|
|
21723
|
+
}, re = (e) => {
|
|
21714
21724
|
let t = x?.pointerId;
|
|
21715
21725
|
t != null && t === e.pointerId && (o.hasPointerCapture?.(e.pointerId) && o.releasePointerCapture(e.pointerId), V());
|
|
21716
|
-
},
|
|
21726
|
+
}, ie = (e) => {
|
|
21717
21727
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), F());
|
|
21718
|
-
},
|
|
21728
|
+
}, ae = (e) => {
|
|
21719
21729
|
e.target !== s && e.preventDefault();
|
|
21720
21730
|
}, oe = (e) => {
|
|
21721
21731
|
e.target === d && k();
|
|
@@ -21724,9 +21734,9 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21724
21734
|
};
|
|
21725
21735
|
return c.addEventListener("pointerdown", (e) => e.stopPropagation()), c.addEventListener("mousedown", (e) => e.stopPropagation()), c.addEventListener("click", (e) => {
|
|
21726
21736
|
e.stopPropagation(), M();
|
|
21727
|
-
}), o.addEventListener("mousedown", H), o.addEventListener("pointerdown",
|
|
21737
|
+
}), o.addEventListener("mousedown", H), o.addEventListener("pointerdown", W), o.addEventListener("keydown", ie), o.addEventListener("contextmenu", ae), d.addEventListener("click", oe), m.addEventListener("click", () => {
|
|
21728
21738
|
I();
|
|
21729
|
-
}), h.addEventListener("click", L), g.addEventListener("click", k), t.addEventListener("mousemove", U, !0), t.addEventListener("mouseup", ee, !0), t.addEventListener("pointermove",
|
|
21739
|
+
}), h.addEventListener("click", L), g.addEventListener("click", k), t.addEventListener("mousemove", U, !0), t.addEventListener("mouseup", ee, !0), t.addEventListener("pointermove", te, !0), t.addEventListener("pointerup", ne, !0), t.addEventListener("pointercancel", re, !0), t.addEventListener("keydown", se, !0), {
|
|
21730
21740
|
show(e, n) {
|
|
21731
21741
|
if (T) return;
|
|
21732
21742
|
E(), k(), w &&= (w.cancel(), null), o.style.opacity = "1", o.style.transform = "none", o.style.willChange = "transform, opacity", o.style.pointerEvents = "auto", A(), v = e;
|
|
@@ -21735,7 +21745,7 @@ var Sb = "mesurer.layout-guides", Cb = "layout-guides:v1", wb = "mesurer.layout-
|
|
|
21735
21745
|
},
|
|
21736
21746
|
dismiss: j,
|
|
21737
21747
|
dispose() {
|
|
21738
|
-
T || (T = !0, E(), D(), j(), t.removeEventListener("mousemove", U, !0), t.removeEventListener("mouseup", ee, !0), t.removeEventListener("pointermove",
|
|
21748
|
+
T || (T = !0, E(), D(), j(), t.removeEventListener("mousemove", U, !0), t.removeEventListener("mouseup", ee, !0), t.removeEventListener("pointermove", te, !0), t.removeEventListener("pointerup", ne, !0), t.removeEventListener("pointercancel", re, !0), t.removeEventListener("keydown", se, !0), o.removeEventListener("mousedown", H), o.removeEventListener("pointerdown", W), o.removeEventListener("keydown", ie), o.removeEventListener("contextmenu", ae), d.removeEventListener("click", oe), a.remove());
|
|
21739
21749
|
}
|
|
21740
21750
|
};
|
|
21741
21751
|
}, jS = "mesurer.screenshot", MS = "screenshot", NS = "mesurer.screenshot.settings", PS = "mesurer.screenshot.active", FS = "runtime:solid", IS = "screenshot.toggle", LS = 2500, RS = 0, zS = [
|
|
@@ -22546,7 +22556,7 @@ function DC(e) {
|
|
|
22546
22556
|
}
|
|
22547
22557
|
//#endregion
|
|
22548
22558
|
//#region src/version.ts
|
|
22549
|
-
var OC = "0.2.2-beta.
|
|
22559
|
+
var OC = "0.2.2-beta.3", kC = lh, AC = uh, jC = () => ({
|
|
22550
22560
|
...ag(),
|
|
22551
22561
|
version: OC
|
|
22552
22562
|
}), MC = AC, NC = (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, PC = (e) => {
|
|
@@ -23799,7 +23809,7 @@ function fT(e = {}) {
|
|
|
23799
23809
|
"queueing",
|
|
23800
23810
|
"queued",
|
|
23801
23811
|
"working"
|
|
23802
|
-
].includes(b.status) ? Kw : b.status === "completed" ? qw : Gw : Gw,
|
|
23812
|
+
].includes(b.status) ? Kw : b.status === "completed" ? qw : Gw : Gw, W = () => {
|
|
23803
23813
|
let e = [], t = /* @__PURE__ */ new Set(), n = (n) => {
|
|
23804
23814
|
t.has(n.id) || (t.add(n.id), e.push(n));
|
|
23805
23815
|
}, r = (e) => ({
|
|
@@ -23814,30 +23824,30 @@ function fT(e = {}) {
|
|
|
23814
23824
|
for (let e of m) n(e);
|
|
23815
23825
|
for (let e of p) n(m.find((t) => t.id === e) ?? r(e));
|
|
23816
23826
|
return e;
|
|
23817
|
-
},
|
|
23827
|
+
}, te = (e = !1) => Promise.resolve(), ne = (e = !1) => O === "origin-denied" ? e ? "Browser origin not allowed" : "Allow this browser origin" : O === "version-mismatch" ? e ? "Bridge version mismatch" : "Update Mesurer Codex Bridge" : O === "capability-mismatch" ? e ? "Bridge capability mismatch" : "Update Mesurer Codex Bridge" : O === "port-conflict" ? e ? "Port 47365 conflict" : "Port 47365 is occupied" : O === "timed-out" ? e ? "Bridge did not respond" : "Mesurer Codex Bridge did not respond" : O === "instance-changed" ? e ? "Codex bridge changed" : "Codex bridge changed; reconnecting" : O === "not-running" ? e ? "Bridge not running" : "Mesurer Codex Bridge is not running" : e ? "Codex unavailable" : "Mesurer Codex Bridge is unavailable", re = () => k ? s?.source === "desktop" ? "Connected · Codex Desktop" : s?.source === "standalone" ? "Connected · Codex CLI" : s?.source === "shared" ? "Connected · Codex shared server" : "Connected · Codex" : p.length === 0 ? "No reachable local Codex session" : "Connected · Local Codex Bridge", ie = () => {
|
|
23818
23828
|
if (o !== "available") {
|
|
23819
23829
|
let e = s?.source === "desktop" && s.reason === "desktop-private-transport", t = !k, n = [];
|
|
23820
23830
|
return o === "unavailable" && t && n.push({
|
|
23821
23831
|
id: "codex.connection.status",
|
|
23822
|
-
label:
|
|
23832
|
+
label: ne(),
|
|
23823
23833
|
disabled: () => !0,
|
|
23824
23834
|
run: () => void 0
|
|
23825
23835
|
}), n.push({
|
|
23826
23836
|
id: "codex.thread.connect",
|
|
23827
23837
|
label: o === "unavailable" ? t ? "Retry Codex connection" : e ? "Retry Codex Desktop" : "Retry Codex connection" : "Choose Codex thread…",
|
|
23828
|
-
run: () =>
|
|
23838
|
+
run: () => te(!0)
|
|
23829
23839
|
}), n;
|
|
23830
23840
|
}
|
|
23831
|
-
let e =
|
|
23841
|
+
let e = W(), t = e.slice(0, g), n = R(), r = [{
|
|
23832
23842
|
id: "codex.connection.status",
|
|
23833
|
-
label:
|
|
23843
|
+
label: re(),
|
|
23834
23844
|
disabled: () => !0,
|
|
23835
23845
|
run: () => void 0
|
|
23836
23846
|
}];
|
|
23837
23847
|
return !k && p.length === 0 && r.push({
|
|
23838
23848
|
id: "codex.thread.refresh",
|
|
23839
23849
|
label: "Refresh Codex sessions",
|
|
23840
|
-
run: () =>
|
|
23850
|
+
run: () => te(!0)
|
|
23841
23851
|
}), r.push(...t.map((e) => {
|
|
23842
23852
|
let t = e.id === l ? "Current · " : e.connected ? "Loaded · " : "", r = b?.thread === e.id ? ` · ${H(b.status)}` : "";
|
|
23843
23853
|
return {
|
|
@@ -23846,14 +23856,14 @@ function fT(e = {}) {
|
|
|
23846
23856
|
checked: () => n === e.id,
|
|
23847
23857
|
disabled: () => V(),
|
|
23848
23858
|
run() {
|
|
23849
|
-
V() || (B(e.id, !l),
|
|
23859
|
+
V() || (B(e.id, !l), ae());
|
|
23850
23860
|
}
|
|
23851
23861
|
};
|
|
23852
23862
|
})), g < Fw && (e.length > g || h) && r.push({
|
|
23853
23863
|
id: "codex.thread.show-more",
|
|
23854
23864
|
label: "Show 5 more…",
|
|
23855
23865
|
run() {
|
|
23856
|
-
g = Fw,
|
|
23866
|
+
g = Fw, ae();
|
|
23857
23867
|
}
|
|
23858
23868
|
}), b?.queuedSubmissionId && b.status === "queued" && (b.dispatch === "desktop-opened" || b.dispatch === "desktop-wake-failed") && r.push({
|
|
23859
23869
|
id: "codex.delivery.receipt",
|
|
@@ -23861,9 +23871,9 @@ function fT(e = {}) {
|
|
|
23861
23871
|
disabled: () => !0,
|
|
23862
23872
|
run: () => void 0
|
|
23863
23873
|
}), r;
|
|
23864
|
-
},
|
|
23874
|
+
}, ae = () => {
|
|
23865
23875
|
if (!n || w) return;
|
|
23866
|
-
let t = R(), r =
|
|
23876
|
+
let t = R(), r = ie(), i = !V() && !d && o !== "unavailable" && (o === "unknown" || !!t), a = s?.source === "desktop" && s.reason === "desktop-private-transport", c = !k, l = ne(!0), u = U() ?? (o === "unavailable" ? c ? l : a ? "Codex Desktop not connected" : "Codex unavailable" : o === "available" && !k && p.length === 0 ? "No reachable Codex session" : d || o === "available" && !t ? "Choose Codex thread" : "Queue to Codex"), f = JSON.stringify({
|
|
23867
23877
|
bridgeAvailability: o,
|
|
23868
23878
|
codexRuntime: s,
|
|
23869
23879
|
routeNeedsSelection: d,
|
|
@@ -23899,7 +23909,7 @@ function fT(e = {}) {
|
|
|
23899
23909
|
});
|
|
23900
23910
|
m = t.threads, h = t.hasMore, p = t.threads.filter((e) => e.connected).map((e) => e.id), f = t.thread;
|
|
23901
23911
|
};
|
|
23902
|
-
|
|
23912
|
+
te = (e = !1) => w || o === "unknown" && !e ? Promise.resolve() : y || (y = (async () => {
|
|
23903
23913
|
try {
|
|
23904
23914
|
let e = await P();
|
|
23905
23915
|
o = "available", O = null, c = !0, f = e.thread, await oe(u ?? l ?? e.thread);
|
|
@@ -23908,14 +23918,14 @@ function fT(e = {}) {
|
|
|
23908
23918
|
} catch (e) {
|
|
23909
23919
|
throw o = "unavailable", O = k ? null : tT(e) ?? "unavailable", s = await M().catch(() => s), e;
|
|
23910
23920
|
} finally {
|
|
23911
|
-
y = null,
|
|
23921
|
+
y = null, ae();
|
|
23912
23922
|
}
|
|
23913
23923
|
})(), y);
|
|
23914
23924
|
let se = () => {
|
|
23915
23925
|
x &&= (globalThis.clearTimeout(x), 0), S &&= (globalThis.clearTimeout(S), 0);
|
|
23916
23926
|
}, ce = () => {
|
|
23917
23927
|
S && globalThis.clearTimeout(S), S = globalThis.setTimeout(() => {
|
|
23918
|
-
S = 0, b?.status === "completed" && (b = null, z(),
|
|
23928
|
+
S = 0, b?.status === "completed" && (b = null, z(), ae());
|
|
23919
23929
|
}, Mw);
|
|
23920
23930
|
}, le = async (e) => {
|
|
23921
23931
|
if (!(!b || b.id !== e.id)) {
|
|
@@ -23928,7 +23938,7 @@ function fT(e = {}) {
|
|
|
23928
23938
|
dispatch: e.dispatch ?? b.dispatch,
|
|
23929
23939
|
dispatchError: e.dispatchError ?? b.dispatchError
|
|
23930
23940
|
}, z(), e.status === "completed") {
|
|
23931
|
-
if (z(),
|
|
23941
|
+
if (z(), ae(), r && b.annotationIds.length > 0) {
|
|
23932
23942
|
let t = !1;
|
|
23933
23943
|
for (let e of b.annotationIds) try {
|
|
23934
23944
|
await i.removeAnnotation(e);
|
|
@@ -23943,24 +23953,24 @@ function fT(e = {}) {
|
|
|
23943
23953
|
t = !0;
|
|
23944
23954
|
}
|
|
23945
23955
|
if (t || n.length > 0) {
|
|
23946
|
-
z(),
|
|
23956
|
+
z(), ae(), x = globalThis.setTimeout(() => {
|
|
23947
23957
|
x = 0, G(e.id);
|
|
23948
23958
|
}, Aw);
|
|
23949
23959
|
return;
|
|
23950
23960
|
}
|
|
23951
23961
|
}
|
|
23952
|
-
z(),
|
|
23962
|
+
z(), ae(), ce();
|
|
23953
23963
|
return;
|
|
23954
23964
|
}
|
|
23955
23965
|
if (e.status === "interrupted") {
|
|
23956
|
-
z(),
|
|
23966
|
+
z(), ae();
|
|
23957
23967
|
let t = e.updatedAt > 0 ? e.updatedAt : Date.now();
|
|
23958
23968
|
Date.now() - t < Pw && (x = globalThis.setTimeout(() => {
|
|
23959
23969
|
x = 0, G(e.id);
|
|
23960
23970
|
}, Nw));
|
|
23961
23971
|
return;
|
|
23962
23972
|
}
|
|
23963
|
-
|
|
23973
|
+
ae(), x = globalThis.setTimeout(() => {
|
|
23964
23974
|
x = 0, G(e.id);
|
|
23965
23975
|
}, jw);
|
|
23966
23976
|
}
|
|
@@ -23971,7 +23981,7 @@ function fT(e = {}) {
|
|
|
23971
23981
|
if (b?.id !== e) return;
|
|
23972
23982
|
let n = t;
|
|
23973
23983
|
if ((b.status === "queued" || b.status === "failed") && b.thread) try {
|
|
23974
|
-
o !== "available" && await
|
|
23984
|
+
o !== "available" && await te(!0);
|
|
23975
23985
|
let e = await I(b);
|
|
23976
23986
|
await le(e);
|
|
23977
23987
|
return;
|
|
@@ -23980,13 +23990,13 @@ function fT(e = {}) {
|
|
|
23980
23990
|
}
|
|
23981
23991
|
if (b?.id !== e) return;
|
|
23982
23992
|
if (b.status === "interrupted") {
|
|
23983
|
-
|
|
23993
|
+
ae();
|
|
23984
23994
|
return;
|
|
23985
23995
|
}
|
|
23986
23996
|
b = {
|
|
23987
23997
|
...b,
|
|
23988
23998
|
status: "failed"
|
|
23989
|
-
}, z(), dT(n) && (o = "unavailable"),
|
|
23999
|
+
}, z(), dT(n) && (o = "unavailable"), ae();
|
|
23990
24000
|
}
|
|
23991
24001
|
}, ue = {
|
|
23992
24002
|
health: N,
|
|
@@ -23999,7 +24009,7 @@ function fT(e = {}) {
|
|
|
23999
24009
|
action: "target",
|
|
24000
24010
|
thread: t
|
|
24001
24011
|
}), r = aT(n);
|
|
24002
|
-
return s = iT(n) ?? s, B(t, !l), f = r.thread, p = r.threads, o = "available", c = !0,
|
|
24012
|
+
return s = iT(n) ?? s, B(t, !l), f = r.thread, p = r.threads, o = "available", c = !0, ae(), r;
|
|
24003
24013
|
},
|
|
24004
24014
|
async queue(e) {
|
|
24005
24015
|
let r = await cT(i, e, t), a = e?.thread?.trim(), s = a || (n ? R() : null);
|
|
@@ -24022,7 +24032,7 @@ function fT(e = {}) {
|
|
|
24022
24032
|
};
|
|
24023
24033
|
return e.queuedSubmissionId !== void 0 && (n.queuedSubmissionId = e.queuedSubmissionId?.trim() || null), e.clientUserMessageId !== void 0 && (n.clientUserMessageId = e.clientUserMessageId?.trim() || null), e.dispatch !== void 0 && (n.dispatch = e.dispatch), e.dispatchError !== void 0 && (n.dispatchError = e.dispatchError?.trim() || null), n;
|
|
24024
24034
|
} catch (e) {
|
|
24025
|
-
throw n && dT(e) && (o = "unavailable", O = k ? null : tT(e) ?? "unavailable",
|
|
24035
|
+
throw n && dT(e) && (o = "unavailable", O = k ? null : tT(e) ?? "unavailable", ae()), e;
|
|
24026
24036
|
}
|
|
24027
24037
|
},
|
|
24028
24038
|
send(e) {
|
|
@@ -24045,9 +24055,9 @@ function fT(e = {}) {
|
|
|
24045
24055
|
clientUserMessageId: null,
|
|
24046
24056
|
dispatch: null,
|
|
24047
24057
|
dispatchError: null
|
|
24048
|
-
},
|
|
24058
|
+
}, ae(), C = (async () => {
|
|
24049
24059
|
try {
|
|
24050
|
-
n && o !== "available" && await
|
|
24060
|
+
n && o !== "available" && await te(!0);
|
|
24051
24061
|
let e = await ue.queue();
|
|
24052
24062
|
b = {
|
|
24053
24063
|
id: e.deliveryId,
|
|
@@ -24058,7 +24068,7 @@ function fT(e = {}) {
|
|
|
24058
24068
|
clientUserMessageId: e.clientUserMessageId ?? null,
|
|
24059
24069
|
dispatch: e.dispatch ?? null,
|
|
24060
24070
|
dispatchError: e.dispatchError ?? null
|
|
24061
|
-
}, B(e.thread, !l), z(),
|
|
24071
|
+
}, B(e.thread, !l), z(), ae(), console.info(`[Mesurer] Queued feedback for Codex thread ${e.thread}.`), e.deliveryId ? e.status === "completed" || e.status === "interrupted" ? await le({
|
|
24062
24072
|
id: e.deliveryId,
|
|
24063
24073
|
thread: e.thread,
|
|
24064
24074
|
status: e.status,
|
|
@@ -24068,10 +24078,10 @@ function fT(e = {}) {
|
|
|
24068
24078
|
}) : x = globalThis.setTimeout(() => {
|
|
24069
24079
|
x = 0, G(e.deliveryId);
|
|
24070
24080
|
}, Aw) : S = globalThis.setTimeout(() => {
|
|
24071
|
-
S = 0, b?.id === null && b?.status === "queued" && (b = null, z(),
|
|
24081
|
+
S = 0, b?.id === null && b?.status === "queued" && (b = null, z(), ae());
|
|
24072
24082
|
}, Mw);
|
|
24073
24083
|
} catch (e) {
|
|
24074
|
-
b = null, z(),
|
|
24084
|
+
b = null, z(), ae();
|
|
24075
24085
|
let t = e instanceof Error ? e.message : String(e);
|
|
24076
24086
|
throw console.error(`[Mesurer] Failed to queue feedback for Codex: ${t}`), e;
|
|
24077
24087
|
} finally {
|
|
@@ -24081,8 +24091,8 @@ function fT(e = {}) {
|
|
|
24081
24091
|
}
|
|
24082
24092
|
};
|
|
24083
24093
|
if (e.command.register("codex.queue", de), e.command.register("codex.send", de), n) {
|
|
24084
|
-
if (
|
|
24085
|
-
await
|
|
24094
|
+
if (ae(), k) try {
|
|
24095
|
+
await te(!0);
|
|
24086
24096
|
} catch (e) {
|
|
24087
24097
|
try {
|
|
24088
24098
|
await j();
|
|
@@ -24092,12 +24102,12 @@ function fT(e = {}) {
|
|
|
24092
24102
|
}
|
|
24093
24103
|
throw e;
|
|
24094
24104
|
}
|
|
24095
|
-
else
|
|
24105
|
+
else te(!0).catch(() => void 0);
|
|
24096
24106
|
b?.id && (c = !0, x = globalThis.setTimeout(() => {
|
|
24097
24107
|
x = 0, b?.id && G(b.id);
|
|
24098
24108
|
}, 0));
|
|
24099
24109
|
let t = globalThis.setInterval(() => {
|
|
24100
|
-
k && !c ||
|
|
24110
|
+
k && !c || te(!0).catch(() => void 0);
|
|
24101
24111
|
}, k ? kw : Uw);
|
|
24102
24112
|
e.lifecycle.onDispose(() => {
|
|
24103
24113
|
w = !0, se(), globalThis.clearInterval(t), _?.dispose(), _ = void 0;
|
|
@@ -24233,13 +24243,13 @@ function wT(e = {}) {
|
|
|
24233
24243
|
let e = b?.service.get(MC);
|
|
24234
24244
|
if (!e) throw Error("Mesurer Edit is disabled. Enable it in Settings or include edit() in plugins.");
|
|
24235
24245
|
return e;
|
|
24236
|
-
}, 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(), ee = async () => (await P()).intents(),
|
|
24246
|
+
}, 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(), ee = async () => (await P()).intents(), W = async (e) => {
|
|
24237
24247
|
let t = (await P()).intent(e);
|
|
24238
24248
|
if (!t) throw Error(`Edit movement intent not found: ${e}`);
|
|
24239
24249
|
return t;
|
|
24240
|
-
},
|
|
24250
|
+
}, te = async (e, t) => {
|
|
24241
24251
|
(await P()).show(e, t);
|
|
24242
|
-
},
|
|
24252
|
+
}, ne = async (e, t) => (await P()).capturePlan(e, t), re = async (e, t) => (await P()).review(e, t), ie = () => j.textEdits(), ae = (e) => j.textEdit(e), oe = Object.assign(j, {
|
|
24243
24253
|
capabilities: () => {
|
|
24244
24254
|
let e = !!b?.service.get(cw);
|
|
24245
24255
|
return {
|
|
@@ -24265,10 +24275,10 @@ function wT(e = {}) {
|
|
|
24265
24275
|
prepareCapture: H,
|
|
24266
24276
|
finishCapture: U,
|
|
24267
24277
|
arrangements: ee,
|
|
24268
|
-
arrange:
|
|
24269
|
-
showArrange:
|
|
24270
|
-
arrangeCapturePlan:
|
|
24271
|
-
reviewArrange:
|
|
24278
|
+
arrange: W,
|
|
24279
|
+
showArrange: te,
|
|
24280
|
+
arrangeCapturePlan: ne,
|
|
24281
|
+
reviewArrange: re
|
|
24272
24282
|
}), se = {
|
|
24273
24283
|
...f,
|
|
24274
24284
|
version: OC,
|
|
@@ -24318,12 +24328,12 @@ function wT(e = {}) {
|
|
|
24318
24328
|
prepareCapture: H,
|
|
24319
24329
|
finishCapture: U,
|
|
24320
24330
|
arrangements: ee,
|
|
24321
|
-
arrange:
|
|
24322
|
-
showArrange:
|
|
24323
|
-
arrangeCapturePlan:
|
|
24324
|
-
reviewArrange:
|
|
24325
|
-
textEdits:
|
|
24326
|
-
textEdit:
|
|
24331
|
+
arrange: W,
|
|
24332
|
+
showArrange: te,
|
|
24333
|
+
arrangeCapturePlan: ne,
|
|
24334
|
+
reviewArrange: re,
|
|
24335
|
+
textEdits: ie,
|
|
24336
|
+
textEdit: ae,
|
|
24327
24337
|
bringToFront: g.bringToFront,
|
|
24328
24338
|
describe: async () => (await ue).describe(),
|
|
24329
24339
|
dispose() {
|