MinsoftK

deleting

Showing 1000 changed files with 0 additions and 4927 deletions

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _postcss = require('postcss');
var _postcss2 = _interopRequireDefault(_postcss);
var _postcssValueParser = require('postcss-value-parser');
var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
var _animation = require('./rules/animation');
var _animation2 = _interopRequireDefault(_animation);
var _border = require('./rules/border');
var _border2 = _interopRequireDefault(_border);
var _boxShadow = require('./rules/boxShadow');
var _boxShadow2 = _interopRequireDefault(_boxShadow);
var _flexFlow = require('./rules/flexFlow');
var _flexFlow2 = _interopRequireDefault(_flexFlow);
var _transition = require('./rules/transition');
var _transition2 = _interopRequireDefault(_transition);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/* eslint-disable quote-props */
const rules = {
'animation': _animation2.default,
'-webkit-animation': _animation2.default,
'border': _border2.default,
'border-top': _border2.default,
'border-right': _border2.default,
'border-bottom': _border2.default,
'border-left': _border2.default,
'outline': _border2.default,
'box-shadow': _boxShadow2.default,
'flex-flow': _flexFlow2.default,
'transition': _transition2.default,
'-webkit-transition': _transition2.default
};
/* eslint-enable */
// rules
function shouldAbort(parsed) {
let abort = false;
parsed.walk(({ type, value }) => {
if (type === 'comment' || type === 'function' && value.toLowerCase() === 'var' || type === 'word' && ~value.indexOf(`___CSS_LOADER_IMPORT___`)) {
abort = true;
return false;
}
});
return abort;
}
function getValue(decl) {
let { value, raws } = decl;
if (raws && raws.value && raws.value.raw) {
value = raws.value.raw;
}
return value;
}
exports.default = _postcss2.default.plugin('postcss-ordered-values', () => {
return css => {
const cache = {};
css.walkDecls(decl => {
const lowerCasedProp = decl.prop.toLowerCase();
const processor = rules[lowerCasedProp];
if (!processor) {
return;
}
const value = getValue(decl);
if (cache[value]) {
decl.value = cache[value];
return;
}
const parsed = (0, _postcssValueParser2.default)(value);
if (parsed.nodes.length < 2 || shouldAbort(parsed)) {
cache[value] = value;
return;
}
const result = processor(parsed);
decl.value = result;
cache[value] = result;
});
};
});
module.exports = exports['default'];
\ No newline at end of file
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = addSpace;
function addSpace() {
return { type: 'space', value: ' ' };
}
module.exports = exports['default'];
\ No newline at end of file
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getParsed;
var _postcssValueParser = require('postcss-value-parser');
var _postcssValueParser2 = _interopRequireDefault(_postcssValueParser);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getParsed(decl) {
let { value, raws } = decl;
if (raws && raws.value && raws.value.raw) {
value = raws.value.raw;
}
return (0, _postcssValueParser2.default)(value);
}
module.exports = exports['default'];
\ No newline at end of file
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = getValue;
var _postcssValueParser = require('postcss-value-parser');
function getValue(values) {
return (0, _postcssValueParser.stringify)({
nodes: values.reduce((nodes, arg, index) => {
arg.forEach((val, idx) => {
if (idx === arg.length - 1 && index === values.length - 1 && val.type === 'space') {
return;
}
nodes.push(val);
});
if (index !== values.length - 1) {
nodes[nodes.length - 1].type = 'div';
nodes[nodes.length - 1].value = ',';
}
return nodes;
}, [])
});
}
module.exports = exports['default'];
\ No newline at end of file
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = normalizeAnimation;
var _postcssValueParser = require('postcss-value-parser');
var _cssnanoUtilGetArguments = require('cssnano-util-get-arguments');
var _cssnanoUtilGetArguments2 = _interopRequireDefault(_cssnanoUtilGetArguments);
var _addSpace = require('../lib/addSpace');
var _addSpace2 = _interopRequireDefault(_addSpace);
var _getValue = require('../lib/getValue');
var _getValue2 = _interopRequireDefault(_getValue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// animation: [ none | <keyframes-name> ] || <time> || <single-timing-function> || <time> || <single-animation-iteration-count> || <single-animation-direction> || <single-animation-fill-mode> || <single-animation-play-state>
const isTimingFunction = (value, type) => {
const functions = ['steps', 'cubic-bezier', 'frames'];
const keywords = ['ease', 'ease-in', 'ease-in-out', 'ease-out', 'linear', 'step-end', 'step-start'];
return type === 'function' && functions.includes(value) || keywords.includes(value);
};
const isDirection = value => {
return ['normal', 'reverse', 'alternate', 'alternate-reverse'].includes(value);
};
const isFillMode = value => {
return ['none', 'forwards', 'backwards', 'both'].includes(value);
};
const isPlayState = value => {
return ['running', 'paused'].includes(value);
};
const isTime = value => {
const quantity = (0, _postcssValueParser.unit)(value);
return quantity && ['ms', 's'].includes(quantity.unit);
};
const isIterationCount = value => {
const quantity = (0, _postcssValueParser.unit)(value);
return value === 'infinite' || quantity && !quantity.unit;
};
function normalizeAnimation(parsed) {
const args = (0, _cssnanoUtilGetArguments2.default)(parsed);
const values = args.reduce((list, arg) => {
const state = {
name: [],
duration: [],
timingFunction: [],
delay: [],
iterationCount: [],
direction: [],
fillMode: [],
playState: []
};
const stateConditions = [{ property: 'duration', delegate: isTime }, { property: 'timingFunction', delegate: isTimingFunction }, { property: 'delay', delegate: isTime }, { property: 'iterationCount', delegate: isIterationCount }, { property: 'direction', delegate: isDirection }, { property: 'fillMode', delegate: isFillMode }, { property: 'playState', delegate: isPlayState }];
arg.forEach(node => {
let { type, value } = node;
if (type === 'space') {
return;
}
value = value.toLowerCase();
const hasMatch = stateConditions.some(({ property, delegate }) => {
if (delegate(value, type) && !state[property].length) {
state[property] = [node, (0, _addSpace2.default)()];
return true;
}
});
if (!hasMatch) {
state.name = [...state.name, node, (0, _addSpace2.default)()];
}
});
return [...list, [...state.name, ...state.duration, ...state.timingFunction, ...state.delay, ...state.iterationCount, ...state.direction, ...state.fillMode, ...state.playState]];
}, []);
return (0, _getValue2.default)(values);
};
module.exports = exports['default'];
\ No newline at end of file
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = normalizeBorder;
var _postcssValueParser = require('postcss-value-parser');
// border: <line-width> || <line-style> || <color>
// outline: <outline-color> || <outline-style> || <outline-width>
const borderWidths = ['thin', 'medium', 'thick'];
const borderStyles = ['none', 'auto', // only in outline-style
'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset'];
function normalizeBorder(border) {
const order = { width: '', style: '', color: '' };
border.walk(node => {
const { type, value } = node;
if (type === 'word') {
if (~borderStyles.indexOf(value.toLowerCase())) {
order.style = value;
return false;
}
if (~borderWidths.indexOf(value.toLowerCase()) || (0, _postcssValueParser.unit)(value.toLowerCase())) {
if (order.width !== '') {
order.width = `${order.width} ${value}`;
return false;
}
order.width = value;
return false;
}
order.color = value;
return false;
}
if (type === 'function') {
if (value.toLowerCase() === 'calc') {
order.width = (0, _postcssValueParser.stringify)(node);
} else {
order.color = (0, _postcssValueParser.stringify)(node);
}
return false;
}
});
return `${order.width} ${order.style} ${order.color}`.trim();
};
module.exports = exports['default'];
\ No newline at end of file
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = normalizeBoxShadow;
var _postcssValueParser = require('postcss-value-parser');
var _cssnanoUtilGetArguments = require('cssnano-util-get-arguments');
var _cssnanoUtilGetArguments2 = _interopRequireDefault(_cssnanoUtilGetArguments);
var _addSpace = require('../lib/addSpace');
var _addSpace2 = _interopRequireDefault(_addSpace);
var _getValue = require('../lib/getValue');
var _getValue2 = _interopRequireDefault(_getValue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// box-shadow: inset? && <length>{2,4} && <color>?
function normalizeBoxShadow(parsed) {
let args = (0, _cssnanoUtilGetArguments2.default)(parsed);
let abort = false;
let values = args.reduce((list, arg) => {
let val = [];
let state = {
inset: [],
color: []
};
arg.forEach(node => {
const { type, value } = node;
if (type === 'function' && ~value.toLowerCase().indexOf('calc')) {
abort = true;
return;
}
if (type === 'space') {
return;
}
if ((0, _postcssValueParser.unit)(value)) {
val = [...val, node, (0, _addSpace2.default)()];
} else if (value.toLowerCase() === 'inset') {
state.inset = [...state.inset, node, (0, _addSpace2.default)()];
} else {
state.color = [...state.color, node, (0, _addSpace2.default)()];
}
});
return [...list, [...state.inset, ...val, ...state.color]];
}, []);
if (abort) {
return parsed.toString();
}
return (0, _getValue2.default)(values);
}
module.exports = exports['default'];
\ No newline at end of file
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = normalizeFlexFlow;
// flex-flow: <flex-direction> || <flex-wrap>
const flexDirection = ['row', 'row-reverse', 'column', 'column-reverse'];
const flexWrap = ['nowrap', 'wrap', 'wrap-reverse'];
function normalizeFlexFlow(flexFlow) {
let order = {
direction: '',
wrap: ''
};
flexFlow.walk(({ value }) => {
if (~flexDirection.indexOf(value.toLowerCase())) {
order.direction = value;
return;
}
if (~flexWrap.indexOf(value.toLowerCase())) {
order.wrap = value;
return;
}
});
return `${order.direction} ${order.wrap}`.trim();
};
module.exports = exports['default'];
\ No newline at end of file
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = normalizeTransition;
var _postcssValueParser = require('postcss-value-parser');
var _cssnanoUtilGetArguments = require('cssnano-util-get-arguments');
var _cssnanoUtilGetArguments2 = _interopRequireDefault(_cssnanoUtilGetArguments);
var _addSpace = require('../lib/addSpace');
var _addSpace2 = _interopRequireDefault(_addSpace);
var _getValue = require('../lib/getValue');
var _getValue2 = _interopRequireDefault(_getValue);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// transition: [ none | <single-transition-property> ] || <time> || <single-transition-timing-function> || <time>
const timingFunctions = ['ease', 'linear', 'ease-in', 'ease-out', 'ease-in-out', 'step-start', 'step-end'];
function normalizeTransition(parsed) {
let args = (0, _cssnanoUtilGetArguments2.default)(parsed);
let values = args.reduce((list, arg) => {
let state = {
timingFunction: [],
property: [],
time1: [],
time2: []
};
arg.forEach(node => {
const { type, value } = node;
if (type === 'space') {
return;
}
if (type === 'function' && ~['steps', 'cubic-bezier'].indexOf(value.toLowerCase())) {
state.timingFunction = [...state.timingFunction, node, (0, _addSpace2.default)()];
} else if ((0, _postcssValueParser.unit)(value)) {
if (!state.time1.length) {
state.time1 = [...state.time1, node, (0, _addSpace2.default)()];
} else {
state.time2 = [...state.time2, node, (0, _addSpace2.default)()];
}
} else if (~timingFunctions.indexOf(value.toLowerCase())) {
state.timingFunction = [...state.timingFunction, node, (0, _addSpace2.default)()];
} else {
state.property = [...state.property, node, (0, _addSpace2.default)()];
}
});
return [...list, [...state.property, ...state.time1, ...state.timingFunction, ...state.time2]];
}, []);
return (0, _getValue2.default)(values);
}
module.exports = exports['default'];
\ No newline at end of file
Copyright (c) Bogdan Chadkin <trysound@yandex.ru>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
# postcss-value-parser
[![Travis CI](https://travis-ci.org/TrySound/postcss-value-parser.svg)](https://travis-ci.org/TrySound/postcss-value-parser)
Transforms CSS declaration values and at-rule parameters into a tree of nodes, and provides a simple traversal API.
## Usage
```js
var valueParser = require('postcss-value-parser');
var cssBackgroundValue = 'url(foo.png) no-repeat 40px 73%';
var parsedValue = valueParser(cssBackgroundValue);
// parsedValue exposes an API described below,
// e.g. parsedValue.walk(..), parsedValue.toString(), etc.
```
For example, parsing the value `rgba(233, 45, 66, .5)` will return the following:
```js
{
nodes: [
{
type: 'function',
value: 'rgba',
before: '',
after: '',
nodes: [
{ type: 'word', value: '233' },
{ type: 'div', value: ',', before: '', after: ' ' },
{ type: 'word', value: '45' },
{ type: 'div', value: ',', before: '', after: ' ' },
{ type: 'word', value: '66' },
{ type: 'div', value: ',', before: ' ', after: '' },
{ type: 'word', value: '.5' }
]
}
]
}
```
If you wanted to convert each `rgba()` value in `sourceCSS` to a hex value, you could do so like this:
```js
var valueParser = require('postcss-value-parser');
var parsed = valueParser(sourceCSS);
// walk() will visit all the of the nodes in the tree,
// invoking the callback for each.
parsed.walk(function (node) {
// Since we only want to transform rgba() values,
// we can ignore anything else.
if (node.type !== 'function' && node.value !== 'rgba') return;
// We can make an array of the rgba() arguments to feed to a
// convertToHex() function
var color = node.nodes.filter(function (node) {
return node.type === 'word';
}).map(function (node) {
return Number(node.value);
}); // [233, 45, 66, .5]
// Now we will transform the existing rgba() function node
// into a word node with the hex value
node.type = 'word';
node.value = convertToHex(color);
})
parsed.toString(); // #E92D42
```
## Nodes
Each node is an object with these common properties:
- **type**: The type of node (`word`, `string`, `div`, `space`, `comment`, or `function`).
Each type is documented below.
- **value**: Each node has a `value` property; but what exactly `value` means
is specific to the node type. Details are documented for each type below.
- **sourceIndex**: The starting index of the node within the original source
string. For example, given the source string `10px 20px`, the `word` node
whose value is `20px` will have a `sourceIndex` of `5`.
### word
The catch-all node type that includes keywords (e.g. `no-repeat`),
quantities (e.g. `20px`, `75%`, `1.5`), and hex colors (e.g. `#e6e6e6`).
Node-specific properties:
- **value**: The "word" itself.
### string
A quoted string value, e.g. `"something"` in `content: "something";`.
Node-specific properties:
- **value**: The text content of the string.
- **quote**: The quotation mark surrounding the string, either `"` or `'`.
- **unclosed**: `true` if the string was not closed properly. e.g. `"unclosed string `.
### div
A divider, for example
- `,` in `animation-duration: 1s, 2s, 3s`
- `/` in `border-radius: 10px / 23px`
- `:` in `(min-width: 700px)`
Node-specific properties:
- **value**: The divider character. Either `,`, `/`, or `:` (see examples above).
- **before**: Whitespace before the divider.
- **after**: Whitespace after the divider.
### space
Whitespace used as a separator, e.g. ` ` occurring twice in `border: 1px solid black;`.
Node-specific properties:
- **value**: The whitespace itself.
### comment
A CSS comment starts with `/*` and ends with `*/`
Node-specific properties:
- **value**: The comment value without `/*` and `*/`
- **unclosed**: `true` if the comment was not closed properly. e.g. `/* comment without an end `.
### function
A CSS function, e.g. `rgb(0,0,0)` or `url(foo.bar)`.
Function nodes have nodes nested within them: the function arguments.
Additional properties:
- **value**: The name of the function, e.g. `rgb` in `rgb(0,0,0)`.
- **before**: Whitespace after the opening parenthesis and before the first argument,
e.g. ` ` in `rgb( 0,0,0)`.
- **after**: Whitespace before the closing parenthesis and after the last argument,
e.g. ` ` in `rgb(0,0,0 )`.
- **nodes**: More nodes representing the arguments to the function.
- **unclosed**: `true` if the parentheses was not closed properly. e.g. `( unclosed-function `.
Media features surrounded by parentheses are considered functions with an
empty value. For example, `(min-width: 700px)` parses to these nodes:
```js
[
{
type: 'function', value: '', before: '', after: '',
nodes: [
{ type: 'word', value: 'min-width' },
{ type: 'div', value: ':', before: '', after: ' ' },
{ type: 'word', value: '700px' }
]
}
]
```
`url()` functions can be parsed a little bit differently depending on
whether the first character in the argument is a quotation mark.
`url( /gfx/img/bg.jpg )` parses to:
```js
{ type: 'function', sourceIndex: 0, value: 'url', before: ' ', after: ' ', nodes: [
{ type: 'word', sourceIndex: 5, value: '/gfx/img/bg.jpg' }
] }
```
`url( "/gfx/img/bg.jpg" )`, on the other hand, parses to:
```js
{ type: 'function', sourceIndex: 0, value: 'url', before: ' ', after: ' ', nodes: [
type: 'string', sourceIndex: 5, quote: '"', value: '/gfx/img/bg.jpg' },
] }
```
## API
```
var valueParser = require('postcss-value-parser');
```
### valueParser.unit(quantity)
Parses `quantity`, distinguishing the number from the unit. Returns an object like the following:
```js
// Given 2rem
{
number: '2',
unit: 'rem'
}
```
If the `quantity` argument cannot be parsed as a number, returns `false`.
*This function does not parse complete values*: you cannot pass it `1px solid black` and expect `px` as
the unit. Instead, you should pass it single quantities only. Parse `1px solid black`, then pass it
the stringified `1px` node (a `word` node) to parse the number and unit.
### valueParser.stringify(nodes[, custom])
Stringifies a node or array of nodes.
The `custom` function is called for each `node`; return a string to override the default behaviour.
### valueParser.walk(nodes, callback[, bubble])
Walks each provided node, recursively walking all descendent nodes within functions.
Returning `false` in the `callback` will prevent traversal of descendent nodes (within functions).
You can use this feature to for shallow iteration, walking over only the *immediate* children.
*Note: This only applies if `bubble` is `false` (which is the default).*
By default, the tree is walked from the outermost node inwards.
To reverse the direction, pass `true` for the `bubble` argument.
The `callback` is invoked with three arguments: `callback(node, index, nodes)`.
- `node`: The current node.
- `index`: The index of the current node.
- `nodes`: The complete nodes array passed to `walk()`.
Returns the `valueParser` instance.
### var parsed = valueParser(value)
Returns the parsed node tree.
### parsed.nodes
The array of nodes.
### parsed.toString()
Stringifies the node tree.
### parsed.walk(callback[, bubble])
Walks each node inside `parsed.nodes`. See the documentation for `valueParser.walk()` above.
# License
MIT © [Bogdan Chadkin](mailto:trysound@yandex.ru)
var parse = require("./parse");
var walk = require("./walk");
var stringify = require("./stringify");
function ValueParser(value) {
if (this instanceof ValueParser) {
this.nodes = parse(value);
return this;
}
return new ValueParser(value);
}
ValueParser.prototype.toString = function() {
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
};
ValueParser.prototype.walk = function(cb, bubble) {
walk(this.nodes, cb, bubble);
return this;
};
ValueParser.unit = require("./unit");
ValueParser.walk = walk;
ValueParser.stringify = stringify;
module.exports = ValueParser;
var openParentheses = "(".charCodeAt(0);
var closeParentheses = ")".charCodeAt(0);
var singleQuote = "'".charCodeAt(0);
var doubleQuote = '"'.charCodeAt(0);
var backslash = "\\".charCodeAt(0);
var slash = "/".charCodeAt(0);
var comma = ",".charCodeAt(0);
var colon = ":".charCodeAt(0);
var star = "*".charCodeAt(0);
module.exports = function(input) {
var tokens = [];
var value = input;
var next, quote, prev, token, escape, escapePos, whitespacePos;
var pos = 0;
var code = value.charCodeAt(pos);
var max = value.length;
var stack = [{ nodes: tokens }];
var balanced = 0;
var parent;
var name = "";
var before = "";
var after = "";
while (pos < max) {
// Whitespaces
if (code <= 32) {
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
token = value.slice(pos, next);
prev = tokens[tokens.length - 1];
if (code === closeParentheses && balanced) {
after = token;
} else if (prev && prev.type === "div") {
prev.after = token;
} else if (
code === comma ||
code === colon ||
(code === slash && value.charCodeAt(next + 1) !== star)
) {
before = token;
} else {
tokens.push({
type: "space",
sourceIndex: pos,
value: token
});
}
pos = next;
// Quotes
} else if (code === singleQuote || code === doubleQuote) {
next = pos;
quote = code === singleQuote ? "'" : '"';
token = {
type: "string",
sourceIndex: pos,
quote: quote
};
do {
escape = false;
next = value.indexOf(quote, next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += quote;
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
token.value = value.slice(pos + 1, next);
tokens.push(token);
pos = next + 1;
code = value.charCodeAt(pos);
// Comments
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
token = {
type: "comment",
sourceIndex: pos
};
next = value.indexOf("*/", pos);
if (next === -1) {
token.unclosed = true;
next = value.length;
}
token.value = value.slice(pos + 2, next);
tokens.push(token);
pos = next + 2;
code = value.charCodeAt(pos);
// Dividers
} else if (code === slash || code === comma || code === colon) {
token = value[pos];
tokens.push({
type: "div",
sourceIndex: pos - before.length,
value: token,
before: before,
after: ""
});
before = "";
pos += 1;
code = value.charCodeAt(pos);
// Open parentheses
} else if (openParentheses === code) {
// Whitespaces after open parentheses
next = pos;
do {
next += 1;
code = value.charCodeAt(next);
} while (code <= 32);
token = {
type: "function",
sourceIndex: pos - name.length,
value: name,
before: value.slice(pos + 1, next)
};
pos = next;
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
next -= 1;
do {
escape = false;
next = value.indexOf(")", next + 1);
if (~next) {
escapePos = next;
while (value.charCodeAt(escapePos - 1) === backslash) {
escapePos -= 1;
escape = !escape;
}
} else {
value += ")";
next = value.length - 1;
token.unclosed = true;
}
} while (escape);
// Whitespaces before closed
whitespacePos = next;
do {
whitespacePos -= 1;
code = value.charCodeAt(whitespacePos);
} while (code <= 32);
if (pos !== whitespacePos + 1) {
token.nodes = [
{
type: "word",
sourceIndex: pos,
value: value.slice(pos, whitespacePos + 1)
}
];
} else {
token.nodes = [];
}
if (token.unclosed && whitespacePos + 1 !== next) {
token.after = "";
token.nodes.push({
type: "space",
sourceIndex: whitespacePos + 1,
value: value.slice(whitespacePos + 1, next)
});
} else {
token.after = value.slice(whitespacePos + 1, next);
}
pos = next + 1;
code = value.charCodeAt(pos);
tokens.push(token);
} else {
balanced += 1;
token.after = "";
tokens.push(token);
stack.push(token);
tokens = token.nodes = [];
parent = token;
}
name = "";
// Close parentheses
} else if (closeParentheses === code && balanced) {
pos += 1;
code = value.charCodeAt(pos);
parent.after = after;
after = "";
balanced -= 1;
stack.pop();
parent = stack[balanced];
tokens = parent.nodes;
// Words
} else {
next = pos;
do {
if (code === backslash) {
next += 1;
}
next += 1;
code = value.charCodeAt(next);
} while (
next < max &&
!(
code <= 32 ||
code === singleQuote ||
code === doubleQuote ||
code === comma ||
code === colon ||
code === slash ||
code === openParentheses ||
(code === closeParentheses && balanced)
)
);
token = value.slice(pos, next);
if (openParentheses === code) {
name = token;
} else {
tokens.push({
type: "word",
sourceIndex: pos,
value: token
});
}
pos = next;
}
}
for (pos = stack.length - 1; pos; pos -= 1) {
stack[pos].unclosed = true;
}
return stack[0].nodes;
};
function stringifyNode(node, custom) {
var type = node.type;
var value = node.value;
var buf;
var customResult;
if (custom && (customResult = custom(node)) !== undefined) {
return customResult;
} else if (type === "word" || type === "space") {
return value;
} else if (type === "string") {
buf = node.quote || "";
return buf + value + (node.unclosed ? "" : buf);
} else if (type === "comment") {
return "/*" + value + (node.unclosed ? "" : "*/");
} else if (type === "div") {
return (node.before || "") + value + (node.after || "");
} else if (Array.isArray(node.nodes)) {
buf = stringify(node.nodes);
if (type !== "function") {
return buf;
}
return (
value +
"(" +
(node.before || "") +
buf +
(node.after || "") +
(node.unclosed ? "" : ")")
);
}
return value;
}
function stringify(nodes, custom) {
var result, i;
if (Array.isArray(nodes)) {
result = "";
for (i = nodes.length - 1; ~i; i -= 1) {
result = stringifyNode(nodes[i], custom) + result;
}
return result;
}
return stringifyNode(nodes, custom);
}
module.exports = stringify;
var minus = "-".charCodeAt(0);
var plus = "+".charCodeAt(0);
var dot = ".".charCodeAt(0);
var exp = "e".charCodeAt(0);
var EXP = "E".charCodeAt(0);
module.exports = function(value) {
var pos = 0;
var length = value.length;
var dotted = false;
var sciPos = -1;
var containsNumber = false;
var code;
while (pos < length) {
code = value.charCodeAt(pos);
if (code >= 48 && code <= 57) {
containsNumber = true;
} else if (code === exp || code === EXP) {
if (sciPos > -1) {
break;
}
sciPos = pos;
} else if (code === dot) {
if (dotted) {
break;
}
dotted = true;
} else if (code === plus || code === minus) {
if (pos !== 0) {
break;
}
} else {
break;
}
pos += 1;
}
if (sciPos + 1 === pos) pos--;
return containsNumber
? {
number: value.slice(0, pos),
unit: value.slice(pos)
}
: false;
};
module.exports = function walk(nodes, cb, bubble) {
var i, max, node, result;
for (i = 0, max = nodes.length; i < max; i += 1) {
node = nodes[i];
if (!bubble) {
result = cb(node, i, nodes);
}
if (
result !== false &&
node.type === "function" &&
Array.isArray(node.nodes)
) {
walk(node.nodes, cb, bubble);
}
if (bubble) {
cb(node, i, nodes);
}
}
};
{
"_from": "postcss-value-parser@^3.0.0",
"_id": "postcss-value-parser@3.3.1",
"_inBundle": false,
"_integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==",
"_location": "/postcss-ordered-values/postcss-value-parser",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "postcss-value-parser@^3.0.0",
"name": "postcss-value-parser",
"escapedName": "postcss-value-parser",
"rawSpec": "^3.0.0",
"saveSpec": null,
"fetchSpec": "^3.0.0"
},
"_requiredBy": [
"/postcss-ordered-values"
],
"_resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz",
"_shasum": "9ff822547e2893213cf1c30efa51ac5fd1ba8281",
"_spec": "postcss-value-parser@^3.0.0",
"_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\postcss-ordered-values",
"author": {
"name": "Bogdan Chadkin",
"email": "trysound@yandex.ru"
},
"bugs": {
"url": "https://github.com/TrySound/postcss-value-parser/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Transforms css values and at-rule params into the tree",
"devDependencies": {
"eslint": "^5.6.1",
"husky": "^1.0.0",
"lint-staged": "^7.3.0",
"prettier": "^1.4.4",
"tap-spec": "^5.0.0",
"tape": "^4.2.0"
},
"eslintConfig": {
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended"
},
"files": [
"lib"
],
"homepage": "https://github.com/TrySound/postcss-value-parser",
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"keywords": [
"postcss",
"value",
"parser"
],
"license": "MIT",
"lint-staged": {
"*.js": [
"eslint",
"prettier --write",
"git add"
]
},
"main": "lib/index.js",
"name": "postcss-value-parser",
"repository": {
"type": "git",
"url": "git+https://github.com/TrySound/postcss-value-parser.git"
},
"scripts": {
"lint": "yarn lint:js && yarn lint:prettier",
"lint:js": "eslint . --cache",
"lint:prettier": "prettier '**/*.js' --list-different",
"pretest": "yarn lint",
"test": "tape test/*.js | tap-spec"
},
"version": "3.3.1"
}
{
"_from": "postcss-ordered-values@^4.1.2",
"_id": "postcss-ordered-values@4.1.2",
"_inBundle": false,
"_integrity": "sha512-2fCObh5UanxvSxeXrtLtlwVThBvHn6MQcu4ksNT2tsaV2Fg76R2CV98W7wNSlX+5/pFwEyaDwKLLoEV7uRybAw==",
"_location": "/postcss-ordered-values",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "postcss-ordered-values@^4.1.2",
"name": "postcss-ordered-values",
"escapedName": "postcss-ordered-values",
"rawSpec": "^4.1.2",
"saveSpec": null,
"fetchSpec": "^4.1.2"
},
"_requiredBy": [
"/cssnano-preset-default"
],
"_resolved": "https://registry.npmjs.org/postcss-ordered-values/-/postcss-ordered-values-4.1.2.tgz",
"_shasum": "0cf75c820ec7d5c4d280189559e0b571ebac0eee",
"_spec": "postcss-ordered-values@^4.1.2",
"_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\cssnano-preset-default",
"author": {
"name": "Ben Briggs",
"email": "beneb.info@gmail.com",
"url": "http://beneb.info"
},
"bugs": {
"url": "https://github.com/cssnano/cssnano/issues"
},
"bundleDependencies": false,
"dependencies": {
"cssnano-util-get-arguments": "^4.0.0",
"postcss": "^7.0.0",
"postcss-value-parser": "^3.0.0"
},
"deprecated": false,
"description": "Ensure values are ordered consistently in your CSS.",
"devDependencies": {
"babel-cli": "^6.0.0",
"cross-env": "^5.0.0"
},
"engines": {
"node": ">=6.9.0"
},
"files": [
"dist",
"LICENSE-MIT"
],
"homepage": "https://github.com/cssnano/cssnano",
"keywords": [
"css",
"postcss",
"postcss-plugin"
],
"license": "MIT",
"main": "dist/index.js",
"name": "postcss-ordered-values",
"repository": {
"type": "git",
"url": "git+https://github.com/cssnano/cssnano.git"
},
"scripts": {
"prepublish": "cross-env BABEL_ENV=publish babel src --out-dir dist --ignore /__tests__/"
},
"version": "4.1.2"
}
# Changes to PostCSS Overflow Shorthand
### 2.0.0 (September 17, 2018)
- Updated: Support for PostCSS v7+
- Updated: Support for Node v6+
### 1.0.1 (May 8, 2018)
- Fixed: Single `overflow` values previously being parsed
### 1.0.0 (April 30, 2018)
- Initial version
# CC0 1.0 Universal
## Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an “owner”) of an original work of
authorship and/or a database (each, a “Work”).
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific works
(“Commons”) that the public can reliably and without fear of later claims of
infringement build upon, modify, incorporate in other works, reuse and
redistribute as freely as possible in any form whatsoever and for any purposes,
including without limitation commercial purposes. These owners may contribute
to the Commons to promote the ideal of a free culture and the further
production of creative, cultural and scientific works, or to gain reputation or
greater distribution for their Work in part through the use and efforts of
others.
For these and/or other purposes and motivations, and without any expectation of
additional consideration or compensation, the person associating CC0 with a
Work (the “Affirmer”), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and
publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights (“Copyright and
Related Rights”). Copyright and Related Rights include, but are not limited
to, the following:
1. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
2. moral rights retained by the original author(s) and/or performer(s);
3. publicity and privacy rights pertaining to a person’s image or likeness
depicted in a Work;
4. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(i), below;
5. rights protecting the extraction, dissemination, use and reuse of data in
a Work;
6. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and
7. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations
thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the “Waiver”). Affirmer
makes the Waiver for the benefit of each member of the public at large and
to the detriment of Affirmer’s heirs and successors, fully intending that
such Waiver shall not be subject to revocation, rescission, cancellation,
termination, or any other legal or equitable action to disrupt the quiet
enjoyment of the Work by the public as contemplated by Affirmer’s express
Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer’s express Statement of Purpose. In addition, to the extent the
Waiver is so judged Affirmer hereby grants to each affected person a
royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer’s Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the “License”). The License
shall be deemed effective as of the date CC0 was applied by Affirmer to the
Work. Should any part of the License for any reason be judged legally
invalid or ineffective under applicable law, such partial invalidity or
ineffectiveness shall not invalidate the remainder of the License, and in
such case Affirmer hereby affirms that he or she will not (i) exercise any
of his or her remaining Copyright and Related Rights in the Work or (ii)
assert any associated claims and causes of action with respect to the Work,
in either case contrary to Affirmer’s express Statement of Purpose.
4. Limitations and Disclaimers.
1. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
2. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or
otherwise, including without limitation warranties of title,
merchantability, fitness for a particular purpose, non infringement, or
the absence of latent or other defects, accuracy, or the present or
absence of errors, whether or not discoverable, all to the greatest
extent permissible under applicable law.
3. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person’s Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the Work.
4. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.
For more information, please see
http://creativecommons.org/publicdomain/zero/1.0/.
# PostCSS Overflow Shorthand [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
[![NPM Version][npm-img]][npm-url]
[![CSS Standard Status][css-img]][css-url]
[![Build Status][cli-img]][cli-url]
[![Support Chat][git-img]][git-url]
[PostCSS Overflow Shorthand] lets you use the `overflow` shorthand in CSS,
following the [CSS Overflow] specification.
```pcss
html {
overflow: hidden auto;
}
/* becomes */
html {
overflow-x: hidden;
overflow-y: auto;
overflow: hidden auto;
}
```
## Usage
Add [PostCSS Overflow Shorthand] to your project:
```bash
npm install postcss-overflow-shorthand --save-dev
```
Use [PostCSS Overflow Shorthand] to process your CSS:
```js
const postcssOverflowShorthand = require('postcss-overflow-shorthand');
postcssOverflowShorthand.process(YOUR_CSS /*, processOptions, pluginOptions */);
```
Or use it as a [PostCSS] plugin:
```js
const postcss = require('postcss');
const postcssOverflowShorthand = require('postcss-overflow-shorthand');
postcss([
postcssOverflowShorthand(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
```
[PostCSS Overflow Shorthand] runs in all Node environments, with special
instructions for:
| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
| --- | --- | --- | --- | --- | --- |
## Options
### preserve
The `preserve` option determines whether the original `overflow` declaration is
preserved. By default, it is preserved.
```js
postcssOverflowShorthand({ preserve: false })
```
```pcss
html {
overflow: hidden auto;
}
/* becomes */
html {
overflow-x: hidden;
overflow-y: auto;
}
```
[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-overflow-shorthand.svg
[cli-url]: https://travis-ci.org/jonathantneal/postcss-overflow-shorthand
[css-img]: https://cssdb.org/badge/overflow-property.svg
[css-url]: https://cssdb.org/#overflow-property
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
[git-url]: https://gitter.im/postcss/postcss
[npm-img]: https://img.shields.io/npm/v/postcss-overflow-shorthand.svg
[npm-url]: https://www.npmjs.com/package/postcss-overflow-shorthand
[CSS Overflow]: https://drafts.csswg.org/css-overflow/#propdef-overflow
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
[PostCSS]: https://github.com/postcss/postcss
[PostCSS Loader]: https://github.com/postcss/postcss-loader
[PostCSS Overflow Shorthand]: https://github.com/jonathantneal/postcss-overflow-shorthand
'use strict';
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var postcss = _interopDefault(require('postcss'));
function _toArray(arr) {
return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest();
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
const space = postcss.list.space; // overflow shorthand property matcher
const overflowPropertyRegExp = /^overflow$/i;
var index = postcss.plugin('postcss-overflow-shorthand', opts => {
const preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : true;
return root => {
// for each overflow declaration
root.walkDecls(overflowPropertyRegExp, decl => {
// split the declaration values
const _space = space(decl.value),
_space2 = _toArray(_space),
overflowX = _space2[0],
overflowY = _space2[1],
invalidatingValues = _space2.slice(2); // if there are two values, but no invalidating values
if (overflowY && !invalidatingValues.length) {
// insert the overflow-* longhand declarations
decl.cloneBefore({
prop: `${decl.prop}-x`,
value: overflowX
});
decl.cloneBefore({
prop: `${decl.prop}-y`,
value: overflowY
}); // conditionally remove the original declaration
if (!preserve) {
decl.remove();
}
}
});
};
});
module.exports = index;
//# sourceMappingURL=index.cjs.js.map
{"version":3,"file":"index.cjs.js","sources":["index.js"],"sourcesContent":["import postcss from 'postcss';\n\n// space-separated values splitter\nconst { list: { space } } = postcss\n\n// overflow shorthand property matcher\nconst overflowPropertyRegExp = /^overflow$/i;\n\nexport default postcss.plugin('postcss-overflow-shorthand', opts => {\n\tconst preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : true;\n\n\treturn root => {\n\t\t// for each overflow declaration\n\t\troot.walkDecls(overflowPropertyRegExp, decl => {\n\t\t\t// split the declaration values\n\t\t\tconst [overflowX, overflowY, ...invalidatingValues] = space(decl.value);\n\n\t\t\t// if there are two values, but no invalidating values\n\t\t\tif (overflowY && !invalidatingValues.length) {\n\t\t\t\t// insert the overflow-* longhand declarations\n\t\t\t\tdecl.cloneBefore({\n\t\t\t\t\tprop: `${decl.prop}-x`,\n\t\t\t\t\tvalue: overflowX\n\t\t\t\t});\n\n\t\t\t\tdecl.cloneBefore({\n\t\t\t\t\tprop: `${decl.prop}-y`,\n\t\t\t\t\tvalue: overflowY\n\t\t\t\t});\n\n\t\t\t\t// conditionally remove the original declaration\n\t\t\t\tif (!preserve) {\n\t\t\t\t\tdecl.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t};\n});\n"],"names":["space","postcss","list","overflowPropertyRegExp","plugin","opts","preserve","Object","Boolean","root","walkDecls","decl","value","overflowX","overflowY","invalidatingValues","length","cloneBefore","prop","remove"],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAGgBA,QAAYC,QAApBC,KAAQF;;AAGhB,MAAMG,sBAAsB,GAAG,aAA/B;AAEA,YAAeF,OAAO,CAACG,MAAR,CAAe,4BAAf,EAA6CC,IAAI,IAAI;QAC7DC,QAAQ,GAAG,cAAcC,MAAM,CAACF,IAAD,CAApB,GAA6BG,OAAO,CAACH,IAAI,CAACC,QAAN,CAApC,GAAsD,IAAvE;SAEOG,IAAI,IAAI;;IAEdA,IAAI,CAACC,SAAL,CAAeP,sBAAf,EAAuCQ,IAAI,IAAI;;qBAEQX,KAAK,CAACW,IAAI,CAACC,KAAN,CAFb;;YAEvCC,SAFuC;YAE5BC,SAF4B;YAEdC,kBAFc;;;UAK1CD,SAAS,IAAI,CAACC,kBAAkB,CAACC,MAArC,EAA6C;;QAE5CL,IAAI,CAACM,WAAL,CAAiB;UAChBC,IAAI,EAAG,GAAEP,IAAI,CAACO,IAAK,IADH;UAEhBN,KAAK,EAAEC;SAFR;QAKAF,IAAI,CAACM,WAAL,CAAiB;UAChBC,IAAI,EAAG,GAAEP,IAAI,CAACO,IAAK,IADH;UAEhBN,KAAK,EAAEE;SAFR,EAP4C;;YAaxC,CAACR,QAAL,EAAe;UACdK,IAAI,CAACQ,MAAL;;;KAnBH;GAFD;CAHc,CAAf;;;;"}
\ No newline at end of file
import postcss from 'postcss';
function _toArray(arr) {
return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest();
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
const space = postcss.list.space; // overflow shorthand property matcher
const overflowPropertyRegExp = /^overflow$/i;
var index = postcss.plugin('postcss-overflow-shorthand', opts => {
const preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : true;
return root => {
// for each overflow declaration
root.walkDecls(overflowPropertyRegExp, decl => {
// split the declaration values
const _space = space(decl.value),
_space2 = _toArray(_space),
overflowX = _space2[0],
overflowY = _space2[1],
invalidatingValues = _space2.slice(2); // if there are two values, but no invalidating values
if (overflowY && !invalidatingValues.length) {
// insert the overflow-* longhand declarations
decl.cloneBefore({
prop: `${decl.prop}-x`,
value: overflowX
});
decl.cloneBefore({
prop: `${decl.prop}-y`,
value: overflowY
}); // conditionally remove the original declaration
if (!preserve) {
decl.remove();
}
}
});
};
});
export default index;
//# sourceMappingURL=index.es.mjs.map
{"version":3,"file":"index.es.mjs","sources":["index.js"],"sourcesContent":["import postcss from 'postcss';\n\n// space-separated values splitter\nconst { list: { space } } = postcss\n\n// overflow shorthand property matcher\nconst overflowPropertyRegExp = /^overflow$/i;\n\nexport default postcss.plugin('postcss-overflow-shorthand', opts => {\n\tconst preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : true;\n\n\treturn root => {\n\t\t// for each overflow declaration\n\t\troot.walkDecls(overflowPropertyRegExp, decl => {\n\t\t\t// split the declaration values\n\t\t\tconst [overflowX, overflowY, ...invalidatingValues] = space(decl.value);\n\n\t\t\t// if there are two values, but no invalidating values\n\t\t\tif (overflowY && !invalidatingValues.length) {\n\t\t\t\t// insert the overflow-* longhand declarations\n\t\t\t\tdecl.cloneBefore({\n\t\t\t\t\tprop: `${decl.prop}-x`,\n\t\t\t\t\tvalue: overflowX\n\t\t\t\t});\n\n\t\t\t\tdecl.cloneBefore({\n\t\t\t\t\tprop: `${decl.prop}-y`,\n\t\t\t\t\tvalue: overflowY\n\t\t\t\t});\n\n\t\t\t\t// conditionally remove the original declaration\n\t\t\t\tif (!preserve) {\n\t\t\t\t\tdecl.remove();\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t};\n});\n"],"names":["space","postcss","list","overflowPropertyRegExp","plugin","opts","preserve","Object","Boolean","root","walkDecls","decl","value","overflowX","overflowY","invalidatingValues","length","cloneBefore","prop","remove"],"mappings":";;;;;;;;;;;;;;;;;;MAGgBA,QAAYC,QAApBC,KAAQF;;AAGhB,MAAMG,sBAAsB,GAAG,aAA/B;AAEA,YAAeF,OAAO,CAACG,MAAR,CAAe,4BAAf,EAA6CC,IAAI,IAAI;QAC7DC,QAAQ,GAAG,cAAcC,MAAM,CAACF,IAAD,CAApB,GAA6BG,OAAO,CAACH,IAAI,CAACC,QAAN,CAApC,GAAsD,IAAvE;SAEOG,IAAI,IAAI;;IAEdA,IAAI,CAACC,SAAL,CAAeP,sBAAf,EAAuCQ,IAAI,IAAI;;qBAEQX,KAAK,CAACW,IAAI,CAACC,KAAN,CAFb;;YAEvCC,SAFuC;YAE5BC,SAF4B;YAEdC,kBAFc;;;UAK1CD,SAAS,IAAI,CAACC,kBAAkB,CAACC,MAArC,EAA6C;;QAE5CL,IAAI,CAACM,WAAL,CAAiB;UAChBC,IAAI,EAAG,GAAEP,IAAI,CAACO,IAAK,IADH;UAEhBN,KAAK,EAAEC;SAFR;QAKAF,IAAI,CAACM,WAAL,CAAiB;UAChBC,IAAI,EAAG,GAAEP,IAAI,CAACO,IAAK,IADH;UAEhBN,KAAK,EAAEE;SAFR,EAP4C;;YAaxC,CAACR,QAAL,EAAe;UACdK,IAAI,CAACQ,MAAL;;;KAnBH;GAFD;CAHc,CAAf;;;;"}
\ No newline at end of file
{
"_from": "postcss-overflow-shorthand@^2.0.0",
"_id": "postcss-overflow-shorthand@2.0.0",
"_inBundle": false,
"_integrity": "sha512-aK0fHc9CBNx8jbzMYhshZcEv8LtYnBIRYQD5i7w/K/wS9c2+0NSR6B3OVMu5y0hBHYLcMGjfU+dmWYNKH0I85g==",
"_location": "/postcss-overflow-shorthand",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "postcss-overflow-shorthand@^2.0.0",
"name": "postcss-overflow-shorthand",
"escapedName": "postcss-overflow-shorthand",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/postcss-preset-env"
],
"_resolved": "https://registry.npmjs.org/postcss-overflow-shorthand/-/postcss-overflow-shorthand-2.0.0.tgz",
"_shasum": "31ecf350e9c6f6ddc250a78f0c3e111f32dd4c30",
"_spec": "postcss-overflow-shorthand@^2.0.0",
"_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\postcss-preset-env",
"author": {
"name": "Jonathan Neal",
"email": "jonathantneal@hotmail.com"
},
"bugs": {
"url": "https://github.com/jonathantneal/postcss-overflow-shorthand/issues"
},
"bundleDependencies": false,
"dependencies": {
"postcss": "^7.0.2"
},
"deprecated": false,
"description": "Use the overflow shorthand in CSS",
"devDependencies": {
"@babel/core": "^7.0.0",
"@babel/preset-env": "^7.0.0",
"babel-eslint": "^9.0.0",
"eslint": "^5.6.0",
"eslint-config-dev": "^2.0.0",
"postcss-tape": "^2.2.0",
"pre-commit": "^1.2.2",
"rollup": "^0.66.0",
"rollup-plugin-babel": "^4.0.1"
},
"engines": {
"node": ">=6.0.0"
},
"eslintConfig": {
"extends": "dev",
"parser": "babel-eslint"
},
"files": [
"index.cjs.js",
"index.cjs.js.map",
"index.es.mjs",
"index.es.mjs.map"
],
"homepage": "https://github.com/jonathantneal/postcss-overflow-shorthand#readme",
"keywords": [
"postcss",
"css",
"postcss-plugin",
"overflow",
"properties",
"shorthands",
"values"
],
"license": "CC0-1.0",
"main": "index.cjs.js",
"module": "index.es.mjs",
"name": "postcss-overflow-shorthand",
"repository": {
"type": "git",
"url": "git+https://github.com/jonathantneal/postcss-overflow-shorthand.git"
},
"scripts": {
"prepublishOnly": "npm test",
"pretest": "rollup -c .rollup.js --silent",
"test": "echo 'Running tests...'; npm run test:js && npm run test:tape",
"test:ec": "echint --ignore index.*.js test",
"test:js": "eslint *.js --cache --ignore-path .gitignore --quiet",
"test:tape": "postcss-tape"
},
"version": "2.0.0"
}
# Change Log
This project adheres to [Semantic Versioning](http://semver.org/).
## 2.0
* Updated: Support for PostCSS v7+
* Updated: Support for Node v6+
## 1.0
* Initial release
The MIT License (MIT)
Copyright 2017 AUTHOR_NAME <AUTHOR_EMAIL>
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# postcss-page-break [![Build Status][ci-img]][ci]
[PostCSS] plugin to fallback `break-` properties with `page-break-` alias.
[PostCSS]: https://github.com/postcss/postcss
[ci-img]: https://travis-ci.org/shrpne/postcss-page-break.svg
[ci]: https://travis-ci.org/shrpne/postcss-page-break
```css
/* before */
.foo {
break-inside: avoid;
break-after: page;
}
/* after */
.foo {
page-break-inside: avoid;
break-inside: avoid;
page-break-after: always;
break-after: page;
}
```
Available fallbacks:
```
break-inside: auto => page-break-inside: auto
break-inside: avoid => page-break-inside: avoid
break-inside: avoid-page => page-break-inside: avoid
break-inside: inherit => page-break-inside: inherit
break-inside: initial => page-break-inside: initial
break-inside: unset => page-break-inside: unset
break-before: auto => page-break-before: auto;
break-before: avoid => page-break-before: avoid;
break-before: avoid-page => page-break-before: avoid;
break-before: page => page-break-before: always;
break-before: always => page-break-before: always;
break-before: left => page-break-before: left;
break-before: right => page-break-before: right;
break-before: recto => page-break-before: recto;
break-before: verso => page-break-before: verso;
break-before: inherit => page-break-before: inherit;
break-before: initial => page-break-before: initial;
break-before: unset => page-break-before: unset;
break-after: auto => page-break-after: auto;
break-after: avoid => page-break-after: avoid;
break-after: avoid-page => page-break-after: avoid;
break-after: page => page-break-after: always;
break-after: always => page-break-after: always;
break-after: left => page-break-after: left;
break-after: right => page-break-after: right;
break-after: recto => page-break-after: recto;
break-after: verso => page-break-after: verso;
break-after: inherit => page-break-after: inherit;
break-after: initial => page-break-after: initial;
break-after: unset => page-break-after: unset;
```
## Usage
```js
postcss([ require('postcss-page-break') ])
```
See [PostCSS] docs for examples for your environment (webpack, gulp, grunt).
var postcss = require('postcss');
module.exports = postcss.plugin('postcss-page-break', function () {
return function (root) {
root.walkDecls(/^break-(inside|before|after)/, function (decl) {
// do not process column|region related properties
if (decl.value.search(/column|region/) >= 0) {
return;
}
var newValue;
switch (decl.value) {
case 'page':
newValue = 'always';
break;
case 'avoid-page':
newValue = 'avoid';
break;
default:
newValue = decl.value;
}
decl.cloneBefore({
prop: 'page-' + decl.prop,
value: newValue
});
});
};
});
{
"_from": "postcss-page-break@^2.0.0",
"_id": "postcss-page-break@2.0.0",
"_inBundle": false,
"_integrity": "sha512-tkpTSrLpfLfD9HvgOlJuigLuk39wVTbbd8RKcy8/ugV2bNBUW3xU+AIqyxhDrQr1VUj1RmyJrBn1YWrqUm9zAQ==",
"_location": "/postcss-page-break",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "postcss-page-break@^2.0.0",
"name": "postcss-page-break",
"escapedName": "postcss-page-break",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/postcss-preset-env"
],
"_resolved": "https://registry.npmjs.org/postcss-page-break/-/postcss-page-break-2.0.0.tgz",
"_shasum": "add52d0e0a528cabe6afee8b46e2abb277df46bf",
"_spec": "postcss-page-break@^2.0.0",
"_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\postcss-preset-env",
"author": {
"name": "shrpne",
"email": "shrpne@gmail.com"
},
"bugs": {
"url": "https://github.com/shrpne/postcss-page-break/issues"
},
"bundleDependencies": false,
"dependencies": {
"postcss": "^7.0.2"
},
"deprecated": false,
"description": "PostCSS plugin postcss-page-break to fallback `break-` properties with `page-break-` alias",
"devDependencies": {
"eslint": "^4.15.0",
"eslint-config-postcss": "^2.0.2",
"jest": "^21.0.0"
},
"eslintConfig": {
"extends": "eslint-config-postcss/es5",
"rules": {
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"max-len": [
"off"
]
},
"env": {
"jest": true
}
},
"homepage": "https://github.com/shrpne/postcss-page-break",
"keywords": [
"postcss",
"css",
"postcss-plugin",
"break",
"break-inside",
"page-break-inside",
"avoid"
],
"license": "MIT",
"name": "postcss-page-break",
"repository": {
"type": "git",
"url": "git+https://github.com/shrpne/postcss-page-break.git"
},
"scripts": {
"test": "jest && eslint *.js"
},
"version": "2.0.0"
}
# Changes to PostCSS Place Properties
### 4.0.1 (September 18, 2018)
- Updated: PostCSS Values Parser 2 (patch for this project)
### 4.0.0 (September 17, 2018)
- Updated: Support for PostCSS v7+
- Updated: Support for Node v6+
### 3.0.1 (May 8, 2018)
- Updated: `postcss-values-parser` to v1.5.0 (major)
- Updated: `postcss` to v6.0.22 (patch)
### 2.0.0 (June 30, 2017)
- Added: Node 4+ compatibility
- Added: PostCSS 6+ compatibility
### 1.0.2 (December 8, 2016)
- Updated: Use destructing assignment on plugin options
- Updated: Use template literals
### 1.0.1 (December 6, 2016)
- Updated: boilerplate conventions (`postcss-tape`)
### 1.0.0 (November 25, 2016)
- Initial version
# CC0 1.0 Universal
## Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an “owner”) of an original work of
authorship and/or a database (each, a “Work”).
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific works
(“Commons”) that the public can reliably and without fear of later claims of
infringement build upon, modify, incorporate in other works, reuse and
redistribute as freely as possible in any form whatsoever and for any purposes,
including without limitation commercial purposes. These owners may contribute
to the Commons to promote the ideal of a free culture and the further
production of creative, cultural and scientific works, or to gain reputation or
greater distribution for their Work in part through the use and efforts of
others.
For these and/or other purposes and motivations, and without any expectation of
additional consideration or compensation, the person associating CC0 with a
Work (the “Affirmer”), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and
publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights (“Copyright and
Related Rights”). Copyright and Related Rights include, but are not limited
to, the following:
1. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
2. moral rights retained by the original author(s) and/or performer(s);
3. publicity and privacy rights pertaining to a person’s image or likeness
depicted in a Work;
4. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(i), below;
5. rights protecting the extraction, dissemination, use and reuse of data in
a Work;
6. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and
7. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations
thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the “Waiver”). Affirmer
makes the Waiver for the benefit of each member of the public at large and
to the detriment of Affirmer’s heirs and successors, fully intending that
such Waiver shall not be subject to revocation, rescission, cancellation,
termination, or any other legal or equitable action to disrupt the quiet
enjoyment of the Work by the public as contemplated by Affirmer’s express
Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer’s express Statement of Purpose. In addition, to the extent the
Waiver is so judged Affirmer hereby grants to each affected person a
royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer’s Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the “License”). The License
shall be deemed effective as of the date CC0 was applied by Affirmer to the
Work. Should any part of the License for any reason be judged legally
invalid or ineffective under applicable law, such partial invalidity or
ineffectiveness shall not invalidate the remainder of the License, and in
such case Affirmer hereby affirms that he or she will not (i) exercise any
of his or her remaining Copyright and Related Rights in the Work or (ii)
assert any associated claims and causes of action with respect to the Work,
in either case contrary to Affirmer’s express Statement of Purpose.
4. Limitations and Disclaimers.
1. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
2. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or
otherwise, including without limitation warranties of title,
merchantability, fitness for a particular purpose, non infringement, or
the absence of latent or other defects, accuracy, or the present or
absence of errors, whether or not discoverable, all to the greatest
extent permissible under applicable law.
3. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person’s Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the Work.
4. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.
For more information, please see
http://creativecommons.org/publicdomain/zero/1.0/.
# PostCSS Place Properties [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
[![NPM Version][npm-img]][npm-url]
[![CSS Standard Status][css-img]][css-url]
[![Build Status][cli-img]][cli-url]
[![Support Chat][git-img]][git-url]
[PostCSS Place Properties] lets you use `place-*` properties as shorthands for `align-*`
and `justify-*`, following the [CSS Box Alignment] specification.
```pcss
.example {
place-self: center;
place-content: space-between center;
}
/* becomes */
.example {
align-self: center;
justify-self: center;
place-self: center;
align-content: space-between;
justify-content: center;
place-content: space-between center;
}
```
## Usage
Add [PostCSS Place Properties] to your project:
```bash
npm install postcss-place --save-dev
```
Use [PostCSS Place Properties] to process your CSS:
```js
import postcssPlace from 'postcss-place';
postcssPlace.process(YOUR_CSS /*, processOptions, pluginOptions */);
```
Or use it as a [PostCSS] plugin:
```js
import postcss from 'postcss';
import postcssPlace from 'postcss-place';
postcss([
postcssPlace(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
```
[PostCSS Place Properties] runs in all Node environments, with special instructions for:
| [Node](INSTALL.md#node) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
| --- | --- | --- | --- | --- |
## Options
### preserve
The `preserve` option determines whether the original place declaration is
preserved. By default, it is preserved.
```js
postcssPlace({ preserve: false })
```
```pcss
.example {
place-self: center;
place-content: space-between center;
}
/* becomes */
.example {
align-self: center;
justify-self: center;
align-content: space-between;
justify-content: center;
}
```
[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-place.svg
[cli-url]: https://travis-ci.org/jonathantneal/postcss-place
[css-img]: https://cssdb.org/badge/place-properties.svg
[css-url]: https://cssdb.org/#place-properties
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
[git-url]: https://gitter.im/postcss/postcss
[npm-img]: https://img.shields.io/npm/v/postcss-place.svg
[npm-url]: https://www.npmjs.com/package/postcss-place
[CSS Box Alignment]: https://www.w3.org/TR/css-align-3/#place-content
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
[PostCSS]: https://github.com/postcss/postcss
[PostCSS Loader]: https://github.com/postcss/postcss-loader
[PostCSS Place Properties]: https://github.com/jonathantneal/postcss-place
'use strict';
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var postcss = _interopDefault(require('postcss'));
var parser = _interopDefault(require('postcss-values-parser'));
const placeMatch = /^place-(content|items|self)/;
var index = postcss.plugin('postcss-place', opts => {
// prepare options
const preserve = 'preserve' in Object(opts) ? Boolean(opts.prefix) : true;
return root => {
// walk each matching declaration
root.walkDecls(placeMatch, decl => {
// alignment
const alignment = decl.prop.match(placeMatch)[1]; // value ast and child nodes
const value = parser(decl.value).parse();
const children = value.nodes[0].nodes; // new justify-[alignment] and align-[alignment] declarations
const alignValue = children.length === 1 ? decl.value : String(children.slice(0, 1)).trim();
const justifyValue = children.length === 1 ? decl.value : String(children.slice(1)).trim();
decl.cloneBefore({
prop: `align-${alignment}`,
value: alignValue
});
decl.cloneBefore({
prop: `justify-${alignment}`,
value: justifyValue
}); // conditionally remove place-[alignment]
if (!preserve) {
decl.remove();
}
});
};
});
module.exports = index;
//# sourceMappingURL=index.cjs.js.map
{"version":3,"file":"index.cjs.js","sources":["index.js"],"sourcesContent":["import postcss from 'postcss';\nimport parser from 'postcss-values-parser';\n\nconst placeMatch = /^place-(content|items|self)/;\n\nexport default postcss.plugin('postcss-place', opts => {\n\t// prepare options\n\tconst preserve = 'preserve' in Object(opts) ? Boolean(opts.prefix) : true;\n\n\treturn root => {\n\t\t// walk each matching declaration\n\t\troot.walkDecls(placeMatch, decl => {\n\t\t\t// alignment\n\t\t\tconst alignment = decl.prop.match(placeMatch)[1];\n\n\t\t\t// value ast and child nodes\n\t\t\tconst value = parser(decl.value).parse();\n\t\t\tconst children = value.nodes[0].nodes;\n\n\t\t\t// new justify-[alignment] and align-[alignment] declarations\n\t\t\tconst alignValue = children.length === 1 ? decl.value : String(children.slice(0, 1)).trim();\n\t\t\tconst justifyValue = children.length === 1 ? decl.value : String(children.slice(1)).trim();\n\n\t\t\tdecl.cloneBefore({\n\t\t\t\tprop: `align-${alignment}`,\n\t\t\t\tvalue: alignValue\n\t\t\t});\n\n\t\t\tdecl.cloneBefore({\n\t\t\t\tprop: `justify-${alignment}`,\n\t\t\t\tvalue: justifyValue\n\t\t\t});\n\n\t\t\t// conditionally remove place-[alignment]\n\t\t\tif (!preserve) {\n\t\t\t\tdecl.remove();\n\t\t\t}\n\t\t});\n\t};\n});\n"],"names":["placeMatch","postcss","plugin","opts","preserve","Object","Boolean","prefix","root","walkDecls","decl","alignment","prop","match","value","parser","parse","children","nodes","alignValue","length","String","slice","trim","justifyValue","cloneBefore","remove"],"mappings":";;;;;;;AAGA,MAAMA,UAAU,GAAG,6BAAnB;AAEA,YAAeC,OAAO,CAACC,MAAR,CAAe,eAAf,EAAgCC,IAAI,IAAI;;QAEhDC,QAAQ,GAAG,cAAcC,MAAM,CAACF,IAAD,CAApB,GAA6BG,OAAO,CAACH,IAAI,CAACI,MAAN,CAApC,GAAoD,IAArE;SAEOC,IAAI,IAAI;;IAEdA,IAAI,CAACC,SAAL,CAAeT,UAAf,EAA2BU,IAAI,IAAI;;YAE5BC,SAAS,GAAGD,IAAI,CAACE,IAAL,CAAUC,KAAV,CAAgBb,UAAhB,EAA4B,CAA5B,CAAlB,CAFkC;;YAK5Bc,KAAK,GAAGC,MAAM,CAACL,IAAI,CAACI,KAAN,CAAN,CAAmBE,KAAnB,EAAd;YACMC,QAAQ,GAAGH,KAAK,CAACI,KAAN,CAAY,CAAZ,EAAeA,KAAhC,CANkC;;YAS5BC,UAAU,GAAGF,QAAQ,CAACG,MAAT,KAAoB,CAApB,GAAwBV,IAAI,CAACI,KAA7B,GAAqCO,MAAM,CAACJ,QAAQ,CAACK,KAAT,CAAe,CAAf,EAAkB,CAAlB,CAAD,CAAN,CAA6BC,IAA7B,EAAxD;YACMC,YAAY,GAAGP,QAAQ,CAACG,MAAT,KAAoB,CAApB,GAAwBV,IAAI,CAACI,KAA7B,GAAqCO,MAAM,CAACJ,QAAQ,CAACK,KAAT,CAAe,CAAf,CAAD,CAAN,CAA0BC,IAA1B,EAA1D;MAEAb,IAAI,CAACe,WAAL,CAAiB;QAChBb,IAAI,EAAG,SAAQD,SAAU,EADT;QAEhBG,KAAK,EAAEK;OAFR;MAKAT,IAAI,CAACe,WAAL,CAAiB;QAChBb,IAAI,EAAG,WAAUD,SAAU,EADX;QAEhBG,KAAK,EAAEU;OAFR,EAjBkC;;UAuB9B,CAACpB,QAAL,EAAe;QACdM,IAAI,CAACgB,MAAL;;KAxBF;GAFD;CAJc,CAAf;;;;"}
\ No newline at end of file
import postcss from 'postcss';
import parser from 'postcss-values-parser';
const placeMatch = /^place-(content|items|self)/;
var index = postcss.plugin('postcss-place', opts => {
// prepare options
const preserve = 'preserve' in Object(opts) ? Boolean(opts.prefix) : true;
return root => {
// walk each matching declaration
root.walkDecls(placeMatch, decl => {
// alignment
const alignment = decl.prop.match(placeMatch)[1]; // value ast and child nodes
const value = parser(decl.value).parse();
const children = value.nodes[0].nodes; // new justify-[alignment] and align-[alignment] declarations
const alignValue = children.length === 1 ? decl.value : String(children.slice(0, 1)).trim();
const justifyValue = children.length === 1 ? decl.value : String(children.slice(1)).trim();
decl.cloneBefore({
prop: `align-${alignment}`,
value: alignValue
});
decl.cloneBefore({
prop: `justify-${alignment}`,
value: justifyValue
}); // conditionally remove place-[alignment]
if (!preserve) {
decl.remove();
}
});
};
});
export default index;
//# sourceMappingURL=index.es.mjs.map
{"version":3,"file":"index.es.mjs","sources":["index.js"],"sourcesContent":["import postcss from 'postcss';\nimport parser from 'postcss-values-parser';\n\nconst placeMatch = /^place-(content|items|self)/;\n\nexport default postcss.plugin('postcss-place', opts => {\n\t// prepare options\n\tconst preserve = 'preserve' in Object(opts) ? Boolean(opts.prefix) : true;\n\n\treturn root => {\n\t\t// walk each matching declaration\n\t\troot.walkDecls(placeMatch, decl => {\n\t\t\t// alignment\n\t\t\tconst alignment = decl.prop.match(placeMatch)[1];\n\n\t\t\t// value ast and child nodes\n\t\t\tconst value = parser(decl.value).parse();\n\t\t\tconst children = value.nodes[0].nodes;\n\n\t\t\t// new justify-[alignment] and align-[alignment] declarations\n\t\t\tconst alignValue = children.length === 1 ? decl.value : String(children.slice(0, 1)).trim();\n\t\t\tconst justifyValue = children.length === 1 ? decl.value : String(children.slice(1)).trim();\n\n\t\t\tdecl.cloneBefore({\n\t\t\t\tprop: `align-${alignment}`,\n\t\t\t\tvalue: alignValue\n\t\t\t});\n\n\t\t\tdecl.cloneBefore({\n\t\t\t\tprop: `justify-${alignment}`,\n\t\t\t\tvalue: justifyValue\n\t\t\t});\n\n\t\t\t// conditionally remove place-[alignment]\n\t\t\tif (!preserve) {\n\t\t\t\tdecl.remove();\n\t\t\t}\n\t\t});\n\t};\n});\n"],"names":["placeMatch","postcss","plugin","opts","preserve","Object","Boolean","prefix","root","walkDecls","decl","alignment","prop","match","value","parser","parse","children","nodes","alignValue","length","String","slice","trim","justifyValue","cloneBefore","remove"],"mappings":";;;AAGA,MAAMA,UAAU,GAAG,6BAAnB;AAEA,YAAeC,OAAO,CAACC,MAAR,CAAe,eAAf,EAAgCC,IAAI,IAAI;;QAEhDC,QAAQ,GAAG,cAAcC,MAAM,CAACF,IAAD,CAApB,GAA6BG,OAAO,CAACH,IAAI,CAACI,MAAN,CAApC,GAAoD,IAArE;SAEOC,IAAI,IAAI;;IAEdA,IAAI,CAACC,SAAL,CAAeT,UAAf,EAA2BU,IAAI,IAAI;;YAE5BC,SAAS,GAAGD,IAAI,CAACE,IAAL,CAAUC,KAAV,CAAgBb,UAAhB,EAA4B,CAA5B,CAAlB,CAFkC;;YAK5Bc,KAAK,GAAGC,MAAM,CAACL,IAAI,CAACI,KAAN,CAAN,CAAmBE,KAAnB,EAAd;YACMC,QAAQ,GAAGH,KAAK,CAACI,KAAN,CAAY,CAAZ,EAAeA,KAAhC,CANkC;;YAS5BC,UAAU,GAAGF,QAAQ,CAACG,MAAT,KAAoB,CAApB,GAAwBV,IAAI,CAACI,KAA7B,GAAqCO,MAAM,CAACJ,QAAQ,CAACK,KAAT,CAAe,CAAf,EAAkB,CAAlB,CAAD,CAAN,CAA6BC,IAA7B,EAAxD;YACMC,YAAY,GAAGP,QAAQ,CAACG,MAAT,KAAoB,CAApB,GAAwBV,IAAI,CAACI,KAA7B,GAAqCO,MAAM,CAACJ,QAAQ,CAACK,KAAT,CAAe,CAAf,CAAD,CAAN,CAA0BC,IAA1B,EAA1D;MAEAb,IAAI,CAACe,WAAL,CAAiB;QAChBb,IAAI,EAAG,SAAQD,SAAU,EADT;QAEhBG,KAAK,EAAEK;OAFR;MAKAT,IAAI,CAACe,WAAL,CAAiB;QAChBb,IAAI,EAAG,WAAUD,SAAU,EADX;QAEhBG,KAAK,EAAEU;OAFR,EAjBkC;;UAuB9B,CAACpB,QAAL,EAAe;QACdM,IAAI,CAACgB,MAAL;;KAxBF;GAFD;CAJc,CAAf;;;;"}
\ No newline at end of file
{
"_from": "postcss-place@^4.0.1",
"_id": "postcss-place@4.0.1",
"_inBundle": false,
"_integrity": "sha512-Zb6byCSLkgRKLODj/5mQugyuj9bvAAw9LqJJjgwz5cYryGeXfFZfSXoP1UfveccFmeq0b/2xxwcTEVScnqGxBg==",
"_location": "/postcss-place",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "postcss-place@^4.0.1",
"name": "postcss-place",
"escapedName": "postcss-place",
"rawSpec": "^4.0.1",
"saveSpec": null,
"fetchSpec": "^4.0.1"
},
"_requiredBy": [
"/postcss-preset-env"
],
"_resolved": "https://registry.npmjs.org/postcss-place/-/postcss-place-4.0.1.tgz",
"_shasum": "e9f39d33d2dc584e46ee1db45adb77ca9d1dcc62",
"_spec": "postcss-place@^4.0.1",
"_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\postcss-preset-env",
"author": {
"name": "Jonathan Neal",
"email": "jonathantneal@hotmail.com"
},
"bugs": {
"url": "https://github.com/jonathantneal/postcss-place/issues"
},
"bundleDependencies": false,
"dependencies": {
"postcss": "^7.0.2",
"postcss-values-parser": "^2.0.0"
},
"deprecated": false,
"description": "Use a place-* shorthand for align-* and justify-* in CSS",
"devDependencies": {
"@babel/core": "^7.1.0",
"@babel/preset-env": "^7.1.0",
"babel-eslint": "^9.0.0",
"eslint": "^5.6.0",
"eslint-config-dev": "^2.0.0",
"postcss-tape": "^2.2.0",
"pre-commit": "^1.2.2",
"rollup": "^0.66.0",
"rollup-plugin-babel": "^4.0.3"
},
"engines": {
"node": ">=6.0.0"
},
"eslintConfig": {
"extends": "dev",
"parser": "babel-eslint"
},
"files": [
"index.cjs.js",
"index.cjs.js.map",
"index.es.mjs",
"index.es.mjs.map"
],
"homepage": "https://github.com/jonathantneal/postcss-place#readme",
"keywords": [
"postcss",
"css",
"postcss-plugin",
"shorthands",
"alignments",
"justifies",
"justify",
"aligns",
"contents",
"selfs"
],
"license": "CC0-1.0",
"main": "index.cjs.js",
"module": "index.es.mjs",
"name": "postcss-place",
"repository": {
"type": "git",
"url": "git+https://github.com/jonathantneal/postcss-place.git"
},
"scripts": {
"prepublishOnly": "npm test",
"pretest": "rollup -c .rollup.js --silent",
"test": "echo 'Running tests...'; npm run test:js && npm run test:tape",
"test:ec": "echint --ignore index.*.js test",
"test:js": "eslint *.js --cache --ignore-path .gitignore --quiet",
"test:tape": "postcss-tape"
},
"version": "4.0.1"
}
# Changes to PostCSS Preset Env
### 6.7.0 (July 8, 2019)
- Fixed the issue of autoprefixer alerting an upcoming change to the API
- Updated `autoprefixer` to 9.6.1 (minor)
- Updated `browserslist` to 4.6.4 (minor)
- Updated `cssdb` to 4.4.0 (minor)
- Updated `caniuse-lite` to 1.0.30000981 (patch)
- Updated `postcss` to 7.0.17 (patch)
- Updated `postcss-color-hex-alpha` to 5.0.3 (patch)
- Updated `postcss-custom-media` to 7.0.8 (patch)
- Updated `postcss-custom-properties` to 8.0.11 (patch)
### 6.6.0 (February 28, 2019)
- Moved browserslist detection from using each input file per process to using
the working directory on intialization, as was implied by the documentation.
If fixing this previously undocumented behavior causes any harm to existing
projects, it can be easily rolled back in a subsequent patch. For the
majority of projects — those with a singular browserslist configuration and
potentially many individually processed CSS files — we should expect reported
build times around 35 seconds to drop to less than 2 seconds.
- Updated `browserslist` to 4.4.2 (minor)
- Updated `autoprefixer` to 9.4.9 (patch)
- Updated `caniuse-lite` to 1.0.30000939 (patch)
- Updated `postcss` to 7.0.14 (patch)
- Updated `postcss-attribute-case-insensitive` to 4.0.1 (patch)
### 6.5.0 (December 12, 2018)
- Added `css-blank-pseudo` polyfill
- Added `css-has-pseudo` polyfill
- Updated `autoprefixer` to 9.4.2 (minor)
- Updated `browserslist` to 4.3.5 (minor)
- Updated `caniuse-lite` to 1.0.30000918 (patch)
- Updated `css-prefers-color-scheme` to 3.1.1 (minor, patch for this project)
- Updated `cssdb` to 4.3.0 (minor)
- Updated `postcss` to 7.0.6 (patch)
### 6.4.0 (November 6, 2018)
- Fixed `exportTo` option to export Custom Media, Custom Properties, and Custom
Selectors all to the same function, object, or file
- Added `css-prefers-color-scheme` 3.0.0 (major, non-breaking for this project)
- Updated `cssdb` to 4.2.0 (minor)
### 6.3.1 (November 5, 2018)
- Updated `caniuse-lite` to 1.0.30000905 (patch)
- Updated `postcss-custom-properties` to 8.0.9 (patch)
### 6.3.0 (October 28, 2018)
- Added `postcss-double-position-gradients` 1.0.0 (major, non-breaking for this project)
- Updated `autoprefixer` to 9.3.1 (minor)
- Updated `browserslist` to 4.3.4 (patch)
- Updated `caniuse-lite` to 1.0.30000899 (patch)
- Updated `cssdb` to 4.1.0 (major, non-breaking for this project)
### 6.2.0 (October 22, 2018)
- Updated `autoprefixer` to 9.2.1 (minor)
- Updated `browserslist` to 4.3.1 (minor)
### 6.1.2 (October 19, 2018)
- Updated `browserslist` to 4.2.1 (patch)
- Updated `caniuse-lite` to 1.0.30000893 (patch)
- Updated `postcss-custom-media` to 7.0.7 (patch)
### 6.1.1 (October 12, 2018)
- Updated: `postcss-custom-media` to 7.0.6 (patch)
### 6.1.0 (October 10, 2018)
- Added: `postcss-color-gray`
- Added: Passing `autoprefixer: false` disables autoprefixer
- Updated: `browserslist` to 4.2.0 (minor)
- Updated: `caniuse-lite` to 1.0.30000890 (patch)
### 6.0.10 (October 2, 2018)
- Updated: `postcss-custom-properties` to 8.0.8 (patch)
### 6.0.9 (October 2, 2018)
- Updated: `browserslist` to 4.1.2 (patch)
- Updated: `postcss` to 7.0.5 (patch)
- Updated: `postcss-custom-properties` to 8.0.7 (patch)
### 6.0.8 (October 1, 2018)
- Updated: `caniuse-lite` to 1.0.30000888 (patch)
- Updated: `postcss` to 7.0.4 (patch)
**Did you hear? PostCSS Preset Env is now part of Create React App!** 🎉
### 6.0.7 (September 23, 2018)
- Updated: `postcss` to 7.0.3 (patch)
- Updated: `postcss-custom-properties` to 8.0.6 (patch)
### 6.0.6 (September 23, 2018)
- Updated: `postcss-custom-media` to 7.0.4 (patch)
### 6.0.5 (September 23, 2018)
- Updated: `postcss-color-mod-function` to 3.0.3 (patch)
### 6.0.4 (September 23, 2018)
- Updated: `caniuse-lite` to 1.0.30000887 (patch)
- Updated: `postcss-color-mod-function` to 3.0.2 (patch)
### 6.0.3 (September 21, 2018)
- Updated: `caniuse-lite` to 1.0.30000885 (patch)
- Updated: `postcss-custom-properties` to 8.0.5 (patch)
### 6.0.2 (September 20, 2018)
- Fixed: Do not break on an empty `importFrom` object
- Fixed: Actually run `postcss-env-function`
### 6.0.1 (September 20, 2018)
- Fixed: Issue with the `system-ui` font family polyfill by replacing
`postcss-font-family-system-ui` with an internal polyfill, at least until the
problem with the original plugin is resolved.
### 6.0.0 (September 20, 2018)
- Added: Support for PostCSS 7+
- Added: Support for PostCSS Values Parser 2+
- Added: Support for PostCSS Selector Parser 5+
- Added: Support for Node 6+
- Updated: All 28 plugins
### 5.4.0 (July 25, 2018)
- Added: `toggle` option to override which features are enabled or disabled
- Deprecated: toggle features with `toggle`, not `features`
### 5.3.0 (July 24, 2018)
- Updated: `postcss-lab-function` to v1.1.0 (minor update)
### 5.2.3 (July 21, 2018)
- Updated: `postcss-color-mod-function` to v2.4.3 (patch update)
### 5.2.2 (July 13, 2018)
- Updated: `autoprefixer` to v8.6.5 (patch update)
- Updated: `caniuse-lite` to v1.0.30000865 (patch update)
- Updated: `postcss-color-functional-notation` to v1.0.2 (patch update)
### 5.2.1 (June 26, 2018)
- Updated: `caniuse-lite` to v1.0.30000859 (patch update)
- Updated: `postcss-attribute-case-insensitive` to v3.0.1 (patch update)
### 5.2.0 (June 25, 2018)
- Updated: `autoprefixer` to v8.6.3 (minor update)
- Updated: `caniuse-lite` to v1.0.30000858 (patch update)
- Updated: `postcss` to 6.0.23 (patch update)
- Updated: `postcss-nesting` to v6.0.0 (major internal update, non-breaking for this project)
### 5.1.0 (May 21, 2018)
- Added: `autoprefixer` option to pass options into autoprefixer
- Updated: `autoprefixer` to v8.5.0 (minor update)
- Updated: `browserslist` to v3.2.8 (patch update)
- Updated: `caniuse-lite` to v1.0.30000844 (patch update)
- Updated: `postcss-color-functional-notation` to v1.0.1 (patch update)
### 5.0.0 (May 11, 2018)
- Added: `autoprefixer`
- Added: `postcss-color-functional-notation`
- Added: `postcss-env-function`
- Added: `postcss-lab-function`
- Added: `postcss-place`
- Added: `postcss-gap-properties`
- Added: `postcss-overflow-shorthand`
- Updated: `cssdb` to v3.1.0 (major update)
- Updated: In conformance with cssdb v3, the default stage is now 2
- Updated: `postcss-attribute-case-insensitive` to v3.0.0 (major update)
- Updated: `postcss-pseudo-class-any-link` to v5.0.0 (major update)
- Updated: `postcss-image-set-function` to v2.0.0 (major update)
- Updated: `postcss-dir-pseudo-class` to v4.0.0 (major update)
- Updated: `postcss-color-rebeccapurple` to v3.1.0 (minor update)
- Updated: `postcss` to v6.0.22 (patch update)
- Updated: `browserslist` to v3.2.7 (patch update)
- Updated: `caniuse-lite` to v1.0.30000839 (patch update)
All plugins now conform to the latest stable releases of `postcss-value-parser`
v1.5.0 and `postcss-selector-parser` v4.0.0.
### 4.1.0 (April 23, 2018)
- Updated: `browserslist` to v3.2.5 (patch update)
- Updated: `caniuse-lite` to v1.0.30000830 (patch update)
- Updated: `postcss-apply` to v0.10.0 (minor update)
- Updated: `postcss-nesting` to v5.0.0 (major update, non-breaking for this project)
### 4.0.0 (April 7, 2018)
- Added: `postcss-focus-within`
- Updated: `postcss-focus-visible` to v3.0.0 (major update)
- Updated: `caniuse-lite` to v1.0.30000824 (patch update)
- Updated: `cssdb` to v2.0.0 (major update)
- Changed: All `specificationId` names to new `id` names for the `cssdb` update.
### 3.5.0 (April 5, 2018)
- Fixed: `selectors-matches-pseudo` mapping to allow `:matches` polyfilling
- Updated: `postcss-dir-pseudo-class` to v3.0.0 (major update, non-breaking for this project)
- Updated: `postcss-logical` to v1.1.1 (minor update)
- Updated: `postcss` to v6.0.21 (patch update)
- Updated: `browserslist` to v3.2.4 (patch update)
- Updated: `caniuse-lite` to v1.0.30000823 (patch update)
### 3.4.0 (March 18, 2018)
- Updated: `browserslist` to v3.2.0 (minor update)
- Updated: `postcss` to v6.0.20 (patch update)
- Updated: `postcss-image-set-polyfill` to `@csstools/postcss-image-set-function` (hopefully temporarily)
### 3.3.0 (March 16, 2018)
- Updated: `postcss-apply` to v0.9.0 (minor update)
- Updated: `browserslist` to v3.1.2 (patch update)
- Updated: `caniuse-lite` to v1.0.30000815 (patch update)
- Updated: distribution to cjs and es bundles
### 3.2.2 (February 27, 2018)
- Updated: `postcss-color-mod-function` to v2.4.2 (patch update)
### 3.2.1 (February 21, 2018)
- Updated: Use the latest tested version of all dependencies
### 3.2.0 (February 18, 2018)
- Added: `postcss-page-break` which has moved here from Autoprefixer
### 3.1.0 (February 17, 2018)
- Added: `postcss-focus-visible`
### 3.0.0 (February 16, 2018)
- Updated: `postcss-color-mod-function` to v2.4 (minor update)
- Updated: `postcss-custom-properties` to v7.0 (major update)
### 2.2.0 (February 14, 2018)
- Updated: `browserslist` to v3.1 (major update)
- Updated: `postcss-color-mod-function` to v2.3 (minor update)
- Improved: cleaned up one reusable variable and added a few tests
### 2.1.0 (January 22, 2018)
- Updated: `cssdb` to v1.5 (minor update)
- Updated: `postcss-color-mod-function` to v2.2 (major update)
- Updated: `postcss-font-family-system-ui` to v3.0 (repo update)
### 2.0.0 (January 16, 2018)
- Initial version
### 1.0.0 (December 20, 2017)
- Unsupported version accidentally published by a member of the community
# CC0 1.0 Universal
## Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an “owner”) of an original work of
authorship and/or a database (each, a “Work”).
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific works
(“Commons”) that the public can reliably and without fear of later claims of
infringement build upon, modify, incorporate in other works, reuse and
redistribute as freely as possible in any form whatsoever and for any purposes,
including without limitation commercial purposes. These owners may contribute
to the Commons to promote the ideal of a free culture and the further
production of creative, cultural and scientific works, or to gain reputation or
greater distribution for their Work in part through the use and efforts of
others.
For these and/or other purposes and motivations, and without any expectation of
additional consideration or compensation, the person associating CC0 with a
Work (the “Affirmer”), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and
publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights (“Copyright and
Related Rights”). Copyright and Related Rights include, but are not limited
to, the following:
1. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
2. moral rights retained by the original author(s) and/or performer(s);
3. publicity and privacy rights pertaining to a person’s image or likeness
depicted in a Work;
4. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(i), below;
5. rights protecting the extraction, dissemination, use and reuse of data in
a Work;
6. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and
7. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations
thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the “Waiver”). Affirmer
makes the Waiver for the benefit of each member of the public at large and
to the detriment of Affirmer’s heirs and successors, fully intending that
such Waiver shall not be subject to revocation, rescission, cancellation,
termination, or any other legal or equitable action to disrupt the quiet
enjoyment of the Work by the public as contemplated by Affirmer’s express
Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer’s express Statement of Purpose. In addition, to the extent the
Waiver is so judged Affirmer hereby grants to each affected person a
royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer’s Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the “License”). The License
shall be deemed effective as of the date CC0 was applied by Affirmer to the
Work. Should any part of the License for any reason be judged legally
invalid or ineffective under applicable law, such partial invalidity or
ineffectiveness shall not invalidate the remainder of the License, and in
such case Affirmer hereby affirms that he or she will not (i) exercise any
of his or her remaining Copyright and Related Rights in the Work or (ii)
assert any associated claims and causes of action with respect to the Work,
in either case contrary to Affirmer’s express Statement of Purpose.
4. Limitations and Disclaimers.
1. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
2. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or
otherwise, including without limitation warranties of title,
merchantability, fitness for a particular purpose, non infringement, or
the absence of latent or other defects, accuracy, or the present or
absence of errors, whether or not discoverable, all to the greatest
extent permissible under applicable law.
3. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person’s Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the Work.
4. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.
For more information, please see
http://creativecommons.org/publicdomain/zero/1.0/.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
{
"_from": "postcss-preset-env@6.7.0",
"_id": "postcss-preset-env@6.7.0",
"_inBundle": false,
"_integrity": "sha512-eU4/K5xzSFwUFJ8hTdTQzo2RBLbDVt83QZrAvI07TULOkmyQlnYlpwep+2yIK+K+0KlZO4BvFcleOCCcUtwchg==",
"_location": "/postcss-preset-env",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "postcss-preset-env@6.7.0",
"name": "postcss-preset-env",
"escapedName": "postcss-preset-env",
"rawSpec": "6.7.0",
"saveSpec": null,
"fetchSpec": "6.7.0"
},
"_requiredBy": [
"/react-scripts"
],
"_resolved": "https://registry.npmjs.org/postcss-preset-env/-/postcss-preset-env-6.7.0.tgz",
"_shasum": "c34ddacf8f902383b35ad1e030f178f4cdf118a5",
"_spec": "postcss-preset-env@6.7.0",
"_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\react-scripts",
"author": {
"name": "Jonathan Neal",
"email": "jonathantneal@hotmail.com"
},
"bugs": {
"url": "https://github.com/csstools/postcss-preset-env/issues"
},
"bundleDependencies": false,
"dependencies": {
"autoprefixer": "^9.6.1",
"browserslist": "^4.6.4",
"caniuse-lite": "^1.0.30000981",
"css-blank-pseudo": "^0.1.4",
"css-has-pseudo": "^0.10.0",
"css-prefers-color-scheme": "^3.1.1",
"cssdb": "^4.4.0",
"postcss": "^7.0.17",
"postcss-attribute-case-insensitive": "^4.0.1",
"postcss-color-functional-notation": "^2.0.1",
"postcss-color-gray": "^5.0.0",
"postcss-color-hex-alpha": "^5.0.3",
"postcss-color-mod-function": "^3.0.3",
"postcss-color-rebeccapurple": "^4.0.1",
"postcss-custom-media": "^7.0.8",
"postcss-custom-properties": "^8.0.11",
"postcss-custom-selectors": "^5.1.2",
"postcss-dir-pseudo-class": "^5.0.0",
"postcss-double-position-gradients": "^1.0.0",
"postcss-env-function": "^2.0.2",
"postcss-focus-visible": "^4.0.0",
"postcss-focus-within": "^3.0.0",
"postcss-font-variant": "^4.0.0",
"postcss-gap-properties": "^2.0.0",
"postcss-image-set-function": "^3.0.1",
"postcss-initial": "^3.0.0",
"postcss-lab-function": "^2.0.1",
"postcss-logical": "^3.0.0",
"postcss-media-minmax": "^4.0.0",
"postcss-nesting": "^7.0.0",
"postcss-overflow-shorthand": "^2.0.0",
"postcss-page-break": "^2.0.0",
"postcss-place": "^4.0.1",
"postcss-pseudo-class-any-link": "^6.0.0",
"postcss-replace-overflow-wrap": "^3.0.0",
"postcss-selector-matches": "^4.0.0",
"postcss-selector-not": "^4.0.0"
},
"deprecated": false,
"description": "Convert modern CSS into something browsers understand",
"devDependencies": {
"@babel/core": "^7.5.0",
"@babel/preset-env": "^7.5.2",
"babel-eslint": "^10.0.2",
"eslint": "^5.16.0",
"eslint-config-dev": "^2.0.0",
"postcss-simple-vars": "^5.0.2",
"postcss-tape": "^4.0.0",
"pre-commit": "^1.2.2",
"rollup": "^1.16.6",
"rollup-plugin-babel": "^4.3.3"
},
"engines": {
"node": ">=6.0.0"
},
"eslintConfig": {
"extends": "dev",
"parser": "babel-eslint"
},
"files": [
"index.js",
"index.js.map",
"index.mjs",
"index.mjs.map"
],
"homepage": "https://github.com/csstools/postcss-preset-env#readme",
"keywords": [
"postcss",
"css",
"postcss-plugin",
"specifications",
"specs",
"features",
"lists",
"stages",
"w3c",
"csswg",
"future",
"next"
],
"license": "CC0-1.0",
"main": "index.js",
"module": "index.mjs",
"name": "postcss-preset-env",
"repository": {
"type": "git",
"url": "git+https://github.com/csstools/postcss-preset-env.git"
},
"scripts": {
"build": "rollup -c .rollup.js --silent",
"prepublishOnly": "npm test",
"pretest:tape": "npm run build",
"test": "npm run test:js && npm run test:tape",
"test:js": "eslint src/*.js src/lib/*.js src/patch/*.js --cache --ignore-path .gitignore --quiet",
"test:tape": "postcss-tape"
},
"version": "6.7.0"
}
# Changes to PostCSS Pseudo Class Any Link
### 6.0.0 (September 17, 2018)
- Updated: Support for PostCSS v7+
- Updated: Support for Node v6+
- Updated: PostCSS Selector Parser 5.0.0-rc.3 (major)
### 5.0.0 (May 7, 2018)
- Updated: `postcss-selector-parser` to v4.0.0 (major)
- Updated: `postcss` to v6.0.22 (patch)
- Changed: Preserves `:any-link` by default
### 4.0.0 (May 10, 2017)
- Added: Support for PostCSS v6
- Added: Support for Node v4
- Removed: `prefix` option, as that would be non-spec
### 3.0.1 (December 8, 2016)
- Updated: Use destructing assignment on plugin options
- Updated: Use template literals
### 3.0.0 (December 5, 2016)
- Updated: boilerplate conventions (Node v6.9.1 LTS)
### 1.0.0 (September 1, 2015)
- Updated: PostCSS 5
- Updated: Develop dependencies
- Updated: ESLint configuration
### 0.3.0 (June 16, 2015)
- Added: Support for complex uses
- Added: Code documentation
- Changed: Coding conventions
### 0.2.1 (June 16, 2015)
- Fixed: postcss-selector-parser is included as a dependency
### 0.2.0 (June 15, 2015)
- Changed: use postcss-selector-parser
### 0.1.1 (June 14, 2015)
Initial release
# CC0 1.0 Universal
## Statement of Purpose
The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an “owner”) of an original work of
authorship and/or a database (each, a “Work”).
Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific works
(“Commons”) that the public can reliably and without fear of later claims of
infringement build upon, modify, incorporate in other works, reuse and
redistribute as freely as possible in any form whatsoever and for any purposes,
including without limitation commercial purposes. These owners may contribute
to the Commons to promote the ideal of a free culture and the further
production of creative, cultural and scientific works, or to gain reputation or
greater distribution for their Work in part through the use and efforts of
others.
For these and/or other purposes and motivations, and without any expectation of
additional consideration or compensation, the person associating CC0 with a
Work (the “Affirmer”), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and
publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.
1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights (“Copyright and
Related Rights”). Copyright and Related Rights include, but are not limited
to, the following:
1. the right to reproduce, adapt, distribute, perform, display, communicate,
and translate a Work;
2. moral rights retained by the original author(s) and/or performer(s);
3. publicity and privacy rights pertaining to a person’s image or likeness
depicted in a Work;
4. rights protecting against unfair competition in regards to a Work,
subject to the limitations in paragraph 4(i), below;
5. rights protecting the extraction, dissemination, use and reuse of data in
a Work;
6. database rights (such as those arising under Directive 96/9/EC of the
European Parliament and of the Council of 11 March 1996 on the legal
protection of databases, and under any national implementation thereof,
including any amended or successor version of such directive); and
7. other similar, equivalent or corresponding rights throughout the world
based on applicable law or treaty, and any national implementations
thereof.
2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer’s Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the “Waiver”). Affirmer
makes the Waiver for the benefit of each member of the public at large and
to the detriment of Affirmer’s heirs and successors, fully intending that
such Waiver shall not be subject to revocation, rescission, cancellation,
termination, or any other legal or equitable action to disrupt the quiet
enjoyment of the Work by the public as contemplated by Affirmer’s express
Statement of Purpose.
3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer’s express Statement of Purpose. In addition, to the extent the
Waiver is so judged Affirmer hereby grants to each affected person a
royalty-free, non transferable, non sublicensable, non exclusive,
irrevocable and unconditional license to exercise Affirmer’s Copyright and
Related Rights in the Work (i) in all territories worldwide, (ii) for the
maximum duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the “License”). The License
shall be deemed effective as of the date CC0 was applied by Affirmer to the
Work. Should any part of the License for any reason be judged legally
invalid or ineffective under applicable law, such partial invalidity or
ineffectiveness shall not invalidate the remainder of the License, and in
such case Affirmer hereby affirms that he or she will not (i) exercise any
of his or her remaining Copyright and Related Rights in the Work or (ii)
assert any associated claims and causes of action with respect to the Work,
in either case contrary to Affirmer’s express Statement of Purpose.
4. Limitations and Disclaimers.
1. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
2. Affirmer offers the Work as-is and makes no representations or warranties
of any kind concerning the Work, express, implied, statutory or
otherwise, including without limitation warranties of title,
merchantability, fitness for a particular purpose, non infringement, or
the absence of latent or other defects, accuracy, or the present or
absence of errors, whether or not discoverable, all to the greatest
extent permissible under applicable law.
3. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person’s Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the Work.
4. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to this
CC0 or use of the Work.
For more information, please see
http://creativecommons.org/publicdomain/zero/1.0/.
# PostCSS Pseudo Class Any Link [<img src="https://postcss.github.io/postcss/logo.svg" alt="PostCSS Logo" width="90" height="90" align="right">][postcss]
[![NPM Version][npm-img]][npm-url]
[![CSS Standard Status][css-img]][css-url]
[![Build Status][cli-img]][cli-url]
[![Support Chat][git-img]][git-url]
[PostCSS Pseudo Class Any Link] lets you `:any-link` pseudo-class in CSS,
following the [Selectors] specification.
```pcss
nav :any-link > span {
background-color: yellow;
}
/* becomes */
nav :link > span, nav :visited > span {
background-color: yellow;
}
nav :any-link > span {
background-color: yellow;
}
```
From the [proposal][Selectors]:
> The `:any-link` pseudo-class represents an element that acts as the source
anchor of a hyperlink. It matches an element if the element would match
`:link` or `:visited`.
## Usage
Add [PostCSS Pseudo Class Any Link] to your project:
```bash
npm install postcss-pseudo-class-any-link --save-dev
```
Use [PostCSS Pseudo Class Any Link] to process your CSS:
```js
const postcssPseudoClassAnyLink = require('postcss-pseudo-class-any-link');
postcssPseudoClassAnyLink.process(YOUR_CSS /*, processOptions, pluginOptions */);
```
Or use it as a [PostCSS] plugin:
```js
const postcss = require('postcss');
const postcssPseudoClassAnyLink = require('postcss-pseudo-class-any-link');
postcss([
postcssPseudoClassAnyLink(/* pluginOptions */)
]).process(YOUR_CSS /*, processOptions */);
```
[PostCSS Pseudo Class Any Link] runs in all Node environments, with special
instructions for:
| [Node](INSTALL.md#node) | [PostCSS CLI](INSTALL.md#postcss-cli) | [Webpack](INSTALL.md#webpack) | [Create React App](INSTALL.md#create-react-app) | [Gulp](INSTALL.md#gulp) | [Grunt](INSTALL.md#grunt) |
| --- | --- | --- | --- | --- | --- |
## Options
### preserve
The `preserve` option determines whether the original `:any-link` rule is
preserved. By default, it is preserved.
```js
postcssPseudoClassAnyLink({ preserve: false })
```
```pcss
nav :any-link > span {
background-color: yellow;
}
/* becomes */
nav :link > span, nav :visited > span {
background-color: yellow;
}
```
[cli-img]: https://img.shields.io/travis/jonathantneal/postcss-pseudo-class-any-link.svg
[cli-url]: https://travis-ci.org/jonathantneal/postcss-pseudo-class-any-link
[css-img]: https://cssdb.org/badge/any-link-pseudo-class.svg
[css-url]: https://cssdb.org/#any-link-pseudo-class
[git-img]: https://img.shields.io/badge/support-chat-blue.svg
[git-url]: https://gitter.im/postcss/postcss
[npm-img]: https://img.shields.io/npm/v/postcss-pseudo-class-any-link.svg
[npm-url]: https://www.npmjs.com/package/postcss-pseudo-class-any-link
[Gulp PostCSS]: https://github.com/postcss/gulp-postcss
[Grunt PostCSS]: https://github.com/nDmitry/grunt-postcss
[PostCSS]: https://github.com/postcss/postcss
[PostCSS Loader]: https://github.com/postcss/postcss-loader
[PostCSS Pseudo Class Any Link]: https://github.com/jonathantneal/postcss-pseudo-class-any-link
[Selectors]: https://www.w3.org/TR/selectors-4/#the-any-link-pseudo
'use strict';
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var postcss = _interopDefault(require('postcss'));
var parser = _interopDefault(require('postcss-selector-parser'));
const anyAnyLinkMatch = /:any-link/;
var index = postcss.plugin('postcss-pseudo-class-any-link', opts => {
const preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : true;
return root => {
// walk each matching rule
root.walkRules(anyAnyLinkMatch, rule => {
const rawSelector = rule.raws.selector && rule.raws.selector.raw || rule.selector; // workaround for https://github.com/postcss/postcss-selector-parser/issues/28#issuecomment-171910556
if (rawSelector[rawSelector.length - 1] !== ':') {
// update the selector
const updatedSelector = parser(selectors => {
// cache variables
let node;
let nodeIndex;
let selector;
let selectorLink;
let selectorVisited; // cache the selector index
let selectorIndex = -1; // for each selector
while (selector = selectors.nodes[++selectorIndex]) {
// reset the node index
nodeIndex = -1; // for each node
while (node = selector.nodes[++nodeIndex]) {
// if the node value matches the any-link value
if (node.value === ':any-link') {
// clone the selector
selectorLink = selector.clone();
selectorVisited = selector.clone(); // update the matching clone values
selectorLink.nodes[nodeIndex].value = ':link';
selectorVisited.nodes[nodeIndex].value = ':visited'; // replace the selector with the clones and roll back the selector index
selectors.nodes.splice(selectorIndex--, 1, selectorLink, selectorVisited); // stop updating the selector
break;
}
}
}
}).processSync(rawSelector);
if (updatedSelector !== rawSelector) {
if (preserve) {
rule.cloneBefore({
selector: updatedSelector
});
} else {
rule.selector = updatedSelector;
}
}
}
});
};
});
module.exports = index;
//# sourceMappingURL=index.cjs.js.map
{"version":3,"file":"index.cjs.js","sources":["index.js"],"sourcesContent":["import postcss from 'postcss';\nimport parser from 'postcss-selector-parser';\n\nconst anyAnyLinkMatch = /:any-link/;\n\nexport default postcss.plugin('postcss-pseudo-class-any-link', opts => {\n\tconst preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : true;\n\n\treturn root => {\n\t\t// walk each matching rule\n\t\troot.walkRules(anyAnyLinkMatch, rule => {\n\t\t\tconst rawSelector = rule.raws.selector && rule.raws.selector.raw || rule.selector;\n\n\t\t\t// workaround for https://github.com/postcss/postcss-selector-parser/issues/28#issuecomment-171910556\n\t\t\tif (rawSelector[rawSelector.length - 1] !== ':') {\n\t\t\t\t// update the selector\n\t\t\t\tconst updatedSelector = parser(selectors => {\n\t\t\t\t\t// cache variables\n\t\t\t\t\tlet node;\n\t\t\t\t\tlet nodeIndex;\n\t\t\t\t\tlet selector;\n\t\t\t\t\tlet selectorLink;\n\t\t\t\t\tlet selectorVisited;\n\n\t\t\t\t\t// cache the selector index\n\t\t\t\t\tlet selectorIndex = -1;\n\n\t\t\t\t\t// for each selector\n\t\t\t\t\twhile (selector = selectors.nodes[++selectorIndex]) {\n\t\t\t\t\t\t// reset the node index\n\t\t\t\t\t\tnodeIndex = -1;\n\n\t\t\t\t\t\t// for each node\n\t\t\t\t\t\twhile (node = selector.nodes[++nodeIndex]) {\n\t\t\t\t\t\t\t// if the node value matches the any-link value\n\t\t\t\t\t\t\tif (node.value === ':any-link') {\n\t\t\t\t\t\t\t\t// clone the selector\n\t\t\t\t\t\t\t\tselectorLink = selector.clone();\n\t\t\t\t\t\t\t\tselectorVisited = selector.clone();\n\n\t\t\t\t\t\t\t\t// update the matching clone values\n\t\t\t\t\t\t\t\tselectorLink.nodes[nodeIndex].value = ':link';\n\t\t\t\t\t\t\t\tselectorVisited.nodes[nodeIndex].value = ':visited';\n\n\t\t\t\t\t\t\t\t// replace the selector with the clones and roll back the selector index\n\t\t\t\t\t\t\t\tselectors.nodes.splice(selectorIndex--, 1, selectorLink, selectorVisited);\n\n\t\t\t\t\t\t\t\t// stop updating the selector\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}).processSync(rawSelector);\n\n\t\t\t\tif (updatedSelector !== rawSelector) {\n\t\t\t\t\tif (preserve) {\n\t\t\t\t\t\trule.cloneBefore({\n\t\t\t\t\t\t\tselector: updatedSelector\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\trule.selector = updatedSelector;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t};\n});\n"],"names":["anyAnyLinkMatch","postcss","plugin","opts","preserve","Object","Boolean","root","walkRules","rule","rawSelector","raws","selector","raw","length","updatedSelector","parser","selectors","node","nodeIndex","selectorLink","selectorVisited","selectorIndex","nodes","value","clone","splice","processSync","cloneBefore"],"mappings":";;;;;;;AAGA,MAAMA,eAAe,GAAG,WAAxB;AAEA,YAAeC,OAAO,CAACC,MAAR,CAAe,+BAAf,EAAgDC,IAAI,IAAI;QAChEC,QAAQ,GAAG,cAAcC,MAAM,CAACF,IAAD,CAApB,GAA6BG,OAAO,CAACH,IAAI,CAACC,QAAN,CAApC,GAAsD,IAAvE;SAEOG,IAAI,IAAI;;IAEdA,IAAI,CAACC,SAAL,CAAeR,eAAf,EAAgCS,IAAI,IAAI;YACjCC,WAAW,GAAGD,IAAI,CAACE,IAAL,CAAUC,QAAV,IAAsBH,IAAI,CAACE,IAAL,CAAUC,QAAV,CAAmBC,GAAzC,IAAgDJ,IAAI,CAACG,QAAzE,CADuC;;UAInCF,WAAW,CAACA,WAAW,CAACI,MAAZ,GAAqB,CAAtB,CAAX,KAAwC,GAA5C,EAAiD;;cAE1CC,eAAe,GAAGC,MAAM,CAACC,SAAS,IAAI;;cAEvCC,IAAJ;cACIC,SAAJ;cACIP,QAAJ;cACIQ,YAAJ;cACIC,eAAJ,CAN2C;;cASvCC,aAAa,GAAG,CAAC,CAArB,CAT2C;;iBAYpCV,QAAQ,GAAGK,SAAS,CAACM,KAAV,CAAgB,EAAED,aAAlB,CAAlB,EAAoD;;YAEnDH,SAAS,GAAG,CAAC,CAAb,CAFmD;;mBAK5CD,IAAI,GAAGN,QAAQ,CAACW,KAAT,CAAe,EAAEJ,SAAjB,CAAd,EAA2C;;kBAEtCD,IAAI,CAACM,KAAL,KAAe,WAAnB,EAAgC;;gBAE/BJ,YAAY,GAAGR,QAAQ,CAACa,KAAT,EAAf;gBACAJ,eAAe,GAAGT,QAAQ,CAACa,KAAT,EAAlB,CAH+B;;gBAM/BL,YAAY,CAACG,KAAb,CAAmBJ,SAAnB,EAA8BK,KAA9B,GAAsC,OAAtC;gBACAH,eAAe,CAACE,KAAhB,CAAsBJ,SAAtB,EAAiCK,KAAjC,GAAyC,UAAzC,CAP+B;;gBAU/BP,SAAS,CAACM,KAAV,CAAgBG,MAAhB,CAAuBJ,aAAa,EAApC,EAAwC,CAAxC,EAA2CF,YAA3C,EAAyDC,eAAzD,EAV+B;;;;;;SAnBL,CAAN,CAoCrBM,WApCqB,CAoCTjB,WApCS,CAAxB;;YAsCIK,eAAe,KAAKL,WAAxB,EAAqC;cAChCN,QAAJ,EAAc;YACbK,IAAI,CAACmB,WAAL,CAAiB;cAChBhB,QAAQ,EAAEG;aADX;WADD,MAIO;YACNN,IAAI,CAACG,QAAL,GAAgBG,eAAhB;;;;KAlDJ;GAFD;CAHc,CAAf;;;;"}
\ No newline at end of file
import postcss from 'postcss';
import parser from 'postcss-selector-parser';
const anyAnyLinkMatch = /:any-link/;
var index = postcss.plugin('postcss-pseudo-class-any-link', opts => {
const preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : true;
return root => {
// walk each matching rule
root.walkRules(anyAnyLinkMatch, rule => {
const rawSelector = rule.raws.selector && rule.raws.selector.raw || rule.selector; // workaround for https://github.com/postcss/postcss-selector-parser/issues/28#issuecomment-171910556
if (rawSelector[rawSelector.length - 1] !== ':') {
// update the selector
const updatedSelector = parser(selectors => {
// cache variables
let node;
let nodeIndex;
let selector;
let selectorLink;
let selectorVisited; // cache the selector index
let selectorIndex = -1; // for each selector
while (selector = selectors.nodes[++selectorIndex]) {
// reset the node index
nodeIndex = -1; // for each node
while (node = selector.nodes[++nodeIndex]) {
// if the node value matches the any-link value
if (node.value === ':any-link') {
// clone the selector
selectorLink = selector.clone();
selectorVisited = selector.clone(); // update the matching clone values
selectorLink.nodes[nodeIndex].value = ':link';
selectorVisited.nodes[nodeIndex].value = ':visited'; // replace the selector with the clones and roll back the selector index
selectors.nodes.splice(selectorIndex--, 1, selectorLink, selectorVisited); // stop updating the selector
break;
}
}
}
}).processSync(rawSelector);
if (updatedSelector !== rawSelector) {
if (preserve) {
rule.cloneBefore({
selector: updatedSelector
});
} else {
rule.selector = updatedSelector;
}
}
}
});
};
});
export default index;
//# sourceMappingURL=index.es.mjs.map
{"version":3,"file":"index.es.mjs","sources":["index.js"],"sourcesContent":["import postcss from 'postcss';\nimport parser from 'postcss-selector-parser';\n\nconst anyAnyLinkMatch = /:any-link/;\n\nexport default postcss.plugin('postcss-pseudo-class-any-link', opts => {\n\tconst preserve = 'preserve' in Object(opts) ? Boolean(opts.preserve) : true;\n\n\treturn root => {\n\t\t// walk each matching rule\n\t\troot.walkRules(anyAnyLinkMatch, rule => {\n\t\t\tconst rawSelector = rule.raws.selector && rule.raws.selector.raw || rule.selector;\n\n\t\t\t// workaround for https://github.com/postcss/postcss-selector-parser/issues/28#issuecomment-171910556\n\t\t\tif (rawSelector[rawSelector.length - 1] !== ':') {\n\t\t\t\t// update the selector\n\t\t\t\tconst updatedSelector = parser(selectors => {\n\t\t\t\t\t// cache variables\n\t\t\t\t\tlet node;\n\t\t\t\t\tlet nodeIndex;\n\t\t\t\t\tlet selector;\n\t\t\t\t\tlet selectorLink;\n\t\t\t\t\tlet selectorVisited;\n\n\t\t\t\t\t// cache the selector index\n\t\t\t\t\tlet selectorIndex = -1;\n\n\t\t\t\t\t// for each selector\n\t\t\t\t\twhile (selector = selectors.nodes[++selectorIndex]) {\n\t\t\t\t\t\t// reset the node index\n\t\t\t\t\t\tnodeIndex = -1;\n\n\t\t\t\t\t\t// for each node\n\t\t\t\t\t\twhile (node = selector.nodes[++nodeIndex]) {\n\t\t\t\t\t\t\t// if the node value matches the any-link value\n\t\t\t\t\t\t\tif (node.value === ':any-link') {\n\t\t\t\t\t\t\t\t// clone the selector\n\t\t\t\t\t\t\t\tselectorLink = selector.clone();\n\t\t\t\t\t\t\t\tselectorVisited = selector.clone();\n\n\t\t\t\t\t\t\t\t// update the matching clone values\n\t\t\t\t\t\t\t\tselectorLink.nodes[nodeIndex].value = ':link';\n\t\t\t\t\t\t\t\tselectorVisited.nodes[nodeIndex].value = ':visited';\n\n\t\t\t\t\t\t\t\t// replace the selector with the clones and roll back the selector index\n\t\t\t\t\t\t\t\tselectors.nodes.splice(selectorIndex--, 1, selectorLink, selectorVisited);\n\n\t\t\t\t\t\t\t\t// stop updating the selector\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}).processSync(rawSelector);\n\n\t\t\t\tif (updatedSelector !== rawSelector) {\n\t\t\t\t\tif (preserve) {\n\t\t\t\t\t\trule.cloneBefore({\n\t\t\t\t\t\t\tselector: updatedSelector\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\trule.selector = updatedSelector;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t};\n});\n"],"names":["anyAnyLinkMatch","postcss","plugin","opts","preserve","Object","Boolean","root","walkRules","rule","rawSelector","raws","selector","raw","length","updatedSelector","parser","selectors","node","nodeIndex","selectorLink","selectorVisited","selectorIndex","nodes","value","clone","splice","processSync","cloneBefore"],"mappings":";;;AAGA,MAAMA,eAAe,GAAG,WAAxB;AAEA,YAAeC,OAAO,CAACC,MAAR,CAAe,+BAAf,EAAgDC,IAAI,IAAI;QAChEC,QAAQ,GAAG,cAAcC,MAAM,CAACF,IAAD,CAApB,GAA6BG,OAAO,CAACH,IAAI,CAACC,QAAN,CAApC,GAAsD,IAAvE;SAEOG,IAAI,IAAI;;IAEdA,IAAI,CAACC,SAAL,CAAeR,eAAf,EAAgCS,IAAI,IAAI;YACjCC,WAAW,GAAGD,IAAI,CAACE,IAAL,CAAUC,QAAV,IAAsBH,IAAI,CAACE,IAAL,CAAUC,QAAV,CAAmBC,GAAzC,IAAgDJ,IAAI,CAACG,QAAzE,CADuC;;UAInCF,WAAW,CAACA,WAAW,CAACI,MAAZ,GAAqB,CAAtB,CAAX,KAAwC,GAA5C,EAAiD;;cAE1CC,eAAe,GAAGC,MAAM,CAACC,SAAS,IAAI;;cAEvCC,IAAJ;cACIC,SAAJ;cACIP,QAAJ;cACIQ,YAAJ;cACIC,eAAJ,CAN2C;;cASvCC,aAAa,GAAG,CAAC,CAArB,CAT2C;;iBAYpCV,QAAQ,GAAGK,SAAS,CAACM,KAAV,CAAgB,EAAED,aAAlB,CAAlB,EAAoD;;YAEnDH,SAAS,GAAG,CAAC,CAAb,CAFmD;;mBAK5CD,IAAI,GAAGN,QAAQ,CAACW,KAAT,CAAe,EAAEJ,SAAjB,CAAd,EAA2C;;kBAEtCD,IAAI,CAACM,KAAL,KAAe,WAAnB,EAAgC;;gBAE/BJ,YAAY,GAAGR,QAAQ,CAACa,KAAT,EAAf;gBACAJ,eAAe,GAAGT,QAAQ,CAACa,KAAT,EAAlB,CAH+B;;gBAM/BL,YAAY,CAACG,KAAb,CAAmBJ,SAAnB,EAA8BK,KAA9B,GAAsC,OAAtC;gBACAH,eAAe,CAACE,KAAhB,CAAsBJ,SAAtB,EAAiCK,KAAjC,GAAyC,UAAzC,CAP+B;;gBAU/BP,SAAS,CAACM,KAAV,CAAgBG,MAAhB,CAAuBJ,aAAa,EAApC,EAAwC,CAAxC,EAA2CF,YAA3C,EAAyDC,eAAzD,EAV+B;;;;;;SAnBL,CAAN,CAoCrBM,WApCqB,CAoCTjB,WApCS,CAAxB;;YAsCIK,eAAe,KAAKL,WAAxB,EAAqC;cAChCN,QAAJ,EAAc;YACbK,IAAI,CAACmB,WAAL,CAAiB;cAChBhB,QAAQ,EAAEG;aADX;WADD,MAIO;YACNN,IAAI,CAACG,QAAL,GAAgBG,eAAhB;;;;KAlDJ;GAFD;CAHc,CAAf;;;;"}
\ No newline at end of file
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/../cssesc/bin/cssesc" "$@"
ret=$?
else
node "$basedir/../cssesc/bin/cssesc" "$@"
ret=$?
fi
exit $ret
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\..\cssesc\bin\cssesc" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/../cssesc/bin/cssesc" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/../cssesc/bin/cssesc" $args
$ret=$LASTEXITCODE
}
exit $ret
Copyright Mathias Bynens <https://mathiasbynens.be/>
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# cssesc [![Build status](https://travis-ci.org/mathiasbynens/cssesc.svg?branch=master)](https://travis-ci.org/mathiasbynens/cssesc) [![Code coverage status](https://img.shields.io/codecov/c/github/mathiasbynens/cssesc.svg)](https://codecov.io/gh/mathiasbynens/cssesc)
A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.
This is a JavaScript library for [escaping text for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes) while generating the shortest possible valid ASCII-only output. [Here’s an online demo.](https://mothereff.in/css-escapes)
[A polyfill for the CSSOM `CSS.escape()` method is available in a separate repository.](https://mths.be/cssescape) (In comparison, _cssesc_ is much more powerful.)
Feel free to fork if you see possible improvements!
## Installation
Via [npm](https://www.npmjs.com/):
```bash
npm install cssesc
```
In a browser:
```html
<script src="cssesc.js"></script>
```
In [Node.js](https://nodejs.org/):
```js
const cssesc = require('cssesc');
```
In Ruby using [the `ruby-cssesc` wrapper gem](https://github.com/borodean/ruby-cssesc):
```bash
gem install ruby-cssesc
```
```ruby
require 'ruby-cssesc'
CSSEsc.escape('I ♥ Ruby', is_identifier: true)
```
In Sass using [`sassy-escape`](https://github.com/borodean/sassy-escape):
```bash
gem install sassy-escape
```
```scss
body {
content: escape('I ♥ Sass', $is-identifier: true);
}
```
## API
### `cssesc(value, options)`
This function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes).
```js
cssesc('Ich ♥ Bücher');
// → 'Ich \\2665 B\\FC cher'
cssesc('foo 𝌆 bar');
// → 'foo \\1D306 bar'
```
By default, `cssesc` returns a string that can be used as part of a CSS string. If the target is a CSS identifier rather than a CSS string, use the `isIdentifier: true` setting (see below).
The optional `options` argument accepts an object with the following options:
#### `isIdentifier`
The default value for the `isIdentifier` option is `false`. This means that the input text will be escaped for use in a CSS string literal. If you want to use the result as a CSS identifier instead (in a selector, for example), set this option to `true`.
```js
cssesc('123a2b');
// → '123a2b'
cssesc('123a2b', {
'isIdentifier': true
});
// → '\\31 23a2b'
```
#### `quotes`
The default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input text will be escaped as `\'`, so that the output can be used in a CSS string literal wrapped in single quotes.
```js
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.');
// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.'
// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc."
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
'quotes': 'single'
});
// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.'
// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc."
```
If you want to use the output as part of a CSS string literal wrapped in double quotes, set the `quotes` option to `'double'`.
```js
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
'quotes': 'double'
});
// → 'Lorem ipsum \\"dolor\\" sit \'amet\' etc.'
// → "Lorem ipsum \\\"dolor\\\" sit 'amet' etc."
```
#### `wrap`
The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid CSS string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting.
```js
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
'quotes': 'single',
'wrap': true
});
// → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\''
// → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'"
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
'quotes': 'double',
'wrap': true
});
// → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."'
// → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\""
```
#### `escapeEverything`
The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols.
```js
cssesc('lolwat"foo\'bar', {
'escapeEverything': true
});
// → '\\6C\\6F\\6C\\77\\61\\74\\"\\66\\6F\\6F\\\'\\62\\61\\72'
// → "\\6C\\6F\\6C\\77\\61\\74\\\"\\66\\6F\\6F\\'\\62\\61\\72"
```
#### Overriding the default options globally
The global default settings can be overridden by modifying the `css.options` object. This saves you from passing in an `options` object for every call to `encode` if you want to use the non-default setting.
```js
// Read the global default setting for `escapeEverything`:
cssesc.options.escapeEverything;
// → `false` by default
// Override the global default setting for `escapeEverything`:
cssesc.options.escapeEverything = true;
// Using the global default setting for `escapeEverything`, which is now `true`:
cssesc('foo © bar ≠ baz 𝌆 qux');
// → '\\66\\6F\\6F\\ \\A9\\ \\62\\61\\72\\ \\2260\\ \\62\\61\\7A\\ \\1D306\\ \\71\\75\\78'
```
### `cssesc.version`
A string representing the semantic version number.
### Using the `cssesc` binary
To use the `cssesc` binary in your shell, simply install cssesc globally using npm:
```bash
npm install -g cssesc
```
After that you will be able to escape text for use in CSS strings or identifiers from the command line:
```bash
$ cssesc 'föo ♥ bår 𝌆 baz'
f\F6o \2665 b\E5r \1D306 baz
```
If the output needs to be a CSS identifier rather than part of a string literal, use the `-i`/`--identifier` option:
```bash
$ cssesc --identifier 'föo ♥ bår 𝌆 baz'
f\F6o\ \2665\ b\E5r\ \1D306\ baz
```
See `cssesc --help` for the full list of options.
## Support
This library supports the Node.js and browser versions mentioned in [`.babelrc`](https://github.com/mathiasbynens/cssesc/blob/master/.babelrc). For a version that supports a wider variety of legacy browsers and environments out-of-the-box, [see v0.1.0](https://github.com/mathiasbynens/cssesc/releases/tag/v0.1.0).
## Author
| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](https://mathiasbynens.be/) |
## License
This library is available under the [MIT](https://mths.be/mit) license.
#!/usr/bin/env node
const fs = require('fs');
const cssesc = require('../cssesc.js');
const strings = process.argv.splice(2);
const stdin = process.stdin;
const options = {};
const log = console.log;
const main = function() {
const option = strings[0];
if (/^(?:-h|--help|undefined)$/.test(option)) {
log(
'cssesc v%s - https://mths.be/cssesc',
cssesc.version
);
log([
'\nUsage:\n',
'\tcssesc [string]',
'\tcssesc [-i | --identifier] [string]',
'\tcssesc [-s | --single-quotes] [string]',
'\tcssesc [-d | --double-quotes] [string]',
'\tcssesc [-w | --wrap] [string]',
'\tcssesc [-e | --escape-everything] [string]',
'\tcssesc [-v | --version]',
'\tcssesc [-h | --help]',
'\nExamples:\n',
'\tcssesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
'\tcssesc --identifier \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
'\tcssesc --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
'\tcssesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
'\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | cssesc'
].join('\n'));
return process.exit(1);
}
if (/^(?:-v|--version)$/.test(option)) {
log('v%s', cssesc.version);
return process.exit(1);
}
strings.forEach(function(string) {
// Process options
if (/^(?:-i|--identifier)$/.test(string)) {
options.isIdentifier = true;
return;
}
if (/^(?:-s|--single-quotes)$/.test(string)) {
options.quotes = 'single';
return;
}
if (/^(?:-d|--double-quotes)$/.test(string)) {
options.quotes = 'double';
return;
}
if (/^(?:-w|--wrap)$/.test(string)) {
options.wrap = true;
return;
}
if (/^(?:-e|--escape-everything)$/.test(string)) {
options.escapeEverything = true;
return;
}
// Process string(s)
let result;
try {
result = cssesc(string, options);
log(result);
} catch (exception) {
log(exception.message + '\n');
log('Error: failed to escape.');
log('If you think this is a bug in cssesc, please report it:');
log('https://github.com/mathiasbynens/cssesc/issues/new');
log(
'\nStack trace using cssesc@%s:\n',
cssesc.version
);
log(exception.stack);
return process.exit(1);
}
});
// Return with exit status 0 outside of the `forEach` loop, in case
// multiple strings were passed in.
return process.exit(0);
};
if (stdin.isTTY) {
// handle shell arguments
main();
} else {
let timeout;
// Either the script is called from within a non-TTY context, or `stdin`
// content is being piped in.
if (!process.stdout.isTTY) {
// The script was called from a non-TTY context. This is a rather uncommon
// use case we don’t actively support. However, we don’t want the script
// to wait forever in such cases, so…
timeout = setTimeout(function() {
// …if no piped data arrived after a whole minute, handle shell
// arguments instead.
main();
}, 60000);
}
let data = '';
stdin.on('data', function(chunk) {
clearTimeout(timeout);
data += chunk;
});
stdin.on('end', function() {
strings.push(data.trim());
main();
});
stdin.resume();
}
/*! https://mths.be/cssesc v1.0.1 by @mathias */
'use strict';
var object = {};
var hasOwnProperty = object.hasOwnProperty;
var merge = function merge(options, defaults) {
if (!options) {
return defaults;
}
var result = {};
for (var key in defaults) {
// `if (defaults.hasOwnProperty(key) { … }` is not needed here, since
// only recognized option names are used.
result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];
}
return result;
};
var regexAnySingleEscape = /[ -,\.\/;-@\[-\^`\{-~]/;
var regexSingleEscape = /[ -,\.\/;-@\[\]\^`\{-~]/;
var regexAlwaysEscape = /['"\\]/;
var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;
// https://mathiasbynens.be/notes/css-escapes#css
var cssesc = function cssesc(string, options) {
options = merge(options, cssesc.options);
if (options.quotes != 'single' && options.quotes != 'double') {
options.quotes = 'single';
}
var quote = options.quotes == 'double' ? '"' : '\'';
var isIdentifier = options.isIdentifier;
var firstChar = string.charAt(0);
var output = '';
var counter = 0;
var length = string.length;
while (counter < length) {
var character = string.charAt(counter++);
var codePoint = character.charCodeAt();
var value = void 0;
// If it’s not a printable ASCII character…
if (codePoint < 0x20 || codePoint > 0x7E) {
if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) {
// It’s a high surrogate, and there is a next character.
var extra = string.charCodeAt(counter++);
if ((extra & 0xFC00) == 0xDC00) {
// next character is low surrogate
codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;
} else {
// It’s an unmatched surrogate; only append this code unit, in case
// the next code unit is the high surrogate of a surrogate pair.
counter--;
}
}
value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
} else {
if (options.escapeEverything) {
if (regexAnySingleEscape.test(character)) {
value = '\\' + character;
} else {
value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
}
// Note: `:` could be escaped as `\:`, but that fails in IE < 8.
} else if (/[\t\n\f\r\x0B:]/.test(character)) {
if (!isIdentifier && character == ':') {
value = character;
} else {
value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
}
} else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) {
value = '\\' + character;
} else {
value = character;
}
}
output += value;
}
if (isIdentifier) {
if (/^_/.test(output)) {
// Prevent IE6 from ignoring the rule altogether (in case this is for an
// identifier used as a selector)
output = '\\_' + output.slice(1);
} else if (/^-[-\d]/.test(output)) {
output = '\\-' + output.slice(1);
} else if (/\d/.test(firstChar)) {
output = '\\3' + firstChar + ' ' + output.slice(1);
}
}
// Remove spaces after `\HEX` escapes that are not followed by a hex digit,
// since they’re redundant. Note that this is only possible if the escape
// sequence isn’t preceded by an odd number of backslashes.
output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {
if ($1 && $1.length % 2) {
// It’s not safe to remove the space, so don’t.
return $0;
}
// Strip the space.
return ($1 || '') + $2;
});
if (!isIdentifier && options.wrap) {
return quote + output + quote;
}
return output;
};
// Expose default options (so they can be overridden globally).
cssesc.options = {
'escapeEverything': false,
'isIdentifier': false,
'quotes': 'single',
'wrap': false
};
cssesc.version = '1.0.1';
module.exports = cssesc;
.Dd August 9, 2013
.Dt cssesc 1
.Sh NAME
.Nm cssesc
.Nd escape text for use in CSS string literals or identifiers
.Sh SYNOPSIS
.Nm
.Op Fl i | -identifier Ar string
.br
.Op Fl s | -single-quotes Ar string
.br
.Op Fl d | -double-quotes Ar string
.br
.Op Fl w | -wrap Ar string
.br
.Op Fl e | -escape-everything Ar string
.br
.Op Fl v | -version
.br
.Op Fl h | -help
.Sh DESCRIPTION
.Nm
escapes strings for use in CSS string literals or identifiers while generating the shortest possible valid ASCII-only output.
.Sh OPTIONS
.Bl -ohang -offset
.It Sy "-s, --single-quotes"
Escape any occurences of ' in the input string as \\', so that the output can be used in a CSS string literal wrapped in single quotes.
.It Sy "-d, --double-quotes"
Escape any occurences of " in the input string as \\", so that the output can be used in a CSS string literal wrapped in double quotes.
.It Sy "-w, --wrap"
Make sure the output is a valid CSS string literal wrapped in quotes. The type of quotes can be specified using the
.Ar -s | --single-quotes
or
.Ar -d | --double-quotes
settings.
.It Sy "-e, --escape-everything"
Escape all the symbols in the output, even printable ASCII symbols.
.It Sy "-v, --version"
Print cssesc's version.
.It Sy "-h, --help"
Show the help screen.
.El
.Sh EXIT STATUS
The
.Nm cssesc
utility exits with one of the following values:
.Pp
.Bl -tag -width flag -compact
.It Li 0
.Nm
successfully escaped the given text and printed the result.
.It Li 1
.Nm
wasn't instructed to escape anything (for example, the
.Ar --help
flag was set); or, an error occurred.
.El
.Sh EXAMPLES
.Bl -ohang -offset
.It Sy "cssesc 'foo bar baz'"
Print an escaped version of the given text.
.It Sy echo\ 'foo bar baz'\ |\ cssesc
Print an escaped version of the text that gets piped in.
.El
.Sh BUGS
cssesc's bug tracker is located at <https://github.com/mathiasbynens/cssesc/issues>.
.Sh AUTHOR
Mathias Bynens <https://mathiasbynens.be/>
.Sh WWW
<https://mths.be/cssesc>
{
"_from": "cssesc@^2.0.0",
"_id": "cssesc@2.0.0",
"_inBundle": false,
"_integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==",
"_location": "/postcss-pseudo-class-any-link/cssesc",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "cssesc@^2.0.0",
"name": "cssesc",
"escapedName": "cssesc",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/postcss-pseudo-class-any-link/postcss-selector-parser"
],
"_resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz",
"_shasum": "3b13bd1bb1cb36e1bcb5a4dcd27f54c5dcb35703",
"_spec": "cssesc@^2.0.0",
"_where": "C:\\Users\\kkwan_000\\Desktop\\git\\2017110269\\minsung\\node_modules\\postcss-pseudo-class-any-link\\node_modules\\postcss-selector-parser",
"author": {
"name": "Mathias Bynens",
"url": "https://mathiasbynens.be/"
},
"bin": {
"cssesc": "bin/cssesc"
},
"bugs": {
"url": "https://github.com/mathiasbynens/cssesc/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.6.1",
"codecov": "^1.0.1",
"grunt": "^1.0.1",
"grunt-template": "^1.0.0",
"istanbul": "^0.4.4",
"mocha": "^2.5.3",
"regenerate": "^1.2.1",
"requirejs": "^2.1.16"
},
"engines": {
"node": ">=4"
},
"files": [
"LICENSE-MIT.txt",
"cssesc.js",
"bin/",
"man/"
],
"homepage": "https://mths.be/cssesc",
"keywords": [
"css",
"escape",
"identifier",
"string",
"tool"
],
"license": "MIT",
"main": "cssesc.js",
"man": [
"man/cssesc.1"
],
"name": "cssesc",
"repository": {
"type": "git",
"url": "git+https://github.com/mathiasbynens/cssesc.git"
},
"scripts": {
"build": "grunt template && babel cssesc.js -o cssesc.js",
"cover": "istanbul cover --report html node_modules/.bin/_mocha tests -- -u exports -R spec",
"test": "mocha tests"
},
"version": "2.0.0"
}
Copyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
# postcss-selector-parser [![Build Status](https://travis-ci.org/postcss/postcss-selector-parser.svg?branch=master)](https://travis-ci.org/postcss/postcss-selector-parser)
> Selector parser with built in methods for working with selector strings.
## Install
With [npm](https://npmjs.com/package/postcss-selector-parser) do:
```
npm install postcss-selector-parser
```
## Quick Start
```js
const parser = require('postcss-selector-parser');
const transform = selectors => {
selectors.walk(selector => {
// do something with the selector
console.log(String(selector))
});
};
const transformed = parser(transform).processSync('h1, h2, h3');
```
To normalize selector whitespace:
```js
const parser = require('postcss-selector-parser');
const normalized = parser().processSync('h1, h2, h3', {lossless: false});
// -> h1,h2,h3
```
Async support is provided through `parser.process` and will resolve a Promise
with the resulting selector string.
## API
Please see [API.md](API.md).
## Credits
* Huge thanks to Andrey Sitnik (@ai) for work on PostCSS which helped
accelerate this module's development.
## License
MIT
'use strict';
exports.__esModule = true;
var _processor = require('./processor');
var _processor2 = _interopRequireDefault(_processor);
var _selectors = require('./selectors');
var selectors = _interopRequireWildcard(_selectors);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var parser = function parser(processor) {
return new _processor2.default(processor);
};
Object.assign(parser, selectors);
delete parser.__esModule;
exports.default = parser;
module.exports = exports['default'];
\ No newline at end of file
"use strict";
exports.__esModule = true;
var _parser = require("./parser");
var _parser2 = _interopRequireDefault(_parser);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var Processor = function () {
function Processor(func, options) {
_classCallCheck(this, Processor);
this.func = func || function noop() {};
this.funcRes = null;
this.options = options;
}
Processor.prototype._shouldUpdateSelector = function _shouldUpdateSelector(rule) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var merged = Object.assign({}, this.options, options);
if (merged.updateSelector === false) {
return false;
} else {
return typeof rule !== "string";
}
};
Processor.prototype._isLossy = function _isLossy() {
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var merged = Object.assign({}, this.options, options);
if (merged.lossless === false) {
return true;
} else {
return false;
}
};
Processor.prototype._root = function _root(rule) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var parser = new _parser2.default(rule, this._parseOptions(options));
return parser.root;
};
Processor.prototype._parseOptions = function _parseOptions(options) {
return {
lossy: this._isLossy(options)
};
};
Processor.prototype._run = function _run(rule) {
var _this = this;
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
return new Promise(function (resolve, reject) {
try {
var root = _this._root(rule, options);
Promise.resolve(_this.func(root)).then(function (transform) {
var string = undefined;
if (_this._shouldUpdateSelector(rule, options)) {
string = root.toString();
rule.selector = string;
}
return { transform: transform, root: root, string: string };
}).then(resolve, reject);
} catch (e) {
reject(e);
return;
}
});
};
Processor.prototype._runSync = function _runSync(rule) {
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var root = this._root(rule, options);
var transform = this.func(root);
if (transform && typeof transform.then === "function") {
throw new Error("Selector processor returned a promise to a synchronous call.");
}
var string = undefined;
if (options.updateSelector && typeof rule !== "string") {
string = root.toString();
rule.selector = string;
}
return { transform: transform, root: root, string: string };
};
/**
* Process rule into a selector AST.
*
* @param rule {postcss.Rule | string} The css selector to be processed
* @param options The options for processing
* @returns {Promise<parser.Root>} The AST of the selector after processing it.
*/
Processor.prototype.ast = function ast(rule, options) {
return this._run(rule, options).then(function (result) {
return result.root;
});
};
/**
* Process rule into a selector AST synchronously.
*
* @param rule {postcss.Rule | string} The css selector to be processed
* @param options The options for processing
* @returns {parser.Root} The AST of the selector after processing it.
*/
Processor.prototype.astSync = function astSync(rule, options) {
return this._runSync(rule, options).root;
};
/**
* Process a selector into a transformed value asynchronously
*
* @param rule {postcss.Rule | string} The css selector to be processed
* @param options The options for processing
* @returns {Promise<any>} The value returned by the processor.
*/
Processor.prototype.transform = function transform(rule, options) {
return this._run(rule, options).then(function (result) {
return result.transform;
});
};
/**
* Process a selector into a transformed value synchronously.
*
* @param rule {postcss.Rule | string} The css selector to be processed
* @param options The options for processing
* @returns {any} The value returned by the processor.
*/
Processor.prototype.transformSync = function transformSync(rule, options) {
return this._runSync(rule, options).transform;
};
/**
* Process a selector into a new selector string asynchronously.
*
* @param rule {postcss.Rule | string} The css selector to be processed
* @param options The options for processing
* @returns {string} the selector after processing.
*/
Processor.prototype.process = function process(rule, options) {
return this._run(rule, options).then(function (result) {
return result.string || result.root.toString();
});
};
/**
* Process a selector into a new selector string synchronously.
*
* @param rule {postcss.Rule | string} The css selector to be processed
* @param options The options for processing
* @returns {string} the selector after processing.
*/
Processor.prototype.processSync = function processSync(rule, options) {
var result = this._runSync(rule, options);
return result.string || result.root.toString();
};
return Processor;
}();
exports.default = Processor;
module.exports = exports["default"];
\ No newline at end of file
'use strict';
exports.__esModule = true;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _cssesc = require('cssesc');
var _cssesc2 = _interopRequireDefault(_cssesc);
var _util = require('../util');
var _node = require('./node');
var _node2 = _interopRequireDefault(_node);
var _types = require('./types');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var ClassName = function (_Node) {
_inherits(ClassName, _Node);
function ClassName(opts) {
_classCallCheck(this, ClassName);
var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
_this.type = _types.CLASS;
_this._constructed = true;
return _this;
}
ClassName.prototype.toString = function toString() {
return [this.rawSpaceBefore, String('.' + this.stringifyProperty("value")), this.rawSpaceAfter].join('');
};
_createClass(ClassName, [{
key: 'value',
set: function set(v) {
if (this._constructed) {
var escaped = (0, _cssesc2.default)(v, { isIdentifier: true });
if (escaped !== v) {
(0, _util.ensureObject)(this, "raws");
this.raws.value = escaped;
} else if (this.raws) {
delete this.raws.value;
}
}
this._value = v;
},
get: function get() {
return this._value;
}
}]);
return ClassName;
}(_node2.default);
exports.default = ClassName;
module.exports = exports['default'];
\ No newline at end of file
'use strict';
exports.__esModule = true;
var _node = require('./node');
var _node2 = _interopRequireDefault(_node);
var _types = require('./types');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Combinator = function (_Node) {
_inherits(Combinator, _Node);
function Combinator(opts) {
_classCallCheck(this, Combinator);
var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
_this.type = _types.COMBINATOR;
return _this;
}
return Combinator;
}(_node2.default);
exports.default = Combinator;
module.exports = exports['default'];
\ No newline at end of file
'use strict';
exports.__esModule = true;
var _node = require('./node');
var _node2 = _interopRequireDefault(_node);
var _types = require('./types');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Comment = function (_Node) {
_inherits(Comment, _Node);
function Comment(opts) {
_classCallCheck(this, Comment);
var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
_this.type = _types.COMMENT;
return _this;
}
return Comment;
}(_node2.default);
exports.default = Comment;
module.exports = exports['default'];
\ No newline at end of file
'use strict';
exports.__esModule = true;
exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = undefined;
var _attribute = require('./attribute');
var _attribute2 = _interopRequireDefault(_attribute);
var _className = require('./className');
var _className2 = _interopRequireDefault(_className);
var _combinator = require('./combinator');
var _combinator2 = _interopRequireDefault(_combinator);
var _comment = require('./comment');
var _comment2 = _interopRequireDefault(_comment);
var _id = require('./id');
var _id2 = _interopRequireDefault(_id);
var _nesting = require('./nesting');
var _nesting2 = _interopRequireDefault(_nesting);
var _pseudo = require('./pseudo');
var _pseudo2 = _interopRequireDefault(_pseudo);
var _root = require('./root');
var _root2 = _interopRequireDefault(_root);
var _selector = require('./selector');
var _selector2 = _interopRequireDefault(_selector);
var _string = require('./string');
var _string2 = _interopRequireDefault(_string);
var _tag = require('./tag');
var _tag2 = _interopRequireDefault(_tag);
var _universal = require('./universal');
var _universal2 = _interopRequireDefault(_universal);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
var attribute = exports.attribute = function attribute(opts) {
return new _attribute2.default(opts);
};
var className = exports.className = function className(opts) {
return new _className2.default(opts);
};
var combinator = exports.combinator = function combinator(opts) {
return new _combinator2.default(opts);
};
var comment = exports.comment = function comment(opts) {
return new _comment2.default(opts);
};
var id = exports.id = function id(opts) {
return new _id2.default(opts);
};
var nesting = exports.nesting = function nesting(opts) {
return new _nesting2.default(opts);
};
var pseudo = exports.pseudo = function pseudo(opts) {
return new _pseudo2.default(opts);
};
var root = exports.root = function root(opts) {
return new _root2.default(opts);
};
var selector = exports.selector = function selector(opts) {
return new _selector2.default(opts);
};
var string = exports.string = function string(opts) {
return new _string2.default(opts);
};
var tag = exports.tag = function tag(opts) {
return new _tag2.default(opts);
};
var universal = exports.universal = function universal(opts) {
return new _universal2.default(opts);
};
\ No newline at end of file
"use strict";
exports.__esModule = true;
exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = exports.isPseudo = exports.isNesting = exports.isIdentifier = exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = undefined;
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _IS_TYPE;
exports.isNode = isNode;
exports.isPseudoElement = isPseudoElement;
exports.isPseudoClass = isPseudoClass;
exports.isContainer = isContainer;
exports.isNamespace = isNamespace;
var _types = require("./types");
var IS_TYPE = (_IS_TYPE = {}, _IS_TYPE[_types.ATTRIBUTE] = true, _IS_TYPE[_types.CLASS] = true, _IS_TYPE[_types.COMBINATOR] = true, _IS_TYPE[_types.COMMENT] = true, _IS_TYPE[_types.ID] = true, _IS_TYPE[_types.NESTING] = true, _IS_TYPE[_types.PSEUDO] = true, _IS_TYPE[_types.ROOT] = true, _IS_TYPE[_types.SELECTOR] = true, _IS_TYPE[_types.STRING] = true, _IS_TYPE[_types.TAG] = true, _IS_TYPE[_types.UNIVERSAL] = true, _IS_TYPE);
function isNode(node) {
return (typeof node === "undefined" ? "undefined" : _typeof(node)) === "object" && IS_TYPE[node.type];
}
function isNodeType(type, node) {
return isNode(node) && node.type === type;
}
var isAttribute = exports.isAttribute = isNodeType.bind(null, _types.ATTRIBUTE);
var isClassName = exports.isClassName = isNodeType.bind(null, _types.CLASS);
var isCombinator = exports.isCombinator = isNodeType.bind(null, _types.COMBINATOR);
var isComment = exports.isComment = isNodeType.bind(null, _types.COMMENT);
var isIdentifier = exports.isIdentifier = isNodeType.bind(null, _types.ID);
var isNesting = exports.isNesting = isNodeType.bind(null, _types.NESTING);
var isPseudo = exports.isPseudo = isNodeType.bind(null, _types.PSEUDO);
var isRoot = exports.isRoot = isNodeType.bind(null, _types.ROOT);
var isSelector = exports.isSelector = isNodeType.bind(null, _types.SELECTOR);
var isString = exports.isString = isNodeType.bind(null, _types.STRING);
var isTag = exports.isTag = isNodeType.bind(null, _types.TAG);
var isUniversal = exports.isUniversal = isNodeType.bind(null, _types.UNIVERSAL);
function isPseudoElement(node) {
return isPseudo(node) && node.value && (node.value.startsWith("::") || node.value === ":before" || node.value === ":after");
}
function isPseudoClass(node) {
return isPseudo(node) && !isPseudoElement(node);
}
function isContainer(node) {
return !!(isNode(node) && node.walk);
}
function isNamespace(node) {
return isAttribute(node) || isTag(node);
}
\ No newline at end of file
'use strict';
exports.__esModule = true;
var _node = require('./node');
var _node2 = _interopRequireDefault(_node);
var _types = require('./types');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var ID = function (_Node) {
_inherits(ID, _Node);
function ID(opts) {
_classCallCheck(this, ID);
var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
_this.type = _types.ID;
return _this;
}
ID.prototype.toString = function toString() {
return [this.rawSpaceBefore, String('#' + this.stringifyProperty("value")), this.rawSpaceAfter].join('');
};
return ID;
}(_node2.default);
exports.default = ID;
module.exports = exports['default'];
\ No newline at end of file
"use strict";
exports.__esModule = true;
var _types = require("./types");
Object.keys(_types).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _types[key];
}
});
});
var _constructors = require("./constructors");
Object.keys(_constructors).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _constructors[key];
}
});
});
var _guards = require("./guards");
Object.keys(_guards).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _guards[key];
}
});
});
\ No newline at end of file
'use strict';
exports.__esModule = true;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _cssesc = require('cssesc');
var _cssesc2 = _interopRequireDefault(_cssesc);
var _util = require('../util');
var _node = require('./node');
var _node2 = _interopRequireDefault(_node);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Namespace = function (_Node) {
_inherits(Namespace, _Node);
function Namespace() {
_classCallCheck(this, Namespace);
return _possibleConstructorReturn(this, _Node.apply(this, arguments));
}
Namespace.prototype.qualifiedName = function qualifiedName(value) {
if (this.namespace) {
return this.namespaceString + '|' + value;
} else {
return value;
}
};
Namespace.prototype.toString = function toString() {
return [this.rawSpaceBefore, this.qualifiedName(this.stringifyProperty("value")), this.rawSpaceAfter].join('');
};
_createClass(Namespace, [{
key: 'namespace',
get: function get() {
return this._namespace;
},
set: function set(namespace) {
if (namespace === true || namespace === "*" || namespace === "&") {
this._namespace = namespace;
if (this.raws) {
delete this.raws.namespace;
}
return;
}
var escaped = (0, _cssesc2.default)(namespace, { isIdentifier: true });
this._namespace = namespace;
if (escaped !== namespace) {
(0, _util.ensureObject)(this, "raws");
this.raws.namespace = escaped;
} else if (this.raws) {
delete this.raws.namespace;
}
}
}, {
key: 'ns',
get: function get() {
return this._namespace;
},
set: function set(namespace) {
this.namespace = namespace;
}
}, {
key: 'namespaceString',
get: function get() {
if (this.namespace) {
var ns = this.stringifyProperty("namespace");
if (ns === true) {
return '';
} else {
return ns;
}
} else {
return '';
}
}
}]);
return Namespace;
}(_node2.default);
exports.default = Namespace;
;
module.exports = exports['default'];
\ No newline at end of file
'use strict';
exports.__esModule = true;
var _node = require('./node');
var _node2 = _interopRequireDefault(_node);
var _types = require('./types');
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
var Nesting = function (_Node) {
_inherits(Nesting, _Node);
function Nesting(opts) {
_classCallCheck(this, Nesting);
var _this = _possibleConstructorReturn(this, _Node.call(this, opts));
_this.type = _types.NESTING;
_this.value = '&';
return _this;
}
return Nesting;
}(_node2.default);
exports.default = Nesting;
module.exports = exports['default'];
\ No newline at end of file
'use strict';
exports.__esModule = true;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
var _util = require('../util');
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var cloneNode = function cloneNode(obj, parent) {
if ((typeof obj === 'undefined' ? 'undefined' : _typeof(obj)) !== 'object' || obj === null) {
return obj;
}
var cloned = new obj.constructor();
for (var i in obj) {
if (!obj.hasOwnProperty(i)) {
continue;
}
var value = obj[i];
var type = typeof value === 'undefined' ? 'undefined' : _typeof(value);
if (i === 'parent' && type === 'object') {
if (parent) {
cloned[i] = parent;
}
} else if (value instanceof Array) {
cloned[i] = value.map(function (j) {
return cloneNode(j, cloned);
});
} else {
cloned[i] = cloneNode(value, cloned);
}
}
return cloned;
};
var Node = function () {
function Node() {
var opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
_classCallCheck(this, Node);
Object.assign(this, opts);
this.spaces = this.spaces || {};
this.spaces.before = this.spaces.before || '';
this.spaces.after = this.spaces.after || '';
}
Node.prototype.remove = function remove() {
if (this.parent) {
this.parent.removeChild(this);
}
this.parent = undefined;
return this;
};
Node.prototype.replaceWith = function replaceWith() {
if (this.parent) {
for (var index in arguments) {
this.parent.insertBefore(this, arguments[index]);
}
this.remove();
}
return this;
};
Node.prototype.next = function next() {
return this.parent.at(this.parent.index(this) + 1);
};
Node.prototype.prev = function prev() {
return this.parent.at(this.parent.index(this) - 1);
};
Node.prototype.clone = function clone() {
var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var cloned = cloneNode(this);
for (var name in overrides) {
cloned[name] = overrides[name];
}
return cloned;
};
/**
* Some non-standard syntax doesn't follow normal escaping rules for css.
* This allows non standard syntax to be appended to an existing property
* by specifying the escaped value. By specifying the escaped value,
* illegal characters are allowed to be directly inserted into css output.
* @param {string} name the property to set
* @param {any} value the unescaped value of the property
* @param {string} valueEscaped optional. the escaped value of the property.
*/
Node.prototype.appendToPropertyAndEscape = function appendToPropertyAndEscape(name, value, valueEscaped) {
if (!this.raws) {
this.raws = {};
}
var originalValue = this[name];
var originalEscaped = this.raws[name];
this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first.
if (originalEscaped || valueEscaped !== value) {
this.raws[name] = (originalEscaped || originalValue) + valueEscaped;
} else {
delete this.raws[name]; // delete any escaped value that was created by the setter.
}
};
/**
* Some non-standard syntax doesn't follow normal escaping rules for css.
* This allows the escaped value to be specified directly, allowing illegal
* characters to be directly inserted into css output.
* @param {string} name the property to set
* @param {any} value the unescaped value of the property
* @param {string} valueEscaped the escaped value of the property.
*/
Node.prototype.setPropertyAndEscape = function setPropertyAndEscape(name, value, valueEscaped) {
if (!this.raws) {
this.raws = {};
}
this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
this.raws[name] = valueEscaped;
};
/**
* When you want a value to passed through to CSS directly. This method
* deletes the corresponding raw value causing the stringifier to fallback
* to the unescaped value.
* @param {string} name the property to set.
* @param {any} value The value that is both escaped and unescaped.
*/
Node.prototype.setPropertyWithoutEscape = function setPropertyWithoutEscape(name, value) {
this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
if (this.raws) {
delete this.raws[name];
}
};
/**
*
* @param {number} line The number (starting with 1)
* @param {number} column The column number (starting with 1)
*/
Node.prototype.isAtPosition = function isAtPosition(line, column) {
if (this.source && this.source.start && this.source.end) {
if (this.source.start.line > line) {
return false;
}
if (this.source.end.line < line) {
return false;
}
if (this.source.start.line === line && this.source.start.column > column) {
return false;
}
if (this.source.end.line === line && this.source.end.column < column) {
return false;
}
return true;
}
return undefined;
};
Node.prototype.stringifyProperty = function stringifyProperty(name) {
return this.raws && this.raws[name] || this[name];
};
Node.prototype.toString = function toString() {
return [this.rawSpaceBefore, String(this.stringifyProperty("value")), this.rawSpaceAfter].join('');
};
_createClass(Node, [{
key: 'rawSpaceBefore',
get: function get() {
var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;
if (rawSpace === undefined) {
rawSpace = this.spaces && this.spaces.before;
}
return rawSpace || "";
},
set: function set(raw) {
(0, _util.ensureObject)(this, "raws", "spaces");
this.raws.spaces.before = raw;
}
}, {
key: 'rawSpaceAfter',
get: function get() {
var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;
if (rawSpace === undefined) {
rawSpace = this.spaces.after;
}
return rawSpace || "";
},
set: function set(raw) {
(0, _util.ensureObject)(this, "raws", "spaces");
this.raws.spaces.after = raw;
}
}]);
return Node;
}();
exports.default = Node;
module.exports = exports['default'];
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.