fix: children($var) domain compilation and resolver support
- Add children branch in convertDomain() alongside descendants — children() now correctly maps to parentVar: '$parent' instead of falling through to the default branch which reversed the parentVar/selector mapping. - SelectorDomainResolver now handles parentVar domains with no CSS selector filter (children domain collects all registered subject IDs, then filters by parent via ancestor index). - All 1072 tests pass across 14 packages.
This commit is contained in:
@@ -938,7 +938,7 @@ function convertDomain(domain: DslDomainRef): DomainRef {
|
||||
|
||||
// Descendant domains use the first argument as parent and second as filter:
|
||||
// descendants($card, '.title') => parentVar: '$card', selector: '.title'
|
||||
if (domain.kind === 'descendants') {
|
||||
if (domain.kind === 'descendants' || domain.kind === 'children') {
|
||||
const parentVar = selectorFromVar ?? domain.selector
|
||||
const selector = extraArgFromVar ?? (domain as any).extraArg
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user