@lotics/cli 0.213.0 → 0.215.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/probe_page.js +56 -12
- package/dist/src/cli.js +365 -102
- package/package.json +1 -1
package/dist/probe_page.js
CHANGED
|
@@ -33,6 +33,7 @@ var __loticsProbe = (() => {
|
|
|
33
33
|
paintState: () => paintState,
|
|
34
34
|
recordRows: () => recordRows,
|
|
35
35
|
rings: () => rings,
|
|
36
|
+
route: () => route,
|
|
36
37
|
run: () => run,
|
|
37
38
|
screens: () => screens,
|
|
38
39
|
surfaceReport: () => surfaceReport,
|
|
@@ -697,6 +698,7 @@ var __loticsProbe = (() => {
|
|
|
697
698
|
const skipTag = /^(SCRIPT|STYLE|TITLE|META|LINK|NOSCRIPT|TEMPLATE)$/;
|
|
698
699
|
const chrome = 'nav, [role="banner"]';
|
|
699
700
|
const recordSurface = '.lotics-record-page, [role="dialog"]';
|
|
701
|
+
const headings = 'h1, h2, h3, h4, h5, h6, [role="heading"]';
|
|
700
702
|
const noteFloor = 3;
|
|
701
703
|
const formFloor = 3;
|
|
702
704
|
const hueStep = 30;
|
|
@@ -705,16 +707,27 @@ var __loticsProbe = (() => {
|
|
|
705
707
|
const sameEdge = 8;
|
|
706
708
|
const words3 = (el) => el === null ? "" : (el.textContent || "").trim().slice(0, 40);
|
|
707
709
|
const surfaces = within(root, recordSurface).filter(onScreen);
|
|
708
|
-
const called2 = (el) => el.matches(recordSurface) ? words3(el.querySelector(".lotics-record-page__heading, h1, h2")) || "the record" : "the screen";
|
|
710
|
+
const called2 = (el) => el.matches(headings) ? words3(el) || "the section" : el.matches(recordSurface) ? words3(el.querySelector(".lotics-record-page__heading, h1, h2")) || "the record" : "the screen";
|
|
709
711
|
const rules = [];
|
|
710
712
|
const primary = '[data-variant="primary"]';
|
|
711
713
|
const acts = within(root, primary).filter(
|
|
712
714
|
(el) => onScreen(el) && el.closest(chrome) === null && (el.parentElement === null || el.parentElement.closest(primary) === null)
|
|
713
715
|
);
|
|
714
716
|
const page = within(root, '[role="main"], main')[0] ?? root;
|
|
717
|
+
const titled = /* @__PURE__ */ new Map();
|
|
715
718
|
const held = /* @__PURE__ */ new Map();
|
|
716
719
|
for (const act of acts) {
|
|
717
|
-
const
|
|
720
|
+
const surface = act.closest(recordSurface) ?? page;
|
|
721
|
+
let titles = titled.get(surface);
|
|
722
|
+
if (titles === void 0) {
|
|
723
|
+
titles = within(surface, headings).filter(onScreen);
|
|
724
|
+
titled.set(surface, titles);
|
|
725
|
+
}
|
|
726
|
+
let owner = surface;
|
|
727
|
+
for (const title of titles) {
|
|
728
|
+
if (title.contains(act)) continue;
|
|
729
|
+
if ((title.compareDocumentPosition(act) & Node.DOCUMENT_POSITION_FOLLOWING) !== 0) owner = title;
|
|
730
|
+
}
|
|
718
731
|
const run2 = held.get(owner);
|
|
719
732
|
if (run2 === void 0) held.set(owner, [act]);
|
|
720
733
|
else run2.push(act);
|
|
@@ -805,14 +818,20 @@ var __loticsProbe = (() => {
|
|
|
805
818
|
let standing = 0;
|
|
806
819
|
const open = [];
|
|
807
820
|
for (const surface of surfaces) {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
821
|
+
for (const block of within(surface, ".lotics-record-facts")) {
|
|
822
|
+
const fold = block.querySelector(".lotics-record-facts__more");
|
|
823
|
+
if (fold === null) continue;
|
|
824
|
+
for (const band of Array.from(block.querySelectorAll(".lotics-record-facts__group"))) {
|
|
825
|
+
if ((fold.compareDocumentPosition(band) & Node.DOCUMENT_POSITION_FOLLOWING) === 0) continue;
|
|
826
|
+
for (const cell of Array.from(band.querySelectorAll(".lotics-record-facts__fact"))) {
|
|
827
|
+
const value = cell.querySelector(".lotics-record-facts__value");
|
|
828
|
+
if (value === null || !onScreen(cell)) continue;
|
|
829
|
+
facts += 1;
|
|
830
|
+
if (!absent.test((value.textContent || "").trim())) continue;
|
|
831
|
+
standing += 1;
|
|
832
|
+
if (open.length < 3) open.push(`"${words3(cell.querySelector(".lotics-record-facts__label")) || words3(cell)}" is unstated and drawn`);
|
|
833
|
+
}
|
|
834
|
+
}
|
|
816
835
|
}
|
|
817
836
|
}
|
|
818
837
|
rules.push({
|
|
@@ -1954,6 +1973,28 @@ var __loticsProbe = (() => {
|
|
|
1954
1973
|
if ((el.textContent || "").trim() !== "") return false;
|
|
1955
1974
|
return (el.getAttribute("aria-label") || "").trim() !== "";
|
|
1956
1975
|
}
|
|
1976
|
+
function route() {
|
|
1977
|
+
return location.pathname;
|
|
1978
|
+
}
|
|
1979
|
+
function partyLinks() {
|
|
1980
|
+
const here = location.pathname + location.search;
|
|
1981
|
+
const doors2 = recordLinks();
|
|
1982
|
+
for (const door of doors2) {
|
|
1983
|
+
const row = isEmptyDoor(door) ? door.parentElement : door;
|
|
1984
|
+
if (row === null) continue;
|
|
1985
|
+
const links = Array.from(row.querySelectorAll('[role="link"], a[href]')).filter((link) => {
|
|
1986
|
+
if (!onScreen(link) || isChrome(link)) return false;
|
|
1987
|
+
if (doors2.some((other) => other === link)) return false;
|
|
1988
|
+
if (link.getAttribute("aria-haspopup") !== null || link.getAttribute("aria-expanded") !== null) return false;
|
|
1989
|
+
const href = link.getAttribute("href");
|
|
1990
|
+
if (href === null) return true;
|
|
1991
|
+
if (href === "" || href.startsWith("http") || href.startsWith("#")) return false;
|
|
1992
|
+
return href !== here;
|
|
1993
|
+
});
|
|
1994
|
+
if (links.length > 0) return links;
|
|
1995
|
+
}
|
|
1996
|
+
return [];
|
|
1997
|
+
}
|
|
1957
1998
|
function doorElements() {
|
|
1958
1999
|
const open = Array.from(document.querySelectorAll(OVERLAY_ROLES)).filter(onScreen);
|
|
1959
2000
|
const reachable = (el) => onScreen(el) && !isChrome(el) && el.getAttribute("aria-disabled") !== "true" && !(el instanceof HTMLButtonElement && el.disabled) && // NEVER A CONTROL INSIDE AN OPEN OVERLAY. A dialog's own buttons are the
|
|
@@ -1963,6 +2004,7 @@ var __loticsProbe = (() => {
|
|
|
1963
2004
|
const records = recordLinks().filter(
|
|
1964
2005
|
(el) => reachable(el) && el.getAttribute("aria-expanded") === null && el.getAttribute("aria-haspopup") === null
|
|
1965
2006
|
);
|
|
2007
|
+
const parties = partyLinks().filter(reachable);
|
|
1966
2008
|
const menus = Array.from(document.querySelectorAll("[aria-haspopup]")).filter(
|
|
1967
2009
|
(el) => reachable(el) && el.getAttribute("aria-expanded") !== "true"
|
|
1968
2010
|
);
|
|
@@ -1985,11 +2027,13 @@ var __loticsProbe = (() => {
|
|
|
1985
2027
|
return [
|
|
1986
2028
|
// One of each state-changing kind — the first row, the acts menu, the first
|
|
1987
2029
|
// fold. A second of any is the same surface again; the acts a screen offers
|
|
1988
|
-
// are not, so every one of those is walked
|
|
2030
|
+
// are not, so every one of those is walked, and neither are the PARTIES a
|
|
2031
|
+
// row names — each column names a different one.
|
|
1989
2032
|
...records.slice(0, 1).map((el) => ({ kind: "record", el })),
|
|
1990
2033
|
...menus.slice(0, 1).map((el) => ({ kind: "menu", el })),
|
|
1991
2034
|
...folds.slice(0, 1).map((el) => ({ kind: "fold", el })),
|
|
1992
|
-
...acts.map((el) => ({ kind: "dialog", el }))
|
|
2035
|
+
...acts.map((el) => ({ kind: "dialog", el })),
|
|
2036
|
+
...parties.map((el) => ({ kind: "party", el }))
|
|
1993
2037
|
];
|
|
1994
2038
|
}
|
|
1995
2039
|
function doors() {
|