mesurer-solid 0.2.3-beta.3 → 0.2.3-beta.4
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 +1903 -1758
- package/dist/inject-script.js +16 -16
- package/dist/inject.js +1899 -1754
- package/dist/plugins.js +945 -897
- package/package.json +1 -1
- package/skills/mesurer-ui/SKILL.md +1 -1
package/dist/plugins.js
CHANGED
|
@@ -3781,7 +3781,22 @@ function Js(e) {
|
|
|
3781
3781
|
}), y;
|
|
3782
3782
|
}
|
|
3783
3783
|
xr(null);
|
|
3784
|
-
var Ys = (e
|
|
3784
|
+
var Ys = (e) => {
|
|
3785
|
+
let t = e, n = /* @__PURE__ */ new Set();
|
|
3786
|
+
for (; !n.has(t);) {
|
|
3787
|
+
n.add(t);
|
|
3788
|
+
let e = null;
|
|
3789
|
+
try {
|
|
3790
|
+
e = t.defaultView?.frameElement ?? null;
|
|
3791
|
+
} catch {
|
|
3792
|
+
return !1;
|
|
3793
|
+
}
|
|
3794
|
+
if (!e) return !1;
|
|
3795
|
+
if (e.hasAttribute("data-mesurer-responsive-frame")) return !0;
|
|
3796
|
+
t = e.ownerDocument;
|
|
3797
|
+
}
|
|
3798
|
+
return !1;
|
|
3799
|
+
}, Xs = (e, t) => {
|
|
3785
3800
|
if (bs(e, t)) return !0;
|
|
3786
3801
|
let n = t.ownerDocument, r = e.ownerDocument, i = /* @__PURE__ */ new Set();
|
|
3787
3802
|
for (; r !== n && !i.has(r);) {
|
|
@@ -3797,11 +3812,11 @@ var Ys = (e, t) => {
|
|
|
3797
3812
|
r = e.ownerDocument;
|
|
3798
3813
|
}
|
|
3799
3814
|
return !1;
|
|
3800
|
-
},
|
|
3815
|
+
}, Zs = (e) => e.nodeType === 11, Qs = (e) => {
|
|
3801
3816
|
if (!e) return null;
|
|
3802
3817
|
let t = e.getRootNode();
|
|
3803
|
-
return
|
|
3804
|
-
},
|
|
3818
|
+
return Zs(t) ? t.host : null;
|
|
3819
|
+
}, $s = (e, t, n) => !!(t?.contains(e) || n && e === n), ec = (e, t) => {
|
|
3805
3820
|
let n = e;
|
|
3806
3821
|
for (; n.shadowRoot;) {
|
|
3807
3822
|
let e = n.shadowRoot.elementFromPoint(t.x, t.y);
|
|
@@ -3809,27 +3824,27 @@ var Ys = (e, t) => {
|
|
|
3809
3824
|
n = e;
|
|
3810
3825
|
}
|
|
3811
3826
|
return n;
|
|
3812
|
-
},
|
|
3827
|
+
}, tc = (e, t, n = document, r = n.body) => {
|
|
3813
3828
|
let i = n.defaultView;
|
|
3814
3829
|
if (!i) return !1;
|
|
3815
|
-
let a = i, o =
|
|
3830
|
+
let a = i, o = Qs(t);
|
|
3816
3831
|
for (let s of n.elementsFromPoint(e.x, e.y)) {
|
|
3817
3832
|
if (!(s instanceof a.Element)) continue;
|
|
3818
|
-
let n =
|
|
3819
|
-
if (
|
|
3833
|
+
let n = ec(s, e);
|
|
3834
|
+
if (!$s(n, t, o)) {
|
|
3820
3835
|
if (mo(n, i)) return !0;
|
|
3821
3836
|
if (bs(n, r) && !po(n, i)) return !1;
|
|
3822
3837
|
}
|
|
3823
3838
|
}
|
|
3824
3839
|
return !1;
|
|
3825
|
-
},
|
|
3826
|
-
let i =
|
|
3840
|
+
}, nc = (e, t, n, r) => tc(e, t, n, r) ? null : xs(t, () => ys(e, r, n)), rc = (e, t, n = document, r = n.body) => {
|
|
3841
|
+
let i = Qs(t), a = nc(e, t, n, r), o = n.defaultView;
|
|
3827
3842
|
if (!o || !a) return null;
|
|
3828
|
-
let s =
|
|
3829
|
-
if (!
|
|
3843
|
+
let s = ic(a, e);
|
|
3844
|
+
if (!Xs(s, r) || $s(s, t, i) || po(s, o) || s === s.ownerDocument.body || s === s.ownerDocument.documentElement) return null;
|
|
3830
3845
|
let c = Us(s);
|
|
3831
3846
|
return c.width > 2 && c.height > 2 ? s : null;
|
|
3832
|
-
},
|
|
3847
|
+
}, ic = (e, t) => {
|
|
3833
3848
|
let n = e, r = t;
|
|
3834
3849
|
for (let e = 0; e < 16; e += 1) {
|
|
3835
3850
|
let e = As(n);
|
|
@@ -3841,12 +3856,12 @@ var Ys = (e, t) => {
|
|
|
3841
3856
|
n = i, r = t;
|
|
3842
3857
|
}
|
|
3843
3858
|
return n;
|
|
3844
|
-
},
|
|
3845
|
-
function
|
|
3846
|
-
return e.addEventListener(
|
|
3859
|
+
}, ac = "mesurer:select-gesture-start";
|
|
3860
|
+
function oc(e, t) {
|
|
3861
|
+
return e.addEventListener(ac, t), () => e.removeEventListener(ac, t);
|
|
3847
3862
|
}
|
|
3848
3863
|
xr((e) => void 0);
|
|
3849
|
-
var
|
|
3864
|
+
var sc = "var(--msr-color-ink-50, #f8fafc)", cc = "var(--msr-color-ink-200, #e2e8f0)", lc = "var(--msr-color-ink-500, #64748b)", uc = "var(--msr-content, #0f172a)", dc = (e, t, n) => {
|
|
3850
3865
|
let r = e.createElement("div");
|
|
3851
3866
|
return Object.assign(r.style, {
|
|
3852
3867
|
position: "absolute",
|
|
@@ -3863,7 +3878,7 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
3863
3878
|
height: "100%"
|
|
3864
3879
|
}
|
|
3865
3880
|
}), r;
|
|
3866
|
-
},
|
|
3881
|
+
}, fc = (e, t, n) => {
|
|
3867
3882
|
let r = e.createElement("div");
|
|
3868
3883
|
Object.assign(r.style, {
|
|
3869
3884
|
position: "fixed",
|
|
@@ -3877,23 +3892,23 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
3877
3892
|
"right",
|
|
3878
3893
|
"bottom",
|
|
3879
3894
|
"left"
|
|
3880
|
-
]) r.appendChild(
|
|
3895
|
+
]) r.appendChild(dc(e, t, n));
|
|
3881
3896
|
return r;
|
|
3882
|
-
},
|
|
3897
|
+
}, pc = (e, t) => {
|
|
3883
3898
|
Object.assign(e.style, {
|
|
3884
3899
|
left: `${t.left}px`,
|
|
3885
3900
|
top: `${t.top}px`,
|
|
3886
3901
|
width: `${t.width}px`,
|
|
3887
3902
|
height: `${t.height}px`
|
|
3888
3903
|
});
|
|
3889
|
-
},
|
|
3904
|
+
}, mc = (e, t) => {
|
|
3890
3905
|
let n = e.createElement("div");
|
|
3891
3906
|
return Object.assign(n.style, {
|
|
3892
3907
|
position: "fixed",
|
|
3893
3908
|
zIndex: "1",
|
|
3894
3909
|
pointerEvents: t ? "auto" : "none",
|
|
3895
3910
|
background: "var(--msr-surface-raised, #ffffff)",
|
|
3896
|
-
color:
|
|
3911
|
+
color: uc,
|
|
3897
3912
|
borderRadius: "13px",
|
|
3898
3913
|
padding: "10px 12px",
|
|
3899
3914
|
fontSize: "11px",
|
|
@@ -3908,7 +3923,7 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
3908
3923
|
boxSizing: "border-box",
|
|
3909
3924
|
boxShadow: "var(--msr-shadow-floating, 0px 0px 0.5px rgba(0, 0, 0, 0.18), 0px 3px 8px rgba(0, 0, 0, 0.1), 0px 1px 3px rgba(0, 0, 0, 0.1))"
|
|
3910
3925
|
}), n.className = t ? "mesurer-ti-card mesurer-ti-card--pinned" : "mesurer-ti-card", n.dataset.state = "hidden", n;
|
|
3911
|
-
},
|
|
3926
|
+
}, hc = (e, t, n, r) => {
|
|
3912
3927
|
t.replaceChildren();
|
|
3913
3928
|
let i = e.createElement("div");
|
|
3914
3929
|
Object.assign(i.style, {
|
|
@@ -3920,8 +3935,8 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
3920
3935
|
});
|
|
3921
3936
|
let a = e.createElement("span");
|
|
3922
3937
|
if (Object.assign(a.style, {
|
|
3923
|
-
color:
|
|
3924
|
-
background:
|
|
3938
|
+
color: sc,
|
|
3939
|
+
background: uc,
|
|
3925
3940
|
borderRadius: "4px",
|
|
3926
3941
|
padding: "1px 5px",
|
|
3927
3942
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
@@ -3930,7 +3945,7 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
3930
3945
|
}), a.textContent = n.tagName, i.appendChild(a), n.textSnippet) {
|
|
3931
3946
|
let t = e.createElement("span");
|
|
3932
3947
|
Object.assign(t.style, {
|
|
3933
|
-
color:
|
|
3948
|
+
color: lc,
|
|
3934
3949
|
overflow: "hidden",
|
|
3935
3950
|
textOverflow: "ellipsis",
|
|
3936
3951
|
whiteSpace: "nowrap",
|
|
@@ -3950,7 +3965,7 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
3950
3965
|
lineHeight: "14px",
|
|
3951
3966
|
textAlign: "center",
|
|
3952
3967
|
borderRadius: "4px",
|
|
3953
|
-
color:
|
|
3968
|
+
color: lc,
|
|
3954
3969
|
fontSize: "14px"
|
|
3955
3970
|
}), i.appendChild(t);
|
|
3956
3971
|
}
|
|
@@ -3965,12 +3980,12 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
3965
3980
|
});
|
|
3966
3981
|
for (let t of n.rows) {
|
|
3967
3982
|
let n = e.createElement("span");
|
|
3968
|
-
n.style.color =
|
|
3983
|
+
n.style.color = lc, n.style.fontSize = "11px", n.textContent = t.label;
|
|
3969
3984
|
let r = e.createElement("span");
|
|
3970
3985
|
if (Object.assign(r.style, {
|
|
3971
3986
|
fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
3972
3987
|
fontSize: "11px",
|
|
3973
|
-
color:
|
|
3988
|
+
color: uc,
|
|
3974
3989
|
overflow: "hidden",
|
|
3975
3990
|
textOverflow: "ellipsis",
|
|
3976
3991
|
whiteSpace: "nowrap"
|
|
@@ -3979,21 +3994,21 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
3979
3994
|
let n = e.createElement("span");
|
|
3980
3995
|
n.textContent = t.value;
|
|
3981
3996
|
let i = e.createElement("span");
|
|
3982
|
-
i.style.color =
|
|
3997
|
+
i.style.color = cc, i.style.margin = "0 6px", i.textContent = "·";
|
|
3983
3998
|
let a = e.createElement("span");
|
|
3984
3999
|
a.style.color = "#0369a1", a.textContent = t.varName, r.append(n, i, a);
|
|
3985
4000
|
}
|
|
3986
4001
|
o.append(n, r);
|
|
3987
4002
|
}
|
|
3988
4003
|
t.appendChild(o);
|
|
3989
|
-
},
|
|
4004
|
+
}, gc = (e, t, n, r = 0, i = 0) => {
|
|
3990
4005
|
let a = Number.parseFloat(t.dataset.mesurerPositionedScrollX ?? ""), o = Number.parseFloat(t.dataset.mesurerPositionedScrollY ?? ""), s = Number.isFinite(a) && a !== e.scrollX || Number.isFinite(o) && o !== e.scrollY, c = n.left + n.width / 2 + r;
|
|
3991
4006
|
t.style.left = `${c}px`;
|
|
3992
4007
|
let l = t.getBoundingClientRect(), u = n.bottom + 4 + i;
|
|
3993
4008
|
u + l.height > e.innerHeight - 8 && (u = n.top - l.height - 4 + i), t.style.top = `${Math.max(8, u)}px`;
|
|
3994
4009
|
let d = l.width / 2;
|
|
3995
4010
|
t.style.left = `${Math.min(Math.max(c, 8 + d), e.innerWidth - 8 - d)}px`, t.dataset.mesurerPositionedScrollX = String(e.scrollX), t.dataset.mesurerPositionedScrollY = String(e.scrollY), s && !t.dataset.mesurerNativeScrollAnchor && (t.dataset.mesurerNativeScrollAnchor = "pending");
|
|
3996
|
-
},
|
|
4011
|
+
}, _c = /* @__PURE__ */ new Map([
|
|
3997
4012
|
["100", "thin"],
|
|
3998
4013
|
["200", "extralight"],
|
|
3999
4014
|
["300", "light"],
|
|
@@ -4003,26 +4018,26 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
4003
4018
|
["700", "bold"],
|
|
4004
4019
|
["800", "extrabold"],
|
|
4005
4020
|
["900", "black"]
|
|
4006
|
-
]),
|
|
4021
|
+
]), vc = [
|
|
4007
4022
|
"font-family",
|
|
4008
4023
|
"font-size",
|
|
4009
4024
|
"font-weight",
|
|
4010
4025
|
"line-height",
|
|
4011
4026
|
"letter-spacing"
|
|
4012
|
-
],
|
|
4027
|
+
], yc = /* @__PURE__ */ new Map([
|
|
4013
4028
|
["Family", "font-family"],
|
|
4014
4029
|
["Size", "font-size"],
|
|
4015
4030
|
["Weight", "font-weight"],
|
|
4016
4031
|
["Line", "line-height"],
|
|
4017
4032
|
["Tracking", "letter-spacing"]
|
|
4018
|
-
]),
|
|
4033
|
+
]), bc = (e) => {
|
|
4019
4034
|
if (!e || e === "normal") return e || "normal";
|
|
4020
4035
|
let t = /^(-?[\d.]+)px$/.exec(e);
|
|
4021
4036
|
return t ? `${Math.round(Number(t[1]) * 10) / 10}px` : e;
|
|
4022
|
-
},
|
|
4023
|
-
let t =
|
|
4037
|
+
}, xc = (e) => (e.split(",")[0] ?? "").trim().replace(/^['"]|['"]$/g, ""), Sc = (e) => {
|
|
4038
|
+
let t = _c.get(e);
|
|
4024
4039
|
return t ? `${e} / ${t}` : e;
|
|
4025
|
-
},
|
|
4040
|
+
}, Cc = (e) => e ? /var\(\s*(--[a-zA-Z0-9_-]+)/.exec(e)?.[1] ?? null : null, wc = (e) => (e.match(/#[\w-]+/g) ?? []).length * 1e4 + (e.match(/\.[\w-]+|\[[^\]]+\]|:[\w-]+/g) ?? []).length * 100 + (e.match(/(?:^|[ >+~])([a-zA-Z][\w-]*)/g) ?? []).length, Tc = (e, t) => !t || (e.important === t.important ? e.specificity === t.specificity ? e.order > t.order : e.specificity > t.specificity : e.important), Ec = class {
|
|
4026
4041
|
document;
|
|
4027
4042
|
window;
|
|
4028
4043
|
constructor(e, t) {
|
|
@@ -4062,11 +4077,11 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
4062
4077
|
return e;
|
|
4063
4078
|
}
|
|
4064
4079
|
findVarReferences(e) {
|
|
4065
|
-
let t = new Map(
|
|
4066
|
-
for (let r of
|
|
4080
|
+
let t = new Map(vc.map((e) => [e, null])), n = this.getRules();
|
|
4081
|
+
for (let r of vc) {
|
|
4067
4082
|
let i = e;
|
|
4068
4083
|
for (; i && t.get(r) === null;) {
|
|
4069
|
-
let e, a =
|
|
4084
|
+
let e, a = Cc(i.style.getPropertyValue(r));
|
|
4070
4085
|
a && (e = {
|
|
4071
4086
|
name: a,
|
|
4072
4087
|
specificity: 2 ** 53 - 1,
|
|
@@ -4082,15 +4097,15 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
4082
4097
|
continue;
|
|
4083
4098
|
}
|
|
4084
4099
|
if (!n) continue;
|
|
4085
|
-
let s =
|
|
4100
|
+
let s = Cc(t.style.getPropertyValue(r));
|
|
4086
4101
|
if (!s) continue;
|
|
4087
4102
|
let c = {
|
|
4088
4103
|
name: s,
|
|
4089
|
-
specificity:
|
|
4104
|
+
specificity: wc(t.selectorText),
|
|
4090
4105
|
order: o,
|
|
4091
4106
|
important: t.style.getPropertyPriority(r) === "important"
|
|
4092
4107
|
};
|
|
4093
|
-
|
|
4108
|
+
Tc(c, e) && (e = c);
|
|
4094
4109
|
}
|
|
4095
4110
|
e && t.set(r, e.name), i = i.parentElement;
|
|
4096
4111
|
}
|
|
@@ -4101,27 +4116,27 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
4101
4116
|
let t = this.window.getComputedStyle(e), n = [
|
|
4102
4117
|
{
|
|
4103
4118
|
label: "Family",
|
|
4104
|
-
value:
|
|
4119
|
+
value: xc(t.fontFamily),
|
|
4105
4120
|
varName: null
|
|
4106
4121
|
},
|
|
4107
4122
|
{
|
|
4108
4123
|
label: "Size",
|
|
4109
|
-
value:
|
|
4124
|
+
value: bc(t.fontSize),
|
|
4110
4125
|
varName: null
|
|
4111
4126
|
},
|
|
4112
4127
|
{
|
|
4113
4128
|
label: "Weight",
|
|
4114
|
-
value:
|
|
4129
|
+
value: Sc(t.fontWeight),
|
|
4115
4130
|
varName: null
|
|
4116
4131
|
},
|
|
4117
4132
|
{
|
|
4118
4133
|
label: "Line",
|
|
4119
|
-
value: t.lineHeight === "normal" ? "normal" :
|
|
4134
|
+
value: t.lineHeight === "normal" ? "normal" : bc(t.lineHeight),
|
|
4120
4135
|
varName: null
|
|
4121
4136
|
},
|
|
4122
4137
|
{
|
|
4123
4138
|
label: "Tracking",
|
|
4124
|
-
value: t.letterSpacing === "normal" ? "normal" :
|
|
4139
|
+
value: t.letterSpacing === "normal" ? "normal" : bc(t.letterSpacing),
|
|
4125
4140
|
varName: null
|
|
4126
4141
|
}
|
|
4127
4142
|
], r = Array.from(e.childNodes).filter((e) => e.nodeType === Node.TEXT_NODE).map((e) => e.nodeValue?.trim() ?? "").filter(Boolean).join(" ").replace(/\s+/g, " ");
|
|
@@ -4136,7 +4151,7 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
4136
4151
|
return {
|
|
4137
4152
|
...t,
|
|
4138
4153
|
rows: t.rows.map((e) => {
|
|
4139
|
-
let t =
|
|
4154
|
+
let t = yc.get(e.label);
|
|
4140
4155
|
return {
|
|
4141
4156
|
...e,
|
|
4142
4157
|
varName: t ? n.get(t) ?? null : null
|
|
@@ -4144,7 +4159,7 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
4144
4159
|
})
|
|
4145
4160
|
};
|
|
4146
4161
|
}
|
|
4147
|
-
},
|
|
4162
|
+
}, Dc = [
|
|
4148
4163
|
"HTML",
|
|
4149
4164
|
"BODY",
|
|
4150
4165
|
"SCRIPT",
|
|
@@ -4156,7 +4171,7 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
4156
4171
|
"VIDEO",
|
|
4157
4172
|
"AUDIO",
|
|
4158
4173
|
"IFRAME"
|
|
4159
|
-
],
|
|
4174
|
+
], Oc = "color-mix(in oklch, oklch(0.62 0.18 255) 8%, transparent)", kc = "color-mix(in oklch, oklch(0.62 0.18 255) 80%, transparent)", Ac = "color-mix(in oklch, oklch(0.62 0.18 255) 4%, transparent)", jc = "color-mix(in oklch, oklch(0.62 0.18 255) 35%, transparent)", Mc = 80, Nc = 0, Pc = (e, t) => `
|
|
4160
4175
|
.${e},.${e} *{cursor:help!important}
|
|
4161
4176
|
.${e} [data-mesurer-root],.${e} [data-mesurer-root] *{cursor:auto!important}
|
|
4162
4177
|
#${t} .mesurer-ti-card{transform:translateX(-50%);opacity:1;transition:none!important;animation:none!important}
|
|
@@ -4167,7 +4182,7 @@ var oc = "var(--msr-color-ink-50, #f8fafc)", sc = "var(--msr-color-ink-200, #e2e
|
|
|
4167
4182
|
#${t} .mesurer-ti-close{cursor:pointer}
|
|
4168
4183
|
#${t} .mesurer-ti-close:hover{background:color-mix(in srgb,var(--msr-content,#0f172a) 6%,transparent)!important;color:var(--msr-content,#0f172a)!important}
|
|
4169
4184
|
`;
|
|
4170
|
-
function
|
|
4185
|
+
function Fc(e = {}, t = !1) {
|
|
4171
4186
|
let n = e.portalTarget?.ownerDocument ?? globalThis.document, r = n?.defaultView ?? globalThis.window;
|
|
4172
4187
|
if (!n || !r) {
|
|
4173
4188
|
let e = () => {};
|
|
@@ -4181,71 +4196,82 @@ function Pc(e = {}, t = !1) {
|
|
|
4181
4196
|
destroy: e,
|
|
4182
4197
|
clear: e,
|
|
4183
4198
|
inspect: () => !1,
|
|
4199
|
+
pin: () => !1,
|
|
4200
|
+
clearHover: e,
|
|
4201
|
+
clearResponsivePreview: e,
|
|
4184
4202
|
canUndo: () => !1,
|
|
4185
4203
|
canRedo: () => !1
|
|
4186
4204
|
};
|
|
4187
4205
|
}
|
|
4188
|
-
let i = (e.id ?? (t ? "mesurer-text-inspector" : `mesurer-text-inspector-${++
|
|
4206
|
+
let i = (e.id ?? (t ? "mesurer-text-inspector" : `mesurer-text-inspector-${++Nc}`)).replace(/[^a-zA-Z0-9_-]/g, "-"), a = `${i}-overlay`, o = `${i}-styles`, s = `${i}-mode`, c = new Set((e.ignoredTags ?? Dc).map((e) => e.toUpperCase())), l = Number.isFinite(e.maxPinned) ? Math.max(1, Math.floor(e.maxPinned)) : Infinity, u = new Ec(n, r), d = r.HTMLElement, f = r.Node, p = !1, m = null, h = null, g = null, _ = null, v = {
|
|
4189
4207
|
x: 0,
|
|
4190
4208
|
y: 0
|
|
4191
|
-
},
|
|
4209
|
+
}, y = 0, b = 0, x = 0, S = r.scrollX, C = r.scrollY, w = null, T = [], E = [], D = [], O = e.portalTarget ?? n.body, k = () => {
|
|
4192
4210
|
let e = [n];
|
|
4193
|
-
|
|
4211
|
+
O instanceof r.ShadowRoot && e.push(O);
|
|
4194
4212
|
for (let t of e) {
|
|
4195
4213
|
if (t.querySelector(`#${o}`)) continue;
|
|
4196
4214
|
let e = n.createElement("style");
|
|
4197
|
-
e.id = o, e.textContent =
|
|
4215
|
+
e.id = o, e.textContent = Pc(s, a), t === n ? n.head.append(e) : t.append(e);
|
|
4198
4216
|
}
|
|
4199
|
-
},
|
|
4200
|
-
|
|
4201
|
-
}) ?? null, Object.assign(
|
|
4217
|
+
}, A = () => m?.isConnected ? m : (m = n.createElement("div"), m.id = a, m.dataset.mesurerInspectorUi = "true", m.dataset.theme = e.theme?.() ?? "system", w ??= e.subscribeTheme?.((e) => {
|
|
4218
|
+
m && (m.dataset.theme = e);
|
|
4219
|
+
}) ?? null, Object.assign(m.style, {
|
|
4202
4220
|
position: "fixed",
|
|
4203
4221
|
inset: "0",
|
|
4204
4222
|
pointerEvents: "none",
|
|
4205
4223
|
zIndex: "2147483646"
|
|
4206
|
-
}),
|
|
4224
|
+
}), O.appendChild(m), m), j = (e, t) => {
|
|
4207
4225
|
e && (e.dataset.state = t ? "visible" : "hidden");
|
|
4208
|
-
},
|
|
4209
|
-
let e =
|
|
4210
|
-
|
|
4211
|
-
},
|
|
4226
|
+
}, M = () => {
|
|
4227
|
+
let e = A();
|
|
4228
|
+
h ??= fc(n, Oc, kc), g ??= mc(n, !1), h.parentNode || e.append(h), g.parentNode || e.append(g);
|
|
4229
|
+
}, N = (e) => Array.from(e.childNodes).some((e) => e.nodeType === f.TEXT_NODE && !!e.nodeValue?.trim()), P = (e) => {
|
|
4230
|
+
let t = e?.ownerDocument.defaultView;
|
|
4231
|
+
return !!e && !!t && e instanceof t.HTMLElement && !(e instanceof t.SVGElement) && !c.has(e.tagName) && N(e) && !e.closest("[data-mesurer-root], [data-mesurer-inspector-ui='true']");
|
|
4232
|
+
}, F = (t) => e.projectRect?.(t, t.getBoundingClientRect()) ?? t.getBoundingClientRect(), I = (e, t) => {
|
|
4212
4233
|
for (let i of n.elementsFromPoint(e, t)) {
|
|
4213
4234
|
if (mo(i, r)) return null;
|
|
4214
|
-
if (
|
|
4235
|
+
if (P(i)) return i;
|
|
4215
4236
|
}
|
|
4216
4237
|
return null;
|
|
4217
4238
|
}, L = () => {
|
|
4218
|
-
|
|
4219
|
-
}, R = (
|
|
4239
|
+
_ = null, j(h, !1), j(g, !1);
|
|
4240
|
+
}, R = () => {
|
|
4241
|
+
r.clearTimeout(b), L();
|
|
4242
|
+
}, z = () => {
|
|
4243
|
+
_ && Ys(_.ownerDocument) && L();
|
|
4244
|
+
for (let e of T.slice()) Ys(e.sourceEl.ownerDocument) && W(e, !1, !1);
|
|
4245
|
+
}, B = (e, t, n) => {
|
|
4220
4246
|
if (!e || e.dataset.state !== "visible") return !1;
|
|
4221
4247
|
let r = e.getBoundingClientRect();
|
|
4222
4248
|
return t >= r.left && t <= r.right && n >= r.top && n <= r.bottom;
|
|
4223
|
-
},
|
|
4224
|
-
if (!
|
|
4225
|
-
|
|
4226
|
-
let i = t
|
|
4227
|
-
return
|
|
4228
|
-
if (!
|
|
4249
|
+
}, V = (e, t) => T.some((n) => B(n.card, e, t)), H = (t) => {
|
|
4250
|
+
if (!p || !P(t)) return !1;
|
|
4251
|
+
M();
|
|
4252
|
+
let i = F(t), a = u.getFast(t);
|
|
4253
|
+
return _ = t, hc(n, g, a, !1), pc(h, i), gc(r, g, i), j(h, !0), j(g, !0), r.clearTimeout(b), b = r.setTimeout(() => {
|
|
4254
|
+
if (!p || _ !== t || !g) return;
|
|
4229
4255
|
let i = u.getFull(t, a);
|
|
4230
|
-
|
|
4256
|
+
hc(n, g, i, !1), gc(r, g, F(t)), e.onInspect?.(t, i);
|
|
4231
4257
|
}, 24), !0;
|
|
4232
|
-
},
|
|
4258
|
+
}, ee = () => T.map((e) => ({
|
|
4233
4259
|
sourceEl: e.sourceEl,
|
|
4234
4260
|
left: e.userPlaced ? e.card.getBoundingClientRect().left + e.card.getBoundingClientRect().width / 2 : 0,
|
|
4235
4261
|
top: e.userPlaced ? e.card.getBoundingClientRect().top : 0,
|
|
4236
4262
|
userPlaced: e.userPlaced
|
|
4237
|
-
})),
|
|
4238
|
-
|
|
4239
|
-
},
|
|
4240
|
-
let i =
|
|
4241
|
-
i < 0 || (n &&
|
|
4242
|
-
},
|
|
4243
|
-
for (;
|
|
4244
|
-
},
|
|
4263
|
+
})), U = () => {
|
|
4264
|
+
E.push(ee()), E.length > 100 && E.shift(), D.length = 0;
|
|
4265
|
+
}, W = (t, n = !0, r = !0) => {
|
|
4266
|
+
let i = T.indexOf(t);
|
|
4267
|
+
i < 0 || (n && U(), T.splice(i, 1), t.detach(), t.box.remove(), t.card.remove(), r && e.onUnpin?.(t.sourceEl));
|
|
4268
|
+
}, te = (e = !1) => {
|
|
4269
|
+
for (; T.length;) W(T[T.length - 1], !1, e);
|
|
4270
|
+
}, ne = (e) => {
|
|
4245
4271
|
let t = -1, n = 0, i = 0, a = 0, o = 0, s = !1, c = !1, l = (l) => {
|
|
4246
4272
|
if (l.pointerId !== t) return;
|
|
4247
4273
|
let u = l.clientX - n, d = l.clientY - i;
|
|
4248
|
-
!s && Math.abs(u) <= 6 && Math.abs(d) <= 6 || (s || (s = !0, e.card.classList.add("mesurer-ti-card--pinned"), delete e.card.dataset.mesurerNativeScrollAnchor, delete e.card.dataset.mesurerNativeScrollOwner, e.card.style.removeProperty("position-anchor")), c ||= (
|
|
4274
|
+
!s && Math.abs(u) <= 6 && Math.abs(d) <= 6 || (s || (s = !0, e.card.classList.add("mesurer-ti-card--pinned"), delete e.card.dataset.mesurerNativeScrollAnchor, delete e.card.dataset.mesurerNativeScrollOwner, e.card.style.removeProperty("position-anchor")), c ||= (U(), !0), e.userPlaced = !0, e.card.style.left = `${Math.min(r.innerWidth - 8, Math.max(8, a + u))}px`, e.card.style.top = `${Math.min(r.innerHeight - 8, Math.max(8, o + d))}px`);
|
|
4249
4275
|
}, u = (e) => {
|
|
4250
4276
|
(t === -1 || e.pointerId === t) && (r.removeEventListener("pointermove", l), r.removeEventListener("pointerup", u), r.removeEventListener("pointercancel", u), t = -1, s = !1, c = !1);
|
|
4251
4277
|
}, f = (s) => {
|
|
@@ -4256,15 +4282,15 @@ function Pc(e = {}, t = !1) {
|
|
|
4256
4282
|
return e.card.addEventListener("pointerdown", f), () => {
|
|
4257
4283
|
e.card.removeEventListener("pointerdown", f), r.removeEventListener("pointermove", l), r.removeEventListener("pointerup", u), r.removeEventListener("pointercancel", u);
|
|
4258
4284
|
};
|
|
4259
|
-
},
|
|
4260
|
-
if (
|
|
4261
|
-
a &&
|
|
4262
|
-
let s =
|
|
4285
|
+
}, G = (t, i, a = !0, o = !0) => {
|
|
4286
|
+
if (T.find((e) => e.sourceEl === t)) return;
|
|
4287
|
+
a && U(), T.length >= l && W(T[0], !1, !0);
|
|
4288
|
+
let s = A(), c = fc(n, Ac, jc), d = mc(n, !0);
|
|
4263
4289
|
d.classList.add("mesurer-ti-card--draggable"), d.classList.remove("mesurer-ti-card--pinned");
|
|
4264
4290
|
let f = u.getFull(t);
|
|
4265
|
-
|
|
4266
|
-
let p = t
|
|
4267
|
-
|
|
4291
|
+
hc(n, d, f, !0), s.append(c, d);
|
|
4292
|
+
let p = F(t);
|
|
4293
|
+
pc(c, p), gc(r, d, p), i?.userPlaced && (d.classList.add("mesurer-ti-card--pinned"), d.style.left = `${i.left}px`, d.style.top = `${i.top}px`), j(c, !0), j(d, !0);
|
|
4268
4294
|
let m = {
|
|
4269
4295
|
sourceEl: t,
|
|
4270
4296
|
box: c,
|
|
@@ -4274,147 +4300,152 @@ function Pc(e = {}, t = !1) {
|
|
|
4274
4300
|
userPlaced: i?.userPlaced ?? !1,
|
|
4275
4301
|
detach: () => {}
|
|
4276
4302
|
};
|
|
4277
|
-
|
|
4278
|
-
e.preventDefault(), e.stopPropagation(),
|
|
4303
|
+
T.push(m), m.detach = ne(m), d.querySelector(".mesurer-ti-close")?.addEventListener("click", (e) => {
|
|
4304
|
+
e.preventDefault(), e.stopPropagation(), W(m);
|
|
4279
4305
|
}), o && e.onPin?.(t, f);
|
|
4280
|
-
},
|
|
4281
|
-
|
|
4282
|
-
for (let t of e) t.sourceEl.isConnected &&
|
|
4283
|
-
}, G = () => {
|
|
4284
|
-
let e = D.pop();
|
|
4285
|
-
return e ? (O.push(V()), ne(e), !0) : !1;
|
|
4286
|
-
}, re = () => {
|
|
4287
|
-
let e = O.pop();
|
|
4288
|
-
return e ? (D.push(V()), ne(e), !0) : !1;
|
|
4289
|
-
}, K = () => {
|
|
4290
|
-
E.length && (H(), U(!0));
|
|
4306
|
+
}, re = (e) => !p || !P(e) ? !1 : (G(e), !0), K = (e) => {
|
|
4307
|
+
te(!1);
|
|
4308
|
+
for (let t of e) t.sourceEl.isConnected && G(t.sourceEl, t, !1, !1);
|
|
4291
4309
|
}, ie = () => {
|
|
4292
|
-
|
|
4310
|
+
let e = E.pop();
|
|
4311
|
+
return e ? (D.push(ee()), K(e), !0) : !1;
|
|
4312
|
+
}, ae = () => {
|
|
4313
|
+
let e = D.pop();
|
|
4314
|
+
return e ? (E.push(ee()), K(e), !0) : !1;
|
|
4315
|
+
}, oe = () => {
|
|
4316
|
+
T.length && (U(), te(!0));
|
|
4317
|
+
}, se = () => {
|
|
4318
|
+
for (let e of T.slice()) {
|
|
4293
4319
|
if (!e.sourceEl.isConnected) {
|
|
4294
|
-
|
|
4320
|
+
W(e, !1, !1);
|
|
4295
4321
|
continue;
|
|
4296
4322
|
}
|
|
4297
|
-
let t = e.sourceEl
|
|
4298
|
-
|
|
4323
|
+
let t = F(e.sourceEl);
|
|
4324
|
+
pc(e.box, t), e.userPlaced || gc(r, e.card, t);
|
|
4299
4325
|
let n = t.bottom >= 0 && t.right >= 0 && t.left <= r.innerWidth && t.top <= r.innerHeight;
|
|
4300
|
-
|
|
4326
|
+
j(e.box, n), j(e.card, n), e.card.style.pointerEvents = n ? "auto" : "none";
|
|
4301
4327
|
}
|
|
4302
|
-
},
|
|
4303
|
-
if (
|
|
4304
|
-
if (
|
|
4305
|
-
if (!
|
|
4328
|
+
}, ce = () => {
|
|
4329
|
+
if (p) {
|
|
4330
|
+
if (_ && h && g) {
|
|
4331
|
+
if (!_.isConnected) L();
|
|
4306
4332
|
else {
|
|
4307
|
-
let e =
|
|
4308
|
-
|
|
4333
|
+
let e = F(_);
|
|
4334
|
+
pc(h, e), gc(r, g, e);
|
|
4309
4335
|
let t = e.bottom >= 0 && e.right >= 0 && e.left <= r.innerWidth && e.top <= r.innerHeight;
|
|
4310
|
-
|
|
4336
|
+
j(h, t), j(g, t);
|
|
4311
4337
|
}
|
|
4312
4338
|
}
|
|
4313
|
-
|
|
4339
|
+
se();
|
|
4314
4340
|
}
|
|
4315
|
-
},
|
|
4316
|
-
if (!
|
|
4317
|
-
let e = I(
|
|
4341
|
+
}, q = () => {
|
|
4342
|
+
if (!p) return;
|
|
4343
|
+
let e = I(v.x, v.y);
|
|
4318
4344
|
if (!e) L();
|
|
4319
|
-
else if (e !==
|
|
4320
|
-
else if (
|
|
4321
|
-
let t = e
|
|
4322
|
-
|
|
4345
|
+
else if (e !== _) H(e);
|
|
4346
|
+
else if (h && g) {
|
|
4347
|
+
let t = F(e);
|
|
4348
|
+
pc(h, t), gc(r, g, t);
|
|
4323
4349
|
}
|
|
4324
|
-
|
|
4325
|
-
},
|
|
4326
|
-
|
|
4327
|
-
|
|
4350
|
+
se();
|
|
4351
|
+
}, le = () => {
|
|
4352
|
+
y ||= r.requestAnimationFrame(() => {
|
|
4353
|
+
y = 0, q();
|
|
4328
4354
|
});
|
|
4329
|
-
},
|
|
4330
|
-
if (
|
|
4331
|
-
x:
|
|
4332
|
-
y:
|
|
4333
|
-
},
|
|
4334
|
-
|
|
4335
|
-
|
|
4355
|
+
}, ue = (e) => e.composedPath().some((e) => mo(e, r)), de = (t) => {
|
|
4356
|
+
if (v = {
|
|
4357
|
+
x: t.clientX,
|
|
4358
|
+
y: t.clientY
|
|
4359
|
+
}, !e.suppressRootPointer?.()) {
|
|
4360
|
+
if (ue(t) || V(t.clientX, t.clientY)) {
|
|
4361
|
+
L();
|
|
4362
|
+
return;
|
|
4363
|
+
}
|
|
4364
|
+
B(g, t.clientX, t.clientY) || le();
|
|
4336
4365
|
}
|
|
4337
|
-
|
|
4338
|
-
}, le = (e, t, n) => {
|
|
4366
|
+
}, fe = (e, t, n) => {
|
|
4339
4367
|
if (!e || e.dataset.mesurerNativeScrollAnchor) return;
|
|
4340
4368
|
let r = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
4341
4369
|
Number.isFinite(r) && (e.style.left = `${r - t}px`), Number.isFinite(i) && (e.style.top = `${i - n}px`);
|
|
4342
|
-
},
|
|
4343
|
-
let e = r.scrollX, t = r.scrollY, i = e -
|
|
4344
|
-
if (
|
|
4370
|
+
}, pe = () => {
|
|
4371
|
+
let e = r.scrollX, t = r.scrollY, i = e - S, a = t - C;
|
|
4372
|
+
if (S = e, C = t, Fo(n)) {
|
|
4345
4373
|
if (i || a) {
|
|
4346
|
-
|
|
4347
|
-
for (let e of
|
|
4374
|
+
fe(h, i, a), fe(g, i, a);
|
|
4375
|
+
for (let e of T) fe(e.box, i, a), e.userPlaced || fe(e.card, i, a);
|
|
4348
4376
|
}
|
|
4349
|
-
|
|
4350
|
-
|
|
4351
|
-
},
|
|
4377
|
+
x && r.clearTimeout(x), x = r.setTimeout(() => {
|
|
4378
|
+
x = 0, ce();
|
|
4379
|
+
}, Mc);
|
|
4352
4380
|
return;
|
|
4353
4381
|
}
|
|
4354
|
-
|
|
4355
|
-
},
|
|
4382
|
+
ce(), le();
|
|
4383
|
+
}, me = (e) => {
|
|
4356
4384
|
e.relatedTarget || L();
|
|
4357
|
-
},
|
|
4358
|
-
if (!
|
|
4359
|
-
if (
|
|
4385
|
+
}, he = (e) => {
|
|
4386
|
+
if (!ue(e)) {
|
|
4387
|
+
if (B(g, e.clientX, e.clientY) || V(e.clientX, e.clientY)) {
|
|
4360
4388
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
4361
4389
|
return;
|
|
4362
4390
|
}
|
|
4363
4391
|
if (e.preventDefault(), e.stopImmediatePropagation(), e.button === 0) {
|
|
4364
4392
|
let t = I(e.clientX, e.clientY);
|
|
4365
|
-
t &&
|
|
4393
|
+
t && G(t);
|
|
4366
4394
|
}
|
|
4367
4395
|
}
|
|
4368
|
-
},
|
|
4369
|
-
if (!
|
|
4370
|
-
if (
|
|
4396
|
+
}, ge = (e) => {
|
|
4397
|
+
if (!ue(e)) {
|
|
4398
|
+
if (B(g, e.clientX, e.clientY) || V(e.clientX, e.clientY)) {
|
|
4371
4399
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
4372
4400
|
return;
|
|
4373
4401
|
}
|
|
4374
4402
|
e.preventDefault(), e.stopImmediatePropagation();
|
|
4375
4403
|
}
|
|
4376
|
-
},
|
|
4377
|
-
|
|
4404
|
+
}, _e = () => {
|
|
4405
|
+
p || (p = !0, k(), A(), n.body.classList.add(s), S = r.scrollX, C = r.scrollY, r.addEventListener("mousemove", de, !0), r.addEventListener("mouseout", me, !0), r.addEventListener("click", he, !0), r.addEventListener("auxclick", ge, !0), r.addEventListener("scroll", pe, {
|
|
4378
4406
|
capture: !0,
|
|
4379
4407
|
passive: !0
|
|
4380
|
-
}), r.addEventListener("resize",
|
|
4381
|
-
},
|
|
4382
|
-
|
|
4383
|
-
},
|
|
4384
|
-
|
|
4408
|
+
}), r.addEventListener("resize", le, !0));
|
|
4409
|
+
}, ve = () => {
|
|
4410
|
+
p && (p = !1, r.cancelAnimationFrame(y), y = 0, r.clearTimeout(b), r.clearTimeout(x), x = 0, r.removeEventListener("mousemove", de, !0), r.removeEventListener("mouseout", me, !0), r.removeEventListener("click", he, !0), r.removeEventListener("auxclick", ge, !0), r.removeEventListener("scroll", pe, !0), r.removeEventListener("resize", le, !0), L(), te(), h?.remove(), g?.remove(), h = null, g = null, E.length = 0, D.length = 0, n.body.classList.remove(s));
|
|
4411
|
+
}, ye = () => {
|
|
4412
|
+
ve(), w?.(), w = null, m?.remove(), m = null, n.getElementById(o)?.remove(), O instanceof r.ShadowRoot && O.querySelector(`#${o}`)?.remove();
|
|
4385
4413
|
};
|
|
4386
4414
|
return {
|
|
4387
|
-
enable:
|
|
4388
|
-
disable:
|
|
4389
|
-
undo:
|
|
4390
|
-
redo:
|
|
4391
|
-
clear:
|
|
4392
|
-
inspect:
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4415
|
+
enable: _e,
|
|
4416
|
+
disable: ve,
|
|
4417
|
+
undo: ie,
|
|
4418
|
+
redo: ae,
|
|
4419
|
+
clear: oe,
|
|
4420
|
+
inspect: H,
|
|
4421
|
+
pin: re,
|
|
4422
|
+
clearHover: R,
|
|
4423
|
+
clearResponsivePreview: z,
|
|
4424
|
+
isEnabled: () => p,
|
|
4425
|
+
canUndo: () => E.length > 0,
|
|
4426
|
+
canRedo: () => D.length > 0,
|
|
4427
|
+
cleanup: ye,
|
|
4428
|
+
destroy: ye
|
|
4398
4429
|
};
|
|
4399
4430
|
}
|
|
4400
|
-
|
|
4401
|
-
var
|
|
4431
|
+
Fc({}, !0);
|
|
4432
|
+
var Ic = {
|
|
4402
4433
|
keepTextChanges: !1,
|
|
4403
4434
|
keepArrangeChanges: !1
|
|
4404
|
-
},
|
|
4435
|
+
}, Lc = (e) => e.state.get("mesurer.presentation.preferences") ?? Ic, Rc = "mesurer.arrange", zc = "arrange", Bc = "mesurer.arrange.intents", Vc = "mesurer.arrange.active", Hc = "mesurer.arrange.settings", Uc = "runtime:solid", Wc = "builtin.select", Gc = "arrange.toggle", Kc = "arrange.commit", qc = "arrange.clear", Jc = "arrange.reset-selection", Yc = "arrange.reset-all", Xc = "mesurer.arrange.selection-available", Zc = 1, Qc = 24, $c = 160, el = 500, tl = "#ef4444", nl = 24, rl = 6, il = 30, al = .5, ol = 4, sl = "[data-mesurer-text-editor='true']", cl = {
|
|
4405
4436
|
viewBox: "0 0 24 24",
|
|
4406
4437
|
paths: ["M12 2.75 8.75 6h2.5v5.25H6V8.75L2.75 12 6 15.25v-2.5h5.25V18h-2.5L12 21.25 15.25 18h-2.5v-5.25H18v2.5L21.25 12 18 8.75v2.5h-5.25V6h2.5L12 2.75Z"]
|
|
4407
|
-
},
|
|
4438
|
+
}, ll = (e, t) => ({
|
|
4408
4439
|
left: e.left + t.x,
|
|
4409
4440
|
top: e.top + t.y,
|
|
4410
4441
|
width: e.width,
|
|
4411
4442
|
height: e.height
|
|
4412
|
-
}),
|
|
4443
|
+
}), ul = (e, t) => ({
|
|
4413
4444
|
left: e.left - t.left,
|
|
4414
4445
|
top: e.top - t.top,
|
|
4415
4446
|
width: e.width - t.width,
|
|
4416
4447
|
height: e.height - t.height
|
|
4417
|
-
}),
|
|
4448
|
+
}), dl = (e) => {
|
|
4418
4449
|
if (!e.length) return null;
|
|
4419
4450
|
let t = Math.min(...e.map((e) => e.left)), n = Math.min(...e.map((e) => e.top)), r = Math.max(...e.map((e) => e.left + e.width)), i = Math.max(...e.map((e) => e.top + e.height));
|
|
4420
4451
|
return {
|
|
@@ -4423,35 +4454,35 @@ var Fc = {
|
|
|
4423
4454
|
width: r - t,
|
|
4424
4455
|
height: i - n
|
|
4425
4456
|
};
|
|
4426
|
-
},
|
|
4457
|
+
}, fl = (e, t, n, r) => Math.max(0, Math.max(e, n) - Math.min(t, r)), pl = (e, t, n) => {
|
|
4427
4458
|
let r = t === "x" ? e.left : e.top, i = t === "x" ? e.width : e.height, a = r + i;
|
|
4428
4459
|
return n === "edge" ? [r, a] : n === "center" ? [r + i / 2] : [
|
|
4429
4460
|
r,
|
|
4430
4461
|
r + i / 2,
|
|
4431
4462
|
a
|
|
4432
4463
|
];
|
|
4433
|
-
},
|
|
4464
|
+
}, ml = (e, t) => t === "x" ? {
|
|
4434
4465
|
start: e.top,
|
|
4435
4466
|
end: e.top + e.height
|
|
4436
4467
|
} : {
|
|
4437
4468
|
start: e.left,
|
|
4438
4469
|
end: e.left + e.width
|
|
4439
|
-
},
|
|
4440
|
-
let r =
|
|
4441
|
-
for (let a of n) if (a.axis === e && !(a.source === "element" &&
|
|
4470
|
+
}, hl = (e) => e.kind === "edge" ? 2 : +(e.kind === "guide"), gl = (e, t, n) => {
|
|
4471
|
+
let r = ml(t, e), i = null;
|
|
4472
|
+
for (let a of n) if (a.axis === e && !(a.source === "element" && fl(r.start, r.end, a.start, a.end) > $c)) for (let n of pl(t, e, a.kind)) {
|
|
4442
4473
|
let e = a.position - n, t = Math.abs(e);
|
|
4443
4474
|
if (t > 10) continue;
|
|
4444
4475
|
let r = i ? Math.abs(i.delta) : Infinity;
|
|
4445
|
-
(t < r || t === r && (!i ||
|
|
4476
|
+
(t < r || t === r && (!i || hl(a) > hl(i))) && (i = {
|
|
4446
4477
|
...a,
|
|
4447
4478
|
delta: e
|
|
4448
4479
|
});
|
|
4449
4480
|
}
|
|
4450
4481
|
return i;
|
|
4451
|
-
},
|
|
4482
|
+
}, _l = (e) => {
|
|
4452
4483
|
let { origin: t, pathname: n, search: r } = e.location;
|
|
4453
4484
|
return `${t}${n}${r}`;
|
|
4454
|
-
},
|
|
4485
|
+
}, vl = (e, t) => `${t}-${e.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`}`, yl = (e) => ({
|
|
4455
4486
|
tag: e.fingerprintTag,
|
|
4456
4487
|
id: e.fingerprintId,
|
|
4457
4488
|
testId: e.fingerprintTestId,
|
|
@@ -4459,10 +4490,10 @@ var Fc = {
|
|
|
4459
4490
|
ariaLabel: e.fingerprintAriaLabel,
|
|
4460
4491
|
classes: [...e.fingerprintClasses],
|
|
4461
4492
|
text: e.fingerprintText
|
|
4462
|
-
}),
|
|
4493
|
+
}), bl = (e) => ({
|
|
4463
4494
|
id: e.id,
|
|
4464
4495
|
selector: e.selector,
|
|
4465
|
-
fingerprint:
|
|
4496
|
+
fingerprint: yl(e),
|
|
4466
4497
|
before: {
|
|
4467
4498
|
left: e.beforeLeft,
|
|
4468
4499
|
top: e.beforeTop,
|
|
@@ -4483,21 +4514,21 @@ var Fc = {
|
|
|
4483
4514
|
x: e.desiredOffsetX,
|
|
4484
4515
|
y: e.desiredOffsetY
|
|
4485
4516
|
}
|
|
4486
|
-
}),
|
|
4517
|
+
}), xl = (e) => ({
|
|
4487
4518
|
id: e.id,
|
|
4488
4519
|
createdAt: e.createdAt,
|
|
4489
4520
|
pageUrl: e.pageUrl,
|
|
4490
|
-
targets: e.targets.map(
|
|
4491
|
-
}),
|
|
4521
|
+
targets: e.targets.map(bl)
|
|
4522
|
+
}), Sl = (e, t) => ({
|
|
4492
4523
|
value: e.style.getPropertyValue(t),
|
|
4493
4524
|
priority: e.style.getPropertyPriority(t)
|
|
4494
|
-
}),
|
|
4525
|
+
}), Cl = (e) => Sl(e, "transform"), wl = (e, t) => e.value === t.value && e.priority === t.priority, Tl = wl, El = (e) => {
|
|
4495
4526
|
let { element: t, beforeTransform: n, appliedTransform: r } = e;
|
|
4496
|
-
|
|
4497
|
-
},
|
|
4498
|
-
id:
|
|
4527
|
+
Tl(Cl(t), r) && (n.value || n.priority ? t.style.setProperty("transform", n.value, n.priority) : t.style.removeProperty("transform"));
|
|
4528
|
+
}, Dl = (e) => e instanceof Element && !!e.closest("input, textarea, select, [contenteditable='true'], [contenteditable='']"), Ol = () => ba({
|
|
4529
|
+
id: Rc,
|
|
4499
4530
|
version: "0.1.0",
|
|
4500
|
-
requires: [
|
|
4531
|
+
requires: [Uc, "tool:select"],
|
|
4501
4532
|
provides: [
|
|
4502
4533
|
"tool:arrange",
|
|
4503
4534
|
"intent:arrange",
|
|
@@ -4505,19 +4536,19 @@ var Fc = {
|
|
|
4505
4536
|
"settings:arrange"
|
|
4506
4537
|
],
|
|
4507
4538
|
setup(e) {
|
|
4508
|
-
let t = e.service.get(
|
|
4539
|
+
let t = e.service.get(Uc);
|
|
4509
4540
|
if (!t) throw Error("Edit movement plugin requires the Solid renderer runtime.");
|
|
4510
4541
|
let { ownerDocument: n, ownerWindow: r } = t, i = t.createWorkspaceRuntime(), a = t.createInspectorMount(), o = t.pageTarget ?? n.body ?? n.documentElement, s = t.portalTarget, c = r;
|
|
4511
4542
|
e.state.register({
|
|
4512
|
-
id:
|
|
4543
|
+
id: Bc,
|
|
4513
4544
|
initial: { intents: [] },
|
|
4514
4545
|
history: !0,
|
|
4515
4546
|
persist: !0
|
|
4516
4547
|
}), e.state.register({
|
|
4517
|
-
id:
|
|
4548
|
+
id: Vc,
|
|
4518
4549
|
initial: !1
|
|
4519
4550
|
}), e.state.register({
|
|
4520
|
-
id:
|
|
4551
|
+
id: Hc,
|
|
4521
4552
|
initial: {
|
|
4522
4553
|
snapping: !0,
|
|
4523
4554
|
elementEdges: !0,
|
|
@@ -4531,9 +4562,9 @@ var Fc = {
|
|
|
4531
4562
|
let l = a.element;
|
|
4532
4563
|
l.dataset.mesurerArrange = "true", l.style.position = "fixed", l.style.inset = "0", l.style.zIndex = "84", l.style.pointerEvents = "none";
|
|
4533
4564
|
let u = n.createElement("div");
|
|
4534
|
-
u.dataset.mesurerArrangeSnapLine = "vertical", u.setAttribute("aria-hidden", "true"), u.style.position = "fixed", u.style.display = "none", u.style.width = "1px", u.style.backgroundColor =
|
|
4565
|
+
u.dataset.mesurerArrangeSnapLine = "vertical", u.setAttribute("aria-hidden", "true"), u.style.position = "fixed", u.style.display = "none", u.style.width = "1px", u.style.backgroundColor = tl, u.style.pointerEvents = "none";
|
|
4535
4566
|
let d = n.createElement("div");
|
|
4536
|
-
d.dataset.mesurerArrangeSnapLine = "horizontal", d.setAttribute("aria-hidden", "true"), d.style.position = "fixed", d.style.display = "none", d.style.height = "1px", d.style.backgroundColor =
|
|
4567
|
+
d.dataset.mesurerArrangeSnapLine = "horizontal", d.setAttribute("aria-hidden", "true"), d.style.position = "fixed", d.style.display = "none", d.style.height = "1px", d.style.backgroundColor = tl, d.style.pointerEvents = "none";
|
|
4537
4568
|
let f = n.createElement("div");
|
|
4538
4569
|
f.dataset.mesurerArrangeBox = "true", f.setAttribute("role", "application"), f.setAttribute("aria-label", "Edit selected elements"), f.style.position = "fixed", f.style.display = "none", f.style.boxSizing = "border-box", f.style.border = "1px solid #0d99ff", f.style.cursor = "grab", f.style.pointerEvents = "auto", f.style.touchAction = "none", f.style.userSelect = "none", l.append(u, d, f);
|
|
4539
4570
|
let p = /* @__PURE__ */ new Map(), m = n.createElement("style");
|
|
@@ -4572,7 +4603,7 @@ var Fc = {
|
|
|
4572
4603
|
intentId: null,
|
|
4573
4604
|
state: "desired"
|
|
4574
4605
|
}, T = null, E = null, D = null, O = !1, k = 0, A = null, j = () => e.state.get("mesurer.arrange.intents") ?? { intents: [] }, M = () => e.state.get("mesurer.arrange.active") ?? !1, N = () => {
|
|
4575
|
-
let t = e.state.get(
|
|
4606
|
+
let t = e.state.get(Hc);
|
|
4576
4607
|
return {
|
|
4577
4608
|
snapping: t?.snapping ?? !0,
|
|
4578
4609
|
elementEdges: t?.elementEdges ?? !0,
|
|
@@ -4582,17 +4613,17 @@ var Fc = {
|
|
|
4582
4613
|
snapLines: t?.snapLines ?? !0
|
|
4583
4614
|
};
|
|
4584
4615
|
}, P = (t) => {
|
|
4585
|
-
e.state.update(
|
|
4616
|
+
e.state.update(Hc, (e) => ({
|
|
4586
4617
|
...e,
|
|
4587
4618
|
...t
|
|
4588
4619
|
}));
|
|
4589
|
-
}, F = () =>
|
|
4620
|
+
}, F = () => _l(r), I = () => j().intents.filter((e) => e.pageUrl === F()), L = (e) => !!e.closest("[data-mesurer-island='true'], [data-mesurer-inspector-ui='true'], [data-mesurer-root='true']"), R = (e) => bs(e, o) && !L(e), z = (e) => {
|
|
4590
4621
|
let t = [];
|
|
4591
4622
|
o instanceof c.HTMLElement && o.matches(e) && !L(o) && t.push(o);
|
|
4592
4623
|
for (let n of o.querySelectorAll(e)) n instanceof c.HTMLElement && R(n) && t.push(n);
|
|
4593
4624
|
return t;
|
|
4594
4625
|
}, B = (e, t) => e.localName !== t.fingerprintTag || t.fingerprintId && e.id !== t.fingerprintId || t.fingerprintTestId && e.getAttribute("data-testid") !== t.fingerprintTestId || t.fingerprintRole && e.getAttribute("role") !== t.fingerprintRole || t.fingerprintAriaLabel && e.getAttribute("aria-label") !== t.fingerprintAriaLabel ? !1 : t.fingerprintClasses.every((t) => e.classList.contains(t)), V = (e) => {
|
|
4595
|
-
let t =
|
|
4626
|
+
let t = yl(e), n = b.get(e.selector);
|
|
4596
4627
|
if (n && n.isConnected && R(n) && B(n, e)) return n;
|
|
4597
4628
|
if (n && b.delete(e.selector), !ws(t)) return null;
|
|
4598
4629
|
let r = [];
|
|
@@ -4616,17 +4647,17 @@ var Fc = {
|
|
|
4616
4647
|
value: "none",
|
|
4617
4648
|
priority: "important"
|
|
4618
4649
|
}, ee = (e) => {
|
|
4619
|
-
let t =
|
|
4620
|
-
(!x.get(e) || !
|
|
4650
|
+
let t = Sl(e, "transition-property");
|
|
4651
|
+
(!x.get(e) || !wl(t, H)) && x.set(e, t), wl(t, H) || e.style.setProperty("transition-property", H.value, H.priority);
|
|
4621
4652
|
}, U = (e) => {
|
|
4622
4653
|
let t = x.get(e);
|
|
4623
|
-
t && (
|
|
4654
|
+
t && (wl(Sl(e, "transition-property"), H) && (t.value || t.priority ? e.style.setProperty("transition-property", t.value, t.priority) : e.style.removeProperty("transition-property")), x.delete(e));
|
|
4624
4655
|
}, W = (e) => {
|
|
4625
4656
|
for (let t of x.keys()) e.has(t) || U(t);
|
|
4626
4657
|
}, te = () => {
|
|
4627
4658
|
for (let e of x.keys()) U(e);
|
|
4628
4659
|
}, ne = () => {
|
|
4629
|
-
for (let e of y.values())
|
|
4660
|
+
for (let e of y.values()) El(e);
|
|
4630
4661
|
y.clear();
|
|
4631
4662
|
}, G = () => {
|
|
4632
4663
|
O || i.refreshSelectionGeometry();
|
|
@@ -4646,7 +4677,7 @@ var Fc = {
|
|
|
4646
4677
|
d.style.display = "block", d.style.left = `${e}px`, d.style.top = `${t.position}px`, d.style.width = `${Math.max(1, r - e)}px`;
|
|
4647
4678
|
}
|
|
4648
4679
|
}
|
|
4649
|
-
}, ae = () => !!(n.querySelector(
|
|
4680
|
+
}, ae = () => !!(n.querySelector(sl) || s.querySelector(sl)), oe = () => {
|
|
4650
4681
|
for (let [e, t] of S) t.value || t.priority ? e.style.setProperty("visibility", t.value, t.priority) : e.style.removeProperty("visibility");
|
|
4651
4682
|
S.clear();
|
|
4652
4683
|
}, se = () => {
|
|
@@ -4752,11 +4783,11 @@ var Fc = {
|
|
|
4752
4783
|
let i = new Map([...y].map(([e, t]) => [e, t.appliedTransform]));
|
|
4753
4784
|
ne();
|
|
4754
4785
|
for (let { element: e, offset: n } of t) {
|
|
4755
|
-
let t =
|
|
4786
|
+
let t = Cl(e), i = r.getComputedStyle(e).transform, a = i && i !== "none" ? ` ${i}` : "";
|
|
4756
4787
|
e.style.setProperty("transform", `translate3d(${n.x}px, ${n.y}px, 0)${a}`, "important"), y.set(e, {
|
|
4757
4788
|
element: e,
|
|
4758
4789
|
beforeTransform: t,
|
|
4759
|
-
appliedTransform:
|
|
4790
|
+
appliedTransform: Cl(e)
|
|
4760
4791
|
});
|
|
4761
4792
|
}
|
|
4762
4793
|
W(n), (i.size !== y.size || [...y].some(([e, t]) => i.get(e) !== t.appliedTransform)) && G();
|
|
@@ -4769,19 +4800,19 @@ var Fc = {
|
|
|
4769
4800
|
}
|
|
4770
4801
|
}, _e = () => i.currentSelection().elements.filter((e) => e instanceof c.HTMLElement && e.isConnected && R(e));
|
|
4771
4802
|
e.state.register({
|
|
4772
|
-
id:
|
|
4803
|
+
id: Xc,
|
|
4773
4804
|
initial: _e().length > 0
|
|
4774
4805
|
});
|
|
4775
|
-
let ve = () => e.state.get(
|
|
4806
|
+
let ve = () => e.state.get(Xc) ?? !1, ye = () => {
|
|
4776
4807
|
let t = _e().length > 0;
|
|
4777
|
-
t !== ve() && e.state.update(
|
|
4778
|
-
}, be = () =>
|
|
4808
|
+
t !== ve() && e.state.update(Xc, () => t);
|
|
4809
|
+
}, be = () => dl(_e().map((e) => ns(e))), xe = () => {
|
|
4779
4810
|
for (let e of C.values()) e.remove();
|
|
4780
4811
|
C.clear();
|
|
4781
4812
|
}, Se = (e) => {
|
|
4782
|
-
let t = e.getBoundingClientRect(), n = t.right +
|
|
4783
|
-
n +
|
|
4784
|
-
let i = Math.min(Math.max(4, t.top +
|
|
4813
|
+
let t = e.getBoundingClientRect(), n = t.right + rl;
|
|
4814
|
+
n + nl > r.innerWidth - 4 && (n = Math.max(4, t.left - nl - rl));
|
|
4815
|
+
let i = Math.min(Math.max(4, t.top + il), Math.max(4, r.innerHeight - nl - 4));
|
|
4785
4816
|
return {
|
|
4786
4817
|
left: n,
|
|
4787
4818
|
top: i
|
|
@@ -4801,11 +4832,11 @@ var Fc = {
|
|
|
4801
4832
|
x: s.x - c.x,
|
|
4802
4833
|
y: s.y - c.y
|
|
4803
4834
|
};
|
|
4804
|
-
if (Math.abs(u.x) <=
|
|
4835
|
+
if (Math.abs(u.x) <= al && Math.abs(u.y) <= al) continue;
|
|
4805
4836
|
a.add(t);
|
|
4806
4837
|
let d = C.get(t);
|
|
4807
4838
|
d || (d = n.createElement("button"), d.type = "button", d.dataset.mesurerArrangeReset = "true", d.dataset.mesurerInspectorUi = "true", d.setAttribute("aria-label", "Reset position"), d.title = "Reset position", d.textContent = "↺", d.className = "msr:pointer-events-auto msr:flex msr:size-6 msr:items-center msr:justify-center msr:rounded-[7px] msr:border msr:border-ink-200 msr:bg-white msr:text-[14px] msr:leading-none msr:text-black msr:outline-none msr:hover:bg-ink-50 msr:focus-visible:border-[#0d99ff]", d.style.position = "fixed", d.addEventListener("pointerdown", (e) => e.stopPropagation()), d.addEventListener("click", (n) => {
|
|
4808
|
-
n.preventDefault(), n.stopPropagation(), D = [t], e.command.execute(
|
|
4839
|
+
n.preventDefault(), n.stopPropagation(), D = [t], e.command.execute(Jc, void 0, { source: "arrange-reset-button" }).catch(() => {
|
|
4809
4840
|
D = null;
|
|
4810
4841
|
});
|
|
4811
4842
|
}), C.set(t, d), l.append(d));
|
|
@@ -4830,7 +4861,7 @@ var Fc = {
|
|
|
4830
4861
|
return t ? { intents: r } : e;
|
|
4831
4862
|
}), Oe(), De());
|
|
4832
4863
|
}, Te = () => {
|
|
4833
|
-
e.state.update(
|
|
4864
|
+
e.state.update(Bc, (e) => {
|
|
4834
4865
|
let t = e.intents.filter((e) => e.pageUrl !== F());
|
|
4835
4866
|
return t.length === e.intents.length ? e : { intents: t };
|
|
4836
4867
|
}), Oe(), De();
|
|
@@ -4838,14 +4869,14 @@ var Fc = {
|
|
|
4838
4869
|
let t = N();
|
|
4839
4870
|
if (!t.snapping) return [];
|
|
4840
4871
|
let n = [], a = new Set(e), s = i.snapshot(), l = s.xrayVisible && t.preferXrayEdges && t.elementEdges, u = 0, d = (i) => {
|
|
4841
|
-
if (u >=
|
|
4872
|
+
if (u >= el || a.has(i) || e.some((e) => e.contains(i)) || !R(i)) return;
|
|
4842
4873
|
let o = r.getComputedStyle(i);
|
|
4843
4874
|
if (o.display === "none" || o.visibility === "hidden" || o.visibility === "collapse") return;
|
|
4844
4875
|
let s = o.outlineStyle === "solid" && (Number.parseFloat(o.outlineWidth) || 0) > 0;
|
|
4845
4876
|
if (l && !s) return;
|
|
4846
4877
|
let c = ns(i);
|
|
4847
4878
|
if (c.width <= 0 || c.height <= 0) return;
|
|
4848
|
-
let d =
|
|
4879
|
+
let d = $c;
|
|
4849
4880
|
if (c.left + c.width < -160 || c.top + c.height < -160 || c.left > r.innerWidth + d || c.top > r.innerHeight + d) return;
|
|
4850
4881
|
u += 1;
|
|
4851
4882
|
let f = c.left + c.width, p = c.top + c.height;
|
|
@@ -4886,7 +4917,7 @@ var Fc = {
|
|
|
4886
4917
|
if (t.elementEdges || t.elementCenters) {
|
|
4887
4918
|
o instanceof c.HTMLElement && d(o);
|
|
4888
4919
|
for (let e of o.querySelectorAll("*")) {
|
|
4889
|
-
if (u >=
|
|
4920
|
+
if (u >= el) break;
|
|
4890
4921
|
e instanceof c.HTMLElement && d(e);
|
|
4891
4922
|
}
|
|
4892
4923
|
}
|
|
@@ -4946,7 +4977,7 @@ var Fc = {
|
|
|
4946
4977
|
}, Me = async () => {
|
|
4947
4978
|
if (s.querySelector("[data-mesurer-builtin='select'] button")?.getAttribute("aria-pressed") === "true") return;
|
|
4948
4979
|
let t = i.currentSelection().elements;
|
|
4949
|
-
await e.command.execute(
|
|
4980
|
+
await e.command.execute(Wc, void 0, { source: "arrange" });
|
|
4950
4981
|
let n = new Set(i.currentSelection().elements);
|
|
4951
4982
|
for (let e of t) n.has(e) || i.toggleSelection(e);
|
|
4952
4983
|
}, Ne = (e) => {
|
|
@@ -4971,7 +5002,7 @@ var Fc = {
|
|
|
4971
5002
|
let n = ns(e), r = q(e, d), i = d.get(e) ?? r, a = u.get(e), o = (a ? ue(a) : null) ?? {
|
|
4972
5003
|
x: i.x - r.x,
|
|
4973
5004
|
y: i.y - r.y
|
|
4974
|
-
}, s =
|
|
5005
|
+
}, s = ll(n, i), c = Cs(e);
|
|
4975
5006
|
return {
|
|
4976
5007
|
element: e,
|
|
4977
5008
|
movesDirectly: de(e, p) === null,
|
|
@@ -5004,7 +5035,7 @@ var Fc = {
|
|
|
5004
5035
|
desiredLocalOffsetY: o.y
|
|
5005
5036
|
}
|
|
5006
5037
|
};
|
|
5007
|
-
}), h =
|
|
5038
|
+
}), h = dl(m.map(({ target: e }) => ({
|
|
5008
5039
|
left: e.beforeLeft,
|
|
5009
5040
|
top: e.beforeTop,
|
|
5010
5041
|
width: e.beforeWidth,
|
|
@@ -5044,18 +5075,18 @@ var Fc = {
|
|
|
5044
5075
|
if (!T || e.pointerId !== T.pointerId) return;
|
|
5045
5076
|
let t = e.clientX - T.originX, n = e.clientY - T.originY, r = null;
|
|
5046
5077
|
if (!T.moved) {
|
|
5047
|
-
if (Math.hypot(t, n) <
|
|
5078
|
+
if (Math.hypot(t, n) < ol) return;
|
|
5048
5079
|
T.moved = !0;
|
|
5049
5080
|
}
|
|
5050
5081
|
e.shiftKey && (Math.abs(t) >= Math.abs(n) ? (n = 0, r = "x") : (t = 0, r = "y"));
|
|
5051
|
-
let i =
|
|
5082
|
+
let i = ll(T.groupBefore, {
|
|
5052
5083
|
x: t,
|
|
5053
5084
|
y: n
|
|
5054
|
-
}), a = r === "y" ? null :
|
|
5085
|
+
}), a = r === "y" ? null : gl("x", i, T.snapCandidates), o = r === "x" ? null : gl("y", i, T.snapCandidates);
|
|
5055
5086
|
t += a?.delta ?? 0, n += o?.delta ?? 0, T.dx = t, T.dy = n;
|
|
5056
5087
|
let s = fe(I(), Pe(T, t, n));
|
|
5057
5088
|
me(s);
|
|
5058
|
-
let c =
|
|
5089
|
+
let c = ll(T.groupBefore, {
|
|
5059
5090
|
x: t,
|
|
5060
5091
|
y: n
|
|
5061
5092
|
});
|
|
@@ -5080,7 +5111,7 @@ var Fc = {
|
|
|
5080
5111
|
}
|
|
5081
5112
|
let a = fe(I(), Pe(n, n.dx, n.dy));
|
|
5082
5113
|
E = {
|
|
5083
|
-
id:
|
|
5114
|
+
id: vl(r, "arrange"),
|
|
5084
5115
|
createdAt: Date.now(),
|
|
5085
5116
|
pageUrl: F(),
|
|
5086
5117
|
targets: n.targets.map(({ element: e, movesDirectly: t, target: r }) => {
|
|
@@ -5106,12 +5137,12 @@ var Fc = {
|
|
|
5106
5137
|
})
|
|
5107
5138
|
};
|
|
5108
5139
|
for (let { element: e, target: t } of n.targets) b.set(t.selector, e);
|
|
5109
|
-
e.command.execute(
|
|
5140
|
+
e.command.execute(Kc).catch(() => {
|
|
5110
5141
|
E = null, Oe(), De();
|
|
5111
5142
|
});
|
|
5112
5143
|
}, Re = (e) => {
|
|
5113
5144
|
!T || e.pointerId !== T.pointerId || Ie();
|
|
5114
|
-
}, ze = (e) => xs(l, () =>
|
|
5145
|
+
}, ze = (e) => xs(l, () => rc({
|
|
5115
5146
|
x: e.clientX,
|
|
5116
5147
|
y: e.clientY
|
|
5117
5148
|
}, t.rendererRoot ?? null, n, o)), Be = (e) => {
|
|
@@ -5125,7 +5156,7 @@ var Fc = {
|
|
|
5125
5156
|
let r = ze(e);
|
|
5126
5157
|
i.setHover(r instanceof c.HTMLElement && R(r) ? r : null);
|
|
5127
5158
|
}, Ve = (t) => {
|
|
5128
|
-
if (t.key !== "Escape" || !M() && !T ||
|
|
5159
|
+
if (t.key !== "Escape" || !M() && !T || Dl(t.target) || s.querySelector("[data-mesurer-tool-menu]")) return;
|
|
5129
5160
|
if (t.preventDefault(), t.stopImmediatePropagation(), T) {
|
|
5130
5161
|
Ie();
|
|
5131
5162
|
return;
|
|
@@ -5135,7 +5166,7 @@ var Fc = {
|
|
|
5135
5166
|
i.clearSelection(), De();
|
|
5136
5167
|
return;
|
|
5137
5168
|
}
|
|
5138
|
-
e.state.update(
|
|
5169
|
+
e.state.update(Vc, () => !1), ke(), De(), e.command.execute(Wc, void 0, { source: "arrange-escape" }).catch(() => void 0);
|
|
5139
5170
|
};
|
|
5140
5171
|
f.addEventListener("pointerdown", Ne), f.addEventListener("pointermove", Fe), f.addEventListener("pointerup", Le), f.addEventListener("pointercancel", Re), r.addEventListener("pointermove", Be, !0), r.addEventListener("keydown", Ve, !0), r.addEventListener("dblclick", je, !0), r.addEventListener("keyup", je, !0), r.addEventListener("pointerup", je, !0), r.addEventListener("resize", je), r.addEventListener("scroll", je, !0), o.addEventListener("scroll", je, !0), A = new c.MutationObserver(() => {
|
|
5141
5172
|
ye(), je();
|
|
@@ -5157,18 +5188,18 @@ var Fc = {
|
|
|
5157
5188
|
!O && M() && !T && De();
|
|
5158
5189
|
}), Ge = (e) => j().intents.find((t) => t.id === e) ?? null, Ke = (e, t) => {
|
|
5159
5190
|
let n = null;
|
|
5160
|
-
if (n = t === "before" ?
|
|
5191
|
+
if (n = t === "before" ? dl(e.targets.map((e) => ({
|
|
5161
5192
|
left: e.beforeLeft,
|
|
5162
5193
|
top: e.beforeTop,
|
|
5163
5194
|
width: e.beforeWidth,
|
|
5164
5195
|
height: e.beforeHeight
|
|
5165
|
-
}))) : t === "desired" ?
|
|
5196
|
+
}))) : t === "desired" ? dl(e.targets.map((e) => ({
|
|
5166
5197
|
left: e.desiredLeft,
|
|
5167
5198
|
top: e.desiredTop,
|
|
5168
5199
|
width: e.desiredWidth,
|
|
5169
5200
|
height: e.desiredHeight
|
|
5170
|
-
}))) : ge(() =>
|
|
5171
|
-
let i = Math.max(0, n.left -
|
|
5201
|
+
}))) : ge(() => dl(e.targets.map((e) => V(e)).filter((e) => e !== null).map((e) => ns(e)))), !n) throw Error(`Edit movement intent has no resolvable capture region: ${e.id}`);
|
|
5202
|
+
let i = Math.max(0, n.left - Qc), a = Math.max(0, n.top - Qc), o = Math.min(r.innerWidth, n.left + n.width + Qc), s = Math.min(r.innerHeight, n.top + n.height + Qc);
|
|
5172
5203
|
return {
|
|
5173
5204
|
left: i,
|
|
5174
5205
|
top: a,
|
|
@@ -5177,10 +5208,10 @@ var Fc = {
|
|
|
5177
5208
|
};
|
|
5178
5209
|
}, qe = {
|
|
5179
5210
|
active: M,
|
|
5180
|
-
intents: () => j().intents.map(
|
|
5211
|
+
intents: () => j().intents.map(xl),
|
|
5181
5212
|
intent(e) {
|
|
5182
5213
|
let t = Ge(e);
|
|
5183
|
-
return t ?
|
|
5214
|
+
return t ? xl(t) : null;
|
|
5184
5215
|
},
|
|
5185
5216
|
show(e, t) {
|
|
5186
5217
|
if (!Ge(e)) throw Error(`Edit intent not found: ${e}`);
|
|
@@ -5213,7 +5244,7 @@ var Fc = {
|
|
|
5213
5244
|
}]
|
|
5214
5245
|
};
|
|
5215
5246
|
},
|
|
5216
|
-
review: (e, t =
|
|
5247
|
+
review: (e, t = Zc) => {
|
|
5217
5248
|
let n = Ge(e);
|
|
5218
5249
|
if (!n) throw Error(`Edit movement intent not found: ${e}`);
|
|
5219
5250
|
let r = ge(() => n.targets.map((e) => {
|
|
@@ -5231,7 +5262,7 @@ var Fc = {
|
|
|
5231
5262
|
delta: null,
|
|
5232
5263
|
matched: !1
|
|
5233
5264
|
};
|
|
5234
|
-
let i = ns(n), a =
|
|
5265
|
+
let i = ns(n), a = ul(i, r), o = Math.abs(a.left) <= t && Math.abs(a.top) <= t && Math.abs(a.width) <= t && Math.abs(a.height) <= t;
|
|
5235
5266
|
return {
|
|
5236
5267
|
targetId: e.id,
|
|
5237
5268
|
selector: e.selector,
|
|
@@ -5251,13 +5282,13 @@ var Fc = {
|
|
|
5251
5282
|
};
|
|
5252
5283
|
},
|
|
5253
5284
|
resetSelection: async () => {
|
|
5254
|
-
await e.command.execute(
|
|
5285
|
+
await e.command.execute(Jc);
|
|
5255
5286
|
},
|
|
5256
5287
|
resetAll: async () => {
|
|
5257
|
-
await e.command.execute(
|
|
5288
|
+
await e.command.execute(Yc);
|
|
5258
5289
|
},
|
|
5259
5290
|
clear: async () => {
|
|
5260
|
-
await e.command.execute(
|
|
5291
|
+
await e.command.execute(qc);
|
|
5261
5292
|
}
|
|
5262
5293
|
};
|
|
5263
5294
|
e.tool.register({
|
|
@@ -5265,10 +5296,10 @@ var Fc = {
|
|
|
5265
5296
|
label: "Edit",
|
|
5266
5297
|
shortcut: "Shift+A",
|
|
5267
5298
|
order: 65,
|
|
5268
|
-
command:
|
|
5299
|
+
command: Gc,
|
|
5269
5300
|
toolbarMode: "edit",
|
|
5270
5301
|
modeSwitch: !0,
|
|
5271
|
-
icon:
|
|
5302
|
+
icon: cl,
|
|
5272
5303
|
active: M,
|
|
5273
5304
|
menu: {
|
|
5274
5305
|
label: "Edit options",
|
|
@@ -5319,7 +5350,7 @@ var Fc = {
|
|
|
5319
5350
|
label: "Reset all positions",
|
|
5320
5351
|
disabled: () => I().length === 0,
|
|
5321
5352
|
run: async () => {
|
|
5322
|
-
await e.command.execute(
|
|
5353
|
+
await e.command.execute(Yc, void 0, { source: "arrange-menu" });
|
|
5323
5354
|
}
|
|
5324
5355
|
}
|
|
5325
5356
|
]
|
|
@@ -5383,31 +5414,31 @@ var Fc = {
|
|
|
5383
5414
|
disabled: () => !N().snapping
|
|
5384
5415
|
}
|
|
5385
5416
|
]
|
|
5386
|
-
}), e.command.register(
|
|
5417
|
+
}), e.command.register(Gc, async () => {
|
|
5387
5418
|
let t = !M();
|
|
5388
5419
|
if (t && await Me(), e.state.update("mesurer.arrange.active", () => t), !t) {
|
|
5389
5420
|
T && Ie(), ke(), De();
|
|
5390
5421
|
return;
|
|
5391
5422
|
}
|
|
5392
5423
|
Oe(), De();
|
|
5393
|
-
}), e.command.register(
|
|
5424
|
+
}), e.command.register(Kc, () => {
|
|
5394
5425
|
let t = E;
|
|
5395
5426
|
E = null, t && (e.state.update("mesurer.arrange.intents", (e) => ({ intents: [...e.intents, t].slice(-100) })), Oe(), De());
|
|
5396
|
-
}), e.command.register(
|
|
5427
|
+
}), e.command.register(Jc, () => {
|
|
5397
5428
|
let e = D ?? _e();
|
|
5398
5429
|
D = null, we(e);
|
|
5399
|
-
}), e.command.register(
|
|
5400
|
-
e.state.update(
|
|
5430
|
+
}), e.command.register(Yc, Te), e.command.register(qc, () => {
|
|
5431
|
+
e.state.update(Bc, () => ({ intents: [] })), w = {
|
|
5401
5432
|
intentId: null,
|
|
5402
5433
|
state: "desired"
|
|
5403
5434
|
}, re(), K(), M() ? se() : oe(), De();
|
|
5404
|
-
}), e.service.provide(
|
|
5435
|
+
}), e.service.provide(zc, qe), he(), De(), e.lifecycle.onDispose(() => {
|
|
5405
5436
|
O = !0, k && r.cancelAnimationFrame(k), A?.disconnect(), A = null, f.removeEventListener("pointerdown", Ne), f.removeEventListener("pointermove", Fe), f.removeEventListener("pointerup", Le), f.removeEventListener("pointercancel", Re), r.removeEventListener("pointermove", Be, !0), r.removeEventListener("keydown", Ve, !0), r.removeEventListener("dblclick", je, !0), r.removeEventListener("keyup", je, !0), r.removeEventListener("pointerup", je, !0), r.removeEventListener("resize", je), r.removeEventListener("scroll", je, !0), o.removeEventListener("scroll", je, !0), He(), We(), Ue.dispose(), re(), xe(), K(), oe(), h(), _([]), m.remove(), i.dispose(), a.dispose();
|
|
5406
5437
|
});
|
|
5407
5438
|
}
|
|
5408
|
-
}),
|
|
5439
|
+
}), kl = (e, t, n) => {
|
|
5409
5440
|
let r = !1, i = 0, a = null, o = null, s = () => ({
|
|
5410
|
-
visible: (e.state.get("mesurer.arrange.active") ?? !1) ||
|
|
5441
|
+
visible: (e.state.get("mesurer.arrange.active") ?? !1) || Lc(e).keepArrangeChanges,
|
|
5411
5442
|
intents: e.state.get("mesurer.arrange.intents")?.intents ?? []
|
|
5412
5443
|
}), c = (e, t) => e?.visible === t.visible && e.intents === t.intents, l = (e) => {
|
|
5413
5444
|
if (a = e, e.visible) {
|
|
@@ -5428,27 +5459,27 @@ var Fc = {
|
|
|
5428
5459
|
l(s()), e.lifecycle.onDispose(() => {
|
|
5429
5460
|
r = !0, i && n.cancelAnimationFrame(i), i = 0, o = null, d.dispose();
|
|
5430
5461
|
});
|
|
5431
|
-
},
|
|
5462
|
+
}, Al = [
|
|
5432
5463
|
"[data-mesurer-measurement='true']",
|
|
5433
5464
|
"[data-mesurer-selected-measurement='true']",
|
|
5434
5465
|
"[data-mesurer-inspector-ui='true']"
|
|
5435
|
-
].join(""),
|
|
5466
|
+
].join(""), jl = "[data-mesurer-text-edit-runtime='true']", Ml = "[data-mesurer-text-editor='true']", Nl = (e, t) => {
|
|
5436
5467
|
let n = t.ownerDocument.body;
|
|
5437
5468
|
if (!n) return;
|
|
5438
|
-
let r = t.ownerWindow, i = /* @__PURE__ */ new Map(), a = e.state.get("mesurer.arrange.active") ?? !1, o = [], s = null, c = (e) => e.matches(
|
|
5469
|
+
let r = t.ownerWindow, i = /* @__PURE__ */ new Map(), a = e.state.get("mesurer.arrange.active") ?? !1, o = [], s = null, c = (e) => e.matches(Al) && e.getRootNode() === t.ownerDocument && e.parentElement === n, l = () => {
|
|
5439
5470
|
for (let [e, t] of i) e.isConnected && (t.value || t.priority ? e.style.setProperty("visibility", t.value, t.priority) : e.style.removeProperty("visibility"));
|
|
5440
5471
|
i.clear();
|
|
5441
|
-
}, u = () => o.some((e) => e.isConnected && !!e.querySelector(
|
|
5472
|
+
}, u = () => o.some((e) => e.isConnected && !!e.querySelector(Ml)), d = (e) => {
|
|
5442
5473
|
!a || u() || !c(e) || (i.has(e) || i.set(e, {
|
|
5443
5474
|
value: e.style.getPropertyValue("visibility"),
|
|
5444
5475
|
priority: e.style.getPropertyPriority("visibility")
|
|
5445
5476
|
}), (e.style.getPropertyValue("visibility") !== "hidden" || e.style.getPropertyPriority("visibility") !== "important") && e.style.setProperty("visibility", "hidden", "important"));
|
|
5446
5477
|
}, f = () => {
|
|
5447
|
-
if (!(!a || u())) for (let e of n.querySelectorAll(
|
|
5478
|
+
if (!(!a || u())) for (let e of n.querySelectorAll(Al)) e instanceof r.HTMLElement && d(e);
|
|
5448
5479
|
}, p = () => {
|
|
5449
5480
|
!a || u() ? l() : f();
|
|
5450
5481
|
}, m = () => {
|
|
5451
|
-
let e = Array.from(n.querySelectorAll(
|
|
5482
|
+
let e = Array.from(n.querySelectorAll(jl));
|
|
5452
5483
|
if (!(e.length === o.length && e.every((e, t) => e === o[t]))) {
|
|
5453
5484
|
if (s?.disconnect(), s = null, o = e, e.length > 0) {
|
|
5454
5485
|
s = new r.MutationObserver(p);
|
|
@@ -5464,8 +5495,8 @@ var Fc = {
|
|
|
5464
5495
|
let h = new r.MutationObserver((e) => {
|
|
5465
5496
|
let t = !1;
|
|
5466
5497
|
for (let n of e) {
|
|
5467
|
-
for (let e of n.addedNodes) e instanceof r.HTMLElement && (e.matches(
|
|
5468
|
-
for (let e of n.removedNodes) e instanceof r.HTMLElement && e.matches(
|
|
5498
|
+
for (let e of n.addedNodes) e instanceof r.HTMLElement && (e.matches(jl) && (t = !0), d(e));
|
|
5499
|
+
for (let e of n.removedNodes) e instanceof r.HTMLElement && e.matches(jl) && (t = !0);
|
|
5469
5500
|
}
|
|
5470
5501
|
t && m();
|
|
5471
5502
|
});
|
|
@@ -5477,20 +5508,20 @@ var Fc = {
|
|
|
5477
5508
|
p(), e.lifecycle.onDispose(() => {
|
|
5478
5509
|
h.disconnect(), s?.disconnect(), s = null, o = [], g.dispose(), l();
|
|
5479
5510
|
});
|
|
5480
|
-
},
|
|
5481
|
-
let e =
|
|
5511
|
+
}, Pl = () => {
|
|
5512
|
+
let e = Ol();
|
|
5482
5513
|
return {
|
|
5483
5514
|
...e,
|
|
5484
5515
|
async setup(t) {
|
|
5485
5516
|
await e.setup(t);
|
|
5486
|
-
let n = t.service.get(
|
|
5517
|
+
let n = t.service.get(zc);
|
|
5487
5518
|
if (!n) throw Error("Edit movement presentation policy requires the movement service.");
|
|
5488
5519
|
let r = t.service.get("runtime:solid");
|
|
5489
5520
|
if (!r) throw Error("Edit movement presentation policy requires the Solid renderer runtime.");
|
|
5490
|
-
|
|
5521
|
+
kl(t, n, r.ownerWindow), Nl(t, r);
|
|
5491
5522
|
}
|
|
5492
5523
|
};
|
|
5493
|
-
},
|
|
5524
|
+
}, Fl = (e, t, n, r) => ba({
|
|
5494
5525
|
id: `mesurer.${e}`,
|
|
5495
5526
|
version: "0.1.0",
|
|
5496
5527
|
provides: [`tool:${e}`],
|
|
@@ -5504,7 +5535,7 @@ var Fc = {
|
|
|
5504
5535
|
command: `builtin.${e}`
|
|
5505
5536
|
});
|
|
5506
5537
|
}
|
|
5507
|
-
}),
|
|
5538
|
+
}), Il = () => Fl("select", "Select", "S", 10), Ll = () => Fl("xray", "X-ray", "X", 20), Rl = () => Fl("color-picker", "Color picker", "P", 30), zl = () => Fl("rulers", "Rulers", "R", 40), Bl = () => Fl("responsive", "Responsive", "B", 65), Vl = () => Fl("text-inspector", "Typography", "A", 50), Hl = () => Fl("guides", "Guides", "G", 60), Ul = () => Fl("settings", "Settings", "⌘/Ctrl+,", 90), Wl = () => ba({
|
|
5508
5539
|
id: "mesurer.distance",
|
|
5509
5540
|
version: "0.1.0",
|
|
5510
5541
|
provides: ["overlay:distance", "settings:selection-spacing"],
|
|
@@ -5520,22 +5551,22 @@ var Fc = {
|
|
|
5520
5551
|
order: 30
|
|
5521
5552
|
});
|
|
5522
5553
|
}
|
|
5523
|
-
}),
|
|
5524
|
-
Fl(),
|
|
5554
|
+
}), Gl = () => [
|
|
5525
5555
|
Il(),
|
|
5526
5556
|
Ll(),
|
|
5527
5557
|
Rl(),
|
|
5528
|
-
Bl(),
|
|
5529
|
-
Vl(),
|
|
5530
5558
|
zl(),
|
|
5531
|
-
|
|
5532
|
-
Hl()
|
|
5559
|
+
Vl(),
|
|
5560
|
+
Hl(),
|
|
5561
|
+
Bl(),
|
|
5562
|
+
Wl(),
|
|
5563
|
+
Ul()
|
|
5533
5564
|
];
|
|
5534
|
-
function
|
|
5565
|
+
function Kl(e = [], t = []) {
|
|
5535
5566
|
let n = new Set(t.map((e) => `mesurer.${e}`));
|
|
5536
|
-
return [...
|
|
5567
|
+
return [...Gl().filter((e) => !n.has(e.id)), ...e];
|
|
5537
5568
|
}
|
|
5538
|
-
var
|
|
5569
|
+
var ql = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), Jl = (e, t, n = 0) => !(e.left + e.width + n <= t.left || t.left + t.width + n <= e.left || e.top + e.height + n <= t.top || t.top + t.height + n <= e.top), Yl = (e, t, n, r, i) => {
|
|
5539
5570
|
let a = e.left + e.width, o = e.top + e.height, s = [
|
|
5540
5571
|
{
|
|
5541
5572
|
axis: "vertical",
|
|
@@ -5583,7 +5614,7 @@ var Kl = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), ql = (e, t, n =
|
|
|
5583
5614
|
}
|
|
5584
5615
|
];
|
|
5585
5616
|
return i ? s.sort((e, t) => t.space - e.space) : s;
|
|
5586
|
-
},
|
|
5617
|
+
}, Xl = (e, t, n) => {
|
|
5587
5618
|
let r = [];
|
|
5588
5619
|
for (let i = 0; i <= n; i += 1) {
|
|
5589
5620
|
let n = i * t;
|
|
@@ -5609,14 +5640,14 @@ var Kl = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), ql = (e, t, n =
|
|
|
5609
5640
|
}
|
|
5610
5641
|
return r;
|
|
5611
5642
|
};
|
|
5612
|
-
function
|
|
5643
|
+
function Zl(e, t, n = {}) {
|
|
5613
5644
|
let r = n.markerSize ?? 24, i = n.markerGap ?? 4, a = n.targetGap ?? 6, o = n.targetClearance ?? 2, s = n.viewportPadding ?? 4, c = n.obstacles ?? [], l = Math.max(0, n.maxShiftRings ?? 2), u = n.viewportAware ?? !1, d = r + i, f = Math.max(s, t.width - r - s), p = Math.max(s, t.height - r - s), m = [], h = e.map((e) => e.rect), g = [];
|
|
5614
5645
|
for (let n of e) {
|
|
5615
|
-
let e = /* @__PURE__ */ new Set(), _ = [], v =
|
|
5616
|
-
for (let t of
|
|
5646
|
+
let e = /* @__PURE__ */ new Set(), _ = [], v = Yl(n.rect, t, r, a, u);
|
|
5647
|
+
for (let t of Xl(v, d, l)) {
|
|
5617
5648
|
let n = u ? {
|
|
5618
|
-
left:
|
|
5619
|
-
top:
|
|
5649
|
+
left: ql(t.left, s, f),
|
|
5650
|
+
top: ql(t.top, s, p)
|
|
5620
5651
|
} : t, r = `${n.left}:${n.top}`;
|
|
5621
5652
|
e.has(r) || (e.add(r), _.push(n));
|
|
5622
5653
|
}
|
|
@@ -5626,21 +5657,21 @@ function Xl(e, t, n = {}) {
|
|
|
5626
5657
|
width: r,
|
|
5627
5658
|
height: r
|
|
5628
5659
|
};
|
|
5629
|
-
return h.every((e) => !
|
|
5660
|
+
return h.every((e) => !Jl(t, e, o)) && c.every((e) => !Jl(t, e, i));
|
|
5630
5661
|
}), b = y.find((e) => {
|
|
5631
5662
|
let t = {
|
|
5632
5663
|
...e,
|
|
5633
5664
|
width: r,
|
|
5634
5665
|
height: r
|
|
5635
5666
|
};
|
|
5636
|
-
return m.every((e) => !
|
|
5667
|
+
return m.every((e) => !Jl(t, e, i));
|
|
5637
5668
|
}) ?? y.find((e) => {
|
|
5638
5669
|
let t = {
|
|
5639
5670
|
...e,
|
|
5640
5671
|
width: r,
|
|
5641
5672
|
height: r
|
|
5642
5673
|
};
|
|
5643
|
-
return m.every((e) => !
|
|
5674
|
+
return m.every((e) => !Jl(t, e));
|
|
5644
5675
|
}) ?? y[0] ?? _[0] ?? {
|
|
5645
5676
|
left: s,
|
|
5646
5677
|
top: s
|
|
@@ -5656,20 +5687,20 @@ function Xl(e, t, n = {}) {
|
|
|
5656
5687
|
}
|
|
5657
5688
|
return g;
|
|
5658
5689
|
}
|
|
5659
|
-
var
|
|
5690
|
+
var Ql = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), $l = 0, eu = (e) => e.split(",").map((e) => e.trim()).filter((e) => e.length > 0 && e !== "none"), tu = (e) => {
|
|
5660
5691
|
let t = e.ownerDocument.defaultView?.HTMLElement;
|
|
5661
5692
|
return !!(t && e instanceof t);
|
|
5662
|
-
},
|
|
5663
|
-
let n = e.style.getPropertyValue("anchor-name"), r = e.style.getPropertyPriority("anchor-name"), i =
|
|
5693
|
+
}, nu = (e, t) => {
|
|
5694
|
+
let n = e.style.getPropertyValue("anchor-name"), r = e.style.getPropertyPriority("anchor-name"), i = eu(n);
|
|
5664
5695
|
i.includes(t) || e.style.setProperty("anchor-name", [...i, t].join(", "), r);
|
|
5665
5696
|
let a = !1;
|
|
5666
5697
|
return () => {
|
|
5667
5698
|
if (a) return;
|
|
5668
5699
|
a = !0;
|
|
5669
|
-
let i =
|
|
5700
|
+
let i = eu(e.style.getPropertyValue("anchor-name")).filter((e) => e !== t);
|
|
5670
5701
|
i.length ? e.style.setProperty("anchor-name", i.join(", "), e.style.getPropertyPriority("anchor-name")) : n.trim() === "none" ? e.style.setProperty("anchor-name", n, r) : e.style.removeProperty("anchor-name");
|
|
5671
5702
|
};
|
|
5672
|
-
},
|
|
5703
|
+
}, ru = (e) => {
|
|
5673
5704
|
if (!e.length) return null;
|
|
5674
5705
|
let t = Math.min(...e.map((e) => e.left)), n = Math.min(...e.map((e) => e.top)), r = Math.max(...e.map((e) => e.left + e.width)), i = Math.max(...e.map((e) => e.top + e.height));
|
|
5675
5706
|
return {
|
|
@@ -5678,14 +5709,14 @@ var Zl = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), Ql = 0, $l = (e)
|
|
|
5678
5709
|
width: r - t,
|
|
5679
5710
|
height: i - n
|
|
5680
5711
|
};
|
|
5681
|
-
},
|
|
5712
|
+
}, iu = (e, t, n, r, i = 8) => {
|
|
5682
5713
|
let a = r.innerWidth - t - 8, o = r.innerHeight - n - 8, s = e.left + e.width + i, c = e.left - t - i;
|
|
5683
5714
|
return {
|
|
5684
|
-
left: s + t <= r.innerWidth - 8 ? s : c >= 8 ? c :
|
|
5685
|
-
top:
|
|
5715
|
+
left: s + t <= r.innerWidth - 8 ? s : c >= 8 ? c : Ql(e.left + e.width - t, 8, a),
|
|
5716
|
+
top: Ql(e.top, 8, o)
|
|
5686
5717
|
};
|
|
5687
|
-
},
|
|
5688
|
-
let a = r.innerWidth - t - 8, o =
|
|
5718
|
+
}, au = (e, t, n, r, i = 8) => {
|
|
5719
|
+
let a = r.innerWidth - t - 8, o = Ql(e.left + e.width / 2 - t / 2, 8, a), s = e.top + e.height + i;
|
|
5689
5720
|
if (s + n <= r.innerHeight - 8) return {
|
|
5690
5721
|
left: o,
|
|
5691
5722
|
top: s
|
|
@@ -5694,10 +5725,10 @@ var Zl = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), Ql = 0, $l = (e)
|
|
|
5694
5725
|
return c >= 8 ? {
|
|
5695
5726
|
left: o,
|
|
5696
5727
|
top: c
|
|
5697
|
-
} :
|
|
5728
|
+
} : iu(e, t, n, r, i);
|
|
5698
5729
|
};
|
|
5699
|
-
function
|
|
5700
|
-
let [t, n] = Tr(0), [r, i] = Tr(0), [a, o] = Tr(null), [s, c] = Tr(null), [l, u] = Tr(null), [d, f] = Tr({}), [p, m] = Tr(!1), [h, g] = Tr(""), [_, v] = Tr(!1), [y, b] = Tr(null), [x, S] = Tr(!1), [C, w] = Tr(null), [T, E] = Tr(null), D = `--mesurer-annotation-trigger-${
|
|
5730
|
+
function ou(e) {
|
|
5731
|
+
let [t, n] = Tr(0), [r, i] = Tr(0), [a, o] = Tr(null), [s, c] = Tr(null), [l, u] = Tr(null), [d, f] = Tr({}), [p, m] = Tr(!1), [h, g] = Tr(""), [_, v] = Tr(!1), [y, b] = Tr(null), [x, S] = Tr(!1), [C, w] = Tr(null), [T, E] = Tr(null), D = `--mesurer-annotation-trigger-${++$l}`, O = null, k = e.initialTriggerFallback === "current-and-next", A = null, j = null, M = null, N, P, F = null, I = null, L = !1, R = null, z = null, B = null, V = null, H = null, ee = null, U = /* @__PURE__ */ new Map(), W = () => N?.ownerDocument.defaultView ?? window, te = uo(W()), ne = "context-annotation-send", G = () => e.coordinateSpace === "viewport", re = (e) => e ? "native-anchor" : G() ? "cached-delta" : "document", K = (e) => {
|
|
5701
5732
|
if (G()) return e;
|
|
5702
5733
|
let t = W();
|
|
5703
5734
|
return {
|
|
@@ -5734,7 +5765,7 @@ function au(e) {
|
|
|
5734
5765
|
}, pe = (t) => {
|
|
5735
5766
|
let n = e.runtime.annotation(t);
|
|
5736
5767
|
return !n || n.anchor.kind !== "elements" ? null : n.resolvedTargets.find(({ element: e }) => e?.isConnected)?.element ?? null;
|
|
5737
|
-
}, me = (e) => !!(
|
|
5768
|
+
}, me = (e) => !!(tu(e) && G() && N && ce() && e.getRootNode() === N.getRootNode()), he = (e) => {
|
|
5738
5769
|
let t = pe(e), n = U.get(e);
|
|
5739
5770
|
if (!t) {
|
|
5740
5771
|
n && (fe(e), i((e) => e + 1));
|
|
@@ -5748,12 +5779,12 @@ function au(e) {
|
|
|
5748
5779
|
fe(e);
|
|
5749
5780
|
let a = t.ownerDocument.defaultView;
|
|
5750
5781
|
if (a) {
|
|
5751
|
-
if (r &&
|
|
5752
|
-
let n = `--mesurer-annotation-${
|
|
5782
|
+
if (r && tu(t)) {
|
|
5783
|
+
let n = `--mesurer-annotation-${++$l}`;
|
|
5753
5784
|
U.set(e, {
|
|
5754
5785
|
target: t,
|
|
5755
5786
|
anchorName: n,
|
|
5756
|
-
releaseAnchor:
|
|
5787
|
+
releaseAnchor: nu(t, n),
|
|
5757
5788
|
scroll: Zo(a, t, () => de(e), { trackWindow: !1 })
|
|
5758
5789
|
});
|
|
5759
5790
|
} else U.set(e, {
|
|
@@ -5779,7 +5810,7 @@ function au(e) {
|
|
|
5779
5810
|
e.initialTriggerFallback && (O = q());
|
|
5780
5811
|
let ye = () => {
|
|
5781
5812
|
V?.release(), V = null, B?.(), B = null, R = null, z = null;
|
|
5782
|
-
}, be = (e) => !!(
|
|
5813
|
+
}, be = (e) => !!(tu(e) && G() && N && e !== O && ce() && e.getRootNode() === N.getRootNode()), xe = () => {
|
|
5783
5814
|
let e = q();
|
|
5784
5815
|
O && e !== O && (O = null);
|
|
5785
5816
|
let t = R, n = !!(e?.isConnected && be(e)), r = z === e;
|
|
@@ -5787,13 +5818,13 @@ function au(e) {
|
|
|
5787
5818
|
V?.sync();
|
|
5788
5819
|
return;
|
|
5789
5820
|
}
|
|
5790
|
-
let i = e === t ? D : `--mesurer-annotation-trigger-${
|
|
5821
|
+
let i = e === t ? D : `--mesurer-annotation-trigger-${++$l}`;
|
|
5791
5822
|
if (ye(), !e?.isConnected) return;
|
|
5792
5823
|
R = e;
|
|
5793
5824
|
let a = e.ownerDocument.defaultView;
|
|
5794
5825
|
if (a) {
|
|
5795
|
-
if (n &&
|
|
5796
|
-
B =
|
|
5826
|
+
if (n && tu(e)) {
|
|
5827
|
+
B = nu(e, i), z = e, D = i, V = Zo(a, e, ue, { trackWindow: !1 });
|
|
5797
5828
|
return;
|
|
5798
5829
|
}
|
|
5799
5830
|
D = i, V = Zo(a, e, ue, { trackWindow: G() });
|
|
@@ -5884,7 +5915,7 @@ function au(e) {
|
|
|
5884
5915
|
};
|
|
5885
5916
|
});
|
|
5886
5917
|
return e.region && t.push({ ...e.region }), t;
|
|
5887
|
-
}), Ue = wr(() =>
|
|
5918
|
+
}), Ue = wr(() => ru(He())), We = (e) => e.anchor.kind === "elements" ? `${e.anchor.targets.length} selected ${e.anchor.targets.length === 1 ? "element" : "elements"}` : "Selected region", Ge = wr(() => {
|
|
5888
5919
|
r();
|
|
5889
5920
|
let t = e.runtime.currentSelection().elements;
|
|
5890
5921
|
if (!t.length) return null;
|
|
@@ -5893,7 +5924,7 @@ function au(e) {
|
|
|
5893
5924
|
}), Ke = () => {
|
|
5894
5925
|
r();
|
|
5895
5926
|
let e = Ge();
|
|
5896
|
-
if (!e?.isConnected) return null;
|
|
5927
|
+
if (!e?.isConnected || Ys(e.ownerDocument)) return null;
|
|
5897
5928
|
let t = zs(e), n = {
|
|
5898
5929
|
left: t.left,
|
|
5899
5930
|
top: t.top,
|
|
@@ -5904,7 +5935,7 @@ function au(e) {
|
|
|
5904
5935
|
top: e.top,
|
|
5905
5936
|
width: 24,
|
|
5906
5937
|
height: 24
|
|
5907
|
-
})), [o] =
|
|
5938
|
+
})), [o] = Zl([{
|
|
5908
5939
|
id: "selection-note-trigger",
|
|
5909
5940
|
rect: n
|
|
5910
5941
|
}], {
|
|
@@ -5914,7 +5945,7 @@ function au(e) {
|
|
|
5914
5945
|
obstacles: [...a, ...Te()],
|
|
5915
5946
|
maxShiftRings: Math.ceil(Math.max(i.innerWidth, i.innerHeight) / 28),
|
|
5916
5947
|
viewportAware: !0
|
|
5917
|
-
}), s = o?.left ??
|
|
5948
|
+
}), s = o?.left ?? Ql(n.left + n.width + 6, 4, i.innerWidth - 24 - 4), c = o?.top ?? Ql(n.top, 4, i.innerHeight - 24 - 4), l = z === e, u = G() && !l;
|
|
5918
5949
|
return {
|
|
5919
5950
|
left: l || u ? s : s + i.scrollX,
|
|
5920
5951
|
top: l || u ? c : c + i.scrollY,
|
|
@@ -5932,7 +5963,7 @@ function au(e) {
|
|
|
5932
5963
|
rect: n
|
|
5933
5964
|
}] : [];
|
|
5934
5965
|
});
|
|
5935
|
-
return new Map(
|
|
5966
|
+
return new Map(Zl(i, {
|
|
5936
5967
|
width: n.innerWidth,
|
|
5937
5968
|
height: n.innerHeight
|
|
5938
5969
|
}, { obstacles: He() }).map((e) => [e.id, e]));
|
|
@@ -5953,7 +5984,7 @@ function au(e) {
|
|
|
5953
5984
|
};
|
|
5954
5985
|
}, Xe = () => {
|
|
5955
5986
|
let e = Ue(), t = W();
|
|
5956
|
-
return e ?
|
|
5987
|
+
return e ? au(e, 256, 160, t) : {
|
|
5957
5988
|
left: 8,
|
|
5958
5989
|
top: 8
|
|
5959
5990
|
};
|
|
@@ -5974,7 +6005,7 @@ function au(e) {
|
|
|
5974
6005
|
};
|
|
5975
6006
|
}, Qe = (e, t) => {
|
|
5976
6007
|
let n = W(), r = qe(), i = r.get(e);
|
|
5977
|
-
if (!i) return
|
|
6008
|
+
if (!i) return iu(t, 272, 176, n);
|
|
5978
6009
|
let a = n.innerWidth - 272 - 8, o = n.innerHeight - 176 - 8, s = [...r.values()].map((e) => ({
|
|
5979
6010
|
left: e.left,
|
|
5980
6011
|
top: e.top,
|
|
@@ -6000,8 +6031,8 @@ function au(e) {
|
|
|
6000
6031
|
}
|
|
6001
6032
|
]) {
|
|
6002
6033
|
let t = {
|
|
6003
|
-
left:
|
|
6004
|
-
top:
|
|
6034
|
+
left: Ql(e.left, 8, a),
|
|
6035
|
+
top: Ql(e.top, 8, o)
|
|
6005
6036
|
}, n = `${t.left}:${t.top}`;
|
|
6006
6037
|
l.has(n) || (l.add(n), u.push(t));
|
|
6007
6038
|
}
|
|
@@ -6017,7 +6048,7 @@ function au(e) {
|
|
|
6017
6048
|
targetOverlap: c(r, t),
|
|
6018
6049
|
index: n
|
|
6019
6050
|
};
|
|
6020
|
-
}).sort((e, t) => e.markerOverlap - t.markerOverlap || e.targetOverlap - t.targetOverlap || e.index - t.index)[0]?.candidate ??
|
|
6051
|
+
}).sort((e, t) => e.markerOverlap - t.markerOverlap || e.targetOverlap - t.targetOverlap || e.index - t.index)[0]?.candidate ?? iu(t, 272, 176, n);
|
|
6021
6052
|
}, $e = (t) => {
|
|
6022
6053
|
let n = e.runtime.annotationRect(t);
|
|
6023
6054
|
if (!n) return {
|
|
@@ -6069,8 +6100,8 @@ function au(e) {
|
|
|
6069
6100
|
let u = (t) => {
|
|
6070
6101
|
if (!j || t.pointerId !== j.pointerId) return;
|
|
6071
6102
|
let r = j, i = Math.max(8, s.innerWidth - r.width - 8), a = Math.max(8, s.innerHeight - r.height - 8), o = {
|
|
6072
|
-
left:
|
|
6073
|
-
top:
|
|
6103
|
+
left: Ql(r.originLeft + t.clientX - r.startX, 8, i),
|
|
6104
|
+
top: Ql(r.originTop + t.clientY - r.startY, 8, a)
|
|
6074
6105
|
}, c = e.runtime.annotationRect(n);
|
|
6075
6106
|
c && f((e) => ({
|
|
6076
6107
|
...e,
|
|
@@ -6101,7 +6132,7 @@ function au(e) {
|
|
|
6101
6132
|
}
|
|
6102
6133
|
}
|
|
6103
6134
|
}, ot = se, st = () => {
|
|
6104
|
-
Be() && (k = !1, A = ie(), g(""), v(!1), b(null), w(null), o(null), m(!0), F = (e) => {
|
|
6135
|
+
Be() && (e.runtime.currentSelection().elements.some((e) => Ys(e.ownerDocument)) || (k = !1, A = ie(), g(""), v(!1), b(null), w(null), o(null), m(!0), F = (e) => {
|
|
6105
6136
|
let t = le()?.querySelector("[data-mesurer-annotation-composer='true']"), n = W().Node;
|
|
6106
6137
|
if (!(t && n && e.target instanceof n && t.contains(e.target))) {
|
|
6107
6138
|
if (h().trim() && !y()) {
|
|
@@ -6110,18 +6141,24 @@ function au(e) {
|
|
|
6110
6141
|
}
|
|
6111
6142
|
ct();
|
|
6112
6143
|
}
|
|
6113
|
-
}, W().document.addEventListener("pointerdown", F, !0), W().queueMicrotask(() => V?.sync()));
|
|
6144
|
+
}, W().document.addEventListener("pointerdown", F, !0), W().queueMicrotask(() => V?.sync())));
|
|
6114
6145
|
}, ct = () => {
|
|
6115
6146
|
let e = p();
|
|
6116
6147
|
A !== null && !ae(A, ie()) ? (O = q(), k = !1, xe(), we()) : e && (k = !1), ot();
|
|
6117
6148
|
}, lt = () => {
|
|
6118
6149
|
p() && (k = !0, ot());
|
|
6119
6150
|
}, ut = () => {
|
|
6120
|
-
if (!(!h().trim() || x()))
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6151
|
+
if (!(!h().trim() || x())) {
|
|
6152
|
+
if (e.runtime.currentSelection().elements.some((e) => Ys(e.ownerDocument))) {
|
|
6153
|
+
b("Context annotations are unavailable for Responsive preview targets.");
|
|
6154
|
+
return;
|
|
6155
|
+
}
|
|
6156
|
+
try {
|
|
6157
|
+
let t = e.runtime.addSelectionAnnotation(h());
|
|
6158
|
+
k = !1, A = null, g(""), v(!1), b(null), m(!1), oe(), he(t.id), et(t.id), o(t.id), w(null), _e(t.id);
|
|
6159
|
+
} catch (e) {
|
|
6160
|
+
b(e instanceof Error ? e.message : String(e));
|
|
6161
|
+
}
|
|
6125
6162
|
}
|
|
6126
6163
|
}, dt = {
|
|
6127
6164
|
openNoteComposer: st,
|
|
@@ -6511,11 +6548,11 @@ function au(e) {
|
|
|
6511
6548
|
})
|
|
6512
6549
|
];
|
|
6513
6550
|
}
|
|
6514
|
-
function
|
|
6551
|
+
function su(e) {
|
|
6515
6552
|
let t = null;
|
|
6516
|
-
return Sn(
|
|
6553
|
+
return Sn(oc(e.ownerWindow, () => {
|
|
6517
6554
|
t?.abandonNoteComposer();
|
|
6518
|
-
})), Y(
|
|
6555
|
+
})), Y(ou, {
|
|
6519
6556
|
get runtime() {
|
|
6520
6557
|
return e.runtime;
|
|
6521
6558
|
},
|
|
@@ -6536,8 +6573,8 @@ function ou(e) {
|
|
|
6536
6573
|
}
|
|
6537
6574
|
});
|
|
6538
6575
|
}
|
|
6539
|
-
var
|
|
6540
|
-
function
|
|
6576
|
+
var cu = "2147482950", lu = "2147483646", uu = "2147483647";
|
|
6577
|
+
function du(e) {
|
|
6541
6578
|
let { ownerDocument: t, ownerWindow: n, pageTarget: r } = e, i = t.body;
|
|
6542
6579
|
if (!(i && !(r instanceof n.ShadowRoot) && r.getRootNode() === t)) return e.createInspectorMount();
|
|
6543
6580
|
Vo(Ho, i);
|
|
@@ -6558,17 +6595,17 @@ function uu(e) {
|
|
|
6558
6595
|
s.dataset.mesurerDocumentInspectorLayerStyle = "true", s.textContent = `
|
|
6559
6596
|
[data-mesurer-document-inspector-mount="true"] [data-mesurer-annotation-target-highlight="true"] {
|
|
6560
6597
|
position: absolute !important;
|
|
6561
|
-
z-index: ${
|
|
6598
|
+
z-index: ${cu} !important;
|
|
6562
6599
|
}
|
|
6563
6600
|
[data-mesurer-document-inspector-mount="true"] [data-mesurer-annotation-panel="true"] {
|
|
6564
6601
|
position: absolute !important;
|
|
6565
|
-
z-index: ${
|
|
6602
|
+
z-index: ${lu} !important;
|
|
6566
6603
|
}
|
|
6567
6604
|
[data-mesurer-document-inspector-mount="true"] [data-mesurer-annotation-marker="true"],
|
|
6568
6605
|
[data-mesurer-document-inspector-mount="true"] [data-mesurer-annotation-trigger="true"],
|
|
6569
6606
|
[data-mesurer-document-inspector-mount="true"] [data-mesurer-annotation-composer="true"] {
|
|
6570
6607
|
position: absolute !important;
|
|
6571
|
-
z-index: ${
|
|
6608
|
+
z-index: ${uu} !important;
|
|
6572
6609
|
}
|
|
6573
6610
|
`, t.head.append(s), i.append(a);
|
|
6574
6611
|
let c = !1;
|
|
@@ -6579,8 +6616,8 @@ function uu(e) {
|
|
|
6579
6616
|
}
|
|
6580
6617
|
};
|
|
6581
6618
|
}
|
|
6582
|
-
var
|
|
6583
|
-
let t = e.kind === "columns", n = e.align === "stretch", r = n ? `repeat(${e.count}, minmax(0, 1fr))` : `repeat(${e.count}, ${e.size}px)`, i =
|
|
6619
|
+
var fu = (e) => `color-mix(in srgb, ${e.color} ${e.opacity * 100}%, transparent)`, pu = (e) => e === "max" ? "end" : e === "center" ? "center" : "start", mu = (e) => {
|
|
6620
|
+
let t = e.kind === "columns", n = e.align === "stretch", r = n ? `repeat(${e.count}, minmax(0, 1fr))` : `repeat(${e.count}, ${e.size}px)`, i = pu(e.align);
|
|
6584
6621
|
return {
|
|
6585
6622
|
position: "absolute",
|
|
6586
6623
|
inset: "0",
|
|
@@ -6601,7 +6638,7 @@ var du = (e) => `color-mix(in srgb, ${e.color} ${e.opacity * 100}%, transparent)
|
|
|
6601
6638
|
transform: e.align === "center" ? t ? `translateX(${e.offset}px)` : `translateY(${e.offset}px)` : void 0
|
|
6602
6639
|
};
|
|
6603
6640
|
};
|
|
6604
|
-
function
|
|
6641
|
+
function hu(e) {
|
|
6605
6642
|
let t = () => e.guides.filter((e) => e.visible);
|
|
6606
6643
|
return Y(jr, {
|
|
6607
6644
|
get when() {
|
|
@@ -6636,7 +6673,7 @@ function mu(e) {
|
|
|
6636
6673
|
"min-height": "0",
|
|
6637
6674
|
width: "100%",
|
|
6638
6675
|
height: "100%",
|
|
6639
|
-
"background-color":
|
|
6676
|
+
"background-color": fu(e)
|
|
6640
6677
|
}), (e, n) => {
|
|
6641
6678
|
$(t, "style", e, n);
|
|
6642
6679
|
}), t;
|
|
@@ -6644,7 +6681,7 @@ function mu(e) {
|
|
|
6644
6681
|
})), da(() => ({
|
|
6645
6682
|
e: e.id,
|
|
6646
6683
|
t: e.kind,
|
|
6647
|
-
a:
|
|
6684
|
+
a: mu(e)
|
|
6648
6685
|
}), ({ e, t: n, a: r }, i) => {
|
|
6649
6686
|
e !== i?.e && $(t, "data-mesurer-layout-guide", e, i?.e), n !== i?.t && $(t, "data-mesurer-layout-guide-kind", n, i?.t), r !== i?.a && $(t, "style", r, i?.a);
|
|
6650
6687
|
}), t;
|
|
@@ -6657,7 +6694,7 @@ function mu(e) {
|
|
|
6657
6694
|
return da(() => ({
|
|
6658
6695
|
e: e.id,
|
|
6659
6696
|
t: {
|
|
6660
|
-
"background-image": `linear-gradient(to right, ${
|
|
6697
|
+
"background-image": `linear-gradient(to right, ${fu(e)} 1px, transparent 1px), linear-gradient(to bottom, ${fu(e)} 1px, transparent 1px)`,
|
|
6661
6698
|
"background-size": `${e.size}px ${e.size}px`
|
|
6662
6699
|
}
|
|
6663
6700
|
}), ({ e, t: n }, r) => {
|
|
@@ -6669,34 +6706,34 @@ function mu(e) {
|
|
|
6669
6706
|
}
|
|
6670
6707
|
});
|
|
6671
6708
|
}
|
|
6672
|
-
var
|
|
6709
|
+
var gu = "#FF0000", _u = .1, vu = /* @__PURE__ */ new Set([
|
|
6673
6710
|
"columns",
|
|
6674
6711
|
"rows",
|
|
6675
6712
|
"grid"
|
|
6676
|
-
]),
|
|
6713
|
+
]), yu = /* @__PURE__ */ new Set([
|
|
6677
6714
|
"stretch",
|
|
6678
6715
|
"min",
|
|
6679
6716
|
"center",
|
|
6680
6717
|
"max"
|
|
6681
|
-
]),
|
|
6682
|
-
let t = e.kind &&
|
|
6718
|
+
]), bu = (e, t, n) => Math.min(n, Math.max(t, e)), xu = (e, t) => e !== void 0 && Number.isFinite(e) ? e : t, Su = (e = {}) => {
|
|
6719
|
+
let t = e.kind && vu.has(e.kind) ? e.kind : "columns", n = e.align && yu.has(e.align) ? e.align : t === "grid" ? "min" : "stretch", r = e.id?.trim(), i = e.color?.trim();
|
|
6683
6720
|
return {
|
|
6684
6721
|
id: r || No(),
|
|
6685
6722
|
kind: t,
|
|
6686
6723
|
visible: e.visible ?? !0,
|
|
6687
6724
|
color: i || "#FF0000",
|
|
6688
|
-
opacity:
|
|
6689
|
-
count:
|
|
6690
|
-
size:
|
|
6691
|
-
gutter:
|
|
6692
|
-
offset:
|
|
6725
|
+
opacity: bu(xu(e.opacity, _u), 0, 1),
|
|
6726
|
+
count: bu(Math.round(xu(e.count, 5)), 1, 24),
|
|
6727
|
+
size: bu(xu(e.size, 72), 1, 4096),
|
|
6728
|
+
gutter: bu(xu(e.gutter, 20), 0, 800),
|
|
6729
|
+
offset: bu(xu(e.offset, 0), 0, 4096),
|
|
6693
6730
|
align: n
|
|
6694
6731
|
};
|
|
6695
|
-
},
|
|
6732
|
+
}, Cu = (e) => (e ?? []).map(Su), wu = (e) => {
|
|
6696
6733
|
if (e.kind === "grid") return `Grid ${Math.round(e.size)}px`;
|
|
6697
6734
|
let t = e.kind === "columns" ? "columns" : "rows";
|
|
6698
6735
|
return e.align === "stretch" ? `${e.count} ${t}` : `${e.count} ${t} (${Math.round(e.size)}px)`;
|
|
6699
|
-
},
|
|
6736
|
+
}, Tu = (e) => (() => {
|
|
6700
6737
|
var t = X("svg", {
|
|
6701
6738
|
xmlns: "http://www.w3.org/2000/svg",
|
|
6702
6739
|
viewBox: "0 0 24 24",
|
|
@@ -6715,10 +6752,10 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6715
6752
|
}), ({ e, t: n }, r) => {
|
|
6716
6753
|
e !== r?.e && $(t, "width", e, r?.e), n !== r?.t && $(t, "height", n, r?.t);
|
|
6717
6754
|
}), t;
|
|
6718
|
-
})(),
|
|
6755
|
+
})(), Eu = (e) => e.kind === "rows" ? Y(wo, { size: 14 }) : e.kind === "grid" ? Y(So, { size: 14 }) : Y(Co, { size: 14 }), Du = "msr:grid-cols-[78px_minmax(0,1fr)]", Ou = (e) => (() => {
|
|
6719
6756
|
var t = X("label", { class: "msr:col-span-2 msr:grid msr:h-8 msr:w-full msr:grid-cols-[78px_minmax(0,1fr)] msr:items-center msr:gap-0 msr:text-[12px] msr:text-ink-700" }), n = X("span");
|
|
6720
6757
|
return Z(t, n), Q(n, () => e.label), Q(t, () => e.children, null), t;
|
|
6721
|
-
})(),
|
|
6758
|
+
})(), ku = (e) => (() => {
|
|
6722
6759
|
var t = X("span", { class: "msr:relative msr:block msr:w-full" }), n = X("select", {
|
|
6723
6760
|
class: Gs,
|
|
6724
6761
|
onPointerDown: (e) => e.stopPropagation(),
|
|
@@ -6730,7 +6767,7 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6730
6767
|
}), ({ e, t }, r) => {
|
|
6731
6768
|
e !== r?.e && $(n, "aria-label", e, r?.e), t !== r?.t && $(n, "value", t, r?.t);
|
|
6732
6769
|
}), t;
|
|
6733
|
-
})(),
|
|
6770
|
+
})(), Au = (e) => {
|
|
6734
6771
|
let [t, n] = Tr(!1), [r, i] = Tr(String(e.value)), a = () => e.min ?? 0, o = () => e.max ?? 9999, s = (e) => Math.min(o(), Math.max(a(), e)), c = (t) => {
|
|
6735
6772
|
let n = Number(t.replace(/[^\d.-]/g, ""));
|
|
6736
6773
|
if (!Number.isFinite(n)) {
|
|
@@ -6771,7 +6808,7 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6771
6808
|
e !== n?.e && $(a, "aria-label", e, n?.e), t !== n?.t && $(a, "value", t, n?.t);
|
|
6772
6809
|
}), a;
|
|
6773
6810
|
} });
|
|
6774
|
-
},
|
|
6811
|
+
}, ju = (e) => e === "rows" || e === "grid" ? e : "columns", Mu = (e) => e === "min" || e === "center" || e === "max" ? e : "stretch", Nu = (e) => {
|
|
6775
6812
|
let t = wr(() => e.guide.kind === "rows" ? {
|
|
6776
6813
|
stretch: "Stretch",
|
|
6777
6814
|
min: "Top",
|
|
@@ -6788,13 +6825,13 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6788
6825
|
"aria-label": "Back to layout guides",
|
|
6789
6826
|
class: "msr:flex msr:size-6 msr:items-center msr:justify-center msr:rounded-control msr:text-ink-500 msr:outline-none msr:hover:bg-ink-100 msr:hover:text-ink-900"
|
|
6790
6827
|
});
|
|
6791
|
-
return Z(r, i), Z(i, a), Q(i, Y(
|
|
6828
|
+
return Z(r, i), Z(i, a), Q(i, Y(ku, {
|
|
6792
6829
|
label: "Layout guide type",
|
|
6793
6830
|
get value() {
|
|
6794
6831
|
return e.guide.kind;
|
|
6795
6832
|
},
|
|
6796
6833
|
onChange: (t) => {
|
|
6797
|
-
let n =
|
|
6834
|
+
let n = ju(t);
|
|
6798
6835
|
e.onUpdate({
|
|
6799
6836
|
kind: n,
|
|
6800
6837
|
align: n === "grid" ? "min" : e.guide.align === "stretch" || n === e.guide.kind ? e.guide.align : "stretch"
|
|
@@ -6816,15 +6853,15 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6816
6853
|
})()
|
|
6817
6854
|
];
|
|
6818
6855
|
}
|
|
6819
|
-
}), a), Q(a, Y(
|
|
6856
|
+
}), a), Q(a, Y(Tu, {})), Q(r, Y(jr, {
|
|
6820
6857
|
get when() {
|
|
6821
6858
|
return e.guide.kind !== "grid";
|
|
6822
6859
|
},
|
|
6823
6860
|
get children() {
|
|
6824
|
-
return Y(
|
|
6861
|
+
return Y(Ou, {
|
|
6825
6862
|
label: "Count",
|
|
6826
6863
|
get children() {
|
|
6827
|
-
return Y(
|
|
6864
|
+
return Y(Au, {
|
|
6828
6865
|
label: "Count",
|
|
6829
6866
|
get value() {
|
|
6830
6867
|
return e.guide.count;
|
|
@@ -6838,14 +6875,14 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6838
6875
|
}
|
|
6839
6876
|
}), null), Q(r, Y(Js, {
|
|
6840
6877
|
label: "Color",
|
|
6841
|
-
columns:
|
|
6878
|
+
columns: Du,
|
|
6842
6879
|
get value() {
|
|
6843
6880
|
return Ea({
|
|
6844
6881
|
...wa(e.guide.color) ?? wa("#FF0000"),
|
|
6845
6882
|
alpha: e.guide.opacity
|
|
6846
6883
|
});
|
|
6847
6884
|
},
|
|
6848
|
-
fallback:
|
|
6885
|
+
fallback: gu,
|
|
6849
6886
|
get ownerWindow() {
|
|
6850
6887
|
return e.ownerWindow;
|
|
6851
6888
|
},
|
|
@@ -6864,15 +6901,15 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6864
6901
|
return e.guide.kind !== "grid";
|
|
6865
6902
|
},
|
|
6866
6903
|
get children() {
|
|
6867
|
-
return Y(
|
|
6904
|
+
return Y(Ou, {
|
|
6868
6905
|
label: "Type",
|
|
6869
6906
|
get children() {
|
|
6870
|
-
return Y(
|
|
6907
|
+
return Y(ku, {
|
|
6871
6908
|
label: "Alignment",
|
|
6872
6909
|
get value() {
|
|
6873
6910
|
return e.guide.align;
|
|
6874
6911
|
},
|
|
6875
|
-
onChange: (t) => e.onUpdate({ align:
|
|
6912
|
+
onChange: (t) => e.onUpdate({ align: Mu(t) }),
|
|
6876
6913
|
get children() {
|
|
6877
6914
|
return Y(Ar, {
|
|
6878
6915
|
each: [
|
|
@@ -6896,12 +6933,12 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6896
6933
|
return e.guide.kind === "grid" || e.guide.align !== "stretch";
|
|
6897
6934
|
},
|
|
6898
6935
|
get children() {
|
|
6899
|
-
return Y(
|
|
6936
|
+
return Y(Ou, {
|
|
6900
6937
|
get label() {
|
|
6901
6938
|
return n();
|
|
6902
6939
|
},
|
|
6903
6940
|
get children() {
|
|
6904
|
-
return Y(
|
|
6941
|
+
return Y(Au, {
|
|
6905
6942
|
get label() {
|
|
6906
6943
|
return n();
|
|
6907
6944
|
},
|
|
@@ -6920,10 +6957,10 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6920
6957
|
return e.guide.kind !== "grid";
|
|
6921
6958
|
},
|
|
6922
6959
|
get children() {
|
|
6923
|
-
return [Y(
|
|
6960
|
+
return [Y(Ou, {
|
|
6924
6961
|
label: "Offset",
|
|
6925
6962
|
get children() {
|
|
6926
|
-
return Y(
|
|
6963
|
+
return Y(Au, {
|
|
6927
6964
|
label: "Offset",
|
|
6928
6965
|
get value() {
|
|
6929
6966
|
return e.guide.offset;
|
|
@@ -6933,10 +6970,10 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6933
6970
|
onChange: (t) => e.onUpdate({ offset: t })
|
|
6934
6971
|
});
|
|
6935
6972
|
}
|
|
6936
|
-
}), Y(
|
|
6973
|
+
}), Y(Ou, {
|
|
6937
6974
|
label: "Gutter",
|
|
6938
6975
|
get children() {
|
|
6939
|
-
return Y(
|
|
6976
|
+
return Y(Au, {
|
|
6940
6977
|
label: "Gutter",
|
|
6941
6978
|
get value() {
|
|
6942
6979
|
return e.guide.gutter;
|
|
@@ -6952,7 +6989,7 @@ var hu = "#FF0000", gu = .1, _u = /* @__PURE__ */ new Set([
|
|
|
6952
6989
|
$(a, "onClick", e, t);
|
|
6953
6990
|
}), r;
|
|
6954
6991
|
};
|
|
6955
|
-
function
|
|
6992
|
+
function Pu(e) {
|
|
6956
6993
|
let [t, n] = Tr(null), r = wr(() => e.guides.find((e) => e.id === t()) ?? null);
|
|
6957
6994
|
var i = X("div", {
|
|
6958
6995
|
"data-mesurer-layout-guides-panel": "true",
|
|
@@ -7001,9 +7038,9 @@ function Nu(e) {
|
|
|
7001
7038
|
class: "msr:flex msr:size-6 msr:items-center msr:justify-center msr:rounded-control msr:text-ink-400 msr:outline-none msr:hover:bg-ink-100 msr:hover:text-ink-900",
|
|
7002
7039
|
onClick: () => e.onRemove(t.id)
|
|
7003
7040
|
});
|
|
7004
|
-
return Z(r, i), Z(r, s), Z(r, c), Z(i, a), Z(i, o), Q(a, Y(
|
|
7041
|
+
return Z(r, i), Z(r, s), Z(r, c), Z(i, a), Z(i, o), Q(a, Y(Eu, { get kind() {
|
|
7005
7042
|
return t.kind;
|
|
7006
|
-
} })), Q(o, () =>
|
|
7043
|
+
} })), Q(o, () => wu(t)), Q(i, Y(vo, {
|
|
7007
7044
|
size: 8,
|
|
7008
7045
|
class: "msr:block msr:-rotate-90 msr:text-ink-400"
|
|
7009
7046
|
}), null), Q(s, (() => {
|
|
@@ -7013,10 +7050,10 @@ function Nu(e) {
|
|
|
7013
7050
|
size: 10,
|
|
7014
7051
|
class: "msr:block"
|
|
7015
7052
|
})), da(() => ({
|
|
7016
|
-
e: t.visible ? `Hide ${
|
|
7053
|
+
e: t.visible ? `Hide ${wu(t)}` : `Show ${wu(t)}`,
|
|
7017
7054
|
t: t.visible ? "true" : "false",
|
|
7018
7055
|
a: `msr:flex msr:size-6 msr:items-center msr:justify-center msr:rounded-control msr:outline-none msr:hover:bg-ink-100 ${t.visible ? "msr:text-ink-700" : "msr:text-ink-400"}`,
|
|
7019
|
-
o: `Remove ${
|
|
7056
|
+
o: `Remove ${wu(t)}`
|
|
7020
7057
|
}), ({ e, t, a: n, o: r }, i) => {
|
|
7021
7058
|
e !== i?.e && $(s, "aria-label", e, i?.e), t !== i?.t && $(s, "aria-pressed", t, i?.t), n !== i?.a && $(s, "class", n, i?.a), r !== i?.o && $(c, "aria-label", r, i?.o);
|
|
7022
7059
|
}), r;
|
|
@@ -7027,7 +7064,7 @@ function Nu(e) {
|
|
|
7027
7064
|
$(a, "onClick", e, t);
|
|
7028
7065
|
}), t;
|
|
7029
7066
|
},
|
|
7030
|
-
children: (t) => Y(
|
|
7067
|
+
children: (t) => Y(Nu, {
|
|
7031
7068
|
get guide() {
|
|
7032
7069
|
return t();
|
|
7033
7070
|
},
|
|
@@ -7039,56 +7076,56 @@ function Nu(e) {
|
|
|
7039
7076
|
})
|
|
7040
7077
|
})), i;
|
|
7041
7078
|
}
|
|
7042
|
-
var
|
|
7079
|
+
var Fu = "mesurer.layout-guides", Iu = "layout-guides:v1", Lu = "mesurer.layout-guides.pages", Ru = "mesurer.layout-guides.active", zu = "runtime:solid", Bu = "layout-guides.toggle", Vu = "layout-guides.add", Hu = "layout-guides.update", Uu = "layout-guides.remove", Wu = "layout-guides.clear", Gu = 240, Ku = 8, qu = 8, Ju = () => ({ pages: {} }), Yu = (e, t) => e.pages[t] ?? [], Xu = (e) => typeof e == "object" && !!e && !Array.isArray(e), Zu = (e) => typeof e == "string", Qu = (e) => typeof e == "boolean", $u = (e) => typeof e == "number", ed = (e) => e === "columns" || e === "rows" || e === "grid", td = (e) => e === "stretch" || e === "min" || e === "center" || e === "max", nd = (e) => ({ ...e }), rd = (e) => e.map(nd), id = (e) => Xu(e) ? e : null, ad = (e) => {
|
|
7043
7080
|
if (!e) return {};
|
|
7044
7081
|
let t = {};
|
|
7045
|
-
return
|
|
7046
|
-
},
|
|
7082
|
+
return Zu(e.id) && (t.id = e.id), ed(e.kind) && (t.kind = e.kind), Qu(e.visible) && (t.visible = e.visible), Zu(e.color) && (t.color = e.color), $u(e.opacity) && (t.opacity = e.opacity), $u(e.count) && (t.count = e.count), $u(e.size) && (t.size = e.size), $u(e.gutter) && (t.gutter = e.gutter), $u(e.offset) && (t.offset = e.offset), td(e.align) && (t.align = e.align), t;
|
|
7083
|
+
}, od = (e) => {
|
|
7047
7084
|
let t = {};
|
|
7048
7085
|
return e.id !== void 0 && (t.id = e.id), e.kind !== void 0 && (t.kind = e.kind), e.visible !== void 0 && (t.visible = e.visible), e.color !== void 0 && (t.color = e.color), e.opacity !== void 0 && (t.opacity = e.opacity), e.count !== void 0 && (t.count = e.count), e.size !== void 0 && (t.size = e.size), e.gutter !== void 0 && (t.gutter = e.gutter), e.offset !== void 0 && (t.offset = e.offset), e.align !== void 0 && (t.align = e.align), t;
|
|
7049
|
-
},
|
|
7086
|
+
}, sd = {
|
|
7050
7087
|
viewBox: "0 0 256 256",
|
|
7051
7088
|
paths: ["M48 48h160v8H48zM48 200h160v8H48zM48 56h8v144h-8zM200 56h8v144h-8z", "M101 56h8v144h-8zM147 56h8v144h-8z"]
|
|
7052
|
-
},
|
|
7053
|
-
id:
|
|
7089
|
+
}, cd = () => ba({
|
|
7090
|
+
id: Fu,
|
|
7054
7091
|
version: "0.1.0",
|
|
7055
|
-
requires: [
|
|
7056
|
-
provides: [
|
|
7092
|
+
requires: [zu],
|
|
7093
|
+
provides: [Iu, "tool:layout-guides"],
|
|
7057
7094
|
setup(e) {
|
|
7058
|
-
let t = e.service.get(
|
|
7095
|
+
let t = e.service.get(zu);
|
|
7059
7096
|
if (!t) throw Error("Layout Guides requires the Solid renderer runtime.");
|
|
7060
7097
|
let n = t.rendererRoot;
|
|
7061
7098
|
if (!n) throw Error("Layout Guides requires a mounted renderer root.");
|
|
7062
7099
|
e.state.register({
|
|
7063
|
-
id:
|
|
7064
|
-
initial:
|
|
7100
|
+
id: Lu,
|
|
7101
|
+
initial: Ju(),
|
|
7065
7102
|
history: !0,
|
|
7066
7103
|
persist: !0
|
|
7067
7104
|
}), e.state.register({
|
|
7068
|
-
id:
|
|
7105
|
+
id: Ru,
|
|
7069
7106
|
initial: !1
|
|
7070
7107
|
});
|
|
7071
|
-
let r = Wo(t.ownerWindow), i = !1, [a, o] = Tr(0), s = /* @__PURE__ */ new Set(), c = 0, l = () => e.state.get("mesurer.layout-guides.pages") ??
|
|
7072
|
-
e.state.update(
|
|
7108
|
+
let r = Wo(t.ownerWindow), i = !1, [a, o] = Tr(0), s = /* @__PURE__ */ new Set(), c = 0, l = () => e.state.get("mesurer.layout-guides.pages") ?? Ju(), u = () => e.state.get("mesurer.layout-guides.active") ?? !1, d = () => Cu(Yu(l(), r)), f = () => (a(), u() ? d() : []), p = (t) => {
|
|
7109
|
+
e.state.update(Ru, () => t);
|
|
7073
7110
|
}, m = (t) => {
|
|
7074
|
-
e.state.update(
|
|
7111
|
+
e.state.update(Lu, (e) => ({
|
|
7075
7112
|
...e,
|
|
7076
7113
|
pages: {
|
|
7077
7114
|
...e.pages,
|
|
7078
|
-
[r]:
|
|
7115
|
+
[r]: rd(t(Cu(e.pages[r])))
|
|
7079
7116
|
}
|
|
7080
7117
|
}));
|
|
7081
7118
|
};
|
|
7082
|
-
e.command.register(
|
|
7119
|
+
e.command.register(Bu, () => {
|
|
7083
7120
|
let e = !u();
|
|
7084
|
-
return e && d().length === 0 && m(() => [
|
|
7085
|
-
}), e.command.register(Bu, (e) => {
|
|
7086
|
-
let t = xu(id(rd(e)));
|
|
7087
|
-
return m((e) => [...e, t]), { ...t };
|
|
7121
|
+
return e && d().length === 0 && m(() => [Su()]), i = e, p(e), u();
|
|
7088
7122
|
}), e.command.register(Vu, (e) => {
|
|
7089
|
-
let t =
|
|
7123
|
+
let t = Su(ad(id(e)));
|
|
7124
|
+
return m((e) => [...e, t]), { ...t };
|
|
7125
|
+
}), e.command.register(Hu, (e) => {
|
|
7126
|
+
let t = id(e), n = t && Zu(t.id) ? t.id : null, r = ad(id(t?.patch));
|
|
7090
7127
|
if (!n) throw Error("layout-guides.update requires a guide id.");
|
|
7091
|
-
m((e) => e.map((e) => e.id === n ?
|
|
7128
|
+
m((e) => e.map((e) => e.id === n ? Su({
|
|
7092
7129
|
...e,
|
|
7093
7130
|
...r,
|
|
7094
7131
|
id: e.id
|
|
@@ -7096,30 +7133,30 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7096
7133
|
let i = d().find((e) => e.id === n);
|
|
7097
7134
|
if (!i) throw Error(`Layout guide not found: ${n}`);
|
|
7098
7135
|
return { ...i };
|
|
7099
|
-
}), e.command.register(
|
|
7100
|
-
let t =
|
|
7136
|
+
}), e.command.register(Uu, (e) => {
|
|
7137
|
+
let t = id(e), n = t && Zu(t.id) ? t.id : null;
|
|
7101
7138
|
if (!n) throw Error("layout-guides.remove requires a guide id.");
|
|
7102
7139
|
let r = d().length;
|
|
7103
7140
|
return m((e) => e.filter((e) => e.id !== n)), d().length !== r;
|
|
7104
|
-
}), e.command.register(
|
|
7141
|
+
}), e.command.register(Wu, () => {
|
|
7105
7142
|
m(() => []);
|
|
7106
7143
|
});
|
|
7107
7144
|
let h = async (t, n) => {
|
|
7108
|
-
let r =
|
|
7145
|
+
let r = id(await e.command.execute(t, n));
|
|
7109
7146
|
if (!r) throw Error(`${t} did not return a layout guide.`);
|
|
7110
|
-
return
|
|
7147
|
+
return Su(ad(r));
|
|
7111
7148
|
}, g = {
|
|
7112
7149
|
list: () => d().map((e) => ({ ...e })),
|
|
7113
|
-
add: (e = {}) => h(
|
|
7114
|
-
update: (e, t) => h(
|
|
7150
|
+
add: (e = {}) => h(Vu, od(e)),
|
|
7151
|
+
update: (e, t) => h(Hu, {
|
|
7115
7152
|
id: e,
|
|
7116
|
-
patch:
|
|
7153
|
+
patch: od(t)
|
|
7117
7154
|
}),
|
|
7118
7155
|
async remove(t) {
|
|
7119
|
-
return await e.command.execute(
|
|
7156
|
+
return await e.command.execute(Uu, { id: t }) === !0;
|
|
7120
7157
|
},
|
|
7121
7158
|
async clear() {
|
|
7122
|
-
await e.command.execute(
|
|
7159
|
+
await e.command.execute(Wu);
|
|
7123
7160
|
},
|
|
7124
7161
|
subscribe(e) {
|
|
7125
7162
|
s.add(e);
|
|
@@ -7129,27 +7166,27 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7129
7166
|
};
|
|
7130
7167
|
}
|
|
7131
7168
|
};
|
|
7132
|
-
e.service.provide(
|
|
7169
|
+
e.service.provide(Iu, g), e.tool.register({
|
|
7133
7170
|
id: "layout-guides",
|
|
7134
7171
|
label: "Layout guides",
|
|
7135
7172
|
shortcut: "L",
|
|
7136
|
-
command:
|
|
7173
|
+
command: Bu,
|
|
7137
7174
|
order: 38,
|
|
7138
7175
|
toolbarMode: "always",
|
|
7139
7176
|
compactPinned: !0,
|
|
7140
|
-
icon:
|
|
7177
|
+
icon: sd,
|
|
7141
7178
|
active: u
|
|
7142
7179
|
});
|
|
7143
7180
|
let _ = t.ownerDocument.createElement("div");
|
|
7144
7181
|
_.dataset.mesurerLayoutGuidesRoot = "true", _.dataset.mesurerLayer = "evidence", _.style.position = "absolute", _.style.inset = "0", _.style.pointerEvents = "none", n.prepend(_);
|
|
7145
|
-
let v = ua(() => Y(
|
|
7182
|
+
let v = ua(() => Y(hu, { get guides() {
|
|
7146
7183
|
return f();
|
|
7147
7184
|
} }), _), y = t.createInspectorMount();
|
|
7148
7185
|
y.element.dataset.mesurerLayoutGuidesPanelRoot = "true", Object.assign(y.element.style, {
|
|
7149
7186
|
position: "fixed",
|
|
7150
7187
|
left: "0",
|
|
7151
7188
|
top: "0",
|
|
7152
|
-
width: `${
|
|
7189
|
+
width: `${Gu}px`,
|
|
7153
7190
|
zIndex: "100",
|
|
7154
7191
|
pointerEvents: "none",
|
|
7155
7192
|
display: "none"
|
|
@@ -7158,13 +7195,13 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7158
7195
|
if (c = 0, !i) return;
|
|
7159
7196
|
let e = t.portalTarget.querySelector("[data-mesurer-tool-id='layout-guides']");
|
|
7160
7197
|
if (!e) return;
|
|
7161
|
-
let n = e.getBoundingClientRect(), r = Math.min(Math.max(
|
|
7198
|
+
let n = e.getBoundingClientRect(), r = Math.min(Math.max(qu, n.right - Gu), Math.max(qu, t.ownerWindow.innerWidth - Gu - qu)), a = t.ownerWindow.innerHeight - n.bottom - Ku - qu, o = Math.min(320, t.ownerWindow.innerHeight - 16), s = a >= Math.min(o, 320) ? n.bottom + Ku : Math.max(qu, n.top - Ku - o);
|
|
7162
7199
|
y.element.style.left = `${r}px`, y.element.style.top = `${s}px`;
|
|
7163
7200
|
}, x = () => {
|
|
7164
7201
|
c ||= t.ownerWindow.requestAnimationFrame(b);
|
|
7165
7202
|
}, S = () => {
|
|
7166
7203
|
y.element.style.display = i ? "block" : "none", i && x();
|
|
7167
|
-
}, C = ua(() => Y(
|
|
7204
|
+
}, C = ua(() => Y(Pu, {
|
|
7168
7205
|
get guides() {
|
|
7169
7206
|
return f();
|
|
7170
7207
|
},
|
|
@@ -7199,11 +7236,11 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7199
7236
|
t.ownerDocument.removeEventListener("pointerdown", D, !0), t.ownerDocument.removeEventListener("keydown", O, !0), t.ownerWindow.removeEventListener("resize", x), t.ownerWindow.removeEventListener("pointerup", x, !0), c && t.ownerWindow.cancelAnimationFrame(c), c = 0, s.clear(), T.dispose(), E(), C(), y.dispose(), v(), _.remove();
|
|
7200
7237
|
});
|
|
7201
7238
|
}
|
|
7202
|
-
}),
|
|
7239
|
+
}), ld = "mesurer:recording-bridge-ping", ud = "mesurer:recording-bridge-request", dd = "mesurer:recording-bridge-response", fd = "position:fixed;left:0;top:0;width:1px;height:1px;margin:0;padding:0;border:0;overflow:hidden;opacity:0;visibility:hidden;pointer-events:none", pd = .01, md = (e) => ({
|
|
7203
7240
|
width: e.innerWidth,
|
|
7204
7241
|
height: e.innerHeight
|
|
7205
|
-
}),
|
|
7206
|
-
let i = Math.max(1, r.width), a = Math.max(1, r.height), o = t / i, s = n / a, c = Math.abs(o - s) <=
|
|
7242
|
+
}), hd = (e, t, n, r) => {
|
|
7243
|
+
let i = Math.max(1, r.width), a = Math.max(1, r.height), o = t / i, s = n / a, c = Math.abs(o - s) <= pd * Math.max(o, s), l = c ? o : Math.min(o, s), u = c ? 0 : (t - i * l) / 2, d = c ? 0 : (n - a * l) / 2, f = c ? o : l, p = c ? s : l, m = u + e.left * f, h = d + e.top * p, g = u + (e.left + e.width) * f, _ = d + (e.top + e.height) * p, v = Math.max(g - m, 1e-6), y = Math.max(_ - h, 1e-6), b = Math.max(0, Math.min(t, m)), x = Math.max(0, Math.min(n, h)), S = Math.max(0, Math.min(t, g)), C = Math.max(0, Math.min(n, _)), w = Math.max(0, Math.round(b)), T = Math.max(0, Math.round(x)), E = Math.min(t, Math.round(S)), D = Math.min(n, Math.round(C));
|
|
7207
7244
|
return {
|
|
7208
7245
|
sx: w,
|
|
7209
7246
|
sy: T,
|
|
@@ -7214,15 +7251,15 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7214
7251
|
dw: Math.max(0, S - b) / v,
|
|
7215
7252
|
dh: Math.max(0, C - x) / y
|
|
7216
7253
|
};
|
|
7217
|
-
},
|
|
7254
|
+
}, gd = (e, t) => {
|
|
7218
7255
|
let n = e.createElement("div");
|
|
7219
7256
|
return n.dataset.mesurerRecordingCrop = "true", n.setAttribute("aria-hidden", "true"), n.style.position = "fixed", n.style.left = `${t.left}px`, n.style.top = `${t.top}px`, n.style.width = `${t.width}px`, n.style.height = `${t.height}px`, n.style.margin = "0", n.style.padding = "0", n.style.border = "0", n.style.background = "transparent", n.style.opacity = "0", n.style.pointerEvents = "none", e.body.append(n), n;
|
|
7220
|
-
},
|
|
7257
|
+
}, _d = async (e, t) => {
|
|
7221
7258
|
let n = e.cropTo, r = globalThis.CropTarget;
|
|
7222
7259
|
if (!n || !r) return !1;
|
|
7223
7260
|
let i = await r.fromElement(t);
|
|
7224
7261
|
return await n.call(e, i), !0;
|
|
7225
|
-
},
|
|
7262
|
+
}, vd = (e, t) => new Promise((n) => {
|
|
7226
7263
|
let r = !1, i = () => {
|
|
7227
7264
|
r || (r = !0, t.clearTimeout(a), n());
|
|
7228
7265
|
}, a = t.setTimeout(i, 250), o = e;
|
|
@@ -7231,20 +7268,20 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7231
7268
|
return;
|
|
7232
7269
|
}
|
|
7233
7270
|
t.requestAnimationFrame(i);
|
|
7234
|
-
}),
|
|
7271
|
+
}), yd = (e) => e.location.origin === "null" ? "*" : e.location.origin, bd = (e, t, n = "") => `${e}:${t}:${n}`, xd = (e, t, n) => {
|
|
7235
7272
|
let r = `${t}:${n}:`;
|
|
7236
7273
|
return e.startsWith(r) ? e.slice(r.length) : null;
|
|
7237
|
-
},
|
|
7238
|
-
let n =
|
|
7239
|
-
o.source === e && o.origin === r &&
|
|
7274
|
+
}, Sd = (e) => e.crypto?.randomUUID?.() ?? `mesurer-recording-${Date.now()}-${Math.random().toString(36).slice(2)}`, Cd = (e) => new Promise((t) => {
|
|
7275
|
+
let n = Sd(e), r = e.location.origin, i = (o) => {
|
|
7276
|
+
o.source === e && o.origin === r && xd(String(o.data ?? ""), "mesurer:recording-bridge-pong", n) !== null && (e.removeEventListener("message", i), e.clearTimeout(a), t(!0));
|
|
7240
7277
|
}, a = e.setTimeout(() => {
|
|
7241
7278
|
e.removeEventListener("message", i), t(!1);
|
|
7242
7279
|
}, 80);
|
|
7243
|
-
e.addEventListener("message", i), e.postMessage(
|
|
7244
|
-
}),
|
|
7245
|
-
let n =
|
|
7280
|
+
e.addEventListener("message", i), e.postMessage(bd(ld, n), yd(e));
|
|
7281
|
+
}), wd = (e) => new Promise((t) => {
|
|
7282
|
+
let n = Sd(e), r = e.location.origin, i = (o) => {
|
|
7246
7283
|
if (o.source !== e || o.origin !== r) return;
|
|
7247
|
-
let s =
|
|
7284
|
+
let s = xd(String(o.data ?? ""), dd, n);
|
|
7248
7285
|
if (s !== null) {
|
|
7249
7286
|
if (e.removeEventListener("message", i), e.clearTimeout(a), !s.startsWith("ok:")) {
|
|
7250
7287
|
t(null);
|
|
@@ -7255,9 +7292,9 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7255
7292
|
}, a = e.setTimeout(() => {
|
|
7256
7293
|
e.removeEventListener("message", i), t(null);
|
|
7257
7294
|
}, 1500);
|
|
7258
|
-
e.addEventListener("message", i), e.postMessage(
|
|
7259
|
-
}),
|
|
7260
|
-
let n =
|
|
7295
|
+
e.addEventListener("message", i), e.postMessage(bd(ud, n), yd(e));
|
|
7296
|
+
}), Td = (e) => e.__MESURER_RECORDING_HOST__?.captureRecordingStream ?? e.__MESURER_HOST__?.captureRecordingStream, Ed = async (e, t) => {
|
|
7297
|
+
let n = Td(e);
|
|
7261
7298
|
if (!n) throw Error("Native recording capture is unavailable.");
|
|
7262
7299
|
let r = (await n())?.streamId?.trim();
|
|
7263
7300
|
if (!r) throw Error("Native recording capture returned no stream id.");
|
|
@@ -7269,9 +7306,9 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7269
7306
|
audio: !1,
|
|
7270
7307
|
video: i
|
|
7271
7308
|
});
|
|
7272
|
-
},
|
|
7273
|
-
if (!e.isSecureContext || !await
|
|
7274
|
-
let n = await
|
|
7309
|
+
}, Dd = async (e, t) => {
|
|
7310
|
+
if (!e.isSecureContext || !await Cd(e)) return null;
|
|
7311
|
+
let n = await wd(e);
|
|
7275
7312
|
if (!n) return null;
|
|
7276
7313
|
let r = { mandatory: {
|
|
7277
7314
|
chromeMediaSource: "tab",
|
|
@@ -7281,7 +7318,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7281
7318
|
audio: !1,
|
|
7282
7319
|
video: r
|
|
7283
7320
|
});
|
|
7284
|
-
},
|
|
7321
|
+
}, Od = async (e, t) => {
|
|
7285
7322
|
let n = e.getVideoTracks()[0];
|
|
7286
7323
|
if (!n?.applyConstraints) return e;
|
|
7287
7324
|
try {
|
|
@@ -7291,13 +7328,13 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7291
7328
|
} });
|
|
7292
7329
|
} catch {}
|
|
7293
7330
|
return e;
|
|
7294
|
-
},
|
|
7331
|
+
}, kd = async (e, t) => {
|
|
7295
7332
|
let n = e.navigator.mediaDevices;
|
|
7296
7333
|
if (!n) throw Error("Screen recording is unavailable in this browser.");
|
|
7297
|
-
if (
|
|
7334
|
+
if (Td(e)) return Od(await Ed(e, n), t);
|
|
7298
7335
|
try {
|
|
7299
|
-
let r = await
|
|
7300
|
-
if (r) return
|
|
7336
|
+
let r = await Dd(e, n);
|
|
7337
|
+
if (r) return Od(r, t);
|
|
7301
7338
|
} catch {}
|
|
7302
7339
|
if (!n.getDisplayMedia) throw Error("Screen recording is unavailable in this browser.");
|
|
7303
7340
|
let r = {
|
|
@@ -7313,33 +7350,33 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7313
7350
|
selfBrowserSurface: "include"
|
|
7314
7351
|
};
|
|
7315
7352
|
try {
|
|
7316
|
-
return
|
|
7353
|
+
return Od(await n.getDisplayMedia(i), t);
|
|
7317
7354
|
} catch (e) {
|
|
7318
7355
|
if (e instanceof DOMException && e.name === "AbortError") throw e;
|
|
7319
|
-
return
|
|
7356
|
+
return Od(await n.getDisplayMedia({
|
|
7320
7357
|
audio: !1,
|
|
7321
7358
|
video: { frameRate: r }
|
|
7322
7359
|
}), t);
|
|
7323
7360
|
}
|
|
7324
|
-
},
|
|
7325
|
-
let i = await
|
|
7361
|
+
}, Ad = async (e, t, n, r = 60) => {
|
|
7362
|
+
let i = await kd(t, r), a = i.getVideoTracks()[0];
|
|
7326
7363
|
if (!a) throw i.getTracks().forEach((e) => e.stop()), Error("No video track was selected.");
|
|
7327
7364
|
if (a.getSettings().displaySurface && a.getSettings().displaySurface !== "browser") throw i.getTracks().forEach((e) => e.stop()), Error("Select the current browser tab to record this region.");
|
|
7328
7365
|
let o = e.createElement("video");
|
|
7329
|
-
o.autoplay = !0, o.muted = !0, o.playsInline = !0, o.srcObject = i, o.setAttribute("playsinline", ""), o.setAttribute("aria-hidden", "true"), o.style.cssText =
|
|
7366
|
+
o.autoplay = !0, o.muted = !0, o.playsInline = !0, o.srcObject = i, o.setAttribute("playsinline", ""), o.setAttribute("aria-hidden", "true"), o.style.cssText = fd, e.body.append(o);
|
|
7330
7367
|
try {
|
|
7331
7368
|
await o.play(), (o.videoWidth <= 0 || o.videoHeight <= 0) && await new Promise((e, t) => {
|
|
7332
7369
|
o.addEventListener("loadeddata", () => e(), { once: !0 }), o.addEventListener("error", () => t(/* @__PURE__ */ Error("Could not read the selected video track.")), { once: !0 });
|
|
7333
7370
|
});
|
|
7334
|
-
let r =
|
|
7371
|
+
let r = gd(e, n), s = !1;
|
|
7335
7372
|
try {
|
|
7336
|
-
s = await
|
|
7373
|
+
s = await _d(a, r);
|
|
7337
7374
|
} catch {
|
|
7338
7375
|
s = !1;
|
|
7339
7376
|
}
|
|
7340
|
-
s || r.remove(), await
|
|
7341
|
-
let c = t.devicePixelRatio || 1, l =
|
|
7342
|
-
u.width = s ? Math.max(2, Math.round(n.width * c)) : l.sw, u.height = s ? Math.max(2, Math.round(n.height * c)) : l.sh, u.setAttribute("aria-hidden", "true"), u.style.cssText =
|
|
7377
|
+
s || r.remove(), await vd(o, t);
|
|
7378
|
+
let c = t.devicePixelRatio || 1, l = hd(n, o.videoWidth, o.videoHeight, md(t)), u = e.createElement("canvas");
|
|
7379
|
+
u.width = s ? Math.max(2, Math.round(n.width * c)) : l.sw, u.height = s ? Math.max(2, Math.round(n.height * c)) : l.sh, u.setAttribute("aria-hidden", "true"), u.style.cssText = fd, e.body.append(u);
|
|
7343
7380
|
let d = u.getContext("2d", { alpha: !1 });
|
|
7344
7381
|
if (!d) throw u.remove(), Error("Screen recording requires a 2D canvas.");
|
|
7345
7382
|
let f = {
|
|
@@ -7351,32 +7388,32 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7351
7388
|
cropTarget: s ? r : null,
|
|
7352
7389
|
regionLocked: s
|
|
7353
7390
|
};
|
|
7354
|
-
return
|
|
7391
|
+
return jd(f, n, md(t)), f;
|
|
7355
7392
|
} catch (e) {
|
|
7356
7393
|
throw o.pause(), o.srcObject = null, o.remove(), i.getTracks().forEach((e) => e.stop()), e;
|
|
7357
7394
|
}
|
|
7358
|
-
},
|
|
7395
|
+
}, jd = (e, t, n) => {
|
|
7359
7396
|
let { source: r, canvas: i, context: a, regionLocked: o } = e;
|
|
7360
7397
|
if (r.videoWidth <= 0 || r.videoHeight <= 0) return;
|
|
7361
7398
|
if (o) {
|
|
7362
7399
|
a.drawImage(r, 0, 0, i.width, i.height);
|
|
7363
7400
|
return;
|
|
7364
7401
|
}
|
|
7365
|
-
let s =
|
|
7402
|
+
let s = hd(t, r.videoWidth, r.videoHeight, n), c = s.dx <= .001 && s.dy <= .001 && s.dw >= .999 && s.dh >= .999, l = c ? 0 : s.dx * i.width, u = c ? 0 : s.dy * i.height, d = c ? i.width : s.dw * i.width, f = c ? i.height : s.dh * i.height;
|
|
7366
7403
|
c || (a.fillStyle = "#000", a.fillRect(0, 0, i.width, i.height)), !(d < 1 || f < 1 || s.dw <= 0 || s.dh <= 0) && a.drawImage(r, s.sx, s.sy, s.sw, s.sh, l, u, d, f);
|
|
7367
|
-
},
|
|
7404
|
+
}, Md = (e) => {
|
|
7368
7405
|
e.source.pause(), e.source.srcObject = null, e.stream.getTracks().forEach((e) => e.stop()), e.cropTarget?.remove(), e.canvas.remove(), e.source.remove();
|
|
7369
|
-
},
|
|
7406
|
+
}, Nd = {
|
|
7370
7407
|
webm: "video/webm",
|
|
7371
7408
|
mp4: "video/mp4"
|
|
7372
|
-
},
|
|
7373
|
-
let r = Math.max(2, Math.round(
|
|
7409
|
+
}, Pd = ["vp9", "vp8"], Fd = ["avc"], Id = (e) => new c(e), Ld = (e, t) => Number.isFinite(e) && e > 0 ? e : t, Rd = (e, t, n) => {
|
|
7410
|
+
let r = Math.max(2, Math.round(Ld(e, 2))), i = Math.max(2, Math.round(Ld(t, 2)));
|
|
7374
7411
|
return n === "mp4" && (r % 2 != 0 && (r += 1), i % 2 != 0 && (i += 1)), {
|
|
7375
7412
|
width: r,
|
|
7376
7413
|
height: i
|
|
7377
7414
|
};
|
|
7378
|
-
},
|
|
7379
|
-
let n = Math.max(.001,
|
|
7415
|
+
}, zd = (e, t = {}) => {
|
|
7416
|
+
let n = Math.max(.001, Ld(e.duration, .001)), r = Math.min(n, Math.max(0, Number.isFinite(t.startTime) ? t.startTime ?? 0 : 0)), i = Number.isFinite(t.endTime) ? t.endTime ?? n : n, a = Math.min(n, Math.max(r + .001, i));
|
|
7380
7417
|
return {
|
|
7381
7418
|
format: t.format ?? "webm",
|
|
7382
7419
|
startTime: r,
|
|
@@ -7384,33 +7421,33 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7384
7421
|
scale: t.scale ?? 1,
|
|
7385
7422
|
quality: t.quality ?? "medium"
|
|
7386
7423
|
};
|
|
7387
|
-
},
|
|
7388
|
-
let a =
|
|
7389
|
-
for (let t of
|
|
7424
|
+
}, Bd = (e) => e === "webm" ? Pd : Fd, Vd = async (e, t, n, r, i = "medium") => {
|
|
7425
|
+
let a = Rd(t, n, e), o = Id(i);
|
|
7426
|
+
for (let t of Bd(e)) if (await u(t, {
|
|
7390
7427
|
width: a.width,
|
|
7391
7428
|
height: a.height,
|
|
7392
7429
|
frameRate: r,
|
|
7393
7430
|
quality: o
|
|
7394
7431
|
})) return t;
|
|
7395
7432
|
return null;
|
|
7396
|
-
},
|
|
7433
|
+
}, Hd = async (e, t, n = 30) => {
|
|
7397
7434
|
let r = [];
|
|
7398
|
-
return await
|
|
7399
|
-
},
|
|
7400
|
-
let i = t.format ?? "webm", a = Math.max(1, Math.min(120, Math.round(t.frameRate ?? 30))), o = t.quality ?? "medium", c = e.width, l = e.height, u = await
|
|
7435
|
+
return await Vd("webm", e, t, n) && r.push("webm"), await Vd("mp4", e, t, n) && r.push("mp4"), r;
|
|
7436
|
+
}, Ud = (e) => e === "webm" ? new l() : new o(), Wd = async (e, t = {}) => {
|
|
7437
|
+
let i = t.format ?? "webm", a = Math.max(1, Math.min(120, Math.round(t.frameRate ?? 30))), o = t.quality ?? "medium", c = e.width, l = e.height, u = await Vd(i, c, l, a, o);
|
|
7401
7438
|
if (!u) throw Error(`MediaBunny cannot encode ${i.toUpperCase()} at ${c}×${l} in this runtime.`);
|
|
7402
7439
|
let d = new n(), f = new s({
|
|
7403
|
-
format:
|
|
7440
|
+
format: Ud(i),
|
|
7404
7441
|
target: d
|
|
7405
7442
|
}), p = new r(e, {
|
|
7406
7443
|
codec: u,
|
|
7407
|
-
quality:
|
|
7444
|
+
quality: Id(o)
|
|
7408
7445
|
});
|
|
7409
7446
|
f.addVideoTrack(p, { frameRate: a }), await f.start();
|
|
7410
7447
|
let m = !1, h = -1;
|
|
7411
7448
|
return {
|
|
7412
7449
|
format: i,
|
|
7413
|
-
mimeType:
|
|
7450
|
+
mimeType: Nd[i],
|
|
7414
7451
|
codec: u,
|
|
7415
7452
|
async addFrame(e, t = 1 / a) {
|
|
7416
7453
|
if (m) throw Error("Recording session is already closed.");
|
|
@@ -7422,7 +7459,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7422
7459
|
finalize: async () => {
|
|
7423
7460
|
if (m) throw Error("Recording session is already closed.");
|
|
7424
7461
|
if (m = !0, p.close(), await f.finalize(), !d.buffer || d.buffer.byteLength === 0) throw Error("MediaBunny produced an empty recording.");
|
|
7425
|
-
return new Blob([d.buffer], { type:
|
|
7462
|
+
return new Blob([d.buffer], { type: Nd[i] });
|
|
7426
7463
|
},
|
|
7427
7464
|
async cancel() {
|
|
7428
7465
|
if (!m) {
|
|
@@ -7433,7 +7470,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7433
7470
|
}
|
|
7434
7471
|
}
|
|
7435
7472
|
};
|
|
7436
|
-
},
|
|
7473
|
+
}, Gd = async (n) => {
|
|
7437
7474
|
let r = new a({
|
|
7438
7475
|
source: new t(n),
|
|
7439
7476
|
formats: e
|
|
@@ -7455,14 +7492,14 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7455
7492
|
} finally {
|
|
7456
7493
|
r.dispose();
|
|
7457
7494
|
}
|
|
7458
|
-
},
|
|
7459
|
-
let c = await
|
|
7495
|
+
}, Kd = async (r, o = {}) => {
|
|
7496
|
+
let c = await Gd(r), l = zd(c, o), u = Rd(c.width * l.scale, c.height * l.scale, l.format), d = await Vd(l.format, u.width, u.height, 30, l.quality);
|
|
7460
7497
|
if (!d) throw Error(`MediaBunny cannot export ${l.format.toUpperCase()} in this runtime.`);
|
|
7461
7498
|
let f = new a({
|
|
7462
7499
|
source: new t(r),
|
|
7463
7500
|
formats: e
|
|
7464
7501
|
}), p = new n(), m = new s({
|
|
7465
|
-
format:
|
|
7502
|
+
format: Ud(l.format),
|
|
7466
7503
|
target: p
|
|
7467
7504
|
});
|
|
7468
7505
|
try {
|
|
@@ -7478,14 +7515,14 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7478
7515
|
width: u.width,
|
|
7479
7516
|
height: u.height,
|
|
7480
7517
|
fit: "fill",
|
|
7481
|
-
quality:
|
|
7518
|
+
quality: Id(l.quality),
|
|
7482
7519
|
forceTranscode: !0
|
|
7483
7520
|
},
|
|
7484
7521
|
audio: { discard: !0 }
|
|
7485
7522
|
});
|
|
7486
7523
|
if (!e.isValid) throw Error(`MediaBunny cannot convert this recording to ${l.format.toUpperCase()}.`);
|
|
7487
7524
|
if (await e.execute(), !p.buffer || p.buffer.byteLength === 0) throw Error("MediaBunny produced an empty export.");
|
|
7488
|
-
let t = new Blob([p.buffer], { type:
|
|
7525
|
+
let t = new Blob([p.buffer], { type: Nd[l.format] }), n = await Gd(t);
|
|
7489
7526
|
return {
|
|
7490
7527
|
blob: t,
|
|
7491
7528
|
format: l.format,
|
|
@@ -7496,11 +7533,11 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7496
7533
|
} finally {
|
|
7497
7534
|
f.dispose();
|
|
7498
7535
|
}
|
|
7499
|
-
},
|
|
7536
|
+
}, qd = (e, t = /* @__PURE__ */ new Date()) => `mesurer-recording-${t.toISOString().replace(/[:.]/g, "-")}.${e}`, Jd = 10, Yd = (e, t) => {
|
|
7500
7537
|
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
7501
|
-
},
|
|
7538
|
+
}, Xd = (e, t, n) => {
|
|
7502
7539
|
let r = e.createElement("button");
|
|
7503
|
-
return r.type = "button", r.setAttribute("aria-label", t), r.title = t, r.textContent = n,
|
|
7540
|
+
return r.type = "button", r.setAttribute("aria-label", t), r.title = t, r.textContent = n, Yd(r, {
|
|
7504
7541
|
display: "inline-flex",
|
|
7505
7542
|
width: "20px",
|
|
7506
7543
|
height: "20px",
|
|
@@ -7516,9 +7553,9 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7516
7553
|
"line-height": "1",
|
|
7517
7554
|
cursor: "pointer"
|
|
7518
7555
|
}), r;
|
|
7519
|
-
},
|
|
7556
|
+
}, Zd = (e, t) => {
|
|
7520
7557
|
let n = e.createElement("button");
|
|
7521
|
-
n.type = "button", n.setAttribute("role", "menuitemradio"),
|
|
7558
|
+
n.type = "button", n.setAttribute("role", "menuitemradio"), Yd(n, {
|
|
7522
7559
|
display: "grid",
|
|
7523
7560
|
width: "100%",
|
|
7524
7561
|
height: "28px",
|
|
@@ -7543,9 +7580,9 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7543
7580
|
check: r,
|
|
7544
7581
|
text: i
|
|
7545
7582
|
};
|
|
7546
|
-
},
|
|
7583
|
+
}, Qd = ({ ownerDocument: e, root: t }) => {
|
|
7547
7584
|
let n = e.createElement("section");
|
|
7548
|
-
n.dataset.mesurerRecordingPreview = "true", n.dataset.mesurerInspectorUi = "true", n.setAttribute("role", "dialog"), n.setAttribute("aria-label", "Screen recording editor"), n.tabIndex = 0,
|
|
7585
|
+
n.dataset.mesurerRecordingPreview = "true", n.dataset.mesurerInspectorUi = "true", n.setAttribute("role", "dialog"), n.setAttribute("aria-label", "Screen recording editor"), n.tabIndex = 0, Yd(n, {
|
|
7549
7586
|
position: "fixed",
|
|
7550
7587
|
display: "none",
|
|
7551
7588
|
width: "352px",
|
|
@@ -7566,7 +7603,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7566
7603
|
transition: "width 200ms ease"
|
|
7567
7604
|
}), t.append(n);
|
|
7568
7605
|
let r = e.createElement("div");
|
|
7569
|
-
|
|
7606
|
+
Yd(r, {
|
|
7570
7607
|
position: "relative",
|
|
7571
7608
|
display: "flex",
|
|
7572
7609
|
width: "100%",
|
|
@@ -7581,7 +7618,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7581
7618
|
cursor: "default"
|
|
7582
7619
|
}), n.append(r);
|
|
7583
7620
|
let i = e.createElement("video");
|
|
7584
|
-
i.muted = !0, i.playsInline = !0, i.preload = "auto",
|
|
7621
|
+
i.muted = !0, i.playsInline = !0, i.preload = "auto", Yd(i, {
|
|
7585
7622
|
display: "block",
|
|
7586
7623
|
width: "100%",
|
|
7587
7624
|
height: "100%",
|
|
@@ -7591,7 +7628,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7591
7628
|
transition: "max-height 200ms ease"
|
|
7592
7629
|
}), r.append(i);
|
|
7593
7630
|
let a = e.createElement("div");
|
|
7594
|
-
a.dataset.mesurerRecordingExporting = "true", a.textContent = "Exporting…",
|
|
7631
|
+
a.dataset.mesurerRecordingExporting = "true", a.textContent = "Exporting…", Yd(a, {
|
|
7595
7632
|
position: "absolute",
|
|
7596
7633
|
inset: "0",
|
|
7597
7634
|
display: "none",
|
|
@@ -7603,8 +7640,8 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7603
7640
|
"font-size": "11px",
|
|
7604
7641
|
"pointer-events": "none"
|
|
7605
7642
|
}), r.append(a);
|
|
7606
|
-
let o =
|
|
7607
|
-
o.dataset.mesurerRecordingDiscard = "true",
|
|
7643
|
+
let o = Xd(e, "Close", "×");
|
|
7644
|
+
o.dataset.mesurerRecordingDiscard = "true", Yd(o, {
|
|
7608
7645
|
position: "absolute",
|
|
7609
7646
|
top: "6px",
|
|
7610
7647
|
right: "6px",
|
|
@@ -7626,17 +7663,17 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7626
7663
|
o.style.opacity = "0", o.style.pointerEvents = "none";
|
|
7627
7664
|
});
|
|
7628
7665
|
let s = e.createElement("div");
|
|
7629
|
-
|
|
7666
|
+
Yd(s, {
|
|
7630
7667
|
display: "flex",
|
|
7631
7668
|
height: "28px",
|
|
7632
7669
|
"align-items": "center",
|
|
7633
7670
|
gap: "8px",
|
|
7634
7671
|
"margin-top": "8px"
|
|
7635
7672
|
}), n.append(s);
|
|
7636
|
-
let c =
|
|
7673
|
+
let c = Xd(e, "Play", "▶");
|
|
7637
7674
|
c.dataset.mesurerRecordingPlay = "true", s.append(c);
|
|
7638
7675
|
let l = e.createElement("span");
|
|
7639
|
-
l.dataset.mesurerRecordingCurrentTime = "true", l.textContent = "0:00.00",
|
|
7676
|
+
l.dataset.mesurerRecordingCurrentTime = "true", l.textContent = "0:00.00", Yd(l, {
|
|
7640
7677
|
display: "flex",
|
|
7641
7678
|
width: "8ch",
|
|
7642
7679
|
"min-width": "8ch",
|
|
@@ -7650,7 +7687,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7650
7687
|
"white-space": "nowrap"
|
|
7651
7688
|
}), s.append(l);
|
|
7652
7689
|
let u = e.createElement("div");
|
|
7653
|
-
u.dataset.mesurerRecordingTimeline = "true",
|
|
7690
|
+
u.dataset.mesurerRecordingTimeline = "true", Yd(u, {
|
|
7654
7691
|
position: "relative",
|
|
7655
7692
|
height: "28px",
|
|
7656
7693
|
"min-width": "0",
|
|
@@ -7659,15 +7696,15 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7659
7696
|
"user-select": "none"
|
|
7660
7697
|
}), s.append(u);
|
|
7661
7698
|
let d = e.createElement("div");
|
|
7662
|
-
d.dataset.mesurerRecordingTimelineTrack = "true",
|
|
7699
|
+
d.dataset.mesurerRecordingTimelineTrack = "true", Yd(d, {
|
|
7663
7700
|
position: "absolute",
|
|
7664
|
-
left: `${
|
|
7665
|
-
right: `${
|
|
7701
|
+
left: `${Jd}px`,
|
|
7702
|
+
right: `${Jd}px`,
|
|
7666
7703
|
top: "0",
|
|
7667
7704
|
bottom: "0"
|
|
7668
7705
|
}), u.append(d);
|
|
7669
7706
|
let f = e.createElement("div");
|
|
7670
|
-
f.dataset.mesurerRecordingTimelineRail = "true",
|
|
7707
|
+
f.dataset.mesurerRecordingTimelineRail = "true", Yd(f, {
|
|
7671
7708
|
position: "absolute",
|
|
7672
7709
|
left: "0",
|
|
7673
7710
|
right: "0",
|
|
@@ -7679,7 +7716,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7679
7716
|
"pointer-events": "none"
|
|
7680
7717
|
}), d.append(f);
|
|
7681
7718
|
let p = e.createElement("div");
|
|
7682
|
-
p.dataset.mesurerRecordingTimelineClip = "true",
|
|
7719
|
+
p.dataset.mesurerRecordingTimelineClip = "true", Yd(p, {
|
|
7683
7720
|
position: "absolute",
|
|
7684
7721
|
top: "21px",
|
|
7685
7722
|
height: "3px",
|
|
@@ -7689,7 +7726,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7689
7726
|
"pointer-events": "none"
|
|
7690
7727
|
}), d.append(p);
|
|
7691
7728
|
let m = e.createElement("div");
|
|
7692
|
-
|
|
7729
|
+
Yd(m, {
|
|
7693
7730
|
position: "absolute",
|
|
7694
7731
|
display: "none",
|
|
7695
7732
|
top: "21px",
|
|
@@ -7702,7 +7739,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7702
7739
|
"pointer-events": "none"
|
|
7703
7740
|
}), d.append(m);
|
|
7704
7741
|
let h = e.createElement("div");
|
|
7705
|
-
h.dataset.mesurerRecordingPlayhead = "true",
|
|
7742
|
+
h.dataset.mesurerRecordingPlayhead = "true", Yd(h, {
|
|
7706
7743
|
position: "absolute",
|
|
7707
7744
|
top: "21px",
|
|
7708
7745
|
left: "0",
|
|
@@ -7717,7 +7754,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7717
7754
|
}), d.append(h);
|
|
7718
7755
|
let g = (t, n) => {
|
|
7719
7756
|
let r = e.createElement("button");
|
|
7720
|
-
r.type = "button", r.dataset.mesurerRecordingTrimHandle = t, r.setAttribute("role", "slider"), r.setAttribute("aria-label", n), r.setAttribute("aria-valuemin", "0"),
|
|
7757
|
+
r.type = "button", r.dataset.mesurerRecordingTrimHandle = t, r.setAttribute("role", "slider"), r.setAttribute("aria-label", n), r.setAttribute("aria-valuemin", "0"), Yd(r, {
|
|
7721
7758
|
position: "absolute",
|
|
7722
7759
|
top: "0",
|
|
7723
7760
|
display: "flex",
|
|
@@ -7740,7 +7777,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7740
7777
|
let a = e.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
7741
7778
|
a.setAttribute("d", t === "start" ? "M3.5 2.5L8.5 7L3.5 11.5" : "M8.5 2.5L3.5 7L8.5 11.5"), a.setAttribute("fill", "none"), a.setAttribute("stroke", "currentColor"), a.setAttribute("stroke-width", "2"), a.setAttribute("stroke-linecap", "round"), a.setAttribute("stroke-linejoin", "round"), i.append(a), r.append(i);
|
|
7742
7779
|
let o = e.createElement("span");
|
|
7743
|
-
return o.setAttribute("aria-hidden", "true"),
|
|
7780
|
+
return o.setAttribute("aria-hidden", "true"), Yd(o, {
|
|
7744
7781
|
position: "absolute",
|
|
7745
7782
|
left: "50%",
|
|
7746
7783
|
top: "15px",
|
|
@@ -7751,7 +7788,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7751
7788
|
"pointer-events": "none"
|
|
7752
7789
|
}), r.append(o), d.append(r), r;
|
|
7753
7790
|
}, _ = g("start", "Trim start"), v = g("end", "Trim end"), y = e.createElement("span");
|
|
7754
|
-
y.dataset.mesurerRecordingDuration = "true",
|
|
7791
|
+
y.dataset.mesurerRecordingDuration = "true", Yd(y, {
|
|
7755
7792
|
display: "flex",
|
|
7756
7793
|
width: "8ch",
|
|
7757
7794
|
"min-width": "8ch",
|
|
@@ -7766,20 +7803,20 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7766
7803
|
"white-space": "nowrap"
|
|
7767
7804
|
}), s.append(y);
|
|
7768
7805
|
let b = e.createElement("div");
|
|
7769
|
-
|
|
7806
|
+
Yd(b, {
|
|
7770
7807
|
position: "relative",
|
|
7771
7808
|
display: "flex",
|
|
7772
7809
|
height: "20px",
|
|
7773
7810
|
"align-items": "center"
|
|
7774
7811
|
}), s.append(b);
|
|
7775
|
-
let x =
|
|
7776
|
-
x.dataset.mesurerRecordingExportOptions = "true", x.setAttribute("aria-haspopup", "menu"), x.setAttribute("aria-expanded", "false"),
|
|
7812
|
+
let x = Xd(e, "Export options", "1×");
|
|
7813
|
+
x.dataset.mesurerRecordingExportOptions = "true", x.setAttribute("aria-haspopup", "menu"), x.setAttribute("aria-expanded", "false"), Yd(x, {
|
|
7777
7814
|
width: "28px",
|
|
7778
7815
|
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
7779
7816
|
"font-size": "10px"
|
|
7780
7817
|
}), b.append(x);
|
|
7781
7818
|
let S = e.createElement("div");
|
|
7782
|
-
S.dataset.mesurerRecordingExportMenu = "true", S.setAttribute("role", "menu"),
|
|
7819
|
+
S.dataset.mesurerRecordingExportMenu = "true", S.setAttribute("role", "menu"), Yd(S, {
|
|
7783
7820
|
position: "absolute",
|
|
7784
7821
|
display: "none",
|
|
7785
7822
|
right: "0",
|
|
@@ -7795,7 +7832,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7795
7832
|
"pointer-events": "auto"
|
|
7796
7833
|
}), b.append(S);
|
|
7797
7834
|
let C = e.createElement("p");
|
|
7798
|
-
C.textContent = "Format",
|
|
7835
|
+
C.textContent = "Format", Yd(C, {
|
|
7799
7836
|
margin: "0",
|
|
7800
7837
|
padding: "4px 8px",
|
|
7801
7838
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
@@ -7805,7 +7842,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7805
7842
|
let w = e.createElement("div");
|
|
7806
7843
|
S.append(w);
|
|
7807
7844
|
let T = e.createElement("p");
|
|
7808
|
-
T.textContent = "Size",
|
|
7845
|
+
T.textContent = "Size", Yd(T, {
|
|
7809
7846
|
margin: "0",
|
|
7810
7847
|
padding: "6px 8px 4px",
|
|
7811
7848
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
@@ -7819,17 +7856,17 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7819
7856
|
2,
|
|
7820
7857
|
3
|
|
7821
7858
|
].map((t) => {
|
|
7822
|
-
let n =
|
|
7859
|
+
let n = Zd(e, `${t}×`);
|
|
7823
7860
|
return n.button.dataset.mesurerRecordingScale = String(t), E.append(n.button), {
|
|
7824
7861
|
scale: t,
|
|
7825
7862
|
...n
|
|
7826
7863
|
};
|
|
7827
|
-
}), O =
|
|
7864
|
+
}), O = Xd(e, "Download", "↓");
|
|
7828
7865
|
O.dataset.mesurerRecordingExport = "true", s.append(O);
|
|
7829
|
-
let k =
|
|
7866
|
+
let k = Xd(e, "Grow preview", "↗");
|
|
7830
7867
|
k.dataset.mesurerRecordingExpand = "true", s.append(k);
|
|
7831
7868
|
let A = e.createElement("p");
|
|
7832
|
-
return A.dataset.mesurerRecordingPreviewStatus = "true", A.setAttribute("role", "status"),
|
|
7869
|
+
return A.dataset.mesurerRecordingPreviewStatus = "true", A.setAttribute("role", "status"), Yd(A, {
|
|
7833
7870
|
display: "none",
|
|
7834
7871
|
margin: "8px 0 0",
|
|
7835
7872
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
@@ -7860,14 +7897,14 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7860
7897
|
expand: k,
|
|
7861
7898
|
status: A
|
|
7862
7899
|
};
|
|
7863
|
-
},
|
|
7900
|
+
}, $d = 8, ef = 8, tf = .05, nf = 200, rf = (e) => {
|
|
7864
7901
|
let t = Number.isFinite(e) ? Math.max(0, e) : 0, n = Math.floor(t / 60);
|
|
7865
7902
|
return `${n}:${(t - n * 60).toFixed(2).padStart(5, "0")}`;
|
|
7866
|
-
},
|
|
7903
|
+
}, af = (e, t, n, r) => {
|
|
7867
7904
|
let i = globalThis.URL.createObjectURL(e), a = n.createElement("a");
|
|
7868
7905
|
a.href = i, a.download = t, a.rel = "noopener", n.documentElement.append(a), a.click(), a.remove(), r.setTimeout(() => globalThis.URL.revokeObjectURL(i), 1e3);
|
|
7869
|
-
},
|
|
7870
|
-
let { panel: o, previewShell: s, video: c, exportingOverlay: l, close: u, play: d, currentTime: f, timeline: p, track: m, clip: h, hoverMarker: g, playhead: _, trimStart: v, trimEnd: y, durationLabel: b, exportAnchor: x, exportOptions: S, exportMenu: C, formatRows: w, scaleRows: T, download: E, expand: D, status: O } =
|
|
7906
|
+
}, of = ({ ownerDocument: e, ownerWindow: t, root: n, formats: r, onDiscard: i, onExport: a }) => {
|
|
7907
|
+
let { panel: o, previewShell: s, video: c, exportingOverlay: l, close: u, play: d, currentTime: f, timeline: p, track: m, clip: h, hoverMarker: g, playhead: _, trimStart: v, trimEnd: y, durationLabel: b, exportAnchor: x, exportOptions: S, exportMenu: C, formatRows: w, scaleRows: T, download: E, expand: D, status: O } = Qd({
|
|
7871
7908
|
ownerDocument: e,
|
|
7872
7909
|
root: n
|
|
7873
7910
|
}), k = null, A = null, j = !1, M = !1, N = 0, P = ["webm"], F = "webm", I = 1, L = 0, R = 0, z = null, B = null, V = null, H = (e) => {
|
|
@@ -7881,15 +7918,15 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7881
7918
|
return t <= 0 || n.width <= 0 ? 0 : Math.min(t, Math.max(0, (e - n.left) / n.width * t));
|
|
7882
7919
|
}, W = () => {
|
|
7883
7920
|
let e = k?.duration ?? 0, t = Math.min(e, Math.max(0, c.currentTime || 0)), n = H(L) * 100, r = H(R) * 100;
|
|
7884
|
-
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 -
|
|
7921
|
+
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 - tf))), v.setAttribute("aria-valuenow", String(L)), v.setAttribute("aria-valuetext", rf(L)), y.setAttribute("aria-valuemin", String(Math.min(e, L + tf))), y.setAttribute("aria-valuemax", String(e)), y.setAttribute("aria-valuenow", String(R)), y.setAttribute("aria-valuetext", rf(R)), f.textContent = rf(t), b.textContent = rf(e);
|
|
7885
7922
|
}, te = (e, t = !0) => {
|
|
7886
7923
|
if (!k) return;
|
|
7887
7924
|
let n = Math.min(R, Math.max(L, e));
|
|
7888
7925
|
t && !c.paused && c.pause(), c.currentTime = n, W();
|
|
7889
7926
|
}, ne = (e, t = !1) => {
|
|
7890
|
-
k && (L = Math.min(Math.max(0, e), Math.max(0, R -
|
|
7927
|
+
k && (L = Math.min(Math.max(0, e), Math.max(0, R - tf)), (t || c.currentTime < L) && te(L), W());
|
|
7891
7928
|
}, G = (e, t = !1) => {
|
|
7892
|
-
k && (R = Math.max(Math.min(k.duration, e), Math.min(k.duration, L +
|
|
7929
|
+
k && (R = Math.max(Math.min(k.duration, e), Math.min(k.duration, L + tf)), t ? te(R) : c.currentTime > R && te(L), W());
|
|
7893
7930
|
}, re = () => {
|
|
7894
7931
|
S.textContent = `${I}×`;
|
|
7895
7932
|
for (let e of T) {
|
|
@@ -7899,14 +7936,14 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7899
7936
|
}, K = () => {
|
|
7900
7937
|
w.replaceChildren();
|
|
7901
7938
|
for (let t of P) {
|
|
7902
|
-
let n =
|
|
7939
|
+
let n = Zd(e, t === "mp4" ? "MP4" : "WebM"), r = t === F;
|
|
7903
7940
|
n.button.dataset.mesurerRecordingFormat = t, n.button.setAttribute("aria-checked", r ? "true" : "false"), n.check.style.opacity = r ? "1" : "0", n.button.addEventListener("click", () => {
|
|
7904
7941
|
F = t, K();
|
|
7905
7942
|
}), w.append(n.button);
|
|
7906
7943
|
}
|
|
7907
7944
|
}, ie = () => {
|
|
7908
7945
|
if (C.style.display === "none") return;
|
|
7909
|
-
let e = x.getBoundingClientRect(), n = Math.max(1, C.offsetHeight), r = e.top -
|
|
7946
|
+
let e = x.getBoundingClientRect(), n = Math.max(1, C.offsetHeight), r = e.top - $d, i = t.innerHeight - e.bottom - $d;
|
|
7910
7947
|
r >= n || r >= i ? (C.style.top = "auto", C.style.bottom = "24px") : (C.style.top = "24px", C.style.bottom = "auto");
|
|
7911
7948
|
}, ae = (e) => {
|
|
7912
7949
|
C.style.display = e ? "block" : "none", S.setAttribute("aria-expanded", e ? "true" : "false"), e && ie();
|
|
@@ -7924,8 +7961,8 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7924
7961
|
]) t.toggleAttribute("disabled", e);
|
|
7925
7962
|
}, se = () => n.closest("[data-mesurer-root='true']")?.querySelector("[data-mesurer-tool-id='recording']") ?? e.querySelector("[data-mesurer-tool-id='recording']"), ce = () => {
|
|
7926
7963
|
if (o.style.display === "none") return;
|
|
7927
|
-
let e = Math.min(j ? 576 : 352, Math.max(1, t.innerWidth - 16)), n = Math.max(180, o.offsetHeight), r = se()?.getBoundingClientRect(), i = r ? r.left + r.width / 2 : t.innerWidth -
|
|
7928
|
-
l + n > t.innerHeight -
|
|
7964
|
+
let e = Math.min(j ? 576 : 352, Math.max(1, t.innerWidth - 16)), n = Math.max(180, o.offsetHeight), r = se()?.getBoundingClientRect(), i = r ? r.left + r.width / 2 : t.innerWidth - $d - e / 2, a = $d + e / 2, s = Math.max(a, t.innerWidth - $d - e / 2), c = Math.min(Math.max(a, i), s), l = r ? r.bottom + ef : $d;
|
|
7965
|
+
l + n > t.innerHeight - $d && (l = r ? r.top - n - ef : t.innerHeight - n - $d), o.style.left = `${c}px`, o.style.top = `${Math.max($d, l)}px`, C.style.display !== "none" && ie();
|
|
7929
7966
|
}, q = () => {
|
|
7930
7967
|
c.pause(), c.removeAttribute("src"), c.load(), A &&= (globalThis.URL.revokeObjectURL(A), null);
|
|
7931
7968
|
}, le = () => {
|
|
@@ -7941,7 +7978,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
7941
7978
|
transform: "scale(0.08)",
|
|
7942
7979
|
opacity: 0
|
|
7943
7980
|
}], {
|
|
7944
|
-
duration:
|
|
7981
|
+
duration: nf,
|
|
7945
7982
|
easing: "ease",
|
|
7946
7983
|
fill: "forwards"
|
|
7947
7984
|
});
|
|
@@ -8016,7 +8053,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8016
8053
|
endTime: i,
|
|
8017
8054
|
scale: I
|
|
8018
8055
|
}).then((r) => {
|
|
8019
|
-
n === N &&
|
|
8056
|
+
n === N && af(r.blob, r.filename, e, t);
|
|
8020
8057
|
}).catch((e) => {
|
|
8021
8058
|
n === N && (O.style.display = "block", O.style.color = "var(--msr-danger-text, #dc2626)", O.textContent = e instanceof Error ? e.message : "Could not export the recording.");
|
|
8022
8059
|
}).finally(() => {
|
|
@@ -8038,7 +8075,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8038
8075
|
show(e) {
|
|
8039
8076
|
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"), q(), k = e, j = !1, I = 1, F = "webm", P = ["webm"], L = 0, R = e.duration, z = null, B = null;
|
|
8040
8077
|
let n = globalThis.URL.createObjectURL(e.blob);
|
|
8041
|
-
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 =
|
|
8078
|
+
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 = rf(e.duration), O.style.display = "none", O.style.color = "var(--msr-color-ink-500, #64748b)", ae(!1), K(), re(), W(), oe(!1), o.style.display = "block", ce(), o.focus({ preventScroll: !0 });
|
|
8042
8079
|
let i = N;
|
|
8043
8080
|
r(e).then((e) => {
|
|
8044
8081
|
i !== N || !k || (P = e, F = e.includes(F) ? F : e[0] ?? "webm", K(), 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."));
|
|
@@ -8051,11 +8088,11 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8051
8088
|
le(), t.removeEventListener("resize", ve), t.removeEventListener("pointermove", he, !0), t.removeEventListener("pointerup", ge, !0), t.removeEventListener("pointercancel", ge, !0), e.removeEventListener("pointerdown", _e, !0), o.remove();
|
|
8052
8089
|
}
|
|
8053
8090
|
};
|
|
8054
|
-
},
|
|
8091
|
+
}, sf = 3e3, cf = (e, t) => {
|
|
8055
8092
|
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
8056
|
-
},
|
|
8093
|
+
}, lf = ({ ownerDocument: e, ownerWindow: t, root: n, statusRoot: r, rendererRoot: i, isSelecting: a, isRecording: o, onRectChange: s, onConfirm: c, onCancel: l, onStop: u, setRecordingInteractionActive: d }) => {
|
|
8057
8094
|
let f = e.createElement("div");
|
|
8058
|
-
f.dataset.mesurerRecordingSelect = "true", f.dataset.mesurerInspectorUi = "true", f.setAttribute("role", "application"), f.setAttribute("aria-label", "Recording selection"),
|
|
8095
|
+
f.dataset.mesurerRecordingSelect = "true", f.dataset.mesurerInspectorUi = "true", f.setAttribute("role", "application"), f.setAttribute("aria-label", "Recording selection"), cf(f, {
|
|
8059
8096
|
position: "fixed",
|
|
8060
8097
|
inset: "0",
|
|
8061
8098
|
display: "none",
|
|
@@ -8067,13 +8104,13 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8067
8104
|
}), n.append(f);
|
|
8068
8105
|
let p = Array.from({ length: 4 }, () => {
|
|
8069
8106
|
let t = e.createElement("div");
|
|
8070
|
-
return t.dataset.mesurerRecordingShade = "true",
|
|
8107
|
+
return t.dataset.mesurerRecordingShade = "true", cf(t, {
|
|
8071
8108
|
position: "fixed",
|
|
8072
8109
|
background: "rgb(0 0 0 / 40%)",
|
|
8073
8110
|
"pointer-events": "none"
|
|
8074
8111
|
}), f.append(t), t;
|
|
8075
8112
|
}), m = e.createElement("div");
|
|
8076
|
-
m.dataset.mesurerRecordingMask = "true",
|
|
8113
|
+
m.dataset.mesurerRecordingMask = "true", cf(m, {
|
|
8077
8114
|
position: "fixed",
|
|
8078
8115
|
display: "none",
|
|
8079
8116
|
background: "transparent",
|
|
@@ -8083,7 +8120,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8083
8120
|
"pointer-events": "none"
|
|
8084
8121
|
}), f.append(m);
|
|
8085
8122
|
let h = e.createElement("div");
|
|
8086
|
-
h.dataset.mesurerRecordingSelection = "true",
|
|
8123
|
+
h.dataset.mesurerRecordingSelection = "true", cf(h, {
|
|
8087
8124
|
position: "fixed",
|
|
8088
8125
|
display: "none",
|
|
8089
8126
|
border: "1px solid var(--msr-accent, #0d99ff)",
|
|
@@ -8091,7 +8128,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8091
8128
|
"pointer-events": "none"
|
|
8092
8129
|
}), f.append(h);
|
|
8093
8130
|
let g = e.createElement("div");
|
|
8094
|
-
|
|
8131
|
+
cf(g, {
|
|
8095
8132
|
position: "fixed",
|
|
8096
8133
|
display: "none",
|
|
8097
8134
|
transform: "translateX(-50%)",
|
|
@@ -8104,7 +8141,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8104
8141
|
"pointer-events": "none"
|
|
8105
8142
|
}), f.append(g);
|
|
8106
8143
|
let _ = e.createElement("div");
|
|
8107
|
-
_.textContent = "Drag a region to record · Esc to cancel",
|
|
8144
|
+
_.textContent = "Drag a region to record · Esc to cancel", cf(_, {
|
|
8108
8145
|
position: "fixed",
|
|
8109
8146
|
left: "50%",
|
|
8110
8147
|
bottom: "16px",
|
|
@@ -8117,7 +8154,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8117
8154
|
"pointer-events": "none"
|
|
8118
8155
|
}), f.append(_);
|
|
8119
8156
|
let v = e.createElement("div");
|
|
8120
|
-
v.dataset.mesurerRecordingRegion = "true", v.dataset.mesurerInspectorUi = "true", v.setAttribute("role", "dialog"), v.setAttribute("aria-label", "Recording region"),
|
|
8157
|
+
v.dataset.mesurerRecordingRegion = "true", v.dataset.mesurerInspectorUi = "true", v.setAttribute("role", "dialog"), v.setAttribute("aria-label", "Recording region"), cf(v, {
|
|
8121
8158
|
position: "fixed",
|
|
8122
8159
|
display: "none",
|
|
8123
8160
|
width: "220px",
|
|
@@ -8135,7 +8172,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8135
8172
|
}), f.append(v);
|
|
8136
8173
|
let y = (t) => {
|
|
8137
8174
|
let n = e.createElement("label");
|
|
8138
|
-
|
|
8175
|
+
cf(n, {
|
|
8139
8176
|
display: "grid",
|
|
8140
8177
|
"grid-template-columns": "44px minmax(0,1fr)",
|
|
8141
8178
|
"align-items": "center",
|
|
@@ -8144,7 +8181,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8144
8181
|
let r = e.createElement("span");
|
|
8145
8182
|
r.textContent = t, r.style.color = "var(--msr-color-ink-500, #64748b)", n.append(r);
|
|
8146
8183
|
let i = e.createElement("div");
|
|
8147
|
-
return
|
|
8184
|
+
return cf(i, {
|
|
8148
8185
|
display: "flex",
|
|
8149
8186
|
"align-items": "center",
|
|
8150
8187
|
gap: "4px",
|
|
@@ -8152,7 +8189,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8152
8189
|
}), n.append(i), v.append(n), i;
|
|
8153
8190
|
}, b = (t) => {
|
|
8154
8191
|
let n = e.createElement("input");
|
|
8155
|
-
return n.type = "number", n.setAttribute("aria-label", t), n.step = "1",
|
|
8192
|
+
return n.type = "number", n.setAttribute("aria-label", t), n.step = "1", cf(n, {
|
|
8156
8193
|
width: "0",
|
|
8157
8194
|
"min-width": "0",
|
|
8158
8195
|
flex: "1 1 0",
|
|
@@ -8179,7 +8216,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8179
8216
|
let k = e.createElement("span");
|
|
8180
8217
|
k.textContent = "px", k.style.color = "var(--msr-color-ink-500, #64748b)", E.append(k);
|
|
8181
8218
|
let A = e.createElement("button");
|
|
8182
|
-
A.type = "button", A.dataset.mesurerRecordingStart = "true", A.textContent = "● Start recording",
|
|
8219
|
+
A.type = "button", A.dataset.mesurerRecordingStart = "true", A.textContent = "● Start recording", cf(A, {
|
|
8183
8220
|
width: "100%",
|
|
8184
8221
|
height: "28px",
|
|
8185
8222
|
"margin-top": "8px",
|
|
@@ -8193,7 +8230,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8193
8230
|
cursor: "pointer"
|
|
8194
8231
|
}), v.append(A);
|
|
8195
8232
|
let j = e.createElement("div");
|
|
8196
|
-
j.dataset.mesurerRecordingGrid = "true",
|
|
8233
|
+
j.dataset.mesurerRecordingGrid = "true", cf(j, {
|
|
8197
8234
|
position: "absolute",
|
|
8198
8235
|
inset: "0",
|
|
8199
8236
|
display: "none",
|
|
@@ -8201,7 +8238,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8201
8238
|
}), h.append(j);
|
|
8202
8239
|
let M = (t) => {
|
|
8203
8240
|
let n = e.createElement("div");
|
|
8204
|
-
|
|
8241
|
+
cf(n, {
|
|
8205
8242
|
position: "absolute",
|
|
8206
8243
|
opacity: "0.3",
|
|
8207
8244
|
...t
|
|
@@ -8263,7 +8300,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8263
8300
|
}
|
|
8264
8301
|
}).map(([t, n]) => {
|
|
8265
8302
|
let r = e.createElement("button");
|
|
8266
|
-
return r.type = "button", r.dataset.mesurerRecordingResize = t, r.setAttribute("aria-label", `Resize ${t}`),
|
|
8303
|
+
return r.type = "button", r.dataset.mesurerRecordingResize = t, r.setAttribute("aria-label", `Resize ${t}`), cf(r, {
|
|
8267
8304
|
position: "absolute",
|
|
8268
8305
|
display: "none",
|
|
8269
8306
|
left: n.left,
|
|
@@ -8280,7 +8317,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8280
8317
|
"pointer-events": "auto"
|
|
8281
8318
|
}), h.append(r), r;
|
|
8282
8319
|
}), P = e.createElement("section");
|
|
8283
|
-
P.dataset.mesurerRecordingStatus = "true", P.dataset.mesurerInspectorUi = "true", P.setAttribute("aria-label", "Screen recording"),
|
|
8320
|
+
P.dataset.mesurerRecordingStatus = "true", P.dataset.mesurerInspectorUi = "true", P.setAttribute("aria-label", "Screen recording"), cf(P, {
|
|
8284
8321
|
position: "fixed",
|
|
8285
8322
|
display: "none",
|
|
8286
8323
|
height: "34px",
|
|
@@ -8297,7 +8334,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8297
8334
|
"pointer-events": "auto"
|
|
8298
8335
|
});
|
|
8299
8336
|
let F = e.createElement("span");
|
|
8300
|
-
F.setAttribute("aria-hidden", "true"),
|
|
8337
|
+
F.setAttribute("aria-hidden", "true"), cf(F, {
|
|
8301
8338
|
width: "6px",
|
|
8302
8339
|
height: "6px",
|
|
8303
8340
|
"border-radius": "999px",
|
|
@@ -8305,14 +8342,14 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8305
8342
|
"flex-shrink": "0"
|
|
8306
8343
|
}), P.append(F);
|
|
8307
8344
|
let I = e.createElement("span");
|
|
8308
|
-
I.dataset.mesurerRecordingTime = "true", I.textContent = "00:00",
|
|
8345
|
+
I.dataset.mesurerRecordingTime = "true", I.textContent = "00:00", cf(I, {
|
|
8309
8346
|
color: "var(--msr-content, #18181b)",
|
|
8310
8347
|
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
8311
8348
|
"font-size": "11px",
|
|
8312
8349
|
"font-variant-numeric": "tabular-nums"
|
|
8313
8350
|
}), P.append(I);
|
|
8314
8351
|
let L = e.createElement("button");
|
|
8315
|
-
L.type = "button", L.dataset.mesurerRecordingStop = "true", L.textContent = "Stop", L.setAttribute("aria-label", "Stop recording"),
|
|
8352
|
+
L.type = "button", L.dataset.mesurerRecordingStop = "true", L.textContent = "Stop", L.setAttribute("aria-label", "Stop recording"), cf(L, {
|
|
8316
8353
|
height: "24px",
|
|
8317
8354
|
padding: "0 8px",
|
|
8318
8355
|
border: "0",
|
|
@@ -8325,7 +8362,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8325
8362
|
cursor: "pointer"
|
|
8326
8363
|
}), P.append(L), r.append(P);
|
|
8327
8364
|
let R = e.createElement("div");
|
|
8328
|
-
R.dataset.mesurerRecordingError = "true", R.dataset.mesurerInspectorUi = "true", R.setAttribute("role", "status"),
|
|
8365
|
+
R.dataset.mesurerRecordingError = "true", R.dataset.mesurerInspectorUi = "true", R.setAttribute("role", "status"), cf(R, {
|
|
8329
8366
|
position: "fixed",
|
|
8330
8367
|
display: "none",
|
|
8331
8368
|
left: "8px",
|
|
@@ -8446,7 +8483,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8446
8483
|
let n = e instanceof Error ? e.message : "Could not record this region.";
|
|
8447
8484
|
R.textContent = n, R.style.display = "block", ee = t.setTimeout(() => {
|
|
8448
8485
|
ee = 0, R.style.display = "none";
|
|
8449
|
-
},
|
|
8486
|
+
}, sf);
|
|
8450
8487
|
}, q = (e, t, n) => {
|
|
8451
8488
|
let r = B;
|
|
8452
8489
|
!V || !r || e.button !== 0 || (e.preventDefault(), e.stopPropagation(), H = {
|
|
@@ -8576,7 +8613,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8576
8613
|
f.removeEventListener("pointerdown", le), f.removeEventListener("pointermove", ue), f.removeEventListener("pointerup", de), f.removeEventListener("pointercancel", fe), t.removeEventListener("keydown", pe, !0), ee && t.clearTimeout(ee), ae();
|
|
8577
8614
|
}
|
|
8578
8615
|
};
|
|
8579
|
-
},
|
|
8616
|
+
}, uf = (e) => {
|
|
8580
8617
|
let t = null, n = () => {
|
|
8581
8618
|
let e = t;
|
|
8582
8619
|
e && (t = null, e.pointerEvents || e.pointerEventsPriority ? e.element.style.setProperty("pointer-events", e.pointerEvents, e.pointerEventsPriority) : e.element.style.removeProperty("pointer-events"), e.cursor || e.cursorPriority ? e.element.style.setProperty("cursor", e.cursor, e.cursorPriority) : e.element.style.removeProperty("cursor"));
|
|
@@ -8595,19 +8632,19 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8595
8632
|
cursorPriority: i.style.getPropertyPriority("cursor")
|
|
8596
8633
|
}), i.style.setProperty("pointer-events", "none", "important"), i.style.setProperty("cursor", "default", "important"));
|
|
8597
8634
|
} };
|
|
8598
|
-
},
|
|
8635
|
+
}, df = "mesurer.recording", ff = "recording:v1", pf = "mesurer.recording.settings", mf = "runtime:solid", hf = "recording.toggle", gf = "recording.stop", _f = "recording.discard", vf = "recording.export", yf = 60, bf = 60, xf = {
|
|
8599
8636
|
viewBox: "0 0 24 24",
|
|
8600
8637
|
paths: ["M7 5.75A3.25 3.25 0 0 0 3.75 9v6A3.25 3.25 0 0 0 7 18.25h7A3.25 3.25 0 0 0 17.25 15v-1.03l2.13 1.42a.75.75 0 0 0 1.17-.624V9.234a.75.75 0 0 0-1.17-.624l-2.13 1.42V9A3.25 3.25 0 0 0 14 5.75H7Zm10.25 6.082 1.8-1.2v2.736l-1.8-1.2v-.336Z", "M10.5 9.25a2.75 2.75 0 1 0 0 5.5 2.75 2.75 0 0 0 0-5.5Z"]
|
|
8601
|
-
},
|
|
8638
|
+
}, Sf = (e) => e ? { ...e } : null, Cf = (e) => ({
|
|
8602
8639
|
...e,
|
|
8603
|
-
rect:
|
|
8604
|
-
}),
|
|
8640
|
+
rect: Sf(e.rect)
|
|
8641
|
+
}), wf = (e, t) => {
|
|
8605
8642
|
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
8606
|
-
},
|
|
8607
|
-
if (!
|
|
8643
|
+
}, Tf = (e) => e != null && !Array.isArray(e) && typeof e == "object", Ef = (e) => typeof e == "number" && Number.isFinite(e), Df = (e) => {
|
|
8644
|
+
if (!Tf(e)) return {};
|
|
8608
8645
|
let t = {};
|
|
8609
|
-
return (e.format === "webm" || e.format === "mp4") && (t.format = e.format),
|
|
8610
|
-
},
|
|
8646
|
+
return (e.format === "webm" || e.format === "mp4") && (t.format = e.format), Ef(e.startTime) && (t.startTime = e.startTime), Ef(e.endTime) && (t.endTime = e.endTime), (e.scale === 1 || e.scale === 2 || e.scale === 3) && (t.scale = e.scale), t;
|
|
8647
|
+
}, Of = (e) => ({
|
|
8611
8648
|
status: e.status,
|
|
8612
8649
|
elapsed: e.elapsed,
|
|
8613
8650
|
rect: e.rect ? { ...e.rect } : null,
|
|
@@ -8615,62 +8652,62 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8615
8652
|
width: e.width,
|
|
8616
8653
|
height: e.height,
|
|
8617
8654
|
error: e.error
|
|
8618
|
-
}),
|
|
8655
|
+
}), kf = (e) => ({
|
|
8619
8656
|
filename: e.filename,
|
|
8620
8657
|
format: e.format,
|
|
8621
8658
|
duration: e.duration,
|
|
8622
8659
|
width: e.width,
|
|
8623
8660
|
height: e.height,
|
|
8624
8661
|
bytes: e.blob.size
|
|
8625
|
-
}),
|
|
8662
|
+
}), Af = (e) => ({
|
|
8626
8663
|
format: e.format,
|
|
8627
8664
|
duration: e.duration,
|
|
8628
8665
|
width: e.width,
|
|
8629
8666
|
height: e.height,
|
|
8630
8667
|
bytes: e.blob.size,
|
|
8631
8668
|
createdAt: e.createdAt
|
|
8632
|
-
}),
|
|
8669
|
+
}), jf = (e, t, n) => {
|
|
8633
8670
|
let r = globalThis.URL.createObjectURL(e.blob), i = t.createElement("a");
|
|
8634
8671
|
i.href = r, i.download = e.filename, i.rel = "noopener", t.documentElement.append(i), i.click(), i.remove(), n.setTimeout(() => globalThis.URL.revokeObjectURL(r), 1e3);
|
|
8635
|
-
},
|
|
8636
|
-
id:
|
|
8672
|
+
}, Mf = (e = {}) => ba({
|
|
8673
|
+
id: df,
|
|
8637
8674
|
version: "0.1.0",
|
|
8638
|
-
requires: [
|
|
8639
|
-
provides: ["tool:recording",
|
|
8675
|
+
requires: [mf],
|
|
8676
|
+
provides: ["tool:recording", ff],
|
|
8640
8677
|
setup(t) {
|
|
8641
|
-
let n = t.service.get(
|
|
8678
|
+
let n = t.service.get(mf);
|
|
8642
8679
|
if (!n) throw Error("Recording plugin requires the Solid renderer runtime.");
|
|
8643
|
-
let { ownerDocument: r, ownerWindow: i } = n, a = n.createInspectorMount(), o = a.element, s = n.createInspectorMount(), c = s.element, l = n.rendererRoot ?? n.portalTarget.querySelector("[data-mesurer-root='true']"), u =
|
|
8644
|
-
o.dataset.mesurerRecording = "true", c.dataset.mesurerRecordingStatusRoot = "true",
|
|
8680
|
+
let { ownerDocument: r, ownerWindow: i } = n, a = n.createInspectorMount(), o = a.element, s = n.createInspectorMount(), c = s.element, l = n.rendererRoot ?? n.portalTarget.querySelector("[data-mesurer-root='true']"), u = uf(l);
|
|
8681
|
+
o.dataset.mesurerRecording = "true", c.dataset.mesurerRecordingStatusRoot = "true", wf(o, {
|
|
8645
8682
|
position: "fixed",
|
|
8646
8683
|
inset: "0",
|
|
8647
8684
|
"z-index": "86",
|
|
8648
8685
|
"pointer-events": "none",
|
|
8649
8686
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
8650
|
-
}),
|
|
8687
|
+
}), wf(c, {
|
|
8651
8688
|
position: "fixed",
|
|
8652
8689
|
inset: "0",
|
|
8653
8690
|
"z-index": "96",
|
|
8654
8691
|
"pointer-events": "none",
|
|
8655
8692
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
8656
8693
|
});
|
|
8657
|
-
let d = Math.max(1, Math.min(600, e.maxDurationSeconds ??
|
|
8694
|
+
let d = Math.max(1, Math.min(600, e.maxDurationSeconds ?? bf)), f = e.quality ?? "medium";
|
|
8658
8695
|
t.state.register({
|
|
8659
|
-
id:
|
|
8696
|
+
id: pf,
|
|
8660
8697
|
initial: {
|
|
8661
8698
|
toolEnabled: e.toolEnabled ?? !0,
|
|
8662
|
-
frameRate: e.frameRate ??
|
|
8699
|
+
frameRate: e.frameRate ?? yf
|
|
8663
8700
|
},
|
|
8664
8701
|
persist: !0
|
|
8665
8702
|
});
|
|
8666
8703
|
let p = () => {
|
|
8667
|
-
let e = t.state.get(
|
|
8704
|
+
let e = t.state.get(pf);
|
|
8668
8705
|
return {
|
|
8669
8706
|
toolEnabled: e?.toolEnabled ?? !0,
|
|
8670
8707
|
frameRate: e?.frameRate === 120 ? 120 : 60
|
|
8671
8708
|
};
|
|
8672
8709
|
}, m = (e) => {
|
|
8673
|
-
t.state.update(
|
|
8710
|
+
t.state.update(pf, (t) => {
|
|
8674
8711
|
let n = { ...t };
|
|
8675
8712
|
return e.toolEnabled !== void 0 && (n.toolEnabled = e.toolEnabled), (e.frameRate === 60 || e.frameRate === 120) && (n.frameRate = e.frameRate), n;
|
|
8676
8713
|
});
|
|
@@ -8683,13 +8720,13 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8683
8720
|
height: null,
|
|
8684
8721
|
error: null
|
|
8685
8722
|
}, g = /* @__PURE__ */ new Set(), _ = null, v = null, y = null, b = null, x, S = null, C = 0, w = 0, T = 0, E = 0, D = -1, O = !1, k = null, A = () => {
|
|
8686
|
-
let e =
|
|
8723
|
+
let e = Cf(h);
|
|
8687
8724
|
for (let t of g) t(e);
|
|
8688
8725
|
}, j = (e) => {
|
|
8689
8726
|
h = {
|
|
8690
8727
|
...h,
|
|
8691
8728
|
...e,
|
|
8692
|
-
rect: e.rect === void 0 ? h.rect :
|
|
8729
|
+
rect: e.rect === void 0 ? h.rect : Sf(e.rect)
|
|
8693
8730
|
}, A();
|
|
8694
8731
|
}, M = () => h.status === "selecting" || h.status === "recording" || h.status === "exporting", N = () => {
|
|
8695
8732
|
if (S) return;
|
|
@@ -8712,7 +8749,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8712
8749
|
let n = y;
|
|
8713
8750
|
y = null, e && await n?.cancel();
|
|
8714
8751
|
let r = v;
|
|
8715
|
-
v = null, r &&
|
|
8752
|
+
v = null, r && Md(r), x.hideRecordingMask(), x.hideRecordingStatus();
|
|
8716
8753
|
}, I = () => {
|
|
8717
8754
|
_ = null, z.dismiss(), j({
|
|
8718
8755
|
status: "idle",
|
|
@@ -8725,7 +8762,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8725
8762
|
}), t.hook.emit("recording:discard", {});
|
|
8726
8763
|
}, L = async () => {
|
|
8727
8764
|
let e = _;
|
|
8728
|
-
return
|
|
8765
|
+
return Hd(e?.width ?? Math.max(2, Math.round(i.innerWidth)), e?.height ?? Math.max(2, Math.round(i.innerHeight)), p().frameRate);
|
|
8729
8766
|
}, R = async (e = {}) => {
|
|
8730
8767
|
let n = _;
|
|
8731
8768
|
if (!n) throw Error("No recording is ready to export.");
|
|
@@ -8735,9 +8772,9 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8735
8772
|
error: null
|
|
8736
8773
|
});
|
|
8737
8774
|
try {
|
|
8738
|
-
let r = await
|
|
8775
|
+
let r = await Kd(n.blob, e), i = {
|
|
8739
8776
|
...r,
|
|
8740
|
-
filename:
|
|
8777
|
+
filename: qd(r.format)
|
|
8741
8778
|
};
|
|
8742
8779
|
return j({
|
|
8743
8780
|
status: "ready",
|
|
@@ -8759,7 +8796,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8759
8796
|
error: e instanceof Error ? e.message : "Could not export the recording."
|
|
8760
8797
|
}), e;
|
|
8761
8798
|
}
|
|
8762
|
-
}, z =
|
|
8799
|
+
}, z = of({
|
|
8763
8800
|
ownerDocument: r,
|
|
8764
8801
|
ownerWindow: i,
|
|
8765
8802
|
root: o,
|
|
@@ -8769,15 +8806,15 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8769
8806
|
}), B = async () => {
|
|
8770
8807
|
if (k) return k;
|
|
8771
8808
|
if (h.status !== "recording" || !y || !v) throw Error("No recording is active.");
|
|
8772
|
-
let e = T, n = y, r = v, a =
|
|
8809
|
+
let e = T, n = y, r = v, a = Sf(h.rect);
|
|
8773
8810
|
if (!a) throw Error("Recording region is unavailable.");
|
|
8774
8811
|
return k = (async () => {
|
|
8775
8812
|
C && i.cancelAnimationFrame(C), C = 0, w && i.clearTimeout(w), w = 0;
|
|
8776
8813
|
let s = b;
|
|
8777
8814
|
b = null, s && await s;
|
|
8778
8815
|
let c = await n.finalize();
|
|
8779
|
-
if (y = null, v = null,
|
|
8780
|
-
let l = await
|
|
8816
|
+
if (y = null, v = null, Md(r), T !== e || O) throw Error("Recording was cancelled.");
|
|
8817
|
+
let l = await Gd(c), u = {
|
|
8781
8818
|
blob: c,
|
|
8782
8819
|
format: "webm",
|
|
8783
8820
|
duration: l.duration,
|
|
@@ -8817,12 +8854,12 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8817
8854
|
let s = Math.max(0, (r - E) / 1e3);
|
|
8818
8855
|
j({ elapsed: s }), x.setRecordingTime(`${String(Math.floor(s / 60)).padStart(2, "0")}:${String(Math.floor(s % 60)).padStart(2, "0")}`);
|
|
8819
8856
|
let c = s;
|
|
8820
|
-
!b && c - D >= a * .8 && (
|
|
8857
|
+
!b && c - D >= a * .8 && (jd(e, h.rect ?? {
|
|
8821
8858
|
left: 0,
|
|
8822
8859
|
top: 0,
|
|
8823
8860
|
width: i.innerWidth,
|
|
8824
8861
|
height: i.innerHeight
|
|
8825
|
-
},
|
|
8862
|
+
}, md(i)), D = c, b = t.addFrame(c, a).catch((e) => {
|
|
8826
8863
|
throw T === n && !O && F(!0).then(() => {
|
|
8827
8864
|
P();
|
|
8828
8865
|
let t = e instanceof Error ? e.message : "MediaBunny could not encode the recording.";
|
|
@@ -8848,21 +8885,21 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8848
8885
|
error: null
|
|
8849
8886
|
}), x.setRecordingTime("00:00"), x.placeRecordingStatus(e);
|
|
8850
8887
|
try {
|
|
8851
|
-
let s = await
|
|
8888
|
+
let s = await Ad(r, i, e, a);
|
|
8852
8889
|
if (O || T !== n) {
|
|
8853
|
-
|
|
8890
|
+
Md(s);
|
|
8854
8891
|
return;
|
|
8855
8892
|
}
|
|
8856
|
-
let c = await
|
|
8893
|
+
let c = await Wd(s.canvas, {
|
|
8857
8894
|
format: "webm",
|
|
8858
8895
|
frameRate: a,
|
|
8859
8896
|
quality: f
|
|
8860
8897
|
});
|
|
8861
8898
|
if (O || T !== n) {
|
|
8862
|
-
await c.cancel(),
|
|
8899
|
+
await c.cancel(), Md(s);
|
|
8863
8900
|
return;
|
|
8864
8901
|
}
|
|
8865
|
-
if (v = s, y = c, E = i.performance.now(), D = 0,
|
|
8902
|
+
if (v = s, y = c, E = i.performance.now(), D = 0, jd(s, e, md(i)), await c.addFrame(0, 1 / a), O || T !== n) {
|
|
8866
8903
|
await F(!0);
|
|
8867
8904
|
return;
|
|
8868
8905
|
}
|
|
@@ -8923,7 +8960,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8923
8960
|
error: null
|
|
8924
8961
|
});
|
|
8925
8962
|
};
|
|
8926
|
-
x =
|
|
8963
|
+
x = lf({
|
|
8927
8964
|
ownerDocument: r,
|
|
8928
8965
|
ownerWindow: i,
|
|
8929
8966
|
root: o,
|
|
@@ -8940,7 +8977,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8940
8977
|
setRecordingInteractionActive: u.setActive
|
|
8941
8978
|
});
|
|
8942
8979
|
let te = {
|
|
8943
|
-
snapshot: () =>
|
|
8980
|
+
snapshot: () => Cf(h),
|
|
8944
8981
|
subscribe(e) {
|
|
8945
8982
|
return g.add(e), () => g.delete(e);
|
|
8946
8983
|
},
|
|
@@ -8958,10 +8995,10 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
8958
8995
|
label: "Record",
|
|
8959
8996
|
shortcut: "Shift+R",
|
|
8960
8997
|
order: 72,
|
|
8961
|
-
command:
|
|
8998
|
+
command: hf,
|
|
8962
8999
|
toolbarMode: "select",
|
|
8963
9000
|
compactPinned: !0,
|
|
8964
|
-
icon:
|
|
9001
|
+
icon: xf,
|
|
8965
9002
|
active: M,
|
|
8966
9003
|
hidden: () => !p().toolEnabled,
|
|
8967
9004
|
menu: {
|
|
@@ -9011,21 +9048,21 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9011
9048
|
m({ frameRate: e ? 120 : 60 });
|
|
9012
9049
|
}
|
|
9013
9050
|
}]
|
|
9014
|
-
}), t.command.register(
|
|
9015
|
-
let t = await R(
|
|
9016
|
-
return
|
|
9017
|
-
}), t.service.provide(
|
|
9051
|
+
}), t.command.register(hf, async () => (await U(), Of(h))), t.command.register(gf, async () => Af(await B())), t.command.register(_f, () => (I(), Of(h))), t.command.register(vf, async (e) => {
|
|
9052
|
+
let t = await R(Df(e));
|
|
9053
|
+
return jf(t, r, i), kf(t);
|
|
9054
|
+
}), t.service.provide(ff, te), t.lifecycle.onDispose(() => {
|
|
9018
9055
|
O = !0, ++T, g.clear(), z.dispose(), x.dispose(), P(), F(!0), s.dispose(), a.dispose();
|
|
9019
9056
|
});
|
|
9020
9057
|
}
|
|
9021
|
-
}),
|
|
9058
|
+
}), Nf = 144, Pf = 96, Ff = 8, If = 4, Lf = 1800, Rf = 200, zf = (e, t) => {
|
|
9022
9059
|
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
9023
|
-
},
|
|
9024
|
-
left: Math.min(Math.max(
|
|
9025
|
-
top: Math.min(Math.max(
|
|
9026
|
-
}),
|
|
9060
|
+
}, Bf = (e, t) => ({
|
|
9061
|
+
left: Math.min(Math.max(Ff, e.left), Math.max(Ff, t.innerWidth - Nf - Ff)),
|
|
9062
|
+
top: Math.min(Math.max(Ff, e.top), Math.max(Ff, t.innerHeight - Pf - Ff))
|
|
9063
|
+
}), Vf = (e, t) => {
|
|
9027
9064
|
let n = e.createElement("button");
|
|
9028
|
-
return n.type = "button", n.textContent = t,
|
|
9065
|
+
return n.type = "button", n.textContent = t, zf(n, {
|
|
9029
9066
|
height: "32px",
|
|
9030
9067
|
padding: "0 12px",
|
|
9031
9068
|
border: "1px solid rgb(255 255 255 / 18%)",
|
|
@@ -9037,11 +9074,11 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9037
9074
|
"font-weight": "500",
|
|
9038
9075
|
cursor: "pointer"
|
|
9039
9076
|
}), n;
|
|
9040
|
-
},
|
|
9077
|
+
}, Hf = ({ copied: e, downloaded: t, copyFailed: n, downloadFailed: r }) => e && t ? "Copied and saved screenshot" : e && r ? "Copied screenshot · Save unavailable" : t && n ? "Saved screenshot · Copy unavailable" : e ? "Copied screenshot" : t ? "Saved screenshot" : n && r ? "Screenshot captured · Copy and save unavailable" : n ? "Screenshot captured · Copy unavailable" : r ? "Screenshot captured · Save unavailable" : "Screenshot captured", Uf = (e) => e !== null && (e.nodeType === 1 || e.nodeType === 11), Wf = ({ ownerDocument: e, ownerWindow: t, root: n, previewDurationMs: r }) => {
|
|
9041
9078
|
let i = n.closest("[data-mesurer-root='true']") ?? n.parentNode;
|
|
9042
|
-
if (!
|
|
9079
|
+
if (!Uf(i)) throw Error("Screenshot preview requires a mounted Mesurer host.");
|
|
9043
9080
|
let a = e.createElement("div");
|
|
9044
|
-
a.dataset.mesurerInspectorUi = "true", a.dataset.mesurerScreenshotInteractive = "true",
|
|
9081
|
+
a.dataset.mesurerInspectorUi = "true", a.dataset.mesurerScreenshotInteractive = "true", zf(a, {
|
|
9045
9082
|
position: "fixed",
|
|
9046
9083
|
left: "0",
|
|
9047
9084
|
top: "0",
|
|
@@ -9053,12 +9090,12 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9053
9090
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
9054
9091
|
}), i.append(a);
|
|
9055
9092
|
let o = e.createElement("div");
|
|
9056
|
-
o.dataset.mesurerScreenshotPreview = "true", o.setAttribute("role", "button"), o.setAttribute("aria-label", "Open captured screenshot"), o.tabIndex = 0,
|
|
9093
|
+
o.dataset.mesurerScreenshotPreview = "true", o.setAttribute("role", "button"), o.setAttribute("aria-label", "Open captured screenshot"), o.tabIndex = 0, zf(o, {
|
|
9057
9094
|
position: "fixed",
|
|
9058
9095
|
display: "none",
|
|
9059
9096
|
"z-index": "96",
|
|
9060
|
-
width: `${
|
|
9061
|
-
height: `${
|
|
9097
|
+
width: `${Nf}px`,
|
|
9098
|
+
height: `${Pf}px`,
|
|
9062
9099
|
"box-sizing": "border-box",
|
|
9063
9100
|
overflow: "hidden",
|
|
9064
9101
|
"border-radius": "10px",
|
|
@@ -9071,7 +9108,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9071
9108
|
"touch-action": "none"
|
|
9072
9109
|
});
|
|
9073
9110
|
let s = e.createElement("img");
|
|
9074
|
-
s.dataset.mesurerScreenshotPreviewImage = "true", s.alt = "Captured screenshot", s.draggable = !1, s.title = "Click to open · Right-click for browser image actions",
|
|
9111
|
+
s.dataset.mesurerScreenshotPreviewImage = "true", s.alt = "Captured screenshot", s.draggable = !1, s.title = "Click to open · Right-click for browser image actions", zf(s, {
|
|
9075
9112
|
display: "block",
|
|
9076
9113
|
width: "100%",
|
|
9077
9114
|
height: "100%",
|
|
@@ -9079,7 +9116,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9079
9116
|
"background-color": "white"
|
|
9080
9117
|
}), o.append(s);
|
|
9081
9118
|
let c = e.createElement("button");
|
|
9082
|
-
c.dataset.mesurerScreenshotPreviewDismiss = "true", c.type = "button", c.setAttribute("aria-label", "Dismiss screenshot preview"), c.title = "Dismiss",
|
|
9119
|
+
c.dataset.mesurerScreenshotPreviewDismiss = "true", c.type = "button", c.setAttribute("aria-label", "Dismiss screenshot preview"), c.title = "Dismiss", zf(c, {
|
|
9083
9120
|
position: "absolute",
|
|
9084
9121
|
top: "8px",
|
|
9085
9122
|
right: "8px",
|
|
@@ -9106,7 +9143,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9106
9143
|
let u = e.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
9107
9144
|
u.setAttribute("d", "m4 4 8 8M12 4l-8 8"), u.setAttribute("stroke", "currentColor"), u.setAttribute("stroke-width", "1.75"), u.setAttribute("stroke-linecap", "round"), l.append(u), c.append(l), o.append(c), a.append(o);
|
|
9108
9145
|
let d = e.createElement("div");
|
|
9109
|
-
d.dataset.mesurerScreenshotViewer = "true", d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "true"), d.setAttribute("aria-label", "Screenshot viewer"),
|
|
9146
|
+
d.dataset.mesurerScreenshotViewer = "true", d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "true"), d.setAttribute("aria-label", "Screenshot viewer"), zf(d, {
|
|
9110
9147
|
position: "fixed",
|
|
9111
9148
|
inset: "0",
|
|
9112
9149
|
display: "none",
|
|
@@ -9120,7 +9157,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9120
9157
|
"pointer-events": "auto"
|
|
9121
9158
|
});
|
|
9122
9159
|
let f = e.createElement("img");
|
|
9123
|
-
f.dataset.mesurerScreenshotViewerImage = "true", f.alt = "Captured screenshot",
|
|
9160
|
+
f.dataset.mesurerScreenshotViewerImage = "true", f.alt = "Captured screenshot", zf(f, {
|
|
9124
9161
|
display: "block",
|
|
9125
9162
|
"max-width": "calc(100vw - 96px)",
|
|
9126
9163
|
"max-height": "calc(100vh - 112px)",
|
|
@@ -9131,7 +9168,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9131
9168
|
"box-shadow": "0 8px 30px rgb(0 0 0 / 28%)"
|
|
9132
9169
|
}), d.append(f);
|
|
9133
9170
|
let p = e.createElement("div");
|
|
9134
|
-
p.dataset.mesurerScreenshotViewerControls = "true",
|
|
9171
|
+
p.dataset.mesurerScreenshotViewerControls = "true", zf(p, {
|
|
9135
9172
|
position: "fixed",
|
|
9136
9173
|
top: "16px",
|
|
9137
9174
|
right: "16px",
|
|
@@ -9139,14 +9176,14 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9139
9176
|
gap: "8px",
|
|
9140
9177
|
"pointer-events": "auto"
|
|
9141
9178
|
});
|
|
9142
|
-
let m =
|
|
9179
|
+
let m = Vf(e, "Copy");
|
|
9143
9180
|
m.dataset.mesurerScreenshotViewerCopy = "true", m.setAttribute("aria-label", "Copy screenshot");
|
|
9144
|
-
let h =
|
|
9181
|
+
let h = Vf(e, "Save");
|
|
9145
9182
|
h.dataset.mesurerScreenshotViewerSave = "true", h.setAttribute("aria-label", "Save screenshot");
|
|
9146
|
-
let g =
|
|
9183
|
+
let g = Vf(e, "Close");
|
|
9147
9184
|
g.dataset.mesurerScreenshotViewerClose = "true", g.setAttribute("aria-label", "Close screenshot viewer"), p.append(m, h, g), d.append(p), a.append(d);
|
|
9148
9185
|
let _ = e.createElement("div");
|
|
9149
|
-
_.dataset.mesurerScreenshotToast = "true", _.setAttribute("role", "status"),
|
|
9186
|
+
_.dataset.mesurerScreenshotToast = "true", _.setAttribute("role", "status"), zf(_, {
|
|
9150
9187
|
position: "fixed",
|
|
9151
9188
|
left: "50%",
|
|
9152
9189
|
bottom: "20px",
|
|
@@ -9168,7 +9205,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9168
9205
|
}, O = (e, n = !1) => {
|
|
9169
9206
|
D(), _.textContent = e, _.style.backgroundColor = n ? "#b42318" : "rgb(28 28 30 / 90%)", _.style.display = "block", C = t.setTimeout(() => {
|
|
9170
9207
|
C = 0, _.style.display = "none";
|
|
9171
|
-
},
|
|
9208
|
+
}, Lf);
|
|
9172
9209
|
}, k = () => {
|
|
9173
9210
|
d.style.display = "none";
|
|
9174
9211
|
}, A = () => {
|
|
@@ -9178,7 +9215,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9178
9215
|
}, M = () => {
|
|
9179
9216
|
if (!v || o.style.display === "none" || w) return;
|
|
9180
9217
|
E(), k();
|
|
9181
|
-
let e = o.getBoundingClientRect(), n = Math.max(152, t.innerWidth - e.left +
|
|
9218
|
+
let e = o.getBoundingClientRect(), n = Math.max(152, t.innerWidth - e.left + Ff);
|
|
9182
9219
|
o.style.pointerEvents = "none", o.style.willChange = "transform, opacity";
|
|
9183
9220
|
let r = o.animate([{
|
|
9184
9221
|
transform: "translateX(0) scale(1)",
|
|
@@ -9187,18 +9224,18 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9187
9224
|
transform: `translateX(${n}px) scale(0.92)`,
|
|
9188
9225
|
opacity: 0
|
|
9189
9226
|
}], {
|
|
9190
|
-
duration:
|
|
9227
|
+
duration: Rf,
|
|
9191
9228
|
easing: "ease",
|
|
9192
9229
|
fill: "forwards"
|
|
9193
9230
|
});
|
|
9194
9231
|
w = r, r.finished.catch(() => void 0).then(() => {
|
|
9195
9232
|
w === r && (r.cancel(), w = null, j());
|
|
9196
9233
|
});
|
|
9197
|
-
}, N = () =>
|
|
9198
|
-
left: t.innerWidth -
|
|
9199
|
-
top: t.innerHeight -
|
|
9234
|
+
}, N = () => Bf({
|
|
9235
|
+
left: t.innerWidth - Nf - Ff,
|
|
9236
|
+
top: t.innerHeight - Pf - Ff
|
|
9200
9237
|
}, t), P = (e) => {
|
|
9201
|
-
let n =
|
|
9238
|
+
let n = Bf(e, t);
|
|
9202
9239
|
b = n, o.style.left = `${n.left}px`, o.style.top = `${n.top}px`;
|
|
9203
9240
|
}, F = () => {
|
|
9204
9241
|
!v || !y || (E(), d.style.display = "flex", g.focus());
|
|
@@ -9232,7 +9269,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9232
9269
|
let n = x;
|
|
9233
9270
|
if (!n) return;
|
|
9234
9271
|
let r = e - n.startX, i = t - n.startY;
|
|
9235
|
-
!n.moved && Math.hypot(r, i) >=
|
|
9272
|
+
!n.moved && Math.hypot(r, i) >= If && (n.moved = !0), n.moved && P({
|
|
9236
9273
|
left: n.left + r,
|
|
9237
9274
|
top: n.top + i
|
|
9238
9275
|
});
|
|
@@ -9276,25 +9313,25 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9276
9313
|
if (T) return;
|
|
9277
9314
|
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;
|
|
9278
9315
|
let i = globalThis.URL.createObjectURL(e);
|
|
9279
|
-
y = i, s.src = i, f.src = i, o.style.display = "block", P(b ?? N()), O(
|
|
9316
|
+
y = i, s.src = i, f.src = i, o.style.display = "block", P(b ?? N()), O(Hf(n)), r > 0 && (S = t.setTimeout(j, r));
|
|
9280
9317
|
},
|
|
9281
9318
|
dismiss: j,
|
|
9282
9319
|
dispose() {
|
|
9283
9320
|
T || (T = !0, E(), D(), j(), t.removeEventListener("mousemove", ee, !0), t.removeEventListener("mouseup", U, !0), t.removeEventListener("pointermove", te, !0), t.removeEventListener("pointerup", ne, !0), t.removeEventListener("pointercancel", G, !0), t.removeEventListener("keydown", ae, !0), o.removeEventListener("mousedown", H), o.removeEventListener("pointerdown", W), o.removeEventListener("keydown", re), o.removeEventListener("contextmenu", K), d.removeEventListener("click", ie), a.remove());
|
|
9284
9321
|
}
|
|
9285
9322
|
};
|
|
9286
|
-
},
|
|
9323
|
+
}, Gf = "mesurer.screenshot", Kf = "screenshot", qf = "mesurer.screenshot.settings", Jf = "mesurer.screenshot.active", Yf = "runtime:solid", Xf = "screenshot.toggle", Zf = 2500, Qf = 0, $f = [
|
|
9287
9324
|
"[data-mesurer-measurement='true']",
|
|
9288
9325
|
"[data-mesurer-selected-measurement='true']",
|
|
9289
9326
|
"[data-mesurer-selection-spacing-target='true']",
|
|
9290
9327
|
"[data-mesurer-guide='true']",
|
|
9291
9328
|
"[data-mesurer-distance='true']"
|
|
9292
|
-
].join(","),
|
|
9329
|
+
].join(","), ep = `${$f},[data-mesurer-rulers='true'],[data-mesurer-multi-selection-document-layer='true']`, tp = {
|
|
9293
9330
|
viewBox: "0 0 256 256",
|
|
9294
9331
|
paths: ["m 96,50 a 6.0006,6.0006 0 0 0 -4.992188,2.671875 L 76.789062,74 H 40 C 27.920803,74 18,83.920803 18,96 v 96 c 0,12.0792 9.920803,22 22,22 h 176 c 12.0792,0 22,-9.9208 22,-22 V 96 C 238,83.920803 228.0792,74 216,74 H 179.21094 L 164.99219,52.671875 A 6.0006,6.0006 0 0 0 160,50 Z m 3.210937,12 h 57.578123 l 14.21875,21.328125 A 6.0006,6.0006 0 0 0 176,86 h 40 c 5.59392,0 10,4.406085 10,10 v 96 c 0,5.59392 -4.40608,10 -10,10 H 40 c -5.593915,0 -10,-4.40608 -10,-10 V 96 c 0,-5.593915 4.406085,-10 10,-10 h 40 a 6.0006,6.0006 0 0 0 4.992187,-2.671875 z", "m 128,94 c -23.12489,0 -42,18.87511 -42,42 0,23.12489 18.87511,42 42,42 23.12489,0 42,-18.87511 42,-42 0,-23.12489 -18.87511,-42 -42,-42 z m 0,12 c 16.63961,0 30,13.36039 30,30 0,16.63961 -13.36039,30 -30,30 -16.63961,0 -30,-13.36039 -30,-30 0,-16.63961 13.36039,-30 30,-30 z"]
|
|
9295
|
-
}, tp = (e, t) => {
|
|
9296
|
-
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
9297
9332
|
}, np = (e, t) => {
|
|
9333
|
+
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
9334
|
+
}, rp = (e, t) => {
|
|
9298
9335
|
for (let n of [
|
|
9299
9336
|
"left",
|
|
9300
9337
|
"top",
|
|
@@ -9306,63 +9343,63 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9306
9343
|
let r = t[n];
|
|
9307
9344
|
r === void 0 ? e.style.removeProperty(n) : e.style.setProperty(n, `${r}px`);
|
|
9308
9345
|
}
|
|
9309
|
-
},
|
|
9310
|
-
let t = e(
|
|
9346
|
+
}, ip = (e) => {
|
|
9347
|
+
let t = e(qf);
|
|
9311
9348
|
return {
|
|
9312
9349
|
toolEnabled: t?.toolEnabled ?? !0,
|
|
9313
9350
|
copy: t?.copy ?? !0,
|
|
9314
9351
|
download: t?.download ?? !1,
|
|
9315
9352
|
includeMeasurements: t?.includeMeasurements ?? !1
|
|
9316
9353
|
};
|
|
9317
|
-
},
|
|
9354
|
+
}, ap = (e) => ({
|
|
9318
9355
|
value: e.style.getPropertyValue("display"),
|
|
9319
9356
|
priority: e.style.getPropertyPriority("display")
|
|
9320
|
-
}),
|
|
9357
|
+
}), op = (e, t) => {
|
|
9321
9358
|
t.value || t.priority ? e.style.setProperty("display", t.value, t.priority) : e.style.removeProperty("display");
|
|
9322
|
-
},
|
|
9359
|
+
}, sp = (e, t) => {
|
|
9323
9360
|
let n = e;
|
|
9324
9361
|
for (; n.parentElement && n.parentElement !== t;) n = n.parentElement;
|
|
9325
9362
|
return n.parentElement === t ? n : null;
|
|
9326
|
-
},
|
|
9363
|
+
}, cp = (e) => {
|
|
9327
9364
|
let t = e.querySelector("[data-mesurer-root='true']");
|
|
9328
9365
|
if (!t) return () => void 0;
|
|
9329
9366
|
let n = /* @__PURE__ */ new Set();
|
|
9330
9367
|
for (let e of t.querySelectorAll("[data-mesurer-rulers='true']")) {
|
|
9331
|
-
let r =
|
|
9368
|
+
let r = sp(e, t);
|
|
9332
9369
|
r && n.add(r);
|
|
9333
9370
|
}
|
|
9334
|
-
for (let e of t.querySelectorAll(
|
|
9335
|
-
let r =
|
|
9371
|
+
for (let e of t.querySelectorAll($f)) {
|
|
9372
|
+
let r = sp(e, t);
|
|
9336
9373
|
r && n.add(r);
|
|
9337
9374
|
}
|
|
9338
9375
|
let r = [];
|
|
9339
9376
|
for (let e of n) e.dataset.mesurerInspectorUi !== "true" && (r.push({
|
|
9340
9377
|
element: e,
|
|
9341
|
-
display:
|
|
9378
|
+
display: ap(e)
|
|
9342
9379
|
}), e.style.setProperty("display", "none", "important"));
|
|
9343
9380
|
return () => {
|
|
9344
|
-
for (let e of r)
|
|
9381
|
+
for (let e of r) op(e.element, e.display);
|
|
9345
9382
|
};
|
|
9346
|
-
},
|
|
9383
|
+
}, lp = (e) => Array.from(e.querySelectorAll(ep)).filter((e) => e.dataset.mesurerInspectorUi === "true").map((e) => ({
|
|
9347
9384
|
element: e,
|
|
9348
|
-
display:
|
|
9349
|
-
})),
|
|
9350
|
-
for (let t of e) t.element.isConnected &&
|
|
9351
|
-
},
|
|
9352
|
-
id:
|
|
9385
|
+
display: ap(e)
|
|
9386
|
+
})), up = (e) => {
|
|
9387
|
+
for (let t of e) t.element.isConnected && op(t.element, t.display);
|
|
9388
|
+
}, dp = (e = {}) => ba({
|
|
9389
|
+
id: Gf,
|
|
9353
9390
|
version: "0.1.0",
|
|
9354
|
-
requires: [
|
|
9391
|
+
requires: [Yf],
|
|
9355
9392
|
provides: [
|
|
9356
9393
|
"tool:screenshot",
|
|
9357
9394
|
"capture:screenshot",
|
|
9358
9395
|
"settings:screenshot"
|
|
9359
9396
|
],
|
|
9360
9397
|
setup(t) {
|
|
9361
|
-
let n = t.service.get(
|
|
9398
|
+
let n = t.service.get(Yf);
|
|
9362
9399
|
if (!n) throw Error("Screenshot plugin requires the Solid renderer runtime.");
|
|
9363
|
-
let { ownerDocument: r, ownerWindow: i } = n, a = n.createWorkspaceRuntime(), o = n.createInspectorMount(), s = e.capture ?? e.captureVisibleTab, c = s ?? ao, l = e.previewDurationMs ??
|
|
9400
|
+
let { ownerDocument: r, ownerWindow: i } = n, a = n.createWorkspaceRuntime(), o = n.createInspectorMount(), s = e.capture ?? e.captureVisibleTab, c = s ?? ao, l = e.previewDurationMs ?? Qf;
|
|
9364
9401
|
t.state.register({
|
|
9365
|
-
id:
|
|
9402
|
+
id: qf,
|
|
9366
9403
|
initial: {
|
|
9367
9404
|
toolEnabled: e.toolEnabled ?? !0,
|
|
9368
9405
|
copy: e.copy ?? !0,
|
|
@@ -9371,11 +9408,11 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9371
9408
|
},
|
|
9372
9409
|
persist: !0
|
|
9373
9410
|
}), t.state.register({
|
|
9374
|
-
id:
|
|
9411
|
+
id: Jf,
|
|
9375
9412
|
initial: !1
|
|
9376
9413
|
});
|
|
9377
9414
|
let u = o.element;
|
|
9378
|
-
u.dataset.mesurerScreenshot = "true",
|
|
9415
|
+
u.dataset.mesurerScreenshot = "true", np(u, {
|
|
9379
9416
|
position: "fixed",
|
|
9380
9417
|
inset: "0",
|
|
9381
9418
|
"z-index": "85",
|
|
@@ -9383,7 +9420,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9383
9420
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
9384
9421
|
});
|
|
9385
9422
|
let d = r.createElement("div");
|
|
9386
|
-
d.dataset.mesurerScreenshotSelect = "true", d.setAttribute("role", "application"), d.setAttribute("aria-label", "Screenshot selection"),
|
|
9423
|
+
d.dataset.mesurerScreenshotSelect = "true", d.setAttribute("role", "application"), d.setAttribute("aria-label", "Screenshot selection"), np(d, {
|
|
9387
9424
|
position: "fixed",
|
|
9388
9425
|
inset: "0",
|
|
9389
9426
|
display: "none",
|
|
@@ -9395,13 +9432,13 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9395
9432
|
}), u.append(d);
|
|
9396
9433
|
let f = Array.from({ length: 4 }, () => {
|
|
9397
9434
|
let e = r.createElement("div");
|
|
9398
|
-
return
|
|
9435
|
+
return np(e, {
|
|
9399
9436
|
position: "fixed",
|
|
9400
9437
|
"background-color": "rgb(0 0 0 / 40%)",
|
|
9401
9438
|
"pointer-events": "none"
|
|
9402
9439
|
}), d.append(e), e;
|
|
9403
9440
|
}), p = r.createElement("div");
|
|
9404
|
-
|
|
9441
|
+
np(p, {
|
|
9405
9442
|
position: "fixed",
|
|
9406
9443
|
display: "none",
|
|
9407
9444
|
border: "1px solid #0d99ff",
|
|
@@ -9409,7 +9446,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9409
9446
|
"pointer-events": "none"
|
|
9410
9447
|
}), d.append(p);
|
|
9411
9448
|
let m = r.createElement("div");
|
|
9412
|
-
|
|
9449
|
+
np(m, {
|
|
9413
9450
|
position: "fixed",
|
|
9414
9451
|
display: "none",
|
|
9415
9452
|
"z-index": "86",
|
|
@@ -9423,7 +9460,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9423
9460
|
"pointer-events": "none"
|
|
9424
9461
|
}), d.append(m);
|
|
9425
9462
|
let h = r.createElement("div");
|
|
9426
|
-
h.textContent = "Drag to select · Esc to cancel",
|
|
9463
|
+
h.textContent = "Drag to select · Esc to cancel", np(h, {
|
|
9427
9464
|
position: "fixed",
|
|
9428
9465
|
left: "50%",
|
|
9429
9466
|
bottom: "16px",
|
|
@@ -9436,7 +9473,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9436
9473
|
"pointer-events": "none"
|
|
9437
9474
|
}), d.append(h);
|
|
9438
9475
|
let g = r.createElement("div");
|
|
9439
|
-
g.dataset.mesurerScreenshotError = "true", g.setAttribute("role", "status"), g.textContent = "Could not save screenshot",
|
|
9476
|
+
g.dataset.mesurerScreenshotError = "true", g.setAttribute("role", "status"), g.textContent = "Could not save screenshot", np(g, {
|
|
9440
9477
|
position: "fixed",
|
|
9441
9478
|
display: "none",
|
|
9442
9479
|
"z-index": "97",
|
|
@@ -9447,8 +9484,8 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9447
9484
|
"font-size": "11px",
|
|
9448
9485
|
"pointer-events": "none"
|
|
9449
9486
|
}), u.append(g);
|
|
9450
|
-
let _ = null, v = null, y = 0, b = 0, x = !1, S = !1, C = !1, w = () => t.state.get("mesurer.screenshot.active") ?? !1, T = () =>
|
|
9451
|
-
t.state.update(
|
|
9487
|
+
let _ = null, v = null, y = 0, b = 0, x = !1, S = !1, C = !1, w = () => t.state.get("mesurer.screenshot.active") ?? !1, T = () => ip(t.state.get), E = (e) => {
|
|
9488
|
+
t.state.update(qf, (t) => {
|
|
9452
9489
|
let n = { ...t };
|
|
9453
9490
|
return e.toolEnabled !== void 0 && (n.toolEnabled = e.toolEnabled), e.copy !== void 0 && (n.copy = e.copy), e.download !== void 0 && (n.download = e.download), e.includeMeasurements !== void 0 && (n.includeMeasurements = e.includeMeasurements), n;
|
|
9454
9491
|
});
|
|
@@ -9471,13 +9508,13 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9471
9508
|
}, A = (e) => {
|
|
9472
9509
|
let t = i.innerWidth, n = i.innerHeight;
|
|
9473
9510
|
if (!e || e.width <= 0 || e.height <= 0) {
|
|
9474
|
-
|
|
9511
|
+
rp(f[0], {
|
|
9475
9512
|
left: 0,
|
|
9476
9513
|
top: 0,
|
|
9477
9514
|
width: t,
|
|
9478
9515
|
height: n
|
|
9479
9516
|
});
|
|
9480
|
-
for (let e of f.slice(1))
|
|
9517
|
+
for (let e of f.slice(1)) rp(e, {
|
|
9481
9518
|
left: 0,
|
|
9482
9519
|
top: 0,
|
|
9483
9520
|
width: 0,
|
|
@@ -9486,31 +9523,31 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9486
9523
|
p.style.display = "none", m.style.display = "none";
|
|
9487
9524
|
return;
|
|
9488
9525
|
}
|
|
9489
|
-
|
|
9526
|
+
rp(f[0], {
|
|
9490
9527
|
left: 0,
|
|
9491
9528
|
top: 0,
|
|
9492
9529
|
width: t,
|
|
9493
9530
|
height: e.top
|
|
9494
|
-
}),
|
|
9531
|
+
}), rp(f[1], {
|
|
9495
9532
|
left: 0,
|
|
9496
9533
|
top: e.top,
|
|
9497
9534
|
width: e.left,
|
|
9498
9535
|
height: e.height
|
|
9499
|
-
}),
|
|
9536
|
+
}), rp(f[2], {
|
|
9500
9537
|
left: e.left + e.width,
|
|
9501
9538
|
top: e.top,
|
|
9502
9539
|
width: Math.max(0, t - e.left - e.width),
|
|
9503
9540
|
height: e.height
|
|
9504
|
-
}),
|
|
9541
|
+
}), rp(f[3], {
|
|
9505
9542
|
left: 0,
|
|
9506
9543
|
top: e.top + e.height,
|
|
9507
9544
|
width: t,
|
|
9508
9545
|
height: Math.max(0, n - e.top - e.height)
|
|
9509
|
-
}), p.style.display = "block",
|
|
9546
|
+
}), p.style.display = "block", rp(p, e), m.style.display = "block", m.textContent = `${Math.round(e.width)} × ${Math.round(e.height)}`, rp(m, {
|
|
9510
9547
|
left: e.left + e.width / 2,
|
|
9511
9548
|
top: Math.min(n - 22, e.top + e.height + 6)
|
|
9512
9549
|
});
|
|
9513
|
-
}, j = () => n.portalTarget.querySelector("[data-mesurer-tool-id='screenshot']")?.getBoundingClientRect() ?? null, M =
|
|
9550
|
+
}, j = () => n.portalTarget.querySelector("[data-mesurer-tool-id='screenshot']")?.getBoundingClientRect() ?? null, M = Wf({
|
|
9514
9551
|
ownerDocument: r,
|
|
9515
9552
|
ownerWindow: i,
|
|
9516
9553
|
root: u,
|
|
@@ -9521,7 +9558,7 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9521
9558
|
}, P = () => {
|
|
9522
9559
|
y && i.clearTimeout(y), g.style.display = "block", N(g), y = i.setTimeout(() => {
|
|
9523
9560
|
y = 0, g.style.display = "none";
|
|
9524
|
-
},
|
|
9561
|
+
}, Zf);
|
|
9525
9562
|
}, F = () => {
|
|
9526
9563
|
_ = null, A(null), d.style.visibility = "", d.style.display = "none", u.style.pointerEvents = "none", D(!1), k();
|
|
9527
9564
|
}, I = () => {
|
|
@@ -9530,8 +9567,8 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9530
9567
|
if (x) throw Error("A screenshot capture is already running.");
|
|
9531
9568
|
if (e.width < 4 || e.height < 4) throw Error("Screenshot selection must be at least 4px by 4px.");
|
|
9532
9569
|
x = !0;
|
|
9533
|
-
let o = ++b, s = T(), l = s.includeMeasurements ?
|
|
9534
|
-
a.prepareCapture(), s.includeMeasurements &&
|
|
9570
|
+
let o = ++b, s = T(), l = s.includeMeasurements ? lp(r) : [], u = s.includeMeasurements ? () => void 0 : cp(n.portalTarget);
|
|
9571
|
+
a.prepareCapture(), s.includeMeasurements && up(l);
|
|
9535
9572
|
try {
|
|
9536
9573
|
d.style.visibility = "hidden", await Va(i);
|
|
9537
9574
|
let n = await La(await c({
|
|
@@ -9639,10 +9676,10 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9639
9676
|
label: "Screenshot",
|
|
9640
9677
|
shortcut: "Shift+S",
|
|
9641
9678
|
order: 70,
|
|
9642
|
-
command:
|
|
9679
|
+
command: Xf,
|
|
9643
9680
|
toolbarMode: "select",
|
|
9644
9681
|
compactPinned: !0,
|
|
9645
|
-
icon:
|
|
9682
|
+
icon: tp,
|
|
9646
9683
|
active: w,
|
|
9647
9684
|
hidden: () => !T().toolEnabled,
|
|
9648
9685
|
menu: {
|
|
@@ -9708,14 +9745,14 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9708
9745
|
set: (e) => E({ includeMeasurements: e })
|
|
9709
9746
|
}
|
|
9710
9747
|
]
|
|
9711
|
-
}), t.command.register(
|
|
9748
|
+
}), t.command.register(Xf, R), t.service.provide(Kf, U), t.lifecycle.onDispose(() => {
|
|
9712
9749
|
C = !0, b += 1, d.removeEventListener("pointerdown", z), d.removeEventListener("pointermove", B), d.removeEventListener("pointerup", V), d.removeEventListener("pointercancel", H), i.removeEventListener("keydown", ee, !0), y && i.clearTimeout(y), M.dispose(), k(), oo(i), a.finishCapture(), a.dispose(), o.dispose();
|
|
9713
9750
|
});
|
|
9714
9751
|
}
|
|
9715
|
-
}),
|
|
9716
|
-
...
|
|
9717
|
-
version:
|
|
9718
|
-
}),
|
|
9752
|
+
}), fp = "0.2.3-beta.4", pp = Vc, mp = Rc, hp = zc, gp = Hc, _p = Bc, vp = () => ({
|
|
9753
|
+
...Pl(),
|
|
9754
|
+
version: fp
|
|
9755
|
+
}), yp = vp, bp = pp, xp = mp, Sp = hp, Cp = gp, wp = _p, Tp = (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, Ep = (e) => {
|
|
9719
9756
|
if (!e.length) return null;
|
|
9720
9757
|
let t = Math.min(...e.map((e) => e.left)), n = Math.min(...e.map((e) => e.top)), r = Math.max(...e.map((e) => e.left + e.width)), i = Math.max(...e.map((e) => e.top + e.height));
|
|
9721
9758
|
return {
|
|
@@ -9724,43 +9761,43 @@ var Pu = "mesurer.layout-guides", Fu = "layout-guides:v1", Iu = "mesurer.layout-
|
|
|
9724
9761
|
width: r - t,
|
|
9725
9762
|
height: i - n
|
|
9726
9763
|
};
|
|
9727
|
-
},
|
|
9728
|
-
function
|
|
9764
|
+
}, Dp = (e, t, n) => t.some((t) => e.orientation === "vertical" ? e.position >= t.left - n && e.position <= t.left + t.width + n : e.position >= t.top - n && e.position <= t.top + t.height + n), Op = (e) => [...e.measurements, ...e.activeMeasurement && !e.measurements.some((t) => t.id === e.activeMeasurement?.id) ? [e.activeMeasurement] : []];
|
|
9765
|
+
function kp(e) {
|
|
9729
9766
|
let { workspace: t, scope: n, guideTolerance: r } = e;
|
|
9730
9767
|
if (n.kind === "workspace") return {
|
|
9731
9768
|
guides: t.guides.map((e) => ({ ...e })),
|
|
9732
|
-
measurements:
|
|
9769
|
+
measurements: Op(t),
|
|
9733
9770
|
distances: [...t.distances]
|
|
9734
9771
|
};
|
|
9735
|
-
let i = new Set(n.elements), a = (e) => e != null && i.has(e), o = (e) => n.regions.some((t) =>
|
|
9772
|
+
let i = new Set(n.elements), a = (e) => e != null && i.has(e), o = (e) => n.regions.some((t) => Tp(e, t));
|
|
9736
9773
|
return {
|
|
9737
|
-
guides: t.guides.filter((e) =>
|
|
9738
|
-
measurements:
|
|
9774
|
+
guides: t.guides.filter((e) => Dp(e, n.regions, r)).map((e) => ({ ...e })),
|
|
9775
|
+
measurements: Op(t).filter((e) => a(e.elementRef) || o(e.rect)),
|
|
9739
9776
|
distances: t.distances.filter((e) => a(e.elementRefA) || a(e.elementRefB) || o(e.rectA) || o(e.rectB))
|
|
9740
9777
|
};
|
|
9741
9778
|
}
|
|
9742
9779
|
//#endregion
|
|
9743
9780
|
//#region ../mesurer-core/dist/domain.js
|
|
9744
|
-
var
|
|
9781
|
+
var Ap = {
|
|
9745
9782
|
opacity: 1,
|
|
9746
9783
|
width: 1,
|
|
9747
9784
|
pattern: "solid",
|
|
9748
9785
|
dashLength: 6,
|
|
9749
9786
|
gap: 4
|
|
9750
|
-
},
|
|
9787
|
+
}, jp = {
|
|
9751
9788
|
opacity: 1,
|
|
9752
9789
|
edgeReveal: !1
|
|
9753
9790
|
};
|
|
9754
|
-
({ ...
|
|
9791
|
+
({ ...Ap }), { ...jp };
|
|
9755
9792
|
//#endregion
|
|
9756
9793
|
//#region ../mesurer-dom/dist/index.js
|
|
9757
|
-
var
|
|
9794
|
+
var Mp = (e) => Number.parseFloat(e) || 0, Np = 0, Pp = (e, t) => {
|
|
9758
9795
|
let n = t.CSS;
|
|
9759
9796
|
return n?.escape ? n.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
9760
9797
|
};
|
|
9761
|
-
function
|
|
9798
|
+
function Fp(e) {
|
|
9762
9799
|
let t = e.ownerDocument.defaultView ?? window;
|
|
9763
|
-
if (e.id) return `#${
|
|
9800
|
+
if (e.id) return `#${Pp(e.id, t)}`;
|
|
9764
9801
|
let n = e.getAttribute("data-testid");
|
|
9765
9802
|
if (n) return `[data-testid=${JSON.stringify(n)}]`;
|
|
9766
9803
|
let r = [], i = e;
|
|
@@ -9774,17 +9811,17 @@ function Pp(e) {
|
|
|
9774
9811
|
}
|
|
9775
9812
|
return r.join(" > ");
|
|
9776
9813
|
}
|
|
9777
|
-
function
|
|
9814
|
+
function Ip(e, t, n = `dom-inspection-${++Np}`) {
|
|
9778
9815
|
let r = e.getBoundingClientRect(), i = t.getComputedStyle(e), a = {
|
|
9779
|
-
top:
|
|
9780
|
-
right:
|
|
9781
|
-
bottom:
|
|
9782
|
-
left:
|
|
9816
|
+
top: Mp(i.paddingTop),
|
|
9817
|
+
right: Mp(i.paddingRight),
|
|
9818
|
+
bottom: Mp(i.paddingBottom),
|
|
9819
|
+
left: Mp(i.paddingLeft)
|
|
9783
9820
|
}, o = {
|
|
9784
|
-
top:
|
|
9785
|
-
right:
|
|
9786
|
-
bottom:
|
|
9787
|
-
left:
|
|
9821
|
+
top: Mp(i.marginTop),
|
|
9822
|
+
right: Mp(i.marginRight),
|
|
9823
|
+
bottom: Mp(i.marginBottom),
|
|
9824
|
+
left: Mp(i.marginLeft)
|
|
9788
9825
|
}, s = {
|
|
9789
9826
|
left: r.left + a.left,
|
|
9790
9827
|
top: r.top + a.top,
|
|
@@ -9812,8 +9849,8 @@ function Fp(e, t, n = `dom-inspection-${++Mp}`) {
|
|
|
9812
9849
|
elementRef: e
|
|
9813
9850
|
};
|
|
9814
9851
|
}
|
|
9815
|
-
function
|
|
9816
|
-
let t = e.ownerDocument.defaultView ?? window, n = t.getComputedStyle(e), r = e instanceof t.HTMLElement ? e : null, i = e.getBoundingClientRect(), a = r ?
|
|
9852
|
+
function Lp(e) {
|
|
9853
|
+
let t = e.ownerDocument.defaultView ?? window, n = t.getComputedStyle(e), r = e instanceof t.HTMLElement ? e : null, i = e.getBoundingClientRect(), a = r ? Ip(r, t) : null, o = (e) => {
|
|
9817
9854
|
let t = Number.parseFloat(e);
|
|
9818
9855
|
return Number.isFinite(t) ? t : 0;
|
|
9819
9856
|
}, s = (e) => ({
|
|
@@ -9823,7 +9860,7 @@ function Ip(e) {
|
|
|
9823
9860
|
left: o(n.getPropertyValue(`${e}-left${e === "border" ? "-width" : ""}`))
|
|
9824
9861
|
});
|
|
9825
9862
|
return {
|
|
9826
|
-
selector:
|
|
9863
|
+
selector: Fp(e),
|
|
9827
9864
|
tag: e.localName,
|
|
9828
9865
|
id: e.id || null,
|
|
9829
9866
|
classes: [...e.classList],
|
|
@@ -9885,25 +9922,25 @@ function Ip(e) {
|
|
|
9885
9922
|
}
|
|
9886
9923
|
//#endregion
|
|
9887
9924
|
//#region src/context.ts
|
|
9888
|
-
var
|
|
9925
|
+
var Rp = 10, zp = (e) => ({
|
|
9889
9926
|
left: e.left,
|
|
9890
9927
|
top: e.top,
|
|
9891
9928
|
width: e.width,
|
|
9892
9929
|
height: e.height
|
|
9893
|
-
}),
|
|
9930
|
+
}), Bp = (e) => {
|
|
9894
9931
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
9895
9932
|
for (let r of e) !r?.isConnected || t.has(r) || (t.add(r), n.push(r));
|
|
9896
9933
|
return n;
|
|
9897
|
-
},
|
|
9898
|
-
function
|
|
9934
|
+
}, Vp = (e) => e.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
9935
|
+
function Hp(e) {
|
|
9899
9936
|
let { runtime: t, ownerDocument: n, ownerWindow: r } = e, i = e.request ?? { scope: "workspace" }, a = t.snapshot();
|
|
9900
9937
|
if (!a) throw Error("Mesurer workspace is not ready yet.");
|
|
9901
|
-
let o = (e) =>
|
|
9938
|
+
let o = (e) => zp(t.elementRect?.(e) ?? e.getBoundingClientRect()), s = [], c = [], l = { kind: "workspace" }, u = /* @__PURE__ */ new Map();
|
|
9902
9939
|
if ("annotation" in i) {
|
|
9903
9940
|
let e = t.annotation(i.annotation);
|
|
9904
9941
|
if (!e) throw Error(`Mesurer annotation not found: ${i.annotation}`);
|
|
9905
9942
|
for (let t of e.resolvedTargets) t.element?.isConnected && u.set(t.element, t.target.id);
|
|
9906
|
-
s =
|
|
9943
|
+
s = Bp(e.resolvedTargets.map((e) => e.element));
|
|
9907
9944
|
let n = t.annotationRect(e.id);
|
|
9908
9945
|
n && (c = [n]);
|
|
9909
9946
|
let r = e.resolvedTargets.length, a = e.resolvedTargets.filter((e) => e.element?.isConnected).length, o = e.anchor.kind === "region" ? "connected" : r === 0 || a === 0 ? "stale" : a === r ? "connected" : "partial";
|
|
@@ -9915,15 +9952,15 @@ function Vp(e) {
|
|
|
9915
9952
|
};
|
|
9916
9953
|
} else if (i.scope === "selection") {
|
|
9917
9954
|
let e = t.currentSelection();
|
|
9918
|
-
if (s =
|
|
9955
|
+
if (s = Bp(e.elements), !s.length && !e.region) throw Error("Mesurer has no current selection.");
|
|
9919
9956
|
c = e.region ? [e.region] : s.map(o), l = { kind: "selection" };
|
|
9920
|
-
} else s =
|
|
9957
|
+
} else s = Bp([
|
|
9921
9958
|
...t.currentSelection().elements,
|
|
9922
9959
|
...a.measurements.map((e) => e.elementRef),
|
|
9923
9960
|
a.activeMeasurement?.elementRef,
|
|
9924
9961
|
...a.heldDistances.flatMap((e) => [e.elementRefA, e.elementRefB])
|
|
9925
9962
|
]);
|
|
9926
|
-
let d = l.kind === "workspace" ? [] : c.length ? c : s.map(o), f =
|
|
9963
|
+
let d = l.kind === "workspace" ? [] : c.length ? c : s.map(o), f = kp({
|
|
9927
9964
|
workspace: {
|
|
9928
9965
|
guides: a.guides,
|
|
9929
9966
|
measurements: a.measurements,
|
|
@@ -9935,8 +9972,8 @@ function Vp(e) {
|
|
|
9935
9972
|
elements: s,
|
|
9936
9973
|
regions: d
|
|
9937
9974
|
},
|
|
9938
|
-
guideTolerance: a.guideRelevanceTolerance ??
|
|
9939
|
-
}), p = f.measurements, m = f.distances, h = f.guides, g =
|
|
9975
|
+
guideTolerance: a.guideRelevanceTolerance ?? Rp
|
|
9976
|
+
}), p = f.measurements, m = f.distances, h = f.guides, g = Bp([
|
|
9940
9977
|
...s,
|
|
9941
9978
|
...p.map((e) => e.elementRef),
|
|
9942
9979
|
...m.flatMap((e) => [e.elementRefA, e.elementRefB])
|
|
@@ -9945,7 +9982,7 @@ function Vp(e) {
|
|
|
9945
9982
|
for (; v.has(e);) e = `target-${y++}`;
|
|
9946
9983
|
return v.add(e), e;
|
|
9947
9984
|
}, x = g.map((e) => {
|
|
9948
|
-
let t = u.get(e) ?? b(), n = o(e), r =
|
|
9985
|
+
let t = u.get(e) ?? b(), n = o(e), r = Lp(e);
|
|
9949
9986
|
return _.set(e, t), {
|
|
9950
9987
|
ref: t,
|
|
9951
9988
|
inspection: {
|
|
@@ -9962,7 +9999,7 @@ function Vp(e) {
|
|
|
9962
9999
|
}), S = p.map((e) => {
|
|
9963
10000
|
let t = {
|
|
9964
10001
|
id: e.id,
|
|
9965
|
-
rect:
|
|
10002
|
+
rect: zp(e.rect),
|
|
9966
10003
|
deltaX: e.deltaX,
|
|
9967
10004
|
deltaY: e.deltaY
|
|
9968
10005
|
};
|
|
@@ -9972,8 +10009,8 @@ function Vp(e) {
|
|
|
9972
10009
|
}), C = m.map((e) => {
|
|
9973
10010
|
let t = {
|
|
9974
10011
|
id: e.id,
|
|
9975
|
-
rectA:
|
|
9976
|
-
rectB:
|
|
10012
|
+
rectA: zp(e.rectA),
|
|
10013
|
+
rectB: zp(e.rectB),
|
|
9977
10014
|
horizontal: e.horizontal ? { ...e.horizontal } : null,
|
|
9978
10015
|
vertical: e.vertical ? { ...e.vertical } : null
|
|
9979
10016
|
}, n = e.elementRefA ? _.get(e.elementRefA) : void 0, r = e.elementRefB ? _.get(e.elementRefB) : void 0;
|
|
@@ -9981,7 +10018,7 @@ function Vp(e) {
|
|
|
9981
10018
|
});
|
|
9982
10019
|
return {
|
|
9983
10020
|
schema: "mesurer.context/v1",
|
|
9984
|
-
id:
|
|
10021
|
+
id: Vp(r),
|
|
9985
10022
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
9986
10023
|
scope: l,
|
|
9987
10024
|
page: {
|
|
@@ -9996,7 +10033,7 @@ function Vp(e) {
|
|
|
9996
10033
|
scrollY: r.scrollY
|
|
9997
10034
|
},
|
|
9998
10035
|
coordinateSpace: "viewport-css-px",
|
|
9999
|
-
regions: l.kind === "workspace" ? [] : c.map(
|
|
10036
|
+
regions: l.kind === "workspace" ? [] : c.map(zp),
|
|
10000
10037
|
visualState: {
|
|
10001
10038
|
rulersVisible: a.rulersVisible,
|
|
10002
10039
|
xrayVisible: a.xrayVisible
|
|
@@ -10010,48 +10047,48 @@ function Vp(e) {
|
|
|
10010
10047
|
}
|
|
10011
10048
|
};
|
|
10012
10049
|
}
|
|
10013
|
-
var
|
|
10014
|
-
function
|
|
10050
|
+
var Up = (e) => `${Math.round(e * 100) / 100}px`, Wp = (e) => `x=${Up(e.left)} y=${Up(e.top)} w=${Up(e.width)} h=${Up(e.height)}`;
|
|
10051
|
+
function Gp(e) {
|
|
10015
10052
|
let t = [
|
|
10016
10053
|
"Mesurer visual context",
|
|
10017
10054
|
"",
|
|
10018
10055
|
`Page: ${e.page.url}`,
|
|
10019
10056
|
`Viewport: ${e.viewport.width} × ${e.viewport.height} CSS px; scroll x=${e.viewport.scrollX} y=${e.viewport.scrollY}`
|
|
10020
10057
|
];
|
|
10021
|
-
if (e.scope.kind === "annotation" ? t.push("", "Annotation", e.scope.note, `Target status: ${e.scope.targetStatus}`) : t.push("", `Scope: ${e.scope.kind}`), e.regions.length && (t.push("", "Requested regions"), e.regions.forEach((e, n) => t.push(`- region-${n + 1}: ${
|
|
10058
|
+
if (e.scope.kind === "annotation" ? t.push("", "Annotation", e.scope.note, `Target status: ${e.scope.targetStatus}`) : t.push("", `Scope: ${e.scope.kind}`), e.regions.length && (t.push("", "Requested regions"), e.regions.forEach((e, n) => t.push(`- region-${n + 1}: ${Wp(e)}`))), (e.visualState.rulersVisible || e.visualState.xrayVisible) && t.push("", `Visual state: rulers=${e.visualState.rulersVisible ? "on" : "off"}; x-ray=${e.visualState.xrayVisible ? "on" : "off"}`), e.targets.length) {
|
|
10022
10059
|
t.push("", "Targets");
|
|
10023
10060
|
for (let n of e.targets) {
|
|
10024
10061
|
let e = n.inspection;
|
|
10025
|
-
t.push(`[${n.ref}] ${e.selector}`, ` rect: ${
|
|
10062
|
+
t.push(`[${n.ref}] ${e.selector}`, ` rect: ${Wp(e.rect)}`, ` margin: ${Up(e.margin.top)} ${Up(e.margin.right)} ${Up(e.margin.bottom)} ${Up(e.margin.left)}`, ` padding: ${Up(e.padding.top)} ${Up(e.padding.right)} ${Up(e.padding.bottom)} ${Up(e.padding.left)}`, ` layout: display=${e.layout.display}; position=${e.layout.position}; gap=${e.layout.gap}`, ` typography: ${e.typography.fontSize} / ${e.typography.lineHeight}; weight=${e.typography.fontWeight}; align=${e.typography.textAlign}`), e.text && t.push(` text: ${JSON.stringify(e.text)}`);
|
|
10026
10063
|
}
|
|
10027
10064
|
}
|
|
10028
10065
|
if (e.visualContext.guides.length) {
|
|
10029
10066
|
t.push("", "Relevant guides");
|
|
10030
|
-
for (let n of e.visualContext.guides) t.push(`- ${n.orientation} ${n.orientation === "vertical" ? "x" : "y"}=${
|
|
10067
|
+
for (let n of e.visualContext.guides) t.push(`- ${n.orientation} ${n.orientation === "vertical" ? "x" : "y"}=${Up(n.position)}`);
|
|
10031
10068
|
}
|
|
10032
10069
|
if (e.visualContext.layoutGuides.length) {
|
|
10033
10070
|
t.push("", "Layout guides");
|
|
10034
10071
|
for (let n of e.visualContext.layoutGuides) {
|
|
10035
10072
|
if (!n.visible) continue;
|
|
10036
|
-
let e = n.kind === "grid" ? `grid ${
|
|
10073
|
+
let e = n.kind === "grid" ? `grid ${Up(n.size)}` : `${n.count} ${n.kind}; gutter=${Up(n.gutter)}; offset=${Up(n.offset)}; align=${n.align}`;
|
|
10037
10074
|
t.push(`- ${e}; color=${n.color}; opacity=${Math.round(n.opacity * 100)}%`);
|
|
10038
10075
|
}
|
|
10039
10076
|
}
|
|
10040
10077
|
if (e.visualContext.measurements.length) {
|
|
10041
10078
|
t.push("", "Relevant measurements");
|
|
10042
|
-
for (let n of e.visualContext.measurements) t.push(`- ${n.targetRef ? `${n.targetRef}: ` : ""}${
|
|
10079
|
+
for (let n of e.visualContext.measurements) t.push(`- ${n.targetRef ? `${n.targetRef}: ` : ""}${Wp(n.rect)}; delta=${Up(n.deltaX)} × ${Up(n.deltaY)}`);
|
|
10043
10080
|
}
|
|
10044
10081
|
if (e.visualContext.distances.length) {
|
|
10045
10082
|
t.push("", "Relevant distances");
|
|
10046
10083
|
for (let n of e.visualContext.distances) {
|
|
10047
|
-
let e = [n.targetARef, n.targetBRef].filter(Boolean).join(" → "), r = [n.horizontal ? `horizontal=${
|
|
10084
|
+
let e = [n.targetARef, n.targetBRef].filter(Boolean).join(" → "), r = [n.horizontal ? `horizontal=${Up(n.horizontal.value)}` : null, n.vertical ? `vertical=${Up(n.vertical.value)}` : null].filter(Boolean).join("; ");
|
|
10048
10085
|
t.push(`- ${e ? `${e}: ` : ""}${r || "overlapping"}`);
|
|
10049
10086
|
}
|
|
10050
10087
|
}
|
|
10051
10088
|
return t.join("\n").trimEnd();
|
|
10052
10089
|
}
|
|
10053
|
-
function
|
|
10054
|
-
let t =
|
|
10090
|
+
function Kp(e) {
|
|
10091
|
+
let t = Ep([
|
|
10055
10092
|
...e.regions,
|
|
10056
10093
|
...e.targets.map((e) => e.inspection.rect),
|
|
10057
10094
|
...e.visualContext.measurements.map((e) => e.rect),
|
|
@@ -10081,7 +10118,7 @@ function Gp(e) {
|
|
|
10081
10118
|
captures: n
|
|
10082
10119
|
};
|
|
10083
10120
|
}
|
|
10084
|
-
var
|
|
10121
|
+
var qp = (e, t, n, r, i) => {
|
|
10085
10122
|
!Number.isFinite(r) || !Number.isFinite(i) || Math.abs(r - i) < .01 || e.push({
|
|
10086
10123
|
kind: t,
|
|
10087
10124
|
label: n,
|
|
@@ -10090,16 +10127,16 @@ var Kp = (e, t, n, r, i) => {
|
|
|
10090
10127
|
delta: i - r,
|
|
10091
10128
|
unit: "px"
|
|
10092
10129
|
});
|
|
10093
|
-
},
|
|
10130
|
+
}, Jp = (e, t, n, r) => e.push({
|
|
10094
10131
|
kind: "missing",
|
|
10095
10132
|
evidence: t,
|
|
10096
10133
|
id: n,
|
|
10097
10134
|
label: r
|
|
10098
|
-
}),
|
|
10099
|
-
function
|
|
10135
|
+
}), Yp = (e, t) => Math.abs(e.left - t.left) < .01 && Math.abs(e.top - t.top) < .01 && Math.abs(e.width - t.width) < .01 && Math.abs(e.height - t.height) < .01;
|
|
10136
|
+
function Xp(e) {
|
|
10100
10137
|
let t = e.runtime.annotation(e.annotationId);
|
|
10101
10138
|
if (!t) throw Error(`Mesurer annotation not found: ${e.annotationId}`);
|
|
10102
|
-
let n =
|
|
10139
|
+
let n = Hp({
|
|
10103
10140
|
runtime: e.runtime,
|
|
10104
10141
|
ownerDocument: e.ownerDocument,
|
|
10105
10142
|
ownerWindow: e.ownerWindow,
|
|
@@ -10109,42 +10146,42 @@ function Yp(e) {
|
|
|
10109
10146
|
if (n.scope.kind !== "annotation") throw Error("Mesurer annotation context invariant failed.");
|
|
10110
10147
|
let r = e.runtime.snapshot();
|
|
10111
10148
|
if (!r) throw Error("Mesurer workspace is not ready yet.");
|
|
10112
|
-
let i =
|
|
10149
|
+
let i = Op({
|
|
10113
10150
|
measurements: r.measurements,
|
|
10114
10151
|
activeMeasurement: r.activeMeasurement
|
|
10115
10152
|
}), a = [];
|
|
10116
10153
|
for (let e of t.baseline.targets) {
|
|
10117
10154
|
let t = n.targets.find((t) => t.ref === e.id);
|
|
10118
10155
|
if (!t) {
|
|
10119
|
-
|
|
10156
|
+
Jp(a, "target", e.id, e.selector);
|
|
10120
10157
|
continue;
|
|
10121
10158
|
}
|
|
10122
|
-
|
|
10159
|
+
qp(a, "target-rect", `${t.inspection.selector} left`, e.rect.left, t.inspection.rect.left), qp(a, "target-rect", `${t.inspection.selector} top`, e.rect.top, t.inspection.rect.top), qp(a, "target-rect", `${t.inspection.selector} width`, e.rect.width, t.inspection.rect.width), qp(a, "target-rect", `${t.inspection.selector} height`, e.rect.height, t.inspection.rect.height);
|
|
10123
10160
|
}
|
|
10124
10161
|
for (let e of t.baseline.guides) {
|
|
10125
10162
|
let t = n.visualContext.guides.find((t) => t.id === e.id) ?? r.guides.find((t) => t.id === e.id);
|
|
10126
10163
|
if (!t) {
|
|
10127
|
-
|
|
10164
|
+
Jp(a, "guide", e.id, `${e.orientation} guide ${e.id}`);
|
|
10128
10165
|
continue;
|
|
10129
10166
|
}
|
|
10130
|
-
|
|
10167
|
+
qp(a, "guide", `${e.orientation} guide ${e.id}`, e.position, t.position);
|
|
10131
10168
|
}
|
|
10132
10169
|
for (let e of t.baseline.measurements) {
|
|
10133
10170
|
let r = n.visualContext.measurements.find((t) => t.id === e.id) ?? i.find((t) => t.id === e.id);
|
|
10134
10171
|
if (!r) {
|
|
10135
|
-
let r = t.baseline.targets.find((t) =>
|
|
10136
|
-
r && n.targets.some((e) => e.ref === r.id) ||
|
|
10172
|
+
let r = t.baseline.targets.find((t) => Yp(t.rect, e.rect));
|
|
10173
|
+
r && n.targets.some((e) => e.ref === r.id) || Jp(a, "measurement", e.id, e.id);
|
|
10137
10174
|
continue;
|
|
10138
10175
|
}
|
|
10139
|
-
|
|
10176
|
+
qp(a, "measurement", `${e.id} width`, e.rect.width, r.rect.width), qp(a, "measurement", `${e.id} height`, e.rect.height, r.rect.height);
|
|
10140
10177
|
}
|
|
10141
10178
|
for (let e of t.baseline.distances) {
|
|
10142
10179
|
let t = n.visualContext.distances.find((t) => t.id === e.id) ?? r.heldDistances.find((t) => t.id === e.id);
|
|
10143
10180
|
if (!t) {
|
|
10144
|
-
|
|
10181
|
+
Jp(a, "distance", e.id, e.id);
|
|
10145
10182
|
continue;
|
|
10146
10183
|
}
|
|
10147
|
-
e.horizontal && t.horizontal ?
|
|
10184
|
+
e.horizontal && t.horizontal ? qp(a, "distance", `${e.id} horizontal`, e.horizontal.value, t.horizontal.value) : e.horizontal && !t.horizontal && Jp(a, "distance", e.id, `${e.id} horizontal`), e.vertical && t.vertical ? qp(a, "distance", `${e.id} vertical`, e.vertical.value, t.vertical.value) : e.vertical && !t.vertical && Jp(a, "distance", e.id, `${e.id} vertical`);
|
|
10148
10185
|
}
|
|
10149
10186
|
return {
|
|
10150
10187
|
schema: "mesurer.review/v1",
|
|
@@ -10156,7 +10193,7 @@ function Yp(e) {
|
|
|
10156
10193
|
changes: a
|
|
10157
10194
|
};
|
|
10158
10195
|
}
|
|
10159
|
-
async function
|
|
10196
|
+
async function Zp(e, t, n) {
|
|
10160
10197
|
try {
|
|
10161
10198
|
if (t.navigator.clipboard?.writeText) {
|
|
10162
10199
|
await t.navigator.clipboard.writeText(n);
|
|
@@ -10170,43 +10207,43 @@ async function Xp(e, t, n) {
|
|
|
10170
10207
|
}
|
|
10171
10208
|
//#endregion
|
|
10172
10209
|
//#region src/layout-guides.ts
|
|
10173
|
-
var
|
|
10174
|
-
...
|
|
10175
|
-
version:
|
|
10176
|
-
}),
|
|
10210
|
+
var Qp = Fu, $p = Iu, em = Lu, tm = Ru, nm = () => ({
|
|
10211
|
+
...cd(),
|
|
10212
|
+
version: fp
|
|
10213
|
+
}), rm = "mesurer.context", im = "context:v1", am = "mesurer.context.settings", om = "context.ui", sm = "data-mesurer-direct-text-edit-active", cm = {
|
|
10177
10214
|
viewBox: "0 0 256 256",
|
|
10178
10215
|
paths: ["M216,32H88a8,8,0,0,0-8,8V80H40a8,8,0,0,0-8,8V216a8,8,0,0,0,8,8H168a8,8,0,0,0,8-8V176h40a8,8,0,0,0,8-8V40A8,8,0,0,0,216,32ZM160,208H48V96H160Zm48-48H176V88a8,8,0,0,0-8-8H96V48H208Z"]
|
|
10179
|
-
},
|
|
10216
|
+
}, lm = {
|
|
10180
10217
|
viewBox: "0 0 256 256",
|
|
10181
10218
|
paths: ["M152,40a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,40Zm-8,168H112a8,8,0,0,0,0,16h32a8,8,0,0,0,0-16ZM208,32H184a8,8,0,0,0,0,16h24V72a8,8,0,0,0,16,0V48A16,16,0,0,0,208,32Zm8,72a8,8,0,0,0-8,8v32a8,8,0,0,0,16,0V112A8,8,0,0,0,216,104Zm0,72a8,8,0,0,0-8,8v24H184a8,8,0,0,0,0,16h24a16,16,0,0,0,16-16V184A8,8,0,0,0,216,176ZM40,152a8,8,0,0,0,8-8V112a8,8,0,0,0-16,0v32A8,8,0,0,0,40,152Zm32,56H48V184a8,8,0,0,0-16,0v24a16,16,0,0,0,16,16H72a8,8,0,0,0,0-16ZM72,32H48A16,16,0,0,0,32,48V72a8,8,0,0,0,16,0V48H72a8,8,0,0,0,0-16Z"]
|
|
10182
|
-
},
|
|
10219
|
+
}, um = {
|
|
10183
10220
|
viewBox: "0 0 256 256",
|
|
10184
10221
|
paths: ["M229.66,58.34l-32-32a8,8,0,0,0-11.32,0l-96,96A8,8,0,0,0,88,128v32a8,8,0,0,0,8,8h32a8,8,0,0,0,5.66-2.34l96-96A8,8,0,0,0,229.66,58.34ZM124.69,152H104V131.31l64-64L188.69,88ZM200,76.69,179.31,56,192,43.31,212.69,64ZM224,128v80a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V48A16,16,0,0,1,48,32h80a8,8,0,0,1,0,16H48V208H208V128a8,8,0,0,1,16,0Z"]
|
|
10185
|
-
},
|
|
10222
|
+
}, dm = async (e, t, n = 1) => {
|
|
10186
10223
|
await e.fonts?.ready;
|
|
10187
10224
|
for (let e = 0; e < Math.max(1, n); e += 1) await new Promise((e) => t.requestAnimationFrame(() => e()));
|
|
10188
|
-
},
|
|
10189
|
-
let i = async (i) =>
|
|
10225
|
+
}, fm = (e, t, n, r) => {
|
|
10226
|
+
let i = async (i) => Hp({
|
|
10190
10227
|
runtime: e,
|
|
10191
10228
|
ownerDocument: t,
|
|
10192
10229
|
ownerWindow: n,
|
|
10193
10230
|
request: i,
|
|
10194
10231
|
layoutGuides: r()
|
|
10195
|
-
}), a = async (e) =>
|
|
10232
|
+
}), a = async (e) => Gp(await i(e));
|
|
10196
10233
|
return {
|
|
10197
10234
|
context: i,
|
|
10198
10235
|
contextText: a,
|
|
10199
|
-
copyContext: async (e) =>
|
|
10236
|
+
copyContext: async (e) => Zp(t, n, await a(e)),
|
|
10200
10237
|
select: async (r) => {
|
|
10201
10238
|
let a = Array.isArray(r) ? [...r] : [String(r)];
|
|
10202
|
-
return e.select(a), await
|
|
10239
|
+
return e.select(a), await dm(t, n), i({ scope: "selection" });
|
|
10203
10240
|
},
|
|
10204
10241
|
annotations: async () => e.annotations(),
|
|
10205
10242
|
removeAnnotation: async (r) => {
|
|
10206
|
-
e.removeAnnotation(r), await
|
|
10243
|
+
e.removeAnnotation(r), await dm(t, n);
|
|
10207
10244
|
},
|
|
10208
10245
|
review: async (i) => {
|
|
10209
|
-
if (await
|
|
10246
|
+
if (await dm(t, n), i) return Xp({
|
|
10210
10247
|
runtime: e,
|
|
10211
10248
|
ownerDocument: t,
|
|
10212
10249
|
ownerWindow: n,
|
|
@@ -10214,7 +10251,7 @@ var Zp = Pu, Qp = Fu, $p = Iu, em = Lu, tm = () => ({
|
|
|
10214
10251
|
layoutGuides: r()
|
|
10215
10252
|
});
|
|
10216
10253
|
let a = r();
|
|
10217
|
-
return e.annotations().map((r) =>
|
|
10254
|
+
return e.annotations().map((r) => Xp({
|
|
10218
10255
|
runtime: e,
|
|
10219
10256
|
ownerDocument: t,
|
|
10220
10257
|
ownerWindow: n,
|
|
@@ -10222,38 +10259,47 @@ var Zp = Pu, Qp = Fu, $p = Iu, em = Lu, tm = () => ({
|
|
|
10222
10259
|
layoutGuides: a
|
|
10223
10260
|
}));
|
|
10224
10261
|
},
|
|
10225
|
-
capturePlan: async (e) =>
|
|
10262
|
+
capturePlan: async (e) => Kp(await i(e)),
|
|
10226
10263
|
prepareCapture: async () => {
|
|
10227
|
-
e.prepareCapture(), await
|
|
10264
|
+
e.prepareCapture(), await dm(t, n);
|
|
10228
10265
|
},
|
|
10229
10266
|
finishCapture: async () => {
|
|
10230
|
-
e.finishCapture(), await
|
|
10267
|
+
e.finishCapture(), await dm(t, n);
|
|
10231
10268
|
}
|
|
10232
10269
|
};
|
|
10233
|
-
},
|
|
10270
|
+
}, pm = (e) => {
|
|
10234
10271
|
let t = e.currentSelection();
|
|
10235
|
-
return t.elements.length > 0 || t.region !== null
|
|
10272
|
+
return (t.elements.length > 0 || t.region !== null) && !t.elements.some((e) => {
|
|
10273
|
+
let t = e.ownerDocument;
|
|
10274
|
+
for (; t;) {
|
|
10275
|
+
let e = t.defaultView?.frameElement ?? null;
|
|
10276
|
+
if (!e) return !1;
|
|
10277
|
+
if (e.hasAttribute("data-mesurer-responsive-frame")) return !0;
|
|
10278
|
+
t = e.ownerDocument;
|
|
10279
|
+
}
|
|
10280
|
+
return !1;
|
|
10281
|
+
});
|
|
10236
10282
|
};
|
|
10237
|
-
function
|
|
10283
|
+
function mm(e = {}) {
|
|
10238
10284
|
return {
|
|
10239
|
-
id:
|
|
10240
|
-
version:
|
|
10285
|
+
id: rm,
|
|
10286
|
+
version: fp,
|
|
10241
10287
|
requires: ["runtime:solid"],
|
|
10242
|
-
provides: [
|
|
10288
|
+
provides: [im],
|
|
10243
10289
|
setup(t) {
|
|
10244
10290
|
let n = t.service.get("runtime:solid");
|
|
10245
10291
|
if (!n) throw Error("Mesurer context plugin requires the renderer runtime service.");
|
|
10246
|
-
let r = n.createWorkspaceRuntime(
|
|
10247
|
-
t.service.provide(
|
|
10248
|
-
id:
|
|
10292
|
+
let r = n.createWorkspaceRuntime(rm), i = fm(r, n.ownerDocument, n.ownerWindow, () => t.service.get($p)?.list() ?? []);
|
|
10293
|
+
t.service.provide(im, i), t.state.register({
|
|
10294
|
+
id: am,
|
|
10249
10295
|
initial: { ui: e.ui ?? !0 },
|
|
10250
10296
|
persist: !0
|
|
10251
10297
|
}), t.state.register({
|
|
10252
|
-
id:
|
|
10253
|
-
initial: { hasSelection:
|
|
10298
|
+
id: om,
|
|
10299
|
+
initial: { hasSelection: pm(r) }
|
|
10254
10300
|
});
|
|
10255
|
-
let a = () => t.state.get("mesurer.context.settings")?.ui ?? !0, o = () =>
|
|
10256
|
-
t.state.update(
|
|
10301
|
+
let a = () => t.state.get("mesurer.context.settings")?.ui ?? !0, o = () => pm(r), s = (e) => {
|
|
10302
|
+
t.state.update(am, (t) => ({
|
|
10257
10303
|
...t,
|
|
10258
10304
|
ui: e
|
|
10259
10305
|
}));
|
|
@@ -10266,22 +10312,22 @@ function pm(e = {}) {
|
|
|
10266
10312
|
elements: [...e.elements],
|
|
10267
10313
|
region: e.region ? { ...e.region } : null
|
|
10268
10314
|
}, r.selectGestureActive() ? c?.abandonNoteComposer() : n && c?.closeNoteComposer();
|
|
10269
|
-
let i =
|
|
10270
|
-
i !== (t.state.get(
|
|
10315
|
+
let i = pm(r);
|
|
10316
|
+
i !== (t.state.get(om)?.hasSelection ?? !1) && t.state.update(om, () => ({ hasSelection: i }));
|
|
10271
10317
|
});
|
|
10272
10318
|
t.command.register("context.copy", () => i.copyContext()), t.command.register("context.copy-selection", () => i.copyContext({ scope: "selection" }));
|
|
10273
10319
|
let g = () => {
|
|
10274
10320
|
let e = u?.element;
|
|
10275
|
-
e && (n.rendererRoot?.hasAttribute(
|
|
10321
|
+
e && (n.rendererRoot?.hasAttribute(sm) ? e.setAttribute(sm, "true") : e.removeAttribute(sm));
|
|
10276
10322
|
}, _ = () => {
|
|
10277
10323
|
d?.disconnect(), d = null, c = null, l?.(), l = null, u?.dispose(), u = null;
|
|
10278
10324
|
}, v = () => {
|
|
10279
10325
|
if (u) return;
|
|
10280
|
-
if (u =
|
|
10326
|
+
if (u = du(n), u.element.dataset.mesurerLayer = "evidence", u.element.dataset.mesurerContextRoot = "true", n.rendererRoot) {
|
|
10281
10327
|
let e = new n.ownerWindow.MutationObserver(g);
|
|
10282
10328
|
d = e, e.observe(n.rendererRoot, {
|
|
10283
10329
|
attributes: !0,
|
|
10284
|
-
attributeFilter: [
|
|
10330
|
+
attributeFilter: [sm]
|
|
10285
10331
|
}), g();
|
|
10286
10332
|
}
|
|
10287
10333
|
let e = {
|
|
@@ -10293,20 +10339,22 @@ function pm(e = {}) {
|
|
|
10293
10339
|
coordinateSpace: "document",
|
|
10294
10340
|
rendererRoot: n.rendererRoot
|
|
10295
10341
|
};
|
|
10296
|
-
l = Ur(() => Or(
|
|
10342
|
+
l = Ur(() => Or(su, yr(e, { get ownerWindow() {
|
|
10297
10343
|
return n.ownerWindow;
|
|
10298
10344
|
} })), u.element);
|
|
10299
10345
|
}, y = () => {
|
|
10300
10346
|
a() ? v() : _();
|
|
10301
10347
|
};
|
|
10302
|
-
y(), t.state.subscribe(y), t.command.register("context.add-note", () =>
|
|
10348
|
+
y(), t.state.subscribe(y), t.command.register("context.add-note", () => {
|
|
10349
|
+
o() && c?.openNoteComposer();
|
|
10350
|
+
}), t.tool.register({
|
|
10303
10351
|
id: "context.copy",
|
|
10304
10352
|
label: "Copy context",
|
|
10305
10353
|
shortcut: "C",
|
|
10306
10354
|
command: "context.copy",
|
|
10307
10355
|
order: 70,
|
|
10308
10356
|
toolbarMode: "always",
|
|
10309
|
-
icon:
|
|
10357
|
+
icon: cm,
|
|
10310
10358
|
hidden: () => !a()
|
|
10311
10359
|
}), t.tool.register({
|
|
10312
10360
|
id: "context.copy-selection",
|
|
@@ -10315,7 +10363,7 @@ function pm(e = {}) {
|
|
|
10315
10363
|
command: "context.copy-selection",
|
|
10316
10364
|
order: 71,
|
|
10317
10365
|
toolbarMode: "always",
|
|
10318
|
-
icon:
|
|
10366
|
+
icon: lm,
|
|
10319
10367
|
hidden: () => !a(),
|
|
10320
10368
|
disabled: () => !o()
|
|
10321
10369
|
}), t.tool.register({
|
|
@@ -10325,7 +10373,7 @@ function pm(e = {}) {
|
|
|
10325
10373
|
command: "context.add-note",
|
|
10326
10374
|
order: 72,
|
|
10327
10375
|
toolbarMode: "always",
|
|
10328
|
-
icon:
|
|
10376
|
+
icon: um,
|
|
10329
10377
|
hidden: () => !a(),
|
|
10330
10378
|
disabled: () => !o()
|
|
10331
10379
|
}), t.settings.register({
|
|
@@ -10348,7 +10396,7 @@ function pm(e = {}) {
|
|
|
10348
10396
|
}
|
|
10349
10397
|
//#endregion
|
|
10350
10398
|
//#region src/plugins/codex/index.ts
|
|
10351
|
-
var
|
|
10399
|
+
var hm = "mesurer.codex", gm = "codex:v1", _m = "mesurer.plugin.before-disable", vm = 2e3, ym = 750, bm = 2e3, xm = 1800, Sm = 2e3, Cm = 12e4, wm = 10, Tm = 5, Em = "http://127.0.0.1:47365", Dm = "mesurer-codex", Om = 2, km = [
|
|
10352
10400
|
"thread-discovery-v1",
|
|
10353
10401
|
"durable-queue-v1",
|
|
10354
10402
|
"history-recovery-v2",
|
|
@@ -10356,33 +10404,33 @@ var mm = "mesurer.codex", hm = "codex:v1", gm = "mesurer.plugin.before-disable",
|
|
|
10356
10404
|
"idle-safe-shutdown-v1",
|
|
10357
10405
|
"nonterminal-retention-v1",
|
|
10358
10406
|
"instance-binding-v1"
|
|
10359
|
-
],
|
|
10407
|
+
], Am = 1500, jm = 15e3, Mm = 5e3, Nm = [
|
|
10360
10408
|
"Implement the current human feedback from Mesurer in this project.",
|
|
10361
10409
|
"Treat the rendered page as the source of truth, preserve unrelated Mesurer review state,",
|
|
10362
10410
|
"and verify the affected UI in the live page with Mesurer before claiming completion."
|
|
10363
|
-
].join(" "),
|
|
10411
|
+
].join(" "), Pm = {
|
|
10364
10412
|
viewBox: "0 0 256 256",
|
|
10365
10413
|
paths: ["M224,48,32,120l88,32,32,88Z M120,152l104-104"]
|
|
10366
|
-
},
|
|
10414
|
+
}, Fm = {
|
|
10367
10415
|
viewBox: "0 0 256 256",
|
|
10368
10416
|
paths: ["M72,32H184a8,8,0,0,1,0,16h-8v20.69a40,40,0,0,1-11.72,28.28L137.25,124l27.03,27.03A40,40,0,0,1,176,179.31V208h8a8,8,0,0,1,0,16H72a8,8,0,0,1,0-16h8V179.31a40,40,0,0,1,11.72-28.28L118.75,124,91.72,96.97A40,40,0,0,1,80,68.69V48H72a8,8,0,0,1,0-16Zm24,16V68.69a24,24,0,0,0,7.03,16.97L128,110.63l24.97-24.97A24,24,0,0,0,160,68.69V48Zm32,90.63-24.97,24.97A24,24,0,0,0,96,180.57V208h64V180.57a24,24,0,0,0-7.03-16.97Z"]
|
|
10369
|
-
},
|
|
10417
|
+
}, Im = {
|
|
10370
10418
|
viewBox: "0 0 256 256",
|
|
10371
10419
|
paths: ["M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"]
|
|
10372
|
-
},
|
|
10420
|
+
}, Lm = class extends Error {
|
|
10373
10421
|
issue;
|
|
10374
10422
|
constructor(e, t) {
|
|
10375
10423
|
super(t), this.issue = e, this.name = "BrowserBridgeConnectionError";
|
|
10376
10424
|
}
|
|
10377
|
-
},
|
|
10425
|
+
}, Rm = () => {
|
|
10378
10426
|
try {
|
|
10379
10427
|
let e = globalThis.location;
|
|
10380
10428
|
return e?.origin ? `mesurer-codex-ui:v2:${e.origin}${e.pathname}` : null;
|
|
10381
10429
|
} catch {
|
|
10382
10430
|
return null;
|
|
10383
10431
|
}
|
|
10384
|
-
},
|
|
10385
|
-
let e =
|
|
10432
|
+
}, zm = () => {
|
|
10433
|
+
let e = Rm();
|
|
10386
10434
|
if (!e) return null;
|
|
10387
10435
|
try {
|
|
10388
10436
|
let t = globalThis.sessionStorage?.getItem(e);
|
|
@@ -10408,35 +10456,35 @@ var mm = "mesurer.codex", hm = "codex:v1", gm = "mesurer.plugin.before-disable",
|
|
|
10408
10456
|
} catch {
|
|
10409
10457
|
return null;
|
|
10410
10458
|
}
|
|
10411
|
-
},
|
|
10412
|
-
let t =
|
|
10459
|
+
}, Bm = (e) => {
|
|
10460
|
+
let t = Rm();
|
|
10413
10461
|
if (t) try {
|
|
10414
10462
|
globalThis.sessionStorage?.setItem(t, JSON.stringify(e));
|
|
10415
10463
|
} catch {}
|
|
10416
|
-
}, Bm = (e) => {
|
|
10417
|
-
let t = Tm.endsWith("/") ? Tm : `${Tm}/`;
|
|
10418
|
-
return new URL(e, t).toString();
|
|
10419
10464
|
}, Vm = (e) => {
|
|
10465
|
+
let t = Em.endsWith("/") ? Em : `${Em}/`;
|
|
10466
|
+
return new URL(e, t).toString();
|
|
10467
|
+
}, Hm = (e) => {
|
|
10420
10468
|
let t = e.bridge;
|
|
10421
|
-
if (!t) throw new
|
|
10422
|
-
if (t.name !==
|
|
10423
|
-
if (t.protocol !==
|
|
10424
|
-
if (e.access?.allowed === !1) throw new
|
|
10425
|
-
let n = new Set(Array.isArray(t.capabilities) ? t.capabilities : []), r =
|
|
10426
|
-
if (r.length > 0) throw new
|
|
10427
|
-
if (!t.instanceId?.trim()) throw new
|
|
10428
|
-
},
|
|
10469
|
+
if (!t) throw new Lm("port-conflict", "Another local service or an outdated Mesurer Codex Bridge is using port 47365. Mesurer will not send data to an unverified service.");
|
|
10470
|
+
if (t.name !== Dm) throw new Lm("port-conflict", `Another local service is using port 47365 (${t.name ?? "unknown"}). Mesurer will not send Codex data to it.`);
|
|
10471
|
+
if (t.protocol !== Om) throw new Lm("version-mismatch", `Mesurer Codex Bridge is out of date (protocol ${t.protocol ?? "unknown"}; expected ${Om}). Restart the matching Mesurer Codex Bridge helper.`);
|
|
10472
|
+
if (e.access?.allowed === !1) throw new Lm("origin-denied", `Mesurer Codex Bridge does not allow this browser origin (${globalThis.location?.origin ?? "this page"}). Allow this origin when starting the bridge.`);
|
|
10473
|
+
let n = new Set(Array.isArray(t.capabilities) ? t.capabilities : []), r = km.filter((e) => !n.has(e));
|
|
10474
|
+
if (r.length > 0) throw new Lm("capability-mismatch", `Mesurer Codex Bridge is missing required capabilities: ${r.join(", ")}. Restart or update the matching helper.`);
|
|
10475
|
+
if (!t.instanceId?.trim()) throw new Lm("capability-mismatch", "Mesurer Codex Bridge did not provide an instance identity. Restart or update the matching helper.");
|
|
10476
|
+
}, Um = (e) => e.includes("does not allow this browser origin") ? "origin-denied" : e.includes("out of date") ? "version-mismatch" : e.includes("missing required capabilities") || e.includes("did not provide an instance identity") ? "capability-mismatch" : e.includes("Another local service") ? "port-conflict" : e.includes("instance changed") ? "instance-changed" : e.includes("timed out") ? "timed-out" : e.includes("companion is unavailable") ? "not-running" : null, Wm = (e) => e instanceof Lm ? e.issue : e instanceof Error ? Um(e.message) : null, Gm = async (e) => {
|
|
10429
10477
|
let t, n;
|
|
10430
|
-
if (e.action === "health") t =
|
|
10478
|
+
if (e.action === "health") t = Vm("health");
|
|
10431
10479
|
else if (e.action === "threads") {
|
|
10432
10480
|
let n = new URLSearchParams();
|
|
10433
|
-
n.set("limit", String(e.limit ??
|
|
10434
|
-
} else if (e.action === "target") t =
|
|
10481
|
+
n.set("limit", String(e.limit ?? wm)), e.thread && n.set("thread", e.thread), t = `${Vm("threads")}?${n.toString()}`;
|
|
10482
|
+
} else if (e.action === "target") t = Vm("target"), n = {
|
|
10435
10483
|
method: "POST",
|
|
10436
10484
|
headers: { "Content-Type": "application/json" },
|
|
10437
10485
|
body: JSON.stringify({ thread: e.thread })
|
|
10438
10486
|
};
|
|
10439
|
-
else if (e.action === "queue") t =
|
|
10487
|
+
else if (e.action === "queue") t = Vm("send"), n = {
|
|
10440
10488
|
method: "POST",
|
|
10441
10489
|
headers: { "Content-Type": "application/json" },
|
|
10442
10490
|
body: JSON.stringify({
|
|
@@ -10444,8 +10492,8 @@ var mm = "mesurer.codex", hm = "codex:v1", gm = "mesurer.plugin.before-disable",
|
|
|
10444
10492
|
thread: e.thread
|
|
10445
10493
|
})
|
|
10446
10494
|
};
|
|
10447
|
-
else if (e.action === "delivery") t =
|
|
10448
|
-
else if (e.action === "restore") t =
|
|
10495
|
+
else if (e.action === "delivery") t = Vm(`deliveries/${encodeURIComponent(String(e.deliveryId ?? ""))}`);
|
|
10496
|
+
else if (e.action === "restore") t = Vm("deliveries/restore"), n = {
|
|
10449
10497
|
method: "POST",
|
|
10450
10498
|
headers: { "Content-Type": "application/json" },
|
|
10451
10499
|
body: JSON.stringify({
|
|
@@ -10459,14 +10507,14 @@ var mm = "mesurer.codex", hm = "codex:v1", gm = "mesurer.plugin.before-disable",
|
|
|
10459
10507
|
else throw Error(`Codex browser companion does not support ${e.action}.`);
|
|
10460
10508
|
if (e.action !== "health") {
|
|
10461
10509
|
let t = e.bridgeInstanceId?.trim();
|
|
10462
|
-
if (!t) throw new
|
|
10510
|
+
if (!t) throw new Lm("instance-changed", "Mesurer Codex Bridge instance changed before this request could be verified.");
|
|
10463
10511
|
let r = new Headers(n?.headers);
|
|
10464
10512
|
r.set("X-Mesurer-Bridge-Instance", t), n = {
|
|
10465
10513
|
...n,
|
|
10466
10514
|
headers: r
|
|
10467
10515
|
};
|
|
10468
10516
|
}
|
|
10469
|
-
let r = new AbortController(), i = e.action === "health" || e.action === "threads" ?
|
|
10517
|
+
let r = new AbortController(), i = e.action === "health" || e.action === "threads" ? Am : jm, a = globalThis.setTimeout(() => r.abort(), i);
|
|
10470
10518
|
try {
|
|
10471
10519
|
let i = await fetch(t, {
|
|
10472
10520
|
...n,
|
|
@@ -10477,23 +10525,23 @@ var mm = "mesurer.codex", hm = "codex:v1", gm = "mesurer.plugin.before-disable",
|
|
|
10477
10525
|
} catch {
|
|
10478
10526
|
o = { error: a };
|
|
10479
10527
|
}
|
|
10480
|
-
if (e.action === "health" &&
|
|
10481
|
-
let e = o.error ?? `Mesurer Codex companion returned HTTP ${i.status}.`, t =
|
|
10482
|
-
throw t ? new
|
|
10528
|
+
if (e.action === "health" && Hm(o), !i.ok || o.ok === !1) {
|
|
10529
|
+
let e = o.error ?? `Mesurer Codex companion returned HTTP ${i.status}.`, t = Um(e);
|
|
10530
|
+
throw t ? new Lm(t, e) : Error(e);
|
|
10483
10531
|
}
|
|
10484
10532
|
return o;
|
|
10485
10533
|
} catch (e) {
|
|
10486
|
-
throw e instanceof Error && e.name === "AbortError" ? new
|
|
10534
|
+
throw e instanceof Error && e.name === "AbortError" ? new Lm("timed-out", "Mesurer Codex companion timed out.") : e instanceof TypeError ? new Lm("not-running", `Mesurer Codex companion is unavailable at ${Em}.`) : e;
|
|
10487
10535
|
} finally {
|
|
10488
10536
|
globalThis.clearTimeout(a);
|
|
10489
10537
|
}
|
|
10490
|
-
},
|
|
10538
|
+
}, Km = async (e) => {
|
|
10491
10539
|
let t = window.__MESURER_HOST__?.codexBridge;
|
|
10492
10540
|
if (!t) throw Error("Codex native host bridge is unavailable.");
|
|
10493
10541
|
let n = await t(e);
|
|
10494
10542
|
if (n.ok === !1) throw Error(n.error ?? "Codex Bridge request failed.");
|
|
10495
10543
|
return n;
|
|
10496
|
-
},
|
|
10544
|
+
}, qm = (e) => {
|
|
10497
10545
|
let t = e.runtime;
|
|
10498
10546
|
return !t || ![
|
|
10499
10547
|
"shared",
|
|
@@ -10511,10 +10559,10 @@ var mm = "mesurer.codex", hm = "codex:v1", gm = "mesurer.plugin.before-disable",
|
|
|
10511
10559
|
available: t.available === !0,
|
|
10512
10560
|
reason: t.reason
|
|
10513
10561
|
};
|
|
10514
|
-
},
|
|
10562
|
+
}, Jm = (e) => ({
|
|
10515
10563
|
thread: e.thread?.trim() || null,
|
|
10516
10564
|
threads: Array.isArray(e.threads) ? e.threads.filter((e) => e.trim().length > 0) : []
|
|
10517
|
-
}),
|
|
10565
|
+
}), Ym = (e) => {
|
|
10518
10566
|
let t = e.deliveryId?.trim(), n = e.thread?.trim(), r = e.status;
|
|
10519
10567
|
if (!t || !n || !r) throw Error("Codex Bridge returned an invalid delivery state.");
|
|
10520
10568
|
let i = {
|
|
@@ -10526,7 +10574,7 @@ var mm = "mesurer.codex", hm = "codex:v1", gm = "mesurer.plugin.before-disable",
|
|
|
10526
10574
|
updatedAt: Number.isFinite(e.updatedAt) ? Number(e.updatedAt) : 0
|
|
10527
10575
|
};
|
|
10528
10576
|
return e.queuedSubmissionId !== void 0 && (i.queuedSubmissionId = e.queuedSubmissionId?.trim() || null), e.clientUserMessageId !== void 0 && (i.clientUserMessageId = e.clientUserMessageId?.trim() || null), e.dispatch !== void 0 && (i.dispatch = e.dispatch), e.dispatchError !== void 0 && (i.dispatchError = e.dispatchError?.trim() || null), i;
|
|
10529
|
-
},
|
|
10577
|
+
}, Xm = (e) => ({
|
|
10530
10578
|
thread: e.thread?.trim() || null,
|
|
10531
10579
|
threads: Array.isArray(e.threadDetails) ? e.threadDetails.flatMap((e) => {
|
|
10532
10580
|
let t = e.id?.trim() ?? "";
|
|
@@ -10538,7 +10586,7 @@ var mm = "mesurer.codex", hm = "codex:v1", gm = "mesurer.plugin.before-disable",
|
|
|
10538
10586
|
}] : [];
|
|
10539
10587
|
}) : [],
|
|
10540
10588
|
hasMore: e.hasMore === !0
|
|
10541
|
-
}),
|
|
10589
|
+
}), Zm = async (e, t, n) => {
|
|
10542
10590
|
let r = t?.instruction?.trim() || n, i = await e.annotations(), a = t?.annotationIds, o = a ? a.flatMap((e) => {
|
|
10543
10591
|
let t = i.find((t) => t.id === e);
|
|
10544
10592
|
return t ? [t] : [];
|
|
@@ -10561,18 +10609,18 @@ var mm = "mesurer.codex", hm = "codex:v1", gm = "mesurer.plugin.before-disable",
|
|
|
10561
10609
|
])
|
|
10562
10610
|
].join("\n").trimEnd()
|
|
10563
10611
|
};
|
|
10564
|
-
},
|
|
10565
|
-
function
|
|
10566
|
-
let t = e.instruction?.trim() ||
|
|
10612
|
+
}, Qm = (e) => e.length > 16 ? `${e.slice(0, 8)}…${e.slice(-4)}` : e, $m = (e, t = 42) => e.length > t ? `${e.slice(0, t - 1)}…` : e, eh = (e) => Wm(e) !== null || e instanceof Error && (e.message === "Codex Bridge is unavailable in this host." || e.message.includes("Codex Bridge lease") || e.message.includes("Mesurer Codex Bridge"));
|
|
10613
|
+
function th(e = {}) {
|
|
10614
|
+
let t = e.instruction?.trim() || Nm, n = e.ui ?? !0, r = e.clearCompletedAnnotations ?? !0;
|
|
10567
10615
|
return {
|
|
10568
|
-
id:
|
|
10569
|
-
version:
|
|
10570
|
-
requires: [
|
|
10571
|
-
provides: [
|
|
10616
|
+
id: hm,
|
|
10617
|
+
version: fp,
|
|
10618
|
+
requires: [im],
|
|
10619
|
+
provides: [gm],
|
|
10572
10620
|
async setup(e) {
|
|
10573
|
-
let i = e.service.get(
|
|
10621
|
+
let i = e.service.get(im);
|
|
10574
10622
|
if (!i) throw Error("Mesurer Codex plugin requires context() from mesurer-solid/plugins.");
|
|
10575
|
-
let a = n ?
|
|
10623
|
+
let a = n ? zm() : null, o = "unknown", s = null, c = !1, l = a?.originThread ?? null, u = a?.selectedThread ?? a?.originThread ?? null, d = !1, f = null, p = [], m = [], h = !1, g = Tm, _, v = "", y = null, b = a?.delivery ? {
|
|
10576
10624
|
id: a.delivery.id,
|
|
10577
10625
|
thread: a.delivery.thread,
|
|
10578
10626
|
status: a.delivery.status,
|
|
@@ -10585,22 +10633,22 @@ function eh(e = {}) {
|
|
|
10585
10633
|
if (!k) try {
|
|
10586
10634
|
let t = e.action === "queue" || e.action === "target" || e.action === "delivery" || e.action === "restore";
|
|
10587
10635
|
if (e.action === "health") {
|
|
10588
|
-
let t = await
|
|
10636
|
+
let t = await Gm(e);
|
|
10589
10637
|
return D = t.bridge?.instanceId?.trim() || null, E = Date.now(), t;
|
|
10590
10638
|
}
|
|
10591
|
-
return (!D || t || Date.now() - E >=
|
|
10639
|
+
return (!D || t || Date.now() - E >= Mm) && (D = (await Gm({
|
|
10592
10640
|
action: "health",
|
|
10593
10641
|
thread: u ?? l ?? void 0
|
|
10594
|
-
})).bridge?.instanceId?.trim() || null, E = Date.now()), await
|
|
10642
|
+
})).bridge?.instanceId?.trim() || null, E = Date.now()), await Gm({
|
|
10595
10643
|
...e,
|
|
10596
10644
|
bridgeInstanceId: D ?? void 0
|
|
10597
10645
|
});
|
|
10598
10646
|
} catch (e) {
|
|
10599
10647
|
throw E = 0, D = null, e;
|
|
10600
10648
|
}
|
|
10601
|
-
if (e.action === "activate" || e.action === "runtime") return
|
|
10649
|
+
if (e.action === "activate" || e.action === "runtime") return Km(e);
|
|
10602
10650
|
if (!T) throw Error("Codex Bridge lease is not active for this plugin.");
|
|
10603
|
-
return
|
|
10651
|
+
return Km({
|
|
10604
10652
|
...e,
|
|
10605
10653
|
leaseId: T
|
|
10606
10654
|
});
|
|
@@ -10608,7 +10656,7 @@ function eh(e = {}) {
|
|
|
10608
10656
|
if (!k) return;
|
|
10609
10657
|
let e = T;
|
|
10610
10658
|
if (e) {
|
|
10611
|
-
if ((await
|
|
10659
|
+
if ((await Km({
|
|
10612
10660
|
action: "deactivate",
|
|
10613
10661
|
leaseId: e
|
|
10614
10662
|
})).released !== !0) throw Error("Codex Bridge did not confirm lease release.");
|
|
@@ -10616,13 +10664,13 @@ function eh(e = {}) {
|
|
|
10616
10664
|
}
|
|
10617
10665
|
};
|
|
10618
10666
|
if (k) {
|
|
10619
|
-
let e = await
|
|
10667
|
+
let e = await Km({
|
|
10620
10668
|
action: "activate",
|
|
10621
10669
|
thread: u ?? l ?? void 0
|
|
10622
10670
|
}), t = e.leaseId?.trim();
|
|
10623
10671
|
if (!t) throw Error("Codex Bridge did not return an activation lease.");
|
|
10624
|
-
T = t, o = "available", s =
|
|
10625
|
-
let n =
|
|
10672
|
+
T = t, o = "available", s = qm(e);
|
|
10673
|
+
let n = Jm(e);
|
|
10626
10674
|
c = !0, f = n.thread, p = n.threads;
|
|
10627
10675
|
}
|
|
10628
10676
|
e.lifecycle.onDispose(() => {
|
|
@@ -10630,12 +10678,12 @@ function eh(e = {}) {
|
|
|
10630
10678
|
let t = e instanceof Error ? e.message : String(e);
|
|
10631
10679
|
console.error(`[Mesurer] Failed to release Codex host lease: ${t}`);
|
|
10632
10680
|
});
|
|
10633
|
-
}), e.hook.on(
|
|
10681
|
+
}), e.hook.on(_m, async (e) => {
|
|
10634
10682
|
e === "mesurer.codex" && await j();
|
|
10635
10683
|
});
|
|
10636
10684
|
let M = async () => {
|
|
10637
10685
|
if (!k) return null;
|
|
10638
|
-
let e =
|
|
10686
|
+
let e = qm(await A({ action: "runtime" }));
|
|
10639
10687
|
if (!e) throw Error("Codex Bridge returned an invalid runtime state.");
|
|
10640
10688
|
return s = e, e;
|
|
10641
10689
|
}, N = async () => {
|
|
@@ -10643,8 +10691,8 @@ function eh(e = {}) {
|
|
|
10643
10691
|
action: "health",
|
|
10644
10692
|
thread: u ?? l ?? void 0
|
|
10645
10693
|
});
|
|
10646
|
-
return s =
|
|
10647
|
-
}, P = N, F = async (e) =>
|
|
10694
|
+
return s = qm(e) ?? s, Jm(e);
|
|
10695
|
+
}, P = N, F = async (e) => Ym(await A({
|
|
10648
10696
|
action: "delivery",
|
|
10649
10697
|
deliveryId: e
|
|
10650
10698
|
})), I = async (e) => {
|
|
@@ -10656,17 +10704,17 @@ function eh(e = {}) {
|
|
|
10656
10704
|
};
|
|
10657
10705
|
if (e.queuedSubmissionId && (n.queuedSubmissionId = e.queuedSubmissionId), e.clientUserMessageId) n.clientUserMessageId = e.clientUserMessageId;
|
|
10658
10706
|
else if (e.annotationIds.length > 0) {
|
|
10659
|
-
let r = await
|
|
10707
|
+
let r = await Zm(i, { annotationIds: e.annotationIds }, t);
|
|
10660
10708
|
if (!(r.annotationIds.length === e.annotationIds.length && r.annotationIds.every((t, n) => t === e.annotationIds[n]))) throw Error("Cannot safely restore this Codex delivery because one or more saved Mesurer annotations are unavailable.");
|
|
10661
10709
|
n.message = r.message;
|
|
10662
10710
|
}
|
|
10663
|
-
return
|
|
10711
|
+
return Ym(await A(n));
|
|
10664
10712
|
}, L = async (e = {}) => {
|
|
10665
10713
|
let t = {
|
|
10666
10714
|
action: "threads",
|
|
10667
|
-
limit: e.limit ??
|
|
10715
|
+
limit: e.limit ?? wm
|
|
10668
10716
|
}, n = e.thread?.trim();
|
|
10669
|
-
return n && (t.thread = n),
|
|
10717
|
+
return n && (t.thread = n), Xm(await A(t));
|
|
10670
10718
|
}, R = () => u ?? l ?? (d ? null : f), z = () => {
|
|
10671
10719
|
if (!n) return;
|
|
10672
10720
|
let e = b?.id && (b.status === "queued" || b.status === "working" || b.status === "completed" || b.status === "interrupted" || b.status === "failed") ? {
|
|
@@ -10679,7 +10727,7 @@ function eh(e = {}) {
|
|
|
10679
10727
|
dispatch: b.dispatch,
|
|
10680
10728
|
dispatchError: b.dispatchError
|
|
10681
10729
|
} : null;
|
|
10682
|
-
|
|
10730
|
+
Bm({
|
|
10683
10731
|
version: 1,
|
|
10684
10732
|
originThread: l,
|
|
10685
10733
|
selectedThread: u,
|
|
@@ -10697,12 +10745,12 @@ function eh(e = {}) {
|
|
|
10697
10745
|
"queueing",
|
|
10698
10746
|
"queued",
|
|
10699
10747
|
"working"
|
|
10700
|
-
].includes(b.status) ?
|
|
10748
|
+
].includes(b.status) ? Fm : b.status === "completed" ? Im : Pm : Pm, W = () => {
|
|
10701
10749
|
let e = [], t = /* @__PURE__ */ new Set(), n = (n) => {
|
|
10702
10750
|
t.has(n.id) || (t.add(n.id), e.push(n));
|
|
10703
10751
|
}, r = (e) => ({
|
|
10704
10752
|
id: e,
|
|
10705
|
-
title: `Codex ${
|
|
10753
|
+
title: `Codex ${Qm(e)}`,
|
|
10706
10754
|
updatedAt: null,
|
|
10707
10755
|
connected: !0
|
|
10708
10756
|
});
|
|
@@ -10740,22 +10788,22 @@ function eh(e = {}) {
|
|
|
10740
10788
|
let t = e.id === l ? "Current · " : e.connected ? "Loaded · " : "", r = b?.thread === e.id ? ` · ${H(b.status)}` : "";
|
|
10741
10789
|
return {
|
|
10742
10790
|
id: `codex.thread.${e.id}`,
|
|
10743
|
-
label: `${t}${
|
|
10791
|
+
label: `${t}${$m(e.title)}${r}`,
|
|
10744
10792
|
checked: () => n === e.id,
|
|
10745
10793
|
disabled: () => V(),
|
|
10746
10794
|
run() {
|
|
10747
10795
|
V() || (B(e.id, !l), K());
|
|
10748
10796
|
}
|
|
10749
10797
|
};
|
|
10750
|
-
})), g <
|
|
10798
|
+
})), g < wm && (e.length > g || h) && r.push({
|
|
10751
10799
|
id: "codex.thread.show-more",
|
|
10752
10800
|
label: "Show 5 more…",
|
|
10753
10801
|
run() {
|
|
10754
|
-
g =
|
|
10802
|
+
g = wm, K();
|
|
10755
10803
|
}
|
|
10756
10804
|
}), b?.queuedSubmissionId && b.status === "queued" && (b.dispatch === "desktop-opened" || b.dispatch === "desktop-wake-failed") && r.push({
|
|
10757
10805
|
id: "codex.delivery.receipt",
|
|
10758
|
-
label: `Receipt · ${
|
|
10806
|
+
label: `Receipt · ${Qm(b.queuedSubmissionId)}`,
|
|
10759
10807
|
disabled: () => !0,
|
|
10760
10808
|
run: () => void 0
|
|
10761
10809
|
}), r;
|
|
@@ -10792,7 +10840,7 @@ function eh(e = {}) {
|
|
|
10792
10840
|
}, ie = async (e) => {
|
|
10793
10841
|
if (o !== "available") return;
|
|
10794
10842
|
let t = await L({
|
|
10795
|
-
limit:
|
|
10843
|
+
limit: wm,
|
|
10796
10844
|
thread: e ?? void 0
|
|
10797
10845
|
});
|
|
10798
10846
|
m = t.threads, h = t.hasMore, p = t.threads.filter((e) => e.connected).map((e) => e.id), f = t.thread;
|
|
@@ -10804,7 +10852,7 @@ function eh(e = {}) {
|
|
|
10804
10852
|
let t = u ?? l;
|
|
10805
10853
|
t && p.includes(t) ? d = !1 : p.length === 1 ? B(p[0], !0) : d = !0, !d && t && z();
|
|
10806
10854
|
} catch (e) {
|
|
10807
|
-
throw o = "unavailable", O = k ? null :
|
|
10855
|
+
throw o = "unavailable", O = k ? null : Wm(e) ?? "unavailable", s = await M().catch(() => s), e;
|
|
10808
10856
|
} finally {
|
|
10809
10857
|
y = null, K();
|
|
10810
10858
|
}
|
|
@@ -10814,7 +10862,7 @@ function eh(e = {}) {
|
|
|
10814
10862
|
}, oe = () => {
|
|
10815
10863
|
S && globalThis.clearTimeout(S), S = globalThis.setTimeout(() => {
|
|
10816
10864
|
S = 0, b?.status === "completed" && (b = null, z(), K());
|
|
10817
|
-
},
|
|
10865
|
+
}, xm);
|
|
10818
10866
|
}, se = async (e) => {
|
|
10819
10867
|
if (!(!b || b.id !== e.id)) {
|
|
10820
10868
|
if (b = {
|
|
@@ -10843,7 +10891,7 @@ function eh(e = {}) {
|
|
|
10843
10891
|
if (t || n.length > 0) {
|
|
10844
10892
|
z(), K(), x = globalThis.setTimeout(() => {
|
|
10845
10893
|
x = 0, ce(e.id);
|
|
10846
|
-
},
|
|
10894
|
+
}, ym);
|
|
10847
10895
|
return;
|
|
10848
10896
|
}
|
|
10849
10897
|
}
|
|
@@ -10853,14 +10901,14 @@ function eh(e = {}) {
|
|
|
10853
10901
|
if (e.status === "interrupted") {
|
|
10854
10902
|
z(), K();
|
|
10855
10903
|
let t = e.updatedAt > 0 ? e.updatedAt : Date.now();
|
|
10856
|
-
Date.now() - t <
|
|
10904
|
+
Date.now() - t < Cm && (x = globalThis.setTimeout(() => {
|
|
10857
10905
|
x = 0, ce(e.id);
|
|
10858
|
-
},
|
|
10906
|
+
}, Sm));
|
|
10859
10907
|
return;
|
|
10860
10908
|
}
|
|
10861
10909
|
K(), x = globalThis.setTimeout(() => {
|
|
10862
10910
|
x = 0, ce(e.id);
|
|
10863
|
-
},
|
|
10911
|
+
}, bm);
|
|
10864
10912
|
}
|
|
10865
10913
|
}, ce = async (e) => {
|
|
10866
10914
|
if (!(w || b?.id !== e)) try {
|
|
@@ -10884,7 +10932,7 @@ function eh(e = {}) {
|
|
|
10884
10932
|
b = {
|
|
10885
10933
|
...b,
|
|
10886
10934
|
status: "failed"
|
|
10887
|
-
}, z(),
|
|
10935
|
+
}, z(), eh(n) && (o = "unavailable"), K();
|
|
10888
10936
|
}
|
|
10889
10937
|
}, q = {
|
|
10890
10938
|
health: N,
|
|
@@ -10896,11 +10944,11 @@ function eh(e = {}) {
|
|
|
10896
10944
|
let n = await A({
|
|
10897
10945
|
action: "target",
|
|
10898
10946
|
thread: t
|
|
10899
|
-
}), r =
|
|
10900
|
-
return s =
|
|
10947
|
+
}), r = Jm(n);
|
|
10948
|
+
return s = qm(n) ?? s, B(t, !l), f = r.thread, p = r.threads, o = "available", c = !0, K(), r;
|
|
10901
10949
|
},
|
|
10902
10950
|
async queue(e) {
|
|
10903
|
-
let r = await
|
|
10951
|
+
let r = await Zm(i, e, t), a = e?.thread?.trim(), s = a || (n ? R() : null);
|
|
10904
10952
|
if (n && !a && (d || !s)) throw Error("Choose a Codex thread before queueing feedback.");
|
|
10905
10953
|
let c = { message: r.message };
|
|
10906
10954
|
s && (c.thread = s);
|
|
@@ -10920,14 +10968,14 @@ function eh(e = {}) {
|
|
|
10920
10968
|
};
|
|
10921
10969
|
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;
|
|
10922
10970
|
} catch (e) {
|
|
10923
|
-
throw n &&
|
|
10971
|
+
throw n && eh(e) && (o = "unavailable", O = k ? null : Wm(e) ?? "unavailable", K()), e;
|
|
10924
10972
|
}
|
|
10925
10973
|
},
|
|
10926
10974
|
send(e) {
|
|
10927
10975
|
return q.queue(e);
|
|
10928
10976
|
}
|
|
10929
10977
|
};
|
|
10930
|
-
e.service.provide(
|
|
10978
|
+
e.service.provide(gm, q);
|
|
10931
10979
|
let le = async () => {
|
|
10932
10980
|
if (!(C || V())) {
|
|
10933
10981
|
if (b?.status === "failed" && b.id) {
|
|
@@ -10965,9 +11013,9 @@ function eh(e = {}) {
|
|
|
10965
11013
|
updatedAt: 0
|
|
10966
11014
|
}) : x = globalThis.setTimeout(() => {
|
|
10967
11015
|
x = 0, ce(e.deliveryId);
|
|
10968
|
-
},
|
|
11016
|
+
}, ym) : S = globalThis.setTimeout(() => {
|
|
10969
11017
|
S = 0, b?.id === null && b?.status === "queued" && (b = null, z(), K());
|
|
10970
|
-
},
|
|
11018
|
+
}, xm);
|
|
10971
11019
|
} catch (e) {
|
|
10972
11020
|
b = null, z(), K();
|
|
10973
11021
|
let t = e instanceof Error ? e.message : String(e);
|
|
@@ -10996,7 +11044,7 @@ function eh(e = {}) {
|
|
|
10996
11044
|
}, 0));
|
|
10997
11045
|
let t = globalThis.setInterval(() => {
|
|
10998
11046
|
k && !c || te(!0).catch(() => void 0);
|
|
10999
|
-
}, k ?
|
|
11047
|
+
}, k ? vm : Mm);
|
|
11000
11048
|
e.lifecycle.onDispose(() => {
|
|
11001
11049
|
w = !0, ae(), globalThis.clearInterval(t), _?.dispose(), _ = void 0;
|
|
11002
11050
|
});
|
|
@@ -11006,15 +11054,15 @@ function eh(e = {}) {
|
|
|
11006
11054
|
}
|
|
11007
11055
|
//#endregion
|
|
11008
11056
|
//#region src/recording.ts
|
|
11009
|
-
var
|
|
11010
|
-
...
|
|
11011
|
-
version:
|
|
11012
|
-
}),
|
|
11013
|
-
...
|
|
11014
|
-
version:
|
|
11015
|
-
}),
|
|
11057
|
+
var nh = df, rh = ff, ih = pf, ah = (e = {}) => ({
|
|
11058
|
+
...Mf(e),
|
|
11059
|
+
version: fp
|
|
11060
|
+
}), oh = Jf, sh = Gf, ch = Kf, lh = qf, uh = 4, dh = so, fh = (e, t) => Ra(e, t), ph = (e = /* @__PURE__ */ new Date()) => za(e), mh = (e, t, n, r) => La(e, t, n, r), hh = (e, t, n) => Ia(e, t, n), gh = (e, t) => io(e, t), _h = (e) => oo(e), vh = (e = {}) => ({
|
|
11061
|
+
...dp(e),
|
|
11062
|
+
version: fp
|
|
11063
|
+
}), yh = (e) => Va(e), bh = (e) => ({
|
|
11016
11064
|
...e,
|
|
11017
|
-
version:
|
|
11018
|
-
}),
|
|
11065
|
+
version: fp
|
|
11066
|
+
}), xh = () => bh(Il()), Sh = () => bh(Ll()), Ch = () => bh(Rl()), wh = () => bh(zl()), Th = () => bh(Vl()), Eh = () => bh(Hl()), Dh = () => bh(Wl()), Oh = () => bh(Ul()), kh = () => Gl().map(bh), Ah = (e = [], t = []) => Kl(e, t).map((e) => e.id.startsWith("mesurer.") ? bh(e) : e);
|
|
11019
11067
|
//#endregion
|
|
11020
|
-
export {
|
|
11068
|
+
export { pp as MESURER_ARRANGE_ACTIVE_STATE_ID, mp as MESURER_ARRANGE_PLUGIN_ID, hp as MESURER_ARRANGE_SERVICE_ID, gp as MESURER_ARRANGE_SETTINGS_STATE_ID, _p as MESURER_ARRANGE_STATE_ID, hm as MESURER_CODEX_PLUGIN_ID, gm as MESURER_CODEX_SERVICE_ID, rm as MESURER_CONTEXT_PLUGIN_ID, im as MESURER_CONTEXT_SERVICE_ID, am as MESURER_CONTEXT_SETTINGS_STATE_ID, bp as MESURER_EDIT_ACTIVE_STATE_ID, xp as MESURER_EDIT_PLUGIN_ID, Sp as MESURER_EDIT_SERVICE_ID, Cp as MESURER_EDIT_SETTINGS_STATE_ID, wp as MESURER_EDIT_STATE_ID, tm as MESURER_LAYOUT_GUIDES_ACTIVE_STATE_ID, Qp as MESURER_LAYOUT_GUIDES_PLUGIN_ID, $p as MESURER_LAYOUT_GUIDES_SERVICE_ID, em as MESURER_LAYOUT_GUIDES_STATE_ID, nh as MESURER_RECORDING_PLUGIN_ID, rh as MESURER_RECORDING_SERVICE_ID, ih as MESURER_RECORDING_SETTINGS_STATE_ID, oh as MESURER_SCREENSHOT_ACTIVE_STATE_ID, sh as MESURER_SCREENSHOT_PLUGIN_ID, ch as MESURER_SCREENSHOT_SERVICE_ID, lh as MESURER_SCREENSHOT_SETTINGS_STATE_ID, uh as MIN_SCREENSHOT_SELECTION, vp as arrange, dh as captureVisibleTabPng, th as codex, Ch as colorPicker, Ah as compose, mm as context, fh as copyPngToClipboard, ph as createScreenshotFilename, mh as cropPngToViewportRect, kh as defaults, Dh as distance, yp as edit, Eh as guides, nm as layoutGuides, hh as normalizeScreenshotRect, gh as prepareScreenshotCapture, ah as recording, _h as releaseScreenshotCapture, wh as rulers, vh as screenshot, xh as select, Oh as settings, Th as typography, yh as waitForNextPaint, Sh as xray };
|