@whenessel/seql-js 1.0.2 → 1.1.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 CHANGED
@@ -8,7 +8,8 @@ Semantic Element Query Language (SEQL) - Stable DOM element identification for w
8
8
 
9
9
  - **Semantic-first**: Uses ARIA roles, labels, semantic HTML tags, and stable attributes.
10
10
  - **Resilient**: Designed to be stable across UI updates and DOM changes.
11
- - **Dual Format**:
11
+ - **State-independent** (v1.0.3): Filters out state attributes (`aria-selected`, `data-state`, `disabled`) to ensure elements are found regardless of their current state.
12
+ - **Dual Format**:
12
13
  - **EID** (JSON): Structured descriptor for internal operations and high precision.
13
14
  - **SEQL Selector** (String): Canonical string format for easy transport (analytics) and storage.
14
15
  - **Deterministic**: Guaranteed same output for the same DOM state.
@@ -96,27 +97,35 @@ Resolution: EID → resolve() → ResolveResult
96
97
  ### SEQL Selector Functions
97
98
 
98
99
  #### `generateSEQL(element, generatorOptions?, stringifyOptions?)`
100
+
99
101
  Convenience function: `generateEID` + `stringifySEQL`. Returns a string or `null`.
100
102
 
101
103
  #### `resolveSEQL(selector, root, options?)`
104
+
102
105
  Convenience function: `parseSEQL` + `resolve`. Returns `Element[]`.
103
106
 
104
107
  #### `parseSEQL(selector)`
108
+
105
109
  Parses a SEQL Selector into an `ElementIdentity` object.
106
110
 
107
111
  #### `stringifySEQL(eid, options?)`
112
+
108
113
  Converts an `ElementIdentity` object into a canonical SEQL Selector.
109
114
 
110
115
  ### Core Functions
111
116
 
112
117
  #### `generateEID(element, options?)`
118
+
113
119
  Generates an `ElementIdentity` (EID) from a DOM element.
120
+
114
121
  - `maxPathDepth`: Default 10.
115
122
  - `enableSvgFingerprint`: Default true.
116
123
  - `confidenceThreshold`: Default 0.1.
117
124
 
118
125
  #### `resolve(eid, root, options?)`
126
+
119
127
  Resolves an EID back to DOM element(s). Returns a `ResolveResult` object.
128
+
120
129
  - `status`: `'success' | 'ambiguous' | 'error' | 'degraded-fallback'`.
121
130
  - `elements`: `Element[]` of matches.
122
131
  - `confidence`: Match confidence score (0-1).
@@ -124,9 +133,11 @@ Resolves an EID back to DOM element(s). Returns a `ResolveResult` object.
124
133
  ### Utilities & Advanced
125
134
 
126
135
  #### `generateEIDBatch(elements, options?)`
136
+
127
137
  Optimized generation for multiple elements at once.
128
138
 
129
139
  #### `createEIDCache(options?)` / `getGlobalCache()`
140
+
130
141
  Manage the LRU cache to improve performance for frequent generations/resolutions.
131
142
 
132
143
  ## Project Structure
@@ -147,14 +158,20 @@ Manage the LRU cache to improve performance for frequent generations/resolutions
147
158
 
148
159
  ## Documentation
149
160
 
150
- - [Architecture Design](docs/specs/ARCHITECTURE.md)
151
- - [EID Specification v1.0](docs/specs/SPECIFICATION.md) (Russian)
152
- - [Developer Guidelines](CLAUDE.md)
153
- - [Migration Guide](docs/MIGRATION.md)
161
+ - **[Getting Started](docs/getting-started/)** - Installation and quick start guide
162
+ - **[API Reference](docs/api/)** - Complete API documentation
163
+ - **[Examples](docs/examples/)** - Practical code examples
164
+ - **[Specification](docs/specification/)** - EID and SEQL format specifications
165
+ - **[Architecture](docs/architecture/)** - System design and internals
166
+ - **[Guides](docs/guides/)** - Advanced topics and patterns
167
+ - **[Contributing](docs/contributing/)** - Development guide
168
+ - **[Troubleshooting](docs/troubleshooting/)** - Common issues and solutions
169
+ - **[CLAUDE.md](CLAUDE.md)** - AI agent development guidelines
154
170
 
155
171
  ## Migrating from v0.x
156
172
 
157
173
  If you are upgrading from v0.x, note these breaking changes:
174
+
158
175
  - `generateDsl()` → `generateEID()`
159
176
  - `resolveDsl()` → `resolve()`
160
177
  - `DslIdentity` → `ElementIdentity`
package/dist/seql-js.d.ts CHANGED
@@ -43,6 +43,8 @@ export declare interface AnchorNode {
43
43
  score: number;
44
44
  /** Whether this is a degraded/fallback anchor */
45
45
  degraded: boolean;
46
+ /** Position among siblings (1-based, for nth-child CSS selector) */
47
+ nthChild?: number;
46
48
  }
47
49
 
48
50
  /**
@@ -1152,8 +1154,7 @@ export declare class SvgFingerprinter {
1152
1154
  /**
1153
1155
  * Target node - the element being identified
1154
1156
  */
1155
- export declare interface TargetNode extends PathNode {
1156
- }
1157
+ export declare type TargetNode = PathNode;
1157
1158
 
1158
1159
  /**
1159
1160
  * Text content with normalization