@lotics/cli 0.256.0 → 0.257.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 +33 -22
- package/dist/src/cli.js +25375 -23712
- package/dist/src/client.d.ts +12 -1
- package/dist/src/client.js +2 -1
- package/docs/cli_reference.md +7 -7
- package/package.json +1 -1
package/dist/probe_page.js
CHANGED
|
@@ -712,13 +712,14 @@ var __loticsProbe = (() => {
|
|
|
712
712
|
}
|
|
713
713
|
|
|
714
714
|
// src/probe_collectors/anatomy.ts
|
|
715
|
-
var
|
|
715
|
+
var RECORD_FRAME = ".lotics-record-frame";
|
|
716
|
+
var SECTION_PAGES = `${RECORD_FRAME} nav [role="link"], ${RECORD_FRAME}__link [role="link"]`;
|
|
716
717
|
var HEADER = ".lotics-record-header";
|
|
717
718
|
var BLOCK = ".lotics-record-frame__block";
|
|
718
719
|
var PRIMARY = '.lotics-button[data-variant="primary"]';
|
|
719
|
-
var FIELD = `${
|
|
720
|
+
var FIELD = `${RECORD_FRAME}__fields .lotics-form-field, .lotics-fact-groups__field`;
|
|
720
721
|
function surfaces(root) {
|
|
721
|
-
return within(root,
|
|
722
|
+
return within(root, RECORD_FRAME).filter(onScreen).map((frame) => {
|
|
722
723
|
const head = frame.closest(".lotics-drawer__popup") ?? frame;
|
|
723
724
|
const title = within(head, `${HEADER}__title`).find(onScreen);
|
|
724
725
|
return { frame, root: head, name: words2(title) || nameOf(head) || "(unnamed record)" };
|
|
@@ -2183,10 +2184,10 @@ var __loticsProbe = (() => {
|
|
|
2183
2184
|
item.click();
|
|
2184
2185
|
return true;
|
|
2185
2186
|
}
|
|
2186
|
-
function recordLinks() {
|
|
2187
|
+
function recordLinks(surface) {
|
|
2187
2188
|
const here = location.pathname + location.search;
|
|
2188
2189
|
const doors2 = Array.from(
|
|
2189
|
-
|
|
2190
|
+
surface.querySelectorAll('a[href], [data-opens="page"], [data-opens="event"], button, [role="button"], [role="link"]')
|
|
2190
2191
|
).filter((door) => door.matches('a[href], [data-opens="page"], [data-opens="event"]') || isEmptyDoor(door));
|
|
2191
2192
|
return doors2.filter((door) => {
|
|
2192
2193
|
if (door.closest('nav, [role="banner"], [role="tablist"]') !== null) return false;
|
|
@@ -2200,14 +2201,20 @@ var __loticsProbe = (() => {
|
|
|
2200
2201
|
});
|
|
2201
2202
|
}
|
|
2202
2203
|
function recordRows() {
|
|
2203
|
-
|
|
2204
|
+
const surface = workedSurface();
|
|
2205
|
+
return surface === null ? [] : recordLinks(surface).map(doorName);
|
|
2204
2206
|
}
|
|
2205
2207
|
function openRecord(index) {
|
|
2206
|
-
const
|
|
2208
|
+
const surface = workedSurface();
|
|
2209
|
+
const door = surface === null ? void 0 : recordLinks(surface)[index];
|
|
2207
2210
|
if (door === void 0) return false;
|
|
2208
2211
|
door.click();
|
|
2209
2212
|
return true;
|
|
2210
2213
|
}
|
|
2214
|
+
function workedSurface() {
|
|
2215
|
+
const surface = measuredSurface();
|
|
2216
|
+
return surface === document.body || within(surface, RECORD_FRAME).length > 0 ? surface : null;
|
|
2217
|
+
}
|
|
2211
2218
|
var OVERLAY_ROLES = '[role="dialog"], [role="alertdialog"], [role="menu"], [role="listbox"]';
|
|
2212
2219
|
var NEVER_PRESS = /delete|remove|archive|discard|revoke|unlink|detach|cancel|reset|clear|approve|reject|send|publish|\bpay|submit|confirm|void|deactivate|disable|merge|overwrite|\bsign\b|issue|export|download|print|\bsave\b|\bapply\b/i;
|
|
2213
2220
|
var NEVER_PRESS_VI_WORDS = [
|
|
@@ -2252,9 +2259,9 @@ var __loticsProbe = (() => {
|
|
|
2252
2259
|
function route() {
|
|
2253
2260
|
return location.pathname;
|
|
2254
2261
|
}
|
|
2255
|
-
function partyLinks() {
|
|
2262
|
+
function partyLinks(surface) {
|
|
2256
2263
|
const here = location.pathname + location.search;
|
|
2257
|
-
const doors2 = recordLinks();
|
|
2264
|
+
const doors2 = recordLinks(surface);
|
|
2258
2265
|
for (const door of doors2) {
|
|
2259
2266
|
const row = isEmptyDoor(door) ? door.parentElement : door;
|
|
2260
2267
|
if (row === null) continue;
|
|
@@ -2272,26 +2279,29 @@ var __loticsProbe = (() => {
|
|
|
2272
2279
|
return [];
|
|
2273
2280
|
}
|
|
2274
2281
|
function doorElements() {
|
|
2275
|
-
const
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
const
|
|
2282
|
+
const surface = workedSurface();
|
|
2283
|
+
if (surface === null) return [];
|
|
2284
|
+
const open = Array.from(document.querySelectorAll(OVERLAY_ROLES)).filter(
|
|
2285
|
+
(overlay) => onScreen(overlay) && overlay !== surface && !overlay.contains(surface)
|
|
2286
|
+
);
|
|
2287
|
+
const inFront = (el) => surface.contains(el) && onScreen(el) && !open.some((overlay) => overlay.contains(el));
|
|
2288
|
+
const reachable = (el) => inFront(el) && !isChrome(el) && el.getAttribute("aria-disabled") !== "true" && !(el instanceof HTMLButtonElement && el.disabled);
|
|
2289
|
+
const records = recordLinks(surface).filter(
|
|
2281
2290
|
(el) => reachable(el) && el.getAttribute("aria-expanded") === null && el.getAttribute("aria-haspopup") === null
|
|
2282
2291
|
);
|
|
2283
|
-
const parties = partyLinks().filter(reachable);
|
|
2284
|
-
const menus = Array.from(
|
|
2292
|
+
const parties = partyLinks(surface).filter(reachable);
|
|
2293
|
+
const menus = Array.from(surface.querySelectorAll("[aria-haspopup]")).filter(
|
|
2285
2294
|
(el) => reachable(el) && el.getAttribute("aria-expanded") !== "true"
|
|
2286
2295
|
);
|
|
2287
|
-
const folds = Array.from(
|
|
2296
|
+
const folds = Array.from(surface.querySelectorAll('[aria-expanded="false"]')).filter(
|
|
2288
2297
|
(el) => reachable(el) && el.getAttribute("aria-haspopup") === null
|
|
2289
2298
|
);
|
|
2290
|
-
const tabs = Array.from(
|
|
2291
|
-
(el) =>
|
|
2299
|
+
const tabs = Array.from(surface.querySelectorAll('[role="tab"][aria-selected="false"]')).filter(
|
|
2300
|
+
(el) => inFront(el) && el.closest('nav, [role="banner"]') === null
|
|
2292
2301
|
);
|
|
2302
|
+
const sections = within(surface, SECTION_PAGES).filter((el) => el instanceof HTMLElement && inFront(el));
|
|
2293
2303
|
const acts = Array.from(
|
|
2294
|
-
|
|
2304
|
+
surface.querySelectorAll('[data-variant="primary"], [data-variant="secondary"]')
|
|
2295
2305
|
).filter((el) => {
|
|
2296
2306
|
if (!reachable(el)) return false;
|
|
2297
2307
|
if (el.tagName !== "BUTTON" && el.getAttribute("role") !== "button") return false;
|
|
@@ -2313,7 +2323,8 @@ var __loticsProbe = (() => {
|
|
|
2313
2323
|
...folds.slice(0, 1).map((el) => ({ kind: "fold", el })),
|
|
2314
2324
|
...acts.map((el) => ({ kind: "dialog", el })),
|
|
2315
2325
|
...parties.map((el) => ({ kind: "party", el })),
|
|
2316
|
-
...tabs.map((el) => ({ kind: "tab", el }))
|
|
2326
|
+
...tabs.map((el) => ({ kind: "tab", el })),
|
|
2327
|
+
...sections.map((el) => ({ kind: "section", el }))
|
|
2317
2328
|
];
|
|
2318
2329
|
}
|
|
2319
2330
|
function doors() {
|