@drskillissue/ganko 0.2.5 → 0.2.6
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-FTIRRRQY.js} +55 -3
- package/dist/{chunk-HIADOXXV.js.map → chunk-FTIRRRQY.js.map} +1 -1
- package/dist/eslint-plugin.cjs +54 -2
- package/dist/eslint-plugin.cjs.map +1 -1
- package/dist/eslint-plugin.js +1 -1
- package/dist/index.cjs +54 -2
- 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
|
@@ -37385,7 +37385,7 @@ function resolveRuleLayerOrder(rule, css) {
|
|
|
37385
37385
|
if (!name) return 0;
|
|
37386
37386
|
return css.layerOrder.get(name) ?? 0;
|
|
37387
37387
|
}
|
|
37388
|
-
function buildConditionalDeltaIndex(elements, appliesByNode, monitoredDeclarationsBySelectorId) {
|
|
37388
|
+
function buildConditionalDeltaIndex(elements, appliesByNode, monitoredDeclarationsBySelectorId, selectorsById) {
|
|
37389
37389
|
const conditionalSignalDeltaFactsByNode = /* @__PURE__ */ new Map();
|
|
37390
37390
|
const elementsWithConditionalDeltaBySignal = /* @__PURE__ */ new Map();
|
|
37391
37391
|
const baselineOffsetFactsByNode = /* @__PURE__ */ new Map();
|
|
@@ -37396,11 +37396,16 @@ function buildConditionalDeltaIndex(elements, appliesByNode, monitoredDeclaratio
|
|
|
37396
37396
|
let factByProperty = null;
|
|
37397
37397
|
if (edges !== void 0 && edges.length > 0) {
|
|
37398
37398
|
const byProperty = /* @__PURE__ */ new Map();
|
|
37399
|
+
let conditionalAttributeDispatch = null;
|
|
37399
37400
|
for (let j = 0; j < edges.length; j++) {
|
|
37400
37401
|
const currentEdge = edges[j];
|
|
37401
37402
|
if (!currentEdge) continue;
|
|
37402
37403
|
const declarations = monitoredDeclarationsBySelectorId.get(currentEdge.selectorId);
|
|
37403
37404
|
if (!declarations) continue;
|
|
37405
|
+
let conditionalAttributeName = null;
|
|
37406
|
+
if (currentEdge.conditionalMatch) {
|
|
37407
|
+
conditionalAttributeName = identifyConditionalAttribute(currentEdge.selectorId, node, selectorsById);
|
|
37408
|
+
}
|
|
37404
37409
|
for (let k = 0; k < declarations.length; k++) {
|
|
37405
37410
|
const declaration = declarations[k];
|
|
37406
37411
|
if (!declaration) continue;
|
|
@@ -37419,6 +37424,15 @@ function buildConditionalDeltaIndex(elements, appliesByNode, monitoredDeclaratio
|
|
|
37419
37424
|
}
|
|
37420
37425
|
if (declaration.guardProvenance.kind === 1 /* Conditional */ || currentEdge.conditionalMatch) {
|
|
37421
37426
|
bucket.conditional.add(expandedEntry.value);
|
|
37427
|
+
if (conditionalAttributeName !== null && declaration.guardProvenance.kind !== 1 /* Conditional */) {
|
|
37428
|
+
if (conditionalAttributeDispatch === null) conditionalAttributeDispatch = /* @__PURE__ */ new Map();
|
|
37429
|
+
let dispatchMap = conditionalAttributeDispatch.get(property);
|
|
37430
|
+
if (!dispatchMap) {
|
|
37431
|
+
dispatchMap = /* @__PURE__ */ new Map();
|
|
37432
|
+
conditionalAttributeDispatch.set(property, dispatchMap);
|
|
37433
|
+
}
|
|
37434
|
+
dispatchMap.set(expandedEntry.value, conditionalAttributeName);
|
|
37435
|
+
}
|
|
37422
37436
|
continue;
|
|
37423
37437
|
}
|
|
37424
37438
|
bucket.unconditional.add(expandedEntry.value);
|
|
@@ -37443,6 +37457,24 @@ function buildConditionalDeltaIndex(elements, appliesByNode, monitoredDeclaratio
|
|
|
37443
37457
|
}
|
|
37444
37458
|
}
|
|
37445
37459
|
}
|
|
37460
|
+
if (hasDelta && conditionalAttributeDispatch !== null) {
|
|
37461
|
+
const dispatchMap = conditionalAttributeDispatch.get(property);
|
|
37462
|
+
if (dispatchMap !== void 0 && dispatchMap.size === conditionalValues.length) {
|
|
37463
|
+
let singleAttribute = null;
|
|
37464
|
+
let allSameAttribute = true;
|
|
37465
|
+
for (const attrName of dispatchMap.values()) {
|
|
37466
|
+
if (singleAttribute === null) {
|
|
37467
|
+
singleAttribute = attrName;
|
|
37468
|
+
} else if (singleAttribute !== attrName) {
|
|
37469
|
+
allSameAttribute = false;
|
|
37470
|
+
break;
|
|
37471
|
+
}
|
|
37472
|
+
}
|
|
37473
|
+
if (allSameAttribute && singleAttribute !== null) {
|
|
37474
|
+
hasDelta = false;
|
|
37475
|
+
}
|
|
37476
|
+
}
|
|
37477
|
+
}
|
|
37446
37478
|
const scrollProfile = buildScrollValueProfile(property, conditionalValues, unconditionalValues);
|
|
37447
37479
|
facts.set(property, {
|
|
37448
37480
|
hasConditional,
|
|
@@ -37528,6 +37560,25 @@ function buildConditionalDeltaSignalGroupElements(elementsWithConditionalDeltaBy
|
|
|
37528
37560
|
}
|
|
37529
37561
|
return out;
|
|
37530
37562
|
}
|
|
37563
|
+
function identifyConditionalAttribute(selectorId, node, selectorsById) {
|
|
37564
|
+
const selector = selectorsById.get(selectorId);
|
|
37565
|
+
if (!selector) return null;
|
|
37566
|
+
const constraints = selector.anchor.attributes;
|
|
37567
|
+
let dynamicAttributeName = null;
|
|
37568
|
+
for (let i = 0; i < constraints.length; i++) {
|
|
37569
|
+
const constraint = constraints[i];
|
|
37570
|
+
if (!constraint) continue;
|
|
37571
|
+
if (constraint.operator !== "equals") continue;
|
|
37572
|
+
if (constraint.value === null) continue;
|
|
37573
|
+
const elementValue = node.attributes.get(constraint.name);
|
|
37574
|
+
if (elementValue !== null) continue;
|
|
37575
|
+
if (dynamicAttributeName !== null && dynamicAttributeName !== constraint.name) {
|
|
37576
|
+
return null;
|
|
37577
|
+
}
|
|
37578
|
+
dynamicAttributeName = constraint.name;
|
|
37579
|
+
}
|
|
37580
|
+
return dynamicAttributeName;
|
|
37581
|
+
}
|
|
37531
37582
|
function buildScrollValueProfile(property, conditionalValues, unconditionalValues) {
|
|
37532
37583
|
if (property !== "overflow" && property !== "overflow-y") {
|
|
37533
37584
|
return {
|
|
@@ -38090,7 +38141,8 @@ function buildLayoutGraph(solids, css, logger = noopLogger) {
|
|
|
38090
38141
|
const conditionalDeltaIndex = buildConditionalDeltaIndex(
|
|
38091
38142
|
elements,
|
|
38092
38143
|
appliesByNode,
|
|
38093
|
-
monitoredDeclarationsBySelectorId
|
|
38144
|
+
monitoredDeclarationsBySelectorId,
|
|
38145
|
+
selectorsById
|
|
38094
38146
|
);
|
|
38095
38147
|
const elementsWithConditionalOverflowDelta = buildConditionalDeltaSignalGroupElements(
|
|
38096
38148
|
conditionalDeltaIndex.elementsWithConditionalDeltaBySignal,
|