mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Deploying to gh-pages from @ 7c3269bdbe 🚀
This commit is contained in:
3
dist/lib/css/IPropertyDescriptor.js
vendored
Normal file
3
dist/lib/css/IPropertyDescriptor.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=IPropertyDescriptor.js.map
|
||||
1
dist/lib/css/IPropertyDescriptor.js.map
vendored
Normal file
1
dist/lib/css/IPropertyDescriptor.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"IPropertyDescriptor.js","sourceRoot":"","sources":["../../../src/css/IPropertyDescriptor.ts"],"names":[],"mappings":""}
|
||||
3
dist/lib/css/ITypeDescriptor.js
vendored
Normal file
3
dist/lib/css/ITypeDescriptor.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
//# sourceMappingURL=ITypeDescriptor.js.map
|
||||
1
dist/lib/css/ITypeDescriptor.js.map
vendored
Normal file
1
dist/lib/css/ITypeDescriptor.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"ITypeDescriptor.js","sourceRoot":"","sources":["../../../src/css/ITypeDescriptor.ts"],"names":[],"mappings":""}
|
||||
216
dist/lib/css/index.js
vendored
Normal file
216
dist/lib/css/index.js
vendored
Normal file
@@ -0,0 +1,216 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.CSSParsedCounterDeclaration = exports.CSSParsedPseudoDeclaration = exports.CSSParsedDeclaration = void 0;
|
||||
var background_clip_1 = require("./property-descriptors/background-clip");
|
||||
var background_color_1 = require("./property-descriptors/background-color");
|
||||
var background_image_1 = require("./property-descriptors/background-image");
|
||||
var background_origin_1 = require("./property-descriptors/background-origin");
|
||||
var background_position_1 = require("./property-descriptors/background-position");
|
||||
var background_repeat_1 = require("./property-descriptors/background-repeat");
|
||||
var background_size_1 = require("./property-descriptors/background-size");
|
||||
var border_color_1 = require("./property-descriptors/border-color");
|
||||
var border_radius_1 = require("./property-descriptors/border-radius");
|
||||
var border_style_1 = require("./property-descriptors/border-style");
|
||||
var border_width_1 = require("./property-descriptors/border-width");
|
||||
var color_1 = require("./property-descriptors/color");
|
||||
var direction_1 = require("./property-descriptors/direction");
|
||||
var display_1 = require("./property-descriptors/display");
|
||||
var float_1 = require("./property-descriptors/float");
|
||||
var letter_spacing_1 = require("./property-descriptors/letter-spacing");
|
||||
var line_break_1 = require("./property-descriptors/line-break");
|
||||
var line_height_1 = require("./property-descriptors/line-height");
|
||||
var list_style_image_1 = require("./property-descriptors/list-style-image");
|
||||
var list_style_position_1 = require("./property-descriptors/list-style-position");
|
||||
var list_style_type_1 = require("./property-descriptors/list-style-type");
|
||||
var margin_1 = require("./property-descriptors/margin");
|
||||
var overflow_1 = require("./property-descriptors/overflow");
|
||||
var overflow_wrap_1 = require("./property-descriptors/overflow-wrap");
|
||||
var padding_1 = require("./property-descriptors/padding");
|
||||
var text_align_1 = require("./property-descriptors/text-align");
|
||||
var position_1 = require("./property-descriptors/position");
|
||||
var text_shadow_1 = require("./property-descriptors/text-shadow");
|
||||
var text_transform_1 = require("./property-descriptors/text-transform");
|
||||
var transform_1 = require("./property-descriptors/transform");
|
||||
var transform_origin_1 = require("./property-descriptors/transform-origin");
|
||||
var visibility_1 = require("./property-descriptors/visibility");
|
||||
var word_break_1 = require("./property-descriptors/word-break");
|
||||
var z_index_1 = require("./property-descriptors/z-index");
|
||||
var parser_1 = require("./syntax/parser");
|
||||
var tokenizer_1 = require("./syntax/tokenizer");
|
||||
var color_2 = require("./types/color");
|
||||
var angle_1 = require("./types/angle");
|
||||
var image_1 = require("./types/image");
|
||||
var time_1 = require("./types/time");
|
||||
var opacity_1 = require("./property-descriptors/opacity");
|
||||
var text_decoration_color_1 = require("./property-descriptors/text-decoration-color");
|
||||
var text_decoration_line_1 = require("./property-descriptors/text-decoration-line");
|
||||
var length_percentage_1 = require("./types/length-percentage");
|
||||
var font_family_1 = require("./property-descriptors/font-family");
|
||||
var font_size_1 = require("./property-descriptors/font-size");
|
||||
var length_1 = require("./types/length");
|
||||
var font_weight_1 = require("./property-descriptors/font-weight");
|
||||
var font_variant_1 = require("./property-descriptors/font-variant");
|
||||
var font_style_1 = require("./property-descriptors/font-style");
|
||||
var bitwise_1 = require("../core/bitwise");
|
||||
var content_1 = require("./property-descriptors/content");
|
||||
var counter_increment_1 = require("./property-descriptors/counter-increment");
|
||||
var counter_reset_1 = require("./property-descriptors/counter-reset");
|
||||
var duration_1 = require("./property-descriptors/duration");
|
||||
var quotes_1 = require("./property-descriptors/quotes");
|
||||
var box_shadow_1 = require("./property-descriptors/box-shadow");
|
||||
var paint_order_1 = require("./property-descriptors/paint-order");
|
||||
var webkit_text_stroke_color_1 = require("./property-descriptors/webkit-text-stroke-color");
|
||||
var webkit_text_stroke_width_1 = require("./property-descriptors/webkit-text-stroke-width");
|
||||
var CSSParsedDeclaration = /** @class */ (function () {
|
||||
function CSSParsedDeclaration(context, declaration) {
|
||||
var _a, _b;
|
||||
this.animationDuration = parse(context, duration_1.duration, declaration.animationDuration);
|
||||
this.backgroundClip = parse(context, background_clip_1.backgroundClip, declaration.backgroundClip);
|
||||
this.backgroundColor = parse(context, background_color_1.backgroundColor, declaration.backgroundColor);
|
||||
this.backgroundImage = parse(context, background_image_1.backgroundImage, declaration.backgroundImage);
|
||||
this.backgroundOrigin = parse(context, background_origin_1.backgroundOrigin, declaration.backgroundOrigin);
|
||||
this.backgroundPosition = parse(context, background_position_1.backgroundPosition, declaration.backgroundPosition);
|
||||
this.backgroundRepeat = parse(context, background_repeat_1.backgroundRepeat, declaration.backgroundRepeat);
|
||||
this.backgroundSize = parse(context, background_size_1.backgroundSize, declaration.backgroundSize);
|
||||
this.borderTopColor = parse(context, border_color_1.borderTopColor, declaration.borderTopColor);
|
||||
this.borderRightColor = parse(context, border_color_1.borderRightColor, declaration.borderRightColor);
|
||||
this.borderBottomColor = parse(context, border_color_1.borderBottomColor, declaration.borderBottomColor);
|
||||
this.borderLeftColor = parse(context, border_color_1.borderLeftColor, declaration.borderLeftColor);
|
||||
this.borderTopLeftRadius = parse(context, border_radius_1.borderTopLeftRadius, declaration.borderTopLeftRadius);
|
||||
this.borderTopRightRadius = parse(context, border_radius_1.borderTopRightRadius, declaration.borderTopRightRadius);
|
||||
this.borderBottomRightRadius = parse(context, border_radius_1.borderBottomRightRadius, declaration.borderBottomRightRadius);
|
||||
this.borderBottomLeftRadius = parse(context, border_radius_1.borderBottomLeftRadius, declaration.borderBottomLeftRadius);
|
||||
this.borderTopStyle = parse(context, border_style_1.borderTopStyle, declaration.borderTopStyle);
|
||||
this.borderRightStyle = parse(context, border_style_1.borderRightStyle, declaration.borderRightStyle);
|
||||
this.borderBottomStyle = parse(context, border_style_1.borderBottomStyle, declaration.borderBottomStyle);
|
||||
this.borderLeftStyle = parse(context, border_style_1.borderLeftStyle, declaration.borderLeftStyle);
|
||||
this.borderTopWidth = parse(context, border_width_1.borderTopWidth, declaration.borderTopWidth);
|
||||
this.borderRightWidth = parse(context, border_width_1.borderRightWidth, declaration.borderRightWidth);
|
||||
this.borderBottomWidth = parse(context, border_width_1.borderBottomWidth, declaration.borderBottomWidth);
|
||||
this.borderLeftWidth = parse(context, border_width_1.borderLeftWidth, declaration.borderLeftWidth);
|
||||
this.boxShadow = parse(context, box_shadow_1.boxShadow, declaration.boxShadow);
|
||||
this.color = parse(context, color_1.color, declaration.color);
|
||||
this.direction = parse(context, direction_1.direction, declaration.direction);
|
||||
this.display = parse(context, display_1.display, declaration.display);
|
||||
this.float = parse(context, float_1.float, declaration.cssFloat);
|
||||
this.fontFamily = parse(context, font_family_1.fontFamily, declaration.fontFamily);
|
||||
this.fontSize = parse(context, font_size_1.fontSize, declaration.fontSize);
|
||||
this.fontStyle = parse(context, font_style_1.fontStyle, declaration.fontStyle);
|
||||
this.fontVariant = parse(context, font_variant_1.fontVariant, declaration.fontVariant);
|
||||
this.fontWeight = parse(context, font_weight_1.fontWeight, declaration.fontWeight);
|
||||
this.letterSpacing = parse(context, letter_spacing_1.letterSpacing, declaration.letterSpacing);
|
||||
this.lineBreak = parse(context, line_break_1.lineBreak, declaration.lineBreak);
|
||||
this.lineHeight = parse(context, line_height_1.lineHeight, declaration.lineHeight);
|
||||
this.listStyleImage = parse(context, list_style_image_1.listStyleImage, declaration.listStyleImage);
|
||||
this.listStylePosition = parse(context, list_style_position_1.listStylePosition, declaration.listStylePosition);
|
||||
this.listStyleType = parse(context, list_style_type_1.listStyleType, declaration.listStyleType);
|
||||
this.marginTop = parse(context, margin_1.marginTop, declaration.marginTop);
|
||||
this.marginRight = parse(context, margin_1.marginRight, declaration.marginRight);
|
||||
this.marginBottom = parse(context, margin_1.marginBottom, declaration.marginBottom);
|
||||
this.marginLeft = parse(context, margin_1.marginLeft, declaration.marginLeft);
|
||||
this.opacity = parse(context, opacity_1.opacity, declaration.opacity);
|
||||
var overflowTuple = parse(context, overflow_1.overflow, declaration.overflow);
|
||||
this.overflowX = overflowTuple[0];
|
||||
this.overflowY = overflowTuple[overflowTuple.length > 1 ? 1 : 0];
|
||||
this.overflowWrap = parse(context, overflow_wrap_1.overflowWrap, declaration.overflowWrap);
|
||||
this.paddingTop = parse(context, padding_1.paddingTop, declaration.paddingTop);
|
||||
this.paddingRight = parse(context, padding_1.paddingRight, declaration.paddingRight);
|
||||
this.paddingBottom = parse(context, padding_1.paddingBottom, declaration.paddingBottom);
|
||||
this.paddingLeft = parse(context, padding_1.paddingLeft, declaration.paddingLeft);
|
||||
this.paintOrder = parse(context, paint_order_1.paintOrder, declaration.paintOrder);
|
||||
this.position = parse(context, position_1.position, declaration.position);
|
||||
this.textAlign = parse(context, text_align_1.textAlign, declaration.textAlign);
|
||||
this.textDecorationColor = parse(context, text_decoration_color_1.textDecorationColor, (_a = declaration.textDecorationColor) !== null && _a !== void 0 ? _a : declaration.color);
|
||||
this.textDecorationLine = parse(context, text_decoration_line_1.textDecorationLine, (_b = declaration.textDecorationLine) !== null && _b !== void 0 ? _b : declaration.textDecoration);
|
||||
this.textShadow = parse(context, text_shadow_1.textShadow, declaration.textShadow);
|
||||
this.textTransform = parse(context, text_transform_1.textTransform, declaration.textTransform);
|
||||
this.transform = parse(context, transform_1.transform, declaration.transform);
|
||||
this.transformOrigin = parse(context, transform_origin_1.transformOrigin, declaration.transformOrigin);
|
||||
this.visibility = parse(context, visibility_1.visibility, declaration.visibility);
|
||||
this.webkitTextStrokeColor = parse(context, webkit_text_stroke_color_1.webkitTextStrokeColor, declaration.webkitTextStrokeColor);
|
||||
this.webkitTextStrokeWidth = parse(context, webkit_text_stroke_width_1.webkitTextStrokeWidth, declaration.webkitTextStrokeWidth);
|
||||
this.wordBreak = parse(context, word_break_1.wordBreak, declaration.wordBreak);
|
||||
this.zIndex = parse(context, z_index_1.zIndex, declaration.zIndex);
|
||||
}
|
||||
CSSParsedDeclaration.prototype.isVisible = function () {
|
||||
return this.display > 0 && this.opacity > 0 && this.visibility === 0 /* VISIBLE */;
|
||||
};
|
||||
CSSParsedDeclaration.prototype.isTransparent = function () {
|
||||
return color_2.isTransparent(this.backgroundColor);
|
||||
};
|
||||
CSSParsedDeclaration.prototype.isTransformed = function () {
|
||||
return this.transform !== null;
|
||||
};
|
||||
CSSParsedDeclaration.prototype.isPositioned = function () {
|
||||
return this.position !== 0 /* STATIC */;
|
||||
};
|
||||
CSSParsedDeclaration.prototype.isPositionedWithZIndex = function () {
|
||||
return this.isPositioned() && !this.zIndex.auto;
|
||||
};
|
||||
CSSParsedDeclaration.prototype.isFloating = function () {
|
||||
return this.float !== 0 /* NONE */;
|
||||
};
|
||||
CSSParsedDeclaration.prototype.isInlineLevel = function () {
|
||||
return (bitwise_1.contains(this.display, 4 /* INLINE */) ||
|
||||
bitwise_1.contains(this.display, 33554432 /* INLINE_BLOCK */) ||
|
||||
bitwise_1.contains(this.display, 268435456 /* INLINE_FLEX */) ||
|
||||
bitwise_1.contains(this.display, 536870912 /* INLINE_GRID */) ||
|
||||
bitwise_1.contains(this.display, 67108864 /* INLINE_LIST_ITEM */) ||
|
||||
bitwise_1.contains(this.display, 134217728 /* INLINE_TABLE */));
|
||||
};
|
||||
return CSSParsedDeclaration;
|
||||
}());
|
||||
exports.CSSParsedDeclaration = CSSParsedDeclaration;
|
||||
var CSSParsedPseudoDeclaration = /** @class */ (function () {
|
||||
function CSSParsedPseudoDeclaration(context, declaration) {
|
||||
this.content = parse(context, content_1.content, declaration.content);
|
||||
this.quotes = parse(context, quotes_1.quotes, declaration.quotes);
|
||||
}
|
||||
return CSSParsedPseudoDeclaration;
|
||||
}());
|
||||
exports.CSSParsedPseudoDeclaration = CSSParsedPseudoDeclaration;
|
||||
var CSSParsedCounterDeclaration = /** @class */ (function () {
|
||||
function CSSParsedCounterDeclaration(context, declaration) {
|
||||
this.counterIncrement = parse(context, counter_increment_1.counterIncrement, declaration.counterIncrement);
|
||||
this.counterReset = parse(context, counter_reset_1.counterReset, declaration.counterReset);
|
||||
}
|
||||
return CSSParsedCounterDeclaration;
|
||||
}());
|
||||
exports.CSSParsedCounterDeclaration = CSSParsedCounterDeclaration;
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var parse = function (context, descriptor, style) {
|
||||
var tokenizer = new tokenizer_1.Tokenizer();
|
||||
var value = style !== null && typeof style !== 'undefined' ? style.toString() : descriptor.initialValue;
|
||||
tokenizer.write(value);
|
||||
var parser = new parser_1.Parser(tokenizer.read());
|
||||
switch (descriptor.type) {
|
||||
case 2 /* IDENT_VALUE */:
|
||||
var token = parser.parseComponentValue();
|
||||
return descriptor.parse(context, parser_1.isIdentToken(token) ? token.value : descriptor.initialValue);
|
||||
case 0 /* VALUE */:
|
||||
return descriptor.parse(context, parser.parseComponentValue());
|
||||
case 1 /* LIST */:
|
||||
return descriptor.parse(context, parser.parseComponentValues());
|
||||
case 4 /* TOKEN_VALUE */:
|
||||
return parser.parseComponentValue();
|
||||
case 3 /* TYPE_VALUE */:
|
||||
switch (descriptor.format) {
|
||||
case 'angle':
|
||||
return angle_1.angle.parse(context, parser.parseComponentValue());
|
||||
case 'color':
|
||||
return color_2.color.parse(context, parser.parseComponentValue());
|
||||
case 'image':
|
||||
return image_1.image.parse(context, parser.parseComponentValue());
|
||||
case 'length':
|
||||
var length_2 = parser.parseComponentValue();
|
||||
return length_1.isLength(length_2) ? length_2 : length_percentage_1.ZERO_LENGTH;
|
||||
case 'length-percentage':
|
||||
var value_1 = parser.parseComponentValue();
|
||||
return length_percentage_1.isLengthPercentage(value_1) ? value_1 : length_percentage_1.ZERO_LENGTH;
|
||||
case 'time':
|
||||
return time_1.time.parse(context, parser.parseComponentValue());
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
dist/lib/css/index.js.map
vendored
Normal file
1
dist/lib/css/index.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
9
dist/lib/css/layout/__mocks__/bounds.js
vendored
Normal file
9
dist/lib/css/layout/__mocks__/bounds.js
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.parseBounds = exports.Bounds = void 0;
|
||||
exports.Bounds = jest.requireActual('../bounds').Bounds;
|
||||
var parseBounds = function () {
|
||||
return new exports.Bounds(0, 0, 200, 50);
|
||||
};
|
||||
exports.parseBounds = parseBounds;
|
||||
//# sourceMappingURL=bounds.js.map
|
||||
1
dist/lib/css/layout/__mocks__/bounds.js.map
vendored
Normal file
1
dist/lib/css/layout/__mocks__/bounds.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bounds.js","sourceRoot":"","sources":["../../../../../src/css/layout/__mocks__/bounds.ts"],"names":[],"mappings":";;;AAAc,QAAA,MAAM,GAAI,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,QAAC;AACjD,IAAM,WAAW,GAAG;IACvB,OAAO,IAAI,cAAM,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC;AACrC,CAAC,CAAC;AAFW,QAAA,WAAW,eAEtB"}
|
||||
42
dist/lib/css/layout/bounds.js
vendored
Normal file
42
dist/lib/css/layout/bounds.js
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.parseDocumentSize = exports.parseBounds = exports.Bounds = void 0;
|
||||
var Bounds = /** @class */ (function () {
|
||||
function Bounds(left, top, width, height) {
|
||||
this.left = left;
|
||||
this.top = top;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
}
|
||||
Bounds.prototype.add = function (x, y, w, h) {
|
||||
return new Bounds(this.left + x, this.top + y, this.width + w, this.height + h);
|
||||
};
|
||||
Bounds.fromClientRect = function (context, clientRect) {
|
||||
return new Bounds(clientRect.left + context.windowBounds.left, clientRect.top + context.windowBounds.top, clientRect.width, clientRect.height);
|
||||
};
|
||||
Bounds.fromDOMRectList = function (context, domRectList) {
|
||||
var domRect = Array.from(domRectList).find(function (rect) { return rect.width !== 0; });
|
||||
return domRect
|
||||
? new Bounds(domRect.left + context.windowBounds.left, domRect.top + context.windowBounds.top, domRect.width, domRect.height)
|
||||
: Bounds.EMPTY;
|
||||
};
|
||||
Bounds.EMPTY = new Bounds(0, 0, 0, 0);
|
||||
return Bounds;
|
||||
}());
|
||||
exports.Bounds = Bounds;
|
||||
var parseBounds = function (context, node) {
|
||||
return Bounds.fromClientRect(context, node.getBoundingClientRect());
|
||||
};
|
||||
exports.parseBounds = parseBounds;
|
||||
var parseDocumentSize = function (document) {
|
||||
var body = document.body;
|
||||
var documentElement = document.documentElement;
|
||||
if (!body || !documentElement) {
|
||||
throw new Error("Unable to get document size");
|
||||
}
|
||||
var width = Math.max(Math.max(body.scrollWidth, documentElement.scrollWidth), Math.max(body.offsetWidth, documentElement.offsetWidth), Math.max(body.clientWidth, documentElement.clientWidth));
|
||||
var height = Math.max(Math.max(body.scrollHeight, documentElement.scrollHeight), Math.max(body.offsetHeight, documentElement.offsetHeight), Math.max(body.clientHeight, documentElement.clientHeight));
|
||||
return new Bounds(0, 0, width, height);
|
||||
};
|
||||
exports.parseDocumentSize = parseDocumentSize;
|
||||
//# sourceMappingURL=bounds.js.map
|
||||
1
dist/lib/css/layout/bounds.js.map
vendored
Normal file
1
dist/lib/css/layout/bounds.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"bounds.js","sourceRoot":"","sources":["../../../../src/css/layout/bounds.ts"],"names":[],"mappings":";;;AAEA;IACI,gBAAqB,IAAY,EAAW,GAAW,EAAW,KAAa,EAAW,MAAc;QAAnF,SAAI,GAAJ,IAAI,CAAQ;QAAW,QAAG,GAAH,GAAG,CAAQ;QAAW,UAAK,GAAL,KAAK,CAAQ;QAAW,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE5G,oBAAG,GAAH,UAAI,CAAS,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;QAC1C,OAAO,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpF,CAAC;IAEM,qBAAc,GAArB,UAAsB,OAAgB,EAAE,UAAsB;QAC1D,OAAO,IAAI,MAAM,CACb,UAAU,CAAC,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,EAC3C,UAAU,CAAC,GAAG,GAAG,OAAO,CAAC,YAAY,CAAC,GAAG,EACzC,UAAU,CAAC,KAAK,EAChB,UAAU,CAAC,MAAM,CACpB,CAAC;IACN,CAAC;IAEM,sBAAe,GAAtB,UAAuB,OAAgB,EAAE,WAAwB;QAC7D,IAAM,OAAO,GAAG,KAAK,CAAC,IAAI,CAA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D,CAAC;IAEF,IAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CACnB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,YAAY,CAAC,EACzD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,YAAY,CAAC,EACzD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,YAAY,CAAC,CAC5D,CAAC;IAEF,OAAO,IAAI,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC;AAC3C,CAAC,CAAC;AApBW,QAAA,iBAAiB,qBAoB5B"}
|
||||
137
dist/lib/css/layout/text.js
vendored
Normal file
137
dist/lib/css/layout/text.js
vendored
Normal file
@@ -0,0 +1,137 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.segmentGraphemes = exports.parseTextBounds = exports.TextBounds = void 0;
|
||||
var css_line_break_1 = require("css-line-break");
|
||||
var text_segmentation_1 = require("text-segmentation");
|
||||
var bounds_1 = require("./bounds");
|
||||
var features_1 = require("../../core/features");
|
||||
var TextBounds = /** @class */ (function () {
|
||||
function TextBounds(text, bounds) {
|
||||
this.text = text;
|
||||
this.bounds = bounds;
|
||||
}
|
||||
return TextBounds;
|
||||
}());
|
||||
exports.TextBounds = TextBounds;
|
||||
var parseTextBounds = function (context, value, styles, node) {
|
||||
var textList = breakText(value, styles);
|
||||
var textBounds = [];
|
||||
var offset = 0;
|
||||
textList.forEach(function (text) {
|
||||
if (styles.textDecorationLine.length || text.trim().length > 0) {
|
||||
if (features_1.FEATURES.SUPPORT_RANGE_BOUNDS) {
|
||||
var clientRects = createRange(node, offset, text.length).getClientRects();
|
||||
if (clientRects.length > 1) {
|
||||
var subSegments = exports.segmentGraphemes(text);
|
||||
var subOffset_1 = 0;
|
||||
subSegments.forEach(function (subSegment) {
|
||||
textBounds.push(new TextBounds(subSegment, bounds_1.Bounds.fromDOMRectList(context, createRange(node, subOffset_1 + offset, subSegment.length).getClientRects())));
|
||||
subOffset_1 += subSegment.length;
|
||||
});
|
||||
}
|
||||
else {
|
||||
textBounds.push(new TextBounds(text, bounds_1.Bounds.fromDOMRectList(context, clientRects)));
|
||||
}
|
||||
}
|
||||
else {
|
||||
var replacementNode = node.splitText(text.length);
|
||||
textBounds.push(new TextBounds(text, getWrapperBounds(context, node)));
|
||||
node = replacementNode;
|
||||
}
|
||||
}
|
||||
else if (!features_1.FEATURES.SUPPORT_RANGE_BOUNDS) {
|
||||
node = node.splitText(text.length);
|
||||
}
|
||||
offset += text.length;
|
||||
});
|
||||
return textBounds;
|
||||
};
|
||||
exports.parseTextBounds = parseTextBounds;
|
||||
var getWrapperBounds = function (context, node) {
|
||||
var ownerDocument = node.ownerDocument;
|
||||
if (ownerDocument) {
|
||||
var wrapper = ownerDocument.createElement('html2canvaswrapper');
|
||||
wrapper.appendChild(node.cloneNode(true));
|
||||
var parentNode = node.parentNode;
|
||||
if (parentNode) {
|
||||
parentNode.replaceChild(wrapper, node);
|
||||
var bounds = bounds_1.parseBounds(context, wrapper);
|
||||
if (wrapper.firstChild) {
|
||||
parentNode.replaceChild(wrapper.firstChild, wrapper);
|
||||
}
|
||||
return bounds;
|
||||
}
|
||||
}
|
||||
return bounds_1.Bounds.EMPTY;
|
||||
};
|
||||
var createRange = function (node, offset, length) {
|
||||
var ownerDocument = node.ownerDocument;
|
||||
if (!ownerDocument) {
|
||||
throw new Error('Node has no owner document');
|
||||
}
|
||||
var range = ownerDocument.createRange();
|
||||
range.setStart(node, offset);
|
||||
range.setEnd(node, offset + length);
|
||||
return range;
|
||||
};
|
||||
var segmentGraphemes = function (value) {
|
||||
if (features_1.FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var segmenter = new Intl.Segmenter(void 0, { granularity: 'grapheme' });
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return Array.from(segmenter.segment(value)).map(function (segment) { return segment.segment; });
|
||||
}
|
||||
return text_segmentation_1.splitGraphemes(value);
|
||||
};
|
||||
exports.segmentGraphemes = segmentGraphemes;
|
||||
var segmentWords = function (value, styles) {
|
||||
if (features_1.FEATURES.SUPPORT_NATIVE_TEXT_SEGMENTATION) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
var segmenter = new Intl.Segmenter(void 0, {
|
||||
granularity: 'word'
|
||||
});
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
return Array.from(segmenter.segment(value)).map(function (segment) { return segment.segment; });
|
||||
}
|
||||
return breakWords(value, styles);
|
||||
};
|
||||
var breakText = function (value, styles) {
|
||||
return styles.letterSpacing !== 0 ? exports.segmentGraphemes(value) : segmentWords(value, styles);
|
||||
};
|
||||
// https://drafts.csswg.org/css-text/#word-separator
|
||||
var wordSeparators = [0x0020, 0x00a0, 0x1361, 0x10100, 0x10101, 0x1039, 0x1091];
|
||||
var breakWords = function (str, styles) {
|
||||
var breaker = css_line_break_1.LineBreaker(str, {
|
||||
lineBreak: styles.lineBreak,
|
||||
wordBreak: styles.overflowWrap === "break-word" /* BREAK_WORD */ ? 'break-word' : styles.wordBreak
|
||||
});
|
||||
var words = [];
|
||||
var bk;
|
||||
var _loop_1 = function () {
|
||||
if (bk.value) {
|
||||
var value = bk.value.slice();
|
||||
var codePoints = css_line_break_1.toCodePoints(value);
|
||||
var word_1 = '';
|
||||
codePoints.forEach(function (codePoint) {
|
||||
if (wordSeparators.indexOf(codePoint) === -1) {
|
||||
word_1 += css_line_break_1.fromCodePoint(codePoint);
|
||||
}
|
||||
else {
|
||||
if (word_1.length) {
|
||||
words.push(word_1);
|
||||
}
|
||||
words.push(css_line_break_1.fromCodePoint(codePoint));
|
||||
word_1 = '';
|
||||
}
|
||||
});
|
||||
if (word_1.length) {
|
||||
words.push(word_1);
|
||||
}
|
||||
}
|
||||
};
|
||||
while (!(bk = breaker.next()).done) {
|
||||
_loop_1();
|
||||
}
|
||||
return words;
|
||||
};
|
||||
//# sourceMappingURL=text.js.map
|
||||
1
dist/lib/css/layout/text.js.map
vendored
Normal file
1
dist/lib/css/layout/text.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../../src/css/layout/text.ts"],"names":[],"mappings":";;;AAEA,iDAAwE;AACxE,uDAAiD;AACjD,mCAA6C;AAC7C,gDAA6C;AAG7C;IAII,oBAAY,IAAY,EAAE,MAAc;QACpC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;IACL,iBAAC;AAAD,CAAC,AARD,IAQC;AARY,gCAAU;AAUhB,IAAM,eAAe,GAAG,UAC3B,OAAgB,EAChB,KAAa,EACb,MAA4B,EAC5B,IAAU;IAEV,IAAM,QAAQ,GAAG,SAAS,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC1C,IAAM,UAAU,GAAiB,EAAE,CAAC;IACpC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,QAAQ,CAAC,OAAO,CAAC,UAAC,IAAI;QAClB,IAAI,MAAM,CAAC,kBAAkB,CAAC,MAAM,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;YAC5D,IAAI,mBAAQ,CAAC,oBAAoB,EAAE;gBAC/B,IAAM,WAAW,GAAG,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,cAAc,EAAE,CAAC;gBAC5E,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE;oBACxB,IAAM,WAAW,GAAG,wBAAgB,CAAC,IAAI,CAAC,CAAC;oBAC3C,IAAI,WAAS,GAAG,CAAC,CAAC;oBAClB,WAAW,CAAC,OAAO,CAAC,UAAC,UAAU;wBAC3B,UAAU,CA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V,IAAM,KAAK,GAAG,EAAE,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAC/B,IAAM,UAAU,GAAG,6BAAY,CAAC,KAAK,CAAC,CAAC;YACvC,IAAI,MAAI,GAAG,EAAE,CAAC;YACd,UAAU,CAAC,OAAO,CAAC,UAAC,SAAS;gBACzB,IAAI,cAAc,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE;oBAC1C,MAAI,IAAI,8BAAa,CAAC,SAAS,CAAC,CAAC;iBACpC;qBAAM;oBACH,IAAI,MAAI,CAAC,MAAM,EAAE;wBACb,KAAK,CAAC,IAAI,CAAC,MAAI,CAAC,CAAC;qBACpB;oBACD,KAAK,CAAC,IAAI,CAAC,8BAAa,CAAC,SAAS,CAAC,CAAC,CAAC;oBACrC,MAAI,GAAG,EAAE,CAAC;iBACb;YACL,CAAC,CAAC,CAAC;YAEH,IAAI,MAAI,CAAC,MAAM,EAAE;gBACb,KAAK,CAAC,IAAI,CAAC,MAAI,CAAC,CAAC;aACpB;SACJ;;IApBL,OAAO,CAAC,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI;;KAqBjC;IAED,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC"}
|
||||
48
dist/lib/css/property-descriptors/__tests__/background-tests.js
vendored
Normal file
48
dist/lib/css/property-descriptors/__tests__/background-tests.js
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var assert_1 = require("assert");
|
||||
var parser_1 = require("../../syntax/parser");
|
||||
var background_image_1 = require("../background-image");
|
||||
var color_1 = require("../../types/color");
|
||||
var angle_1 = require("../../types/angle");
|
||||
jest.mock('../../../core/context');
|
||||
var context_1 = require("../../../core/context");
|
||||
jest.mock('../../../core/features');
|
||||
var backgroundImageParse = function (context, value) {
|
||||
return background_image_1.backgroundImage.parse(context, parser_1.Parser.parseValues(value));
|
||||
};
|
||||
describe('property-descriptors', function () {
|
||||
var context;
|
||||
beforeEach(function () {
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
context = new context_1.Context({}, {});
|
||||
});
|
||||
describe('background-image', function () {
|
||||
it('none', function () {
|
||||
assert_1.deepStrictEqual(backgroundImageParse(context, 'none'), []);
|
||||
expect(context.cache.addImage).not.toHaveBeenCalled();
|
||||
});
|
||||
it('url(test.jpg), url(test2.jpg)', function () {
|
||||
assert_1.deepStrictEqual(backgroundImageParse(context, 'url(http://example.com/test.jpg), url(http://example.com/test2.jpg)'), [
|
||||
{ url: 'http://example.com/test.jpg', type: 0 /* URL */ },
|
||||
{ url: 'http://example.com/test2.jpg', type: 0 /* URL */ }
|
||||
]);
|
||||
expect(context.cache.addImage).toHaveBeenCalledWith('http://example.com/test.jpg');
|
||||
expect(context.cache.addImage).toHaveBeenCalledWith('http://example.com/test2.jpg');
|
||||
});
|
||||
it("linear-gradient(to bottom, rgba(255,255,0,0.5), rgba(0,0,255,0.5)), url('https://html2canvas.hertzen.com')", function () {
|
||||
return assert_1.deepStrictEqual(backgroundImageParse(context, "linear-gradient(to bottom, rgba(255,255,0,0.5), rgba(0,0,255,0.5)), url('https://html2canvas.hertzen.com')"), [
|
||||
{
|
||||
angle: angle_1.deg(180),
|
||||
type: 1 /* LINEAR_GRADIENT */,
|
||||
stops: [
|
||||
{ color: color_1.pack(255, 255, 0, 0.5), stop: null },
|
||||
{ color: color_1.pack(0, 0, 255, 0.5), stop: null }
|
||||
]
|
||||
},
|
||||
{ url: 'https://html2canvas.hertzen.com', type: 0 /* URL */ }
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=background-tests.js.map
|
||||
1
dist/lib/css/property-descriptors/__tests__/background-tests.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/__tests__/background-tests.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"background-tests.js","sourceRoot":"","sources":["../../../../../src/css/property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C,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;QACxF,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4GAA4G,EAAE;YAC7G,OAAA,wBAAe,CACX,oBAAoB,CAChB,OAAO,EACP,4GAA4G,CAC/G,EACD;gBACI;oBACI,KAAK,EAAE,WAAG,CAAC,GAAG,CAAC;oBACf,IAAI,yBAA8B;oBAClC,KAAK,EAAE;wBACH,EAAC,KAAK,EAAE,YAAI,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC;wBAC3C,EAAC,KAAK,EAAE,YAAI,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC;qBAC5C;iBACJ;gBACD,EAAC,GAAG,EAAE,iCAAiC,EAAE,IAAI,aAAkB,EAAC;aACnE,CACJ;QAhBD,CAgBC,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
25
dist/lib/css/property-descriptors/__tests__/font-family.js
vendored
Normal file
25
dist/lib/css/property-descriptors/__tests__/font-family.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var assert_1 = require("assert");
|
||||
var parser_1 = require("../../syntax/parser");
|
||||
var font_family_1 = require("../font-family");
|
||||
var fontFamilyParse = function (value) { return font_family_1.fontFamily.parse({}, parser_1.Parser.parseValues(value)); };
|
||||
describe('property-descriptors', function () {
|
||||
describe('font-family', function () {
|
||||
it('sans-serif', function () { return assert_1.deepEqual(fontFamilyParse('sans-serif'), ['sans-serif']); });
|
||||
it('great fonts 40 library', function () {
|
||||
return assert_1.deepEqual(fontFamilyParse('great fonts 40 library'), ["'great fonts 40 library'"]);
|
||||
});
|
||||
it('preferred font, "quoted fallback font", font', function () {
|
||||
return assert_1.deepEqual(fontFamilyParse('preferred font, "quoted fallback font", font'), [
|
||||
"'preferred font'",
|
||||
"'quoted fallback font'",
|
||||
'font'
|
||||
]);
|
||||
});
|
||||
it("'escaping test\\'s font'", function () {
|
||||
return assert_1.deepEqual(fontFamilyParse("'escaping test\\'s font'"), ["'escaping test's font'"]);
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=font-family.js.map
|
||||
1
dist/lib/css/property-descriptors/__tests__/font-family.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/__tests__/font-family.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"font-family.js","sourceRoot":"","sources":["../../../../../src/css/property-descriptors/__tests__/font-family.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AACjC,8CAA2C;AAC3C,8CAA0C;AAG1C,IAAM,eAAe,GAAG,UAAC,KAAa,IAAK,OAAA,wBAAU,CAAC,KAAK,CAAC,EAAa,EAAE,eAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAA1D,CAA0D,CAAC;AAEtG,QAAQ,CAAC,sBAAsB,EAAE;IAC7B,QAAQ,CAAC,aAAa,EAAE;QACpB,EAAE,CAAC,YAAY,EAAE,cAAM,OAAA,kBAAS,CAAC,eAAe,CAAC,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,EAAxD,CAAwD,CAAC,CAAC;QAEjF,EAAE,CAAC,wBAAwB,EAAE;YACzB,OAAA,kBAAS,CAAC,eAAe,CAAC,wBAAwB,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC;QAAlF,CAAkF,CAAC,CAAC;QAExF,EAAE,CAAC,8CAA8C,EAAE;YAC/C,OAAA,kBAAS,CAAC,eAAe,CAAC,8CAA8C,CAAC,EAAE;gBACvE,kBAAkB;gBAClB,wBAAwB;gBACxB,MAAM;aACT,CAAC;QAJF,CAIE,CAAC,CAAC;QAER,EAAE,CAAC,0BAA0B,EAAE;YAC3B,OAAA,kBAAS,CAAC,eAAe,CAAC,0BAA0B,CAAC,EAAE,CAAC,wBAAwB,CAAC,CAAC;QAAlF,CAAkF,CAAC,CAAC;IAC5F,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
88
dist/lib/css/property-descriptors/__tests__/paint-order.js
vendored
Normal file
88
dist/lib/css/property-descriptors/__tests__/paint-order.js
vendored
Normal file
@@ -0,0 +1,88 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var assert_1 = require("assert");
|
||||
var parser_1 = require("../../syntax/parser");
|
||||
var paint_order_1 = require("../paint-order");
|
||||
var paintOrderParse = function (value) { return paint_order_1.paintOrder.parse({}, parser_1.Parser.parseValues(value)); };
|
||||
describe('property-descriptors', function () {
|
||||
describe('paint-order', function () {
|
||||
it('none', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse('none'), [
|
||||
0 /* FILL */,
|
||||
1 /* STROKE */,
|
||||
2 /* MARKERS */
|
||||
]);
|
||||
});
|
||||
it('EMPTY', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse(''), [
|
||||
0 /* FILL */,
|
||||
1 /* STROKE */,
|
||||
2 /* MARKERS */
|
||||
]);
|
||||
});
|
||||
it('other values', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse('other values'), [
|
||||
0 /* FILL */,
|
||||
1 /* STROKE */,
|
||||
2 /* MARKERS */
|
||||
]);
|
||||
});
|
||||
it('normal', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse('normal'), [
|
||||
0 /* FILL */,
|
||||
1 /* STROKE */,
|
||||
2 /* MARKERS */
|
||||
]);
|
||||
});
|
||||
it('stroke', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse('stroke'), [
|
||||
1 /* STROKE */,
|
||||
0 /* FILL */,
|
||||
2 /* MARKERS */
|
||||
]);
|
||||
});
|
||||
it('fill', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse('fill'), [
|
||||
0 /* FILL */,
|
||||
1 /* STROKE */,
|
||||
2 /* MARKERS */
|
||||
]);
|
||||
});
|
||||
it('markers', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse('markers'), [
|
||||
2 /* MARKERS */,
|
||||
0 /* FILL */,
|
||||
1 /* STROKE */
|
||||
]);
|
||||
});
|
||||
it('stroke fill', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse('stroke fill'), [
|
||||
1 /* STROKE */,
|
||||
0 /* FILL */,
|
||||
2 /* MARKERS */
|
||||
]);
|
||||
});
|
||||
it('markers stroke', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse('markers stroke'), [
|
||||
2 /* MARKERS */,
|
||||
1 /* STROKE */,
|
||||
0 /* FILL */
|
||||
]);
|
||||
});
|
||||
it('markers stroke fill', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse('markers stroke fill'), [
|
||||
2 /* MARKERS */,
|
||||
1 /* STROKE */,
|
||||
0 /* FILL */
|
||||
]);
|
||||
});
|
||||
it('stroke fill markers', function () {
|
||||
return assert_1.deepStrictEqual(paintOrderParse('stroke fill markers'), [
|
||||
1 /* STROKE */,
|
||||
0 /* FILL */,
|
||||
2 /* MARKERS */
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=paint-order.js.map
|
||||
1
dist/lib/css/property-descriptors/__tests__/paint-order.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/__tests__/paint-order.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paint-order.js","sourceRoot":"","sources":["../../../../../src/css/property-descriptors/__tests__/paint-order.ts"],"names":[],"mappings":";;AAAA,iCAAuC;AACvC,8CAA2C;AAC3C,8CAA6D;AAG7D,IAAM,eAAe,GAAG,UAAC,KAAa,IAAK,OAAA,wBAAU,CAAC,KAAK,CAAC,EAAa,EAAE,eAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAA1D,CAA0D,CAAC;AAEtG,QAAQ,CAAC,sBAAsB,EAAE;IAC7B,QAAQ,CAAC,aAAa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D,CAAC;QAJF,CAIE,CAAC,CAAC;QAER,EAAE,CAAC,qBAAqB,EAAE;YACtB,OAAA,wBAAe,CAAC,eAAe,CAAC,qBAAqB,CAAC,EAAE;;;;aAIvD,CAAC;QAJF,CAIE,CAAC,CAAC;IACZ,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
94
dist/lib/css/property-descriptors/__tests__/text-shadow.js
vendored
Normal file
94
dist/lib/css/property-descriptors/__tests__/text-shadow.js
vendored
Normal file
@@ -0,0 +1,94 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var assert_1 = require("assert");
|
||||
var parser_1 = require("../../syntax/parser");
|
||||
var color_1 = require("../../types/color");
|
||||
var text_shadow_1 = require("../text-shadow");
|
||||
var tokenizer_1 = require("../../syntax/tokenizer");
|
||||
var length_percentage_1 = require("../../types/length-percentage");
|
||||
var textShadowParse = function (value) { return text_shadow_1.textShadow.parse({}, parser_1.Parser.parseValues(value)); };
|
||||
var colorParse = function (value) { return color_1.color.parse({}, parser_1.Parser.parseValue(value)); };
|
||||
var dimension = function (number, unit) { return ({
|
||||
flags: tokenizer_1.FLAG_INTEGER,
|
||||
number: number,
|
||||
unit: unit,
|
||||
type: 15 /* DIMENSION_TOKEN */
|
||||
}); };
|
||||
describe('property-descriptors', function () {
|
||||
describe('text-shadow', function () {
|
||||
it('none', function () { return assert_1.deepStrictEqual(textShadowParse('none'), []); });
|
||||
it('1px 1px 2px pink', function () {
|
||||
return assert_1.deepStrictEqual(textShadowParse('1px 1px 2px pink'), [
|
||||
{
|
||||
color: colorParse('pink'),
|
||||
offsetX: dimension(1, 'px'),
|
||||
offsetY: dimension(1, 'px'),
|
||||
blur: dimension(2, 'px')
|
||||
}
|
||||
]);
|
||||
});
|
||||
it('#fc0 1px 0 10px', function () {
|
||||
return assert_1.deepStrictEqual(textShadowParse('#fc0 1px 0 10px'), [
|
||||
{
|
||||
color: colorParse('#fc0'),
|
||||
offsetX: dimension(1, 'px'),
|
||||
offsetY: length_percentage_1.ZERO_LENGTH,
|
||||
blur: dimension(10, 'px')
|
||||
}
|
||||
]);
|
||||
});
|
||||
it('5px 5px #558abb', function () {
|
||||
return assert_1.deepStrictEqual(textShadowParse('5px 5px #558abb'), [
|
||||
{
|
||||
color: colorParse('#558abb'),
|
||||
offsetX: dimension(5, 'px'),
|
||||
offsetY: dimension(5, 'px'),
|
||||
blur: length_percentage_1.ZERO_LENGTH
|
||||
}
|
||||
]);
|
||||
});
|
||||
it('white 2px 5px', function () {
|
||||
return assert_1.deepStrictEqual(textShadowParse('white 2px 5px'), [
|
||||
{
|
||||
color: colorParse('#fff'),
|
||||
offsetX: dimension(2, 'px'),
|
||||
offsetY: dimension(5, 'px'),
|
||||
blur: length_percentage_1.ZERO_LENGTH
|
||||
}
|
||||
]);
|
||||
});
|
||||
it('white 2px 5px', function () {
|
||||
return assert_1.deepStrictEqual(textShadowParse('5px 10px'), [
|
||||
{
|
||||
color: color_1.COLORS.TRANSPARENT,
|
||||
offsetX: dimension(5, 'px'),
|
||||
offsetY: dimension(10, 'px'),
|
||||
blur: length_percentage_1.ZERO_LENGTH
|
||||
}
|
||||
]);
|
||||
});
|
||||
it('1px 1px 2px red, 0 0 1em blue, 0 0 2em blue', function () {
|
||||
return assert_1.deepStrictEqual(textShadowParse('1px 1px 2px red, 0 0 1em blue, 0 0 2em blue'), [
|
||||
{
|
||||
color: colorParse('red'),
|
||||
offsetX: dimension(1, 'px'),
|
||||
offsetY: dimension(1, 'px'),
|
||||
blur: dimension(2, 'px')
|
||||
},
|
||||
{
|
||||
color: colorParse('blue'),
|
||||
offsetX: length_percentage_1.ZERO_LENGTH,
|
||||
offsetY: length_percentage_1.ZERO_LENGTH,
|
||||
blur: dimension(1, 'em')
|
||||
},
|
||||
{
|
||||
color: colorParse('blue'),
|
||||
offsetX: length_percentage_1.ZERO_LENGTH,
|
||||
offsetY: length_percentage_1.ZERO_LENGTH,
|
||||
blur: dimension(2, 'em')
|
||||
}
|
||||
]);
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=text-shadow.js.map
|
||||
1
dist/lib/css/property-descriptors/__tests__/text-shadow.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/__tests__/text-shadow.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"text-shadow.js","sourceRoot":"","sources":["../../../../../src/css/property-descriptors/__tests__/text-shadow.ts"],"names":[],"mappings":";;AAAA,iCAAuC;AACvC,8CAA2C;AAC3C,2CAAgD;AAChD,8CAA0C;AAC1C,oDAA+E;AAC/E,mEAA0D;AAG1D,IAAM,eAAe,GAAG,UAAC,KAAa,IAAK,OAAA,wBAAU,CAAC,KAAK,CAAC,EAAa,EAAE,eAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,EAA1D,CAA0D,CAAC;AACtG,IAAM,UAAU,GAAG,UAAC,KAAa,IAAK,OAAA,aAAK,CAAC,KAAK,CAAC,EAAa,EAAE,eAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAApD,CAAoD,CAAC;AAC3F,IAAM,SAAS,GAAG,UAAC,MAAc,EAAE,IAAY,IAAqB,OAAA,CAAC;IACjE,KAAK,EAAE,wBAAY;IACnB,MAAM,QAAA;IACN,IAAI,MAAA;IACJ,IAAI,0BAA2B;CAClC,CAAC,EALkE,CAKlE,CAAC;AAEH,QAAQ,CAAC,sBAAsB,EAAE;IAC7B,QAAQ,CAAC,aAAa,EAAE;QACpB,EAAE,CAAC,MAAM,EAAE,cAAM,OAAA,wBAAe,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC,EAA5C,CAA4C,CAAC,CAAC;QAE/D,EAAE,CAAC,kBAAkB,EAAE;YACnB,OAAA,wBAAe,CAAC,eAAe,CAAC,kBAAkB,CAAC,EAAE;gBACjD;oBACI,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;oBACzB,OAAO,EAAE,SAAS,CAAC,CAAC,EAAE,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K,EAAE,cAAM,CAAC,WAAW;oBACzB,OAAO,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;oBAC3B,OAAO,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC;oBAC5B,IAAI,EAAE,+BAAW;iBACpB;aACJ,CAAC;QAPF,CAOE,CAAC,CAAC;QAER,EAAE,CAAC,6CAA6C,EAAE;YAC9C,OAAA,wBAAe,CAAC,eAAe,CAAC,6CAA6C,CAAC,EAAE;gBAC5E;oBACI,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC;oBACxB,OAAO,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;oBAC3B,OAAO,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;oBAC3B,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;iBAC3B;gBACD;oBACI,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;oBACzB,OAAO,EAAE,+BAAW;oBACpB,OAAO,EAAE,+BAAW;oBACpB,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;iBAC3B;gBACD;oBACI,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;oBACzB,OAAO,EAAE,+BAAW;oBACpB,OAAO,EAAE,+BAAW;oBACpB,IAAI,EAAE,SAAS,CAAC,CAAC,EAAE,IAAI,CAAC;iBAC3B;aACJ,CAAC;QAnBF,CAmBE,CAAC,CAAC;IACZ,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
18
dist/lib/css/property-descriptors/__tests__/transform-tests.js
vendored
Normal file
18
dist/lib/css/property-descriptors/__tests__/transform-tests.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
var transform_1 = require("../transform");
|
||||
var parser_1 = require("../../syntax/parser");
|
||||
var assert_1 = require("assert");
|
||||
var parseValue = function (value) { return transform_1.transform.parse({}, parser_1.Parser.parseValue(value)); };
|
||||
describe('property-descriptors', function () {
|
||||
describe('transform', function () {
|
||||
it('none', function () { return assert_1.deepStrictEqual(parseValue('none'), null); });
|
||||
it('matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)', function () {
|
||||
return assert_1.deepStrictEqual(parseValue('matrix(1.0, 2.0, 3.0, 4.0, 5.0, 6.0)'), [1, 2, 3, 4, 5, 6]);
|
||||
});
|
||||
it('matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)', function () {
|
||||
return assert_1.deepStrictEqual(parseValue('matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)'), [1, 0, 0, 1, 0, 0]);
|
||||
});
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=transform-tests.js.map
|
||||
1
dist/lib/css/property-descriptors/__tests__/transform-tests.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/__tests__/transform-tests.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"transform-tests.js","sourceRoot":"","sources":["../../../../../src/css/property-descriptors/__tests__/transform-tests.ts"],"names":[],"mappings":";;AAAA,0CAAuC;AACvC,8CAA2C;AAC3C,iCAAuC;AAEvC,IAAM,UAAU,GAAG,UAAC,KAAa,IAAK,OAAA,qBAAS,CAAC,KAAK,CAAC,EAAa,EAAE,eAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAxD,CAAwD,CAAC;AAE/F,QAAQ,CAAC,sBAAsB,EAAE;IAC7B,QAAQ,CAAC,WAAW,EAAE;QAClB,EAAE,CAAC,MAAM,EAAE,cAAM,OAAA,wBAAe,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,EAAzC,CAAyC,CAAC,CAAC;QAC5D,EAAE,CAAC,sCAAsC,EAAE;YACvC,OAAA,wBAAe,CAAC,UAAU,CAAC,sCAAsC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QAAvF,CAAuF,CAAC,CAAC;QAC7F,EAAE,CAAC,0DAA0D,EAAE;YAC3D,OAAA,wBAAe,CACX,UAAU,CAAC,0DAA0D,CAAC,EACtE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CACrB;QAHD,CAGC,CAAC,CAAC;IACX,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
||||
24
dist/lib/css/property-descriptors/background-clip.js
vendored
Normal file
24
dist/lib/css/property-descriptors/background-clip.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.backgroundClip = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.backgroundClip = {
|
||||
name: 'background-clip',
|
||||
initialValue: 'border-box',
|
||||
prefix: false,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
return tokens.map(function (token) {
|
||||
if (parser_1.isIdentToken(token)) {
|
||||
switch (token.value) {
|
||||
case 'padding-box':
|
||||
return 1 /* PADDING_BOX */;
|
||||
case 'content-box':
|
||||
return 2 /* CONTENT_BOX */;
|
||||
}
|
||||
}
|
||||
return 0 /* BORDER_BOX */;
|
||||
});
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=background-clip.js.map
|
||||
1
dist/lib/css/property-descriptors/background-clip.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/background-clip.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"background-clip.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/background-clip.ts"],"names":[],"mappings":";;;AACA,2CAAwD;AAU3C,QAAA,cAAc,GAA4C;IACnE,IAAI,EAAE,iBAAiB;IACvB,YAAY,EAAE,YAAY;IAC1B,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK;YACpB,IAAI,qBAAY,CAAC,KAAK,CAAC,EAAE;gBACrB,QAAQ,KAAK,CAAC,KAAK,EAAE;oBACjB,KAAK,aAAa;wBACd,2BAAmC;oBACvC,KAAK,aAAa;wBACd,2BAAmC;iBAC1C;aACJ;YACD,0BAAkC;QACtC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAC"}
|
||||
11
dist/lib/css/property-descriptors/background-color.js
vendored
Normal file
11
dist/lib/css/property-descriptors/background-color.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.backgroundColor = void 0;
|
||||
exports.backgroundColor = {
|
||||
name: "background-color",
|
||||
initialValue: 'transparent',
|
||||
prefix: false,
|
||||
type: 3 /* TYPE_VALUE */,
|
||||
format: 'color'
|
||||
};
|
||||
//# sourceMappingURL=background-color.js.map
|
||||
1
dist/lib/css/property-descriptors/background-color.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/background-color.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"background-color.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/background-color.ts"],"names":[],"mappings":";;;AAEa,QAAA,eAAe,GAAiC;IACzD,IAAI,EAAE,kBAAkB;IACxB,YAAY,EAAE,aAAa;IAC3B,MAAM,EAAE,KAAK;IACb,IAAI,oBAA0C;IAC9C,MAAM,EAAE,OAAO;CAClB,CAAC"}
|
||||
24
dist/lib/css/property-descriptors/background-image.js
vendored
Normal file
24
dist/lib/css/property-descriptors/background-image.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.backgroundImage = void 0;
|
||||
var image_1 = require("../types/image");
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.backgroundImage = {
|
||||
name: 'background-image',
|
||||
initialValue: 'none',
|
||||
type: 1 /* LIST */,
|
||||
prefix: false,
|
||||
parse: function (context, tokens) {
|
||||
if (tokens.length === 0) {
|
||||
return [];
|
||||
}
|
||||
var first = tokens[0];
|
||||
if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {
|
||||
return [];
|
||||
}
|
||||
return tokens
|
||||
.filter(function (value) { return parser_1.nonFunctionArgSeparator(value) && image_1.isSupportedImage(value); })
|
||||
.map(function (value) { return image_1.image.parse(context, value); });
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=background-image.js.map
|
||||
1
dist/lib/css/property-descriptors/background-image.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/background-image.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"background-image.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/background-image.ts"],"names":[],"mappings":";;;AACA,wCAAkE;AAElE,2CAAmE;AAGtD,QAAA,eAAe,GAAyC;IACjE,IAAI,EAAE,kBAAkB;IACxB,YAAY,EAAE,MAAM;IACpB,IAAI,cAAoC;IACxC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,OAAgB,EAAE,MAAkB;QACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,OAAO,EAAE,CAAC;SACb;QAED,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAExB,IAAI,KAAK,CAAC,IAAI,yBAA0B,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE;YAChE,OAAO,EAAE,CAAC;SACb;QAED,OAAO,MAAM;aACR,MAAM,CAAC,UAAC,KAAK,IAAK,OAAA,gCAAuB,CAAC,KAAK,CAAC,IAAI,wBAAgB,CAAC,KAAK,CAAC,EAAzD,CAAyD,CAAC;aAC5E,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,aAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,EAA3B,CAA2B,CAAC,CAAC;IACrD,CAAC;CACJ,CAAC"}
|
||||
24
dist/lib/css/property-descriptors/background-origin.js
vendored
Normal file
24
dist/lib/css/property-descriptors/background-origin.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.backgroundOrigin = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.backgroundOrigin = {
|
||||
name: 'background-origin',
|
||||
initialValue: 'border-box',
|
||||
prefix: false,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
return tokens.map(function (token) {
|
||||
if (parser_1.isIdentToken(token)) {
|
||||
switch (token.value) {
|
||||
case 'padding-box':
|
||||
return 1 /* PADDING_BOX */;
|
||||
case 'content-box':
|
||||
return 2 /* CONTENT_BOX */;
|
||||
}
|
||||
}
|
||||
return 0 /* BORDER_BOX */;
|
||||
});
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=background-origin.js.map
|
||||
1
dist/lib/css/property-descriptors/background-origin.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/background-origin.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"background-origin.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/background-origin.ts"],"names":[],"mappings":";;;AACA,2CAAwD;AAW3C,QAAA,gBAAgB,GAA8C;IACvE,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,YAAY;IAC1B,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,MAAM,CAAC,GAAG,CAAC,UAAC,KAAK;YACpB,IAAI,qBAAY,CAAC,KAAK,CAAC,EAAE;gBACrB,QAAQ,KAAK,CAAC,KAAK,EAAE;oBACjB,KAAK,aAAa;wBACd,2BAAqC;oBACzC,KAAK,aAAa;wBACd,2BAAqC;iBAC5C;aACJ;YACD,0BAAoC;QACxC,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAC"}
|
||||
17
dist/lib/css/property-descriptors/background-position.js
vendored
Normal file
17
dist/lib/css/property-descriptors/background-position.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.backgroundPosition = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
var length_percentage_1 = require("../types/length-percentage");
|
||||
exports.backgroundPosition = {
|
||||
name: 'background-position',
|
||||
initialValue: '0% 0%',
|
||||
type: 1 /* LIST */,
|
||||
prefix: false,
|
||||
parse: function (_context, tokens) {
|
||||
return parser_1.parseFunctionArgs(tokens)
|
||||
.map(function (values) { return values.filter(length_percentage_1.isLengthPercentage); })
|
||||
.map(length_percentage_1.parseLengthPercentageTuple);
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=background-position.js.map
|
||||
1
dist/lib/css/property-descriptors/background-position.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/background-position.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"background-position.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/background-position.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAC7D,gEAAiH;AAMpG,QAAA,kBAAkB,GAAgD;IAC3E,IAAI,EAAE,qBAAqB;IAC3B,YAAY,EAAE,OAAO;IACrB,IAAI,cAAoC;IACxC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,0BAAiB,CAAC,MAAM,CAAC;aAC3B,GAAG,CAAC,UAAC,MAAkB,IAAK,OAAA,MAAM,CAAC,MAAM,CAAC,sCAAkB,CAAC,EAAjC,CAAiC,CAAC;aAC9D,GAAG,CAAC,8CAA0B,CAAC,CAAC;IACzC,CAAC;CACJ,CAAC"}
|
||||
36
dist/lib/css/property-descriptors/background-repeat.js
vendored
Normal file
36
dist/lib/css/property-descriptors/background-repeat.js
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.backgroundRepeat = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.backgroundRepeat = {
|
||||
name: 'background-repeat',
|
||||
initialValue: 'repeat',
|
||||
prefix: false,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
return parser_1.parseFunctionArgs(tokens)
|
||||
.map(function (values) {
|
||||
return values
|
||||
.filter(parser_1.isIdentToken)
|
||||
.map(function (token) { return token.value; })
|
||||
.join(' ');
|
||||
})
|
||||
.map(parseBackgroundRepeat);
|
||||
}
|
||||
};
|
||||
var parseBackgroundRepeat = function (value) {
|
||||
switch (value) {
|
||||
case 'no-repeat':
|
||||
return 1 /* NO_REPEAT */;
|
||||
case 'repeat-x':
|
||||
case 'repeat no-repeat':
|
||||
return 2 /* REPEAT_X */;
|
||||
case 'repeat-y':
|
||||
case 'no-repeat repeat':
|
||||
return 3 /* REPEAT_Y */;
|
||||
case 'repeat':
|
||||
default:
|
||||
return 0 /* REPEAT */;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=background-repeat.js.map
|
||||
1
dist/lib/css/property-descriptors/background-repeat.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/background-repeat.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"background-repeat.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/background-repeat.ts"],"names":[],"mappings":";;;AACA,2CAA2E;AAW9D,QAAA,gBAAgB,GAA8C;IACvE,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,QAAQ;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,0BAAiB,CAAC,MAAM,CAAC;aAC3B,GAAG,CAAC,UAAC,MAAM;YACR,OAAA,MAAM;iBACD,MAAM,CAAC,qBAAY,CAAC;iBACpB,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,KAAK,CAAC,KAAK,EAAX,CAAW,CAAC;iBAC3B,IAAI,CAAC,GAAG,CAAC;QAHd,CAGc,CACjB;aACA,GAAG,CAAC,qBAAqB,CAAC,CAAC;IACpC,CAAC;CACJ,CAAC;AAEF,IAAM,qBAAqB,GAAG,UAAC,KAAa;IACxC,QAAQ,KAAK,EAAE;QACX,KAAK,WAAW;YACZ,yBAAmC;QACvC,KAAK,UAAU,CAAC;QAChB,KAAK,kBAAkB;YACnB,wBAAkC;QACtC,KAAK,UAAU,CAAC;QAChB,KAAK,kBAAkB;YACnB,wBAAkC;QACtC,KAAK,QAAQ,CAAC;QACd;YACI,sBAAgC;KACvC;AACL,CAAC,CAAC"}
|
||||
24
dist/lib/css/property-descriptors/background-size.js
vendored
Normal file
24
dist/lib/css/property-descriptors/background-size.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.backgroundSize = exports.BACKGROUND_SIZE = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
var length_percentage_1 = require("../types/length-percentage");
|
||||
var BACKGROUND_SIZE;
|
||||
(function (BACKGROUND_SIZE) {
|
||||
BACKGROUND_SIZE["AUTO"] = "auto";
|
||||
BACKGROUND_SIZE["CONTAIN"] = "contain";
|
||||
BACKGROUND_SIZE["COVER"] = "cover";
|
||||
})(BACKGROUND_SIZE = exports.BACKGROUND_SIZE || (exports.BACKGROUND_SIZE = {}));
|
||||
exports.backgroundSize = {
|
||||
name: 'background-size',
|
||||
initialValue: '0',
|
||||
prefix: false,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
return parser_1.parseFunctionArgs(tokens).map(function (values) { return values.filter(isBackgroundSizeInfoToken); });
|
||||
}
|
||||
};
|
||||
var isBackgroundSizeInfoToken = function (value) {
|
||||
return parser_1.isIdentToken(value) || length_percentage_1.isLengthPercentage(value);
|
||||
};
|
||||
//# sourceMappingURL=background-size.js.map
|
||||
1
dist/lib/css/property-descriptors/background-size.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/background-size.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"background-size.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/background-size.ts"],"names":[],"mappings":";;;AACA,2CAA2E;AAC3E,gEAAgF;AAIhF,IAAY,eAIX;AAJD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,sCAAmB,CAAA;IACnB,kCAAe,CAAA;AACnB,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B;AAKY,QAAA,cAAc,GAA4C;IACnE,IAAI,EAAE,iBAAiB;IACvB,YAAY,EAAE,GAAG;IACjB,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,0BAAiB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAC,MAAM,IAAK,OAAA,MAAM,CAAC,MAAM,CAAC,yBAAyB,CAAC,EAAxC,CAAwC,CAAC,CAAC;IAC/F,CAAC;CACJ,CAAC;AAEF,IAAM,yBAAyB,GAAG,UAAC,KAAe;IAC9C,OAAA,qBAAY,CAAC,KAAK,CAAC,IAAI,sCAAkB,CAAC,KAAK,CAAC;AAAhD,CAAgD,CAAC"}
|
||||
15
dist/lib/css/property-descriptors/border-color.js
vendored
Normal file
15
dist/lib/css/property-descriptors/border-color.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.borderLeftColor = exports.borderBottomColor = exports.borderRightColor = exports.borderTopColor = void 0;
|
||||
var borderColorForSide = function (side) { return ({
|
||||
name: "border-" + side + "-color",
|
||||
initialValue: 'transparent',
|
||||
prefix: false,
|
||||
type: 3 /* TYPE_VALUE */,
|
||||
format: 'color'
|
||||
}); };
|
||||
exports.borderTopColor = borderColorForSide('top');
|
||||
exports.borderRightColor = borderColorForSide('right');
|
||||
exports.borderBottomColor = borderColorForSide('bottom');
|
||||
exports.borderLeftColor = borderColorForSide('left');
|
||||
//# sourceMappingURL=border-color.js.map
|
||||
1
dist/lib/css/property-descriptors/border-color.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/border-color.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"border-color.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/border-color.ts"],"names":[],"mappings":";;;AACA,IAAM,kBAAkB,GAAG,UAAC,IAAY,IAAmC,OAAA,CAAC;IACxE,IAAI,EAAE,YAAU,IAAI,WAAQ;IAC5B,YAAY,EAAE,aAAa;IAC3B,MAAM,EAAE,KAAK;IACb,IAAI,oBAA0C;IAC9C,MAAM,EAAE,OAAO;CAClB,CAAC,EANyE,CAMzE,CAAC;AAEU,QAAA,cAAc,GAAiC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACzE,QAAA,gBAAgB,GAAiC,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAC7E,QAAA,iBAAiB,GAAiC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AAC/E,QAAA,eAAe,GAAiC,kBAAkB,CAAC,MAAM,CAAC,CAAC"}
|
||||
18
dist/lib/css/property-descriptors/border-radius.js
vendored
Normal file
18
dist/lib/css/property-descriptors/border-radius.js
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.borderBottomLeftRadius = exports.borderBottomRightRadius = exports.borderTopRightRadius = exports.borderTopLeftRadius = void 0;
|
||||
var length_percentage_1 = require("../types/length-percentage");
|
||||
var borderRadiusForSide = function (side) { return ({
|
||||
name: "border-radius-" + side,
|
||||
initialValue: '0 0',
|
||||
prefix: false,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
return length_percentage_1.parseLengthPercentageTuple(tokens.filter(length_percentage_1.isLengthPercentage));
|
||||
}
|
||||
}); };
|
||||
exports.borderTopLeftRadius = borderRadiusForSide('top-left');
|
||||
exports.borderTopRightRadius = borderRadiusForSide('top-right');
|
||||
exports.borderBottomRightRadius = borderRadiusForSide('bottom-right');
|
||||
exports.borderBottomLeftRadius = borderRadiusForSide('bottom-left');
|
||||
//# sourceMappingURL=border-radius.js.map
|
||||
1
dist/lib/css/property-descriptors/border-radius.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/border-radius.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"border-radius.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/border-radius.ts"],"names":[],"mappings":";;;AAEA,gEAAiH;AAIjH,IAAM,mBAAmB,GAAG,UAAC,IAAY,IAA4C,OAAA,CAAC;IAClF,IAAI,EAAE,mBAAiB,IAAM;IAC7B,YAAY,EAAE,KAAK;IACnB,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAA,8CAA0B,CAAC,MAAM,CAAC,MAAM,CAAC,sCAAkB,CAAC,CAAC;IAA7D,CAA6D;CACpE,CAAC,EAPmF,CAOnF,CAAC;AAEU,QAAA,mBAAmB,GAA0C,mBAAmB,CAAC,UAAU,CAAC,CAAC;AAC7F,QAAA,oBAAoB,GAA0C,mBAAmB,CAAC,WAAW,CAAC,CAAC;AAC/F,QAAA,uBAAuB,GAA0C,mBAAmB,CAAC,cAAc,CAAC,CAAC;AACrG,QAAA,sBAAsB,GAA0C,mBAAmB,CAAC,aAAa,CAAC,CAAC"}
|
||||
27
dist/lib/css/property-descriptors/border-style.js
vendored
Normal file
27
dist/lib/css/property-descriptors/border-style.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.borderLeftStyle = exports.borderBottomStyle = exports.borderRightStyle = exports.borderTopStyle = void 0;
|
||||
var borderStyleForSide = function (side) { return ({
|
||||
name: "border-" + side + "-style",
|
||||
initialValue: 'solid',
|
||||
prefix: false,
|
||||
type: 2 /* IDENT_VALUE */,
|
||||
parse: function (_context, style) {
|
||||
switch (style) {
|
||||
case 'none':
|
||||
return 0 /* NONE */;
|
||||
case 'dashed':
|
||||
return 2 /* DASHED */;
|
||||
case 'dotted':
|
||||
return 3 /* DOTTED */;
|
||||
case 'double':
|
||||
return 4 /* DOUBLE */;
|
||||
}
|
||||
return 1 /* SOLID */;
|
||||
}
|
||||
}); };
|
||||
exports.borderTopStyle = borderStyleForSide('top');
|
||||
exports.borderRightStyle = borderStyleForSide('right');
|
||||
exports.borderBottomStyle = borderStyleForSide('bottom');
|
||||
exports.borderLeftStyle = borderStyleForSide('left');
|
||||
//# sourceMappingURL=border-style.js.map
|
||||
1
dist/lib/css/property-descriptors/border-style.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/border-style.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"border-style.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/border-style.ts"],"names":[],"mappings":";;;AAUA,IAAM,kBAAkB,GAAG,UAAC,IAAY,IAAkD,OAAA,CAAC;IACvF,IAAI,EAAE,YAAU,IAAI,WAAQ;IAC5B,YAAY,EAAE,OAAO;IACrB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;IAC/C,KAAK,EAAE,UAAC,QAAiB,EAAE,KAAa;QACpC,QAAQ,KAAK,EAAE;YACX,KAAK,MAAM;gBACP,oBAAyB;YAC7B,KAAK,QAAQ;gBACT,sBAA2B;YAC/B,KAAK,QAAQ;gBACT,sBAA2B;YAC/B,KAAK,QAAQ;gBACT,sBAA2B;SAClC;QACD,qBAA0B;IAC9B,CAAC;CACJ,CAAC,EAlBwF,CAkBxF,CAAC;AAEU,QAAA,cAAc,GAAgD,kBAAkB,CAAC,KAAK,CAAC,CAAC;AACxF,QAAA,gBAAgB,GAAgD,kBAAkB,CAAC,OAAO,CAAC,CAAC;AAC5F,QAAA,iBAAiB,GAAgD,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AAC9F,QAAA,eAAe,GAAgD,kBAAkB,CAAC,MAAM,CAAC,CAAC"}
|
||||
21
dist/lib/css/property-descriptors/border-width.js
vendored
Normal file
21
dist/lib/css/property-descriptors/border-width.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.borderLeftWidth = exports.borderBottomWidth = exports.borderRightWidth = exports.borderTopWidth = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
var borderWidthForSide = function (side) { return ({
|
||||
name: "border-" + side + "-width",
|
||||
initialValue: '0',
|
||||
type: 0 /* VALUE */,
|
||||
prefix: false,
|
||||
parse: function (_context, token) {
|
||||
if (parser_1.isDimensionToken(token)) {
|
||||
return token.number;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}); };
|
||||
exports.borderTopWidth = borderWidthForSide('top');
|
||||
exports.borderRightWidth = borderWidthForSide('right');
|
||||
exports.borderBottomWidth = borderWidthForSide('bottom');
|
||||
exports.borderLeftWidth = borderWidthForSide('left');
|
||||
//# sourceMappingURL=border-width.js.map
|
||||
1
dist/lib/css/property-descriptors/border-width.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/border-width.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"border-width.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/border-width.ts"],"names":[],"mappings":";;;AACA,2CAA4D;AAE5D,IAAM,kBAAkB,GAAG,UAAC,IAAY,IAAuC,OAAA,CAAC;IAC5E,IAAI,EAAE,YAAU,IAAI,WAAQ;IAC5B,YAAY,EAAE,GAAG;IACjB,IAAI,eAAqC;IACzC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,QAAiB,EAAE,KAAe;QACtC,IAAI,yBAAgB,CAAC,KAAK,CAAC,EAAE;YACzB,OAAO,KAAK,CAAC,MAAM,CAAC;SACvB;QACD,OAAO,CAAC,CAAC;IACb,CAAC;CACJ,CAAC,EAX6E,CAW7E,CAAC;AAEU,QAAA,cAAc,GAAqC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAC7E,QAAA,gBAAgB,GAAqC,kBAAkB,CAAC,OAAO,CAAC,CAAC;AACjF,QAAA,iBAAiB,GAAqC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;AACnF,QAAA,eAAe,GAAqC,kBAAkB,CAAC,MAAM,CAAC,CAAC"}
|
||||
55
dist/lib/css/property-descriptors/box-shadow.js
vendored
Normal file
55
dist/lib/css/property-descriptors/box-shadow.js
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.boxShadow = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
var length_percentage_1 = require("../types/length-percentage");
|
||||
var color_1 = require("../types/color");
|
||||
var length_1 = require("../types/length");
|
||||
exports.boxShadow = {
|
||||
name: 'box-shadow',
|
||||
initialValue: 'none',
|
||||
type: 1 /* LIST */,
|
||||
prefix: false,
|
||||
parse: function (context, tokens) {
|
||||
if (tokens.length === 1 && parser_1.isIdentWithValue(tokens[0], 'none')) {
|
||||
return [];
|
||||
}
|
||||
return parser_1.parseFunctionArgs(tokens).map(function (values) {
|
||||
var shadow = {
|
||||
color: 0x000000ff,
|
||||
offsetX: length_percentage_1.ZERO_LENGTH,
|
||||
offsetY: length_percentage_1.ZERO_LENGTH,
|
||||
blur: length_percentage_1.ZERO_LENGTH,
|
||||
spread: length_percentage_1.ZERO_LENGTH,
|
||||
inset: false
|
||||
};
|
||||
var c = 0;
|
||||
for (var i = 0; i < values.length; i++) {
|
||||
var token = values[i];
|
||||
if (parser_1.isIdentWithValue(token, 'inset')) {
|
||||
shadow.inset = true;
|
||||
}
|
||||
else if (length_1.isLength(token)) {
|
||||
if (c === 0) {
|
||||
shadow.offsetX = token;
|
||||
}
|
||||
else if (c === 1) {
|
||||
shadow.offsetY = token;
|
||||
}
|
||||
else if (c === 2) {
|
||||
shadow.blur = token;
|
||||
}
|
||||
else {
|
||||
shadow.spread = token;
|
||||
}
|
||||
c++;
|
||||
}
|
||||
else {
|
||||
shadow.color = color_1.color.parse(context, token);
|
||||
}
|
||||
}
|
||||
return shadow;
|
||||
});
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=box-shadow.js.map
|
||||
1
dist/lib/css/property-descriptors/box-shadow.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/box-shadow.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"box-shadow.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/box-shadow.ts"],"names":[],"mappings":";;;AACA,2CAA+E;AAC/E,gEAAuD;AACvD,wCAA4C;AAC5C,0CAAiD;AAapC,QAAA,SAAS,GAAuC;IACzD,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,MAAM;IACpB,IAAI,cAAoC;IACxC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,OAAgB,EAAE,MAAkB;QACxC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,yBAAgB,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE;YAC5D,OAAO,EAAE,CAAC;SACb;QAED,OAAO,0BAAiB,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAC,MAAkB;YACpD,IAAM,MAAM,GAAkB;gBAC1B,KAAK,EAAE,UAAU;gBACjB,OAAO,EAAE,+BAAW;gBACpB,OAAO,EAAE,+BAAW;gBACpB,IAAI,EAAE,+BAAW;gBACjB,MAAM,EAAE,+BAAW;gBACnB,KAAK,EAAE,KAAK;aACf,CAAC;YACF,IAAI,CAAC,GAAG,CAAC,CAAC;YACV,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBACpC,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;gBACxB,IAAI,yBAAgB,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE;oBAClC,MAAM,CAAC,KAAK,GAAG,IAAI,CAAC;iBACvB;qBAAM,IAAI,iBAAQ,CAAC,KAAK,CAAC,EAAE;oBACxB,IAAI,CAAC,KAAK,CAAC,EAAE;wBACT,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;qBAC1B;yBAAM,IAAI,CAAC,KAAK,CAAC,EAAE;wBAChB,MAAM,CAAC,OAAO,GAAG,KAAK,CAAC;qBAC1B;yBAAM,IAAI,CAAC,KAAK,CAAC,EAAE;wBAChB,MAAM,CAAC,IAAI,GAAG,KAAK,CAAC;qBACvB;yBAAM;wBACH,MAAM,CAAC,MAAM,GAAG,KAAK,CAAC;qBACzB;oBACD,CAAC,EAAE,CAAC;iBACP;qBAAM;oBACH,MAAM,CAAC,KAAK,GAAG,aAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;iBAC9C;aACJ;YACD,OAAO,MAAM,CAAC;QAClB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAC"}
|
||||
11
dist/lib/css/property-descriptors/color.js
vendored
Normal file
11
dist/lib/css/property-descriptors/color.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.color = void 0;
|
||||
exports.color = {
|
||||
name: "color",
|
||||
initialValue: 'transparent',
|
||||
prefix: false,
|
||||
type: 3 /* TYPE_VALUE */,
|
||||
format: 'color'
|
||||
};
|
||||
//# sourceMappingURL=color.js.map
|
||||
1
dist/lib/css/property-descriptors/color.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/color.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/color.ts"],"names":[],"mappings":";;;AAEa,QAAA,KAAK,GAAiC;IAC/C,IAAI,EAAE,OAAO;IACb,YAAY,EAAE,aAAa;IAC3B,MAAM,EAAE,KAAK;IACb,IAAI,oBAA0C;IAC9C,MAAM,EAAE,OAAO;CAClB,CAAC"}
|
||||
20
dist/lib/css/property-descriptors/content.js
vendored
Normal file
20
dist/lib/css/property-descriptors/content.js
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.content = void 0;
|
||||
exports.content = {
|
||||
name: 'content',
|
||||
initialValue: 'none',
|
||||
type: 1 /* LIST */,
|
||||
prefix: false,
|
||||
parse: function (_context, tokens) {
|
||||
if (tokens.length === 0) {
|
||||
return [];
|
||||
}
|
||||
var first = tokens[0];
|
||||
if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {
|
||||
return [];
|
||||
}
|
||||
return tokens;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=content.js.map
|
||||
1
dist/lib/css/property-descriptors/content.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/content.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/content.ts"],"names":[],"mappings":";;;AAOa,QAAA,OAAO,GAAqC;IACrD,IAAI,EAAE,SAAS;IACf,YAAY,EAAE,MAAM;IACpB,IAAI,cAAoC;IACxC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,OAAO,EAAE,CAAC;SACb;QAED,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAExB,IAAI,KAAK,CAAC,IAAI,yBAA0B,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE;YAChE,OAAO,EAAE,CAAC;SACb;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC"}
|
||||
31
dist/lib/css/property-descriptors/counter-increment.js
vendored
Normal file
31
dist/lib/css/property-descriptors/counter-increment.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.counterIncrement = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.counterIncrement = {
|
||||
name: 'counter-increment',
|
||||
initialValue: 'none',
|
||||
prefix: true,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
if (tokens.length === 0) {
|
||||
return null;
|
||||
}
|
||||
var first = tokens[0];
|
||||
if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {
|
||||
return null;
|
||||
}
|
||||
var increments = [];
|
||||
var filtered = tokens.filter(parser_1.nonWhiteSpace);
|
||||
for (var i = 0; i < filtered.length; i++) {
|
||||
var counter = filtered[i];
|
||||
var next = filtered[i + 1];
|
||||
if (counter.type === 20 /* IDENT_TOKEN */) {
|
||||
var increment = next && parser_1.isNumberToken(next) ? next.number : 1;
|
||||
increments.push({ counter: counter.value, increment: increment });
|
||||
}
|
||||
}
|
||||
return increments;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=counter-increment.js.map
|
||||
1
dist/lib/css/property-descriptors/counter-increment.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/counter-increment.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"counter-increment.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/counter-increment.ts"],"names":[],"mappings":";;;AACA,2CAAwE;AAW3D,QAAA,gBAAgB,GAA8C;IACvE,IAAI,EAAE,mBAAmB;IACzB,YAAY,EAAE,MAAM;IACpB,MAAM,EAAE,IAAI;IACZ,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,OAAO,IAAI,CAAC;SACf;QAED,IAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;QAExB,IAAI,KAAK,CAAC,IAAI,yBAA0B,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE;YAChE,OAAO,IAAI,CAAC;SACf;QAED,IAAM,UAAU,GAAG,EAAE,CAAC;QACtB,IAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAa,CAAC,CAAC;QAE9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC7B,IAAI,OAAO,CAAC,IAAI,yBAA0B,EAAE;gBACxC,IAAM,SAAS,GAAG,IAAI,IAAI,sBAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBAChE,UAAU,CAAC,IAAI,CAAC,EAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,SAAS,WAAA,EAAC,CAAC,CAAC;aACxD;SACJ;QAED,OAAO,UAAU,CAAC;IACtB,CAAC;CACJ,CAAC"}
|
||||
27
dist/lib/css/property-descriptors/counter-reset.js
vendored
Normal file
27
dist/lib/css/property-descriptors/counter-reset.js
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.counterReset = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.counterReset = {
|
||||
name: 'counter-reset',
|
||||
initialValue: 'none',
|
||||
prefix: true,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
if (tokens.length === 0) {
|
||||
return [];
|
||||
}
|
||||
var resets = [];
|
||||
var filtered = tokens.filter(parser_1.nonWhiteSpace);
|
||||
for (var i = 0; i < filtered.length; i++) {
|
||||
var counter = filtered[i];
|
||||
var next = filtered[i + 1];
|
||||
if (parser_1.isIdentToken(counter) && counter.value !== 'none') {
|
||||
var reset = next && parser_1.isNumberToken(next) ? next.number : 0;
|
||||
resets.push({ counter: counter.value, reset: reset });
|
||||
}
|
||||
}
|
||||
return resets;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=counter-reset.js.map
|
||||
1
dist/lib/css/property-descriptors/counter-reset.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/counter-reset.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"counter-reset.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/counter-reset.ts"],"names":[],"mappings":";;;AACA,2CAAsF;AAUzE,QAAA,YAAY,GAA0C;IAC/D,IAAI,EAAE,eAAe;IACrB,YAAY,EAAE,MAAM;IACpB,MAAM,EAAE,IAAI;IACZ,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE;YACrB,OAAO,EAAE,CAAC;SACb;QAED,IAAM,MAAM,GAAG,EAAE,CAAC;QAClB,IAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,sBAAa,CAAC,CAAC;QAE9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACtC,IAAM,OAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YAC5B,IAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;YAC7B,IAAI,qBAAY,CAAC,OAAO,CAAC,IAAI,OAAO,CAAC,KAAK,KAAK,MAAM,EAAE;gBACnD,IAAM,KAAK,GAAG,IAAI,IAAI,sBAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC5D,MAAM,CAAC,IAAI,CAAC,EAAC,OAAO,EAAE,OAAO,CAAC,KAAK,EAAE,KAAK,OAAA,EAAC,CAAC,CAAC;aAChD;SACJ;QAED,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC"}
|
||||
19
dist/lib/css/property-descriptors/direction.js
vendored
Normal file
19
dist/lib/css/property-descriptors/direction.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.direction = void 0;
|
||||
exports.direction = {
|
||||
name: 'direction',
|
||||
initialValue: 'ltr',
|
||||
prefix: false,
|
||||
type: 2 /* IDENT_VALUE */,
|
||||
parse: function (_context, direction) {
|
||||
switch (direction) {
|
||||
case 'rtl':
|
||||
return 1 /* RTL */;
|
||||
case 'ltr':
|
||||
default:
|
||||
return 0 /* LTR */;
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=direction.js.map
|
||||
1
dist/lib/css/property-descriptors/direction.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/direction.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"direction.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/direction.ts"],"names":[],"mappings":";;;AAQa,QAAA,SAAS,GAA6C;IAC/D,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE,KAAK;IACnB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;IAC/C,KAAK,EAAE,UAAC,QAAiB,EAAE,SAAiB;QACxC,QAAQ,SAAS,EAAE;YACf,KAAK,KAAK;gBACN,mBAAqB;YACzB,KAAK,KAAK,CAAC;YACX;gBACI,mBAAqB;SAC5B;IACL,CAAC;CACJ,CAAC"}
|
||||
82
dist/lib/css/property-descriptors/display.js
vendored
Normal file
82
dist/lib/css/property-descriptors/display.js
vendored
Normal file
@@ -0,0 +1,82 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.display = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.display = {
|
||||
name: 'display',
|
||||
initialValue: 'inline-block',
|
||||
prefix: false,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
return tokens.filter(parser_1.isIdentToken).reduce(function (bit, token) {
|
||||
return bit | parseDisplayValue(token.value);
|
||||
}, 0 /* NONE */);
|
||||
}
|
||||
};
|
||||
var parseDisplayValue = function (display) {
|
||||
switch (display) {
|
||||
case 'block':
|
||||
case '-webkit-box':
|
||||
return 2 /* BLOCK */;
|
||||
case 'inline':
|
||||
return 4 /* INLINE */;
|
||||
case 'run-in':
|
||||
return 8 /* RUN_IN */;
|
||||
case 'flow':
|
||||
return 16 /* FLOW */;
|
||||
case 'flow-root':
|
||||
return 32 /* FLOW_ROOT */;
|
||||
case 'table':
|
||||
return 64 /* TABLE */;
|
||||
case 'flex':
|
||||
case '-webkit-flex':
|
||||
return 128 /* FLEX */;
|
||||
case 'grid':
|
||||
case '-ms-grid':
|
||||
return 256 /* GRID */;
|
||||
case 'ruby':
|
||||
return 512 /* RUBY */;
|
||||
case 'subgrid':
|
||||
return 1024 /* SUBGRID */;
|
||||
case 'list-item':
|
||||
return 2048 /* LIST_ITEM */;
|
||||
case 'table-row-group':
|
||||
return 4096 /* TABLE_ROW_GROUP */;
|
||||
case 'table-header-group':
|
||||
return 8192 /* TABLE_HEADER_GROUP */;
|
||||
case 'table-footer-group':
|
||||
return 16384 /* TABLE_FOOTER_GROUP */;
|
||||
case 'table-row':
|
||||
return 32768 /* TABLE_ROW */;
|
||||
case 'table-cell':
|
||||
return 65536 /* TABLE_CELL */;
|
||||
case 'table-column-group':
|
||||
return 131072 /* TABLE_COLUMN_GROUP */;
|
||||
case 'table-column':
|
||||
return 262144 /* TABLE_COLUMN */;
|
||||
case 'table-caption':
|
||||
return 524288 /* TABLE_CAPTION */;
|
||||
case 'ruby-base':
|
||||
return 1048576 /* RUBY_BASE */;
|
||||
case 'ruby-text':
|
||||
return 2097152 /* RUBY_TEXT */;
|
||||
case 'ruby-base-container':
|
||||
return 4194304 /* RUBY_BASE_CONTAINER */;
|
||||
case 'ruby-text-container':
|
||||
return 8388608 /* RUBY_TEXT_CONTAINER */;
|
||||
case 'contents':
|
||||
return 16777216 /* CONTENTS */;
|
||||
case 'inline-block':
|
||||
return 33554432 /* INLINE_BLOCK */;
|
||||
case 'inline-list-item':
|
||||
return 67108864 /* INLINE_LIST_ITEM */;
|
||||
case 'inline-table':
|
||||
return 134217728 /* INLINE_TABLE */;
|
||||
case 'inline-flex':
|
||||
return 268435456 /* INLINE_FLEX */;
|
||||
case 'inline-grid':
|
||||
return 536870912 /* INLINE_GRID */;
|
||||
}
|
||||
return 0 /* NONE */;
|
||||
};
|
||||
//# sourceMappingURL=display.js.map
|
||||
1
dist/lib/css/property-descriptors/display.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/display.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/display.ts"],"names":[],"mappings":";;;AACA,2CAAwD;AAqC3C,QAAA,OAAO,GAAqC;IACrD,IAAI,EAAE,SAAS;IACf,YAAY,EAAE,cAAc;IAC5B,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,MAAM,CAAC,MAAM,CAAC,qBAAY,CAAC,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,KAAK;YACjD,OAAO,GAAG,GAAG,iBAAiB,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QAChD,CAAC,eAAe,CAAC;IACrB,CAAC;CACJ,CAAC;AAEF,IAAM,iBAAiB,GAAG,UAAC,OAAe;IACtC,QAAQ,OAAO,EAAE;QACb,KAAK,OAAO,CAAC;QACb,KAAK,aAAa;YACd,qBAAqB;QACzB,KAAK,QAAQ;YACT,sBAAsB;QAC1B,KAAK,QAAQ;YACT,sBAAsB;QAC1B,KAAK,MAAM;YACP,qBAAoB;QACxB,KAAK,WAAW;YACZ,0BAAyB;QAC7B,KAAK,OAAO;YACR,sBAAqB;QACzB,KAAK,MAAM,CAAC;QACZ,KAAK,cAAc;YACf,sBAAoB;QACxB,KAAK,MAAM,CAAC;QACZ,KAAK,UAAU;YACX,sBAAoB;QACxB,KAAK,MAAM;YACP,sBAAoB;QACxB,KAAK,SAAS;YACV,0BAAuB;QAC3B,KAAK,WAAW;YACZ,4BAAyB;QAC7B,KAAK,iBAAiB;YAClB,kCAA+B;QACnC,KAAK,oBAAoB;YACrB,qCAAkC;QACtC,KAAK,oBAAoB;YACrB,sCAAkC;QACtC,KAAK,WAAW;YACZ,6BAAyB;QAC7B,KAAK,YAAY;YACb,8BAA0B;QAC9B,KAAK,oBAAoB;YACrB,uCAAkC;QACtC,KAAK,cAAc;YACf,iCAA4B;QAChC,KAAK,eAAe;YAChB,kCAA6B;QACjC,KAAK,WAAW;YACZ,+BAAyB;QAC7B,KAAK,WAAW;YACZ,+BAAyB;QAC7B,KAAK,qBAAqB;YACtB,yCAAmC;QACvC,KAAK,qBAAqB;YACtB,yCAAmC;QACvC,KAAK,UAAU;YACX,+BAAwB;QAC5B,KAAK,cAAc;YACf,mCAA4B;QAChC,KAAK,kBAAkB;YACnB,uCAAgC;QACpC,KAAK,cAAc;YACf,oCAA4B;QAChC,KAAK,aAAa;YACd,mCAA2B;QAC/B,KAAK,aAAa;YACd,mCAA2B;KAClC;IAED,oBAAoB;AACxB,CAAC,CAAC"}
|
||||
15
dist/lib/css/property-descriptors/duration.js
vendored
Normal file
15
dist/lib/css/property-descriptors/duration.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.duration = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
var time_1 = require("../types/time");
|
||||
exports.duration = {
|
||||
name: 'duration',
|
||||
initialValue: '0s',
|
||||
prefix: false,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (context, tokens) {
|
||||
return tokens.filter(parser_1.isDimensionToken).map(function (token) { return time_1.time.parse(context, token); });
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=duration.js.map
|
||||
1
dist/lib/css/property-descriptors/duration.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/duration.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"duration.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/duration.ts"],"names":[],"mappings":";;;AAEA,2CAA4D;AAC5D,sCAAmC;AAEtB,QAAA,QAAQ,GAAsC;IACvD,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE,IAAI;IAClB,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,OAAgB,EAAE,MAAkB;QACxC,OAAO,MAAM,CAAC,MAAM,CAAC,yBAAgB,CAAC,CAAC,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,WAAI,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,EAA1B,CAA0B,CAAC,CAAC;IACtF,CAAC;CACJ,CAAC"}
|
||||
23
dist/lib/css/property-descriptors/float.js
vendored
Normal file
23
dist/lib/css/property-descriptors/float.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.float = void 0;
|
||||
exports.float = {
|
||||
name: 'float',
|
||||
initialValue: 'none',
|
||||
prefix: false,
|
||||
type: 2 /* IDENT_VALUE */,
|
||||
parse: function (_context, float) {
|
||||
switch (float) {
|
||||
case 'left':
|
||||
return 1 /* LEFT */;
|
||||
case 'right':
|
||||
return 2 /* RIGHT */;
|
||||
case 'inline-start':
|
||||
return 3 /* INLINE_START */;
|
||||
case 'inline-end':
|
||||
return 4 /* INLINE_END */;
|
||||
}
|
||||
return 0 /* NONE */;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=float.js.map
|
||||
1
dist/lib/css/property-descriptors/float.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/float.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"float.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/float.ts"],"names":[],"mappings":";;;AAUa,QAAA,KAAK,GAAyC;IACvD,IAAI,EAAE,OAAO;IACb,YAAY,EAAE,MAAM;IACpB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;IAC/C,KAAK,EAAE,UAAC,QAAiB,EAAE,KAAa;QACpC,QAAQ,KAAK,EAAE;YACX,KAAK,MAAM;gBACP,oBAAkB;YACtB,KAAK,OAAO;gBACR,qBAAmB;YACvB,KAAK,cAAc;gBACf,4BAA0B;YAC9B,KAAK,YAAY;gBACb,0BAAwB;SAC/B;QACD,oBAAkB;IACtB,CAAC;CACJ,CAAC"}
|
||||
33
dist/lib/css/property-descriptors/font-family.js
vendored
Normal file
33
dist/lib/css/property-descriptors/font-family.js
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fontFamily = void 0;
|
||||
exports.fontFamily = {
|
||||
name: "font-family",
|
||||
initialValue: '',
|
||||
prefix: false,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
var accumulator = [];
|
||||
var results = [];
|
||||
tokens.forEach(function (token) {
|
||||
switch (token.type) {
|
||||
case 20 /* IDENT_TOKEN */:
|
||||
case 0 /* STRING_TOKEN */:
|
||||
accumulator.push(token.value);
|
||||
break;
|
||||
case 17 /* NUMBER_TOKEN */:
|
||||
accumulator.push(token.number.toString());
|
||||
break;
|
||||
case 4 /* COMMA_TOKEN */:
|
||||
results.push(accumulator.join(' '));
|
||||
accumulator.length = 0;
|
||||
break;
|
||||
}
|
||||
});
|
||||
if (accumulator.length) {
|
||||
results.push(accumulator.join(' '));
|
||||
}
|
||||
return results.map(function (result) { return (result.indexOf(' ') === -1 ? result : "'" + result + "'"); });
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=font-family.js.map
|
||||
1
dist/lib/css/property-descriptors/font-family.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/font-family.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"font-family.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/font-family.ts"],"names":[],"mappings":";;;AASa,QAAA,UAAU,GAAwC;IAC3D,IAAI,EAAE,aAAa;IACnB,YAAY,EAAE,EAAE;IAChB,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,IAAM,WAAW,GAAa,EAAE,CAAC;QACjC,IAAM,OAAO,GAAa,EAAE,CAAC;QAC7B,MAAM,CAAC,OAAO,CAAC,UAAC,KAAK;YACjB,QAAQ,KAAK,CAAC,IAAI,EAAE;gBAChB,0BAA2B;gBAC3B;oBACI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;oBAC9B,MAAM;gBACV;oBACI,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;oBAC1C,MAAM;gBACV;oBACI,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;oBACpC,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC;oBACvB,MAAM;aACb;QACL,CAAC,CAAC,CAAC;QACH,IAAI,WAAW,CAAC,MAAM,EAAE;YACpB,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;SACvC;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,UAAC,MAAM,IAAK,OAAA,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAI,MAAM,MAAG,CAAC,EAArD,CAAqD,CAAC,CAAC;IAC1F,CAAC;CACJ,CAAC"}
|
||||
11
dist/lib/css/property-descriptors/font-size.js
vendored
Normal file
11
dist/lib/css/property-descriptors/font-size.js
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fontSize = void 0;
|
||||
exports.fontSize = {
|
||||
name: "font-size",
|
||||
initialValue: '0',
|
||||
prefix: false,
|
||||
type: 3 /* TYPE_VALUE */,
|
||||
format: 'length'
|
||||
};
|
||||
//# sourceMappingURL=font-size.js.map
|
||||
1
dist/lib/css/property-descriptors/font-size.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/font-size.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"font-size.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/font-size.ts"],"names":[],"mappings":";;;AAEa,QAAA,QAAQ,GAAiC;IAClD,IAAI,EAAE,WAAW;IACjB,YAAY,EAAE,GAAG;IACjB,MAAM,EAAE,KAAK;IACb,IAAI,oBAA0C;IAC9C,MAAM,EAAE,QAAQ;CACnB,CAAC"}
|
||||
21
dist/lib/css/property-descriptors/font-style.js
vendored
Normal file
21
dist/lib/css/property-descriptors/font-style.js
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fontStyle = void 0;
|
||||
exports.fontStyle = {
|
||||
name: 'font-style',
|
||||
initialValue: 'normal',
|
||||
prefix: false,
|
||||
type: 2 /* IDENT_VALUE */,
|
||||
parse: function (_context, overflow) {
|
||||
switch (overflow) {
|
||||
case 'oblique':
|
||||
return "oblique" /* OBLIQUE */;
|
||||
case 'italic':
|
||||
return "italic" /* ITALIC */;
|
||||
case 'normal':
|
||||
default:
|
||||
return "normal" /* NORMAL */;
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=font-style.js.map
|
||||
1
dist/lib/css/property-descriptors/font-style.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/font-style.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"font-style.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/font-style.ts"],"names":[],"mappings":";;;AAQa,QAAA,SAAS,GAA8C;IAChE,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,QAAQ;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;IAC/C,KAAK,EAAE,UAAC,QAAiB,EAAE,QAAgB;QACvC,QAAQ,QAAQ,EAAE;YACd,KAAK,SAAS;gBACV,+BAA0B;YAC9B,KAAK,QAAQ;gBACT,6BAAyB;YAC7B,KAAK,QAAQ,CAAC;YACd;gBACI,6BAAyB;SAChC;IACL,CAAC;CACJ,CAAC"}
|
||||
14
dist/lib/css/property-descriptors/font-variant.js
vendored
Normal file
14
dist/lib/css/property-descriptors/font-variant.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fontVariant = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.fontVariant = {
|
||||
name: 'font-variant',
|
||||
initialValue: 'none',
|
||||
type: 1 /* LIST */,
|
||||
prefix: false,
|
||||
parse: function (_context, tokens) {
|
||||
return tokens.filter(parser_1.isIdentToken).map(function (token) { return token.value; });
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=font-variant.js.map
|
||||
1
dist/lib/css/property-descriptors/font-variant.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/font-variant.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"font-variant.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/font-variant.ts"],"names":[],"mappings":";;;AACA,2CAAwD;AAE3C,QAAA,WAAW,GAAsC;IAC1D,IAAI,EAAE,cAAc;IACpB,YAAY,EAAE,MAAM;IACpB,IAAI,cAAoC;IACxC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,MAAM,CAAC,MAAM,CAAC,qBAAY,CAAC,CAAC,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,KAAK,CAAC,KAAK,EAAX,CAAW,CAAC,CAAC;IACnE,CAAC;CACJ,CAAC"}
|
||||
26
dist/lib/css/property-descriptors/font-weight.js
vendored
Normal file
26
dist/lib/css/property-descriptors/font-weight.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.fontWeight = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.fontWeight = {
|
||||
name: 'font-weight',
|
||||
initialValue: 'normal',
|
||||
type: 0 /* VALUE */,
|
||||
prefix: false,
|
||||
parse: function (_context, token) {
|
||||
if (parser_1.isNumberToken(token)) {
|
||||
return token.number;
|
||||
}
|
||||
if (parser_1.isIdentToken(token)) {
|
||||
switch (token.value) {
|
||||
case 'bold':
|
||||
return 700;
|
||||
case 'normal':
|
||||
default:
|
||||
return 400;
|
||||
}
|
||||
}
|
||||
return 400;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=font-weight.js.map
|
||||
1
dist/lib/css/property-descriptors/font-weight.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/font-weight.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"font-weight.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/font-weight.ts"],"names":[],"mappings":";;;AACA,2CAAuE;AAE1D,QAAA,UAAU,GAAqC;IACxD,IAAI,EAAE,aAAa;IACnB,YAAY,EAAE,QAAQ;IACtB,IAAI,eAAqC;IACzC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,QAAiB,EAAE,KAAe;QACtC,IAAI,sBAAa,CAAC,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,MAAM,CAAC;SACvB;QAED,IAAI,qBAAY,CAAC,KAAK,CAAC,EAAE;YACrB,QAAQ,KAAK,CAAC,KAAK,EAAE;gBACjB,KAAK,MAAM;oBACP,OAAO,GAAG,CAAC;gBACf,KAAK,QAAQ,CAAC;gBACd;oBACI,OAAO,GAAG,CAAC;aAClB;SACJ;QAED,OAAO,GAAG,CAAC;IACf,CAAC;CACJ,CAAC"}
|
||||
22
dist/lib/css/property-descriptors/letter-spacing.js
vendored
Normal file
22
dist/lib/css/property-descriptors/letter-spacing.js
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.letterSpacing = void 0;
|
||||
exports.letterSpacing = {
|
||||
name: 'letter-spacing',
|
||||
initialValue: '0',
|
||||
prefix: false,
|
||||
type: 0 /* VALUE */,
|
||||
parse: function (_context, token) {
|
||||
if (token.type === 20 /* IDENT_TOKEN */ && token.value === 'normal') {
|
||||
return 0;
|
||||
}
|
||||
if (token.type === 17 /* NUMBER_TOKEN */) {
|
||||
return token.number;
|
||||
}
|
||||
if (token.type === 15 /* DIMENSION_TOKEN */) {
|
||||
return token.number;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=letter-spacing.js.map
|
||||
1
dist/lib/css/property-descriptors/letter-spacing.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/letter-spacing.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"letter-spacing.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/letter-spacing.ts"],"names":[],"mappings":";;;AAIa,QAAA,aAAa,GAAqC;IAC3D,IAAI,EAAE,gBAAgB;IACtB,YAAY,EAAE,GAAG;IACjB,MAAM,EAAE,KAAK;IACb,IAAI,eAAqC;IACzC,KAAK,EAAE,UAAC,QAAiB,EAAE,KAAe;QACtC,IAAI,KAAK,CAAC,IAAI,yBAA0B,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;YAClE,OAAO,CAAC,CAAC;SACZ;QAED,IAAI,KAAK,CAAC,IAAI,0BAA2B,EAAE;YACvC,OAAO,KAAK,CAAC,MAAM,CAAC;SACvB;QAED,IAAI,KAAK,CAAC,IAAI,6BAA8B,EAAE;YAC1C,OAAO,KAAK,CAAC,MAAM,CAAC;SACvB;QAED,OAAO,CAAC,CAAC;IACb,CAAC;CACJ,CAAC"}
|
||||
24
dist/lib/css/property-descriptors/line-break.js
vendored
Normal file
24
dist/lib/css/property-descriptors/line-break.js
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.lineBreak = exports.LINE_BREAK = void 0;
|
||||
var LINE_BREAK;
|
||||
(function (LINE_BREAK) {
|
||||
LINE_BREAK["NORMAL"] = "normal";
|
||||
LINE_BREAK["STRICT"] = "strict";
|
||||
})(LINE_BREAK = exports.LINE_BREAK || (exports.LINE_BREAK = {}));
|
||||
exports.lineBreak = {
|
||||
name: 'line-break',
|
||||
initialValue: 'normal',
|
||||
prefix: false,
|
||||
type: 2 /* IDENT_VALUE */,
|
||||
parse: function (_context, lineBreak) {
|
||||
switch (lineBreak) {
|
||||
case 'strict':
|
||||
return LINE_BREAK.STRICT;
|
||||
case 'normal':
|
||||
default:
|
||||
return LINE_BREAK.NORMAL;
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=line-break.js.map
|
||||
1
dist/lib/css/property-descriptors/line-break.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/line-break.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"line-break.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/line-break.ts"],"names":[],"mappings":";;;AAEA,IAAY,UAGX;AAHD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;AACrB,CAAC,EAHW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAGrB;AAEY,QAAA,SAAS,GAA8C;IAChE,IAAI,EAAE,YAAY;IAClB,YAAY,EAAE,QAAQ;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;IAC/C,KAAK,EAAE,UAAC,QAAiB,EAAE,SAAiB;QACxC,QAAQ,SAAS,EAAE;YACf,KAAK,QAAQ;gBACT,OAAO,UAAU,CAAC,MAAM,CAAC;YAC7B,KAAK,QAAQ,CAAC;YACd;gBACI,OAAO,UAAU,CAAC,MAAM,CAAC;SAChC;IACL,CAAC;CACJ,CAAC"}
|
||||
25
dist/lib/css/property-descriptors/line-height.js
vendored
Normal file
25
dist/lib/css/property-descriptors/line-height.js
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.computeLineHeight = exports.lineHeight = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
var length_percentage_1 = require("../types/length-percentage");
|
||||
exports.lineHeight = {
|
||||
name: 'line-height',
|
||||
initialValue: 'normal',
|
||||
prefix: false,
|
||||
type: 4 /* TOKEN_VALUE */
|
||||
};
|
||||
var computeLineHeight = function (token, fontSize) {
|
||||
if (parser_1.isIdentToken(token) && token.value === 'normal') {
|
||||
return 1.2 * fontSize;
|
||||
}
|
||||
else if (token.type === 17 /* NUMBER_TOKEN */) {
|
||||
return fontSize * token.number;
|
||||
}
|
||||
else if (length_percentage_1.isLengthPercentage(token)) {
|
||||
return length_percentage_1.getAbsoluteValue(token, fontSize);
|
||||
}
|
||||
return fontSize;
|
||||
};
|
||||
exports.computeLineHeight = computeLineHeight;
|
||||
//# sourceMappingURL=line-height.js.map
|
||||
1
dist/lib/css/property-descriptors/line-height.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/line-height.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"line-height.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/line-height.ts"],"names":[],"mappings":";;;AACA,2CAAwD;AAExD,gEAAgF;AACnE,QAAA,UAAU,GAAkC;IACrD,IAAI,EAAE,aAAa;IACnB,YAAY,EAAE,QAAQ;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;CAClD,CAAC;AAEK,IAAM,iBAAiB,GAAG,UAAC,KAAe,EAAE,QAAgB;IAC/D,IAAI,qBAAY,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;QACjD,OAAO,GAAG,GAAG,QAAQ,CAAC;KACzB;SAAM,IAAI,KAAK,CAAC,IAAI,0BAA2B,EAAE;QAC9C,OAAO,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC;KAClC;SAAM,IAAI,sCAAkB,CAAC,KAAK,CAAC,EAAE;QAClC,OAAO,oCAAgB,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;KAC5C;IAED,OAAO,QAAQ,CAAC;AACpB,CAAC,CAAC;AAVW,QAAA,iBAAiB,qBAU5B"}
|
||||
17
dist/lib/css/property-descriptors/list-style-image.js
vendored
Normal file
17
dist/lib/css/property-descriptors/list-style-image.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.listStyleImage = void 0;
|
||||
var image_1 = require("../types/image");
|
||||
exports.listStyleImage = {
|
||||
name: 'list-style-image',
|
||||
initialValue: 'none',
|
||||
type: 0 /* VALUE */,
|
||||
prefix: false,
|
||||
parse: function (context, token) {
|
||||
if (token.type === 20 /* IDENT_TOKEN */ && token.value === 'none') {
|
||||
return null;
|
||||
}
|
||||
return image_1.image.parse(context, token);
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=list-style-image.js.map
|
||||
1
dist/lib/css/property-descriptors/list-style-image.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/list-style-image.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"list-style-image.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/list-style-image.ts"],"names":[],"mappings":";;;AACA,wCAAgD;AAKnC,QAAA,cAAc,GAA+C;IACtE,IAAI,EAAE,kBAAkB;IACxB,YAAY,EAAE,MAAM;IACpB,IAAI,eAAqC;IACzC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,OAAgB,EAAE,KAAe;QACrC,IAAI,KAAK,CAAC,IAAI,yBAA0B,IAAI,KAAK,CAAC,KAAK,KAAK,MAAM,EAAE;YAChE,OAAO,IAAI,CAAC;SACf;QAED,OAAO,aAAK,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACvC,CAAC;CACJ,CAAC"}
|
||||
19
dist/lib/css/property-descriptors/list-style-position.js
vendored
Normal file
19
dist/lib/css/property-descriptors/list-style-position.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.listStylePosition = void 0;
|
||||
exports.listStylePosition = {
|
||||
name: 'list-style-position',
|
||||
initialValue: 'outside',
|
||||
prefix: false,
|
||||
type: 2 /* IDENT_VALUE */,
|
||||
parse: function (_context, position) {
|
||||
switch (position) {
|
||||
case 'inside':
|
||||
return 0 /* INSIDE */;
|
||||
case 'outside':
|
||||
default:
|
||||
return 1 /* OUTSIDE */;
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=list-style-position.js.map
|
||||
1
dist/lib/css/property-descriptors/list-style-position.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/list-style-position.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"list-style-position.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/list-style-position.ts"],"names":[],"mappings":";;;AAOa,QAAA,iBAAiB,GAAuD;IACjF,IAAI,EAAE,qBAAqB;IAC3B,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;IAC/C,KAAK,EAAE,UAAC,QAAiB,EAAE,QAAgB;QACvC,QAAQ,QAAQ,EAAE;YACd,KAAK,QAAQ;gBACT,sBAAkC;YACtC,KAAK,SAAS,CAAC;YACf;gBACI,uBAAmC;SAC1C;IACL,CAAC;CACJ,CAAC"}
|
||||
123
dist/lib/css/property-descriptors/list-style-type.js
vendored
Normal file
123
dist/lib/css/property-descriptors/list-style-type.js
vendored
Normal file
@@ -0,0 +1,123 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.listStyleType = void 0;
|
||||
exports.listStyleType = {
|
||||
name: 'list-style-type',
|
||||
initialValue: 'none',
|
||||
prefix: false,
|
||||
type: 2 /* IDENT_VALUE */,
|
||||
parse: function (_context, type) {
|
||||
switch (type) {
|
||||
case 'disc':
|
||||
return 0 /* DISC */;
|
||||
case 'circle':
|
||||
return 1 /* CIRCLE */;
|
||||
case 'square':
|
||||
return 2 /* SQUARE */;
|
||||
case 'decimal':
|
||||
return 3 /* DECIMAL */;
|
||||
case 'cjk-decimal':
|
||||
return 4 /* CJK_DECIMAL */;
|
||||
case 'decimal-leading-zero':
|
||||
return 5 /* DECIMAL_LEADING_ZERO */;
|
||||
case 'lower-roman':
|
||||
return 6 /* LOWER_ROMAN */;
|
||||
case 'upper-roman':
|
||||
return 7 /* UPPER_ROMAN */;
|
||||
case 'lower-greek':
|
||||
return 8 /* LOWER_GREEK */;
|
||||
case 'lower-alpha':
|
||||
return 9 /* LOWER_ALPHA */;
|
||||
case 'upper-alpha':
|
||||
return 10 /* UPPER_ALPHA */;
|
||||
case 'arabic-indic':
|
||||
return 11 /* ARABIC_INDIC */;
|
||||
case 'armenian':
|
||||
return 12 /* ARMENIAN */;
|
||||
case 'bengali':
|
||||
return 13 /* BENGALI */;
|
||||
case 'cambodian':
|
||||
return 14 /* CAMBODIAN */;
|
||||
case 'cjk-earthly-branch':
|
||||
return 15 /* CJK_EARTHLY_BRANCH */;
|
||||
case 'cjk-heavenly-stem':
|
||||
return 16 /* CJK_HEAVENLY_STEM */;
|
||||
case 'cjk-ideographic':
|
||||
return 17 /* CJK_IDEOGRAPHIC */;
|
||||
case 'devanagari':
|
||||
return 18 /* DEVANAGARI */;
|
||||
case 'ethiopic-numeric':
|
||||
return 19 /* ETHIOPIC_NUMERIC */;
|
||||
case 'georgian':
|
||||
return 20 /* GEORGIAN */;
|
||||
case 'gujarati':
|
||||
return 21 /* GUJARATI */;
|
||||
case 'gurmukhi':
|
||||
return 22 /* GURMUKHI */;
|
||||
case 'hebrew':
|
||||
return 22 /* HEBREW */;
|
||||
case 'hiragana':
|
||||
return 23 /* HIRAGANA */;
|
||||
case 'hiragana-iroha':
|
||||
return 24 /* HIRAGANA_IROHA */;
|
||||
case 'japanese-formal':
|
||||
return 25 /* JAPANESE_FORMAL */;
|
||||
case 'japanese-informal':
|
||||
return 26 /* JAPANESE_INFORMAL */;
|
||||
case 'kannada':
|
||||
return 27 /* KANNADA */;
|
||||
case 'katakana':
|
||||
return 28 /* KATAKANA */;
|
||||
case 'katakana-iroha':
|
||||
return 29 /* KATAKANA_IROHA */;
|
||||
case 'khmer':
|
||||
return 30 /* KHMER */;
|
||||
case 'korean-hangul-formal':
|
||||
return 31 /* KOREAN_HANGUL_FORMAL */;
|
||||
case 'korean-hanja-formal':
|
||||
return 32 /* KOREAN_HANJA_FORMAL */;
|
||||
case 'korean-hanja-informal':
|
||||
return 33 /* KOREAN_HANJA_INFORMAL */;
|
||||
case 'lao':
|
||||
return 34 /* LAO */;
|
||||
case 'lower-armenian':
|
||||
return 35 /* LOWER_ARMENIAN */;
|
||||
case 'malayalam':
|
||||
return 36 /* MALAYALAM */;
|
||||
case 'mongolian':
|
||||
return 37 /* MONGOLIAN */;
|
||||
case 'myanmar':
|
||||
return 38 /* MYANMAR */;
|
||||
case 'oriya':
|
||||
return 39 /* ORIYA */;
|
||||
case 'persian':
|
||||
return 40 /* PERSIAN */;
|
||||
case 'simp-chinese-formal':
|
||||
return 41 /* SIMP_CHINESE_FORMAL */;
|
||||
case 'simp-chinese-informal':
|
||||
return 42 /* SIMP_CHINESE_INFORMAL */;
|
||||
case 'tamil':
|
||||
return 43 /* TAMIL */;
|
||||
case 'telugu':
|
||||
return 44 /* TELUGU */;
|
||||
case 'thai':
|
||||
return 45 /* THAI */;
|
||||
case 'tibetan':
|
||||
return 46 /* TIBETAN */;
|
||||
case 'trad-chinese-formal':
|
||||
return 47 /* TRAD_CHINESE_FORMAL */;
|
||||
case 'trad-chinese-informal':
|
||||
return 48 /* TRAD_CHINESE_INFORMAL */;
|
||||
case 'upper-armenian':
|
||||
return 49 /* UPPER_ARMENIAN */;
|
||||
case 'disclosure-open':
|
||||
return 50 /* DISCLOSURE_OPEN */;
|
||||
case 'disclosure-closed':
|
||||
return 51 /* DISCLOSURE_CLOSED */;
|
||||
case 'none':
|
||||
default:
|
||||
return -1 /* NONE */;
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=list-style-type.js.map
|
||||
1
dist/lib/css/property-descriptors/list-style-type.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/list-style-type.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"list-style-type.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/list-style-type.ts"],"names":[],"mappings":";;;AA2Da,QAAA,aAAa,GAAmD;IACzE,IAAI,EAAE,iBAAiB;IACvB,YAAY,EAAE,MAAM;IACpB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;IAC/C,KAAK,EAAE,UAAC,QAAiB,EAAE,IAAY;QACnC,QAAQ,IAAI,EAAE;YACV,KAAK,MAAM;gBACP,oBAA4B;YAChC,KAAK,QAAQ;gBACT,sBAA8B;YAClC,KAAK,QAAQ;gBACT,sBAA8B;YAClC,KAAK,SAAS;gBACV,uBAA+B;YACnC,KAAK,aAAa;gBACd,2BAAmC;YACvC,KAAK,sBAAsB;gBACvB,oCAA4C;YAChD,KAAK,aAAa;gBACd,2BAAmC;YACvC,KAAK,aAAa;gBACd,2BAAmC;YACvC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C;YACjD,KAAK,OAAO;gBACR,sBAA6B;YACjC,KAAK,QAAQ;gBACT,uBAA8B;YAClC,KAAK,MAAM;gBACP,qBAA4B;YAChC,KAAK,SAAS;gBACV,wBAA+B;YACnC,KAAK,qBAAqB;gBACtB,oCAA2C;YAC/C,KAAK,uBAAuB;gBACxB,sCAA6C;YACjD,KAAK,gBAAgB;gBACjB,+BAAsC;YAC1C,KAAK,iBAAiB;gBAClB,gCAAuC;YAC3C,KAAK,mBAAmB;gBACpB,kCAAyC;YAC7C,KAAK,MAAM,CAAC;YACZ;gBACI,qBAA4B;SACnC;IACL,CAAC;CACJ,CAAC"}
|
||||
14
dist/lib/css/property-descriptors/margin.js
vendored
Normal file
14
dist/lib/css/property-descriptors/margin.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.marginLeft = exports.marginBottom = exports.marginRight = exports.marginTop = void 0;
|
||||
var marginForSide = function (side) { return ({
|
||||
name: "margin-" + side,
|
||||
initialValue: '0',
|
||||
prefix: false,
|
||||
type: 4 /* TOKEN_VALUE */
|
||||
}); };
|
||||
exports.marginTop = marginForSide('top');
|
||||
exports.marginRight = marginForSide('right');
|
||||
exports.marginBottom = marginForSide('bottom');
|
||||
exports.marginLeft = marginForSide('left');
|
||||
//# sourceMappingURL=margin.js.map
|
||||
1
dist/lib/css/property-descriptors/margin.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/margin.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"margin.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/margin.ts"],"names":[],"mappings":";;;AAEA,IAAM,aAAa,GAAG,UAAC,IAAY,IAAoC,OAAA,CAAC;IACpE,IAAI,EAAE,YAAU,IAAM;IACtB,YAAY,EAAE,GAAG;IACjB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;CAClD,CAAC,EALqE,CAKrE,CAAC;AAEU,QAAA,SAAS,GAAkC,aAAa,CAAC,KAAK,CAAC,CAAC;AAChE,QAAA,WAAW,GAAkC,aAAa,CAAC,OAAO,CAAC,CAAC;AACpE,QAAA,YAAY,GAAkC,aAAa,CAAC,QAAQ,CAAC,CAAC;AACtE,QAAA,UAAU,GAAkC,aAAa,CAAC,MAAM,CAAC,CAAC"}
|
||||
17
dist/lib/css/property-descriptors/opacity.js
vendored
Normal file
17
dist/lib/css/property-descriptors/opacity.js
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.opacity = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.opacity = {
|
||||
name: 'opacity',
|
||||
initialValue: '1',
|
||||
type: 0 /* VALUE */,
|
||||
prefix: false,
|
||||
parse: function (_context, token) {
|
||||
if (parser_1.isNumberToken(token)) {
|
||||
return token.number;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=opacity.js.map
|
||||
1
dist/lib/css/property-descriptors/opacity.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/opacity.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"opacity.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/opacity.ts"],"names":[],"mappings":";;;AACA,2CAAyD;AAE5C,QAAA,OAAO,GAAqC;IACrD,IAAI,EAAE,SAAS;IACf,YAAY,EAAE,GAAG;IACjB,IAAI,eAAqC;IACzC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,QAAiB,EAAE,KAAe;QACtC,IAAI,sBAAa,CAAC,KAAK,CAAC,EAAE;YACtB,OAAO,KAAK,CAAC,MAAM,CAAC;SACvB;QACD,OAAO,CAAC,CAAC;IACb,CAAC;CACJ,CAAC"}
|
||||
19
dist/lib/css/property-descriptors/overflow-wrap.js
vendored
Normal file
19
dist/lib/css/property-descriptors/overflow-wrap.js
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.overflowWrap = void 0;
|
||||
exports.overflowWrap = {
|
||||
name: 'overflow-wrap',
|
||||
initialValue: 'normal',
|
||||
prefix: false,
|
||||
type: 2 /* IDENT_VALUE */,
|
||||
parse: function (_context, overflow) {
|
||||
switch (overflow) {
|
||||
case 'break-word':
|
||||
return "break-word" /* BREAK_WORD */;
|
||||
case 'normal':
|
||||
default:
|
||||
return "normal" /* NORMAL */;
|
||||
}
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=overflow-wrap.js.map
|
||||
1
dist/lib/css/property-descriptors/overflow-wrap.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/overflow-wrap.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"overflow-wrap.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/overflow-wrap.ts"],"names":[],"mappings":";;;AAOa,QAAA,YAAY,GAAiD;IACtE,IAAI,EAAE,eAAe;IACrB,YAAY,EAAE,QAAQ;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;IAC/C,KAAK,EAAE,UAAC,QAAiB,EAAE,QAAgB;QACvC,QAAQ,QAAQ,EAAE;YACd,KAAK,YAAY;gBACb,qCAAgC;YACpC,KAAK,QAAQ,CAAC;YACd;gBACI,6BAA4B;SACnC;IACL,CAAC;CACJ,CAAC"}
|
||||
28
dist/lib/css/property-descriptors/overflow.js
vendored
Normal file
28
dist/lib/css/property-descriptors/overflow.js
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.overflow = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.overflow = {
|
||||
name: 'overflow',
|
||||
initialValue: 'visible',
|
||||
prefix: false,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
return tokens.filter(parser_1.isIdentToken).map(function (overflow) {
|
||||
switch (overflow.value) {
|
||||
case 'hidden':
|
||||
return 1 /* HIDDEN */;
|
||||
case 'scroll':
|
||||
return 2 /* SCROLL */;
|
||||
case 'clip':
|
||||
return 3 /* CLIP */;
|
||||
case 'auto':
|
||||
return 4 /* AUTO */;
|
||||
case 'visible':
|
||||
default:
|
||||
return 0 /* VISIBLE */;
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=overflow.js.map
|
||||
1
dist/lib/css/property-descriptors/overflow.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/overflow.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"overflow.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/overflow.ts"],"names":[],"mappings":";;;AACA,2CAAwD;AAU3C,QAAA,QAAQ,GAAwC;IACzD,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE,SAAS;IACvB,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,MAAM,CAAC,MAAM,CAAC,qBAAY,CAAC,CAAC,GAAG,CAAC,UAAC,QAAQ;YAC5C,QAAQ,QAAQ,CAAC,KAAK,EAAE;gBACpB,KAAK,QAAQ;oBACT,sBAAuB;gBAC3B,KAAK,QAAQ;oBACT,sBAAuB;gBAC3B,KAAK,MAAM;oBACP,oBAAqB;gBACzB,KAAK,MAAM;oBACP,oBAAqB;gBACzB,KAAK,SAAS,CAAC;gBACf;oBACI,uBAAwB;aAC/B;QACL,CAAC,CAAC,CAAC;IACP,CAAC;CACJ,CAAC"}
|
||||
15
dist/lib/css/property-descriptors/padding.js
vendored
Normal file
15
dist/lib/css/property-descriptors/padding.js
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.paddingLeft = exports.paddingBottom = exports.paddingRight = exports.paddingTop = void 0;
|
||||
var paddingForSide = function (side) { return ({
|
||||
name: "padding-" + side,
|
||||
initialValue: '0',
|
||||
prefix: false,
|
||||
type: 3 /* TYPE_VALUE */,
|
||||
format: 'length-percentage'
|
||||
}); };
|
||||
exports.paddingTop = paddingForSide('top');
|
||||
exports.paddingRight = paddingForSide('right');
|
||||
exports.paddingBottom = paddingForSide('bottom');
|
||||
exports.paddingLeft = paddingForSide('left');
|
||||
//# sourceMappingURL=padding.js.map
|
||||
1
dist/lib/css/property-descriptors/padding.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/padding.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"padding.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/padding.ts"],"names":[],"mappings":";;;AAEA,IAAM,cAAc,GAAG,UAAC,IAAY,IAAmC,OAAA,CAAC;IACpE,IAAI,EAAE,aAAW,IAAM;IACvB,YAAY,EAAE,GAAG;IACjB,MAAM,EAAE,KAAK;IACb,IAAI,oBAA0C;IAC9C,MAAM,EAAE,mBAAmB;CAC9B,CAAC,EANqE,CAMrE,CAAC;AAEU,QAAA,UAAU,GAAiC,cAAc,CAAC,KAAK,CAAC,CAAC;AACjE,QAAA,YAAY,GAAiC,cAAc,CAAC,OAAO,CAAC,CAAC;AACrE,QAAA,aAAa,GAAiC,cAAc,CAAC,QAAQ,CAAC,CAAC;AACvE,QAAA,WAAW,GAAiC,cAAc,CAAC,MAAM,CAAC,CAAC"}
|
||||
34
dist/lib/css/property-descriptors/paint-order.js
vendored
Normal file
34
dist/lib/css/property-descriptors/paint-order.js
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.paintOrder = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.paintOrder = {
|
||||
name: 'paint-order',
|
||||
initialValue: 'normal',
|
||||
prefix: false,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
var DEFAULT_VALUE = [0 /* FILL */, 1 /* STROKE */, 2 /* MARKERS */];
|
||||
var layers = [];
|
||||
tokens.filter(parser_1.isIdentToken).forEach(function (token) {
|
||||
switch (token.value) {
|
||||
case 'stroke':
|
||||
layers.push(1 /* STROKE */);
|
||||
break;
|
||||
case 'fill':
|
||||
layers.push(0 /* FILL */);
|
||||
break;
|
||||
case 'markers':
|
||||
layers.push(2 /* MARKERS */);
|
||||
break;
|
||||
}
|
||||
});
|
||||
DEFAULT_VALUE.forEach(function (value) {
|
||||
if (layers.indexOf(value) === -1) {
|
||||
layers.push(value);
|
||||
}
|
||||
});
|
||||
return layers;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=paint-order.js.map
|
||||
1
dist/lib/css/property-descriptors/paint-order.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/paint-order.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"paint-order.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/paint-order.ts"],"names":[],"mappings":";;;AACA,2CAAwD;AAU3C,QAAA,UAAU,GAAwC;IAC3D,IAAI,EAAE,aAAa;IACnB,YAAY,EAAE,QAAQ;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,cAAoC;IACxC,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,IAAM,aAAa,GAAG,+CAA6E,CAAC;QACpG,IAAM,MAAM,GAAe,EAAE,CAAC;QAE9B,MAAM,CAAC,MAAM,CAAC,qBAAY,CAAC,CAAC,OAAO,CAAC,UAAC,KAAK;YACtC,QAAQ,KAAK,CAAC,KAAK,EAAE;gBACjB,KAAK,QAAQ;oBACT,MAAM,CAAC,IAAI,gBAA0B,CAAC;oBACtC,MAAM;gBACV,KAAK,MAAM;oBACP,MAAM,CAAC,IAAI,cAAwB,CAAC;oBACpC,MAAM;gBACV,KAAK,SAAS;oBACV,MAAM,CAAC,IAAI,iBAA2B,CAAC;oBACvC,MAAM;aACb;QACL,CAAC,CAAC,CAAC;QACH,aAAa,CAAC,OAAO,CAAC,UAAC,KAAK;YACxB,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE;gBAC9B,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;aACtB;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAClB,CAAC;CACJ,CAAC"}
|
||||
23
dist/lib/css/property-descriptors/position.js
vendored
Normal file
23
dist/lib/css/property-descriptors/position.js
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.position = void 0;
|
||||
exports.position = {
|
||||
name: 'position',
|
||||
initialValue: 'static',
|
||||
prefix: false,
|
||||
type: 2 /* IDENT_VALUE */,
|
||||
parse: function (_context, position) {
|
||||
switch (position) {
|
||||
case 'relative':
|
||||
return 1 /* RELATIVE */;
|
||||
case 'absolute':
|
||||
return 2 /* ABSOLUTE */;
|
||||
case 'fixed':
|
||||
return 3 /* FIXED */;
|
||||
case 'sticky':
|
||||
return 4 /* STICKY */;
|
||||
}
|
||||
return 0 /* STATIC */;
|
||||
}
|
||||
};
|
||||
//# sourceMappingURL=position.js.map
|
||||
1
dist/lib/css/property-descriptors/position.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/position.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"position.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/position.ts"],"names":[],"mappings":";;;AAUa,QAAA,QAAQ,GAA4C;IAC7D,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE,QAAQ;IACtB,MAAM,EAAE,KAAK;IACb,IAAI,qBAA2C;IAC/C,KAAK,EAAE,UAAC,QAAiB,EAAE,QAAgB;QACvC,QAAQ,QAAQ,EAAE;YACd,KAAK,UAAU;gBACX,wBAAyB;YAC7B,KAAK,UAAU;gBACX,wBAAyB;YAC7B,KAAK,OAAO;gBACR,qBAAsB;YAC1B,KAAK,QAAQ;gBACT,sBAAuB;SAC9B;QAED,sBAAuB;IAC3B,CAAC;CACJ,CAAC"}
|
||||
42
dist/lib/css/property-descriptors/quotes.js
vendored
Normal file
42
dist/lib/css/property-descriptors/quotes.js
vendored
Normal file
@@ -0,0 +1,42 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getQuote = exports.quotes = void 0;
|
||||
var parser_1 = require("../syntax/parser");
|
||||
exports.quotes = {
|
||||
name: 'quotes',
|
||||
initialValue: 'none',
|
||||
prefix: true,
|
||||
type: 1 /* LIST */,
|
||||
parse: function (_context, tokens) {
|
||||
if (tokens.length === 0) {
|
||||
return null;
|
||||
}
|
||||
var first = tokens[0];
|
||||
if (first.type === 20 /* IDENT_TOKEN */ && first.value === 'none') {
|
||||
return null;
|
||||
}
|
||||
var quotes = [];
|
||||
var filtered = tokens.filter(parser_1.isStringToken);
|
||||
if (filtered.length % 2 !== 0) {
|
||||
return null;
|
||||
}
|
||||
for (var i = 0; i < filtered.length; i += 2) {
|
||||
var open_1 = filtered[i].value;
|
||||
var close_1 = filtered[i + 1].value;
|
||||
quotes.push({ open: open_1, close: close_1 });
|
||||
}
|
||||
return quotes;
|
||||
}
|
||||
};
|
||||
var getQuote = function (quotes, depth, open) {
|
||||
if (!quotes) {
|
||||
return '';
|
||||
}
|
||||
var quote = quotes[Math.min(depth, quotes.length - 1)];
|
||||
if (!quote) {
|
||||
return '';
|
||||
}
|
||||
return open ? quote.open : quote.close;
|
||||
};
|
||||
exports.getQuote = getQuote;
|
||||
//# sourceMappingURL=quotes.js.map
|
||||
1
dist/lib/css/property-descriptors/quotes.js.map
vendored
Normal file
1
dist/lib/css/property-descriptors/quotes.js.map
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"quotes.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/quotes.ts"],"names":[],"mappings":";;;AACA,2CAAyD;AAW5C,QAAA,MAAM,GAAoC;IACnD,IAAI,EAAE,QA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