mnfst 0.5.311 → 0.5.313
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/lib/manifest.appwrite.data.js +1 -1
- package/lib/manifest.data.js +1 -1
- package/lib/manifest.data.min.js +1 -1
- package/lib/manifest.integrity.json +10 -10
- package/lib/manifest.js +2 -2
- package/lib/manifest.min.js +1 -1
- package/lib/manifest.modules.integrity.json +7 -7
- package/lib/manifest.sw.js +1 -1
- package/lib/manifest.sw.min.js +1 -1
- package/lib/manifest.utilities.js +126 -84
- package/lib/manifest.utilities.min.js +1 -1
- package/lib/manifest.utilities.min.js.map +1 -1
- package/lib/manifest.utilities.node.mjs +127 -89
- package/package.json +3 -1
|
@@ -1881,6 +1881,16 @@ TailwindCompiler.prototype.parseClassName = function (className) {
|
|
|
1881
1881
|
// Unrecognised @-form falls through to the warning below.
|
|
1882
1882
|
}
|
|
1883
1883
|
|
|
1884
|
+
// Breakpoint ranges (Tailwind v4): max-md → width < md, min-md → width >= md, plus min-/max-[size]
|
|
1885
|
+
const rangeMatch = variant.match(/^(min|max)-(?:\[(.+)\]|(sm|md|lg|xl|2xl))$/);
|
|
1886
|
+
if (rangeMatch) {
|
|
1887
|
+
const named = rangeMatch[3] && /\(min-width:\s*([^)]+)\)/.exec(this.variants[rangeMatch[3]] || '');
|
|
1888
|
+
const size = rangeMatch[2] ? rangeMatch[2].replace(/_/g, ' ') : named && named[1].trim();
|
|
1889
|
+
if (size && !/[{};]/.test(size)) {
|
|
1890
|
+
return { name: variant, selector: `@media (width ${rangeMatch[1] === 'max' ? '<' : '>='} ${size})`, isArbitrary: false };
|
|
1891
|
+
}
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1884
1894
|
// If no match found, warn once per unique token and return null.
|
|
1885
1895
|
// Deduped so unsupported variants (e.g. container queries like
|
|
1886
1896
|
// `@[10rem]:`) don't flood the console on every compile pass.
|
|
@@ -1905,14 +1915,14 @@ TailwindCompiler.prototype.parseClassName = function (className) {
|
|
|
1905
1915
|
// Generate utilities from CSS variables
|
|
1906
1916
|
TailwindCompiler.prototype.generateUtilitiesFromVars = function (cssText, usedData) {
|
|
1907
1917
|
try {
|
|
1908
|
-
const
|
|
1918
|
+
const out = [];
|
|
1909
1919
|
const generatedRules = new Set(); // Track generated rules to prevent duplicates
|
|
1910
1920
|
const variables = this.extractThemeVariables(cssText);
|
|
1911
1921
|
const { classes: usedClasses, variableSuffixes } = usedData;
|
|
1912
1922
|
// Optional: raw rules + their full-regen order keys (incremental apply places deltas by them)
|
|
1913
1923
|
const rulesOut = usedData.rulesOut, keysOut = usedData.keysOut;
|
|
1914
1924
|
let slot = null;
|
|
1915
|
-
const emit = (rule, sub) => {
|
|
1925
|
+
const emit = (rule, sub, order) => { out.push({ rule, key: ruleKey(rule, order, slot.concat(slot[3] ? 2 : sub)) }); }; // opacity rules order by discovery
|
|
1916
1926
|
|
|
1917
1927
|
if (variables.size === 0) {
|
|
1918
1928
|
return '';
|
|
@@ -1972,6 +1982,7 @@ TailwindCompiler.prototype.generateUtilitiesFromVars = function (cssText, usedDa
|
|
|
1972
1982
|
let selector = `.${escapeClassName(variantClass)}`;
|
|
1973
1983
|
let hasMediaQuery = false;
|
|
1974
1984
|
let mediaQueryRule = '';
|
|
1985
|
+
const atRules = [];
|
|
1975
1986
|
|
|
1976
1987
|
for (const variant of parsed.variants) {
|
|
1977
1988
|
if (variant.isArbitrary) {
|
|
@@ -1997,9 +2008,10 @@ TailwindCompiler.prototype.generateUtilitiesFromVars = function (cssText, usedDa
|
|
|
1997
2008
|
// For pseudo-classes, append to selector
|
|
1998
2009
|
selector = `${selector}${variant.selector}`;
|
|
1999
2010
|
} else if (variant.selector.startsWith('@')) {
|
|
2000
|
-
//
|
|
2011
|
+
// At-rules wrap the rule; stacked ones nest outer to inner (md:max-lg:)
|
|
2001
2012
|
hasMediaQuery = true;
|
|
2002
|
-
|
|
2013
|
+
atRules.push(variant.selector);
|
|
2014
|
+
mediaQueryRule = atRules[0];
|
|
2003
2015
|
}
|
|
2004
2016
|
}
|
|
2005
2017
|
|
|
@@ -2013,12 +2025,10 @@ TailwindCompiler.prototype.generateUtilitiesFromVars = function (cssText, usedDa
|
|
|
2013
2025
|
rule = `${selector} { ${cssContent} }`;
|
|
2014
2026
|
}
|
|
2015
2027
|
|
|
2016
|
-
const finalRule = hasMediaQuery ?
|
|
2017
|
-
`${mediaQueryRule} { ${rule} }` :
|
|
2018
|
-
rule;
|
|
2028
|
+
const finalRule = hasMediaQuery ? wrapAtRules(atRules, rule) : rule;
|
|
2019
2029
|
|
|
2020
2030
|
if (!generatedRules.has(finalRule)) {
|
|
2021
|
-
emit(finalRule, 2);
|
|
2031
|
+
emit(finalRule, 2, mediaOrder(parsed.variants));
|
|
2022
2032
|
generatedRules.add(finalRule);
|
|
2023
2033
|
}
|
|
2024
2034
|
}
|
|
@@ -2096,13 +2106,17 @@ TailwindCompiler.prototype.generateUtilitiesFromVars = function (cssText, usedDa
|
|
|
2096
2106
|
}
|
|
2097
2107
|
}
|
|
2098
2108
|
|
|
2099
|
-
return
|
|
2109
|
+
return flushEntries(out, rulesOut, keysOut);
|
|
2100
2110
|
} catch (error) {
|
|
2101
2111
|
console.error('Error generating utilities:', error);
|
|
2102
2112
|
return '';
|
|
2103
2113
|
}
|
|
2104
2114
|
};
|
|
2105
2115
|
|
|
2116
|
+
function wrapAtRules(atRules, rule) {
|
|
2117
|
+
return atRules.reduceRight((inner, at) => `${at} { ${inner} }`, rule);
|
|
2118
|
+
}
|
|
2119
|
+
|
|
2106
2120
|
// Responsive display ordering: every breakpoint display class sits at 0,2,0, in breakpoint order,
|
|
2107
2121
|
// so it beats an unprefixed `hidden` from any sheet and larger breakpoints still win (col md:row lg:hidden)
|
|
2108
2122
|
const BUILTIN_DISPLAY_CLASSES = new Set(['row', 'row-wrap', 'col', 'col-wrap', 'trailing']);
|
|
@@ -2116,10 +2130,71 @@ const TAILWIND_DISPLAY = {
|
|
|
2116
2130
|
'table-header-group': 'table-header-group', 'table-row-group': 'table-row-group', 'table-row': 'table-row'
|
|
2117
2131
|
};
|
|
2118
2132
|
|
|
2133
|
+
// Breakpoint name (sm, min-sm, max-sm) → { px, max }; null if not a breakpoint
|
|
2134
|
+
function breakpointOf(name) {
|
|
2135
|
+
const max = name.startsWith('max-');
|
|
2136
|
+
const base = max ? name.slice(4) : name.startsWith('min-') ? name.slice(4) : name;
|
|
2137
|
+
return Object.prototype.hasOwnProperty.call(BREAKPOINT_PX, base) ? { px: BREAKPOINT_PX[base], max } : null;
|
|
2138
|
+
}
|
|
2139
|
+
|
|
2119
2140
|
// max-* widest first, then min-width ascending (Tailwind's order)
|
|
2120
2141
|
function breakpointRank(name) {
|
|
2121
|
-
|
|
2122
|
-
return
|
|
2142
|
+
const bp = breakpointOf(name);
|
|
2143
|
+
return bp.max ? -bp.px : bp.px;
|
|
2144
|
+
}
|
|
2145
|
+
|
|
2146
|
+
// ---- @media rule order (Tailwind v4): early media, then breakpoints by rank, then other media ----
|
|
2147
|
+
const NO_RANK = -1e6;
|
|
2148
|
+
const EARLY_MEDIA_VARIANTS = new Set([
|
|
2149
|
+
'motion-safe', 'motion-reduce', 'contrast-more', 'contrast-less',
|
|
2150
|
+
'prefers-reduced-motion', 'prefers-reduced-motion-no-preference',
|
|
2151
|
+
'prefers-contrast', 'prefers-contrast-less', 'prefers-contrast-no-preference'
|
|
2152
|
+
]);
|
|
2153
|
+
|
|
2154
|
+
// Named or arbitrary range variant → rank (max-* negative, min-width positive); null if not a range
|
|
2155
|
+
function rangeRank(name) {
|
|
2156
|
+
if (!name) return null;
|
|
2157
|
+
if (breakpointOf(name)) return breakpointRank(name);
|
|
2158
|
+
const m = /^(min|max)-\[(.+)\]$/.exec(name);
|
|
2159
|
+
if (!m) return null;
|
|
2160
|
+
const u = /^(-?\d*\.?\d+)(px|rem|em)$/.exec(m[2].trim());
|
|
2161
|
+
const px = u ? parseFloat(u[1]) * (u[2] === 'px' ? 1 : 16) : null;
|
|
2162
|
+
if (m[1] === 'max') return px === null ? -1e5 : -px;
|
|
2163
|
+
return px === null ? 1e5 : px;
|
|
2164
|
+
}
|
|
2165
|
+
|
|
2166
|
+
// [band, r1, r2, extra] for an @media rule built from these variants; the highest-order variant decides,
|
|
2167
|
+
// extra lower-order media variants sort after (md: before motion-safe:md:)
|
|
2168
|
+
function mediaOrder(variants) {
|
|
2169
|
+
let band = -1, extra = 0;
|
|
2170
|
+
const ranks = [];
|
|
2171
|
+
for (const v of variants || []) {
|
|
2172
|
+
if (!v || typeof v.selector !== 'string' || !v.selector.startsWith('@media')) continue;
|
|
2173
|
+
const r = rangeRank(v.name);
|
|
2174
|
+
if (r !== null) { ranks.push(r); band = Math.max(band, 1); }
|
|
2175
|
+
else { band = Math.max(band, EARLY_MEDIA_VARIANTS.has(v.name) ? 0 : 2); extra++; }
|
|
2176
|
+
}
|
|
2177
|
+
ranks.sort((a, b) => b - a);
|
|
2178
|
+
if (band === 1) extra = Math.min(extra, 1);
|
|
2179
|
+
else extra = 0;
|
|
2180
|
+
return [band < 0 ? 2 : band, ranks.length ? ranks[0] : NO_RANK, ranks.length > 1 ? ranks[1] : NO_RANK, extra];
|
|
2181
|
+
}
|
|
2182
|
+
|
|
2183
|
+
// Full order key: [media, band, r1, r2, extra, section, var/entry, pair/array, opacity, sub]
|
|
2184
|
+
function ruleKey(rule, order, slotKey) {
|
|
2185
|
+
const head = isMediaRule(rule) ? [1].concat(order || [2, NO_RANK, NO_RANK, 0]) : [0, 0, 0, 0, 0];
|
|
2186
|
+
return head.concat(slotKey);
|
|
2187
|
+
}
|
|
2188
|
+
|
|
2189
|
+
function sortEntries(entries) {
|
|
2190
|
+
return entries.slice().sort((a, b) => compareKeys(a.key, b.key));
|
|
2191
|
+
}
|
|
2192
|
+
|
|
2193
|
+
// Sorted text; raw rules + keys go to rulesOut/keysOut when the caller asked for them
|
|
2194
|
+
function flushEntries(out, rulesOut, keysOut) {
|
|
2195
|
+
const sorted = sortEntries(out);
|
|
2196
|
+
if (rulesOut) for (const e of sorted) { rulesOut.push(e.rule); keysOut.push(e.key); }
|
|
2197
|
+
return sorted.map(e => e.rule).join('\n');
|
|
2123
2198
|
}
|
|
2124
2199
|
|
|
2125
2200
|
// Top-level display declarations only (nested blocks ignored)
|
|
@@ -2142,7 +2217,7 @@ function withoutTopLevelDisplay(css) {
|
|
|
2142
2217
|
|
|
2143
2218
|
function responsiveDisplayDecl(baseClass, parsed, css) {
|
|
2144
2219
|
if (!BUILTIN_DISPLAY_CLASSES.has(baseClass) || parsed.variants.length !== 1) return null;
|
|
2145
|
-
if (!
|
|
2220
|
+
if (!breakpointOf(parsed.variants[0].name)) return null;
|
|
2146
2221
|
return topLevelDisplay(css);
|
|
2147
2222
|
}
|
|
2148
2223
|
|
|
@@ -2152,14 +2227,12 @@ function tailwindResponsiveDisplay(usedClasses) {
|
|
|
2152
2227
|
for (const cls of usedClasses) {
|
|
2153
2228
|
const parts = cls.split(':');
|
|
2154
2229
|
if (parts.length !== 2 || !Object.prototype.hasOwnProperty.call(TAILWIND_DISPLAY, parts[1])) continue;
|
|
2155
|
-
const bp = parts[0];
|
|
2156
|
-
|
|
2157
|
-
const px = BREAKPOINT_PX[max ? bp.slice(4) : bp];
|
|
2158
|
-
if (!px) continue;
|
|
2230
|
+
const bp = breakpointOf(parts[0]);
|
|
2231
|
+
if (!bp) continue;
|
|
2159
2232
|
out.push({
|
|
2160
2233
|
cls,
|
|
2161
|
-
media: max ? `@media (width < ${px}px)` : `@media (min-width: ${px}px)`,
|
|
2162
|
-
rank: breakpointRank(
|
|
2234
|
+
media: bp.max ? `@media (width < ${bp.px}px)` : `@media (min-width: ${bp.px}px)`,
|
|
2235
|
+
rank: breakpointRank(parts[0]),
|
|
2163
2236
|
css: TAILWIND_DISPLAY[parts[1]]
|
|
2164
2237
|
});
|
|
2165
2238
|
}
|
|
@@ -2169,12 +2242,12 @@ function tailwindResponsiveDisplay(usedClasses) {
|
|
|
2169
2242
|
// Generate custom utilities from discovered custom utility classes
|
|
2170
2243
|
TailwindCompiler.prototype.generateCustomUtilities = function (usedData) {
|
|
2171
2244
|
try {
|
|
2172
|
-
const
|
|
2245
|
+
const out = [];
|
|
2173
2246
|
const generatedRules = new Set();
|
|
2174
2247
|
const { classes: usedClasses } = usedData;
|
|
2175
2248
|
const rulesOut = usedData.rulesOut, keysOut = usedData.keysOut;
|
|
2176
2249
|
let slot = null;
|
|
2177
|
-
const emit = (rule, sub) => {
|
|
2250
|
+
const emit = (rule, sub, order) => { out.push({ rule, key: ruleKey(rule, order, slot.concat(sub)) }); };
|
|
2178
2251
|
const responsiveDisplay = [];
|
|
2179
2252
|
|
|
2180
2253
|
// Helper to clean up [object Object] from CSS strings
|
|
@@ -2355,6 +2428,7 @@ TailwindCompiler.prototype.generateCustomUtilities = function (usedData) {
|
|
|
2355
2428
|
let selector = `.${escapeClassName(variantClass)}`;
|
|
2356
2429
|
let hasMediaQuery = false;
|
|
2357
2430
|
let mediaQueryRule = '';
|
|
2431
|
+
const atRules = [];
|
|
2358
2432
|
let nestedSelector = null;
|
|
2359
2433
|
|
|
2360
2434
|
for (const variant of parsed.variants) {
|
|
@@ -2381,9 +2455,10 @@ TailwindCompiler.prototype.generateCustomUtilities = function (usedData) {
|
|
|
2381
2455
|
// For pseudo-classes, append to selector
|
|
2382
2456
|
selector = `${selector}${variant.selector}`;
|
|
2383
2457
|
} else if (variant.selector.startsWith('@')) {
|
|
2384
|
-
//
|
|
2458
|
+
// At-rules wrap the rule; stacked ones nest outer to inner (md:max-lg:)
|
|
2385
2459
|
hasMediaQuery = true;
|
|
2386
|
-
|
|
2460
|
+
atRules.push(variant.selector);
|
|
2461
|
+
mediaQueryRule = atRules[0];
|
|
2387
2462
|
}
|
|
2388
2463
|
}
|
|
2389
2464
|
|
|
@@ -2509,14 +2584,14 @@ TailwindCompiler.prototype.generateCustomUtilities = function (usedData) {
|
|
|
2509
2584
|
if (typeof rule === 'string' && rule.trim().startsWith('@media')) {
|
|
2510
2585
|
finalRule = rule;
|
|
2511
2586
|
} else {
|
|
2512
|
-
finalRule =
|
|
2587
|
+
finalRule = wrapAtRules(atRules, rule);
|
|
2513
2588
|
}
|
|
2514
2589
|
} else {
|
|
2515
2590
|
finalRule = rule;
|
|
2516
2591
|
}
|
|
2517
2592
|
|
|
2518
2593
|
if (!generatedRules.has(finalRule)) {
|
|
2519
|
-
emit(finalRule, 2);
|
|
2594
|
+
emit(finalRule, 2, mediaOrder(parsed.variants));
|
|
2520
2595
|
generatedRules.add(finalRule);
|
|
2521
2596
|
}
|
|
2522
2597
|
}
|
|
@@ -2609,51 +2684,34 @@ TailwindCompiler.prototype.generateCustomUtilities = function (usedData) {
|
|
|
2609
2684
|
const rule = `${e.media} { ${own}${own} { display: ${e.css} } }`;
|
|
2610
2685
|
if (generatedRules.has(rule)) continue;
|
|
2611
2686
|
generatedRules.add(rule);
|
|
2612
|
-
slot = [2,
|
|
2613
|
-
emit(rule, 2);
|
|
2687
|
+
slot = [2, 0, 0, 0];
|
|
2688
|
+
emit(rule, 2, [1, e.rank, NO_RANK, 0]);
|
|
2614
2689
|
}
|
|
2615
2690
|
}
|
|
2616
2691
|
|
|
2617
|
-
return
|
|
2692
|
+
return flushEntries(out, rulesOut, keysOut);
|
|
2618
2693
|
} catch (error) {
|
|
2619
2694
|
console.error('Error generating custom utilities:', error);
|
|
2620
2695
|
return '';
|
|
2621
2696
|
}
|
|
2622
2697
|
};
|
|
2623
2698
|
|
|
2624
|
-
//
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
currentRule = line;
|
|
2632
|
-
} else {
|
|
2633
|
-
currentRule += '\n' + line;
|
|
2634
|
-
}
|
|
2635
|
-
}
|
|
2636
|
-
if (currentRule.trim()) rules.push(currentRule.trim());
|
|
2637
|
-
return rules;
|
|
2699
|
+
// Rules + order keys for theme and custom utilities, in sheet order (base, then @media by breakpoint).
|
|
2700
|
+
// Full compile, incremental apply, cache text and the node bake all write this order.
|
|
2701
|
+
TailwindCompiler.prototype.generateOrderedUtilities = function (themeCss, usedData) {
|
|
2702
|
+
const data = Object.assign({}, usedData, { rulesOut: [], keysOut: [] });
|
|
2703
|
+
this.generateUtilitiesFromVars(themeCss, data);
|
|
2704
|
+
this.generateCustomUtilities(data);
|
|
2705
|
+
return sortEntries(data.rulesOut.map((rule, i) => ({ rule, key: data.keysOut[i] })));
|
|
2638
2706
|
};
|
|
2639
2707
|
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
if (!utilitiesText) return '';
|
|
2643
|
-
const rules = this.splitUtilityRules(utilitiesText);
|
|
2644
|
-
rules.sort((a, b) => {
|
|
2645
|
-
const aHasMedia = a.startsWith('@media');
|
|
2646
|
-
const bHasMedia = b.startsWith('@media');
|
|
2647
|
-
if (!aHasMedia && bHasMedia) return -1;
|
|
2648
|
-
if (aHasMedia && !bHasMedia) return 1;
|
|
2649
|
-
return 0;
|
|
2650
|
-
});
|
|
2651
|
-
return rules.join('\n\n');
|
|
2708
|
+
TailwindCompiler.prototype.orderedUtilitiesCss = function (entries) {
|
|
2709
|
+
return entries.map(e => e.rule).join('\n\n');
|
|
2652
2710
|
};
|
|
2653
2711
|
|
|
2654
2712
|
// ---- Incremental apply: new rules go in through CSSOM, never a whole-sheet rewrite ----
|
|
2655
2713
|
// Entries mirror the layer's cssRules 1:1, each keyed by where a full regen would emit it
|
|
2656
|
-
// (
|
|
2714
|
+
// (see ruleKey); deltas are inserted at that index.
|
|
2657
2715
|
|
|
2658
2716
|
const utilitiesCssFrom = (applied) => `@layer utilities {\n${applied.entries.map(e => e.rule).join('\n\n')}\n}`;
|
|
2659
2717
|
const isMediaRule = (rule) => rule.trim().startsWith('@media');
|
|
@@ -2663,16 +2721,9 @@ function compareKeys(a, b) {
|
|
|
2663
2721
|
return 0;
|
|
2664
2722
|
}
|
|
2665
2723
|
|
|
2666
|
-
// Raw rules + order keys for a class set, as a full regen would emit them
|
|
2724
|
+
// Raw rules + order keys for a class set, as a full regen would emit them
|
|
2667
2725
|
TailwindCompiler.prototype.generateKeyedUtilities = function (themeCss, classes) {
|
|
2668
|
-
|
|
2669
|
-
this.generateUtilitiesFromVars(themeCss, usedData);
|
|
2670
|
-
this.generateCustomUtilities(usedData);
|
|
2671
|
-
const out = usedData.rulesOut.map((rule, i) => {
|
|
2672
|
-
const media = isMediaRule(rule) ? 1 : 0;
|
|
2673
|
-
return { rule, key: [media].concat(usedData.keysOut[i]) };
|
|
2674
|
-
});
|
|
2675
|
-
return out.filter(e => !e.key[0]).concat(out.filter(e => e.key[0]));
|
|
2726
|
+
return this.generateOrderedUtilities(themeCss, { classes, variableSuffixes: [] });
|
|
2676
2727
|
};
|
|
2677
2728
|
|
|
2678
2729
|
TailwindCompiler.prototype.utilitiesLayerRule = function () {
|
|
@@ -2731,7 +2782,11 @@ TailwindCompiler.prototype.compileDelta = function (themeCss) {
|
|
|
2731
2782
|
const candidates = [];
|
|
2732
2783
|
for (const cls of this.dynamicClassCache) if (!applied.classes.has(cls)) candidates.push(cls);
|
|
2733
2784
|
const classes = this.filterStaticallyCoveredClasses(candidates);
|
|
2785
|
+
// Tailwind display classes at a breakpoint join the display block, which only a full regen emits
|
|
2786
|
+
if (tailwindResponsiveDisplay(classes).length) return false;
|
|
2734
2787
|
const fresh = classes.length ? this.generateKeyedUtilities(themeCss, classes).filter(e => !applied.rules.has(e.rule)) : [];
|
|
2788
|
+
// The display block's contents depend on every used class: a new block rule means a full regen
|
|
2789
|
+
if (fresh.some(e => e.key[5] === 2)) return false;
|
|
2735
2790
|
const entries = applied.entries;
|
|
2736
2791
|
|
|
2737
2792
|
// Place every rule first; bail before touching the sheet if any is ambiguous
|
|
@@ -2739,9 +2794,10 @@ TailwindCompiler.prototype.compileDelta = function (themeCss) {
|
|
|
2739
2794
|
for (const e of fresh) {
|
|
2740
2795
|
let lo = 0, hi = entries.length;
|
|
2741
2796
|
while (lo < hi) { const mid = (lo + hi) >> 1; if (compareKeys(entries[mid].key, e.key) <= 0) lo = mid + 1; else hi = mid; }
|
|
2742
|
-
// Same utility, same
|
|
2743
|
-
|
|
2744
|
-
|
|
2797
|
+
// Same utility, same media rank, both variants: full regen orders them by discovery
|
|
2798
|
+
const last = e.key.length - 1;
|
|
2799
|
+
if (e.key[last] === 2) {
|
|
2800
|
+
const sameSlot = (x) => x && compareKeys(x.key.slice(0, last), e.key.slice(0, last)) === 0 && x.key[last] === 2;
|
|
2745
2801
|
if (sameSlot(entries[lo - 1]) || sameSlot(entries[lo]) || plan.some(q => sameSlot(q.e))) return false;
|
|
2746
2802
|
}
|
|
2747
2803
|
plan.push({ e, at: lo });
|
|
@@ -2945,14 +3001,8 @@ TailwindCompiler.prototype.compile = async function () {
|
|
|
2945
3001
|
}
|
|
2946
3002
|
}
|
|
2947
3003
|
|
|
2948
|
-
|
|
2949
|
-
const varUtilities = this.generateUtilitiesFromVars(themeCss, staticUsedData);
|
|
2950
|
-
const customUtilitiesGenerated = this.generateCustomUtilities(staticUsedData);
|
|
3004
|
+
const allUtilities = this.orderedUtilitiesCss(this.generateOrderedUtilities(themeCss, staticUsedData));
|
|
2951
3005
|
|
|
2952
|
-
let allUtilities = [varUtilities, customUtilitiesGenerated].filter(Boolean).join('\n\n');
|
|
2953
|
-
// Sort utilities so base classes come before variants
|
|
2954
|
-
allUtilities = this.sortUtilities(allUtilities);
|
|
2955
|
-
|
|
2956
3006
|
if (allUtilities) {
|
|
2957
3007
|
const finalCss = `@layer utilities {\n${allUtilities}\n}`;
|
|
2958
3008
|
|
|
@@ -3036,16 +3086,9 @@ TailwindCompiler.prototype.compile = async function () {
|
|
|
3036
3086
|
// Generate utilities for all classes (static + dynamic) if needed
|
|
3037
3087
|
if (hasVariableChanges || dynamicClassesHash !== this.lastClassesHash) {
|
|
3038
3088
|
|
|
3039
|
-
|
|
3040
|
-
const
|
|
3041
|
-
const keyedData = Object.assign({}, usedData, { rulesOut, keysOut });
|
|
3042
|
-
const varUtilities = this.generateUtilitiesFromVars(themeCss, keyedData);
|
|
3043
|
-
const customUtilitiesGenerated = this.generateCustomUtilities(keyedData);
|
|
3089
|
+
const entries = this.generateOrderedUtilities(themeCss, usedData);
|
|
3090
|
+
const allUtilities = this.orderedUtilitiesCss(entries);
|
|
3044
3091
|
|
|
3045
|
-
let allUtilities = [varUtilities, customUtilitiesGenerated].filter(Boolean).join('\n\n');
|
|
3046
|
-
// Sort utilities so base classes come before variants
|
|
3047
|
-
allUtilities = this.sortUtilities(allUtilities);
|
|
3048
|
-
|
|
3049
3092
|
if (allUtilities) {
|
|
3050
3093
|
const finalCss = `@layer utilities {\n${allUtilities}\n}`;
|
|
3051
3094
|
|
|
@@ -3066,8 +3109,7 @@ TailwindCompiler.prototype.compile = async function () {
|
|
|
3066
3109
|
});
|
|
3067
3110
|
});
|
|
3068
3111
|
this.lastClassesHash = dynamicClassesHash;
|
|
3069
|
-
|
|
3070
|
-
this.recordAppliedUtilities(entries.filter(e => !e.key[0]).concat(entries.filter(e => e.key[0])), themeCss, dynamicClasses);
|
|
3112
|
+
this.recordAppliedUtilities(entries, themeCss, dynamicClasses);
|
|
3071
3113
|
// Classes that arrived during the await above still need a pass
|
|
3072
3114
|
if (this.dynamicClassCache.size > dynamicClasses.length) this.compile();
|
|
3073
3115
|
|
|
@@ -3338,11 +3380,7 @@ export async function compileUtilities({ classes = [], themeCss = '', baseCss =
|
|
|
3338
3380
|
|
|
3339
3381
|
const usedData = { classes: uniqueClasses, variableSuffixes: [] };
|
|
3340
3382
|
|
|
3341
|
-
const
|
|
3342
|
-
const customUtilities = compiler.generateCustomUtilities(usedData);
|
|
3343
|
-
|
|
3344
|
-
let allUtilities = [varUtilities, customUtilities].filter(Boolean).join('\n\n');
|
|
3345
|
-
allUtilities = compiler.sortUtilities(allUtilities);
|
|
3383
|
+
const allUtilities = compiler.orderedUtilitiesCss(compiler.generateOrderedUtilities(cssText, usedData));
|
|
3346
3384
|
|
|
3347
3385
|
const manifestLayer = allUtilities ? `@layer utilities {\n${allUtilities}\n}` : '';
|
|
3348
3386
|
const tailwindLayer = await compileTailwindPass(uniqueClasses, tailwind);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mnfst",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.313",
|
|
4
4
|
"private": false,
|
|
5
5
|
"workspaces": [
|
|
6
6
|
"templates/starter",
|
|
@@ -62,6 +62,8 @@
|
|
|
62
62
|
"test:e2e:route-display": "node tests/e2e/components-route-display.e2e.mjs",
|
|
63
63
|
"test:e2e:prerender-patch": "node tests/e2e/utilities-prerender-patch.e2e.mjs",
|
|
64
64
|
"test:e2e:hidden-responsive": "node tests/e2e/utilities-hidden-responsive.e2e.mjs",
|
|
65
|
+
"test:e2e:breakpoint-range": "node tests/e2e/utilities-breakpoint-range.e2e.mjs",
|
|
66
|
+
"test:e2e:responsive-order": "node tests/e2e/utilities-responsive-order.e2e.mjs",
|
|
65
67
|
"test:e2e:tailwind-dark": "node tests/e2e/tailwind-dark-variant.e2e.mjs",
|
|
66
68
|
"test:e2e:inline-style-variants": "node tests/e2e/utilities-inline-style-variants.e2e.mjs",
|
|
67
69
|
"test:e2e:presence-tabs": "node tests/e2e/presence-tabs.e2e.mjs",
|