@simplysf/simply-utam-core 0.2.0 → 0.3.1
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/README.md +72 -16
- package/lib/forceignore/forceignore-manager.d.ts +30 -0
- package/lib/forceignore/forceignore-manager.js +28 -10
- package/lib/forceignore/forceignore-manager.js.map +1 -1
- package/lib/forceignore/index.d.ts +1 -1
- package/lib/forceignore/index.js +1 -1
- package/lib/forceignore/index.js.map +1 -1
- package/lib/gitignore/gitignore-manager.d.ts +64 -0
- package/lib/gitignore/gitignore-manager.js +96 -0
- package/lib/gitignore/gitignore-manager.js.map +1 -0
- package/lib/gitignore/index.d.ts +1 -0
- package/lib/gitignore/index.js +17 -0
- package/lib/gitignore/index.js.map +1 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.js +3 -1
- package/lib/index.js.map +1 -1
- package/lib/namespaces/namespace-map.d.ts +18 -0
- package/lib/namespaces/namespace-map.js +75 -0
- package/lib/namespaces/namespace-map.js.map +1 -0
- package/lib/namespaces/namespace-rewriter.js +2 -47
- package/lib/namespaces/namespace-rewriter.js.map +1 -1
- package/lib/scaffold/project-scaffolder.d.ts +26 -1
- package/lib/scaffold/project-scaffolder.js +81 -11
- package/lib/scaffold/project-scaffolder.js.map +1 -1
- package/lib/snapshot/capture.d.ts +56 -0
- package/lib/snapshot/capture.js +115 -0
- package/lib/snapshot/capture.js.map +1 -0
- package/lib/snapshot/console.d.ts +25 -0
- package/lib/snapshot/console.js +74 -0
- package/lib/snapshot/console.js.map +1 -0
- package/lib/snapshot/describe.d.ts +27 -0
- package/lib/snapshot/describe.js +76 -0
- package/lib/snapshot/describe.js.map +1 -0
- package/lib/snapshot/files.d.ts +85 -0
- package/lib/snapshot/files.js +185 -0
- package/lib/snapshot/files.js.map +1 -0
- package/lib/snapshot/find.d.ts +36 -0
- package/lib/snapshot/find.js +186 -0
- package/lib/snapshot/find.js.map +1 -0
- package/lib/snapshot/format.d.ts +96 -0
- package/lib/snapshot/format.js +100 -0
- package/lib/snapshot/format.js.map +1 -0
- package/lib/snapshot/header.d.ts +38 -0
- package/lib/snapshot/header.js +120 -0
- package/lib/snapshot/header.js.map +1 -0
- package/lib/snapshot/index.d.ts +13 -0
- package/lib/snapshot/index.js +28 -0
- package/lib/snapshot/index.js.map +1 -0
- package/lib/snapshot/locate.d.ts +61 -0
- package/lib/snapshot/locate.js +110 -0
- package/lib/snapshot/locate.js.map +1 -0
- package/lib/snapshot/lookup.d.ts +53 -0
- package/lib/snapshot/lookup.js +188 -0
- package/lib/snapshot/lookup.js.map +1 -0
- package/lib/snapshot/page-object-index.d.ts +149 -0
- package/lib/snapshot/page-object-index.js +806 -0
- package/lib/snapshot/page-object-index.js.map +1 -0
- package/lib/snapshot/page-object-packages.d.ts +41 -0
- package/lib/snapshot/page-object-packages.js +115 -0
- package/lib/snapshot/page-object-packages.js.map +1 -0
- package/lib/snapshot/path.d.ts +102 -0
- package/lib/snapshot/path.js +381 -0
- package/lib/snapshot/path.js.map +1 -0
- package/lib/snapshot/query-result.d.ts +20 -0
- package/lib/snapshot/query-result.js +32 -0
- package/lib/snapshot/query-result.js.map +1 -0
- package/lib/snapshot/selector.d.ts +103 -0
- package/lib/snapshot/selector.js +280 -0
- package/lib/snapshot/selector.js.map +1 -0
- package/lib/snapshot/tree.d.ts +76 -0
- package/lib/snapshot/tree.js +201 -0
- package/lib/snapshot/tree.js.map +1 -0
- package/lib/snapshot/walker.js +532 -0
- package/package.json +12 -4
- package/templates/dom-snapshot.steps.mjs +34 -0
- package/templates/wdio.conf.mjs +81 -4
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { compile } from 'css-select';
|
|
17
|
+
import { DomSnapshotError } from './format.js';
|
|
18
|
+
import { getNode, locate, toFound } from './locate.js';
|
|
19
|
+
/** An own attribute's value, so a name like `constructor` isn't read off the object's prototype. */
|
|
20
|
+
export function attribute(attrs, name) {
|
|
21
|
+
return attrs && Object.hasOwn(attrs, name) ? attrs[name] : undefined;
|
|
22
|
+
}
|
|
23
|
+
/** The adapter, exported for its tests: `compile` uses only part of it, and `selectAll` the rest. */
|
|
24
|
+
export const adapter = {
|
|
25
|
+
isTag: (node) => node !== undefined,
|
|
26
|
+
getName: (node) => node.node.tag,
|
|
27
|
+
getAttributeValue: (node, name) => attribute(node.node.attrs, name),
|
|
28
|
+
hasAttrib: (node, name) => attribute(node.node.attrs, name) !== undefined,
|
|
29
|
+
getChildren: (node) => node.light,
|
|
30
|
+
getParent: (node) => (node.viaShadow ? null : (node.parent ?? null)),
|
|
31
|
+
getSiblings: (node) => (node.parent ? (node.viaShadow ? node.parent.shadow : node.parent.light) : [node]),
|
|
32
|
+
prevElementSibling: (node) => {
|
|
33
|
+
const siblings = adapter.getSiblings(node);
|
|
34
|
+
return siblings[siblings.indexOf(node) - 1] ?? null;
|
|
35
|
+
},
|
|
36
|
+
getText: (node) => [node.node.text, node.node.shadow?.text].filter(Boolean).join(' '),
|
|
37
|
+
removeSubsets: (nodes) => nodes.filter((node) => {
|
|
38
|
+
for (let up = node.parent; up; up = up.viaShadow ? undefined : up.parent)
|
|
39
|
+
if (nodes.includes(up))
|
|
40
|
+
return false;
|
|
41
|
+
return true;
|
|
42
|
+
}),
|
|
43
|
+
existsOne: (test, nodes) => nodes.some((node) => test(node) || adapter.existsOne(test, node.light)),
|
|
44
|
+
findAll: (test, nodes) => nodes.flatMap((node) => [...(test(node) ? [node] : []), ...adapter.findAll(test, node.light)]),
|
|
45
|
+
findOne: (test, nodes) => {
|
|
46
|
+
for (const node of nodes) {
|
|
47
|
+
if (test(node))
|
|
48
|
+
return node;
|
|
49
|
+
const found = adapter.findOne(test, node.light);
|
|
50
|
+
if (found)
|
|
51
|
+
return found;
|
|
52
|
+
}
|
|
53
|
+
return null;
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
// Pseudo-classes about live state that a snapshot can't judge; they're dropped, so the selector may over-match.
|
|
57
|
+
// Longer names come first, and the guard stops `:focus` matching the start of `:focus-within`.
|
|
58
|
+
const LIVE_STATE = /:(focus-within|focus-visible|focus|hover|active|visited|checked)(?![\w-])/g;
|
|
59
|
+
// A live-state pseudo-class that is a whole compound, such as `:hover` in `:hover, a` or `a > :focus`,
|
|
60
|
+
// leaves this mark: any element, or, as a whole argument of `:not()`, `:is()`, `:where()` or `:has()`,
|
|
61
|
+
// nothing, which drops a pseudo-class left with no arguments too.
|
|
62
|
+
const WHOLE_COMPOUND = '\uE001';
|
|
63
|
+
const COMPOUND_START = /[\s>+~,(]/;
|
|
64
|
+
const LOGICAL_PSEUDO = /:(not|is|where|has)\(([^()]*)\)/g;
|
|
65
|
+
// Strings and attribute tests, which the rewrites below must not read as syntax.
|
|
66
|
+
const VALUE = /(["'])(?:\\.|(?!\1).)*\1|\[(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^\]"'])*\]/g;
|
|
67
|
+
const MASKED_VALUE = /\uE000(\d+)\uE000/g;
|
|
68
|
+
/** Rewrite a selector's syntax only: its strings and attribute tests are kept as they are. */
|
|
69
|
+
function outsideValues(selector, rewrite) {
|
|
70
|
+
const values = [];
|
|
71
|
+
const masked = selector.replace(VALUE, (value) => `\uE000${values.push(value) - 1}\uE000`);
|
|
72
|
+
return rewrite(masked).replace(MASKED_VALUE, (_match, i) => values[Number(i)]);
|
|
73
|
+
}
|
|
74
|
+
function dropLiveState(syntax) {
|
|
75
|
+
// Dropped, a pseudo-class that is a whole compound leaves any element in its place.
|
|
76
|
+
const dropped = (offset, whole) => offset === 0 || COMPOUND_START.test(whole[offset - 1]) ? WHOLE_COMPOUND : '';
|
|
77
|
+
let out = syntax.replace(LIVE_STATE, (_match, _name, offset, whole) => dropped(offset, whole));
|
|
78
|
+
let before;
|
|
79
|
+
do {
|
|
80
|
+
before = out;
|
|
81
|
+
out = out.replace(LOGICAL_PSEUDO, (_match, name, args, offset, whole) => {
|
|
82
|
+
const kept = args.split(',').filter((arg) => arg.trim() !== WHOLE_COMPOUND);
|
|
83
|
+
return kept.length > 0 ? `:${name}(${kept.join(',').trim()})` : dropped(offset, whole);
|
|
84
|
+
});
|
|
85
|
+
} while (out !== before);
|
|
86
|
+
return out.replaceAll(WHOLE_COMPOUND, '*');
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Rewrite a page object's selector for the snapshot: `%s`/`%d` placeholders in an attribute test or
|
|
90
|
+
* a child-position argument match any value, and live-state pseudo-classes are dropped. Says what it
|
|
91
|
+
* changed.
|
|
92
|
+
*
|
|
93
|
+
* @param selector The CSS selector, as a page object or a user writes it.
|
|
94
|
+
*/
|
|
95
|
+
export function prepareSelector(selector) {
|
|
96
|
+
const notes = [];
|
|
97
|
+
let out = selector.replace(/\[\s*([\w-]+)\s*[~|^$*]?=\s*(["']?)[^\]]*%[sd][^\]]*\2\s*\]/g, '[$1]');
|
|
98
|
+
out = outsideValues(out, (syntax) => syntax.replace(/(:nth-[\w-]+\()\s*%d\s*\)/g, '$1n)'));
|
|
99
|
+
if (out !== selector)
|
|
100
|
+
notes.push('%s/%d placeholders match any value.');
|
|
101
|
+
const live = new Set();
|
|
102
|
+
outsideValues(out, (syntax) => {
|
|
103
|
+
for (const match of syntax.matchAll(LIVE_STATE))
|
|
104
|
+
live.add(`:${match[1]}`);
|
|
105
|
+
return syntax;
|
|
106
|
+
});
|
|
107
|
+
if (live.size > 0) {
|
|
108
|
+
out = outsideValues(out, dropLiveState);
|
|
109
|
+
notes.push(`Ignored ${[...live].join(', ')}: a snapshot doesn't record live state, so this may over-match.`);
|
|
110
|
+
}
|
|
111
|
+
return { selector: out, notes };
|
|
112
|
+
}
|
|
113
|
+
/** A selector with strings and attribute tests blanked, so a `>` or `.` inside one isn't read as syntax. */
|
|
114
|
+
function blankValues(selector) {
|
|
115
|
+
return selector.replace(/(["'])(?:\\.|(?!\1).)*\1/g, '""').replace(/\[[^\]]*\]/g, '[]');
|
|
116
|
+
}
|
|
117
|
+
/** The tags, classes and ids a selector names, leaving out pseudo-class arguments that aren't selectors. */
|
|
118
|
+
function selectorNames(selector) {
|
|
119
|
+
const bare = blankValues(selector).replace(/:(nth-[\w-]+|lang|dir)\([^)]*\)/g, '');
|
|
120
|
+
const names = (pattern) => [...new Set([...bare.matchAll(pattern)].map((m) => m[1]))];
|
|
121
|
+
return {
|
|
122
|
+
tags: names(/(?:^|[\s>+~,(])([a-zA-Z][\w-]*)/g).map((tag) => tag.toLowerCase()),
|
|
123
|
+
classes: names(/\.(-?[_a-zA-Z][\w-]*)/g),
|
|
124
|
+
ids: names(/#(-?[_a-zA-Z][\w-]*)/g),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
const POSITIONAL = /[>+~]|:(nth-[\w-]+|first-child|last-child|only-child|first-of-type|last-of-type|only-of-type)/;
|
|
128
|
+
/**
|
|
129
|
+
* The plain tags, classes and ids a selector names that no node in the snapshot has. Such a name may be
|
|
130
|
+
* on a plain wrapper the snapshot pruned, so the live page can match where the snapshot doesn't.
|
|
131
|
+
*
|
|
132
|
+
* @param snapshot The snapshot.
|
|
133
|
+
* @param selector The selector, already through {@link prepareSelector}.
|
|
134
|
+
*/
|
|
135
|
+
export function unseenNames(snapshot, selector) {
|
|
136
|
+
const { tags, classes, ids } = selectorNames(selector);
|
|
137
|
+
const seen = seenNames(snapshot);
|
|
138
|
+
return [
|
|
139
|
+
// The walker keeps every custom element, so a custom tag no node has isn't on the page.
|
|
140
|
+
...tags.filter((tag) => !tag.includes('-') && !seen.tags.has(tag)),
|
|
141
|
+
...classes.filter((name) => !seen.classes.has(name)).map((name) => `.${name}`),
|
|
142
|
+
...ids.filter((id) => !seen.ids.has(id)).map((id) => `#${id}`),
|
|
143
|
+
];
|
|
144
|
+
}
|
|
145
|
+
const seenBySnapshot = new WeakMap();
|
|
146
|
+
function seenNames(snapshot) {
|
|
147
|
+
let seen = seenBySnapshot.get(snapshot);
|
|
148
|
+
if (!seen) {
|
|
149
|
+
const nodes = [...locate(snapshot).values()].map((entry) => entry.node);
|
|
150
|
+
seen = {
|
|
151
|
+
tags: new Set(nodes.map((node) => node.tag)),
|
|
152
|
+
classes: new Set(nodes.flatMap((node) => (attribute(node.attrs, 'class') ?? '').split(/\s+/))),
|
|
153
|
+
ids: new Set(nodes.map((node) => attribute(node.attrs, 'id'))),
|
|
154
|
+
};
|
|
155
|
+
seenBySnapshot.set(snapshot, seen);
|
|
156
|
+
}
|
|
157
|
+
return seen;
|
|
158
|
+
}
|
|
159
|
+
/** What the snapshot's pruned wrappers may change about a selector's matches. */
|
|
160
|
+
function prunedNotes(snapshot, selector) {
|
|
161
|
+
const notes = [];
|
|
162
|
+
const unseen = unseenNames(snapshot, selector);
|
|
163
|
+
if (unseen.length > 0)
|
|
164
|
+
notes.push(`No node in this snapshot has ${unseen.join(', ')}: it may be on an element the snapshot pruned (plain wrappers are dropped), so the live page may match differently.`);
|
|
165
|
+
if (POSITIONAL.test(blankValues(selector)))
|
|
166
|
+
notes.push(">, +, ~ and child-position pseudo-classes can match differently on the live page: the snapshot drops plain wrappers, so a node's parent and siblings here may not be its live ones.");
|
|
167
|
+
return notes;
|
|
168
|
+
}
|
|
169
|
+
const compiled = new Map();
|
|
170
|
+
function compiledFor(selector) {
|
|
171
|
+
let test = compiled.get(selector);
|
|
172
|
+
if (!test) {
|
|
173
|
+
try {
|
|
174
|
+
test = compile(selector, { adapter, xmlMode: false, cacheResults: false });
|
|
175
|
+
}
|
|
176
|
+
catch (error) {
|
|
177
|
+
throw new DomSnapshotError(`Can't read selector "${selector}": ${error.message}`);
|
|
178
|
+
}
|
|
179
|
+
compiled.set(selector, test);
|
|
180
|
+
}
|
|
181
|
+
return test;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Whether a node matches a selector, ancestors included, within the node's own tree scope.
|
|
185
|
+
*
|
|
186
|
+
* @param node The node.
|
|
187
|
+
* @param selector The selector, already through {@link prepareSelector}.
|
|
188
|
+
*/
|
|
189
|
+
export function nodeMatchesSelector(node, selector) {
|
|
190
|
+
return compiledFor(selector)(node);
|
|
191
|
+
}
|
|
192
|
+
function scopeNodes(roots) {
|
|
193
|
+
const out = [];
|
|
194
|
+
const walk = (node) => {
|
|
195
|
+
out.push(node);
|
|
196
|
+
for (const child of node.light)
|
|
197
|
+
walk(child);
|
|
198
|
+
};
|
|
199
|
+
for (const root of roots)
|
|
200
|
+
walk(root);
|
|
201
|
+
return out;
|
|
202
|
+
}
|
|
203
|
+
/** The nodes a search in `scope` tests, in document order. */
|
|
204
|
+
function scopeCandidates(snapshot, scope) {
|
|
205
|
+
if (scope.kind === 'document')
|
|
206
|
+
return scopeNodes([locate(snapshot).values().next().value]);
|
|
207
|
+
const host = getNode(snapshot, scope.within);
|
|
208
|
+
if (scope.kind === 'shadow' && host.shadow.length === 0)
|
|
209
|
+
throw new DomSnapshotError(`${scope.within} has no shadow root in this snapshot.`);
|
|
210
|
+
return scopeNodes(scope.kind === 'shadow' ? host.shadow : host.light);
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* The nodes a selector matches in a scope, as {@link matchSelector} finds them but without its notes,
|
|
214
|
+
* and none for a selector that can't be read or a scope that isn't in the snapshot: for checking
|
|
215
|
+
* page objects' selectors, where one that can't be checked is skipped.
|
|
216
|
+
*
|
|
217
|
+
* @param snapshot The snapshot.
|
|
218
|
+
* @param selector The CSS selector, as a page object writes it.
|
|
219
|
+
* @param scope Where to search.
|
|
220
|
+
*/
|
|
221
|
+
export function scopeMatches(snapshot, selector, scope) {
|
|
222
|
+
try {
|
|
223
|
+
const test = compiledFor(prepareSelector(selector).selector);
|
|
224
|
+
return scopeCandidates(snapshot, scope).filter((node) => test(node));
|
|
225
|
+
}
|
|
226
|
+
catch {
|
|
227
|
+
return [];
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Every node a selector matches in a scope, in document order, as `querySelectorAll` would find them:
|
|
232
|
+
* combinators don't cross shadow roots, and ancestors above the scope still count. The first match
|
|
233
|
+
* is the one UTAM's `findElement`, and `utam.load` for a root selector, takes.
|
|
234
|
+
*
|
|
235
|
+
* @param snapshot The snapshot.
|
|
236
|
+
* @param selector The CSS selector, as a page object or a person writes it.
|
|
237
|
+
* @param scope Where to search; the document when omitted.
|
|
238
|
+
*/
|
|
239
|
+
export function querySnapshot(snapshot, selector, scope = { kind: 'document' }) {
|
|
240
|
+
const located = matchSelector(snapshot, selector, scope);
|
|
241
|
+
return { ...located, matches: located.matches.map(toFound) };
|
|
242
|
+
}
|
|
243
|
+
/** Accessible names: `aria` mode keeps them on controls, `labels` and `structure` mask them. */
|
|
244
|
+
const NAME_ATTRIBUTES = ['title', 'aria-label', 'placeholder', 'alt'];
|
|
245
|
+
/** The attributes a selector tests the values of, such as `title` in `[title="Edit"]`. */
|
|
246
|
+
export function testedAttributes(selector) {
|
|
247
|
+
return [...new Set([...selector.matchAll(/\[\s*([\w-]+)\s*[~|^$*]?=/g)].map((m) => m[1]))];
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* For a selector that tests accessible names this snapshot's mask hides, the line telling the reader
|
|
251
|
+
* to recapture with `aria`; undefined otherwise.
|
|
252
|
+
*
|
|
253
|
+
* @param snapshot The snapshot.
|
|
254
|
+
* @param attributes The attributes the selector tests.
|
|
255
|
+
*/
|
|
256
|
+
export function recaptureForNames(snapshot, attributes) {
|
|
257
|
+
const { mask } = snapshot.meta;
|
|
258
|
+
if (mask !== 'labels' && mask !== 'structure')
|
|
259
|
+
return undefined;
|
|
260
|
+
const names = attributes.filter((name) => NAME_ATTRIBUTES.includes(name));
|
|
261
|
+
if (names.length === 0)
|
|
262
|
+
return undefined;
|
|
263
|
+
return `Mask ${mask} hides every ${names.map((name) => `[${name}]`).join(', ')} value. To check them on controls, recapture with UTAM_SNAPSHOT_MASK=aria.`;
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* {@link querySnapshot}, keeping the located nodes.
|
|
267
|
+
*
|
|
268
|
+
* @param snapshot The snapshot.
|
|
269
|
+
* @param selector The CSS selector.
|
|
270
|
+
* @param scope Where to search; the document when omitted.
|
|
271
|
+
*/
|
|
272
|
+
export function matchSelector(snapshot, selector, scope = { kind: 'document' }) {
|
|
273
|
+
const prepared = prepareSelector(selector);
|
|
274
|
+
const test = compiledFor(prepared.selector);
|
|
275
|
+
const candidates = scopeCandidates(snapshot, scope);
|
|
276
|
+
const matches = candidates.filter((node) => test(node));
|
|
277
|
+
const maskedAttributes = testedAttributes(prepared.selector).filter((name) => candidates.some((node) => attribute(node.node.attrs, name)?.startsWith('•')));
|
|
278
|
+
return { matches, notes: [...prepared.notes, ...prunedNotes(snapshot, prepared.selector)], maskedAttributes };
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selector.js","sourceRoot":"","sources":["../../src/snapshot/selector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,OAAO,EAAgB,MAAM,YAAY,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAoB,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAgC,MAAM,aAAa,CAAC;AAErF,oGAAoG;AACpG,MAAM,UAAU,SAA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AM,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5C,MAAM,UAAU,GAAG,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxD,MAAM,gBAAgB,GAAG,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAC3E,UAAU,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,UAAU,CAAC,GAAG,CAAC,CAAC,CAC7E,CAAC;IACF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,GAAG,WAAW,CAAC,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAAE,gBAAgB,EAAE,CAAC;AAChH,CAAC"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { DomNode, DomSnapshot } from './format.js';
|
|
2
|
+
import { type QueryOutputOptions, type QueryResult } from './query-result.js';
|
|
3
|
+
export type SubtreeOptions = QueryOutputOptions & {
|
|
4
|
+
/** How many levels below the node to print. Defaults to 3. */
|
|
5
|
+
depth?: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The pruned tree under a node, to a depth. Under a node with a shadow root, its shadow root's
|
|
9
|
+
* children come first, then its light children under `light DOM:`, so every child's side is explicit.
|
|
10
|
+
*
|
|
11
|
+
* @param snapshot The snapshot.
|
|
12
|
+
* @param handle The node to start at; the snapshot's root when omitted.
|
|
13
|
+
* @param options How deep to go, and the output limit.
|
|
14
|
+
*/
|
|
15
|
+
export declare function subtree(snapshot: DomSnapshot, handle?: string, options?: SubtreeOptions): QueryResult<DomNode>;
|
|
16
|
+
type ChildLine = {
|
|
17
|
+
id: string;
|
|
18
|
+
node: string;
|
|
19
|
+
hidden: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type NodeDetails = {
|
|
22
|
+
node: Omit<DomNode, 'children' | 'shadow'> & {
|
|
23
|
+
shadow?: {
|
|
24
|
+
mode: string;
|
|
25
|
+
text?: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
/** `light` when it's a child of its parent, `shadow` when it's in its parent's shadow root. */
|
|
29
|
+
parent?: {
|
|
30
|
+
id: string;
|
|
31
|
+
node: string;
|
|
32
|
+
via: 'light' | 'shadow';
|
|
33
|
+
};
|
|
34
|
+
/** The top of the hidden subtree it's in, itself included. */
|
|
35
|
+
hiddenUnder?: string;
|
|
36
|
+
children: ChildLine[];
|
|
37
|
+
shadowChildren: ChildLine[];
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* One node in full: its handle and address, every recorded attribute unclipped, its text and shadow
|
|
41
|
+
* text, size, visibility, parent, and each of its light and shadow children on one line.
|
|
42
|
+
*
|
|
43
|
+
* @param snapshot The snapshot.
|
|
44
|
+
* @param handle The node's handle.
|
|
45
|
+
* @param options The output limit.
|
|
46
|
+
*/
|
|
47
|
+
export declare function nodeDetails(snapshot: DomSnapshot, handle: string, options?: QueryOutputOptions): QueryResult<NodeDetails>;
|
|
48
|
+
export type AncestorLine = {
|
|
49
|
+
kind: 'element';
|
|
50
|
+
id: string;
|
|
51
|
+
node: string;
|
|
52
|
+
hidden: boolean;
|
|
53
|
+
}
|
|
54
|
+
/** The next element up is this host; the elements below are in its shadow root. */
|
|
55
|
+
| {
|
|
56
|
+
kind: 'shadowRoot';
|
|
57
|
+
host: string;
|
|
58
|
+
mode: string;
|
|
59
|
+
};
|
|
60
|
+
export type AncestorsResult = {
|
|
61
|
+
target: {
|
|
62
|
+
id: string;
|
|
63
|
+
node: string;
|
|
64
|
+
};
|
|
65
|
+
ancestors: AncestorLine[];
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* A node's ancestors, nearest first, one line each, with a line where the chain leaves a shadow
|
|
69
|
+
* root: for picking a container to scope a selector with, which `find --css` then tests.
|
|
70
|
+
*
|
|
71
|
+
* @param snapshot The snapshot.
|
|
72
|
+
* @param handle The node's handle.
|
|
73
|
+
* @param options The output limit.
|
|
74
|
+
*/
|
|
75
|
+
export declare function nodeAncestors(snapshot: DomSnapshot, handle: string, options?: QueryOutputOptions): QueryResult<AncestorsResult>;
|
|
76
|
+
export {};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2026, SimplySF.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { clip, describeNode, describePlain } from './describe.js';
|
|
17
|
+
import { getNode, locate } from './locate.js';
|
|
18
|
+
import { DEFAULT_OUTPUT_LIMIT, limitLines } from './query-result.js';
|
|
19
|
+
/**
|
|
20
|
+
* The pruned tree under a node, to a depth. Under a node with a shadow root, its shadow root's
|
|
21
|
+
* children come first, then its light children under `light DOM:`, so every child's side is explicit.
|
|
22
|
+
*
|
|
23
|
+
* @param snapshot The snapshot.
|
|
24
|
+
* @param handle The node to start at; the snapshot's root when omitted.
|
|
25
|
+
* @param options How deep to go, and the output limit.
|
|
26
|
+
*/
|
|
27
|
+
export function subtree(snapshot, handle, options = {}) {
|
|
28
|
+
const start = handle ? getNode(snapshot, handle) : locate(snapshot).values().next().value;
|
|
29
|
+
const maxDepth = options.depth ?? 3;
|
|
30
|
+
const lines = [];
|
|
31
|
+
const trim = (node, depth) => {
|
|
32
|
+
const copy = { ...node };
|
|
33
|
+
delete copy.children;
|
|
34
|
+
if (copy.shadow)
|
|
35
|
+
copy.shadow = { ...copy.shadow, children: [] };
|
|
36
|
+
if (depth < maxDepth) {
|
|
37
|
+
if (node.children)
|
|
38
|
+
copy.children = node.children.map((child) => trim(child, depth + 1));
|
|
39
|
+
if (node.shadow && copy.shadow)
|
|
40
|
+
copy.shadow.children = node.shadow.children.map((child) => trim(child, depth + 1));
|
|
41
|
+
}
|
|
42
|
+
return copy;
|
|
43
|
+
};
|
|
44
|
+
const print = (node, depth, indent) => {
|
|
45
|
+
const pad = ' '.repeat(indent);
|
|
46
|
+
lines.push(`${pad}${describeNode(node)}${node.hidden ? ' (hidden)' : ''} [${node.id}]`);
|
|
47
|
+
const childCount = (node.children?.length ?? 0) + (node.shadow?.children.length ?? 0);
|
|
48
|
+
if (depth >= maxDepth) {
|
|
49
|
+
if (childCount > 0)
|
|
50
|
+
lines.push(`${pad} … ${childCount} children (raise --depth or tree --node a child)`);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const light = node.children ?? [];
|
|
54
|
+
if (!node.shadow || node.shadow.mode === 'unreadable') {
|
|
55
|
+
for (const child of light)
|
|
56
|
+
print(child, depth + 1, indent + 1);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
// The shadow root first, as the component renders it; light children under their own marker.
|
|
60
|
+
lines.push(`${pad} #shadow(${node.shadow.mode})${node.shadow.text ? ` "${node.shadow.text}"` : ''}`);
|
|
61
|
+
for (const child of node.shadow.children)
|
|
62
|
+
print(child, depth + 1, indent + 2);
|
|
63
|
+
if (light.length > 0) {
|
|
64
|
+
lines.push(`${pad} light DOM:`);
|
|
65
|
+
for (const child of light)
|
|
66
|
+
print(child, depth + 1, indent + 2);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
if (start.hiddenTop && start.hiddenTop !== start)
|
|
70
|
+
lines.push(`(inside hidden subtree ${start.hiddenTop.node.id})`);
|
|
71
|
+
print(start.node, 0, 0);
|
|
72
|
+
const limited = limitLines(lines, options.limit ?? DEFAULT_OUTPUT_LIMIT, 'Lower --depth, or tree --node a child.');
|
|
73
|
+
// Some agent harnesses keep only the tail of long output; repeat where this tree starts.
|
|
74
|
+
if (limited.length > 40)
|
|
75
|
+
limited.push(`(end of tree under ${start.node.id} ${clip(describeNode(start.node), 80)})`);
|
|
76
|
+
return { lines: limited, json: trim(start.node, 0) };
|
|
77
|
+
}
|
|
78
|
+
function ownFields(node) {
|
|
79
|
+
const own = { ...node };
|
|
80
|
+
delete own.children;
|
|
81
|
+
const { shadow } = node;
|
|
82
|
+
if (shadow)
|
|
83
|
+
own.shadow = { mode: shadow.mode, ...(shadow.text ? { text: shadow.text } : {}) };
|
|
84
|
+
return own;
|
|
85
|
+
}
|
|
86
|
+
function visibilityLine(entry) {
|
|
87
|
+
const { node } = entry;
|
|
88
|
+
if (node.hidden)
|
|
89
|
+
return ' visibility: hidden (top of a hidden subtree)';
|
|
90
|
+
if (entry.hiddenTop)
|
|
91
|
+
return ` visibility: hidden, inside ${entry.hiddenTop.node.id} ${describePlain(entry.hiddenTop.node)}`;
|
|
92
|
+
const rect = node.rect ? `, rect [x ${node.rect[0]}, y ${node.rect[1]}, ${node.rect[2]}×${node.rect[3]}]` : '';
|
|
93
|
+
return ` visibility: visible${rect}`;
|
|
94
|
+
}
|
|
95
|
+
/** `nodeDetails`'s text lines, before the output limit. */
|
|
96
|
+
function detailLines(entry, json) {
|
|
97
|
+
const { node } = entry;
|
|
98
|
+
const lines = [`${node.tag} [${node.id}] at ${node.address}`];
|
|
99
|
+
const attrs = Object.entries(node.attrs ?? {});
|
|
100
|
+
if (attrs.length > 0)
|
|
101
|
+
lines.push(' attributes:', ...attrs.map(([name, value]) => ` ${name}="${value}"`));
|
|
102
|
+
if (node.text)
|
|
103
|
+
lines.push(` text: "${node.text}"`);
|
|
104
|
+
if (node.shadow?.mode === 'unreadable')
|
|
105
|
+
lines.push(" shadow root: unreadable, most likely closed; UTAM selectors can't reach inside it");
|
|
106
|
+
else if (node.shadow)
|
|
107
|
+
lines.push(` shadow root: ${node.shadow.mode}${node.shadow.text ? `, text "${node.shadow.text}"` : ''}`);
|
|
108
|
+
if (node.src)
|
|
109
|
+
lines.push(` src: ${node.src}${node.notCaptured ? ' (iframe content not captured)' : ''}`);
|
|
110
|
+
lines.push(visibilityLine(entry));
|
|
111
|
+
if (json.parent) {
|
|
112
|
+
const side = json.parent.via === 'shadow' ? 'in its shadow root' : 'light DOM child';
|
|
113
|
+
lines.push(` parent in the snapshot: ${json.parent.id} ${clip(json.parent.node, 100)} (${side})`);
|
|
114
|
+
}
|
|
115
|
+
const list = (label, items) => {
|
|
116
|
+
if (items.length === 0)
|
|
117
|
+
return;
|
|
118
|
+
lines.push(` ${label} (${items.length}):`);
|
|
119
|
+
for (const item of items)
|
|
120
|
+
lines.push(` ${item.id.padEnd(24)} ${clip(item.node, 110)}${item.hidden ? ' (hidden)' : ''}`);
|
|
121
|
+
};
|
|
122
|
+
list('light DOM children', json.children);
|
|
123
|
+
list('shadow root children', json.shadowChildren);
|
|
124
|
+
if (json.children.length === 0 && json.shadowChildren.length === 0)
|
|
125
|
+
lines.push(' no children in the snapshot');
|
|
126
|
+
return lines;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* One node in full: its handle and address, every recorded attribute unclipped, its text and shadow
|
|
130
|
+
* text, size, visibility, parent, and each of its light and shadow children on one line.
|
|
131
|
+
*
|
|
132
|
+
* @param snapshot The snapshot.
|
|
133
|
+
* @param handle The node's handle.
|
|
134
|
+
* @param options The output limit.
|
|
135
|
+
*/
|
|
136
|
+
export function nodeDetails(snapshot, handle, options = {}) {
|
|
137
|
+
const entry = getNode(snapshot, handle);
|
|
138
|
+
const { node } = entry;
|
|
139
|
+
const summary = (child) => ({
|
|
140
|
+
id: child.id,
|
|
141
|
+
node: describeNode(child),
|
|
142
|
+
hidden: child.hidden === true,
|
|
143
|
+
});
|
|
144
|
+
const json = {
|
|
145
|
+
node: ownFields(node),
|
|
146
|
+
...(entry.parent
|
|
147
|
+
? {
|
|
148
|
+
parent: {
|
|
149
|
+
id: entry.parent.node.id,
|
|
150
|
+
node: describeNode(entry.parent.node),
|
|
151
|
+
via: entry.viaShadow ? 'shadow' : 'light',
|
|
152
|
+
},
|
|
153
|
+
}
|
|
154
|
+
: {}),
|
|
155
|
+
...(entry.hiddenTop ? { hiddenUnder: entry.hiddenTop.node.id } : {}),
|
|
156
|
+
children: (node.children ?? []).map(summary),
|
|
157
|
+
shadowChildren: (node.shadow?.children ?? []).map(summary),
|
|
158
|
+
};
|
|
159
|
+
return { lines: limitLines(detailLines(entry, json), options.limit ?? DEFAULT_OUTPUT_LIMIT, 'Raise --limit.'), json };
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* A node's ancestors, nearest first, one line each, with a line where the chain leaves a shadow
|
|
163
|
+
* root: for picking a container to scope a selector with, which `find --css` then tests.
|
|
164
|
+
*
|
|
165
|
+
* @param snapshot The snapshot.
|
|
166
|
+
* @param handle The node's handle.
|
|
167
|
+
* @param options The output limit.
|
|
168
|
+
*/
|
|
169
|
+
export function nodeAncestors(snapshot, handle, options = {}) {
|
|
170
|
+
const start = getNode(snapshot, handle);
|
|
171
|
+
const ancestors = [];
|
|
172
|
+
for (let entry = start; entry.parent; entry = entry.parent) {
|
|
173
|
+
const parent = entry.parent;
|
|
174
|
+
if (entry.viaShadow)
|
|
175
|
+
ancestors.push({ kind: 'shadowRoot', host: parent.node.id, mode: parent.node.shadow?.mode ?? 'unknown' });
|
|
176
|
+
ancestors.push({
|
|
177
|
+
kind: 'element',
|
|
178
|
+
id: parent.node.id,
|
|
179
|
+
node: describePlain(parent.node),
|
|
180
|
+
hidden: parent.node.hidden === true,
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
let where = '';
|
|
184
|
+
if (start.hiddenTop)
|
|
185
|
+
where = start.hiddenTop === start ? ' (hidden)' : ` (hidden, under ${start.hiddenTop.node.id})`;
|
|
186
|
+
const lines = [`Ancestors of ${start.node.id} ${describePlain(start.node)}${where}, nearest first:`];
|
|
187
|
+
const width = Math.max(...ancestors.map((line) => (line.kind === 'element' ? line.id.length : 0)), 2);
|
|
188
|
+
for (const line of ancestors) {
|
|
189
|
+
if (line.kind === 'shadowRoot')
|
|
190
|
+
lines.push(` — #shadow(${line.mode}) root of ${line.host} —`);
|
|
191
|
+
else
|
|
192
|
+
lines.push(` ${line.id.padEnd(width)} ${line.node}${line.hidden ? ' (hidden)' : ''}`);
|
|
193
|
+
}
|
|
194
|
+
if (ancestors.some((line) => line.kind === 'shadowRoot'))
|
|
195
|
+
lines.push("A CSS selector can't reach past a #shadow line: above it, scope with a page object, not a selector.");
|
|
196
|
+
return {
|
|
197
|
+
lines: limitLines(lines, options.limit ?? DEFAULT_OUTPUT_LIMIT, 'Raise --limit.'),
|
|
198
|
+
json: { target: { id: start.node.id, node: describePlain(start.node) }, ancestors },
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tree.js","sourceRoot":"","sources":["../../src/snapshot/tree.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAA6C,MAAM,mBAAmB,CAAC;AAOhH;;;;;;;GAOG;AACH,MAAM,UAAU,OAAO,CAAC,QAAqB,EAAE,MAAe,EAAE,UAA0B,EAAE;IAC1F,MAAM,K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