@lotics/cli 0.247.0 → 0.251.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 +9 -43
- package/dist/src/cli.js +7359 -366
- package/docs/building_an_app.md +3 -3
- package/docs/cli_reference.md +4 -4
- package/docs/migration.md +20 -5
- package/package.json +1 -1
package/dist/probe_page.js
CHANGED
|
@@ -716,13 +716,7 @@ var __loticsProbe = (() => {
|
|
|
716
716
|
var HEADER = ".lotics-record-header";
|
|
717
717
|
var BLOCK = ".lotics-record-frame__block";
|
|
718
718
|
var PRIMARY = '.lotics-button[data-variant="primary"]';
|
|
719
|
-
var
|
|
720
|
-
{ width: 1280, height: 800 },
|
|
721
|
-
{ width: 375, height: 667 }
|
|
722
|
-
];
|
|
723
|
-
function firstViewport(width) {
|
|
724
|
-
return FIRST_VIEWPORTS.reduce((near, one) => Math.abs(one.width - width) < Math.abs(near.width - width) ? one : near);
|
|
725
|
-
}
|
|
719
|
+
var FIELD = `${FRAME}__fields .lotics-form-field, .lotics-fact-groups__field`;
|
|
726
720
|
function surfaces(root) {
|
|
727
721
|
return within(root, FRAME).filter(onScreen).map((frame) => {
|
|
728
722
|
const head = frame.closest(".lotics-drawer__popup") ?? frame;
|
|
@@ -738,21 +732,10 @@ var __loticsProbe = (() => {
|
|
|
738
732
|
function headingPrimaries(root = document.body) {
|
|
739
733
|
const drawn = surfaces(root);
|
|
740
734
|
const loud = drawn.flatMap(
|
|
741
|
-
(surface) => within(surface.frame, PRIMARY).filter(
|
|
742
|
-
(act) => onScreen(act) && act.closest(BLOCK) !== null && (act.closest(`${FRAME}__action`) !== null || act.closest(".lotics-section-heading") !== null)
|
|
743
|
-
).map((act) => ({ record: surface.name, act: nameOf(act) || words2(act) }))
|
|
735
|
+
(surface) => within(surface.frame, PRIMARY).filter((act) => onScreen(act) && act.closest(BLOCK) !== null && act.closest(".lotics-section-heading") !== null).map((act) => ({ record: surface.name, act: nameOf(act) || words2(act) }))
|
|
744
736
|
);
|
|
745
737
|
return { total: drawn.length, loud };
|
|
746
738
|
}
|
|
747
|
-
function actsBelowFold(root = document.body, width = window.innerWidth) {
|
|
748
|
-
const fold = firstViewport(width).height;
|
|
749
|
-
const acts = surfaces(root).flatMap((surface) => {
|
|
750
|
-
const seat = within(surface.frame, `${FRAME}__act`).find(onScreen);
|
|
751
|
-
const button = seat === void 0 ? void 0 : within(seat, ".lotics-button").find(onScreen);
|
|
752
|
-
return button === void 0 ? [] : [{ record: surface.name, act: nameOf(button) || words2(button), bottom: Math.round(button.getBoundingClientRect().bottom) }];
|
|
753
|
-
});
|
|
754
|
-
return { total: acts.length, fold, below: acts.filter((one) => one.bottom > fold) };
|
|
755
|
-
}
|
|
756
739
|
function factRepeats(root = document.body) {
|
|
757
740
|
let total = 0;
|
|
758
741
|
const repeated = surfaces(root).flatMap((surface) => {
|
|
@@ -761,7 +744,7 @@ var __loticsProbe = (() => {
|
|
|
761
744
|
const head = new Set(
|
|
762
745
|
within(header, "*").filter((el) => el.childElementCount === 0 && el.closest('button, [role="button"], [role="menu"]') === null && onScreen(el)).map((el) => said(words2(el))).filter((text) => text.length > 1)
|
|
763
746
|
);
|
|
764
|
-
const fields = within(surface.frame,
|
|
747
|
+
const fields = within(surface.frame, FIELD).filter((field) => onScreen(field) && !header.contains(field));
|
|
765
748
|
total += fields.length;
|
|
766
749
|
return fields.flatMap((field) => {
|
|
767
750
|
const label = within(field, ".lotics-form-field__label")[0];
|
|
@@ -777,10 +760,8 @@ var __loticsProbe = (() => {
|
|
|
777
760
|
const blocks = within(surface.frame, BLOCK).filter(onScreen);
|
|
778
761
|
total += blocks.length;
|
|
779
762
|
return blocks.flatMap((block) => {
|
|
780
|
-
const body = Array.from(block.children).filter(
|
|
781
|
-
|
|
782
|
-
);
|
|
783
|
-
const drawn = body.some((child) => words2(child) !== "" || child.querySelector("img, svg, input, textarea, button") !== null);
|
|
763
|
+
const body = Array.from(block.children).filter((child) => !child.matches(".lotics-section-heading") && onScreen(child));
|
|
764
|
+
const drawn = body.some((child) => words2(child) !== "" || child.querySelector("img, svg, input, textarea, button, [contenteditable]") !== null);
|
|
784
765
|
return drawn ? [] : [{ record: surface.name, block: block.getAttribute("aria-label") ?? "" }];
|
|
785
766
|
});
|
|
786
767
|
});
|
|
@@ -1075,7 +1056,7 @@ var __loticsProbe = (() => {
|
|
|
1075
1056
|
var CONTROL = 'a[href], button, summary, [role="button"], [role="link"], [role="menuitem"], [role="tab"], [role="checkbox"], [role="switch"]';
|
|
1076
1057
|
var NAVIGATION = 'nav, [role="navigation"], [role="banner"]';
|
|
1077
1058
|
var EDITOR = 'input, textarea, select, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"], [role="textbox"], [role="searchbox"], [role="combobox"], [role="spinbutton"]';
|
|
1078
|
-
var
|
|
1059
|
+
var FIELD2 = EDITOR + ', [role="checkbox"], [role="switch"], [role="radio"], [role="slider"]';
|
|
1079
1060
|
var GROUP = '[role="group"], fieldset';
|
|
1080
1061
|
var TEXT_ENTRY = /* @__PURE__ */ new Set([
|
|
1081
1062
|
"text",
|
|
@@ -1177,7 +1158,7 @@ var __loticsProbe = (() => {
|
|
|
1177
1158
|
offenders: badges
|
|
1178
1159
|
});
|
|
1179
1160
|
const editors = editorsIn(root);
|
|
1180
|
-
const fieldsIn = (box) => within(box,
|
|
1161
|
+
const fieldsIn = (box) => within(box, FIELD2).filter(onScreen);
|
|
1181
1162
|
const labelsIn = (box) => within(box, "label").filter((el) => onScreen(el) && words3(el) !== "");
|
|
1182
1163
|
const oneControl = (el) => el.matches(GROUP) || (el.getAttribute("aria-label") || "").trim() !== "" || (el.getAttribute("aria-labelledby") || "").trim() !== "";
|
|
1183
1164
|
const around = (outer, inner) => outer.left <= inner.left + HAIR && outer.top <= inner.top + HAIR && outer.right + HAIR >= inner.right && outer.bottom + HAIR >= inner.bottom;
|
|
@@ -1858,12 +1839,7 @@ var __loticsProbe = (() => {
|
|
|
1858
1839
|
record_primary: {
|
|
1859
1840
|
law: "hierarchy.md",
|
|
1860
1841
|
section: "One primary act per surface",
|
|
1861
|
-
fix: "Draw a block's add secondary: the record's
|
|
1862
|
-
},
|
|
1863
|
-
act_fold: {
|
|
1864
|
-
law: "hierarchy.md",
|
|
1865
|
-
section: "Budgets a reviewer can count",
|
|
1866
|
-
fix: "Seat the open act where the frame pins it \u2014 `RecordFrame`'s `act`, never a button of the page's own \u2014 so it stays in view while the facts run on."
|
|
1842
|
+
fix: "Draw a block's add secondary: the record's primaries are its acts \u2014 the next step at a section's foot."
|
|
1867
1843
|
},
|
|
1868
1844
|
fact_repeats: {
|
|
1869
1845
|
law: "hierarchy.md",
|
|
@@ -2105,17 +2081,7 @@ var __loticsProbe = (() => {
|
|
|
2105
2081
|
...signature("record_primary"),
|
|
2106
2082
|
total: primaries.total,
|
|
2107
2083
|
count: primaries.loud.length,
|
|
2108
|
-
detail: primaries.loud.slice(0, 5).map((one) => `"${one.record}": "${one.act}" is primary in a block's heading row, beside the record's
|
|
2109
|
-
});
|
|
2110
|
-
}
|
|
2111
|
-
const folded = actsBelowFold(surface);
|
|
2112
|
-
if (folded.below.length > 0) {
|
|
2113
|
-
findings.push({
|
|
2114
|
-
probe: "act_fold",
|
|
2115
|
-
...signature("act_fold"),
|
|
2116
|
-
total: folded.total,
|
|
2117
|
-
count: folded.below.length,
|
|
2118
|
-
detail: folded.below.slice(0, 5).map((one) => `"${one.record}": "${one.act}" ends at ${one.bottom}px, past the ${folded.fold}px first viewport`)
|
|
2084
|
+
detail: primaries.loud.slice(0, 5).map((one) => `"${one.record}": "${one.act}" is primary in a block's heading row, beside the record's own acts`)
|
|
2119
2085
|
});
|
|
2120
2086
|
}
|
|
2121
2087
|
const repeats = factRepeats(surface);
|