@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.
@@ -28384,14 +28384,16 @@ function walkAndProcess(graph, file, container, context, collector) {
28384
28384
  if (parentAtRule) {
28385
28385
  parentAtRule.rules.push(rule);
28386
28386
  }
28387
- const selectorStrings = parseSelectorList(rule.selectorText);
28388
- for (let j = 0; j < selectorStrings.length; j++) {
28389
- const selectorText = selectorStrings[j];
28390
- if (!selectorText) continue;
28391
- const selector = createSelectorEntity(graph, selectorText, rule);
28392
- graph.addSelector(selector);
28393
- rule.selectors.push(selector);
28394
- graph.registerRuleBySelector(selectorText, rule);
28387
+ if (parentAtRule === null || parentAtRule.kind !== "keyframes") {
28388
+ const selectorStrings = parseSelectorList(rule.selectorText);
28389
+ for (let j = 0; j < selectorStrings.length; j++) {
28390
+ const selectorText = selectorStrings[j];
28391
+ if (!selectorText) continue;
28392
+ const selector = createSelectorEntity(graph, selectorText, rule);
28393
+ graph.addSelector(selector);
28394
+ rule.selectors.push(selector);
28395
+ graph.registerRuleBySelector(selectorText, rule);
28396
+ }
28395
28397
  }
28396
28398
  const ruleChildren = ruleNode.nodes;
28397
28399
  if (ruleChildren && ruleChildren.length > 0) {
@@ -36261,7 +36263,7 @@ var DYNAMIC_ATTRIBUTE_GUARD = {
36261
36263
  key: "dynamic-attribute:*"
36262
36264
  };
36263
36265
  var SCROLLABLE_VALUES = /* @__PURE__ */ new Set(["auto", "scroll"]);
36264
- function collectMonitoredDeclarations(selector, layerOrder, guard) {
36266
+ function collectMonitoredDeclarations(selector, layerOrder, guard, variablesByName) {
36265
36267
  const out = [];
36266
36268
  const declarations = selector.rule.declarations;
36267
36269
  for (let i = 0; i < declarations.length; i++) {
@@ -36277,12 +36279,14 @@ function collectMonitoredDeclarations(selector, layerOrder, guard) {
36277
36279
  specificityScore: selector.specificityScore,
36278
36280
  isImportant: declaration.cascadePosition.isImportant || declaration.node.important
36279
36281
  };
36282
+ const rawValue = declaration.value;
36283
+ const resolvedValue = variablesByName !== null && rawValue.includes("var(") ? substituteVarReferences(rawValue, variablesByName, 0) : rawValue;
36280
36284
  const directSignal = MONITORED_SIGNAL_NAME_MAP.get(property);
36281
36285
  if (directSignal !== void 0) {
36282
- out.push({ property: directSignal, value: declaration.value, guardProvenance: guard, position });
36286
+ out.push({ property: directSignal, value: resolvedValue, guardProvenance: guard, position });
36283
36287
  continue;
36284
36288
  }
36285
- const value2 = declaration.value.trim().toLowerCase();
36289
+ const value2 = resolvedValue.trim().toLowerCase();
36286
36290
  const expanded = expandShorthand(property, value2);
36287
36291
  if (expanded === void 0) continue;
36288
36292
  if (expanded === null) {
@@ -36293,7 +36297,7 @@ function collectMonitoredDeclarations(selector, layerOrder, guard) {
36293
36297
  if (!longhand) continue;
36294
36298
  const signal = MONITORED_SIGNAL_NAME_MAP.get(longhand);
36295
36299
  if (signal === void 0) continue;
36296
- out.push({ property: signal, value: declaration.value, guardProvenance: guard, position });
36300
+ out.push({ property: signal, value: resolvedValue, guardProvenance: guard, position });
36297
36301
  }
36298
36302
  continue;
36299
36303
  }
@@ -36388,19 +36392,6 @@ function augmentCascadeWithTailwind(cascade, node, tailwind) {
36388
36392
  }
36389
36393
  }
36390
36394
  var MAX_VAR_SUBSTITUTION_DEPTH = 10;
36391
- function resolveVarReferencesInCascade(cascade, variablesByName) {
36392
- for (const [property, declaration] of cascade) {
36393
- if (!declaration.value.includes("var(")) continue;
36394
- const resolved = substituteVarReferences(declaration.value, variablesByName, 0);
36395
- if (resolved !== declaration.value) {
36396
- cascade.set(property, {
36397
- value: resolved,
36398
- source: declaration.source,
36399
- guardProvenance: declaration.guardProvenance
36400
- });
36401
- }
36402
- }
36403
- }
36404
36395
  function substituteVarReferences(value2, variablesByName, depth) {
36405
36396
  if (depth >= MAX_VAR_SUBSTITUTION_DEPTH) return value2;
36406
36397
  const refs = extractVarReferences(value2);
@@ -36434,7 +36425,7 @@ function selectBestVariableValue(candidates) {
36434
36425
  const first = candidates[0];
36435
36426
  return first ? first.value : null;
36436
36427
  }
36437
- function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind, variablesByName) {
36428
+ function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind) {
36438
36429
  const out = /* @__PURE__ */ new Map();
36439
36430
  const positions = /* @__PURE__ */ new Map();
36440
36431
  for (let i = 0; i < edges.length; i++) {
@@ -36492,9 +36483,6 @@ function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorI
36492
36483
  if (tailwind !== null) {
36493
36484
  augmentCascadeWithTailwind(out, node, tailwind);
36494
36485
  }
36495
- if (variablesByName !== null) {
36496
- resolveVarReferencesInCascade(out, variablesByName);
36497
- }
36498
36486
  return out;
36499
36487
  }
36500
36488
  function compareLayoutEdge(a, b) {
@@ -37163,7 +37151,8 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
37163
37151
  const monitoredDeclarations = collectMonitoredDeclarations(
37164
37152
  selector,
37165
37153
  resolveRuleLayerOrder(selector.rule, css),
37166
- guard
37154
+ guard,
37155
+ css.variablesByName
37167
37156
  );
37168
37157
  selectorsById.set(selector.id, selector);
37169
37158
  monitoredDeclarationsBySelectorId.set(selector.id, monitoredDeclarations);
@@ -37341,7 +37330,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
37341
37330
  const mutableEdges = appliesByElementNodeMutable.get(node);
37342
37331
  if (mutableEdges) mutableEdges.sort(compareLayoutEdge);
37343
37332
  const edges = mutableEdges ?? EMPTY_EDGE_LIST;
37344
- const cascade = buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind, css.variablesByName);
37333
+ const cascade = buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind);
37345
37334
  if (trace && cascade.size > 0) {
37346
37335
  const displayDecl = cascade.get("display");
37347
37336
  const flexDirDecl = cascade.get("flex-direction");
@@ -41164,7 +41153,13 @@ var jsxLayoutPolicyTouchTarget = defineCrossRule({
41164
41153
  }
41165
41154
  });
41166
41155
  function checkDimension(snapshot, signal, min, layout, node, emit, messageId, template, tag, policyName) {
41167
- const px = readKnownPx(snapshot, signal);
41156
+ let px = readKnownPx(snapshot, signal);
41157
+ if (px === null) {
41158
+ const signalValue = readKnownSignalWithGuard(snapshot, signal);
41159
+ if (signalValue !== null && signalValue.guard.kind === 1 /* Conditional */) {
41160
+ px = resolveUnconditionalFallbackPx(layout, node, signal);
41161
+ }
41162
+ }
41168
41163
  if (px === null) return;
41169
41164
  if (px >= min) return;
41170
41165
  emitLayoutDiagnostic(
@@ -41184,6 +41179,20 @@ function checkDimension(snapshot, signal, min, layout, node, emit, messageId, te
41184
41179
  }
41185
41180
  );
41186
41181
  }
41182
+ function resolveUnconditionalFallbackPx(layout, node, signal) {
41183
+ const delta = readConditionalSignalDeltaFact(layout, node, signal);
41184
+ if (!delta.hasConditional) return null;
41185
+ const values = delta.unconditionalValues;
41186
+ let bestPx = null;
41187
+ for (let i = 0; i < values.length; i++) {
41188
+ const raw = values[i];
41189
+ if (!raw) continue;
41190
+ const px = parsePxValue(raw);
41191
+ if (px === null) continue;
41192
+ if (bestPx === null || px > bestPx) bestPx = px;
41193
+ }
41194
+ return bestPx;
41195
+ }
41187
41196
 
41188
41197
  // src/cross-file/rules/index.ts
41189
41198
  var rules3 = [
@@ -41314,4 +41323,4 @@ export {
41314
41323
  rules3,
41315
41324
  runCrossFileRules
41316
41325
  };
41317
- //# sourceMappingURL=chunk-QDFZ6A6X.js.map
41326
+ //# sourceMappingURL=chunk-F5F7F4LG.js.map