@drskillissue/ganko 0.1.18 → 0.1.20
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-OYGFWDEL.js → chunk-PX2XCAZW.js} +189 -21
- package/dist/chunk-PX2XCAZW.js.map +1 -0
- package/dist/eslint-plugin.cjs +192 -23
- package/dist/eslint-plugin.cjs.map +1 -1
- package/dist/eslint-plugin.js +4 -2
- package/dist/eslint-plugin.js.map +1 -1
- package/dist/index.cjs +210 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -1
- package/dist/index.d.ts +34 -1
- package/dist/index.js +21 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-OYGFWDEL.js.map +0 -1
package/dist/eslint-plugin.cjs
CHANGED
|
@@ -28929,7 +28929,8 @@ var cssRequireReducedMotionOverride = defineCSSRule({
|
|
|
28929
28929
|
for (let j = 0; j < resolved.length; j++) {
|
|
28930
28930
|
const sel = resolved[j];
|
|
28931
28931
|
if (!sel) continue;
|
|
28932
|
-
|
|
28932
|
+
const key = `${normalizeSelector2(sel)}|${group}`;
|
|
28933
|
+
reduced.add(key);
|
|
28933
28934
|
}
|
|
28934
28935
|
}
|
|
28935
28936
|
for (let i = 0; i < motionDecls.length; i++) {
|
|
@@ -28948,7 +28949,8 @@ var cssRequireReducedMotionOverride = defineCSSRule({
|
|
|
28948
28949
|
for (let j = 0; j < resolved.length; j++) {
|
|
28949
28950
|
const sel = resolved[j];
|
|
28950
28951
|
if (!sel) continue;
|
|
28951
|
-
|
|
28952
|
+
const key = `${normalizeSelector2(sel)}|${group}`;
|
|
28953
|
+
if (reduced.has(key)) {
|
|
28952
28954
|
covered = true;
|
|
28953
28955
|
break;
|
|
28954
28956
|
}
|
|
@@ -29926,6 +29928,16 @@ function readKnownNormalizedWithGuard(snapshot, name) {
|
|
|
29926
29928
|
if (!value2) return null;
|
|
29927
29929
|
return value2.normalized;
|
|
29928
29930
|
}
|
|
29931
|
+
function isLayoutHidden(node, snapshotByElementNode) {
|
|
29932
|
+
if (node.attributes.has("hidden")) return true;
|
|
29933
|
+
if (node.classTokenSet.has("hidden")) return true;
|
|
29934
|
+
const snapshot = snapshotByElementNode.get(node);
|
|
29935
|
+
if (snapshot) {
|
|
29936
|
+
const display = readKnownNormalized(snapshot, "display");
|
|
29937
|
+
if (display === "none") return true;
|
|
29938
|
+
}
|
|
29939
|
+
return false;
|
|
29940
|
+
}
|
|
29929
29941
|
function hasEffectivePosition(snapshot) {
|
|
29930
29942
|
const position = readKnownNormalized(snapshot, "position");
|
|
29931
29943
|
if (position === null) return false;
|
|
@@ -29994,6 +30006,7 @@ function readStatefulBaseValueIndex(graph) {
|
|
|
29994
30006
|
}
|
|
29995
30007
|
|
|
29996
30008
|
// src/cross-file/layout/context-classification.ts
|
|
30009
|
+
var WHITESPACE_RE3 = /\s+/;
|
|
29997
30010
|
var TABLE_SEMANTIC_TAGS = /* @__PURE__ */ new Set(["table", "thead", "tbody", "tfoot", "tr", "td", "th"]);
|
|
29998
30011
|
var TABLE_DISPLAY_VALUES = /* @__PURE__ */ new Set([
|
|
29999
30012
|
"table",
|
|
@@ -30032,6 +30045,7 @@ function createAlignmentContextForParent(parent, snapshot) {
|
|
|
30032
30045
|
const classified = classifyKind(evidence);
|
|
30033
30046
|
const contextCertainty = combineCertainty(classified.certainty, axis.certainty);
|
|
30034
30047
|
const certainty = combineCertainty(contextCertainty, inlineDirection.certainty);
|
|
30048
|
+
const baselineRelevance = computeBaselineRelevance(classified.kind, parentAlignItems, parentPlaceItems);
|
|
30035
30049
|
const out = {
|
|
30036
30050
|
kind: classified.kind,
|
|
30037
30051
|
certainty,
|
|
@@ -30047,6 +30061,7 @@ function createAlignmentContextForParent(parent, snapshot) {
|
|
|
30047
30061
|
parentAlignItems,
|
|
30048
30062
|
parentPlaceItems,
|
|
30049
30063
|
hasPositionedOffset: positionedOffset.hasPositionedOffset,
|
|
30064
|
+
baselineRelevance,
|
|
30050
30065
|
evidence
|
|
30051
30066
|
};
|
|
30052
30067
|
return out;
|
|
@@ -30267,6 +30282,63 @@ function combineCertainty(left, right) {
|
|
|
30267
30282
|
if (left === "conditional" || right === "conditional") return "conditional";
|
|
30268
30283
|
return "resolved";
|
|
30269
30284
|
}
|
|
30285
|
+
var FLEX_GRID_GEOMETRIC_ALIGN_ITEMS = /* @__PURE__ */ new Set([
|
|
30286
|
+
"center",
|
|
30287
|
+
"flex-start",
|
|
30288
|
+
"flex-end",
|
|
30289
|
+
"start",
|
|
30290
|
+
"end",
|
|
30291
|
+
"stretch",
|
|
30292
|
+
"self-start",
|
|
30293
|
+
"self-end",
|
|
30294
|
+
"normal"
|
|
30295
|
+
]);
|
|
30296
|
+
function computeBaselineRelevance(kind, parentAlignItems, parentPlaceItems) {
|
|
30297
|
+
if (kind === "flex-cross-axis" || kind === "grid-cross-axis") {
|
|
30298
|
+
const effective = resolveEffectiveAlignItems(parentAlignItems, parentPlaceItems);
|
|
30299
|
+
if (effective === null) return "relevant";
|
|
30300
|
+
return FLEX_GRID_GEOMETRIC_ALIGN_ITEMS.has(effective) ? "irrelevant" : "relevant";
|
|
30301
|
+
}
|
|
30302
|
+
return "relevant";
|
|
30303
|
+
}
|
|
30304
|
+
function resolveEffectiveAlignItems(alignItems, placeItems) {
|
|
30305
|
+
if (alignItems !== null) return alignItems;
|
|
30306
|
+
if (placeItems === null) return null;
|
|
30307
|
+
const firstToken2 = placeItems.split(WHITESPACE_RE3)[0];
|
|
30308
|
+
return firstToken2 ?? null;
|
|
30309
|
+
}
|
|
30310
|
+
var TABLE_CELL_GEOMETRIC_VERTICAL_ALIGN = /* @__PURE__ */ new Set([
|
|
30311
|
+
"middle",
|
|
30312
|
+
"top",
|
|
30313
|
+
"bottom"
|
|
30314
|
+
]);
|
|
30315
|
+
function finalizeTableCellBaselineRelevance(contextByParentNode, cohortVerticalAlignConsensus) {
|
|
30316
|
+
for (const [parent, consensusValue] of cohortVerticalAlignConsensus) {
|
|
30317
|
+
const context = contextByParentNode.get(parent);
|
|
30318
|
+
if (!context) continue;
|
|
30319
|
+
if (context.kind !== "table-cell") continue;
|
|
30320
|
+
if (consensusValue === null) continue;
|
|
30321
|
+
if (!TABLE_CELL_GEOMETRIC_VERTICAL_ALIGN.has(consensusValue)) continue;
|
|
30322
|
+
contextByParentNode.set(parent, {
|
|
30323
|
+
kind: context.kind,
|
|
30324
|
+
certainty: context.certainty,
|
|
30325
|
+
parentSolidFile: context.parentSolidFile,
|
|
30326
|
+
parentElementId: context.parentElementId,
|
|
30327
|
+
parentElementKey: context.parentElementKey,
|
|
30328
|
+
parentTag: context.parentTag,
|
|
30329
|
+
axis: context.axis,
|
|
30330
|
+
axisCertainty: context.axisCertainty,
|
|
30331
|
+
inlineDirection: context.inlineDirection,
|
|
30332
|
+
inlineDirectionCertainty: context.inlineDirectionCertainty,
|
|
30333
|
+
parentDisplay: context.parentDisplay,
|
|
30334
|
+
parentAlignItems: context.parentAlignItems,
|
|
30335
|
+
parentPlaceItems: context.parentPlaceItems,
|
|
30336
|
+
hasPositionedOffset: context.hasPositionedOffset,
|
|
30337
|
+
baselineRelevance: "irrelevant",
|
|
30338
|
+
evidence: context.evidence
|
|
30339
|
+
});
|
|
30340
|
+
}
|
|
30341
|
+
}
|
|
30270
30342
|
|
|
30271
30343
|
// src/cross-file/layout/diagnostics.ts
|
|
30272
30344
|
var FINDING_WEIGHT_BY_KIND = /* @__PURE__ */ new Map([
|
|
@@ -32962,7 +33034,7 @@ var UNCONDITIONAL_GUARD = {
|
|
|
32962
33034
|
conditions: [],
|
|
32963
33035
|
key: "always"
|
|
32964
33036
|
};
|
|
32965
|
-
var
|
|
33037
|
+
var WHITESPACE_RE4 = /\s+/g;
|
|
32966
33038
|
function resolveRuleGuard(rule) {
|
|
32967
33039
|
const conditions = collectRuleConditions(rule);
|
|
32968
33040
|
if (conditions.length === 0) return UNCONDITIONAL_GUARD;
|
|
@@ -33021,7 +33093,7 @@ function buildCondition(kind, query) {
|
|
|
33021
33093
|
}
|
|
33022
33094
|
function normalizeQuery(query) {
|
|
33023
33095
|
if (query === null) return null;
|
|
33024
|
-
const normalized = query.trim().toLowerCase().replace(
|
|
33096
|
+
const normalized = query.trim().toLowerCase().replace(WHITESPACE_RE4, " ");
|
|
33025
33097
|
if (normalized.length === 0) return null;
|
|
33026
33098
|
return normalized;
|
|
33027
33099
|
}
|
|
@@ -33643,12 +33715,7 @@ function resolveInlineReplacedKindDivergence(subjectFingerprint, allFingerprints
|
|
|
33643
33715
|
return alignmentStrengthCalibration.compositionMixedOutlierAmongReplacedStrength;
|
|
33644
33716
|
}
|
|
33645
33717
|
function hasSharedBaselineAlignment(context) {
|
|
33646
|
-
|
|
33647
|
-
if (context.kind === "flex-cross-axis" || context.kind === "grid-cross-axis") {
|
|
33648
|
-
const alignItems = context.parentAlignItems;
|
|
33649
|
-
return alignItems === null || alignItems === "baseline";
|
|
33650
|
-
}
|
|
33651
|
-
return false;
|
|
33718
|
+
return context.baselineRelevance === "relevant";
|
|
33652
33719
|
}
|
|
33653
33720
|
function resolveMajorityClassification(allFingerprints) {
|
|
33654
33721
|
const countByClassification = /* @__PURE__ */ new Map();
|
|
@@ -33802,6 +33869,7 @@ function estimateBlockOffsetWithDeclaredFromSources(axis, position, readNumeric)
|
|
|
33802
33869
|
// src/cross-file/layout/cohort-index.ts
|
|
33803
33870
|
function buildCohortIndex(input) {
|
|
33804
33871
|
const statsByParentNode = /* @__PURE__ */ new Map();
|
|
33872
|
+
const verticalAlignConsensusByParent = /* @__PURE__ */ new Map();
|
|
33805
33873
|
const profileBuffers = createCohortProfileBuffers();
|
|
33806
33874
|
let conditionalSignals = 0;
|
|
33807
33875
|
let totalSignals = 0;
|
|
@@ -33876,12 +33944,14 @@ function buildCohortIndex(input) {
|
|
|
33876
33944
|
subjectsByElementKey,
|
|
33877
33945
|
excludedElementKeys: cohortMetricsResult.excludedElementKeys
|
|
33878
33946
|
});
|
|
33947
|
+
verticalAlignConsensusByParent.set(parent, resolveVerticalAlignConsensus(signalIndex.verticalAlign));
|
|
33879
33948
|
conditionalSignals += counts.conditional;
|
|
33880
33949
|
totalSignals += counts.total;
|
|
33881
33950
|
if (!profile.unimodal) unimodalFalseCount++;
|
|
33882
33951
|
}
|
|
33883
33952
|
return {
|
|
33884
33953
|
statsByParentNode,
|
|
33954
|
+
verticalAlignConsensusByParent,
|
|
33885
33955
|
conditionalSignals,
|
|
33886
33956
|
totalSignals,
|
|
33887
33957
|
unimodalFalseCount,
|
|
@@ -33901,6 +33971,10 @@ function collectCohortMetrics(input) {
|
|
|
33901
33971
|
const node = input.children[i];
|
|
33902
33972
|
if (!node) continue;
|
|
33903
33973
|
const childSnapshot = input.snapshotByElementNode.get(node);
|
|
33974
|
+
if (isLayoutHidden(node, input.snapshotByElementNode)) {
|
|
33975
|
+
excluded.add(node.key);
|
|
33976
|
+
continue;
|
|
33977
|
+
}
|
|
33904
33978
|
if (childSnapshot && isUnconditionallyOutOfFlow(childSnapshot)) {
|
|
33905
33979
|
excluded.add(node.key);
|
|
33906
33980
|
continue;
|
|
@@ -34700,6 +34774,13 @@ function swap(values, left, right) {
|
|
|
34700
34774
|
values[left] = rightValue;
|
|
34701
34775
|
values[right] = leftValue;
|
|
34702
34776
|
}
|
|
34777
|
+
function resolveVerticalAlignConsensus(aggregate) {
|
|
34778
|
+
if (aggregate.comparableCount === 0) return null;
|
|
34779
|
+
if (aggregate.countsByValue.size !== 1) return null;
|
|
34780
|
+
const firstEntry = aggregate.countsByValue.entries().next();
|
|
34781
|
+
if (firstEntry.done) return null;
|
|
34782
|
+
return firstEntry.value[0];
|
|
34783
|
+
}
|
|
34703
34784
|
|
|
34704
34785
|
// src/cross-file/layout/measurement-node.ts
|
|
34705
34786
|
var EMPTY_NODE_LIST = [];
|
|
@@ -34787,6 +34868,7 @@ function resolveMeasurementCandidates(root, childrenByParentNode, snapshotByElem
|
|
|
34787
34868
|
for (let i = 0; i < children.length; i++) {
|
|
34788
34869
|
const child = children[i];
|
|
34789
34870
|
if (!child) continue;
|
|
34871
|
+
if (isLayoutHidden(child, snapshotByElementNode)) continue;
|
|
34790
34872
|
if (firstControlOrReplacedDescendant === null && (child.isControl || child.isReplaced)) {
|
|
34791
34873
|
firstControlOrReplacedDescendant = child;
|
|
34792
34874
|
}
|
|
@@ -36301,6 +36383,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
36301
36383
|
snapshotByElementNode,
|
|
36302
36384
|
snapshotHotSignalsByElementKey: factIndex.snapshotHotSignalsByElementKey
|
|
36303
36385
|
});
|
|
36386
|
+
finalizeTableCellBaselineRelevance(contextByParentNode, cohortIndex.verticalAlignConsensusByParent);
|
|
36304
36387
|
perf.conditionalSignals = cohortIndex.conditionalSignals;
|
|
36305
36388
|
perf.totalSignals = cohortIndex.totalSignals;
|
|
36306
36389
|
perf.cohortUnimodalFalse = cohortIndex.unimodalFalseCount;
|
|
@@ -36641,6 +36724,12 @@ function collectAlignmentCases(context) {
|
|
|
36641
36724
|
if (!subjectStats) {
|
|
36642
36725
|
throw new Error(`missing subject cohort stats for ${measurementNode.key}`);
|
|
36643
36726
|
}
|
|
36727
|
+
const effectiveAlignmentContext = resolveEffectiveAlignmentContext(
|
|
36728
|
+
alignmentContext,
|
|
36729
|
+
child,
|
|
36730
|
+
measurementNode,
|
|
36731
|
+
context.layout.contextByParentNode
|
|
36732
|
+
);
|
|
36644
36733
|
const subjectDeclaredOffsetDeviation = computeDeviation(
|
|
36645
36734
|
subjectStats.declaredOffset,
|
|
36646
36735
|
subjectStats.baselineProfile.medianDeclaredOffsetPx
|
|
@@ -36656,7 +36745,7 @@ function collectAlignmentCases(context) {
|
|
|
36656
36745
|
out.push(
|
|
36657
36746
|
buildAlignmentCase(
|
|
36658
36747
|
parent,
|
|
36659
|
-
|
|
36748
|
+
effectiveAlignmentContext,
|
|
36660
36749
|
cohortStats.profile,
|
|
36661
36750
|
subjectStats.signals,
|
|
36662
36751
|
subjectStats.identifiability,
|
|
@@ -36805,6 +36894,31 @@ function collectCohortContentCompositions(cohortStats, children, measurementNode
|
|
|
36805
36894
|
}
|
|
36806
36895
|
return out;
|
|
36807
36896
|
}
|
|
36897
|
+
function resolveEffectiveAlignmentContext(parentContext, child, measurementNode, contextByParentNode) {
|
|
36898
|
+
if (child === measurementNode) return parentContext;
|
|
36899
|
+
if (parentContext.baselineRelevance === "irrelevant") return parentContext;
|
|
36900
|
+
const childContext = contextByParentNode.get(child);
|
|
36901
|
+
if (!childContext) return parentContext;
|
|
36902
|
+
if (childContext.baselineRelevance !== "irrelevant") return parentContext;
|
|
36903
|
+
return {
|
|
36904
|
+
kind: parentContext.kind,
|
|
36905
|
+
certainty: parentContext.certainty,
|
|
36906
|
+
parentSolidFile: parentContext.parentSolidFile,
|
|
36907
|
+
parentElementId: parentContext.parentElementId,
|
|
36908
|
+
parentElementKey: parentContext.parentElementKey,
|
|
36909
|
+
parentTag: parentContext.parentTag,
|
|
36910
|
+
axis: parentContext.axis,
|
|
36911
|
+
axisCertainty: parentContext.axisCertainty,
|
|
36912
|
+
inlineDirection: parentContext.inlineDirection,
|
|
36913
|
+
inlineDirectionCertainty: parentContext.inlineDirectionCertainty,
|
|
36914
|
+
parentDisplay: parentContext.parentDisplay,
|
|
36915
|
+
parentAlignItems: parentContext.parentAlignItems,
|
|
36916
|
+
parentPlaceItems: parentContext.parentPlaceItems,
|
|
36917
|
+
hasPositionedOffset: parentContext.hasPositionedOffset,
|
|
36918
|
+
baselineRelevance: "irrelevant",
|
|
36919
|
+
evidence: parentContext.evidence
|
|
36920
|
+
};
|
|
36921
|
+
}
|
|
36808
36922
|
function compareAlignmentCaseOrder(left, right) {
|
|
36809
36923
|
if (left.subject.solidFile < right.subject.solidFile) return -1;
|
|
36810
36924
|
if (left.subject.solidFile > right.subject.solidFile) return 1;
|
|
@@ -36837,10 +36951,11 @@ function buildConsistencyEvidence(input) {
|
|
|
36837
36951
|
input.cohortProfile.lineHeightDispersionPx,
|
|
36838
36952
|
input.cohortProfile.medianLineHeightPx
|
|
36839
36953
|
);
|
|
36840
|
-
const
|
|
36841
|
-
const
|
|
36842
|
-
const
|
|
36843
|
-
const
|
|
36954
|
+
const baselinesIrrelevant = input.context.baselineRelevance === "irrelevant";
|
|
36955
|
+
const baselineStrength = baselinesIrrelevant ? ZERO_STRENGTH : resolveBaselineStrength(input, lineHeight);
|
|
36956
|
+
const contextStrength = baselinesIrrelevant ? ZERO_STRENGTH : resolveContextStrength(input, lineHeight);
|
|
36957
|
+
const replacedStrength = baselinesIrrelevant ? ZERO_STRENGTH : resolveReplacedControlStrength(input, lineHeight);
|
|
36958
|
+
const compositionStrength = baselinesIrrelevant ? ZERO_STRENGTH : resolveContentCompositionStrength(input);
|
|
36844
36959
|
const contextCertaintyPenalty = resolveContextCertaintyPenalty(input);
|
|
36845
36960
|
const provenance = input.cohortProvenance;
|
|
36846
36961
|
const atoms = buildEvidenceAtoms(
|
|
@@ -37136,6 +37251,7 @@ function toNegativeContribution(strength, maxPenalty, valueKind) {
|
|
|
37136
37251
|
max: 0
|
|
37137
37252
|
};
|
|
37138
37253
|
}
|
|
37254
|
+
var ZERO_STRENGTH = { strength: 0, kind: "exact" };
|
|
37139
37255
|
|
|
37140
37256
|
// src/cross-file/layout/consistency-policy.ts
|
|
37141
37257
|
function applyConsistencyPolicy(input) {
|
|
@@ -37355,6 +37471,7 @@ function runLayoutDetector(context, detector) {
|
|
|
37355
37471
|
const cases = detector.collect(context);
|
|
37356
37472
|
const startedAt = performance.now();
|
|
37357
37473
|
const out = [];
|
|
37474
|
+
const log = context.logger;
|
|
37358
37475
|
for (let i = 0; i < cases.length; i++) {
|
|
37359
37476
|
const current = cases[i];
|
|
37360
37477
|
if (!current) continue;
|
|
@@ -37367,10 +37484,20 @@ function runLayoutDetector(context, detector) {
|
|
|
37367
37484
|
result.evidence.posteriorLower,
|
|
37368
37485
|
result.evidence.posteriorUpper
|
|
37369
37486
|
);
|
|
37487
|
+
if (log.enabled) {
|
|
37488
|
+
log.debug(
|
|
37489
|
+
`[${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("; ")}]`
|
|
37490
|
+
);
|
|
37491
|
+
}
|
|
37370
37492
|
out.push({ caseData: current, evidence: result.evidence });
|
|
37371
37493
|
continue;
|
|
37372
37494
|
}
|
|
37373
37495
|
recordPolicyMetrics(context, result.evidenceMass, result.posteriorLower, result.posteriorUpper);
|
|
37496
|
+
if (log.enabled) {
|
|
37497
|
+
log.debug(
|
|
37498
|
+
`[${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)}`
|
|
37499
|
+
);
|
|
37500
|
+
}
|
|
37374
37501
|
if (result.reason === "low-evidence") {
|
|
37375
37502
|
context.layout.perf.casesRejectedLowEvidence++;
|
|
37376
37503
|
continue;
|
|
@@ -38151,33 +38278,73 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
38151
38278
|
category: "css-layout"
|
|
38152
38279
|
},
|
|
38153
38280
|
check(context, emit) {
|
|
38281
|
+
const log = context.logger;
|
|
38154
38282
|
const detections = runLayoutDetector(context, siblingAlignmentDetector);
|
|
38155
38283
|
const uniqueDetections = dedupeDetectionsBySubject(detections);
|
|
38284
|
+
if (log.enabled) {
|
|
38285
|
+
log.debug(
|
|
38286
|
+
`[sibling-alignment] raw=${detections.length} deduped=${uniqueDetections.length}`
|
|
38287
|
+
);
|
|
38288
|
+
}
|
|
38156
38289
|
for (let i = 0; i < uniqueDetections.length; i++) {
|
|
38157
38290
|
const detection = uniqueDetections[i];
|
|
38158
38291
|
if (!detection) continue;
|
|
38159
|
-
|
|
38292
|
+
const subjectTag = detection.caseData.subject.tag ?? "element";
|
|
38293
|
+
const parentTag = detection.caseData.cohort.parentTag ?? "container";
|
|
38294
|
+
const subjectFile = detection.caseData.subject.solidFile;
|
|
38295
|
+
const subjectId = detection.caseData.subject.elementId;
|
|
38296
|
+
const logPrefix = `[sibling-alignment] <${subjectTag}> in <${parentTag}> (${subjectFile}#${subjectId})`;
|
|
38297
|
+
if (detection.evidence.confidence < MIN_CONFIDENCE_THRESHOLD) {
|
|
38298
|
+
if (log.enabled) {
|
|
38299
|
+
log.debug(
|
|
38300
|
+
`${logPrefix} SKIP: confidence=${detection.evidence.confidence.toFixed(2)} < threshold=${MIN_CONFIDENCE_THRESHOLD}`
|
|
38301
|
+
);
|
|
38302
|
+
}
|
|
38303
|
+
continue;
|
|
38304
|
+
}
|
|
38160
38305
|
const estimatedOffset = detection.evidence.estimatedOffsetPx;
|
|
38161
|
-
if (estimatedOffset !== null && Math.abs(estimatedOffset) < MIN_OFFSET_PX_THRESHOLD && !hasNonOffsetPrimaryEvidence(detection.evidence.topFactors))
|
|
38306
|
+
if (estimatedOffset !== null && Math.abs(estimatedOffset) < MIN_OFFSET_PX_THRESHOLD && !hasNonOffsetPrimaryEvidence(detection.evidence.topFactors)) {
|
|
38307
|
+
if (log.enabled) {
|
|
38308
|
+
log.debug(
|
|
38309
|
+
`${logPrefix} SKIP: offset=${estimatedOffset.toFixed(2)}px < ${MIN_OFFSET_PX_THRESHOLD}px (no non-offset primary evidence, topFactors=[${detection.evidence.topFactors.join(",")}])`
|
|
38310
|
+
);
|
|
38311
|
+
}
|
|
38312
|
+
continue;
|
|
38313
|
+
}
|
|
38162
38314
|
if (isInsideOutOfFlowAncestor(
|
|
38163
38315
|
context.layout,
|
|
38164
38316
|
detection.caseData.cohort.parentElementKey,
|
|
38165
38317
|
detection.caseData.subject.solidFile
|
|
38166
|
-
))
|
|
38318
|
+
)) {
|
|
38319
|
+
if (log.enabled) {
|
|
38320
|
+
log.debug(`${logPrefix} SKIP: out-of-flow ancestor`);
|
|
38321
|
+
}
|
|
38322
|
+
continue;
|
|
38323
|
+
}
|
|
38167
38324
|
const subjectRef = readNodeRefById(
|
|
38168
38325
|
context.layout,
|
|
38169
38326
|
detection.caseData.subject.solidFile,
|
|
38170
38327
|
detection.caseData.subject.elementId
|
|
38171
38328
|
);
|
|
38172
|
-
if (!subjectRef)
|
|
38173
|
-
|
|
38174
|
-
|
|
38329
|
+
if (!subjectRef) {
|
|
38330
|
+
if (log.enabled) {
|
|
38331
|
+
log.debug(`${logPrefix} SKIP: no node ref`);
|
|
38332
|
+
}
|
|
38333
|
+
continue;
|
|
38334
|
+
}
|
|
38335
|
+
const subject = subjectTag;
|
|
38336
|
+
const parent = parentTag;
|
|
38175
38337
|
const severity = formatFixed(detection.evidence.severity);
|
|
38176
38338
|
const confidence = formatFixed(detection.evidence.confidence);
|
|
38177
38339
|
const offset = detection.evidence.estimatedOffsetPx;
|
|
38178
38340
|
const hasOffset = offset !== null && Math.abs(offset) > 0.25;
|
|
38179
38341
|
const offsetClause = hasOffset ? `, estimated offset ${formatFixed(offset)}px` : "";
|
|
38180
38342
|
const causes = detection.evidence.causes.length === 0 ? "alignment signals indicate an outlier" : detection.evidence.causes.join("; ");
|
|
38343
|
+
if (log.enabled) {
|
|
38344
|
+
log.debug(
|
|
38345
|
+
`${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}]`
|
|
38346
|
+
);
|
|
38347
|
+
}
|
|
38181
38348
|
emit(
|
|
38182
38349
|
createDiagnostic(
|
|
38183
38350
|
subjectRef.solid.file,
|
|
@@ -39715,7 +39882,8 @@ var CrossFilePlugin = {
|
|
|
39715
39882
|
const context = {
|
|
39716
39883
|
solids: solidGraphs,
|
|
39717
39884
|
css: cssGraph,
|
|
39718
|
-
layout: buildLayoutGraph(solidGraphs, cssGraph)
|
|
39885
|
+
layout: buildLayoutGraph(solidGraphs, cssGraph),
|
|
39886
|
+
logger: noopLogger
|
|
39719
39887
|
};
|
|
39720
39888
|
runCrossFileRules(context, emit);
|
|
39721
39889
|
}
|
|
@@ -39754,7 +39922,8 @@ function buildCrossContext(context) {
|
|
|
39754
39922
|
return {
|
|
39755
39923
|
solids: [solidGraph],
|
|
39756
39924
|
css: cssGraph,
|
|
39757
|
-
layout: buildLayoutGraph([solidGraph], cssGraph)
|
|
39925
|
+
layout: buildLayoutGraph([solidGraph], cssGraph),
|
|
39926
|
+
logger: noopLogger
|
|
39758
39927
|
};
|
|
39759
39928
|
}
|
|
39760
39929
|
var { eslintRules: eslintRules3 } = createBatchPluginAdapter(
|