This commit is contained in:
Yamozha
2021-04-02 02:24:13 +03:00
parent c23950b545
commit 7256d79e2c
31493 changed files with 3036630 additions and 0 deletions

View File

@ -0,0 +1,7 @@
// https://developer.mozilla.org/en-US/docs/Web/CSS/background-clip#Browser_compatibility
export default function backgroundClip(property, value) {
if (typeof value === 'string' && value === 'text') {
return ['-webkit-text', 'text'];
}
}

11
node_modules/inline-style-prefixer/es/plugins/calc.js generated vendored Normal file
View File

@ -0,0 +1,11 @@
import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';
var prefixes = ['-webkit-', '-moz-', ''];
export default function calc(property, value) {
if (typeof value === 'string' && !isPrefixedValue(value) && value.indexOf('calc(') > -1) {
return prefixes.map(function (prefix) {
return value.replace(/calc\(/g, prefix + 'calc(');
});
}
}

View File

@ -0,0 +1,12 @@
import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';
// http://caniuse.com/#search=cross-fade
var prefixes = ['-webkit-', ''];
export default function crossFade(property, value) {
if (typeof value === 'string' && !isPrefixedValue(value) && value.indexOf('cross-fade(') > -1) {
return prefixes.map(function (prefix) {
return value.replace(/cross-fade\(/g, prefix + 'cross-fade(');
});
}
}

View File

@ -0,0 +1,16 @@
var prefixes = ['-webkit-', '-moz-', ''];
var values = {
'zoom-in': true,
'zoom-out': true,
grab: true,
grabbing: true
};
export default function cursor(property, value) {
if (property === 'cursor' && values.hasOwnProperty(value)) {
return prefixes.map(function (prefix) {
return prefix + value;
});
}
}

View File

@ -0,0 +1,12 @@
import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';
// http://caniuse.com/#feat=css-filter-function
var prefixes = ['-webkit-', ''];
export default function filter(property, value) {
if (typeof value === 'string' && !isPrefixedValue(value) && value.indexOf('filter(') > -1) {
return prefixes.map(function (prefix) {
return value.replace(/filter\(/g, prefix + 'filter(');
});
}
}

10
node_modules/inline-style-prefixer/es/plugins/flex.js generated vendored Normal file
View File

@ -0,0 +1,10 @@
var values = {
flex: ['-webkit-box', '-moz-box', '-ms-flexbox', '-webkit-flex', 'flex'],
'inline-flex': ['-webkit-inline-box', '-moz-inline-box', '-ms-inline-flexbox', '-webkit-inline-flex', 'inline-flex']
};
export default function flex(property, value) {
if (property === 'display' && values.hasOwnProperty(value)) {
return values[value];
}
}

View File

@ -0,0 +1,67 @@
var alternativeValues = {
'space-around': 'distribute',
'space-between': 'justify',
'flex-start': 'start',
'flex-end': 'end'
};
var alternativeProps = {
alignContent: 'msFlexLinePack',
alignSelf: 'msFlexItemAlign',
alignItems: 'msFlexAlign',
justifyContent: 'msFlexPack',
order: 'msFlexOrder',
flexGrow: 'msFlexPositive',
flexShrink: 'msFlexNegative',
flexBasis: 'msFlexPreferredSize'
// Full expanded syntax is flex-grow | flex-shrink | flex-basis.
};var flexShorthandMappings = {
auto: '1 1 auto',
inherit: 'inherit',
initial: '0 1 auto',
none: '0 0 auto',
unset: 'unset'
};
var isUnitlessNumber = /^\d+(\.\d+)?$/;
export default function flexboxIE(property, value, style) {
if (Object.prototype.hasOwnProperty.call(alternativeProps, property)) {
style[alternativeProps[property]] = alternativeValues[value] || value;
}
if (property === 'flex') {
// For certain values we can do straight mappings based on the spec
// for the expansions.
if (Object.prototype.hasOwnProperty.call(flexShorthandMappings, value)) {
style.msFlex = flexShorthandMappings[value];
return;
}
// Here we have no direct mapping, so we favor looking for a
// unitless positive number as that will be the most common use-case.
if (isUnitlessNumber.test(value)) {
style.msFlex = value + ' 1 0%';
return;
}
// The next thing we can look for is if there are multiple values.
var flexValues = value.split(/\s/);
// If we only have a single value that wasn't a positive unitless
// or a pre-mapped value, then we can assume it is a unit value.
switch (flexValues.length) {
case 1:
style.msFlex = '1 1 ' + value;
return;
case 2:
// If we have 2 units, then we expect that the first will
// always be a unitless number and represents flex-grow.
// The second unit will represent flex-shrink for a unitless
// value, or flex-basis otherwise.
if (isUnitlessNumber.test(flexValues[1])) {
style.msFlex = flexValues[0] + ' ' + flexValues[1] + ' 0%';
} else {
style.msFlex = flexValues[0] + ' 1 ' + flexValues[1];
}
return;
default:
style.msFlex = value;
}
}
}

View File

@ -0,0 +1,33 @@
var alternativeValues = {
'space-around': 'justify',
'space-between': 'justify',
'flex-start': 'start',
'flex-end': 'end',
'wrap-reverse': 'multiple',
wrap: 'multiple'
};
var alternativeProps = {
alignItems: 'WebkitBoxAlign',
justifyContent: 'WebkitBoxPack',
flexWrap: 'WebkitBoxLines',
flexGrow: 'WebkitBoxFlex'
};
export default function flexboxOld(property, value, style) {
if (property === 'flexDirection' && typeof value === 'string') {
if (value.indexOf('column') > -1) {
style.WebkitBoxOrient = 'vertical';
} else {
style.WebkitBoxOrient = 'horizontal';
}
if (value.indexOf('reverse') > -1) {
style.WebkitBoxDirection = 'reverse';
} else {
style.WebkitBoxDirection = 'normal';
}
}
if (alternativeProps.hasOwnProperty(property)) {
style[alternativeProps[property]] = alternativeValues[value] || value;
}
}

View File

@ -0,0 +1,14 @@
import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';
var prefixes = ['-webkit-', '-moz-', ''];
var values = /linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/gi;
export default function gradient(property, value) {
if (typeof value === 'string' && !isPrefixedValue(value) && values.test(value)) {
return prefixes.map(function (prefix) {
return value.replace(values, function (grad) {
return prefix + grad;
});
});
}
}

129
node_modules/inline-style-prefixer/es/plugins/grid.js generated vendored Normal file
View File

@ -0,0 +1,129 @@
var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
function isSimplePositionValue(value) {
return typeof value === 'number' && !isNaN(value);
}
function isComplexSpanValue(value) {
return typeof value === 'string' && value.includes('/');
}
var alignmentValues = ['center', 'end', 'start', 'stretch'];
var displayValues = {
'inline-grid': ['-ms-inline-grid', 'inline-grid'],
grid: ['-ms-grid', 'grid']
};
var propertyConverters = {
alignSelf: function alignSelf(value, style) {
if (alignmentValues.indexOf(value) > -1) {
style.msGridRowAlign = value;
}
},
gridColumn: function gridColumn(value, style) {
if (isSimplePositionValue(value)) {
style.msGridColumn = value;
} else if (isComplexSpanValue(value)) {
var _value$split = value.split('/'),
_value$split2 = _slicedToArray(_value$split, 2),
start = _value$split2[0],
end = _value$split2[1];
propertyConverters.gridColumnStart(+start, style);
var _end$split = end.split(/ ?span /),
_end$split2 = _slicedToArray(_end$split, 2),
maybeSpan = _end$split2[0],
maybeNumber = _end$split2[1];
if (maybeSpan === '') {
propertyConverters.gridColumnEnd(+start + +maybeNumber, style);
} else {
propertyConverters.gridColumnEnd(+end, style);
}
} else {
propertyConverters.gridColumnStart(value, style);
}
},
gridColumnEnd: function gridColumnEnd(value, style) {
var msGridColumn = style.msGridColumn;
if (isSimplePositionValue(value) && isSimplePositionValue(msGridColumn)) {
style.msGridColumnSpan = value - msGridColumn;
}
},
gridColumnStart: function gridColumnStart(value, style) {
if (isSimplePositionValue(value)) {
style.msGridColumn = value;
}
},
gridRow: function gridRow(value, style) {
if (isSimplePositionValue(value)) {
style.msGridRow = value;
} else if (isComplexSpanValue(value)) {
var _value$split3 = value.split('/'),
_value$split4 = _slicedToArray(_value$split3, 2),
start = _value$split4[0],
end = _value$split4[1];
propertyConverters.gridRowStart(+start, style);
var _end$split3 = end.split(/ ?span /),
_end$split4 = _slicedToArray(_end$split3, 2),
maybeSpan = _end$split4[0],
maybeNumber = _end$split4[1];
if (maybeSpan === '') {
propertyConverters.gridRowEnd(+start + +maybeNumber, style);
} else {
propertyConverters.gridRowEnd(+end, style);
}
} else {
propertyConverters.gridRowStart(value, style);
}
},
gridRowEnd: function gridRowEnd(value, style) {
var msGridRow = style.msGridRow;
if (isSimplePositionValue(value) && isSimplePositionValue(msGridRow)) {
style.msGridRowSpan = value - msGridRow;
}
},
gridRowStart: function gridRowStart(value, style) {
if (isSimplePositionValue(value)) {
style.msGridRow = value;
}
},
gridTemplateColumns: function gridTemplateColumns(value, style) {
style.msGridColumns = value;
},
gridTemplateRows: function gridTemplateRows(value, style) {
style.msGridRows = value;
},
justifySelf: function justifySelf(value, style) {
if (alignmentValues.indexOf(value) > -1) {
style.msGridColumnAlign = value;
}
}
};
export default function grid(property, value, style) {
if (property === 'display' && value in displayValues) {
return displayValues[value];
}
if (property in propertyConverters) {
var propertyConverter = propertyConverters[property];
propertyConverter(value, style);
}
}

View File

@ -0,0 +1,12 @@
import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';
// http://caniuse.com/#feat=css-image-set
var prefixes = ['-webkit-', ''];
export default function imageSet(property, value) {
if (typeof value === 'string' && !isPrefixedValue(value) && value.indexOf('image-set(') > -1) {
return prefixes.map(function (prefix) {
return value.replace(/image-set\(/g, prefix + 'image-set(');
});
}
}

17
node_modules/inline-style-prefixer/es/plugins/index.js generated vendored Normal file
View File

@ -0,0 +1,17 @@
import backgroundClip from './backgroundClip';
import calc from './calc';
import cursor from './cursor';
import crossFade from './crossFade';
import filter from './filter';
import flex from './flex';
import flexboxIE from './flexboxIE';
import flexboxOld from './flexboxOld';
import gradient from './gradient';
import grid from './grid';
import imageSet from './imageSet';
import logical from './logical';
import position from './position';
import sizing from './sizing';
import transition from './transition';
export default [backgroundClip, calc, crossFade, cursor, filter, flex, flexboxIE, flexboxOld, gradient, grid, imageSet, logical, position, sizing, transition];

View File

@ -0,0 +1,35 @@
var alternativeProps = {
marginBlockStart: ['WebkitMarginBefore'],
marginBlockEnd: ['WebkitMarginAfter'],
marginInlineStart: ['WebkitMarginStart', 'MozMarginStart'],
marginInlineEnd: ['WebkitMarginEnd', 'MozMarginEnd'],
paddingBlockStart: ['WebkitPaddingBefore'],
paddingBlockEnd: ['WebkitPaddingAfter'],
paddingInlineStart: ['WebkitPaddingStart', 'MozPaddingStart'],
paddingInlineEnd: ['WebkitPaddingEnd', 'MozPaddingEnd'],
borderBlockStart: ['WebkitBorderBefore'],
borderBlockStartColor: ['WebkitBorderBeforeColor'],
borderBlockStartStyle: ['WebkitBorderBeforeStyle'],
borderBlockStartWidth: ['WebkitBorderBeforeWidth'],
borderBlockEnd: ['WebkitBorderAfter'],
borderBlockEndColor: ['WebkitBorderAfterColor'],
borderBlockEndStyle: ['WebkitBorderAfterStyle'],
borderBlockEndWidth: ['WebkitBorderAfterWidth'],
borderInlineStart: ['WebkitBorderStart', 'MozBorderStart'],
borderInlineStartColor: ['WebkitBorderStartColor', 'MozBorderStartColor'],
borderInlineStartStyle: ['WebkitBorderStartStyle', 'MozBorderStartStyle'],
borderInlineStartWidth: ['WebkitBorderStartWidth', 'MozBorderStartWidth'],
borderInlineEnd: ['WebkitBorderEnd', 'MozBorderEnd'],
borderInlineEndColor: ['WebkitBorderEndColor', 'MozBorderEndColor'],
borderInlineEndStyle: ['WebkitBorderEndStyle', 'MozBorderEndStyle'],
borderInlineEndWidth: ['WebkitBorderEndWidth', 'MozBorderEndWidth']
};
export default function logical(property, value, style) {
if (Object.prototype.hasOwnProperty.call(alternativeProps, property)) {
var alternativePropList = alternativeProps[property];
for (var i = 0, len = alternativePropList.length; i < len; ++i) {
style[alternativePropList[i]] = value;
}
}
}

View File

@ -0,0 +1,5 @@
export default function position(property, value) {
if (property === 'position' && value === 'sticky') {
return ['-webkit-sticky', 'sticky'];
}
}

View File

@ -0,0 +1,26 @@
var prefixes = ['-webkit-', '-moz-', ''];
var properties = {
maxHeight: true,
maxWidth: true,
width: true,
height: true,
columnWidth: true,
minWidth: true,
minHeight: true
};
var values = {
'min-content': true,
'max-content': true,
'fill-available': true,
'fit-content': true,
'contain-floats': true
};
export default function sizing(property, value) {
if (properties.hasOwnProperty(property) && values.hasOwnProperty(value)) {
return prefixes.map(function (prefix) {
return prefix + value;
});
}
}

View File

@ -0,0 +1,75 @@
import hyphenateProperty from 'css-in-js-utils/lib/hyphenateProperty';
import isPrefixedValue from 'css-in-js-utils/lib/isPrefixedValue';
import capitalizeString from '../utils/capitalizeString';
var properties = {
transition: true,
transitionProperty: true,
WebkitTransition: true,
WebkitTransitionProperty: true,
MozTransition: true,
MozTransitionProperty: true
};
var prefixMapping = {
Webkit: '-webkit-',
Moz: '-moz-',
ms: '-ms-'
};
function prefixValue(value, propertyPrefixMap) {
if (isPrefixedValue(value)) {
return value;
}
// only split multi values, not cubic beziers
var multipleValues = value.split(/,(?![^()]*(?:\([^()]*\))?\))/g);
for (var i = 0, len = multipleValues.length; i < len; ++i) {
var singleValue = multipleValues[i];
var values = [singleValue];
for (var property in propertyPrefixMap) {
var dashCaseProperty = hyphenateProperty(property);
if (singleValue.indexOf(dashCaseProperty) > -1 && dashCaseProperty !== 'order') {
var prefixes = propertyPrefixMap[property];
for (var j = 0, pLen = prefixes.length; j < pLen; ++j) {
// join all prefixes and create a new value
values.unshift(singleValue.replace(dashCaseProperty, prefixMapping[prefixes[j]] + dashCaseProperty));
}
}
}
multipleValues[i] = values.join(',');
}
return multipleValues.join(',');
}
export default function transition(property, value, style, propertyPrefixMap) {
// also check for already prefixed transitions
if (typeof value === 'string' && properties.hasOwnProperty(property)) {
var outputValue = prefixValue(value, propertyPrefixMap);
// if the property is already prefixed
var webkitOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (val) {
return !/-moz-|-ms-/.test(val);
}).join(',');
if (property.indexOf('Webkit') > -1) {
return webkitOutput;
}
var mozOutput = outputValue.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function (val) {
return !/-webkit-|-ms-/.test(val);
}).join(',');
if (property.indexOf('Moz') > -1) {
return mozOutput;
}
style['Webkit' + capitalizeString(property)] = webkitOutput;
style['Moz' + capitalizeString(property)] = mozOutput;
return outputValue;
}
}