forked from hero/www_hero
hero_web
This commit is contained in:
8
node_modules/tailwindcss/lib/util/bigSign.js
generated
vendored
Normal file
8
node_modules/tailwindcss/lib/util/bigSign.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = bigSign;
|
||||
function bigSign(bigIntValue) {
|
||||
return (bigIntValue > 0n) - (bigIntValue < 0n);
|
||||
}
|
19
node_modules/tailwindcss/lib/util/buildMediaQuery.js
generated
vendored
Normal file
19
node_modules/tailwindcss/lib/util/buildMediaQuery.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = buildMediaQuery;
|
||||
function buildMediaQuery(screens) {
|
||||
screens = Array.isArray(screens) ? screens : [
|
||||
screens
|
||||
];
|
||||
return screens.map((screen1)=>screen1.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 ");
|
||||
})).join(", ");
|
||||
}
|
17
node_modules/tailwindcss/lib/util/cloneDeep.js
generated
vendored
Normal file
17
node_modules/tailwindcss/lib/util/cloneDeep.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.cloneDeep = 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;
|
||||
}
|
25
node_modules/tailwindcss/lib/util/cloneNodes.js
generated
vendored
Normal file
25
node_modules/tailwindcss/lib/util/cloneNodes.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cloneNodes;
|
||||
function cloneNodes(nodes, source = undefined, raws = undefined) {
|
||||
return nodes.map((node)=>{
|
||||
let cloned = node.clone();
|
||||
if (source !== undefined) {
|
||||
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;
|
||||
});
|
||||
}
|
90
node_modules/tailwindcss/lib/util/color.js
generated
vendored
Normal file
90
node_modules/tailwindcss/lib/util/color.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.parseColor = parseColor;
|
||||
exports.formatColor = formatColor;
|
||||
var _colorName = _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}` : ""})`;
|
||||
}
|
18
node_modules/tailwindcss/lib/util/configurePlugins.js
generated
vendored
Normal file
18
node_modules/tailwindcss/lib/util/configurePlugins.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _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;
|
||||
}
|
28
node_modules/tailwindcss/lib/util/createPlugin.js
generated
vendored
Normal file
28
node_modules/tailwindcss/lib/util/createPlugin.js
generated
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
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;
|
||||
};
|
||||
var _default = createPlugin;
|
||||
exports.default = _default;
|
48
node_modules/tailwindcss/lib/util/createUtilityPlugin.js
generated
vendored
Normal file
48
node_modules/tailwindcss/lib/util/createUtilityPlugin.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = createUtilityPlugin;
|
||||
var _transformThemeValue = _interopRequireDefault(require("./transformThemeValue"));
|
||||
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((obj1, [classPrefix, properties])=>{
|
||||
return Object.assign(obj1, {
|
||||
[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)
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
235
node_modules/tailwindcss/lib/util/dataTypes.js
generated
vendored
Normal file
235
node_modules/tailwindcss/lib/util/dataTypes.js
generated
vendored
Normal file
@@ -0,0 +1,235 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.normalize = normalize;
|
||||
exports.url = url;
|
||||
exports.number = number;
|
||||
exports.percentage = percentage;
|
||||
exports.length = length;
|
||||
exports.lineWidth = lineWidth;
|
||||
exports.shadow = shadow;
|
||||
exports.color = color;
|
||||
exports.image = image;
|
||||
exports.gradient = gradient;
|
||||
exports.position = position;
|
||||
exports.familyName = familyName;
|
||||
exports.genericName = genericName;
|
||||
exports.absoluteSize = absoluteSize;
|
||||
exports.relativeSize = relativeSize;
|
||||
var _color = require("./color");
|
||||
var _parseBoxShadowValue = require("./parseBoxShadowValue");
|
||||
let cssFunctions = [
|
||||
"min",
|
||||
"max",
|
||||
"clamp",
|
||||
"calc"
|
||||
];
|
||||
// Ref: https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Types
|
||||
let COMMA = /,(?![^(]*\))/g // Comma separator that is not located between brackets. E.g.: `cubiz-bezier(a, b, c)` these don't count.
|
||||
;
|
||||
let UNDERSCORE = /_(?![^(]*\))/g // Underscore separator that is not located between brackets. E.g.: `rgba(255,_255,_255)_black` these don't count.
|
||||
;
|
||||
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)) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?`).test(value));
|
||||
}
|
||||
function percentage(value) {
|
||||
return value.split(UNDERSCORE).every((part)=>{
|
||||
return /%$/g.test(part) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?%`).test(part));
|
||||
});
|
||||
}
|
||||
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.split(UNDERSCORE).every((part)=>{
|
||||
return part === "0" || new RegExp(`${lengthUnitsPattern}$`).test(part) || cssFunctions.some((fn)=>new RegExp(`^${fn}\\(.+?${lengthUnitsPattern}`).test(part));
|
||||
});
|
||||
}
|
||||
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 = value.split(UNDERSCORE).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 = value.split(COMMA).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 = value.split(UNDERSCORE).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 = value.split(COMMA).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);
|
||||
}
|
22
node_modules/tailwindcss/lib/util/defaults.js
generated
vendored
Normal file
22
node_modules/tailwindcss/lib/util/defaults.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.defaults = 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;
|
||||
}
|
19
node_modules/tailwindcss/lib/util/escapeClassName.js
generated
vendored
Normal file
19
node_modules/tailwindcss/lib/util/escapeClassName.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = escapeClassName;
|
||||
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
||||
var _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
|
||||
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);
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
8
node_modules/tailwindcss/lib/util/escapeCommas.js
generated
vendored
Normal file
8
node_modules/tailwindcss/lib/util/escapeCommas.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = escapeCommas;
|
||||
function escapeCommas(className) {
|
||||
return className.replace(/\\,/g, "\\2c ");
|
||||
}
|
14
node_modules/tailwindcss/lib/util/flattenColorPalette.js
generated
vendored
Normal file
14
node_modules/tailwindcss/lib/util/flattenColorPalette.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
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
|
||||
}
|
||||
]));
|
||||
var _default = flattenColorPalette;
|
||||
exports.default = _default;
|
193
node_modules/tailwindcss/lib/util/formatVariantSelector.js
generated
vendored
Normal file
193
node_modules/tailwindcss/lib/util/formatVariantSelector.js
generated
vendored
Normal file
@@ -0,0 +1,193 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.formatVariantSelector = formatVariantSelector;
|
||||
exports.finalizeSelector = finalizeSelector;
|
||||
exports.selectorFunctions = void 0;
|
||||
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
||||
var _unesc = _interopRequireDefault(require("postcss-selector-parser/dist/util/unesc"));
|
||||
var _escapeClassName = _interopRequireDefault(require("../util/escapeClassName"));
|
||||
var _prefixSelector = _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
|
||||
]);
|
||||
exports.selectorFunctions = selectorFunctions;
|
||||
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;
|
||||
}
|
||||
var ref1;
|
||||
function finalizeSelector(format, { selector: selector1 , candidate , context , // 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(selector1);
|
||||
if (context === null || context === void 0 ? void 0 : (ref2 = context.tailwindConfig) === null || ref2 === void 0 ? void 0 : ref2.prefix) {
|
||||
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((node)=>{
|
||||
let hasClassesMatchingCandidate = node.some((n)=>n.type === "class" && n.value === base);
|
||||
if (!hasClassesMatchingCandidate) {
|
||||
node.remove();
|
||||
}
|
||||
});
|
||||
// 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));
|
||||
}
|
||||
});
|
||||
// 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) {
|
||||
node.replaceWith(...formatAst.nodes);
|
||||
}
|
||||
});
|
||||
// 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;
|
||||
}
|
34
node_modules/tailwindcss/lib/util/getAllConfigs.js
generated
vendored
Normal file
34
node_modules/tailwindcss/lib/util/getAllConfigs.js
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getAllConfigs;
|
||||
var _defaultConfigStubJs = _interopRequireDefault(require("../../stubs/defaultConfig.stub.js"));
|
||||
var _featureFlags = require("../featureFlags");
|
||||
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: {
|
||||
DEFAULT: "#3b82f67f"
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
const experimentals = Object.keys(features).filter((feature)=>(0, _featureFlags).flagEnabled(config, feature)).map((feature)=>features[feature]);
|
||||
return [
|
||||
config,
|
||||
...experimentals,
|
||||
...configs
|
||||
];
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
16
node_modules/tailwindcss/lib/util/hashConfig.js
generated
vendored
Normal file
16
node_modules/tailwindcss/lib/util/hashConfig.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = hashConfig;
|
||||
var _objectHash = _interopRequireDefault(require("object-hash"));
|
||||
function hashConfig(config) {
|
||||
return (0, _objectHash).default(config, {
|
||||
ignoreUnknown: true
|
||||
});
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
8
node_modules/tailwindcss/lib/util/isKeyframeRule.js
generated
vendored
Normal file
8
node_modules/tailwindcss/lib/util/isKeyframeRule.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isKeyframeRule;
|
||||
function isKeyframeRule(rule) {
|
||||
return rule.parent && rule.parent.type === "atrule" && /keyframes$/.test(rule.parent.name);
|
||||
}
|
12
node_modules/tailwindcss/lib/util/isPlainObject.js
generated
vendored
Normal file
12
node_modules/tailwindcss/lib/util/isPlainObject.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = 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;
|
||||
}
|
63
node_modules/tailwindcss/lib/util/isValidArbitraryValue.js
generated
vendored
Normal file
63
node_modules/tailwindcss/lib/util/isValidArbitraryValue.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = isValidArbitraryValue;
|
||||
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;
|
||||
}
|
||||
let matchingBrackets = new Map([
|
||||
[
|
||||
"{",
|
||||
"}"
|
||||
],
|
||||
[
|
||||
"[",
|
||||
"]"
|
||||
],
|
||||
[
|
||||
"(",
|
||||
")"
|
||||
],
|
||||
]);
|
||||
let inverseMatchingBrackets = new Map(Array.from(matchingBrackets.entries()).map(([k, v])=>[
|
||||
v,
|
||||
k
|
||||
]));
|
||||
let quotes = new Set([
|
||||
'"',
|
||||
"'",
|
||||
"`"
|
||||
]);
|
50
node_modules/tailwindcss/lib/util/log.js
generated
vendored
Normal file
50
node_modules/tailwindcss/lib/util/log.js
generated
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.dim = dim;
|
||||
exports.default = void 0;
|
||||
var _picocolors = _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);
|
||||
}
|
||||
var _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
|
||||
]);
|
||||
}
|
||||
};
|
||||
exports.default = _default;
|
32
node_modules/tailwindcss/lib/util/nameClass.js
generated
vendored
Normal file
32
node_modules/tailwindcss/lib/util/nameClass.js
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = nameClass;
|
||||
exports.asClass = asClass;
|
||||
exports.formatClass = formatClass;
|
||||
var _escapeClassName = _interopRequireDefault(require("./escapeClassName"));
|
||||
var _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
|
||||
function nameClass(classPrefix, key) {
|
||||
return asClass(formatClass(classPrefix, key));
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function asClass(name) {
|
||||
return (0, _escapeCommas).default(`.${(0, _escapeClassName).default(name)}`);
|
||||
}
|
||||
function formatClass(classPrefix, key) {
|
||||
if (key === "DEFAULT") {
|
||||
return classPrefix;
|
||||
}
|
||||
if (key === "-" || key === "-DEFAULT") {
|
||||
return `-${classPrefix}`;
|
||||
}
|
||||
if (key.startsWith("-")) {
|
||||
return `-${classPrefix}${key}`;
|
||||
}
|
||||
return `${classPrefix}-${key}`;
|
||||
}
|
18
node_modules/tailwindcss/lib/util/negateValue.js
generated
vendored
Normal file
18
node_modules/tailwindcss/lib/util/negateValue.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _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 === "-" ? "" : "-");
|
||||
}
|
||||
if (value.includes("var(") || value.includes("calc(")) {
|
||||
return `calc(${value} * -1)`;
|
||||
}
|
||||
}
|
250
node_modules/tailwindcss/lib/util/normalizeConfig.js
generated
vendored
Normal file
250
node_modules/tailwindcss/lib/util/normalizeConfig.js
generated
vendored
Normal file
@@ -0,0 +1,250 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.normalizeConfig = normalizeConfig;
|
||||
var _log = _interopRequireWildcard(require("./log"));
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (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`, `extract` and `transform` can exist in `config.content`
|
||||
if (Object.keys(config.content).some((key)=>![
|
||||
"files",
|
||||
"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 value of Object.values(config.content.transform)){
|
||||
if (typeof value !== "function") {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if (!(config.content.transform === undefined || typeof config.content.transform === "function")) {
|
||||
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 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 = {
|
||||
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, ref10, ref11, ref12;
|
||||
if ((ref = config.purge) === null || ref === void 0 ? void 0 : (ref10 = ref.options) === null || ref10 === void 0 ? void 0 : ref10.defaultExtractor) {
|
||||
return config.purge.options.defaultExtractor;
|
||||
}
|
||||
if ((ref11 = config.content) === null || ref11 === void 0 ? void 0 : (ref12 = ref11.options) === null || ref12 === void 0 ? void 0 : ref12.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, ref13, ref14, ref15, ref16, ref17;
|
||||
if ((ref = config.purge) === null || ref === void 0 ? void 0 : ref.transform) return config.purge.transform;
|
||||
if ((ref13 = config.content) === null || ref13 === void 0 ? void 0 : ref13.transform) return config.content.transform;
|
||||
if ((ref14 = config.purge) === null || ref14 === void 0 ? void 0 : (ref15 = ref14.transform) === null || ref15 === void 0 ? void 0 : ref15.DEFAULT) return config.purge.transform.DEFAULT;
|
||||
if ((ref16 = config.content) === null || ref16 === void 0 ? void 0 : (ref17 = ref16.transform) === null || ref17 === void 0 ? void 0 : ref17.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;
|
||||
}
|
58
node_modules/tailwindcss/lib/util/normalizeScreens.js
generated
vendored
Normal file
58
node_modules/tailwindcss/lib/util/normalizeScreens.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.normalizeScreens = normalizeScreens;
|
||||
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(),
|
||||
values: [
|
||||
{
|
||||
min: screen,
|
||||
max: undefined
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
let [name, options] = screen;
|
||||
name = name.toString();
|
||||
if (typeof options === "string") {
|
||||
return {
|
||||
name,
|
||||
values: [
|
||||
{
|
||||
min: options,
|
||||
max: undefined
|
||||
}
|
||||
]
|
||||
};
|
||||
}
|
||||
if (Array.isArray(options)) {
|
||||
return {
|
||||
name,
|
||||
values: options.map((option)=>resolveValue(option))
|
||||
};
|
||||
}
|
||||
return {
|
||||
name,
|
||||
values: [
|
||||
resolveValue(options)
|
||||
]
|
||||
};
|
||||
});
|
||||
}
|
||||
return normalizeScreens(Object.entries(screens !== null && screens !== void 0 ? screens : {}), false);
|
||||
}
|
||||
function resolveValue({ "min-width": _minWidth , min =_minWidth , max , raw } = {}) {
|
||||
return {
|
||||
min,
|
||||
max,
|
||||
raw
|
||||
};
|
||||
}
|
88
node_modules/tailwindcss/lib/util/parseAnimationValue.js
generated
vendored
Normal file
88
node_modules/tailwindcss/lib/util/parseAnimationValue.js
generated
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = parseAnimationValue;
|
||||
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;
|
||||
});
|
||||
}
|
||||
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+)$/;
|
76
node_modules/tailwindcss/lib/util/parseBoxShadowValue.js
generated
vendored
Normal file
76
node_modules/tailwindcss/lib/util/parseBoxShadowValue.js
generated
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.parseBoxShadowValue = parseBoxShadowValue;
|
||||
exports.formatBoxShadowValue = formatBoxShadowValue;
|
||||
var _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 = Array.from((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(", ");
|
||||
}
|
63
node_modules/tailwindcss/lib/util/parseDependency.js
generated
vendored
Normal file
63
node_modules/tailwindcss/lib/util/parseDependency.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = parseDependency;
|
||||
var _isGlob = _interopRequireDefault(require("is-glob"));
|
||||
var _globParent = _interopRequireDefault(require("glob-parent"));
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
function parseDependency(normalizedFileOrGlob) {
|
||||
if (normalizedFileOrGlob.startsWith("!")) {
|
||||
return null;
|
||||
}
|
||||
let message;
|
||||
if ((0, _isGlob).default(normalizedFileOrGlob)) {
|
||||
let { base , glob } = parseGlob(normalizedFileOrGlob);
|
||||
message = {
|
||||
type: "dir-dependency",
|
||||
dir: _path.default.resolve(base),
|
||||
glob
|
||||
};
|
||||
} else {
|
||||
message = {
|
||||
type: "dependency",
|
||||
file: _path.default.resolve(normalizedFileOrGlob)
|
||||
};
|
||||
}
|
||||
// rollup-plugin-postcss does not support dir-dependency messages
|
||||
// but directories can be watched in the same way as files
|
||||
if (message.type === "dir-dependency" && process.env.ROLLUP_WATCH === "true") {
|
||||
message = {
|
||||
type: "dependency",
|
||||
file: message.dir
|
||||
};
|
||||
}
|
||||
return message;
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
// Based on `glob-base`
|
||||
// https://github.com/micromatch/glob-base/blob/master/index.js
|
||||
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
|
||||
};
|
||||
}
|
31
node_modules/tailwindcss/lib/util/parseObjectStyles.js
generated
vendored
Normal file
31
node_modules/tailwindcss/lib/util/parseObjectStyles.js
generated
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = parseObjectStyles;
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
var _postcssNested = _interopRequireDefault(require("postcss-nested"));
|
||||
var _postcssJs = _interopRequireDefault(require("postcss-js"));
|
||||
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;
|
||||
});
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
187
node_modules/tailwindcss/lib/util/pluginUtils.js
generated
vendored
Normal file
187
node_modules/tailwindcss/lib/util/pluginUtils.js
generated
vendored
Normal file
@@ -0,0 +1,187 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.updateAllClasses = updateAllClasses;
|
||||
exports.asValue = asValue;
|
||||
exports.parseColorFormat = parseColorFormat;
|
||||
exports.asColor = asColor;
|
||||
exports.asLookupValue = asLookupValue;
|
||||
exports.coerceValue = coerceValue;
|
||||
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
||||
var _escapeCommas = _interopRequireDefault(require("./escapeCommas"));
|
||||
var _withAlphaVariable = require("./withAlphaVariable");
|
||||
var _dataTypes = require("./dataTypes");
|
||||
var _negateValue = _interopRequireDefault(require("./negateValue"));
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function updateAllClasses(selectors1, 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(selectors1);
|
||||
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 splitAlpha(modifier) {
|
||||
let slashIdx = modifier.lastIndexOf("/");
|
||||
if (slashIdx === -1 || slashIdx === modifier.length - 1) {
|
||||
return [
|
||||
modifier
|
||||
];
|
||||
}
|
||||
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(modifier, options = {}, { tailwindConfig ={} } = {}) {
|
||||
var ref;
|
||||
if (((ref = options.values) === null || ref === void 0 ? void 0 : ref[modifier]) !== undefined) {
|
||||
var ref1;
|
||||
return parseColorFormat((ref1 = options.values) === null || ref1 === void 0 ? void 0 : ref1[modifier]);
|
||||
}
|
||||
let [color, alpha] = splitAlpha(modifier);
|
||||
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(modifier, options, {
|
||||
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)=>{
|
||||
return asValue(modifier, options, {
|
||||
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)
|
||||
};
|
||||
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
|
||||
];
|
||||
}
|
||||
}
|
||||
// Find first matching type
|
||||
for (let type of [].concat(types)){
|
||||
let result = typeMap[type](modifier, options, {
|
||||
tailwindConfig
|
||||
});
|
||||
if (result !== undefined) return [
|
||||
result,
|
||||
type
|
||||
];
|
||||
}
|
||||
return [];
|
||||
}
|
20
node_modules/tailwindcss/lib/util/prefixSelector.js
generated
vendored
Normal file
20
node_modules/tailwindcss/lib/util/prefixSelector.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
var _postcssSelectorParser = _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);
|
||||
}
|
18
node_modules/tailwindcss/lib/util/removeAlphaVariables.js
generated
vendored
Normal file
18
node_modules/tailwindcss/lib/util/removeAlphaVariables.js
generated
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.removeAlphaVariables = 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
|
||||
});
|
||||
exports.default = resolveConfig;
|
||||
var _negateValue = _interopRequireDefault(require("./negateValue"));
|
||||
var _corePluginList = _interopRequireDefault(require("../corePluginList"));
|
||||
var _configurePlugins = _interopRequireDefault(require("./configurePlugins"));
|
||||
var _defaultConfigStub = _interopRequireDefault(require("../../stubs/defaultConfig.stub"));
|
||||
var _colors = _interopRequireDefault(require("../public/colors"));
|
||||
var _defaults = require("./defaults");
|
||||
var _toPath = require("./toPath");
|
||||
var _normalizeConfig = require("./normalizeConfig");
|
||||
var _isPlainObject = _interopRequireDefault(require("./isPlainObject"));
|
||||
var _cloneDeep = require("./cloneDeep");
|
||||
var _pluginUtils = require("./pluginUtils");
|
||||
var _withAlphaVariable = require("./withAlphaVariable");
|
||||
var _toColorValue = _interopRequireDefault(require("./toColorValue"));
|
||||
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));
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function isFunction(input) {
|
||||
return typeof input === "function";
|
||||
}
|
||||
function isObject(input) {
|
||||
return typeof input === "object" && input !== null;
|
||||
}
|
||||
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 (isObject(target[k]) && isObject(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, value1) {
|
||||
// When we have an array of objects, we do want to merge it
|
||||
if (Array.isArray(merged) && isObject(merged[0])) {
|
||||
return merged.concat(value1);
|
||||
}
|
||||
// When the incoming value is an array, and the existing config is an object, prepend the existing object
|
||||
if (Array.isArray(value1) && isObject(value1[0]) && isObject(merged)) {
|
||||
return [
|
||||
merged,
|
||||
...value1
|
||||
];
|
||||
}
|
||||
// Override arrays (for example for font-families, box-shadows, ...)
|
||||
if (Array.isArray(value1)) {
|
||||
return value1;
|
||||
}
|
||||
// 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 ref2;
|
||||
const plugins = (ref2 = config === null || config === void 0 ? void 0 : config.plugins) !== null && ref2 !== void 0 ? ref2 : [];
|
||||
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;
|
||||
}
|
51
node_modules/tailwindcss/lib/util/resolveConfigPath.js
generated
vendored
Normal file
51
node_modules/tailwindcss/lib/util/resolveConfigPath.js
generated
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = resolveConfigPath;
|
||||
var _fs = _interopRequireDefault(require("fs"));
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
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;
|
||||
}
|
||||
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;
|
||||
}
|
19
node_modules/tailwindcss/lib/util/responsive.js
generated
vendored
Normal file
19
node_modules/tailwindcss/lib/util/responsive.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = responsive;
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
var _cloneNodes = _interopRequireDefault(require("./cloneNodes"));
|
||||
function responsive(rules) {
|
||||
return _postcss.default.atRule({
|
||||
name: "responsive"
|
||||
}).append((0, _cloneNodes).default(Array.isArray(rules) ? rules : [
|
||||
rules
|
||||
]));
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
90
node_modules/tailwindcss/lib/util/splitAtTopLevelOnly.js
generated
vendored
Normal file
90
node_modules/tailwindcss/lib/util/splitAtTopLevelOnly.js
generated
vendored
Normal file
@@ -0,0 +1,90 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.splitAtTopLevelOnly = splitAtTopLevelOnly;
|
||||
var regex = _interopRequireWildcard(require("../lib/regex"));
|
||||
function _getRequireWildcardCache() {
|
||||
if (typeof WeakMap !== "function") return null;
|
||||
var cache = new WeakMap();
|
||||
_getRequireWildcardCache = function() {
|
||||
return cache;
|
||||
};
|
||||
return cache;
|
||||
}
|
||||
function _interopRequireWildcard(obj) {
|
||||
if (obj && obj.__esModule) {
|
||||
return obj;
|
||||
}
|
||||
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
||||
return {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
var cache = _getRequireWildcardCache();
|
||||
if (cache && cache.has(obj)) {
|
||||
return cache.get(obj);
|
||||
}
|
||||
var newObj = {};
|
||||
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
||||
for(var key in obj){
|
||||
if (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* splitAtTopLevelOnly(input, separator) {
|
||||
let SPECIALS = new RegExp(`[(){}\\[\\]${regex.escape(separator)}]`, "g");
|
||||
let depth = 0;
|
||||
let lastIndex = 0;
|
||||
let found = false;
|
||||
let separatorIndex = 0;
|
||||
let separatorStart = 0;
|
||||
let separatorLength = separator.length;
|
||||
// Find all paren-like things & character
|
||||
// And only split on commas if they're top-level
|
||||
for (let match of input.matchAll(SPECIALS)){
|
||||
let matchesSeparator = match[0] === separator[separatorIndex];
|
||||
let atEndOfSeparator = separatorIndex === separatorLength - 1;
|
||||
let matchesFullSeparator = matchesSeparator && atEndOfSeparator;
|
||||
if (match[0] === "(") depth++;
|
||||
if (match[0] === ")") depth--;
|
||||
if (match[0] === "[") depth++;
|
||||
if (match[0] === "]") depth--;
|
||||
if (match[0] === "{") depth++;
|
||||
if (match[0] === "}") depth--;
|
||||
if (matchesSeparator && depth === 0) {
|
||||
if (separatorStart === 0) {
|
||||
separatorStart = match.index;
|
||||
}
|
||||
separatorIndex++;
|
||||
}
|
||||
if (matchesFullSeparator && depth === 0) {
|
||||
found = true;
|
||||
yield input.substring(lastIndex, separatorStart);
|
||||
lastIndex = separatorStart + separatorLength;
|
||||
}
|
||||
if (separatorIndex === separatorLength) {
|
||||
separatorIndex = 0;
|
||||
separatorStart = 0;
|
||||
}
|
||||
}
|
||||
// Provide the last segment of the string if available
|
||||
// Otherwise the whole string since no `char`s were found
|
||||
// This mirrors the behavior of string.split()
|
||||
if (found) {
|
||||
yield input.substring(lastIndex);
|
||||
} else {
|
||||
yield input;
|
||||
}
|
||||
}
|
9
node_modules/tailwindcss/lib/util/tap.js
generated
vendored
Normal file
9
node_modules/tailwindcss/lib/util/tap.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.tap = tap;
|
||||
function tap(value, mutator) {
|
||||
mutator(value);
|
||||
return value;
|
||||
}
|
8
node_modules/tailwindcss/lib/util/toColorValue.js
generated
vendored
Normal file
8
node_modules/tailwindcss/lib/util/toColorValue.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toColorValue;
|
||||
function toColorValue(maybeFunction) {
|
||||
return typeof maybeFunction === "function" ? maybeFunction({}) : maybeFunction;
|
||||
}
|
14
node_modules/tailwindcss/lib/util/toPath.js
generated
vendored
Normal file
14
node_modules/tailwindcss/lib/util/toPath.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.toPath = 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);
|
||||
}
|
61
node_modules/tailwindcss/lib/util/transformThemeValue.js
generated
vendored
Normal file
61
node_modules/tailwindcss/lib/util/transformThemeValue.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = transformThemeValue;
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
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 ([
|
||||
"fontFamily",
|
||||
"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;
|
||||
};
|
||||
}
|
||||
function _interopRequireDefault(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
21
node_modules/tailwindcss/lib/util/validateConfig.js
generated
vendored
Normal file
21
node_modules/tailwindcss/lib/util/validateConfig.js
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.validateConfig = validateConfig;
|
||||
var _log = _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;
|
||||
}
|
67
node_modules/tailwindcss/lib/util/withAlphaVariable.js
generated
vendored
Normal file
67
node_modules/tailwindcss/lib/util/withAlphaVariable.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = withAlphaVariable;
|
||||
exports.withAlphaValue = withAlphaValue;
|
||||
var _color = require("./color");
|
||||
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})`
|
||||
})
|
||||
];
|
||||
}))
|
||||
};
|
||||
}
|
||||
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
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user