initial commit
This commit is contained in:
11
node_modules/tailwindcss/lib/util/bigSign.js
generated
vendored
Normal file
11
node_modules/tailwindcss/lib/util/bigSign.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>bigSign
|
||||
});
|
||||
function bigSign(bigIntValue) {
|
||||
return (bigIntValue > 0n) - (bigIntValue < 0n);
|
||||
}
|
||||
25
node_modules/tailwindcss/lib/util/buildMediaQuery.js
generated
vendored
Normal file
25
node_modules/tailwindcss/lib/util/buildMediaQuery.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>buildMediaQuery
|
||||
});
|
||||
function buildMediaQuery(screens) {
|
||||
screens = Array.isArray(screens) ? screens : [
|
||||
screens
|
||||
];
|
||||
return screens.map((screen)=>{
|
||||
let values = screen.values.map((screen)=>{
|
||||
if (screen.raw !== undefined) {
|
||||
return screen.raw;
|
||||
}
|
||||
return [
|
||||
screen.min && `(min-width: ${screen.min})`,
|
||||
screen.max && `(max-width: ${screen.max})`
|
||||
].filter(Boolean).join(" and ");
|
||||
});
|
||||
return screen.not ? `not all and ${values}` : values;
|
||||
}).join(", ");
|
||||
}
|
||||
20
node_modules/tailwindcss/lib/util/cloneDeep.js
generated
vendored
Normal file
20
node_modules/tailwindcss/lib/util/cloneDeep.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "cloneDeep", {
|
||||
enumerable: true,
|
||||
get: ()=>cloneDeep
|
||||
});
|
||||
function cloneDeep(value) {
|
||||
if (Array.isArray(value)) {
|
||||
return value.map((child)=>cloneDeep(child));
|
||||
}
|
||||
if (typeof value === "object" && value !== null) {
|
||||
return Object.fromEntries(Object.entries(value).map(([k, v])=>[
|
||||
k,
|
||||
cloneDeep(v)
|
||||
]));
|
||||
}
|
||||
return value;
|
||||
}
|
||||
32
node_modules/tailwindcss/lib/util/cloneNodes.js
generated
vendored
Normal file
32
node_modules/tailwindcss/lib/util/cloneNodes.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>cloneNodes
|
||||
});
|
||||
function cloneNodes(nodes, source = undefined, raws = undefined) {
|
||||
return nodes.map((node)=>{
|
||||
var ref;
|
||||
let cloned = node.clone();
|
||||
// We always want override the source map
|
||||
// except when explicitly told not to
|
||||
let shouldOverwriteSource = ((ref = node.raws.tailwind) === null || ref === void 0 ? void 0 : ref.preserveSource) !== true || !cloned.source;
|
||||
if (source !== undefined && shouldOverwriteSource) {
|
||||
cloned.source = source;
|
||||
if ("walk" in cloned) {
|
||||
cloned.walk((child)=>{
|
||||
child.source = source;
|
||||
});
|
||||
}
|
||||
}
|
||||
if (raws !== undefined) {
|
||||
cloned.raws.tailwind = {
|
||||
...cloned.raws.tailwind,
|
||||
...raws
|
||||
};
|
||||
}
|
||||
return cloned;
|
||||
});
|
||||
}
|
||||
98
node_modules/tailwindcss/lib/util/color.js
generated
vendored
Normal file
98
node_modules/tailwindcss/lib/util/color.js
generated
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
parseColor: ()=>parseColor,
|
||||
formatColor: ()=>formatColor
|
||||
});
|
||||
const _colorName = /*#__PURE__*/ _interopRequireDefault(require("color-name"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
let HEX = /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;
|
||||
let SHORT_HEX = /^#([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
|
||||
let VALUE = /(?:\d+|\d*\.\d+)%?/;
|
||||
let SEP = /(?:\s*,\s*|\s+)/;
|
||||
let ALPHA_SEP = /\s*[,/]\s*/;
|
||||
let CUSTOM_PROPERTY = /var\(--(?:[^ )]*?)\)/;
|
||||
let RGB = new RegExp(`^(rgb)a?\\(\\s*(${VALUE.source}|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`);
|
||||
let HSL = new RegExp(`^(hsl)a?\\(\\s*((?:${VALUE.source})(?:deg|rad|grad|turn)?|${CUSTOM_PROPERTY.source})(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?(?:${ALPHA_SEP.source}(${VALUE.source}|${CUSTOM_PROPERTY.source}))?\\s*\\)$`);
|
||||
function parseColor(value, { loose =false } = {}) {
|
||||
var ref, ref1;
|
||||
if (typeof value !== "string") {
|
||||
return null;
|
||||
}
|
||||
value = value.trim();
|
||||
if (value === "transparent") {
|
||||
return {
|
||||
mode: "rgb",
|
||||
color: [
|
||||
"0",
|
||||
"0",
|
||||
"0"
|
||||
],
|
||||
alpha: "0"
|
||||
};
|
||||
}
|
||||
if (value in _colorName.default) {
|
||||
return {
|
||||
mode: "rgb",
|
||||
color: _colorName.default[value].map((v)=>v.toString())
|
||||
};
|
||||
}
|
||||
let hex = value.replace(SHORT_HEX, (_, r, g, b, a)=>[
|
||||
"#",
|
||||
r,
|
||||
r,
|
||||
g,
|
||||
g,
|
||||
b,
|
||||
b,
|
||||
a ? a + a : ""
|
||||
].join("")).match(HEX);
|
||||
if (hex !== null) {
|
||||
return {
|
||||
mode: "rgb",
|
||||
color: [
|
||||
parseInt(hex[1], 16),
|
||||
parseInt(hex[2], 16),
|
||||
parseInt(hex[3], 16)
|
||||
].map((v)=>v.toString()),
|
||||
alpha: hex[4] ? (parseInt(hex[4], 16) / 255).toString() : undefined
|
||||
};
|
||||
}
|
||||
var ref2;
|
||||
let match = (ref2 = value.match(RGB)) !== null && ref2 !== void 0 ? ref2 : value.match(HSL);
|
||||
if (match === null) {
|
||||
return null;
|
||||
}
|
||||
let color = [
|
||||
match[2],
|
||||
match[3],
|
||||
match[4]
|
||||
].filter(Boolean).map((v)=>v.toString());
|
||||
if (!loose && color.length !== 3) {
|
||||
return null;
|
||||
}
|
||||
if (color.length < 3 && !color.some((part)=>/^var\(.*?\)$/.test(part))) {
|
||||
return null;
|
||||
}
|
||||
return {
|
||||
mode: match[1],
|
||||
color,
|
||||
alpha: (ref = match[5]) === null || ref === void 0 ? void 0 : (ref1 = ref.toString) === null || ref1 === void 0 ? void 0 : ref1.call(ref)
|
||||
};
|
||||
}
|
||||
function formatColor({ mode , color , alpha }) {
|
||||
let hasAlpha = alpha !== undefined;
|
||||
return `${mode}(${color.join(" ")}${hasAlpha ? ` / ${alpha}` : ""})`;
|
||||
}
|
||||
21
node_modules/tailwindcss/lib/util/configurePlugins.js
generated
vendored
Normal file
21
node_modules/tailwindcss/lib/util/configurePlugins.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>_default
|
||||
});
|
||||
function _default(pluginConfig, plugins) {
|
||||
if (pluginConfig === undefined) {
|
||||
return plugins;
|
||||
}
|
||||
const pluginNames = Array.isArray(pluginConfig) ? pluginConfig : [
|
||||
...new Set(plugins.filter((pluginName)=>{
|
||||
return pluginConfig !== false && pluginConfig[pluginName] !== false;
|
||||
}).concat(Object.keys(pluginConfig).filter((pluginName)=>{
|
||||
return pluginConfig[pluginName] !== false;
|
||||
})))
|
||||
];
|
||||
return pluginNames;
|
||||
}
|
||||
30
node_modules/tailwindcss/lib/util/createPlugin.js
generated
vendored
Normal file
30
node_modules/tailwindcss/lib/util/createPlugin.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>_default
|
||||
});
|
||||
function createPlugin(plugin, config) {
|
||||
return {
|
||||
handler: plugin,
|
||||
config
|
||||
};
|
||||
}
|
||||
createPlugin.withOptions = function(pluginFunction, configFunction = ()=>({})) {
|
||||
const optionsFunction = function(options) {
|
||||
return {
|
||||
__options: options,
|
||||
handler: pluginFunction(options),
|
||||
config: configFunction(options)
|
||||
};
|
||||
};
|
||||
optionsFunction.__isOptionsFunction = true;
|
||||
// Expose plugin dependencies so that `object-hash` returns a different
|
||||
// value if anything here changes, to ensure a rebuild is triggered.
|
||||
optionsFunction.__pluginFunction = pluginFunction;
|
||||
optionsFunction.__configFunction = configFunction;
|
||||
return optionsFunction;
|
||||
};
|
||||
const _default = createPlugin;
|
||||
51
node_modules/tailwindcss/lib/util/createUtilityPlugin.js
generated
vendored
Normal file
51
node_modules/tailwindcss/lib/util/createUtilityPlugin.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>createUtilityPlugin
|
||||
});
|
||||
const _transformThemeValue = /*#__PURE__*/ _interopRequireDefault(require("./transformThemeValue"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function createUtilityPlugin(themeKey, utilityVariations = [
|
||||
[
|
||||
themeKey,
|
||||
[
|
||||
themeKey
|
||||
]
|
||||
]
|
||||
], { filterDefault =false , ...options } = {}) {
|
||||
let transformValue = (0, _transformThemeValue.default)(themeKey);
|
||||
return function({ matchUtilities , theme }) {
|
||||
for (let utilityVariation of utilityVariations){
|
||||
let group = Array.isArray(utilityVariation[0]) ? utilityVariation : [
|
||||
utilityVariation
|
||||
];
|
||||
var ref;
|
||||
matchUtilities(group.reduce((obj, [classPrefix, properties])=>{
|
||||
return Object.assign(obj, {
|
||||
[classPrefix]: (value)=>{
|
||||
return properties.reduce((obj, name)=>{
|
||||
if (Array.isArray(name)) {
|
||||
return Object.assign(obj, {
|
||||
[name[0]]: name[1]
|
||||
});
|
||||
}
|
||||
return Object.assign(obj, {
|
||||
[name]: transformValue(value)
|
||||
});
|
||||
}, {});
|
||||
}
|
||||
});
|
||||
}, {}), {
|
||||
...options,
|
||||
values: filterDefault ? Object.fromEntries(Object.entries((ref = theme(themeKey)) !== null && ref !== void 0 ? ref : {}).filter(([modifier])=>modifier !== "DEFAULT")) : theme(themeKey)
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
239
node_modules/tailwindcss/lib/util/dataTypes.js
generated
vendored
Normal file
239
node_modules/tailwindcss/lib/util/dataTypes.js
generated
vendored
Normal file
@@ -0,0 +1,239 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
normalize: ()=>normalize,
|
||||
url: ()=>url,
|
||||
number: ()=>number,
|
||||
percentage: ()=>percentage,
|
||||
length: ()=>length,
|
||||
lineWidth: ()=>lineWidth,
|
||||
shadow: ()=>shadow,
|
||||
color: ()=>color,
|
||||
image: ()=>image,
|
||||
gradient: ()=>gradient,
|
||||
position: ()=>position,
|
||||
familyName: ()=>familyName,
|
||||
genericName: ()=>genericName,
|
||||
absoluteSize: ()=>absoluteSize,
|
||||
relativeSize: ()=>relativeSize
|
||||
});
|
||||
const _color = require("./color");
|
||||
const _parseBoxShadowValue = require("./parseBoxShadowValue");
|
||||
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
||||
let cssFunctions = [
|
||||
"min",
|
||||
"max",
|
||||
"clamp",
|
||||
"calc"
|
||||
];
|
||||
// Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types
|
||||
function isCSSFunction(value) {
|
||||
return cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.*\\)`).test(value));
|
||||
}
|
||||
function normalize(value, isRoot = true) {
|
||||
// Keep raw strings if it starts with `url(`
|
||||
if (value.includes("url(")) {
|
||||
return value.split(/(url\(.*?\))/g).filter(Boolean).map((part)=>{
|
||||
if (/^url\(.*?\)$/.test(part)) {
|
||||
return part;
|
||||
}
|
||||
return normalize(part, false);
|
||||
}).join("");
|
||||
}
|
||||
// Convert `_` to ` `, except for escaped underscores `\_`
|
||||
value = value.replace(/([^\\])_+/g, (fullMatch, characterBefore)=>characterBefore + " ".repeat(fullMatch.length - 1)).replace(/^_/g, " ").replace(/\\_/g, "_");
|
||||
// Remove leftover whitespace
|
||||
if (isRoot) {
|
||||
value = value.trim();
|
||||
}
|
||||
// Add spaces around operators inside math functions like calc() that do not follow an operator
|
||||
// or '('.
|
||||
value = value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
|
||||
return match.replace(/(-?\d*\.?\d(?!\b-.+[,)](?![^+\-/*])\D)(?:%|[a-z]+)?|\))([+\-/*])/g, "$1 $2 ");
|
||||
});
|
||||
return value;
|
||||
}
|
||||
function url(value) {
|
||||
return value.startsWith("url(");
|
||||
}
|
||||
function number(value) {
|
||||
return !isNaN(Number(value)) || isCSSFunction(value);
|
||||
}
|
||||
function percentage(value) {
|
||||
return value.endsWith("%") && number(value.slice(0, -1)) || isCSSFunction(value);
|
||||
}
|
||||
let lengthUnits = [
|
||||
"cm",
|
||||
"mm",
|
||||
"Q",
|
||||
"in",
|
||||
"pc",
|
||||
"pt",
|
||||
"px",
|
||||
"em",
|
||||
"ex",
|
||||
"ch",
|
||||
"rem",
|
||||
"lh",
|
||||
"vw",
|
||||
"vh",
|
||||
"vmin",
|
||||
"vmax"
|
||||
];
|
||||
let lengthUnitsPattern = `(?:${lengthUnits.join("|")})`;
|
||||
function length(value) {
|
||||
return value === "0" || new RegExp(`^[+-]?[0-9]*\.?[0-9]+(?:[eE][+-]?[0-9]+)?${lengthUnitsPattern}$`).test(value) || isCSSFunction(value);
|
||||
}
|
||||
let lineWidths = new Set([
|
||||
"thin",
|
||||
"medium",
|
||||
"thick"
|
||||
]);
|
||||
function lineWidth(value) {
|
||||
return lineWidths.has(value);
|
||||
}
|
||||
function shadow(value) {
|
||||
let parsedShadows = (0, _parseBoxShadowValue.parseBoxShadowValue)(normalize(value));
|
||||
for (let parsedShadow of parsedShadows){
|
||||
if (!parsedShadow.valid) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function color(value) {
|
||||
let colors = 0;
|
||||
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>{
|
||||
part = normalize(part);
|
||||
if (part.startsWith("var(")) return true;
|
||||
if ((0, _color.parseColor)(part, {
|
||||
loose: true
|
||||
}) !== null) return colors++, true;
|
||||
return false;
|
||||
});
|
||||
if (!result) return false;
|
||||
return colors > 0;
|
||||
}
|
||||
function image(value) {
|
||||
let images = 0;
|
||||
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
|
||||
part = normalize(part);
|
||||
if (part.startsWith("var(")) return true;
|
||||
if (url(part) || gradient(part) || [
|
||||
"element(",
|
||||
"image(",
|
||||
"cross-fade(",
|
||||
"image-set("
|
||||
].some((fn)=>part.startsWith(fn))) {
|
||||
images++;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (!result) return false;
|
||||
return images > 0;
|
||||
}
|
||||
let gradientTypes = new Set([
|
||||
"linear-gradient",
|
||||
"radial-gradient",
|
||||
"repeating-linear-gradient",
|
||||
"repeating-radial-gradient",
|
||||
"conic-gradient"
|
||||
]);
|
||||
function gradient(value) {
|
||||
value = normalize(value);
|
||||
for (let type of gradientTypes){
|
||||
if (value.startsWith(`${type}(`)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
let validPositions = new Set([
|
||||
"center",
|
||||
"top",
|
||||
"right",
|
||||
"bottom",
|
||||
"left"
|
||||
]);
|
||||
function position(value) {
|
||||
let positions = 0;
|
||||
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, "_").every((part)=>{
|
||||
part = normalize(part);
|
||||
if (part.startsWith("var(")) return true;
|
||||
if (validPositions.has(part) || length(part) || percentage(part)) {
|
||||
positions++;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
if (!result) return false;
|
||||
return positions > 0;
|
||||
}
|
||||
function familyName(value) {
|
||||
let fonts = 0;
|
||||
let result = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
|
||||
part = normalize(part);
|
||||
if (part.startsWith("var(")) return true;
|
||||
// If it contains spaces, then it should be quoted
|
||||
if (part.includes(" ")) {
|
||||
if (!/(['"])([^"']+)\1/g.test(part)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// If it starts with a number, it's invalid
|
||||
if (/^\d/g.test(part)) {
|
||||
return false;
|
||||
}
|
||||
fonts++;
|
||||
return true;
|
||||
});
|
||||
if (!result) return false;
|
||||
return fonts > 0;
|
||||
}
|
||||
let genericNames = new Set([
|
||||
"serif",
|
||||
"sans-serif",
|
||||
"monospace",
|
||||
"cursive",
|
||||
"fantasy",
|
||||
"system-ui",
|
||||
"ui-serif",
|
||||
"ui-sans-serif",
|
||||
"ui-monospace",
|
||||
"ui-rounded",
|
||||
"math",
|
||||
"emoji",
|
||||
"fangsong"
|
||||
]);
|
||||
function genericName(value) {
|
||||
return genericNames.has(value);
|
||||
}
|
||||
let absoluteSizes = new Set([
|
||||
"xx-small",
|
||||
"x-small",
|
||||
"small",
|
||||
"medium",
|
||||
"large",
|
||||
"x-large",
|
||||
"x-large",
|
||||
"xxx-large"
|
||||
]);
|
||||
function absoluteSize(value) {
|
||||
return absoluteSizes.has(value);
|
||||
}
|
||||
let relativeSizes = new Set([
|
||||
"larger",
|
||||
"smaller"
|
||||
]);
|
||||
function relativeSize(value) {
|
||||
return relativeSizes.has(value);
|
||||
}
|
||||
25
node_modules/tailwindcss/lib/util/defaults.js
generated
vendored
Normal file
25
node_modules/tailwindcss/lib/util/defaults.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "defaults", {
|
||||
enumerable: true,
|
||||
get: ()=>defaults
|
||||
});
|
||||
function defaults(target, ...sources) {
|
||||
for (let source of sources){
|
||||
for(let k in source){
|
||||
var ref;
|
||||
if (!(target === null || target === void 0 ? void 0 : (ref = target.hasOwnProperty) === null || ref === void 0 ? void 0 : ref.call(target, k))) {
|
||||
target[k] = source[k];
|
||||
}
|
||||
}
|
||||
for (let k1 of Object.getOwnPropertySymbols(source)){
|
||||
var ref1;
|
||||
if (!(target === null || target === void 0 ? void 0 : (ref1 = target.hasOwnProperty) === null || ref1 === void 0 ? void 0 : ref1.call(target, k1))) {
|
||||
target[k1] = source[k1];
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
22
node_modules/tailwindcss/lib/util/escapeClassName.js
generated
vendored
Normal file
22
node_modules/tailwindcss/lib/util/escapeClassName.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>escapeClassName
|
||||
});
|
||||
const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
|
||||
const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function escapeClassName(className) {
|
||||
var ref;
|
||||
let node = _postcssSelectorParser.default.className();
|
||||
node.value = className;
|
||||
var ref1;
|
||||
return (0, _escapeCommas.default)((ref1 = node === null || node === void 0 ? void 0 : (ref = node.raws) === null || ref === void 0 ? void 0 : ref.value) !== null && ref1 !== void 0 ? ref1 : node.value);
|
||||
}
|
||||
11
node_modules/tailwindcss/lib/util/escapeCommas.js
generated
vendored
Normal file
11
node_modules/tailwindcss/lib/util/escapeCommas.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>escapeCommas
|
||||
});
|
||||
function escapeCommas(className) {
|
||||
return className.replace(/\\,/g, "\\2c ");
|
||||
}
|
||||
16
node_modules/tailwindcss/lib/util/flattenColorPalette.js
generated
vendored
Normal file
16
node_modules/tailwindcss/lib/util/flattenColorPalette.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>_default
|
||||
});
|
||||
const flattenColorPalette = (colors)=>Object.assign({}, ...Object.entries(colors !== null && colors !== void 0 ? colors : {}).flatMap(([color, values])=>typeof values == "object" ? Object.entries(flattenColorPalette(values)).map(([number, hex])=>({
|
||||
[color + (number === "DEFAULT" ? "" : `-${number}`)]: hex
|
||||
})) : [
|
||||
{
|
||||
[`${color}`]: values
|
||||
}
|
||||
]));
|
||||
const _default = flattenColorPalette;
|
||||
285
node_modules/tailwindcss/lib/util/formatVariantSelector.js
generated
vendored
Normal file
285
node_modules/tailwindcss/lib/util/formatVariantSelector.js
generated
vendored
Normal file
@@ -0,0 +1,285 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
selectorFunctions: ()=>selectorFunctions,
|
||||
formatVariantSelector: ()=>formatVariantSelector,
|
||||
finalizeSelector: ()=>finalizeSelector
|
||||
});
|
||||
const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
|
||||
const _unesc = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser/dist/util/unesc"));
|
||||
const _escapeClassName = /*#__PURE__*/ _interopRequireDefault(require("../util/escapeClassName"));
|
||||
const _prefixSelector = /*#__PURE__*/ _interopRequireDefault(require("../util/prefixSelector"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var ref;
|
||||
let MERGE = ":merge";
|
||||
let PARENT = "&";
|
||||
let selectorFunctions = new Set([
|
||||
MERGE
|
||||
]);
|
||||
function formatVariantSelector(current, ...others) {
|
||||
for (let other of others){
|
||||
let incomingValue = resolveFunctionArgument(other, MERGE);
|
||||
if (incomingValue !== null) {
|
||||
let existingValue = resolveFunctionArgument(current, MERGE, incomingValue);
|
||||
if (existingValue !== null) {
|
||||
let existingTarget = `${MERGE}(${incomingValue})`;
|
||||
let splitIdx = other.indexOf(existingTarget);
|
||||
let addition = other.slice(splitIdx + existingTarget.length).split(" ")[0];
|
||||
current = current.replace(existingTarget, existingTarget + addition);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
current = other.replace(PARENT, current);
|
||||
}
|
||||
return current;
|
||||
}
|
||||
/**
|
||||
* Given any node in a selector this gets the "simple" selector it's a part of
|
||||
* A simple selector is just a list of nodes without any combinators
|
||||
* Technically :is(), :not(), :has(), etc… can have combinators but those are nested
|
||||
* inside the relevant node and won't be picked up so they're fine to ignore
|
||||
*
|
||||
* @param {import('postcss-selector-parser').Node} node
|
||||
* @returns {import('postcss-selector-parser').Node[]}
|
||||
**/ function simpleSelectorForNode(node) {
|
||||
/** @type {import('postcss-selector-parser').Node[]} */ let nodes = [];
|
||||
// Walk backwards until we hit a combinator node (or the start)
|
||||
while(node.prev() && node.prev().type !== "combinator"){
|
||||
node = node.prev();
|
||||
}
|
||||
// Now record all non-combinator nodes until we hit one (or the end)
|
||||
while(node && node.type !== "combinator"){
|
||||
nodes.push(node);
|
||||
node = node.next();
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
/**
|
||||
* Resorts the nodes in a selector to ensure they're in the correct order
|
||||
* Tags go before classes, and pseudo classes go after classes
|
||||
*
|
||||
* @param {import('postcss-selector-parser').Selector} sel
|
||||
* @returns {import('postcss-selector-parser').Selector}
|
||||
**/ function resortSelector(sel) {
|
||||
sel.sort((a, b)=>{
|
||||
if (a.type === "tag" && b.type === "class") {
|
||||
return -1;
|
||||
} else if (a.type === "class" && b.type === "tag") {
|
||||
return 1;
|
||||
} else if (a.type === "class" && b.type === "pseudo" && b.value.startsWith("::")) {
|
||||
return -1;
|
||||
} else if (a.type === "pseudo" && a.value.startsWith("::") && b.type === "class") {
|
||||
return 1;
|
||||
}
|
||||
return sel.index(a) - sel.index(b);
|
||||
});
|
||||
return sel;
|
||||
}
|
||||
function eliminateIrrelevantSelectors(sel, base) {
|
||||
let hasClassesMatchingCandidate = false;
|
||||
sel.walk((child)=>{
|
||||
if (child.type === "class" && child.value === base) {
|
||||
hasClassesMatchingCandidate = true;
|
||||
return false // Stop walking
|
||||
;
|
||||
}
|
||||
});
|
||||
if (!hasClassesMatchingCandidate) {
|
||||
sel.remove();
|
||||
}
|
||||
// We do NOT recursively eliminate sub selectors that don't have the base class
|
||||
// as this is NOT a safe operation. For example, if we have:
|
||||
// `.space-x-2 > :not([hidden]) ~ :not([hidden])`
|
||||
// We cannot remove the [hidden] from the :not() because it would change the
|
||||
// meaning of the selector.
|
||||
// TODO: Can we do this for :matches, :is, and :where?
|
||||
}
|
||||
var ref1;
|
||||
function finalizeSelector(format, { selector , candidate , context , isArbitraryVariant , // Split by the separator, but ignore the separator inside square brackets:
|
||||
//
|
||||
// E.g.: dark:lg:hover:[paint-order:markers]
|
||||
// ┬ ┬ ┬ ┬
|
||||
// │ │ │ ╰── We will not split here
|
||||
// ╰──┴─────┴─────────────── We will split here
|
||||
//
|
||||
base =candidate.split(new RegExp(`\\${(ref1 = context === null || context === void 0 ? void 0 : (ref = context.tailwindConfig) === null || ref === void 0 ? void 0 : ref.separator) !== null && ref1 !== void 0 ? ref1 : ":"}(?![^[]*\\])`)).pop() }) {
|
||||
var ref2;
|
||||
let ast = (0, _postcssSelectorParser.default)().astSync(selector);
|
||||
// We explicitly DO NOT prefix classes in arbitrary variants
|
||||
if ((context === null || context === void 0 ? void 0 : (ref2 = context.tailwindConfig) === null || ref2 === void 0 ? void 0 : ref2.prefix) && !isArbitraryVariant) {
|
||||
format = (0, _prefixSelector.default)(context.tailwindConfig.prefix, format);
|
||||
}
|
||||
format = format.replace(PARENT, `.${(0, _escapeClassName.default)(candidate)}`);
|
||||
let formatAst = (0, _postcssSelectorParser.default)().astSync(format);
|
||||
// Remove extraneous selectors that do not include the base class/candidate being matched against
|
||||
// For example if we have a utility defined `.a, .b { color: red}`
|
||||
// And the formatted variant is sm:b then we want the final selector to be `.sm\:b` and not `.a, .sm\:b`
|
||||
ast.each((sel)=>eliminateIrrelevantSelectors(sel, base));
|
||||
// Normalize escaped classes, e.g.:
|
||||
//
|
||||
// The idea would be to replace the escaped `base` in the selector with the
|
||||
// `format`. However, in css you can escape the same selector in a few
|
||||
// different ways. This would result in different strings and therefore we
|
||||
// can't replace it properly.
|
||||
//
|
||||
// base: bg-[rgb(255,0,0)]
|
||||
// base in selector: bg-\\[rgb\\(255\\,0\\,0\\)\\]
|
||||
// escaped base: bg-\\[rgb\\(255\\2c 0\\2c 0\\)\\]
|
||||
//
|
||||
ast.walkClasses((node)=>{
|
||||
if (node.raws && node.value.includes(base)) {
|
||||
node.raws.value = (0, _escapeClassName.default)((0, _unesc.default)(node.raws.value));
|
||||
}
|
||||
});
|
||||
let simpleStart = _postcssSelectorParser.default.comment({
|
||||
value: "/*__simple__*/"
|
||||
});
|
||||
let simpleEnd = _postcssSelectorParser.default.comment({
|
||||
value: "/*__simple__*/"
|
||||
});
|
||||
// We can safely replace the escaped base now, since the `base` section is
|
||||
// now in a normalized escaped value.
|
||||
ast.walkClasses((node)=>{
|
||||
if (node.value !== base) {
|
||||
return;
|
||||
}
|
||||
let parent = node.parent;
|
||||
let formatNodes = formatAst.nodes[0].nodes;
|
||||
// Perf optimization: if the parent is a single class we can just replace it and be done
|
||||
if (parent.nodes.length === 1) {
|
||||
node.replaceWith(...formatNodes);
|
||||
return;
|
||||
}
|
||||
let simpleSelector = simpleSelectorForNode(node);
|
||||
parent.insertBefore(simpleSelector[0], simpleStart);
|
||||
parent.insertAfter(simpleSelector[simpleSelector.length - 1], simpleEnd);
|
||||
for (let child of formatNodes){
|
||||
parent.insertBefore(simpleSelector[0], child);
|
||||
}
|
||||
node.remove();
|
||||
// Re-sort the simple selector to ensure it's in the correct order
|
||||
simpleSelector = simpleSelectorForNode(simpleStart);
|
||||
let firstNode = parent.index(simpleStart);
|
||||
parent.nodes.splice(firstNode, simpleSelector.length, ...resortSelector(_postcssSelectorParser.default.selector({
|
||||
nodes: simpleSelector
|
||||
})).nodes);
|
||||
simpleStart.remove();
|
||||
simpleEnd.remove();
|
||||
});
|
||||
// This will make sure to move pseudo's to the correct spot (the end for
|
||||
// pseudo elements) because otherwise the selector will never work
|
||||
// anyway.
|
||||
//
|
||||
// E.g.:
|
||||
// - `before:hover:text-center` would result in `.before\:hover\:text-center:hover::before`
|
||||
// - `hover:before:text-center` would result in `.hover\:before\:text-center:hover::before`
|
||||
//
|
||||
// `::before:hover` doesn't work, which means that we can make it work for you by flipping the order.
|
||||
function collectPseudoElements(selector) {
|
||||
let nodes = [];
|
||||
for (let node of selector.nodes){
|
||||
if (isPseudoElement(node)) {
|
||||
nodes.push(node);
|
||||
selector.removeChild(node);
|
||||
}
|
||||
if (node === null || node === void 0 ? void 0 : node.nodes) {
|
||||
nodes.push(...collectPseudoElements(node));
|
||||
}
|
||||
}
|
||||
return nodes;
|
||||
}
|
||||
// Remove unnecessary pseudo selectors that we used as placeholders
|
||||
ast.each((selector)=>{
|
||||
selector.walkPseudos((p)=>{
|
||||
if (selectorFunctions.has(p.value)) {
|
||||
p.replaceWith(p.nodes);
|
||||
}
|
||||
});
|
||||
let pseudoElements = collectPseudoElements(selector);
|
||||
if (pseudoElements.length > 0) {
|
||||
selector.nodes.push(pseudoElements.sort(sortSelector));
|
||||
}
|
||||
});
|
||||
return ast.toString();
|
||||
}
|
||||
// Note: As a rule, double colons (::) should be used instead of a single colon
|
||||
// (:). This distinguishes pseudo-classes from pseudo-elements. However, since
|
||||
// this distinction was not present in older versions of the W3C spec, most
|
||||
// browsers support both syntaxes for the original pseudo-elements.
|
||||
let pseudoElementsBC = [
|
||||
":before",
|
||||
":after",
|
||||
":first-line",
|
||||
":first-letter"
|
||||
];
|
||||
// These pseudo-elements _can_ be combined with other pseudo selectors AND the order does matter.
|
||||
let pseudoElementExceptions = [
|
||||
"::file-selector-button"
|
||||
];
|
||||
// This will make sure to move pseudo's to the correct spot (the end for
|
||||
// pseudo elements) because otherwise the selector will never work
|
||||
// anyway.
|
||||
//
|
||||
// E.g.:
|
||||
// - `before:hover:text-center` would result in `.before\:hover\:text-center:hover::before`
|
||||
// - `hover:before:text-center` would result in `.hover\:before\:text-center:hover::before`
|
||||
//
|
||||
// `::before:hover` doesn't work, which means that we can make it work
|
||||
// for you by flipping the order.
|
||||
function sortSelector(a, z) {
|
||||
// Both nodes are non-pseudo's so we can safely ignore them and keep
|
||||
// them in the same order.
|
||||
if (a.type !== "pseudo" && z.type !== "pseudo") {
|
||||
return 0;
|
||||
}
|
||||
// If one of them is a combinator, we need to keep it in the same order
|
||||
// because that means it will start a new "section" in the selector.
|
||||
if (a.type === "combinator" ^ z.type === "combinator") {
|
||||
return 0;
|
||||
}
|
||||
// One of the items is a pseudo and the other one isn't. Let's move
|
||||
// the pseudo to the right.
|
||||
if (a.type === "pseudo" ^ z.type === "pseudo") {
|
||||
return (a.type === "pseudo") - (z.type === "pseudo");
|
||||
}
|
||||
// Both are pseudo's, move the pseudo elements (except for
|
||||
// ::file-selector-button) to the right.
|
||||
return isPseudoElement(a) - isPseudoElement(z);
|
||||
}
|
||||
function isPseudoElement(node) {
|
||||
if (node.type !== "pseudo") return false;
|
||||
if (pseudoElementExceptions.includes(node.value)) return false;
|
||||
return node.value.startsWith("::") || pseudoElementsBC.includes(node.value);
|
||||
}
|
||||
function resolveFunctionArgument(haystack, needle, arg) {
|
||||
let startIdx = haystack.indexOf(arg ? `${needle}(${arg})` : needle);
|
||||
if (startIdx === -1) return null;
|
||||
// Start inside the `(`
|
||||
startIdx += needle.length + 1;
|
||||
let target = "";
|
||||
let count = 0;
|
||||
for (let char of haystack.slice(startIdx)){
|
||||
if (char !== "(" && char !== ")") {
|
||||
target += char;
|
||||
} else if (char === "(") {
|
||||
target += char;
|
||||
count++;
|
||||
} else if (char === ")") {
|
||||
if (--count < 0) break; // unbalanced
|
||||
target += char;
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
48
node_modules/tailwindcss/lib/util/getAllConfigs.js
generated
vendored
Normal file
48
node_modules/tailwindcss/lib/util/getAllConfigs.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>getAllConfigs
|
||||
});
|
||||
const _defaultConfigStubJs = /*#__PURE__*/ _interopRequireDefault(require("../../stubs/defaultConfig.stub.js"));
|
||||
const _featureFlags = require("../featureFlags");
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function getAllConfigs(config) {
|
||||
var ref;
|
||||
const configs = ((ref = config === null || config === void 0 ? void 0 : config.presets) !== null && ref !== void 0 ? ref : [
|
||||
_defaultConfigStubJs.default
|
||||
]).slice().reverse().flatMap((preset)=>getAllConfigs(preset instanceof Function ? preset() : preset));
|
||||
const features = {
|
||||
// Add experimental configs here...
|
||||
respectDefaultRingColorOpacity: {
|
||||
theme: {
|
||||
ringColor: ({ theme })=>({
|
||||
DEFAULT: "#3b82f67f",
|
||||
...theme("colors")
|
||||
})
|
||||
}
|
||||
},
|
||||
disableColorOpacityUtilitiesByDefault: {
|
||||
corePlugins: {
|
||||
backgroundOpacity: false,
|
||||
borderOpacity: false,
|
||||
divideOpacity: false,
|
||||
placeholderOpacity: false,
|
||||
ringOpacity: false,
|
||||
textOpacity: false
|
||||
}
|
||||
}
|
||||
};
|
||||
const experimentals = Object.keys(features).filter((feature)=>(0, _featureFlags.flagEnabled)(config, feature)).map((feature)=>features[feature]);
|
||||
return [
|
||||
config,
|
||||
...experimentals,
|
||||
...configs
|
||||
];
|
||||
}
|
||||
19
node_modules/tailwindcss/lib/util/hashConfig.js
generated
vendored
Normal file
19
node_modules/tailwindcss/lib/util/hashConfig.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>hashConfig
|
||||
});
|
||||
const _objectHash = /*#__PURE__*/ _interopRequireDefault(require("object-hash"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function hashConfig(config) {
|
||||
return (0, _objectHash.default)(config, {
|
||||
ignoreUnknown: true
|
||||
});
|
||||
}
|
||||
11
node_modules/tailwindcss/lib/util/isKeyframeRule.js
generated
vendored
Normal file
11
node_modules/tailwindcss/lib/util/isKeyframeRule.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>isKeyframeRule
|
||||
});
|
||||
function isKeyframeRule(rule) {
|
||||
return rule.parent && rule.parent.type === "atrule" && /keyframes$/.test(rule.parent.name);
|
||||
}
|
||||
15
node_modules/tailwindcss/lib/util/isPlainObject.js
generated
vendored
Normal file
15
node_modules/tailwindcss/lib/util/isPlainObject.js
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>isPlainObject
|
||||
});
|
||||
function isPlainObject(value) {
|
||||
if (Object.prototype.toString.call(value) !== "[object Object]") {
|
||||
return false;
|
||||
}
|
||||
const prototype = Object.getPrototypeOf(value);
|
||||
return prototype === null || prototype === Object.prototype;
|
||||
}
|
||||
72
node_modules/tailwindcss/lib/util/isValidArbitraryValue.js
generated
vendored
Normal file
72
node_modules/tailwindcss/lib/util/isValidArbitraryValue.js
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, // Arbitrary values must contain balanced brackets (), [] and {}. Escaped
|
||||
// values don't count, and brackets inside quotes also don't count.
|
||||
//
|
||||
// E.g.: w-[this-is]w-[weird-and-invalid]
|
||||
// E.g.: w-[this-is\\]w-\\[weird-but-valid]
|
||||
// E.g.: content-['this-is-also-valid]-weirdly-enough']
|
||||
"default", {
|
||||
enumerable: true,
|
||||
get: ()=>isValidArbitraryValue
|
||||
});
|
||||
let matchingBrackets = new Map([
|
||||
[
|
||||
"{",
|
||||
"}"
|
||||
],
|
||||
[
|
||||
"[",
|
||||
"]"
|
||||
],
|
||||
[
|
||||
"(",
|
||||
")"
|
||||
]
|
||||
]);
|
||||
let inverseMatchingBrackets = new Map(Array.from(matchingBrackets.entries()).map(([k, v])=>[
|
||||
v,
|
||||
k
|
||||
]));
|
||||
let quotes = new Set([
|
||||
'"',
|
||||
"'",
|
||||
"`"
|
||||
]);
|
||||
function isValidArbitraryValue(value) {
|
||||
let stack = [];
|
||||
let inQuotes = false;
|
||||
for(let i = 0; i < value.length; i++){
|
||||
let char = value[i];
|
||||
if (char === ":" && !inQuotes && stack.length === 0) {
|
||||
return false;
|
||||
}
|
||||
// Non-escaped quotes allow us to "allow" anything in between
|
||||
if (quotes.has(char) && value[i - 1] !== "\\") {
|
||||
inQuotes = !inQuotes;
|
||||
}
|
||||
if (inQuotes) continue;
|
||||
if (value[i - 1] === "\\") continue; // Escaped
|
||||
if (matchingBrackets.has(char)) {
|
||||
stack.push(char);
|
||||
} else if (inverseMatchingBrackets.has(char)) {
|
||||
let inverse = inverseMatchingBrackets.get(char);
|
||||
// Nothing to pop from, therefore it is unbalanced
|
||||
if (stack.length <= 0) {
|
||||
return false;
|
||||
}
|
||||
// Popped value must match the inverse value, otherwise it is unbalanced
|
||||
if (stack.pop() !== inverse) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If there is still something on the stack, it is also unbalanced
|
||||
if (stack.length > 0) {
|
||||
return false;
|
||||
}
|
||||
// All good, totally balanced!
|
||||
return true;
|
||||
}
|
||||
57
node_modules/tailwindcss/lib/util/log.js
generated
vendored
Normal file
57
node_modules/tailwindcss/lib/util/log.js
generated
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
dim: ()=>dim,
|
||||
default: ()=>_default
|
||||
});
|
||||
const _picocolors = /*#__PURE__*/ _interopRequireDefault(require("picocolors"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
let alreadyShown = new Set();
|
||||
function log(type, messages, key) {
|
||||
if (typeof process !== "undefined" && process.env.JEST_WORKER_ID) return;
|
||||
if (key && alreadyShown.has(key)) return;
|
||||
if (key) alreadyShown.add(key);
|
||||
console.warn("");
|
||||
messages.forEach((message)=>console.warn(type, "-", message));
|
||||
}
|
||||
function dim(input) {
|
||||
return _picocolors.default.dim(input);
|
||||
}
|
||||
const _default = {
|
||||
info (key, messages) {
|
||||
log(_picocolors.default.bold(_picocolors.default.cyan("info")), ...Array.isArray(key) ? [
|
||||
key
|
||||
] : [
|
||||
messages,
|
||||
key
|
||||
]);
|
||||
},
|
||||
warn (key, messages) {
|
||||
log(_picocolors.default.bold(_picocolors.default.yellow("warn")), ...Array.isArray(key) ? [
|
||||
key
|
||||
] : [
|
||||
messages,
|
||||
key
|
||||
]);
|
||||
},
|
||||
risk (key, messages) {
|
||||
log(_picocolors.default.bold(_picocolors.default.magenta("risk")), ...Array.isArray(key) ? [
|
||||
key
|
||||
] : [
|
||||
messages,
|
||||
key
|
||||
]);
|
||||
}
|
||||
};
|
||||
43
node_modules/tailwindcss/lib/util/nameClass.js
generated
vendored
Normal file
43
node_modules/tailwindcss/lib/util/nameClass.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
asClass: ()=>asClass,
|
||||
default: ()=>nameClass,
|
||||
formatClass: ()=>formatClass
|
||||
});
|
||||
const _escapeClassName = /*#__PURE__*/ _interopRequireDefault(require("./escapeClassName"));
|
||||
const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function asClass(name) {
|
||||
return (0, _escapeCommas.default)(`.${(0, _escapeClassName.default)(name)}`);
|
||||
}
|
||||
function nameClass(classPrefix, key) {
|
||||
return asClass(formatClass(classPrefix, key));
|
||||
}
|
||||
function formatClass(classPrefix, key) {
|
||||
if (key === "DEFAULT") {
|
||||
return classPrefix;
|
||||
}
|
||||
if (key === "-" || key === "-DEFAULT") {
|
||||
return `-${classPrefix}`;
|
||||
}
|
||||
if (key.startsWith("-")) {
|
||||
return `-${classPrefix}${key}`;
|
||||
}
|
||||
if (key.startsWith("/")) {
|
||||
return `${classPrefix}${key}`;
|
||||
}
|
||||
return `${classPrefix}-${key}`;
|
||||
}
|
||||
34
node_modules/tailwindcss/lib/util/negateValue.js
generated
vendored
Normal file
34
node_modules/tailwindcss/lib/util/negateValue.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>_default
|
||||
});
|
||||
function _default(value) {
|
||||
value = `${value}`;
|
||||
if (value === "0") {
|
||||
return "0";
|
||||
}
|
||||
// Flip sign of numbers
|
||||
if (/^[+-]?(\d+|\d*\.\d+)(e[+-]?\d+)?(%|\w+)?$/.test(value)) {
|
||||
return value.replace(/^[+-]?/, (sign)=>sign === "-" ? "" : "-");
|
||||
}
|
||||
// What functions we support negating numeric values for
|
||||
// var() isn't inherently a numeric function but we support it anyway
|
||||
// The trigonometric functions are omitted because you'll need to use calc(…) with them _anyway_
|
||||
// to produce generally useful results and that will be covered already
|
||||
let numericFunctions = [
|
||||
"var",
|
||||
"calc",
|
||||
"min",
|
||||
"max",
|
||||
"clamp"
|
||||
];
|
||||
for (const fn of numericFunctions){
|
||||
if (value.includes(`${fn}(`)) {
|
||||
return `calc(${value} * -1)`;
|
||||
}
|
||||
}
|
||||
}
|
||||
281
node_modules/tailwindcss/lib/util/normalizeConfig.js
generated
vendored
Normal file
281
node_modules/tailwindcss/lib/util/normalizeConfig.js
generated
vendored
Normal file
@@ -0,0 +1,281 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "normalizeConfig", {
|
||||
enumerable: true,
|
||||
get: ()=>normalizeConfig
|
||||
});
|
||||
const _log = /*#__PURE__*/ _interopRequireWildcard(require("./log"));
|
||||
function _getRequireWildcardCache(nodeInterop) {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cacheBabelInterop = new WeakMap();
|
||||
var cacheNodeInterop = new WeakMap();
|
||||
return (_getRequireWildcardCache = function(nodeInterop) {
|
||||
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
||||
})(nodeInterop);
|
||||
}
|
||||
function _interopRequireWildcard(obj, nodeInterop) {
|
||||
if (!nodeInterop && obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache(nodeInterop);
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
||||
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
||||
if (desc && (desc.get || desc.set)) {
|
||||
Object.defineProperty(newObj, key, desc);
|
||||
} else {
|
||||
newObj[key] = obj[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
newObj.default = obj;
|
||||
if (cache) {
|
||||
cache.set(obj, newObj);
|
||||
}
|
||||
return newObj;
|
||||
}
|
||||
function normalizeConfig(config) {
|
||||
// Quick structure validation
|
||||
/**
|
||||
* type FilePath = string
|
||||
* type RawFile = { raw: string, extension?: string }
|
||||
* type ExtractorFn = (content: string) => Array<string>
|
||||
* type TransformerFn = (content: string) => string
|
||||
*
|
||||
* type Content =
|
||||
* | Array<FilePath | RawFile>
|
||||
* | {
|
||||
* files: Array<FilePath | RawFile>,
|
||||
* extract?: ExtractorFn | { [extension: string]: ExtractorFn }
|
||||
* transform?: TransformerFn | { [extension: string]: TransformerFn }
|
||||
* }
|
||||
*/ let valid = (()=>{
|
||||
// `config.purge` should not exist anymore
|
||||
if (config.purge) {
|
||||
return false;
|
||||
}
|
||||
// `config.content` should exist
|
||||
if (!config.content) {
|
||||
return false;
|
||||
}
|
||||
// `config.content` should be an object or an array
|
||||
if (!Array.isArray(config.content) && !(typeof config.content === "object" && config.content !== null)) {
|
||||
return false;
|
||||
}
|
||||
// When `config.content` is an array, it should consist of FilePaths or RawFiles
|
||||
if (Array.isArray(config.content)) {
|
||||
return config.content.every((path)=>{
|
||||
// `path` can be a string
|
||||
if (typeof path === "string") return true;
|
||||
// `path` can be an object { raw: string, extension?: string }
|
||||
// `raw` must be a string
|
||||
if (typeof (path === null || path === void 0 ? void 0 : path.raw) !== "string") return false;
|
||||
// `extension` (if provided) should also be a string
|
||||
if ((path === null || path === void 0 ? void 0 : path.extension) && typeof (path === null || path === void 0 ? void 0 : path.extension) !== "string") {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
// When `config.content` is an object
|
||||
if (typeof config.content === "object" && config.content !== null) {
|
||||
// Only `files`, `relative`, `extract`, and `transform` can exist in `config.content`
|
||||
if (Object.keys(config.content).some((key)=>![
|
||||
"files",
|
||||
"relative",
|
||||
"extract",
|
||||
"transform"
|
||||
].includes(key))) {
|
||||
return false;
|
||||
}
|
||||
// `config.content.files` should exist of FilePaths or RawFiles
|
||||
if (Array.isArray(config.content.files)) {
|
||||
if (!config.content.files.every((path)=>{
|
||||
// `path` can be a string
|
||||
if (typeof path === "string") return true;
|
||||
// `path` can be an object { raw: string, extension?: string }
|
||||
// `raw` must be a string
|
||||
if (typeof (path === null || path === void 0 ? void 0 : path.raw) !== "string") return false;
|
||||
// `extension` (if provided) should also be a string
|
||||
if ((path === null || path === void 0 ? void 0 : path.extension) && typeof (path === null || path === void 0 ? void 0 : path.extension) !== "string") {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
})) {
|
||||
return false;
|
||||
}
|
||||
// `config.content.extract` is optional, and can be a Function or a Record<String, Function>
|
||||
if (typeof config.content.extract === "object") {
|
||||
for (let value of Object.values(config.content.extract)){
|
||||
if (typeof value !== "function") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if (!(config.content.extract === undefined || typeof config.content.extract === "function")) {
|
||||
return false;
|
||||
}
|
||||
// `config.content.transform` is optional, and can be a Function or a Record<String, Function>
|
||||
if (typeof config.content.transform === "object") {
|
||||
for (let value1 of Object.values(config.content.transform)){
|
||||
if (typeof value1 !== "function") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if (!(config.content.transform === undefined || typeof config.content.transform === "function")) {
|
||||
return false;
|
||||
}
|
||||
// `config.content.relative` is optional and can be a boolean
|
||||
if (typeof config.content.relative !== "boolean" && typeof config.content.relative !== "undefined") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
})();
|
||||
if (!valid) {
|
||||
_log.default.warn("purge-deprecation", [
|
||||
"The `purge`/`content` options have changed in Tailwind CSS v3.0.",
|
||||
"Update your configuration file to eliminate this warning.",
|
||||
"https://tailwindcss.com/docs/upgrade-guide#configure-content-sources"
|
||||
]);
|
||||
}
|
||||
// Normalize the `safelist`
|
||||
config.safelist = (()=>{
|
||||
var ref;
|
||||
let { content , purge , safelist } = config;
|
||||
if (Array.isArray(safelist)) return safelist;
|
||||
if (Array.isArray(content === null || content === void 0 ? void 0 : content.safelist)) return content.safelist;
|
||||
if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.safelist)) return purge.safelist;
|
||||
if (Array.isArray(purge === null || purge === void 0 ? void 0 : (ref = purge.options) === null || ref === void 0 ? void 0 : ref.safelist)) return purge.options.safelist;
|
||||
return [];
|
||||
})();
|
||||
// Normalize the `blocklist`
|
||||
config.blocklist = (()=>{
|
||||
let { blocklist } = config;
|
||||
if (Array.isArray(blocklist)) {
|
||||
if (blocklist.every((item)=>typeof item === "string")) {
|
||||
return blocklist;
|
||||
}
|
||||
_log.default.warn("blocklist-invalid", [
|
||||
"The `blocklist` option must be an array of strings.",
|
||||
"https://tailwindcss.com/docs/content-configuration#discarding-classes"
|
||||
]);
|
||||
}
|
||||
return [];
|
||||
})();
|
||||
// Normalize prefix option
|
||||
if (typeof config.prefix === "function") {
|
||||
_log.default.warn("prefix-function", [
|
||||
"As of Tailwind CSS v3.0, `prefix` cannot be a function.",
|
||||
"Update `prefix` in your configuration to be a string to eliminate this warning.",
|
||||
"https://tailwindcss.com/docs/upgrade-guide#prefix-cannot-be-a-function"
|
||||
]);
|
||||
config.prefix = "";
|
||||
} else {
|
||||
var _prefix;
|
||||
config.prefix = (_prefix = config.prefix) !== null && _prefix !== void 0 ? _prefix : "";
|
||||
}
|
||||
// Normalize the `content`
|
||||
config.content = {
|
||||
relative: (()=>{
|
||||
var ref;
|
||||
let { content } = config;
|
||||
if (content === null || content === void 0 ? void 0 : content.relative) {
|
||||
return content.relative;
|
||||
}
|
||||
var ref1;
|
||||
return (ref1 = (ref = config.future) === null || ref === void 0 ? void 0 : ref.relativeContentPathsByDefault) !== null && ref1 !== void 0 ? ref1 : false;
|
||||
})(),
|
||||
files: (()=>{
|
||||
let { content , purge } = config;
|
||||
if (Array.isArray(purge)) return purge;
|
||||
if (Array.isArray(purge === null || purge === void 0 ? void 0 : purge.content)) return purge.content;
|
||||
if (Array.isArray(content)) return content;
|
||||
if (Array.isArray(content === null || content === void 0 ? void 0 : content.content)) return content.content;
|
||||
if (Array.isArray(content === null || content === void 0 ? void 0 : content.files)) return content.files;
|
||||
return [];
|
||||
})(),
|
||||
extract: (()=>{
|
||||
let extract = (()=>{
|
||||
var ref, ref1, ref2, ref3, ref4, ref5, ref6, ref7, ref8, ref9;
|
||||
if ((ref = config.purge) === null || ref === void 0 ? void 0 : ref.extract) return config.purge.extract;
|
||||
if ((ref1 = config.content) === null || ref1 === void 0 ? void 0 : ref1.extract) return config.content.extract;
|
||||
if ((ref2 = config.purge) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.extract) === null || ref3 === void 0 ? void 0 : ref3.DEFAULT) return config.purge.extract.DEFAULT;
|
||||
if ((ref4 = config.content) === null || ref4 === void 0 ? void 0 : (ref5 = ref4.extract) === null || ref5 === void 0 ? void 0 : ref5.DEFAULT) return config.content.extract.DEFAULT;
|
||||
if ((ref6 = config.purge) === null || ref6 === void 0 ? void 0 : (ref7 = ref6.options) === null || ref7 === void 0 ? void 0 : ref7.extractors) return config.purge.options.extractors;
|
||||
if ((ref8 = config.content) === null || ref8 === void 0 ? void 0 : (ref9 = ref8.options) === null || ref9 === void 0 ? void 0 : ref9.extractors) return config.content.options.extractors;
|
||||
return {};
|
||||
})();
|
||||
let extractors = {};
|
||||
let defaultExtractor = (()=>{
|
||||
var ref, ref1, ref2, ref3;
|
||||
if ((ref = config.purge) === null || ref === void 0 ? void 0 : (ref1 = ref.options) === null || ref1 === void 0 ? void 0 : ref1.defaultExtractor) {
|
||||
return config.purge.options.defaultExtractor;
|
||||
}
|
||||
if ((ref2 = config.content) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.options) === null || ref3 === void 0 ? void 0 : ref3.defaultExtractor) {
|
||||
return config.content.options.defaultExtractor;
|
||||
}
|
||||
return undefined;
|
||||
})();
|
||||
if (defaultExtractor !== undefined) {
|
||||
extractors.DEFAULT = defaultExtractor;
|
||||
}
|
||||
// Functions
|
||||
if (typeof extract === "function") {
|
||||
extractors.DEFAULT = extract;
|
||||
} else if (Array.isArray(extract)) {
|
||||
for (let { extensions , extractor } of extract !== null && extract !== void 0 ? extract : []){
|
||||
for (let extension of extensions){
|
||||
extractors[extension] = extractor;
|
||||
}
|
||||
}
|
||||
} else if (typeof extract === "object" && extract !== null) {
|
||||
Object.assign(extractors, extract);
|
||||
}
|
||||
return extractors;
|
||||
})(),
|
||||
transform: (()=>{
|
||||
let transform = (()=>{
|
||||
var ref, ref1, ref2, ref3, ref4, ref5;
|
||||
if ((ref = config.purge) === null || ref === void 0 ? void 0 : ref.transform) return config.purge.transform;
|
||||
if ((ref1 = config.content) === null || ref1 === void 0 ? void 0 : ref1.transform) return config.content.transform;
|
||||
if ((ref2 = config.purge) === null || ref2 === void 0 ? void 0 : (ref3 = ref2.transform) === null || ref3 === void 0 ? void 0 : ref3.DEFAULT) return config.purge.transform.DEFAULT;
|
||||
if ((ref4 = config.content) === null || ref4 === void 0 ? void 0 : (ref5 = ref4.transform) === null || ref5 === void 0 ? void 0 : ref5.DEFAULT) return config.content.transform.DEFAULT;
|
||||
return {};
|
||||
})();
|
||||
let transformers = {};
|
||||
if (typeof transform === "function") {
|
||||
transformers.DEFAULT = transform;
|
||||
}
|
||||
if (typeof transform === "object" && transform !== null) {
|
||||
Object.assign(transformers, transform);
|
||||
}
|
||||
return transformers;
|
||||
})()
|
||||
};
|
||||
// Validate globs to prevent bogus globs.
|
||||
// E.g.: `./src/*.{html}` is invalid, the `{html}` should just be `html`
|
||||
for (let file of config.content.files){
|
||||
if (typeof file === "string" && /{([^,]*?)}/g.test(file)) {
|
||||
_log.default.warn("invalid-glob-braces", [
|
||||
`The glob pattern ${(0, _log.dim)(file)} in your Tailwind CSS configuration is invalid.`,
|
||||
`Update it to ${(0, _log.dim)(file.replace(/{([^,]*?)}/g, "$1"))} to silence this warning.`
|
||||
]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return config;
|
||||
}
|
||||
170
node_modules/tailwindcss/lib/util/normalizeScreens.js
generated
vendored
Normal file
170
node_modules/tailwindcss/lib/util/normalizeScreens.js
generated
vendored
Normal file
@@ -0,0 +1,170 @@
|
||||
/**
|
||||
* @typedef {object} ScreenValue
|
||||
* @property {number|undefined} min
|
||||
* @property {number|undefined} max
|
||||
* @property {string|undefined} raw
|
||||
*/ /**
|
||||
* @typedef {object} Screen
|
||||
* @property {string} name
|
||||
* @property {boolean} not
|
||||
* @property {ScreenValue[]} values
|
||||
*/ /**
|
||||
* A function that normalizes the various forms that the screens object can be
|
||||
* provided in.
|
||||
*
|
||||
* Input(s):
|
||||
* - ['100px', '200px'] // Raw strings
|
||||
* - { sm: '100px', md: '200px' } // Object with string values
|
||||
* - { sm: { min: '100px' }, md: { max: '100px' } } // Object with object values
|
||||
* - { sm: [{ min: '100px' }, { max: '200px' }] } // Object with object array (multiple values)
|
||||
*
|
||||
* Output(s):
|
||||
* - [{ name: 'sm', values: [{ min: '100px', max: '200px' }] }] // List of objects, that contains multiple values
|
||||
*
|
||||
* @returns {Screen[]}
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
normalizeScreens: ()=>normalizeScreens,
|
||||
isScreenSortable: ()=>isScreenSortable,
|
||||
compareScreens: ()=>compareScreens,
|
||||
toScreen: ()=>toScreen
|
||||
});
|
||||
function normalizeScreens(screens, root = true) {
|
||||
if (Array.isArray(screens)) {
|
||||
return screens.map((screen)=>{
|
||||
if (root && Array.isArray(screen)) {
|
||||
throw new Error("The tuple syntax is not supported for `screens`.");
|
||||
}
|
||||
if (typeof screen === "string") {
|
||||
return {
|
||||
name: screen.toString(),
|
||||
not: false,
|
||||
values: [
|
||||
{
|
||||
min: screen,
|
||||
max: undefined
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
let [name, options] = screen;
|
||||
name = name.toString();
|
||||
if (typeof options === "string") {
|
||||
return {
|
||||
name,
|
||||
not: false,
|
||||
values: [
|
||||
{
|
||||
min: options,
|
||||
max: undefined
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
if (Array.isArray(options)) {
|
||||
return {
|
||||
name,
|
||||
not: false,
|
||||
values: options.map((option)=>resolveValue(option))
|
||||
};
|
||||
}
|
||||
return {
|
||||
name,
|
||||
not: false,
|
||||
values: [
|
||||
resolveValue(options)
|
||||
]
|
||||
};
|
||||
});
|
||||
}
|
||||
return normalizeScreens(Object.entries(screens !== null && screens !== void 0 ? screens : {}), false);
|
||||
}
|
||||
function isScreenSortable(screen) {
|
||||
if (screen.values.length !== 1) {
|
||||
return {
|
||||
result: false,
|
||||
reason: "multiple-values"
|
||||
};
|
||||
} else if (screen.values[0].raw !== undefined) {
|
||||
return {
|
||||
result: false,
|
||||
reason: "raw-values"
|
||||
};
|
||||
} else if (screen.values[0].min !== undefined && screen.values[0].max !== undefined) {
|
||||
return {
|
||||
result: false,
|
||||
reason: "min-and-max"
|
||||
};
|
||||
}
|
||||
return {
|
||||
result: true,
|
||||
reason: null
|
||||
};
|
||||
}
|
||||
function compareScreens(type, a, z) {
|
||||
let aScreen = toScreen(a, type);
|
||||
let zScreen = toScreen(z, type);
|
||||
let aSorting = isScreenSortable(aScreen);
|
||||
let bSorting = isScreenSortable(zScreen);
|
||||
// These cases should never happen and indicate a bug in Tailwind CSS itself
|
||||
if (aSorting.reason === "multiple-values" || bSorting.reason === "multiple-values") {
|
||||
throw new Error("Attempted to sort a screen with multiple values. This should never happen. Please open a bug report.");
|
||||
} else if (aSorting.reason === "raw-values" || bSorting.reason === "raw-values") {
|
||||
throw new Error("Attempted to sort a screen with raw values. This should never happen. Please open a bug report.");
|
||||
} else if (aSorting.reason === "min-and-max" || bSorting.reason === "min-and-max") {
|
||||
throw new Error("Attempted to sort a screen with both min and max values. This should never happen. Please open a bug report.");
|
||||
}
|
||||
// Let the sorting begin
|
||||
let { min: aMin , max: aMax } = aScreen.values[0];
|
||||
let { min: zMin , max: zMax } = zScreen.values[0];
|
||||
// Negating screens flip their behavior. Basically `not min-width` is `max-width`
|
||||
if (a.not) [aMin, aMax] = [
|
||||
aMax,
|
||||
aMin
|
||||
];
|
||||
if (z.not) [zMin, zMax] = [
|
||||
zMax,
|
||||
zMin
|
||||
];
|
||||
aMin = aMin === undefined ? aMin : parseFloat(aMin);
|
||||
aMax = aMax === undefined ? aMax : parseFloat(aMax);
|
||||
zMin = zMin === undefined ? zMin : parseFloat(zMin);
|
||||
zMax = zMax === undefined ? zMax : parseFloat(zMax);
|
||||
let [aValue, zValue] = type === "min" ? [
|
||||
aMin,
|
||||
zMin
|
||||
] : [
|
||||
zMax,
|
||||
aMax
|
||||
];
|
||||
return aValue - zValue;
|
||||
}
|
||||
function toScreen(value, type) {
|
||||
if (typeof value === "object") {
|
||||
return value;
|
||||
}
|
||||
return {
|
||||
name: "arbitrary-screen",
|
||||
values: [
|
||||
{
|
||||
[type]: value
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
function resolveValue({ "min-width": _minWidth , min =_minWidth , max , raw } = {}) {
|
||||
return {
|
||||
min,
|
||||
max,
|
||||
raw
|
||||
};
|
||||
}
|
||||
91
node_modules/tailwindcss/lib/util/parseAnimationValue.js
generated
vendored
Normal file
91
node_modules/tailwindcss/lib/util/parseAnimationValue.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>parseAnimationValue
|
||||
});
|
||||
const DIRECTIONS = new Set([
|
||||
"normal",
|
||||
"reverse",
|
||||
"alternate",
|
||||
"alternate-reverse"
|
||||
]);
|
||||
const PLAY_STATES = new Set([
|
||||
"running",
|
||||
"paused"
|
||||
]);
|
||||
const FILL_MODES = new Set([
|
||||
"none",
|
||||
"forwards",
|
||||
"backwards",
|
||||
"both"
|
||||
]);
|
||||
const ITERATION_COUNTS = new Set([
|
||||
"infinite"
|
||||
]);
|
||||
const TIMINGS = new Set([
|
||||
"linear",
|
||||
"ease",
|
||||
"ease-in",
|
||||
"ease-out",
|
||||
"ease-in-out",
|
||||
"step-start",
|
||||
"step-end"
|
||||
]);
|
||||
const TIMING_FNS = [
|
||||
"cubic-bezier",
|
||||
"steps"
|
||||
];
|
||||
const COMMA = /\,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubiz-bezier(a, b, c)` these don't count.
|
||||
;
|
||||
const SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.
|
||||
;
|
||||
const TIME = /^(-?[\d.]+m?s)$/;
|
||||
const DIGIT = /^(\d+)$/;
|
||||
function parseAnimationValue(input) {
|
||||
let animations = input.split(COMMA);
|
||||
return animations.map((animation)=>{
|
||||
let value = animation.trim();
|
||||
let result = {
|
||||
value
|
||||
};
|
||||
let parts = value.split(SPACE);
|
||||
let seen = new Set();
|
||||
for (let part of parts){
|
||||
if (!seen.has("DIRECTIONS") && DIRECTIONS.has(part)) {
|
||||
result.direction = part;
|
||||
seen.add("DIRECTIONS");
|
||||
} else if (!seen.has("PLAY_STATES") && PLAY_STATES.has(part)) {
|
||||
result.playState = part;
|
||||
seen.add("PLAY_STATES");
|
||||
} else if (!seen.has("FILL_MODES") && FILL_MODES.has(part)) {
|
||||
result.fillMode = part;
|
||||
seen.add("FILL_MODES");
|
||||
} else if (!seen.has("ITERATION_COUNTS") && (ITERATION_COUNTS.has(part) || DIGIT.test(part))) {
|
||||
result.iterationCount = part;
|
||||
seen.add("ITERATION_COUNTS");
|
||||
} else if (!seen.has("TIMING_FUNCTION") && TIMINGS.has(part)) {
|
||||
result.timingFunction = part;
|
||||
seen.add("TIMING_FUNCTION");
|
||||
} else if (!seen.has("TIMING_FUNCTION") && TIMING_FNS.some((f)=>part.startsWith(`${f}(`))) {
|
||||
result.timingFunction = part;
|
||||
seen.add("TIMING_FUNCTION");
|
||||
} else if (!seen.has("DURATION") && TIME.test(part)) {
|
||||
result.duration = part;
|
||||
seen.add("DURATION");
|
||||
} else if (!seen.has("DELAY") && TIME.test(part)) {
|
||||
result.delay = part;
|
||||
seen.add("DELAY");
|
||||
} else if (!seen.has("NAME")) {
|
||||
result.name = part;
|
||||
seen.add("NAME");
|
||||
} else {
|
||||
if (!result.unknown) result.unknown = [];
|
||||
result.unknown.push(part);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
});
|
||||
}
|
||||
84
node_modules/tailwindcss/lib/util/parseBoxShadowValue.js
generated
vendored
Normal file
84
node_modules/tailwindcss/lib/util/parseBoxShadowValue.js
generated
vendored
Normal file
@@ -0,0 +1,84 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
parseBoxShadowValue: ()=>parseBoxShadowValue,
|
||||
formatBoxShadowValue: ()=>formatBoxShadowValue
|
||||
});
|
||||
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
||||
let KEYWORDS = new Set([
|
||||
"inset",
|
||||
"inherit",
|
||||
"initial",
|
||||
"revert",
|
||||
"unset"
|
||||
]);
|
||||
let SPACE = /\ +(?![^(]*\))/g // Similar to the one above, but with spaces instead.
|
||||
;
|
||||
let LENGTH = /^-?(\d+|\.\d+)(.*?)$/g;
|
||||
function parseBoxShadowValue(input) {
|
||||
let shadows = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(input, ",");
|
||||
return shadows.map((shadow)=>{
|
||||
let value = shadow.trim();
|
||||
let result = {
|
||||
raw: value
|
||||
};
|
||||
let parts = value.split(SPACE);
|
||||
let seen = new Set();
|
||||
for (let part of parts){
|
||||
// Reset index, since the regex is stateful.
|
||||
LENGTH.lastIndex = 0;
|
||||
// Keyword
|
||||
if (!seen.has("KEYWORD") && KEYWORDS.has(part)) {
|
||||
result.keyword = part;
|
||||
seen.add("KEYWORD");
|
||||
} else if (LENGTH.test(part)) {
|
||||
if (!seen.has("X")) {
|
||||
result.x = part;
|
||||
seen.add("X");
|
||||
} else if (!seen.has("Y")) {
|
||||
result.y = part;
|
||||
seen.add("Y");
|
||||
} else if (!seen.has("BLUR")) {
|
||||
result.blur = part;
|
||||
seen.add("BLUR");
|
||||
} else if (!seen.has("SPREAD")) {
|
||||
result.spread = part;
|
||||
seen.add("SPREAD");
|
||||
}
|
||||
} else {
|
||||
if (!result.color) {
|
||||
result.color = part;
|
||||
} else {
|
||||
if (!result.unknown) result.unknown = [];
|
||||
result.unknown.push(part);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Check if valid
|
||||
result.valid = result.x !== undefined && result.y !== undefined;
|
||||
return result;
|
||||
});
|
||||
}
|
||||
function formatBoxShadowValue(shadows) {
|
||||
return shadows.map((shadow)=>{
|
||||
if (!shadow.valid) {
|
||||
return shadow.raw;
|
||||
}
|
||||
return [
|
||||
shadow.keyword,
|
||||
shadow.x,
|
||||
shadow.y,
|
||||
shadow.blur,
|
||||
shadow.spread,
|
||||
shadow.color
|
||||
].filter(Boolean).join(" ");
|
||||
}).join(", ");
|
||||
}
|
||||
45
node_modules/tailwindcss/lib/util/parseDependency.js
generated
vendored
Normal file
45
node_modules/tailwindcss/lib/util/parseDependency.js
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// @ts-check
|
||||
/**
|
||||
* @typedef {{type: 'dependency', file: string} | {type: 'dir-dependency', dir: string, glob: string}} Dependency
|
||||
*/ /**
|
||||
*
|
||||
* @param {import('../lib/content.js').ContentPath} contentPath
|
||||
* @returns {Dependency[]}
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>parseDependency
|
||||
});
|
||||
function parseDependency(contentPath) {
|
||||
if (contentPath.ignore) {
|
||||
return [];
|
||||
}
|
||||
if (!contentPath.glob) {
|
||||
return [
|
||||
{
|
||||
type: "dependency",
|
||||
file: contentPath.base
|
||||
}
|
||||
];
|
||||
}
|
||||
if (process.env.ROLLUP_WATCH === "true") {
|
||||
// rollup-plugin-postcss does not support dir-dependency messages
|
||||
// but directories can be watched in the same way as files
|
||||
return [
|
||||
{
|
||||
type: "dependency",
|
||||
file: contentPath.base
|
||||
}
|
||||
];
|
||||
}
|
||||
return [
|
||||
{
|
||||
type: "dir-dependency",
|
||||
dir: contentPath.base,
|
||||
glob: contentPath.glob
|
||||
}
|
||||
];
|
||||
}
|
||||
34
node_modules/tailwindcss/lib/util/parseGlob.js
generated
vendored
Normal file
34
node_modules/tailwindcss/lib/util/parseGlob.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "parseGlob", {
|
||||
enumerable: true,
|
||||
get: ()=>parseGlob
|
||||
});
|
||||
const _globParent = /*#__PURE__*/ _interopRequireDefault(require("glob-parent"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function parseGlob(pattern) {
|
||||
let glob = pattern;
|
||||
let base = (0, _globParent.default)(pattern);
|
||||
if (base !== ".") {
|
||||
glob = pattern.substr(base.length);
|
||||
if (glob.charAt(0) === "/") {
|
||||
glob = glob.substr(1);
|
||||
}
|
||||
}
|
||||
if (glob.substr(0, 2) === "./") {
|
||||
glob = glob.substr(2);
|
||||
}
|
||||
if (glob.charAt(0) === "/") {
|
||||
glob = glob.substr(1);
|
||||
}
|
||||
return {
|
||||
base,
|
||||
glob
|
||||
};
|
||||
}
|
||||
34
node_modules/tailwindcss/lib/util/parseObjectStyles.js
generated
vendored
Normal file
34
node_modules/tailwindcss/lib/util/parseObjectStyles.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>parseObjectStyles
|
||||
});
|
||||
const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
|
||||
const _postcssNested = /*#__PURE__*/ _interopRequireDefault(require("postcss-nested"));
|
||||
const _postcssJs = /*#__PURE__*/ _interopRequireDefault(require("postcss-js"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function parseObjectStyles(styles) {
|
||||
if (!Array.isArray(styles)) {
|
||||
return parseObjectStyles([
|
||||
styles
|
||||
]);
|
||||
}
|
||||
return styles.flatMap((style)=>{
|
||||
return (0, _postcss.default)([
|
||||
(0, _postcssNested.default)({
|
||||
bubble: [
|
||||
"screen"
|
||||
]
|
||||
})
|
||||
]).process(style, {
|
||||
parser: _postcssJs.default
|
||||
}).root.nodes;
|
||||
});
|
||||
}
|
||||
278
node_modules/tailwindcss/lib/util/pluginUtils.js
generated
vendored
Normal file
278
node_modules/tailwindcss/lib/util/pluginUtils.js
generated
vendored
Normal file
@@ -0,0 +1,278 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
updateAllClasses: ()=>updateAllClasses,
|
||||
filterSelectorsForClass: ()=>filterSelectorsForClass,
|
||||
asValue: ()=>asValue,
|
||||
parseColorFormat: ()=>parseColorFormat,
|
||||
asColor: ()=>asColor,
|
||||
asLookupValue: ()=>asLookupValue,
|
||||
typeMap: ()=>typeMap,
|
||||
coerceValue: ()=>coerceValue,
|
||||
getMatchingTypes: ()=>getMatchingTypes
|
||||
});
|
||||
const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
|
||||
const _escapeCommas = /*#__PURE__*/ _interopRequireDefault(require("./escapeCommas"));
|
||||
const _withAlphaVariable = require("./withAlphaVariable");
|
||||
const _dataTypes = require("./dataTypes");
|
||||
const _negateValue = /*#__PURE__*/ _interopRequireDefault(require("./negateValue"));
|
||||
const _validateFormalSyntax = require("./validateFormalSyntax");
|
||||
const _featureFlagsJs = require("../featureFlags.js");
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function updateAllClasses(selectors, updateClass) {
|
||||
let parser = (0, _postcssSelectorParser.default)((selectors)=>{
|
||||
selectors.walkClasses((sel)=>{
|
||||
let updatedClass = updateClass(sel.value);
|
||||
sel.value = updatedClass;
|
||||
if (sel.raws && sel.raws.value) {
|
||||
sel.raws.value = (0, _escapeCommas.default)(sel.raws.value);
|
||||
}
|
||||
});
|
||||
});
|
||||
let result = parser.processSync(selectors);
|
||||
return result;
|
||||
}
|
||||
function filterSelectorsForClass(selectors, classCandidate) {
|
||||
let parser = (0, _postcssSelectorParser.default)((selectors)=>{
|
||||
selectors.each((sel)=>{
|
||||
const containsClass = sel.nodes.some((node)=>node.type === "class" && node.value === classCandidate);
|
||||
if (!containsClass) {
|
||||
sel.remove();
|
||||
}
|
||||
});
|
||||
});
|
||||
let result = parser.processSync(selectors);
|
||||
return result;
|
||||
}
|
||||
function resolveArbitraryValue(modifier, validate) {
|
||||
if (!isArbitraryValue(modifier)) {
|
||||
return undefined;
|
||||
}
|
||||
let value = modifier.slice(1, -1);
|
||||
if (!validate(value)) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _dataTypes.normalize)(value);
|
||||
}
|
||||
function asNegativeValue(modifier, lookup = {}, validate) {
|
||||
let positiveValue = lookup[modifier];
|
||||
if (positiveValue !== undefined) {
|
||||
return (0, _negateValue.default)(positiveValue);
|
||||
}
|
||||
if (isArbitraryValue(modifier)) {
|
||||
let resolved = resolveArbitraryValue(modifier, validate);
|
||||
if (resolved === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _negateValue.default)(resolved);
|
||||
}
|
||||
}
|
||||
function asValue(modifier, options = {}, { validate =()=>true } = {}) {
|
||||
var ref;
|
||||
let value = (ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier];
|
||||
if (value !== undefined) {
|
||||
return value;
|
||||
}
|
||||
if (options.supportsNegativeValues && modifier.startsWith("-")) {
|
||||
return asNegativeValue(modifier.slice(1), options.values, validate);
|
||||
}
|
||||
return resolveArbitraryValue(modifier, validate);
|
||||
}
|
||||
function isArbitraryValue(input) {
|
||||
return input.startsWith("[") && input.endsWith("]");
|
||||
}
|
||||
function splitUtilityModifier(modifier) {
|
||||
let slashIdx = modifier.lastIndexOf("/");
|
||||
if (slashIdx === -1 || slashIdx === modifier.length - 1) {
|
||||
return [
|
||||
modifier,
|
||||
undefined
|
||||
];
|
||||
}
|
||||
let arbitrary = isArbitraryValue(modifier);
|
||||
// The modifier could be of the form `[foo]/[bar]`
|
||||
// We want to handle this case properly
|
||||
// without affecting `[foo/bar]`
|
||||
if (arbitrary && !modifier.includes("]/[")) {
|
||||
return [
|
||||
modifier,
|
||||
undefined
|
||||
];
|
||||
}
|
||||
return [
|
||||
modifier.slice(0, slashIdx),
|
||||
modifier.slice(slashIdx + 1)
|
||||
];
|
||||
}
|
||||
function parseColorFormat(value) {
|
||||
if (typeof value === "string" && value.includes("<alpha-value>")) {
|
||||
let oldValue = value;
|
||||
return ({ opacityValue =1 })=>oldValue.replace("<alpha-value>", opacityValue);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
function asColor(_, options = {}, { tailwindConfig ={} , utilityModifier , rawModifier } = {}) {
|
||||
var ref;
|
||||
if (((ref = options.values) === null || ref === void 0 ? void 0 : ref[rawModifier]) !== undefined) {
|
||||
var ref1;
|
||||
return parseColorFormat((ref1 = options.values) === null || ref1 === void 0 ? void 0 : ref1[rawModifier]);
|
||||
}
|
||||
// TODO: Hoist this up to getMatchingTypes or something
|
||||
// We do this here because we need the alpha value (if any)
|
||||
let [color, alpha] = splitUtilityModifier(rawModifier);
|
||||
if (alpha !== undefined) {
|
||||
var ref2, ref3, ref4;
|
||||
var ref5;
|
||||
let normalizedColor = (ref5 = (ref2 = options.values) === null || ref2 === void 0 ? void 0 : ref2[color]) !== null && ref5 !== void 0 ? ref5 : isArbitraryValue(color) ? color.slice(1, -1) : undefined;
|
||||
if (normalizedColor === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
normalizedColor = parseColorFormat(normalizedColor);
|
||||
if (isArbitraryValue(alpha)) {
|
||||
return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, alpha.slice(1, -1));
|
||||
}
|
||||
if (((ref3 = tailwindConfig.theme) === null || ref3 === void 0 ? void 0 : (ref4 = ref3.opacity) === null || ref4 === void 0 ? void 0 : ref4[alpha]) === undefined) {
|
||||
return undefined;
|
||||
}
|
||||
return (0, _withAlphaVariable.withAlphaValue)(normalizedColor, tailwindConfig.theme.opacity[alpha]);
|
||||
}
|
||||
return asValue(rawModifier, options, {
|
||||
rawModifier,
|
||||
utilityModifier,
|
||||
validate: _dataTypes.color
|
||||
});
|
||||
}
|
||||
function asLookupValue(modifier, options = {}) {
|
||||
var ref;
|
||||
return (ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier];
|
||||
}
|
||||
function guess(validate) {
|
||||
return (modifier, options, extras)=>{
|
||||
return asValue(modifier, options, {
|
||||
...extras,
|
||||
validate
|
||||
});
|
||||
};
|
||||
}
|
||||
let typeMap = {
|
||||
any: asValue,
|
||||
color: asColor,
|
||||
url: guess(_dataTypes.url),
|
||||
image: guess(_dataTypes.image),
|
||||
length: guess(_dataTypes.length),
|
||||
percentage: guess(_dataTypes.percentage),
|
||||
position: guess(_dataTypes.position),
|
||||
lookup: asLookupValue,
|
||||
"generic-name": guess(_dataTypes.genericName),
|
||||
"family-name": guess(_dataTypes.familyName),
|
||||
number: guess(_dataTypes.number),
|
||||
"line-width": guess(_dataTypes.lineWidth),
|
||||
"absolute-size": guess(_dataTypes.absoluteSize),
|
||||
"relative-size": guess(_dataTypes.relativeSize),
|
||||
shadow: guess(_dataTypes.shadow),
|
||||
size: guess(_validateFormalSyntax.backgroundSize)
|
||||
};
|
||||
let supportedTypes = Object.keys(typeMap);
|
||||
function splitAtFirst(input, delim) {
|
||||
let idx = input.indexOf(delim);
|
||||
if (idx === -1) return [
|
||||
undefined,
|
||||
input
|
||||
];
|
||||
return [
|
||||
input.slice(0, idx),
|
||||
input.slice(idx + 1)
|
||||
];
|
||||
}
|
||||
function coerceValue(types, modifier, options, tailwindConfig) {
|
||||
if (isArbitraryValue(modifier)) {
|
||||
let arbitraryValue = modifier.slice(1, -1);
|
||||
let [explicitType, value] = splitAtFirst(arbitraryValue, ":");
|
||||
// It could be that this resolves to `url(https` which is not a valid
|
||||
// identifier. We currently only support "simple" words with dashes or
|
||||
// underscores. E.g.: family-name
|
||||
if (!/^[\w-_]+$/g.test(explicitType)) {
|
||||
value = arbitraryValue;
|
||||
} else if (explicitType !== undefined && !supportedTypes.includes(explicitType)) {
|
||||
return [];
|
||||
}
|
||||
if (value.length > 0 && supportedTypes.includes(explicitType)) {
|
||||
return [
|
||||
asValue(`[${value}]`, options),
|
||||
explicitType,
|
||||
null
|
||||
];
|
||||
}
|
||||
}
|
||||
let matches = getMatchingTypes(types, modifier, options, tailwindConfig);
|
||||
// Find first matching type
|
||||
for (let match of matches){
|
||||
return match;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
function* getMatchingTypes(types, rawModifier, options, tailwindConfig) {
|
||||
let modifiersEnabled = (0, _featureFlagsJs.flagEnabled)(tailwindConfig, "generalizedModifiers");
|
||||
let [modifier, utilityModifier] = splitUtilityModifier(rawModifier);
|
||||
let canUseUtilityModifier = modifiersEnabled && options.modifiers != null && (options.modifiers === "any" || typeof options.modifiers === "object" && (utilityModifier && isArbitraryValue(utilityModifier) || utilityModifier in options.modifiers));
|
||||
if (!canUseUtilityModifier) {
|
||||
modifier = rawModifier;
|
||||
utilityModifier = undefined;
|
||||
}
|
||||
if (utilityModifier !== undefined && modifier === "") {
|
||||
modifier = "DEFAULT";
|
||||
}
|
||||
// Check the full value first
|
||||
// TODO: Move to asValue… somehow
|
||||
if (utilityModifier !== undefined) {
|
||||
if (typeof options.modifiers === "object") {
|
||||
var ref;
|
||||
var ref1;
|
||||
let configValue = (ref1 = (ref = options.modifiers) === null || ref === void 0 ? void 0 : ref[utilityModifier]) !== null && ref1 !== void 0 ? ref1 : null;
|
||||
if (configValue !== null) {
|
||||
utilityModifier = configValue;
|
||||
} else if (isArbitraryValue(utilityModifier)) {
|
||||
utilityModifier = utilityModifier.slice(1, -1);
|
||||
}
|
||||
}
|
||||
let result = asValue(rawModifier, options, {
|
||||
rawModifier,
|
||||
utilityModifier,
|
||||
tailwindConfig
|
||||
});
|
||||
if (result !== undefined) {
|
||||
yield [
|
||||
result,
|
||||
"any",
|
||||
null
|
||||
];
|
||||
}
|
||||
}
|
||||
for (const { type } of types !== null && types !== void 0 ? types : []){
|
||||
let result1 = typeMap[type](modifier, options, {
|
||||
rawModifier,
|
||||
utilityModifier,
|
||||
tailwindConfig
|
||||
});
|
||||
if (result1 === undefined) {
|
||||
continue;
|
||||
}
|
||||
yield [
|
||||
result1,
|
||||
type,
|
||||
utilityModifier !== null && utilityModifier !== void 0 ? utilityModifier : null
|
||||
];
|
||||
}
|
||||
}
|
||||
23
node_modules/tailwindcss/lib/util/prefixSelector.js
generated
vendored
Normal file
23
node_modules/tailwindcss/lib/util/prefixSelector.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>_default
|
||||
});
|
||||
const _postcssSelectorParser = /*#__PURE__*/ _interopRequireDefault(require("postcss-selector-parser"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function _default(prefix, selector, prependNegative = false) {
|
||||
return (0, _postcssSelectorParser.default)((selectors)=>{
|
||||
selectors.walkClasses((classSelector)=>{
|
||||
let baseClass = classSelector.value;
|
||||
let shouldPlaceNegativeBeforePrefix = prependNegative && baseClass.startsWith("-");
|
||||
classSelector.value = shouldPlaceNegativeBeforePrefix ? `-${prefix}${baseClass.slice(1)}` : `${prefix}${baseClass}`;
|
||||
});
|
||||
}).processSync(selector);
|
||||
}
|
||||
29
node_modules/tailwindcss/lib/util/removeAlphaVariables.js
generated
vendored
Normal file
29
node_modules/tailwindcss/lib/util/removeAlphaVariables.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* This function removes any uses of CSS variables used as an alpha channel
|
||||
*
|
||||
* This is required for selectors like `:visited` which do not allow
|
||||
* changes in opacity or external control using CSS variables.
|
||||
*
|
||||
* @param {import('postcss').Container} container
|
||||
* @param {string[]} toRemove
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "removeAlphaVariables", {
|
||||
enumerable: true,
|
||||
get: ()=>removeAlphaVariables
|
||||
});
|
||||
function removeAlphaVariables(container, toRemove) {
|
||||
container.walkDecls((decl)=>{
|
||||
if (toRemove.includes(decl.prop)) {
|
||||
decl.remove();
|
||||
return;
|
||||
}
|
||||
for (let varName of toRemove){
|
||||
if (decl.value.includes(`/ var(${varName})`)) {
|
||||
decl.value = decl.value.replace(`/ var(${varName})`, "");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
256
node_modules/tailwindcss/lib/util/resolveConfig.js
generated
vendored
Normal file
256
node_modules/tailwindcss/lib/util/resolveConfig.js
generated
vendored
Normal file
@@ -0,0 +1,256 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>resolveConfig
|
||||
});
|
||||
const _negateValue = /*#__PURE__*/ _interopRequireDefault(require("./negateValue"));
|
||||
const _corePluginList = /*#__PURE__*/ _interopRequireDefault(require("../corePluginList"));
|
||||
const _configurePlugins = /*#__PURE__*/ _interopRequireDefault(require("./configurePlugins"));
|
||||
const _defaultConfigStub = /*#__PURE__*/ _interopRequireDefault(require("../../stubs/defaultConfig.stub"));
|
||||
const _colors = /*#__PURE__*/ _interopRequireDefault(require("../public/colors"));
|
||||
const _defaults = require("./defaults");
|
||||
const _toPath = require("./toPath");
|
||||
const _normalizeConfig = require("./normalizeConfig");
|
||||
const _isPlainObject = /*#__PURE__*/ _interopRequireDefault(require("./isPlainObject"));
|
||||
const _cloneDeep = require("./cloneDeep");
|
||||
const _pluginUtils = require("./pluginUtils");
|
||||
const _withAlphaVariable = require("./withAlphaVariable");
|
||||
const _toColorValue = /*#__PURE__*/ _interopRequireDefault(require("./toColorValue"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function isFunction(input) {
|
||||
return typeof input === "function";
|
||||
}
|
||||
function mergeWith(target, ...sources) {
|
||||
let customizer = sources.pop();
|
||||
for (let source of sources){
|
||||
for(let k in source){
|
||||
let merged = customizer(target[k], source[k]);
|
||||
if (merged === undefined) {
|
||||
if ((0, _isPlainObject.default)(target[k]) && (0, _isPlainObject.default)(source[k])) {
|
||||
target[k] = mergeWith({}, target[k], source[k], customizer);
|
||||
} else {
|
||||
target[k] = source[k];
|
||||
}
|
||||
} else {
|
||||
target[k] = merged;
|
||||
}
|
||||
}
|
||||
}
|
||||
return target;
|
||||
}
|
||||
const configUtils = {
|
||||
colors: _colors.default,
|
||||
negative (scale) {
|
||||
// TODO: Log that this function isn't really needed anymore?
|
||||
return Object.keys(scale).filter((key)=>scale[key] !== "0").reduce((negativeScale, key)=>{
|
||||
let negativeValue = (0, _negateValue.default)(scale[key]);
|
||||
if (negativeValue !== undefined) {
|
||||
negativeScale[`-${key}`] = negativeValue;
|
||||
}
|
||||
return negativeScale;
|
||||
}, {});
|
||||
},
|
||||
breakpoints (screens) {
|
||||
return Object.keys(screens).filter((key)=>typeof screens[key] === "string").reduce((breakpoints, key)=>({
|
||||
...breakpoints,
|
||||
[`screen-${key}`]: screens[key]
|
||||
}), {});
|
||||
}
|
||||
};
|
||||
function value(valueToResolve, ...args) {
|
||||
return isFunction(valueToResolve) ? valueToResolve(...args) : valueToResolve;
|
||||
}
|
||||
function collectExtends(items) {
|
||||
return items.reduce((merged, { extend })=>{
|
||||
return mergeWith(merged, extend, (mergedValue, extendValue)=>{
|
||||
if (mergedValue === undefined) {
|
||||
return [
|
||||
extendValue
|
||||
];
|
||||
}
|
||||
if (Array.isArray(mergedValue)) {
|
||||
return [
|
||||
extendValue,
|
||||
...mergedValue
|
||||
];
|
||||
}
|
||||
return [
|
||||
extendValue,
|
||||
mergedValue
|
||||
];
|
||||
});
|
||||
}, {});
|
||||
}
|
||||
function mergeThemes(themes) {
|
||||
return {
|
||||
...themes.reduce((merged, theme)=>(0, _defaults.defaults)(merged, theme), {}),
|
||||
// In order to resolve n config objects, we combine all of their `extend` properties
|
||||
// into arrays instead of objects so they aren't overridden.
|
||||
extend: collectExtends(themes)
|
||||
};
|
||||
}
|
||||
function mergeExtensionCustomizer(merged, value) {
|
||||
// When we have an array of objects, we do want to merge it
|
||||
if (Array.isArray(merged) && (0, _isPlainObject.default)(merged[0])) {
|
||||
return merged.concat(value);
|
||||
}
|
||||
// When the incoming value is an array, and the existing config is an object, prepend the existing object
|
||||
if (Array.isArray(value) && (0, _isPlainObject.default)(value[0]) && (0, _isPlainObject.default)(merged)) {
|
||||
return [
|
||||
merged,
|
||||
...value
|
||||
];
|
||||
}
|
||||
// Override arrays (for example for font-families, box-shadows, ...)
|
||||
if (Array.isArray(value)) {
|
||||
return value;
|
||||
}
|
||||
// Execute default behaviour
|
||||
return undefined;
|
||||
}
|
||||
function mergeExtensions({ extend , ...theme }) {
|
||||
return mergeWith(theme, extend, (themeValue, extensions)=>{
|
||||
// The `extend` property is an array, so we need to check if it contains any functions
|
||||
if (!isFunction(themeValue) && !extensions.some(isFunction)) {
|
||||
return mergeWith({}, themeValue, ...extensions, mergeExtensionCustomizer);
|
||||
}
|
||||
return (resolveThemePath, utils)=>mergeWith({}, ...[
|
||||
themeValue,
|
||||
...extensions
|
||||
].map((e)=>value(e, resolveThemePath, utils)), mergeExtensionCustomizer);
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {string} key
|
||||
* @return {Iterable<string[] & {alpha: string | undefined}>}
|
||||
*/ function* toPaths(key) {
|
||||
let path = (0, _toPath.toPath)(key);
|
||||
if (path.length === 0) {
|
||||
return;
|
||||
}
|
||||
yield path;
|
||||
if (Array.isArray(key)) {
|
||||
return;
|
||||
}
|
||||
let pattern = /^(.*?)\s*\/\s*([^/]+)$/;
|
||||
let matches = key.match(pattern);
|
||||
if (matches !== null) {
|
||||
let [, prefix, alpha] = matches;
|
||||
let newPath = (0, _toPath.toPath)(prefix);
|
||||
newPath.alpha = alpha;
|
||||
yield newPath;
|
||||
}
|
||||
}
|
||||
function resolveFunctionKeys(object) {
|
||||
// theme('colors.red.500 / 0.5') -> ['colors', 'red', '500 / 0', '5]
|
||||
const resolvePath = (key, defaultValue)=>{
|
||||
for (const path of toPaths(key)){
|
||||
let index = 0;
|
||||
let val = object;
|
||||
while(val !== undefined && val !== null && index < path.length){
|
||||
val = val[path[index++]];
|
||||
let shouldResolveAsFn = isFunction(val) && (path.alpha === undefined || index <= path.length - 1);
|
||||
val = shouldResolveAsFn ? val(resolvePath, configUtils) : val;
|
||||
}
|
||||
if (val !== undefined) {
|
||||
if (path.alpha !== undefined) {
|
||||
let normalized = (0, _pluginUtils.parseColorFormat)(val);
|
||||
return (0, _withAlphaVariable.withAlphaValue)(normalized, path.alpha, (0, _toColorValue.default)(normalized));
|
||||
}
|
||||
if ((0, _isPlainObject.default)(val)) {
|
||||
return (0, _cloneDeep.cloneDeep)(val);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
}
|
||||
return defaultValue;
|
||||
};
|
||||
Object.assign(resolvePath, {
|
||||
theme: resolvePath,
|
||||
...configUtils
|
||||
});
|
||||
return Object.keys(object).reduce((resolved, key)=>{
|
||||
resolved[key] = isFunction(object[key]) ? object[key](resolvePath, configUtils) : object[key];
|
||||
return resolved;
|
||||
}, {});
|
||||
}
|
||||
function extractPluginConfigs(configs) {
|
||||
let allConfigs = [];
|
||||
configs.forEach((config)=>{
|
||||
allConfigs = [
|
||||
...allConfigs,
|
||||
config
|
||||
];
|
||||
var ref;
|
||||
const plugins = (ref = config === null || config === void 0 ? void 0 : config.plugins) !== null && ref !== void 0 ? ref : [];
|
||||
if (plugins.length === 0) {
|
||||
return;
|
||||
}
|
||||
plugins.forEach((plugin)=>{
|
||||
if (plugin.__isOptionsFunction) {
|
||||
plugin = plugin();
|
||||
}
|
||||
var ref;
|
||||
allConfigs = [
|
||||
...allConfigs,
|
||||
...extractPluginConfigs([
|
||||
(ref = plugin === null || plugin === void 0 ? void 0 : plugin.config) !== null && ref !== void 0 ? ref : {}
|
||||
])
|
||||
];
|
||||
});
|
||||
});
|
||||
return allConfigs;
|
||||
}
|
||||
function resolveCorePlugins(corePluginConfigs) {
|
||||
const result = [
|
||||
...corePluginConfigs
|
||||
].reduceRight((resolved, corePluginConfig)=>{
|
||||
if (isFunction(corePluginConfig)) {
|
||||
return corePluginConfig({
|
||||
corePlugins: resolved
|
||||
});
|
||||
}
|
||||
return (0, _configurePlugins.default)(corePluginConfig, resolved);
|
||||
}, _corePluginList.default);
|
||||
return result;
|
||||
}
|
||||
function resolvePluginLists(pluginLists) {
|
||||
const result = [
|
||||
...pluginLists
|
||||
].reduceRight((resolved, pluginList)=>{
|
||||
return [
|
||||
...resolved,
|
||||
...pluginList
|
||||
];
|
||||
}, []);
|
||||
return result;
|
||||
}
|
||||
function resolveConfig(configs) {
|
||||
let allConfigs = [
|
||||
...extractPluginConfigs(configs),
|
||||
{
|
||||
prefix: "",
|
||||
important: false,
|
||||
separator: ":",
|
||||
variantOrder: _defaultConfigStub.default.variantOrder
|
||||
}
|
||||
];
|
||||
var ref, ref1;
|
||||
return (0, _normalizeConfig.normalizeConfig)((0, _defaults.defaults)({
|
||||
theme: resolveFunctionKeys(mergeExtensions(mergeThemes(allConfigs.map((t)=>{
|
||||
return (ref = t === null || t === void 0 ? void 0 : t.theme) !== null && ref !== void 0 ? ref : {};
|
||||
})))),
|
||||
corePlugins: resolveCorePlugins(allConfigs.map((c)=>c.corePlugins)),
|
||||
plugins: resolvePluginLists(configs.map((c)=>{
|
||||
return (ref1 = c === null || c === void 0 ? void 0 : c.plugins) !== null && ref1 !== void 0 ? ref1 : [];
|
||||
}))
|
||||
}, ...allConfigs));
|
||||
}
|
||||
54
node_modules/tailwindcss/lib/util/resolveConfigPath.js
generated
vendored
Normal file
54
node_modules/tailwindcss/lib/util/resolveConfigPath.js
generated
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>resolveConfigPath
|
||||
});
|
||||
const _fs = /*#__PURE__*/ _interopRequireDefault(require("fs"));
|
||||
const _path = /*#__PURE__*/ _interopRequireDefault(require("path"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function isObject(value) {
|
||||
return typeof value === "object" && value !== null;
|
||||
}
|
||||
function isEmpty(obj) {
|
||||
return Object.keys(obj).length === 0;
|
||||
}
|
||||
function isString(value) {
|
||||
return typeof value === "string" || value instanceof String;
|
||||
}
|
||||
function resolveConfigPath(pathOrConfig) {
|
||||
// require('tailwindcss')({ theme: ..., variants: ... })
|
||||
if (isObject(pathOrConfig) && pathOrConfig.config === undefined && !isEmpty(pathOrConfig)) {
|
||||
return null;
|
||||
}
|
||||
// require('tailwindcss')({ config: 'custom-config.js' })
|
||||
if (isObject(pathOrConfig) && pathOrConfig.config !== undefined && isString(pathOrConfig.config)) {
|
||||
return _path.default.resolve(pathOrConfig.config);
|
||||
}
|
||||
// require('tailwindcss')({ config: { theme: ..., variants: ... } })
|
||||
if (isObject(pathOrConfig) && pathOrConfig.config !== undefined && isObject(pathOrConfig.config)) {
|
||||
return null;
|
||||
}
|
||||
// require('tailwindcss')('custom-config.js')
|
||||
if (isString(pathOrConfig)) {
|
||||
return _path.default.resolve(pathOrConfig);
|
||||
}
|
||||
// require('tailwindcss')
|
||||
for (const configFile of [
|
||||
"./tailwind.config.js",
|
||||
"./tailwind.config.cjs"
|
||||
]){
|
||||
try {
|
||||
const configPath = _path.default.resolve(configFile);
|
||||
_fs.default.accessSync(configPath);
|
||||
return configPath;
|
||||
} catch (err) {}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
22
node_modules/tailwindcss/lib/util/responsive.js
generated
vendored
Normal file
22
node_modules/tailwindcss/lib/util/responsive.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>responsive
|
||||
});
|
||||
const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
|
||||
const _cloneNodes = /*#__PURE__*/ _interopRequireDefault(require("./cloneNodes"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function responsive(rules) {
|
||||
return _postcss.default.atRule({
|
||||
name: "responsive"
|
||||
}).append((0, _cloneNodes.default)(Array.isArray(rules) ? rules : [
|
||||
rules
|
||||
]));
|
||||
}
|
||||
43
node_modules/tailwindcss/lib/util/splitAtTopLevelOnly.js
generated
vendored
Normal file
43
node_modules/tailwindcss/lib/util/splitAtTopLevelOnly.js
generated
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* This splits a string on a top-level character.
|
||||
*
|
||||
* Regex doesn't support recursion (at least not the JS-flavored version).
|
||||
* So we have to use a tiny state machine to keep track of paren placement.
|
||||
*
|
||||
* Expected behavior using commas:
|
||||
* var(--a, 0 0 1px rgb(0, 0, 0)), 0 0 1px rgb(0, 0, 0)
|
||||
* ─┬─ ┬ ┬ ┬
|
||||
* x x x ╰──────── Split because top-level
|
||||
* ╰──────────────┴──┴───────────── Ignored b/c inside >= 1 levels of parens
|
||||
*
|
||||
* @param {string} input
|
||||
* @param {string} separator
|
||||
*/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "splitAtTopLevelOnly", {
|
||||
enumerable: true,
|
||||
get: ()=>splitAtTopLevelOnly
|
||||
});
|
||||
function splitAtTopLevelOnly(input, separator) {
|
||||
let stack = [];
|
||||
let parts = [];
|
||||
let lastPos = 0;
|
||||
for(let idx = 0; idx < input.length; idx++){
|
||||
let char = input[idx];
|
||||
if (stack.length === 0 && char === separator[0]) {
|
||||
if (separator.length === 1 || input.slice(idx, idx + separator.length) === separator) {
|
||||
parts.push(input.slice(lastPos, idx));
|
||||
lastPos = idx + separator.length;
|
||||
}
|
||||
}
|
||||
if (char === "(" || char === "[" || char === "{") {
|
||||
stack.push(char);
|
||||
} else if (char === ")" && stack[stack.length - 1] === "(" || char === "]" && stack[stack.length - 1] === "[" || char === "}" && stack[stack.length - 1] === "{") {
|
||||
stack.pop();
|
||||
}
|
||||
}
|
||||
parts.push(input.slice(lastPos));
|
||||
return parts;
|
||||
}
|
||||
12
node_modules/tailwindcss/lib/util/tap.js
generated
vendored
Normal file
12
node_modules/tailwindcss/lib/util/tap.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "tap", {
|
||||
enumerable: true,
|
||||
get: ()=>tap
|
||||
});
|
||||
function tap(value, mutator) {
|
||||
mutator(value);
|
||||
return value;
|
||||
}
|
||||
11
node_modules/tailwindcss/lib/util/toColorValue.js
generated
vendored
Normal file
11
node_modules/tailwindcss/lib/util/toColorValue.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>toColorValue
|
||||
});
|
||||
function toColorValue(maybeFunction) {
|
||||
return typeof maybeFunction === "function" ? maybeFunction({}) : maybeFunction;
|
||||
}
|
||||
30
node_modules/tailwindcss/lib/util/toPath.js
generated
vendored
Normal file
30
node_modules/tailwindcss/lib/util/toPath.js
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
/**
|
||||
* Parse a path string into an array of path segments.
|
||||
*
|
||||
* Square bracket notation `a[b]` may be used to "escape" dots that would otherwise be interpreted as path separators.
|
||||
*
|
||||
* Example:
|
||||
* a -> ['a']
|
||||
* a.b.c -> ['a', 'b', 'c']
|
||||
* a[b].c -> ['a', 'b', 'c']
|
||||
* a[b.c].e.f -> ['a', 'b.c', 'e', 'f']
|
||||
* a[b][c][d] -> ['a', 'b', 'c', 'd']
|
||||
*
|
||||
* @param {string|string[]} path
|
||||
**/ "use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "toPath", {
|
||||
enumerable: true,
|
||||
get: ()=>toPath
|
||||
});
|
||||
function toPath(path) {
|
||||
if (Array.isArray(path)) return path;
|
||||
let openBrackets = path.split("[").length - 1;
|
||||
let closedBrackets = path.split("]").length - 1;
|
||||
if (openBrackets !== closedBrackets) {
|
||||
throw new Error(`Path is invalid. Has unbalanced brackets: ${path}`);
|
||||
}
|
||||
return path.split(/\.(?![^\[]*\])|[\[\]]/g).filter(Boolean);
|
||||
}
|
||||
71
node_modules/tailwindcss/lib/util/transformThemeValue.js
generated
vendored
Normal file
71
node_modules/tailwindcss/lib/util/transformThemeValue.js
generated
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "default", {
|
||||
enumerable: true,
|
||||
get: ()=>transformThemeValue
|
||||
});
|
||||
const _postcss = /*#__PURE__*/ _interopRequireDefault(require("postcss"));
|
||||
const _isPlainObject = /*#__PURE__*/ _interopRequireDefault(require("./isPlainObject"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function transformThemeValue(themeSection) {
|
||||
if ([
|
||||
"fontSize",
|
||||
"outline"
|
||||
].includes(themeSection)) {
|
||||
return (value)=>{
|
||||
if (typeof value === "function") value = value({});
|
||||
if (Array.isArray(value)) value = value[0];
|
||||
return value;
|
||||
};
|
||||
}
|
||||
if (themeSection === "fontFamily") {
|
||||
return (value)=>{
|
||||
if (typeof value === "function") value = value({});
|
||||
let families = Array.isArray(value) && (0, _isPlainObject.default)(value[1]) ? value[0] : value;
|
||||
return Array.isArray(families) ? families.join(", ") : families;
|
||||
};
|
||||
}
|
||||
if ([
|
||||
"boxShadow",
|
||||
"transitionProperty",
|
||||
"transitionDuration",
|
||||
"transitionDelay",
|
||||
"transitionTimingFunction",
|
||||
"backgroundImage",
|
||||
"backgroundSize",
|
||||
"backgroundColor",
|
||||
"cursor",
|
||||
"animation"
|
||||
].includes(themeSection)) {
|
||||
return (value)=>{
|
||||
if (typeof value === "function") value = value({});
|
||||
if (Array.isArray(value)) value = value.join(", ");
|
||||
return value;
|
||||
};
|
||||
}
|
||||
// For backwards compatibility reasons, before we switched to underscores
|
||||
// instead of commas for arbitrary values.
|
||||
if ([
|
||||
"gridTemplateColumns",
|
||||
"gridTemplateRows",
|
||||
"objectPosition"
|
||||
].includes(themeSection)) {
|
||||
return (value)=>{
|
||||
if (typeof value === "function") value = value({});
|
||||
if (typeof value === "string") value = _postcss.default.list.comma(value).join(" ");
|
||||
return value;
|
||||
};
|
||||
}
|
||||
return (value, opts = {})=>{
|
||||
if (typeof value === "function") {
|
||||
value = value(opts);
|
||||
}
|
||||
return value;
|
||||
};
|
||||
}
|
||||
24
node_modules/tailwindcss/lib/util/validateConfig.js
generated
vendored
Normal file
24
node_modules/tailwindcss/lib/util/validateConfig.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "validateConfig", {
|
||||
enumerable: true,
|
||||
get: ()=>validateConfig
|
||||
});
|
||||
const _log = /*#__PURE__*/ _interopRequireDefault(require("./log"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function validateConfig(config) {
|
||||
if (config.content.files.length === 0) {
|
||||
_log.default.warn("content-problems", [
|
||||
"The `content` option in your Tailwind CSS configuration is missing or empty.",
|
||||
"Configure your content sources or your generated CSS will be missing styles.",
|
||||
"https://tailwindcss.com/docs/content-configuration"
|
||||
]);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
24
node_modules/tailwindcss/lib/util/validateFormalSyntax.js
generated
vendored
Normal file
24
node_modules/tailwindcss/lib/util/validateFormalSyntax.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "backgroundSize", {
|
||||
enumerable: true,
|
||||
get: ()=>backgroundSize
|
||||
});
|
||||
const _dataTypes = require("./dataTypes");
|
||||
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
||||
function backgroundSize(value) {
|
||||
let keywordValues = [
|
||||
"cover",
|
||||
"contain"
|
||||
];
|
||||
// the <length-percentage> type will probably be a css function
|
||||
// so we have to use `splitAtTopLevelOnly`
|
||||
return (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(value, ",").every((part)=>{
|
||||
let sizes = (0, _splitAtTopLevelOnly.splitAtTopLevelOnly)(part, "_").filter(Boolean);
|
||||
if (sizes.length === 1 && keywordValues.includes(sizes[0])) return true;
|
||||
if (sizes.length !== 1 && sizes.length !== 2) return false;
|
||||
return sizes.every((size)=>(0, _dataTypes.length)(size) || (0, _dataTypes.percentage)(size) || size === "auto");
|
||||
});
|
||||
}
|
||||
75
node_modules/tailwindcss/lib/util/withAlphaVariable.js
generated
vendored
Normal file
75
node_modules/tailwindcss/lib/util/withAlphaVariable.js
generated
vendored
Normal file
@@ -0,0 +1,75 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
withAlphaValue: ()=>withAlphaValue,
|
||||
default: ()=>withAlphaVariable
|
||||
});
|
||||
const _color = require("./color");
|
||||
function withAlphaValue(color, alphaValue, defaultValue) {
|
||||
if (typeof color === "function") {
|
||||
return color({
|
||||
opacityValue: alphaValue
|
||||
});
|
||||
}
|
||||
let parsed = (0, _color.parseColor)(color, {
|
||||
loose: true
|
||||
});
|
||||
if (parsed === null) {
|
||||
return defaultValue;
|
||||
}
|
||||
return (0, _color.formatColor)({
|
||||
...parsed,
|
||||
alpha: alphaValue
|
||||
});
|
||||
}
|
||||
function withAlphaVariable({ color , property , variable }) {
|
||||
let properties = [].concat(property);
|
||||
if (typeof color === "function") {
|
||||
return {
|
||||
[variable]: "1",
|
||||
...Object.fromEntries(properties.map((p)=>{
|
||||
return [
|
||||
p,
|
||||
color({
|
||||
opacityVariable: variable,
|
||||
opacityValue: `var(${variable})`
|
||||
})
|
||||
];
|
||||
}))
|
||||
};
|
||||
}
|
||||
const parsed = (0, _color.parseColor)(color);
|
||||
if (parsed === null) {
|
||||
return Object.fromEntries(properties.map((p)=>[
|
||||
p,
|
||||
color
|
||||
]));
|
||||
}
|
||||
if (parsed.alpha !== undefined) {
|
||||
// Has an alpha value, return color as-is
|
||||
return Object.fromEntries(properties.map((p)=>[
|
||||
p,
|
||||
color
|
||||
]));
|
||||
}
|
||||
return {
|
||||
[variable]: "1",
|
||||
...Object.fromEntries(properties.map((p)=>{
|
||||
return [
|
||||
p,
|
||||
(0, _color.formatColor)({
|
||||
...parsed,
|
||||
alpha: `var(${variable})`
|
||||
})
|
||||
];
|
||||
}))
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user