@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.
@@ -25662,14 +25662,16 @@ function walkAndProcess(graph, file, container, context, collector) {
25662
25662
  if (parentAtRule) {
25663
25663
  parentAtRule.rules.push(rule);
25664
25664
  }
25665
- const selectorStrings = parseSelectorList(rule.selectorText);
25666
- for (let j = 0; j < selectorStrings.length; j++) {
25667
- const selectorText = selectorStrings[j];
25668
- if (!selectorText) continue;
25669
- const selector = createSelectorEntity(graph, selectorText, rule);
25670
- graph.addSelector(selector);
25671
- rule.selectors.push(selector);
25672
- graph.registerRuleBySelector(selectorText, rule);
25665
+ if (parentAtRule === null || parentAtRule.kind !== "keyframes") {
25666
+ const selectorStrings = parseSelectorList(rule.selectorText);
25667
+ for (let j = 0; j < selectorStrings.length; j++) {
25668
+ const selectorText = selectorStrings[j];
25669
+ if (!selectorText) continue;
25670
+ const selector = createSelectorEntity(graph, selectorText, rule);
25671
+ graph.addSelector(selector);
25672
+ rule.selectors.push(selector);
25673
+ graph.registerRuleBySelector(selectorText, rule);
25674
+ }
25673
25675
  }
25674
25676
  const ruleChildren = ruleNode.nodes;
25675
25677
  if (ruleChildren && ruleChildren.length > 0) {
@@ -36063,7 +36065,7 @@ var DYNAMIC_ATTRIBUTE_GUARD = {
36063
36065
  key: "dynamic-attribute:*"
36064
36066
  };
36065
36067
  var SCROLLABLE_VALUES = /* @__PURE__ */ new Set(["auto", "scroll"]);
36066
- function collectMonitoredDeclarations(selector, layerOrder, guard) {
36068
+ function collectMonitoredDeclarations(selector, layerOrder, guard, variablesByName) {
36067
36069
  const out = [];
36068
36070
  const declarations = selector.rule.declarations;
36069
36071
  for (let i = 0; i < declarations.length; i++) {
@@ -36079,12 +36081,14 @@ function collectMonitoredDeclarations(selector, layerOrder, guard) {
36079
36081
  specificityScore: selector.specificityScore,
36080
36082
  isImportant: declaration.cascadePosition.isImportant || declaration.node.important
36081
36083
  };
36084
+ const rawValue = declaration.value;
36085
+ const resolvedValue = variablesByName !== null && rawValue.includes("var(") ? substituteVarReferences(rawValue, variablesByName, 0) : rawValue;
36082
36086
  const directSignal = MONITORED_SIGNAL_NAME_MAP.get(property);
36083
36087
  if (directSignal !== void 0) {
36084
- out.push({ property: directSignal, value: declaration.value, guardProvenance: guard, position });
36088
+ out.push({ property: directSignal, value: resolvedValue, guardProvenance: guard, position });
36085
36089
  continue;
36086
36090
  }
36087
- const value2 = declaration.value.trim().toLowerCase();
36091
+ const value2 = resolvedValue.trim().toLowerCase();
36088
36092
  const expanded = expandShorthand(property, value2);
36089
36093
  if (expanded === void 0) continue;
36090
36094
  if (expanded === null) {
@@ -36095,7 +36099,7 @@ function collectMonitoredDeclarations(selector, layerOrder, guard) {
36095
36099
  if (!longhand) continue;
36096
36100
  const signal = MONITORED_SIGNAL_NAME_MAP.get(longhand);
36097
36101
  if (signal === void 0) continue;
36098
- out.push({ property: signal, value: declaration.value, guardProvenance: guard, position });
36102
+ out.push({ property: signal, value: resolvedValue, guardProvenance: guard, position });
36099
36103
  }
36100
36104
  continue;
36101
36105
  }
@@ -36190,19 +36194,6 @@ function augmentCascadeWithTailwind(cascade, node, tailwind) {
36190
36194
  }
36191
36195
  }
36192
36196
  var MAX_VAR_SUBSTITUTION_DEPTH = 10;
36193
- function resolveVarReferencesInCascade(cascade, variablesByName) {
36194
- for (const [property, declaration] of cascade) {
36195
- if (!declaration.value.includes("var(")) continue;
36196
- const resolved = substituteVarReferences(declaration.value, variablesByName, 0);
36197
- if (resolved !== declaration.value) {
36198
- cascade.set(property, {
36199
- value: resolved,
36200
- source: declaration.source,
36201
- guardProvenance: declaration.guardProvenance
36202
- });
36203
- }
36204
- }
36205
- }
36206
36197
  function substituteVarReferences(value2, variablesByName, depth) {
36207
36198
  if (depth >= MAX_VAR_SUBSTITUTION_DEPTH) return value2;
36208
36199
  const refs = extractVarReferences(value2);
@@ -36236,7 +36227,7 @@ function selectBestVariableValue(candidates) {
36236
36227
  const first = candidates[0];
36237
36228
  return first ? first.value : null;
36238
36229
  }
36239
- function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind, variablesByName) {
36230
+ function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind) {
36240
36231
  const out = /* @__PURE__ */ new Map();
36241
36232
  const positions = /* @__PURE__ */ new Map();
36242
36233
  for (let i = 0; i < edges.length; i++) {
@@ -36294,9 +36285,6 @@ function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorI
36294
36285
  if (tailwind !== null) {
36295
36286
  augmentCascadeWithTailwind(out, node, tailwind);
36296
36287
  }
36297
- if (variablesByName !== null) {
36298
- resolveVarReferencesInCascade(out, variablesByName);
36299
- }
36300
36288
  return out;
36301
36289
  }
36302
36290
  function compareLayoutEdge(a, b) {
@@ -36965,7 +36953,8 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
36965
36953
  const monitoredDeclarations = collectMonitoredDeclarations(
36966
36954
  selector,
36967
36955
  resolveRuleLayerOrder(selector.rule, css),
36968
- guard
36956
+ guard,
36957
+ css.variablesByName
36969
36958
  );
36970
36959
  selectorsById.set(selector.id, selector);
36971
36960
  monitoredDeclarationsBySelectorId.set(selector.id, monitoredDeclarations);
@@ -37143,7 +37132,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
37143
37132
  const mutableEdges = appliesByElementNodeMutable.get(node);
37144
37133
  if (mutableEdges) mutableEdges.sort(compareLayoutEdge);
37145
37134
  const edges = mutableEdges ?? EMPTY_EDGE_LIST;
37146
- const cascade = buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind, css.variablesByName);
37135
+ const cascade = buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind);
37147
37136
  if (trace && cascade.size > 0) {
37148
37137
  const displayDecl = cascade.get("display");
37149
37138
  const flexDirDecl = cascade.get("flex-direction");
@@ -40922,7 +40911,13 @@ var jsxLayoutPolicyTouchTarget = defineCrossRule({
40922
40911
  }
40923
40912
  });
40924
40913
  function checkDimension(snapshot, signal, min, layout, node, emit, messageId, template, tag, policyName) {
40925
- const px = readKnownPx(snapshot, signal);
40914
+ let px = readKnownPx(snapshot, signal);
40915
+ if (px === null) {
40916
+ const signalValue = readKnownSignalWithGuard(snapshot, signal);
40917
+ if (signalValue !== null && signalValue.guard.kind === 1 /* Conditional */) {
40918
+ px = resolveUnconditionalFallbackPx(layout, node, signal);
40919
+ }
40920
+ }
40926
40921
  if (px === null) return;
40927
40922
  if (px >= min) return;
40928
40923
  emitLayoutDiagnostic(
@@ -40942,6 +40937,20 @@ function checkDimension(snapshot, signal, min, layout, node, emit, messageId, te
40942
40937
  }
40943
40938
  );
40944
40939
  }
40940
+ function resolveUnconditionalFallbackPx(layout, node, signal) {
40941
+ const delta = readConditionalSignalDeltaFact(layout, node, signal);
40942
+ if (!delta.hasConditional) return null;
40943
+ const values = delta.unconditionalValues;
40944
+ let bestPx = null;
40945
+ for (let i = 0; i < values.length; i++) {
40946
+ const raw = values[i];
40947
+ if (!raw) continue;
40948
+ const px = parsePxValue(raw);
40949
+ if (px === null) continue;
40950
+ if (bestPx === null || px > bestPx) bestPx = px;
40951
+ }
40952
+ return bestPx;
40953
+ }
40945
40954
 
40946
40955
  // src/cross-file/rules/index.ts
40947
40956
  var rules3 = [