@drskillissue/ganko 0.2.6 → 0.2.7
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/{chunk-FTIRRRQY.js → chunk-WY5MMHK2.js} +195 -82
- package/dist/chunk-WY5MMHK2.js.map +1 -0
- package/dist/eslint-plugin.cjs +189 -81
- package/dist/eslint-plugin.cjs.map +1 -1
- package/dist/eslint-plugin.js +1 -1
- package/dist/index.cjs +214 -102
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +17 -2
- package/dist/index.d.ts +17 -2
- package/dist/index.js +23 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -2
- package/dist/chunk-FTIRRRQY.js.map +0 -1
package/dist/eslint-plugin.cjs
CHANGED
|
@@ -142,9 +142,29 @@ function canonicalPath(path) {
|
|
|
142
142
|
return canonical;
|
|
143
143
|
}
|
|
144
144
|
var LOG_LEVELS = ["trace", "debug", "info", "warning", "error", "critical", "off"];
|
|
145
|
+
var Level = {
|
|
146
|
+
Trace: 0,
|
|
147
|
+
Debug: 1,
|
|
148
|
+
Info: 2,
|
|
149
|
+
Warning: 3,
|
|
150
|
+
Error: 4,
|
|
151
|
+
Critical: 5,
|
|
152
|
+
Off: 6
|
|
153
|
+
};
|
|
154
|
+
var LOG_LEVEL_ORDER = {
|
|
155
|
+
trace: Level.Trace,
|
|
156
|
+
debug: Level.Debug,
|
|
157
|
+
info: Level.Info,
|
|
158
|
+
warning: Level.Warning,
|
|
159
|
+
error: Level.Error,
|
|
160
|
+
critical: Level.Critical,
|
|
161
|
+
off: Level.Off
|
|
162
|
+
};
|
|
145
163
|
var noopLogger = {
|
|
146
|
-
enabled: false,
|
|
147
164
|
level: "off",
|
|
165
|
+
isLevelEnabled() {
|
|
166
|
+
return false;
|
|
167
|
+
},
|
|
148
168
|
trace() {
|
|
149
169
|
},
|
|
150
170
|
debug() {
|
|
@@ -2913,6 +2933,35 @@ var TypeResolver = class {
|
|
|
2913
2933
|
return false;
|
|
2914
2934
|
}
|
|
2915
2935
|
}
|
|
2936
|
+
/**
|
|
2937
|
+
* Strict array check: only matches Array<T>, T[], ReadonlyArray<T>, and tuples.
|
|
2938
|
+
* Does NOT match typed arrays (Uint8Array, Buffer, etc.) or other types with
|
|
2939
|
+
* a numeric index signature.
|
|
2940
|
+
*/
|
|
2941
|
+
isStrictArrayType(node) {
|
|
2942
|
+
try {
|
|
2943
|
+
const tsType = this.checker.getTypeAtLocation(node);
|
|
2944
|
+
return this.checkIsStrictArrayType(tsType);
|
|
2945
|
+
} catch {
|
|
2946
|
+
return false;
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
checkIsStrictArrayType(tsType) {
|
|
2950
|
+
if (tsType.flags & 524288) {
|
|
2951
|
+
const objFlags = getObjectFlags(tsType);
|
|
2952
|
+
if (objFlags & 8) return true;
|
|
2953
|
+
if (objFlags & 4) {
|
|
2954
|
+
const name = tsType.getSymbol()?.getName();
|
|
2955
|
+
if (name === "Array" || name === "ReadonlyArray") return true;
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
if (tsType.isUnion()) {
|
|
2959
|
+
for (const t of tsType.types) {
|
|
2960
|
+
if (this.checkIsStrictArrayType(t)) return true;
|
|
2961
|
+
}
|
|
2962
|
+
}
|
|
2963
|
+
return false;
|
|
2964
|
+
}
|
|
2916
2965
|
checkIsArrayType(tsType) {
|
|
2917
2966
|
if (tsType.flags & 524288) {
|
|
2918
2967
|
const objFlags = getObjectFlags(tsType);
|
|
@@ -2964,7 +3013,7 @@ var TypeResolver = class {
|
|
|
2964
3013
|
if (exprTsType.flags & import_typescript2.default.TypeFlags.Any) return false;
|
|
2965
3014
|
if (targetTsType.flags & import_typescript2.default.TypeFlags.Any) return false;
|
|
2966
3015
|
const result = this.checker.isTypeAssignableTo(exprTsType, targetTsType);
|
|
2967
|
-
if (this.logger.
|
|
3016
|
+
if (this.logger.isLevelEnabled(Level.Debug)) {
|
|
2968
3017
|
const exprStr = this.checker.typeToString(exprTsType);
|
|
2969
3018
|
const targetStr = this.checker.typeToString(targetTsType);
|
|
2970
3019
|
this.logger.debug(`isUnnecessaryCast: expr="${exprStr.slice(0, 120)}" target="${targetStr.slice(0, 120)}" assignable=${result} exprFlags=${exprTsType.flags} targetFlags=${targetTsType.flags}`);
|
|
@@ -9928,6 +9977,9 @@ function typeIncludesString(graph, node) {
|
|
|
9928
9977
|
function typeIsArray(graph, node) {
|
|
9929
9978
|
return graph.typeResolver.isArrayType(node);
|
|
9930
9979
|
}
|
|
9980
|
+
function typeIsStrictArray(graph, node) {
|
|
9981
|
+
return graph.typeResolver.isStrictArrayType(node);
|
|
9982
|
+
}
|
|
9931
9983
|
function getArrayElementKind(graph, node) {
|
|
9932
9984
|
return graph.typeResolver.getArrayElementKind(node);
|
|
9933
9985
|
}
|
|
@@ -19723,6 +19775,7 @@ var preferSetLookupInLoop = defineSolidRule({
|
|
|
19723
19775
|
options: options77,
|
|
19724
19776
|
check(graph, emit) {
|
|
19725
19777
|
const reported = /* @__PURE__ */ new Set();
|
|
19778
|
+
const graphHasTypes = hasTypeInfo(graph);
|
|
19726
19779
|
for (const method of LINEAR_SEARCH_METHODS) {
|
|
19727
19780
|
const calls = getCallsByMethodName(graph, method);
|
|
19728
19781
|
for (let i = 0, len = calls.length; i < len; i++) {
|
|
@@ -19740,6 +19793,7 @@ var preferSetLookupInLoop = defineSolidRule({
|
|
|
19740
19793
|
const loop = getEnclosingLoop(call.node);
|
|
19741
19794
|
if (!loop) continue;
|
|
19742
19795
|
if (!isDeclaredOutsideLoop2(loop, variable)) continue;
|
|
19796
|
+
if (graphHasTypes && !typeIsStrictArray(graph, callee.expression)) continue;
|
|
19743
19797
|
if (isStringLikeReceiver(graph, callee.expression, variable)) continue;
|
|
19744
19798
|
const key = `${loop.pos}:var:${variable.id}`;
|
|
19745
19799
|
if (reported.has(key)) continue;
|
|
@@ -28997,11 +29051,12 @@ var POLICIES = {
|
|
|
28997
29051
|
"dense-ui": DENSE_UI,
|
|
28998
29052
|
"large-text": LARGE_TEXT
|
|
28999
29053
|
};
|
|
29000
|
-
var activePolicyName =
|
|
29054
|
+
var activePolicyName = null;
|
|
29001
29055
|
function getActivePolicyName() {
|
|
29002
29056
|
return activePolicyName;
|
|
29003
29057
|
}
|
|
29004
29058
|
function getActivePolicy() {
|
|
29059
|
+
if (activePolicyName === null) return null;
|
|
29005
29060
|
return POLICIES[activePolicyName];
|
|
29006
29061
|
}
|
|
29007
29062
|
|
|
@@ -29320,7 +29375,8 @@ var cssPolicyContrast = defineCSSRule({
|
|
|
29320
29375
|
options: {},
|
|
29321
29376
|
check(graph, emit) {
|
|
29322
29377
|
const policy = getActivePolicy();
|
|
29323
|
-
|
|
29378
|
+
if (policy === null) return;
|
|
29379
|
+
const name = getActivePolicyName() ?? "";
|
|
29324
29380
|
const colorDecls = graph.declarationsByProperty.get("color");
|
|
29325
29381
|
if (!colorDecls) return;
|
|
29326
29382
|
const candidates = /* @__PURE__ */ new Set();
|
|
@@ -29397,7 +29453,8 @@ var cssPolicySpacing = defineCSSRule({
|
|
|
29397
29453
|
options: {},
|
|
29398
29454
|
check(graph, emit) {
|
|
29399
29455
|
const policy = getActivePolicy();
|
|
29400
|
-
|
|
29456
|
+
if (policy === null) return;
|
|
29457
|
+
const name = getActivePolicyName() ?? "";
|
|
29401
29458
|
const letterDecls = graph.declarationsByProperty.get("letter-spacing");
|
|
29402
29459
|
if (letterDecls) {
|
|
29403
29460
|
for (let i = 0; i < letterDecls.length; i++) {
|
|
@@ -29506,7 +29563,8 @@ var cssPolicyTouchTarget = defineCSSRule({
|
|
|
29506
29563
|
options: {},
|
|
29507
29564
|
check(graph, emit) {
|
|
29508
29565
|
const policy = getActivePolicy();
|
|
29509
|
-
|
|
29566
|
+
if (policy === null) return;
|
|
29567
|
+
const name = getActivePolicyName() ?? "";
|
|
29510
29568
|
const decls = graph.declarationsForProperties(
|
|
29511
29569
|
"height",
|
|
29512
29570
|
"min-height",
|
|
@@ -29665,7 +29723,8 @@ var cssPolicyTypography = defineCSSRule({
|
|
|
29665
29723
|
options: {},
|
|
29666
29724
|
check(graph, emit) {
|
|
29667
29725
|
const policy = getActivePolicy();
|
|
29668
|
-
|
|
29726
|
+
if (policy === null) return;
|
|
29727
|
+
const name = getActivePolicyName() ?? "";
|
|
29669
29728
|
const fontDecls = graph.declarationsByProperty.get("font-size");
|
|
29670
29729
|
if (fontDecls) {
|
|
29671
29730
|
for (let i = 0; i < fontDecls.length; i++) {
|
|
@@ -31007,6 +31066,9 @@ function readBaselineOffsetFacts(graph, node) {
|
|
|
31007
31066
|
function readElementRef(graph, node) {
|
|
31008
31067
|
return readElementRefById(graph, node.solidFile, node.elementId);
|
|
31009
31068
|
}
|
|
31069
|
+
function readHostElementRef(graph, node) {
|
|
31070
|
+
return graph.hostElementRefsByNode.get(node) ?? null;
|
|
31071
|
+
}
|
|
31010
31072
|
function readElementRefById(graph, solidFile, elementId) {
|
|
31011
31073
|
const refs = graph.elementRefsBySolidFileAndId.get(solidFile);
|
|
31012
31074
|
if (!refs) return null;
|
|
@@ -32072,7 +32134,7 @@ function publishLayoutPerfStatsForTest(stats) {
|
|
|
32072
32134
|
}
|
|
32073
32135
|
function maybeLogLayoutPerf(stats, log) {
|
|
32074
32136
|
if (process.env["SOLID_LINT_LAYOUT_PROFILE"] !== "1") return;
|
|
32075
|
-
if (!log || !log.
|
|
32137
|
+
if (!log || !log.isLevelEnabled(Level.Debug)) return;
|
|
32076
32138
|
const view = snapshotLayoutPerfStats(stats);
|
|
32077
32139
|
log.debug(
|
|
32078
32140
|
`[layout] elements=${view.elementsScanned} candidates=${view.selectorCandidatesChecked} compiledSelectors=${view.compiledSelectorCount} unsupportedSelectors=${view.selectorsRejectedUnsupported} conditionalSelectors=${view.selectorsGuardedConditional} ancestryChecks=${view.ancestryChecks} edges=${view.matchEdgesCreated} collected=${view.casesCollected} cases=${view.casesScored} rejectLowEvidence=${view.casesRejectedLowEvidence} rejectThreshold=${view.casesRejectedThreshold} rejectUndecidable=${view.casesRejectedUndecidable} rejectIdentifiability=${view.casesRejectedIdentifiability} undecidableInterval=${view.undecidableInterval} conditionalSignalRatio=${Math.round(view.conditionalSignalRatio * 1e3) / 1e3} conditionalSignals=${view.conditionalSignals} totalSignals=${view.totalSignals} cohortUnimodalFalse=${view.cohortUnimodalFalse} factorCoverageMean=${Math.round(view.factorCoverageMean * 1e3) / 1e3} posteriorWidthP95=${Math.round(view.posteriorWidthP95 * 1e3) / 1e3} uncertaintyEscalations=${view.uncertaintyEscalations} snapshots=${view.signalSnapshotsBuilt} snapshotHits=${view.signalSnapshotCacheHits} measurementIndexHits=${view.measurementIndexHits} contexts=${view.contextsClassified} diagnostics=${view.diagnosticsEmitted} selectorIndexMs=${Math.round(view.selectorIndexMs * 100) / 100} selectorMatchMs=${Math.round(view.selectorMatchMs * 100) / 100} cascadeBuildMs=${Math.round(view.cascadeBuildMs * 100) / 100} caseBuildMs=${Math.round(view.caseBuildMs * 100) / 100} scoringMs=${Math.round(view.scoringMs * 100) / 100} elapsedMs=${Math.round(view.elapsedMs * 100) / 100}`
|
|
@@ -32137,17 +32199,17 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32137
32199
|
if (cached !== void 0) return cached;
|
|
32138
32200
|
const binding = resolveTagBinding(normalizedFile, tag);
|
|
32139
32201
|
if (binding === null) {
|
|
32140
|
-
if (logger.
|
|
32202
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveHost(${tag}): binding=null`);
|
|
32141
32203
|
hostByTagCache.set(cacheKey, null);
|
|
32142
32204
|
return null;
|
|
32143
32205
|
}
|
|
32144
32206
|
if (binding.kind === "component") {
|
|
32145
|
-
if (logger.
|
|
32207
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveHost(${tag}): component, tagName=${binding.host.descriptor.tagName}, attrs=[${[...binding.host.descriptor.staticAttributes.keys()]}]`);
|
|
32146
32208
|
hostByTagCache.set(cacheKey, binding.host);
|
|
32147
32209
|
return binding.host;
|
|
32148
32210
|
}
|
|
32149
32211
|
const host = binding.base ? binding.base.host : null;
|
|
32150
|
-
if (logger.
|
|
32212
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveHost(${tag}): namespace, base=${host?.descriptor.tagName ?? "null"}`);
|
|
32151
32213
|
hostByTagCache.set(cacheKey, host);
|
|
32152
32214
|
return host;
|
|
32153
32215
|
},
|
|
@@ -32160,26 +32222,26 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32160
32222
|
}
|
|
32161
32223
|
};
|
|
32162
32224
|
function resolveComponentHostEntry(entry) {
|
|
32163
|
-
if (entry.resolution === "resolved")
|
|
32164
|
-
|
|
32225
|
+
if (entry.resolution === "resolved") {
|
|
32226
|
+
return { descriptor: entry.descriptor, hostElementRef: entry.hostElementRef };
|
|
32227
|
+
}
|
|
32228
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveComponentHostEntry: deferred innerTag=${entry.innerTag}, file=${entry.filePath}, attrs=[${[...entry.staticAttributes.keys()]}]`);
|
|
32165
32229
|
const innerBinding = resolveLocalIdentifierBinding(entry.filePath, entry.innerTag);
|
|
32166
|
-
if (logger.
|
|
32230
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] innerBinding=${innerBinding === null ? "null" : innerBinding.kind}`);
|
|
32167
32231
|
const innerHost = extractHostFromBinding(innerBinding);
|
|
32168
|
-
if (logger.
|
|
32169
|
-
let tagName = innerHost !== null ? innerHost.tagName : null;
|
|
32232
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] innerHost=${innerHost === null ? "null" : `tagName=${innerHost.descriptor.tagName}, attrs=[${[...innerHost.descriptor.staticAttributes.keys()]}]`}`);
|
|
32233
|
+
let tagName = innerHost !== null ? innerHost.descriptor.tagName : null;
|
|
32170
32234
|
if (tagName === null) {
|
|
32171
32235
|
tagName = resolveTagNameFromPolymorphicProp(entry.staticAttributes);
|
|
32172
|
-
if (logger.
|
|
32236
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] polymorphic fallback: tagName=${tagName}`);
|
|
32173
32237
|
}
|
|
32174
|
-
const staticAttributes = innerHost !== null ? mergeStaticAttributes(entry.staticAttributes, innerHost.staticAttributes) : entry.staticAttributes;
|
|
32175
|
-
const staticClassTokens = innerHost !== null ? mergeStaticClassTokens(entry.staticClassTokens, innerHost.staticClassTokens) : entry.staticClassTokens;
|
|
32176
|
-
const forwardsChildren = entry.forwardsChildren || innerHost !== null && innerHost.forwardsChildren;
|
|
32177
|
-
if (logger.
|
|
32238
|
+
const staticAttributes = innerHost !== null ? mergeStaticAttributes(entry.staticAttributes, innerHost.descriptor.staticAttributes) : entry.staticAttributes;
|
|
32239
|
+
const staticClassTokens = innerHost !== null ? mergeStaticClassTokens(entry.staticClassTokens, innerHost.descriptor.staticClassTokens) : entry.staticClassTokens;
|
|
32240
|
+
const forwardsChildren = entry.forwardsChildren || innerHost !== null && innerHost.descriptor.forwardsChildren;
|
|
32241
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolved: tagName=${tagName}, attrs=[${[...staticAttributes.keys()]}], classes=[${staticClassTokens}]`);
|
|
32178
32242
|
return {
|
|
32179
|
-
tagName,
|
|
32180
|
-
|
|
32181
|
-
staticClassTokens,
|
|
32182
|
-
forwardsChildren
|
|
32243
|
+
descriptor: { tagName, staticAttributes, staticClassTokens, forwardsChildren },
|
|
32244
|
+
hostElementRef: innerHost?.hostElementRef ?? null
|
|
32183
32245
|
};
|
|
32184
32246
|
}
|
|
32185
32247
|
function extractHostFromBinding(binding) {
|
|
@@ -32220,10 +32282,7 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32220
32282
|
if (hostEntry) {
|
|
32221
32283
|
const resolved = resolveComponentHostEntry(hostEntry);
|
|
32222
32284
|
if (resolved !== null) {
|
|
32223
|
-
const binding = {
|
|
32224
|
-
kind: "component",
|
|
32225
|
-
host: resolved
|
|
32226
|
-
};
|
|
32285
|
+
const binding = { kind: "component", host: resolved };
|
|
32227
32286
|
localBindingCache.set(key, binding);
|
|
32228
32287
|
resolvingLocal.delete(key);
|
|
32229
32288
|
return binding;
|
|
@@ -32284,7 +32343,7 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32284
32343
|
const baseExpression = toExpressionArgument(firstArg);
|
|
32285
32344
|
if (baseExpression === null) return null;
|
|
32286
32345
|
const baseBinding = resolveBindingFromExpression(filePath, baseExpression);
|
|
32287
|
-
if (logger.
|
|
32346
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] Object.assign base: ${baseBinding === null ? "null" : baseBinding.kind}${baseBinding?.kind === "component" ? `, tagName=${baseBinding.host.descriptor.tagName}` : ""}`);
|
|
32288
32347
|
let baseComponent = null;
|
|
32289
32348
|
const members = /* @__PURE__ */ new Map();
|
|
32290
32349
|
if (baseBinding && baseBinding.kind === "component") {
|
|
@@ -32310,7 +32369,7 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32310
32369
|
if (!import_typescript125.default.isObjectLiteralExpression(argument)) continue;
|
|
32311
32370
|
appendObjectExpressionMembers(filePath, argument, members);
|
|
32312
32371
|
}
|
|
32313
|
-
if (logger.
|
|
32372
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] Object.assign result: base=${baseComponent === null ? "null" : `tagName=${baseComponent.host.descriptor.tagName}`}, members=[${[...members.keys()]}]`);
|
|
32314
32373
|
if (baseComponent === null && members.size === 0) return null;
|
|
32315
32374
|
return {
|
|
32316
32375
|
kind: "namespace",
|
|
@@ -32352,7 +32411,7 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32352
32411
|
}
|
|
32353
32412
|
function resolveBindingFromImport(filePath, importBinding) {
|
|
32354
32413
|
const resolvedModule = moduleResolver.resolveSolid(filePath, importBinding.source) ?? resolveAndIndexExternalModule(filePath, importBinding.source);
|
|
32355
|
-
if (logger.
|
|
32414
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveBindingFromImport: source=${importBinding.source}, kind=${importBinding.kind}, resolvedModule=${resolvedModule}`);
|
|
32356
32415
|
if (resolvedModule === null) return null;
|
|
32357
32416
|
const normalized = (0, import_node_path3.resolve)(resolvedModule);
|
|
32358
32417
|
if (importBinding.kind === "namespace") {
|
|
@@ -32361,7 +32420,7 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32361
32420
|
const exportName = importBinding.kind === "default" ? "default" : importBinding.importedName;
|
|
32362
32421
|
if (exportName === null) return null;
|
|
32363
32422
|
const result = resolveExportBinding(normalized, exportName);
|
|
32364
|
-
if (logger.
|
|
32423
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] export ${exportName}: ${result === null ? "null" : result.kind}`);
|
|
32365
32424
|
return result;
|
|
32366
32425
|
}
|
|
32367
32426
|
function resolveAndIndexExternalModule(importerFile, importSource) {
|
|
@@ -32555,6 +32614,7 @@ function collectComponentHosts(graph) {
|
|
|
32555
32614
|
}
|
|
32556
32615
|
function resolveComponentHostEntryForFunction(graph, fn) {
|
|
32557
32616
|
let entry = null;
|
|
32617
|
+
let hostElementRefAgreed = true;
|
|
32558
32618
|
const bodyEntry = resolveHostEntryFromFunctionBody(graph, fn);
|
|
32559
32619
|
if (bodyEntry !== null) {
|
|
32560
32620
|
entry = bodyEntry;
|
|
@@ -32570,9 +32630,17 @@ function resolveComponentHostEntryForFunction(graph, fn) {
|
|
|
32570
32630
|
entry = returnEntry;
|
|
32571
32631
|
continue;
|
|
32572
32632
|
}
|
|
32573
|
-
if (areComponentHostEntriesEqual(entry, returnEntry))
|
|
32633
|
+
if (areComponentHostEntriesEqual(entry, returnEntry)) {
|
|
32634
|
+
if (hostElementRefAgreed && entry.resolution === "resolved" && returnEntry.resolution === "resolved" && entry.hostElementRef !== returnEntry.hostElementRef) {
|
|
32635
|
+
hostElementRefAgreed = false;
|
|
32636
|
+
}
|
|
32637
|
+
continue;
|
|
32638
|
+
}
|
|
32574
32639
|
return null;
|
|
32575
32640
|
}
|
|
32641
|
+
if (!hostElementRefAgreed && entry !== null && entry.resolution === "resolved") {
|
|
32642
|
+
return { resolution: "resolved", descriptor: entry.descriptor, hostElementRef: null };
|
|
32643
|
+
}
|
|
32576
32644
|
return entry;
|
|
32577
32645
|
}
|
|
32578
32646
|
function resolveHostEntryFromFunctionBody(graph, fn) {
|
|
@@ -32600,7 +32668,8 @@ function resolveHostEntryFromJSXElement(graph, node) {
|
|
|
32600
32668
|
staticAttributes: collectStaticAttributes(element),
|
|
32601
32669
|
staticClassTokens: getStaticClassTokensForElementEntity(graph, element),
|
|
32602
32670
|
forwardsChildren: detectChildrenForwarding(element)
|
|
32603
|
-
}
|
|
32671
|
+
},
|
|
32672
|
+
hostElementRef: { solid: graph, element }
|
|
32604
32673
|
};
|
|
32605
32674
|
}
|
|
32606
32675
|
if (isContextProviderTag(element.tag)) {
|
|
@@ -33310,7 +33379,7 @@ function matchesChain(matcher, node, index, perf, fileRootElements, logger) {
|
|
|
33310
33379
|
ancestor = ancestor.parentElementNode;
|
|
33311
33380
|
}
|
|
33312
33381
|
if (fileRootElements !== null) {
|
|
33313
|
-
if (logger.
|
|
33382
|
+
if (logger.isLevelEnabled(Level.Trace)) {
|
|
33314
33383
|
const compoundDesc = describeCompound(targetCompound);
|
|
33315
33384
|
logger.trace(`[selector-match] fallback: node=${node.key} tag=${node.tagName} checking ${fileRootElements.length} roots for compound=${compoundDesc}`);
|
|
33316
33385
|
}
|
|
@@ -33321,11 +33390,11 @@ function matchesChain(matcher, node, index, perf, fileRootElements, logger) {
|
|
|
33321
33390
|
if (root.solidFile !== node.solidFile) continue;
|
|
33322
33391
|
perf.ancestryChecks++;
|
|
33323
33392
|
const compoundResult = matchesCompound(root, targetCompound);
|
|
33324
|
-
if (logger.
|
|
33393
|
+
if (logger.isLevelEnabled(Level.Trace) && compoundResult === "no-match") {
|
|
33325
33394
|
logger.trace(`[selector-match] fallback MISS: root=${root.key} tag=${root.tagName} attrs=[${[...root.attributes.entries()].map(([k, v]) => `${k}=${v}`).join(",")}]`);
|
|
33326
33395
|
}
|
|
33327
33396
|
if (compoundResult !== "no-match") {
|
|
33328
|
-
if (logger.
|
|
33397
|
+
if (logger.isLevelEnabled(Level.Debug)) {
|
|
33329
33398
|
const compoundDesc = describeCompound(targetCompound);
|
|
33330
33399
|
logger.debug(`[selector-match] fallback HIT: node=${node.key} tag=${node.tagName} matched root=${root.key} tag=${root.tagName} compound=${compoundDesc} isFinal=${isFinal}`);
|
|
33331
33400
|
}
|
|
@@ -36527,7 +36596,7 @@ function appendMatchingEdgesFromSelectorIds(ctx, selectorIds, node, applies, app
|
|
|
36527
36596
|
};
|
|
36528
36597
|
applies.push(edge);
|
|
36529
36598
|
ctx.perf.matchEdgesCreated++;
|
|
36530
|
-
if (ctx.logger.
|
|
36599
|
+
if (ctx.logger.isLevelEnabled(Level.Trace)) {
|
|
36531
36600
|
ctx.logger.trace(
|
|
36532
36601
|
`[cascade] edge node=${node.key} selector=${selector.id} match=${matchResult} conditional=${edge.conditionalMatch} selector-raw=${selector.raw.slice(0, 80)}`
|
|
36533
36602
|
);
|
|
@@ -36970,7 +37039,7 @@ function getTextualContentState(element, memo, compositionMetaByElementId, logge
|
|
|
36970
37039
|
if (!child) continue;
|
|
36971
37040
|
if (child.kind === "expression") {
|
|
36972
37041
|
if (isStructuralExpression(child.node)) {
|
|
36973
|
-
if (logger.
|
|
37042
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id} \u2192 unknown (structural expression child)`);
|
|
36974
37043
|
memo.set(element.id, 2 /* Unknown */);
|
|
36975
37044
|
return 2 /* Unknown */;
|
|
36976
37045
|
}
|
|
@@ -36992,11 +37061,11 @@ function getTextualContentState(element, memo, compositionMetaByElementId, logge
|
|
|
36992
37061
|
if (!child.isDomElement) {
|
|
36993
37062
|
const childMeta = compositionMetaByElementId.get(child.id);
|
|
36994
37063
|
if (childMeta !== void 0 && isControlTag(childMeta.tagName)) {
|
|
36995
|
-
if (logger.
|
|
37064
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id}: non-DOM child ${child.tag}#${child.id} resolves to control tag=${childMeta.tagName}, skipping`);
|
|
36996
37065
|
continue;
|
|
36997
37066
|
}
|
|
36998
37067
|
if (childState !== 1 /* No */) {
|
|
36999
|
-
if (logger.
|
|
37068
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id}: non-DOM child ${child.tag ?? child.id}#${child.id} has state=${childState} \u2192 childHasUnknown`);
|
|
37000
37069
|
childHasUnknown = true;
|
|
37001
37070
|
}
|
|
37002
37071
|
continue;
|
|
@@ -37009,12 +37078,12 @@ function getTextualContentState(element, memo, compositionMetaByElementId, logge
|
|
|
37009
37078
|
if (childState === 3 /* DynamicText */) childHasDynamicText = true;
|
|
37010
37079
|
}
|
|
37011
37080
|
if (childHasUnknown) {
|
|
37012
|
-
if (logger.
|
|
37081
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id} \u2192 unknown (child has unknown)`);
|
|
37013
37082
|
memo.set(element.id, 2 /* Unknown */);
|
|
37014
37083
|
return 2 /* Unknown */;
|
|
37015
37084
|
}
|
|
37016
37085
|
if (hasTextOnlyExpression || childHasDynamicText) {
|
|
37017
|
-
if (logger.
|
|
37086
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id} \u2192 dynamic-text`);
|
|
37018
37087
|
memo.set(element.id, 3 /* DynamicText */);
|
|
37019
37088
|
return 3 /* DynamicText */;
|
|
37020
37089
|
}
|
|
@@ -37036,15 +37105,16 @@ function collectLayoutElementRecordsForSolid(solid, selectorRequirements, inline
|
|
|
37036
37105
|
const meta = compositionMetaByElementId.get(element.id);
|
|
37037
37106
|
if (!meta || !meta.participates) continue;
|
|
37038
37107
|
const localClassTokens = selectorRequirements.needsClassTokens ? getStaticClassTokensForElementEntity(solid, element) : EMPTY_STRING_LIST3;
|
|
37039
|
-
const classTokens = mergeClassTokens(localClassTokens, meta.
|
|
37108
|
+
const classTokens = mergeClassTokens(localClassTokens, meta.resolvedHost?.descriptor.staticClassTokens);
|
|
37040
37109
|
const classTokenSet = classTokens.length === 0 ? EMPTY_CLASS_TOKEN_SET : createClassTokenSet(classTokens);
|
|
37041
37110
|
const inlineStyleKeys = getStaticStyleKeysForElement(solid, element.id);
|
|
37042
37111
|
const localAttributes = selectorRequirements.needsAttributes ? collectStaticAttributes(element) : EMPTY_ATTRIBUTES2;
|
|
37043
|
-
const attributes = mergeAttributes(localAttributes, meta.
|
|
37112
|
+
const attributes = mergeAttributes(localAttributes, meta.resolvedHost?.descriptor.staticAttributes);
|
|
37044
37113
|
const selectorDispatchKeys = buildSelectorDispatchKeys(attributes, classTokens);
|
|
37045
37114
|
const inlineStyleValues = inlineStyleValuesByElementId.get(element.id) ?? EMPTY_INLINE_STYLE_VALUES;
|
|
37046
37115
|
const textualContent = getTextualContentState(element, textContentMemo, compositionMetaByElementId, logger);
|
|
37047
37116
|
const parentElementId = resolveComposedParentElementId(element, compositionMetaByElementId);
|
|
37117
|
+
const hostElementRef = meta.resolvedHost?.hostElementRef ?? null;
|
|
37048
37118
|
out.push({
|
|
37049
37119
|
element,
|
|
37050
37120
|
key: toLayoutElementKey(solid.file, element.id),
|
|
@@ -37057,7 +37127,8 @@ function collectLayoutElementRecordsForSolid(solid, selectorRequirements, inline
|
|
|
37057
37127
|
selectorDispatchKeys,
|
|
37058
37128
|
inlineStyleValues,
|
|
37059
37129
|
textualContent,
|
|
37060
|
-
parentElementId
|
|
37130
|
+
parentElementId,
|
|
37131
|
+
hostElementRef
|
|
37061
37132
|
});
|
|
37062
37133
|
}
|
|
37063
37134
|
return out;
|
|
@@ -37067,7 +37138,7 @@ function collectCompositionMetaByElementId(solid, componentHostResolver) {
|
|
|
37067
37138
|
for (let i = 0; i < solid.jsxElements.length; i++) {
|
|
37068
37139
|
const element = solid.jsxElements[i];
|
|
37069
37140
|
if (!element) continue;
|
|
37070
|
-
const
|
|
37141
|
+
const resolvedHost = resolveHostForElement(
|
|
37071
37142
|
componentHostResolver,
|
|
37072
37143
|
solid.file,
|
|
37073
37144
|
element
|
|
@@ -37076,30 +37147,30 @@ function collectCompositionMetaByElementId(solid, componentHostResolver) {
|
|
|
37076
37147
|
componentHostResolver,
|
|
37077
37148
|
solid.file,
|
|
37078
37149
|
element,
|
|
37079
|
-
|
|
37150
|
+
resolvedHost
|
|
37080
37151
|
);
|
|
37081
37152
|
const participates = element.tag !== null && !isTransparentPrimitive;
|
|
37082
|
-
const tag = resolveEffectiveTag(element,
|
|
37153
|
+
const tag = resolveEffectiveTag(element, resolvedHost?.descriptor ?? null);
|
|
37083
37154
|
const tagName = tag ? tag.toLowerCase() : null;
|
|
37084
37155
|
out.set(element.id, {
|
|
37085
37156
|
element,
|
|
37086
37157
|
participates,
|
|
37087
37158
|
tag,
|
|
37088
37159
|
tagName,
|
|
37089
|
-
|
|
37160
|
+
resolvedHost
|
|
37090
37161
|
});
|
|
37091
37162
|
}
|
|
37092
37163
|
return out;
|
|
37093
37164
|
}
|
|
37094
|
-
function
|
|
37165
|
+
function resolveHostForElement(componentHostResolver, solidFile, element) {
|
|
37095
37166
|
if (element.tag === null) return null;
|
|
37096
37167
|
if (element.isDomElement) return null;
|
|
37097
37168
|
return componentHostResolver.resolveHost(solidFile, element.tag);
|
|
37098
37169
|
}
|
|
37099
|
-
function resolveTransparentPrimitiveStatus(componentHostResolver, solidFile, element,
|
|
37170
|
+
function resolveTransparentPrimitiveStatus(componentHostResolver, solidFile, element, resolvedHost) {
|
|
37100
37171
|
if (element.tag === null) return false;
|
|
37101
37172
|
if (element.isDomElement) return false;
|
|
37102
|
-
if (
|
|
37173
|
+
if (resolvedHost !== null) return false;
|
|
37103
37174
|
return componentHostResolver.isTransparentPrimitive(solidFile, element.tag);
|
|
37104
37175
|
}
|
|
37105
37176
|
function resolveEffectiveTag(element, hostDescriptor) {
|
|
@@ -37217,6 +37288,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
37217
37288
|
const childrenByParentNodeMutable = /* @__PURE__ */ new Map();
|
|
37218
37289
|
const elementBySolidFileAndIdMutable = /* @__PURE__ */ new Map();
|
|
37219
37290
|
const elementRefsBySolidFileAndIdMutable = /* @__PURE__ */ new Map();
|
|
37291
|
+
const hostElementRefsByNodeMutable = /* @__PURE__ */ new Map();
|
|
37220
37292
|
const appliesByElementNodeMutable = /* @__PURE__ */ new Map();
|
|
37221
37293
|
const selectorsById = /* @__PURE__ */ new Map();
|
|
37222
37294
|
const monitoredDeclarationsBySelectorId = /* @__PURE__ */ new Map();
|
|
@@ -37253,7 +37325,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
37253
37325
|
const moduleResolver = createLayoutModuleResolver(solids, css);
|
|
37254
37326
|
const componentHostResolver = createLayoutComponentHostResolver(solids, moduleResolver, logger);
|
|
37255
37327
|
const cssScopeBySolidFile = collectCSSScopeBySolidFile(solids, css, moduleResolver);
|
|
37256
|
-
if (logger.
|
|
37328
|
+
if (logger.isLevelEnabled(Level.Trace)) {
|
|
37257
37329
|
for (const [solidFile, scopePaths] of cssScopeBySolidFile) {
|
|
37258
37330
|
if (scopePaths.length > 0) {
|
|
37259
37331
|
let names = "";
|
|
@@ -37348,6 +37420,9 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
37348
37420
|
isControl: isControlTag(record.tagName),
|
|
37349
37421
|
isReplaced: isReplacedTag(record.tagName)
|
|
37350
37422
|
};
|
|
37423
|
+
if (record.hostElementRef !== null) {
|
|
37424
|
+
hostElementRefsByNodeMutable.set(node, record.hostElementRef);
|
|
37425
|
+
}
|
|
37351
37426
|
elements.push(node);
|
|
37352
37427
|
elementById.set(record.element.id, node);
|
|
37353
37428
|
nodeByElementId.set(record.element.id, node);
|
|
@@ -37369,7 +37444,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
37369
37444
|
}
|
|
37370
37445
|
}
|
|
37371
37446
|
}
|
|
37372
|
-
if (logger.
|
|
37447
|
+
if (logger.isLevelEnabled(Level.Debug)) {
|
|
37373
37448
|
for (const [file, roots] of rootElementsByFile) {
|
|
37374
37449
|
const descs = roots.map((r) => `${r.key}(tag=${r.tagName}, attrs=[${[...r.attributes.entries()].map(([k, v]) => `${k}=${v}`).join(",")}])`);
|
|
37375
37450
|
logger.debug(`[build] rootElementsByFile file=${file} count=${roots.length}: ${descs.join(", ")}`);
|
|
@@ -37412,7 +37487,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
37412
37487
|
appliesByNode.set(node, edges);
|
|
37413
37488
|
}
|
|
37414
37489
|
perf.cascadeBuildMs = performance.now() - cascadeStartedAt;
|
|
37415
|
-
if (logger.
|
|
37490
|
+
if (logger.isLevelEnabled(Level.Trace)) {
|
|
37416
37491
|
for (let i = 0; i < elements.length; i++) {
|
|
37417
37492
|
const node = elements[i];
|
|
37418
37493
|
if (!node) continue;
|
|
@@ -37468,6 +37543,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
37468
37543
|
childrenByParentNode: childrenByParentNodeMutable,
|
|
37469
37544
|
elementBySolidFileAndId: elementBySolidFileAndIdMutable,
|
|
37470
37545
|
elementRefsBySolidFileAndId: elementRefsBySolidFileAndIdMutable,
|
|
37546
|
+
hostElementRefsByNode: hostElementRefsByNodeMutable,
|
|
37471
37547
|
appliesByNode,
|
|
37472
37548
|
selectorCandidatesByNode,
|
|
37473
37549
|
selectorsById,
|
|
@@ -37868,7 +37944,7 @@ function computeFlowParticipationFact(snapshot) {
|
|
|
37868
37944
|
}
|
|
37869
37945
|
function buildContextIndex(childrenByParentNode, snapshotByElementNode, perf, logger) {
|
|
37870
37946
|
const out = /* @__PURE__ */ new Map();
|
|
37871
|
-
const trace = logger.
|
|
37947
|
+
const trace = logger.isLevelEnabled(Level.Trace);
|
|
37872
37948
|
for (const [parent, children] of childrenByParentNode) {
|
|
37873
37949
|
if (children.length < 2) continue;
|
|
37874
37950
|
const snapshot = snapshotByElementNode.get(parent);
|
|
@@ -38687,7 +38763,7 @@ function runLayoutDetector(context, detector) {
|
|
|
38687
38763
|
result.evidence.posteriorLower,
|
|
38688
38764
|
result.evidence.posteriorUpper
|
|
38689
38765
|
);
|
|
38690
|
-
if (log.
|
|
38766
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
38691
38767
|
log.debug(
|
|
38692
38768
|
`[${detector.id}] accept case=${i} severity=${result.evidence.severity.toFixed(2)} confidence=${result.evidence.confidence.toFixed(2)} posterior=[${result.evidence.posteriorLower.toFixed(3)},${result.evidence.posteriorUpper.toFixed(3)}] evidenceMass=${result.evidence.evidenceMass.toFixed(3)} context=${result.evidence.contextKind} offset=${result.evidence.estimatedOffsetPx?.toFixed(2) ?? "null"} topFactors=[${result.evidence.topFactors.join(",")}] causes=[${result.evidence.causes.join("; ")}]`
|
|
38693
38769
|
);
|
|
@@ -38696,7 +38772,7 @@ function runLayoutDetector(context, detector) {
|
|
|
38696
38772
|
continue;
|
|
38697
38773
|
}
|
|
38698
38774
|
recordPolicyMetrics(context, result.evidenceMass, result.posteriorLower, result.posteriorUpper);
|
|
38699
|
-
if (log.
|
|
38775
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
38700
38776
|
log.debug(
|
|
38701
38777
|
`[${detector.id}] reject case=${i} reason=${result.reason} detail=${result.detail ?? "none"} posterior=[${result.posteriorLower.toFixed(3)},${result.posteriorUpper.toFixed(3)}] evidenceMass=${result.evidenceMass.toFixed(3)}`
|
|
38702
38778
|
);
|
|
@@ -39324,13 +39400,39 @@ var INLINE_TOUCH_TARGET_KEYS = /* @__PURE__ */ new Set([
|
|
|
39324
39400
|
"height",
|
|
39325
39401
|
"min-height",
|
|
39326
39402
|
"width",
|
|
39327
|
-
"min-width"
|
|
39328
|
-
"padding-left",
|
|
39329
|
-
"padding-right",
|
|
39330
|
-
"padding-inline",
|
|
39331
|
-
"padding-inline-start",
|
|
39332
|
-
"padding-inline-end"
|
|
39403
|
+
"min-width"
|
|
39333
39404
|
]);
|
|
39405
|
+
var INTERACTIVE_HTML_TAGS = /* @__PURE__ */ new Set(["button", "a", "input", "select", "textarea", "label", "summary"]);
|
|
39406
|
+
var INTERACTIVE_ARIA_ROLES = /* @__PURE__ */ new Set([
|
|
39407
|
+
"button",
|
|
39408
|
+
"link",
|
|
39409
|
+
"checkbox",
|
|
39410
|
+
"radio",
|
|
39411
|
+
"combobox",
|
|
39412
|
+
"listbox",
|
|
39413
|
+
"menuitem",
|
|
39414
|
+
"menuitemcheckbox",
|
|
39415
|
+
"menuitemradio",
|
|
39416
|
+
"option",
|
|
39417
|
+
"switch",
|
|
39418
|
+
"tab"
|
|
39419
|
+
]);
|
|
39420
|
+
function isInteractiveElement(solid, element, hostElementRef) {
|
|
39421
|
+
if (element.tagName !== null && INTERACTIVE_HTML_TAGS.has(element.tagName)) return true;
|
|
39422
|
+
const roleAttr = getJSXAttributeEntity(solid, element, "role");
|
|
39423
|
+
if (roleAttr !== null && roleAttr.valueNode !== null) {
|
|
39424
|
+
const role = getStaticStringFromJSXValue(roleAttr.valueNode);
|
|
39425
|
+
if (role !== null && INTERACTIVE_ARIA_ROLES.has(role)) return true;
|
|
39426
|
+
}
|
|
39427
|
+
if (hostElementRef !== null && hostElementRef.element.tagName !== null) {
|
|
39428
|
+
if (INTERACTIVE_HTML_TAGS.has(hostElementRef.element.tagName)) return true;
|
|
39429
|
+
}
|
|
39430
|
+
return false;
|
|
39431
|
+
}
|
|
39432
|
+
function readNodeHostElementRef(layout, solid, element) {
|
|
39433
|
+
const node = layout.elementBySolidFileAndId.get(solid.file)?.get(element.id) ?? null;
|
|
39434
|
+
return node !== null ? readHostElementRef(layout, node) : null;
|
|
39435
|
+
}
|
|
39334
39436
|
var jsxStylePolicy = defineCrossRule({
|
|
39335
39437
|
id: "jsx-style-policy",
|
|
39336
39438
|
severity: "warn",
|
|
@@ -39341,10 +39443,11 @@ var jsxStylePolicy = defineCrossRule({
|
|
|
39341
39443
|
category: "css-jsx"
|
|
39342
39444
|
},
|
|
39343
39445
|
check(context, emit) {
|
|
39344
|
-
const { solids } = context;
|
|
39446
|
+
const { solids, layout } = context;
|
|
39345
39447
|
const policy = getActivePolicy();
|
|
39346
|
-
|
|
39347
|
-
|
|
39448
|
+
if (policy === null) return;
|
|
39449
|
+
const name = getActivePolicyName() ?? "";
|
|
39450
|
+
forEachStylePropertyAcross(solids, (solid, p, element) => {
|
|
39348
39451
|
if (!import_typescript135.default.isPropertyAssignment(p)) return;
|
|
39349
39452
|
const key = objectKeyName(p.name);
|
|
39350
39453
|
if (!key) return;
|
|
@@ -39392,6 +39495,8 @@ var jsxStylePolicy = defineCrossRule({
|
|
|
39392
39495
|
return;
|
|
39393
39496
|
}
|
|
39394
39497
|
if (INLINE_TOUCH_TARGET_KEYS.has(normalizedKey)) {
|
|
39498
|
+
const hostRef = readNodeHostElementRef(layout, solid, element);
|
|
39499
|
+
if (!isInteractiveElement(solid, element, hostRef)) return;
|
|
39395
39500
|
const strVal = getStaticStringValue(p.initializer);
|
|
39396
39501
|
if (!strVal) return;
|
|
39397
39502
|
const px = parsePxValue(strVal);
|
|
@@ -39470,7 +39575,7 @@ var siblingAlignmentDetector = {
|
|
|
39470
39575
|
id: "sibling-alignment-outlier",
|
|
39471
39576
|
collect: collectAlignmentCases,
|
|
39472
39577
|
evaluate(input, context) {
|
|
39473
|
-
if (context.logger.
|
|
39578
|
+
if (context.logger.isLevelEnabled(Level.Trace)) {
|
|
39474
39579
|
const ctx = input.context;
|
|
39475
39580
|
context.logger.trace(
|
|
39476
39581
|
`[sibling-alignment] evaluate subject=${input.subject.elementKey} tag=${input.subject.tag} parent=${ctx.parentElementKey} parentTag=${ctx.parentTag} context.kind=${ctx.kind} certainty=${ctx.certainty} display=${ctx.parentDisplay} alignItems=${ctx.parentAlignItems} crossAxisIsBlockAxis=${ctx.crossAxisIsBlockAxis} crossAxisCertainty=${ctx.crossAxisIsBlockAxisCertainty} baseline=${ctx.baselineRelevance}`
|
|
@@ -39519,7 +39624,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
39519
39624
|
const log = context.logger;
|
|
39520
39625
|
const detections = runLayoutDetector(context, siblingAlignmentDetector);
|
|
39521
39626
|
const uniqueDetections = dedupeDetectionsBySubject(detections);
|
|
39522
|
-
if (log.
|
|
39627
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
39523
39628
|
log.debug(
|
|
39524
39629
|
`[sibling-alignment] raw=${detections.length} deduped=${uniqueDetections.length}`
|
|
39525
39630
|
);
|
|
@@ -39533,7 +39638,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
39533
39638
|
const subjectId = detection.caseData.subject.elementId;
|
|
39534
39639
|
const logPrefix = `[sibling-alignment] <${subjectTag}> in <${parentTag}> (${subjectFile}#${subjectId})`;
|
|
39535
39640
|
if (detection.evidence.confidence < MIN_CONFIDENCE_THRESHOLD) {
|
|
39536
|
-
if (log.
|
|
39641
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
39537
39642
|
log.debug(
|
|
39538
39643
|
`${logPrefix} SKIP: confidence=${detection.evidence.confidence.toFixed(2)} < threshold=${MIN_CONFIDENCE_THRESHOLD}`
|
|
39539
39644
|
);
|
|
@@ -39542,7 +39647,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
39542
39647
|
}
|
|
39543
39648
|
const estimatedOffset = detection.evidence.estimatedOffsetPx;
|
|
39544
39649
|
if (estimatedOffset !== null && Math.abs(estimatedOffset) < MIN_OFFSET_PX_THRESHOLD && !hasNonOffsetPrimaryEvidence(detection.evidence.topFactors)) {
|
|
39545
|
-
if (log.
|
|
39650
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
39546
39651
|
log.debug(
|
|
39547
39652
|
`${logPrefix} SKIP: offset=${estimatedOffset.toFixed(2)}px < ${MIN_OFFSET_PX_THRESHOLD}px (no non-offset primary evidence, topFactors=[${detection.evidence.topFactors.join(",")}])`
|
|
39548
39653
|
);
|
|
@@ -39554,7 +39659,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
39554
39659
|
detection.caseData.cohort.parentElementKey,
|
|
39555
39660
|
detection.caseData.subject.solidFile
|
|
39556
39661
|
)) {
|
|
39557
|
-
if (log.
|
|
39662
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
39558
39663
|
log.debug(`${logPrefix} SKIP: out-of-flow ancestor`);
|
|
39559
39664
|
}
|
|
39560
39665
|
continue;
|
|
@@ -39565,7 +39670,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
39565
39670
|
detection.caseData.subject.elementId
|
|
39566
39671
|
);
|
|
39567
39672
|
if (!subjectRef) {
|
|
39568
|
-
if (log.
|
|
39673
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
39569
39674
|
log.debug(`${logPrefix} SKIP: no node ref`);
|
|
39570
39675
|
}
|
|
39571
39676
|
continue;
|
|
@@ -39581,7 +39686,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
39581
39686
|
const primaryFix = detection.evidence.primaryFix;
|
|
39582
39687
|
const firstChar = primaryFix.length > 0 ? primaryFix[0] : void 0;
|
|
39583
39688
|
const fix = firstChar !== void 0 ? ` ${firstChar.toUpperCase()}${primaryFix.slice(1)}.` : "";
|
|
39584
|
-
if (log.
|
|
39689
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
39585
39690
|
log.debug(
|
|
39586
39691
|
`${logPrefix} EMIT: severity=${severity} confidence=${confidence} offset=${offset?.toFixed(2) ?? "null"} posterior=[${detection.evidence.posteriorLower.toFixed(3)},${detection.evidence.posteriorUpper.toFixed(3)}] evidenceMass=${detection.evidence.evidenceMass.toFixed(3)} topFactors=[${detection.evidence.topFactors.join(",")}] causes=[${causes}]`
|
|
39587
39692
|
);
|
|
@@ -39990,7 +40095,8 @@ var cssLayoutUnsizedReplacedElement = defineCrossRule({
|
|
|
39990
40095
|
const ref = readNodeRef(context.layout, node);
|
|
39991
40096
|
if (!ref) continue;
|
|
39992
40097
|
const reservedSpace = readReservedSpaceFact(context.layout, node);
|
|
39993
|
-
|
|
40098
|
+
const hostRef = readHostElementRef(context.layout, node);
|
|
40099
|
+
if (hasReservedSize(ref.solid, node.attributes, ref.element, reservedSpace, hostRef)) continue;
|
|
39994
40100
|
emit(
|
|
39995
40101
|
createDiagnostic(
|
|
39996
40102
|
ref.solid.file,
|
|
@@ -40005,15 +40111,17 @@ var cssLayoutUnsizedReplacedElement = defineCrossRule({
|
|
|
40005
40111
|
}
|
|
40006
40112
|
}
|
|
40007
40113
|
});
|
|
40008
|
-
function hasReservedSize(solid, attributes, element, reservedSpaceFact) {
|
|
40114
|
+
function hasReservedSize(solid, attributes, element, reservedSpaceFact, hostElementRef) {
|
|
40009
40115
|
if (reservedSpaceFact.hasReservedSpace) return true;
|
|
40010
40116
|
const attrWidth = parsePositiveLength(attributes.get("width"));
|
|
40011
40117
|
const attrHeight = parsePositiveLength(attributes.get("height"));
|
|
40012
40118
|
const jsxAttrWidth = readPositiveJsxAttribute(solid, element, "width");
|
|
40013
40119
|
const jsxAttrHeight = readPositiveJsxAttribute(solid, element, "height");
|
|
40014
|
-
|
|
40015
|
-
const
|
|
40016
|
-
|
|
40120
|
+
const hostJsxWidth = hostElementRef !== null ? readPositiveJsxAttribute(hostElementRef.solid, hostElementRef.element, "width") : false;
|
|
40121
|
+
const hostJsxHeight = hostElementRef !== null ? readPositiveJsxAttribute(hostElementRef.solid, hostElementRef.element, "height") : false;
|
|
40122
|
+
if (attrWidth && attrHeight || jsxAttrWidth && jsxAttrHeight || hostJsxWidth && hostJsxHeight) return true;
|
|
40123
|
+
const hasAnyWidth = attrWidth || jsxAttrWidth || hostJsxWidth || reservedSpaceFact.hasUsableInlineDimension;
|
|
40124
|
+
const hasAnyHeight = attrHeight || jsxAttrHeight || hostJsxHeight || reservedSpaceFact.hasUsableBlockDimension || reservedSpaceFact.hasContainIntrinsicSize;
|
|
40017
40125
|
if (reservedSpaceFact.hasUsableAspectRatio && (hasAnyWidth || hasAnyHeight)) return true;
|
|
40018
40126
|
if (reservedSpaceFact.hasContainIntrinsicSize && (hasAnyWidth || hasAnyHeight)) return true;
|
|
40019
40127
|
return false;
|