v1.0 with SW PWA enabled
This commit is contained in:
0
frontend/node_modules/tailwindcss/lib/cli.js
generated
vendored
Normal file → Executable file
0
frontend/node_modules/tailwindcss/lib/cli.js
generated
vendored
Normal file → Executable file
7
frontend/node_modules/tailwindcss/lib/cli/build/plugin.js
generated
vendored
7
frontend/node_modules/tailwindcss/lib/cli/build/plugin.js
generated
vendored
@ -52,10 +52,13 @@ function _interop_require_default(obj) {
|
||||
if (!config.plugins) {
|
||||
config.plugins = [];
|
||||
}
|
||||
// We have to await these because in v5 and v6 of postcss-load-config
|
||||
// these functions return promises while they don't in v4. Awaiting a
|
||||
// non-promise is basically a no-op so this is safe to do.
|
||||
return {
|
||||
file,
|
||||
plugins: (0, _plugins.default)(config, file),
|
||||
options: (0, _options.default)(config, file)
|
||||
plugins: await (0, _plugins.default)(config, file),
|
||||
options: await (0, _options.default)(config, file)
|
||||
};
|
||||
})() : await (0, _postcssloadconfig.default)();
|
||||
let configPlugins = config.plugins;
|
||||
|
||||
4
frontend/node_modules/tailwindcss/lib/corePlugins.js
generated
vendored
4
frontend/node_modules/tailwindcss/lib/corePlugins.js
generated
vendored
@ -441,8 +441,8 @@ let variantPlugins = {
|
||||
supportsVariants: ({ matchVariant , theme })=>{
|
||||
var _theme;
|
||||
matchVariant("supports", (value = "")=>{
|
||||
let check = (0, _dataTypes.normalize)(value);
|
||||
let isRaw = /^\w*\s*\(/.test(check);
|
||||
let check = value.startsWith("--") ? value : (0, _dataTypes.normalize)(value);
|
||||
let isRaw = /^[\w-]*\s*\(/.test(check);
|
||||
// Chrome has a bug where `(condition1)or(condition2)` is not valid
|
||||
// But `(condition1) or (condition2)` is supported.
|
||||
check = isRaw ? check.replace(/\b(and|or|not)\b/g, " $1 ") : check;
|
||||
|
||||
7
frontend/node_modules/tailwindcss/lib/lib/generateRules.js
generated
vendored
7
frontend/node_modules/tailwindcss/lib/lib/generateRules.js
generated
vendored
@ -182,7 +182,12 @@ function applyImportant(matches, classCandidate) {
|
||||
ast.each((sel)=>(0, _formatVariantSelector.eliminateIrrelevantSelectors)(sel, classCandidate));
|
||||
// Update all instances of the base candidate to include the important marker
|
||||
(0, _pluginUtils.updateAllClasses)(ast, (className)=>className === classCandidate ? `!${className}` : className);
|
||||
r.selector = ast.toString();
|
||||
let newSelector = ast.toString();
|
||||
if (newSelector.trim() === "") {
|
||||
r.remove();
|
||||
return;
|
||||
}
|
||||
r.selector = newSelector;
|
||||
r.walkDecls((d)=>d.important = true);
|
||||
});
|
||||
result.push([
|
||||
|
||||
9
frontend/node_modules/tailwindcss/lib/lib/load-config.js
generated
vendored
9
frontend/node_modules/tailwindcss/lib/lib/load-config.js
generated
vendored
@ -47,15 +47,8 @@ function lazyJiti() {
|
||||
function loadConfig(path) {
|
||||
let config = function() {
|
||||
if (!path) return {};
|
||||
// Always use jiti for now. There is a a bug that occurs in Node v22.12+
|
||||
// where imported files return invalid results
|
||||
return lazyJiti()(path);
|
||||
// Always use jiti for ESM or TS files
|
||||
if (path && (path.endsWith(".mjs") || path.endsWith(".ts") || path.endsWith(".cts") || path.endsWith(".mts"))) {
|
||||
return lazyJiti()(path);
|
||||
}
|
||||
try {
|
||||
return path ? require(path) : {};
|
||||
return require(path);
|
||||
} catch {
|
||||
return lazyJiti()(path);
|
||||
}
|
||||
|
||||
3
frontend/node_modules/tailwindcss/lib/lib/setupTrackingContext.js
generated
vendored
3
frontend/node_modules/tailwindcss/lib/lib/setupTrackingContext.js
generated
vendored
@ -66,6 +66,9 @@ function getTailwindConfig(configOrPath) {
|
||||
}
|
||||
// It has changed (based on timestamps), or first run
|
||||
for (let file of newDeps){
|
||||
// When loaded transitively through a TypeScript file `require.cache`
|
||||
// may be undefined. Happens in Node 22.18+.
|
||||
if (!require.cache) continue;
|
||||
delete require.cache[file];
|
||||
}
|
||||
let newConfig = (0, _validateConfig.validateConfig)((0, _resolveconfig.default)((0, _loadconfig.loadConfig)(userConfigPath)));
|
||||
|
||||
110
frontend/node_modules/tailwindcss/lib/util/dataTypes.js
generated
vendored
110
frontend/node_modules/tailwindcss/lib/util/dataTypes.js
generated
vendored
@ -59,6 +59,7 @@ _export(exports, {
|
||||
}
|
||||
});
|
||||
const _color = require("./color");
|
||||
const _mathoperators = require("./math-operators");
|
||||
const _parseBoxShadowValue = require("./parseBoxShadowValue");
|
||||
const _splitAtTopLevelOnly = require("./splitAtTopLevelOnly");
|
||||
let cssFunctions = [
|
||||
@ -118,7 +119,7 @@ function normalize(value, context = null, isRoot = true) {
|
||||
if (isRoot) {
|
||||
value = value.trim();
|
||||
}
|
||||
value = normalizeMathOperatorSpacing(value);
|
||||
value = (0, _mathoperators.addWhitespaceAroundMathOperators)(value);
|
||||
return value;
|
||||
}
|
||||
function normalizeAttributeSelectors(value) {
|
||||
@ -140,113 +141,6 @@ function normalizeAttributeSelectors(value) {
|
||||
}
|
||||
return value;
|
||||
}
|
||||
/**
|
||||
* Add spaces around operators inside math functions
|
||||
* like calc() that do not follow an operator, '(', or `,`.
|
||||
*
|
||||
* @param {string} value
|
||||
* @returns {string}
|
||||
*/ function normalizeMathOperatorSpacing(value) {
|
||||
let preventFormattingInFunctions = [
|
||||
"theme"
|
||||
];
|
||||
let preventFormattingKeywords = [
|
||||
"min-content",
|
||||
"max-content",
|
||||
"fit-content",
|
||||
// Env
|
||||
"safe-area-inset-top",
|
||||
"safe-area-inset-right",
|
||||
"safe-area-inset-bottom",
|
||||
"safe-area-inset-left",
|
||||
"titlebar-area-x",
|
||||
"titlebar-area-y",
|
||||
"titlebar-area-width",
|
||||
"titlebar-area-height",
|
||||
"keyboard-inset-top",
|
||||
"keyboard-inset-right",
|
||||
"keyboard-inset-bottom",
|
||||
"keyboard-inset-left",
|
||||
"keyboard-inset-width",
|
||||
"keyboard-inset-height",
|
||||
"radial-gradient",
|
||||
"linear-gradient",
|
||||
"conic-gradient",
|
||||
"repeating-radial-gradient",
|
||||
"repeating-linear-gradient",
|
||||
"repeating-conic-gradient",
|
||||
"anchor-size"
|
||||
];
|
||||
return value.replace(/(calc|min|max|clamp)\(.+\)/g, (match)=>{
|
||||
let result = "";
|
||||
function lastChar() {
|
||||
let char = result.trimEnd();
|
||||
return char[char.length - 1];
|
||||
}
|
||||
for(let i = 0; i < match.length; i++){
|
||||
function peek(word) {
|
||||
return word.split("").every((char, j)=>match[i + j] === char);
|
||||
}
|
||||
function consumeUntil(chars) {
|
||||
let minIndex = Infinity;
|
||||
for (let char of chars){
|
||||
let index = match.indexOf(char, i);
|
||||
if (index !== -1 && index < minIndex) {
|
||||
minIndex = index;
|
||||
}
|
||||
}
|
||||
let result = match.slice(i, minIndex);
|
||||
i += result.length - 1;
|
||||
return result;
|
||||
}
|
||||
let char = match[i];
|
||||
// Handle `var(--variable)`
|
||||
if (peek("var")) {
|
||||
// When we consume until `)`, then we are dealing with this scenario:
|
||||
// `var(--example)`
|
||||
//
|
||||
// When we consume until `,`, then we are dealing with this scenario:
|
||||
// `var(--example, 1rem)`
|
||||
//
|
||||
// In this case we do want to "format", the default value as well
|
||||
result += consumeUntil([
|
||||
")",
|
||||
","
|
||||
]);
|
||||
} else if (preventFormattingKeywords.some((keyword)=>peek(keyword))) {
|
||||
let keyword = preventFormattingKeywords.find((keyword)=>peek(keyword));
|
||||
result += keyword;
|
||||
i += keyword.length - 1;
|
||||
} else if (preventFormattingInFunctions.some((fn)=>peek(fn))) {
|
||||
result += consumeUntil([
|
||||
")"
|
||||
]);
|
||||
} else if (peek("[")) {
|
||||
result += consumeUntil([
|
||||
"]"
|
||||
]);
|
||||
} else if ([
|
||||
"+",
|
||||
"-",
|
||||
"*",
|
||||
"/"
|
||||
].includes(char) && ![
|
||||
"(",
|
||||
"+",
|
||||
"-",
|
||||
"*",
|
||||
"/",
|
||||
","
|
||||
].includes(lastChar())) {
|
||||
result += ` ${char} `;
|
||||
} else {
|
||||
result += char;
|
||||
}
|
||||
}
|
||||
// Simplify multiple spaces
|
||||
return result.replace(/\s+/g, " ");
|
||||
});
|
||||
}
|
||||
function url(value) {
|
||||
return value.startsWith("url(");
|
||||
}
|
||||
|
||||
152
frontend/node_modules/tailwindcss/lib/util/math-operators.js
generated
vendored
Normal file
152
frontend/node_modules/tailwindcss/lib/util/math-operators.js
generated
vendored
Normal file
@ -0,0 +1,152 @@
|
||||
"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, {
|
||||
hasMathFn: function() {
|
||||
return hasMathFn;
|
||||
},
|
||||
addWhitespaceAroundMathOperators: function() {
|
||||
return addWhitespaceAroundMathOperators;
|
||||
}
|
||||
});
|
||||
const LOWER_A = 0x61;
|
||||
const LOWER_Z = 0x7a;
|
||||
const UPPER_A = 0x41;
|
||||
const UPPER_Z = 0x5a;
|
||||
const LOWER_E = 0x65;
|
||||
const UPPER_E = 0x45;
|
||||
const ZERO = 0x30;
|
||||
const NINE = 0x39;
|
||||
const ADD = 0x2b;
|
||||
const SUB = 0x2d;
|
||||
const MUL = 0x2a;
|
||||
const DIV = 0x2f;
|
||||
const OPEN_PAREN = 0x28;
|
||||
const CLOSE_PAREN = 0x29;
|
||||
const COMMA = 0x2c;
|
||||
const SPACE = 0x20;
|
||||
const PERCENT = 0x25;
|
||||
const MATH_FUNCTIONS = [
|
||||
"calc",
|
||||
"min",
|
||||
"max",
|
||||
"clamp",
|
||||
"mod",
|
||||
"rem",
|
||||
"sin",
|
||||
"cos",
|
||||
"tan",
|
||||
"asin",
|
||||
"acos",
|
||||
"atan",
|
||||
"atan2",
|
||||
"pow",
|
||||
"sqrt",
|
||||
"hypot",
|
||||
"log",
|
||||
"exp",
|
||||
"round"
|
||||
];
|
||||
function hasMathFn(input) {
|
||||
return input.indexOf("(") !== -1 && MATH_FUNCTIONS.some((fn)=>input.includes(`${fn}(`));
|
||||
}
|
||||
function addWhitespaceAroundMathOperators(input) {
|
||||
// Bail early if there are no math functions in the input
|
||||
if (!MATH_FUNCTIONS.some((fn)=>input.includes(fn))) {
|
||||
return input;
|
||||
}
|
||||
let result = "";
|
||||
let formattable = [];
|
||||
let valuePos = null;
|
||||
let lastValuePos = null;
|
||||
for(let i = 0; i < input.length; i++){
|
||||
let char = input.charCodeAt(i);
|
||||
// Track if we see a number followed by a unit, then we know for sure that
|
||||
// this is not a function call.
|
||||
if (char >= ZERO && char <= NINE) {
|
||||
valuePos = i;
|
||||
} else if (valuePos !== null && (char === PERCENT || char >= LOWER_A && char <= LOWER_Z || char >= UPPER_A && char <= UPPER_Z)) {
|
||||
valuePos = i;
|
||||
} else {
|
||||
lastValuePos = valuePos;
|
||||
valuePos = null;
|
||||
}
|
||||
// Determine if we're inside a math function
|
||||
if (char === OPEN_PAREN) {
|
||||
result += input[i];
|
||||
// Scan backwards to determine the function name. This assumes math
|
||||
// functions are named with lowercase alphanumeric characters.
|
||||
let start = i;
|
||||
for(let j = i - 1; j >= 0; j--){
|
||||
let inner = input.charCodeAt(j);
|
||||
if (inner >= ZERO && inner <= NINE) {
|
||||
start = j // 0-9
|
||||
;
|
||||
} else if (inner >= LOWER_A && inner <= LOWER_Z) {
|
||||
start = j // a-z
|
||||
;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
let fn = input.slice(start, i);
|
||||
// This is a known math function so start formatting
|
||||
if (MATH_FUNCTIONS.includes(fn)) {
|
||||
formattable.unshift(true);
|
||||
continue;
|
||||
} else if (formattable[0] && fn === "") {
|
||||
formattable.unshift(true);
|
||||
continue;
|
||||
}
|
||||
// This is not a known math function so don't format it
|
||||
formattable.unshift(false);
|
||||
continue;
|
||||
} else if (char === CLOSE_PAREN) {
|
||||
result += input[i];
|
||||
formattable.shift();
|
||||
} else if (char === COMMA && formattable[0]) {
|
||||
result += `, `;
|
||||
continue;
|
||||
} else if (char === SPACE && formattable[0] && result.charCodeAt(result.length - 1) === SPACE) {
|
||||
continue;
|
||||
} else if ((char === ADD || char === MUL || char === DIV || char === SUB) && formattable[0]) {
|
||||
let trimmed = result.trimEnd();
|
||||
let prev = trimmed.charCodeAt(trimmed.length - 1);
|
||||
let prevPrev = trimmed.charCodeAt(trimmed.length - 2);
|
||||
let next = input.charCodeAt(i + 1);
|
||||
// Do not add spaces for scientific notation, e.g.: `-3.4e-2`
|
||||
if ((prev === LOWER_E || prev === UPPER_E) && prevPrev >= ZERO && prevPrev <= NINE) {
|
||||
result += input[i];
|
||||
continue;
|
||||
} else if (prev === ADD || prev === MUL || prev === DIV || prev === SUB) {
|
||||
result += input[i];
|
||||
continue;
|
||||
} else if (prev === OPEN_PAREN || prev === COMMA) {
|
||||
result += input[i];
|
||||
continue;
|
||||
} else if (input.charCodeAt(i - 1) === SPACE) {
|
||||
result += `${input[i]} `;
|
||||
} else if (// Previous is a digit
|
||||
prev >= ZERO && prev <= NINE || // Next is a digit
|
||||
next >= ZERO && next <= NINE || // Previous is end of a function call (or parenthesized expression)
|
||||
prev === CLOSE_PAREN || // Next is start of a parenthesized expression
|
||||
next === OPEN_PAREN || // Next is an operator
|
||||
next === ADD || next === MUL || next === DIV || next === SUB || // Previous position was a value (+ unit)
|
||||
lastValuePos !== null && lastValuePos === i - 1) {
|
||||
result += ` ${input[i]} `;
|
||||
} else {
|
||||
result += input[i];
|
||||
}
|
||||
} else {
|
||||
result += input[i];
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user