@drskillissue/ganko 0.2.5 → 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-HIADOXXV.js → chunk-WY5MMHK2.js} +249 -84
- package/dist/chunk-WY5MMHK2.js.map +1 -0
- package/dist/eslint-plugin.cjs +243 -83
- package/dist/eslint-plugin.cjs.map +1 -1
- package/dist/eslint-plugin.js +1 -1
- package/dist/index.cjs +268 -104
- 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-HIADOXXV.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -151,9 +151,29 @@ function canonicalPath(path) {
|
|
|
151
151
|
return canonical;
|
|
152
152
|
}
|
|
153
153
|
var LOG_LEVELS = ["trace", "debug", "info", "warning", "error", "critical", "off"];
|
|
154
|
+
var Level = {
|
|
155
|
+
Trace: 0,
|
|
156
|
+
Debug: 1,
|
|
157
|
+
Info: 2,
|
|
158
|
+
Warning: 3,
|
|
159
|
+
Error: 4,
|
|
160
|
+
Critical: 5,
|
|
161
|
+
Off: 6
|
|
162
|
+
};
|
|
163
|
+
var LOG_LEVEL_ORDER = {
|
|
164
|
+
trace: Level.Trace,
|
|
165
|
+
debug: Level.Debug,
|
|
166
|
+
info: Level.Info,
|
|
167
|
+
warning: Level.Warning,
|
|
168
|
+
error: Level.Error,
|
|
169
|
+
critical: Level.Critical,
|
|
170
|
+
off: Level.Off
|
|
171
|
+
};
|
|
154
172
|
var noopLogger = {
|
|
155
|
-
enabled: false,
|
|
156
173
|
level: "off",
|
|
174
|
+
isLevelEnabled() {
|
|
175
|
+
return false;
|
|
176
|
+
},
|
|
157
177
|
trace() {
|
|
158
178
|
},
|
|
159
179
|
debug() {
|
|
@@ -2790,7 +2810,7 @@ var GraphCache = class {
|
|
|
2790
2810
|
const key = canonicalPath(path);
|
|
2791
2811
|
const cached = this.solids.get(key);
|
|
2792
2812
|
const hit = cached !== void 0 && cached.version === version;
|
|
2793
|
-
if (this.log.
|
|
2813
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`hasSolidGraph: ${key} v=${version} cached=${cached?.version ?? "none"} hit=${hit} (${this.solids.size} total)`);
|
|
2794
2814
|
return hit;
|
|
2795
2815
|
}
|
|
2796
2816
|
/**
|
|
@@ -2807,7 +2827,7 @@ var GraphCache = class {
|
|
|
2807
2827
|
const key = canonicalPath(path);
|
|
2808
2828
|
this.solids.set(key, { version, graph });
|
|
2809
2829
|
this.solidGeneration++;
|
|
2810
|
-
if (this.log.
|
|
2830
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`setSolidGraph: ${key} v=${version} (${this.solids.size} total) solidGen=${this.solidGeneration}`);
|
|
2811
2831
|
}
|
|
2812
2832
|
/**
|
|
2813
2833
|
* Get a cached SolidGraph without building on miss.
|
|
@@ -2823,10 +2843,10 @@ var GraphCache = class {
|
|
|
2823
2843
|
const key = canonicalPath(path);
|
|
2824
2844
|
const cached = this.solids.get(key);
|
|
2825
2845
|
if (cached !== void 0 && cached.version === version) {
|
|
2826
|
-
if (this.log.
|
|
2846
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCachedSolidGraph HIT: ${key} v=${version}`);
|
|
2827
2847
|
return cached.graph;
|
|
2828
2848
|
}
|
|
2829
|
-
if (this.log.
|
|
2849
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCachedSolidGraph MISS: ${key} v=${version}`);
|
|
2830
2850
|
return null;
|
|
2831
2851
|
}
|
|
2832
2852
|
/**
|
|
@@ -2843,15 +2863,15 @@ var GraphCache = class {
|
|
|
2843
2863
|
const key = canonicalPath(path);
|
|
2844
2864
|
const cached = this.solids.get(key);
|
|
2845
2865
|
if (cached !== void 0 && cached.version === version) {
|
|
2846
|
-
if (this.log.
|
|
2866
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getSolidGraph HIT: ${key} v=${version}`);
|
|
2847
2867
|
return cached.graph;
|
|
2848
2868
|
}
|
|
2849
|
-
if (this.log.
|
|
2869
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getSolidGraph MISS: ${key} v=${version} (was ${cached?.version ?? "uncached"})`);
|
|
2850
2870
|
const t0 = performance.now();
|
|
2851
2871
|
const graph = build();
|
|
2852
2872
|
this.solids.set(key, { version, graph });
|
|
2853
2873
|
this.solidGeneration++;
|
|
2854
|
-
if (this.log.
|
|
2874
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getSolidGraph BUILT: ${key} v=${version} in ${performance.now() - t0}ms (${this.solids.size} total) solidGen=${this.solidGeneration}`);
|
|
2855
2875
|
return graph;
|
|
2856
2876
|
}
|
|
2857
2877
|
/**
|
|
@@ -2865,14 +2885,14 @@ var GraphCache = class {
|
|
|
2865
2885
|
*/
|
|
2866
2886
|
getCSSGraph(build) {
|
|
2867
2887
|
if (this.css !== null && this.css.generation === this.cssGeneration) {
|
|
2868
|
-
if (this.log.
|
|
2888
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCSSGraph HIT: gen=${this.cssGeneration}`);
|
|
2869
2889
|
return this.css.graph;
|
|
2870
2890
|
}
|
|
2871
|
-
if (this.log.
|
|
2891
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCSSGraph MISS: currentGen=${this.cssGeneration} cachedGen=${this.css?.generation ?? "none"}`);
|
|
2872
2892
|
const t0 = performance.now();
|
|
2873
2893
|
const graph = build();
|
|
2874
2894
|
this.css = { generation: this.cssGeneration, graph };
|
|
2875
|
-
if (this.log.
|
|
2895
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCSSGraph BUILT: gen=${this.cssGeneration} in ${performance.now() - t0}ms`);
|
|
2876
2896
|
return graph;
|
|
2877
2897
|
}
|
|
2878
2898
|
/**
|
|
@@ -2887,10 +2907,10 @@ var GraphCache = class {
|
|
|
2887
2907
|
const solidGen = this.solidGeneration;
|
|
2888
2908
|
const cssGen = this.cssGeneration;
|
|
2889
2909
|
if (this.layout !== null && this.layout.solidGeneration === solidGen && this.layout.cssGeneration === cssGen) {
|
|
2890
|
-
if (this.log.
|
|
2910
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getLayoutGraph HIT: solidGen=${solidGen} cssGen=${cssGen}`);
|
|
2891
2911
|
return this.layout.graph;
|
|
2892
2912
|
}
|
|
2893
|
-
if (this.log.
|
|
2913
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(
|
|
2894
2914
|
`getLayoutGraph MISS: solidGen=${solidGen} cssGen=${cssGen} cached=${this.layout !== null}`
|
|
2895
2915
|
);
|
|
2896
2916
|
const t0 = performance.now();
|
|
@@ -2900,7 +2920,7 @@ var GraphCache = class {
|
|
|
2900
2920
|
cssGeneration: cssGen,
|
|
2901
2921
|
graph
|
|
2902
2922
|
};
|
|
2903
|
-
if (this.log.
|
|
2923
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getLayoutGraph BUILT: in ${performance.now() - t0}ms`);
|
|
2904
2924
|
return graph;
|
|
2905
2925
|
}
|
|
2906
2926
|
/**
|
|
@@ -2915,7 +2935,7 @@ var GraphCache = class {
|
|
|
2915
2935
|
invalidate(path) {
|
|
2916
2936
|
const key = canonicalPath(path);
|
|
2917
2937
|
const kind = classifyFile(key);
|
|
2918
|
-
if (this.log.
|
|
2938
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`invalidate: ${key} kind=${kind} solids=${this.solids.size} hasCrossFileResults=${this.crossFileResults !== null} hasLayout=${this.layout !== null}`);
|
|
2919
2939
|
if (kind === "solid") {
|
|
2920
2940
|
const had = this.solids.has(key);
|
|
2921
2941
|
this.solids.delete(key);
|
|
@@ -2923,7 +2943,7 @@ var GraphCache = class {
|
|
|
2923
2943
|
this.crossFileResults = null;
|
|
2924
2944
|
this.solidGeneration++;
|
|
2925
2945
|
this.layout = null;
|
|
2926
|
-
if (this.log.
|
|
2946
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`invalidate SOLID: ${key} wasInCache=${had} solids=${this.solids.size} solidGen=${this.solidGeneration}`);
|
|
2927
2947
|
}
|
|
2928
2948
|
if (kind === "css") {
|
|
2929
2949
|
this.crossFileDiagnostics.delete(key);
|
|
@@ -2931,7 +2951,7 @@ var GraphCache = class {
|
|
|
2931
2951
|
this.cssGeneration++;
|
|
2932
2952
|
this.css = null;
|
|
2933
2953
|
this.layout = null;
|
|
2934
|
-
if (this.log.
|
|
2954
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`invalidate CSS: ${key} newCssGen=${this.cssGeneration}`);
|
|
2935
2955
|
}
|
|
2936
2956
|
}
|
|
2937
2957
|
/**
|
|
@@ -2940,7 +2960,7 @@ var GraphCache = class {
|
|
|
2940
2960
|
* Called on workspace-level events like config changes.
|
|
2941
2961
|
*/
|
|
2942
2962
|
invalidateAll() {
|
|
2943
|
-
if (this.log.
|
|
2963
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`invalidateAll: solids=${this.solids.size} solidGen=${this.solidGeneration} cssGen=${this.cssGeneration}`);
|
|
2944
2964
|
this.solids.clear();
|
|
2945
2965
|
this.crossFileDiagnostics.clear();
|
|
2946
2966
|
this.crossFileResults = null;
|
|
@@ -2956,7 +2976,7 @@ var GraphCache = class {
|
|
|
2956
2976
|
* Used by cross-file analysis which needs all SolidGraphs.
|
|
2957
2977
|
*/
|
|
2958
2978
|
getAllSolidGraphs() {
|
|
2959
|
-
if (this.log.
|
|
2979
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getAllSolidGraphs: ${this.solids.size} graphs`);
|
|
2960
2980
|
const out = new Array(this.solids.size);
|
|
2961
2981
|
let i = 0;
|
|
2962
2982
|
for (const entry of this.solids.values()) {
|
|
@@ -3012,10 +3032,10 @@ var GraphCache = class {
|
|
|
3012
3032
|
const solidMatch = this.crossFileResults.solidGeneration === this.solidGeneration;
|
|
3013
3033
|
const cssMatch = this.crossFileResults.cssGeneration === this.cssGeneration;
|
|
3014
3034
|
if (solidMatch && cssMatch) {
|
|
3015
|
-
if (this.log.
|
|
3035
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(`getCachedCrossFileResults HIT: ${this.crossFileResults?.byFile.size} files`);
|
|
3016
3036
|
return this.crossFileResults.byFile;
|
|
3017
3037
|
}
|
|
3018
|
-
if (this.log.
|
|
3038
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(
|
|
3019
3039
|
`getCachedCrossFileResults MISS: solidMatch=${solidMatch} cssMatch=${cssMatch} cachedSolidGen=${this.crossFileResults?.solidGeneration} currentSolidGen=${this.solidGeneration} cachedCssGen=${this.crossFileResults?.cssGeneration} currentCssGen=${this.cssGeneration}`
|
|
3020
3040
|
);
|
|
3021
3041
|
return null;
|
|
@@ -3046,7 +3066,7 @@ var GraphCache = class {
|
|
|
3046
3066
|
cssGeneration: this.cssGeneration,
|
|
3047
3067
|
byFile
|
|
3048
3068
|
};
|
|
3049
|
-
if (this.log.
|
|
3069
|
+
if (this.log.isLevelEnabled(Level.Debug)) this.log.debug(
|
|
3050
3070
|
`setCachedCrossFileResults: ${allDiagnostics.length} diags across ${byFile.size} files solidGen=${this.solidGeneration} cssGen=${this.cssGeneration}`
|
|
3051
3071
|
);
|
|
3052
3072
|
this.crossFileDiagnostics.clear();
|
|
@@ -3358,6 +3378,35 @@ var TypeResolver = class {
|
|
|
3358
3378
|
return false;
|
|
3359
3379
|
}
|
|
3360
3380
|
}
|
|
3381
|
+
/**
|
|
3382
|
+
* Strict array check: only matches Array<T>, T[], ReadonlyArray<T>, and tuples.
|
|
3383
|
+
* Does NOT match typed arrays (Uint8Array, Buffer, etc.) or other types with
|
|
3384
|
+
* a numeric index signature.
|
|
3385
|
+
*/
|
|
3386
|
+
isStrictArrayType(node) {
|
|
3387
|
+
try {
|
|
3388
|
+
const tsType = this.checker.getTypeAtLocation(node);
|
|
3389
|
+
return this.checkIsStrictArrayType(tsType);
|
|
3390
|
+
} catch {
|
|
3391
|
+
return false;
|
|
3392
|
+
}
|
|
3393
|
+
}
|
|
3394
|
+
checkIsStrictArrayType(tsType) {
|
|
3395
|
+
if (tsType.flags & 524288) {
|
|
3396
|
+
const objFlags = getObjectFlags(tsType);
|
|
3397
|
+
if (objFlags & 8) return true;
|
|
3398
|
+
if (objFlags & 4) {
|
|
3399
|
+
const name = tsType.getSymbol()?.getName();
|
|
3400
|
+
if (name === "Array" || name === "ReadonlyArray") return true;
|
|
3401
|
+
}
|
|
3402
|
+
}
|
|
3403
|
+
if (tsType.isUnion()) {
|
|
3404
|
+
for (const t of tsType.types) {
|
|
3405
|
+
if (this.checkIsStrictArrayType(t)) return true;
|
|
3406
|
+
}
|
|
3407
|
+
}
|
|
3408
|
+
return false;
|
|
3409
|
+
}
|
|
3361
3410
|
checkIsArrayType(tsType) {
|
|
3362
3411
|
if (tsType.flags & 524288) {
|
|
3363
3412
|
const objFlags = getObjectFlags(tsType);
|
|
@@ -3409,7 +3458,7 @@ var TypeResolver = class {
|
|
|
3409
3458
|
if (exprTsType.flags & import_typescript2.default.TypeFlags.Any) return false;
|
|
3410
3459
|
if (targetTsType.flags & import_typescript2.default.TypeFlags.Any) return false;
|
|
3411
3460
|
const result = this.checker.isTypeAssignableTo(exprTsType, targetTsType);
|
|
3412
|
-
if (this.logger.
|
|
3461
|
+
if (this.logger.isLevelEnabled(Level.Debug)) {
|
|
3413
3462
|
const exprStr = this.checker.typeToString(exprTsType);
|
|
3414
3463
|
const targetStr = this.checker.typeToString(targetTsType);
|
|
3415
3464
|
this.logger.debug(`isUnnecessaryCast: expr="${exprStr.slice(0, 120)}" target="${targetStr.slice(0, 120)}" assignable=${result} exprFlags=${exprTsType.flags} targetFlags=${targetTsType.flags}`);
|
|
@@ -10373,6 +10422,9 @@ function typeIncludesString(graph, node) {
|
|
|
10373
10422
|
function typeIsArray(graph, node) {
|
|
10374
10423
|
return graph.typeResolver.isArrayType(node);
|
|
10375
10424
|
}
|
|
10425
|
+
function typeIsStrictArray(graph, node) {
|
|
10426
|
+
return graph.typeResolver.isStrictArrayType(node);
|
|
10427
|
+
}
|
|
10376
10428
|
function getArrayElementKind(graph, node) {
|
|
10377
10429
|
return graph.typeResolver.getArrayElementKind(node);
|
|
10378
10430
|
}
|
|
@@ -20168,6 +20220,7 @@ var preferSetLookupInLoop = defineSolidRule({
|
|
|
20168
20220
|
options: options77,
|
|
20169
20221
|
check(graph, emit) {
|
|
20170
20222
|
const reported = /* @__PURE__ */ new Set();
|
|
20223
|
+
const graphHasTypes = hasTypeInfo(graph);
|
|
20171
20224
|
for (const method of LINEAR_SEARCH_METHODS) {
|
|
20172
20225
|
const calls = getCallsByMethodName(graph, method);
|
|
20173
20226
|
for (let i = 0, len = calls.length; i < len; i++) {
|
|
@@ -20185,6 +20238,7 @@ var preferSetLookupInLoop = defineSolidRule({
|
|
|
20185
20238
|
const loop = getEnclosingLoop(call.node);
|
|
20186
20239
|
if (!loop) continue;
|
|
20187
20240
|
if (!isDeclaredOutsideLoop2(loop, variable)) continue;
|
|
20241
|
+
if (graphHasTypes && !typeIsStrictArray(graph, callee.expression)) continue;
|
|
20188
20242
|
if (isStringLikeReceiver(graph, callee.expression, variable)) continue;
|
|
20189
20243
|
const key = `${loop.pos}:var:${variable.id}`;
|
|
20190
20244
|
if (reported.has(key)) continue;
|
|
@@ -29284,8 +29338,12 @@ var POLICIES = {
|
|
|
29284
29338
|
"dense-ui": DENSE_UI,
|
|
29285
29339
|
"large-text": LARGE_TEXT
|
|
29286
29340
|
};
|
|
29287
|
-
var activePolicyName =
|
|
29341
|
+
var activePolicyName = null;
|
|
29288
29342
|
function setActivePolicy(name) {
|
|
29343
|
+
if (name === null) {
|
|
29344
|
+
activePolicyName = null;
|
|
29345
|
+
return;
|
|
29346
|
+
}
|
|
29289
29347
|
const match = ACCESSIBILITY_POLICIES.find((n) => n === name);
|
|
29290
29348
|
if (match) {
|
|
29291
29349
|
activePolicyName = match;
|
|
@@ -29295,6 +29353,7 @@ function getActivePolicyName() {
|
|
|
29295
29353
|
return activePolicyName;
|
|
29296
29354
|
}
|
|
29297
29355
|
function getActivePolicy() {
|
|
29356
|
+
if (activePolicyName === null) return null;
|
|
29298
29357
|
return POLICIES[activePolicyName];
|
|
29299
29358
|
}
|
|
29300
29359
|
|
|
@@ -29613,7 +29672,8 @@ var cssPolicyContrast = defineCSSRule({
|
|
|
29613
29672
|
options: {},
|
|
29614
29673
|
check(graph, emit) {
|
|
29615
29674
|
const policy = getActivePolicy();
|
|
29616
|
-
|
|
29675
|
+
if (policy === null) return;
|
|
29676
|
+
const name = getActivePolicyName() ?? "";
|
|
29617
29677
|
const colorDecls = graph.declarationsByProperty.get("color");
|
|
29618
29678
|
if (!colorDecls) return;
|
|
29619
29679
|
const candidates = /* @__PURE__ */ new Set();
|
|
@@ -29690,7 +29750,8 @@ var cssPolicySpacing = defineCSSRule({
|
|
|
29690
29750
|
options: {},
|
|
29691
29751
|
check(graph, emit) {
|
|
29692
29752
|
const policy = getActivePolicy();
|
|
29693
|
-
|
|
29753
|
+
if (policy === null) return;
|
|
29754
|
+
const name = getActivePolicyName() ?? "";
|
|
29694
29755
|
const letterDecls = graph.declarationsByProperty.get("letter-spacing");
|
|
29695
29756
|
if (letterDecls) {
|
|
29696
29757
|
for (let i = 0; i < letterDecls.length; i++) {
|
|
@@ -29799,7 +29860,8 @@ var cssPolicyTouchTarget = defineCSSRule({
|
|
|
29799
29860
|
options: {},
|
|
29800
29861
|
check(graph, emit) {
|
|
29801
29862
|
const policy = getActivePolicy();
|
|
29802
|
-
|
|
29863
|
+
if (policy === null) return;
|
|
29864
|
+
const name = getActivePolicyName() ?? "";
|
|
29803
29865
|
const decls = graph.declarationsForProperties(
|
|
29804
29866
|
"height",
|
|
29805
29867
|
"min-height",
|
|
@@ -29958,7 +30020,8 @@ var cssPolicyTypography = defineCSSRule({
|
|
|
29958
30020
|
options: {},
|
|
29959
30021
|
check(graph, emit) {
|
|
29960
30022
|
const policy = getActivePolicy();
|
|
29961
|
-
|
|
30023
|
+
if (policy === null) return;
|
|
30024
|
+
const name = getActivePolicyName() ?? "";
|
|
29962
30025
|
const fontDecls = graph.declarationsByProperty.get("font-size");
|
|
29963
30026
|
if (fontDecls) {
|
|
29964
30027
|
for (let i = 0; i < fontDecls.length; i++) {
|
|
@@ -31731,6 +31794,9 @@ function readBaselineOffsetFacts(graph, node) {
|
|
|
31731
31794
|
function readElementRef(graph, node) {
|
|
31732
31795
|
return readElementRefById(graph, node.solidFile, node.elementId);
|
|
31733
31796
|
}
|
|
31797
|
+
function readHostElementRef(graph, node) {
|
|
31798
|
+
return graph.hostElementRefsByNode.get(node) ?? null;
|
|
31799
|
+
}
|
|
31734
31800
|
function readElementRefById(graph, solidFile, elementId) {
|
|
31735
31801
|
const refs = graph.elementRefsBySolidFileAndId.get(solidFile);
|
|
31736
31802
|
if (!refs) return null;
|
|
@@ -32796,7 +32862,7 @@ function publishLayoutPerfStatsForTest(stats) {
|
|
|
32796
32862
|
}
|
|
32797
32863
|
function maybeLogLayoutPerf(stats, log) {
|
|
32798
32864
|
if (process.env["SOLID_LINT_LAYOUT_PROFILE"] !== "1") return;
|
|
32799
|
-
if (!log || !log.
|
|
32865
|
+
if (!log || !log.isLevelEnabled(Level.Debug)) return;
|
|
32800
32866
|
const view = snapshotLayoutPerfStats(stats);
|
|
32801
32867
|
log.debug(
|
|
32802
32868
|
`[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}`
|
|
@@ -32844,17 +32910,17 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32844
32910
|
if (cached !== void 0) return cached;
|
|
32845
32911
|
const binding = resolveTagBinding(normalizedFile, tag);
|
|
32846
32912
|
if (binding === null) {
|
|
32847
|
-
if (logger.
|
|
32913
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveHost(${tag}): binding=null`);
|
|
32848
32914
|
hostByTagCache.set(cacheKey, null);
|
|
32849
32915
|
return null;
|
|
32850
32916
|
}
|
|
32851
32917
|
if (binding.kind === "component") {
|
|
32852
|
-
if (logger.
|
|
32918
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveHost(${tag}): component, tagName=${binding.host.descriptor.tagName}, attrs=[${[...binding.host.descriptor.staticAttributes.keys()]}]`);
|
|
32853
32919
|
hostByTagCache.set(cacheKey, binding.host);
|
|
32854
32920
|
return binding.host;
|
|
32855
32921
|
}
|
|
32856
32922
|
const host = binding.base ? binding.base.host : null;
|
|
32857
|
-
if (logger.
|
|
32923
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveHost(${tag}): namespace, base=${host?.descriptor.tagName ?? "null"}`);
|
|
32858
32924
|
hostByTagCache.set(cacheKey, host);
|
|
32859
32925
|
return host;
|
|
32860
32926
|
},
|
|
@@ -32867,26 +32933,26 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32867
32933
|
}
|
|
32868
32934
|
};
|
|
32869
32935
|
function resolveComponentHostEntry(entry) {
|
|
32870
|
-
if (entry.resolution === "resolved")
|
|
32871
|
-
|
|
32936
|
+
if (entry.resolution === "resolved") {
|
|
32937
|
+
return { descriptor: entry.descriptor, hostElementRef: entry.hostElementRef };
|
|
32938
|
+
}
|
|
32939
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveComponentHostEntry: deferred innerTag=${entry.innerTag}, file=${entry.filePath}, attrs=[${[...entry.staticAttributes.keys()]}]`);
|
|
32872
32940
|
const innerBinding = resolveLocalIdentifierBinding(entry.filePath, entry.innerTag);
|
|
32873
|
-
if (logger.
|
|
32941
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] innerBinding=${innerBinding === null ? "null" : innerBinding.kind}`);
|
|
32874
32942
|
const innerHost = extractHostFromBinding(innerBinding);
|
|
32875
|
-
if (logger.
|
|
32876
|
-
let tagName = innerHost !== null ? innerHost.tagName : null;
|
|
32943
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] innerHost=${innerHost === null ? "null" : `tagName=${innerHost.descriptor.tagName}, attrs=[${[...innerHost.descriptor.staticAttributes.keys()]}]`}`);
|
|
32944
|
+
let tagName = innerHost !== null ? innerHost.descriptor.tagName : null;
|
|
32877
32945
|
if (tagName === null) {
|
|
32878
32946
|
tagName = resolveTagNameFromPolymorphicProp(entry.staticAttributes);
|
|
32879
|
-
if (logger.
|
|
32947
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] polymorphic fallback: tagName=${tagName}`);
|
|
32880
32948
|
}
|
|
32881
|
-
const staticAttributes = innerHost !== null ? mergeStaticAttributes(entry.staticAttributes, innerHost.staticAttributes) : entry.staticAttributes;
|
|
32882
|
-
const staticClassTokens = innerHost !== null ? mergeStaticClassTokens(entry.staticClassTokens, innerHost.staticClassTokens) : entry.staticClassTokens;
|
|
32883
|
-
const forwardsChildren = entry.forwardsChildren || innerHost !== null && innerHost.forwardsChildren;
|
|
32884
|
-
if (logger.
|
|
32949
|
+
const staticAttributes = innerHost !== null ? mergeStaticAttributes(entry.staticAttributes, innerHost.descriptor.staticAttributes) : entry.staticAttributes;
|
|
32950
|
+
const staticClassTokens = innerHost !== null ? mergeStaticClassTokens(entry.staticClassTokens, innerHost.descriptor.staticClassTokens) : entry.staticClassTokens;
|
|
32951
|
+
const forwardsChildren = entry.forwardsChildren || innerHost !== null && innerHost.descriptor.forwardsChildren;
|
|
32952
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolved: tagName=${tagName}, attrs=[${[...staticAttributes.keys()]}], classes=[${staticClassTokens}]`);
|
|
32885
32953
|
return {
|
|
32886
|
-
tagName,
|
|
32887
|
-
|
|
32888
|
-
staticClassTokens,
|
|
32889
|
-
forwardsChildren
|
|
32954
|
+
descriptor: { tagName, staticAttributes, staticClassTokens, forwardsChildren },
|
|
32955
|
+
hostElementRef: innerHost?.hostElementRef ?? null
|
|
32890
32956
|
};
|
|
32891
32957
|
}
|
|
32892
32958
|
function extractHostFromBinding(binding) {
|
|
@@ -32927,10 +32993,7 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32927
32993
|
if (hostEntry) {
|
|
32928
32994
|
const resolved = resolveComponentHostEntry(hostEntry);
|
|
32929
32995
|
if (resolved !== null) {
|
|
32930
|
-
const binding = {
|
|
32931
|
-
kind: "component",
|
|
32932
|
-
host: resolved
|
|
32933
|
-
};
|
|
32996
|
+
const binding = { kind: "component", host: resolved };
|
|
32934
32997
|
localBindingCache.set(key, binding);
|
|
32935
32998
|
resolvingLocal.delete(key);
|
|
32936
32999
|
return binding;
|
|
@@ -32991,7 +33054,7 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
32991
33054
|
const baseExpression = toExpressionArgument(firstArg);
|
|
32992
33055
|
if (baseExpression === null) return null;
|
|
32993
33056
|
const baseBinding = resolveBindingFromExpression(filePath, baseExpression);
|
|
32994
|
-
if (logger.
|
|
33057
|
+
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}` : ""}`);
|
|
32995
33058
|
let baseComponent = null;
|
|
32996
33059
|
const members = /* @__PURE__ */ new Map();
|
|
32997
33060
|
if (baseBinding && baseBinding.kind === "component") {
|
|
@@ -33017,7 +33080,7 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
33017
33080
|
if (!import_typescript126.default.isObjectLiteralExpression(argument)) continue;
|
|
33018
33081
|
appendObjectExpressionMembers(filePath, argument, members);
|
|
33019
33082
|
}
|
|
33020
|
-
if (logger.
|
|
33083
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] Object.assign result: base=${baseComponent === null ? "null" : `tagName=${baseComponent.host.descriptor.tagName}`}, members=[${[...members.keys()]}]`);
|
|
33021
33084
|
if (baseComponent === null && members.size === 0) return null;
|
|
33022
33085
|
return {
|
|
33023
33086
|
kind: "namespace",
|
|
@@ -33059,7 +33122,7 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
33059
33122
|
}
|
|
33060
33123
|
function resolveBindingFromImport(filePath, importBinding) {
|
|
33061
33124
|
const resolvedModule = moduleResolver.resolveSolid(filePath, importBinding.source) ?? resolveAndIndexExternalModule(filePath, importBinding.source);
|
|
33062
|
-
if (logger.
|
|
33125
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] resolveBindingFromImport: source=${importBinding.source}, kind=${importBinding.kind}, resolvedModule=${resolvedModule}`);
|
|
33063
33126
|
if (resolvedModule === null) return null;
|
|
33064
33127
|
const normalized = (0, import_node_path4.resolve)(resolvedModule);
|
|
33065
33128
|
if (importBinding.kind === "namespace") {
|
|
@@ -33068,7 +33131,7 @@ function createLayoutComponentHostResolver(solids, moduleResolver, logger = noop
|
|
|
33068
33131
|
const exportName = importBinding.kind === "default" ? "default" : importBinding.importedName;
|
|
33069
33132
|
if (exportName === null) return null;
|
|
33070
33133
|
const result = resolveExportBinding(normalized, exportName);
|
|
33071
|
-
if (logger.
|
|
33134
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[component-host] export ${exportName}: ${result === null ? "null" : result.kind}`);
|
|
33072
33135
|
return result;
|
|
33073
33136
|
}
|
|
33074
33137
|
function resolveAndIndexExternalModule(importerFile, importSource) {
|
|
@@ -33262,6 +33325,7 @@ function collectComponentHosts(graph) {
|
|
|
33262
33325
|
}
|
|
33263
33326
|
function resolveComponentHostEntryForFunction(graph, fn) {
|
|
33264
33327
|
let entry = null;
|
|
33328
|
+
let hostElementRefAgreed = true;
|
|
33265
33329
|
const bodyEntry = resolveHostEntryFromFunctionBody(graph, fn);
|
|
33266
33330
|
if (bodyEntry !== null) {
|
|
33267
33331
|
entry = bodyEntry;
|
|
@@ -33277,9 +33341,17 @@ function resolveComponentHostEntryForFunction(graph, fn) {
|
|
|
33277
33341
|
entry = returnEntry;
|
|
33278
33342
|
continue;
|
|
33279
33343
|
}
|
|
33280
|
-
if (areComponentHostEntriesEqual(entry, returnEntry))
|
|
33344
|
+
if (areComponentHostEntriesEqual(entry, returnEntry)) {
|
|
33345
|
+
if (hostElementRefAgreed && entry.resolution === "resolved" && returnEntry.resolution === "resolved" && entry.hostElementRef !== returnEntry.hostElementRef) {
|
|
33346
|
+
hostElementRefAgreed = false;
|
|
33347
|
+
}
|
|
33348
|
+
continue;
|
|
33349
|
+
}
|
|
33281
33350
|
return null;
|
|
33282
33351
|
}
|
|
33352
|
+
if (!hostElementRefAgreed && entry !== null && entry.resolution === "resolved") {
|
|
33353
|
+
return { resolution: "resolved", descriptor: entry.descriptor, hostElementRef: null };
|
|
33354
|
+
}
|
|
33283
33355
|
return entry;
|
|
33284
33356
|
}
|
|
33285
33357
|
function resolveHostEntryFromFunctionBody(graph, fn) {
|
|
@@ -33307,7 +33379,8 @@ function resolveHostEntryFromJSXElement(graph, node) {
|
|
|
33307
33379
|
staticAttributes: collectStaticAttributes(element),
|
|
33308
33380
|
staticClassTokens: getStaticClassTokensForElementEntity(graph, element),
|
|
33309
33381
|
forwardsChildren: detectChildrenForwarding(element)
|
|
33310
|
-
}
|
|
33382
|
+
},
|
|
33383
|
+
hostElementRef: { solid: graph, element }
|
|
33311
33384
|
};
|
|
33312
33385
|
}
|
|
33313
33386
|
if (isContextProviderTag(element.tag)) {
|
|
@@ -34017,7 +34090,7 @@ function matchesChain(matcher, node, index, perf, fileRootElements, logger) {
|
|
|
34017
34090
|
ancestor = ancestor.parentElementNode;
|
|
34018
34091
|
}
|
|
34019
34092
|
if (fileRootElements !== null) {
|
|
34020
|
-
if (logger.
|
|
34093
|
+
if (logger.isLevelEnabled(Level.Trace)) {
|
|
34021
34094
|
const compoundDesc = describeCompound(targetCompound);
|
|
34022
34095
|
logger.trace(`[selector-match] fallback: node=${node.key} tag=${node.tagName} checking ${fileRootElements.length} roots for compound=${compoundDesc}`);
|
|
34023
34096
|
}
|
|
@@ -34028,11 +34101,11 @@ function matchesChain(matcher, node, index, perf, fileRootElements, logger) {
|
|
|
34028
34101
|
if (root.solidFile !== node.solidFile) continue;
|
|
34029
34102
|
perf.ancestryChecks++;
|
|
34030
34103
|
const compoundResult = matchesCompound(root, targetCompound);
|
|
34031
|
-
if (logger.
|
|
34104
|
+
if (logger.isLevelEnabled(Level.Trace) && compoundResult === "no-match") {
|
|
34032
34105
|
logger.trace(`[selector-match] fallback MISS: root=${root.key} tag=${root.tagName} attrs=[${[...root.attributes.entries()].map(([k, v]) => `${k}=${v}`).join(",")}]`);
|
|
34033
34106
|
}
|
|
34034
34107
|
if (compoundResult !== "no-match") {
|
|
34035
|
-
if (logger.
|
|
34108
|
+
if (logger.isLevelEnabled(Level.Debug)) {
|
|
34036
34109
|
const compoundDesc = describeCompound(targetCompound);
|
|
34037
34110
|
logger.debug(`[selector-match] fallback HIT: node=${node.key} tag=${node.tagName} matched root=${root.key} tag=${root.tagName} compound=${compoundDesc} isFinal=${isFinal}`);
|
|
34038
34111
|
}
|
|
@@ -37234,7 +37307,7 @@ function appendMatchingEdgesFromSelectorIds(ctx, selectorIds, node, applies, app
|
|
|
37234
37307
|
};
|
|
37235
37308
|
applies.push(edge);
|
|
37236
37309
|
ctx.perf.matchEdgesCreated++;
|
|
37237
|
-
if (ctx.logger.
|
|
37310
|
+
if (ctx.logger.isLevelEnabled(Level.Trace)) {
|
|
37238
37311
|
ctx.logger.trace(
|
|
37239
37312
|
`[cascade] edge node=${node.key} selector=${selector.id} match=${matchResult} conditional=${edge.conditionalMatch} selector-raw=${selector.raw.slice(0, 80)}`
|
|
37240
37313
|
);
|
|
@@ -37385,7 +37458,7 @@ function resolveRuleLayerOrder(rule, css) {
|
|
|
37385
37458
|
if (!name) return 0;
|
|
37386
37459
|
return css.layerOrder.get(name) ?? 0;
|
|
37387
37460
|
}
|
|
37388
|
-
function buildConditionalDeltaIndex(elements, appliesByNode, monitoredDeclarationsBySelectorId) {
|
|
37461
|
+
function buildConditionalDeltaIndex(elements, appliesByNode, monitoredDeclarationsBySelectorId, selectorsById) {
|
|
37389
37462
|
const conditionalSignalDeltaFactsByNode = /* @__PURE__ */ new Map();
|
|
37390
37463
|
const elementsWithConditionalDeltaBySignal = /* @__PURE__ */ new Map();
|
|
37391
37464
|
const baselineOffsetFactsByNode = /* @__PURE__ */ new Map();
|
|
@@ -37396,11 +37469,16 @@ function buildConditionalDeltaIndex(elements, appliesByNode, monitoredDeclaratio
|
|
|
37396
37469
|
let factByProperty = null;
|
|
37397
37470
|
if (edges !== void 0 && edges.length > 0) {
|
|
37398
37471
|
const byProperty = /* @__PURE__ */ new Map();
|
|
37472
|
+
let conditionalAttributeDispatch = null;
|
|
37399
37473
|
for (let j = 0; j < edges.length; j++) {
|
|
37400
37474
|
const currentEdge = edges[j];
|
|
37401
37475
|
if (!currentEdge) continue;
|
|
37402
37476
|
const declarations = monitoredDeclarationsBySelectorId.get(currentEdge.selectorId);
|
|
37403
37477
|
if (!declarations) continue;
|
|
37478
|
+
let conditionalAttributeName = null;
|
|
37479
|
+
if (currentEdge.conditionalMatch) {
|
|
37480
|
+
conditionalAttributeName = identifyConditionalAttribute(currentEdge.selectorId, node, selectorsById);
|
|
37481
|
+
}
|
|
37404
37482
|
for (let k = 0; k < declarations.length; k++) {
|
|
37405
37483
|
const declaration = declarations[k];
|
|
37406
37484
|
if (!declaration) continue;
|
|
@@ -37419,6 +37497,15 @@ function buildConditionalDeltaIndex(elements, appliesByNode, monitoredDeclaratio
|
|
|
37419
37497
|
}
|
|
37420
37498
|
if (declaration.guardProvenance.kind === 1 /* Conditional */ || currentEdge.conditionalMatch) {
|
|
37421
37499
|
bucket.conditional.add(expandedEntry.value);
|
|
37500
|
+
if (conditionalAttributeName !== null && declaration.guardProvenance.kind !== 1 /* Conditional */) {
|
|
37501
|
+
if (conditionalAttributeDispatch === null) conditionalAttributeDispatch = /* @__PURE__ */ new Map();
|
|
37502
|
+
let dispatchMap = conditionalAttributeDispatch.get(property);
|
|
37503
|
+
if (!dispatchMap) {
|
|
37504
|
+
dispatchMap = /* @__PURE__ */ new Map();
|
|
37505
|
+
conditionalAttributeDispatch.set(property, dispatchMap);
|
|
37506
|
+
}
|
|
37507
|
+
dispatchMap.set(expandedEntry.value, conditionalAttributeName);
|
|
37508
|
+
}
|
|
37422
37509
|
continue;
|
|
37423
37510
|
}
|
|
37424
37511
|
bucket.unconditional.add(expandedEntry.value);
|
|
@@ -37443,6 +37530,24 @@ function buildConditionalDeltaIndex(elements, appliesByNode, monitoredDeclaratio
|
|
|
37443
37530
|
}
|
|
37444
37531
|
}
|
|
37445
37532
|
}
|
|
37533
|
+
if (hasDelta && conditionalAttributeDispatch !== null) {
|
|
37534
|
+
const dispatchMap = conditionalAttributeDispatch.get(property);
|
|
37535
|
+
if (dispatchMap !== void 0 && dispatchMap.size === conditionalValues.length) {
|
|
37536
|
+
let singleAttribute = null;
|
|
37537
|
+
let allSameAttribute = true;
|
|
37538
|
+
for (const attrName of dispatchMap.values()) {
|
|
37539
|
+
if (singleAttribute === null) {
|
|
37540
|
+
singleAttribute = attrName;
|
|
37541
|
+
} else if (singleAttribute !== attrName) {
|
|
37542
|
+
allSameAttribute = false;
|
|
37543
|
+
break;
|
|
37544
|
+
}
|
|
37545
|
+
}
|
|
37546
|
+
if (allSameAttribute && singleAttribute !== null) {
|
|
37547
|
+
hasDelta = false;
|
|
37548
|
+
}
|
|
37549
|
+
}
|
|
37550
|
+
}
|
|
37446
37551
|
const scrollProfile = buildScrollValueProfile(property, conditionalValues, unconditionalValues);
|
|
37447
37552
|
facts.set(property, {
|
|
37448
37553
|
hasConditional,
|
|
@@ -37528,6 +37633,25 @@ function buildConditionalDeltaSignalGroupElements(elementsWithConditionalDeltaBy
|
|
|
37528
37633
|
}
|
|
37529
37634
|
return out;
|
|
37530
37635
|
}
|
|
37636
|
+
function identifyConditionalAttribute(selectorId, node, selectorsById) {
|
|
37637
|
+
const selector = selectorsById.get(selectorId);
|
|
37638
|
+
if (!selector) return null;
|
|
37639
|
+
const constraints = selector.anchor.attributes;
|
|
37640
|
+
let dynamicAttributeName = null;
|
|
37641
|
+
for (let i = 0; i < constraints.length; i++) {
|
|
37642
|
+
const constraint = constraints[i];
|
|
37643
|
+
if (!constraint) continue;
|
|
37644
|
+
if (constraint.operator !== "equals") continue;
|
|
37645
|
+
if (constraint.value === null) continue;
|
|
37646
|
+
const elementValue = node.attributes.get(constraint.name);
|
|
37647
|
+
if (elementValue !== null) continue;
|
|
37648
|
+
if (dynamicAttributeName !== null && dynamicAttributeName !== constraint.name) {
|
|
37649
|
+
return null;
|
|
37650
|
+
}
|
|
37651
|
+
dynamicAttributeName = constraint.name;
|
|
37652
|
+
}
|
|
37653
|
+
return dynamicAttributeName;
|
|
37654
|
+
}
|
|
37531
37655
|
function buildScrollValueProfile(property, conditionalValues, unconditionalValues) {
|
|
37532
37656
|
if (property !== "overflow" && property !== "overflow-y") {
|
|
37533
37657
|
return {
|
|
@@ -37626,7 +37750,7 @@ function getTextualContentState(element, memo, compositionMetaByElementId, logge
|
|
|
37626
37750
|
if (!child) continue;
|
|
37627
37751
|
if (child.kind === "expression") {
|
|
37628
37752
|
if (isStructuralExpression(child.node)) {
|
|
37629
|
-
if (logger.
|
|
37753
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id} \u2192 unknown (structural expression child)`);
|
|
37630
37754
|
memo.set(element.id, 2 /* Unknown */);
|
|
37631
37755
|
return 2 /* Unknown */;
|
|
37632
37756
|
}
|
|
@@ -37648,11 +37772,11 @@ function getTextualContentState(element, memo, compositionMetaByElementId, logge
|
|
|
37648
37772
|
if (!child.isDomElement) {
|
|
37649
37773
|
const childMeta = compositionMetaByElementId.get(child.id);
|
|
37650
37774
|
if (childMeta !== void 0 && isControlTag(childMeta.tagName)) {
|
|
37651
|
-
if (logger.
|
|
37775
|
+
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`);
|
|
37652
37776
|
continue;
|
|
37653
37777
|
}
|
|
37654
37778
|
if (childState !== 1 /* No */) {
|
|
37655
|
-
if (logger.
|
|
37779
|
+
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`);
|
|
37656
37780
|
childHasUnknown = true;
|
|
37657
37781
|
}
|
|
37658
37782
|
continue;
|
|
@@ -37665,12 +37789,12 @@ function getTextualContentState(element, memo, compositionMetaByElementId, logge
|
|
|
37665
37789
|
if (childState === 3 /* DynamicText */) childHasDynamicText = true;
|
|
37666
37790
|
}
|
|
37667
37791
|
if (childHasUnknown) {
|
|
37668
|
-
if (logger.
|
|
37792
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id} \u2192 unknown (child has unknown)`);
|
|
37669
37793
|
memo.set(element.id, 2 /* Unknown */);
|
|
37670
37794
|
return 2 /* Unknown */;
|
|
37671
37795
|
}
|
|
37672
37796
|
if (hasTextOnlyExpression || childHasDynamicText) {
|
|
37673
|
-
if (logger.
|
|
37797
|
+
if (logger.isLevelEnabled(Level.Trace)) logger.trace(`[textual-content] element=${element.tagName ?? element.tag}#${element.id} \u2192 dynamic-text`);
|
|
37674
37798
|
memo.set(element.id, 3 /* DynamicText */);
|
|
37675
37799
|
return 3 /* DynamicText */;
|
|
37676
37800
|
}
|
|
@@ -37692,15 +37816,16 @@ function collectLayoutElementRecordsForSolid(solid, selectorRequirements, inline
|
|
|
37692
37816
|
const meta = compositionMetaByElementId.get(element.id);
|
|
37693
37817
|
if (!meta || !meta.participates) continue;
|
|
37694
37818
|
const localClassTokens = selectorRequirements.needsClassTokens ? getStaticClassTokensForElementEntity(solid, element) : EMPTY_STRING_LIST3;
|
|
37695
|
-
const classTokens = mergeClassTokens(localClassTokens, meta.
|
|
37819
|
+
const classTokens = mergeClassTokens(localClassTokens, meta.resolvedHost?.descriptor.staticClassTokens);
|
|
37696
37820
|
const classTokenSet = classTokens.length === 0 ? EMPTY_CLASS_TOKEN_SET : createClassTokenSet(classTokens);
|
|
37697
37821
|
const inlineStyleKeys = getStaticStyleKeysForElement(solid, element.id);
|
|
37698
37822
|
const localAttributes = selectorRequirements.needsAttributes ? collectStaticAttributes(element) : EMPTY_ATTRIBUTES2;
|
|
37699
|
-
const attributes = mergeAttributes(localAttributes, meta.
|
|
37823
|
+
const attributes = mergeAttributes(localAttributes, meta.resolvedHost?.descriptor.staticAttributes);
|
|
37700
37824
|
const selectorDispatchKeys = buildSelectorDispatchKeys(attributes, classTokens);
|
|
37701
37825
|
const inlineStyleValues = inlineStyleValuesByElementId.get(element.id) ?? EMPTY_INLINE_STYLE_VALUES;
|
|
37702
37826
|
const textualContent = getTextualContentState(element, textContentMemo, compositionMetaByElementId, logger);
|
|
37703
37827
|
const parentElementId = resolveComposedParentElementId(element, compositionMetaByElementId);
|
|
37828
|
+
const hostElementRef = meta.resolvedHost?.hostElementRef ?? null;
|
|
37704
37829
|
out.push({
|
|
37705
37830
|
element,
|
|
37706
37831
|
key: toLayoutElementKey(solid.file, element.id),
|
|
@@ -37713,7 +37838,8 @@ function collectLayoutElementRecordsForSolid(solid, selectorRequirements, inline
|
|
|
37713
37838
|
selectorDispatchKeys,
|
|
37714
37839
|
inlineStyleValues,
|
|
37715
37840
|
textualContent,
|
|
37716
|
-
parentElementId
|
|
37841
|
+
parentElementId,
|
|
37842
|
+
hostElementRef
|
|
37717
37843
|
});
|
|
37718
37844
|
}
|
|
37719
37845
|
return out;
|
|
@@ -37723,7 +37849,7 @@ function collectCompositionMetaByElementId(solid, componentHostResolver) {
|
|
|
37723
37849
|
for (let i = 0; i < solid.jsxElements.length; i++) {
|
|
37724
37850
|
const element = solid.jsxElements[i];
|
|
37725
37851
|
if (!element) continue;
|
|
37726
|
-
const
|
|
37852
|
+
const resolvedHost = resolveHostForElement(
|
|
37727
37853
|
componentHostResolver,
|
|
37728
37854
|
solid.file,
|
|
37729
37855
|
element
|
|
@@ -37732,30 +37858,30 @@ function collectCompositionMetaByElementId(solid, componentHostResolver) {
|
|
|
37732
37858
|
componentHostResolver,
|
|
37733
37859
|
solid.file,
|
|
37734
37860
|
element,
|
|
37735
|
-
|
|
37861
|
+
resolvedHost
|
|
37736
37862
|
);
|
|
37737
37863
|
const participates = element.tag !== null && !isTransparentPrimitive;
|
|
37738
|
-
const tag = resolveEffectiveTag(element,
|
|
37864
|
+
const tag = resolveEffectiveTag(element, resolvedHost?.descriptor ?? null);
|
|
37739
37865
|
const tagName = tag ? tag.toLowerCase() : null;
|
|
37740
37866
|
out.set(element.id, {
|
|
37741
37867
|
element,
|
|
37742
37868
|
participates,
|
|
37743
37869
|
tag,
|
|
37744
37870
|
tagName,
|
|
37745
|
-
|
|
37871
|
+
resolvedHost
|
|
37746
37872
|
});
|
|
37747
37873
|
}
|
|
37748
37874
|
return out;
|
|
37749
37875
|
}
|
|
37750
|
-
function
|
|
37876
|
+
function resolveHostForElement(componentHostResolver, solidFile, element) {
|
|
37751
37877
|
if (element.tag === null) return null;
|
|
37752
37878
|
if (element.isDomElement) return null;
|
|
37753
37879
|
return componentHostResolver.resolveHost(solidFile, element.tag);
|
|
37754
37880
|
}
|
|
37755
|
-
function resolveTransparentPrimitiveStatus(componentHostResolver, solidFile, element,
|
|
37881
|
+
function resolveTransparentPrimitiveStatus(componentHostResolver, solidFile, element, resolvedHost) {
|
|
37756
37882
|
if (element.tag === null) return false;
|
|
37757
37883
|
if (element.isDomElement) return false;
|
|
37758
|
-
if (
|
|
37884
|
+
if (resolvedHost !== null) return false;
|
|
37759
37885
|
return componentHostResolver.isTransparentPrimitive(solidFile, element.tag);
|
|
37760
37886
|
}
|
|
37761
37887
|
function resolveEffectiveTag(element, hostDescriptor) {
|
|
@@ -37873,6 +37999,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
37873
37999
|
const childrenByParentNodeMutable = /* @__PURE__ */ new Map();
|
|
37874
38000
|
const elementBySolidFileAndIdMutable = /* @__PURE__ */ new Map();
|
|
37875
38001
|
const elementRefsBySolidFileAndIdMutable = /* @__PURE__ */ new Map();
|
|
38002
|
+
const hostElementRefsByNodeMutable = /* @__PURE__ */ new Map();
|
|
37876
38003
|
const appliesByElementNodeMutable = /* @__PURE__ */ new Map();
|
|
37877
38004
|
const selectorsById = /* @__PURE__ */ new Map();
|
|
37878
38005
|
const monitoredDeclarationsBySelectorId = /* @__PURE__ */ new Map();
|
|
@@ -37909,7 +38036,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
37909
38036
|
const moduleResolver = createLayoutModuleResolver(solids, css);
|
|
37910
38037
|
const componentHostResolver = createLayoutComponentHostResolver(solids, moduleResolver, logger);
|
|
37911
38038
|
const cssScopeBySolidFile = collectCSSScopeBySolidFile(solids, css, moduleResolver);
|
|
37912
|
-
if (logger.
|
|
38039
|
+
if (logger.isLevelEnabled(Level.Trace)) {
|
|
37913
38040
|
for (const [solidFile, scopePaths] of cssScopeBySolidFile) {
|
|
37914
38041
|
if (scopePaths.length > 0) {
|
|
37915
38042
|
let names = "";
|
|
@@ -38004,6 +38131,9 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
38004
38131
|
isControl: isControlTag(record.tagName),
|
|
38005
38132
|
isReplaced: isReplacedTag(record.tagName)
|
|
38006
38133
|
};
|
|
38134
|
+
if (record.hostElementRef !== null) {
|
|
38135
|
+
hostElementRefsByNodeMutable.set(node, record.hostElementRef);
|
|
38136
|
+
}
|
|
38007
38137
|
elements.push(node);
|
|
38008
38138
|
elementById.set(record.element.id, node);
|
|
38009
38139
|
nodeByElementId.set(record.element.id, node);
|
|
@@ -38025,7 +38155,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
38025
38155
|
}
|
|
38026
38156
|
}
|
|
38027
38157
|
}
|
|
38028
|
-
if (logger.
|
|
38158
|
+
if (logger.isLevelEnabled(Level.Debug)) {
|
|
38029
38159
|
for (const [file, roots] of rootElementsByFile) {
|
|
38030
38160
|
const descs = roots.map((r) => `${r.key}(tag=${r.tagName}, attrs=[${[...r.attributes.entries()].map(([k, v]) => `${k}=${v}`).join(",")}])`);
|
|
38031
38161
|
logger.debug(`[build] rootElementsByFile file=${file} count=${roots.length}: ${descs.join(", ")}`);
|
|
@@ -38068,7 +38198,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
38068
38198
|
appliesByNode.set(node, edges);
|
|
38069
38199
|
}
|
|
38070
38200
|
perf.cascadeBuildMs = performance.now() - cascadeStartedAt;
|
|
38071
|
-
if (logger.
|
|
38201
|
+
if (logger.isLevelEnabled(Level.Trace)) {
|
|
38072
38202
|
for (let i = 0; i < elements.length; i++) {
|
|
38073
38203
|
const node = elements[i];
|
|
38074
38204
|
if (!node) continue;
|
|
@@ -38090,7 +38220,8 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
38090
38220
|
const conditionalDeltaIndex = buildConditionalDeltaIndex(
|
|
38091
38221
|
elements,
|
|
38092
38222
|
appliesByNode,
|
|
38093
|
-
monitoredDeclarationsBySelectorId
|
|
38223
|
+
monitoredDeclarationsBySelectorId,
|
|
38224
|
+
selectorsById
|
|
38094
38225
|
);
|
|
38095
38226
|
const elementsWithConditionalOverflowDelta = buildConditionalDeltaSignalGroupElements(
|
|
38096
38227
|
conditionalDeltaIndex.elementsWithConditionalDeltaBySignal,
|
|
@@ -38123,6 +38254,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
38123
38254
|
childrenByParentNode: childrenByParentNodeMutable,
|
|
38124
38255
|
elementBySolidFileAndId: elementBySolidFileAndIdMutable,
|
|
38125
38256
|
elementRefsBySolidFileAndId: elementRefsBySolidFileAndIdMutable,
|
|
38257
|
+
hostElementRefsByNode: hostElementRefsByNodeMutable,
|
|
38126
38258
|
appliesByNode,
|
|
38127
38259
|
selectorCandidatesByNode,
|
|
38128
38260
|
selectorsById,
|
|
@@ -38523,7 +38655,7 @@ function computeFlowParticipationFact(snapshot) {
|
|
|
38523
38655
|
}
|
|
38524
38656
|
function buildContextIndex(childrenByParentNode, snapshotByElementNode, perf, logger) {
|
|
38525
38657
|
const out = /* @__PURE__ */ new Map();
|
|
38526
|
-
const trace = logger.
|
|
38658
|
+
const trace = logger.isLevelEnabled(Level.Trace);
|
|
38527
38659
|
for (const [parent, children] of childrenByParentNode) {
|
|
38528
38660
|
if (children.length < 2) continue;
|
|
38529
38661
|
const snapshot = snapshotByElementNode.get(parent);
|
|
@@ -39342,7 +39474,7 @@ function runLayoutDetector(context, detector) {
|
|
|
39342
39474
|
result.evidence.posteriorLower,
|
|
39343
39475
|
result.evidence.posteriorUpper
|
|
39344
39476
|
);
|
|
39345
|
-
if (log.
|
|
39477
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
39346
39478
|
log.debug(
|
|
39347
39479
|
`[${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("; ")}]`
|
|
39348
39480
|
);
|
|
@@ -39351,7 +39483,7 @@ function runLayoutDetector(context, detector) {
|
|
|
39351
39483
|
continue;
|
|
39352
39484
|
}
|
|
39353
39485
|
recordPolicyMetrics(context, result.evidenceMass, result.posteriorLower, result.posteriorUpper);
|
|
39354
|
-
if (log.
|
|
39486
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
39355
39487
|
log.debug(
|
|
39356
39488
|
`[${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)}`
|
|
39357
39489
|
);
|
|
@@ -39884,13 +40016,39 @@ var INLINE_TOUCH_TARGET_KEYS = /* @__PURE__ */ new Set([
|
|
|
39884
40016
|
"height",
|
|
39885
40017
|
"min-height",
|
|
39886
40018
|
"width",
|
|
39887
|
-
"min-width"
|
|
39888
|
-
|
|
39889
|
-
|
|
39890
|
-
|
|
39891
|
-
"
|
|
39892
|
-
"
|
|
40019
|
+
"min-width"
|
|
40020
|
+
]);
|
|
40021
|
+
var INTERACTIVE_HTML_TAGS = /* @__PURE__ */ new Set(["button", "a", "input", "select", "textarea", "label", "summary"]);
|
|
40022
|
+
var INTERACTIVE_ARIA_ROLES = /* @__PURE__ */ new Set([
|
|
40023
|
+
"button",
|
|
40024
|
+
"link",
|
|
40025
|
+
"checkbox",
|
|
40026
|
+
"radio",
|
|
40027
|
+
"combobox",
|
|
40028
|
+
"listbox",
|
|
40029
|
+
"menuitem",
|
|
40030
|
+
"menuitemcheckbox",
|
|
40031
|
+
"menuitemradio",
|
|
40032
|
+
"option",
|
|
40033
|
+
"switch",
|
|
40034
|
+
"tab"
|
|
39893
40035
|
]);
|
|
40036
|
+
function isInteractiveElement(solid, element, hostElementRef) {
|
|
40037
|
+
if (element.tagName !== null && INTERACTIVE_HTML_TAGS.has(element.tagName)) return true;
|
|
40038
|
+
const roleAttr = getJSXAttributeEntity(solid, element, "role");
|
|
40039
|
+
if (roleAttr !== null && roleAttr.valueNode !== null) {
|
|
40040
|
+
const role = getStaticStringFromJSXValue(roleAttr.valueNode);
|
|
40041
|
+
if (role !== null && INTERACTIVE_ARIA_ROLES.has(role)) return true;
|
|
40042
|
+
}
|
|
40043
|
+
if (hostElementRef !== null && hostElementRef.element.tagName !== null) {
|
|
40044
|
+
if (INTERACTIVE_HTML_TAGS.has(hostElementRef.element.tagName)) return true;
|
|
40045
|
+
}
|
|
40046
|
+
return false;
|
|
40047
|
+
}
|
|
40048
|
+
function readNodeHostElementRef(layout, solid, element) {
|
|
40049
|
+
const node = layout.elementBySolidFileAndId.get(solid.file)?.get(element.id) ?? null;
|
|
40050
|
+
return node !== null ? readHostElementRef(layout, node) : null;
|
|
40051
|
+
}
|
|
39894
40052
|
var jsxStylePolicy = defineCrossRule({
|
|
39895
40053
|
id: "jsx-style-policy",
|
|
39896
40054
|
severity: "warn",
|
|
@@ -39901,10 +40059,11 @@ var jsxStylePolicy = defineCrossRule({
|
|
|
39901
40059
|
category: "css-jsx"
|
|
39902
40060
|
},
|
|
39903
40061
|
check(context, emit) {
|
|
39904
|
-
const { solids } = context;
|
|
40062
|
+
const { solids, layout } = context;
|
|
39905
40063
|
const policy = getActivePolicy();
|
|
39906
|
-
|
|
39907
|
-
|
|
40064
|
+
if (policy === null) return;
|
|
40065
|
+
const name = getActivePolicyName() ?? "";
|
|
40066
|
+
forEachStylePropertyAcross(solids, (solid, p, element) => {
|
|
39908
40067
|
if (!import_typescript135.default.isPropertyAssignment(p)) return;
|
|
39909
40068
|
const key = objectKeyName(p.name);
|
|
39910
40069
|
if (!key) return;
|
|
@@ -39952,6 +40111,8 @@ var jsxStylePolicy = defineCrossRule({
|
|
|
39952
40111
|
return;
|
|
39953
40112
|
}
|
|
39954
40113
|
if (INLINE_TOUCH_TARGET_KEYS.has(normalizedKey)) {
|
|
40114
|
+
const hostRef = readNodeHostElementRef(layout, solid, element);
|
|
40115
|
+
if (!isInteractiveElement(solid, element, hostRef)) return;
|
|
39955
40116
|
const strVal = getStaticStringValue(p.initializer);
|
|
39956
40117
|
if (!strVal) return;
|
|
39957
40118
|
const px = parsePxValue(strVal);
|
|
@@ -40030,7 +40191,7 @@ var siblingAlignmentDetector = {
|
|
|
40030
40191
|
id: "sibling-alignment-outlier",
|
|
40031
40192
|
collect: collectAlignmentCases,
|
|
40032
40193
|
evaluate(input, context) {
|
|
40033
|
-
if (context.logger.
|
|
40194
|
+
if (context.logger.isLevelEnabled(Level.Trace)) {
|
|
40034
40195
|
const ctx = input.context;
|
|
40035
40196
|
context.logger.trace(
|
|
40036
40197
|
`[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}`
|
|
@@ -40079,7 +40240,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
40079
40240
|
const log = context.logger;
|
|
40080
40241
|
const detections = runLayoutDetector(context, siblingAlignmentDetector);
|
|
40081
40242
|
const uniqueDetections = dedupeDetectionsBySubject(detections);
|
|
40082
|
-
if (log.
|
|
40243
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
40083
40244
|
log.debug(
|
|
40084
40245
|
`[sibling-alignment] raw=${detections.length} deduped=${uniqueDetections.length}`
|
|
40085
40246
|
);
|
|
@@ -40093,7 +40254,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
40093
40254
|
const subjectId = detection.caseData.subject.elementId;
|
|
40094
40255
|
const logPrefix = `[sibling-alignment] <${subjectTag}> in <${parentTag}> (${subjectFile}#${subjectId})`;
|
|
40095
40256
|
if (detection.evidence.confidence < MIN_CONFIDENCE_THRESHOLD) {
|
|
40096
|
-
if (log.
|
|
40257
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
40097
40258
|
log.debug(
|
|
40098
40259
|
`${logPrefix} SKIP: confidence=${detection.evidence.confidence.toFixed(2)} < threshold=${MIN_CONFIDENCE_THRESHOLD}`
|
|
40099
40260
|
);
|
|
@@ -40102,7 +40263,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
40102
40263
|
}
|
|
40103
40264
|
const estimatedOffset = detection.evidence.estimatedOffsetPx;
|
|
40104
40265
|
if (estimatedOffset !== null && Math.abs(estimatedOffset) < MIN_OFFSET_PX_THRESHOLD && !hasNonOffsetPrimaryEvidence(detection.evidence.topFactors)) {
|
|
40105
|
-
if (log.
|
|
40266
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
40106
40267
|
log.debug(
|
|
40107
40268
|
`${logPrefix} SKIP: offset=${estimatedOffset.toFixed(2)}px < ${MIN_OFFSET_PX_THRESHOLD}px (no non-offset primary evidence, topFactors=[${detection.evidence.topFactors.join(",")}])`
|
|
40108
40269
|
);
|
|
@@ -40114,7 +40275,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
40114
40275
|
detection.caseData.cohort.parentElementKey,
|
|
40115
40276
|
detection.caseData.subject.solidFile
|
|
40116
40277
|
)) {
|
|
40117
|
-
if (log.
|
|
40278
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
40118
40279
|
log.debug(`${logPrefix} SKIP: out-of-flow ancestor`);
|
|
40119
40280
|
}
|
|
40120
40281
|
continue;
|
|
@@ -40125,7 +40286,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
40125
40286
|
detection.caseData.subject.elementId
|
|
40126
40287
|
);
|
|
40127
40288
|
if (!subjectRef) {
|
|
40128
|
-
if (log.
|
|
40289
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
40129
40290
|
log.debug(`${logPrefix} SKIP: no node ref`);
|
|
40130
40291
|
}
|
|
40131
40292
|
continue;
|
|
@@ -40141,7 +40302,7 @@ var cssLayoutSiblingAlignmentOutlier = defineCrossRule({
|
|
|
40141
40302
|
const primaryFix = detection.evidence.primaryFix;
|
|
40142
40303
|
const firstChar = primaryFix.length > 0 ? primaryFix[0] : void 0;
|
|
40143
40304
|
const fix = firstChar !== void 0 ? ` ${firstChar.toUpperCase()}${primaryFix.slice(1)}.` : "";
|
|
40144
|
-
if (log.
|
|
40305
|
+
if (log.isLevelEnabled(Level.Debug)) {
|
|
40145
40306
|
log.debug(
|
|
40146
40307
|
`${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}]`
|
|
40147
40308
|
);
|
|
@@ -40550,7 +40711,8 @@ var cssLayoutUnsizedReplacedElement = defineCrossRule({
|
|
|
40550
40711
|
const ref = readNodeRef(context.layout, node);
|
|
40551
40712
|
if (!ref) continue;
|
|
40552
40713
|
const reservedSpace = readReservedSpaceFact(context.layout, node);
|
|
40553
|
-
|
|
40714
|
+
const hostRef = readHostElementRef(context.layout, node);
|
|
40715
|
+
if (hasReservedSize(ref.solid, node.attributes, ref.element, reservedSpace, hostRef)) continue;
|
|
40554
40716
|
emit(
|
|
40555
40717
|
createDiagnostic(
|
|
40556
40718
|
ref.solid.file,
|
|
@@ -40565,15 +40727,17 @@ var cssLayoutUnsizedReplacedElement = defineCrossRule({
|
|
|
40565
40727
|
}
|
|
40566
40728
|
}
|
|
40567
40729
|
});
|
|
40568
|
-
function hasReservedSize(solid, attributes, element, reservedSpaceFact) {
|
|
40730
|
+
function hasReservedSize(solid, attributes, element, reservedSpaceFact, hostElementRef) {
|
|
40569
40731
|
if (reservedSpaceFact.hasReservedSpace) return true;
|
|
40570
40732
|
const attrWidth = parsePositiveLength(attributes.get("width"));
|
|
40571
40733
|
const attrHeight = parsePositiveLength(attributes.get("height"));
|
|
40572
40734
|
const jsxAttrWidth = readPositiveJsxAttribute(solid, element, "width");
|
|
40573
40735
|
const jsxAttrHeight = readPositiveJsxAttribute(solid, element, "height");
|
|
40574
|
-
|
|
40575
|
-
const
|
|
40576
|
-
|
|
40736
|
+
const hostJsxWidth = hostElementRef !== null ? readPositiveJsxAttribute(hostElementRef.solid, hostElementRef.element, "width") : false;
|
|
40737
|
+
const hostJsxHeight = hostElementRef !== null ? readPositiveJsxAttribute(hostElementRef.solid, hostElementRef.element, "height") : false;
|
|
40738
|
+
if (attrWidth && attrHeight || jsxAttrWidth && jsxAttrHeight || hostJsxWidth && hostJsxHeight) return true;
|
|
40739
|
+
const hasAnyWidth = attrWidth || jsxAttrWidth || hostJsxWidth || reservedSpaceFact.hasUsableInlineDimension;
|
|
40740
|
+
const hasAnyHeight = attrHeight || jsxAttrHeight || hostJsxHeight || reservedSpaceFact.hasUsableBlockDimension || reservedSpaceFact.hasContainIntrinsicSize;
|
|
40577
40741
|
if (reservedSpaceFact.hasUsableAspectRatio && (hasAnyWidth || hasAnyHeight)) return true;
|
|
40578
40742
|
if (reservedSpaceFact.hasContainIntrinsicSize && (hasAnyWidth || hasAnyHeight)) return true;
|
|
40579
40743
|
return false;
|