@drskillissue/ganko 0.2.81 → 0.2.82

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.
@@ -36261,7 +36261,7 @@ var DYNAMIC_ATTRIBUTE_GUARD = {
36261
36261
  key: "dynamic-attribute:*"
36262
36262
  };
36263
36263
  var SCROLLABLE_VALUES = /* @__PURE__ */ new Set(["auto", "scroll"]);
36264
- function collectMonitoredDeclarations(selector, layerOrder, guard) {
36264
+ function collectMonitoredDeclarations(selector, layerOrder, guard, variablesByName) {
36265
36265
  const out = [];
36266
36266
  const declarations = selector.rule.declarations;
36267
36267
  for (let i = 0; i < declarations.length; i++) {
@@ -36277,12 +36277,14 @@ function collectMonitoredDeclarations(selector, layerOrder, guard) {
36277
36277
  specificityScore: selector.specificityScore,
36278
36278
  isImportant: declaration.cascadePosition.isImportant || declaration.node.important
36279
36279
  };
36280
+ const rawValue = declaration.value;
36281
+ const resolvedValue = variablesByName !== null && rawValue.includes("var(") ? substituteVarReferences(rawValue, variablesByName, 0) : rawValue;
36280
36282
  const directSignal = MONITORED_SIGNAL_NAME_MAP.get(property);
36281
36283
  if (directSignal !== void 0) {
36282
- out.push({ property: directSignal, value: declaration.value, guardProvenance: guard, position });
36284
+ out.push({ property: directSignal, value: resolvedValue, guardProvenance: guard, position });
36283
36285
  continue;
36284
36286
  }
36285
- const value2 = declaration.value.trim().toLowerCase();
36287
+ const value2 = resolvedValue.trim().toLowerCase();
36286
36288
  const expanded = expandShorthand(property, value2);
36287
36289
  if (expanded === void 0) continue;
36288
36290
  if (expanded === null) {
@@ -36293,7 +36295,7 @@ function collectMonitoredDeclarations(selector, layerOrder, guard) {
36293
36295
  if (!longhand) continue;
36294
36296
  const signal = MONITORED_SIGNAL_NAME_MAP.get(longhand);
36295
36297
  if (signal === void 0) continue;
36296
- out.push({ property: signal, value: declaration.value, guardProvenance: guard, position });
36298
+ out.push({ property: signal, value: resolvedValue, guardProvenance: guard, position });
36297
36299
  }
36298
36300
  continue;
36299
36301
  }
@@ -36388,19 +36390,6 @@ function augmentCascadeWithTailwind(cascade, node, tailwind) {
36388
36390
  }
36389
36391
  }
36390
36392
  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
36393
  function substituteVarReferences(value2, variablesByName, depth) {
36405
36394
  if (depth >= MAX_VAR_SUBSTITUTION_DEPTH) return value2;
36406
36395
  const refs = extractVarReferences(value2);
@@ -36434,7 +36423,7 @@ function selectBestVariableValue(candidates) {
36434
36423
  const first = candidates[0];
36435
36424
  return first ? first.value : null;
36436
36425
  }
36437
- function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind, variablesByName) {
36426
+ function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind) {
36438
36427
  const out = /* @__PURE__ */ new Map();
36439
36428
  const positions = /* @__PURE__ */ new Map();
36440
36429
  for (let i = 0; i < edges.length; i++) {
@@ -36492,9 +36481,6 @@ function buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorI
36492
36481
  if (tailwind !== null) {
36493
36482
  augmentCascadeWithTailwind(out, node, tailwind);
36494
36483
  }
36495
- if (variablesByName !== null) {
36496
- resolveVarReferencesInCascade(out, variablesByName);
36497
- }
36498
36484
  return out;
36499
36485
  }
36500
36486
  function compareLayoutEdge(a, b) {
@@ -37163,7 +37149,8 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
37163
37149
  const monitoredDeclarations = collectMonitoredDeclarations(
37164
37150
  selector,
37165
37151
  resolveRuleLayerOrder(selector.rule, css),
37166
- guard
37152
+ guard,
37153
+ css.variablesByName
37167
37154
  );
37168
37155
  selectorsById.set(selector.id, selector);
37169
37156
  monitoredDeclarationsBySelectorId.set(selector.id, monitoredDeclarations);
@@ -37341,7 +37328,7 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
37341
37328
  const mutableEdges = appliesByElementNodeMutable.get(node);
37342
37329
  if (mutableEdges) mutableEdges.sort(compareLayoutEdge);
37343
37330
  const edges = mutableEdges ?? EMPTY_EDGE_LIST;
37344
- const cascade = buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind, css.variablesByName);
37331
+ const cascade = buildCascadeMapForElement(node, edges, monitoredDeclarationsBySelectorId, tailwind);
37345
37332
  if (trace && cascade.size > 0) {
37346
37333
  const displayDecl = cascade.get("display");
37347
37334
  const flexDirDecl = cascade.get("flex-direction");
@@ -41164,7 +41151,13 @@ var jsxLayoutPolicyTouchTarget = defineCrossRule({
41164
41151
  }
41165
41152
  });
41166
41153
  function checkDimension(snapshot, signal, min, layout, node, emit, messageId, template, tag, policyName) {
41167
- const px = readKnownPx(snapshot, signal);
41154
+ let px = readKnownPx(snapshot, signal);
41155
+ if (px === null) {
41156
+ const signalValue = readKnownSignalWithGuard(snapshot, signal);
41157
+ if (signalValue !== null && signalValue.guard.kind === 1 /* Conditional */) {
41158
+ px = resolveUnconditionalFallbackPx(layout, node, signal);
41159
+ }
41160
+ }
41168
41161
  if (px === null) return;
41169
41162
  if (px >= min) return;
41170
41163
  emitLayoutDiagnostic(
@@ -41184,6 +41177,20 @@ function checkDimension(snapshot, signal, min, layout, node, emit, messageId, te
41184
41177
  }
41185
41178
  );
41186
41179
  }
41180
+ function resolveUnconditionalFallbackPx(layout, node, signal) {
41181
+ const delta = readConditionalSignalDeltaFact(layout, node, signal);
41182
+ if (!delta.hasConditional) return null;
41183
+ const values = delta.unconditionalValues;
41184
+ let bestPx = null;
41185
+ for (let i = 0; i < values.length; i++) {
41186
+ const raw = values[i];
41187
+ if (!raw) continue;
41188
+ const px = parsePxValue(raw);
41189
+ if (px === null) continue;
41190
+ if (bestPx === null || px > bestPx) bestPx = px;
41191
+ }
41192
+ return bestPx;
41193
+ }
41187
41194
 
41188
41195
  // src/cross-file/rules/index.ts
41189
41196
  var rules3 = [
@@ -41314,4 +41321,4 @@ export {
41314
41321
  rules3,
41315
41322
  runCrossFileRules
41316
41323
  };
41317
- //# sourceMappingURL=chunk-QDFZ6A6X.js.map
41324
+ //# sourceMappingURL=chunk-CHVGY25Z.js.map