mesurer-solid 0.1.8-beta.1 → 0.1.8-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +29 -27
- package/dist/inject-script.js +3 -3
- package/dist/inject.js +29 -27
- package/dist/plugins.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5142,8 +5142,10 @@ function oc(e) {
|
|
|
5142
5142
|
var n = X("div", {
|
|
5143
5143
|
"data-mesurer-measurement-chrome": "true",
|
|
5144
5144
|
class: "msr:absolute"
|
|
5145
|
-
})
|
|
5146
|
-
return
|
|
5145
|
+
});
|
|
5146
|
+
return Ji(() => (e) => {
|
|
5147
|
+
t = e;
|
|
5148
|
+
}, n), Q(n, Y(q, {
|
|
5147
5149
|
get when() {
|
|
5148
5150
|
return a().top;
|
|
5149
5151
|
},
|
|
@@ -5208,9 +5210,9 @@ function oc(e) {
|
|
|
5208
5210
|
"data-mesurer-measurement-label": "true",
|
|
5209
5211
|
class: "msr:pointer-events-none msr:absolute msr:rounded msr:px-1 msr:py-0.5 msr:text-[10px] msr:text-ink-50 msr:tabular-nums msr:select-none msr:-translate-x-1/2 msr:bg-ink-900/90"
|
|
5210
5212
|
}), t = Wi(" x ");
|
|
5211
|
-
Z(e, t)
|
|
5212
|
-
|
|
5213
|
-
|
|
5213
|
+
return Z(e, t), Ji(() => (e) => {
|
|
5214
|
+
n = e;
|
|
5215
|
+
}, e), Q(e, () => ic(r().rect.width), t), Q(e, () => ic(r().rect.height), null), J(() => ({
|
|
5214
5216
|
left: `${r().rect.left + d().x + r().rect.width / 2}px`,
|
|
5215
5217
|
top: `${r().rect.top + d().y + r().rect.height + 2}px`,
|
|
5216
5218
|
"z-index": s() ? ac : void 0,
|
|
@@ -13490,9 +13492,9 @@ function jh(e, t) {
|
|
|
13490
13492
|
u.popup.style.width = `${n}px`;
|
|
13491
13493
|
let i = u.popup.getBoundingClientRect(), a = r.innerWidth - kh, o = r.innerHeight - kh, s = Math.max(kh, a - i.width), c = Math.min(Math.max(e.left, kh), s), l = e.bottom + Ah, f = e.top - Ah - i.height, p = l + i.height <= o || f < kh ? Math.min(l, Math.max(kh, o - i.height)) : f;
|
|
13492
13494
|
u.popup.style.left = `${c}px`, u.popup.style.top = `${Math.max(kh, p)}px`;
|
|
13493
|
-
}, p = (e
|
|
13494
|
-
let
|
|
13495
|
-
|
|
13495
|
+
}, p = (e) => {
|
|
13496
|
+
let t = n.createElement("button");
|
|
13497
|
+
t.type = "button", t.dataset.mesurerUnifiedSelectOption = e.key, t.setAttribute("role", "option"), t.setAttribute("aria-selected", e.selected ? "true" : "false"), t.disabled = e.disabled, Object.assign(t.style, {
|
|
13496
13498
|
width: "100%",
|
|
13497
13499
|
minHeight: "30px",
|
|
13498
13500
|
display: "flex",
|
|
@@ -13511,39 +13513,39 @@ function jh(e, t) {
|
|
|
13511
13513
|
opacity: e.disabled ? "0.55" : "1",
|
|
13512
13514
|
pointerEvents: "auto"
|
|
13513
13515
|
});
|
|
13514
|
-
let
|
|
13515
|
-
if (
|
|
13516
|
+
let r = n.createElement("span");
|
|
13517
|
+
if (r.textContent = e.label, Object.assign(r.style, {
|
|
13516
13518
|
minWidth: "0",
|
|
13517
13519
|
overflow: "hidden",
|
|
13518
13520
|
textOverflow: "ellipsis",
|
|
13519
13521
|
whiteSpace: "nowrap"
|
|
13520
|
-
}),
|
|
13521
|
-
let
|
|
13522
|
-
|
|
13522
|
+
}), t.append(r), e.shortcut) {
|
|
13523
|
+
let r = n.createElement("span");
|
|
13524
|
+
r.textContent = e.shortcut, Object.assign(r.style, {
|
|
13523
13525
|
flex: "0 0 auto",
|
|
13524
13526
|
color: Th,
|
|
13525
13527
|
font: "500 10px/1 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif",
|
|
13526
13528
|
whiteSpace: "nowrap"
|
|
13527
|
-
}),
|
|
13529
|
+
}), t.append(r);
|
|
13528
13530
|
}
|
|
13529
|
-
return
|
|
13530
|
-
e.disabled || (
|
|
13531
|
-
}),
|
|
13532
|
-
|
|
13533
|
-
}),
|
|
13531
|
+
return t.addEventListener("mouseenter", () => {
|
|
13532
|
+
e.disabled || (t.style.background = e.selected ? Ch : Sh);
|
|
13533
|
+
}), t.addEventListener("mouseleave", () => {
|
|
13534
|
+
t.style.background = e.selected ? Ch : "transparent";
|
|
13535
|
+
}), t.addEventListener("click", () => {
|
|
13534
13536
|
e.disabled || (e.activate(), d());
|
|
13535
|
-
}),
|
|
13537
|
+
}), t.addEventListener("keydown", (e) => {
|
|
13536
13538
|
if (e.key === "Escape") {
|
|
13537
13539
|
e.preventDefault(), d(!0);
|
|
13538
13540
|
return;
|
|
13539
13541
|
}
|
|
13540
13542
|
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
13541
13543
|
e.preventDefault();
|
|
13542
|
-
let
|
|
13543
|
-
if (!
|
|
13544
|
-
let
|
|
13545
|
-
i < 0 ||
|
|
13546
|
-
}),
|
|
13544
|
+
let n = t.closest("[data-mesurer-unified-select-popup='true']");
|
|
13545
|
+
if (!n) return;
|
|
13546
|
+
let r = Array.from(n.querySelectorAll("[data-mesurer-unified-select-option]")).filter((e) => !e.disabled), i = r.indexOf(t);
|
|
13547
|
+
i < 0 || r.length === 0 || r[(i + (e.key === "ArrowDown" ? 1 : -1) + r.length) % r.length]?.focus({ preventScroll: !0 });
|
|
13548
|
+
}), t;
|
|
13547
13549
|
}, m = (e, t, r) => {
|
|
13548
13550
|
if (u?.trigger === e) {
|
|
13549
13551
|
d(!0);
|
|
@@ -13566,7 +13568,7 @@ function jh(e, t) {
|
|
|
13566
13568
|
boxShadow: "0 8px 24px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.08)",
|
|
13567
13569
|
pointerEvents: "auto"
|
|
13568
13570
|
});
|
|
13569
|
-
for (let
|
|
13571
|
+
for (let e of r) i.append(p(e));
|
|
13570
13572
|
s.append(i), e.setAttribute("aria-expanded", "true"), t?.style.setProperty("transform", "rotate(225deg)");
|
|
13571
13573
|
let a = e.closest("[data-mesurer-unified-select-shell='true'], [data-mesurer-unified-style-shell='true']");
|
|
13572
13574
|
a && (a.style.borderColor = "transparent", a.style.boxShadow = `inset 0 0 0 1px ${Oh}`), u = {
|
|
@@ -17010,7 +17012,7 @@ async function Y_(e, t, n) {
|
|
|
17010
17012
|
}
|
|
17011
17013
|
//#endregion
|
|
17012
17014
|
//#region src/version.ts
|
|
17013
|
-
var X_ = "0.1.8-beta.
|
|
17015
|
+
var X_ = "0.1.8-beta.2", Z_ = "mesurer.context", Q_ = "context:v1", $_ = "mesurer.context.settings", ev = "context.ui", tv = "data-mesurer-direct-text-edit-active", nv = {
|
|
17014
17016
|
viewBox: "0 0 256 256",
|
|
17015
17017
|
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"]
|
|
17016
17018
|
}, rv = {
|