@takazudo/zdtp 0.5.1 → 0.5.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/CHANGELOG.md +30 -1
- package/PORTABLE-CONTRACT.md +66 -1
- package/dist/controls/actions-menu-popover.d.ts +4 -0
- package/dist/controls/role-button.d.ts +4 -1
- package/dist/{index-RLAXfjv2.js → index-CAQf4HKm.js} +1 -1
- package/dist/{index-D4NR_eYT.js → index-ChsJ5u4d.js} +332 -327
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -3,9 +3,9 @@ import { createContext as lt, Fragment as Xe, render as Za } from "preact";
|
|
|
3
3
|
import { useRef as U, useCallback as L, useState as J, useMemo as G, useEffect as oe, useId as vn, useLayoutEffect as Qa, useContext as xn, createPortal as Vt, forwardRef as Ql, memo as St } from "preact/compat";
|
|
4
4
|
import { i as bt, c as fn, d as vt, e as ht, s as tr, f as Fe, n as nr, h as ei, j as Kt, o as ot, k as ti, m as es, p as xo, q as Le, r as dt, M as or, t as rr, u as ts, v as yn, w as cn, x as Or, y as ns, z as rn, A as Wn, B as Br, C as Vo, D as Vr, E as os, F as rs, G as as, H as is, g as dn, I as ls, J as ss, K as An, L as cs, N as ds, O as jr, P as ps, Q as us, R as yo, l as jo, S as Fo, T as ni, U as ks, V as hs, W as an, X as fs, Y as ms, _ as No, $ as Fr, a0 as gs, a1 as Hr, a2 as Co, a3 as ws, a4 as bs, b as vs } from "./tweak-state-c53KtLHq.js";
|
|
5
5
|
import { B as Un, x as je, C as Ct, q as oi, p as ar, A as ir, g as Ee, D as xs, m as le, o as ys, E as Ns, F as ri, G as ai, H as Cs, I as ii, a as li, J as si, K as Ss, i as Es, L as $s, M as Is, N as lr, O as ci, P as Ts, Q as di } from "./panel-config-CqbuB0nh.js";
|
|
6
|
-
import { c as
|
|
7
|
-
import { r as
|
|
8
|
-
import { useContext as st, useCallback as te, useRef as $e, useEffect as ye, useState as
|
|
6
|
+
import { c as zs } from "./color-schemes-CgzOBqGO.js";
|
|
7
|
+
import { r as _s } from "./route-tokens-to-files-1DvmWBdj.js";
|
|
8
|
+
import { useContext as st, useCallback as te, useRef as $e, useEffect as ye, useState as ze, useMemo as Ve, useImperativeHandle as As } from "preact/hooks";
|
|
9
9
|
import { e as Pe, l as pi, b as qn, a as ui, f as Ls, s as ki, r as sr, c as Ms, g as Ps } from "./autoload-state-BI4-9A58.js";
|
|
10
10
|
import { f as Rs } from "./manifest-DvuKi7I4.js";
|
|
11
11
|
import { DEFAULT_TOGGLE_EVENT as Ds } from "./constants.js";
|
|
@@ -371,8 +371,8 @@ function xi(e, t, n, o) {
|
|
|
371
371
|
o.push(`${g.id}.raw.${C} is not a non-empty string; ignored.`);
|
|
372
372
|
continue;
|
|
373
373
|
}
|
|
374
|
-
const
|
|
375
|
-
|
|
374
|
+
const z = S[E.tierId] ?? (S[E.tierId] = {});
|
|
375
|
+
z[E.itemId] = A, M = !0;
|
|
376
376
|
}
|
|
377
377
|
M && (f || (f = {}), f[g.id] = S);
|
|
378
378
|
}
|
|
@@ -635,7 +635,7 @@ function ur(e = Ee()) {
|
|
|
635
635
|
}
|
|
636
636
|
function rc(e, t) {
|
|
637
637
|
if (t) return t;
|
|
638
|
-
const n = Object.values(
|
|
638
|
+
const n = Object.values(zs)[0];
|
|
639
639
|
return n ? ei(n) : e;
|
|
640
640
|
}
|
|
641
641
|
function ac({ onClose: e, state: t, colorDefaults: n, instanceConfig: o }) {
|
|
@@ -799,8 +799,8 @@ function ic({ onClose: e, onLoad: t, colorDefaults: n, instanceConfig: o }) {
|
|
|
799
799
|
console.groupCollapsed(
|
|
800
800
|
`[design-token-serde] ${S.length} unknown token${S.length === 1 ? "" : "s"} ignored while loading JSON`
|
|
801
801
|
);
|
|
802
|
-
for (const
|
|
803
|
-
console.warn(
|
|
802
|
+
for (const z of S)
|
|
803
|
+
console.warn(z);
|
|
804
804
|
console.groupEnd();
|
|
805
805
|
}
|
|
806
806
|
M.length > 0 && console.warn("[design-token-serde] warnings:", M), t(T);
|
|
@@ -1087,15 +1087,15 @@ function yi(e, t, n) {
|
|
|
1087
1087
|
function fc(e) {
|
|
1088
1088
|
const { state: t, open: n, onClose: o, colorDefaults: r, onApplied: a } = e, s = e.instanceConfig ?? Ee(), l = G(() => kc(s), [s]), p = U(null), c = U(null), d = `${s.modalClassPrefix}-apply-title-${vn()}`, [u, k] = J({ kind: "preview" }), f = U(u);
|
|
1089
1089
|
f.current = u;
|
|
1090
|
-
const [g, m] = J(null), [b, T] = J(null), [S, M] = J(null), [C, A] = J(!1), [E,
|
|
1090
|
+
const [g, m] = J(null), [b, T] = J(null), [S, M] = J(null), [C, A] = J(!1), [E, z] = J(/* @__PURE__ */ new Set()), [B, P] = J(0), [x, y] = J(null), [N, w] = J("Copy pre-apply state to clipboard"), q = U(0), $ = U(null), V = U(null), R = U(!1), X = U(!1), _ = G(() => yi(t, r, s), [t, r, s]), W = G(() => Ns(s), [s]), Y = G(() => _s(_, W), [_, W]), re = s.applyEndpoint, K = ri(s);
|
|
1091
1091
|
oe(() => {
|
|
1092
1092
|
const Q = p.current;
|
|
1093
1093
|
Q && (n && !Q.open ? (typeof Q.showModal == "function" ? Q.showModal() : Q.setAttribute("open", ""), requestAnimationFrame(() => c.current?.focus())) : !n && Q.open && (typeof Q.close == "function" ? Q.close() : Q.removeAttribute("open")));
|
|
1094
1094
|
}, [n]), oe(() => {
|
|
1095
1095
|
if (!n) return;
|
|
1096
1096
|
const Q = Y.groups.flatMap((ie) => Object.keys(ie.tokens));
|
|
1097
|
-
k({ kind: "preview" }), m(null), $.current = null, T(null), M(null),
|
|
1098
|
-
}, [n,
|
|
1097
|
+
k({ kind: "preview" }), m(null), $.current = null, T(null), M(null), z(new Set(Q)), P(0), y(null), w("Copy pre-apply state to clipboard"), q.current++, V.current = null, R.current = !1, X.current = !1, K && Object.keys(_).length > 0 && (V.current = F(_));
|
|
1098
|
+
}, [n, _, Y]);
|
|
1099
1099
|
async function F(Q, ie) {
|
|
1100
1100
|
if (!re || Object.keys(Q).length === 0) return null;
|
|
1101
1101
|
const be = ++q.current;
|
|
@@ -1113,7 +1113,7 @@ function fc(e) {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
oe(() => {
|
|
1115
1115
|
if (!n || !K || u.kind !== "preview" || B === 0) return;
|
|
1116
|
-
const Q = Object.fromEntries(Object.entries(
|
|
1116
|
+
const Q = Object.fromEntries(Object.entries(_).filter(([be]) => E.has(be)));
|
|
1117
1117
|
if (Object.keys(Q).length === 0) {
|
|
1118
1118
|
q.current++, V.current = null, $.current = null, R.current = !1, m(null), A(!1);
|
|
1119
1119
|
return;
|
|
@@ -1122,7 +1122,7 @@ function fc(e) {
|
|
|
1122
1122
|
V.current = F(Q);
|
|
1123
1123
|
}, uc);
|
|
1124
1124
|
return () => clearTimeout(ie);
|
|
1125
|
-
}, [n, K, u.kind,
|
|
1125
|
+
}, [n, K, u.kind, _, E, B]);
|
|
1126
1126
|
function ne() {
|
|
1127
1127
|
const Q = f.current;
|
|
1128
1128
|
Q.kind === "success" && !X.current && (X.current = !0, a(Q.written)), o();
|
|
@@ -1135,7 +1135,7 @@ function fc(e) {
|
|
|
1135
1135
|
const ke = cr(p, ce);
|
|
1136
1136
|
async function Z() {
|
|
1137
1137
|
if (!re || C || R.current) return;
|
|
1138
|
-
const Q = Object.fromEntries(Object.entries(
|
|
1138
|
+
const Q = Object.fromEntries(Object.entries(_).filter(([ie]) => E.has(ie)));
|
|
1139
1139
|
k({ kind: "applying" });
|
|
1140
1140
|
try {
|
|
1141
1141
|
const ie = await (V.current ?? Promise.resolve($.current)), be = Object.fromEntries((ie?.files ?? []).filter((O) => O.file && O.digest).map((O) => [O.file, O.digest])), Ne = await fetch(re, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ tokens: Q, expectDigests: be }) }), ve = await Ne.json();
|
|
@@ -1153,8 +1153,8 @@ function fc(e) {
|
|
|
1153
1153
|
k({ kind: "error", message: `Network error: ${ie instanceof Error ? ie.message : String(ie)}` });
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
|
-
const de = b?.files ?? g?.files ?? Y.groups.map((Q) => ({ file: Q.relativePath, blockKind: Q.prefix, changed: Object.keys(Q.tokens), hunks: [] })),
|
|
1157
|
-
q.current++, V.current = null, $.current = null, R.current = K, K && A(!0),
|
|
1156
|
+
const de = b?.files ?? g?.files ?? Y.groups.map((Q) => ({ file: Q.relativePath, blockKind: Q.prefix, changed: Object.keys(Q.tokens), hunks: [] })), _e = b?.rejected ?? g?.rejected ?? Y.rejected, j = b?.rejectedReasons ?? g?.rejectedReasons ?? Y.rejectedReasons, ae = de.find((Q) => Q.file === x) ?? de[0], pe = de.filter((Q) => Q.changed?.some((ie) => E.has(ie))).length, fe = !K || C || E.size === 0 || pe === 0, we = (Q, ie) => {
|
|
1157
|
+
q.current++, V.current = null, $.current = null, R.current = K, K && A(!0), z((be) => {
|
|
1158
1158
|
const Ne = new Set(be);
|
|
1159
1159
|
for (const ve of Q)
|
|
1160
1160
|
ie ? Ne.add(ve) : Ne.delete(ve);
|
|
@@ -1186,11 +1186,11 @@ function fc(e) {
|
|
|
1186
1186
|
{
|
|
1187
1187
|
cls: l,
|
|
1188
1188
|
configured: K,
|
|
1189
|
-
overrides:
|
|
1189
|
+
overrides: _,
|
|
1190
1190
|
files: de,
|
|
1191
1191
|
activeFile: ae,
|
|
1192
1192
|
selected: E,
|
|
1193
|
-
rejected:
|
|
1193
|
+
rejected: _e,
|
|
1194
1194
|
rejectedReasons: j,
|
|
1195
1195
|
notice: S,
|
|
1196
1196
|
loading: C,
|
|
@@ -1364,13 +1364,14 @@ function ue({
|
|
|
1364
1364
|
id: l,
|
|
1365
1365
|
title: p,
|
|
1366
1366
|
"aria-label": c,
|
|
1367
|
-
"data-testid": d
|
|
1367
|
+
"data-testid": d,
|
|
1368
|
+
"data-zdtp-action": u
|
|
1368
1369
|
}) {
|
|
1369
|
-
function
|
|
1370
|
-
(
|
|
1370
|
+
function k(g) {
|
|
1371
|
+
(g.key === "Enter" || g.key === " ") && (g.preventDefault(), o || t(g));
|
|
1371
1372
|
}
|
|
1372
|
-
function
|
|
1373
|
-
o || t(
|
|
1373
|
+
function f(g) {
|
|
1374
|
+
o || t(g);
|
|
1374
1375
|
}
|
|
1375
1376
|
return /* @__PURE__ */ i(
|
|
1376
1377
|
"div",
|
|
@@ -1379,13 +1380,14 @@ function ue({
|
|
|
1379
1380
|
ref: s,
|
|
1380
1381
|
tabIndex: a,
|
|
1381
1382
|
className: n,
|
|
1382
|
-
onClick:
|
|
1383
|
-
onKeyDown:
|
|
1383
|
+
onClick: f,
|
|
1384
|
+
onKeyDown: k,
|
|
1384
1385
|
"aria-disabled": o,
|
|
1385
1386
|
id: l,
|
|
1386
1387
|
title: p,
|
|
1387
1388
|
"aria-label": c,
|
|
1388
1389
|
"data-testid": d,
|
|
1390
|
+
"data-zdtp-action": u,
|
|
1389
1391
|
...r,
|
|
1390
1392
|
children: e
|
|
1391
1393
|
}
|
|
@@ -1443,21 +1445,21 @@ function qr({
|
|
|
1443
1445
|
M.current = p;
|
|
1444
1446
|
const C = U(c);
|
|
1445
1447
|
C.current = c;
|
|
1446
|
-
function A(
|
|
1448
|
+
function A(z) {
|
|
1447
1449
|
const B = g.current;
|
|
1448
1450
|
if (!B) return null;
|
|
1449
1451
|
const P = B.getBoundingClientRect();
|
|
1450
1452
|
if (P.width === 0) return null;
|
|
1451
|
-
const x = Rn((
|
|
1453
|
+
const x = Rn((z - P.left) / P.width, 0, 1), y = M.current + x * (C.current - M.current), N = Sc(y, M.current, k.current);
|
|
1452
1454
|
return Rn(N, M.current, C.current);
|
|
1453
1455
|
}
|
|
1454
1456
|
oe(() => {
|
|
1455
|
-
const
|
|
1456
|
-
if (!
|
|
1457
|
+
const z = g.current;
|
|
1458
|
+
if (!z) return;
|
|
1457
1459
|
function B(N) {
|
|
1458
1460
|
f.current = !0, T.current();
|
|
1459
1461
|
try {
|
|
1460
|
-
|
|
1462
|
+
z.setPointerCapture(N.pointerId);
|
|
1461
1463
|
} catch {
|
|
1462
1464
|
}
|
|
1463
1465
|
const w = A(N.clientX);
|
|
@@ -1472,7 +1474,7 @@ function qr({
|
|
|
1472
1474
|
if (f.current) {
|
|
1473
1475
|
f.current = !1;
|
|
1474
1476
|
try {
|
|
1475
|
-
|
|
1477
|
+
z.releasePointerCapture(N.pointerId);
|
|
1476
1478
|
} catch {
|
|
1477
1479
|
}
|
|
1478
1480
|
S.current();
|
|
@@ -1482,39 +1484,39 @@ function qr({
|
|
|
1482
1484
|
if (f.current) {
|
|
1483
1485
|
f.current = !1;
|
|
1484
1486
|
try {
|
|
1485
|
-
|
|
1487
|
+
z.releasePointerCapture(N.pointerId);
|
|
1486
1488
|
} catch {
|
|
1487
1489
|
}
|
|
1488
1490
|
S.current();
|
|
1489
1491
|
}
|
|
1490
1492
|
}
|
|
1491
|
-
return
|
|
1492
|
-
|
|
1493
|
+
return z.addEventListener("pointerdown", B), z.addEventListener("pointermove", P), z.addEventListener("pointerup", x), z.addEventListener("pointercancel", y), () => {
|
|
1494
|
+
z.removeEventListener("pointerdown", B), z.removeEventListener("pointermove", P), z.removeEventListener("pointerup", x), z.removeEventListener("pointercancel", y);
|
|
1493
1495
|
};
|
|
1494
1496
|
}, []);
|
|
1495
1497
|
const E = L(
|
|
1496
|
-
(
|
|
1498
|
+
(z) => {
|
|
1497
1499
|
const B = d * 10;
|
|
1498
1500
|
let P = 0;
|
|
1499
|
-
switch (
|
|
1501
|
+
switch (z.key) {
|
|
1500
1502
|
case "ArrowRight":
|
|
1501
1503
|
case "ArrowUp":
|
|
1502
|
-
P =
|
|
1504
|
+
P = z.shiftKey ? B : d;
|
|
1503
1505
|
break;
|
|
1504
1506
|
case "ArrowLeft":
|
|
1505
1507
|
case "ArrowDown":
|
|
1506
|
-
P =
|
|
1508
|
+
P = z.shiftKey ? -B : -d;
|
|
1507
1509
|
break;
|
|
1508
1510
|
case "Home":
|
|
1509
|
-
o(p),
|
|
1511
|
+
o(p), z.preventDefault();
|
|
1510
1512
|
return;
|
|
1511
1513
|
case "End":
|
|
1512
|
-
o(c),
|
|
1514
|
+
o(c), z.preventDefault();
|
|
1513
1515
|
return;
|
|
1514
1516
|
default:
|
|
1515
1517
|
return;
|
|
1516
1518
|
}
|
|
1517
|
-
|
|
1519
|
+
z.preventDefault(), o(Rn(t + P, p, c));
|
|
1518
1520
|
},
|
|
1519
1521
|
[t, p, c, d, o]
|
|
1520
1522
|
);
|
|
@@ -1587,7 +1589,7 @@ function kr(e) {
|
|
|
1587
1589
|
o !== -1 && gt.splice(o, 1);
|
|
1588
1590
|
};
|
|
1589
1591
|
}
|
|
1590
|
-
const Ni = "tokenpanel.colorPicker.mode", Ko = [95, 78, 61, 44, 27, 10],
|
|
1592
|
+
const Ni = "tokenpanel.colorPicker.mode", Ko = [95, 78, 61, 44, 27, 10], zc = [0, 60, 120, 180, 240, 300], _c = [0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330], Ac = 0.18, Lc = 320, Mc = 400, Pc = 520, Rc = 440;
|
|
1591
1593
|
function Dc() {
|
|
1592
1594
|
return [
|
|
1593
1595
|
{
|
|
@@ -1753,7 +1755,7 @@ function fr({
|
|
|
1753
1755
|
null
|
|
1754
1756
|
), S = U(null), M = U(!1), [C, A] = J(
|
|
1755
1757
|
() => Bc(r)
|
|
1756
|
-
), [E,
|
|
1758
|
+
), [E, z] = J("mini"), [B, P] = J(m);
|
|
1757
1759
|
oe(() => {
|
|
1758
1760
|
(/^#[0-9a-fA-F]{6}$/.test(B) || /^#[0-9a-fA-F]{8}$/.test(B)) && P(m);
|
|
1759
1761
|
}, [m]), Nn(p, s, a);
|
|
@@ -1804,7 +1806,7 @@ function fr({
|
|
|
1804
1806
|
[y, l, w, N]
|
|
1805
1807
|
), V = (j) => {
|
|
1806
1808
|
P(j), (/^#[0-9a-fA-F]{6}$/.test(j) || /^#[0-9a-fA-F]{8}$/.test(j)) && N(j);
|
|
1807
|
-
}, R = E === "expanded" ?
|
|
1809
|
+
}, R = E === "expanded" ? _c : zc, X = L(
|
|
1808
1810
|
(j, ae) => {
|
|
1809
1811
|
const pe = Yr(j, ae, x.a, R);
|
|
1810
1812
|
if (l)
|
|
@@ -1815,7 +1817,7 @@ function fr({
|
|
|
1815
1817
|
}
|
|
1816
1818
|
},
|
|
1817
1819
|
[x.a, R, l, w, N]
|
|
1818
|
-
),
|
|
1820
|
+
), _ = L(
|
|
1819
1821
|
(j, ae, pe) => {
|
|
1820
1822
|
let fe = ae, we = pe;
|
|
1821
1823
|
if (j.key === "ArrowRight")
|
|
@@ -1913,14 +1915,14 @@ function fr({
|
|
|
1913
1915
|
d.current = !0;
|
|
1914
1916
|
}, []), de = L(() => {
|
|
1915
1917
|
d.current = !1;
|
|
1916
|
-
}, []),
|
|
1918
|
+
}, []), _e = b ? { position: "fixed", left: b.left, top: b.top } : F;
|
|
1917
1919
|
return /* @__PURE__ */ h(
|
|
1918
1920
|
"div",
|
|
1919
1921
|
{
|
|
1920
1922
|
ref: p,
|
|
1921
1923
|
className: "tokenpanel-color-picker",
|
|
1922
1924
|
"data-mode-shell": E,
|
|
1923
|
-
style:
|
|
1925
|
+
style: _e,
|
|
1924
1926
|
role: "dialog",
|
|
1925
1927
|
"aria-label": o ? `${o} color picker` : "Color picker",
|
|
1926
1928
|
children: [
|
|
@@ -1982,9 +1984,9 @@ function fr({
|
|
|
1982
1984
|
className: "tokenpanel-color-picker-expand-btn",
|
|
1983
1985
|
"aria-label": E === "mini" ? "Expand picker" : "Collapse picker",
|
|
1984
1986
|
"aria-expanded": E === "expanded",
|
|
1985
|
-
onClick: () =>
|
|
1987
|
+
onClick: () => z(E === "mini" ? "expanded" : "mini"),
|
|
1986
1988
|
onKeyDown: (j) => {
|
|
1987
|
-
(j.key === "Enter" || j.key === " ") && (j.preventDefault(),
|
|
1989
|
+
(j.key === "Enter" || j.key === " ") && (j.preventDefault(), z(E === "mini" ? "expanded" : "mini"));
|
|
1988
1990
|
},
|
|
1989
1991
|
children: E === "mini" ? "⤢" : "⤡"
|
|
1990
1992
|
}
|
|
@@ -2048,7 +2050,7 @@ function fr({
|
|
|
2048
2050
|
style: { background: ie },
|
|
2049
2051
|
tabIndex: ae === 0 && fe === 0 ? 0 : -1,
|
|
2050
2052
|
onClick: () => X(ae, fe),
|
|
2051
|
-
onKeyDown: (Re) =>
|
|
2053
|
+
onKeyDown: (Re) => _(Re, ae, fe)
|
|
2052
2054
|
},
|
|
2053
2055
|
`${ae}-${fe}`
|
|
2054
2056
|
);
|
|
@@ -2600,7 +2602,7 @@ const Jn = {
|
|
|
2600
2602
|
longhands: ["mask-image"],
|
|
2601
2603
|
compounds: ["mask-image"]
|
|
2602
2604
|
}
|
|
2603
|
-
}, Dn = [null, "::before", "::after"], Ti = "tokenpanel-highlight-mount",
|
|
2605
|
+
}, Dn = [null, "::before", "::after"], Ti = "tokenpanel-highlight-mount", zi = "tokenpanel-elpath-mount", _i = "tokenpanel-domtweaker-mount", Ai = "tokenpanel-element-inspect-mount", Xc = "[data-zdtp-specimen]", to = `.tokenpanel-shell, [data-design-token-panel-modal], .tokenpanel-chain-popover, #${Ti}, #${zi}, #${_i}, #${Ai}, ${Xc}`, Zc = /^(transparent|currentcolor|currentColor|inherit|initial|unset|red|blue|green|black|white|gray|grey|silver|yellow|orange|purple|pink|brown|cyan|magenta|lime|olive|navy|maroon|teal|aqua|fuchsia|coral|salmon|gold|khaki|violet|indigo|crimson|lavender|beige|ivory|chocolate|tomato|orchid|plum|turquoise|tan|sienna|peru|papayawhip|peachpuff|moccasin|mistyrose|linen|lemonchiffon|honeydew|gainsboro)$/i, Qc = /^(rgb|rgba|hsl|hsla|color|oklch|hwb|lab|lch)\(/i, ed = /^#/, td = /^-?(?:\d+\.?\d*|\.\d+)(px|rem|em|vh|vw|vmin|vmax|pt|pc|in|cm|mm|ex|ch|fr|%)$/, nd = /^-?\d+(\.\d+)?$/, od = /^(cubic-bezier|steps|linear)\(/i, rd = /^-?(?:\d+\.?\d*|\.\d+)(ms|s)$/i, ad = /^".*"$/, id = /^url\(/i;
|
|
2604
2606
|
function Li(e, t) {
|
|
2605
2607
|
const n = getComputedStyle(document.documentElement).getPropertyValue(e).trim();
|
|
2606
2608
|
return n ? Qc.test(n) || ed.test(n) || Zc.test(n) ? "color" : td.test(n) ? "length" : nd.test(n) ? "number" : od.test(n) ? "easing" : rd.test(n) ? "time" : ad.test(n) ? "content" : (id.test(n) && t.push(
|
|
@@ -2790,8 +2792,8 @@ function Jr(e, t) {
|
|
|
2790
2792
|
for (const C of c) {
|
|
2791
2793
|
const A = S.get(C);
|
|
2792
2794
|
for (let E = 0; E < Dn.length; E++) {
|
|
2793
|
-
const
|
|
2794
|
-
if (ld(A[E],
|
|
2795
|
+
const z = Xn(C, Dn[E], b);
|
|
2796
|
+
if (ld(A[E], z) !== null) {
|
|
2795
2797
|
d.add(C);
|
|
2796
2798
|
break;
|
|
2797
2799
|
}
|
|
@@ -2874,7 +2876,7 @@ function pd({ items: e }) {
|
|
|
2874
2876
|
}) });
|
|
2875
2877
|
}
|
|
2876
2878
|
function no(e) {
|
|
2877
|
-
const t = $e(null), [, n] =
|
|
2879
|
+
const t = $e(null), [, n] = ze(0);
|
|
2878
2880
|
return ye(() => {
|
|
2879
2881
|
function o() {
|
|
2880
2882
|
if (!Pe() || !document.body) return null;
|
|
@@ -2950,7 +2952,7 @@ function gd({
|
|
|
2950
2952
|
const n = t ?? Ee(), o = Ve(() => Jt(n), [n]), r = Ve(
|
|
2951
2953
|
() => kd(n, o),
|
|
2952
2954
|
[n, o]
|
|
2953
|
-
), [a, s] =
|
|
2955
|
+
), [a, s] = ze(() => Jc(n)), [l, p] = ze(0), [c, d] = ze(0), u = $e(/* @__PURE__ */ new Map()), [k, f] = ze({});
|
|
2954
2956
|
ye(() => {
|
|
2955
2957
|
u.current.clear(), f({});
|
|
2956
2958
|
}, [n.storagePrefix]);
|
|
@@ -3018,18 +3020,18 @@ function gd({
|
|
|
3018
3020
|
const M = te((x) => {
|
|
3019
3021
|
const y = `${n.storagePrefix}|${x}|${l}|${c}`, N = u.current.get(y);
|
|
3020
3022
|
if (N) {
|
|
3021
|
-
if (N.elements.every((
|
|
3023
|
+
if (N.elements.every((_) => _.isConnected))
|
|
3022
3024
|
return N;
|
|
3023
3025
|
u.current.delete(y);
|
|
3024
3026
|
}
|
|
3025
3027
|
const w = r.get(x), q = ud(w), $ = q ? { kind: q } : {};
|
|
3026
3028
|
let V, R;
|
|
3027
3029
|
if (fd(w)) {
|
|
3028
|
-
const
|
|
3029
|
-
V =
|
|
3030
|
+
const _ = Jr(x, { ...$, mode: "differential" });
|
|
3031
|
+
V = _.elements, R = _.warnings;
|
|
3030
3032
|
} else {
|
|
3031
|
-
const
|
|
3032
|
-
V =
|
|
3033
|
+
const _ = Jr(x, $);
|
|
3034
|
+
V = _.elements, R = _.warnings;
|
|
3033
3035
|
}
|
|
3034
3036
|
const X = { elements: V, warnings: R };
|
|
3035
3037
|
return u.current.set(y, X), X;
|
|
@@ -3044,7 +3046,7 @@ function gd({
|
|
|
3044
3046
|
C(N);
|
|
3045
3047
|
const w = N.elements.length, q = Be(x);
|
|
3046
3048
|
return f(($) => $[q] === w && $[y.cssVar] === w ? $ : { ...$, [q]: w, [y.cssVar]: w }), w;
|
|
3047
|
-
}, [C, M, o]), { items: E, matchCounts:
|
|
3049
|
+
}, [C, M, o]), { items: E, matchCounts: z } = Ve(() => {
|
|
3048
3050
|
const x = [], y = {};
|
|
3049
3051
|
for (const [N, w] of Object.entries(a.active)) {
|
|
3050
3052
|
const q = M(N);
|
|
@@ -3062,8 +3064,8 @@ function gd({
|
|
|
3062
3064
|
f({});
|
|
3063
3065
|
}, [l, c]);
|
|
3064
3066
|
const B = Ve(
|
|
3065
|
-
() => ({ ...k, ...
|
|
3066
|
-
[
|
|
3067
|
+
() => ({ ...k, ...z }),
|
|
3068
|
+
[z, k]
|
|
3067
3069
|
), P = Ve(
|
|
3068
3070
|
() => ({
|
|
3069
3071
|
state: a,
|
|
@@ -3129,7 +3131,7 @@ function Oi(e, t) {
|
|
|
3129
3131
|
function Bi(e, t, n) {
|
|
3130
3132
|
return Oi(t, e.address.tabId)?.semanticMappings[e.address.itemId] ?? (e.address.tabId, void 0)?.semanticMappings[e.address.itemId] ?? e.default;
|
|
3131
3133
|
}
|
|
3132
|
-
function
|
|
3134
|
+
function zo(e, t, n, o) {
|
|
3133
3135
|
return e.find(
|
|
3134
3136
|
(r) => r.address.tabId === t && r.address.tierId === n && r.address.itemId === o
|
|
3135
3137
|
)?.address;
|
|
@@ -3158,7 +3160,7 @@ function vd(e, t, n) {
|
|
|
3158
3160
|
if (ht(k))
|
|
3159
3161
|
l(
|
|
3160
3162
|
c.address,
|
|
3161
|
-
|
|
3163
|
+
zo(
|
|
3162
3164
|
o.entries,
|
|
3163
3165
|
k.ref.tab ?? d.id,
|
|
3164
3166
|
k.ref.tier,
|
|
@@ -3173,7 +3175,7 @@ function vd(e, t, n) {
|
|
|
3173
3175
|
);
|
|
3174
3176
|
if (!f || !g || g.items.length === 0) continue;
|
|
3175
3177
|
const m = k === "bg" ? f.background : k === "fg" ? f.foreground : k, b = g.items[tr(m, g.items.length)];
|
|
3176
|
-
l(c.address,
|
|
3178
|
+
l(c.address, zo(o.entries, d.id, g.id, b.id));
|
|
3177
3179
|
}
|
|
3178
3180
|
continue;
|
|
3179
3181
|
}
|
|
@@ -3181,7 +3183,7 @@ function vd(e, t, n) {
|
|
|
3181
3183
|
const k = c.address.tabId === "spacing" ? t.spacing[c.address.itemId] : c.address.tabId === "font" ? t.typography[c.address.itemId] : c.address.tabId === "size" ? t.size[c.address.itemId] : t.tabs?.[d.id]?.[u.id]?.[c.address.itemId], f = d.tiers.find((b) => b.id === u.referencesTier);
|
|
3182
3184
|
if (!f || f.items.length === 0) continue;
|
|
3183
3185
|
const g = k ?? c.address.itemId, m = f.items.find((b) => b.id === g) ?? f.items.find((b) => b.id === c.default) ?? f.items.find((b) => b.id === c.address.itemId) ?? f.items[0];
|
|
3184
|
-
l(c.address,
|
|
3186
|
+
l(c.address, zo(o.entries, d.id, f.id, m.id));
|
|
3185
3187
|
}
|
|
3186
3188
|
}
|
|
3187
3189
|
}
|
|
@@ -3292,10 +3294,10 @@ function Sd({
|
|
|
3292
3294
|
anchorRef: t,
|
|
3293
3295
|
onClose: n
|
|
3294
3296
|
}) {
|
|
3295
|
-
const o = ji(), r = st(eo), a = $e(null), [s, l] =
|
|
3297
|
+
const o = ji(), r = st(eo), a = $e(null), [s, l] = ze(void 0), [p, c] = ze(void 0), d = Be(e);
|
|
3296
3298
|
Nn(a, n, t), yt(`token-chain-${d}`, !0);
|
|
3297
3299
|
const u = o ? ln(o.graph.entries, e) : void 0, k = u ? o.graph.resolutionChain(e) : [], f = u ? o.graph.dependentsOf(e) : [], g = u ? o.graph.rampSiblings(e) : [], m = Nd(k), b = r?.requestMatchCount, T = te(
|
|
3298
|
-
(E,
|
|
3300
|
+
(E, z) => b ? b(E) : r?.matchCounts?.[z.cssVar],
|
|
3299
3301
|
[r?.matchCounts, b]
|
|
3300
3302
|
);
|
|
3301
3303
|
ye(() => {
|
|
@@ -3308,14 +3310,14 @@ function Sd({
|
|
|
3308
3310
|
c(f.length === 0 ? 0 : void 0);
|
|
3309
3311
|
return;
|
|
3310
3312
|
}
|
|
3311
|
-
let E = 0,
|
|
3313
|
+
let E = 0, z = !0;
|
|
3312
3314
|
for (const B of f) {
|
|
3313
3315
|
const P = ln(o.graph.entries, B);
|
|
3314
3316
|
if (!P) continue;
|
|
3315
3317
|
const x = T(B, P);
|
|
3316
|
-
x === void 0 ?
|
|
3318
|
+
x === void 0 ? z = !1 : E += x;
|
|
3317
3319
|
}
|
|
3318
|
-
c(
|
|
3320
|
+
c(z ? E : void 0);
|
|
3319
3321
|
}, [o, S, f, T]);
|
|
3320
3322
|
if (ye(() => {
|
|
3321
3323
|
M();
|
|
@@ -3332,10 +3334,10 @@ function Sd({
|
|
|
3332
3334
|
style: { ...hr(t.current, 460, 440), zIndex: it.settingsPopover },
|
|
3333
3335
|
"data-layer-active": "true",
|
|
3334
3336
|
children: [
|
|
3335
|
-
/* @__PURE__ */ i("div", { className: "tokenpanel-chain-hops", "aria-label": "Resolution chain", children: k.map((E,
|
|
3336
|
-
|
|
3337
|
+
/* @__PURE__ */ i("div", { className: "tokenpanel-chain-hops", "aria-label": "Resolution chain", children: k.map((E, z) => /* @__PURE__ */ h("span", { className: "tokenpanel-chain-hop-wrap", children: [
|
|
3338
|
+
z > 0 && /* @__PURE__ */ i("span", { className: "tokenpanel-chain-arrow", "aria-hidden": "true", children: "→" }),
|
|
3337
3339
|
/* @__PURE__ */ i(Cd, { hop: E, color: E.kind === "token" && u.kind === "color" ? m : void 0 })
|
|
3338
|
-
] }, `${E.kind}-${
|
|
3340
|
+
] }, `${E.kind}-${z}`)) }),
|
|
3339
3341
|
/* @__PURE__ */ h("div", { className: "tokenpanel-chain-row tokenpanel-chain-used-row", children: [
|
|
3340
3342
|
/* @__PURE__ */ i("span", { className: "tokenpanel-chain-row-label", children: "used on page" }),
|
|
3341
3343
|
/* @__PURE__ */ i("span", { className: "tokenpanel-chain-row-value", children: s === void 0 ? "…" : `${s} element${s === 1 ? "" : "s"}` }),
|
|
@@ -3347,11 +3349,11 @@ function Sd({
|
|
|
3347
3349
|
/* @__PURE__ */ h("div", { className: "tokenpanel-chain-row", children: [
|
|
3348
3350
|
/* @__PURE__ */ i("span", { className: "tokenpanel-chain-row-label", children: "depended on by" }),
|
|
3349
3351
|
/* @__PURE__ */ i("span", { className: "tokenpanel-chain-chip-list", children: f.length === 0 ? /* @__PURE__ */ i("span", { className: "tokenpanel-chain-empty", children: "—" }) : f.map((E) => {
|
|
3350
|
-
const
|
|
3351
|
-
return
|
|
3352
|
+
const z = ln(o.graph.entries, E);
|
|
3353
|
+
return z ? /* @__PURE__ */ i(
|
|
3352
3354
|
Qr,
|
|
3353
3355
|
{
|
|
3354
|
-
entry:
|
|
3356
|
+
entry: z,
|
|
3355
3357
|
onClick: () => C(E)
|
|
3356
3358
|
},
|
|
3357
3359
|
Be(E)
|
|
@@ -3362,11 +3364,11 @@ function Sd({
|
|
|
3362
3364
|
/* @__PURE__ */ h("div", { className: "tokenpanel-chain-row", children: [
|
|
3363
3365
|
/* @__PURE__ */ i("span", { className: "tokenpanel-chain-row-label", children: "ramp siblings" }),
|
|
3364
3366
|
/* @__PURE__ */ i("span", { className: "tokenpanel-chain-chip-list", children: g.length === 0 ? /* @__PURE__ */ i("span", { className: "tokenpanel-chain-empty", children: "—" }) : g.map((E) => {
|
|
3365
|
-
const
|
|
3366
|
-
return
|
|
3367
|
+
const z = ln(o.graph.entries, E);
|
|
3368
|
+
return z ? /* @__PURE__ */ i(
|
|
3367
3369
|
Qr,
|
|
3368
3370
|
{
|
|
3369
|
-
entry:
|
|
3371
|
+
entry: z,
|
|
3370
3372
|
onClick: () => C(E)
|
|
3371
3373
|
},
|
|
3372
3374
|
Be(E)
|
|
@@ -3384,7 +3386,7 @@ function Sd({
|
|
|
3384
3386
|
return typeof document > "u" || !document.body ? null : Vt(A, document.body);
|
|
3385
3387
|
}
|
|
3386
3388
|
function Cn({ address: e }) {
|
|
3387
|
-
const t = ji(), n = t ? ln(t.graph.entries, e) : void 0, [o, r] =
|
|
3389
|
+
const t = ji(), n = t ? ln(t.graph.entries, e) : void 0, [o, r] = ze(!1), a = $e(null);
|
|
3388
3390
|
return n ? /* @__PURE__ */ h(me, { children: [
|
|
3389
3391
|
/* @__PURE__ */ i(
|
|
3390
3392
|
ue,
|
|
@@ -3488,14 +3490,14 @@ function On(e, t) {
|
|
|
3488
3490
|
return !1;
|
|
3489
3491
|
}
|
|
3490
3492
|
}
|
|
3491
|
-
function
|
|
3493
|
+
function zd(e) {
|
|
3492
3494
|
const t = e.parentElement;
|
|
3493
3495
|
if (!t) return "";
|
|
3494
3496
|
const n = e.tagName, o = Array.from(t.children).filter((a) => a.tagName === n);
|
|
3495
3497
|
return o.length <= 1 ? "" : `:nth-of-type(${o.indexOf(e) + 1})`;
|
|
3496
3498
|
}
|
|
3497
|
-
function
|
|
3498
|
-
return e.localName +
|
|
3499
|
+
function _d(e) {
|
|
3500
|
+
return e.localName + zd(e);
|
|
3499
3501
|
}
|
|
3500
3502
|
function Ad(e) {
|
|
3501
3503
|
if (e.tagName === "HTML") return "html";
|
|
@@ -3518,7 +3520,7 @@ function Ad(e) {
|
|
|
3518
3520
|
continue;
|
|
3519
3521
|
}
|
|
3520
3522
|
}
|
|
3521
|
-
n.unshift(
|
|
3523
|
+
n.unshift(_d(o));
|
|
3522
3524
|
const a = n.join(" > ");
|
|
3523
3525
|
if (On(a, e)) return a;
|
|
3524
3526
|
o = o.parentElement;
|
|
@@ -3667,7 +3669,7 @@ function Fd(e, t) {
|
|
|
3667
3669
|
Kn.get(e) === t && (Kn.delete(e), Rt === e && (Rt = null));
|
|
3668
3670
|
};
|
|
3669
3671
|
}
|
|
3670
|
-
function
|
|
3672
|
+
function _o(e) {
|
|
3671
3673
|
if (Rt === e) return;
|
|
3672
3674
|
const t = Rt;
|
|
3673
3675
|
Rt = e, t !== null && Kn.get(t)?.onArmingRevoked();
|
|
@@ -3706,13 +3708,13 @@ function Gd({
|
|
|
3706
3708
|
zIndex: c = it.inspectorBox,
|
|
3707
3709
|
labelGap: d = Kd
|
|
3708
3710
|
}, u) {
|
|
3709
|
-
const [k, f] =
|
|
3711
|
+
const [k, f] = ze(!1), [g, m] = ze(null), b = $e(!1);
|
|
3710
3712
|
b.current = k;
|
|
3711
3713
|
const T = $e(null);
|
|
3712
3714
|
T.current = g;
|
|
3713
3715
|
const S = $e(null), M = $e(null), C = $e(null), A = $e(!1), E = $e(o);
|
|
3714
3716
|
E.current = o;
|
|
3715
|
-
const
|
|
3717
|
+
const z = Ve(
|
|
3716
3718
|
() => ({ ...Wd, ...p }),
|
|
3717
3719
|
[p]
|
|
3718
3720
|
), B = te(() => {
|
|
@@ -3722,7 +3724,7 @@ function Gd({
|
|
|
3722
3724
|
m(!V || qd(V, l) ? null : V);
|
|
3723
3725
|
}, [l]), x = te(() => {
|
|
3724
3726
|
if (!e) return;
|
|
3725
|
-
A.current = !0,
|
|
3727
|
+
A.current = !0, _o(t), f(!0);
|
|
3726
3728
|
const q = C.current;
|
|
3727
3729
|
q && P(q.x, q.y);
|
|
3728
3730
|
}, [e, t, P]);
|
|
@@ -3731,7 +3733,7 @@ function Gd({
|
|
|
3731
3733
|
A.current = !1, f(!1), m(null), E.current?.();
|
|
3732
3734
|
}
|
|
3733
3735
|
}), [t]), ye(() => {
|
|
3734
|
-
!e || !r ||
|
|
3736
|
+
!e || !r || _o(t);
|
|
3735
3737
|
}, [r, e, t]), ye(() => {
|
|
3736
3738
|
e || B();
|
|
3737
3739
|
}, [B, e]), ye(() => {
|
|
@@ -3741,7 +3743,7 @@ function Gd({
|
|
|
3741
3743
|
}
|
|
3742
3744
|
function $(R) {
|
|
3743
3745
|
if ((R.key === "Alt" || R.altKey) && !b.current) {
|
|
3744
|
-
A.current = !1,
|
|
3746
|
+
A.current = !1, _o(t), f(!0);
|
|
3745
3747
|
const X = C.current;
|
|
3746
3748
|
X && P(X.x, X.y);
|
|
3747
3749
|
}
|
|
@@ -3767,10 +3769,10 @@ function Gd({
|
|
|
3767
3769
|
}, [k, e, n]), ye(() => {
|
|
3768
3770
|
if (!e || !k) return;
|
|
3769
3771
|
const q = document.documentElement;
|
|
3770
|
-
return q.classList.add(
|
|
3771
|
-
q.classList.remove(
|
|
3772
|
+
return q.classList.add(z.inspectingRoot), () => {
|
|
3773
|
+
q.classList.remove(z.inspectingRoot);
|
|
3772
3774
|
};
|
|
3773
|
-
}, [k,
|
|
3775
|
+
}, [k, z.inspectingRoot, e]), ye(() => {
|
|
3774
3776
|
if (!k || !g) return;
|
|
3775
3777
|
let q = 0;
|
|
3776
3778
|
function $() {
|
|
@@ -3782,11 +3784,11 @@ function Gd({
|
|
|
3782
3784
|
}
|
|
3783
3785
|
const X = V.getBoundingClientRect();
|
|
3784
3786
|
R.style.top = `${X.top}px`, R.style.left = `${X.left}px`, R.style.width = `${X.width}px`, R.style.height = `${X.height}px`;
|
|
3785
|
-
const
|
|
3786
|
-
if (
|
|
3787
|
-
const W =
|
|
3787
|
+
const _ = M.current;
|
|
3788
|
+
if (_) {
|
|
3789
|
+
const W = _.offsetHeight;
|
|
3788
3790
|
let Y = X.top - W - d;
|
|
3789
|
-
Y < 0 && (Y = X.top + d),
|
|
3791
|
+
Y < 0 && (Y = X.top + d), _.style.left = `${Math.max(0, X.left)}px`, _.style.top = `${Y}px`;
|
|
3790
3792
|
}
|
|
3791
3793
|
}
|
|
3792
3794
|
q = requestAnimationFrame($);
|
|
@@ -3823,7 +3825,7 @@ function Gd({
|
|
|
3823
3825
|
"div",
|
|
3824
3826
|
{
|
|
3825
3827
|
ref: S,
|
|
3826
|
-
className:
|
|
3828
|
+
className: z.box,
|
|
3827
3829
|
"aria-hidden": "true",
|
|
3828
3830
|
style: {
|
|
3829
3831
|
position: "fixed",
|
|
@@ -3840,7 +3842,7 @@ function Gd({
|
|
|
3840
3842
|
"div",
|
|
3841
3843
|
{
|
|
3842
3844
|
ref: M,
|
|
3843
|
-
className:
|
|
3845
|
+
className: z.label,
|
|
3844
3846
|
"aria-hidden": "true",
|
|
3845
3847
|
style: {
|
|
3846
3848
|
position: "fixed",
|
|
@@ -3850,8 +3852,8 @@ function Gd({
|
|
|
3850
3852
|
pointerEvents: "none"
|
|
3851
3853
|
},
|
|
3852
3854
|
children: [
|
|
3853
|
-
/* @__PURE__ */ i("span", { className:
|
|
3854
|
-
/* @__PURE__ */ h("span", { className:
|
|
3855
|
+
/* @__PURE__ */ i("span", { className: z.labelName, children: N }),
|
|
3856
|
+
/* @__PURE__ */ h("span", { className: z.labelSize, children: [
|
|
3855
3857
|
Math.round(w.width),
|
|
3856
3858
|
" × ",
|
|
3857
3859
|
Math.round(w.height)
|
|
@@ -3875,7 +3877,7 @@ function Zd({
|
|
|
3875
3877
|
enabled: e,
|
|
3876
3878
|
onArmingRevoked: t
|
|
3877
3879
|
}) {
|
|
3878
|
-
const [n, o] =
|
|
3880
|
+
const [n, o] = ze(null), r = $e(null), a = $e(0), s = te(async (l) => {
|
|
3879
3881
|
const p = Od(l), c = await Wi(p);
|
|
3880
3882
|
a.current += 1, o({
|
|
3881
3883
|
message: c ? `Copied path: ${at(l)}` : "Copy failed — clipboard unavailable",
|
|
@@ -3904,14 +3906,14 @@ function Zd({
|
|
|
3904
3906
|
] });
|
|
3905
3907
|
}
|
|
3906
3908
|
function Qd({ enabled: e, onArmingRevoked: t }) {
|
|
3907
|
-
const n = no(
|
|
3909
|
+
const n = no(zi);
|
|
3908
3910
|
return n ? Vt(
|
|
3909
3911
|
/* @__PURE__ */ i(Zd, { enabled: e, onArmingRevoked: t }),
|
|
3910
3912
|
n
|
|
3911
3913
|
) : null;
|
|
3912
3914
|
}
|
|
3913
3915
|
function ep({ children: e }) {
|
|
3914
|
-
const [t, n] =
|
|
3916
|
+
const [t, n] = ze(pi), o = te((s) => {
|
|
3915
3917
|
n(s), qn(s);
|
|
3916
3918
|
}, []), r = te(() => {
|
|
3917
3919
|
n((s) => {
|
|
@@ -4315,7 +4317,7 @@ function gp({
|
|
|
4315
4317
|
onJumpToColorTab: s,
|
|
4316
4318
|
panelOpen: l = !0
|
|
4317
4319
|
}) {
|
|
4318
|
-
const p = Ve(() => Jt(t), [t]), [c, d] =
|
|
4320
|
+
const p = Ve(() => Jt(t), [t]), [c, d] = ze(!1), [u, k] = ze(null), [f, g] = ze(null), m = $e(null), b = te((w) => {
|
|
4319
4321
|
w.isConnected && (k(w), g(sp(w, p)), r());
|
|
4320
4322
|
}, [r, p]), T = te(() => d(!0), []), S = te(() => {
|
|
4321
4323
|
m.current?.disarm(), d(!1);
|
|
@@ -4338,7 +4340,7 @@ function gp({
|
|
|
4338
4340
|
m.current?.disarm(), d(!1), k(null), g(null), a();
|
|
4339
4341
|
}, [a]), E = te(() => {
|
|
4340
4342
|
d(!1);
|
|
4341
|
-
}, []),
|
|
4343
|
+
}, []), z = te(() => {
|
|
4342
4344
|
k(null), g(null), a();
|
|
4343
4345
|
}, [a]), B = te((w, q) => {
|
|
4344
4346
|
o(
|
|
@@ -4375,7 +4377,7 @@ function gp({
|
|
|
4375
4377
|
pickerRef: m,
|
|
4376
4378
|
pinned: u,
|
|
4377
4379
|
onElementPicked: C,
|
|
4378
|
-
onPinnedDetached:
|
|
4380
|
+
onPinnedDetached: z,
|
|
4379
4381
|
onArmingRevoked: E
|
|
4380
4382
|
}
|
|
4381
4383
|
)
|
|
@@ -4525,7 +4527,7 @@ function Cp({
|
|
|
4525
4527
|
address: e,
|
|
4526
4528
|
onJumpToColorTab: t
|
|
4527
4529
|
}) {
|
|
4528
|
-
const n = Yi(e), { entry: o } = n, r = n.readonly || o.item.readonly === !0, [a, s] =
|
|
4530
|
+
const n = Yi(e), { entry: o } = n, r = n.readonly || o.item.readonly === !0, [a, s] = ze(() => Ao(n.value));
|
|
4529
4531
|
if (ye(() => s(Ao(n.value)), [n.value]), n.readonly) {
|
|
4530
4532
|
const p = n.jumpTo ?? t;
|
|
4531
4533
|
return /* @__PURE__ */ h("div", { className: "tokenpanel-element-inspect-color-value", children: [
|
|
@@ -4756,7 +4758,7 @@ function Tp({
|
|
|
4756
4758
|
onRuntimeStatusChange: a,
|
|
4757
4759
|
onArmingRevoked: s
|
|
4758
4760
|
}) {
|
|
4759
|
-
const l = no(
|
|
4761
|
+
const l = no(_i);
|
|
4760
4762
|
return !l || n === null || t.domTweaker === void 0 ? null : Vt(
|
|
4761
4763
|
/* @__PURE__ */ i(
|
|
4762
4764
|
n,
|
|
@@ -4775,11 +4777,11 @@ function Tp({
|
|
|
4775
4777
|
l
|
|
4776
4778
|
);
|
|
4777
4779
|
}
|
|
4778
|
-
function
|
|
4780
|
+
function zp({
|
|
4779
4781
|
children: e,
|
|
4780
4782
|
instanceConfig: t
|
|
4781
4783
|
}) {
|
|
4782
|
-
const [n, o] =
|
|
4784
|
+
const [n, o] = ze(() => t.domTweaker === void 0 || !ui(t) ? !1 : pa(t)), [r, a] = ze(null), [s, l] = ze("idle"), [p, c] = ze(!1), d = $e(null), u = te(
|
|
4783
4785
|
(b) => {
|
|
4784
4786
|
if (b) {
|
|
4785
4787
|
if (t.domTweaker === void 0 || !pa(t)) return;
|
|
@@ -4798,7 +4800,7 @@ function _p({
|
|
|
4798
4800
|
ye(() => () => {
|
|
4799
4801
|
ua(t);
|
|
4800
4802
|
}, [t]), ye(() => {
|
|
4801
|
-
!n && !p || r !== null || d.current !== null || (n && l("loading"), d.current = import("./index-
|
|
4803
|
+
!n && !p || r !== null || d.current !== null || (n && l("loading"), d.current = import("./index-CAQf4HKm.js").then((b) => {
|
|
4802
4804
|
a(() => b.DomTweakerLazyBoundary);
|
|
4803
4805
|
}).catch((b) => {
|
|
4804
4806
|
d.current = null, n && l("error"), console.warn(
|
|
@@ -4827,7 +4829,7 @@ function _p({
|
|
|
4827
4829
|
)
|
|
4828
4830
|
] });
|
|
4829
4831
|
}
|
|
4830
|
-
function
|
|
4832
|
+
function _p({ compact: e = !1 } = {}) {
|
|
4831
4833
|
const t = st(br);
|
|
4832
4834
|
if (t === null) return null;
|
|
4833
4835
|
const { enabled: n, openDiffExport: o, runtimeStatus: r, toggle: a } = t, s = r === "loading" ? "runtime loading" : r === "ready" ? "runtime ready" : r === "error" ? "runtime failed" : "runtime not loaded", l = n ? `DOM Tweaker: ON (${s}) — click to turn off.` : `DOM Tweaker: OFF (${s}) — click to enable.`;
|
|
@@ -4926,13 +4928,14 @@ function Lp({
|
|
|
4926
4928
|
{
|
|
4927
4929
|
"aria-disabled": a.disabled,
|
|
4928
4930
|
title: a.disabledReason,
|
|
4931
|
+
"data-zdtp-action": a.id,
|
|
4929
4932
|
onClick: () => {
|
|
4930
4933
|
a.onSelect(), n();
|
|
4931
4934
|
},
|
|
4932
4935
|
className: "tokenpanel-action-link",
|
|
4933
4936
|
children: a.label
|
|
4934
4937
|
},
|
|
4935
|
-
a.
|
|
4938
|
+
a.id
|
|
4936
4939
|
)),
|
|
4937
4940
|
o
|
|
4938
4941
|
]
|
|
@@ -5159,9 +5162,9 @@ function jp({
|
|
|
5159
5162
|
(A) => {
|
|
5160
5163
|
const E = e.findIndex((P) => P.id === t);
|
|
5161
5164
|
if (E === -1) return;
|
|
5162
|
-
let
|
|
5163
|
-
A.key === "ArrowRight" ?
|
|
5164
|
-
const B = e[
|
|
5165
|
+
let z = E;
|
|
5166
|
+
A.key === "ArrowRight" ? z = (E + 1) % e.length : A.key === "ArrowLeft" ? z = (E - 1 + e.length) % e.length : A.key === "Home" ? z = 0 : A.key === "End" && (z = e.length - 1), A.preventDefault();
|
|
5167
|
+
const B = e[z];
|
|
5165
5168
|
n(B.id), window.requestAnimationFrame(() => r.current?.[B.id]?.focus());
|
|
5166
5169
|
},
|
|
5167
5170
|
l
|
|
@@ -5190,14 +5193,14 @@ function jp({
|
|
|
5190
5193
|
}
|
|
5191
5194
|
if (E(), A.addEventListener("scroll", E), typeof ResizeObserver > "u")
|
|
5192
5195
|
return () => A.removeEventListener("scroll", E);
|
|
5193
|
-
const
|
|
5194
|
-
|
|
5196
|
+
const z = new ResizeObserver(E);
|
|
5197
|
+
z.observe(A);
|
|
5195
5198
|
for (const B of e) {
|
|
5196
5199
|
const P = r.current?.[B.id];
|
|
5197
|
-
P &&
|
|
5200
|
+
P && z.observe(P);
|
|
5198
5201
|
}
|
|
5199
5202
|
return () => {
|
|
5200
|
-
|
|
5203
|
+
z.disconnect(), A.removeEventListener("scroll", E);
|
|
5201
5204
|
};
|
|
5202
5205
|
}, [t, l, r, e]), oe(() => {
|
|
5203
5206
|
if (!g) return;
|
|
@@ -5225,8 +5228,8 @@ function jp({
|
|
|
5225
5228
|
return /* @__PURE__ */ h(
|
|
5226
5229
|
"div",
|
|
5227
5230
|
{
|
|
5228
|
-
ref: (
|
|
5229
|
-
r.current && (r.current[A.id] =
|
|
5231
|
+
ref: (z) => {
|
|
5232
|
+
r.current && (r.current[A.id] = z);
|
|
5230
5233
|
},
|
|
5231
5234
|
role: "tab",
|
|
5232
5235
|
id: `dtp-tab-${o}-${A.id}`,
|
|
@@ -5932,7 +5935,7 @@ function du(e, t, n, o) {
|
|
|
5932
5935
|
};
|
|
5933
5936
|
}
|
|
5934
5937
|
function pu(e) {
|
|
5935
|
-
const [t, n] =
|
|
5938
|
+
const [t, n] = ze(() => lu(e)), o = te(
|
|
5936
5939
|
(a, s, l, p) => {
|
|
5937
5940
|
const c = {
|
|
5938
5941
|
state: s,
|
|
@@ -6146,8 +6149,8 @@ function vu({
|
|
|
6146
6149
|
getElement: () => c.current
|
|
6147
6150
|
}) : void 0, [n, e]);
|
|
6148
6151
|
const m = G(() => gu(o, r ?? void 0), [o, r]), b = G(() => {
|
|
6149
|
-
const C = u.trim(), A = wu(m, C), E = a.filter((P) => C ? ol(C, P.label) : !0),
|
|
6150
|
-
return C ? [...
|
|
6152
|
+
const C = u.trim(), A = wu(m, C), E = a.filter((P) => C ? ol(C, P.label) : !0), z = A.map((P) => ({ kind: "token", token: P })), B = E.map((P) => ({ kind: "action", action: P }));
|
|
6153
|
+
return C ? [...z, ...B] : [...B, ...z.slice(0, 16)];
|
|
6151
6154
|
}, [a, u, m]);
|
|
6152
6155
|
oe(() => {
|
|
6153
6156
|
g((C) => Math.min(C, Math.max(0, b.length - 1)));
|
|
@@ -6228,11 +6231,11 @@ function vu({
|
|
|
6228
6231
|
onKeyDown: S,
|
|
6229
6232
|
children: [
|
|
6230
6233
|
b.map((C, A) => {
|
|
6231
|
-
const E = C.kind === "token" ? "Tokens" : "Actions",
|
|
6234
|
+
const E = C.kind === "token" ? "Tokens" : "Actions", z = C.kind !== M ? /* @__PURE__ */ i("div", { className: "tokenpanel-command-palette-group", role: "presentation", children: E }, `heading-${E}`) : null;
|
|
6232
6235
|
M = C.kind;
|
|
6233
6236
|
const B = A === f;
|
|
6234
6237
|
return C.kind === "token" ? /* @__PURE__ */ h(Xe, { children: [
|
|
6235
|
-
|
|
6238
|
+
z,
|
|
6236
6239
|
/* @__PURE__ */ h(
|
|
6237
6240
|
"div",
|
|
6238
6241
|
{
|
|
@@ -6254,7 +6257,7 @@ function vu({
|
|
|
6254
6257
|
}
|
|
6255
6258
|
)
|
|
6256
6259
|
] }, `token-result-${A}`) : /* @__PURE__ */ h(Xe, { children: [
|
|
6257
|
-
|
|
6260
|
+
z,
|
|
6258
6261
|
/* @__PURE__ */ h(
|
|
6259
6262
|
"div",
|
|
6260
6263
|
{
|
|
@@ -6519,7 +6522,7 @@ function Iu({ state: e }) {
|
|
|
6519
6522
|
);
|
|
6520
6523
|
}
|
|
6521
6524
|
function Tu({ children: e }) {
|
|
6522
|
-
const [t, n] =
|
|
6525
|
+
const [t, n] = ze({
|
|
6523
6526
|
visible: !1,
|
|
6524
6527
|
text: "",
|
|
6525
6528
|
triggerEl: null
|
|
@@ -6609,18 +6612,18 @@ function ao(e, t) {
|
|
|
6609
6612
|
);
|
|
6610
6613
|
return { onMouseEnter: a, onMouseLeave: s, onFocusIn: l, onFocusOut: p, show: c, hide: d };
|
|
6611
6614
|
}
|
|
6612
|
-
function
|
|
6615
|
+
function zu({ cssVar: e, label: t, className: n }) {
|
|
6613
6616
|
const o = ao(e, { anchor: "text" });
|
|
6614
6617
|
return /* @__PURE__ */ h("span", { className: n ?? "tokenpanel-row-label", ...o, children: [
|
|
6615
6618
|
e,
|
|
6616
6619
|
t && t !== e && /* @__PURE__ */ i("span", { className: "tokenpanel-row-label-sub", children: t })
|
|
6617
6620
|
] });
|
|
6618
6621
|
}
|
|
6619
|
-
const At = St(
|
|
6622
|
+
const At = St(zu), xa = "Ramp options stay linked live to palette edits. Literal sets a fixed color that is not linked. Per-mode sets independent light and dark colors emitted with CSS light-dark().";
|
|
6620
6623
|
function ya({ text: e, ariaLabel: t }) {
|
|
6621
6624
|
const { onMouseEnter: n, onMouseLeave: o, onFocusIn: r, onFocusOut: a, show: s, hide: l } = ao(e, {
|
|
6622
6625
|
variant: "help"
|
|
6623
|
-
}), [p, c] =
|
|
6626
|
+
}), [p, c] = ze(!1), d = $e(null), u = te(() => {
|
|
6624
6627
|
const m = d.current, b = !p;
|
|
6625
6628
|
c(b), m && (b ? s(m) : l(m));
|
|
6626
6629
|
}, [p, s, l]), k = te(
|
|
@@ -6674,7 +6677,7 @@ function Ca(e) {
|
|
|
6674
6677
|
function qo(e, t) {
|
|
6675
6678
|
return e.tiers.find((n) => n.id === t);
|
|
6676
6679
|
}
|
|
6677
|
-
function
|
|
6680
|
+
function _u(e, t) {
|
|
6678
6681
|
return (e.tab ?? "") === (t.tab ?? "") && e.tier === t.tier && e.item === t.item;
|
|
6679
6682
|
}
|
|
6680
6683
|
const Sa = /* @__PURE__ */ new Set();
|
|
@@ -6721,7 +6724,7 @@ function Pu({
|
|
|
6721
6724
|
const d = qo(e, n), u = d?.referencesRamps, k = !!u && u.length > 0, g = k ? Lu(u, e, t ?? [e]) : (() => {
|
|
6722
6725
|
const x = d?.referencesTier ?? "", y = x ? qo(e, x) : void 0;
|
|
6723
6726
|
return y ? [{ label: y.label, options: Mu(y) }] : [];
|
|
6724
|
-
})(), m = g.flatMap((x) => x.options), b = pt(r) ? void 0 : m.find((x) =>
|
|
6727
|
+
})(), m = g.flatMap((x) => x.options), b = pt(r) ? void 0 : m.find((x) => _u(x.ref, r.ref)), T = !pt(r) && !b ? r.ref : void 0;
|
|
6725
6728
|
T && Au(T);
|
|
6726
6729
|
const S = pt(r) ? Lo : b?.key ?? Mo, M = l ?? o, C = k ? pt(r) ? typeof r.literal == "string" ? r.literal : cn({ literal: r.literal }, c) : s ? s(r.ref) : b?.item.default ?? "" : void 0, A = (x) => {
|
|
6727
6730
|
const y = x.currentTarget.value;
|
|
@@ -6735,7 +6738,7 @@ function Pu({
|
|
|
6735
6738
|
N && a(o, { ref: N.ref });
|
|
6736
6739
|
}, E = (x) => {
|
|
6737
6740
|
a(o, { literal: x });
|
|
6738
|
-
},
|
|
6741
|
+
}, z = () => {
|
|
6739
6742
|
if (!pt(r)) return;
|
|
6740
6743
|
const x = r.literal;
|
|
6741
6744
|
typeof x == "object" && x !== null ? a(o, { literal: cn({ literal: x }, c) }) : a(o, { literal: { light: x, dark: x } });
|
|
@@ -6809,7 +6812,7 @@ function Pu({
|
|
|
6809
6812
|
{
|
|
6810
6813
|
type: "checkbox",
|
|
6811
6814
|
checked: typeof r.literal == "object" && r.literal !== null,
|
|
6812
|
-
onChange:
|
|
6815
|
+
onChange: z,
|
|
6813
6816
|
"aria-label": `${M} per-mode (light/dark)`
|
|
6814
6817
|
}
|
|
6815
6818
|
),
|
|
@@ -6919,11 +6922,11 @@ function Ta(e) {
|
|
|
6919
6922
|
(t) => !t.referencesTier && !t.semantic && t.items.length > 0 && t.items[0].type.kind === "color"
|
|
6920
6923
|
);
|
|
6921
6924
|
}
|
|
6922
|
-
function
|
|
6925
|
+
function za(e, t) {
|
|
6923
6926
|
const n = e?.items[t];
|
|
6924
6927
|
return n && n.type.kind === "color" && n.type.format === "oklch" ? "oklch" : "hex";
|
|
6925
6928
|
}
|
|
6926
|
-
const
|
|
6929
|
+
const _a = St(function({
|
|
6927
6930
|
color: t,
|
|
6928
6931
|
onChange: n,
|
|
6929
6932
|
index: o,
|
|
@@ -7025,35 +7028,35 @@ const za = St(function({
|
|
|
7025
7028
|
isChanged: k = !1,
|
|
7026
7029
|
onRevert: f
|
|
7027
7030
|
}) {
|
|
7028
|
-
const g = a ?? ((
|
|
7031
|
+
const g = a ?? ((_) => `--zd-p${_}`), [m, b] = J(!1), T = U(null), S = U(null), M = U(null), C = L(() => b(!1), []), A = L(() => b((_) => !_), []), E = L(() => {
|
|
7029
7032
|
b(!1), S.current?.focus();
|
|
7030
|
-
}, []),
|
|
7033
|
+
}, []), z = o === "bg" ? p ?? "#000000" : o === "fg" ? c ?? "#ffffff" : r[o] ?? "#000000", B = o === "bg" ? "bg" : o === "fg" ? "fg" : `p${o}`;
|
|
7031
7034
|
Ru(T, C, m, E);
|
|
7032
7035
|
const P = ao(`${t}: ${B}`), x = G(
|
|
7033
|
-
() => [...l ?? [], ...r.map((
|
|
7036
|
+
() => [...l ?? [], ...r.map((_, W) => W)],
|
|
7034
7037
|
[l, r]
|
|
7035
|
-
), y = l?.length ?? 0, N = vn(), w = (
|
|
7038
|
+
), y = l?.length ?? 0, N = vn(), w = (_) => `${N}-opt-${_}`, [q, $] = J(0), V = x[q];
|
|
7036
7039
|
oe(() => {
|
|
7037
7040
|
if (!m) return;
|
|
7038
|
-
const
|
|
7039
|
-
$(
|
|
7041
|
+
const _ = x.findIndex((W) => W === o);
|
|
7042
|
+
$(_ >= 0 ? _ : 0), M.current?.focus();
|
|
7040
7043
|
}, [m]);
|
|
7041
|
-
function R(
|
|
7042
|
-
s(n,
|
|
7044
|
+
function R(_) {
|
|
7045
|
+
s(n, _), b(!1);
|
|
7043
7046
|
}
|
|
7044
|
-
function X(
|
|
7047
|
+
function X(_) {
|
|
7045
7048
|
const W = x.length;
|
|
7046
7049
|
if (W !== 0) {
|
|
7047
|
-
if (
|
|
7048
|
-
|
|
7049
|
-
else if (
|
|
7050
|
-
|
|
7051
|
-
else if (
|
|
7052
|
-
|
|
7053
|
-
else if (
|
|
7054
|
-
|
|
7055
|
-
else if (
|
|
7056
|
-
|
|
7050
|
+
if (_.key === "ArrowDown" || _.key === "ArrowRight")
|
|
7051
|
+
_.preventDefault(), $((Y) => Math.min(W - 1, Y + 1));
|
|
7052
|
+
else if (_.key === "ArrowUp" || _.key === "ArrowLeft")
|
|
7053
|
+
_.preventDefault(), $((Y) => Math.max(0, Y - 1));
|
|
7054
|
+
else if (_.key === "Home")
|
|
7055
|
+
_.preventDefault(), $(0);
|
|
7056
|
+
else if (_.key === "End")
|
|
7057
|
+
_.preventDefault(), $(W - 1);
|
|
7058
|
+
else if (_.key === "Enter" || _.key === " ") {
|
|
7059
|
+
_.preventDefault();
|
|
7057
7060
|
const Y = x[q];
|
|
7058
7061
|
Y !== void 0 && (R(Y), S.current?.focus());
|
|
7059
7062
|
}
|
|
@@ -7073,8 +7076,8 @@ const za = St(function({
|
|
|
7073
7076
|
role: "button",
|
|
7074
7077
|
tabIndex: 0,
|
|
7075
7078
|
onClick: A,
|
|
7076
|
-
onKeyDown: (
|
|
7077
|
-
|
|
7079
|
+
onKeyDown: (_) => {
|
|
7080
|
+
_.key === "Enter" || _.key === " " ? (_.preventDefault(), A()) : _.key === "ArrowDown" && (_.preventDefault(), m || b(!0));
|
|
7078
7081
|
},
|
|
7079
7082
|
className: "tokenpanel-palette-trigger",
|
|
7080
7083
|
"aria-label": `${t}: ${B}`,
|
|
@@ -7087,7 +7090,7 @@ const za = St(function({
|
|
|
7087
7090
|
"div",
|
|
7088
7091
|
{
|
|
7089
7092
|
className: "tokenpanel-palette-trigger-color",
|
|
7090
|
-
style: { backgroundColor:
|
|
7093
|
+
style: { backgroundColor: z }
|
|
7091
7094
|
}
|
|
7092
7095
|
),
|
|
7093
7096
|
/* @__PURE__ */ i("span", { className: "tokenpanel-palette-trigger-value", children: B }),
|
|
@@ -7150,15 +7153,15 @@ const za = St(function({
|
|
|
7150
7153
|
className: "tokenpanel-palette-options",
|
|
7151
7154
|
style: Du(S.current, 440, l ? 160 : 120),
|
|
7152
7155
|
children: [
|
|
7153
|
-
l && l.length > 0 && /* @__PURE__ */ i("div", { className: "tokenpanel-palette-options-extras", children: l.map((
|
|
7154
|
-
const Y =
|
|
7156
|
+
l && l.length > 0 && /* @__PURE__ */ i("div", { className: "tokenpanel-palette-options-extras", children: l.map((_, W) => {
|
|
7157
|
+
const Y = _ === "bg" ? p ?? "#000000" : c ?? "#ffffff", re = o === _, K = q === W;
|
|
7155
7158
|
return /* @__PURE__ */ h(
|
|
7156
7159
|
"div",
|
|
7157
7160
|
{
|
|
7158
|
-
id: w(
|
|
7161
|
+
id: w(_),
|
|
7159
7162
|
role: "option",
|
|
7160
7163
|
"aria-selected": re,
|
|
7161
|
-
onClick: () => R(
|
|
7164
|
+
onClick: () => R(_),
|
|
7162
7165
|
className: [
|
|
7163
7166
|
"tokenpanel-palette-extra-option",
|
|
7164
7167
|
re ? "is-selected" : "",
|
|
@@ -7172,13 +7175,13 @@ const za = St(function({
|
|
|
7172
7175
|
style: { backgroundColor: Y }
|
|
7173
7176
|
}
|
|
7174
7177
|
),
|
|
7175
|
-
/* @__PURE__ */ i("span", { className: "tokenpanel-palette-extra-label", children:
|
|
7178
|
+
/* @__PURE__ */ i("span", { className: "tokenpanel-palette-extra-label", children: _ })
|
|
7176
7179
|
]
|
|
7177
7180
|
},
|
|
7178
|
-
|
|
7181
|
+
_
|
|
7179
7182
|
);
|
|
7180
7183
|
}) }),
|
|
7181
|
-
/* @__PURE__ */ i("div", { className: "tokenpanel-palette-options-grid", children: r.map((
|
|
7184
|
+
/* @__PURE__ */ i("div", { className: "tokenpanel-palette-options-grid", children: r.map((_, W) => {
|
|
7182
7185
|
const Y = o === W, re = q === y + W, K = g(W);
|
|
7183
7186
|
return /* @__PURE__ */ i(
|
|
7184
7187
|
"div",
|
|
@@ -7186,15 +7189,15 @@ const za = St(function({
|
|
|
7186
7189
|
id: w(W),
|
|
7187
7190
|
role: "option",
|
|
7188
7191
|
"aria-selected": Y,
|
|
7189
|
-
"aria-label": `${K}: ${
|
|
7192
|
+
"aria-label": `${K}: ${_}`,
|
|
7190
7193
|
onClick: () => R(W),
|
|
7191
|
-
title: `${K}: ${
|
|
7194
|
+
title: `${K}: ${_}`,
|
|
7192
7195
|
className: [
|
|
7193
7196
|
"tokenpanel-palette-option-button",
|
|
7194
7197
|
Y ? "is-selected" : "",
|
|
7195
7198
|
re ? "is-active" : ""
|
|
7196
7199
|
].filter(Boolean).join(" "),
|
|
7197
|
-
style: { backgroundColor:
|
|
7200
|
+
style: { backgroundColor: _ }
|
|
7198
7201
|
},
|
|
7199
7202
|
W
|
|
7200
7203
|
);
|
|
@@ -7455,7 +7458,7 @@ function Ou({
|
|
|
7455
7458
|
), M = k.colorPresets ?? {}, C = G(
|
|
7456
7459
|
() => ({ ...M, ...m.colorSchemes }),
|
|
7457
7460
|
[M, m.colorSchemes]
|
|
7458
|
-
), A = G(() => Object.keys(m.colorSchemes), [m.colorSchemes]), E = G(() => Object.keys(M).sort(), [M]),
|
|
7461
|
+
), A = G(() => Object.keys(m.colorSchemes), [m.colorSchemes]), E = G(() => Object.keys(M).sort(), [M]), z = m.label ?? m.id.toUpperCase(), B = b?.label ?? b?.id.toUpperCase() ?? "", P = L(
|
|
7459
7462
|
(I) => je(m, I),
|
|
7460
7463
|
[m]
|
|
7461
7464
|
), x = L(
|
|
@@ -7517,7 +7520,7 @@ function Ou({
|
|
|
7517
7520
|
tierLabel: N.label
|
|
7518
7521
|
})) : [],
|
|
7519
7522
|
[w, b, N, r]
|
|
7520
|
-
),
|
|
7523
|
+
), _ = G(
|
|
7521
7524
|
() => $.map(({ key: I, mapping: O, semanticTier: H, cssVar: se, label: Ie }) => Vn(w, {
|
|
7522
7525
|
cssVar: se,
|
|
7523
7526
|
id: I,
|
|
@@ -7549,15 +7552,15 @@ function Ou({
|
|
|
7549
7552
|
), F = G(
|
|
7550
7553
|
() => $.map(({ key: I, semanticTier: O }) => o && O ? W({ tabId: o.id, tierId: O.id, itemId: I }) : !1),
|
|
7551
7554
|
[W, $, o]
|
|
7552
|
-
), ne = (!w || V.some(Boolean)) && (!d || Y.some(Boolean)), ce = (!w || R.some(Boolean)) && (!d || re.some(Boolean)), ke = (!w || X.some(Boolean)) && (!d || K.some(Boolean)), Z = (!w ||
|
|
7555
|
+
), ne = (!w || V.some(Boolean)) && (!d || Y.some(Boolean)), ce = (!w || R.some(Boolean)) && (!d || re.some(Boolean)), ke = (!w || X.some(Boolean)) && (!d || K.some(Boolean)), Z = (!w || _.some(Boolean)) && (!d || F.some(Boolean)), de = Y.some(
|
|
7553
7556
|
(I, O) => I && (!w || V[O] === !0)
|
|
7554
7557
|
) || re.some(
|
|
7555
7558
|
(I, O) => I && (!w || R[O] === !0)
|
|
7556
7559
|
) || K.some(
|
|
7557
7560
|
(I, O) => I && (!w || X[O] === !0)
|
|
7558
7561
|
) || F.some(
|
|
7559
|
-
(I, O) => I && (!w ||
|
|
7560
|
-
),
|
|
7562
|
+
(I, O) => I && (!w || _[O] === !0)
|
|
7563
|
+
), _e = L(
|
|
7561
7564
|
(I, O) => {
|
|
7562
7565
|
n((H) => ({
|
|
7563
7566
|
...H,
|
|
@@ -7670,7 +7673,7 @@ function Ou({
|
|
|
7670
7673
|
) }),
|
|
7671
7674
|
t.palette.length > 0 && ne && /* @__PURE__ */ h("div", { className: "tokenpanel-tab-section", children: [
|
|
7672
7675
|
/* @__PURE__ */ h("div", { role: "heading", "aria-level": 3, className: "tokenpanel-tab-section-heading tokenpanel-tab-section-heading--color", children: [
|
|
7673
|
-
|
|
7676
|
+
z,
|
|
7674
7677
|
" — Palette"
|
|
7675
7678
|
] }),
|
|
7676
7679
|
/* @__PURE__ */ i("div", { className: "tokenpanel-color-palette-grid", children: t.palette.map((I, O) => {
|
|
@@ -7683,14 +7686,14 @@ function Ou({
|
|
|
7683
7686
|
// stays effective. `valueFormat` routes oklch-format slots through
|
|
7684
7687
|
// the lossless OKLCH editor; absent/`'hex'` slots stay hex.
|
|
7685
7688
|
/* @__PURE__ */ i(
|
|
7686
|
-
|
|
7689
|
+
_a,
|
|
7687
7690
|
{
|
|
7688
7691
|
color: I,
|
|
7689
7692
|
index: O,
|
|
7690
7693
|
label: je(m, O),
|
|
7691
7694
|
cssVar: je(m, O),
|
|
7692
|
-
valueFormat:
|
|
7693
|
-
onChange:
|
|
7695
|
+
valueFormat: za(y, O),
|
|
7696
|
+
onChange: _e,
|
|
7694
7697
|
address: se,
|
|
7695
7698
|
isChanged: !!Y[O],
|
|
7696
7699
|
onRevert: se && u ? () => u(se) : void 0
|
|
@@ -7703,7 +7706,7 @@ function Ou({
|
|
|
7703
7706
|
/* @__PURE__ */ h("div", { className: "tokenpanel-tab-content", children: [
|
|
7704
7707
|
t.palette.length > 0 && !d && /* @__PURE__ */ h("div", { className: "tokenpanel-tab-section", children: [
|
|
7705
7708
|
/* @__PURE__ */ h("div", { role: "heading", "aria-level": 3, className: "tokenpanel-tab-section-heading tokenpanel-tab-section-heading--color", children: [
|
|
7706
|
-
|
|
7709
|
+
z,
|
|
7707
7710
|
" — Base"
|
|
7708
7711
|
] }),
|
|
7709
7712
|
/* @__PURE__ */ h("div", { className: "tokenpanel-color-base-grid", children: [
|
|
@@ -7743,13 +7746,13 @@ function Ou({
|
|
|
7743
7746
|
"aria-level": 3,
|
|
7744
7747
|
className: "tokenpanel-tab-section-heading tokenpanel-tab-section-heading--color tokenpanel-tab-section-heading--with-help",
|
|
7745
7748
|
children: [
|
|
7746
|
-
|
|
7749
|
+
z,
|
|
7747
7750
|
" — Semantic Tokens",
|
|
7748
7751
|
/* @__PURE__ */ i(
|
|
7749
7752
|
ya,
|
|
7750
7753
|
{
|
|
7751
7754
|
text: xa,
|
|
7752
|
-
ariaLabel: `${
|
|
7755
|
+
ariaLabel: `${z} Semantic Tokens help`
|
|
7753
7756
|
}
|
|
7754
7757
|
)
|
|
7755
7758
|
]
|
|
@@ -7833,13 +7836,13 @@ function Ou({
|
|
|
7833
7836
|
if (w && !X[O] || d && !K[O]) return null;
|
|
7834
7837
|
const se = H ? { tabId: o.id, tierId: N?.id ?? "palette", itemId: H.id } : void 0;
|
|
7835
7838
|
return /* @__PURE__ */ i(
|
|
7836
|
-
|
|
7839
|
+
_a,
|
|
7837
7840
|
{
|
|
7838
7841
|
color: I,
|
|
7839
7842
|
index: O,
|
|
7840
7843
|
label: je(b, O),
|
|
7841
7844
|
cssVar: je(b, O),
|
|
7842
|
-
valueFormat:
|
|
7845
|
+
valueFormat: za(N, O),
|
|
7843
7846
|
onChange: j,
|
|
7844
7847
|
address: se,
|
|
7845
7848
|
isChanged: !!K[O],
|
|
@@ -7878,7 +7881,7 @@ function Ou({
|
|
|
7878
7881
|
),
|
|
7879
7882
|
/* @__PURE__ */ i("div", { className: "tokenpanel-color-base-grid", children: $.map(({ key: I, mapping: O, semanticTier: H }) => {
|
|
7880
7883
|
const se = b.semanticCssNames[I], Ie = $.findIndex((Et) => Et.key === I);
|
|
7881
|
-
if (w && !
|
|
7884
|
+
if (w && !_[Ie]) return null;
|
|
7882
7885
|
const xe = H ? { tabId: o.id, tierId: H.id, itemId: I } : void 0, Ge = xe ? W(xe) : !1;
|
|
7883
7886
|
if (d && !Ge) return null;
|
|
7884
7887
|
const We = O, ct = $a(o, I), et = ct?.referencesRamps;
|
|
@@ -8352,7 +8355,7 @@ function Qu({ tab: e, state: t, valueFor: n }) {
|
|
|
8352
8355
|
] });
|
|
8353
8356
|
}
|
|
8354
8357
|
function ek(e) {
|
|
8355
|
-
const { enabled: t, instanceConfig: n } = e, o = lo(n), [r, a] =
|
|
8358
|
+
const { enabled: t, instanceConfig: n } = e, o = lo(n), [r, a] = ze(null);
|
|
8356
8359
|
return ye(() => {
|
|
8357
8360
|
if (!t) return;
|
|
8358
8361
|
const s = Zu(o);
|
|
@@ -8757,12 +8760,12 @@ function dk({
|
|
|
8757
8760
|
o(e.address, N.currentTarget.checked ? k : m.current || f);
|
|
8758
8761
|
},
|
|
8759
8762
|
[f, e.address, o, k]
|
|
8760
|
-
),
|
|
8763
|
+
), z = Te(e.address), B = n.map((N) => N.className?.(e)).filter((N) => !!N), P = (N) => [N, ...B].join(" "), x = (N) => /* @__PURE__ */ i(Xe, { children: n.map((w) => {
|
|
8761
8764
|
const q = w[N];
|
|
8762
8765
|
return q ? /* @__PURE__ */ i(Xe, { children: q(e) }, w.id) : null;
|
|
8763
8766
|
}) }), y = {
|
|
8764
8767
|
"data-css-var": l.cssVar,
|
|
8765
|
-
"data-address":
|
|
8768
|
+
"data-address": z
|
|
8766
8769
|
};
|
|
8767
8770
|
if (s.referencesTier !== void 0) {
|
|
8768
8771
|
const N = s.referencesTier, w = (q, $) => {
|
|
@@ -8814,7 +8817,7 @@ function dk({
|
|
|
8814
8817
|
M(K);
|
|
8815
8818
|
const F = parseFloat(K);
|
|
8816
8819
|
Number.isFinite(F) && o(e.address, $ ? `${F}${$}` : String(F));
|
|
8817
|
-
},
|
|
8820
|
+
}, _ = () => {
|
|
8818
8821
|
Number.isFinite(parseFloat(S)) || M(String(T));
|
|
8819
8822
|
}, W = () => {
|
|
8820
8823
|
if (!w || w.length < 2) return;
|
|
@@ -8839,7 +8842,7 @@ function dk({
|
|
|
8839
8842
|
inputMode: "decimal",
|
|
8840
8843
|
value: S,
|
|
8841
8844
|
onChange: X,
|
|
8842
|
-
onBlur:
|
|
8845
|
+
onBlur: _,
|
|
8843
8846
|
disabled: R,
|
|
8844
8847
|
className: "tokenpanel-row-number-input",
|
|
8845
8848
|
"aria-label": `${l.cssVar} value`
|
|
@@ -9043,47 +9046,47 @@ function co({
|
|
|
9043
9046
|
const m = G(
|
|
9044
9047
|
() => s.trim() ? [...a, ck(s)] : a,
|
|
9045
9048
|
[a, s]
|
|
9046
|
-
), b = G(() => new Map(e.tiers.map((
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
const Y = { tabId: e.id, tierId:
|
|
9050
|
-
return { address: Y, tab: e, tier:
|
|
9049
|
+
), b = G(() => new Map(e.tiers.map((_) => [
|
|
9050
|
+
_.id,
|
|
9051
|
+
_.items.map((W) => {
|
|
9052
|
+
const Y = { tabId: e.id, tierId: _.id, itemId: W.id };
|
|
9053
|
+
return { address: Y, tab: e, tier: _, item: W, value: t(Y, W), kind: W.type.kind };
|
|
9051
9054
|
})
|
|
9052
9055
|
])), [t, e]), T = G(() => {
|
|
9053
|
-
const
|
|
9056
|
+
const _ = /* @__PURE__ */ new Map();
|
|
9054
9057
|
for (const W of b.values())
|
|
9055
|
-
for (const Y of W)
|
|
9056
|
-
return
|
|
9058
|
+
for (const Y of W) _.set(Te(Y.address), Y);
|
|
9059
|
+
return _;
|
|
9057
9060
|
}, [b]), S = G(() => new Map(
|
|
9058
|
-
[...b].map(([
|
|
9059
|
-
|
|
9061
|
+
[...b].map(([_, W]) => [
|
|
9062
|
+
_,
|
|
9060
9063
|
W.filter((Y) => m.every((re) => re.filter?.(Y) !== !1))
|
|
9061
9064
|
])
|
|
9062
|
-
), [m, b]), [M, C] = J(() => /* @__PURE__ */ new Set()), [A, E] = J(rk),
|
|
9065
|
+
), [m, b]), [M, C] = J(() => /* @__PURE__ */ new Set()), [A, E] = J(rk), z = G(
|
|
9063
9066
|
() => [...S.values()].flat().filter(Ot),
|
|
9064
9067
|
[S]
|
|
9065
9068
|
), B = G(
|
|
9066
|
-
() =>
|
|
9067
|
-
[
|
|
9069
|
+
() => z.filter((_) => M.has(Te(_.address))),
|
|
9070
|
+
[z, M]
|
|
9068
9071
|
);
|
|
9069
9072
|
oe(() => {
|
|
9070
|
-
const
|
|
9073
|
+
const _ = new Set(z.map((W) => Te(W.address)));
|
|
9071
9074
|
C((W) => {
|
|
9072
9075
|
let Y = !1;
|
|
9073
9076
|
const re = /* @__PURE__ */ new Set();
|
|
9074
9077
|
for (const K of W)
|
|
9075
|
-
|
|
9078
|
+
_.has(K) ? re.add(K) : Y = !0;
|
|
9076
9079
|
return Y ? re : W;
|
|
9077
9080
|
});
|
|
9078
|
-
}, [
|
|
9079
|
-
const P = L((
|
|
9080
|
-
const Y = Te(
|
|
9081
|
+
}, [z]);
|
|
9082
|
+
const P = L((_, W) => {
|
|
9083
|
+
const Y = Te(_.address);
|
|
9081
9084
|
C((re) => {
|
|
9082
9085
|
const K = new Set(re);
|
|
9083
9086
|
return W ? K.add(Y) : K.delete(Y), K;
|
|
9084
9087
|
});
|
|
9085
|
-
}, []), x = L((
|
|
9086
|
-
const Y = S.get(
|
|
9088
|
+
}, []), x = L((_, W) => {
|
|
9089
|
+
const Y = S.get(_.id) ?? [];
|
|
9087
9090
|
C((re) => {
|
|
9088
9091
|
const K = new Set(re);
|
|
9089
9092
|
for (const F of Y) {
|
|
@@ -9093,8 +9096,8 @@ function co({
|
|
|
9093
9096
|
}
|
|
9094
9097
|
return K;
|
|
9095
9098
|
});
|
|
9096
|
-
}, [S]), y = L((
|
|
9097
|
-
x(
|
|
9099
|
+
}, [S]), y = L((_, W) => {
|
|
9100
|
+
x(_, !0), E((Y) => ({
|
|
9098
9101
|
...Y,
|
|
9099
9102
|
multiply: String(W),
|
|
9100
9103
|
add: "0",
|
|
@@ -9102,8 +9105,8 @@ function co({
|
|
|
9102
9105
|
}));
|
|
9103
9106
|
}, [x]), N = L(() => {
|
|
9104
9107
|
C(/* @__PURE__ */ new Set());
|
|
9105
|
-
}, []), w = L((
|
|
9106
|
-
!g ||
|
|
9108
|
+
}, []), w = L((_) => {
|
|
9109
|
+
!g || _.length === 0 || (g(_), E((W) => ({
|
|
9107
9110
|
...W,
|
|
9108
9111
|
multiply: "1",
|
|
9109
9112
|
add: "0",
|
|
@@ -9131,7 +9134,7 @@ function co({
|
|
|
9131
9134
|
() => [...$, Ed],
|
|
9132
9135
|
[$]
|
|
9133
9136
|
), R = G(
|
|
9134
|
-
() => [...S.values()].some((
|
|
9137
|
+
() => [...S.values()].some((_) => _.length > 0),
|
|
9135
9138
|
[S]
|
|
9136
9139
|
), X = ["tokenpanel-tab-content", c].filter(Boolean).join(" ");
|
|
9137
9140
|
return /* @__PURE__ */ i(
|
|
@@ -9143,21 +9146,21 @@ function co({
|
|
|
9143
9146
|
jumpTo: f,
|
|
9144
9147
|
children: /* @__PURE__ */ h("div", { className: X, ...d ? { "data-testid": d } : {}, children: [
|
|
9145
9148
|
p,
|
|
9146
|
-
e.tiers.map((
|
|
9147
|
-
const W = (b.get(
|
|
9149
|
+
e.tiers.map((_) => {
|
|
9150
|
+
const W = (b.get(_.id) ?? []).filter((Y) => $.every((re) => re.filter?.(Y) !== !1));
|
|
9148
9151
|
return W.length === 0 ? null : /* @__PURE__ */ i(
|
|
9149
9152
|
kk,
|
|
9150
9153
|
{
|
|
9151
|
-
tier:
|
|
9154
|
+
tier: _,
|
|
9152
9155
|
entries: W,
|
|
9153
9156
|
overrides: r,
|
|
9154
9157
|
contributions: V,
|
|
9155
|
-
testId: u?.(
|
|
9158
|
+
testId: u?.(_),
|
|
9156
9159
|
setValue: n,
|
|
9157
9160
|
deleteValue: o,
|
|
9158
9161
|
renderTierBody: k
|
|
9159
9162
|
},
|
|
9160
|
-
|
|
9163
|
+
_.id
|
|
9161
9164
|
);
|
|
9162
9165
|
}),
|
|
9163
9166
|
g && B.length > 0 && /* @__PURE__ */ i(
|
|
@@ -9200,10 +9203,10 @@ function hk({
|
|
|
9200
9203
|
oe(() => {
|
|
9201
9204
|
m && Uu(o, T);
|
|
9202
9205
|
}, [m, o, T]);
|
|
9203
|
-
const
|
|
9206
|
+
const z = L((y) => t[y.id] ?? y.default, [t]), B = G(() => [
|
|
9204
9207
|
io(),
|
|
9205
|
-
Fu({ tab: e, state: T, valueFor:
|
|
9206
|
-
], [A, T, e,
|
|
9208
|
+
Fu({ tab: e, state: T, valueFor: z, onPage: A })
|
|
9209
|
+
], [A, T, e, z]), P = L((y, N) => Hu(y, N, { tab: e, valueFor: z }), [T, e, z]), x = p ? [...B, p] : B;
|
|
9207
9210
|
return /* @__PURE__ */ h(me, { children: [
|
|
9208
9211
|
m && /* @__PURE__ */ i(
|
|
9209
9212
|
ek,
|
|
@@ -9211,7 +9214,7 @@ function hk({
|
|
|
9211
9214
|
enabled: A,
|
|
9212
9215
|
tab: e,
|
|
9213
9216
|
state: T,
|
|
9214
|
-
valueFor:
|
|
9217
|
+
valueFor: z,
|
|
9215
9218
|
instanceConfig: o
|
|
9216
9219
|
}
|
|
9217
9220
|
),
|
|
@@ -9400,7 +9403,7 @@ const xk = 359.99;
|
|
|
9400
9403
|
function yk(e) {
|
|
9401
9404
|
return e >= 360 ? xk : e;
|
|
9402
9405
|
}
|
|
9403
|
-
const kt = 300,
|
|
9406
|
+
const kt = 300, _t = 200, ja = 4, Nk = 11, Ck = 2, pl = 16, Fa = pl / 2 + 2, Ro = ["l", "c", "h"], ul = { l: 1, c: 1e-3, h: 1 };
|
|
9404
9407
|
function Do(e, t) {
|
|
9405
9408
|
const n = ul[t];
|
|
9406
9409
|
return Math.round(e / n) * n;
|
|
@@ -9412,7 +9415,7 @@ function wn(e, t) {
|
|
|
9412
9415
|
return t <= 0 ? kt / 2 : wk(e, t) * kt;
|
|
9413
9416
|
}
|
|
9414
9417
|
function bn(e, t) {
|
|
9415
|
-
return bk(e, t) *
|
|
9418
|
+
return bk(e, t) * _t;
|
|
9416
9419
|
}
|
|
9417
9420
|
function Gt(e, t) {
|
|
9418
9421
|
return e[t];
|
|
@@ -9468,21 +9471,21 @@ function $k({
|
|
|
9468
9471
|
l: U(null),
|
|
9469
9472
|
c: U(null),
|
|
9470
9473
|
h: U(null)
|
|
9471
|
-
}, d = U(null), [u, k] = J({ w: kt, h:
|
|
9474
|
+
}, d = U(null), [u, k] = J({ w: kt, h: _t });
|
|
9472
9475
|
Qa(() => {
|
|
9473
9476
|
const $ = d.current;
|
|
9474
9477
|
if (!$) return;
|
|
9475
9478
|
const V = () => {
|
|
9476
9479
|
const X = $.getBoundingClientRect();
|
|
9477
9480
|
X.width > 0 && X.height > 0 && k(
|
|
9478
|
-
(
|
|
9481
|
+
(_) => _.w === X.width && _.h === X.height ? _ : { w: X.width, h: X.height }
|
|
9479
9482
|
);
|
|
9480
9483
|
};
|
|
9481
9484
|
if (V(), typeof ResizeObserver > "u") return;
|
|
9482
9485
|
const R = new ResizeObserver(V);
|
|
9483
9486
|
return R.observe($), () => R.disconnect();
|
|
9484
9487
|
}, []);
|
|
9485
|
-
const f = u.w > 0 ? u.w / kt : 1, g = u.h > 0 ? u.h /
|
|
9488
|
+
const f = u.w > 0 ? u.w / kt : 1, g = u.h > 0 ? u.h / _t : 1, m = ja / f, b = ja / g, T = Fa / f, S = Fa / g, M = U(a);
|
|
9486
9489
|
M.current = a;
|
|
9487
9490
|
const C = U(s);
|
|
9488
9491
|
C.current = s;
|
|
@@ -9490,8 +9493,8 @@ function $k({
|
|
|
9490
9493
|
A.current = l;
|
|
9491
9494
|
const E = U(p);
|
|
9492
9495
|
E.current = p;
|
|
9493
|
-
const
|
|
9494
|
-
|
|
9496
|
+
const z = U(e);
|
|
9497
|
+
z.current = e;
|
|
9495
9498
|
const B = U(t);
|
|
9496
9499
|
B.current = t;
|
|
9497
9500
|
const P = U(n);
|
|
@@ -9510,7 +9513,7 @@ function $k({
|
|
|
9510
9513
|
($, V) => {
|
|
9511
9514
|
const R = c[V].current;
|
|
9512
9515
|
if (!R) return 0;
|
|
9513
|
-
const X = R.getBoundingClientRect(),
|
|
9516
|
+
const X = R.getBoundingClientRect(), _ = X.height > 0 ? ($ - X.top) / X.height : 0, W = vk(_, V);
|
|
9514
9517
|
return Do(W, V);
|
|
9515
9518
|
},
|
|
9516
9519
|
// svgRefs is a stable object of stable refs — read at call time.
|
|
@@ -9525,7 +9528,7 @@ function $k({
|
|
|
9525
9528
|
const F = K.closest("[data-node-hit]"), ne = K.closest("[data-hit-line]");
|
|
9526
9529
|
if (F) {
|
|
9527
9530
|
const ce = Number(F.getAttribute("data-node-hit"));
|
|
9528
|
-
if (!
|
|
9531
|
+
if (!z.current[ce] || !B.current[ce]) return;
|
|
9529
9532
|
const ke = P.current[ce];
|
|
9530
9533
|
if (!ke) return;
|
|
9531
9534
|
re.preventDefault(), re.stopPropagation();
|
|
@@ -9542,7 +9545,7 @@ function $k({
|
|
|
9542
9545
|
ne.setPointerCapture(re.pointerId);
|
|
9543
9546
|
} catch {
|
|
9544
9547
|
}
|
|
9545
|
-
const ce =
|
|
9548
|
+
const ce = z.current.map(
|
|
9546
9549
|
(Z, de) => Z && B.current[de] ? Gt(Z, R) : null
|
|
9547
9550
|
), ke = ce.map(
|
|
9548
9551
|
(Z, de) => Z === null ? null : P.current[de] ?? null
|
|
@@ -9556,11 +9559,11 @@ function $k({
|
|
|
9556
9559
|
startIdentities: ke
|
|
9557
9560
|
}, A.current?.();
|
|
9558
9561
|
}
|
|
9559
|
-
},
|
|
9562
|
+
}, _ = function(re) {
|
|
9560
9563
|
const K = x.current;
|
|
9561
9564
|
if (!K || K.channel !== R) return;
|
|
9562
9565
|
if (K.kind === "node") {
|
|
9563
|
-
if (!
|
|
9566
|
+
if (!z.current[K.index] || !B.current[K.index] || P.current[K.index] !== K.identity) return;
|
|
9564
9567
|
M.current(
|
|
9565
9568
|
K.index,
|
|
9566
9569
|
R,
|
|
@@ -9571,19 +9574,19 @@ function $k({
|
|
|
9571
9574
|
const { startValues: F, startIdentities: ne, startPointerValue: ce } = K;
|
|
9572
9575
|
if (F.length === 0) return;
|
|
9573
9576
|
const ke = kn[R], Z = N(re.clientY, R) - ce, de = F.filter(
|
|
9574
|
-
(pe, fe) => pe !== null && !!
|
|
9577
|
+
(pe, fe) => pe !== null && !!z.current[fe] && !!B.current[fe] && P.current[fe] === ne[fe]
|
|
9575
9578
|
);
|
|
9576
9579
|
if (de.length === 0) return;
|
|
9577
|
-
const
|
|
9580
|
+
const _e = Math.min(...de), j = Math.max(...de), ae = Ha(Z, -_e, ke - j);
|
|
9578
9581
|
F.forEach((pe, fe) => {
|
|
9579
|
-
pe === null || !
|
|
9582
|
+
pe === null || !z.current[fe] || !B.current[fe] || P.current[fe] !== ne[fe] || M.current(fe, R, Do(pe + ae, R));
|
|
9580
9583
|
});
|
|
9581
9584
|
}, W = function() {
|
|
9582
9585
|
!x.current || x.current.channel !== R || (x.current = null, E.current?.());
|
|
9583
9586
|
};
|
|
9584
9587
|
const Y = c[R].current;
|
|
9585
|
-
Y && (Y.addEventListener("pointerdown", X), Y.addEventListener("pointermove",
|
|
9586
|
-
Y.removeEventListener("pointerdown", X), Y.removeEventListener("pointermove",
|
|
9588
|
+
Y && (Y.addEventListener("pointerdown", X), Y.addEventListener("pointermove", _), Y.addEventListener("pointerup", W), Y.addEventListener("pointercancel", W), V.push(() => {
|
|
9589
|
+
Y.removeEventListener("pointerdown", X), Y.removeEventListener("pointermove", _), Y.removeEventListener("pointerup", W), Y.removeEventListener("pointercancel", W);
|
|
9587
9590
|
}));
|
|
9588
9591
|
}
|
|
9589
9592
|
return () => {
|
|
@@ -9591,18 +9594,18 @@ function $k({
|
|
|
9591
9594
|
};
|
|
9592
9595
|
}, [r.l, r.c, r.h, N]);
|
|
9593
9596
|
const w = L(
|
|
9594
|
-
($, V, R, X,
|
|
9595
|
-
if (!
|
|
9597
|
+
($, V, R, X, _) => {
|
|
9598
|
+
if (!z.current[V] || !B.current[V] || P.current[V] !== R) return;
|
|
9596
9599
|
const W = kn[X], Y = ul[X], re = Y * 10;
|
|
9597
9600
|
let K = null;
|
|
9598
9601
|
switch ($.key) {
|
|
9599
9602
|
case "ArrowUp":
|
|
9600
9603
|
case "ArrowRight":
|
|
9601
|
-
K =
|
|
9604
|
+
K = _ + ($.shiftKey ? re : Y);
|
|
9602
9605
|
break;
|
|
9603
9606
|
case "ArrowDown":
|
|
9604
9607
|
case "ArrowLeft":
|
|
9605
|
-
K =
|
|
9608
|
+
K = _ - ($.shiftKey ? re : Y);
|
|
9606
9609
|
break;
|
|
9607
9610
|
case "Home":
|
|
9608
9611
|
K = 0;
|
|
@@ -9628,7 +9631,7 @@ function $k({
|
|
|
9628
9631
|
"svg",
|
|
9629
9632
|
{
|
|
9630
9633
|
className: "tokenpanel-palette-chart-bands",
|
|
9631
|
-
viewBox: `0 0 ${kt} ${
|
|
9634
|
+
viewBox: `0 0 ${kt} ${_t}`,
|
|
9632
9635
|
preserveAspectRatio: "none",
|
|
9633
9636
|
role: "presentation",
|
|
9634
9637
|
"data-testid": "palette-chart-bands",
|
|
@@ -9638,7 +9641,7 @@ function $k({
|
|
|
9638
9641
|
x: $.x,
|
|
9639
9642
|
y: 0,
|
|
9640
9643
|
width: $.width,
|
|
9641
|
-
height:
|
|
9644
|
+
height: _t,
|
|
9642
9645
|
fill: $.fill,
|
|
9643
9646
|
"data-band-index": $.index,
|
|
9644
9647
|
"data-invalid": $.valid ? void 0 : !0,
|
|
@@ -9655,7 +9658,7 @@ function $k({
|
|
|
9655
9658
|
{
|
|
9656
9659
|
ref: c[$],
|
|
9657
9660
|
className: `tokenpanel-palette-chart-curve tokenpanel-palette-chart-curve--${$}`,
|
|
9658
|
-
viewBox: `0 0 ${kt} ${
|
|
9661
|
+
viewBox: `0 0 ${kt} ${_t}`,
|
|
9659
9662
|
preserveAspectRatio: "none",
|
|
9660
9663
|
role: "presentation",
|
|
9661
9664
|
"data-testid": `palette-chart-curve-${$}`,
|
|
@@ -9691,7 +9694,7 @@ function $k({
|
|
|
9691
9694
|
) }, `segment-${$}-${R}`)),
|
|
9692
9695
|
e.map((V, R) => {
|
|
9693
9696
|
if (!V) return null;
|
|
9694
|
-
const X = Gt(V, $),
|
|
9697
|
+
const X = Gt(V, $), _ = wn(R, e.length), W = bn(X, $), Y = R === o, re = !!t[R];
|
|
9695
9698
|
return /* @__PURE__ */ h(
|
|
9696
9699
|
"g",
|
|
9697
9700
|
{
|
|
@@ -9702,7 +9705,7 @@ function $k({
|
|
|
9702
9705
|
"ellipse",
|
|
9703
9706
|
{
|
|
9704
9707
|
className: re ? "tokenpanel-palette-chart-node-visual" : "tokenpanel-palette-chart-node-visual is-readonly",
|
|
9705
|
-
cx:
|
|
9708
|
+
cx: _,
|
|
9706
9709
|
cy: W,
|
|
9707
9710
|
rx: m,
|
|
9708
9711
|
ry: b,
|
|
@@ -9716,7 +9719,7 @@ function $k({
|
|
|
9716
9719
|
"circle",
|
|
9717
9720
|
{
|
|
9718
9721
|
className: "tokenpanel-palette-chart-node-hit",
|
|
9719
|
-
cx:
|
|
9722
|
+
cx: _,
|
|
9720
9723
|
cy: W,
|
|
9721
9724
|
r: Nk,
|
|
9722
9725
|
fill: "transparent",
|
|
@@ -9745,7 +9748,7 @@ function $k({
|
|
|
9745
9748
|
"svg",
|
|
9746
9749
|
{
|
|
9747
9750
|
className: "tokenpanel-palette-chart-blockers",
|
|
9748
|
-
viewBox: `0 0 ${kt} ${
|
|
9751
|
+
viewBox: `0 0 ${kt} ${_t}`,
|
|
9749
9752
|
preserveAspectRatio: "none",
|
|
9750
9753
|
role: "presentation",
|
|
9751
9754
|
"aria-hidden": "true",
|
|
@@ -9777,14 +9780,14 @@ function Tk(e) {
|
|
|
9777
9780
|
const n = parseInt(t[1], 16), o = parseInt(t[2], 16), r = parseInt(t[3], 16);
|
|
9778
9781
|
return `rgb(${n}, ${o}, ${r})`;
|
|
9779
9782
|
}
|
|
9780
|
-
function
|
|
9783
|
+
function zk(e) {
|
|
9781
9784
|
const t = e.l.toFixed(1), n = e.c.toFixed(3), o = e.h.toFixed(0);
|
|
9782
9785
|
if (e.a >= 100) return `oklch(${t}% ${n} ${o})`;
|
|
9783
9786
|
const r = (e.a / 100).toFixed(2);
|
|
9784
9787
|
return `oklch(${t}% ${n} ${o} / ${r})`;
|
|
9785
9788
|
}
|
|
9786
|
-
function
|
|
9787
|
-
const o = ot(e), r = Tk(o), a =
|
|
9789
|
+
function _k({ oklcha: e, cssVar: t, outOfGamut: n }) {
|
|
9790
|
+
const o = ot(e), r = Tk(o), a = zk(e);
|
|
9788
9791
|
return /* @__PURE__ */ h("div", { className: "tokenpanel-palette-readout", "data-testid": "palette-readout", children: [
|
|
9789
9792
|
/* @__PURE__ */ i(
|
|
9790
9793
|
"div",
|
|
@@ -9937,7 +9940,7 @@ function Dk({
|
|
|
9937
9940
|
l: !0,
|
|
9938
9941
|
c: !0,
|
|
9939
9942
|
h: !0
|
|
9940
|
-
}), [M, C] = J({}), A = U({}), E = U(null),
|
|
9943
|
+
}), [M, C] = J({}), A = U({}), E = U(null), z = L((F) => {
|
|
9941
9944
|
A.current = F, C(F);
|
|
9942
9945
|
}, []), B = L((F) => {
|
|
9943
9946
|
S((ne) => ({ ...ne, [F]: !ne[F] }));
|
|
@@ -9945,10 +9948,10 @@ function Dk({
|
|
|
9945
9948
|
oe(() => {
|
|
9946
9949
|
if (!l || l.tabId !== e.id) return;
|
|
9947
9950
|
const F = c.find((ke) => ke.id === l.tierId), ne = F?.items.findIndex((ke) => ke.id === l.itemId) ?? -1;
|
|
9948
|
-
if (!F || ne < 0 || (g(F.id), b(ne), E.current = null,
|
|
9951
|
+
if (!F || ne < 0 || (g(F.id), b(ne), E.current = null, z({}), !p)) return;
|
|
9949
9952
|
const ce = window.requestAnimationFrame(() => p(l));
|
|
9950
9953
|
return () => window.cancelAnimationFrame(ce);
|
|
9951
|
-
}, [c, l, p, e.id,
|
|
9954
|
+
}, [c, l, p, e.id, z]);
|
|
9952
9955
|
const x = U(P);
|
|
9953
9956
|
x.current = P;
|
|
9954
9957
|
const y = U(m);
|
|
@@ -9961,14 +9964,14 @@ function Dk({
|
|
|
9961
9964
|
}) : [], [P, t, M]), q = L((F) => {
|
|
9962
9965
|
g((ce) => ce === F ? null : F);
|
|
9963
9966
|
const ne = k.find((ce) => ce.id === F);
|
|
9964
|
-
b(ne ? Ak(ne, t) : 0), E.current = null,
|
|
9965
|
-
}, [t, k,
|
|
9967
|
+
b(ne ? Ak(ne, t) : 0), E.current = null, z({});
|
|
9968
|
+
}, [t, k, z]), $ = L((F, ne) => {
|
|
9966
9969
|
g(F), b(ne);
|
|
9967
9970
|
}, []), V = L((F) => {
|
|
9968
9971
|
b(F);
|
|
9969
9972
|
}, []), R = L(() => {
|
|
9970
|
-
E.current = P ? { tierId: P.id, itemIds: P.items.map((F) => F.id) } : null,
|
|
9971
|
-
}, [P,
|
|
9973
|
+
E.current = P ? { tierId: P.id, itemIds: P.items.map((F) => F.id) } : null, z({});
|
|
9974
|
+
}, [P, z]), X = L(
|
|
9972
9975
|
(F, ne, ce) => {
|
|
9973
9976
|
if (!P) return;
|
|
9974
9977
|
const ke = E.current;
|
|
@@ -9977,30 +9980,30 @@ function Dk({
|
|
|
9977
9980
|
if (!Z || ke.itemIds[F] !== Z.id) return;
|
|
9978
9981
|
const de = Lt(Z, P.id, t);
|
|
9979
9982
|
if (!Fn(Z, de)) return;
|
|
9980
|
-
const
|
|
9981
|
-
|
|
9983
|
+
const _e = A.current, j = _e[Z.id] ?? de.color, ae = ne === "h" ? yk(ce) : ce;
|
|
9984
|
+
z({ ..._e, [Z.id]: { ...j, [ne]: ae } });
|
|
9982
9985
|
},
|
|
9983
|
-
[P, t,
|
|
9984
|
-
),
|
|
9986
|
+
[P, t, z]
|
|
9987
|
+
), _ = L(() => {
|
|
9985
9988
|
const F = A.current, ne = Object.keys(F), ce = E.current, ke = !!(P && ce && P.id === ce.tierId && P.items.length === ce.itemIds.length && P.items.every((Z, de) => Z.id === ce.itemIds[de]));
|
|
9986
9989
|
if (P && ke && ne.length > 0) {
|
|
9987
9990
|
const Z = {};
|
|
9988
9991
|
for (const de of ne) {
|
|
9989
|
-
const
|
|
9990
|
-
Fn(
|
|
9992
|
+
const _e = P.items.find((j) => j.id === de);
|
|
9993
|
+
Fn(_e, _e && Lt(_e, P.id, t)) && (Z[de] = Le(F[de]));
|
|
9991
9994
|
}
|
|
9992
9995
|
if (Object.keys(Z).length === 0) {
|
|
9993
|
-
E.current = null,
|
|
9996
|
+
E.current = null, z({});
|
|
9994
9997
|
return;
|
|
9995
9998
|
}
|
|
9996
9999
|
if (o)
|
|
9997
10000
|
o(P.id, Z);
|
|
9998
10001
|
else
|
|
9999
|
-
for (const [de,
|
|
10000
|
-
n(P.id, de,
|
|
10002
|
+
for (const [de, _e] of Object.entries(Z))
|
|
10003
|
+
n(P.id, de, _e);
|
|
10001
10004
|
}
|
|
10002
|
-
E.current = null,
|
|
10003
|
-
}, [P, n, o, t,
|
|
10005
|
+
E.current = null, z({});
|
|
10006
|
+
}, [P, n, o, t, z]), W = L(
|
|
10004
10007
|
(F, ne, ce) => {
|
|
10005
10008
|
const ke = x.current;
|
|
10006
10009
|
if (!ke || ke.id !== F) return;
|
|
@@ -10075,8 +10078,8 @@ function Dk({
|
|
|
10075
10078
|
className: "tokenpanel-palette-edit-swatches",
|
|
10076
10079
|
"data-testid": `palette-edit-swatches-${F.id}`,
|
|
10077
10080
|
children: F.items.map((Z, de) => {
|
|
10078
|
-
const
|
|
10079
|
-
return a && !u(
|
|
10081
|
+
const _e = { tabId: e.id, tierId: F.id, itemId: Z.id };
|
|
10082
|
+
return a && !u(_e) ? null : /* @__PURE__ */ i(
|
|
10080
10083
|
Mk,
|
|
10081
10084
|
{
|
|
10082
10085
|
item: Z,
|
|
@@ -10109,7 +10112,7 @@ function Dk({
|
|
|
10109
10112
|
onChartSelectIndex: V,
|
|
10110
10113
|
onToggleChannel: B,
|
|
10111
10114
|
onChangeStart: R,
|
|
10112
|
-
onChangeEnd:
|
|
10115
|
+
onChangeEnd: _,
|
|
10113
10116
|
onDirectEdit: W
|
|
10114
10117
|
}
|
|
10115
10118
|
)
|
|
@@ -10175,7 +10178,7 @@ function Ok({
|
|
|
10175
10178
|
/* @__PURE__ */ i("div", { className: "tokenpanel-palette-edit-direct-hint", children: S ? "Locked · read-only inspection" : l ? "edit selected step exactly" : "N/A · unsupported color is read-only" })
|
|
10176
10179
|
] }),
|
|
10177
10180
|
s && l ? /* @__PURE__ */ i(
|
|
10178
|
-
|
|
10181
|
+
_k,
|
|
10179
10182
|
{
|
|
10180
10183
|
oklcha: l,
|
|
10181
10184
|
cssVar: s.cssVar,
|
|
@@ -10312,7 +10315,7 @@ function Gk({
|
|
|
10312
10315
|
[l, o, s, e.id, a]
|
|
10313
10316
|
), c = G(() => new Map(p.map((N) => [N.id, N.items.filter((w) => !o || l({ tabId: e.id, tierId: N.id, itemId: w.id })).map((w) => Kk(e.id, w, N.id, t))])), [l, o, t, e.id, p]), d = p.flatMap((N) => c.get(N.id) ?? []), u = d.find((N) => N.opaque) ?? null, [k, f] = J(() => u ? Mt(u) : ""), [g, m] = J(!0), [b, T] = J(!1), S = d.find((N) => N.opaque && Mt(N) === k) ?? u, M = S ? Mt(S) : "", C = L((N) => {
|
|
10314
10317
|
N.opaque && f(Mt(N));
|
|
10315
|
-
}, []), A = L((N) => m(!N.target.checked), []), E = L((N) => T(N.target.checked), []),
|
|
10318
|
+
}, []), A = L((N) => m(!N.target.checked), []), E = L((N) => T(N.target.checked), []), z = b ? 3 : 4.5, B = S ? d.filter((N) => N.opaque && N.hex) : [], P = B.filter((N) => hl(S.hex, N.hex) >= z).length, x = { id: "__flat__", label: "Palette", items: [] }, y = (N) => g ? p.map((w) => /* @__PURE__ */ i(Wa, { tier: w, entries: c.get(w.id) ?? [], side: N, showHeading: !0, selectedKey: M, onSelect: C, base: S, isLarge: b }, `${N}-${w.id}`)) : /* @__PURE__ */ i(Wa, { tier: x, entries: d, side: N, showHeading: !1, selectedKey: M, onSelect: C, base: S, isLarge: b });
|
|
10316
10319
|
return /* @__PURE__ */ h("div", { className: "tokenpanel-palette-check-view", "data-testid": "palette-check-view", children: [
|
|
10317
10320
|
/* @__PURE__ */ h("div", { className: "tokenpanel-palette-check-toolbar", "data-testid": "palette-check-toolbar", children: [
|
|
10318
10321
|
/* @__PURE__ */ h("label", { className: "tokenpanel-palette-check-switch", children: [
|
|
@@ -10662,7 +10665,7 @@ function lh() {
|
|
|
10662
10665
|
return new ih();
|
|
10663
10666
|
}
|
|
10664
10667
|
function sh(e) {
|
|
10665
|
-
const [t, n] =
|
|
10668
|
+
const [t, n] = ze(() => e.getSnapshot());
|
|
10666
10669
|
return ye(() => e.subscribe(() => n(e.getSnapshot())), [e]), {
|
|
10667
10670
|
...t,
|
|
10668
10671
|
undo: () => e.undo(),
|
|
@@ -10804,9 +10807,9 @@ function mh({
|
|
|
10804
10807
|
const n = G(
|
|
10805
10808
|
() => e ?? Ee(),
|
|
10806
10809
|
[e]
|
|
10807
|
-
), o = vn(), [r, a] = J(!1), [s, l] = J(!1), [p, c] = J(!1), [d, u] = J(!1), [k, f] = J(!1), [g, m] = J(!1), [b, T] = J(null), [S, M] = J(null), [C, A] = J(!1), [E,
|
|
10810
|
+
), o = vn(), [r, a] = J(!1), [s, l] = J(!1), [p, c] = J(!1), [d, u] = J(!1), [k, f] = J(!1), [g, m] = J(!1), [b, T] = J(null), [S, M] = J(null), [C, A] = J(!1), [E, z] = J(""), [B, P] = J(!1), [x, y] = J(null), N = U(null), [w, q] = J(null), [$, V] = J(
|
|
10808
10811
|
n.tabs[0]?.id ?? Ga
|
|
10809
|
-
), [R, X] = J(Vr), [
|
|
10812
|
+
), [R, X] = J(Vr), [_, W] = J(os), [Y, re] = J(rs), [K, F] = J(as), [ne, ce] = J(is), [ke, Z] = J(!1), de = U(null), [_e, j] = J(!1), ae = U(null), pe = U(null), fe = U(null), we = L((v) => {
|
|
10810
10813
|
pe.current = v, fe.current = v;
|
|
10811
10814
|
}, []), Q = U({
|
|
10812
10815
|
spacing: null,
|
|
@@ -10815,19 +10818,19 @@ function mh({
|
|
|
10815
10818
|
color: null
|
|
10816
10819
|
}), ie = U(Vr);
|
|
10817
10820
|
ie.current = R;
|
|
10818
|
-
const be = U(
|
|
10819
|
-
be.current =
|
|
10821
|
+
const be = U(_);
|
|
10822
|
+
be.current = _;
|
|
10820
10823
|
const Ne = U(ne);
|
|
10821
10824
|
Ne.current = ne;
|
|
10822
10825
|
const ve = U(K);
|
|
10823
10826
|
ve.current = K;
|
|
10824
|
-
const Re = U("float"), I = U(null), O = U(null), { commitTweakState: H, history: se } = ch(w, q, n), Ie = sh(se), { snapshots: xe, save: Ge } = pu(n), { persistColor: We, persistSpacing: ct, persistFont: et, persistSize: Et, persistSecondary:
|
|
10827
|
+
const Re = U("float"), I = U(null), O = U(null), { commitTweakState: H, history: se } = ch(w, q, n), Ie = sh(se), { snapshots: xe, save: Ge } = pu(n), { persistColor: We, persistSpacing: ct, persistFont: et, persistSize: Et, persistSecondary: zl, persistTab: Zt } = rh(H, n), jt = G(
|
|
10825
10828
|
() => {
|
|
10826
10829
|
const v = Fe(n);
|
|
10827
10830
|
return typeof document > "u" || !document.documentElement ? v.panelSettings.colorScheme : Vo(v, n);
|
|
10828
10831
|
},
|
|
10829
10832
|
[n, w]
|
|
10830
|
-
),
|
|
10833
|
+
), _l = L((v) => {
|
|
10831
10834
|
v.length !== 0 && H("bulk", (D) => ({
|
|
10832
10835
|
...D,
|
|
10833
10836
|
spacing: v.reduce(
|
|
@@ -11104,7 +11107,7 @@ function mh({
|
|
|
11104
11107
|
[]
|
|
11105
11108
|
), go = L(() => {
|
|
11106
11109
|
Ie.canUndo && Ft(se.undo());
|
|
11107
|
-
}, [Ft, se, Ie.canUndo]),
|
|
11110
|
+
}, [Ft, se, Ie.canUndo]), zr = L(() => {
|
|
11108
11111
|
Ie.canRedo && Ft(se.redo());
|
|
11109
11112
|
}, [Ft, se, Ie.canRedo]), Vl = L(
|
|
11110
11113
|
(v) => {
|
|
@@ -11132,7 +11135,7 @@ function mh({
|
|
|
11132
11135
|
return;
|
|
11133
11136
|
}
|
|
11134
11137
|
wo(b === "A" ? "B" : "A");
|
|
11135
|
-
}, [wo, b, xe.A, xe.B]),
|
|
11138
|
+
}, [wo, b, xe.A, xe.B]), _r = L((v) => {
|
|
11136
11139
|
if (v === "color") {
|
|
11137
11140
|
H("reset-color", (D) => ({
|
|
11138
11141
|
...D,
|
|
@@ -11157,15 +11160,16 @@ function mh({
|
|
|
11157
11160
|
v === "notes" || v === "color-secondary" || Zt(v, () => ({}));
|
|
11158
11161
|
}, [H, n, et, Et, ct, Zt]), ft = ri(n), Tt = G(
|
|
11159
11162
|
() => [
|
|
11160
|
-
{ label: "Export", onSelect: () => l(!0) },
|
|
11161
|
-
{ label: "Load from JSON…", onSelect: () => c(!0) },
|
|
11163
|
+
{ id: "export", label: "Export", onSelect: () => l(!0) },
|
|
11164
|
+
{ id: "import", label: "Load from JSON…", onSelect: () => c(!0) },
|
|
11162
11165
|
{
|
|
11166
|
+
id: "apply",
|
|
11163
11167
|
label: "Apply",
|
|
11164
11168
|
onSelect: () => u(!0),
|
|
11165
11169
|
disabled: !ft,
|
|
11166
11170
|
disabledReason: ft ? void 0 : Bo
|
|
11167
11171
|
},
|
|
11168
|
-
{ label: "Reset", onSelect: In }
|
|
11172
|
+
{ id: "reset", label: "Reset", onSelect: In }
|
|
11169
11173
|
],
|
|
11170
11174
|
[ft, In]
|
|
11171
11175
|
), mt = G(
|
|
@@ -11208,13 +11212,13 @@ function mh({
|
|
|
11208
11212
|
}, [n]), Ye = G(() => Jt(n), [n]), tt = G(() => ({
|
|
11209
11213
|
color: mt,
|
|
11210
11214
|
...Qt ? { secondary: Qt } : {}
|
|
11211
|
-
}), [mt, Qt]),
|
|
11215
|
+
}), [mt, Qt]), zt = G(
|
|
11212
11216
|
() => w ? Vs(Ye.entries, w, tt, n) : {},
|
|
11213
11217
|
[tt, n, Ye.entries, w]
|
|
11214
11218
|
), Pr = G(
|
|
11215
|
-
() => Object.values(
|
|
11216
|
-
[
|
|
11217
|
-
), bo = $ === "color" ? (
|
|
11219
|
+
() => Object.values(zt).reduce((v, D) => v + D, 0),
|
|
11220
|
+
[zt]
|
|
11221
|
+
), bo = $ === "color" ? (zt.color ?? 0) + (zt["color-secondary"] ?? 0) : zt[$] ?? 0, Rr = L((v) => {
|
|
11218
11222
|
const D = Ye.entry(v);
|
|
11219
11223
|
return !!(D && w && Qn(D, w, tt, n));
|
|
11220
11224
|
}, [tt, n, Ye, w]), vo = L((v) => {
|
|
@@ -11223,7 +11227,7 @@ function mh({
|
|
|
11223
11227
|
D && H("revert", mi(D, tt, n), {
|
|
11224
11228
|
address: Be(v)
|
|
11225
11229
|
});
|
|
11226
|
-
}, [tt, H, n, Ye, w]),
|
|
11230
|
+
}, [tt, H, n, Ye, w]), zn = G(
|
|
11227
11231
|
() => w ? Cu({
|
|
11228
11232
|
index: Ye,
|
|
11229
11233
|
state: w,
|
|
@@ -11242,19 +11246,19 @@ function mh({
|
|
|
11242
11246
|
}
|
|
11243
11247
|
const D = Ye.entries.filter((Ce) => Ce.address.tabId === v.id), ee = D.length, he = D.filter((Ce) => mu(Ce, E, w ?? void 0, n)).length;
|
|
11244
11248
|
return { tab: De[v.id] ?? { id: v.id, label: v.label, tiers: [] }, total: ee, matches: he };
|
|
11245
|
-
}), [Ze, n, Ye, E, w, De]),
|
|
11249
|
+
}), [Ze, n, Ye, E, w, De]), _n = L((v) => {
|
|
11246
11250
|
const D = pe.current ? Di(pe.current, v) : null, ee = 'input:not([type="hidden"]), select, textarea, [role="button"]';
|
|
11247
11251
|
(D?.matches(ee) ? D : D?.querySelector(ee))?.focus();
|
|
11248
11252
|
}, []), Yl = L((v) => {
|
|
11249
11253
|
const D = v.tabId === "color-secondary" ? "color" : v.tabId;
|
|
11250
|
-
if (
|
|
11254
|
+
if (z(""), V(D), v.tabId === "palette") {
|
|
11251
11255
|
y(v);
|
|
11252
11256
|
return;
|
|
11253
11257
|
}
|
|
11254
|
-
window.requestAnimationFrame(() =>
|
|
11255
|
-
}, [
|
|
11256
|
-
y(null), window.requestAnimationFrame(() =>
|
|
11257
|
-
}, [
|
|
11258
|
+
window.requestAnimationFrame(() => _n(v));
|
|
11259
|
+
}, [_n]), Jl = L((v) => {
|
|
11260
|
+
y(null), window.requestAnimationFrame(() => _n(v));
|
|
11261
|
+
}, [_n]), Xl = G(() => {
|
|
11258
11262
|
const v = [
|
|
11259
11263
|
{ id: "export", label: "Export", onSelect: () => l(!0) },
|
|
11260
11264
|
{ id: "import", label: "Load from JSON…", onSelect: () => c(!0) },
|
|
@@ -11270,7 +11274,7 @@ function mh({
|
|
|
11270
11274
|
D.id === "notes" || D.id === "color-secondary" || v.push({
|
|
11271
11275
|
id: `reset-${D.id}`,
|
|
11272
11276
|
label: `Reset ${D.label}`,
|
|
11273
|
-
onSelect: () =>
|
|
11277
|
+
onSelect: () => _r(D.id)
|
|
11274
11278
|
});
|
|
11275
11279
|
for (const D of Ze)
|
|
11276
11280
|
D.id !== "color-secondary" && v.push({
|
|
@@ -11283,7 +11287,7 @@ function mh({
|
|
|
11283
11287
|
label: "Highlight settings",
|
|
11284
11288
|
onSelect: () => f(!0)
|
|
11285
11289
|
}), v;
|
|
11286
|
-
}, [Ze, ft,
|
|
11290
|
+
}, [Ze, ft, _r]), Zl = G(
|
|
11287
11291
|
() => ({
|
|
11288
11292
|
"header-actions": [
|
|
11289
11293
|
{
|
|
@@ -11293,14 +11297,14 @@ function mh({
|
|
|
11293
11297
|
ku,
|
|
11294
11298
|
{
|
|
11295
11299
|
query: E,
|
|
11296
|
-
onQueryChange:
|
|
11300
|
+
onQueryChange: z,
|
|
11297
11301
|
onOpenPalette: () => A(!0)
|
|
11298
11302
|
}
|
|
11299
11303
|
)
|
|
11300
11304
|
},
|
|
11301
11305
|
...Tt.map(
|
|
11302
11306
|
(v, D) => ({
|
|
11303
|
-
id: `panel-action-${v.
|
|
11307
|
+
id: `panel-action-${v.id}`,
|
|
11304
11308
|
order: D,
|
|
11305
11309
|
compactAction: v,
|
|
11306
11310
|
render: () => /* @__PURE__ */ i(
|
|
@@ -11310,6 +11314,7 @@ function mh({
|
|
|
11310
11314
|
className: "tokenpanel-action-link",
|
|
11311
11315
|
"aria-disabled": v.disabled,
|
|
11312
11316
|
title: v.disabledReason,
|
|
11317
|
+
"data-zdtp-action": v.id,
|
|
11313
11318
|
children: v.label
|
|
11314
11319
|
}
|
|
11315
11320
|
)
|
|
@@ -11349,7 +11354,7 @@ function mh({
|
|
|
11349
11354
|
render: ({ compact: v }) => v ? /* @__PURE__ */ i(
|
|
11350
11355
|
Ya,
|
|
11351
11356
|
{
|
|
11352
|
-
enabled:
|
|
11357
|
+
enabled: _e,
|
|
11353
11358
|
onChange: mo,
|
|
11354
11359
|
compact: !0
|
|
11355
11360
|
}
|
|
@@ -11428,7 +11433,7 @@ function mh({
|
|
|
11428
11433
|
id: "dom-tweaker",
|
|
11429
11434
|
order: 2,
|
|
11430
11435
|
renderInCompactMenu: !0,
|
|
11431
|
-
render: ({ compact: v }) => /* @__PURE__ */ i(
|
|
11436
|
+
render: ({ compact: v }) => /* @__PURE__ */ i(_p, { compact: v })
|
|
11432
11437
|
}
|
|
11433
11438
|
] : [],
|
|
11434
11439
|
{
|
|
@@ -11504,7 +11509,7 @@ function mh({
|
|
|
11504
11509
|
{
|
|
11505
11510
|
id: "ghost-idle",
|
|
11506
11511
|
order: 0,
|
|
11507
|
-
render: () => /* @__PURE__ */ i(Ya, { enabled:
|
|
11512
|
+
render: () => /* @__PURE__ */ i(Ya, { enabled: _e, onChange: mo })
|
|
11508
11513
|
},
|
|
11509
11514
|
{
|
|
11510
11515
|
id: "changed-only",
|
|
@@ -11540,10 +11545,10 @@ function mh({
|
|
|
11540
11545
|
tt,
|
|
11541
11546
|
B,
|
|
11542
11547
|
bo,
|
|
11543
|
-
|
|
11548
|
+
zt,
|
|
11544
11549
|
Y,
|
|
11545
11550
|
K,
|
|
11546
|
-
|
|
11551
|
+
_e,
|
|
11547
11552
|
fo,
|
|
11548
11553
|
$t,
|
|
11549
11554
|
mo,
|
|
@@ -11574,7 +11579,7 @@ function mh({
|
|
|
11574
11579
|
history: Ie,
|
|
11575
11580
|
railOpen: g,
|
|
11576
11581
|
onUndo: go,
|
|
11577
|
-
onRedo:
|
|
11582
|
+
onRedo: zr,
|
|
11578
11583
|
onToggleRail: () => m((v) => !v)
|
|
11579
11584
|
}
|
|
11580
11585
|
),
|
|
@@ -11583,7 +11588,7 @@ function mh({
|
|
|
11583
11588
|
{
|
|
11584
11589
|
enabled: r,
|
|
11585
11590
|
onUndo: go,
|
|
11586
|
-
onRedo:
|
|
11591
|
+
onRedo: zr,
|
|
11587
11592
|
onFlipSnapshots: Fl
|
|
11588
11593
|
}
|
|
11589
11594
|
),
|
|
@@ -11598,8 +11603,8 @@ function mh({
|
|
|
11598
11603
|
onInspectTabClear: ql,
|
|
11599
11604
|
onJumpToColorTab: Mr,
|
|
11600
11605
|
panelOpen: r,
|
|
11601
|
-
children: /* @__PURE__ */ i(
|
|
11602
|
-
const { width: v, height: D } = ph(
|
|
11606
|
+
children: /* @__PURE__ */ i(zp, { instanceConfig: n, children: /* @__PURE__ */ i(xd, { instanceConfig: n, state: w, children: /* @__PURE__ */ i(Tu, { children: r && (() => {
|
|
11607
|
+
const { width: v, height: D } = ph(_), ee = K === "mini" ? "float" : K, he = ee === "right" ? { position: "fixed", top: 0, right: 0, bottom: 0, left: "auto" } : ee === "bottom" ? { position: "fixed", top: "auto", right: 0, bottom: 0, left: 0 } : { position: "fixed", top: R.top, left: R.left }, Ce = ee === "right" ? ne.right : ee === "bottom" ? "100vw" : v, Se = ee === "bottom" ? ne.bottom : ee === "right" ? "100vh" : D;
|
|
11603
11608
|
return /* @__PURE__ */ h(me, { children: [
|
|
11604
11609
|
K === "mini" ? /* @__PURE__ */ i(
|
|
11605
11610
|
Wp,
|
|
@@ -11634,7 +11639,7 @@ function mh({
|
|
|
11634
11639
|
"--tokenpanel-grid-min": fs(Y)
|
|
11635
11640
|
},
|
|
11636
11641
|
children: [
|
|
11637
|
-
/* @__PURE__ */ i(fh, { enabled:
|
|
11642
|
+
/* @__PURE__ */ i(fh, { enabled: _e, targetRef: pe }),
|
|
11638
11643
|
/* @__PURE__ */ i(Dp, { onMouseDown: Pl }),
|
|
11639
11644
|
/* @__PURE__ */ i(
|
|
11640
11645
|
jp,
|
|
@@ -11647,7 +11652,7 @@ function mh({
|
|
|
11647
11652
|
density: Y,
|
|
11648
11653
|
onDensityChange: fo,
|
|
11649
11654
|
open: r,
|
|
11650
|
-
changedCounts:
|
|
11655
|
+
changedCounts: zt
|
|
11651
11656
|
}
|
|
11652
11657
|
),
|
|
11653
11658
|
/* @__PURE__ */ i(
|
|
@@ -11679,7 +11684,7 @@ function mh({
|
|
|
11679
11684
|
persistColor: We,
|
|
11680
11685
|
secondaryTab: De["color-secondary"] ?? null,
|
|
11681
11686
|
secondaryState: w.secondary ?? Kt(n) ?? null,
|
|
11682
|
-
persistSecondary:
|
|
11687
|
+
persistSecondary: zl,
|
|
11683
11688
|
instanceConfig: n,
|
|
11684
11689
|
tabOverrides: w.tabs ?? {},
|
|
11685
11690
|
searchQuery: E,
|
|
@@ -11695,8 +11700,8 @@ function mh({
|
|
|
11695
11700
|
state: w.spacing,
|
|
11696
11701
|
persistSpacing: ct,
|
|
11697
11702
|
searchQuery: E,
|
|
11698
|
-
onBulkApply:
|
|
11699
|
-
changedContribution:
|
|
11703
|
+
onBulkApply: _l,
|
|
11704
|
+
changedContribution: zn,
|
|
11700
11705
|
changedOnly: B
|
|
11701
11706
|
}
|
|
11702
11707
|
),
|
|
@@ -11711,7 +11716,7 @@ function mh({
|
|
|
11711
11716
|
onRenderOnPageChange: Ol,
|
|
11712
11717
|
searchQuery: E,
|
|
11713
11718
|
onBulkApply: Al,
|
|
11714
|
-
changedContribution:
|
|
11719
|
+
changedContribution: zn,
|
|
11715
11720
|
changedOnly: B
|
|
11716
11721
|
}
|
|
11717
11722
|
),
|
|
@@ -11723,7 +11728,7 @@ function mh({
|
|
|
11723
11728
|
persistSize: Et,
|
|
11724
11729
|
searchQuery: E,
|
|
11725
11730
|
onBulkApply: Ll,
|
|
11726
|
-
changedContribution:
|
|
11731
|
+
changedContribution: zn,
|
|
11727
11732
|
changedOnly: B
|
|
11728
11733
|
}
|
|
11729
11734
|
),
|
|
@@ -11764,7 +11769,7 @@ function mh({
|
|
|
11764
11769
|
overrides: w.tabs?.[ge.id] ?? {},
|
|
11765
11770
|
searchQuery: E,
|
|
11766
11771
|
onBulkApply: (Ae) => Ml(ge.id, Ae),
|
|
11767
|
-
changedContribution:
|
|
11772
|
+
changedContribution: zn,
|
|
11768
11773
|
changedOnly: B,
|
|
11769
11774
|
onChange: (Ae, He, Ke) => {
|
|
11770
11775
|
Zt(ge.id, (Ue) => {
|
|
@@ -12200,7 +12205,7 @@ function af(e) {
|
|
|
12200
12205
|
const t = Il();
|
|
12201
12206
|
Ih(t), t.adapter = e, e ? Th(t, e) : Tl(t);
|
|
12202
12207
|
}
|
|
12203
|
-
const
|
|
12208
|
+
const zh = () => {
|
|
12204
12209
|
El(), Bt();
|
|
12205
12210
|
};
|
|
12206
12211
|
if (typeof window < "u") {
|
|
@@ -12209,7 +12214,7 @@ if (typeof window < "u") {
|
|
|
12209
12214
|
show: Nh,
|
|
12210
12215
|
hide: Ch,
|
|
12211
12216
|
toggle: Sh
|
|
12212
|
-
}), e.bound || (e.bound = !0, Tl(e), $s(
|
|
12217
|
+
}), e.bound || (e.bound = !0, Tl(e), $s(zh));
|
|
12213
12218
|
}
|
|
12214
12219
|
export {
|
|
12215
12220
|
Ui as A,
|