Revert "Commit updated Javascript packages"
This reverts commit a88734348a.
This commit is contained in:
36
build/javascript/node_modules/tailwindcss/lib/util/buildMediaQuery.js
generated
vendored
36
build/javascript/node_modules/tailwindcss/lib/util/buildMediaQuery.js
generated
vendored
@@ -1,36 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = buildMediaQuery;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function buildMediaQuery(screens) {
|
||||
if (_lodash.default.isString(screens)) {
|
||||
screens = {
|
||||
min: screens
|
||||
};
|
||||
}
|
||||
|
||||
if (!Array.isArray(screens)) {
|
||||
screens = [screens];
|
||||
}
|
||||
|
||||
return (0, _lodash.default)(screens).map(screen => {
|
||||
if (_lodash.default.has(screen, 'raw')) {
|
||||
return screen.raw;
|
||||
}
|
||||
|
||||
return (0, _lodash.default)(screen).map((value, feature) => {
|
||||
feature = _lodash.default.get({
|
||||
min: 'min-width',
|
||||
max: 'max-width'
|
||||
}, feature, feature);
|
||||
return `(${feature}: ${value})`;
|
||||
}).join(' and ');
|
||||
}).join(', ');
|
||||
}
|
||||
31
build/javascript/node_modules/tailwindcss/lib/util/buildSelectorVariant.js
generated
vendored
31
build/javascript/node_modules/tailwindcss/lib/util/buildSelectorVariant.js
generated
vendored
@@ -1,31 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
||||
|
||||
var _tap = _interopRequireDefault(require("lodash/tap"));
|
||||
|
||||
var _useMemo = require("./useMemo");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const buildSelectorVariant = (0, _useMemo.useMemo)((selector, variantName, separator, onError = () => {}) => {
|
||||
return (0, _postcssSelectorParser.default)(selectors => {
|
||||
(0, _tap.default)(selectors.first.filter(({
|
||||
type
|
||||
}) => type === 'class').pop(), classSelector => {
|
||||
if (classSelector === undefined) {
|
||||
onError('Variant cannot be generated because selector contains no classes.');
|
||||
return;
|
||||
}
|
||||
|
||||
classSelector.value = `${variantName}${separator}${classSelector.value}`;
|
||||
});
|
||||
}).processSync(selector);
|
||||
}, (selector, variantName, separator) => [selector, variantName, separator].join('||'));
|
||||
var _default = buildSelectorVariant;
|
||||
exports.default = _default;
|
||||
14
build/javascript/node_modules/tailwindcss/lib/util/cloneNodes.js
generated
vendored
14
build/javascript/node_modules/tailwindcss/lib/util/cloneNodes.js
generated
vendored
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = cloneNodes;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function cloneNodes(nodes) {
|
||||
return _lodash.default.map(nodes, node => node.clone());
|
||||
}
|
||||
17
build/javascript/node_modules/tailwindcss/lib/util/configurePlugins.js
generated
vendored
17
build/javascript/node_modules/tailwindcss/lib/util/configurePlugins.js
generated
vendored
@@ -1,17 +0,0 @@
|
||||
"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 : plugins.filter(pluginName => {
|
||||
return pluginConfig !== false && pluginConfig[pluginName] !== false;
|
||||
});
|
||||
return pluginNames;
|
||||
}
|
||||
28
build/javascript/node_modules/tailwindcss/lib/util/createPlugin.js
generated
vendored
28
build/javascript/node_modules/tailwindcss/lib/util/createPlugin.js
generated
vendored
@@ -1,28 +0,0 @@
|
||||
"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 {
|
||||
handler: pluginFunction(options),
|
||||
config: configFunction(options)
|
||||
};
|
||||
};
|
||||
|
||||
optionsFunction.__isOptionsFunction = true;
|
||||
return optionsFunction;
|
||||
};
|
||||
|
||||
var _default = createPlugin;
|
||||
exports.default = _default;
|
||||
44
build/javascript/node_modules/tailwindcss/lib/util/createUtilityPlugin.js
generated
vendored
44
build/javascript/node_modules/tailwindcss/lib/util/createUtilityPlugin.js
generated
vendored
@@ -1,44 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = createUtilityPlugin;
|
||||
|
||||
var _identity = _interopRequireDefault(require("lodash/identity"));
|
||||
|
||||
var _fromPairs = _interopRequireDefault(require("lodash/fromPairs"));
|
||||
|
||||
var _toPairs = _interopRequireDefault(require("lodash/toPairs"));
|
||||
|
||||
var _castArray = _interopRequireDefault(require("lodash/castArray"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function className(classPrefix, key) {
|
||||
if (key === 'default') {
|
||||
return classPrefix;
|
||||
}
|
||||
|
||||
if (key.startsWith('-')) {
|
||||
return `-${classPrefix}${key}`;
|
||||
}
|
||||
|
||||
return `${classPrefix}-${key}`;
|
||||
}
|
||||
|
||||
function createUtilityPlugin(themeKey, utilityVariations) {
|
||||
return function ({
|
||||
e,
|
||||
addUtilities,
|
||||
variants,
|
||||
theme
|
||||
}) {
|
||||
const utilities = utilityVariations.map(([classPrefix, properties, transformValue = _identity.default]) => {
|
||||
return (0, _fromPairs.default)((0, _toPairs.default)(theme(themeKey)).map(([key, value]) => {
|
||||
return [`.${e(className(classPrefix, key))}`, (0, _fromPairs.default)((0, _castArray.default)(properties).map(property => [property, transformValue(value)]))];
|
||||
}));
|
||||
});
|
||||
return addUtilities(utilities, variants(themeKey));
|
||||
};
|
||||
}
|
||||
19
build/javascript/node_modules/tailwindcss/lib/util/escapeClassName.js
generated
vendored
19
build/javascript/node_modules/tailwindcss/lib/util/escapeClassName.js
generated
vendored
@@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = escapeClassName;
|
||||
|
||||
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
||||
|
||||
var _get = _interopRequireDefault(require("lodash/get"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function escapeClassName(className) {
|
||||
const node = _postcssSelectorParser.default.className();
|
||||
|
||||
node.value = className;
|
||||
return (0, _get.default)(node, 'raws.value', node.value);
|
||||
}
|
||||
24
build/javascript/node_modules/tailwindcss/lib/util/flattenColorPalette.js
generated
vendored
24
build/javascript/node_modules/tailwindcss/lib/util/flattenColorPalette.js
generated
vendored
@@ -1,24 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = flattenColorPalette;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function flattenColorPalette(colors) {
|
||||
const result = (0, _lodash.default)(colors).flatMap((color, name) => {
|
||||
if (_lodash.default.isFunction(color) || !_lodash.default.isObject(color)) {
|
||||
return [[name, color]];
|
||||
}
|
||||
|
||||
return _lodash.default.map(color, (value, key) => {
|
||||
const suffix = key === 'default' ? '' : `-${key}`;
|
||||
return [`${name}${suffix}`, value];
|
||||
});
|
||||
}).fromPairs().value();
|
||||
return result;
|
||||
}
|
||||
57
build/javascript/node_modules/tailwindcss/lib/util/generateVariantFunction.js
generated
vendored
57
build/javascript/node_modules/tailwindcss/lib/util/generateVariantFunction.js
generated
vendored
@@ -1,57 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = generateVariantFunction;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
||||
|
||||
var _useMemo = require("./useMemo");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const classNameParser = (0, _postcssSelectorParser.default)(selectors => {
|
||||
return selectors.first.filter(({
|
||||
type
|
||||
}) => type === 'class').pop().value;
|
||||
});
|
||||
const getClassNameFromSelector = (0, _useMemo.useMemo)(selector => classNameParser.transformSync(selector), selector => selector);
|
||||
|
||||
function generateVariantFunction(generator, options = {}) {
|
||||
return {
|
||||
options,
|
||||
handler: (container, config) => {
|
||||
const cloned = _postcss.default.root({
|
||||
nodes: container.clone().nodes
|
||||
});
|
||||
|
||||
container.before(_lodash.default.defaultTo(generator({
|
||||
container: cloned,
|
||||
separator: config.separator,
|
||||
modifySelectors: modifierFunction => {
|
||||
cloned.each(rule => {
|
||||
if (rule.type !== 'rule') {
|
||||
return;
|
||||
}
|
||||
|
||||
rule.selectors = rule.selectors.map(selector => {
|
||||
return modifierFunction({
|
||||
get className() {
|
||||
return getClassNameFromSelector(selector);
|
||||
},
|
||||
|
||||
selector
|
||||
});
|
||||
});
|
||||
});
|
||||
return cloned;
|
||||
}
|
||||
}), cloned).nodes);
|
||||
}
|
||||
};
|
||||
}
|
||||
49
build/javascript/node_modules/tailwindcss/lib/util/getAllConfigs.js
generated
vendored
49
build/javascript/node_modules/tailwindcss/lib/util/getAllConfigs.js
generated
vendored
@@ -1,49 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = getAllConfigs;
|
||||
|
||||
var _defaultConfigStub = _interopRequireDefault(require("../../stubs/defaultConfig.stub.js"));
|
||||
|
||||
var _featureFlags = require("../featureFlags");
|
||||
|
||||
var _uniformColorPalette = _interopRequireDefault(require("../flagged/uniformColorPalette.js"));
|
||||
|
||||
var _extendedSpacingScale = _interopRequireDefault(require("../flagged/extendedSpacingScale.js"));
|
||||
|
||||
var _defaultLineHeights = _interopRequireDefault(require("../flagged/defaultLineHeights.js"));
|
||||
|
||||
var _extendedFontSizeScale = _interopRequireDefault(require("../flagged/extendedFontSizeScale.js"));
|
||||
|
||||
var _darkModeVariant = _interopRequireDefault(require("../flagged/darkModeVariant.js"));
|
||||
|
||||
var _standardFontWeights = _interopRequireDefault(require("../flagged/standardFontWeights"));
|
||||
|
||||
var _additionalBreakpoint = _interopRequireDefault(require("../flagged/additionalBreakpoint"));
|
||||
|
||||
var _lodash = require("lodash");
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function getAllConfigs(config, defaultPresets = [_defaultConfigStub.default]) {
|
||||
const configs = (0, _lodash.flatMap)([...(0, _lodash.get)(config, 'presets', defaultPresets)].reverse(), preset => {
|
||||
return getAllConfigs(preset, []);
|
||||
});
|
||||
const features = {
|
||||
uniformColorPalette: _uniformColorPalette.default,
|
||||
extendedSpacingScale: _extendedSpacingScale.default,
|
||||
defaultLineHeights: _defaultLineHeights.default,
|
||||
extendedFontSizeScale: _extendedFontSizeScale.default,
|
||||
standardFontWeights: _standardFontWeights.default,
|
||||
darkModeVariant: _darkModeVariant.default,
|
||||
additionalBreakpoint: _additionalBreakpoint.default
|
||||
};
|
||||
Object.keys(features).forEach(feature => {
|
||||
if ((0, _featureFlags.flagEnabled)(config, feature)) {
|
||||
configs.unshift(features[feature]);
|
||||
}
|
||||
});
|
||||
return [config, ...configs];
|
||||
}
|
||||
10
build/javascript/node_modules/tailwindcss/lib/util/increaseSpecificity.js
generated
vendored
10
build/javascript/node_modules/tailwindcss/lib/util/increaseSpecificity.js
generated
vendored
@@ -1,10 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
function _default(importantVal, selector) {
|
||||
return `${importantVal} ${selector}`;
|
||||
}
|
||||
35
build/javascript/node_modules/tailwindcss/lib/util/log.js
generated
vendored
35
build/javascript/node_modules/tailwindcss/lib/util/log.js
generated
vendored
@@ -1,35 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
|
||||
var _chalk = _interopRequireDefault(require("chalk"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
var _default = {
|
||||
info(messages) {
|
||||
console.warn('');
|
||||
messages.forEach(message => {
|
||||
console.warn(_chalk.default.bold.cyan('info'), '-', message);
|
||||
});
|
||||
},
|
||||
|
||||
warn(messages) {
|
||||
console.warn('');
|
||||
messages.forEach(message => {
|
||||
console.warn(_chalk.default.bold.yellow('warn'), '-', message);
|
||||
});
|
||||
},
|
||||
|
||||
risk(messages) {
|
||||
console.warn('');
|
||||
messages.forEach(message => {
|
||||
console.warn(_chalk.default.bold.magenta('risk'), '-', message);
|
||||
});
|
||||
}
|
||||
|
||||
};
|
||||
exports.default = _default;
|
||||
18
build/javascript/node_modules/tailwindcss/lib/util/negateValue.js
generated
vendored
18
build/javascript/node_modules/tailwindcss/lib/util/negateValue.js
generated
vendored
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _reduceCssCalc = _interopRequireDefault(require("reduce-css-calc"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _default(value) {
|
||||
try {
|
||||
return (0, _reduceCssCalc.default)(`calc(${value} * -1)`);
|
||||
} catch (e) {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
30
build/javascript/node_modules/tailwindcss/lib/util/parseObjectStyles.js
generated
vendored
30
build/javascript/node_modules/tailwindcss/lib/util/parseObjectStyles.js
generated
vendored
@@ -1,30 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = parseObjectStyles;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _postcssNested = _interopRequireDefault(require("postcss-nested"));
|
||||
|
||||
var _postcssJs = _interopRequireDefault(require("postcss-js"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function parseObjectStyles(styles) {
|
||||
if (!Array.isArray(styles)) {
|
||||
return parseObjectStyles([styles]);
|
||||
}
|
||||
|
||||
return _lodash.default.flatMap(styles, style => {
|
||||
return (0, _postcss.default)([(0, _postcssNested.default)({
|
||||
bubble: ['screen']
|
||||
})]).process(style, {
|
||||
parser: _postcssJs.default
|
||||
}).root.nodes;
|
||||
});
|
||||
}
|
||||
20
build/javascript/node_modules/tailwindcss/lib/util/prefixNegativeModifiers.js
generated
vendored
20
build/javascript/node_modules/tailwindcss/lib/util/prefixNegativeModifiers.js
generated
vendored
@@ -1,20 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = prefixNegativeModifiers;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function prefixNegativeModifiers(base, modifier) {
|
||||
if (modifier === '-') {
|
||||
return `-${base}`;
|
||||
} else if (_lodash.default.startsWith(modifier, '-')) {
|
||||
return `-${base}-${modifier.slice(1)}`;
|
||||
} else {
|
||||
return `${base}-${modifier}`;
|
||||
}
|
||||
}
|
||||
23
build/javascript/node_modules/tailwindcss/lib/util/prefixSelector.js
generated
vendored
23
build/javascript/node_modules/tailwindcss/lib/util/prefixSelector.js
generated
vendored
@@ -1,23 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _postcssSelectorParser = _interopRequireDefault(require("postcss-selector-parser"));
|
||||
|
||||
var _tap = _interopRequireDefault(require("lodash/tap"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function _default(prefix, selector) {
|
||||
const getPrefix = typeof prefix === 'function' ? prefix : () => prefix === undefined ? '' : prefix;
|
||||
return (0, _postcssSelectorParser.default)(selectors => {
|
||||
selectors.walkClasses(classSelector => {
|
||||
(0, _tap.default)(classSelector.value, baseClass => {
|
||||
classSelector.value = `${getPrefix('.' + baseClass)}${baseClass}`;
|
||||
});
|
||||
});
|
||||
}).processSync(selector);
|
||||
}
|
||||
162
build/javascript/node_modules/tailwindcss/lib/util/processPlugins.js
generated
vendored
162
build/javascript/node_modules/tailwindcss/lib/util/processPlugins.js
generated
vendored
@@ -1,162 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = _default;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _browserslist = _interopRequireDefault(require("browserslist"));
|
||||
|
||||
var _node = _interopRequireDefault(require("postcss/lib/node"));
|
||||
|
||||
var _isFunction = _interopRequireDefault(require("lodash/isFunction"));
|
||||
|
||||
var _escapeClassName = _interopRequireDefault(require("../util/escapeClassName"));
|
||||
|
||||
var _generateVariantFunction = _interopRequireDefault(require("../util/generateVariantFunction"));
|
||||
|
||||
var _parseObjectStyles = _interopRequireDefault(require("../util/parseObjectStyles"));
|
||||
|
||||
var _prefixSelector = _interopRequireDefault(require("../util/prefixSelector"));
|
||||
|
||||
var _wrapWithVariants = _interopRequireDefault(require("../util/wrapWithVariants"));
|
||||
|
||||
var _cloneNodes = _interopRequireDefault(require("../util/cloneNodes"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function parseStyles(styles) {
|
||||
if (!Array.isArray(styles)) {
|
||||
return parseStyles([styles]);
|
||||
}
|
||||
|
||||
return _lodash.default.flatMap(styles, style => style instanceof _node.default ? style : (0, _parseObjectStyles.default)(style));
|
||||
}
|
||||
|
||||
function wrapWithLayer(rules, layer) {
|
||||
return _postcss.default.atRule({
|
||||
name: 'layer',
|
||||
params: layer
|
||||
}).append((0, _cloneNodes.default)(Array.isArray(rules) ? rules : [rules]));
|
||||
}
|
||||
|
||||
function isKeyframeRule(rule) {
|
||||
return rule.parent && rule.parent.type === 'atrule' && /keyframes$/.test(rule.parent.name);
|
||||
}
|
||||
|
||||
function _default(plugins, config) {
|
||||
const pluginBaseStyles = [];
|
||||
const pluginComponents = [];
|
||||
const pluginUtilities = [];
|
||||
const pluginVariantGenerators = {};
|
||||
|
||||
const applyConfiguredPrefix = selector => {
|
||||
return (0, _prefixSelector.default)(config.prefix, selector);
|
||||
};
|
||||
|
||||
const getConfigValue = (path, defaultValue) => path ? _lodash.default.get(config, path, defaultValue) : config;
|
||||
|
||||
const browserslistTarget = (0, _browserslist.default)().includes('ie 11') ? 'ie11' : 'relaxed';
|
||||
plugins.forEach(plugin => {
|
||||
if (plugin.__isOptionsFunction) {
|
||||
plugin = plugin();
|
||||
}
|
||||
|
||||
const handler = (0, _isFunction.default)(plugin) ? plugin : _lodash.default.get(plugin, 'handler', () => {});
|
||||
handler({
|
||||
postcss: _postcss.default,
|
||||
config: getConfigValue,
|
||||
theme: (path, defaultValue) => getConfigValue(`theme.${path}`, defaultValue),
|
||||
corePlugins: path => {
|
||||
if (Array.isArray(config.corePlugins)) {
|
||||
return config.corePlugins.includes(path);
|
||||
}
|
||||
|
||||
return getConfigValue(`corePlugins.${path}`, true);
|
||||
},
|
||||
variants: (path, defaultValue) => {
|
||||
if (Array.isArray(config.variants)) {
|
||||
return config.variants;
|
||||
}
|
||||
|
||||
return getConfigValue(`variants.${path}`, defaultValue);
|
||||
},
|
||||
target: path => {
|
||||
if (_lodash.default.isString(config.target)) {
|
||||
return config.target === 'browserslist' ? browserslistTarget : config.target;
|
||||
}
|
||||
|
||||
const [defaultTarget, targetOverrides] = getConfigValue('target', 'relaxed');
|
||||
|
||||
const target = _lodash.default.get(targetOverrides, path, defaultTarget);
|
||||
|
||||
return target === 'browserslist' ? browserslistTarget : target;
|
||||
},
|
||||
e: _escapeClassName.default,
|
||||
prefix: applyConfiguredPrefix,
|
||||
addUtilities: (utilities, options) => {
|
||||
const defaultOptions = {
|
||||
variants: [],
|
||||
respectPrefix: true,
|
||||
respectImportant: true
|
||||
};
|
||||
options = Array.isArray(options) ? Object.assign({}, defaultOptions, {
|
||||
variants: options
|
||||
}) : _lodash.default.defaults(options, defaultOptions);
|
||||
|
||||
const styles = _postcss.default.root({
|
||||
nodes: parseStyles(utilities)
|
||||
});
|
||||
|
||||
styles.walkRules(rule => {
|
||||
if (options.respectPrefix && !isKeyframeRule(rule)) {
|
||||
rule.selector = applyConfiguredPrefix(rule.selector);
|
||||
}
|
||||
|
||||
if (options.respectImportant && config.important) {
|
||||
rule.__tailwind = { ...rule.__tailwind,
|
||||
important: config.important
|
||||
};
|
||||
}
|
||||
});
|
||||
pluginUtilities.push(wrapWithLayer((0, _wrapWithVariants.default)(styles.nodes, options.variants), 'utilities'));
|
||||
},
|
||||
addComponents: (components, options) => {
|
||||
const defaultOptions = {
|
||||
variants: [],
|
||||
respectPrefix: true
|
||||
};
|
||||
options = Array.isArray(options) ? Object.assign({}, defaultOptions, {
|
||||
variants: options
|
||||
}) : _lodash.default.defaults(options, defaultOptions);
|
||||
|
||||
const styles = _postcss.default.root({
|
||||
nodes: parseStyles(components)
|
||||
});
|
||||
|
||||
styles.walkRules(rule => {
|
||||
if (options.respectPrefix && !isKeyframeRule(rule)) {
|
||||
rule.selector = applyConfiguredPrefix(rule.selector);
|
||||
}
|
||||
});
|
||||
pluginComponents.push(wrapWithLayer((0, _wrapWithVariants.default)(styles.nodes, options.variants), 'components'));
|
||||
},
|
||||
addBase: baseStyles => {
|
||||
pluginBaseStyles.push(wrapWithLayer(parseStyles(baseStyles), 'base'));
|
||||
},
|
||||
addVariant: (name, generator, options = {}) => {
|
||||
pluginVariantGenerators[name] = (0, _generateVariantFunction.default)(generator, options);
|
||||
}
|
||||
});
|
||||
});
|
||||
return {
|
||||
base: pluginBaseStyles,
|
||||
components: pluginComponents,
|
||||
utilities: pluginUtilities,
|
||||
variantGenerators: pluginVariantGenerators
|
||||
};
|
||||
}
|
||||
222
build/javascript/node_modules/tailwindcss/lib/util/resolveConfig.js
generated
vendored
222
build/javascript/node_modules/tailwindcss/lib/util/resolveConfig.js
generated
vendored
@@ -1,222 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = resolveConfig;
|
||||
|
||||
var _some = _interopRequireDefault(require("lodash/some"));
|
||||
|
||||
var _mergeWith = _interopRequireDefault(require("lodash/mergeWith"));
|
||||
|
||||
var _isFunction = _interopRequireDefault(require("lodash/isFunction"));
|
||||
|
||||
var _isUndefined = _interopRequireDefault(require("lodash/isUndefined"));
|
||||
|
||||
var _defaults = _interopRequireDefault(require("lodash/defaults"));
|
||||
|
||||
var _map = _interopRequireDefault(require("lodash/map"));
|
||||
|
||||
var _get = _interopRequireDefault(require("lodash/get"));
|
||||
|
||||
var _toPath = _interopRequireDefault(require("lodash/toPath"));
|
||||
|
||||
var _negateValue = _interopRequireDefault(require("./negateValue"));
|
||||
|
||||
var _corePluginList = require("../corePluginList");
|
||||
|
||||
var _configurePlugins = _interopRequireDefault(require("./configurePlugins"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
const configUtils = {
|
||||
negative(scale) {
|
||||
return Object.keys(scale).filter(key => scale[key] !== '0').reduce((negativeScale, key) => ({ ...negativeScale,
|
||||
[`-${key}`]: (0, _negateValue.default)(scale[key])
|
||||
}), {});
|
||||
},
|
||||
|
||||
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 (0, _isFunction.default)(valueToResolve) ? valueToResolve(...args) : valueToResolve;
|
||||
}
|
||||
|
||||
function mergeThemes(themes) {
|
||||
const theme = (({
|
||||
extend: _,
|
||||
...t
|
||||
}) => t)(themes.reduce((merged, t) => {
|
||||
return (0, _defaults.default)(merged, t);
|
||||
}, {}));
|
||||
|
||||
return { ...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: themes.reduce((merged, {
|
||||
extend
|
||||
}) => {
|
||||
return (0, _mergeWith.default)(merged, extend, (mergedValue, extendValue) => {
|
||||
if ((0, _isUndefined.default)(mergedValue)) {
|
||||
return [extendValue];
|
||||
}
|
||||
|
||||
if (Array.isArray(mergedValue)) {
|
||||
return [extendValue, ...mergedValue];
|
||||
}
|
||||
|
||||
return [extendValue, mergedValue];
|
||||
});
|
||||
}, {})
|
||||
};
|
||||
}
|
||||
|
||||
function mergeExtensions({
|
||||
extend,
|
||||
...theme
|
||||
}) {
|
||||
return (0, _mergeWith.default)(theme, extend, (themeValue, extensions) => {
|
||||
// The `extend` property is an array, so we need to check if it contains any functions
|
||||
if (!(0, _isFunction.default)(themeValue) && !(0, _some.default)(extensions, _isFunction.default)) {
|
||||
return { ...themeValue,
|
||||
...Object.assign({}, ...extensions)
|
||||
};
|
||||
}
|
||||
|
||||
return (resolveThemePath, utils) => ({ ...value(themeValue, resolveThemePath, utils),
|
||||
...Object.assign({}, ...extensions.map(e => value(e, resolveThemePath, utils)))
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function resolveFunctionKeys(object) {
|
||||
const resolvePath = (key, defaultValue) => {
|
||||
const path = (0, _toPath.default)(key);
|
||||
let index = 0;
|
||||
let val = object;
|
||||
|
||||
while (val !== undefined && val !== null && index < path.length) {
|
||||
val = val[path[index++]];
|
||||
val = (0, _isFunction.default)(val) ? val(resolvePath, configUtils) : val;
|
||||
}
|
||||
|
||||
return val === undefined ? defaultValue : val;
|
||||
};
|
||||
|
||||
return Object.keys(object).reduce((resolved, key) => {
|
||||
return { ...resolved,
|
||||
[key]: (0, _isFunction.default)(object[key]) ? object[key](resolvePath, configUtils) : object[key]
|
||||
};
|
||||
}, {});
|
||||
}
|
||||
|
||||
function extractPluginConfigs(configs) {
|
||||
let allConfigs = [];
|
||||
configs.forEach(config => {
|
||||
allConfigs = [...allConfigs, config];
|
||||
const plugins = (0, _get.default)(config, 'plugins', []);
|
||||
|
||||
if (plugins.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
plugins.forEach(plugin => {
|
||||
if (plugin.__isOptionsFunction) {
|
||||
plugin = plugin();
|
||||
}
|
||||
|
||||
allConfigs = [...allConfigs, ...extractPluginConfigs([(0, _get.default)(plugin, 'config', {})])];
|
||||
});
|
||||
});
|
||||
return allConfigs;
|
||||
}
|
||||
|
||||
function resolveVariants([firstConfig, ...variantConfigs]) {
|
||||
if (Array.isArray(firstConfig)) {
|
||||
return firstConfig;
|
||||
}
|
||||
|
||||
return [firstConfig, ...variantConfigs].reverse().reduce((resolved, variants) => {
|
||||
Object.entries(variants || {}).forEach(([plugin, pluginVariants]) => {
|
||||
if ((0, _isFunction.default)(pluginVariants)) {
|
||||
resolved[plugin] = pluginVariants({
|
||||
variants(path) {
|
||||
return (0, _get.default)(resolved, path, []);
|
||||
},
|
||||
|
||||
before(toInsert, variant, existingPluginVariants = (0, _get.default)(resolved, plugin, [])) {
|
||||
if (variant === undefined) {
|
||||
return [...toInsert, ...existingPluginVariants];
|
||||
}
|
||||
|
||||
const index = existingPluginVariants.indexOf(variant);
|
||||
|
||||
if (index === -1) {
|
||||
return [...existingPluginVariants, ...toInsert];
|
||||
}
|
||||
|
||||
return [...existingPluginVariants.slice(0, index), ...toInsert, ...existingPluginVariants.slice(index)];
|
||||
},
|
||||
|
||||
after(toInsert, variant, existingPluginVariants = (0, _get.default)(resolved, plugin, [])) {
|
||||
if (variant === undefined) {
|
||||
return [...existingPluginVariants, ...toInsert];
|
||||
}
|
||||
|
||||
const index = existingPluginVariants.indexOf(variant);
|
||||
|
||||
if (index === -1) {
|
||||
return [...toInsert, ...existingPluginVariants];
|
||||
}
|
||||
|
||||
return [...existingPluginVariants.slice(0, index + 1), ...toInsert, ...existingPluginVariants.slice(index + 1)];
|
||||
},
|
||||
|
||||
without(toRemove, existingPluginVariants = (0, _get.default)(resolved, plugin, [])) {
|
||||
return existingPluginVariants.filter(v => !toRemove.includes(v));
|
||||
}
|
||||
|
||||
});
|
||||
} else {
|
||||
resolved[plugin] = pluginVariants;
|
||||
}
|
||||
});
|
||||
return resolved;
|
||||
}, {});
|
||||
}
|
||||
|
||||
function resolveCorePlugins(corePluginConfigs) {
|
||||
const result = [...corePluginConfigs].reverse().reduce((resolved, corePluginConfig) => {
|
||||
if ((0, _isFunction.default)(corePluginConfig)) {
|
||||
return corePluginConfig({
|
||||
corePlugins: resolved
|
||||
});
|
||||
}
|
||||
|
||||
return (0, _configurePlugins.default)(corePluginConfig, resolved);
|
||||
}, _corePluginList.corePluginList);
|
||||
return result;
|
||||
}
|
||||
|
||||
function resolvePluginLists(pluginLists) {
|
||||
const result = [...pluginLists].reverse().reduce((resolved, pluginList) => {
|
||||
return [...resolved, ...pluginList];
|
||||
}, []);
|
||||
return result;
|
||||
}
|
||||
|
||||
function resolveConfig(configs) {
|
||||
const allConfigs = extractPluginConfigs(configs);
|
||||
return (0, _defaults.default)({
|
||||
theme: resolveFunctionKeys(mergeExtensions(mergeThemes((0, _map.default)(allConfigs, t => (0, _get.default)(t, 'theme', {}))))),
|
||||
variants: resolveVariants(allConfigs.map(c => c.variants)),
|
||||
corePlugins: resolveCorePlugins(allConfigs.map(c => c.corePlugins)),
|
||||
plugins: resolvePluginLists(configs.map(c => (0, _get.default)(c, 'plugins', [])))
|
||||
}, ...allConfigs);
|
||||
}
|
||||
18
build/javascript/node_modules/tailwindcss/lib/util/responsive.js
generated
vendored
18
build/javascript/node_modules/tailwindcss/lib/util/responsive.js
generated
vendored
@@ -1,18 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = responsive;
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _cloneNodes = _interopRequireDefault(require("./cloneNodes"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function responsive(rules) {
|
||||
return _postcss.default.atRule({
|
||||
name: 'responsive'
|
||||
}).append((0, _cloneNodes.default)(Array.isArray(rules) ? rules : [rules]));
|
||||
}
|
||||
14
build/javascript/node_modules/tailwindcss/lib/util/toColorValue.js
generated
vendored
14
build/javascript/node_modules/tailwindcss/lib/util/toColorValue.js
generated
vendored
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = toColorValue;
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function toColorValue(maybeFunction) {
|
||||
return _lodash.default.isFunction(maybeFunction) ? maybeFunction({}) : maybeFunction;
|
||||
}
|
||||
21
build/javascript/node_modules/tailwindcss/lib/util/useMemo.js
generated
vendored
21
build/javascript/node_modules/tailwindcss/lib/util/useMemo.js
generated
vendored
@@ -1,21 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.useMemo = useMemo;
|
||||
|
||||
function useMemo(cb, keyResolver) {
|
||||
const cache = new Map();
|
||||
return (...args) => {
|
||||
const key = keyResolver(...args);
|
||||
|
||||
if (cache.has(key)) {
|
||||
return cache.get(key);
|
||||
}
|
||||
|
||||
const result = cb(...args);
|
||||
cache.set(key, result);
|
||||
return result;
|
||||
};
|
||||
}
|
||||
22
build/javascript/node_modules/tailwindcss/lib/util/usesCustomProperties.js
generated
vendored
22
build/javascript/node_modules/tailwindcss/lib/util/usesCustomProperties.js
generated
vendored
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = usesCustomProperties;
|
||||
|
||||
var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function usesCustomProperties(value) {
|
||||
let foundCustomProperty = false;
|
||||
(0, _postcssValueParser.default)(value).walk(node => {
|
||||
if (node.type === 'function' && node.value === 'var') {
|
||||
foundCustomProperty = true;
|
||||
}
|
||||
|
||||
return !foundCustomProperty;
|
||||
});
|
||||
return foundCustomProperty;
|
||||
}
|
||||
56
build/javascript/node_modules/tailwindcss/lib/util/withAlphaVariable.js
generated
vendored
56
build/javascript/node_modules/tailwindcss/lib/util/withAlphaVariable.js
generated
vendored
@@ -1,56 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.toRgba = toRgba;
|
||||
exports.default = withAlphaVariable;
|
||||
|
||||
var _color = _interopRequireDefault(require("color"));
|
||||
|
||||
var _lodash = _interopRequireDefault(require("lodash"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function hasAlpha(color) {
|
||||
return color.startsWith('rgba(') || color.startsWith('hsla(') || color.startsWith('#') && color.length === 9 || color.startsWith('#') && color.length === 5;
|
||||
}
|
||||
|
||||
function toRgba(color) {
|
||||
const [r, g, b, a] = (0, _color.default)(color).rgb().array();
|
||||
return [r, g, b, a === undefined && hasAlpha(color) ? 1 : a];
|
||||
}
|
||||
|
||||
function withAlphaVariable({
|
||||
color,
|
||||
property,
|
||||
variable
|
||||
}) {
|
||||
if (_lodash.default.isFunction(color)) {
|
||||
return {
|
||||
[variable]: '1',
|
||||
[property]: color({
|
||||
opacityVariable: variable
|
||||
})
|
||||
};
|
||||
}
|
||||
|
||||
try {
|
||||
const [r, g, b, a] = toRgba(color);
|
||||
|
||||
if (a !== undefined) {
|
||||
return {
|
||||
[property]: color
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
[variable]: '1',
|
||||
[property]: [color, `rgba(${r}, ${g}, ${b}, var(${variable}))`]
|
||||
};
|
||||
} catch (error) {
|
||||
return {
|
||||
[property]: color
|
||||
};
|
||||
}
|
||||
}
|
||||
31
build/javascript/node_modules/tailwindcss/lib/util/wrapWithVariants.js
generated
vendored
31
build/javascript/node_modules/tailwindcss/lib/util/wrapWithVariants.js
generated
vendored
@@ -1,31 +0,0 @@
|
||||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = wrapWithVariants;
|
||||
|
||||
var _postcss = _interopRequireDefault(require("postcss"));
|
||||
|
||||
var _cloneNodes = _interopRequireDefault(require("./cloneNodes"));
|
||||
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
|
||||
function wrapWithVariants(rules, variants) {
|
||||
let foundVariantAtRule = false;
|
||||
|
||||
_postcss.default.root({
|
||||
nodes: rules
|
||||
}).walkAtRules('variants', () => {
|
||||
foundVariantAtRule = true;
|
||||
});
|
||||
|
||||
if (foundVariantAtRule) {
|
||||
return (0, _cloneNodes.default)(rules);
|
||||
}
|
||||
|
||||
return _postcss.default.atRule({
|
||||
name: 'variants',
|
||||
params: variants.join(', ')
|
||||
}).append((0, _cloneNodes.default)(Array.isArray(rules) ? rules : [rules]));
|
||||
}
|
||||
Reference in New Issue
Block a user