mesurer-solid 0.2.1-beta.6 → 0.2.1-beta.7
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 +798 -592
- package/dist/inject-script.js +3 -3
- package/dist/inject.js +793 -587
- package/dist/plugins.js +1307 -1101
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17973,42 +17973,57 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
17973
17973
|
}, lb = (e) => {
|
|
17974
17974
|
let t = Number.isFinite(e) ? Math.max(0, e) : 0, n = Math.floor(t / 60);
|
|
17975
17975
|
return `${n}:${(t - n * 60).toFixed(2).padStart(5, "0")}`;
|
|
17976
|
-
}, ub = (e, t) => {
|
|
17977
|
-
let
|
|
17978
|
-
return
|
|
17979
|
-
|
|
17980
|
-
|
|
17981
|
-
|
|
17982
|
-
|
|
17983
|
-
|
|
17976
|
+
}, ub = (e, t, n) => {
|
|
17977
|
+
let r = e.createElement("button");
|
|
17978
|
+
return r.type = "button", r.setAttribute("aria-label", t), r.title = t, r.textContent = n, cb(r, {
|
|
17979
|
+
display: "inline-flex",
|
|
17980
|
+
width: "20px",
|
|
17981
|
+
height: "20px",
|
|
17982
|
+
padding: "0",
|
|
17983
|
+
border: "0",
|
|
17984
|
+
"border-radius": "5px",
|
|
17985
|
+
background: "transparent",
|
|
17984
17986
|
color: "var(--msr-content, #18181b)",
|
|
17987
|
+
"align-items": "center",
|
|
17988
|
+
"justify-content": "center",
|
|
17985
17989
|
"font-family": "inherit",
|
|
17986
17990
|
"font-size": "11px",
|
|
17987
|
-
"
|
|
17991
|
+
"line-height": "1",
|
|
17988
17992
|
cursor: "pointer"
|
|
17989
|
-
}),
|
|
17993
|
+
}), r;
|
|
17990
17994
|
}, db = (e, t) => {
|
|
17991
|
-
let n = e.createElement("
|
|
17992
|
-
|
|
17995
|
+
let n = e.createElement("button");
|
|
17996
|
+
n.type = "button", n.setAttribute("role", "menuitemradio"), cb(n, {
|
|
17997
|
+
display: "grid",
|
|
17998
|
+
width: "100%",
|
|
17993
17999
|
height: "28px",
|
|
17994
|
-
padding: "0
|
|
17995
|
-
border: "
|
|
17996
|
-
"border-radius": "
|
|
17997
|
-
background: "
|
|
18000
|
+
padding: "0 8px",
|
|
18001
|
+
border: "0",
|
|
18002
|
+
"border-radius": "6px",
|
|
18003
|
+
background: "transparent",
|
|
17998
18004
|
color: "var(--msr-content, #18181b)",
|
|
18005
|
+
"grid-template-columns": "14px minmax(0, 1fr)",
|
|
18006
|
+
gap: "6px",
|
|
18007
|
+
"align-items": "center",
|
|
18008
|
+
"text-align": "left",
|
|
17999
18009
|
"font-family": "inherit",
|
|
18000
18010
|
"font-size": "11px",
|
|
18001
18011
|
cursor: "pointer"
|
|
18002
|
-
})
|
|
18012
|
+
});
|
|
18013
|
+
let r = e.createElement("span");
|
|
18014
|
+
r.setAttribute("aria-hidden", "true"), r.textContent = "✓", r.style.opacity = "0";
|
|
18015
|
+
let i = e.createElement("span");
|
|
18016
|
+
return i.textContent = t, n.append(r, i), {
|
|
18017
|
+
button: n,
|
|
18018
|
+
check: r,
|
|
18019
|
+
text: i
|
|
18020
|
+
};
|
|
18003
18021
|
}, fb = (e, t, n, r) => {
|
|
18004
|
-
let i = e.createElement("option");
|
|
18005
|
-
i.value = n, i.textContent = r, t.append(i);
|
|
18006
|
-
}, pb = (e, t, n, r) => {
|
|
18007
18022
|
let i = globalThis.URL.createObjectURL(e), a = n.createElement("a");
|
|
18008
18023
|
a.href = i, a.download = t, a.rel = "noopener", n.documentElement.append(a), a.click(), a.remove(), r.setTimeout(() => globalThis.URL.revokeObjectURL(i), 1e3);
|
|
18009
|
-
},
|
|
18024
|
+
}, pb = ({ ownerDocument: e, ownerWindow: t, root: n, formats: r, onDiscard: i, onExport: a }) => {
|
|
18010
18025
|
let o = e.createElement("section");
|
|
18011
|
-
o.dataset.mesurerRecordingPreview = "true", o.dataset.mesurerInspectorUi = "true", o.setAttribute("role", "dialog"), o.setAttribute("aria-label", "Screen recording editor"), cb(o, {
|
|
18026
|
+
o.dataset.mesurerRecordingPreview = "true", o.dataset.mesurerInspectorUi = "true", o.setAttribute("role", "dialog"), o.setAttribute("aria-label", "Screen recording editor"), o.tabIndex = 0, cb(o, {
|
|
18012
18027
|
position: "fixed",
|
|
18013
18028
|
display: "none",
|
|
18014
18029
|
width: `${rb}px`,
|
|
@@ -18023,234 +18038,425 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18023
18038
|
"box-shadow": "var(--msr-shadow-floating, 0 10px 30px rgba(0, 0, 0, 0.12))",
|
|
18024
18039
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif",
|
|
18025
18040
|
"font-size": "11px",
|
|
18026
|
-
"pointer-events": "auto"
|
|
18041
|
+
"pointer-events": "auto",
|
|
18042
|
+
outline: "none",
|
|
18043
|
+
transition: "width 200ms ease"
|
|
18027
18044
|
}), n.append(o);
|
|
18028
18045
|
let s = e.createElement("div");
|
|
18029
18046
|
cb(s, {
|
|
18030
18047
|
position: "relative",
|
|
18048
|
+
display: "flex",
|
|
18031
18049
|
width: "100%",
|
|
18032
18050
|
"min-height": "72px",
|
|
18033
|
-
"max-height": "
|
|
18051
|
+
"max-height": "144px",
|
|
18034
18052
|
overflow: "hidden",
|
|
18035
18053
|
"border-radius": "8px",
|
|
18036
18054
|
background: "var(--msr-surface-muted, #f8fafc)",
|
|
18037
|
-
|
|
18055
|
+
"align-items": "center",
|
|
18056
|
+
"justify-content": "center",
|
|
18057
|
+
transition: "max-height 200ms ease",
|
|
18058
|
+
cursor: "default"
|
|
18038
18059
|
}), o.append(s);
|
|
18039
18060
|
let c = e.createElement("video");
|
|
18040
18061
|
c.muted = !0, c.playsInline = !0, c.preload = "auto", cb(c, {
|
|
18041
18062
|
display: "block",
|
|
18042
18063
|
width: "100%",
|
|
18043
18064
|
height: "100%",
|
|
18044
|
-
"max-
|
|
18065
|
+
"max-width": "100%",
|
|
18066
|
+
"max-height": "144px",
|
|
18045
18067
|
"object-fit": "contain",
|
|
18046
|
-
transition: "max-height
|
|
18068
|
+
transition: "max-height 200ms ease"
|
|
18047
18069
|
}), s.append(c);
|
|
18048
|
-
let l =
|
|
18049
|
-
l.dataset.
|
|
18070
|
+
let l = e.createElement("div");
|
|
18071
|
+
l.dataset.mesurerRecordingExporting = "true", l.textContent = "Exporting…", cb(l, {
|
|
18072
|
+
position: "absolute",
|
|
18073
|
+
inset: "0",
|
|
18074
|
+
display: "none",
|
|
18075
|
+
"align-items": "center",
|
|
18076
|
+
"justify-content": "center",
|
|
18077
|
+
"z-index": "30",
|
|
18078
|
+
background: "rgb(15 23 42 / 45%)",
|
|
18079
|
+
color: "#fff",
|
|
18080
|
+
"font-size": "11px",
|
|
18081
|
+
"pointer-events": "none"
|
|
18082
|
+
}), s.append(l);
|
|
18083
|
+
let u = ub(e, "Close", "×");
|
|
18084
|
+
u.dataset.mesurerRecordingDiscard = "true", cb(u, {
|
|
18050
18085
|
position: "absolute",
|
|
18051
18086
|
top: "6px",
|
|
18052
18087
|
right: "6px",
|
|
18053
18088
|
width: "24px",
|
|
18054
|
-
|
|
18055
|
-
"
|
|
18089
|
+
height: "24px",
|
|
18090
|
+
"z-index": "40",
|
|
18056
18091
|
background: "rgb(15 23 42 / 78%)",
|
|
18057
18092
|
color: "#fff",
|
|
18058
|
-
|
|
18059
|
-
|
|
18060
|
-
|
|
18061
|
-
|
|
18093
|
+
opacity: "0",
|
|
18094
|
+
"pointer-events": "none",
|
|
18095
|
+
transition: "opacity 150ms ease"
|
|
18096
|
+
}), s.append(u), s.addEventListener("mouseenter", () => {
|
|
18097
|
+
u.style.opacity = "1", u.style.pointerEvents = "auto";
|
|
18098
|
+
}), s.addEventListener("mouseleave", () => {
|
|
18099
|
+
e.activeElement !== u && (u.style.opacity = "0", u.style.pointerEvents = "none");
|
|
18100
|
+
}), u.addEventListener("focus", () => {
|
|
18101
|
+
u.style.opacity = "1", u.style.pointerEvents = "auto";
|
|
18102
|
+
}), u.addEventListener("blur", () => {
|
|
18103
|
+
u.style.opacity = "0", u.style.pointerEvents = "none";
|
|
18104
|
+
});
|
|
18105
|
+
let d = e.createElement("div");
|
|
18106
|
+
cb(d, {
|
|
18062
18107
|
display: "flex",
|
|
18108
|
+
height: "20px",
|
|
18063
18109
|
"align-items": "center",
|
|
18064
18110
|
gap: "6px",
|
|
18065
18111
|
"margin-top": "8px"
|
|
18066
|
-
}), o.append(
|
|
18067
|
-
let
|
|
18068
|
-
|
|
18069
|
-
let f = e.createElement("span");
|
|
18070
|
-
f.textContent = "0:00.00", cb(f, {
|
|
18071
|
-
width: "48px",
|
|
18072
|
-
color: "var(--msr-color-ink-500, #64748b)",
|
|
18073
|
-
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
18074
|
-
"font-variant-numeric": "tabular-nums"
|
|
18075
|
-
}), u.append(f);
|
|
18112
|
+
}), o.append(d);
|
|
18113
|
+
let f = ub(e, "Play", "▶");
|
|
18114
|
+
f.dataset.mesurerRecordingPlay = "true", d.append(f);
|
|
18076
18115
|
let p = e.createElement("span");
|
|
18077
|
-
cb(p, {
|
|
18078
|
-
|
|
18116
|
+
p.textContent = "0:00.00", cb(p, {
|
|
18117
|
+
display: "flex",
|
|
18118
|
+
width: "32px",
|
|
18119
|
+
height: "20px",
|
|
18120
|
+
"align-items": "center",
|
|
18121
|
+
"flex-shrink": "0",
|
|
18079
18122
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
18080
18123
|
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
18124
|
+
"font-size": "10px",
|
|
18081
18125
|
"font-variant-numeric": "tabular-nums"
|
|
18082
|
-
}),
|
|
18126
|
+
}), d.append(p);
|
|
18083
18127
|
let m = e.createElement("div");
|
|
18084
|
-
m.dataset.
|
|
18085
|
-
|
|
18128
|
+
m.dataset.mesurerRecordingTimeline = "true", cb(m, {
|
|
18129
|
+
position: "relative",
|
|
18130
|
+
height: "20px",
|
|
18131
|
+
"min-width": "0",
|
|
18132
|
+
flex: "1 1 0",
|
|
18133
|
+
cursor: "pointer",
|
|
18134
|
+
"user-select": "none"
|
|
18135
|
+
}), d.append(m);
|
|
18136
|
+
let h = e.createElement("div");
|
|
18137
|
+
h.dataset.mesurerRecordingTimelineRail = "true", cb(h, {
|
|
18138
|
+
position: "absolute",
|
|
18139
|
+
left: "0",
|
|
18140
|
+
right: "0",
|
|
18141
|
+
top: "50%",
|
|
18142
|
+
height: "3px",
|
|
18143
|
+
transform: "translateY(-50%)",
|
|
18144
|
+
"border-radius": "999px",
|
|
18145
|
+
background: "var(--msr-color-ink-200, #e2e8f0)",
|
|
18146
|
+
"pointer-events": "none"
|
|
18147
|
+
}), m.append(h);
|
|
18148
|
+
let g = e.createElement("div");
|
|
18149
|
+
g.dataset.mesurerRecordingTimelineClip = "true", cb(g, {
|
|
18150
|
+
position: "absolute",
|
|
18151
|
+
top: "50%",
|
|
18152
|
+
height: "3px",
|
|
18153
|
+
transform: "translateY(-50%)",
|
|
18154
|
+
"border-radius": "999px",
|
|
18155
|
+
background: "var(--msr-color-ink-300, #cbd5e1)",
|
|
18156
|
+
"pointer-events": "none"
|
|
18157
|
+
}), m.append(g);
|
|
18158
|
+
let _ = e.createElement("div");
|
|
18159
|
+
cb(_, {
|
|
18160
|
+
position: "absolute",
|
|
18161
|
+
display: "none",
|
|
18162
|
+
top: "50%",
|
|
18163
|
+
width: "2px",
|
|
18164
|
+
height: "10px",
|
|
18165
|
+
transform: "translate(-50%, -50%)",
|
|
18166
|
+
"border-radius": "999px",
|
|
18167
|
+
background: "var(--msr-color-ink-500, #64748b)",
|
|
18168
|
+
opacity: "0.5",
|
|
18169
|
+
"pointer-events": "none"
|
|
18170
|
+
}), m.append(_);
|
|
18171
|
+
let v = e.createElement("div");
|
|
18172
|
+
v.dataset.mesurerRecordingPlayhead = "true", cb(v, {
|
|
18173
|
+
position: "absolute",
|
|
18174
|
+
top: "50%",
|
|
18175
|
+
left: "0",
|
|
18176
|
+
width: "2px",
|
|
18177
|
+
height: "8px",
|
|
18178
|
+
transform: "translate(-50%, -50%)",
|
|
18179
|
+
"border-radius": "999px",
|
|
18180
|
+
background: "var(--msr-content, #18181b)",
|
|
18181
|
+
"z-index": "25",
|
|
18182
|
+
"pointer-events": "none",
|
|
18183
|
+
transition: "height 150ms ease"
|
|
18184
|
+
}), m.append(v);
|
|
18185
|
+
let y = (t, n) => {
|
|
18186
|
+
let r = e.createElement("button");
|
|
18187
|
+
return r.type = "button", r.dataset.mesurerRecordingTrimHandle = t, r.setAttribute("role", "slider"), r.setAttribute("aria-label", n), r.setAttribute("aria-valuemin", "0"), cb(r, {
|
|
18188
|
+
position: "absolute",
|
|
18189
|
+
top: "50%",
|
|
18190
|
+
width: "8px",
|
|
18191
|
+
height: "14px",
|
|
18192
|
+
padding: "0",
|
|
18193
|
+
border: "1px solid var(--msr-surface-raised, #fff)",
|
|
18194
|
+
"border-radius": "3px",
|
|
18195
|
+
background: "var(--msr-content, #18181b)",
|
|
18196
|
+
transform: "translate(-50%, -50%)",
|
|
18197
|
+
"z-index": "20",
|
|
18198
|
+
cursor: "ew-resize"
|
|
18199
|
+
}), m.append(r), r;
|
|
18200
|
+
}, b = y("start", "Trim start"), x = y("end", "Trim end"), S = e.createElement("span");
|
|
18201
|
+
cb(S, {
|
|
18202
|
+
display: "flex",
|
|
18203
|
+
width: "32px",
|
|
18204
|
+
height: "20px",
|
|
18205
|
+
"align-items": "center",
|
|
18206
|
+
"justify-content": "flex-end",
|
|
18207
|
+
"flex-shrink": "0",
|
|
18086
18208
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
18087
18209
|
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
18210
|
+
"font-size": "10px",
|
|
18088
18211
|
"font-variant-numeric": "tabular-nums"
|
|
18089
|
-
}),
|
|
18090
|
-
let
|
|
18091
|
-
cb(
|
|
18092
|
-
|
|
18093
|
-
"grid-template-columns": "32px minmax(0, 1fr)",
|
|
18094
|
-
gap: "5px 8px",
|
|
18095
|
-
"align-items": "center",
|
|
18096
|
-
"margin-top": "5px"
|
|
18097
|
-
}), o.append(h);
|
|
18098
|
-
let g = e.createElement("span");
|
|
18099
|
-
g.textContent = "In", g.style.color = "var(--msr-color-ink-500, #64748b)", h.append(g);
|
|
18100
|
-
let _ = e.createElement("input");
|
|
18101
|
-
_.type = "range", _.min = "0", _.step = "0.01", _.dataset.mesurerRecordingTrimStart = "true", h.append(_);
|
|
18102
|
-
let v = e.createElement("span");
|
|
18103
|
-
v.textContent = "Out", v.style.color = "var(--msr-color-ink-500, #64748b)", h.append(v);
|
|
18104
|
-
let y = e.createElement("input");
|
|
18105
|
-
y.type = "range", y.min = "0", y.step = "0.01", y.dataset.mesurerRecordingTrimEnd = "true", h.append(y);
|
|
18106
|
-
for (let e of [_, y]) cb(e, {
|
|
18107
|
-
width: "100%",
|
|
18108
|
-
height: "20px",
|
|
18109
|
-
margin: "0",
|
|
18110
|
-
accentColor: "var(--msr-accent, #0d99ff)",
|
|
18111
|
-
cursor: "ew-resize"
|
|
18112
|
-
});
|
|
18113
|
-
let b = e.createElement("div");
|
|
18114
|
-
cb(b, {
|
|
18212
|
+
}), d.append(S);
|
|
18213
|
+
let C = e.createElement("div");
|
|
18214
|
+
cb(C, {
|
|
18215
|
+
position: "relative",
|
|
18115
18216
|
display: "flex",
|
|
18116
|
-
|
|
18117
|
-
|
|
18118
|
-
|
|
18119
|
-
|
|
18120
|
-
|
|
18121
|
-
|
|
18122
|
-
|
|
18123
|
-
|
|
18124
|
-
|
|
18125
|
-
|
|
18126
|
-
|
|
18127
|
-
|
|
18128
|
-
color: "var(--msr-surface, #fff)",
|
|
18129
|
-
border: "0"
|
|
18130
|
-
}), b.append(C);
|
|
18131
|
-
let w = ub(e, "Expand");
|
|
18132
|
-
w.dataset.mesurerRecordingExpand = "true", b.append(w);
|
|
18133
|
-
let T = e.createElement("p");
|
|
18134
|
-
T.dataset.mesurerRecordingPreviewStatus = "true", T.setAttribute("role", "status"), cb(T, {
|
|
18217
|
+
height: "20px",
|
|
18218
|
+
"align-items": "center"
|
|
18219
|
+
}), d.append(C);
|
|
18220
|
+
let w = ub(e, "Export options", "1×");
|
|
18221
|
+
w.dataset.mesurerRecordingExportOptions = "true", w.setAttribute("aria-haspopup", "menu"), w.setAttribute("aria-expanded", "false"), cb(w, {
|
|
18222
|
+
width: "28px",
|
|
18223
|
+
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
18224
|
+
"font-size": "10px"
|
|
18225
|
+
}), C.append(w);
|
|
18226
|
+
let T = e.createElement("div");
|
|
18227
|
+
T.dataset.mesurerRecordingExportMenu = "true", T.setAttribute("role", "menu"), cb(T, {
|
|
18228
|
+
position: "absolute",
|
|
18135
18229
|
display: "none",
|
|
18136
|
-
|
|
18230
|
+
right: "0",
|
|
18231
|
+
bottom: "24px",
|
|
18232
|
+
width: "176px",
|
|
18233
|
+
padding: "4px",
|
|
18234
|
+
"z-index": "120",
|
|
18235
|
+
border: "1px solid var(--msr-color-ink-200, #e2e8f0)",
|
|
18236
|
+
"border-radius": "9px",
|
|
18237
|
+
background: "var(--msr-surface-raised, #fff)",
|
|
18238
|
+
color: "var(--msr-content, #18181b)",
|
|
18239
|
+
"box-shadow": "var(--msr-shadow-floating, 0 10px 30px rgba(0, 0, 0, 0.12))",
|
|
18240
|
+
"pointer-events": "auto"
|
|
18241
|
+
}), C.append(T);
|
|
18242
|
+
let E = e.createElement("p");
|
|
18243
|
+
E.textContent = "Format", cb(E, {
|
|
18244
|
+
margin: "0",
|
|
18245
|
+
padding: "4px 8px",
|
|
18137
18246
|
color: "var(--msr-color-ink-500, #64748b)",
|
|
18138
|
-
"font-size": "
|
|
18139
|
-
|
|
18140
|
-
|
|
18141
|
-
|
|
18142
|
-
|
|
18143
|
-
|
|
18144
|
-
|
|
18145
|
-
|
|
18146
|
-
|
|
18147
|
-
|
|
18247
|
+
"font-size": "10px",
|
|
18248
|
+
"font-weight": "500"
|
|
18249
|
+
}), T.append(E);
|
|
18250
|
+
let D = e.createElement("div");
|
|
18251
|
+
T.append(D);
|
|
18252
|
+
let O = e.createElement("p");
|
|
18253
|
+
O.textContent = "Size", cb(O, {
|
|
18254
|
+
margin: "0",
|
|
18255
|
+
padding: "6px 8px 4px",
|
|
18256
|
+
color: "var(--msr-color-ink-500, #64748b)",
|
|
18257
|
+
"font-size": "10px",
|
|
18258
|
+
"font-weight": "500"
|
|
18259
|
+
}), T.append(O);
|
|
18260
|
+
let k = e.createElement("div");
|
|
18261
|
+
T.append(k);
|
|
18262
|
+
let A = [
|
|
18263
|
+
1,
|
|
18264
|
+
2,
|
|
18265
|
+
3
|
|
18266
|
+
].map((t) => {
|
|
18267
|
+
let n = db(e, `${t}×`);
|
|
18268
|
+
return n.button.dataset.mesurerRecordingScale = String(t), k.append(n.button), {
|
|
18269
|
+
scale: t,
|
|
18270
|
+
...n
|
|
18148
18271
|
};
|
|
18149
|
-
},
|
|
18150
|
-
|
|
18151
|
-
|
|
18152
|
-
|
|
18153
|
-
|
|
18272
|
+
}), j = ub(e, "Download", "↓");
|
|
18273
|
+
j.dataset.mesurerRecordingExport = "true", d.append(j);
|
|
18274
|
+
let M = ub(e, "Grow preview", "↗");
|
|
18275
|
+
M.dataset.mesurerRecordingExpand = "true", d.append(M);
|
|
18276
|
+
let N = e.createElement("p");
|
|
18277
|
+
N.dataset.mesurerRecordingPreviewStatus = "true", N.setAttribute("role", "status"), cb(N, {
|
|
18278
|
+
display: "none",
|
|
18279
|
+
margin: "8px 0 0",
|
|
18280
|
+
color: "var(--msr-color-ink-500, #64748b)",
|
|
18281
|
+
"font-size": "11px",
|
|
18282
|
+
"line-height": "16px"
|
|
18283
|
+
}), o.append(N);
|
|
18284
|
+
let P = null, F = null, I = !1, L = !1, R = 0, z = ["webm"], B = "webm", V = 1, H = 0, U = 0, ee = null, te = null, ne = (e) => {
|
|
18285
|
+
let t = P?.duration ?? 0;
|
|
18286
|
+
return t <= 0 ? 0 : Math.min(1, Math.max(0, e / t));
|
|
18287
|
+
}, W = () => ({
|
|
18288
|
+
start: H,
|
|
18289
|
+
end: U
|
|
18290
|
+
}), re = (e) => {
|
|
18291
|
+
let t = P?.duration ?? 0, n = m.getBoundingClientRect();
|
|
18292
|
+
return t <= 0 || n.width <= 0 ? 0 : Math.min(t, Math.max(0, (e - n.left) / n.width * t));
|
|
18293
|
+
}, ie = () => {
|
|
18294
|
+
let e = P?.duration ?? 0, t = Math.min(e, Math.max(0, c.currentTime || 0)), n = ne(H) * 100, r = ne(U) * 100;
|
|
18295
|
+
b.style.left = `${n}%`, x.style.left = `${r}%`, g.style.left = `${n}%`, g.style.width = `${Math.max(0, r - n)}%`, v.style.left = `${ne(t) * 100}%`, b.setAttribute("aria-valuemax", String(Math.max(0, U - sb))), b.setAttribute("aria-valuenow", String(H)), b.setAttribute("aria-valuetext", lb(H)), x.setAttribute("aria-valuemin", String(Math.min(e, H + sb))), x.setAttribute("aria-valuemax", String(e)), x.setAttribute("aria-valuenow", String(U)), x.setAttribute("aria-valuetext", lb(U)), p.textContent = lb(t), S.textContent = lb(e);
|
|
18296
|
+
}, ae = (e, t = !0) => {
|
|
18297
|
+
if (!P) return;
|
|
18298
|
+
let n = Math.min(U, Math.max(H, e));
|
|
18299
|
+
t && !c.paused && c.pause(), c.currentTime = n, ie();
|
|
18300
|
+
}, oe = (e, t = !1) => {
|
|
18301
|
+
P && (H = Math.min(Math.max(0, e), Math.max(0, U - sb)), (t || c.currentTime < H) && ae(H), ie());
|
|
18302
|
+
}, se = (e, t = !1) => {
|
|
18303
|
+
P && (U = Math.max(Math.min(P.duration, e), Math.min(P.duration, H + sb)), t ? ae(U) : c.currentTime > U && ae(H), ie());
|
|
18304
|
+
}, ce = () => {
|
|
18305
|
+
w.textContent = `${V}×`;
|
|
18306
|
+
for (let e of A) {
|
|
18307
|
+
let t = e.scale === V;
|
|
18308
|
+
e.button.setAttribute("aria-checked", t ? "true" : "false"), e.check.style.opacity = t ? "1" : "0", e.text.textContent = P ? `${e.scale}× ${Math.round(P.width * e.scale)} × ${Math.round(P.height * e.scale)}` : `${e.scale}×`;
|
|
18309
|
+
}
|
|
18310
|
+
}, le = () => {
|
|
18311
|
+
D.replaceChildren();
|
|
18312
|
+
for (let t of z) {
|
|
18313
|
+
let n = db(e, t === "mp4" ? "MP4" : "WebM"), r = t === B;
|
|
18314
|
+
n.button.dataset.mesurerRecordingFormat = t, n.button.setAttribute("aria-checked", r ? "true" : "false"), n.check.style.opacity = r ? "1" : "0", n.button.addEventListener("click", () => {
|
|
18315
|
+
B = t, le();
|
|
18316
|
+
}), D.append(n.button);
|
|
18317
|
+
}
|
|
18318
|
+
}, G = () => {
|
|
18319
|
+
if (T.style.display === "none") return;
|
|
18320
|
+
let e = C.getBoundingClientRect(), n = Math.max(1, T.offsetHeight), r = e.top - ab, i = t.innerHeight - e.bottom - ab;
|
|
18321
|
+
r >= n || r >= i ? (T.style.top = "auto", T.style.bottom = "24px") : (T.style.top = "24px", T.style.bottom = "auto");
|
|
18322
|
+
}, ue = (e) => {
|
|
18323
|
+
T.style.display = e ? "block" : "none", w.setAttribute("aria-expanded", e ? "true" : "false"), e && G();
|
|
18324
|
+
}, de = (e) => {
|
|
18325
|
+
L = e, l.style.display = e ? "flex" : "none";
|
|
18154
18326
|
for (let t of [
|
|
18155
|
-
|
|
18156
|
-
|
|
18157
|
-
|
|
18158
|
-
y,
|
|
18327
|
+
f,
|
|
18328
|
+
u,
|
|
18329
|
+
b,
|
|
18159
18330
|
x,
|
|
18160
|
-
|
|
18161
|
-
|
|
18162
|
-
|
|
18331
|
+
w,
|
|
18332
|
+
j,
|
|
18333
|
+
M,
|
|
18334
|
+
...A.map((e) => e.button)
|
|
18163
18335
|
]) t.toggleAttribute("disabled", e);
|
|
18164
|
-
|
|
18165
|
-
}, F = () => {
|
|
18336
|
+
}, fe = () => {
|
|
18166
18337
|
if (o.style.display === "none") return;
|
|
18167
|
-
let r = Math.min(
|
|
18168
|
-
s = Math.min(Math.max(ab, s), Math.max(ab, t.innerWidth - r - ab)), c + i > t.innerHeight - ab && (c = a ? a.top - i - ob : t.innerHeight - i - ab), o.style.left = `${s}px`, o.style.top = `${Math.max(ab, c)}px
|
|
18169
|
-
},
|
|
18170
|
-
c.pause(), c.removeAttribute("src"), c.load(),
|
|
18171
|
-
},
|
|
18172
|
-
|
|
18173
|
-
}
|
|
18174
|
-
|
|
18175
|
-
|
|
18176
|
-
|
|
18177
|
-
if (!(!E || k)) {
|
|
18178
|
-
if (c.paused) {
|
|
18179
|
-
let { start: e, end: t } = M();
|
|
18180
|
-
(c.currentTime < e || c.currentTime >= t) && (c.currentTime = e), c.play();
|
|
18338
|
+
let r = Math.min(I ? ib : rb, Math.max(1, t.innerWidth - 16)), i = Math.max(180, o.offsetHeight), a = (n.closest("[data-mesurer-root='true']")?.querySelector("[data-mesurer-tool-id='recording']") ?? e.querySelector("[data-mesurer-tool-id='recording']"))?.getBoundingClientRect(), s = a ? a.left + a.width / 2 - r / 2 : t.innerWidth - r - ab, c = a ? a.bottom + ob : ab;
|
|
18339
|
+
s = Math.min(Math.max(ab, s), Math.max(ab, t.innerWidth - r - ab)), c + i > t.innerHeight - ab && (c = a ? a.top - i - ob : t.innerHeight - i - ab), o.style.left = `${s}px`, o.style.top = `${Math.max(ab, c)}px`, T.style.display !== "none" && G();
|
|
18340
|
+
}, pe = () => {
|
|
18341
|
+
c.pause(), c.removeAttribute("src"), c.load(), F &&= (globalThis.URL.revokeObjectURL(F), null);
|
|
18342
|
+
}, me = () => {
|
|
18343
|
+
R += 1, pe(), P = null, ee = null, te = null, ue(!1), o.style.display = "none", N.style.display = "none", de(!1);
|
|
18344
|
+
}, he = () => {
|
|
18345
|
+
if (!(!P || L)) {
|
|
18346
|
+
if (!c.paused) {
|
|
18347
|
+
c.pause();
|
|
18181
18348
|
return;
|
|
18182
18349
|
}
|
|
18183
|
-
c.
|
|
18350
|
+
(c.currentTime < H || c.currentTime >= U) && (c.currentTime = H), c.play();
|
|
18184
18351
|
}
|
|
18185
|
-
}
|
|
18186
|
-
|
|
18352
|
+
}, ge = () => {
|
|
18353
|
+
ee = null, te = null, v.style.height = "8px";
|
|
18354
|
+
}, _e = (e) => {
|
|
18355
|
+
if (!ee) return;
|
|
18356
|
+
let t = re(e);
|
|
18357
|
+
ee === "start" ? oe(t, !0) : ee === "end" ? se(t, !0) : ae(t);
|
|
18358
|
+
}, ve = (e, t) => {
|
|
18359
|
+
!P || L || t.button !== 0 || (t.preventDefault(), t.stopPropagation(), ee = e, te = t.pointerId, v.style.height = "10px", _e(t.clientX));
|
|
18360
|
+
}, ye = (e) => {
|
|
18361
|
+
te !== null && e.pointerId === te && _e(e.clientX);
|
|
18362
|
+
}, be = (e) => {
|
|
18363
|
+
te !== null && e.pointerId === te && ge();
|
|
18364
|
+
};
|
|
18365
|
+
b.addEventListener("pointerdown", (e) => ve("start", e)), x.addEventListener("pointerdown", (e) => ve("end", e)), m.addEventListener("pointerdown", (e) => {
|
|
18366
|
+
let t = e.target;
|
|
18367
|
+
t instanceof Element && t.closest("[data-mesurer-recording-trim-handle]") || ve("playhead", e);
|
|
18368
|
+
}), m.addEventListener("pointermove", (e) => {
|
|
18369
|
+
te === null && (_.style.display = "block", _.style.left = `${ne(re(e.clientX)) * 100}%`);
|
|
18370
|
+
}), m.addEventListener("pointerleave", () => {
|
|
18371
|
+
_.style.display = "none";
|
|
18372
|
+
});
|
|
18373
|
+
for (let [e, t] of [["start", b], ["end", x]]) t.addEventListener("keydown", (t) => {
|
|
18374
|
+
if (!P || t.key !== "ArrowLeft" && t.key !== "ArrowRight") return;
|
|
18375
|
+
t.preventDefault();
|
|
18376
|
+
let n = t.key === "ArrowLeft" ? -1 : 1, r = (e === "start" ? H : U) + n * .05;
|
|
18377
|
+
e === "start" ? oe(r, !0) : se(r, !0);
|
|
18378
|
+
});
|
|
18379
|
+
t.addEventListener("pointermove", ye, !0), t.addEventListener("pointerup", be, !0), t.addEventListener("pointercancel", be, !0), u.addEventListener("click", (e) => {
|
|
18380
|
+
e.stopPropagation(), me(), i();
|
|
18381
|
+
}), s.addEventListener("click", (e) => {
|
|
18382
|
+
let t = e.target;
|
|
18383
|
+
t instanceof Element && t.closest("button") || he();
|
|
18384
|
+
}), f.addEventListener("click", he), c.addEventListener("play", () => {
|
|
18385
|
+
f.textContent = "Ⅱ", f.setAttribute("aria-label", "Pause"), f.title = "Pause";
|
|
18187
18386
|
}), c.addEventListener("pause", () => {
|
|
18188
|
-
|
|
18387
|
+
f.textContent = "▶", f.setAttribute("aria-label", "Play"), f.title = "Play";
|
|
18189
18388
|
}), c.addEventListener("timeupdate", () => {
|
|
18190
|
-
|
|
18191
|
-
|
|
18192
|
-
|
|
18193
|
-
}), _.addEventListener("input", () => {
|
|
18194
|
-
if (!E) return;
|
|
18195
|
-
let e = Math.min(E.duration - sb, Math.max(0, Number(_.value) || 0));
|
|
18196
|
-
_.value = String(e), (Number(y.value) || E.duration) < e + sb && (y.value = String(Math.min(E.duration, e + sb))), c.currentTime = e, N();
|
|
18197
|
-
}), y.addEventListener("input", () => {
|
|
18198
|
-
if (!E) return;
|
|
18199
|
-
let e = Number(_.value) || 0, t = Math.max(e + sb, Math.min(E.duration, Number(y.value) || E.duration));
|
|
18200
|
-
y.value = String(t), c.currentTime = t, N();
|
|
18389
|
+
P && (c.currentTime >= U - .01 ? (c.pause(), c.currentTime = H) : c.currentTime < H && (c.currentTime = H), ie());
|
|
18390
|
+
}), c.addEventListener("loadedmetadata", () => {
|
|
18391
|
+
ie();
|
|
18201
18392
|
}), w.addEventListener("click", () => {
|
|
18202
|
-
|
|
18203
|
-
})
|
|
18204
|
-
|
|
18205
|
-
|
|
18206
|
-
|
|
18207
|
-
|
|
18393
|
+
L || ue(T.style.display === "none");
|
|
18394
|
+
});
|
|
18395
|
+
for (let e of A) e.button.addEventListener("click", () => {
|
|
18396
|
+
V = e.scale, ce();
|
|
18397
|
+
});
|
|
18398
|
+
let xe = (e) => {
|
|
18399
|
+
T.style.display !== "none" && (e.composedPath().includes(C) || ue(!1));
|
|
18400
|
+
};
|
|
18401
|
+
e.addEventListener("pointerdown", xe, !0), M.addEventListener("click", () => {
|
|
18402
|
+
I = !I, o.style.width = `${I ? ib : rb}px`, s.style.maxHeight = I ? "448px" : "144px", c.style.maxHeight = I ? "448px" : "144px", M.textContent = I ? "↙" : "↗", M.setAttribute("aria-label", I ? "Shrink preview" : "Grow preview"), M.title = I ? "Shrink preview" : "Grow preview", t.requestAnimationFrame(fe);
|
|
18403
|
+
}), j.addEventListener("click", () => {
|
|
18404
|
+
if (!P || L || z.length === 0) return;
|
|
18405
|
+
let n = ++R, { start: r, end: i } = W();
|
|
18406
|
+
de(!0), ue(!1), N.style.display = "none", a({
|
|
18407
|
+
format: B,
|
|
18208
18408
|
startTime: r,
|
|
18209
18409
|
endTime: i,
|
|
18210
|
-
scale:
|
|
18410
|
+
scale: V
|
|
18211
18411
|
}).then((r) => {
|
|
18212
|
-
n ===
|
|
18412
|
+
n === R && fb(r.blob, r.filename, e, t);
|
|
18213
18413
|
}).catch((e) => {
|
|
18214
|
-
n ===
|
|
18414
|
+
n === R && (N.style.display = "block", N.style.color = "var(--msr-danger-text, #dc2626)", N.textContent = e instanceof Error ? e.message : "Could not export the recording.");
|
|
18215
18415
|
}).finally(() => {
|
|
18216
|
-
n ===
|
|
18416
|
+
n === R && de(!1);
|
|
18217
18417
|
});
|
|
18418
|
+
}), o.addEventListener("keydown", (e) => {
|
|
18419
|
+
if (e.key === "Escape") {
|
|
18420
|
+
if (T.style.display !== "none") {
|
|
18421
|
+
e.preventDefault(), ue(!1);
|
|
18422
|
+
return;
|
|
18423
|
+
}
|
|
18424
|
+
e.preventDefault(), me(), i();
|
|
18425
|
+
return;
|
|
18426
|
+
}
|
|
18427
|
+
(e.key === " " || e.code === "Space") && e.target === o && (e.preventDefault(), he());
|
|
18218
18428
|
});
|
|
18219
|
-
let
|
|
18220
|
-
return t.addEventListener("resize",
|
|
18221
|
-
show(
|
|
18222
|
-
|
|
18223
|
-
let
|
|
18224
|
-
|
|
18225
|
-
let
|
|
18226
|
-
r(
|
|
18227
|
-
|
|
18228
|
-
x.replaceChildren();
|
|
18229
|
-
for (let n of t) fb(e, x, n, n === "mp4" ? "MP4" : "WebM");
|
|
18230
|
-
t.length === 0 ? (fb(e, x, "webm", "No export codec"), x.disabled = !0, C.disabled = !0, T.style.display = "block", T.textContent = "No MediaBunny video encoder is available in this runtime.") : (x.disabled = !1, C.disabled = !1);
|
|
18231
|
-
}
|
|
18429
|
+
let Se = () => fe();
|
|
18430
|
+
return t.addEventListener("resize", Se), {
|
|
18431
|
+
show(e) {
|
|
18432
|
+
R += 1, pe(), P = e, I = !1, V = 1, B = "webm", z = ["webm"], H = 0, U = e.duration, ee = null, te = null;
|
|
18433
|
+
let n = globalThis.URL.createObjectURL(e.blob);
|
|
18434
|
+
F = 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 = `${rb}px`, s.style.maxHeight = "144px", c.style.maxHeight = "144px", M.textContent = "↗", M.setAttribute("aria-label", "Grow preview"), M.title = "Grow preview", p.textContent = "0:00.00", S.textContent = lb(e.duration), N.style.display = "none", N.style.color = "var(--msr-color-ink-500, #64748b)", ue(!1), le(), ce(), ie(), de(!1), o.style.display = "block", fe(), o.focus({ preventScroll: !0 });
|
|
18435
|
+
let i = R;
|
|
18436
|
+
r(e).then((e) => {
|
|
18437
|
+
i !== R || !P || (z = e, B = e.includes(B) ? B : e[0] ?? "webm", le(), j.disabled = e.length === 0, e.length === 0 && (N.style.display = "block", N.style.color = "var(--msr-danger-text, #dc2626)", N.textContent = "No MediaBunny video encoder is available in this runtime."));
|
|
18232
18438
|
}).catch((e) => {
|
|
18233
|
-
|
|
18234
|
-
}), t.requestAnimationFrame(
|
|
18439
|
+
i === R && (z = [], le(), j.disabled = !0, N.style.display = "block", N.style.color = "var(--msr-danger-text, #dc2626)", N.textContent = e instanceof Error ? e.message : "Could not inspect export support.");
|
|
18440
|
+
}), t.requestAnimationFrame(fe);
|
|
18235
18441
|
},
|
|
18236
|
-
dismiss:
|
|
18442
|
+
dismiss: me,
|
|
18237
18443
|
dispose() {
|
|
18238
|
-
|
|
18444
|
+
me(), t.removeEventListener("resize", Se), t.removeEventListener("pointermove", ye, !0), t.removeEventListener("pointerup", be, !0), t.removeEventListener("pointercancel", be, !0), e.removeEventListener("pointerdown", xe, !0), o.remove();
|
|
18239
18445
|
}
|
|
18240
18446
|
};
|
|
18241
|
-
},
|
|
18447
|
+
}, mb = "mesurer.recording", hb = "recording:v1", gb = "mesurer.recording.settings", _b = "runtime:solid", vb = "recording.toggle", yb = "recording.stop", bb = "recording.discard", xb = "recording.export", Sb = 30, Cb = 60, wb = 3e3, Tb = {
|
|
18242
18448
|
viewBox: "0 0 24 24",
|
|
18243
18449
|
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"]
|
|
18244
|
-
},
|
|
18450
|
+
}, Eb = (e) => e ? { ...e } : null, Db = (e) => ({
|
|
18245
18451
|
...e,
|
|
18246
|
-
rect:
|
|
18247
|
-
}),
|
|
18452
|
+
rect: Eb(e.rect)
|
|
18453
|
+
}), Ob = (e, t) => {
|
|
18248
18454
|
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
18249
|
-
},
|
|
18250
|
-
if (!
|
|
18455
|
+
}, kb = (e) => e != null && !Array.isArray(e) && typeof e == "object", Ab = (e) => typeof e == "number" && Number.isFinite(e), jb = (e) => {
|
|
18456
|
+
if (!kb(e)) return {};
|
|
18251
18457
|
let t = {};
|
|
18252
|
-
return (e.format === "webm" || e.format === "mp4") && (t.format = e.format),
|
|
18253
|
-
},
|
|
18458
|
+
return (e.format === "webm" || e.format === "mp4") && (t.format = e.format), Ab(e.startTime) && (t.startTime = e.startTime), Ab(e.endTime) && (t.endTime = e.endTime), (e.scale === 1 || e.scale === 2 || e.scale === 3) && (t.scale = e.scale), t;
|
|
18459
|
+
}, Mb = (e) => ({
|
|
18254
18460
|
status: e.status,
|
|
18255
18461
|
elapsed: e.elapsed,
|
|
18256
18462
|
rect: e.rect ? { ...e.rect } : null,
|
|
@@ -18258,56 +18464,56 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18258
18464
|
width: e.width,
|
|
18259
18465
|
height: e.height,
|
|
18260
18466
|
error: e.error
|
|
18261
|
-
}),
|
|
18467
|
+
}), Nb = (e) => ({
|
|
18262
18468
|
filename: e.filename,
|
|
18263
18469
|
format: e.format,
|
|
18264
18470
|
duration: e.duration,
|
|
18265
18471
|
width: e.width,
|
|
18266
18472
|
height: e.height,
|
|
18267
18473
|
bytes: e.blob.size
|
|
18268
|
-
}),
|
|
18474
|
+
}), Pb = (e) => ({
|
|
18269
18475
|
format: e.format,
|
|
18270
18476
|
duration: e.duration,
|
|
18271
18477
|
width: e.width,
|
|
18272
18478
|
height: e.height,
|
|
18273
18479
|
bytes: e.blob.size,
|
|
18274
18480
|
createdAt: e.createdAt
|
|
18275
|
-
}),
|
|
18481
|
+
}), Fb = (e, t, n) => {
|
|
18276
18482
|
let r = globalThis.URL.createObjectURL(e.blob), i = t.createElement("a");
|
|
18277
18483
|
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);
|
|
18278
|
-
},
|
|
18279
|
-
id:
|
|
18484
|
+
}, Ib = (e = {}) => Ta({
|
|
18485
|
+
id: mb,
|
|
18280
18486
|
version: "0.1.0",
|
|
18281
|
-
requires: [
|
|
18282
|
-
provides: ["tool:recording",
|
|
18487
|
+
requires: [_b],
|
|
18488
|
+
provides: ["tool:recording", hb],
|
|
18283
18489
|
setup(t) {
|
|
18284
|
-
let n = t.service.get(
|
|
18490
|
+
let n = t.service.get(_b);
|
|
18285
18491
|
if (!n) throw Error("Recording plugin requires the Solid renderer runtime.");
|
|
18286
18492
|
let { ownerDocument: r, ownerWindow: i } = n, a = n.createInspectorMount(), o = a.element, s = n.rendererRoot ?? n.portalTarget.querySelector("[data-mesurer-root='true']"), c = (e) => {
|
|
18287
18493
|
s?.toggleAttribute("data-mesurer-recording-active", e);
|
|
18288
18494
|
let t = s?.querySelector("[data-mesurer-interaction-overlay='true']");
|
|
18289
18495
|
t && (e ? (t.style.setProperty("pointer-events", "none", "important"), t.style.setProperty("cursor", "default", "important")) : (t.style.removeProperty("pointer-events"), t.style.removeProperty("cursor")));
|
|
18290
18496
|
};
|
|
18291
|
-
o.dataset.mesurerRecording = "true",
|
|
18497
|
+
o.dataset.mesurerRecording = "true", Ob(o, {
|
|
18292
18498
|
position: "fixed",
|
|
18293
18499
|
inset: "0",
|
|
18294
18500
|
"z-index": "86",
|
|
18295
18501
|
"pointer-events": "none",
|
|
18296
18502
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
18297
18503
|
});
|
|
18298
|
-
let l = Math.max(1, Math.min(60, Math.round(e.frameRate ??
|
|
18504
|
+
let l = Math.max(1, Math.min(60, Math.round(e.frameRate ?? Sb))), u = Math.max(1, Math.min(600, e.maxDurationSeconds ?? Cb)), d = e.quality ?? "medium";
|
|
18299
18505
|
t.state.register({
|
|
18300
|
-
id:
|
|
18506
|
+
id: gb,
|
|
18301
18507
|
initial: { toolEnabled: e.toolEnabled ?? !0 },
|
|
18302
18508
|
persist: !0
|
|
18303
18509
|
});
|
|
18304
18510
|
let f = () => ({ toolEnabled: t.state.get("mesurer.recording.settings")?.toolEnabled ?? !0 }), p = (e) => {
|
|
18305
|
-
t.state.update(
|
|
18511
|
+
t.state.update(gb, (t) => {
|
|
18306
18512
|
let n = { ...t };
|
|
18307
18513
|
return e.toolEnabled !== void 0 && (n.toolEnabled = e.toolEnabled), n;
|
|
18308
18514
|
});
|
|
18309
18515
|
}, m = r.createElement("div");
|
|
18310
|
-
m.dataset.mesurerRecordingSelect = "true", m.dataset.mesurerInspectorUi = "true", m.setAttribute("role", "application"), m.setAttribute("aria-label", "Recording selection"),
|
|
18516
|
+
m.dataset.mesurerRecordingSelect = "true", m.dataset.mesurerInspectorUi = "true", m.setAttribute("role", "application"), m.setAttribute("aria-label", "Recording selection"), Ob(m, {
|
|
18311
18517
|
position: "fixed",
|
|
18312
18518
|
inset: "0",
|
|
18313
18519
|
display: "none",
|
|
@@ -18319,13 +18525,13 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18319
18525
|
}), o.append(m);
|
|
18320
18526
|
let h = Array.from({ length: 4 }, () => {
|
|
18321
18527
|
let e = r.createElement("div");
|
|
18322
|
-
return
|
|
18528
|
+
return Ob(e, {
|
|
18323
18529
|
position: "fixed",
|
|
18324
18530
|
background: "rgb(0 0 0 / 40%)",
|
|
18325
18531
|
"pointer-events": "none"
|
|
18326
18532
|
}), m.append(e), e;
|
|
18327
18533
|
}), g = r.createElement("div");
|
|
18328
|
-
g.dataset.mesurerRecordingSelection = "true",
|
|
18534
|
+
g.dataset.mesurerRecordingSelection = "true", Ob(g, {
|
|
18329
18535
|
position: "fixed",
|
|
18330
18536
|
display: "none",
|
|
18331
18537
|
border: "1px solid var(--msr-accent, #0d99ff)",
|
|
@@ -18333,7 +18539,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18333
18539
|
"pointer-events": "none"
|
|
18334
18540
|
}), m.append(g);
|
|
18335
18541
|
let _ = r.createElement("div");
|
|
18336
|
-
|
|
18542
|
+
Ob(_, {
|
|
18337
18543
|
position: "fixed",
|
|
18338
18544
|
display: "none",
|
|
18339
18545
|
transform: "translateX(-50%)",
|
|
@@ -18346,7 +18552,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18346
18552
|
"pointer-events": "none"
|
|
18347
18553
|
}), m.append(_);
|
|
18348
18554
|
let v = r.createElement("div");
|
|
18349
|
-
v.textContent = "Drag a region to record · Esc to cancel",
|
|
18555
|
+
v.textContent = "Drag a region to record · Esc to cancel", Ob(v, {
|
|
18350
18556
|
position: "fixed",
|
|
18351
18557
|
left: "50%",
|
|
18352
18558
|
bottom: "16px",
|
|
@@ -18359,7 +18565,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18359
18565
|
"pointer-events": "none"
|
|
18360
18566
|
}), m.append(v);
|
|
18361
18567
|
let y = r.createElement("div");
|
|
18362
|
-
y.dataset.mesurerRecordingRegion = "true", y.dataset.mesurerInspectorUi = "true", y.setAttribute("role", "dialog"), y.setAttribute("aria-label", "Recording region"),
|
|
18568
|
+
y.dataset.mesurerRecordingRegion = "true", y.dataset.mesurerInspectorUi = "true", y.setAttribute("role", "dialog"), y.setAttribute("aria-label", "Recording region"), Ob(y, {
|
|
18363
18569
|
position: "fixed",
|
|
18364
18570
|
display: "none",
|
|
18365
18571
|
width: "220px",
|
|
@@ -18377,7 +18583,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18377
18583
|
}), m.append(y);
|
|
18378
18584
|
let b = (e) => {
|
|
18379
18585
|
let t = r.createElement("label");
|
|
18380
|
-
|
|
18586
|
+
Ob(t, {
|
|
18381
18587
|
display: "grid",
|
|
18382
18588
|
"grid-template-columns": "44px minmax(0,1fr)",
|
|
18383
18589
|
"align-items": "center",
|
|
@@ -18386,7 +18592,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18386
18592
|
let n = r.createElement("span");
|
|
18387
18593
|
n.textContent = e, n.style.color = "var(--msr-color-ink-500, #64748b)", t.append(n);
|
|
18388
18594
|
let i = r.createElement("div");
|
|
18389
|
-
return
|
|
18595
|
+
return Ob(i, {
|
|
18390
18596
|
display: "flex",
|
|
18391
18597
|
"align-items": "center",
|
|
18392
18598
|
gap: "4px",
|
|
@@ -18394,7 +18600,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18394
18600
|
}), t.append(i), y.append(t), i;
|
|
18395
18601
|
}, x = (e) => {
|
|
18396
18602
|
let t = r.createElement("input");
|
|
18397
|
-
return t.type = "number", t.setAttribute("aria-label", e), t.step = "1",
|
|
18603
|
+
return t.type = "number", t.setAttribute("aria-label", e), t.step = "1", Ob(t, {
|
|
18398
18604
|
width: "0",
|
|
18399
18605
|
"min-width": "0",
|
|
18400
18606
|
flex: "1 1 0",
|
|
@@ -18421,7 +18627,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18421
18627
|
let A = r.createElement("span");
|
|
18422
18628
|
A.textContent = "px", A.style.color = "var(--msr-color-ink-500, #64748b)", D.append(A);
|
|
18423
18629
|
let j = r.createElement("button");
|
|
18424
|
-
j.type = "button", j.dataset.mesurerRecordingStart = "true", j.textContent = "● Start recording",
|
|
18630
|
+
j.type = "button", j.dataset.mesurerRecordingStart = "true", j.textContent = "● Start recording", Ob(j, {
|
|
18425
18631
|
width: "100%",
|
|
18426
18632
|
height: "28px",
|
|
18427
18633
|
"margin-top": "8px",
|
|
@@ -18435,7 +18641,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18435
18641
|
cursor: "pointer"
|
|
18436
18642
|
}), y.append(j);
|
|
18437
18643
|
let M = r.createElement("div");
|
|
18438
|
-
M.dataset.mesurerRecordingGrid = "true",
|
|
18644
|
+
M.dataset.mesurerRecordingGrid = "true", Ob(M, {
|
|
18439
18645
|
position: "absolute",
|
|
18440
18646
|
inset: "0",
|
|
18441
18647
|
display: "none",
|
|
@@ -18443,7 +18649,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18443
18649
|
}), g.append(M);
|
|
18444
18650
|
let N = (e) => {
|
|
18445
18651
|
let t = r.createElement("div");
|
|
18446
|
-
|
|
18652
|
+
Ob(t, {
|
|
18447
18653
|
position: "absolute",
|
|
18448
18654
|
opacity: "0.3",
|
|
18449
18655
|
...e
|
|
@@ -18505,7 +18711,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18505
18711
|
}
|
|
18506
18712
|
}).map(([e, t]) => {
|
|
18507
18713
|
let n = r.createElement("button");
|
|
18508
|
-
return n.type = "button", n.dataset.mesurerRecordingResize = e, n.setAttribute("aria-label", `Resize ${e}`),
|
|
18714
|
+
return n.type = "button", n.dataset.mesurerRecordingResize = e, n.setAttribute("aria-label", `Resize ${e}`), Ob(n, {
|
|
18509
18715
|
position: "absolute",
|
|
18510
18716
|
display: "none",
|
|
18511
18717
|
left: t.left,
|
|
@@ -18522,7 +18728,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18522
18728
|
"pointer-events": "auto"
|
|
18523
18729
|
}), g.append(n), n;
|
|
18524
18730
|
}), F = r.createElement("section");
|
|
18525
|
-
F.dataset.mesurerRecordingStatus = "true", F.dataset.mesurerInspectorUi = "true", F.setAttribute("aria-label", "Screen recording"),
|
|
18731
|
+
F.dataset.mesurerRecordingStatus = "true", F.dataset.mesurerInspectorUi = "true", F.setAttribute("aria-label", "Screen recording"), Ob(F, {
|
|
18526
18732
|
position: "fixed",
|
|
18527
18733
|
display: "none",
|
|
18528
18734
|
height: "34px",
|
|
@@ -18539,7 +18745,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18539
18745
|
"pointer-events": "auto"
|
|
18540
18746
|
});
|
|
18541
18747
|
let I = r.createElement("span");
|
|
18542
|
-
I.setAttribute("aria-hidden", "true"),
|
|
18748
|
+
I.setAttribute("aria-hidden", "true"), Ob(I, {
|
|
18543
18749
|
width: "6px",
|
|
18544
18750
|
height: "6px",
|
|
18545
18751
|
"border-radius": "999px",
|
|
@@ -18547,14 +18753,14 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18547
18753
|
"flex-shrink": "0"
|
|
18548
18754
|
}), F.append(I);
|
|
18549
18755
|
let L = r.createElement("span");
|
|
18550
|
-
L.dataset.mesurerRecordingTime = "true", L.textContent = "00:00",
|
|
18756
|
+
L.dataset.mesurerRecordingTime = "true", L.textContent = "00:00", Ob(L, {
|
|
18551
18757
|
color: "var(--msr-content, #18181b)",
|
|
18552
18758
|
"font-family": "ui-monospace, SFMono-Regular, Menlo, monospace",
|
|
18553
18759
|
"font-size": "11px",
|
|
18554
18760
|
"font-variant-numeric": "tabular-nums"
|
|
18555
18761
|
}), F.append(L);
|
|
18556
18762
|
let R = r.createElement("button");
|
|
18557
|
-
R.type = "button", R.dataset.mesurerRecordingStop = "true", R.textContent = "Stop", R.setAttribute("aria-label", "Stop recording"),
|
|
18763
|
+
R.type = "button", R.dataset.mesurerRecordingStop = "true", R.textContent = "Stop", R.setAttribute("aria-label", "Stop recording"), Ob(R, {
|
|
18558
18764
|
height: "24px",
|
|
18559
18765
|
padding: "0 8px",
|
|
18560
18766
|
border: "0",
|
|
@@ -18567,7 +18773,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18567
18773
|
cursor: "pointer"
|
|
18568
18774
|
}), F.append(R), o.append(F);
|
|
18569
18775
|
let z = r.createElement("div");
|
|
18570
|
-
z.dataset.mesurerRecordingError = "true", z.dataset.mesurerInspectorUi = "true", z.setAttribute("role", "status"),
|
|
18776
|
+
z.dataset.mesurerRecordingError = "true", z.dataset.mesurerInspectorUi = "true", z.setAttribute("role", "status"), Ob(z, {
|
|
18571
18777
|
position: "fixed",
|
|
18572
18778
|
display: "none",
|
|
18573
18779
|
left: "8px",
|
|
@@ -18589,13 +18795,13 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18589
18795
|
height: null,
|
|
18590
18796
|
error: null
|
|
18591
18797
|
}, V = /* @__PURE__ */ new Set(), H = null, U = null, ee = null, te = null, ne = null, W = null, re = !1, ie = null, ae = null, oe = 0, se = 0, ce = 0, le = 0, G = 0, ue = -1, de = !1, fe = null, pe = () => {
|
|
18592
|
-
let e =
|
|
18798
|
+
let e = Db(B);
|
|
18593
18799
|
for (let t of V) t(e);
|
|
18594
18800
|
}, me = (e) => {
|
|
18595
18801
|
B = {
|
|
18596
18802
|
...B,
|
|
18597
18803
|
...e,
|
|
18598
|
-
rect: e.rect === void 0 ? B.rect :
|
|
18804
|
+
rect: e.rect === void 0 ? B.rect : Eb(e.rect)
|
|
18599
18805
|
}, pe();
|
|
18600
18806
|
}, he = () => B.status === "selecting" || B.status === "recording" || B.status === "exporting", ge = () => {
|
|
18601
18807
|
if (ae) return;
|
|
@@ -18728,7 +18934,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18728
18934
|
let t = e instanceof Error ? e.message : "Could not record this region.";
|
|
18729
18935
|
z.textContent = t, z.style.display = "block", ce = i.setTimeout(() => {
|
|
18730
18936
|
ce = 0, z.style.display = "none";
|
|
18731
|
-
},
|
|
18937
|
+
}, wb);
|
|
18732
18938
|
}, ke = async (e) => {
|
|
18733
18939
|
oe && i.cancelAnimationFrame(oe), oe = 0, se && i.clearTimeout(se), se = 0;
|
|
18734
18940
|
let t = te;
|
|
@@ -18785,7 +18991,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18785
18991
|
error: e instanceof Error ? e.message : "Could not export the recording."
|
|
18786
18992
|
}), e;
|
|
18787
18993
|
}
|
|
18788
|
-
}, Ne =
|
|
18994
|
+
}, Ne = pb({
|
|
18789
18995
|
ownerDocument: r,
|
|
18790
18996
|
ownerWindow: i,
|
|
18791
18997
|
root: o,
|
|
@@ -18795,7 +19001,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
18795
19001
|
}), Pe = async () => {
|
|
18796
19002
|
if (fe) return fe;
|
|
18797
19003
|
if (B.status !== "recording" || !ee || !U) throw Error("No recording is active.");
|
|
18798
|
-
let e = le, n = ee, r = U, a =
|
|
19004
|
+
let e = le, n = ee, r = U, a = Eb(B.rect);
|
|
18799
19005
|
if (!a) throw Error("Recording region is unavailable.");
|
|
18800
19006
|
return fe = (async () => {
|
|
18801
19007
|
oe && i.cancelAnimationFrame(oe), oe = 0, se && i.clearTimeout(se), se = 0;
|
|
@@ -19058,7 +19264,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19058
19264
|
B.status === "recording" && Pe().catch(() => void 0);
|
|
19059
19265
|
});
|
|
19060
19266
|
let qe = {
|
|
19061
|
-
snapshot: () =>
|
|
19267
|
+
snapshot: () => Db(B),
|
|
19062
19268
|
subscribe(e) {
|
|
19063
19269
|
return V.add(e), () => V.delete(e);
|
|
19064
19270
|
},
|
|
@@ -19074,9 +19280,9 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19074
19280
|
label: "Record",
|
|
19075
19281
|
shortcut: "Shift+R",
|
|
19076
19282
|
order: 72,
|
|
19077
|
-
command:
|
|
19283
|
+
command: vb,
|
|
19078
19284
|
toolbarMode: "select",
|
|
19079
|
-
icon:
|
|
19285
|
+
icon: Tb,
|
|
19080
19286
|
active: he,
|
|
19081
19287
|
hidden: () => !f().toolEnabled,
|
|
19082
19288
|
menu: {
|
|
@@ -19116,21 +19322,21 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19116
19322
|
p({ toolEnabled: e }), !e && he() && await ze();
|
|
19117
19323
|
}
|
|
19118
19324
|
}]
|
|
19119
|
-
}), t.command.register(
|
|
19120
|
-
let t = await Me(
|
|
19121
|
-
return
|
|
19122
|
-
}), t.service.provide(
|
|
19325
|
+
}), t.command.register(vb, async () => (await Re(), Mb(B))), t.command.register(yb, async () => Pb(await Pe())), t.command.register(bb, () => (Ae(), Mb(B))), t.command.register(xb, async (e) => {
|
|
19326
|
+
let t = await Me(jb(e));
|
|
19327
|
+
return Fb(t, r, i), Nb(t);
|
|
19328
|
+
}), t.service.provide(hb, qe), t.lifecycle.onDispose(() => {
|
|
19123
19329
|
de = !0, ++le, V.clear(), m.removeEventListener("pointerdown", Ve), m.removeEventListener("pointermove", He), m.removeEventListener("pointerup", Ue), m.removeEventListener("pointercancel", We), i.removeEventListener("keydown", Ge, !0), ce && i.clearTimeout(ce), Ne.dispose(), Te(), _e(), ke(!0), a.dispose();
|
|
19124
19330
|
});
|
|
19125
19331
|
}
|
|
19126
|
-
}),
|
|
19332
|
+
}), Lb = 144, Rb = 96, zb = 8, Bb = 4, Vb = 1800, Hb = (e, t) => {
|
|
19127
19333
|
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
19128
|
-
},
|
|
19129
|
-
left: Math.min(Math.max(
|
|
19130
|
-
top: Math.min(Math.max(
|
|
19131
|
-
}),
|
|
19334
|
+
}, Ub = (e, t) => ({
|
|
19335
|
+
left: Math.min(Math.max(zb, e.left), Math.max(zb, t.innerWidth - Lb - zb)),
|
|
19336
|
+
top: Math.min(Math.max(zb, e.top), Math.max(zb, t.innerHeight - Rb - zb))
|
|
19337
|
+
}), Wb = (e, t) => {
|
|
19132
19338
|
let n = e.createElement("button");
|
|
19133
|
-
return n.type = "button", n.textContent = t,
|
|
19339
|
+
return n.type = "button", n.textContent = t, Hb(n, {
|
|
19134
19340
|
height: "32px",
|
|
19135
19341
|
padding: "0 12px",
|
|
19136
19342
|
border: "1px solid rgb(255 255 255 / 18%)",
|
|
@@ -19142,11 +19348,11 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19142
19348
|
"font-weight": "500",
|
|
19143
19349
|
cursor: "pointer"
|
|
19144
19350
|
}), n;
|
|
19145
|
-
},
|
|
19351
|
+
}, Gb = ({ 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", Kb = (e) => e !== null && (e.nodeType === 1 || e.nodeType === 11), qb = ({ ownerDocument: e, ownerWindow: t, root: n, previewDurationMs: r }) => {
|
|
19146
19352
|
let i = n.closest("[data-mesurer-root='true']")?.parentNode ?? n.parentNode;
|
|
19147
|
-
if (!
|
|
19353
|
+
if (!Kb(i)) throw Error("Screenshot preview requires a mounted Mesurer host.");
|
|
19148
19354
|
let a = e.createElement("div");
|
|
19149
|
-
a.dataset.mesurerInspectorUi = "true", a.dataset.mesurerScreenshotInteractive = "true",
|
|
19355
|
+
a.dataset.mesurerInspectorUi = "true", a.dataset.mesurerScreenshotInteractive = "true", Hb(a, {
|
|
19150
19356
|
position: "fixed",
|
|
19151
19357
|
left: "0",
|
|
19152
19358
|
top: "0",
|
|
@@ -19158,12 +19364,12 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19158
19364
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
19159
19365
|
}), i.append(a);
|
|
19160
19366
|
let o = e.createElement("div");
|
|
19161
|
-
o.dataset.mesurerScreenshotPreview = "true", o.setAttribute("role", "button"), o.setAttribute("aria-label", "Open captured screenshot"), o.tabIndex = 0,
|
|
19367
|
+
o.dataset.mesurerScreenshotPreview = "true", o.setAttribute("role", "button"), o.setAttribute("aria-label", "Open captured screenshot"), o.tabIndex = 0, Hb(o, {
|
|
19162
19368
|
position: "fixed",
|
|
19163
19369
|
display: "none",
|
|
19164
19370
|
"z-index": "96",
|
|
19165
|
-
width: `${
|
|
19166
|
-
height: `${
|
|
19371
|
+
width: `${Lb}px`,
|
|
19372
|
+
height: `${Rb}px`,
|
|
19167
19373
|
"box-sizing": "border-box",
|
|
19168
19374
|
overflow: "hidden",
|
|
19169
19375
|
"border-radius": "10px",
|
|
@@ -19176,7 +19382,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19176
19382
|
"touch-action": "none"
|
|
19177
19383
|
});
|
|
19178
19384
|
let s = e.createElement("img");
|
|
19179
|
-
s.dataset.mesurerScreenshotPreviewImage = "true", s.alt = "Captured screenshot", s.draggable = !1, s.title = "Click to open · Right-click for browser image actions",
|
|
19385
|
+
s.dataset.mesurerScreenshotPreviewImage = "true", s.alt = "Captured screenshot", s.draggable = !1, s.title = "Click to open · Right-click for browser image actions", Hb(s, {
|
|
19180
19386
|
display: "block",
|
|
19181
19387
|
width: "100%",
|
|
19182
19388
|
height: "100%",
|
|
@@ -19184,7 +19390,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19184
19390
|
"background-color": "white"
|
|
19185
19391
|
}), o.append(s);
|
|
19186
19392
|
let c = e.createElement("button");
|
|
19187
|
-
c.dataset.mesurerScreenshotPreviewDismiss = "true", c.type = "button", c.setAttribute("aria-label", "Dismiss screenshot preview"), c.title = "Dismiss",
|
|
19393
|
+
c.dataset.mesurerScreenshotPreviewDismiss = "true", c.type = "button", c.setAttribute("aria-label", "Dismiss screenshot preview"), c.title = "Dismiss", Hb(c, {
|
|
19188
19394
|
position: "absolute",
|
|
19189
19395
|
top: "8px",
|
|
19190
19396
|
right: "8px",
|
|
@@ -19210,7 +19416,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19210
19416
|
let u = e.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
19211
19417
|
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);
|
|
19212
19418
|
let d = e.createElement("div");
|
|
19213
|
-
d.dataset.mesurerScreenshotViewer = "true", d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "true"), d.setAttribute("aria-label", "Screenshot viewer"),
|
|
19419
|
+
d.dataset.mesurerScreenshotViewer = "true", d.setAttribute("role", "dialog"), d.setAttribute("aria-modal", "true"), d.setAttribute("aria-label", "Screenshot viewer"), Hb(d, {
|
|
19214
19420
|
position: "fixed",
|
|
19215
19421
|
inset: "0",
|
|
19216
19422
|
display: "none",
|
|
@@ -19224,7 +19430,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19224
19430
|
"pointer-events": "auto"
|
|
19225
19431
|
});
|
|
19226
19432
|
let f = e.createElement("img");
|
|
19227
|
-
f.dataset.mesurerScreenshotViewerImage = "true", f.alt = "Captured screenshot",
|
|
19433
|
+
f.dataset.mesurerScreenshotViewerImage = "true", f.alt = "Captured screenshot", Hb(f, {
|
|
19228
19434
|
display: "block",
|
|
19229
19435
|
"max-width": "calc(100vw - 96px)",
|
|
19230
19436
|
"max-height": "calc(100vh - 112px)",
|
|
@@ -19235,7 +19441,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19235
19441
|
"box-shadow": "0 8px 30px rgb(0 0 0 / 28%)"
|
|
19236
19442
|
}), d.append(f);
|
|
19237
19443
|
let p = e.createElement("div");
|
|
19238
|
-
p.dataset.mesurerScreenshotViewerControls = "true",
|
|
19444
|
+
p.dataset.mesurerScreenshotViewerControls = "true", Hb(p, {
|
|
19239
19445
|
position: "fixed",
|
|
19240
19446
|
top: "16px",
|
|
19241
19447
|
right: "16px",
|
|
@@ -19243,14 +19449,14 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19243
19449
|
gap: "8px",
|
|
19244
19450
|
"pointer-events": "auto"
|
|
19245
19451
|
});
|
|
19246
|
-
let m =
|
|
19452
|
+
let m = Wb(e, "Copy");
|
|
19247
19453
|
m.dataset.mesurerScreenshotViewerCopy = "true", m.setAttribute("aria-label", "Copy screenshot");
|
|
19248
|
-
let h =
|
|
19454
|
+
let h = Wb(e, "Save");
|
|
19249
19455
|
h.dataset.mesurerScreenshotViewerSave = "true", h.setAttribute("aria-label", "Save screenshot");
|
|
19250
|
-
let g =
|
|
19456
|
+
let g = Wb(e, "Close");
|
|
19251
19457
|
g.dataset.mesurerScreenshotViewerClose = "true", g.setAttribute("aria-label", "Close screenshot viewer"), p.append(m, h, g), d.append(p), a.append(d);
|
|
19252
19458
|
let _ = e.createElement("div");
|
|
19253
|
-
_.dataset.mesurerScreenshotToast = "true", _.setAttribute("role", "status"),
|
|
19459
|
+
_.dataset.mesurerScreenshotToast = "true", _.setAttribute("role", "status"), Hb(_, {
|
|
19254
19460
|
position: "fixed",
|
|
19255
19461
|
left: "50%",
|
|
19256
19462
|
bottom: "20px",
|
|
@@ -19272,18 +19478,18 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19272
19478
|
}, D = (e, n = !1) => {
|
|
19273
19479
|
E(), _.textContent = e, _.style.backgroundColor = n ? "#b42318" : "rgb(28 28 30 / 90%)", _.style.display = "block", C = t.setTimeout(() => {
|
|
19274
19480
|
C = 0, _.style.display = "none";
|
|
19275
|
-
},
|
|
19481
|
+
}, Vb);
|
|
19276
19482
|
}, O = () => {
|
|
19277
19483
|
d.style.display = "none";
|
|
19278
19484
|
}, k = () => {
|
|
19279
19485
|
y && globalThis.URL.revokeObjectURL(y), y = null, v = null, s.removeAttribute("src"), f.removeAttribute("src");
|
|
19280
19486
|
}, A = () => {
|
|
19281
19487
|
T(), O(), o.style.display = "none", k();
|
|
19282
|
-
}, j = () =>
|
|
19283
|
-
left: t.innerWidth -
|
|
19284
|
-
top: t.innerHeight -
|
|
19488
|
+
}, j = () => Ub({
|
|
19489
|
+
left: t.innerWidth - Lb - zb,
|
|
19490
|
+
top: t.innerHeight - Rb - zb
|
|
19285
19491
|
}, t), M = (e) => {
|
|
19286
|
-
let n =
|
|
19492
|
+
let n = Ub(e, t);
|
|
19287
19493
|
b = n, o.style.left = `${n.left}px`, o.style.top = `${n.top}px`;
|
|
19288
19494
|
}, N = () => {
|
|
19289
19495
|
!v || !y || (T(), d.style.display = "flex", g.focus());
|
|
@@ -19317,7 +19523,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19317
19523
|
let n = x;
|
|
19318
19524
|
if (!n) return;
|
|
19319
19525
|
let r = e - n.startX, i = t - n.startY;
|
|
19320
|
-
!n.moved && Math.hypot(r, i) >=
|
|
19526
|
+
!n.moved && Math.hypot(r, i) >= Bb && (n.moved = !0), n.moved && M({
|
|
19321
19527
|
left: n.left + r,
|
|
19322
19528
|
top: n.top + i
|
|
19323
19529
|
});
|
|
@@ -19361,25 +19567,25 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19361
19567
|
if (w) return;
|
|
19362
19568
|
T(), O(), k(), v = e;
|
|
19363
19569
|
let i = globalThis.URL.createObjectURL(e);
|
|
19364
|
-
y = i, s.src = i, f.src = i, o.style.display = "block", M(b ?? j()), D(
|
|
19570
|
+
y = i, s.src = i, f.src = i, o.style.display = "block", M(b ?? j()), D(Gb(n)), r > 0 && (S = t.setTimeout(A, r));
|
|
19365
19571
|
},
|
|
19366
19572
|
dismiss: A,
|
|
19367
19573
|
dispose() {
|
|
19368
19574
|
w || (w = !0, T(), E(), A(), t.removeEventListener("mousemove", V, !0), t.removeEventListener("mouseup", H, !0), t.removeEventListener("pointermove", ee, !0), t.removeEventListener("pointerup", te, !0), t.removeEventListener("pointercancel", ne, !0), t.removeEventListener("keydown", ae, !0), o.removeEventListener("mousedown", B), o.removeEventListener("pointerdown", U), o.removeEventListener("keydown", W), o.removeEventListener("contextmenu", re), d.removeEventListener("click", ie), a.remove());
|
|
19369
19575
|
}
|
|
19370
19576
|
};
|
|
19371
|
-
},
|
|
19577
|
+
}, Jb = "mesurer.screenshot", Yb = "screenshot", Xb = "mesurer.screenshot.settings", Zb = "mesurer.screenshot.active", Qb = "runtime:solid", $b = "screenshot.toggle", ex = 2500, tx = 0, nx = [
|
|
19372
19578
|
"[data-mesurer-measurement='true']",
|
|
19373
19579
|
"[data-mesurer-selected-measurement='true']",
|
|
19374
19580
|
"[data-mesurer-selection-spacing-target='true']",
|
|
19375
19581
|
"[data-mesurer-guide='true']",
|
|
19376
19582
|
"[data-mesurer-distance='true']"
|
|
19377
|
-
].join(","),
|
|
19583
|
+
].join(","), rx = `${nx},[data-mesurer-rulers='true']`, ix = {
|
|
19378
19584
|
viewBox: "0 0 256 256",
|
|
19379
19585
|
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"]
|
|
19380
|
-
},
|
|
19586
|
+
}, ax = (e, t) => {
|
|
19381
19587
|
for (let [n, r] of Object.entries(t)) e.style.setProperty(n, r);
|
|
19382
|
-
},
|
|
19588
|
+
}, ox = (e, t) => {
|
|
19383
19589
|
for (let n of [
|
|
19384
19590
|
"left",
|
|
19385
19591
|
"top",
|
|
@@ -19391,63 +19597,63 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19391
19597
|
let r = t[n];
|
|
19392
19598
|
r === void 0 ? e.style.removeProperty(n) : e.style.setProperty(n, `${r}px`);
|
|
19393
19599
|
}
|
|
19394
|
-
},
|
|
19395
|
-
let t = e(
|
|
19600
|
+
}, sx = (e) => {
|
|
19601
|
+
let t = e(Xb);
|
|
19396
19602
|
return {
|
|
19397
19603
|
toolEnabled: t?.toolEnabled ?? !0,
|
|
19398
19604
|
copy: t?.copy ?? !0,
|
|
19399
19605
|
download: t?.download ?? !1,
|
|
19400
19606
|
includeMeasurements: t?.includeMeasurements ?? !1
|
|
19401
19607
|
};
|
|
19402
|
-
},
|
|
19608
|
+
}, cx = (e) => ({
|
|
19403
19609
|
value: e.style.getPropertyValue("display"),
|
|
19404
19610
|
priority: e.style.getPropertyPriority("display")
|
|
19405
|
-
}),
|
|
19611
|
+
}), lx = (e, t) => {
|
|
19406
19612
|
t.value || t.priority ? e.style.setProperty("display", t.value, t.priority) : e.style.removeProperty("display");
|
|
19407
|
-
},
|
|
19613
|
+
}, ux = (e, t) => {
|
|
19408
19614
|
let n = e;
|
|
19409
19615
|
for (; n.parentElement && n.parentElement !== t;) n = n.parentElement;
|
|
19410
19616
|
return n.parentElement === t ? n : null;
|
|
19411
|
-
},
|
|
19617
|
+
}, dx = (e) => {
|
|
19412
19618
|
let t = e.querySelector("[data-mesurer-root='true']");
|
|
19413
19619
|
if (!t) return () => void 0;
|
|
19414
19620
|
let n = /* @__PURE__ */ new Set();
|
|
19415
19621
|
for (let e of t.querySelectorAll("[data-mesurer-rulers='true']")) {
|
|
19416
|
-
let r =
|
|
19622
|
+
let r = ux(e, t);
|
|
19417
19623
|
r && n.add(r);
|
|
19418
19624
|
}
|
|
19419
|
-
for (let e of t.querySelectorAll(
|
|
19420
|
-
let r =
|
|
19625
|
+
for (let e of t.querySelectorAll(nx)) {
|
|
19626
|
+
let r = ux(e, t);
|
|
19421
19627
|
r && n.add(r);
|
|
19422
19628
|
}
|
|
19423
19629
|
let r = [];
|
|
19424
19630
|
for (let e of n) e.dataset.mesurerInspectorUi !== "true" && (r.push({
|
|
19425
19631
|
element: e,
|
|
19426
|
-
display:
|
|
19632
|
+
display: cx(e)
|
|
19427
19633
|
}), e.style.setProperty("display", "none", "important"));
|
|
19428
19634
|
return () => {
|
|
19429
|
-
for (let e of r)
|
|
19635
|
+
for (let e of r) lx(e.element, e.display);
|
|
19430
19636
|
};
|
|
19431
|
-
},
|
|
19637
|
+
}, fx = (e) => Array.from(e.querySelectorAll(rx)).filter((e) => e.dataset.mesurerInspectorUi === "true").map((e) => ({
|
|
19432
19638
|
element: e,
|
|
19433
|
-
display:
|
|
19434
|
-
})),
|
|
19435
|
-
for (let t of e) t.element.isConnected &&
|
|
19436
|
-
},
|
|
19437
|
-
id:
|
|
19639
|
+
display: cx(e)
|
|
19640
|
+
})), px = (e) => {
|
|
19641
|
+
for (let t of e) t.element.isConnected && lx(t.element, t.display);
|
|
19642
|
+
}, mx = (e = {}) => Ta({
|
|
19643
|
+
id: Jb,
|
|
19438
19644
|
version: "0.1.0",
|
|
19439
|
-
requires: [
|
|
19645
|
+
requires: [Qb],
|
|
19440
19646
|
provides: [
|
|
19441
19647
|
"tool:screenshot",
|
|
19442
19648
|
"capture:screenshot",
|
|
19443
19649
|
"settings:screenshot"
|
|
19444
19650
|
],
|
|
19445
19651
|
setup(t) {
|
|
19446
|
-
let n = t.service.get(
|
|
19652
|
+
let n = t.service.get(Qb);
|
|
19447
19653
|
if (!n) throw Error("Screenshot plugin requires the Solid renderer runtime.");
|
|
19448
|
-
let { ownerDocument: r, ownerWindow: i } = n, a = n.createWorkspaceRuntime(), o = n.createInspectorMount(), s = e.capture ?? e.captureVisibleTab, c = s ?? _o, l = e.previewDurationMs ??
|
|
19654
|
+
let { ownerDocument: r, ownerWindow: i } = n, a = n.createWorkspaceRuntime(), o = n.createInspectorMount(), s = e.capture ?? e.captureVisibleTab, c = s ?? _o, l = e.previewDurationMs ?? tx;
|
|
19449
19655
|
t.state.register({
|
|
19450
|
-
id:
|
|
19656
|
+
id: Xb,
|
|
19451
19657
|
initial: {
|
|
19452
19658
|
toolEnabled: e.toolEnabled ?? !0,
|
|
19453
19659
|
copy: e.copy ?? !0,
|
|
@@ -19456,11 +19662,11 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19456
19662
|
},
|
|
19457
19663
|
persist: !0
|
|
19458
19664
|
}), t.state.register({
|
|
19459
|
-
id:
|
|
19665
|
+
id: Zb,
|
|
19460
19666
|
initial: !1
|
|
19461
19667
|
});
|
|
19462
19668
|
let u = o.element;
|
|
19463
|
-
u.dataset.mesurerScreenshot = "true",
|
|
19669
|
+
u.dataset.mesurerScreenshot = "true", ax(u, {
|
|
19464
19670
|
position: "fixed",
|
|
19465
19671
|
inset: "0",
|
|
19466
19672
|
"z-index": "85",
|
|
@@ -19468,7 +19674,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19468
19674
|
"font-family": "ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, sans-serif"
|
|
19469
19675
|
});
|
|
19470
19676
|
let d = r.createElement("div");
|
|
19471
|
-
d.dataset.mesurerScreenshotSelect = "true", d.setAttribute("role", "application"), d.setAttribute("aria-label", "Screenshot selection"),
|
|
19677
|
+
d.dataset.mesurerScreenshotSelect = "true", d.setAttribute("role", "application"), d.setAttribute("aria-label", "Screenshot selection"), ax(d, {
|
|
19472
19678
|
position: "fixed",
|
|
19473
19679
|
inset: "0",
|
|
19474
19680
|
display: "none",
|
|
@@ -19480,13 +19686,13 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19480
19686
|
}), u.append(d);
|
|
19481
19687
|
let f = Array.from({ length: 4 }, () => {
|
|
19482
19688
|
let e = r.createElement("div");
|
|
19483
|
-
return
|
|
19689
|
+
return ax(e, {
|
|
19484
19690
|
position: "fixed",
|
|
19485
19691
|
"background-color": "rgb(0 0 0 / 40%)",
|
|
19486
19692
|
"pointer-events": "none"
|
|
19487
19693
|
}), d.append(e), e;
|
|
19488
19694
|
}), p = r.createElement("div");
|
|
19489
|
-
|
|
19695
|
+
ax(p, {
|
|
19490
19696
|
position: "fixed",
|
|
19491
19697
|
display: "none",
|
|
19492
19698
|
border: "1px solid #0d99ff",
|
|
@@ -19494,7 +19700,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19494
19700
|
"pointer-events": "none"
|
|
19495
19701
|
}), d.append(p);
|
|
19496
19702
|
let m = r.createElement("div");
|
|
19497
|
-
|
|
19703
|
+
ax(m, {
|
|
19498
19704
|
position: "fixed",
|
|
19499
19705
|
display: "none",
|
|
19500
19706
|
"z-index": "86",
|
|
@@ -19508,7 +19714,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19508
19714
|
"pointer-events": "none"
|
|
19509
19715
|
}), d.append(m);
|
|
19510
19716
|
let h = r.createElement("div");
|
|
19511
|
-
h.textContent = "Drag to select · Esc to cancel",
|
|
19717
|
+
h.textContent = "Drag to select · Esc to cancel", ax(h, {
|
|
19512
19718
|
position: "fixed",
|
|
19513
19719
|
left: "50%",
|
|
19514
19720
|
bottom: "16px",
|
|
@@ -19521,7 +19727,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19521
19727
|
"pointer-events": "none"
|
|
19522
19728
|
}), d.append(h);
|
|
19523
19729
|
let g = r.createElement("div");
|
|
19524
|
-
g.dataset.mesurerScreenshotError = "true", g.setAttribute("role", "status"), g.textContent = "Could not save screenshot",
|
|
19730
|
+
g.dataset.mesurerScreenshotError = "true", g.setAttribute("role", "status"), g.textContent = "Could not save screenshot", ax(g, {
|
|
19525
19731
|
position: "fixed",
|
|
19526
19732
|
display: "none",
|
|
19527
19733
|
"z-index": "97",
|
|
@@ -19532,8 +19738,8 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19532
19738
|
"font-size": "11px",
|
|
19533
19739
|
"pointer-events": "none"
|
|
19534
19740
|
}), u.append(g);
|
|
19535
|
-
let _ = null, v = null, y = 0, b = 0, x = !1, S = !1, C = !1, w = () => t.state.get("mesurer.screenshot.active") ?? !1, T = () =>
|
|
19536
|
-
t.state.update(
|
|
19741
|
+
let _ = null, v = null, y = 0, b = 0, x = !1, S = !1, C = !1, w = () => t.state.get("mesurer.screenshot.active") ?? !1, T = () => sx(t.state.get), E = (e) => {
|
|
19742
|
+
t.state.update(Xb, (t) => {
|
|
19537
19743
|
let n = { ...t };
|
|
19538
19744
|
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;
|
|
19539
19745
|
});
|
|
@@ -19556,13 +19762,13 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19556
19762
|
}, A = (e) => {
|
|
19557
19763
|
let t = i.innerWidth, n = i.innerHeight;
|
|
19558
19764
|
if (!e || e.width <= 0 || e.height <= 0) {
|
|
19559
|
-
|
|
19765
|
+
ox(f[0], {
|
|
19560
19766
|
left: 0,
|
|
19561
19767
|
top: 0,
|
|
19562
19768
|
width: t,
|
|
19563
19769
|
height: n
|
|
19564
19770
|
});
|
|
19565
|
-
for (let e of f.slice(1))
|
|
19771
|
+
for (let e of f.slice(1)) ox(e, {
|
|
19566
19772
|
left: 0,
|
|
19567
19773
|
top: 0,
|
|
19568
19774
|
width: 0,
|
|
@@ -19571,31 +19777,31 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19571
19777
|
p.style.display = "none", m.style.display = "none";
|
|
19572
19778
|
return;
|
|
19573
19779
|
}
|
|
19574
|
-
|
|
19780
|
+
ox(f[0], {
|
|
19575
19781
|
left: 0,
|
|
19576
19782
|
top: 0,
|
|
19577
19783
|
width: t,
|
|
19578
19784
|
height: e.top
|
|
19579
|
-
}),
|
|
19785
|
+
}), ox(f[1], {
|
|
19580
19786
|
left: 0,
|
|
19581
19787
|
top: e.top,
|
|
19582
19788
|
width: e.left,
|
|
19583
19789
|
height: e.height
|
|
19584
|
-
}),
|
|
19790
|
+
}), ox(f[2], {
|
|
19585
19791
|
left: e.left + e.width,
|
|
19586
19792
|
top: e.top,
|
|
19587
19793
|
width: Math.max(0, t - e.left - e.width),
|
|
19588
19794
|
height: e.height
|
|
19589
|
-
}),
|
|
19795
|
+
}), ox(f[3], {
|
|
19590
19796
|
left: 0,
|
|
19591
19797
|
top: e.top + e.height,
|
|
19592
19798
|
width: t,
|
|
19593
19799
|
height: Math.max(0, n - e.top - e.height)
|
|
19594
|
-
}), p.style.display = "block",
|
|
19800
|
+
}), p.style.display = "block", ox(p, e), m.style.display = "block", m.textContent = `${Math.round(e.width)} × ${Math.round(e.height)}`, ox(m, {
|
|
19595
19801
|
left: e.left + e.width / 2,
|
|
19596
19802
|
top: Math.min(n - 22, e.top + e.height + 6)
|
|
19597
19803
|
});
|
|
19598
|
-
}, j = () => n.portalTarget.querySelector("[data-mesurer-tool-id='screenshot']")?.getBoundingClientRect() ?? null, M =
|
|
19804
|
+
}, j = () => n.portalTarget.querySelector("[data-mesurer-tool-id='screenshot']")?.getBoundingClientRect() ?? null, M = qb({
|
|
19599
19805
|
ownerDocument: r,
|
|
19600
19806
|
ownerWindow: i,
|
|
19601
19807
|
root: u,
|
|
@@ -19606,7 +19812,7 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19606
19812
|
}, P = () => {
|
|
19607
19813
|
y && i.clearTimeout(y), g.style.display = "block", N(g), y = i.setTimeout(() => {
|
|
19608
19814
|
y = 0, g.style.display = "none";
|
|
19609
|
-
},
|
|
19815
|
+
}, ex);
|
|
19610
19816
|
}, F = () => {
|
|
19611
19817
|
_ = null, A(null), d.style.visibility = "", d.style.display = "none", u.style.pointerEvents = "none", D(!1), k();
|
|
19612
19818
|
}, I = () => {
|
|
@@ -19615,8 +19821,8 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19615
19821
|
if (x) throw Error("A screenshot capture is already running.");
|
|
19616
19822
|
if (e.width < 4 || e.height < 4) throw Error("Screenshot selection must be at least 4px by 4px.");
|
|
19617
19823
|
x = !0;
|
|
19618
|
-
let o = ++b, s = T(), l = s.includeMeasurements ?
|
|
19619
|
-
a.prepareCapture(), s.includeMeasurements &&
|
|
19824
|
+
let o = ++b, s = T(), l = s.includeMeasurements ? fx(r) : [], u = s.includeMeasurements ? () => void 0 : dx(n.portalTarget);
|
|
19825
|
+
a.prepareCapture(), s.includeMeasurements && px(l);
|
|
19620
19826
|
try {
|
|
19621
19827
|
d.style.visibility = "hidden", await Qa(i);
|
|
19622
19828
|
let n = await Ja(await c({
|
|
@@ -19724,9 +19930,9 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19724
19930
|
label: "Screenshot",
|
|
19725
19931
|
shortcut: "Shift+S",
|
|
19726
19932
|
order: 70,
|
|
19727
|
-
command:
|
|
19933
|
+
command: $b,
|
|
19728
19934
|
toolbarMode: "select",
|
|
19729
|
-
icon:
|
|
19935
|
+
icon: ix,
|
|
19730
19936
|
active: w,
|
|
19731
19937
|
hidden: () => !T().toolEnabled,
|
|
19732
19938
|
menu: {
|
|
@@ -19792,31 +19998,31 @@ var Kv = "mesurer.layout-guides", qv = "layout-guides:v1", Jv = "mesurer.layout-
|
|
|
19792
19998
|
set: (e) => E({ includeMeasurements: e })
|
|
19793
19999
|
}
|
|
19794
20000
|
]
|
|
19795
|
-
}), t.command.register(
|
|
20001
|
+
}), t.command.register($b, R), t.service.provide(Yb, ee), t.lifecycle.onDispose(() => {
|
|
19796
20002
|
C = !0, b += 1, d.removeEventListener("pointerdown", z), d.removeEventListener("pointermove", B), d.removeEventListener("pointerup", V), d.removeEventListener("pointercancel", H), i.removeEventListener("keydown", U, !0), y && i.clearTimeout(y), M.dispose(), k(), vo(i), a.finishCapture(), a.dispose(), o.dispose();
|
|
19797
20003
|
});
|
|
19798
20004
|
}
|
|
19799
|
-
}),
|
|
20005
|
+
}), hx = (e) => Number.parseFloat(e) || 0, gx = 0, _x = (e, t) => {
|
|
19800
20006
|
let n = t.CSS;
|
|
19801
20007
|
return n?.escape ? n.escape(e) : e.replace(/[^a-zA-Z0-9_-]/g, (e) => `\\${e}`);
|
|
19802
|
-
},
|
|
19803
|
-
function
|
|
20008
|
+
}, vx = (e) => e.nodeType === 9, yx = (e) => e.nodeType === 11;
|
|
20009
|
+
function bx(e) {
|
|
19804
20010
|
let t = e.getRootNode();
|
|
19805
|
-
return
|
|
20011
|
+
return yx(t) ? t : e.ownerDocument;
|
|
19806
20012
|
}
|
|
19807
|
-
var
|
|
19808
|
-
if (
|
|
19809
|
-
let n =
|
|
19810
|
-
return
|
|
19811
|
-
},
|
|
20013
|
+
var xx = (e, t) => {
|
|
20014
|
+
if (vx(e) || yx(e)) return e;
|
|
20015
|
+
let n = bx(e);
|
|
20016
|
+
return yx(n) ? n : t;
|
|
20017
|
+
}, Sx = 600, Cx = "audio, canvas, embed, iframe, img, input, object, picture, select, textarea, video", wx = /* @__PURE__ */ new WeakMap(), Tx = (e) => {
|
|
19812
20018
|
let t = e;
|
|
19813
20019
|
for (; t;) {
|
|
19814
|
-
if ((
|
|
20020
|
+
if ((wx.get(t) ?? 0) > 0) return !0;
|
|
19815
20021
|
let e = t.getRootNode();
|
|
19816
|
-
t =
|
|
20022
|
+
t = yx(e) ? e.host : t.parentElement;
|
|
19817
20023
|
}
|
|
19818
20024
|
return !1;
|
|
19819
|
-
},
|
|
20025
|
+
}, Ex = (e, t) => t.x >= e.left && t.x <= e.right && t.y >= e.top && t.y <= e.bottom, Dx = (e, t) => Array.from(e.getClientRects()).some((e) => Ex(e, t)), Ox = (e, t, n) => {
|
|
19820
20026
|
let r = e;
|
|
19821
20027
|
for (; r;) {
|
|
19822
20028
|
let e = n.getComputedStyle(r);
|
|
@@ -19825,7 +20031,7 @@ var Sx = (e, t) => {
|
|
|
19825
20031
|
r = r.parentElement;
|
|
19826
20032
|
}
|
|
19827
20033
|
return !0;
|
|
19828
|
-
},
|
|
20034
|
+
}, kx = (e, t) => {
|
|
19829
20035
|
if (e.matches("img, picture, video, canvas, svg image, path, circle, ellipse, line, polygon, polyline, rect, text, use")) return !0;
|
|
19830
20036
|
let n = t.getComputedStyle(e), r = n.backgroundImage !== "none" || n.backgroundColor !== "transparent" && n.backgroundColor !== "rgba(0, 0, 0, 0)", i = [
|
|
19831
20037
|
"top",
|
|
@@ -19834,7 +20040,7 @@ var Sx = (e, t) => {
|
|
|
19834
20040
|
"left"
|
|
19835
20041
|
].some((e) => Number.parseFloat(n.getPropertyValue(`border-${e}-width`)) > 0 && n.getPropertyValue(`border-${e}-style`) !== "none");
|
|
19836
20042
|
return r || i || n.boxShadow !== "none" || n.outlineStyle !== "none";
|
|
19837
|
-
},
|
|
20043
|
+
}, Ax = (e, t) => !!e.textContent?.trim() || kx(e, t), jx = (e, t, n) => {
|
|
19838
20044
|
let r = t, i = r.caretRangeFromPoint?.(e.x, e.y)?.startContainer ?? r.caretPositionFromPoint?.(e.x, e.y)?.offsetNode;
|
|
19839
20045
|
if (!i) return null;
|
|
19840
20046
|
let a = t.defaultView?.Element;
|
|
@@ -19845,11 +20051,11 @@ var Sx = (e, t) => {
|
|
|
19845
20051
|
o = o.parentElement;
|
|
19846
20052
|
}
|
|
19847
20053
|
return o === n ? n : null;
|
|
19848
|
-
},
|
|
20054
|
+
}, Mx = (e, t, n) => {
|
|
19849
20055
|
let r = n.defaultView, i = r?.Element;
|
|
19850
20056
|
if (!r || !i) return [];
|
|
19851
20057
|
let a = [], o = /* @__PURE__ */ new Set(), s = (n, i, s) => {
|
|
19852
|
-
if (o.has(n) ||
|
|
20058
|
+
if (o.has(n) || Tx(n) || r.getComputedStyle(n).pointerEvents !== "none" || Ox(n, e, r) || !Dx(n, t)) return;
|
|
19853
20059
|
let c = n.getBoundingClientRect();
|
|
19854
20060
|
o.add(n), a.push({
|
|
19855
20061
|
element: n,
|
|
@@ -19858,7 +20064,7 @@ var Sx = (e, t) => {
|
|
|
19858
20064
|
order: s
|
|
19859
20065
|
});
|
|
19860
20066
|
}, c = n.createTreeWalker(e, 1), l = c.nextNode(), u = 1;
|
|
19861
|
-
for (; l && u <=
|
|
20067
|
+
for (; l && u <= Sx;) {
|
|
19862
20068
|
if (l instanceof i) {
|
|
19863
20069
|
let t = l;
|
|
19864
20070
|
if (r.getComputedStyle(t).pointerEvents === "none") {
|
|
@@ -19869,9 +20075,9 @@ var Sx = (e, t) => {
|
|
|
19869
20075
|
}
|
|
19870
20076
|
u += 1, l = c.nextNode();
|
|
19871
20077
|
}
|
|
19872
|
-
let d =
|
|
20078
|
+
let d = jx(t, n, e);
|
|
19873
20079
|
return d && r.getComputedStyle(d).pointerEvents === "none" && s(d, 1e4, u), a.sort((e, t) => t.depth - e.depth || e.area - t.area || t.order - e.order).map(({ element: e }) => e);
|
|
19874
|
-
},
|
|
20080
|
+
}, Nx = (e, t, n) => {
|
|
19875
20081
|
let r = t.ownerDocument.defaultView;
|
|
19876
20082
|
if (!r) return [];
|
|
19877
20083
|
let i = [...new Set(e)], a = /* @__PURE__ */ new Map();
|
|
@@ -19880,7 +20086,7 @@ var Sx = (e, t) => {
|
|
|
19880
20086
|
t && (a.set(e, e.getAttribute("style")), t.style.setProperty("pointer-events", "auto", "important"));
|
|
19881
20087
|
}
|
|
19882
20088
|
try {
|
|
19883
|
-
let e =
|
|
20089
|
+
let e = bx(t).elementsFromPoint(n.x, n.y), r = e.findIndex((e) => e === t), a = new Map(e.map((e, t) => [e, t]));
|
|
19884
20090
|
return i.filter((e) => {
|
|
19885
20091
|
let t = a.get(e);
|
|
19886
20092
|
return t !== void 0 && (r < 0 || t < r);
|
|
@@ -19888,31 +20094,31 @@ var Sx = (e, t) => {
|
|
|
19888
20094
|
} finally {
|
|
19889
20095
|
for (let [e, t] of a) t === null ? e.removeAttribute("style") : e.setAttribute("style", t);
|
|
19890
20096
|
}
|
|
19891
|
-
},
|
|
20097
|
+
}, Px = (e, t) => {
|
|
19892
20098
|
let n = e;
|
|
19893
20099
|
for (; n.parentElement && n.parentElement !== t;) n = n.parentElement;
|
|
19894
20100
|
return n.parentElement === t ? n : null;
|
|
19895
|
-
},
|
|
20101
|
+
}, Fx = (e, t, n, r) => {
|
|
19896
20102
|
let i = r.defaultView;
|
|
19897
20103
|
if (!i) return [];
|
|
19898
|
-
let a =
|
|
20104
|
+
let a = Nx(Mx(e, t, r).filter((e) => Ax(e, i)), e, t);
|
|
19899
20105
|
if (a.length > 0) return a;
|
|
19900
|
-
if (e.textContent?.trim() && !e.matches(
|
|
19901
|
-
let o = [], s = /* @__PURE__ */ new Set(), c = !
|
|
20106
|
+
if (e.textContent?.trim() && !e.matches(Cx) || e.matches("a, button, input, select, textarea, label, summary, [contenteditable='true']")) return [];
|
|
20107
|
+
let o = [], s = /* @__PURE__ */ new Set(), c = !vx(n) && !yx(n) ? n : null, l = e.parentElement;
|
|
19902
20108
|
for (; l && l !== r.body && l !== r.documentElement && !(c && l !== c && !c.contains(l));) {
|
|
19903
|
-
let a = l, u =
|
|
19904
|
-
if (!
|
|
19905
|
-
let t =
|
|
20109
|
+
let a = l, u = Px(e, a), d = Mx(a, t, r).filter((e) => {
|
|
20110
|
+
if (!Lx(e, n) || e.closest("[aria-hidden='true'], [inert]")) return !1;
|
|
20111
|
+
let t = Px(e, a);
|
|
19906
20112
|
return t === null || t !== u;
|
|
19907
20113
|
});
|
|
19908
|
-
for (let e of d) s.has(e) || !
|
|
20114
|
+
for (let e of d) s.has(e) || !Ax(e, i) || (s.add(e), o.push(e));
|
|
19909
20115
|
if (a === c) break;
|
|
19910
20116
|
l = a.parentElement;
|
|
19911
20117
|
}
|
|
19912
|
-
return
|
|
20118
|
+
return Nx(o, e, t);
|
|
19913
20119
|
};
|
|
19914
|
-
function
|
|
19915
|
-
let r =
|
|
20120
|
+
function Ix(e, t, n = vx(t) ? t : t.ownerDocument ?? document) {
|
|
20121
|
+
let r = xx(t, n), i = n.defaultView;
|
|
19916
20122
|
if (!i) return null;
|
|
19917
20123
|
let a = r.elementsFromPoint(e.x, e.y);
|
|
19918
20124
|
for (let r of a) {
|
|
@@ -19922,28 +20128,28 @@ function Lx(e, t, n = yx(t) ? t : t.ownerDocument ?? document) {
|
|
|
19922
20128
|
if (!t || t === a) break;
|
|
19923
20129
|
a = t;
|
|
19924
20130
|
}
|
|
19925
|
-
if (!a || !
|
|
19926
|
-
let o =
|
|
20131
|
+
if (!a || !Lx(a, t)) continue;
|
|
20132
|
+
let o = Fx(a, e, t, n);
|
|
19927
20133
|
if (o.length > 0) return o[0];
|
|
19928
20134
|
if (i.getComputedStyle(a).pointerEvents !== "none") return a;
|
|
19929
20135
|
}
|
|
19930
20136
|
return null;
|
|
19931
20137
|
}
|
|
19932
|
-
function
|
|
19933
|
-
if (
|
|
20138
|
+
function Lx(e, t) {
|
|
20139
|
+
if (vx(t)) return !0;
|
|
19934
20140
|
let n = e;
|
|
19935
20141
|
for (; n;) {
|
|
19936
20142
|
if (t === n || t.contains(n)) return !0;
|
|
19937
20143
|
let e = n.getRootNode();
|
|
19938
|
-
if (!
|
|
20144
|
+
if (!yx(e)) return !1;
|
|
19939
20145
|
n = e.host;
|
|
19940
20146
|
}
|
|
19941
20147
|
return !1;
|
|
19942
20148
|
}
|
|
19943
|
-
function
|
|
20149
|
+
function Rx(e, t) {
|
|
19944
20150
|
if (!e) return t();
|
|
19945
|
-
let n =
|
|
19946
|
-
|
|
20151
|
+
let n = wx.get(e) ?? 0;
|
|
20152
|
+
wx.set(e, n + 1);
|
|
19947
20153
|
let r = [e, ...e.querySelectorAll("*")], i = r.map((e) => [
|
|
19948
20154
|
e,
|
|
19949
20155
|
e.style.getPropertyValue("pointer-events"),
|
|
@@ -19953,13 +20159,13 @@ function zx(e, t) {
|
|
|
19953
20159
|
try {
|
|
19954
20160
|
return t();
|
|
19955
20161
|
} finally {
|
|
19956
|
-
n === 0 ?
|
|
20162
|
+
n === 0 ? wx.delete(e) : wx.set(e, n);
|
|
19957
20163
|
for (let [e, t, n] of i) t ? e.style.setProperty("pointer-events", t, n) : e.style.removeProperty("pointer-events");
|
|
19958
20164
|
}
|
|
19959
20165
|
}
|
|
19960
|
-
function
|
|
20166
|
+
function zx(e) {
|
|
19961
20167
|
let t = e.ownerDocument.defaultView ?? window;
|
|
19962
|
-
if (e.id) return `#${
|
|
20168
|
+
if (e.id) return `#${_x(e.id, t)}`;
|
|
19963
20169
|
let n = e.getAttribute("data-testid");
|
|
19964
20170
|
if (n) return `[data-testid=${JSON.stringify(n)}]`;
|
|
19965
20171
|
let r = [], i = e;
|
|
@@ -19973,17 +20179,17 @@ function Bx(e) {
|
|
|
19973
20179
|
}
|
|
19974
20180
|
return r.join(" > ");
|
|
19975
20181
|
}
|
|
19976
|
-
function
|
|
20182
|
+
function Bx(e, t, n = `dom-inspection-${++gx}`) {
|
|
19977
20183
|
let r = e.getBoundingClientRect(), i = t.getComputedStyle(e), a = {
|
|
19978
|
-
top:
|
|
19979
|
-
right:
|
|
19980
|
-
bottom:
|
|
19981
|
-
left:
|
|
20184
|
+
top: hx(i.paddingTop),
|
|
20185
|
+
right: hx(i.paddingRight),
|
|
20186
|
+
bottom: hx(i.paddingBottom),
|
|
20187
|
+
left: hx(i.paddingLeft)
|
|
19982
20188
|
}, o = {
|
|
19983
|
-
top:
|
|
19984
|
-
right:
|
|
19985
|
-
bottom:
|
|
19986
|
-
left:
|
|
20189
|
+
top: hx(i.marginTop),
|
|
20190
|
+
right: hx(i.marginRight),
|
|
20191
|
+
bottom: hx(i.marginBottom),
|
|
20192
|
+
left: hx(i.marginLeft)
|
|
19987
20193
|
}, s = {
|
|
19988
20194
|
left: r.left + a.left,
|
|
19989
20195
|
top: r.top + a.top,
|
|
@@ -20011,8 +20217,8 @@ function Vx(e, t, n = `dom-inspection-${++_x}`) {
|
|
|
20011
20217
|
elementRef: e
|
|
20012
20218
|
};
|
|
20013
20219
|
}
|
|
20014
|
-
function
|
|
20015
|
-
let t = e.ownerDocument.defaultView ?? window, n = t.getComputedStyle(e), r = e instanceof t.HTMLElement ? e : null, i = e.getBoundingClientRect(), a = r ?
|
|
20220
|
+
function Vx(e) {
|
|
20221
|
+
let t = e.ownerDocument.defaultView ?? window, n = t.getComputedStyle(e), r = e instanceof t.HTMLElement ? e : null, i = e.getBoundingClientRect(), a = r ? Bx(r, t) : null, o = (e) => {
|
|
20016
20222
|
let t = Number.parseFloat(e);
|
|
20017
20223
|
return Number.isFinite(t) ? t : 0;
|
|
20018
20224
|
}, s = (e) => ({
|
|
@@ -20022,7 +20228,7 @@ function Hx(e) {
|
|
|
20022
20228
|
left: o(n.getPropertyValue(`${e}-left${e === "border" ? "-width" : ""}`))
|
|
20023
20229
|
});
|
|
20024
20230
|
return {
|
|
20025
|
-
selector:
|
|
20231
|
+
selector: zx(e),
|
|
20026
20232
|
tag: e.localName,
|
|
20027
20233
|
id: e.id || null,
|
|
20028
20234
|
classes: [...e.classList],
|
|
@@ -20084,10 +20290,10 @@ function Hx(e) {
|
|
|
20084
20290
|
}
|
|
20085
20291
|
//#endregion
|
|
20086
20292
|
//#region src/agent.ts
|
|
20087
|
-
var
|
|
20088
|
-
function
|
|
20089
|
-
let t = e.root ?? e.ownerDocument, n = e.ownerDocument.defaultView ?? window, r = (e, n = 0) => t.querySelectorAll(e).item(n) || null, i = (n) => t === e.ownerDocument ||
|
|
20090
|
-
let t = (e.getPluginHost() ?? await e.waitForPluginHost()).service.get(
|
|
20293
|
+
var Hx = "text-edit", Ux = (e) => Vx(e);
|
|
20294
|
+
function Wx(e) {
|
|
20295
|
+
let t = e.root ?? e.ownerDocument, n = e.ownerDocument.defaultView ?? window, r = (e, n = 0) => t.querySelectorAll(e).item(n) || null, i = (n) => t === e.ownerDocument || Lx(n, t), a = async () => {
|
|
20296
|
+
let t = (e.getPluginHost() ?? await e.waitForPluginHost()).service.get(Hx);
|
|
20091
20297
|
if (!t) throw Error("Mesurer text editing service is unavailable.");
|
|
20092
20298
|
return t;
|
|
20093
20299
|
}, o = () => {
|
|
@@ -20116,25 +20322,25 @@ function Gx(e) {
|
|
|
20116
20322
|
},
|
|
20117
20323
|
inspect(e, t = 0) {
|
|
20118
20324
|
let n = r(e, t);
|
|
20119
|
-
return n ?
|
|
20325
|
+
return n ? Ux(n) : null;
|
|
20120
20326
|
},
|
|
20121
20327
|
inspectAll(e, n = 50) {
|
|
20122
|
-
return [...t.querySelectorAll(e)].slice(0, Math.max(0, n)).map(
|
|
20328
|
+
return [...t.querySelectorAll(e)].slice(0, Math.max(0, n)).map(Ux);
|
|
20123
20329
|
},
|
|
20124
20330
|
at(n, r) {
|
|
20125
20331
|
let a = t.querySelector?.("[data-mesurer-island]") ?? null;
|
|
20126
|
-
return
|
|
20127
|
-
let a =
|
|
20332
|
+
return Rx(a?.shadowRoot?.querySelector("[data-mesurer-root='true']") ?? a, () => {
|
|
20333
|
+
let a = Ix({
|
|
20128
20334
|
x: n,
|
|
20129
20335
|
y: r
|
|
20130
20336
|
}, t, e.ownerDocument);
|
|
20131
|
-
return a && i(a) ?
|
|
20337
|
+
return a && i(a) ? Ux(a) : null;
|
|
20132
20338
|
});
|
|
20133
20339
|
},
|
|
20134
20340
|
distance(e, t) {
|
|
20135
20341
|
let n = r(e), i = r(t);
|
|
20136
20342
|
if (!n || !i) return null;
|
|
20137
|
-
let a =
|
|
20343
|
+
let a = Ux(n), o = Ux(i), s = a.rect, c = o.rect;
|
|
20138
20344
|
return {
|
|
20139
20345
|
a,
|
|
20140
20346
|
b: o,
|
|
@@ -20150,7 +20356,7 @@ function Gx(e) {
|
|
|
20150
20356
|
let r = e.getPluginHost() ?? await e.waitForPluginHost();
|
|
20151
20357
|
return {
|
|
20152
20358
|
viewport: o(),
|
|
20153
|
-
elements: n.flatMap((e) => [...t.querySelectorAll(e)].slice(0, 50).map(
|
|
20359
|
+
elements: n.flatMap((e) => [...t.querySelectorAll(e)].slice(0, 50).map(Ux)),
|
|
20154
20360
|
plugins: r.describe(),
|
|
20155
20361
|
pluginState: r.state.serialize("all")
|
|
20156
20362
|
};
|
|
@@ -20175,10 +20381,10 @@ function Gx(e) {
|
|
|
20175
20381
|
}
|
|
20176
20382
|
//#endregion
|
|
20177
20383
|
//#region src/version.ts
|
|
20178
|
-
var
|
|
20384
|
+
var Gx = "0.2.1-beta.7", Kx = Np, qx = Pp, Jx = () => ({
|
|
20179
20385
|
...km(),
|
|
20180
|
-
version:
|
|
20181
|
-
}),
|
|
20386
|
+
version: Gx
|
|
20387
|
+
}), Yx = qx, Xx = (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, Zx = (e) => {
|
|
20182
20388
|
if (!e.length) return null;
|
|
20183
20389
|
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));
|
|
20184
20390
|
return {
|
|
@@ -20187,36 +20393,36 @@ var Kx = "0.2.1-beta.6", qx = Np, Jx = Pp, Yx = () => ({
|
|
|
20187
20393
|
width: r - t,
|
|
20188
20394
|
height: i - n
|
|
20189
20395
|
};
|
|
20190
|
-
},
|
|
20191
|
-
function
|
|
20396
|
+
}, Qx = (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), $x = (e) => [...e.measurements, ...e.activeMeasurement && !e.measurements.some((t) => t.id === e.activeMeasurement?.id) ? [e.activeMeasurement] : []];
|
|
20397
|
+
function eS(e) {
|
|
20192
20398
|
let { workspace: t, scope: n, guideTolerance: r } = e;
|
|
20193
20399
|
if (n.kind === "workspace") return {
|
|
20194
20400
|
guides: t.guides.map((e) => ({ ...e })),
|
|
20195
|
-
measurements:
|
|
20401
|
+
measurements: $x(t),
|
|
20196
20402
|
distances: [...t.distances]
|
|
20197
20403
|
};
|
|
20198
|
-
let i = new Set(n.elements), a = (e) => e != null && i.has(e), o = (e) => n.regions.some((t) =>
|
|
20404
|
+
let i = new Set(n.elements), a = (e) => e != null && i.has(e), o = (e) => n.regions.some((t) => Xx(e, t));
|
|
20199
20405
|
return {
|
|
20200
|
-
guides: t.guides.filter((e) =>
|
|
20201
|
-
measurements:
|
|
20406
|
+
guides: t.guides.filter((e) => Qx(e, n.regions, r)).map((e) => ({ ...e })),
|
|
20407
|
+
measurements: $x(t).filter((e) => a(e.elementRef) || o(e.rect)),
|
|
20202
20408
|
distances: t.distances.filter((e) => a(e.elementRefA) || a(e.elementRefB) || o(e.rectA) || o(e.rectB))
|
|
20203
20409
|
};
|
|
20204
20410
|
}
|
|
20205
20411
|
//#endregion
|
|
20206
20412
|
//#region ../mesurer-core/dist/domain.js
|
|
20207
|
-
var
|
|
20413
|
+
var tS = {
|
|
20208
20414
|
opacity: 1,
|
|
20209
20415
|
width: 1,
|
|
20210
20416
|
pattern: "solid",
|
|
20211
20417
|
dashLength: 6,
|
|
20212
20418
|
gap: 4
|
|
20213
|
-
},
|
|
20419
|
+
}, nS = {
|
|
20214
20420
|
opacity: 1,
|
|
20215
20421
|
edgeReveal: !1
|
|
20216
20422
|
};
|
|
20217
20423
|
//#endregion
|
|
20218
20424
|
//#region ../mesurer-core/dist/events.js
|
|
20219
|
-
function
|
|
20425
|
+
function rS() {
|
|
20220
20426
|
let e = /* @__PURE__ */ new Map();
|
|
20221
20427
|
return {
|
|
20222
20428
|
on(t, n) {
|
|
@@ -20234,12 +20440,12 @@ function iS() {
|
|
|
20234
20440
|
}
|
|
20235
20441
|
};
|
|
20236
20442
|
}
|
|
20237
|
-
({ ...
|
|
20443
|
+
({ ...tS }), { ...nS };
|
|
20238
20444
|
//#endregion
|
|
20239
20445
|
//#region ../mesurer-core/dist/plugins.js
|
|
20240
|
-
var
|
|
20241
|
-
function
|
|
20242
|
-
let e = 1, t = 0, n =
|
|
20446
|
+
var iS = 50;
|
|
20447
|
+
function aS() {
|
|
20448
|
+
let e = 1, t = 0, n = rS(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), p = [], m = [], h = (e, t) => {
|
|
20243
20449
|
n.emit("changed", {
|
|
20244
20450
|
pluginId: e,
|
|
20245
20451
|
reason: t
|
|
@@ -20302,15 +20508,15 @@ function oS() {
|
|
|
20302
20508
|
}
|
|
20303
20509
|
if (o && s) {
|
|
20304
20510
|
let e = y("history");
|
|
20305
|
-
x(s, e) || (p.push(s), p.length >
|
|
20511
|
+
x(s, e) || (p.push(s), p.length > iS && p.shift(), m.length = 0);
|
|
20306
20512
|
}
|
|
20307
20513
|
return l;
|
|
20308
20514
|
}, w = () => {
|
|
20309
20515
|
let e = p.pop();
|
|
20310
|
-
return e ? (m.push(y("history")), m.length >
|
|
20516
|
+
return e ? (m.push(y("history")), m.length > iS && m.shift(), b(e, "history"), h(void 0, "history"), !0) : !1;
|
|
20311
20517
|
}, T = () => {
|
|
20312
20518
|
let e = m.pop();
|
|
20313
|
-
return e ? (p.push(y("history")), p.length >
|
|
20519
|
+
return e ? (p.push(y("history")), p.length > iS && p.shift(), b(e, "history"), h(void 0, "history"), !0) : !1;
|
|
20314
20520
|
}, E = async (e, t) => {
|
|
20315
20521
|
for (let n of [...l.values()].filter((t) => t.name === e)) await n.handler(t);
|
|
20316
20522
|
}, D = (e) => [...u.values()].reverse().find((t) => t.id === e)?.value, O = {
|
|
@@ -20467,8 +20673,8 @@ function oS() {
|
|
|
20467
20673
|
}
|
|
20468
20674
|
//#endregion
|
|
20469
20675
|
//#region ../mesurer-core/dist/runtime.js
|
|
20470
|
-
async function
|
|
20471
|
-
let t =
|
|
20676
|
+
async function oS(e = {}) {
|
|
20677
|
+
let t = aS();
|
|
20472
20678
|
try {
|
|
20473
20679
|
for (let n of e.plugins ?? []) await t.load(n);
|
|
20474
20680
|
return t;
|
|
@@ -20478,17 +20684,17 @@ async function sS(e = {}) {
|
|
|
20478
20684
|
}
|
|
20479
20685
|
//#endregion
|
|
20480
20686
|
//#region src/context.ts
|
|
20481
|
-
var
|
|
20687
|
+
var sS = 10, cS = (e) => ({
|
|
20482
20688
|
left: e.left,
|
|
20483
20689
|
top: e.top,
|
|
20484
20690
|
width: e.width,
|
|
20485
20691
|
height: e.height
|
|
20486
|
-
}),
|
|
20692
|
+
}), lS = (e) => {
|
|
20487
20693
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
20488
20694
|
for (let r of e) !r?.isConnected || t.has(r) || (t.add(r), n.push(r));
|
|
20489
20695
|
return n;
|
|
20490
|
-
},
|
|
20491
|
-
function
|
|
20696
|
+
}, uS = (e) => e.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
20697
|
+
function dS(e) {
|
|
20492
20698
|
let { runtime: t, ownerDocument: n, ownerWindow: r } = e, i = e.request ?? { scope: "workspace" }, a = t.snapshot();
|
|
20493
20699
|
if (!a) throw Error("Mesurer workspace is not ready yet.");
|
|
20494
20700
|
let o = [], s = [], c = { kind: "workspace" }, l = /* @__PURE__ */ new Map();
|
|
@@ -20496,7 +20702,7 @@ function fS(e) {
|
|
|
20496
20702
|
let e = t.annotation(i.annotation);
|
|
20497
20703
|
if (!e) throw Error(`Mesurer annotation not found: ${i.annotation}`);
|
|
20498
20704
|
for (let t of e.resolvedTargets) t.element?.isConnected && l.set(t.element, t.target.id);
|
|
20499
|
-
o =
|
|
20705
|
+
o = lS(e.resolvedTargets.map((e) => e.element));
|
|
20500
20706
|
let n = t.annotationRect(e.id);
|
|
20501
20707
|
n && (s = [n]);
|
|
20502
20708
|
let r = e.resolvedTargets.length, a = e.resolvedTargets.filter((e) => e.element?.isConnected).length, u = e.anchor.kind === "region" ? "connected" : r === 0 || a === 0 ? "stale" : a === r ? "connected" : "partial";
|
|
@@ -20508,15 +20714,15 @@ function fS(e) {
|
|
|
20508
20714
|
};
|
|
20509
20715
|
} else if (i.scope === "selection") {
|
|
20510
20716
|
let e = t.currentSelection();
|
|
20511
|
-
if (o =
|
|
20512
|
-
s = e.region ? [e.region] : o.map((e) =>
|
|
20513
|
-
} else o =
|
|
20717
|
+
if (o = lS(e.elements), !o.length && !e.region) throw Error("Mesurer has no current selection.");
|
|
20718
|
+
s = e.region ? [e.region] : o.map((e) => cS(e.getBoundingClientRect())), c = { kind: "selection" };
|
|
20719
|
+
} else o = lS([
|
|
20514
20720
|
...t.currentSelection().elements,
|
|
20515
20721
|
...a.measurements.map((e) => e.elementRef),
|
|
20516
20722
|
a.activeMeasurement?.elementRef,
|
|
20517
20723
|
...a.heldDistances.flatMap((e) => [e.elementRefA, e.elementRefB])
|
|
20518
20724
|
]);
|
|
20519
|
-
let u = c.kind === "workspace" ? [] : s.length ? s : o.map((e) =>
|
|
20725
|
+
let u = c.kind === "workspace" ? [] : s.length ? s : o.map((e) => cS(e.getBoundingClientRect())), d = eS({
|
|
20520
20726
|
workspace: {
|
|
20521
20727
|
guides: a.guides,
|
|
20522
20728
|
measurements: a.measurements,
|
|
@@ -20528,8 +20734,8 @@ function fS(e) {
|
|
|
20528
20734
|
elements: o,
|
|
20529
20735
|
regions: u
|
|
20530
20736
|
},
|
|
20531
|
-
guideTolerance: a.guideRelevanceTolerance ??
|
|
20532
|
-
}), f = d.measurements, p = d.distances, m = d.guides, h =
|
|
20737
|
+
guideTolerance: a.guideRelevanceTolerance ?? sS
|
|
20738
|
+
}), f = d.measurements, p = d.distances, m = d.guides, h = lS([
|
|
20533
20739
|
...o,
|
|
20534
20740
|
...f.map((e) => e.elementRef),
|
|
20535
20741
|
...p.flatMap((e) => [e.elementRefA, e.elementRefB])
|
|
@@ -20541,12 +20747,12 @@ function fS(e) {
|
|
|
20541
20747
|
let t = l.get(e) ?? y();
|
|
20542
20748
|
return g.set(e, t), {
|
|
20543
20749
|
ref: t,
|
|
20544
|
-
inspection:
|
|
20750
|
+
inspection: Vx(e)
|
|
20545
20751
|
};
|
|
20546
20752
|
}), x = f.map((e) => {
|
|
20547
20753
|
let t = {
|
|
20548
20754
|
id: e.id,
|
|
20549
|
-
rect:
|
|
20755
|
+
rect: cS(e.rect),
|
|
20550
20756
|
deltaX: e.deltaX,
|
|
20551
20757
|
deltaY: e.deltaY
|
|
20552
20758
|
};
|
|
@@ -20556,8 +20762,8 @@ function fS(e) {
|
|
|
20556
20762
|
}), S = p.map((e) => {
|
|
20557
20763
|
let t = {
|
|
20558
20764
|
id: e.id,
|
|
20559
|
-
rectA:
|
|
20560
|
-
rectB:
|
|
20765
|
+
rectA: cS(e.rectA),
|
|
20766
|
+
rectB: cS(e.rectB),
|
|
20561
20767
|
horizontal: e.horizontal ? { ...e.horizontal } : null,
|
|
20562
20768
|
vertical: e.vertical ? { ...e.vertical } : null
|
|
20563
20769
|
}, n = e.elementRefA ? g.get(e.elementRefA) : void 0, r = e.elementRefB ? g.get(e.elementRefB) : void 0;
|
|
@@ -20565,7 +20771,7 @@ function fS(e) {
|
|
|
20565
20771
|
});
|
|
20566
20772
|
return {
|
|
20567
20773
|
schema: "mesurer.context/v1",
|
|
20568
|
-
id:
|
|
20774
|
+
id: uS(r),
|
|
20569
20775
|
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
20570
20776
|
scope: c,
|
|
20571
20777
|
page: {
|
|
@@ -20580,7 +20786,7 @@ function fS(e) {
|
|
|
20580
20786
|
scrollY: r.scrollY
|
|
20581
20787
|
},
|
|
20582
20788
|
coordinateSpace: "viewport-css-px",
|
|
20583
|
-
regions: c.kind === "workspace" ? [] : s.map(
|
|
20789
|
+
regions: c.kind === "workspace" ? [] : s.map(cS),
|
|
20584
20790
|
visualState: {
|
|
20585
20791
|
rulersVisible: a.rulersVisible,
|
|
20586
20792
|
xrayVisible: a.xrayVisible
|
|
@@ -20594,48 +20800,48 @@ function fS(e) {
|
|
|
20594
20800
|
}
|
|
20595
20801
|
};
|
|
20596
20802
|
}
|
|
20597
|
-
var
|
|
20598
|
-
function
|
|
20803
|
+
var fS = (e) => `${Math.round(e * 100) / 100}px`, pS = (e) => `x=${fS(e.left)} y=${fS(e.top)} w=${fS(e.width)} h=${fS(e.height)}`;
|
|
20804
|
+
function mS(e) {
|
|
20599
20805
|
let t = [
|
|
20600
20806
|
"Mesurer visual context",
|
|
20601
20807
|
"",
|
|
20602
20808
|
`Page: ${e.page.url}`,
|
|
20603
20809
|
`Viewport: ${e.viewport.width} × ${e.viewport.height} CSS px; scroll x=${e.viewport.scrollX} y=${e.viewport.scrollY}`
|
|
20604
20810
|
];
|
|
20605
|
-
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}: ${
|
|
20811
|
+
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}: ${pS(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) {
|
|
20606
20812
|
t.push("", "Targets");
|
|
20607
20813
|
for (let n of e.targets) {
|
|
20608
20814
|
let e = n.inspection;
|
|
20609
|
-
t.push(`[${n.ref}] ${e.selector}`, ` rect: ${
|
|
20815
|
+
t.push(`[${n.ref}] ${e.selector}`, ` rect: ${pS(e.rect)}`, ` margin: ${fS(e.margin.top)} ${fS(e.margin.right)} ${fS(e.margin.bottom)} ${fS(e.margin.left)}`, ` padding: ${fS(e.padding.top)} ${fS(e.padding.right)} ${fS(e.padding.bottom)} ${fS(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)}`);
|
|
20610
20816
|
}
|
|
20611
20817
|
}
|
|
20612
20818
|
if (e.visualContext.guides.length) {
|
|
20613
20819
|
t.push("", "Relevant guides");
|
|
20614
|
-
for (let n of e.visualContext.guides) t.push(`- ${n.orientation} ${n.orientation === "vertical" ? "x" : "y"}=${
|
|
20820
|
+
for (let n of e.visualContext.guides) t.push(`- ${n.orientation} ${n.orientation === "vertical" ? "x" : "y"}=${fS(n.position)}`);
|
|
20615
20821
|
}
|
|
20616
20822
|
if (e.visualContext.layoutGuides.length) {
|
|
20617
20823
|
t.push("", "Layout guides");
|
|
20618
20824
|
for (let n of e.visualContext.layoutGuides) {
|
|
20619
20825
|
if (!n.visible) continue;
|
|
20620
|
-
let e = n.kind === "grid" ? `grid ${
|
|
20826
|
+
let e = n.kind === "grid" ? `grid ${fS(n.size)}` : `${n.count} ${n.kind}; gutter=${fS(n.gutter)}; offset=${fS(n.offset)}; align=${n.align}`;
|
|
20621
20827
|
t.push(`- ${e}; color=${n.color}; opacity=${Math.round(n.opacity * 100)}%`);
|
|
20622
20828
|
}
|
|
20623
20829
|
}
|
|
20624
20830
|
if (e.visualContext.measurements.length) {
|
|
20625
20831
|
t.push("", "Relevant measurements");
|
|
20626
|
-
for (let n of e.visualContext.measurements) t.push(`- ${n.targetRef ? `${n.targetRef}: ` : ""}${
|
|
20832
|
+
for (let n of e.visualContext.measurements) t.push(`- ${n.targetRef ? `${n.targetRef}: ` : ""}${pS(n.rect)}; delta=${fS(n.deltaX)} × ${fS(n.deltaY)}`);
|
|
20627
20833
|
}
|
|
20628
20834
|
if (e.visualContext.distances.length) {
|
|
20629
20835
|
t.push("", "Relevant distances");
|
|
20630
20836
|
for (let n of e.visualContext.distances) {
|
|
20631
|
-
let e = [n.targetARef, n.targetBRef].filter(Boolean).join(" → "), r = [n.horizontal ? `horizontal=${
|
|
20837
|
+
let e = [n.targetARef, n.targetBRef].filter(Boolean).join(" → "), r = [n.horizontal ? `horizontal=${fS(n.horizontal.value)}` : null, n.vertical ? `vertical=${fS(n.vertical.value)}` : null].filter(Boolean).join("; ");
|
|
20632
20838
|
t.push(`- ${e ? `${e}: ` : ""}${r || "overlapping"}`);
|
|
20633
20839
|
}
|
|
20634
20840
|
}
|
|
20635
20841
|
return t.join("\n").trimEnd();
|
|
20636
20842
|
}
|
|
20637
|
-
function
|
|
20638
|
-
let t =
|
|
20843
|
+
function hS(e) {
|
|
20844
|
+
let t = Zx([
|
|
20639
20845
|
...e.regions,
|
|
20640
20846
|
...e.targets.map((e) => e.inspection.rect),
|
|
20641
20847
|
...e.visualContext.measurements.map((e) => e.rect),
|
|
@@ -20665,7 +20871,7 @@ function gS(e) {
|
|
|
20665
20871
|
captures: n
|
|
20666
20872
|
};
|
|
20667
20873
|
}
|
|
20668
|
-
var
|
|
20874
|
+
var gS = (e, t, n, r, i) => {
|
|
20669
20875
|
!Number.isFinite(r) || !Number.isFinite(i) || Math.abs(r - i) < .01 || e.push({
|
|
20670
20876
|
kind: t,
|
|
20671
20877
|
label: n,
|
|
@@ -20674,16 +20880,16 @@ var _S = (e, t, n, r, i) => {
|
|
|
20674
20880
|
delta: i - r,
|
|
20675
20881
|
unit: "px"
|
|
20676
20882
|
});
|
|
20677
|
-
},
|
|
20883
|
+
}, _S = (e, t, n, r) => e.push({
|
|
20678
20884
|
kind: "missing",
|
|
20679
20885
|
evidence: t,
|
|
20680
20886
|
id: n,
|
|
20681
20887
|
label: r
|
|
20682
|
-
}),
|
|
20683
|
-
function
|
|
20888
|
+
}), vS = (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;
|
|
20889
|
+
function yS(e) {
|
|
20684
20890
|
let t = e.runtime.annotation(e.annotationId);
|
|
20685
20891
|
if (!t) throw Error(`Mesurer annotation not found: ${e.annotationId}`);
|
|
20686
|
-
let n =
|
|
20892
|
+
let n = dS({
|
|
20687
20893
|
runtime: e.runtime,
|
|
20688
20894
|
ownerDocument: e.ownerDocument,
|
|
20689
20895
|
ownerWindow: e.ownerWindow,
|
|
@@ -20693,42 +20899,42 @@ function bS(e) {
|
|
|
20693
20899
|
if (n.scope.kind !== "annotation") throw Error("Mesurer annotation context invariant failed.");
|
|
20694
20900
|
let r = e.runtime.snapshot();
|
|
20695
20901
|
if (!r) throw Error("Mesurer workspace is not ready yet.");
|
|
20696
|
-
let i =
|
|
20902
|
+
let i = $x({
|
|
20697
20903
|
measurements: r.measurements,
|
|
20698
20904
|
activeMeasurement: r.activeMeasurement
|
|
20699
20905
|
}), a = [];
|
|
20700
20906
|
for (let e of t.baseline.targets) {
|
|
20701
20907
|
let t = n.targets.find((t) => t.ref === e.id);
|
|
20702
20908
|
if (!t) {
|
|
20703
|
-
|
|
20909
|
+
_S(a, "target", e.id, e.selector);
|
|
20704
20910
|
continue;
|
|
20705
20911
|
}
|
|
20706
|
-
|
|
20912
|
+
gS(a, "target-rect", `${t.inspection.selector} left`, e.rect.left, t.inspection.rect.left), gS(a, "target-rect", `${t.inspection.selector} top`, e.rect.top, t.inspection.rect.top), gS(a, "target-rect", `${t.inspection.selector} width`, e.rect.width, t.inspection.rect.width), gS(a, "target-rect", `${t.inspection.selector} height`, e.rect.height, t.inspection.rect.height);
|
|
20707
20913
|
}
|
|
20708
20914
|
for (let e of t.baseline.guides) {
|
|
20709
20915
|
let t = n.visualContext.guides.find((t) => t.id === e.id) ?? r.guides.find((t) => t.id === e.id);
|
|
20710
20916
|
if (!t) {
|
|
20711
|
-
|
|
20917
|
+
_S(a, "guide", e.id, `${e.orientation} guide ${e.id}`);
|
|
20712
20918
|
continue;
|
|
20713
20919
|
}
|
|
20714
|
-
|
|
20920
|
+
gS(a, "guide", `${e.orientation} guide ${e.id}`, e.position, t.position);
|
|
20715
20921
|
}
|
|
20716
20922
|
for (let e of t.baseline.measurements) {
|
|
20717
20923
|
let r = n.visualContext.measurements.find((t) => t.id === e.id) ?? i.find((t) => t.id === e.id);
|
|
20718
20924
|
if (!r) {
|
|
20719
|
-
let r = t.baseline.targets.find((t) =>
|
|
20720
|
-
r && n.targets.some((e) => e.ref === r.id) ||
|
|
20925
|
+
let r = t.baseline.targets.find((t) => vS(t.rect, e.rect));
|
|
20926
|
+
r && n.targets.some((e) => e.ref === r.id) || _S(a, "measurement", e.id, e.id);
|
|
20721
20927
|
continue;
|
|
20722
20928
|
}
|
|
20723
|
-
|
|
20929
|
+
gS(a, "measurement", `${e.id} width`, e.rect.width, r.rect.width), gS(a, "measurement", `${e.id} height`, e.rect.height, r.rect.height);
|
|
20724
20930
|
}
|
|
20725
20931
|
for (let e of t.baseline.distances) {
|
|
20726
20932
|
let t = n.visualContext.distances.find((t) => t.id === e.id) ?? r.heldDistances.find((t) => t.id === e.id);
|
|
20727
20933
|
if (!t) {
|
|
20728
|
-
|
|
20934
|
+
_S(a, "distance", e.id, e.id);
|
|
20729
20935
|
continue;
|
|
20730
20936
|
}
|
|
20731
|
-
e.horizontal && t.horizontal ?
|
|
20937
|
+
e.horizontal && t.horizontal ? gS(a, "distance", `${e.id} horizontal`, e.horizontal.value, t.horizontal.value) : e.horizontal && !t.horizontal && _S(a, "distance", e.id, `${e.id} horizontal`), e.vertical && t.vertical ? gS(a, "distance", `${e.id} vertical`, e.vertical.value, t.vertical.value) : e.vertical && !t.vertical && _S(a, "distance", e.id, `${e.id} vertical`);
|
|
20732
20938
|
}
|
|
20733
20939
|
return {
|
|
20734
20940
|
schema: "mesurer.review/v1",
|
|
@@ -20740,7 +20946,7 @@ function bS(e) {
|
|
|
20740
20946
|
changes: a
|
|
20741
20947
|
};
|
|
20742
20948
|
}
|
|
20743
|
-
async function
|
|
20949
|
+
async function bS(e, t, n) {
|
|
20744
20950
|
try {
|
|
20745
20951
|
if (t.navigator.clipboard?.writeText) {
|
|
20746
20952
|
await t.navigator.clipboard.writeText(n);
|
|
@@ -20754,43 +20960,43 @@ async function xS(e, t, n) {
|
|
|
20754
20960
|
}
|
|
20755
20961
|
//#endregion
|
|
20756
20962
|
//#region src/layout-guides.ts
|
|
20757
|
-
var
|
|
20963
|
+
var xS = Kv, SS = qv, CS = () => ({
|
|
20758
20964
|
...yy(),
|
|
20759
|
-
version:
|
|
20760
|
-
}),
|
|
20965
|
+
version: Gx
|
|
20966
|
+
}), wS = "mesurer.context", TS = "context:v1", ES = "mesurer.context.settings", DS = "context.ui", OS = "data-mesurer-direct-text-edit-active", kS = {
|
|
20761
20967
|
viewBox: "0 0 256 256",
|
|
20762
20968
|
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"]
|
|
20763
|
-
},
|
|
20969
|
+
}, AS = {
|
|
20764
20970
|
viewBox: "0 0 256 256",
|
|
20765
20971
|
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"]
|
|
20766
|
-
},
|
|
20972
|
+
}, jS = {
|
|
20767
20973
|
viewBox: "0 0 256 256",
|
|
20768
20974
|
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"]
|
|
20769
|
-
},
|
|
20975
|
+
}, MS = async (e, t, n = 1) => {
|
|
20770
20976
|
await e.fonts?.ready;
|
|
20771
20977
|
for (let e = 0; e < Math.max(1, n); e += 1) await new Promise((e) => t.requestAnimationFrame(() => e()));
|
|
20772
|
-
},
|
|
20773
|
-
let i = async (i) =>
|
|
20978
|
+
}, NS = (e, t, n, r) => {
|
|
20979
|
+
let i = async (i) => dS({
|
|
20774
20980
|
runtime: e,
|
|
20775
20981
|
ownerDocument: t,
|
|
20776
20982
|
ownerWindow: n,
|
|
20777
20983
|
request: i,
|
|
20778
20984
|
layoutGuides: r()
|
|
20779
|
-
}), a = async (e) =>
|
|
20985
|
+
}), a = async (e) => mS(await i(e));
|
|
20780
20986
|
return {
|
|
20781
20987
|
context: i,
|
|
20782
20988
|
contextText: a,
|
|
20783
|
-
copyContext: async (e) =>
|
|
20989
|
+
copyContext: async (e) => bS(t, n, await a(e)),
|
|
20784
20990
|
select: async (r) => {
|
|
20785
20991
|
let a = Array.isArray(r) ? [...r] : [String(r)];
|
|
20786
|
-
return e.select(a), await
|
|
20992
|
+
return e.select(a), await MS(t, n), i({ scope: "selection" });
|
|
20787
20993
|
},
|
|
20788
20994
|
annotations: async () => e.annotations(),
|
|
20789
20995
|
removeAnnotation: async (r) => {
|
|
20790
|
-
e.removeAnnotation(r), await
|
|
20996
|
+
e.removeAnnotation(r), await MS(t, n);
|
|
20791
20997
|
},
|
|
20792
20998
|
review: async (i) => {
|
|
20793
|
-
if (await
|
|
20999
|
+
if (await MS(t, n), i) return yS({
|
|
20794
21000
|
runtime: e,
|
|
20795
21001
|
ownerDocument: t,
|
|
20796
21002
|
ownerWindow: n,
|
|
@@ -20798,7 +21004,7 @@ var SS = Kv, CS = qv, wS = () => ({
|
|
|
20798
21004
|
layoutGuides: r()
|
|
20799
21005
|
});
|
|
20800
21006
|
let a = r();
|
|
20801
|
-
return e.annotations().map((r) =>
|
|
21007
|
+
return e.annotations().map((r) => yS({
|
|
20802
21008
|
runtime: e,
|
|
20803
21009
|
ownerDocument: t,
|
|
20804
21010
|
ownerWindow: n,
|
|
@@ -20806,38 +21012,38 @@ var SS = Kv, CS = qv, wS = () => ({
|
|
|
20806
21012
|
layoutGuides: a
|
|
20807
21013
|
}));
|
|
20808
21014
|
},
|
|
20809
|
-
capturePlan: async (e) =>
|
|
21015
|
+
capturePlan: async (e) => hS(await i(e)),
|
|
20810
21016
|
prepareCapture: async () => {
|
|
20811
|
-
e.prepareCapture(), await
|
|
21017
|
+
e.prepareCapture(), await MS(t, n);
|
|
20812
21018
|
},
|
|
20813
21019
|
finishCapture: async () => {
|
|
20814
|
-
e.finishCapture(), await
|
|
21020
|
+
e.finishCapture(), await MS(t, n);
|
|
20815
21021
|
}
|
|
20816
21022
|
};
|
|
20817
|
-
},
|
|
21023
|
+
}, PS = (e) => {
|
|
20818
21024
|
let t = e.currentSelection();
|
|
20819
21025
|
return t.elements.length > 0 || t.region !== null;
|
|
20820
21026
|
};
|
|
20821
|
-
function
|
|
21027
|
+
function FS(e = {}) {
|
|
20822
21028
|
return {
|
|
20823
|
-
id:
|
|
20824
|
-
version:
|
|
21029
|
+
id: wS,
|
|
21030
|
+
version: Gx,
|
|
20825
21031
|
requires: ["runtime:solid"],
|
|
20826
|
-
provides: [
|
|
21032
|
+
provides: [TS],
|
|
20827
21033
|
setup(t) {
|
|
20828
21034
|
let n = t.service.get("runtime:solid");
|
|
20829
21035
|
if (!n) throw Error("Mesurer context plugin requires the renderer runtime service.");
|
|
20830
|
-
let r = n.createWorkspaceRuntime(
|
|
20831
|
-
t.service.provide(
|
|
20832
|
-
id:
|
|
21036
|
+
let r = n.createWorkspaceRuntime(wS), i = NS(r, n.ownerDocument, n.ownerWindow, () => t.service.get(SS)?.list() ?? []);
|
|
21037
|
+
t.service.provide(TS, i), t.state.register({
|
|
21038
|
+
id: ES,
|
|
20833
21039
|
initial: { ui: e.ui ?? !0 },
|
|
20834
21040
|
persist: !0
|
|
20835
21041
|
}), t.state.register({
|
|
20836
|
-
id:
|
|
20837
|
-
initial: { hasSelection:
|
|
21042
|
+
id: DS,
|
|
21043
|
+
initial: { hasSelection: PS(r) }
|
|
20838
21044
|
});
|
|
20839
|
-
let a = () => t.state.get("mesurer.context.settings")?.ui ?? !0, o = () => t.state.get(
|
|
20840
|
-
t.state.update(
|
|
21045
|
+
let a = () => t.state.get("mesurer.context.settings")?.ui ?? !0, o = () => t.state.get(DS)?.hasSelection === !0, s = (e) => {
|
|
21046
|
+
t.state.update(ES, (t) => ({
|
|
20841
21047
|
...t,
|
|
20842
21048
|
ui: e
|
|
20843
21049
|
}));
|
|
@@ -20851,12 +21057,12 @@ function IS(e = {}) {
|
|
|
20851
21057
|
region: e.region ? { ...e.region } : null
|
|
20852
21058
|
}, r.selectGestureActive() ? c?.abandonNoteComposer() : n && c?.closeNoteComposer();
|
|
20853
21059
|
let i = e.elements.length > 0 || e.region !== null;
|
|
20854
|
-
i !== (t.state.get(
|
|
21060
|
+
i !== (t.state.get(DS)?.hasSelection ?? !1) && t.state.update(DS, () => ({ hasSelection: i }));
|
|
20855
21061
|
});
|
|
20856
21062
|
t.command.register("context.copy", () => i.copyContext()), t.command.register("context.copy-selection", () => i.copyContext({ scope: "selection" }));
|
|
20857
21063
|
let g = () => {
|
|
20858
21064
|
let e = u?.element;
|
|
20859
|
-
e && (n.rendererRoot?.hasAttribute(
|
|
21065
|
+
e && (n.rendererRoot?.hasAttribute(OS) ? e.setAttribute(OS, "true") : e.removeAttribute(OS));
|
|
20860
21066
|
}, _ = () => {
|
|
20861
21067
|
d?.disconnect(), d = null, c = null, l?.(), l = null, u?.dispose(), u = null;
|
|
20862
21068
|
}, v = () => {
|
|
@@ -20865,7 +21071,7 @@ function IS(e = {}) {
|
|
|
20865
21071
|
let e = new n.ownerWindow.MutationObserver(g);
|
|
20866
21072
|
d = e, e.observe(n.rendererRoot, {
|
|
20867
21073
|
attributes: !0,
|
|
20868
|
-
attributeFilter: [
|
|
21074
|
+
attributeFilter: [OS]
|
|
20869
21075
|
}), g();
|
|
20870
21076
|
}
|
|
20871
21077
|
let e = {
|
|
@@ -20889,7 +21095,7 @@ function IS(e = {}) {
|
|
|
20889
21095
|
command: "context.copy",
|
|
20890
21096
|
order: 70,
|
|
20891
21097
|
toolbarMode: "always",
|
|
20892
|
-
icon:
|
|
21098
|
+
icon: kS,
|
|
20893
21099
|
hidden: () => !a()
|
|
20894
21100
|
}), t.tool.register({
|
|
20895
21101
|
id: "context.copy-selection",
|
|
@@ -20898,7 +21104,7 @@ function IS(e = {}) {
|
|
|
20898
21104
|
command: "context.copy-selection",
|
|
20899
21105
|
order: 71,
|
|
20900
21106
|
toolbarMode: "always",
|
|
20901
|
-
icon:
|
|
21107
|
+
icon: AS,
|
|
20902
21108
|
hidden: () => !a(),
|
|
20903
21109
|
disabled: () => !o()
|
|
20904
21110
|
}), t.tool.register({
|
|
@@ -20908,7 +21114,7 @@ function IS(e = {}) {
|
|
|
20908
21114
|
command: "context.add-note",
|
|
20909
21115
|
order: 72,
|
|
20910
21116
|
toolbarMode: "always",
|
|
20911
|
-
icon:
|
|
21117
|
+
icon: jS,
|
|
20912
21118
|
hidden: () => !a(),
|
|
20913
21119
|
disabled: () => !o()
|
|
20914
21120
|
}), t.settings.register({
|
|
@@ -20931,7 +21137,7 @@ function IS(e = {}) {
|
|
|
20931
21137
|
}
|
|
20932
21138
|
//#endregion
|
|
20933
21139
|
//#region src/host-layer.ts
|
|
20934
|
-
var
|
|
21140
|
+
var IS = {
|
|
20935
21141
|
display: "block",
|
|
20936
21142
|
position: "fixed",
|
|
20937
21143
|
inset: "0",
|
|
@@ -20973,48 +21179,48 @@ var LS = {
|
|
|
20973
21179
|
"letter-spacing": "normal",
|
|
20974
21180
|
direction: "ltr"
|
|
20975
21181
|
};
|
|
20976
|
-
function
|
|
20977
|
-
for (let [t, n] of Object.entries(
|
|
21182
|
+
function LS(e) {
|
|
21183
|
+
for (let [t, n] of Object.entries(IS)) e.style.setProperty(t, n, "important");
|
|
20978
21184
|
}
|
|
20979
|
-
function
|
|
21185
|
+
function RS(e) {
|
|
20980
21186
|
return "popover" in e && "showPopover" in e && typeof e.showPopover == "function" && "hidePopover" in e && typeof e.hidePopover == "function";
|
|
20981
21187
|
}
|
|
20982
|
-
var
|
|
20983
|
-
function
|
|
20984
|
-
if (!
|
|
21188
|
+
var zS = (e) => "newState" in e, BS = (e) => e.localName === "dialog";
|
|
21189
|
+
function VS(e) {
|
|
21190
|
+
if (!BS(e) || !e.open) return !1;
|
|
20985
21191
|
try {
|
|
20986
21192
|
return e.matches(":modal");
|
|
20987
21193
|
} catch {
|
|
20988
21194
|
return !1;
|
|
20989
21195
|
}
|
|
20990
21196
|
}
|
|
20991
|
-
function
|
|
20992
|
-
|
|
21197
|
+
function HS(e, t, n = !0) {
|
|
21198
|
+
LS(e);
|
|
20993
21199
|
let r = e.ownerDocument, i = r.defaultView ?? window, a = t, o = !1, s = "fixed", c = !1, l = 0, u = [];
|
|
20994
|
-
if (n &&
|
|
21200
|
+
if (n && RS(e) && (e.popover = "manual"), t.append(e), n && RS(e)) try {
|
|
20995
21201
|
e.showPopover(), c = e.matches(":popover-open"), c && (s = "top-layer");
|
|
20996
21202
|
} catch {
|
|
20997
21203
|
e.removeAttribute("popover");
|
|
20998
21204
|
}
|
|
20999
21205
|
let d = () => {
|
|
21000
|
-
if (!(!c || !
|
|
21206
|
+
if (!(!c || !RS(e))) try {
|
|
21001
21207
|
e.matches(":popover-open") || e.showPopover();
|
|
21002
21208
|
} catch {}
|
|
21003
21209
|
}, f = (t) => {
|
|
21004
21210
|
if (e.parentNode === t) return;
|
|
21005
|
-
let n = c &&
|
|
21006
|
-
if (n &&
|
|
21211
|
+
let n = c && RS(e) && e.matches(":popover-open");
|
|
21212
|
+
if (n && RS(e)) try {
|
|
21007
21213
|
e.hidePopover();
|
|
21008
21214
|
} catch {}
|
|
21009
|
-
t.append(e),
|
|
21215
|
+
t.append(e), LS(e), n && d();
|
|
21010
21216
|
}, p = () => {
|
|
21011
|
-
u = u.filter((e) => e.isConnected &&
|
|
21217
|
+
u = u.filter((e) => e.isConnected && VS(e)), f(u.at(-1) ?? a);
|
|
21012
21218
|
}, m = (e) => {
|
|
21013
21219
|
u = u.filter((t) => t !== e), u.push(e), p();
|
|
21014
21220
|
}, h = (e) => {
|
|
21015
21221
|
u = u.filter((t) => t !== e), p();
|
|
21016
21222
|
}, g = () => {
|
|
21017
|
-
if (!(o || !c || !
|
|
21223
|
+
if (!(o || !c || !RS(e))) try {
|
|
21018
21224
|
e.matches(":popover-open") && e.hidePopover(), e.showPopover();
|
|
21019
21225
|
} catch {}
|
|
21020
21226
|
}, _ = () => {
|
|
@@ -21023,27 +21229,27 @@ function US(e, t, n = !0) {
|
|
|
21023
21229
|
}));
|
|
21024
21230
|
}, v = (t) => {
|
|
21025
21231
|
if (!c || t.target === e) return;
|
|
21026
|
-
let n =
|
|
21232
|
+
let n = zS(t) ? t.newState : void 0, r = t.target;
|
|
21027
21233
|
if (r instanceof i.Element) {
|
|
21028
|
-
if (
|
|
21029
|
-
n === "open" &&
|
|
21234
|
+
if (BS(r)) {
|
|
21235
|
+
n === "open" && VS(r) ? (m(r), _()) : n === "closed" ? h(r) : n === "open" && _();
|
|
21030
21236
|
return;
|
|
21031
21237
|
}
|
|
21032
21238
|
n === "open" && r.hasAttribute("popover") && _();
|
|
21033
21239
|
}
|
|
21034
21240
|
}, y = (e) => {
|
|
21035
21241
|
let t = e.target;
|
|
21036
|
-
t instanceof i.Element &&
|
|
21242
|
+
t instanceof i.Element && BS(t) && h(t);
|
|
21037
21243
|
}, b = () => {
|
|
21038
21244
|
r.fullscreenElement && _();
|
|
21039
21245
|
}, x = (e) => {
|
|
21040
|
-
|
|
21041
|
-
for (let t of e.querySelectorAll("dialog"))
|
|
21246
|
+
VS(e) && m(e);
|
|
21247
|
+
for (let t of e.querySelectorAll("dialog")) VS(t) && m(t);
|
|
21042
21248
|
}, S = new i.MutationObserver((e) => {
|
|
21043
21249
|
if (c) for (let t of e) {
|
|
21044
21250
|
if (t.type === "attributes") {
|
|
21045
21251
|
let e = t.target;
|
|
21046
|
-
e instanceof i.Element &&
|
|
21252
|
+
e instanceof i.Element && BS(e) && (VS(e) ? m(e) : h(e));
|
|
21047
21253
|
}
|
|
21048
21254
|
for (let e of t.addedNodes) e instanceof i.Element && x(e);
|
|
21049
21255
|
u.some((e) => !e.isConnected) && p();
|
|
@@ -21059,7 +21265,7 @@ function US(e, t, n = !0) {
|
|
|
21059
21265
|
bringToFront: g,
|
|
21060
21266
|
dispose() {
|
|
21061
21267
|
if (!o) {
|
|
21062
|
-
if (o = !0, l && i.cancelAnimationFrame(l), r.removeEventListener("toggle", v, !0), r.removeEventListener("close", y, !0), r.removeEventListener("fullscreenchange", b, !0), S.disconnect(), c &&
|
|
21268
|
+
if (o = !0, l && i.cancelAnimationFrame(l), r.removeEventListener("toggle", v, !0), r.removeEventListener("close", y, !0), r.removeEventListener("fullscreenchange", b, !0), S.disconnect(), c && RS(e) && e.matches(":popover-open")) try {
|
|
21063
21269
|
e.hidePopover();
|
|
21064
21270
|
} catch {}
|
|
21065
21271
|
u = [];
|
|
@@ -21069,28 +21275,28 @@ function US(e, t, n = !0) {
|
|
|
21069
21275
|
}
|
|
21070
21276
|
//#endregion
|
|
21071
21277
|
//#region src/plugins/codex/index.ts
|
|
21072
|
-
var
|
|
21278
|
+
var US = "mesurer.codex", WS = "codex:v1", GS = "mesurer.plugin.before-disable", KS = 2e3, qS = 750, JS = 1800, YS = 2e3, XS = 12e4, ZS = 10, QS = 5, $S = "Codex host connection is unavailable. Electron apps must expose window.__MESURER_HOST__.codexBridge from preload.", eC = [
|
|
21073
21279
|
"Implement the current human feedback from Mesurer in this project.",
|
|
21074
21280
|
"Treat the rendered page as the source of truth, preserve unrelated Mesurer review state,",
|
|
21075
21281
|
"and verify the affected UI in the live page with Mesurer before claiming completion."
|
|
21076
|
-
].join(" "),
|
|
21282
|
+
].join(" "), tC = {
|
|
21077
21283
|
viewBox: "0 0 256 256",
|
|
21078
21284
|
paths: ["M224,48,32,120l88,32,32,88Z M120,152l104-104"]
|
|
21079
|
-
},
|
|
21285
|
+
}, nC = {
|
|
21080
21286
|
viewBox: "0 0 256 256",
|
|
21081
21287
|
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"]
|
|
21082
|
-
},
|
|
21288
|
+
}, rC = {
|
|
21083
21289
|
viewBox: "0 0 256 256",
|
|
21084
21290
|
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"]
|
|
21085
|
-
},
|
|
21291
|
+
}, iC = () => {
|
|
21086
21292
|
try {
|
|
21087
21293
|
let e = globalThis.location;
|
|
21088
21294
|
return e?.origin ? `mesurer-codex-ui:v2:${e.origin}${e.pathname}` : null;
|
|
21089
21295
|
} catch {
|
|
21090
21296
|
return null;
|
|
21091
21297
|
}
|
|
21092
|
-
},
|
|
21093
|
-
let e =
|
|
21298
|
+
}, aC = () => {
|
|
21299
|
+
let e = iC();
|
|
21094
21300
|
if (!e) return null;
|
|
21095
21301
|
try {
|
|
21096
21302
|
let t = globalThis.sessionStorage?.getItem(e);
|
|
@@ -21115,18 +21321,18 @@ var WS = "mesurer.codex", GS = "codex:v1", KS = "mesurer.plugin.before-disable",
|
|
|
21115
21321
|
} catch {
|
|
21116
21322
|
return null;
|
|
21117
21323
|
}
|
|
21118
|
-
},
|
|
21119
|
-
let t =
|
|
21324
|
+
}, oC = (e) => {
|
|
21325
|
+
let t = iC();
|
|
21120
21326
|
if (t) try {
|
|
21121
21327
|
globalThis.sessionStorage?.setItem(t, JSON.stringify(e));
|
|
21122
21328
|
} catch {}
|
|
21123
|
-
},
|
|
21329
|
+
}, sC = async (e) => {
|
|
21124
21330
|
let t = window.__MESURER_HOST__?.codexBridge;
|
|
21125
|
-
if (!t) throw Error(
|
|
21331
|
+
if (!t) throw Error($S);
|
|
21126
21332
|
let n = await t(e);
|
|
21127
21333
|
if (n.ok === !1) throw Error(n.error ?? "Codex Bridge request failed.");
|
|
21128
21334
|
return n;
|
|
21129
|
-
},
|
|
21335
|
+
}, cC = (e) => {
|
|
21130
21336
|
let t = e.runtime;
|
|
21131
21337
|
return !t || ![
|
|
21132
21338
|
"shared",
|
|
@@ -21144,10 +21350,10 @@ var WS = "mesurer.codex", GS = "codex:v1", KS = "mesurer.plugin.before-disable",
|
|
|
21144
21350
|
available: t.available === !0,
|
|
21145
21351
|
reason: t.reason
|
|
21146
21352
|
};
|
|
21147
|
-
},
|
|
21353
|
+
}, lC = (e) => ({
|
|
21148
21354
|
thread: e.thread?.trim() || null,
|
|
21149
21355
|
threads: Array.isArray(e.threads) ? e.threads.filter((e) => e.trim().length > 0) : []
|
|
21150
|
-
}),
|
|
21356
|
+
}), uC = (e) => {
|
|
21151
21357
|
let t = e.deliveryId?.trim(), n = e.thread?.trim(), r = e.status;
|
|
21152
21358
|
if (!t || !n || !r) throw Error("Codex Bridge returned an invalid delivery state.");
|
|
21153
21359
|
let i = {
|
|
@@ -21159,7 +21365,7 @@ var WS = "mesurer.codex", GS = "codex:v1", KS = "mesurer.plugin.before-disable",
|
|
|
21159
21365
|
updatedAt: Number.isFinite(e.updatedAt) ? Number(e.updatedAt) : 0
|
|
21160
21366
|
};
|
|
21161
21367
|
return e.queuedSubmissionId !== void 0 && (i.queuedSubmissionId = e.queuedSubmissionId?.trim() || null), e.dispatch !== void 0 && (i.dispatch = e.dispatch), e.dispatchError !== void 0 && (i.dispatchError = e.dispatchError?.trim() || null), i;
|
|
21162
|
-
},
|
|
21368
|
+
}, dC = (e) => ({
|
|
21163
21369
|
thread: e.thread?.trim() || null,
|
|
21164
21370
|
threads: Array.isArray(e.threadDetails) ? e.threadDetails.flatMap((e) => {
|
|
21165
21371
|
let t = e.id?.trim() ?? "";
|
|
@@ -21171,7 +21377,7 @@ var WS = "mesurer.codex", GS = "codex:v1", KS = "mesurer.plugin.before-disable",
|
|
|
21171
21377
|
}] : [];
|
|
21172
21378
|
}) : [],
|
|
21173
21379
|
hasMore: e.hasMore === !0
|
|
21174
|
-
}),
|
|
21380
|
+
}), fC = async (e, t, n) => {
|
|
21175
21381
|
let r = t?.instruction?.trim() || n, i = await e.annotations(), a = t?.annotationIds, o = a ? a.flatMap((e) => {
|
|
21176
21382
|
let t = i.find((t) => t.id === e);
|
|
21177
21383
|
return t ? [t] : [];
|
|
@@ -21194,18 +21400,18 @@ var WS = "mesurer.codex", GS = "codex:v1", KS = "mesurer.plugin.before-disable",
|
|
|
21194
21400
|
])
|
|
21195
21401
|
].join("\n").trimEnd()
|
|
21196
21402
|
};
|
|
21197
|
-
},
|
|
21198
|
-
function
|
|
21199
|
-
let t = e.instruction?.trim() ||
|
|
21403
|
+
}, pC = (e) => e.length > 16 ? `${e.slice(0, 8)}…${e.slice(-4)}` : e, mC = (e, t = 42) => e.length > t ? `${e.slice(0, t - 1)}…` : e, hC = (e) => e instanceof Error && (e.message === $S || e.message === "Codex Bridge is unavailable in this host." || e.message.includes("Codex Bridge lease"));
|
|
21404
|
+
function gC(e = {}) {
|
|
21405
|
+
let t = e.instruction?.trim() || eC, n = e.ui ?? !0, r = e.clearCompletedAnnotations ?? !0;
|
|
21200
21406
|
return {
|
|
21201
|
-
id:
|
|
21202
|
-
version:
|
|
21203
|
-
requires: [
|
|
21204
|
-
provides: [
|
|
21407
|
+
id: US,
|
|
21408
|
+
version: Gx,
|
|
21409
|
+
requires: [TS],
|
|
21410
|
+
provides: [WS],
|
|
21205
21411
|
async setup(e) {
|
|
21206
|
-
let i = e.service.get(
|
|
21412
|
+
let i = e.service.get(TS);
|
|
21207
21413
|
if (!i) throw Error("Mesurer Codex plugin requires context() from mesurer-solid/plugins.");
|
|
21208
|
-
let a = n ?
|
|
21414
|
+
let a = n ? aC() : 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 = QS, _, v = "", y = null, b = a?.delivery ? {
|
|
21209
21415
|
id: a.delivery.id,
|
|
21210
21416
|
thread: a.delivery.thread,
|
|
21211
21417
|
status: a.delivery.status,
|
|
@@ -21214,38 +21420,38 @@ function _C(e = {}) {
|
|
|
21214
21420
|
dispatch: a.delivery.dispatch ?? null,
|
|
21215
21421
|
dispatchError: a.delivery.dispatchError ?? null
|
|
21216
21422
|
} : null, x = 0, S = 0, C = null, w = !1, T = null, E = async (e) => {
|
|
21217
|
-
if (e.action === "activate" || e.action === "runtime") return
|
|
21423
|
+
if (e.action === "activate" || e.action === "runtime") return sC(e);
|
|
21218
21424
|
if (!T) throw Error("Codex Bridge lease is not active for this plugin.");
|
|
21219
|
-
return
|
|
21425
|
+
return sC({
|
|
21220
21426
|
...e,
|
|
21221
21427
|
leaseId: T
|
|
21222
21428
|
});
|
|
21223
21429
|
}, D = async () => {
|
|
21224
21430
|
let e = T;
|
|
21225
21431
|
if (e) {
|
|
21226
|
-
if ((await
|
|
21432
|
+
if ((await sC({
|
|
21227
21433
|
action: "deactivate",
|
|
21228
21434
|
leaseId: e
|
|
21229
21435
|
})).released !== !0) throw Error("Codex Bridge did not confirm lease release.");
|
|
21230
21436
|
T = null;
|
|
21231
21437
|
}
|
|
21232
|
-
}, O = await
|
|
21438
|
+
}, O = await sC({
|
|
21233
21439
|
action: "activate",
|
|
21234
21440
|
thread: u ?? l ?? void 0
|
|
21235
21441
|
}), k = O.leaseId?.trim();
|
|
21236
21442
|
if (!k) throw Error("Codex Bridge did not return an activation lease.");
|
|
21237
|
-
T = k, o = "available", s =
|
|
21238
|
-
let A =
|
|
21443
|
+
T = k, o = "available", s = cC(O);
|
|
21444
|
+
let A = lC(O);
|
|
21239
21445
|
c = !0, f = A.thread, p = A.threads, e.lifecycle.onDispose(() => {
|
|
21240
21446
|
T && D().catch((e) => {
|
|
21241
21447
|
let t = e instanceof Error ? e.message : String(e);
|
|
21242
21448
|
console.error(`[Mesurer] Failed to release Codex host lease: ${t}`);
|
|
21243
21449
|
});
|
|
21244
|
-
}), e.hook.on(
|
|
21450
|
+
}), e.hook.on(GS, async (e) => {
|
|
21245
21451
|
e === "mesurer.codex" && await D();
|
|
21246
21452
|
});
|
|
21247
21453
|
let j = async () => {
|
|
21248
|
-
let e =
|
|
21454
|
+
let e = cC(await E({ action: "runtime" }));
|
|
21249
21455
|
if (!e) throw Error("Codex Bridge returned an invalid runtime state.");
|
|
21250
21456
|
return s = e, e;
|
|
21251
21457
|
}, M = async () => {
|
|
@@ -21253,8 +21459,8 @@ function _C(e = {}) {
|
|
|
21253
21459
|
action: "health",
|
|
21254
21460
|
thread: u ?? l ?? void 0
|
|
21255
21461
|
});
|
|
21256
|
-
return s =
|
|
21257
|
-
}, N = M, P = async (e) =>
|
|
21462
|
+
return s = cC(e) ?? s, lC(e);
|
|
21463
|
+
}, N = M, P = async (e) => uC(await E({
|
|
21258
21464
|
action: "delivery",
|
|
21259
21465
|
deliveryId: e
|
|
21260
21466
|
})), F = async (e) => {
|
|
@@ -21264,13 +21470,13 @@ function _C(e = {}) {
|
|
|
21264
21470
|
deliveryId: e.id,
|
|
21265
21471
|
thread: e.thread
|
|
21266
21472
|
};
|
|
21267
|
-
return e.queuedSubmissionId && (t.queuedSubmissionId = e.queuedSubmissionId),
|
|
21473
|
+
return e.queuedSubmissionId && (t.queuedSubmissionId = e.queuedSubmissionId), uC(await E(t));
|
|
21268
21474
|
}, I = async (e = {}) => {
|
|
21269
21475
|
let t = {
|
|
21270
21476
|
action: "threads",
|
|
21271
|
-
limit: e.limit ??
|
|
21477
|
+
limit: e.limit ?? ZS
|
|
21272
21478
|
}, n = e.thread?.trim();
|
|
21273
|
-
return n && (t.thread = n),
|
|
21479
|
+
return n && (t.thread = n), dC(await E(t));
|
|
21274
21480
|
}, L = () => u ?? l ?? (d ? null : f), R = () => {
|
|
21275
21481
|
if (!n) return;
|
|
21276
21482
|
let e = b?.id && (b.status === "queued" || b.status === "working" || b.status === "interrupted") ? {
|
|
@@ -21282,7 +21488,7 @@ function _C(e = {}) {
|
|
|
21282
21488
|
dispatch: b.dispatch,
|
|
21283
21489
|
dispatchError: b.dispatchError
|
|
21284
21490
|
} : null;
|
|
21285
|
-
|
|
21491
|
+
oC({
|
|
21286
21492
|
version: 1,
|
|
21287
21493
|
originThread: l,
|
|
21288
21494
|
selectedThread: u,
|
|
@@ -21300,12 +21506,12 @@ function _C(e = {}) {
|
|
|
21300
21506
|
"queueing",
|
|
21301
21507
|
"queued",
|
|
21302
21508
|
"working"
|
|
21303
|
-
].includes(b.status) ?
|
|
21509
|
+
].includes(b.status) ? nC : b.status === "completed" ? rC : tC : tC, ee = () => {
|
|
21304
21510
|
let e = [], t = /* @__PURE__ */ new Set(), n = (n) => {
|
|
21305
21511
|
t.has(n.id) || (t.add(n.id), e.push(n));
|
|
21306
21512
|
}, r = (e) => ({
|
|
21307
21513
|
id: e,
|
|
21308
|
-
title: `Codex ${
|
|
21514
|
+
title: `Codex ${pC(e)}`,
|
|
21309
21515
|
updatedAt: null,
|
|
21310
21516
|
connected: !0
|
|
21311
21517
|
});
|
|
@@ -21333,7 +21539,7 @@ function _C(e = {}) {
|
|
|
21333
21539
|
let t = e.id === l ? "Current · " : e.connected ? "Loaded · " : "", r = b?.thread === e.id ? ` · ${V(b.status)}` : "";
|
|
21334
21540
|
return {
|
|
21335
21541
|
id: `codex.thread.${e.id}`,
|
|
21336
|
-
label: `${t}${
|
|
21542
|
+
label: `${t}${mC(e.title)}${r}`,
|
|
21337
21543
|
checked: () => n === e.id,
|
|
21338
21544
|
disabled: () => B(),
|
|
21339
21545
|
run() {
|
|
@@ -21341,15 +21547,15 @@ function _C(e = {}) {
|
|
|
21341
21547
|
}
|
|
21342
21548
|
};
|
|
21343
21549
|
});
|
|
21344
|
-
return g <
|
|
21550
|
+
return g < ZS && (e.length > g || h) && r.push({
|
|
21345
21551
|
id: "codex.thread.show-more",
|
|
21346
21552
|
label: "Show 5 more…",
|
|
21347
21553
|
run() {
|
|
21348
|
-
g =
|
|
21554
|
+
g = ZS, W();
|
|
21349
21555
|
}
|
|
21350
21556
|
}), b?.queuedSubmissionId && b.status === "queued" && (b.dispatch === "desktop-opened" || b.dispatch === "desktop-wake-failed") && r.push({
|
|
21351
21557
|
id: "codex.delivery.receipt",
|
|
21352
|
-
label: `Receipt · ${
|
|
21558
|
+
label: `Receipt · ${pC(b.queuedSubmissionId)}`,
|
|
21353
21559
|
disabled: () => !0,
|
|
21354
21560
|
run: () => void 0
|
|
21355
21561
|
}), r;
|
|
@@ -21386,7 +21592,7 @@ function _C(e = {}) {
|
|
|
21386
21592
|
}, re = async (e) => {
|
|
21387
21593
|
if (o !== "available") return;
|
|
21388
21594
|
let t = await I({
|
|
21389
|
-
limit:
|
|
21595
|
+
limit: ZS,
|
|
21390
21596
|
thread: e ?? void 0
|
|
21391
21597
|
});
|
|
21392
21598
|
m = t.threads, h = t.hasMore, p = t.threads.filter((e) => e.connected).map((e) => e.id), f = t.thread;
|
|
@@ -21408,7 +21614,7 @@ function _C(e = {}) {
|
|
|
21408
21614
|
}, ae = () => {
|
|
21409
21615
|
S && globalThis.clearTimeout(S), S = globalThis.setTimeout(() => {
|
|
21410
21616
|
S = 0, b?.status === "completed" && (b = null, R(), W());
|
|
21411
|
-
},
|
|
21617
|
+
}, JS);
|
|
21412
21618
|
}, oe = async (e) => {
|
|
21413
21619
|
if (!(!b || b.id !== e.id)) {
|
|
21414
21620
|
if (b = {
|
|
@@ -21430,14 +21636,14 @@ function _C(e = {}) {
|
|
|
21430
21636
|
if (e.status === "interrupted") {
|
|
21431
21637
|
R(), W();
|
|
21432
21638
|
let t = e.updatedAt > 0 ? e.updatedAt : Date.now();
|
|
21433
|
-
Date.now() - t <
|
|
21639
|
+
Date.now() - t < XS && (x = globalThis.setTimeout(() => {
|
|
21434
21640
|
x = 0, se(e.id);
|
|
21435
|
-
},
|
|
21641
|
+
}, YS));
|
|
21436
21642
|
return;
|
|
21437
21643
|
}
|
|
21438
21644
|
W(), x = globalThis.setTimeout(() => {
|
|
21439
21645
|
x = 0, se(e.id);
|
|
21440
|
-
},
|
|
21646
|
+
}, qS);
|
|
21441
21647
|
}
|
|
21442
21648
|
}, se = async (e) => {
|
|
21443
21649
|
if (!(w || b?.id !== e)) try {
|
|
@@ -21461,7 +21667,7 @@ function _C(e = {}) {
|
|
|
21461
21667
|
b = {
|
|
21462
21668
|
...b,
|
|
21463
21669
|
status: "failed"
|
|
21464
|
-
}, R(),
|
|
21670
|
+
}, R(), hC(n) && (o = "unavailable"), W();
|
|
21465
21671
|
}
|
|
21466
21672
|
}, ce = {
|
|
21467
21673
|
health: M,
|
|
@@ -21473,11 +21679,11 @@ function _C(e = {}) {
|
|
|
21473
21679
|
let n = await E({
|
|
21474
21680
|
action: "target",
|
|
21475
21681
|
thread: t
|
|
21476
|
-
}), r =
|
|
21477
|
-
return s =
|
|
21682
|
+
}), r = lC(n);
|
|
21683
|
+
return s = cC(n) ?? s, z(t, !l), f = r.thread, p = r.threads, o = "available", c = !0, W(), r;
|
|
21478
21684
|
},
|
|
21479
21685
|
async queue(e) {
|
|
21480
|
-
let r = await
|
|
21686
|
+
let r = await fC(i, e, t), a = e?.thread?.trim(), s = a || (n ? L() : null);
|
|
21481
21687
|
if (n && !a && (d || !s)) throw Error("Choose a Codex thread before queueing feedback.");
|
|
21482
21688
|
let c = { message: r.message };
|
|
21483
21689
|
s && (c.thread = s);
|
|
@@ -21497,14 +21703,14 @@ function _C(e = {}) {
|
|
|
21497
21703
|
};
|
|
21498
21704
|
return e.queuedSubmissionId !== void 0 && (n.queuedSubmissionId = e.queuedSubmissionId?.trim() || null), e.dispatch !== void 0 && (n.dispatch = e.dispatch), e.dispatchError !== void 0 && (n.dispatchError = e.dispatchError?.trim() || null), n;
|
|
21499
21705
|
} catch (e) {
|
|
21500
|
-
throw n &&
|
|
21706
|
+
throw n && hC(e) && (o = "unavailable", W()), e;
|
|
21501
21707
|
}
|
|
21502
21708
|
},
|
|
21503
21709
|
send(e) {
|
|
21504
21710
|
return ce.queue(e);
|
|
21505
21711
|
}
|
|
21506
21712
|
};
|
|
21507
|
-
e.service.provide(
|
|
21713
|
+
e.service.provide(WS, ce);
|
|
21508
21714
|
let le = async () => {
|
|
21509
21715
|
if (!(C || B())) return ie(), b = {
|
|
21510
21716
|
id: null,
|
|
@@ -21535,9 +21741,9 @@ function _C(e = {}) {
|
|
|
21535
21741
|
updatedAt: 0
|
|
21536
21742
|
}) : x = globalThis.setTimeout(() => {
|
|
21537
21743
|
x = 0, se(e.deliveryId);
|
|
21538
|
-
},
|
|
21744
|
+
}, qS) : S = globalThis.setTimeout(() => {
|
|
21539
21745
|
S = 0, b?.id === null && b?.status === "queued" && (b = null, R(), W());
|
|
21540
|
-
},
|
|
21746
|
+
}, JS);
|
|
21541
21747
|
} catch (e) {
|
|
21542
21748
|
b = null, R(), W();
|
|
21543
21749
|
let t = e instanceof Error ? e.message : String(e);
|
|
@@ -21565,7 +21771,7 @@ function _C(e = {}) {
|
|
|
21565
21771
|
}, 0));
|
|
21566
21772
|
let t = globalThis.setInterval(() => {
|
|
21567
21773
|
c && te().catch(() => void 0);
|
|
21568
|
-
},
|
|
21774
|
+
}, KS);
|
|
21569
21775
|
e.lifecycle.onDispose(() => {
|
|
21570
21776
|
w = !0, ie(), globalThis.clearInterval(t), _?.dispose(), _ = void 0;
|
|
21571
21777
|
});
|
|
@@ -21575,66 +21781,66 @@ function _C(e = {}) {
|
|
|
21575
21781
|
}
|
|
21576
21782
|
//#endregion
|
|
21577
21783
|
//#region src/recording.ts
|
|
21578
|
-
var
|
|
21579
|
-
...
|
|
21580
|
-
version:
|
|
21581
|
-
}),
|
|
21582
|
-
...
|
|
21583
|
-
version:
|
|
21584
|
-
}),
|
|
21784
|
+
var _C = mb, vC = (e = {}) => ({
|
|
21785
|
+
...Ib(e),
|
|
21786
|
+
version: Gx
|
|
21787
|
+
}), yC = Jb, bC = (e = {}) => ({
|
|
21788
|
+
...mx(e),
|
|
21789
|
+
version: Gx
|
|
21790
|
+
}), xC = () => globalThis.window?.__MESURER_HOST__?.codexBridge !== void 0, SC = [
|
|
21585
21791
|
{
|
|
21586
|
-
id:
|
|
21792
|
+
id: wS,
|
|
21587
21793
|
label: "Context",
|
|
21588
21794
|
order: 30,
|
|
21589
|
-
create:
|
|
21795
|
+
create: FS,
|
|
21590
21796
|
settingsIds: ["context"],
|
|
21591
21797
|
hiddenSettingsControlIds: ["ui"]
|
|
21592
21798
|
},
|
|
21593
21799
|
{
|
|
21594
|
-
id:
|
|
21800
|
+
id: Kx,
|
|
21595
21801
|
label: "Edit",
|
|
21596
21802
|
order: 35,
|
|
21597
|
-
create:
|
|
21803
|
+
create: Jx,
|
|
21598
21804
|
settingsIds: ["arrange"]
|
|
21599
21805
|
},
|
|
21600
21806
|
{
|
|
21601
|
-
id:
|
|
21807
|
+
id: xS,
|
|
21602
21808
|
label: "Layout Guides",
|
|
21603
21809
|
order: 38,
|
|
21604
|
-
create:
|
|
21810
|
+
create: CS
|
|
21605
21811
|
},
|
|
21606
21812
|
{
|
|
21607
|
-
id:
|
|
21813
|
+
id: yC,
|
|
21608
21814
|
label: "Screenshot",
|
|
21609
21815
|
order: 40,
|
|
21610
|
-
create:
|
|
21816
|
+
create: bC,
|
|
21611
21817
|
settingsIds: ["screenshot"],
|
|
21612
21818
|
hiddenSettingsControlIds: ["tool"]
|
|
21613
21819
|
},
|
|
21614
21820
|
{
|
|
21615
|
-
id:
|
|
21821
|
+
id: _C,
|
|
21616
21822
|
label: "Recording",
|
|
21617
21823
|
description: "Record a selected page region and trim, resize, or export it through MediaBunny.",
|
|
21618
21824
|
order: 42,
|
|
21619
|
-
create:
|
|
21825
|
+
create: vC,
|
|
21620
21826
|
settingsIds: ["recording"],
|
|
21621
21827
|
hiddenSettingsControlIds: ["tool"]
|
|
21622
21828
|
},
|
|
21623
21829
|
{
|
|
21624
|
-
id:
|
|
21830
|
+
id: US,
|
|
21625
21831
|
label: "Codex",
|
|
21626
21832
|
description: "Connects Mesurer to open Codex threads on this computer. Electron hosts provide the native Codex connection through preload.",
|
|
21627
21833
|
order: 45,
|
|
21628
|
-
create:
|
|
21834
|
+
create: gC
|
|
21629
21835
|
}
|
|
21630
|
-
],
|
|
21631
|
-
let t = e !== void 0, n = new Map((e ?? []).map((e) => [e.id, e])), r = new Set(
|
|
21836
|
+
], CC = (e) => {
|
|
21837
|
+
let t = e !== void 0, n = new Map((e ?? []).map((e) => [e.id, e])), r = new Set(SC.map((e) => e.id)), i = SC.map((e) => {
|
|
21632
21838
|
let r = n.get(e.id);
|
|
21633
21839
|
return {
|
|
21634
21840
|
...e,
|
|
21635
21841
|
settingsIds: e.settingsIds ? [...e.settingsIds] : void 0,
|
|
21636
21842
|
hiddenSettingsControlIds: e.hiddenSettingsControlIds ? [...e.hiddenSettingsControlIds] : void 0,
|
|
21637
|
-
enabled: t ? !!r : e.id === "mesurer.codex" ?
|
|
21843
|
+
enabled: t ? !!r : e.id === "mesurer.codex" ? xC() : e.enabled !== !1,
|
|
21638
21844
|
create: r ? () => r : e.create
|
|
21639
21845
|
};
|
|
21640
21846
|
});
|
|
@@ -21645,16 +21851,16 @@ var vC = hb, yC = (e = {}) => ({
|
|
|
21645
21851
|
create: () => n
|
|
21646
21852
|
});
|
|
21647
21853
|
return i;
|
|
21648
|
-
},
|
|
21649
|
-
function
|
|
21650
|
-
return
|
|
21854
|
+
}, wC = (e) => e;
|
|
21855
|
+
function TC() {
|
|
21856
|
+
return aS();
|
|
21651
21857
|
}
|
|
21652
|
-
async function
|
|
21653
|
-
return
|
|
21858
|
+
async function EC(e = {}) {
|
|
21859
|
+
return oS(e);
|
|
21654
21860
|
}
|
|
21655
21861
|
//#endregion
|
|
21656
21862
|
//#region src/index.tsx
|
|
21657
|
-
var
|
|
21863
|
+
var DC = {
|
|
21658
21864
|
select: "select",
|
|
21659
21865
|
xray: "xray",
|
|
21660
21866
|
colorPicker: "color-picker",
|
|
@@ -21664,14 +21870,14 @@ var OC = {
|
|
|
21664
21870
|
distance: "distance",
|
|
21665
21871
|
settings: "settings"
|
|
21666
21872
|
};
|
|
21667
|
-
function
|
|
21873
|
+
function OC(e = {}) {
|
|
21668
21874
|
if (!("document" in globalThis)) throw Error("mountMesurer() requires a browser or Electron renderer document.");
|
|
21669
21875
|
let { target: t = document.body, isolate: n = !0, shadowMode: r = "open", topLayer: i = !0, agent: a = !1, signal: o, onPluginHost: s, onPluginsReady: c, plugins: l, excludeBuiltins: u, excludePlugins: d, ...f } = e;
|
|
21670
21876
|
if (o?.aborted) throw o.reason ?? new DOMException("Mesurer mount aborted.", "AbortError");
|
|
21671
21877
|
if (!t) throw Error("mountMesurer() requires document.body to exist or an explicit target.");
|
|
21672
21878
|
let p = t.ownerDocument ?? document, m = p.defaultView ?? window, h = p.createElement("div");
|
|
21673
21879
|
h.dataset.mesurerIsland = "true";
|
|
21674
|
-
let g =
|
|
21880
|
+
let g = HS(h, t, i), _ = h, v = h, y = h;
|
|
21675
21881
|
if (n) {
|
|
21676
21882
|
let e = h.attachShadow({ mode: r });
|
|
21677
21883
|
v = p.createElement("div"), v.dataset.mesurerIslandMount = "true", e.append(v), _ = e, y = e;
|
|
@@ -21682,7 +21888,7 @@ function kC(e = {}) {
|
|
|
21682
21888
|
C = e, w = t;
|
|
21683
21889
|
});
|
|
21684
21890
|
D.catch(() => void 0), O.catch(() => void 0);
|
|
21685
|
-
let k = async () => (await (b ? Promise.resolve(b) : D), O), A = a === !0 ? {} : a === !1 ? null : a, j =
|
|
21891
|
+
let k = async () => (await (b ? Promise.resolve(b) : D), O), A = a === !0 ? {} : a === !1 ? null : a, j = Wx({
|
|
21686
21892
|
ownerDocument: p,
|
|
21687
21893
|
root: A?.root ?? (t.nodeType === 11 ? t : p),
|
|
21688
21894
|
getPluginHost: () => b,
|
|
@@ -21694,12 +21900,12 @@ function kC(e = {}) {
|
|
|
21694
21900
|
return t;
|
|
21695
21901
|
}, N = async () => {
|
|
21696
21902
|
await j.ready();
|
|
21697
|
-
let e = b?.service.get(
|
|
21903
|
+
let e = b?.service.get(TS);
|
|
21698
21904
|
if (!e) throw Error("Mesurer Context is disabled. Enable it in Settings or include context() in plugins.");
|
|
21699
21905
|
return e;
|
|
21700
21906
|
}, P = async () => {
|
|
21701
21907
|
await j.ready();
|
|
21702
|
-
let e = b?.service.get(
|
|
21908
|
+
let e = b?.service.get(Yx);
|
|
21703
21909
|
if (!e) throw Error("Mesurer Edit is disabled. Enable it in Settings or include edit() in plugins.");
|
|
21704
21910
|
return e;
|
|
21705
21911
|
}, F = async (e) => (await N()).context(e), I = async (e) => (await N()).contextText(e), L = async (e) => (await N()).copyContext(e), R = async (e) => (await N()).select(e), z = async () => (await N()).annotations(), B = async (e) => (await N()).review(e), V = async (e) => (await N()).capturePlan(e), H = async () => (await N()).prepareCapture(), U = async () => (await N()).finishCapture(), ee = async () => (await P()).intents(), te = async (e) => {
|
|
@@ -21710,7 +21916,7 @@ function kC(e = {}) {
|
|
|
21710
21916
|
(await P()).show(e, t);
|
|
21711
21917
|
}, W = async (e, t) => (await P()).capturePlan(e, t), re = async (e, t) => (await P()).review(e, t), ie = () => j.textEdits(), ae = (e) => j.textEdit(e), oe = Object.assign(j, {
|
|
21712
21918
|
capabilities: () => {
|
|
21713
|
-
let e = !!b?.service.get(
|
|
21919
|
+
let e = !!b?.service.get(TS);
|
|
21714
21920
|
return {
|
|
21715
21921
|
protocol: "mesurer.agent/v1",
|
|
21716
21922
|
contextSchema: "mesurer.context/v1",
|
|
@@ -21720,8 +21926,8 @@ function kC(e = {}) {
|
|
|
21720
21926
|
annotations: e,
|
|
21721
21927
|
review: e,
|
|
21722
21928
|
capturePlan: e,
|
|
21723
|
-
arrange: !!b?.service.get(
|
|
21724
|
-
textEdit: !!b?.service.get(
|
|
21929
|
+
arrange: !!b?.service.get(Yx),
|
|
21930
|
+
textEdit: !!b?.service.get(Hx)
|
|
21725
21931
|
}
|
|
21726
21932
|
};
|
|
21727
21933
|
},
|
|
@@ -21740,9 +21946,9 @@ function kC(e = {}) {
|
|
|
21740
21946
|
reviewArrange: re
|
|
21741
21947
|
}), se = {
|
|
21742
21948
|
...f,
|
|
21743
|
-
version:
|
|
21744
|
-
plugins:
|
|
21745
|
-
excludePlugins: u ? u.map((e) =>
|
|
21949
|
+
version: Gx,
|
|
21950
|
+
plugins: CC(l),
|
|
21951
|
+
excludePlugins: u ? u.map((e) => DC[e]) : [...d ?? []]
|
|
21746
21952
|
}, ce = Oi(() => Yr(rv, Di(se, {
|
|
21747
21953
|
portalTarget: y,
|
|
21748
21954
|
pageTarget: t,
|
|
@@ -21811,6 +22017,6 @@ function kC(e = {}) {
|
|
|
21811
22017
|
}
|
|
21812
22018
|
return he;
|
|
21813
22019
|
}
|
|
21814
|
-
var
|
|
22020
|
+
var kC = OC;
|
|
21815
22021
|
//#endregion
|
|
21816
|
-
export {
|
|
22022
|
+
export { Hx as MESURER_TEXT_EDIT_SERVICE_ID, Gx as MESURER_VERSION, dS as captureMesurerContext, bS as copyTextToClipboard, Wx as createMesurerAgentHarness, hS as createMesurerCapturePlan, TC as createMesurerPluginHost, EC as createMesurerRuntime, wC as defineMesurerPlugin, mS as formatMesurerContext, kC as mountMeasurer, OC as mountMesurer, yS as reviewMesurerAnnotation };
|