@stillwind/host 0.12.0 → 0.13.0
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/CHANGELOG.md +9 -0
- package/dist/browser.js +2 -2
- package/dist/browser.js.map +1 -1
- package/dist/{configuration-MQZe6ufN.js → configuration-BckWlAj2.js} +126 -42
- package/dist/configuration-BckWlAj2.js.map +1 -0
- package/dist/index.d.ts +50 -4
- package/dist/index.js +81 -22
- package/dist/index.js.map +1 -1
- package/dist/{options-Cc-SlJed.js → options-B0m3Ajj9.js} +580 -122
- package/dist/options-B0m3Ajj9.js.map +1 -0
- package/dist/{plugin-CNOsrkrd.js → plugin-BG0VOzNB.js} +26 -34
- package/dist/plugin-BG0VOzNB.js.map +1 -0
- package/package.json +6 -6
- package/dist/configuration-MQZe6ufN.js.map +0 -1
- package/dist/options-Cc-SlJed.js.map +0 -1
- package/dist/plugin-CNOsrkrd.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { decodeArbitraryValue } from "@stillwind/native";
|
|
1
|
+
import { a as utilityBodies, c as isValidArbitrary, configurePlugin, darkModeVariant, i as serializeCss, l as segment, n as identifier, o as utilityRules, r as selectorRules, resolveConfig, s as withAlpha, t as cssString } from "./configuration-BckWlAj2.js";
|
|
2
|
+
import { customPropertyReferences, decodeArbitraryValue } from "@stillwind/native";
|
|
3
3
|
import defaultTheme from "tailwindcss/defaultTheme";
|
|
4
4
|
// src/css/plugins/tailwind/data-type.ts
|
|
5
5
|
const NAMED_COLORS = /* @__PURE__ */ new Set([
|
|
@@ -253,13 +253,13 @@ function isUrl(value) {
|
|
|
253
253
|
return IS_URL.test(value);
|
|
254
254
|
}
|
|
255
255
|
function isLineWidth(value) {
|
|
256
|
-
return
|
|
256
|
+
return segment(value, " ").every((value) => isLength(value) || isNumber(value) || value === "thin" || value === "medium" || value === "thick");
|
|
257
257
|
}
|
|
258
258
|
const IS_IMAGE_FN = /^(?:element|image|cross-fade|image-set)\(/;
|
|
259
259
|
const IS_GRADIENT_FN = /^(repeating-)?(conic|linear|radial)-gradient\(/;
|
|
260
260
|
function isImage(value) {
|
|
261
261
|
let count = 0;
|
|
262
|
-
for (const part of
|
|
262
|
+
for (const part of segment(value, ",")) {
|
|
263
263
|
if (part.startsWith("var(")) continue;
|
|
264
264
|
if (isUrl(part)) {
|
|
265
265
|
count += 1;
|
|
@@ -282,7 +282,7 @@ function isGenericName(value) {
|
|
|
282
282
|
}
|
|
283
283
|
function isFamilyName(value) {
|
|
284
284
|
let count = 0;
|
|
285
|
-
for (const part of
|
|
285
|
+
for (const part of segment(value, ",")) {
|
|
286
286
|
const char = part.charCodeAt(0);
|
|
287
287
|
if (char >= 48 && char <= 57) return false;
|
|
288
288
|
if (part.startsWith("var(")) continue;
|
|
@@ -366,7 +366,7 @@ function isLength(value) {
|
|
|
366
366
|
}
|
|
367
367
|
function isBackgroundPosition(value) {
|
|
368
368
|
let count = 0;
|
|
369
|
-
for (const part of
|
|
369
|
+
for (const part of segment(value, " ")) {
|
|
370
370
|
if (part === "center" || part === "top" || part === "right" || part === "bottom" || part === "left") {
|
|
371
371
|
count += 1;
|
|
372
372
|
continue;
|
|
@@ -388,12 +388,12 @@ function isBackgroundPosition(value) {
|
|
|
388
388
|
*/
|
|
389
389
|
function isBackgroundSize(value) {
|
|
390
390
|
let count = 0;
|
|
391
|
-
for (const size of
|
|
391
|
+
for (const size of segment(value, ",")) {
|
|
392
392
|
if (size === "cover" || size === "contain") {
|
|
393
393
|
count += 1;
|
|
394
394
|
continue;
|
|
395
395
|
}
|
|
396
|
-
const values =
|
|
396
|
+
const values = segment(size, " ");
|
|
397
397
|
if (values.length !== 1 && values.length !== 2) return false;
|
|
398
398
|
if (values.every((value) => value === "auto" || isLength(value) || isPercentage(value))) count += 1;
|
|
399
399
|
}
|
|
@@ -486,15 +486,6 @@ function variantBody(value) {
|
|
|
486
486
|
return `${value}{@slot;}`;
|
|
487
487
|
}
|
|
488
488
|
/**
|
|
489
|
-
* Whether a decoded arbitrary value has no top-level `;` or `}`, which Tailwind rejects.
|
|
490
|
-
*
|
|
491
|
-
* @param value - Decoded value.
|
|
492
|
-
* @returns Whether the value can be used.
|
|
493
|
-
*/
|
|
494
|
-
function validArbitrary(value) {
|
|
495
|
-
return splitTopLevel(value, ";").length === 1 && splitTopLevel(value, "}").length === 1;
|
|
496
|
-
}
|
|
497
|
-
/**
|
|
498
489
|
* Parses the value part of a candidate as Tailwind's candidate parser does.
|
|
499
490
|
*
|
|
500
491
|
* @param text - Text after the root and its `-`, such as `4`, `[length:1px]`, or
|
|
@@ -504,9 +495,9 @@ function validArbitrary(value) {
|
|
|
504
495
|
function parseValue(text) {
|
|
505
496
|
let inner;
|
|
506
497
|
if (text.startsWith("(") && text.endsWith(")")) {
|
|
507
|
-
const parts =
|
|
498
|
+
const parts = segment(text.slice(1, -1), ":");
|
|
508
499
|
const [dataType, variable] = parts.length === 2 ? parts : [null, parts.join(":")];
|
|
509
|
-
if (!variable.startsWith("--") || !
|
|
500
|
+
if (!variable.startsWith("--") || !isValidArbitrary(variable)) return;
|
|
510
501
|
inner = dataType === null ? `var(${variable})` : `${dataType}:var(${variable})`;
|
|
511
502
|
} else if (text.startsWith("[") && text.endsWith("]")) inner = text.slice(1, -1);
|
|
512
503
|
else return {
|
|
@@ -514,7 +505,7 @@ function parseValue(text) {
|
|
|
514
505
|
value: text
|
|
515
506
|
};
|
|
516
507
|
let value = decodeArbitraryValue(inner);
|
|
517
|
-
if (!
|
|
508
|
+
if (!isValidArbitrary(value)) return;
|
|
518
509
|
let dataType = null;
|
|
519
510
|
const hint = /^([a-z-]*):/.exec(value);
|
|
520
511
|
if (hint) {
|
|
@@ -537,7 +528,7 @@ function parseValue(text) {
|
|
|
537
528
|
function parseModifier(text) {
|
|
538
529
|
if (text.startsWith("[") && text.endsWith("]")) {
|
|
539
530
|
const value = decodeArbitraryValue(text.slice(1, -1));
|
|
540
|
-
return
|
|
531
|
+
return isValidArbitrary(value) && value.trim() ? {
|
|
541
532
|
kind: "arbitrary",
|
|
542
533
|
value,
|
|
543
534
|
dataType: null
|
|
@@ -545,7 +536,7 @@ function parseModifier(text) {
|
|
|
545
536
|
}
|
|
546
537
|
if (text.startsWith("(") && text.endsWith(")")) {
|
|
547
538
|
const variable = text.slice(1, -1);
|
|
548
|
-
return variable.startsWith("--") &&
|
|
539
|
+
return variable.startsWith("--") && isValidArbitrary(variable) ? {
|
|
549
540
|
kind: "arbitrary",
|
|
550
541
|
value: decodeArbitraryValue(`var(${variable})`),
|
|
551
542
|
dataType: null
|
|
@@ -570,7 +561,7 @@ function resolveUtility(candidate, registration) {
|
|
|
570
561
|
const negative = candidate.startsWith("-");
|
|
571
562
|
const raw = negative ? candidate.slice(1) : candidate;
|
|
572
563
|
if (!member(raw, name) || negative && !options.supportsNegativeValues) return;
|
|
573
|
-
const [stem, ...modifierParts] =
|
|
564
|
+
const [stem, ...modifierParts] = segment(raw, "/");
|
|
574
565
|
if (modifierParts.length > 1) return;
|
|
575
566
|
const modifierText = modifierParts[0];
|
|
576
567
|
const valueText = stem === name ? void 0 : stem.slice(name.length + 1);
|
|
@@ -633,7 +624,7 @@ function resolveUtility(candidate, registration) {
|
|
|
633
624
|
function resolveVariant(candidate, registration) {
|
|
634
625
|
const { name, options } = registration;
|
|
635
626
|
if (!member(candidate, name)) return;
|
|
636
|
-
const [stem, ...modifierParts] =
|
|
627
|
+
const [stem, ...modifierParts] = segment(candidate, "/");
|
|
637
628
|
if (modifierParts.length > 1) return;
|
|
638
629
|
const valueText = stem === name ? void 0 : stem.slice(name.length + 1);
|
|
639
630
|
const parsed = valueText === void 0 ? null : parseValue(valueText);
|
|
@@ -806,7 +797,7 @@ function themeableValues(theme) {
|
|
|
806
797
|
*/
|
|
807
798
|
function toKeyPath(path) {
|
|
808
799
|
const keys = [];
|
|
809
|
-
for (const part of
|
|
800
|
+
for (const part of segment(path, ".")) {
|
|
810
801
|
let index = 0;
|
|
811
802
|
for (;;) {
|
|
812
803
|
const open = part.indexOf("[", index);
|
|
@@ -842,15 +833,16 @@ function read(value, path) {
|
|
|
842
833
|
return value;
|
|
843
834
|
}
|
|
844
835
|
/**
|
|
845
|
-
* Whether a theme value
|
|
836
|
+
* Whether a theme value refers to the variable that it would define.
|
|
846
837
|
*
|
|
847
838
|
* @param name - Variable name without the leading `--`, such as `color-primary`.
|
|
848
839
|
* @param value - Configured value.
|
|
849
|
-
* @returns Whether `value`
|
|
850
|
-
* of `--name` a cycle.
|
|
840
|
+
* @returns Whether `value` refers to `--name`, as in `var(--name)`, `var(--x, var(--name))`, or
|
|
841
|
+
* `--name(4)`, which makes a declaration of `--name` a cycle. Names in strings, comments, and URLs
|
|
842
|
+
* do not count.
|
|
851
843
|
*/
|
|
852
844
|
function selfReference(name, value) {
|
|
853
|
-
return typeof value === "string" &&
|
|
845
|
+
return typeof value === "string" && customPropertyReferences(value).includes(`--${name}`);
|
|
854
846
|
}
|
|
855
847
|
/**
|
|
856
848
|
* Whether a value is a plain object rather than null or an array.
|
|
@@ -966,8 +958,8 @@ var PluginTheme = class {
|
|
|
966
958
|
* Emits the plugins' own theme configuration, which native utility resolution also needs.
|
|
967
959
|
*
|
|
968
960
|
* @returns A `@stillwind-plugin-theme` block with the configured variables and keyframes, and a
|
|
969
|
-
* `@stillwind-plugin-theme inline` block with the values that refer to their own
|
|
970
|
-
* empty string when the plugins configure nothing.
|
|
961
|
+
* `@stillwind-plugin-theme inline reference` block with the values that refer to their own
|
|
962
|
+
* variable, or an empty string when the plugins configure nothing.
|
|
971
963
|
*/
|
|
972
964
|
css() {
|
|
973
965
|
const configured = {};
|
|
@@ -1004,7 +996,7 @@ var PluginTheme = class {
|
|
|
1004
996
|
}
|
|
1005
997
|
let frames = "";
|
|
1006
998
|
if (object(configured.keyframes)) for (const [name, body] of Object.entries(configured.keyframes)) frames += `@keyframes ${name}{${serializeCss(body)}}`;
|
|
1007
|
-
return [declarations || frames ? `@stillwind-plugin-theme{${declarations}${frames}}` : "", inline ? `@stillwind-plugin-theme inline{${inline}}` : ""].join("");
|
|
999
|
+
return [declarations || frames ? `@stillwind-plugin-theme{${declarations}${frames}}` : "", inline ? `@stillwind-plugin-theme inline reference{${inline}}` : ""].join("");
|
|
1008
1000
|
}
|
|
1009
1001
|
/**
|
|
1010
1002
|
* Resolves every section, for `config("theme")` and `theme()` without a path.
|
|
@@ -1398,7 +1390,7 @@ var TailwindRuntime = class {
|
|
|
1398
1390
|
* @returns The key's index, or the number of keys for an arbitrary value.
|
|
1399
1391
|
*/
|
|
1400
1392
|
const order = (candidate) => {
|
|
1401
|
-
const [stem] =
|
|
1393
|
+
const [stem] = segment(candidate.name, "/");
|
|
1402
1394
|
const key = stem === registration.name ? "DEFAULT" : stem.slice(registration.name.length + 1);
|
|
1403
1395
|
const index = keys.indexOf(key);
|
|
1404
1396
|
return index < 0 ? keys.length : index;
|
|
@@ -1425,4 +1417,4 @@ var TailwindRuntime = class {
|
|
|
1425
1417
|
};
|
|
1426
1418
|
export { TailwindRuntime };
|
|
1427
1419
|
|
|
1428
|
-
//# sourceMappingURL=plugin-
|
|
1420
|
+
//# sourceMappingURL=plugin-BG0VOzNB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-BG0VOzNB.js","names":[],"sources":["../src/css/plugins/tailwind/data-type.ts","../src/css/plugins/tailwind/candidates.ts","../src/css/plugins/tailwind/container.ts","../src/css/plugins/tailwind/theme.ts","../src/css/plugins/tailwind/plugin.ts"],"sourcesContent":["// Ported from Tailwind CSS 4.3.5 (MIT), utils/infer-data-type.ts and utils/is-color.ts. Keep\n// the checks aligned with upstream: they decide which `matchUtilities` registration receives an\n// arbitrary value without a type hint, which is a different question from whether the value is\n// valid CSS for a property.\n\nimport { segment } from \"./segment.ts\";\n\nconst NAMED_COLORS = new Set([\n // CSS Level 1 colors\n \"black\",\n \"silver\",\n \"gray\",\n \"white\",\n \"maroon\",\n \"red\",\n \"purple\",\n \"fuchsia\",\n \"green\",\n \"lime\",\n \"olive\",\n \"yellow\",\n \"navy\",\n \"blue\",\n \"teal\",\n \"aqua\",\n\n // CSS Level 2/3 colors\n \"aliceblue\",\n \"antiquewhite\",\n \"aqua\",\n \"aquamarine\",\n \"azure\",\n \"beige\",\n \"bisque\",\n \"black\",\n \"blanchedalmond\",\n \"blue\",\n \"blueviolet\",\n \"brown\",\n \"burlywood\",\n \"cadetblue\",\n \"chartreuse\",\n \"chocolate\",\n \"coral\",\n \"cornflowerblue\",\n \"cornsilk\",\n \"crimson\",\n \"cyan\",\n \"darkblue\",\n \"darkcyan\",\n \"darkgoldenrod\",\n \"darkgray\",\n \"darkgreen\",\n \"darkgrey\",\n \"darkkhaki\",\n \"darkmagenta\",\n \"darkolivegreen\",\n \"darkorange\",\n \"darkorchid\",\n \"darkred\",\n \"darksalmon\",\n \"darkseagreen\",\n \"darkslateblue\",\n \"darkslategray\",\n \"darkslategrey\",\n \"darkturquoise\",\n \"darkviolet\",\n \"deeppink\",\n \"deepskyblue\",\n \"dimgray\",\n \"dimgrey\",\n \"dodgerblue\",\n \"firebrick\",\n \"floralwhite\",\n \"forestgreen\",\n \"fuchsia\",\n \"gainsboro\",\n \"ghostwhite\",\n \"gold\",\n \"goldenrod\",\n \"gray\",\n \"green\",\n \"greenyellow\",\n \"grey\",\n \"honeydew\",\n \"hotpink\",\n \"indianred\",\n \"indigo\",\n \"ivory\",\n \"khaki\",\n \"lavender\",\n \"lavenderblush\",\n \"lawngreen\",\n \"lemonchiffon\",\n \"lightblue\",\n \"lightcoral\",\n \"lightcyan\",\n \"lightgoldenrodyellow\",\n \"lightgray\",\n \"lightgreen\",\n \"lightgrey\",\n \"lightpink\",\n \"lightsalmon\",\n \"lightseagreen\",\n \"lightskyblue\",\n \"lightslategray\",\n \"lightslategrey\",\n \"lightsteelblue\",\n \"lightyellow\",\n \"lime\",\n \"limegreen\",\n \"linen\",\n \"magenta\",\n \"maroon\",\n \"mediumaquamarine\",\n \"mediumblue\",\n \"mediumorchid\",\n \"mediumpurple\",\n \"mediumseagreen\",\n \"mediumslateblue\",\n \"mediumspringgreen\",\n \"mediumturquoise\",\n \"mediumvioletred\",\n \"midnightblue\",\n \"mintcream\",\n \"mistyrose\",\n \"moccasin\",\n \"navajowhite\",\n \"navy\",\n \"oldlace\",\n \"olive\",\n \"olivedrab\",\n \"orange\",\n \"orangered\",\n \"orchid\",\n \"palegoldenrod\",\n \"palegreen\",\n \"paleturquoise\",\n \"palevioletred\",\n \"papayawhip\",\n \"peachpuff\",\n \"peru\",\n \"pink\",\n \"plum\",\n \"powderblue\",\n \"purple\",\n \"rebeccapurple\",\n \"red\",\n \"rosybrown\",\n \"royalblue\",\n \"saddlebrown\",\n \"salmon\",\n \"sandybrown\",\n \"seagreen\",\n \"seashell\",\n \"sienna\",\n \"silver\",\n \"skyblue\",\n \"slateblue\",\n \"slategray\",\n \"slategrey\",\n \"snow\",\n \"springgreen\",\n \"steelblue\",\n \"tan\",\n \"teal\",\n \"thistle\",\n \"tomato\",\n \"turquoise\",\n \"violet\",\n \"wheat\",\n \"white\",\n \"whitesmoke\",\n \"yellow\",\n \"yellowgreen\",\n\n // Keywords\n \"transparent\",\n \"currentcolor\",\n\n // System colors\n \"canvas\",\n \"canvastext\",\n \"linktext\",\n \"visitedtext\",\n \"activetext\",\n \"buttonface\",\n \"buttontext\",\n \"buttonborder\",\n \"field\",\n \"fieldtext\",\n \"highlight\",\n \"highlighttext\",\n \"selecteditem\",\n \"selecteditemtext\",\n \"mark\",\n \"marktext\",\n \"graytext\",\n \"accentcolor\",\n \"accentcolortext\",\n]);\n\nconst IS_COLOR_FN = /^(rgba?|hsla?|hwb|color|(ok)?(lab|lch)|light-dark|color-mix|--alpha)\\(/i;\n\nfunction isColor(value: string): boolean {\n return value.startsWith(\"#\") || IS_COLOR_FN.test(value) || NAMED_COLORS.has(value.toLowerCase());\n}\n\nconst MATH_FUNCTIONS = [\n \"calc\",\n \"min\",\n \"max\",\n \"clamp\",\n \"mod\",\n \"rem\",\n \"sin\",\n \"cos\",\n \"tan\",\n \"asin\",\n \"acos\",\n \"atan\",\n \"atan2\",\n \"pow\",\n \"sqrt\",\n \"hypot\",\n \"log\",\n \"exp\",\n \"round\",\n];\n\nfunction hasMathFn(input: string): boolean {\n return input.includes(\"(\") && MATH_FUNCTIONS.some((fn) => input.includes(`${fn}(`));\n}\n\nexport type DataType =\n | \"color\"\n | \"length\"\n | \"percentage\"\n | \"ratio\"\n | \"number\"\n | \"integer\"\n | \"url\"\n | \"position\"\n | \"bg-size\"\n | \"line-width\"\n | \"image\"\n | \"family-name\"\n | \"generic-name\"\n | \"absolute-size\"\n | \"relative-size\"\n | \"angle\"\n | \"vector\";\n\nconst checks: Record<DataType, (value: string) => boolean> = {\n color: isColor,\n length: isLength,\n percentage: isPercentage,\n ratio: isFraction,\n number: isNumber,\n integer: isPositiveInteger,\n url: isUrl,\n position: isBackgroundPosition,\n \"bg-size\": isBackgroundSize,\n \"line-width\": isLineWidth,\n image: isImage,\n \"family-name\": isFamilyName,\n \"generic-name\": isGenericName,\n \"absolute-size\": isAbsoluteSize,\n \"relative-size\": isRelativeSize,\n angle: isAngle,\n vector: isVector,\n};\n\n/**\n * Determine the type of `value` using syntax rules from CSS specs.\n *\n * @param value - Decoded arbitrary value without a type hint.\n * @param types - Types of the registration, in its order.\n * @returns The first type that the value has, or null. A `var()` value has no type.\n */\nexport function inferDataType(value: string, types: DataType[]): DataType | null {\n if (value.startsWith(\"var(\")) {\n return null;\n }\n\n for (const type of types) {\n if (checks[type]?.(value)) {\n return type;\n }\n }\n\n return null;\n}\n\n/* -------------------------------------------------------------------------- */\n\nconst IS_URL = /^url\\(.*\\)$/;\n\nfunction isUrl(value: string): boolean {\n return IS_URL.test(value);\n}\n\n/* -------------------------------------------------------------------------- */\n\nfunction isLineWidth(value: string): boolean {\n return segment(value, \" \").every(\n (value) =>\n isLength(value) ||\n isNumber(value) ||\n value === \"thin\" ||\n value === \"medium\" ||\n value === \"thick\",\n );\n}\n\n/* -------------------------------------------------------------------------- */\n\nconst IS_IMAGE_FN = /^(?:element|image|cross-fade|image-set)\\(/;\nconst IS_GRADIENT_FN = /^(repeating-)?(conic|linear|radial)-gradient\\(/;\n\nfunction isImage(value: string) {\n let count = 0;\n\n for (const part of segment(value, \",\")) {\n if (part.startsWith(\"var(\")) {\n continue;\n }\n\n if (isUrl(part)) {\n count += 1;\n continue;\n }\n\n if (IS_GRADIENT_FN.test(part)) {\n count += 1;\n continue;\n }\n\n if (IS_IMAGE_FN.test(part)) {\n count += 1;\n continue;\n }\n\n return false;\n }\n\n return count > 0;\n}\n\n/* -------------------------------------------------------------------------- */\n\nfunction isGenericName(value: string): boolean {\n return (\n value === \"serif\" ||\n value === \"sans-serif\" ||\n value === \"monospace\" ||\n value === \"cursive\" ||\n value === \"fantasy\" ||\n value === \"system-ui\" ||\n value === \"ui-serif\" ||\n value === \"ui-sans-serif\" ||\n value === \"ui-monospace\" ||\n value === \"ui-rounded\" ||\n value === \"math\" ||\n value === \"emoji\" ||\n value === \"fangsong\"\n );\n}\n\nfunction isFamilyName(value: string): boolean {\n let count = 0;\n\n for (const part of segment(value, \",\")) {\n // If it starts with a digit, then it's not a family name\n const char = part.charCodeAt(0);\n if (char >= 48 && char <= 57) {\n return false;\n }\n\n if (part.startsWith(\"var(\")) {\n continue;\n }\n\n count += 1;\n }\n\n return count > 0;\n}\n\nfunction isAbsoluteSize(value: string): boolean {\n return (\n value === \"xx-small\" ||\n value === \"x-small\" ||\n value === \"small\" ||\n value === \"medium\" ||\n value === \"large\" ||\n value === \"x-large\" ||\n value === \"xx-large\" ||\n value === \"xxx-large\"\n );\n}\n\nfunction isRelativeSize(value: string): boolean {\n return value === \"larger\" || value === \"smaller\";\n}\n\n/* -------------------------------------------------------------------------- */\n\nconst HAS_NUMBER = /[+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?/;\n\n/* -------------------------------------------------------------------------- */\n\nconst IS_NUMBER = new RegExp(`^${HAS_NUMBER.source}$`);\n\nfunction isNumber(value: string): boolean {\n return IS_NUMBER.test(value) || hasMathFn(value);\n}\n\n/* -------------------------------------------------------------------------- */\n\nconst IS_PERCENTAGE = new RegExp(`^${HAS_NUMBER.source}%$`);\n\nfunction isPercentage(value: string): boolean {\n return IS_PERCENTAGE.test(value) || hasMathFn(value);\n}\n\n/* -------------------------------------------------------------------------- */\n\nconst IS_FRACTION = new RegExp(`^${HAS_NUMBER.source}\\\\s*/\\\\s*${HAS_NUMBER.source}$`);\n\nfunction isFraction(value: string): boolean {\n return IS_FRACTION.test(value) || hasMathFn(value);\n}\n\n/* -------------------------------------------------------------------------- */\n\n/**\n * Please refer to MDN when updating this list:\n *\n * @see https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Values_and_units\n * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Container_Queries#container_query_length_units\n */\nconst LENGTH_UNITS = [\n \"cm\",\n \"mm\",\n \"Q\",\n \"in\",\n \"pc\",\n \"pt\",\n \"px\",\n \"em\",\n \"ex\",\n \"ch\",\n \"cap\",\n \"ic\",\n \"rem\",\n \"rex\",\n \"rch\",\n \"rcap\",\n \"ric\",\n \"lh\",\n \"rlh\",\n \"vw\",\n \"vh\",\n \"vmin\",\n \"vmax\",\n \"vb\",\n \"vi\",\n \"svw\",\n \"svh\",\n \"svi\",\n \"svb\",\n \"svmin\",\n \"svmax\",\n \"lvw\",\n \"lvh\",\n \"lvi\",\n \"lvb\",\n \"lvmin\",\n \"lvmax\",\n \"dvw\",\n \"dvh\",\n \"dvi\",\n \"dvb\",\n \"dvmin\",\n \"dvmax\",\n \"cqw\",\n \"cqh\",\n \"cqi\",\n \"cqb\",\n \"cqmin\",\n \"cqmax\",\n];\n\nconst IS_LENGTH = new RegExp(`^${HAS_NUMBER.source}(${LENGTH_UNITS.join(\"|\")})$`);\nconst IS_LENGTH_FN = /^(--spacing)\\(/i;\n\nfunction isLength(value: string): boolean {\n return IS_LENGTH.test(value) || IS_LENGTH_FN.test(value) || hasMathFn(value);\n}\n\n/* -------------------------------------------------------------------------- */\n\nfunction isBackgroundPosition(value: string): boolean {\n let count = 0;\n\n for (const part of segment(value, \" \")) {\n if (\n part === \"center\" ||\n part === \"top\" ||\n part === \"right\" ||\n part === \"bottom\" ||\n part === \"left\"\n ) {\n count += 1;\n continue;\n }\n\n if (part.startsWith(\"var(\")) {\n continue;\n }\n\n if (isLength(part) || isPercentage(part)) {\n count += 1;\n continue;\n }\n\n return false;\n }\n\n return count > 0;\n}\n\n/* -------------------------------------------------------------------------- */\n\n/**\n * Recognizes background-size entries for Tailwind type inference.\n *\n * @param value - CSS value text with comma-separated entries.\n * @returns Whether at least one entry is cover, contain, or one or two size values.\n */\nfunction isBackgroundSize(value: string) {\n let count = 0;\n\n for (const size of segment(value, \",\")) {\n if (size === \"cover\" || size === \"contain\") {\n count += 1;\n continue;\n }\n\n const values = segment(size, \" \");\n\n // Sizes must have exactly one or two values\n if (values.length !== 1 && values.length !== 2) {\n return false;\n }\n\n if (values.every((value) => value === \"auto\" || isLength(value) || isPercentage(value))) {\n count += 1;\n }\n }\n\n return count > 0;\n}\n\n/* -------------------------------------------------------------------------- */\n\nconst ANGLE_UNITS = [\"deg\", \"rad\", \"grad\", \"turn\"];\n\nconst IS_ANGLE = new RegExp(`^${HAS_NUMBER.source}(${ANGLE_UNITS.join(\"|\")})$`);\n\n/**\n * Recognizes a number with an angle unit.\n *\n * @param value - CSS text without surrounding whitespace.\n * @returns Whether the number ends with deg, rad, grad, or turn.\n */\nfunction isAngle(value: string) {\n return IS_ANGLE.test(value);\n}\n\n/* -------------------------------------------------------------------------- */\n\nconst IS_VECTOR = new RegExp(`^${HAS_NUMBER.source} +${HAS_NUMBER.source} +${HAS_NUMBER.source}$`);\n\n/**\n * Recognizes the three numbers of a rotate vector.\n *\n * @param value - CSS text without surrounding whitespace.\n * @returns Whether exactly three numbers are separated by spaces.\n */\nfunction isVector(value: string) {\n return IS_VECTOR.test(value);\n}\n\n/**\n * Recognizes integer text used by Tailwind type inference.\n *\n * @param value - Number text without surrounding whitespace.\n * @returns True for zero or a positive integer whose JavaScript number spelling matches value.\n */\nfunction isPositiveInteger(value: string): boolean {\n const number = Number(value);\n return Number.isInteger(number) && number >= 0 && String(number) === String(value);\n}\n","import { decodeArbitraryValue } from \"@stillwind/native\";\nimport type { PluginAPI } from \"tailwindcss/plugin\";\n\nimport { serializeCss, utilityBodies, withAlpha } from \"./css.ts\";\nimport { inferDataType, type DataType } from \"./data-type.ts\";\nimport { isValidArbitrary, segment } from \"./segment.ts\";\n\n/** Options of one `matchUtilities()` call. */\ntype MatchOptions = NonNullable<Parameters<PluginAPI[\"matchUtilities\"]>[1]>;\n\n/** Callback of one utility root in `matchUtilities()`. */\ntype UtilityCallback = Parameters<PluginAPI[\"matchUtilities\"]>[0][string];\n\n/** Callback of `matchVariant()`, which returns a selector, an at-rule, or a list of them. */\nexport type VariantCallback = (\n value: unknown,\n extra: {\n modifier: string | null;\n },\n) => string | string[];\n\n/** Options of one `matchVariant()` call. */\nexport interface VariantOptions {\n /** Named values, with `DEFAULT` for the bare root. */\n values?: Record<string, unknown>;\n /** Orders the generated variants; without it, the order of `values` decides. */\n sort?: (\n a: {\n value: unknown;\n modifier: string | null;\n },\n b: {\n value: unknown;\n modifier: string | null;\n },\n ) => number;\n}\n\n/** One root of a `matchUtilities()` call and its results so far. */\nexport interface DynamicUtility {\n /** Index of the `@plugin` statement whose handler registered the utility. */\n owner: number;\n /** Utility root, such as `scrollbar`. */\n name: string;\n callback: UtilityCallback;\n options: MatchOptions;\n /** Rules that carry the selectors of the callback's results for `options.values`, for marker classes. */\n markerSource: string;\n /** Generated bodies by request, null when the callback stops evaluation. */\n results: Map<string, string[] | null | undefined>;\n}\n\n/** One variant that a `matchVariant()` callback generated. */\ninterface VariantResult {\n /** Complete variant name, such as `state-[open]`. */\n name: string;\n /** Value passed to the callback. */\n value: unknown;\n /** Modifier passed to the callback. */\n modifier: string | null;\n /** Variant body with `@slot`. */\n body: string;\n}\n\n/** One `matchVariant()` registration and its results so far. */\nexport interface DynamicVariant {\n /** Index of the `@plugin` statement whose handler registered the variant. */\n owner: number;\n /** Variant root, such as `state`. */\n name: string;\n callback: VariantCallback;\n options: VariantOptions;\n /** CSS that the callback generates for the values in `options.values`, for marker classes. */\n markerSource: string;\n /** Generated variants by complete name. */\n results: Map<string, VariantResult>;\n}\n\n/**\n * Runs a `matchUtilities()` or `matchVariant()` callback for each named value and joins the rules\n * that carry its selectors.\n *\n * The compiler collects marker classes from the selectors of callback results that candidates\n * request. The host passes these rules in `@stillwind-marker-source`, so these classes are\n * markers before any candidate requests a value, and the class that a candidate adds does not\n * depend on which module the host compiles first. A value whose callback throws contributes\n * nothing.\n *\n * @param values - Named values of the registration. Keys that start with `__` are skipped, as\n * Tailwind skips them when it lists candidates.\n * @param run - Returns the CSS rules that carry the selectors of the callback's result for one\n * value.\n * @returns The distinct rules, or an empty string when no value has a selector.\n */\nexport function probeCss(\n values: Record<string, unknown> | undefined,\n run: (value: unknown) => readonly string[],\n): string {\n const rules = new Set<string>();\n for (const [key, value] of Object.entries(values ?? {})) {\n if (key.startsWith(\"__\")) {\n continue;\n }\n try {\n for (const rule of run(value)) {\n rules.add(rule);\n }\n } catch {}\n }\n return [...rules].join(\"\");\n}\n\n/**\n * Whether a candidate or variant belongs to a registered root.\n *\n * @param candidate - Name without a leading `-`.\n * @param root - Registered root, such as `scrollbar`.\n * @returns Whether the name is the root or continues it with `-` or `/`.\n */\nexport function member(candidate: string, root: string): boolean {\n return candidate === root || candidate.startsWith(`${root}-`) || candidate.startsWith(`${root}/`);\n}\n\n/**\n * Converts a variant definition that a plugin returns into a `@custom-variant` body.\n *\n * @param value - Selector or at-rule string, CSS object, or a list of them.\n * @returns CSS with `@slot`. A string without `@slot` gets one at its innermost block, or a\n * block of its own.\n */\nexport function variantBody(value: unknown): string {\n if (Array.isArray(value)) {\n return value.map(variantBody).join(\"\\n\");\n }\n if (typeof value !== \"string\") {\n return serializeCss(value);\n }\n if (value.includes(\"@slot\")) {\n return value;\n }\n if (value.includes(\"{\")) {\n return value.replace(\"}\", \"{@slot;}}\");\n }\n return `${value}{@slot;}`;\n}\n\n/** A candidate value or modifier, as Tailwind's candidate parser reads it. */\ntype CandidatePart =\n | {\n kind: \"named\";\n /** Text as written. */\n value: string;\n }\n | {\n kind: \"arbitrary\";\n /** Decoded value; a `(--name)` shorthand becomes `var(--name)`. */\n value: string;\n /** Explicit type hint such as `length` in `[length:1px]`, or null without one. */\n dataType: string | null;\n };\n\n/**\n * Parses the value part of a candidate as Tailwind's candidate parser does.\n *\n * @param text - Text after the root and its `-`, such as `4`, `[length:1px]`, or\n * `(length:--size)`.\n * @returns The value, or undefined when Tailwind rejects the candidate.\n */\nfunction parseValue(text: string): CandidatePart | undefined {\n let inner: string;\n if (text.startsWith(\"(\") && text.endsWith(\")\")) {\n // Tailwind rewrites `(type:--name)` to `[type:var(--name)]` before decoding.\n const parts = segment(text.slice(1, -1), \":\");\n const [dataType, variable] = parts.length === 2 ? parts : [null, parts.join(\":\")];\n if (!variable.startsWith(\"--\") || !isValidArbitrary(variable)) {\n return undefined;\n }\n inner = dataType === null ? `var(${variable})` : `${dataType}:var(${variable})`;\n } else if (text.startsWith(\"[\") && text.endsWith(\"]\")) {\n inner = text.slice(1, -1);\n } else {\n return {\n kind: \"named\",\n value: text,\n };\n }\n let value = decodeArbitraryValue(inner);\n if (!isValidArbitrary(value)) {\n return undefined;\n }\n // A type hint consists of lowercase letters and hyphens before the first colon.\n let dataType: string | null = null;\n const hint = /^([a-z-]*):/.exec(value);\n if (hint) {\n if (!hint[1]) {\n return undefined;\n }\n dataType = hint[1];\n value = value.slice(hint[0].length);\n }\n return value.trim()\n ? {\n kind: \"arbitrary\",\n value,\n dataType,\n }\n : undefined;\n}\n\n/**\n * Parses a `/` modifier as Tailwind's candidate parser does.\n *\n * @param text - Modifier text without the slash.\n * @returns The modifier, or undefined when Tailwind rejects the candidate.\n */\nfunction parseModifier(text: string): CandidatePart | undefined {\n if (text.startsWith(\"[\") && text.endsWith(\"]\")) {\n const value = decodeArbitraryValue(text.slice(1, -1));\n return isValidArbitrary(value) && value.trim()\n ? {\n kind: \"arbitrary\",\n value,\n dataType: null,\n }\n : undefined;\n }\n if (text.startsWith(\"(\") && text.endsWith(\")\")) {\n const variable = text.slice(1, -1);\n return variable.startsWith(\"--\") && isValidArbitrary(variable)\n ? {\n kind: \"arbitrary\",\n value: decodeArbitraryValue(`var(${variable})`),\n dataType: null,\n }\n : undefined;\n }\n return text\n ? {\n kind: \"named\",\n value: text,\n }\n : undefined;\n}\n\n/**\n * Runs a `matchUtilities` callback for one candidate as Tailwind's compatibility layer does.\n *\n * @param candidate - Utility key, such as `-probe-[3px]/mirror`.\n * @param registration - Registration whose root, callback, and options apply.\n * @returns The bodies of the callback's targets, undefined when the registration does not apply,\n * and null when an arbitrary value has an invalid modifier, which ends Tailwind's evaluation of\n * later definitions.\n */\nexport function resolveUtility(\n candidate: string,\n registration: DynamicUtility,\n): string[] | null | undefined {\n const { name, callback, options } = registration;\n const negative = candidate.startsWith(\"-\");\n const raw = negative ? candidate.slice(1) : candidate;\n if (!member(raw, name) || (negative && !options.supportsNegativeValues)) {\n return;\n }\n const [stem, ...modifierParts] = segment(raw, \"/\");\n if (modifierParts.length > 1) {\n return;\n }\n const modifierText = modifierParts[0];\n const valueText = stem === name ? undefined : stem.slice(name.length + 1);\n const parsed = valueText === undefined ? null : parseValue(valueText);\n const candidateModifier = modifierText === undefined ? null : parseModifier(modifierText);\n if (parsed === undefined || candidateModifier === undefined) {\n return;\n }\n const types = Array.isArray(options.type) ? options.type : [options.type ?? \"any\"];\n if (parsed?.kind === \"arbitrary\" && types.length > 0 && !types.includes(\"any\")) {\n if (\n parsed.dataType\n ? !types.includes(parsed.dataType)\n : !inferDataType(parsed.value, types as DataType[])\n ) {\n return;\n }\n }\n const isColor = types.includes(\"color\");\n // Color utilities accept these keywords unless their values define the keys, as in Tailwind.\n const values: Record<string, unknown> = isColor\n ? {\n inherit: \"inherit\",\n transparent: \"transparent\",\n current: \"currentcolor\",\n ...options.values,\n }\n : (options.values ?? {});\n // A named value with a named modifier, such as `w-1/2`, may be a fraction key.\n const fraction =\n parsed?.kind === \"named\" && candidateModifier?.kind === \"named\"\n ? `${parsed.value}/${candidateModifier.value}`\n : null;\n let value: unknown = null;\n let ignoreModifier = false;\n if (!parsed) {\n value = values.DEFAULT ?? null;\n } else if (parsed.kind === \"arbitrary\") {\n value = parsed.value;\n } else if (fraction && Object.hasOwn(values, fraction)) {\n value = values[fraction];\n ignoreModifier = true;\n } else if (Object.hasOwn(values, parsed.value)) {\n value = values[parsed.value];\n } else if (typeof values.__BARE_VALUE__ === \"function\") {\n value =\n values.__BARE_VALUE__({\n kind: \"named\",\n value: parsed.value,\n fraction,\n }) ?? null;\n ignoreModifier = fraction !== null && typeof value === \"string\" && value.includes(\"/\");\n }\n if (value === null || value === undefined) {\n return;\n }\n let modifier: string | null = null;\n if (candidateModifier) {\n const modifiers = options.modifiers;\n if (modifiers === \"any\" || candidateModifier.kind === \"arbitrary\") {\n modifier = candidateModifier.value;\n } else if (modifiers && Object.hasOwn(modifiers, candidateModifier.value)) {\n modifier = modifiers[candidateModifier.value];\n } else if (isColor && !Number.isNaN(Number(candidateModifier.value))) {\n modifier = `${candidateModifier.value}%`;\n }\n if (modifier === null && !ignoreModifier) {\n return parsed?.kind === \"arbitrary\" ? null : undefined;\n }\n }\n // Like Tailwind, these interpolate the value as text; color and negative registrations hold\n // strings or numbers.\n if (isColor && modifier !== null) {\n value = withAlpha(String(value as string), modifier);\n }\n if (negative) {\n value = `calc(${String(value as string)} * -1)`;\n }\n return utilityBodies(\n // Tailwind passes a value from `values` as it is, so a number stays a number.\n (\n callback as (\n value: unknown,\n extra: {\n modifier: string | null;\n },\n ) => unknown\n )(value, {\n modifier,\n }),\n );\n}\n\n/**\n * Selects the callback arguments of a `matchVariant()` registration for one variant name, as\n * Tailwind's compatibility layer does.\n *\n * The bare root uses the `DEFAULT` value. A named value must be a string in `values`, so\n * `values: { one: 1 }` defines no `name-one` variant. An arbitrary value passes its decoded text.\n *\n * @param candidate - Complete variant name, such as `state-[open]/peer`.\n * @param registration - Registration whose root and values apply.\n * @returns The variant name, value, and modifier, or undefined when the registration has no\n * such value.\n */\nexport function resolveVariant(\n candidate: string,\n registration: DynamicVariant,\n):\n | {\n name: string;\n value: unknown;\n modifier: string | null;\n }\n | undefined {\n const { name, options } = registration;\n if (!member(candidate, name)) {\n return;\n }\n const [stem, ...modifierParts] = segment(candidate, \"/\");\n if (modifierParts.length > 1) {\n return;\n }\n const valueText = stem === name ? undefined : stem.slice(name.length + 1);\n const parsed = valueText === undefined ? null : parseValue(valueText);\n const modifier = modifierParts[0] === undefined ? null : parseModifier(modifierParts[0]);\n if (parsed === undefined || modifier === undefined) {\n return;\n }\n const values = options.values;\n let value: unknown;\n if (!parsed) {\n if (!values || !(\"DEFAULT\" in values)) {\n return;\n }\n value = values.DEFAULT;\n } else if (parsed.kind === \"arbitrary\") {\n value = parsed.value;\n } else {\n value = values && Object.hasOwn(values, parsed.value) ? values[parsed.value] : undefined;\n if (typeof value !== \"string\") {\n return;\n }\n }\n return {\n name: candidate,\n value,\n modifier: modifier?.value ?? null,\n };\n}\n","/**\n * Converts the legacy `theme.container` configuration into the `container` utility that\n * Tailwind's compatibility layer adds next to its built-in `container`.\n */\n\n/**\n * Compares two breakpoint values in ascending order, as Tailwind sorts its `--breakpoint-*`\n * values. Lengths in `px`, `rem`, and `em` compare by size, with `1rem` and `1em` as `16px`.\n * Other values compare as text after every length.\n *\n * @param left - CSS length, such as `40rem`.\n * @param right - CSS length.\n * @returns A negative number when `left` comes first, a positive number when `right` comes\n * first, and zero for equal values.\n */\nfunction compareBreakpoints(left: string, right: string): number {\n const a = pixels(left);\n const b = pixels(right);\n if (a !== null && b !== null) {\n return a - b;\n }\n if (a !== null || b !== null) {\n return a === null ? 1 : -1;\n }\n return left < right ? -1 : left > right ? 1 : 0;\n}\n\n/**\n * Converts a length to pixels.\n *\n * @param value - CSS length.\n * @returns The size in pixels, or null for other values.\n */\nfunction pixels(value: string): number | null {\n const match = /^(-?\\d*\\.?\\d+)(px|r?em)$/.exec(value.trim());\n return match ? Number(match[1]) * (match[2] === \"px\" ? 1 : 16) : null;\n}\n\n/**\n * Builds the body of the `container` utility for a `theme.container` configuration, as\n * Tailwind's compatibility layer does.\n *\n * `center` adds `margin-inline: auto`. A string `padding`, or the `DEFAULT` of an object, adds\n * `padding-inline`, and the other keys of an object add `padding-inline` from the breakpoint of\n * the same name. `screens` replaces the built-in maximum widths: the smallest breakpoint resets\n * `max-width`, and each screen sets `max-width` to its minimum width. A screen without a\n * minimum width is skipped.\n *\n * @param container - The `theme.container` value.\n * @param breakpoints - Breakpoint values by name, such as `{ sm: \"40rem\" }`.\n * @returns CSS declarations and rules for an `@utility container` body, or an empty string when\n * the configuration adds nothing.\n */\nexport function containerUtility(\n container: unknown,\n breakpoints: Readonly<Record<string, string>>,\n): string {\n if (!container || typeof container !== \"object\") {\n return \"\";\n }\n const { center, padding, screens } = container as Record<string, unknown>;\n const output: string[] = [];\n if (center) {\n output.push(\"margin-inline:auto;\");\n }\n if (typeof padding === \"string\") {\n output.push(`padding-inline:${padding};`);\n } else if (padding && typeof padding === \"object\" && \"DEFAULT\" in padding) {\n output.push(`padding-inline:${String((padding as Record<string, unknown>).DEFAULT)};`);\n }\n const sorted = Object.entries(breakpoints).sort(([, a], [, b]) => compareBreakpoints(a, b));\n let widths: Map<string, string[]> | undefined;\n if (screens && typeof screens === \"object\") {\n widths = new Map();\n if (sorted.length) {\n output.push(`@media (width >= ${sorted[0][1]}){max-width:none;}`);\n }\n for (const [name, screen] of Object.entries(screens)) {\n const width =\n typeof screen === \"string\"\n ? screen\n : screen && typeof screen === \"object\" && \"min\" in screen\n ? String((screen as Record<string, unknown>).min)\n : undefined;\n if (width !== undefined) {\n widths.set(name, [width, `max-width:${width};`]);\n }\n }\n }\n if (padding && typeof padding === \"object\") {\n const paddings = Object.entries(padding as Record<string, unknown>)\n .filter(([name]) => name !== \"DEFAULT\" && name in breakpoints)\n .sort(([a], [b]) => compareBreakpoints(breakpoints[a], breakpoints[b]));\n for (const [name, value] of paddings) {\n const screen = widths?.get(name);\n if (screen) {\n screen.push(`padding-inline:${String(value)};`);\n } else if (!widths) {\n output.push(`@media (width >= ${breakpoints[name]}){padding-inline:${String(value)};}`);\n }\n }\n }\n for (const [width, ...declarations] of widths?.values() ?? []) {\n output.push(`@media (width >= ${width}){${declarations.join(\"\")}}`);\n }\n return output.join(\"\");\n}\n","import {\n customPropertyReferences,\n type NativeLegacyThemeKey,\n type NativeThemeToken,\n} from \"@stillwind/native\";\nimport defaultTheme from \"tailwindcss/defaultTheme\";\n\nimport { serializeCss, withAlpha } from \"./css.ts\";\nimport { segment } from \"./segment.ts\";\n\ntype Dictionary = Record<string, unknown>;\n\n/**\n * The `theme()` function that Tailwind passes to plugins and to functions in theme config.\n */\ntype ThemeFunction = ((path?: string, fallback?: unknown) => unknown) & {\n /** The function itself, for config functions written as `({ theme }) => ...`. */\n theme: ThemeFunction;\n /** The resolved `colors` section, for config functions written as `({ colors }) => ...`. */\n colors: unknown;\n};\n\n// The tables, `keyPathToCssProperty()`, `themeableValues()`, `readFromCss()`, and the merge\n// rules of `get` follow Tailwind CSS 4.3.5 (compat/apply-config-to-theme.ts and\n// compat/plugin-functions.ts). Keep them aligned with upstream instead of adding names here:\n// they define which v3 config key reads and writes which CSS theme variable. The v3 config\n// keys whose namespace has another name come from the `@stillwind-legacy-theme-key`\n// statements of the design system.\n\n/**\n * Config keys whose `DEFAULT` value is a shared default in the `--default-*` namespace.\n */\nconst SPECIAL_DEFAULT_KEYS: Record<string, string> = {\n borderWidth: \"border-width\",\n outlineWidth: \"outline-width\",\n ringColor: \"ring-color\",\n ringWidth: \"ring-width\",\n transitionDuration: \"transition-duration\",\n transitionTimingFunction: \"transition-timing-function\",\n};\n\nconst IS_VALID_KEY = /^[a-zA-Z0-9-_%/.]+$/;\n\n/** Tailwind's `ThemeOptions.DEFAULT` flag in `__CSS_VALUES__`. */\nconst DEFAULT_OPTION = 4;\n\n/**\n * Converts a config key path to the name of its CSS theme variable without `--`, as Tailwind does.\n * `fontSize.xs.1.lineHeight` becomes `text-xs--line-height`, and `transitionDuration.DEFAULT`\n * becomes `default-transition-duration`.\n *\n * @param path - Config keys, such as `[\"colors\", \"red\", \"500\"]`.\n * @param namespaces - The namespace name of each v3 config key whose namespace has another\n * name, such as `text` for `fontSize`. Other keys use their kebab-case name.\n * @returns The variable name, or null for the legacy container config and for keys with\n * characters that a variable name cannot hold.\n */\nexport function keyPathToCssProperty(\n path: readonly string[],\n namespaces: Readonly<Record<string, string>>,\n): string | null {\n const special = SPECIAL_DEFAULT_KEYS[path[0]];\n if (special && path[1] === \"DEFAULT\") {\n return `default-${special}`;\n }\n if (path[0] === \"container\" || !path.every((part) => IS_VALID_KEY.test(part))) {\n return null;\n }\n const parts = [namespaces[path[0]] ?? path[0], ...path.slice(1)];\n return parts\n .map((part, index, all) => (part === \"1\" && index !== all.length - 1 ? \"\" : part))\n .map((part, index) => {\n part = part.replaceAll(\".\", \"_\");\n return index === 0 || part.startsWith(\"-\") || part === \"lineHeight\"\n ? part.replace(/([a-z])([A-Z])/g, (_, a: string, b: string) => `${a}-${b.toLowerCase()}`)\n : part;\n })\n .filter((part, index) => part !== \"DEFAULT\" || index !== path.length - 1)\n .join(\"-\");\n}\n\n/**\n * Lists the primitive values of a resolved theme config with their key paths, as Tailwind writes\n * them back to CSS: tuples add their extra values under `-key`, and string arrays become a\n * comma-separated list, except that a `fontSize` array is a size and a line height.\n *\n * @param theme - Resolved config sections keyed by config key.\n * @returns Key paths and values in traversal order. Keys that start with `__` are skipped.\n */\nfunction themeableValues(theme: Dictionary): [string[], unknown][] {\n const result: [string[], unknown][] = [];\n /**\n * Adds the primitive values of one config value.\n * @param value - Config value at `path`.\n * @param path - Keys from the section key to `value`.\n */\n const visit = (value: unknown, path: string[]) => {\n if (typeof value === \"string\" || typeof value === \"number\") {\n result.push([path, value]);\n } else if (\n Array.isArray(value) &&\n value.length === 2 &&\n (typeof value[0] === \"string\" || typeof value[0] === \"number\") &&\n object(value[1])\n ) {\n result.push([path, value[0]]);\n for (const [key, extra] of Object.entries(value[1])) {\n result.push([[...path, `-${key}`], extra]);\n }\n } else if (Array.isArray(value) && value.every((entry) => typeof entry === \"string\")) {\n if (path[0] === \"fontSize\") {\n result.push([path, value[0]]);\n if (value.length >= 2) {\n result.push([[...path, \"-line-height\"], value[1]]);\n }\n } else {\n result.push([path, value.join(\", \")]);\n }\n } else if (object(value)) {\n for (const [key, entry] of Object.entries(value)) {\n if (!key.startsWith(\"__\")) {\n visit(entry, [...path, key]);\n }\n }\n }\n };\n visit(theme, []);\n return result;\n}\n\n/**\n * Parses a `theme()` path, as Tailwind's `toKeyPath()` does.\n *\n * @param path - Dotted path with optional brackets, such as `colors.red[500]`.\n * @returns The keys, such as `[\"colors\", \"red\", \"500\"]`. A bracket keeps dots, so `spacing[1.5]`\n * has the key `1.5`.\n */\nexport function toKeyPath(path: string): string[] {\n const keys: string[] = [];\n for (const part of segment(path, \".\")) {\n let index = 0;\n for (;;) {\n const open = part.indexOf(\"[\", index);\n const close = part.indexOf(\"]\", open);\n if (open < 0 || close < 0) {\n break;\n }\n if (open > index) {\n keys.push(part.slice(index, open));\n }\n keys.push(part.slice(open + 1, close));\n index = close + 1;\n }\n if (index < part.length) {\n keys.push(part.slice(index));\n }\n }\n return keys;\n}\n\n/**\n * Reads a key path from a config object. A missing key joins the next one with `-`, so\n * `colors.red.500` also finds a `red-500` entry.\n *\n * @param value - Config object.\n * @param path - Keys below `value`.\n * @returns The value at the path, or undefined when a key is missing at the end of the path.\n */\nfunction read(value: unknown, path: readonly string[]): unknown {\n const keys = [...path];\n for (let index = 0; index < keys.length; index++) {\n const key = keys[index];\n if (!object(value) || !Object.hasOwn(value, key)) {\n if (keys[index + 1] === undefined) {\n return undefined;\n }\n keys[index + 1] = `${key}-${keys[index + 1]}`;\n continue;\n }\n value = value[key];\n }\n return value;\n}\n\n/**\n * Whether a theme value refers to the variable that it would define.\n *\n * @param name - Variable name without the leading `--`, such as `color-primary`.\n * @param value - Configured value.\n * @returns Whether `value` refers to `--name`, as in `var(--name)`, `var(--x, var(--name))`, or\n * `--name(4)`, which makes a declaration of `--name` a cycle. Names in strings, comments, and URLs\n * do not count.\n */\nfunction selfReference(name: string, value: unknown): boolean {\n return typeof value === \"string\" && customPropertyReferences(value).includes(`--${name}`);\n}\n\n/**\n * Whether a value is a plain object rather than null or an array.\n *\n * @param value - Any value.\n * @returns Whether `value` can hold config keys.\n */\nfunction object(value: unknown): value is Dictionary {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * Merges configuration objects deeply. Arrays and scalar values replace earlier values.\n *\n * @param target - Object that receives the entries; nested objects are copied before merging.\n * @param source - Entries to merge into `target`.\n * @returns `target`.\n */\nexport function merge(target: Dictionary, source: Dictionary): Dictionary {\n for (const [key, value] of Object.entries(source)) {\n target[key] =\n object(value) && object(target[key])\n ? merge(\n {\n ...target[key],\n },\n value,\n )\n : value;\n }\n return target;\n}\n\n/**\n * Reads one `fontFamily` config entry, as Tailwind's `fontFamily.sans` handling does.\n *\n * @param value - Config entry: a family string, an array of families, or a `[family, settings]`\n * tuple.\n * @param setting - Settings key of a tuple, such as `fontFeatureSettings`, or undefined for the\n * family.\n * @returns The family with array entries joined by `, `, or the tuple's setting. Returns null when\n * the entry does not hold the requested value.\n */\nfunction fontValue(value: unknown, setting?: string): string | null {\n if (Array.isArray(value) && value.length === 2 && object(value[1])) {\n const result = setting === undefined ? value[0] : value[1][setting];\n return result === undefined || result === null ? null : String(result);\n }\n if (setting !== undefined) {\n return null;\n }\n if (Array.isArray(value)) {\n return value.join(\", \");\n }\n return typeof value === \"string\" ? value : null;\n}\n\n/**\n * The `theme` and `theme.extend` objects of one config.\n */\ninterface ConfigLayer {\n theme: Dictionary;\n extend: Dictionary;\n}\n\n/**\n * Resolves plugin theme configuration against the active CSS tokens, as Tailwind's compatibility\n * layer does, and writes the plugins' own configuration back as CSS theme variables.\n *\n * Reads combine three sources: CSS tokens, the plugins' config, and Tailwind's v3 default theme\n * without colors. Ordinary CSS definitions win. Config values win over `@theme default`\n * definitions and over the defaults.\n */\nexport class PluginTheme {\n /** The function passed to plugin handlers and config functions. */\n readonly get: ThemeFunction;\n\n /** Active tokens by full name. */\n readonly #tokens: ReadonlyMap<string, NativeThemeToken>;\n\n /** The namespace name of each v3 config key whose namespace has another name. */\n readonly #namespaces: Readonly<Record<string, string>>;\n\n /** Tailwind's compatibility defaults followed by the plugin configs, in plugin order. */\n readonly #layers: ConfigLayer[];\n\n /** Number of leading layers that are compatibility defaults rather than plugin config. */\n readonly #defaults: number;\n\n readonly #sections = new Map<string, unknown>();\n\n readonly #resolving = new Set<string>();\n\n /**\n * @param configs - Configs of the plugins and their presets, in registration order.\n * @param tokens - Active CSS theme tokens.\n * @param legacyKeys - The namespaces that v3 config keys read, from the design system.\n */\n constructor(\n configs: readonly Dictionary[],\n tokens: readonly NativeThemeToken[],\n legacyKeys: readonly NativeLegacyThemeKey[],\n ) {\n this.#tokens = new Map(tokens.map((token) => [token.name, token]));\n this.#namespaces = Object.fromEntries(legacyKeys.map(({ key, namespace }) => [key, namespace]));\n /**\n * Splits a config's `theme` into its replacing and extending parts.\n * @param theme - The `theme` value of a config.\n * @returns The layer, empty for a value that is not an object.\n */\n const layer = (theme: unknown): ConfigLayer => {\n const { extend, ...rest } = object(theme) ? theme : {};\n return {\n theme: rest,\n extend: object(extend) ? extend : {},\n };\n };\n /**\n * Creates a config function that reads one CSS theme namespace.\n * @param namespace - CSS namespace, such as `color`.\n * @returns A function that returns the namespace's values, or an empty object.\n */\n const fromCss = (namespace: string) => () => this.get(namespace, {});\n // Tailwind's `createCompatConfig()`: the v3 defaults, and the CSS namespaces exposed under\n // their v3 keys. A `replace` key, such as `colors`, reads only CSS. An `extend` key adds\n // the CSS values to the v3 defaults.\n const exposed = (exposure: NativeLegacyThemeKey[\"exposure\"]) =>\n Object.fromEntries(\n legacyKeys\n .filter((legacy) => legacy.exposure === exposure)\n .map(({ key, namespace }) => [key, fromCss(namespace)]),\n );\n this.#layers = [\n {\n theme: {\n ...(defaultTheme as Dictionary),\n ...exposed(\"replace\"),\n },\n extend: {\n ...exposed(\"extend\"),\n transitionDuration: {\n DEFAULT: this.#tokens.get(\"--default-transition-duration\")?.value ?? null,\n },\n transitionTimingFunction: {\n DEFAULT: this.#tokens.get(\"--default-transition-timing-function\")?.value ?? null,\n },\n },\n },\n ...configs.map((config) => layer(config.theme)),\n ];\n this.#defaults = 1;\n /**\n * The theme function of plugins and config functions.\n * @param path - Config path, or undefined for every section.\n * @param fallback - Value for a path that resolves to nothing.\n * @returns The resolved value.\n */\n const get = ((path?: string, fallback?: unknown) =>\n path === undefined ? this.#all() : this.#theme(path, fallback)) as ThemeFunction;\n get.theme = get;\n this.get = get;\n get.colors = get(\"colors\");\n }\n\n /**\n * Emits the plugins' own theme configuration, which native utility resolution also needs.\n *\n * @returns A `@stillwind-plugin-theme` block with the configured variables and keyframes, and a\n * `@stillwind-plugin-theme inline reference` block with the values that refer to their own\n * variable, or an empty string when the plugins configure nothing.\n */\n css(): string {\n const configured: Dictionary = {};\n const replaced = new Set<string>();\n const layers = this.#layers.slice(this.#defaults);\n for (const key of new Set(\n layers.flatMap(({ theme, extend }) => [...Object.keys(theme), ...Object.keys(extend)]),\n )) {\n if (layers.some(({ theme }) => Object.hasOwn(theme, key))) {\n replaced.add(key);\n }\n configured[key] = this.#resolve(key, layers);\n }\n let declarations = \"\";\n let inline = \"\";\n // A replaced section clears the `@theme default` values of its namespace, as Tailwind's\n // `clearNamespace(..., ThemeOptions.DEFAULT)` does. Ordinary definitions stay.\n for (const key of replaced) {\n const name = keyPathToCssProperty([key], this.#namespaces);\n if (name) {\n declarations += `--${name}-*:initial;`;\n }\n }\n for (const [path, configuredValue] of themeableValues(configured)) {\n let value = configuredValue;\n if (path[0] === \"keyframes\") {\n continue;\n }\n if (typeof value === \"string\") {\n value = value.replaceAll(\"<alpha-value>\", \"1\");\n }\n if (path[0] === \"opacity\") {\n const number = typeof value === \"string\" ? Number.parseFloat(value) : Number(value);\n if (number >= 0 && number <= 1) {\n value = `${number * 100}%`;\n }\n }\n const name = keyPathToCssProperty(path, this.#namespaces);\n if (!name) {\n continue;\n }\n // A value such as daisyUI's `colors.primary: \"var(--color-primary)\"` names the variable\n // that it would define. Declaring it would make the variable invalid through a cycle. The\n // `reference` mode keeps the value out of the generated CSS even when a `var()` refers to\n // it, so utilities inline the reference and the plugin's own CSS defines the variable.\n if (selfReference(name, value)) {\n inline += `--${name}:${String(value)};`;\n } else {\n declarations += `--${name}:${String(value)};`;\n }\n }\n // Tailwind points the preflight fonts of documents and code at the configured `sans` and\n // `mono` families, so they apply even without the default theme. An ordinary `--font-sans` or\n // `--font-mono` definition keeps the preflight defaults unchanged.\n if (object(configured.fontFamily)) {\n for (const [key, prefix] of [\n [\"sans\", \"default\"],\n [\"mono\", \"default-mono\"],\n ]) {\n const entry = configured.fontFamily[key];\n const family = fontValue(entry);\n const token = this.#tokens.get(`--font-${key}`);\n if (family !== null && (!token || token.fallback)) {\n declarations +=\n `--${prefix}-font-family:${family};` +\n `--${prefix}-font-feature-settings:${fontValue(entry, \"fontFeatureSettings\") ?? \"normal\"};` +\n `--${prefix}-font-variation-settings:${fontValue(entry, \"fontVariationSettings\") ?? \"normal\"};`;\n }\n }\n }\n let frames = \"\";\n if (object(configured.keyframes)) {\n for (const [name, body] of Object.entries(configured.keyframes)) {\n frames += `@keyframes ${name}{${serializeCss(body)}}`;\n }\n }\n return [\n declarations || frames ? `@stillwind-plugin-theme{${declarations}${frames}}` : \"\",\n inline ? `@stillwind-plugin-theme inline reference{${inline}}` : \"\",\n ].join(\"\");\n }\n\n /**\n * Resolves every section, for `config(\"theme\")` and `theme()` without a path.\n *\n * @returns Resolved sections keyed by config key.\n */\n #all(): Dictionary {\n const keys = new Set(\n this.#layers.flatMap(({ theme, extend }) => [...Object.keys(theme), ...Object.keys(extend)]),\n );\n return Object.fromEntries([...keys].map((key) => [key, this.#section(key)]));\n }\n\n /**\n * Resolves one config section across all layers, once.\n *\n * @param key - Config key, such as `colors`.\n * @returns The resolved section, or undefined when no layer configures it.\n * @throws If resolving the section reads the section itself.\n */\n #section(key: string): unknown {\n if (this.#sections.has(key)) {\n return this.#sections.get(key);\n }\n if (this.#resolving.has(key)) {\n throw new Error(`Circular Tailwind plugin theme reference: ${key}`);\n }\n this.#resolving.add(key);\n try {\n const value = this.#resolve(key, this.#layers);\n this.#sections.set(key, value);\n return value;\n } finally {\n this.#resolving.delete(key);\n }\n }\n\n /**\n * Resolves one section of `layers`: the last `theme` value replaces earlier ones, and every\n * `extend` value then merges into it. Function values receive the theme function.\n *\n * @param key - Config key.\n * @param layers - Layers to combine, in registration order.\n * @returns The resolved section, or undefined when no layer configures it.\n */\n #resolve(key: string, layers: readonly ConfigLayer[]): unknown {\n /**\n * Calls a config function with the theme function.\n * @param value - Config value or function.\n * @returns The function's result, or `value` itself.\n */\n const evaluate = (value: unknown) =>\n typeof value === \"function\" ? (value as (theme: ThemeFunction) => unknown)(this.get) : value;\n let value: unknown;\n for (const layer of layers) {\n if (Object.hasOwn(layer.theme, key)) {\n value = evaluate(layer.theme[key]);\n }\n }\n for (const layer of layers) {\n if (Object.hasOwn(layer.extend, key)) {\n const extension = evaluate(layer.extend[key]);\n value = object(extension)\n ? merge(\n {\n ...(object(value) ? value : {}),\n },\n extension,\n )\n : extension;\n }\n }\n return value;\n }\n\n /**\n * Tailwind's `theme(path, defaultValue)` for plugins.\n *\n * @param path - Config path, or a CSS variable name such as `--color-red-500`, with an optional\n * trailing `/ alpha`.\n * @param fallback - Value for a path that resolves to nothing.\n * @returns The resolved value, with the alpha applied to a string value.\n */\n #theme(path: string, fallback: unknown): unknown {\n const slash = path.lastIndexOf(\"/\");\n const modifier = slash < 0 ? null : path.slice(slash + 1).trim();\n const keys = toKeyPath(slash < 0 ? path : path.slice(0, slash).trim());\n const [css, options] = this.#readFromCss(keys);\n let config = keys[0] === undefined ? undefined : read(this.#section(keys[0]), keys.slice(1));\n if (typeof config === \"string\") {\n config = config.replace(\"<alpha-value>\", \"1\");\n }\n let value: unknown;\n if (css === null) {\n value = config;\n } else if (typeof css !== \"object\") {\n // A `@theme default` value yields to the config, as it does in Tailwind.\n value = typeof options === \"number\" && options & DEFAULT_OPTION ? (config ?? css) : css;\n } else if (object(config) && object(css)) {\n const copy = merge({}, config);\n const cssOptions = (css.__CSS_VALUES__ ?? {}) as Record<string, number>;\n for (const [key, entry] of Object.entries(css)) {\n const yields =\n ((cssOptions[key] ?? 0) & DEFAULT_OPTION) !== 0 &&\n read(copy, key.split(\"-\")) !== undefined;\n if (key !== \"__CSS_VALUES__\" && !yields) {\n copy[key] = entry;\n }\n }\n value = copy;\n } else {\n // A specific key such as `colors.foo` returns its `DEFAULT` when CSS also defines\n // `--color-foo-bar`. Namespace root lookups keep the whole object.\n value = keys.length > 1 && object(css) && \"DEFAULT\" in css ? css.DEFAULT : css;\n }\n if (modifier && typeof value === \"string\") {\n value = withAlpha(value, modifier);\n }\n return value ?? fallback;\n }\n\n /**\n * Tailwind's `readFromCss()`: the token of a key path, or the namespace's tokens as an object\n * keyed by suffix with `__CSS_VALUES__` options. `--text-xs--line-height` becomes the tuple\n * `[size, { lineHeight }]` of `xs`.\n *\n * @param path - Config key path, or one CSS variable name.\n * @returns The value or object, and its options: a number for a value, and an object of\n * numbers for an object. Null and 0 when no token matches.\n */\n #readFromCss(path: readonly string[]): [unknown, unknown] {\n /**\n * Returns Tailwind's options of a token.\n * @param token - Active token.\n * @returns The `DEFAULT` flag for a definition that ordinary definitions override.\n */\n const option = (token: NativeThemeToken | undefined) => (token?.fallback ? DEFAULT_OPTION : 0);\n if (path.length === 1 && path[0].startsWith(\"--\")) {\n const token = this.#tokens.get(path[0]);\n return [token?.value ?? null, option(token)];\n }\n const name = keyPathToCssProperty(path, this.#namespaces);\n if (!name) {\n return [null, 0];\n }\n const values = new Map<string | null, unknown>();\n const options = new Map<string | null, unknown>();\n const nested = new Map<string | null, Record<string, [string, number]>>();\n for (const token of this.#tokens.values()) {\n if (token.name !== `--${name}` && !token.name.startsWith(`--${name}-`)) {\n continue;\n }\n const key = token.name === `--${name}` ? null : token.name.slice(name.length + 3);\n if (key === null || !key.includes(\"--\")) {\n values.set(key, token.value);\n options.set(key, option(token));\n continue;\n }\n const split = key.indexOf(\"--\");\n const main = key.slice(0, split) || null;\n const extra = key\n .slice(split + 2)\n .replace(/-([a-z])/g, (_, letter: string) => letter.toUpperCase());\n nested.set(main, {\n ...nested.get(main),\n [extra]: [token.value, option(token)],\n });\n }\n if (!values.size && !nested.size) {\n return [null, 0];\n }\n for (const [key, extra] of nested) {\n const base = values.get(key);\n if (typeof base === \"string\") {\n values.set(key, [\n base,\n Object.fromEntries(Object.entries(extra).map(([k, [v]]) => [k, v])),\n ]);\n options.set(key, [\n options.get(key),\n Object.fromEntries(Object.entries(extra).map(([k, [, o]]) => [k, o])),\n ]);\n }\n }\n const result: Dictionary = Object.fromEntries(\n [...values].map(([key, value]) => [key ?? \"DEFAULT\", value]),\n );\n const resultOptions = Object.fromEntries(\n [...options].map(([key, value]) => [key ?? \"DEFAULT\", value]),\n );\n if (path.at(-1) === \"DEFAULT\") {\n return [result.DEFAULT ?? null, resultOptions.DEFAULT ?? 0];\n }\n if (path.length > 1 && \"DEFAULT\" in result && Object.keys(result).length === 1) {\n return [result.DEFAULT, resultOptions.DEFAULT ?? 0];\n }\n result.__CSS_VALUES__ = resultOptions;\n return [result, resultOptions];\n }\n}\n","import type { NativeLegacyThemeKey, NativeThemeToken } from \"@stillwind/native\";\nimport type { PluginAPI, PluginWithConfig } from \"tailwindcss/plugin\";\n\nimport type { TailwindPlugin } from \"../host.ts\";\nimport {\n member,\n probeCss,\n resolveUtility,\n resolveVariant,\n variantBody,\n type DynamicUtility,\n type DynamicVariant,\n type VariantCallback,\n type VariantOptions,\n} from \"./candidates.ts\";\nimport { configurePlugin, darkModeVariant, resolveConfig } from \"./configuration.ts\";\nimport { containerUtility } from \"./container.ts\";\nimport { cssString, identifier, selectorRules, serializeCss, utilityRules } from \"./css.ts\";\nimport { segment } from \"./segment.ts\";\nimport { PluginTheme, toKeyPath } from \"./theme.ts\";\n\n/** A static registration and the `@plugin` statement that registered it. */\ninterface Owned {\n /** Index of the `@plugin` statement whose handler registered the CSS. */\n owner: number;\n /** Registered utility or variant name, without escapes, when the CSS registers one. */\n name?: string;\n /** Stillwind CSS of the registration. */\n css: string;\n}\n\n/**\n * Executes Tailwind API handlers once and resolves their registered callbacks on demand.\n *\n * All handlers share one resolved config and theme, as in Tailwind. Each registration keeps the\n * index of the `@plugin` statement that registered it, so the CSS of each statement stays at its\n * own position in the stylesheet. The project's configuration and the settings that apply to\n * every statement belong to an extra owner, whose CSS {@link TailwindRuntime.settingsCss}\n * returns.\n */\nexport class TailwindRuntime {\n /** `addUtilities()` and `addComponents()` registrations, as `@utility` rules. */\n readonly #utilities: Owned[] = [];\n\n /** `addVariant()` registrations by name, as `@custom-variant` rules. */\n readonly #variants = new Map<string, Owned>();\n\n /** Base styles, keyframes, and `@property` rules. */\n readonly #globals: Owned[] = [];\n\n readonly #dynamicUtilities: DynamicUtility[] = [];\n\n readonly #dynamicVariants: DynamicVariant[] = [];\n\n /** Requests already resolved, including ones that no registration accepted. */\n readonly #requests = new Set<string>();\n\n /** Theme shared by every handler. */\n readonly #theme: PluginTheme;\n\n /** Owner whose handler is running, recorded with each registration. */\n #owner = 0;\n\n /**\n * Number of `@plugin` statements. It is also the owner index of the project's configuration\n * and of the settings for every statement.\n */\n readonly #owners: number;\n\n /**\n * `@stillwind-plugin-important` statement for the merged `important` setting, or an empty\n * string when the setting is neither `true` nor a selector.\n */\n readonly #important: string;\n\n /**\n * @param plugins - Configured handlers, one for each `@plugin` statement, in stylesheet order.\n * @param tokens - Active CSS theme tokens, which the handlers' `theme()` calls read.\n * @param legacyKeys - The namespaces that v3 config keys read, from the design system.\n * @param project - Project's Tailwind configuration. Its keys replace the same keys of every\n * plugin configuration, as the keys of a Tailwind `@config` file do. Its plugins register in\n * {@link TailwindRuntime.settingsCss}.\n */\n constructor(\n plugins: readonly PluginWithConfig[],\n tokens: readonly NativeThemeToken[],\n legacyKeys: readonly NativeLegacyThemeKey[],\n project?: PluginWithConfig[\"config\"],\n ) {\n const entries: [PluginWithConfig, number][] = [];\n const configs: Record<string, unknown>[] = [];\n /**\n * Collects a plugin's presets, config, and nested plugins before the plugin itself.\n * @param plugin - Configured plugin.\n * @param owner - Statement whose output receives the plugin's registrations.\n */\n const visit = (plugin: PluginWithConfig, owner: number) => {\n for (const preset of plugin.config?.presets ?? []) {\n visit(\n {\n handler: () => {},\n config: preset,\n },\n owner,\n );\n }\n configs.push((plugin.config ?? {}) as Record<string, unknown>);\n for (const nested of plugin.config?.plugins ?? []) {\n visit(configurePlugin(nested as TailwindPlugin, []), owner);\n }\n entries.push([plugin, owner]);\n };\n for (const [owner, plugin] of plugins.entries()) {\n visit(plugin, owner);\n }\n this.#owners = plugins.length;\n if (project) {\n visit(\n {\n handler: () => {},\n config: project,\n },\n this.#owners,\n );\n }\n this.#theme = new PluginTheme(configs, tokens, legacyKeys);\n const config = resolveConfig(configs);\n const addUtilities: PluginAPI[\"addUtilities\"] = (css) =>\n utilityRules(\n css,\n (name, body) =>\n this.#utilities.push({\n owner: this.#owner,\n name,\n css: `@utility ${identifier(name)}{${body}}`,\n }),\n (body) =>\n this.#globals.push({\n owner: this.#owner,\n css: body,\n }),\n );\n const matchUtilities: PluginAPI[\"matchUtilities\"] = (utilities, options = {}) => {\n for (const [name, callback] of Object.entries(utilities)) {\n this.#dynamicUtilities.push({\n owner: this.#owner,\n name,\n callback,\n options,\n markerSource: probeCss(options.values, (value) =>\n selectorRules(\n (\n callback as (\n value: unknown,\n extra: {\n modifier: string | null;\n },\n ) => unknown\n )(value, {\n modifier: null,\n }),\n ),\n ),\n results: new Map(),\n });\n }\n };\n const api: PluginAPI = {\n addBase: (css) => {\n this.#globals.push({\n owner: this.#owner,\n css: `@layer base{${serializeCss(css)}}`,\n });\n },\n addUtilities,\n addComponents: addUtilities,\n matchUtilities,\n matchComponents: matchUtilities,\n addVariant: (name, value) => {\n const body = variantBody(value);\n // Tailwind v4 drops the v3 `:merge()` form, which these plugins also provide.\n if (!body.includes(\":merge(\")) {\n // A later registration replaces an earlier one and keeps its position, as in Tailwind.\n const previous = this.#variants.get(name);\n this.#variants.set(name, {\n owner: previous?.owner ?? this.#owner,\n css: `@custom-variant ${identifier(name)}{${body}}`,\n });\n }\n },\n matchVariant: (name, callback, options = {}) => {\n try {\n if (\n String(\n callback(\"a\", {\n modifier: null,\n }),\n ).includes(\":merge(\")\n ) {\n return;\n }\n } catch {}\n this.#dynamicVariants.push({\n owner: this.#owner,\n name,\n callback: callback as VariantCallback,\n options: options as VariantOptions,\n markerSource: probeCss((options as VariantOptions).values, (value) => [\n variantBody(\n (callback as VariantCallback)(value, {\n modifier: null,\n }),\n ),\n ]),\n results: new Map(),\n });\n },\n theme: this.#theme.get,\n config: (path, fallback) => {\n if (!path) {\n return {\n ...config,\n theme: this.#theme.get(),\n };\n }\n // Tailwind reads a config path with `toKeyPath()`, so `theme[colors][brand]` and\n // `theme.colors.brand` name the same value.\n const [key, ...keys] = toKeyPath(path);\n if (key === \"theme\") {\n return keys.length\n ? this.#theme.get(keys.map((entry) => `[${entry}]`).join(\"\"), fallback)\n : this.#theme.get();\n }\n return (\n [key, ...keys].reduce<unknown>(\n (value, entry) =>\n value && typeof value === \"object\"\n ? (value as Record<string, unknown>)[entry]\n : undefined,\n config,\n ) ?? fallback\n );\n },\n prefix: (className) => className,\n };\n for (const [plugin, owner] of entries) {\n this.#owner = owner;\n plugin.handler(api);\n }\n // Tailwind defines the `darkMode` variant after running the handlers, so it replaces a\n // plugin's `dark` variant. A stylesheet's `@custom-variant dark` still replaces it, because\n // the native loader gives plugin variants lower precedence.\n const dark = darkModeVariant(config.darkMode);\n if (dark) {\n this.#owner = this.#owners;\n api.addVariant(\"dark\", dark);\n }\n // `config.prefix` is not applied: Stillwind generates unique class names, so it does not\n // prefix candidates.\n const { important } = config;\n this.#important =\n important === true\n ? \"@stillwind-plugin-important;\"\n : typeof important === \"string\" && important.trim()\n ? `@stillwind-plugin-important ${important.trim()};`\n : \"\";\n const screens = this.#theme.get(\"screens\");\n const container = containerUtility(\n this.#theme.get(\"container\"),\n Object.fromEntries(\n Object.entries(screens && typeof screens === \"object\" ? screens : {}).filter(\n (entry): entry is [string, string] =>\n entry[0] !== \"__CSS_VALUES__\" && typeof entry[1] === \"string\",\n ),\n ),\n );\n if (container) {\n this.#utilities.push({\n owner: this.#owners,\n name: \"container\",\n css: `@utility container{${container}}`,\n });\n }\n }\n\n /**\n * Reports whether a compiler discovery request belongs to one of this runtime's callbacks.\n *\n * @param candidate - Utility key, or variant name with an `@variant ` prefix.\n * @returns Whether a `matchUtilities()` or `matchVariant()` root matches it.\n */\n accepts(candidate: string): boolean {\n if (candidate.startsWith(\"@variant \")) {\n return this.#dynamicVariants.some(({ name }) => member(candidate.slice(9), name));\n }\n const value = candidate.replace(/^-/, \"\");\n return this.#dynamicUtilities.some(({ name }) => member(value, name));\n }\n\n /**\n * Runs the callbacks for requests that this runtime has not seen.\n *\n * @param candidates - Utility keys, and variant names with an `@variant ` prefix.\n * @returns Whether the generated CSS of any statement changed.\n * @throws If a callback fails.\n */\n resolve(candidates: readonly string[]): boolean {\n const before = this.#all();\n for (const candidate of candidates) {\n if (this.#requests.has(candidate)) {\n continue;\n }\n this.#requests.add(candidate);\n if (candidate.startsWith(\"@variant \")) {\n for (const registration of this.#dynamicVariants) {\n const variant = resolveVariant(candidate.slice(9), registration);\n if (variant) {\n registration.results.set(variant.name, {\n ...variant,\n body: variantBody(\n registration.callback(variant.value, {\n modifier: variant.modifier,\n }),\n ),\n });\n }\n }\n } else {\n for (const registration of this.#dynamicUtilities) {\n registration.results.set(candidate, resolveUtility(candidate, registration));\n }\n }\n }\n return before !== this.#all();\n }\n\n /**\n * Lists finite utility and variant suggestions without executing dynamic callbacks.\n *\n * @returns Static utility names, the named values of dynamic utilities with their modifiers and\n * negative forms, and variant names with a trailing `:`.\n */\n catalog(): string[] {\n const result = [\n ...new Set(this.#utilities.map(({ name }) => name!)),\n ...[...this.#variants.keys()].map((name) => `${name}:`),\n ];\n for (const { name, options } of this.#dynamicUtilities) {\n const keys = Object.keys(options.values ?? {}).filter((key) => !key.startsWith(\"__\"));\n const modifiers =\n options.modifiers && options.modifiers !== \"any\" ? Object.keys(options.modifiers) : [];\n for (const key of keys) {\n const candidate = key === \"DEFAULT\" ? name : `${name}-${key}`;\n result.push(candidate, ...modifiers.map((modifier) => `${candidate}/${modifier}`));\n if (options.supportsNegativeValues) {\n result.push(`-${candidate}`);\n }\n }\n }\n for (const { name, options } of this.#dynamicVariants) {\n for (const key of Object.keys(options.values ?? {})) {\n result.push(`${key === \"DEFAULT\" ? name : `${name}-${key}`}:`);\n }\n }\n return result;\n }\n\n /**\n * Serializes every statement, for change detection.\n *\n * @returns The CSS of all statements in order.\n */\n #all(): string {\n return Array.from({ length: this.#owners }, (_, owner) => this.css(owner)).join(\"\\n\");\n }\n\n /**\n * Serializes the registrations of one `@plugin` statement in handler order, including sorted\n * dynamic variants.\n *\n * A static utility becomes an ordinary `@utility`. A callback result for one candidate becomes\n * a `(functional)` `@utility`, so it adds to the built-in and stylesheet definitions of its\n * root, as Tailwind evaluates every definition of a name. A registration whose types include\n * `any` and another type is a Tailwind fallback, and a callback that rejects an arbitrary value\n * with an invalid modifier stops the evaluation of later definitions.\n *\n * @param owner - Index of the statement among the configured handlers, or the number of\n * statements for the settings that {@link TailwindRuntime.settingsCss} describes.\n * @returns Stillwind CSS for the statement's position.\n */\n css(owner: number): string {\n const output =\n owner === this.#owners ? [this.#theme.css(), this.#important].filter(Boolean) : [];\n output.push(\n ...[...this.#globals, ...this.#utilities]\n .filter((entry) => entry.owner === owner)\n .map(({ css }) => css),\n );\n for (const variant of this.#variants.values()) {\n if (variant.owner === owner) {\n output.push(variant.css);\n }\n }\n for (const registration of this.#dynamicUtilities) {\n if (registration.owner !== owner) {\n continue;\n }\n output.push(\n `@stillwind-plugin-family utility ${registration.name};`,\n ...(registration.markerSource\n ? [`@stillwind-marker-source ${cssString(registration.markerSource)};`]\n : []),\n );\n const types = Array.isArray(registration.options.type)\n ? registration.options.type\n : [registration.options.type ?? \"any\"];\n const role =\n types.length > 1 && types.includes(\"any\") ? \"functional, fallback\" : \"functional\";\n for (const [request, body] of registration.results) {\n if (body === null) {\n output.push(`@utility ${identifier(request)} (functional, stop){}`);\n }\n for (const target of body ?? []) {\n output.push(`@utility ${identifier(request)} (${role}){${target}}`);\n }\n }\n }\n for (const registration of this.#dynamicVariants) {\n if (registration.owner !== owner) {\n continue;\n }\n output.push(\n `@stillwind-plugin-family variant ${registration.name};`,\n ...(registration.markerSource\n ? [`@stillwind-marker-source ${cssString(registration.markerSource)};`]\n : []),\n );\n const candidates = [...registration.results.values()];\n candidates.sort((a, b) => {\n if (registration.options.sort) {\n return registration.options.sort(a, b);\n }\n const keys = Object.keys(registration.options.values ?? {});\n /**\n * Positions a variant by its value's key in `values`.\n * @param candidate - Generated variant.\n * @returns The key's index, or the number of keys for an arbitrary value.\n */\n const order = (candidate: typeof a) => {\n const [stem] = segment(candidate.name, \"/\");\n const key =\n stem === registration.name ? \"DEFAULT\" : stem.slice(registration.name.length + 1);\n const index = keys.indexOf(key);\n return index < 0 ? keys.length : index;\n };\n return order(a) - order(b) || (String(a.value) < String(b.value) ? -1 : 1);\n });\n for (const candidate of candidates) {\n output.push(`@custom-variant ${identifier(candidate.name)}{${candidate.body}}`);\n }\n }\n return output.join(\"\\n\");\n }\n\n /**\n * Serializes the settings that apply to every statement, followed by the registrations of the\n * project's configuration, in the form that {@link TailwindRuntime.css} describes.\n *\n * The settings are the merged theme configuration as a `@stillwind-plugin-theme` block, which\n * native utility resolution also reads, the `important` setting, the `dark` variant of the\n * `darkMode` setting, and the `container` utility of `theme.container`.\n *\n * @returns Stillwind CSS for the request that follows the root stylesheet.\n */\n settingsCss(): string {\n return this.css(this.#owners);\n }\n}\n"],"mappings":";;;;AAOA,MAAM,+BAAe,IAAI,IAAI;CAE3B;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,cAAc;AAEpB,SAAS,QAAQ,OAAwB;CACvC,OAAO,MAAM,WAAW,GAAG,KAAK,YAAY,KAAK,KAAK,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AAO;CAC9B;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stillwind/host",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Host services shared by Stillwind's build integrations and analysis tools",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"stillwind"
|
|
@@ -48,9 +48,9 @@
|
|
|
48
48
|
"@jridgewell/gen-mapping": "^0.3.13",
|
|
49
49
|
"@jridgewell/remapping": "^2.3.5",
|
|
50
50
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
51
|
-
"@stillwind/config": "0.
|
|
52
|
-
"@stillwind/native": "0.
|
|
53
|
-
"@stillwind/projection": "0.
|
|
51
|
+
"@stillwind/config": "0.13.0",
|
|
52
|
+
"@stillwind/native": "0.13.0",
|
|
53
|
+
"@stillwind/projection": "0.13.0",
|
|
54
54
|
"minimatch": "^11.0.5",
|
|
55
55
|
"oxc-resolver": "^11.24.2",
|
|
56
56
|
"pathe": "^2.0.3",
|
|
@@ -64,11 +64,11 @@
|
|
|
64
64
|
"@stillwind-internal/tools-workspace": "0.0.0",
|
|
65
65
|
"@types/node": "^26.6.6",
|
|
66
66
|
"@vue/compiler-sfc": "^3.5.45",
|
|
67
|
-
"stillwind": "0.
|
|
67
|
+
"stillwind": "0.13.0",
|
|
68
68
|
"svelte": "^5.57.3",
|
|
69
69
|
"tailwindcss": "4.3.5",
|
|
70
70
|
"typescript": "^6.0.3",
|
|
71
|
-
"vite-plus": "1.
|
|
71
|
+
"vite-plus": "1.8.0",
|
|
72
72
|
"vue-language-core-3-0-2": "npm:@vue/language-core@3.0.2",
|
|
73
73
|
"vue-language-core-3-0-6": "npm:@vue/language-core@3.0.6",
|
|
74
74
|
"vue-language-core-3-1-0": "npm:@vue/language-core@3.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configuration-MQZe6ufN.js","names":[],"sources":["../src/css/plugins/tailwind/css.ts","../src/css/plugins/tailwind/configuration.ts"],"sourcesContent":["import type { NativePluginOption } from \"@stillwind/native\";\n\n/**\n * Serializes a plugin CSS object, as plugins pass it to Tailwind's API, while preserving\n * repeated declarations and nested rules.\n *\n * @param input - CSS-in-JS object or array of them. An array value of a property repeats the\n * declaration, camel-case property names become kebab-case, and null, undefined, and false\n * values are skipped. `@slot` keys and values become `@slot` statements.\n * @returns CSS declarations and rules without surrounding braces, or an empty string for input\n * that is not an object.\n */\nexport function serializeCss(input: unknown): string {\n if (Array.isArray(input)) {\n return input.map(serializeCss).join(\"\\n\");\n }\n if (!input || typeof input !== \"object\") {\n return \"\";\n }\n let output = \"\";\n for (const [key, value] of Object.entries(input)) {\n if (value === null || value === undefined || value === false) {\n continue;\n }\n if (key === \"@slot\") {\n output += \"@slot;\";\n continue;\n }\n if (!key.startsWith(\"--\") && value === \"@slot\") {\n output += `${key}{@slot;}`;\n continue;\n }\n if (statement(key, value)) {\n output += `${key};`;\n continue;\n }\n const values = Array.isArray(value) ? value : [value];\n for (const entry of values) {\n if (entry && typeof entry === \"object\") {\n output += `${key}{${serializeCss(entry)}}`;\n } else if (entry !== null && entry !== undefined && entry !== false) {\n const property = key.startsWith(\"--\")\n ? key\n : key.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`).replace(/^ms-/, \"-ms-\");\n output += `${property}:${String(entry)};`;\n }\n }\n }\n return output;\n}\n\n/**\n * Whether an entry is an at-rule without a block, such as `{ \"@apply p-4\": {} }`, which\n * Tailwind serializes as the statement `@apply p-4;`.\n *\n * @param key - Entry key.\n * @param value - Entry value.\n * @returns Whether the key is an at-rule and the value an empty object.\n */\nfunction statement(key: string, value: unknown): boolean {\n return (\n key.startsWith(\"@\") &&\n typeof value === \"object\" &&\n value !== null &&\n !Array.isArray(value) &&\n Object.keys(value).length === 0\n );\n}\n\n/**\n * Escapes a complete candidate as one CSS identifier, including arbitrary-value punctuation.\n *\n * @param value - Candidate or variant name, such as `-probe-[3px]/mirror`.\n * @returns An identifier whose CSS escapes decode to `value`. A leading digit becomes a\n * six-digit hexadecimal escape.\n */\nexport function identifier(value: string): string {\n return Array.from(value)\n .map((character, index) => {\n if (/[_a-zA-Z\\u0080-\\uffff-]/u.test(character) || (index > 0 && /\\d/.test(character))) {\n return character;\n }\n if (/\\d/.test(character)) {\n return `\\\\${character.codePointAt(0)!.toString(16).padStart(6, \"0\")}`;\n }\n return `\\\\${character}`;\n })\n .join(\"\");\n}\n\n/**\n * Applies an alpha value to a color as Tailwind's `withAlpha()` does.\n *\n * Every plain number is multiplied by 100, so `0.5` means 50% and `50` means 5000%, which\n * `color-mix()` rejects. Tailwind applies this to the `/50` of `theme(\"colors.red.500 / 50\")`,\n * while a `/50` color modifier of a utility arrives here already as `50%`.\n *\n * @param value - CSS color.\n * @param alpha - Number, percentage, or other CSS value such as `var(--opacity)`.\n * @returns The color itself for `100%`, and a `color-mix()` toward transparent otherwise.\n */\nexport function withAlpha(value: string, alpha: string): string {\n const number = Number(alpha);\n const percentage = Number.isNaN(number) ? alpha : `${number * 100}%`;\n return percentage === \"100%\" ? value : `color-mix(in oklab, ${value} ${percentage}, transparent)`;\n}\n\n/** Class names that Tailwind's `addUtilities()` registers. */\nconst IS_VALID_UTILITY_NAME = /^[a-z@][a-zA-Z0-9/%._-]*$/;\n\n/**\n * Finds the classes that a plugin selector registers, as Tailwind's `addUtilities()` does: every\n * class outside attribute selectors and outside the arguments of `:not()`, `:nth-child()`, and\n * `:nth-last-child()`, whose classes are conditions rather than utilities. `.outer .inner`\n * registers both `outer` and `inner`.\n *\n * @param selector - One complex selector without top-level commas.\n * @returns The decoded class names with the range of each `.name`, in source order.\n */\nfunction utilityClasses(selector: string): { name: string; start: number; end: number }[] {\n const classes: {\n name: string;\n start: number;\n end: number;\n }[] = [];\n const parentheses: boolean[] = [];\n let excluded = 0;\n let attribute = 0;\n let quote = \"\";\n for (let index = 0; index < selector.length; index++) {\n const char = selector[index];\n if (char === \"\\\\\") {\n index++;\n } else if (quote) {\n quote = char === quote ? \"\" : quote;\n } else if (char === '\"' || char === \"'\") {\n quote = char;\n } else if (char === \"[\") {\n attribute++;\n } else if (char === \"]\") {\n attribute--;\n } else if (char === \"(\") {\n const condition = /:(?:not|nth-child|nth-last-child)$/i.test(selector.slice(0, index));\n parentheses.push(condition);\n excluded += condition ? 1 : 0;\n } else if (char === \")\") {\n excluded -= parentheses.pop() ? 1 : 0;\n } else if (char === \".\" && !excluded && !attribute) {\n const { name, end } = readIdentifier(selector, index + 1);\n if (IS_VALID_UTILITY_NAME.test(name)) {\n classes.push({\n name,\n start: index,\n end,\n });\n }\n index = end - 1;\n }\n }\n return classes;\n}\n\n/**\n * Reads a CSS identifier and decodes its escapes.\n *\n * @param text - Text that contains the identifier.\n * @param start - Index of the first character of the identifier.\n * @returns The decoded name, empty when no identifier starts at `start`, and the index after it.\n */\nfunction readIdentifier(text: string, start: number): { name: string; end: number } {\n let end = start;\n let name = \"\";\n while (end < text.length) {\n const next = text[end];\n if (next === \"\\\\\") {\n const hex = /^[0-9a-f]{1,6}\\s?/i.exec(text.slice(end + 1));\n name += hex ? String.fromCodePoint(Number.parseInt(hex[0], 16)) : text[end + 1];\n end += 1 + (hex ? hex[0].length : 1);\n } else if (/[\\w\\u0080--]/u.test(next)) {\n name += next;\n end++;\n } else {\n break;\n }\n }\n return {\n name,\n end,\n };\n}\n\n/**\n * Serializes text as a CSS string.\n *\n * @param value - Text, such as generated CSS.\n * @returns A double-quoted CSS string whose escapes decode to `value`.\n */\nexport function cssString(value: string): string {\n return `\"${value\n .replace(/[\"\\\\]/g, \"\\\\$&\")\n .replace(/[\\n\\r\\f]/g, (character) => `\\\\${character.codePointAt(0)!.toString(16)} `)}\"`;\n}\n\n/**\n * Replaces every `&` outside strings and attribute selectors.\n *\n * @param selector - Selector that may contain `&`.\n * @param parent - Replacement for `&`.\n * @returns The selector with the parent substituted, or undefined when it has no `&`.\n */\nfunction substituteNesting(selector: string, parent: string): string | undefined {\n let output = \"\";\n let nested = false;\n let attribute = 0;\n let quote = \"\";\n for (let index = 0; index < selector.length; index++) {\n const char = selector[index];\n if (char === \"\\\\\") {\n output += selector.slice(index, index + 2);\n index++;\n continue;\n }\n if (quote) {\n quote = char === quote ? \"\" : quote;\n } else if (char === '\"' || char === \"'\") {\n quote = char;\n } else if (char === \"[\") {\n attribute++;\n } else if (char === \"]\") {\n attribute--;\n } else if (char === \"&\" && !attribute) {\n output += parent;\n nested = true;\n continue;\n }\n output += char;\n }\n return nested ? output : undefined;\n}\n\n/**\n * Converts the rules that `addUtilities()` receives into utility bodies. At-rules retain their\n * enclosing conditions.\n *\n * @param input - CSS-in-JS object keyed by selectors and at-rules, or an array of them.\n * @param register - Receives the anchor class of a selector and one body for it, once for each\n * selector of the body.\n * @param global - Receives top-level `@keyframes` and `@property` rules, which apply whether or\n * not a utility is used. The compiler emits such rules nested in a utility body only with that\n * utility.\n * @param wrappers - Enclosing at-rule preludes, outermost first.\n * @throws If a selector has no class outside `:not()` and attribute selectors, or if an\n * `@scope` rule encloses a selector.\n */\nexport function utilityRules(\n input: unknown,\n register: (name: string, body: string) => void,\n global: (css: string) => void,\n wrappers: string[] = [],\n): void {\n if (Array.isArray(input)) {\n for (const entry of input) {\n utilityRules(entry, register, global, wrappers);\n }\n return;\n }\n if (!input || typeof input !== \"object\") {\n return;\n }\n /**\n * Wraps CSS in the enclosing at-rules.\n * @param body - CSS inside the innermost at-rule.\n * @returns The wrapped CSS.\n */\n const wrap = (body: string) => wrappers.reduceRight((css, rule) => `${rule}{${css}}`, body);\n for (const [selector, body] of Object.entries(input)) {\n if (selector.startsWith(\"@keyframes \") || selector.startsWith(\"@property \")) {\n global(wrap(`${selector}{${serializeCss(body)}}`));\n } else if (scopeRule(selector)) {\n // A utility body is nested in its class rule, and nesting changes `@scope` there:\n // `.item{@scope (.theme){color:red}}` colors `.theme` elements inside `.item`, while\n // `@scope (.theme){.item{color:red}}` colors `.item` elements inside `.theme`.\n throw new Error(\n `Tailwind plugin utility selectors cannot be nested in @scope outside a selector: ${selector}`,\n );\n } else if (selector.startsWith(\"@\")) {\n utilityRules(body, register, global, [...wrappers, selector]);\n } else {\n for (const branch of splitTopLevel(selector, \",\").map((part) => part.trim())) {\n const classes = utilityClasses(branch);\n if (!classes.length) {\n throw new Error(`Tailwind plugin utility requires a class selector: ${selector}`);\n }\n // Each class becomes `&` in its own registration and stays literal in the others.\n for (const anchor of classes) {\n const relative = `${branch.slice(0, anchor.start)}&${branch.slice(anchor.end)}`;\n for (const css of utilityBodies(body, relative, wrappers)) {\n register(anchor.name, css);\n }\n }\n }\n }\n }\n}\n\n/**\n * Whether a CSS-in-JS key is an `@scope` rule.\n *\n * @param key - Entry key.\n * @returns Whether the key is `@scope` with or without a prelude.\n */\nfunction scopeRule(key: string): boolean {\n return /^@scope(?![\\w-])/.test(key);\n}\n\n/**\n * Lists the selectors of the nested rules in CSS-in-JS input, each as an empty rule, so that\n * the compiler can collect the classes that they name without the declarations.\n *\n * @param input - CSS-in-JS body, or an array of them.\n * @returns Each selector key as written followed by `{}`, in source order. Selectors inside\n * conditional at-rules are included, and `@keyframes` and `@property` rules are skipped.\n */\nexport function selectorRules(input: unknown): string[] {\n if (Array.isArray(input)) {\n return input.flatMap(selectorRules);\n }\n if (!input || typeof input !== \"object\") {\n return [];\n }\n const rules: string[] = [];\n for (const [key, value] of Object.entries(input)) {\n // An array of strings is a declaration with fallback values, as in `utilityBodies`.\n if (\n !value ||\n typeof value !== \"object\" ||\n statement(key, value) ||\n (Array.isArray(value) && !value.some((entry) => entry && typeof entry === \"object\")) ||\n key.startsWith(\"@keyframes \") ||\n key.startsWith(\"@property \")\n ) {\n continue;\n }\n if (!key.startsWith(\"@\")) {\n rules.push(`${key}{}`);\n }\n rules.push(...selectorRules(value));\n }\n return rules;\n}\n\n/**\n * Flattens nested selector rules into utility bodies with one selector block each, which the\n * compiler composes as independent targets.\n *\n * @param input - CSS-in-JS body, or an array of them.\n * @param selector - Selector of the body relative to the utility class, `&` for the class itself.\n * @param conditions - Enclosing at-rule preludes, outermost first.\n * @returns Bodies in source order. Each one is either declarations, possibly inside\n * conditions, for `&`, one rule for another selector, one `@scope` rule with its nested rules\n * for `&` or another selector, or one `@keyframes` or `@property` rule inside its conditions.\n */\nexport function utilityBodies(input: unknown, selector = \"&\", conditions: string[] = []): string[] {\n if (Array.isArray(input)) {\n return input.flatMap((entry) => utilityBodies(entry, selector, conditions));\n }\n if (!input || typeof input !== \"object\") {\n return [];\n }\n const result: string[] = [];\n let declarations: Record<string, unknown> = {};\n /**\n * Adds CSS as one body for the current selector inside the current conditions.\n *\n * @param css - Declarations or rules for the current selector.\n */\n const place = (css: string) => {\n const body = conditions.reduceRight((body, condition) => `${condition}{${body}}`, css);\n result.push(selector === \"&\" ? body : `${selector}{${body}}`);\n };\n /** Adds the declarations collected so far as one body and starts a new collection. */\n const flush = () => {\n const css = serializeCss(declarations);\n if (css) {\n place(css);\n }\n declarations = {};\n };\n for (const [key, value] of Object.entries(input)) {\n if (\n value &&\n typeof value === \"object\" &&\n !statement(key, value) &&\n (!Array.isArray(value) || value.some((entry) => entry && typeof entry === \"object\"))\n ) {\n flush();\n if (key.startsWith(\"@keyframes \") || key.startsWith(\"@property \")) {\n result.push(\n conditions.reduceRight(\n (body, condition) => `${condition}{${body}}`,\n `${key}{${serializeCss(value)}}`,\n ),\n );\n } else if (scopeRule(key)) {\n // Nested rules stay inside `@scope`, because `:scope` in a selector means the scoping\n // root only there. Moved out, `:where(:scope > :first-child)` from `@scope (&)` becomes\n // the prelude `& :where(:scope > :first-child)`, where `:scope` matches `:root`.\n place(`${key}{${serializeCss(value)}}`);\n } else if (key.startsWith(\"@\")) {\n result.push(...utilityBodies(value, selector, [...conditions, key]));\n } else {\n // Each target keeps one selector, because a utility body holds one selector block.\n for (const parent of splitTopLevel(selector, \",\").map((part) => part.trim())) {\n for (const child of splitTopLevel(key, \",\").map((part) => part.trim())) {\n result.push(\n ...utilityBodies(\n value,\n substituteNesting(child, parent) ?? `${parent} ${child}`,\n conditions,\n ),\n );\n }\n }\n }\n } else {\n declarations[key] = value;\n }\n }\n flush();\n return result;\n}\n\n/**\n * Splits text at a delimiter outside CSS strings, brackets, and function calls.\n *\n * @param value - Text to split. Escaped characters never delimit.\n * @param delimiter - One character, such as `,` or `/`.\n * @returns The parts without trimming, including empty ones. Text without the delimiter is one\n * part.\n */\nexport function splitTopLevel(value: string, delimiter: string): string[] {\n const parts: string[] = [];\n let start = 0;\n let depth = 0;\n let quote = \"\";\n for (let index = 0; index < value.length; index++) {\n const char = value[index];\n if (char === \"\\\\\") {\n index++;\n continue;\n }\n if (quote) {\n if (char === quote) {\n quote = \"\";\n }\n continue;\n }\n if (char === '\"' || char === \"'\") {\n quote = char;\n continue;\n }\n if (char === \"[\" || char === \"(\") {\n depth++;\n } else if (char === \"]\" || char === \")\") {\n depth--;\n } else if (depth === 0 && char === delimiter) {\n parts.push(value.slice(start, index));\n start = index + 1;\n }\n }\n parts.push(value.slice(start));\n return parts;\n}\n\n/**\n * Converts the declarations of a Tailwind `@plugin` options block into the values that\n * `plugin.withOptions()` factories receive.\n *\n * @param options - Declarations in authored order, such as `prefix` with the value `\"x\"`.\n * @returns Options by name, converted as Tailwind converts them. A later declaration of a\n * name replaces an earlier one. `true`, `false`, `null`, and numeric text become those values.\n * A quoted string loses its quotes and keeps its backslashes. Other text stays a string, and a\n * comma-separated list becomes an array.\n */\nexport function pluginOptions(options: readonly NativePluginOption[]): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const { name, value: text } of options) {\n const entries = splitTopLevel(text, \",\").map((part) => {\n const value = part.trim();\n if (value === \"true\") {\n return true;\n }\n if (value === \"false\") {\n return false;\n }\n if (value === \"null\") {\n return null;\n }\n if (!Number.isNaN(Number(value))) {\n return Number(value);\n }\n return (value.startsWith('\"') && value.endsWith('\"')) ||\n (value.startsWith(\"'\") && value.endsWith(\"'\"))\n ? value.slice(1, -1)\n : value;\n });\n result[name] = entries.length === 1 ? entries[0] : entries;\n }\n return result;\n}\n","import type { NativePluginOption } from \"@stillwind/native\";\nimport type { PluginCreator, PluginWithConfig } from \"tailwindcss/plugin\";\n\nimport type { TailwindPlugin } from \"../host.ts\";\nimport { pluginOptions } from \"./css.ts\";\n\n/**\n * Normalizes a Tailwind plugin export to `{ handler, config }` and applies the options of its\n * `@plugin` statement.\n *\n * @param plugin - Handler, `{ handler, config }`, or factory from `plugin.withOptions()`.\n * @param options - Declarations of the statement's options block, empty without a block.\n * @returns The factory's result for converted `options`, or the plugin in object form.\n * @throws If a handler that is not a factory receives options, or an option value is invalid.\n */\nexport function configurePlugin(\n plugin: TailwindPlugin,\n options: readonly NativePluginOption[],\n): PluginWithConfig {\n if (\n typeof plugin === \"function\" &&\n \"__isOptionsFunction\" in plugin &&\n plugin.__isOptionsFunction\n ) {\n return (plugin as unknown as (options: Record<string, unknown>) => PluginWithConfig)(\n pluginOptions(options),\n );\n }\n if (options.length) {\n throw new Error(\"This Tailwind plugin does not accept options\");\n }\n return typeof plugin === \"function\"\n ? {\n handler: plugin as PluginCreator,\n }\n : (plugin as PluginWithConfig);\n}\n\n/**\n * Builds the part of Tailwind's resolved config that `config()` reads besides `theme`.\n *\n * Like Tailwind, the result keeps only `darkMode`, `prefix`, `blocklist`, and `important` from\n * the configs, so `config(\"custom\")` returns the fallback. The last config that defines one of\n * these keys sets it, and a `null` value restores the default.\n *\n * @param configs - Plugin configs in registration order, presets first.\n * @returns The resolved keys with Tailwind's defaults for the others.\n */\nexport function resolveConfig(\n configs: readonly Record<string, unknown>[],\n): Record<string, unknown> {\n const defaults: Record<string, unknown> = {\n darkMode: null,\n prefix: \"\",\n blocklist: [],\n important: false,\n };\n const result: Record<string, unknown> = {\n ...defaults,\n future: {},\n experimental: {},\n plugins: [],\n content: {\n files: [],\n },\n };\n for (const config of configs) {\n for (const [key, fallback] of Object.entries(defaults)) {\n if (config[key] !== undefined) {\n result[key] = config[key] ?? fallback;\n }\n }\n }\n return result;\n}\n\n/**\n * Returns the `dark` variant that Tailwind's `darkMode` configuration key defines.\n *\n * @param setting - `\"media\"`, `\"selector\"`, `\"class\"`, or a tuple of one of these modes and a\n * selector, which defaults to `.dark`. `[\"variant\", selectors]` uses a selector or a list of\n * selectors, and each must contain `&`.\n * @returns The value for `addVariant()`, or undefined when the setting defines no variant,\n * including `null`, `false`, and the `variant` mode with a selector that Tailwind rejects.\n */\nexport function darkModeVariant(setting: unknown): string | string[] | undefined {\n const [mode, selector = \".dark\"] = Array.isArray(setting) ? setting : [setting];\n switch (mode) {\n case \"media\":\n return \"@media (prefers-color-scheme: dark)\";\n\n case \"selector\":\n return `&:where(${selector}, ${selector} *)`;\n\n case \"class\":\n return `&:is(${selector} *)`;\n\n case \"variant\": {\n const selectors: unknown[] = Array.isArray(selector) ? selector : [selector];\n // Tailwind warns and defines no variant for the default selector or a selector without `&`.\n return selectors.every(\n (entry): entry is string =>\n typeof entry === \"string\" && entry !== \".dark\" && entry.includes(\"&\"),\n )\n ? (selectors as string[])\n : undefined;\n }\n\n default:\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;AAYA,SAAgB,aAAa,OAAwB;CACnD,IAAI,MAAM,QAAQ,KAAK,GACrB,OAAO,MAAM,IAAI,YAAY,CAAC,CAAC,KAAK,IAAI;CAE1C,IAAI,CAAC,SAAS,OAAO,UAAU,UAC7B,OAAO;CAET,IAAI,SAAS;CACb,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,KAAK,GAAG;EAChD,IAAI,UAAU,QAAQ,UAAU,KAAA,KAAa,UAAU,OACrD;EAEF,IAAI,QAAQ,SAAS;GACnB,UAAU;GACV;EACF;EACA,IAAI,CAAC,IAAI,WAAW,IAAI,KAAK,UAAU,SAAS;GAC9C,UAAU,GAAG,IAAI;GACjB;EACF;EACA,IAAI,UAAU,KAAK,KAAK,GAAG;GACzB,UAAU,GAAG,IAAI;GACjB;EACF;EACA,MAAM,SAAS,MAAM,QAAQ,KAAK,IAAI,QAAQ,C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