@drskillissue/ganko 0.2.81 → 0.2.83
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-QDFZ6A6X.js → chunk-F5F7F4LG.js} +42 -33
- package/dist/{chunk-QDFZ6A6X.js.map → chunk-F5F7F4LG.js.map} +1 -1
- package/dist/eslint-plugin.cjs +41 -32
- package/dist/eslint-plugin.cjs.map +1 -1
- package/dist/eslint-plugin.js +1 -1
- package/dist/index.cjs +41 -32
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/eslint-plugin.js
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -25949,14 +25949,16 @@ function walkAndProcess(graph, file, container, context, collector) {
|
|
|
25949
25949
|
if (parentAtRule) {
|
|
25950
25950
|
parentAtRule.rules.push(rule);
|
|
25951
25951
|
}
|
|
25952
|
-
|
|
25953
|
-
|
|
25954
|
-
|
|
25955
|
-
|
|
25956
|
-
|
|
25957
|
-
|
|
25958
|
-
|
|
25959
|
-
|
|
25952
|
+
if (parentAtRule === null || parentAtRule.kind !== "keyframes") {
|
|
25953
|
+
const selectorStrings = parseSelectorList(rule.selectorText);
|
|
25954
|
+
for (let j = 0; j < selectorStrings.length; j++) {
|
|
25955
|
+
const selectorText = selectorStrings[j];
|
|
25956
|
+
if (!selectorText) continue;
|
|
25957
|
+
const selector = createSelectorEntity(graph, selectorText, rule);
|
|
25958
|
+
graph.addSelector(selector);
|
|
25959
|
+
rule.selectors.push(selector);
|
|
25960
|
+
graph.registerRuleBySelector(selectorText, rule);
|
|
25961
|
+
}
|
|
25960
25962
|
}
|
|
25961
25963
|
const ruleChildren = ruleNode.nodes;
|
|
25962
25964
|
if (ruleChildren && ruleChildren.length > 0) {
|
|
@@ -36787,7 +36789,7 @@ var DYNAMIC_ATTRIBUTE_GUARD = {
|
|
|
36787
36789
|
key: "dynamic-attribute:*"
|
|
36788
36790
|
};
|
|
36789
36791
|
var SCROLLABLE_VALUES = /* @__PURE__ */ new Set(["auto", "scroll"]);
|
|
36790
|
-
function collectMonitoredDeclarations(selector, layerOrder, guard) {
|
|
36792
|
+
function collectMonitoredDeclarations(selector, layerOrder, guard, variablesByName) {
|
|
36791
36793
|
const out = [];
|
|
36792
36794
|
const declarations = selector.rule.declarations;
|
|
36793
36795
|
for (let i = 0; i < declarations.length; i++) {
|
|
@@ -36803,12 +36805,14 @@ function collectMonitoredDeclarations(selector, layerOrder, guard) {
|
|
|
36803
36805
|
specificityScore: selector.specificityScore,
|
|
36804
36806
|
isImportant: declaration.cascadePosition.isImportant || declaration.node.important
|
|
36805
36807
|
};
|
|
36808
|
+
const rawValue = declaration.value;
|
|
36809
|
+
const resolvedValue = variablesByName !== null && rawValue.includes("var(") ? substituteVarReferences(rawValue, variablesByName, 0) : rawValue;
|
|
36806
36810
|
const directSignal = MONITORED_SIGNAL_NAME_MAP.get(property);
|
|
36807
36811
|
if (directSignal !== void 0) {
|
|
36808
|
-
out.push({ property: directSignal, value:
|
|
36812
|
+
out.push({ property: directSignal, value: resolvedValue, guardProvenance: guard, position });
|
|
36809
36813
|
continue;
|
|
36810
36814
|
}
|
|
36811
|
-
const value2 =
|
|
36815
|
+
const value2 = resolvedValue.trim().toLowerCase();
|
|
36812
36816
|
const expanded = expandShorthand(property, value2);
|
|
36813
36817
|
if (expanded === void 0) continue;
|
|
36814
36818
|
if (expanded === null) {
|
|
@@ -36819,7 +36823,7 @@ function collectMonitoredDeclarations(selector, layerOrder, guard) {
|
|
|
36819
36823
|
if (!longhand) continue;
|
|
36820
36824
|
const signal = MONITORED_SIGNAL_NAME_MAP.get(longhand);
|
|
36821
36825
|
if (signal === void 0) continue;
|
|
36822
|
-
out.push({ property: signal, value:
|
|
36826
|
+
out.push({ property: signal, value: resolvedValue, guardProvenance: guard, position });
|
|
36823
36827
|
}
|
|
36824
36828
|
continue;
|
|
36825
36829
|
}
|
|
@@ -36914,19 +36918,6 @@ function augmentCascadeWithTailwind(cascade, node, tailwind) {
|
|
|
36914
36918
|
}
|
|
36915
36919
|
}
|
|
36916
36920
|
var MAX_VAR_SUBSTITUTION_DEPTH = 10;
|
|
36917
|
-
function resolveVarReferencesInCascade(cascade, variablesByName) {
|
|
36918
|
-
for (const [property, declaration] of cascade) {
|
|
36919
|
-
if (!declaration.value.includes("var(")) continue;
|
|
36920
|
-
const resolved = substituteVarReferences(declaration.value, variablesByName, 0);
|
|
36921
|
-
if (resolved !== declaration.value) {
|
|
36922
|
-
cascade.set(property, {
|
|
36923
|
-
value: resolved,
|
|
36924
|
-
source: declaration.source,
|
|
36925
|
-
guardProvenance: declaration.guardProvenance
|
|
36926
|
-
});
|
|
36927
|
-
}
|
|
36928
|
-
}
|
|
36929
|
-
}
|
|
36930
36921
|
function substituteVarReferences(value2, variablesByName, depth) {
|
|
36931
36922
|
if (depth >= MAX_VAR_SUBSTITUTION_DEPTH) return value2;
|
|
36932
36923
|
const refs = extractVarReferences(value2);
|
|
@@ -36960,7 +36951,7 @@ function selectBestVariableValue(candidates) {
|
|
|
36960
36951
|
const first = candidates[0];
|
|
36961
36952
|
return first ? first.value : null;
|
|
36962
36953
|
}
|
|
36963
|
-
function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind
|
|
36954
|
+
function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind) {
|
|
36964
36955
|
const out = /* @__PURE__ */ new Map();
|
|
36965
36956
|
const positions = /* @__PURE__ */ new Map();
|
|
36966
36957
|
for (let i = 0; i < edges.length; i++) {
|
|
@@ -37018,9 +37009,6 @@ function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorI
|
|
|
37018
37009
|
if (tailwind !== null) {
|
|
37019
37010
|
augmentCascadeWithTailwind(out, node, tailwind);
|
|
37020
37011
|
}
|
|
37021
|
-
if (variablesByName !== null) {
|
|
37022
|
-
resolveVarReferencesInCascade(out, variablesByName);
|
|
37023
|
-
}
|
|
37024
37012
|
return out;
|
|
37025
37013
|
}
|
|
37026
37014
|
function compareLayoutEdge(a, b) {
|
|
@@ -37689,7 +37677,8 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
37689
37677
|
const monitoredDeclarations = collectMonitoredDeclarations(
|
|
37690
37678
|
selector,
|
|
37691
37679
|
resolveRuleLayerOrder(selector.rule, css),
|
|
37692
|
-
guard
|
|
37680
|
+
guard,
|
|
37681
|
+
css.variablesByName
|
|
37693
37682
|
);
|
|
37694
37683
|
selectorsById.set(selector.id, selector);
|
|
37695
37684
|
monitoredDeclarationsBySelectorId.set(selector.id, monitoredDeclarations);
|
|
@@ -37867,7 +37856,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
37867
37856
|
const mutableEdges = appliesByElementNodeMutable.get(node);
|
|
37868
37857
|
if (mutableEdges) mutableEdges.sort(compareLayoutEdge);
|
|
37869
37858
|
const edges = mutableEdges ?? EMPTY_EDGE_LIST;
|
|
37870
|
-
const cascade = buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind
|
|
37859
|
+
const cascade = buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind);
|
|
37871
37860
|
if (trace && cascade.size > 0) {
|
|
37872
37861
|
const displayDecl = cascade.get("display");
|
|
37873
37862
|
const flexDirDecl = cascade.get("flex-direction");
|
|
@@ -41551,7 +41540,13 @@ var jsxLayoutPolicyTouchTarget = defineCrossRule({
|
|
|
41551
41540
|
}
|
|
41552
41541
|
});
|
|
41553
41542
|
function checkDimension(snapshot, signal, min, layout, node, emit, messageId, template, tag, policyName) {
|
|
41554
|
-
|
|
41543
|
+
let px = readKnownPx(snapshot, signal);
|
|
41544
|
+
if (px === null) {
|
|
41545
|
+
const signalValue = readKnownSignalWithGuard(snapshot, signal);
|
|
41546
|
+
if (signalValue !== null && signalValue.guard.kind === 1 /* Conditional */) {
|
|
41547
|
+
px = resolveUnconditionalFallbackPx(layout, node, signal);
|
|
41548
|
+
}
|
|
41549
|
+
}
|
|
41555
41550
|
if (px === null) return;
|
|
41556
41551
|
if (px >= min) return;
|
|
41557
41552
|
emitLayoutDiagnostic(
|
|
@@ -41571,6 +41566,20 @@ function checkDimension(snapshot, signal, min, layout, node, emit, messageId, te
|
|
|
41571
41566
|
}
|
|
41572
41567
|
);
|
|
41573
41568
|
}
|
|
41569
|
+
function resolveUnconditionalFallbackPx(layout, node, signal) {
|
|
41570
|
+
const delta = readConditionalSignalDeltaFact(layout, node, signal);
|
|
41571
|
+
if (!delta.hasConditional) return null;
|
|
41572
|
+
const values = delta.unconditionalValues;
|
|
41573
|
+
let bestPx = null;
|
|
41574
|
+
for (let i = 0; i < values.length; i++) {
|
|
41575
|
+
const raw = values[i];
|
|
41576
|
+
if (!raw) continue;
|
|
41577
|
+
const px = parsePxValue(raw);
|
|
41578
|
+
if (px === null) continue;
|
|
41579
|
+
if (bestPx === null || px > bestPx) bestPx = px;
|
|
41580
|
+
}
|
|
41581
|
+
return bestPx;
|
|
41582
|
+
}
|
|
41574
41583
|
|
|
41575
41584
|
// src/cross-file/rules/index.ts
|
|
41576
41585
|
var rules3 = [
|