windrunner 1.0.0 → 1.0.2
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/README.md +8 -1
- package/dist/index.esm.js +260 -52
- package/dist/index.js +260 -52
- package/dist/index.min.js +3 -3
- package/package.json +2 -1
package/dist/index.js
CHANGED
|
@@ -756,6 +756,7 @@ var theme = {
|
|
|
756
756
|
},
|
|
757
757
|
grayscale: {
|
|
758
758
|
0: "0",
|
|
759
|
+
50: "0.5",
|
|
759
760
|
DEFAULT: "100%"
|
|
760
761
|
},
|
|
761
762
|
gridAutoColumns: {
|
|
@@ -946,6 +947,7 @@ var theme = {
|
|
|
946
947
|
}),
|
|
947
948
|
invert: {
|
|
948
949
|
0: "0",
|
|
950
|
+
50: "0.5",
|
|
949
951
|
DEFAULT: "100%"
|
|
950
952
|
},
|
|
951
953
|
letterSpacing: {
|
|
@@ -1170,6 +1172,7 @@ var theme = {
|
|
|
1170
1172
|
scrollPadding: ({ theme: theme2 }) => theme2("spacing"),
|
|
1171
1173
|
sepia: {
|
|
1172
1174
|
0: "0",
|
|
1175
|
+
50: "0.5",
|
|
1173
1176
|
DEFAULT: "100%"
|
|
1174
1177
|
},
|
|
1175
1178
|
skew: {
|
|
@@ -1442,12 +1445,7 @@ function getConfigOptions(options = {}, pluginKeys = []) {
|
|
|
1442
1445
|
const newTheme = {};
|
|
1443
1446
|
const themeKeys = Object.keys(config_default.theme);
|
|
1444
1447
|
themeKeys.forEach((key) => {
|
|
1445
|
-
newTheme[key] = theme2[key]
|
|
1446
|
-
if (isFunction(newTheme[key])) {
|
|
1447
|
-
newTheme[key] = newTheme[key]({
|
|
1448
|
-
theme: (keyRef) => config_default.theme[keyRef]
|
|
1449
|
-
});
|
|
1450
|
-
}
|
|
1448
|
+
newTheme[key] = Object.prototype.hasOwnProperty.call(theme2, key) ? theme2[key] : config_default.theme[key];
|
|
1451
1449
|
});
|
|
1452
1450
|
themeKeys.forEach((key) => {
|
|
1453
1451
|
if (isFunction(newTheme[key])) {
|
|
@@ -1671,6 +1669,65 @@ var BOX_SIZING_MAP = {
|
|
|
1671
1669
|
border: "box-sizing: border-box;",
|
|
1672
1670
|
content: "box-sizing: content-box;"
|
|
1673
1671
|
};
|
|
1672
|
+
var BREAK_AFTER_MAP = {
|
|
1673
|
+
auto: "break-after: auto;",
|
|
1674
|
+
avoid: "break-after: avoid;",
|
|
1675
|
+
"avoid-page": "break-after: avoid-page;",
|
|
1676
|
+
"avoid-column": "break-after: avoid-column;",
|
|
1677
|
+
page: "break-after: page;",
|
|
1678
|
+
all: "break-after: all;",
|
|
1679
|
+
left: "break-after: left;",
|
|
1680
|
+
right: "break-after: right;",
|
|
1681
|
+
recto: "break-after: recto;",
|
|
1682
|
+
verso: "break-after: verso;"
|
|
1683
|
+
};
|
|
1684
|
+
var BREAK_BEFORE_MAP = {
|
|
1685
|
+
auto: "break-before: auto;",
|
|
1686
|
+
avoid: "break-before: avoid;",
|
|
1687
|
+
"avoid-page": "break-before: avoid-page;",
|
|
1688
|
+
"avoid-column": "break-before: avoid-column;",
|
|
1689
|
+
page: "break-before: page;",
|
|
1690
|
+
left: "break-before: left;",
|
|
1691
|
+
right: "break-before: right;",
|
|
1692
|
+
recto: "break-before: recto;",
|
|
1693
|
+
verso: "break-before: verso;"
|
|
1694
|
+
};
|
|
1695
|
+
var BREAK_INSIDE_MAP = {
|
|
1696
|
+
auto: "break-inside: auto;",
|
|
1697
|
+
avoid: "break-inside: avoid;",
|
|
1698
|
+
"avoid-page": "break-inside: avoid-page;",
|
|
1699
|
+
"avoid-column": "break-inside: avoid-column;"
|
|
1700
|
+
};
|
|
1701
|
+
var BOX_DECORATION_BREAK_MAP = {
|
|
1702
|
+
slice: "box-decoration-break: slice;",
|
|
1703
|
+
clone: "box-decoration-break: clone;"
|
|
1704
|
+
};
|
|
1705
|
+
var HYPHENS_MAP = {
|
|
1706
|
+
none: "hyphens: none;",
|
|
1707
|
+
manual: "hyphens: manual;",
|
|
1708
|
+
auto: "hyphens: auto;"
|
|
1709
|
+
};
|
|
1710
|
+
var COLOR_SCHEME_MAP = {
|
|
1711
|
+
light: "color-scheme: light;",
|
|
1712
|
+
dark: "color-scheme: dark;",
|
|
1713
|
+
normal: "color-scheme: normal;"
|
|
1714
|
+
};
|
|
1715
|
+
var SCROLLBAR_COLOR_MAP = {
|
|
1716
|
+
auto: "scrollbar-color: auto;",
|
|
1717
|
+
transparent: "scrollbar-color: transparent;",
|
|
1718
|
+
current: "scrollbar-color: currentColor;"
|
|
1719
|
+
};
|
|
1720
|
+
var SCROLLBAR_WIDTH_MAP = {
|
|
1721
|
+
auto: "scrollbar-width: auto;",
|
|
1722
|
+
thin: "scrollbar-width: thin;",
|
|
1723
|
+
none: "scrollbar-width: none;"
|
|
1724
|
+
};
|
|
1725
|
+
var SCROLLBAR_GUTTER_MAP = {
|
|
1726
|
+
auto: "scrollbar-gutter: auto;",
|
|
1727
|
+
stable: "scrollbar-gutter: stable;",
|
|
1728
|
+
"stable-both-edges": "scrollbar-gutter: stable both-edges;",
|
|
1729
|
+
"both-edges": "scrollbar-gutter: both-edges;"
|
|
1730
|
+
};
|
|
1674
1731
|
var TABLE_LAYOUT_MAP = {
|
|
1675
1732
|
auto: "table-layout: auto;",
|
|
1676
1733
|
fixed: "table-layout: fixed;"
|
|
@@ -1827,6 +1884,16 @@ function buildLayoutDeclaration(baseToken, theme2) {
|
|
|
1827
1884
|
const val = resolveThemeValue(theme2.order || {}, baseToken.slice(6));
|
|
1828
1885
|
if (val !== void 0) return `order: ${val};`;
|
|
1829
1886
|
}
|
|
1887
|
+
if (baseToken.startsWith("break-after-")) return BREAK_AFTER_MAP[baseToken.slice(12)] ?? void 0;
|
|
1888
|
+
if (baseToken.startsWith("break-before-")) return BREAK_BEFORE_MAP[baseToken.slice(13)] ?? void 0;
|
|
1889
|
+
if (baseToken.startsWith("break-inside-")) return BREAK_INSIDE_MAP[baseToken.slice(13)] ?? void 0;
|
|
1890
|
+
if (baseToken.startsWith("box-decoration-break-")) return BOX_DECORATION_BREAK_MAP[baseToken.slice(21)] ?? void 0;
|
|
1891
|
+
if (baseToken.startsWith("hyphens-")) return HYPHENS_MAP[baseToken.slice(8)] ?? void 0;
|
|
1892
|
+
if (baseToken.startsWith("color-scheme-")) return COLOR_SCHEME_MAP[baseToken.slice(13)] ?? void 0;
|
|
1893
|
+
if (baseToken.startsWith("scrollbar-color-")) return SCROLLBAR_COLOR_MAP[baseToken.slice(16)] ?? void 0;
|
|
1894
|
+
if (baseToken.startsWith("scrollbar-width-")) return SCROLLBAR_WIDTH_MAP[baseToken.slice(16)] ?? void 0;
|
|
1895
|
+
if (baseToken.startsWith("scrollbar-gutter-")) return SCROLLBAR_GUTTER_MAP[baseToken.slice(17)] ?? void 0;
|
|
1896
|
+
if (baseToken.startsWith("scroll-behavior-")) return SCROLL_BEHAVIOR_MAP[baseToken.slice(16)] ?? void 0;
|
|
1830
1897
|
if (baseToken.startsWith("aspect-")) {
|
|
1831
1898
|
const val = resolveThemeValue(theme2.aspectRatio || {}, baseToken.slice(7));
|
|
1832
1899
|
if (val !== void 0) return `aspect-ratio: ${val};`;
|
|
@@ -1873,10 +1940,14 @@ function buildLayoutDeclaration(baseToken, theme2) {
|
|
|
1873
1940
|
if (val !== void 0) return `will-change: ${val};`;
|
|
1874
1941
|
}
|
|
1875
1942
|
if (baseToken.startsWith("content-")) {
|
|
1876
|
-
const
|
|
1877
|
-
if (
|
|
1878
|
-
|
|
1879
|
-
|
|
1943
|
+
const valueKey = baseToken.slice(8);
|
|
1944
|
+
if (valueKey.startsWith("[") && valueKey.endsWith("]")) {
|
|
1945
|
+
const arb = resolveArbitraryValue(valueKey);
|
|
1946
|
+
if (arb !== void 0) return `content: ${arb};`;
|
|
1947
|
+
} else {
|
|
1948
|
+
const val = resolveThemeValue(theme2.content || {}, valueKey);
|
|
1949
|
+
if (val !== void 0) return `content: "${val}";`;
|
|
1950
|
+
}
|
|
1880
1951
|
}
|
|
1881
1952
|
if (baseToken.startsWith("size-")) {
|
|
1882
1953
|
const val = resolveThemeValue(theme2.size || theme2.spacing || {}, baseToken.slice(5));
|
|
@@ -1959,6 +2030,12 @@ function buildGapDeclaration(baseToken, theme2) {
|
|
|
1959
2030
|
}
|
|
1960
2031
|
function buildDimensionDeclaration(baseToken, theme2) {
|
|
1961
2032
|
const patterns = [
|
|
2033
|
+
{ prefix: "min-inline-size-", prop: "min-inline-size", scale: theme2.minWidth || theme2.width || theme2.spacing || {} },
|
|
2034
|
+
{ prefix: "max-inline-size-", prop: "max-inline-size", scale: theme2.maxWidth || theme2.width || theme2.spacing || {} },
|
|
2035
|
+
{ prefix: "inline-size-", prop: "inline-size", scale: theme2.width || theme2.spacing || {} },
|
|
2036
|
+
{ prefix: "min-block-size-", prop: "min-block-size", scale: theme2.minHeight || theme2.height || theme2.spacing || {} },
|
|
2037
|
+
{ prefix: "max-block-size-", prop: "max-block-size", scale: theme2.maxHeight || theme2.height || theme2.spacing || {} },
|
|
2038
|
+
{ prefix: "block-size-", prop: "block-size", scale: theme2.height || theme2.spacing || {} },
|
|
1962
2039
|
{ prefix: "min-w-", prop: "min-width", scale: theme2.minWidth || theme2.width || {} },
|
|
1963
2040
|
{ prefix: "max-w-", prop: "max-width", scale: theme2.maxWidth || theme2.width || {} },
|
|
1964
2041
|
{ prefix: "min-h-", prop: "min-height", scale: theme2.minHeight || theme2.height || {} },
|
|
@@ -2030,6 +2107,7 @@ var JUSTIFY_CONTENT_MAP = {
|
|
|
2030
2107
|
stretch: "justify-content: stretch;"
|
|
2031
2108
|
};
|
|
2032
2109
|
var JUSTIFY_ITEMS_MAP = {
|
|
2110
|
+
normal: "justify-items: normal;",
|
|
2033
2111
|
start: "justify-items: start;",
|
|
2034
2112
|
end: "justify-items: end;",
|
|
2035
2113
|
center: "justify-items: center;",
|
|
@@ -2203,6 +2281,7 @@ var TEXT_TRANSFORM_MAP = {
|
|
|
2203
2281
|
};
|
|
2204
2282
|
var TEXT_OVERFLOW_MAP = {
|
|
2205
2283
|
truncate: "overflow: hidden; text-overflow: ellipsis; white-space: nowrap;",
|
|
2284
|
+
"overflow-ellipsis": "text-overflow: ellipsis;",
|
|
2206
2285
|
"text-ellipsis": "text-overflow: ellipsis;",
|
|
2207
2286
|
"text-clip": "text-overflow: clip;"
|
|
2208
2287
|
};
|
|
@@ -2224,6 +2303,35 @@ var FONT_STYLE_MAP = {
|
|
|
2224
2303
|
italic: "font-style: italic;",
|
|
2225
2304
|
"not-italic": "font-style: normal;"
|
|
2226
2305
|
};
|
|
2306
|
+
var FONT_STRETCH_MAP = {
|
|
2307
|
+
"ultra-condensed": "font-stretch: ultra-condensed;",
|
|
2308
|
+
"extra-condensed": "font-stretch: extra-condensed;",
|
|
2309
|
+
condensed: "font-stretch: condensed;",
|
|
2310
|
+
"semi-condensed": "font-stretch: semi-condensed;",
|
|
2311
|
+
normal: "font-stretch: normal;",
|
|
2312
|
+
"semi-expanded": "font-stretch: semi-expanded;",
|
|
2313
|
+
expanded: "font-stretch: expanded;",
|
|
2314
|
+
"extra-expanded": "font-stretch: extra-expanded;",
|
|
2315
|
+
"ultra-expanded": "font-stretch: ultra-expanded;"
|
|
2316
|
+
};
|
|
2317
|
+
var FONT_VARIANT_NUMERIC_MAP = {
|
|
2318
|
+
ordinal: "font-variant-numeric: ordinal;",
|
|
2319
|
+
"slashed-zero": "font-variant-numeric: slashed-zero;",
|
|
2320
|
+
"lining-nums": "font-variant-numeric: lining-nums;",
|
|
2321
|
+
"oldstyle-nums": "font-variant-numeric: oldstyle-nums;",
|
|
2322
|
+
"proportional-nums": "font-variant-numeric: proportional-nums;",
|
|
2323
|
+
"tabular-nums": "font-variant-numeric: tabular-nums;",
|
|
2324
|
+
"diagonal-fractions": "font-variant-numeric: diagonal-fractions;",
|
|
2325
|
+
"stacked-fractions": "font-variant-numeric: stacked-fractions;"
|
|
2326
|
+
};
|
|
2327
|
+
var LIST_STYLE_IMAGE_MAP = {
|
|
2328
|
+
none: "list-style-image: none;"
|
|
2329
|
+
};
|
|
2330
|
+
var HYPHENS_MAP2 = {
|
|
2331
|
+
none: "hyphens: none;",
|
|
2332
|
+
manual: "hyphens: manual;",
|
|
2333
|
+
auto: "hyphens: auto;"
|
|
2334
|
+
};
|
|
2227
2335
|
var FONT_SMOOTHING_MAP = {
|
|
2228
2336
|
antialiased: "-webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;",
|
|
2229
2337
|
"subpixel-antialiased": "-webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto;"
|
|
@@ -2272,6 +2380,12 @@ function buildTypographyDeclaration(baseToken, theme2) {
|
|
|
2272
2380
|
return `font-family: ${fontFamily};`;
|
|
2273
2381
|
}
|
|
2274
2382
|
}
|
|
2383
|
+
if (baseToken.startsWith("font-stretch-")) {
|
|
2384
|
+
return FONT_STRETCH_MAP[baseToken.slice(13)] ?? void 0;
|
|
2385
|
+
}
|
|
2386
|
+
if (baseToken.startsWith("font-variant-numeric-")) {
|
|
2387
|
+
return FONT_VARIANT_NUMERIC_MAP[baseToken.slice(21)] ?? void 0;
|
|
2388
|
+
}
|
|
2275
2389
|
if (baseToken.startsWith("leading-")) {
|
|
2276
2390
|
const val = resolveThemeValue(theme2.lineHeight || {}, baseToken.slice(8));
|
|
2277
2391
|
if (val !== void 0) return `line-height: ${val};`;
|
|
@@ -2299,13 +2413,18 @@ function buildTypographyDeclaration(baseToken, theme2) {
|
|
|
2299
2413
|
if (baseToken.startsWith("list-")) {
|
|
2300
2414
|
const key = baseToken.slice(5);
|
|
2301
2415
|
if (LIST_STYLE_POSITION_MAP[key]) return LIST_STYLE_POSITION_MAP[key];
|
|
2416
|
+
if (LIST_STYLE_IMAGE_MAP[baseToken]) return LIST_STYLE_IMAGE_MAP[baseToken.slice(17)] ?? void 0;
|
|
2302
2417
|
const val = resolveThemeValue(theme2.listStyleType || {}, key);
|
|
2303
2418
|
if (val !== void 0) return `list-style-type: ${val};`;
|
|
2304
2419
|
}
|
|
2420
|
+
if (baseToken.startsWith("list-style-image-")) {
|
|
2421
|
+
return LIST_STYLE_IMAGE_MAP[baseToken.slice(17)] ?? void 0;
|
|
2422
|
+
}
|
|
2305
2423
|
if (baseToken.startsWith("whitespace-")) {
|
|
2306
2424
|
const key = baseToken.slice(11);
|
|
2307
2425
|
if (WHITESPACE_MAP[key]) return WHITESPACE_MAP[key];
|
|
2308
2426
|
}
|
|
2427
|
+
if (baseToken.startsWith("hyphens-")) return HYPHENS_MAP2[baseToken.slice(8)] ?? void 0;
|
|
2309
2428
|
if (baseToken === "text-wrap") return "text-wrap: wrap;";
|
|
2310
2429
|
if (baseToken === "text-nowrap") return "text-wrap: nowrap;";
|
|
2311
2430
|
if (baseToken === "text-balance") return "text-wrap: balance;";
|
|
@@ -2444,6 +2563,48 @@ var PERSPECTIVE_MAP = {
|
|
|
2444
2563
|
midrange: "perspective: 800px;",
|
|
2445
2564
|
distant: "perspective: 1200px;"
|
|
2446
2565
|
};
|
|
2566
|
+
var PERSPECTIVE_ORIGIN_MAP = {
|
|
2567
|
+
center: "perspective-origin: center;",
|
|
2568
|
+
top: "perspective-origin: top;",
|
|
2569
|
+
bottom: "perspective-origin: bottom;",
|
|
2570
|
+
left: "perspective-origin: left;",
|
|
2571
|
+
right: "perspective-origin: right;",
|
|
2572
|
+
"top-left": "perspective-origin: top left;",
|
|
2573
|
+
"top-right": "perspective-origin: top right;",
|
|
2574
|
+
"bottom-left": "perspective-origin: bottom left;",
|
|
2575
|
+
"bottom-right": "perspective-origin: bottom right;"
|
|
2576
|
+
};
|
|
2577
|
+
var MASK_CLIP_MAP = {
|
|
2578
|
+
"mask-clip-border": "mask-clip: border; -webkit-mask-clip: border;",
|
|
2579
|
+
"mask-clip-padding": "mask-clip: padding; -webkit-mask-clip: padding;",
|
|
2580
|
+
"mask-clip-content": "mask-clip: content; -webkit-mask-clip: content;",
|
|
2581
|
+
"mask-clip-text": "mask-clip: text; -webkit-mask-clip: text;"
|
|
2582
|
+
};
|
|
2583
|
+
var MASK_COMPOSITE_MAP = {
|
|
2584
|
+
"mask-composite-add": "mask-composite: add; -webkit-mask-composite: add;",
|
|
2585
|
+
"mask-composite-subtract": "mask-composite: subtract; -webkit-mask-composite: subtract;",
|
|
2586
|
+
"mask-composite-intersect": "mask-composite: intersect; -webkit-mask-composite: intersect;",
|
|
2587
|
+
"mask-composite-exclude": "mask-composite: exclude; -webkit-mask-composite: exclude;",
|
|
2588
|
+
"mask-composite-replace": "mask-composite: replace; -webkit-mask-composite: replace;",
|
|
2589
|
+
"mask-composite-xor": "mask-composite: xor; -webkit-mask-composite: xor;"
|
|
2590
|
+
};
|
|
2591
|
+
var MASK_MODE_MAP = {
|
|
2592
|
+
"mask-mode-alpha": "mask-mode: alpha; -webkit-mask-mode: alpha;",
|
|
2593
|
+
"mask-mode-luminance": "mask-mode: luminance; -webkit-mask-mode: luminance;",
|
|
2594
|
+
"mask-mode-match-source": "mask-mode: match-source; -webkit-mask-mode: match-source;"
|
|
2595
|
+
};
|
|
2596
|
+
var MASK_ORIGIN_MAP = {
|
|
2597
|
+
"mask-origin-border": "mask-origin: border-box; -webkit-mask-origin: border-box;",
|
|
2598
|
+
"mask-origin-padding": "mask-origin: padding-box; -webkit-mask-origin: padding-box;",
|
|
2599
|
+
"mask-origin-content": "mask-origin: content-box; -webkit-mask-origin: content-box;",
|
|
2600
|
+
"mask-origin-fill": "mask-origin: fill-box; -webkit-mask-origin: fill-box;",
|
|
2601
|
+
"mask-origin-stroke": "mask-origin: stroke-box; -webkit-mask-origin: stroke-box;",
|
|
2602
|
+
"mask-origin-view": "mask-origin: view-box; -webkit-mask-origin: view-box;"
|
|
2603
|
+
};
|
|
2604
|
+
var MASK_TYPE_MAP = {
|
|
2605
|
+
"mask-type-luminance": "mask-type: luminance; -webkit-mask-type: luminance;",
|
|
2606
|
+
"mask-type-alpha": "mask-type: alpha; -webkit-mask-type: alpha;"
|
|
2607
|
+
};
|
|
2447
2608
|
var MASK_LINEAR_MAP = {
|
|
2448
2609
|
"mask-linear-to-t": "mask-image: linear-gradient(to top, black, transparent); -webkit-mask-image: linear-gradient(to top, black, transparent);",
|
|
2449
2610
|
"mask-linear-to-tr": "mask-image: linear-gradient(to top right, black, transparent); -webkit-mask-image: linear-gradient(to top right, black, transparent);",
|
|
@@ -2568,11 +2729,14 @@ function buildShadowDeclaration(baseToken, theme2) {
|
|
|
2568
2729
|
}
|
|
2569
2730
|
if (!baseToken.startsWith("shadow-")) return void 0;
|
|
2570
2731
|
const valueKey = baseToken.slice(7);
|
|
2571
|
-
const
|
|
2572
|
-
if (
|
|
2732
|
+
const arb = resolveArbitraryValue(valueKey);
|
|
2733
|
+
if (arb !== void 0) return `box-shadow: ${arb};`;
|
|
2573
2734
|
const value = resolveThemeValue(theme2.boxShadow || {}, valueKey);
|
|
2574
|
-
if (value
|
|
2575
|
-
|
|
2735
|
+
if (value !== void 0) return `box-shadow: ${value};`;
|
|
2736
|
+
const colorScale = theme2.boxShadowColor || theme2.colors || {};
|
|
2737
|
+
const color = resolveColorWithOpacity(colorScale, valueKey);
|
|
2738
|
+
if (color !== void 0) return `--tw-shadow-color: ${color};`;
|
|
2739
|
+
return void 0;
|
|
2576
2740
|
}
|
|
2577
2741
|
function buildInsetShadowDeclaration(baseToken, theme2) {
|
|
2578
2742
|
if (baseToken === "inset-shadow") return INSET_SHADOW_SIZES.DEFAULT;
|
|
@@ -2640,7 +2804,10 @@ function buildRingOffsetDeclaration(baseToken, theme2) {
|
|
|
2640
2804
|
if (widthVal !== void 0) {
|
|
2641
2805
|
return `--tw-ring-offset-width: ${widthVal}; box-shadow: 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color, #fff), var(--tw-ring-shadow, 0 0 #0000);`;
|
|
2642
2806
|
}
|
|
2643
|
-
|
|
2807
|
+
let color = resolveColorWithOpacity(theme2.ringOffsetColor || {}, key);
|
|
2808
|
+
if (color === void 0) {
|
|
2809
|
+
color = resolveColorWithOpacity(theme2.colors || {}, key);
|
|
2810
|
+
}
|
|
2644
2811
|
if (color !== void 0) return `--tw-ring-offset-color: ${color};`;
|
|
2645
2812
|
return void 0;
|
|
2646
2813
|
}
|
|
@@ -2761,6 +2928,12 @@ function buildTransformDeclaration(baseToken, theme2) {
|
|
|
2761
2928
|
const val = resolveThemeValue(theme2.transformOrigin || {}, normalized.slice(7));
|
|
2762
2929
|
if (val !== void 0) return `transform-origin: ${val};`;
|
|
2763
2930
|
}
|
|
2931
|
+
if (normalized.startsWith("perspective-origin-")) {
|
|
2932
|
+
const key = normalized.slice(19);
|
|
2933
|
+
if (PERSPECTIVE_ORIGIN_MAP[key]) return PERSPECTIVE_ORIGIN_MAP[key];
|
|
2934
|
+
const arb = resolveArbitraryValue(key);
|
|
2935
|
+
if (arb !== void 0) return `perspective-origin: ${arb};`;
|
|
2936
|
+
}
|
|
2764
2937
|
if (normalized.startsWith("perspective-")) {
|
|
2765
2938
|
const key = normalized.slice(12);
|
|
2766
2939
|
if (PERSPECTIVE_MAP[key]) return PERSPECTIVE_MAP[key];
|
|
@@ -2784,15 +2957,26 @@ function buildFilterDeclaration(baseToken, theme2) {
|
|
|
2784
2957
|
}
|
|
2785
2958
|
return theme2[key] || {};
|
|
2786
2959
|
};
|
|
2960
|
+
if (rest === "filter") {
|
|
2961
|
+
return `${prefix}: none;`;
|
|
2962
|
+
}
|
|
2787
2963
|
if (rest === "blur" || rest.startsWith("blur-")) {
|
|
2788
2964
|
const key = rest === "blur" ? "DEFAULT" : rest.slice(5);
|
|
2789
2965
|
const val = resolveThemeValue(getScale("blur"), key);
|
|
2790
2966
|
if (val !== void 0) return `${prefix}: blur(${val});`;
|
|
2791
2967
|
}
|
|
2968
|
+
if (rest === "brightness") {
|
|
2969
|
+
const val = resolveThemeValue(getScale("brightness"), "100") || resolveThemeValue(getScale("brightness"), "DEFAULT") || "1";
|
|
2970
|
+
return `${prefix}: brightness(${val});`;
|
|
2971
|
+
}
|
|
2792
2972
|
if (rest.startsWith("brightness-")) {
|
|
2793
2973
|
const val = resolveThemeValue(getScale("brightness"), rest.slice(11));
|
|
2794
2974
|
if (val !== void 0) return `${prefix}: brightness(${val});`;
|
|
2795
2975
|
}
|
|
2976
|
+
if (rest === "contrast") {
|
|
2977
|
+
const val = resolveThemeValue(getScale("contrast"), "100") || resolveThemeValue(getScale("contrast"), "DEFAULT") || "1";
|
|
2978
|
+
return `${prefix}: contrast(${val});`;
|
|
2979
|
+
}
|
|
2796
2980
|
if (rest.startsWith("contrast-")) {
|
|
2797
2981
|
const val = resolveThemeValue(getScale("contrast"), rest.slice(9));
|
|
2798
2982
|
if (val !== void 0) return `${prefix}: contrast(${val});`;
|
|
@@ -2802,6 +2986,10 @@ function buildFilterDeclaration(baseToken, theme2) {
|
|
|
2802
2986
|
const val = resolveThemeValue(getScale("grayscale"), key);
|
|
2803
2987
|
if (val !== void 0) return `${prefix}: grayscale(${val});`;
|
|
2804
2988
|
}
|
|
2989
|
+
if (rest === "hue-rotate") {
|
|
2990
|
+
const val = resolveThemeValue(getScale("hueRotate"), "0") || resolveThemeValue(getScale("hueRotate"), "DEFAULT") || "0deg";
|
|
2991
|
+
return `${prefix}: hue-rotate(${val});`;
|
|
2992
|
+
}
|
|
2805
2993
|
if (rest.startsWith("hue-rotate-")) {
|
|
2806
2994
|
const val = resolveThemeValue(getScale("hueRotate"), rest.slice(11));
|
|
2807
2995
|
if (val !== void 0) {
|
|
@@ -2814,6 +3002,10 @@ function buildFilterDeclaration(baseToken, theme2) {
|
|
|
2814
3002
|
const val = resolveThemeValue(getScale("invert"), key);
|
|
2815
3003
|
if (val !== void 0) return `${prefix}: invert(${val});`;
|
|
2816
3004
|
}
|
|
3005
|
+
if (rest === "saturate") {
|
|
3006
|
+
const val = resolveThemeValue(getScale("saturate"), "100") || resolveThemeValue(getScale("saturate"), "DEFAULT") || "1";
|
|
3007
|
+
return `${prefix}: saturate(${val});`;
|
|
3008
|
+
}
|
|
2817
3009
|
if (rest.startsWith("saturate-")) {
|
|
2818
3010
|
const val = resolveThemeValue(getScale("saturate"), rest.slice(9));
|
|
2819
3011
|
if (val !== void 0) return `${prefix}: saturate(${val});`;
|
|
@@ -2831,6 +3023,10 @@ function buildFilterDeclaration(baseToken, theme2) {
|
|
|
2831
3023
|
const val = resolveThemeValue(theme2.dropShadow || {}, rest.slice(12) || "DEFAULT");
|
|
2832
3024
|
if (val !== void 0) return `filter: drop-shadow(${val});`;
|
|
2833
3025
|
}
|
|
3026
|
+
if (isBackdrop && rest === "opacity") {
|
|
3027
|
+
const val = resolveThemeValue(theme2.backdropOpacity || theme2.opacity || {}, "DEFAULT") || "1";
|
|
3028
|
+
return `backdrop-filter: opacity(${val});`;
|
|
3029
|
+
}
|
|
2834
3030
|
if (isBackdrop && rest.startsWith("opacity-")) {
|
|
2835
3031
|
const val = resolveThemeValue(theme2.backdropOpacity || theme2.opacity || {}, rest.slice(8));
|
|
2836
3032
|
if (val !== void 0) return `backdrop-filter: opacity(${val});`;
|
|
@@ -2877,6 +3073,11 @@ function buildAnimationDeclaration(baseToken) {
|
|
|
2877
3073
|
return void 0;
|
|
2878
3074
|
}
|
|
2879
3075
|
function buildMaskDeclaration(baseToken) {
|
|
3076
|
+
if (MASK_CLIP_MAP[baseToken]) return MASK_CLIP_MAP[baseToken];
|
|
3077
|
+
if (MASK_COMPOSITE_MAP[baseToken]) return MASK_COMPOSITE_MAP[baseToken];
|
|
3078
|
+
if (MASK_MODE_MAP[baseToken]) return MASK_MODE_MAP[baseToken];
|
|
3079
|
+
if (MASK_ORIGIN_MAP[baseToken]) return MASK_ORIGIN_MAP[baseToken];
|
|
3080
|
+
if (MASK_TYPE_MAP[baseToken]) return MASK_TYPE_MAP[baseToken];
|
|
2880
3081
|
if (MASK_LINEAR_MAP[baseToken]) return MASK_LINEAR_MAP[baseToken];
|
|
2881
3082
|
if (MASK_REPEAT_MAP[baseToken]) return MASK_REPEAT_MAP[baseToken];
|
|
2882
3083
|
if (MASK_SIZE_MAP[baseToken]) return MASK_SIZE_MAP[baseToken];
|
|
@@ -2909,6 +3110,7 @@ function buildInteractivityDeclaration(baseToken, theme2) {
|
|
|
2909
3110
|
if (baseToken.startsWith("cursor-")) return CURSOR_MAP[baseToken.slice(7)] ?? void 0;
|
|
2910
3111
|
if (baseToken.startsWith("pointer-events-")) return POINTER_EVENTS_MAP[baseToken.slice(15)] ?? void 0;
|
|
2911
3112
|
if (baseToken.startsWith("select-")) return USER_SELECT_MAP[baseToken.slice(7)] ?? void 0;
|
|
3113
|
+
if (baseToken.startsWith("user-select-")) return USER_SELECT_MAP[baseToken.slice(12)] ?? void 0;
|
|
2912
3114
|
if (baseToken.startsWith("appearance-")) {
|
|
2913
3115
|
return APPEARANCE_MAP[baseToken.slice(11)] ? `appearance: ${baseToken.slice(11)};` : void 0;
|
|
2914
3116
|
}
|
|
@@ -3012,6 +3214,12 @@ function buildBlendingDeclaration(baseToken) {
|
|
|
3012
3214
|
}
|
|
3013
3215
|
|
|
3014
3216
|
// src/builders/space-divide.js
|
|
3217
|
+
function childScoped(declaration) {
|
|
3218
|
+
return { __childScoped: true, declaration };
|
|
3219
|
+
}
|
|
3220
|
+
function isChildScoped(result) {
|
|
3221
|
+
return result !== null && typeof result === "object" && result.__childScoped === true;
|
|
3222
|
+
}
|
|
3015
3223
|
function buildSpaceBetweenDeclaration(baseToken, theme2) {
|
|
3016
3224
|
const negative = baseToken.startsWith("-");
|
|
3017
3225
|
const normalized = negative ? baseToken.slice(1) : baseToken;
|
|
@@ -3022,22 +3230,22 @@ function buildSpaceBetweenDeclaration(baseToken, theme2) {
|
|
|
3022
3230
|
let val = resolveThemeValue(theme2.spacing || {}, matchX[1]);
|
|
3023
3231
|
if (val === void 0) return void 0;
|
|
3024
3232
|
if (negative && val !== "0") val = `-${val}`;
|
|
3025
|
-
return [
|
|
3233
|
+
return childScoped([
|
|
3026
3234
|
`--tw-space-x-reverse: 0;`,
|
|
3027
3235
|
`margin-inline-end: calc(${val} * var(--tw-space-x-reverse));`,
|
|
3028
3236
|
`margin-inline-start: calc(${val} * calc(1 - var(--tw-space-x-reverse)));`
|
|
3029
|
-
].join(" ");
|
|
3237
|
+
].join(" "));
|
|
3030
3238
|
}
|
|
3031
3239
|
const matchY = normalized.match(/^space-y-(.+)$/);
|
|
3032
3240
|
if (matchY) {
|
|
3033
3241
|
let val = resolveThemeValue(theme2.spacing || {}, matchY[1]);
|
|
3034
3242
|
if (val === void 0) return void 0;
|
|
3035
3243
|
if (negative && val !== "0") val = `-${val}`;
|
|
3036
|
-
return [
|
|
3244
|
+
return childScoped([
|
|
3037
3245
|
`--tw-space-y-reverse: 0;`,
|
|
3038
3246
|
`margin-bottom: calc(${val} * var(--tw-space-y-reverse));`,
|
|
3039
3247
|
`margin-top: calc(${val} * calc(1 - var(--tw-space-y-reverse)));`
|
|
3040
|
-
].join(" ");
|
|
3248
|
+
].join(" "));
|
|
3041
3249
|
}
|
|
3042
3250
|
return void 0;
|
|
3043
3251
|
}
|
|
@@ -3047,22 +3255,22 @@ function buildDivideDeclaration(baseToken, theme2) {
|
|
|
3047
3255
|
if (key === "x" || key === "x-reverse") {
|
|
3048
3256
|
if (key === "x-reverse") return "--tw-divide-x-reverse: 1;";
|
|
3049
3257
|
const val = resolveThemeValue(theme2.borderWidth || {}, "DEFAULT") || "1px";
|
|
3050
|
-
return `--tw-divide-x-reverse: 0; border-inline-end-width: calc(${val} * var(--tw-divide-x-reverse)); border-inline-start-width: calc(${val} * calc(1 - var(--tw-divide-x-reverse)))
|
|
3258
|
+
return childScoped(`--tw-divide-x-reverse: 0; border-inline-end-width: calc(${val} * var(--tw-divide-x-reverse)); border-inline-start-width: calc(${val} * calc(1 - var(--tw-divide-x-reverse)));`);
|
|
3051
3259
|
}
|
|
3052
3260
|
const matchX = key.match(/^x-(\d+)$/);
|
|
3053
3261
|
if (matchX) {
|
|
3054
3262
|
const val = resolveThemeValue(theme2.borderWidth || {}, matchX[1]);
|
|
3055
|
-
if (val !== void 0) return `--tw-divide-x-reverse: 0; border-inline-end-width: calc(${val} * var(--tw-divide-x-reverse)); border-inline-start-width: calc(${val} * calc(1 - var(--tw-divide-x-reverse)))
|
|
3263
|
+
if (val !== void 0) return childScoped(`--tw-divide-x-reverse: 0; border-inline-end-width: calc(${val} * var(--tw-divide-x-reverse)); border-inline-start-width: calc(${val} * calc(1 - var(--tw-divide-x-reverse)));`);
|
|
3056
3264
|
}
|
|
3057
3265
|
if (key === "y" || key === "y-reverse") {
|
|
3058
3266
|
if (key === "y-reverse") return "--tw-divide-y-reverse: 1;";
|
|
3059
3267
|
const val = resolveThemeValue(theme2.borderWidth || {}, "DEFAULT") || "1px";
|
|
3060
|
-
return `--tw-divide-y-reverse: 0; border-bottom-width: calc(${val} * var(--tw-divide-y-reverse)); border-top-width: calc(${val} * calc(1 - var(--tw-divide-y-reverse)))
|
|
3268
|
+
return childScoped(`--tw-divide-y-reverse: 0; border-bottom-width: calc(${val} * var(--tw-divide-y-reverse)); border-top-width: calc(${val} * calc(1 - var(--tw-divide-y-reverse)));`);
|
|
3061
3269
|
}
|
|
3062
3270
|
const matchY = key.match(/^y-(\d+)$/);
|
|
3063
3271
|
if (matchY) {
|
|
3064
3272
|
const val = resolveThemeValue(theme2.borderWidth || {}, matchY[1]);
|
|
3065
|
-
if (val !== void 0) return `--tw-divide-y-reverse: 0; border-bottom-width: calc(${val} * var(--tw-divide-y-reverse)); border-top-width: calc(${val} * calc(1 - var(--tw-divide-y-reverse)))
|
|
3273
|
+
if (val !== void 0) return childScoped(`--tw-divide-y-reverse: 0; border-bottom-width: calc(${val} * var(--tw-divide-y-reverse)); border-top-width: calc(${val} * calc(1 - var(--tw-divide-y-reverse)));`);
|
|
3066
3274
|
}
|
|
3067
3275
|
if (BORDER_STYLE_MAP[key]) return `border-style: ${BORDER_STYLE_MAP[key].replace("border-style: ", "").replace(";", "")};`;
|
|
3068
3276
|
if (key === "none") return "border-style: none;";
|
|
@@ -3072,10 +3280,10 @@ function buildDivideDeclaration(baseToken, theme2) {
|
|
|
3072
3280
|
if (key === "double") return "border-style: double;";
|
|
3073
3281
|
const colors = theme2.colors || {};
|
|
3074
3282
|
const color = resolveColorWithOpacity(theme2.divideColor || colors, key);
|
|
3075
|
-
if (color !== void 0) return `border-color: ${color}
|
|
3283
|
+
if (color !== void 0) return childScoped(`border-color: ${color};`);
|
|
3076
3284
|
if (key.startsWith("opacity-")) {
|
|
3077
3285
|
const val = resolveThemeValue(theme2.opacity || {}, key.slice(8));
|
|
3078
|
-
if (val !== void 0) return `--tw-divide-opacity: ${val}
|
|
3286
|
+
if (val !== void 0) return childScoped(`--tw-divide-opacity: ${val};`);
|
|
3079
3287
|
}
|
|
3080
3288
|
return void 0;
|
|
3081
3289
|
}
|
|
@@ -3219,8 +3427,8 @@ function resolveRuntimeContext(options = {}) {
|
|
|
3219
3427
|
return {
|
|
3220
3428
|
config,
|
|
3221
3429
|
theme: config.theme || {},
|
|
3222
|
-
screens: config.theme && config.theme.screens || {},
|
|
3223
|
-
containers: config.theme && config.theme.containers || {}
|
|
3430
|
+
screens: config.theme && config.theme.screens || config.screens || {},
|
|
3431
|
+
containers: config.theme && config.theme.containers || config.containers || {}
|
|
3224
3432
|
};
|
|
3225
3433
|
}
|
|
3226
3434
|
function getBaseTailwindOptions(options = {}) {
|
|
@@ -3269,28 +3477,22 @@ function compileRuntimeClassNameWithContext(className, context) {
|
|
|
3269
3477
|
const selector = `.${escapeCssIdentifier(parsed.original)}`;
|
|
3270
3478
|
const variantSelector = applyVariants(selector, parsed.variants);
|
|
3271
3479
|
if (!variantSelector) return "";
|
|
3272
|
-
const finalDeclaration = appendImportant(
|
|
3273
|
-
|
|
3274
|
-
|
|
3480
|
+
const finalDeclaration = appendImportant(
|
|
3481
|
+
isChildScoped(declaration) ? declaration.declaration : declaration,
|
|
3482
|
+
parsed.important
|
|
3483
|
+
);
|
|
3484
|
+
const scopedSelector = isChildScoped(declaration) ? `${variantSelector} > :not(:first-child)` : variantSelector;
|
|
3275
3485
|
const ruleBody = `${scopedSelector} { ${finalDeclaration} }`;
|
|
3486
|
+
let result = ruleBody;
|
|
3276
3487
|
if (parsed.breakpoint) {
|
|
3277
|
-
|
|
3278
|
-
}
|
|
3279
|
-
|
|
3280
|
-
return `@container (min-width: ${context.containers[parsed.containerBreakpoint]}) { ${ruleBody} }`;
|
|
3488
|
+
result = `@media (min-width: ${context.screens[parsed.breakpoint]}) { ${ruleBody} }`;
|
|
3489
|
+
} else if (parsed.containerBreakpoint) {
|
|
3490
|
+
result = `@container (min-width: ${context.containers[parsed.containerBreakpoint]}) { ${ruleBody} }`;
|
|
3281
3491
|
}
|
|
3282
|
-
return ruleBody;
|
|
3283
3492
|
if (parsed.starting) {
|
|
3284
|
-
|
|
3285
|
-
return `@starting-style { ${wrapped} }`;
|
|
3493
|
+
return `@starting-style { ${result} }`;
|
|
3286
3494
|
}
|
|
3287
|
-
|
|
3288
|
-
return `@media (min-width: ${context.screens[parsed.breakpoint]}) { ${rule} }`;
|
|
3289
|
-
}
|
|
3290
|
-
if (parsed.containerBreakpoint) {
|
|
3291
|
-
return `@container (min-width: ${context.containers[parsed.containerBreakpoint]}) { ${rule} }`;
|
|
3292
|
-
}
|
|
3293
|
-
return rule;
|
|
3495
|
+
return result;
|
|
3294
3496
|
}
|
|
3295
3497
|
function compileClass(className, options = {}) {
|
|
3296
3498
|
return compileRuntimeClassNameWithContext(className, resolveRuntimeContext(options));
|
|
@@ -3416,18 +3618,18 @@ function createWindrunner(options = {}) {
|
|
|
3416
3618
|
cache.set(className, cssRule);
|
|
3417
3619
|
return cssRule;
|
|
3418
3620
|
};
|
|
3419
|
-
const insertRule = (
|
|
3420
|
-
if (!
|
|
3621
|
+
const insertRule = (rule) => {
|
|
3622
|
+
if (!rule || insertedRules.has(rule)) return;
|
|
3421
3623
|
if (typeof document !== "object") return;
|
|
3422
3624
|
if (!styleElement) styleElement = findOrCreateRuntimeStyle(styleId);
|
|
3423
3625
|
if (styleElement) loadExistingRules(styleElement);
|
|
3424
|
-
if (insertedRules.has(
|
|
3425
|
-
insertedRules.add(
|
|
3626
|
+
if (insertedRules.has(rule)) return;
|
|
3627
|
+
insertedRules.add(rule);
|
|
3426
3628
|
if (!styleElement || !styleElement.sheet) return;
|
|
3427
3629
|
try {
|
|
3428
|
-
styleElement.sheet.insertRule(
|
|
3630
|
+
styleElement.sheet.insertRule(rule, styleElement.sheet.cssRules.length);
|
|
3429
3631
|
} catch {
|
|
3430
|
-
styleElement.appendChild(document.createTextNode(`${
|
|
3632
|
+
styleElement.appendChild(document.createTextNode(`${rule}
|
|
3431
3633
|
`));
|
|
3432
3634
|
}
|
|
3433
3635
|
};
|
|
@@ -3444,6 +3646,12 @@ function createWindrunner(options = {}) {
|
|
|
3444
3646
|
if (!element || !element.classList) return;
|
|
3445
3647
|
element.classList.forEach((className) => processClassName(className));
|
|
3446
3648
|
};
|
|
3649
|
+
const processElementTree = (element) => {
|
|
3650
|
+
if (!element || element.nodeType !== 1) return;
|
|
3651
|
+
processElement(element);
|
|
3652
|
+
const children = element.querySelectorAll ? element.querySelectorAll("[class]") : [];
|
|
3653
|
+
children.forEach((child) => processElement(child));
|
|
3654
|
+
};
|
|
3447
3655
|
const processClassList = (classList) => {
|
|
3448
3656
|
if (!classList) return [];
|
|
3449
3657
|
const values = typeof classList === "string" ? classList.split(/\s+/) : Array.isArray(classList) ? classList : typeof classList === "object" && typeof classList.forEach === "function" ? Array.from(classList) : [];
|
|
@@ -3451,13 +3659,13 @@ function createWindrunner(options = {}) {
|
|
|
3451
3659
|
};
|
|
3452
3660
|
const scan = (root = document) => {
|
|
3453
3661
|
if (typeof document !== "object" || !root) return;
|
|
3454
|
-
if (root.nodeType === 1
|
|
3662
|
+
if (root.nodeType === 1) processElementTree(root);
|
|
3455
3663
|
const elements = root.querySelectorAll ? root.querySelectorAll("[class]") : [];
|
|
3456
3664
|
elements.forEach((element) => processElement(element));
|
|
3457
3665
|
};
|
|
3458
3666
|
const flushQueue = () => {
|
|
3459
3667
|
scheduled = false;
|
|
3460
|
-
pendingElements.forEach((element) =>
|
|
3668
|
+
pendingElements.forEach((element) => processElementTree(element));
|
|
3461
3669
|
pendingElements.clear();
|
|
3462
3670
|
};
|
|
3463
3671
|
const flush = () => {
|