taro-css-to-react-native
Advanced tools
Comparing version 4.0.1-alpha.1 to 4.0.1
@@ -11,7 +11,7 @@ "use strict"; | ||
var _index = _interopRequireDefault(require("./transforms/index")); | ||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } | ||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | ||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } | ||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } | ||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /* eslint-disable no-param-reassign */ | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /* eslint-disable no-param-reassign */ | ||
// Note if this is wrong, you'll need to change tokenTypes.js too | ||
@@ -24,3 +24,3 @@ var numberOrLengthRe = /^([+-]?(?:\d*\.)?\d+(?:[Ee][+-]?\d+)?)((?:px)|(?:vw$)|(?:vh$)|(?:vmin$)|(?:vmax$))?$/i; | ||
// Undocumented export | ||
var transformRawValue = exports.transformRawValue = function transformRawValue(input) { | ||
var transformRawValue = function transformRawValue(input) { | ||
var value = input.trim(); | ||
@@ -48,2 +48,3 @@ var numberMatch = value.match(numberOrLengthRe); | ||
}; | ||
exports.transformRawValue = transformRawValue; | ||
var baseTransformShorthandValue = function baseTransformShorthandValue(propName, inputValue) { | ||
@@ -63,3 +64,3 @@ // const ast = parse(inputValue.trim().replace(/PX|Px|pX$/g, "")); | ||
var transformShorthandValue = process.env.NODE_ENV === 'production' ? baseTransformShorthandValue : checkBaseTransformShorthandValue; | ||
var getStylesForProperty = exports.getStylesForProperty = function getStylesForProperty(propName, inputValue, allowShorthand) { | ||
var getStylesForProperty = function getStylesForProperty(propName, inputValue, allowShorthand) { | ||
var isRawValue = allowShorthand === false || !(propName in _index["default"]); | ||
@@ -69,3 +70,4 @@ var propValue = isRawValue ? transformRawValue(inputValue) : transformShorthandValue(propName, inputValue.trim()); | ||
}; | ||
var getPropertyName = exports.getPropertyName = function getPropertyName(propName) { | ||
exports.getStylesForProperty = getStylesForProperty; | ||
var getPropertyName = function getPropertyName(propName) { | ||
var isCustomProp = /^--\w+/.test(propName); | ||
@@ -77,3 +79,4 @@ if (isCustomProp) { | ||
}; | ||
var _default = exports["default"] = function _default(rules) { | ||
exports.getPropertyName = getPropertyName; | ||
var _default = function _default(rules) { | ||
var shorthandBlacklist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : []; | ||
@@ -86,2 +89,3 @@ return rules.reduce(function (accum, rule) { | ||
}, {}); | ||
}; | ||
}; | ||
exports["default"] = _default; |
@@ -7,10 +7,10 @@ "use strict"; | ||
exports["default"] = void 0; | ||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | ||
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } | ||
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } | ||
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } | ||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } | ||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | ||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } | ||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
var SYMBOL_MATCH = 'SYMBOL_MATCH'; | ||
var TokenStream = exports["default"] = /*#__PURE__*/function () { | ||
var TokenStream = /*#__PURE__*/function () { | ||
function TokenStream(nodes, parent) { | ||
@@ -24,3 +24,3 @@ _classCallCheck(this, TokenStream); | ||
} | ||
return _createClass(TokenStream, [{ | ||
_createClass(TokenStream, [{ | ||
key: "node", | ||
@@ -107,2 +107,4 @@ get: function get() { | ||
}]); | ||
}(); | ||
return TokenStream; | ||
}(); | ||
exports["default"] = TokenStream; |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _postcssValueParser = require("postcss-value-parser"); | ||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
/* eslint-disable react/display-name */ | ||
@@ -66,3 +66,3 @@ | ||
}; | ||
var regExpToken = exports.regExpToken = function regExpToken(regExp) { | ||
var regExpToken = function regExpToken(regExp) { | ||
var transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : String; | ||
@@ -86,3 +86,4 @@ return function (node) { | ||
}; | ||
var tokens = exports.tokens = { | ||
exports.regExpToken = regExpToken; | ||
var tokens = { | ||
SPACE: noopToken(function (node) { | ||
@@ -110,2 +111,3 @@ return node.type === 'space'; | ||
LINE: regExpToken(/^(none|underline|line-through)$/i) | ||
}; | ||
}; | ||
exports.tokens = tokens; |
@@ -9,6 +9,6 @@ "use strict"; | ||
var _util = require("./util"); | ||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | ||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } | ||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } | ||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
var WORD = _tokenTypes.tokens.WORD, | ||
@@ -20,21 +20,27 @@ FUNC = _tokenTypes.tokens.FUNC, | ||
function borderDirectionFactory() { | ||
var _anyOrderFactory; | ||
var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | ||
var prefix = "border".concat(direction); | ||
return (0, _util.anyOrderFactory)(_defineProperty(_defineProperty(_defineProperty({}, "".concat(prefix, "Width"), { | ||
return (0, _util.anyOrderFactory)((_anyOrderFactory = {}, _defineProperty(_anyOrderFactory, "".concat(prefix, "Width"), { | ||
tokens: [LENGTH, UNSUPPORTED_LENGTH_UNIT], | ||
"default": 1 | ||
}), "".concat(prefix, "Color"), { | ||
}), _defineProperty(_anyOrderFactory, "".concat(prefix, "Color"), { | ||
tokens: [COLOR], | ||
"default": 'black' | ||
}), "borderStyle", { | ||
}), _defineProperty(_anyOrderFactory, "borderStyle", { | ||
tokens: [(0, _tokenTypes.regExpToken)(/^(solid|dashed|dotted)$/)], | ||
"default": 'solid' | ||
})); | ||
}), _anyOrderFactory)); | ||
} | ||
var border = exports.border = borderDirectionFactory(); | ||
var borderTop = exports.borderTop = borderDirectionFactory('Top'); | ||
var borderRight = exports.borderRight = borderDirectionFactory('Right'); | ||
var borderBottom = exports.borderBottom = borderDirectionFactory('Bottom'); | ||
var borderLeft = exports.borderLeft = borderDirectionFactory('Left'); | ||
var borderColor = exports.borderColor = (0, _util.directionFactory)({ | ||
var border = borderDirectionFactory(); | ||
exports.border = border; | ||
var borderTop = borderDirectionFactory('Top'); | ||
exports.borderTop = borderTop; | ||
var borderRight = borderDirectionFactory('Right'); | ||
exports.borderRight = borderRight; | ||
var borderBottom = borderDirectionFactory('Bottom'); | ||
exports.borderBottom = borderBottom; | ||
var borderLeft = borderDirectionFactory('Left'); | ||
exports.borderLeft = borderLeft; | ||
var borderColor = (0, _util.directionFactory)({ | ||
types: [WORD, FUNC], | ||
@@ -44,3 +50,4 @@ prefix: 'border', | ||
}); | ||
var borderRadius = exports.borderRadius = (0, _util.directionFactory)({ | ||
exports.borderColor = borderColor; | ||
var borderRadius = (0, _util.directionFactory)({ | ||
directions: ['TopLeft', 'TopRight', 'BottomRight', 'BottomLeft'], | ||
@@ -50,5 +57,7 @@ prefix: 'border', | ||
}); | ||
var borderWidth = exports.borderWidth = (0, _util.directionFactory)({ | ||
exports.borderRadius = borderRadius; | ||
var borderWidth = (0, _util.directionFactory)({ | ||
prefix: 'border', | ||
suffix: 'Width' | ||
}); | ||
}); | ||
exports.borderWidth = borderWidth; |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _util = require("./util"); | ||
var _default = exports["default"] = function _default(tokenStream) { | ||
var _default = function _default(tokenStream) { | ||
var _parseShadow = (0, _util.parseShadow)(tokenStream), | ||
@@ -22,2 +22,3 @@ offset = _parseShadow.offset, | ||
}; | ||
}; | ||
}; | ||
exports["default"] = _default; |
@@ -16,3 +16,3 @@ "use strict"; | ||
var defaultFlexBasis = 0; | ||
var _default = exports["default"] = function _default(tokenStream) { | ||
var _default = function _default(tokenStream) { | ||
var flexGrow; | ||
@@ -73,2 +73,3 @@ var flexShrink; | ||
}; | ||
}; | ||
}; | ||
exports["default"] = _default; |
@@ -9,3 +9,3 @@ "use strict"; | ||
var _fontFamily = _interopRequireDefault(require("./fontFamily")); | ||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var SPACE = _tokenTypes.tokens.SPACE, | ||
@@ -23,3 +23,3 @@ LENGTH = _tokenTypes.tokens.LENGTH, | ||
var defaultFontVariant = []; | ||
var _default = exports["default"] = function _default(tokenStream) { | ||
var _default = function _default(tokenStream) { | ||
var fontStyle; | ||
@@ -73,2 +73,3 @@ var fontWeight; | ||
}; | ||
}; | ||
}; | ||
exports["default"] = _default; |
@@ -11,3 +11,3 @@ "use strict"; | ||
STRING = _tokenTypes.tokens.STRING; | ||
var _default = exports["default"] = function _default(tokenStream) { | ||
var _default = function _default(tokenStream) { | ||
var fontFamily; | ||
@@ -26,2 +26,3 @@ if (tokenStream.matches(STRING)) { | ||
return fontFamily; | ||
}; | ||
}; | ||
exports["default"] = _default; |
@@ -18,3 +18,3 @@ "use strict"; | ||
var _util = require("./util"); | ||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var IDENT = _tokenTypes.tokens.IDENT, | ||
@@ -59,3 +59,3 @@ WORD = _tokenTypes.tokens.WORD, | ||
var textShadowOffset = (0, _util.shadowOffsetFactory)(); | ||
var _default = exports["default"] = { | ||
var _default = { | ||
background: background, | ||
@@ -85,2 +85,3 @@ border: _border.border, | ||
transform: _transform["default"] | ||
}; | ||
}; | ||
exports["default"] = _default; |
@@ -15,3 +15,3 @@ "use strict"; | ||
var defaultTextDecorationColor = 'black'; | ||
var _default = exports["default"] = function _default(tokenStream) { | ||
var _default = function _default(tokenStream) { | ||
var line; | ||
@@ -51,2 +51,3 @@ var style; | ||
}; | ||
}; | ||
}; | ||
exports["default"] = _default; |
@@ -10,3 +10,3 @@ "use strict"; | ||
LINE = _tokenTypes.tokens.LINE; | ||
var _default = exports["default"] = function _default(tokenStream) { | ||
var _default = function _default(tokenStream) { | ||
var lines = []; | ||
@@ -21,2 +21,3 @@ var didParseFirst = false; | ||
return lines.join(' '); | ||
}; | ||
}; | ||
exports["default"] = _default; |
@@ -8,3 +8,3 @@ "use strict"; | ||
var _util = require("./util"); | ||
var _default = exports["default"] = function _default(tokenStream) { | ||
var _default = function _default(tokenStream) { | ||
var _parseShadow = (0, _util.parseShadow)(tokenStream), | ||
@@ -21,2 +21,3 @@ offset = _parseShadow.offset, | ||
}; | ||
}; | ||
}; | ||
exports["default"] = _default; |
@@ -8,6 +8,6 @@ "use strict"; | ||
var _tokenTypes = require("../tokenTypes"); | ||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | ||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } | ||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } | ||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
var SPACE = _tokenTypes.tokens.SPACE, | ||
@@ -67,3 +67,3 @@ COMMA = _tokenTypes.tokens.COMMA, | ||
}; | ||
var _default = exports["default"] = function _default(tokenStream) { | ||
var _default = function _default(tokenStream) { | ||
var transforms = []; | ||
@@ -83,2 +83,3 @@ var didParseFirst = false; | ||
return transforms; | ||
}; | ||
}; | ||
exports["default"] = _default; |
"use strict"; | ||
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } | ||
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -9,11 +9,11 @@ value: true | ||
var _tokenTypes = require("../tokenTypes"); | ||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } | ||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } | ||
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } | ||
function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); } | ||
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | ||
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } | ||
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } | ||
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } | ||
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | ||
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | ||
function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } | ||
function _arrayWithoutHoles(r) { if (Array.isArray(r)) return _arrayLikeToArray(r); } | ||
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } | ||
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } | ||
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } | ||
var LENGTH = _tokenTypes.tokens.LENGTH, | ||
@@ -25,3 +25,3 @@ UNSUPPORTED_LENGTH_UNIT = _tokenTypes.tokens.UNSUPPORTED_LENGTH_UNIT, | ||
NONE = _tokenTypes.tokens.NONE; | ||
var directionFactory = exports.directionFactory = function directionFactory(_ref) { | ||
var directionFactory = function directionFactory(_ref) { | ||
var _ref$types = _ref.types, | ||
@@ -36,2 +36,3 @@ types = _ref$types === void 0 ? [LENGTH, UNSUPPORTED_LENGTH_UNIT, PERCENT] : _ref$types, | ||
return function (tokenStream) { | ||
var _output; | ||
var values = []; | ||
@@ -56,3 +57,3 @@ | ||
}; | ||
var output = _defineProperty(_defineProperty(_defineProperty(_defineProperty({}, keyFor(0), top), keyFor(1), right), keyFor(2), bottom), keyFor(3), left); | ||
var output = (_output = {}, _defineProperty(_output, keyFor(0), top), _defineProperty(_output, keyFor(1), right), _defineProperty(_output, keyFor(2), bottom), _defineProperty(_output, keyFor(3), left), _output); | ||
return { | ||
@@ -63,3 +64,4 @@ $merge: output | ||
}; | ||
var anyOrderFactory = exports.anyOrderFactory = function anyOrderFactory(properties) { | ||
exports.directionFactory = directionFactory; | ||
var anyOrderFactory = function anyOrderFactory(properties) { | ||
var delim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : SPACE; | ||
@@ -98,3 +100,4 @@ return function (tokenStream) { | ||
}; | ||
var shadowOffsetFactory = exports.shadowOffsetFactory = function shadowOffsetFactory() { | ||
exports.anyOrderFactory = anyOrderFactory; | ||
var shadowOffsetFactory = function shadowOffsetFactory() { | ||
return function (tokenStream) { | ||
@@ -110,3 +113,4 @@ var width = tokenStream.expect(LENGTH); | ||
}; | ||
var parseShadow = exports.parseShadow = function parseShadow(tokenStream) { | ||
exports.shadowOffsetFactory = shadowOffsetFactory; | ||
var parseShadow = function parseShadow(tokenStream) { | ||
var offsetX; | ||
@@ -168,2 +172,3 @@ var offsetY; | ||
}; | ||
}; | ||
}; | ||
exports.parseShadow = parseShadow; |
@@ -23,3 +23,3 @@ "use strict"; | ||
var _values = require("./utils/values"); | ||
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } | ||
var lengthRe = /^(0$|(?:[+-]?(?:\d*\.)?\d+(?:[Ee][+-]?\d+)?)(?=px|rem$))/; | ||
@@ -141,2 +141,3 @@ var viewportUnitRe = /^([+-]?[0-9.]+)(vh|vw|vmin|vmax)$/; | ||
}; | ||
var _default = exports["default"] = transform; | ||
var _default = transform; | ||
exports["default"] = _default; |
@@ -7,3 +7,5 @@ "use strict"; | ||
exports.mediaQueryFeatures = exports.dimensionFeatures = void 0; | ||
var dimensionFeatures = exports.dimensionFeatures = ['width', 'height', 'device-width', 'device-height']; | ||
var mediaQueryFeatures = exports.mediaQueryFeatures = ['orientation', 'scan', 'resolution', 'aspect-ratio', 'device-aspect-ratio', 'grid', 'color', 'color-index', 'monochrome'].concat(dimensionFeatures); | ||
var dimensionFeatures = ['width', 'height', 'device-width', 'device-height']; | ||
exports.dimensionFeatures = dimensionFeatures; | ||
var mediaQueryFeatures = ['orientation', 'scan', 'resolution', 'aspect-ratio', 'device-aspect-ratio', 'grid', 'color', 'color-index', 'monochrome'].concat(dimensionFeatures); | ||
exports.mediaQueryFeatures = mediaQueryFeatures; |
@@ -7,5 +7,9 @@ "use strict"; | ||
exports.reactNativeMediaQueryTypes = exports.mediaQueryTypes = exports.defaultTypes = exports.cssnextMediaQueryTypes = void 0; | ||
var defaultTypes = exports.defaultTypes = ['all', 'braille', 'embossed', 'handheld', 'print', 'projection', 'screen', 'speech', 'tty', 'tv']; | ||
var cssnextMediaQueryTypes = exports.cssnextMediaQueryTypes = ['pointer', 'hover', 'block-overflow']; | ||
var reactNativeMediaQueryTypes = exports.reactNativeMediaQueryTypes = ['android', 'dom', 'ios', 'macos', 'web', 'windows']; | ||
var mediaQueryTypes = exports.mediaQueryTypes = defaultTypes.concat(cssnextMediaQueryTypes).concat(reactNativeMediaQueryTypes); | ||
var defaultTypes = ['all', 'braille', 'embossed', 'handheld', 'print', 'projection', 'screen', 'speech', 'tty', 'tv']; | ||
exports.defaultTypes = defaultTypes; | ||
var cssnextMediaQueryTypes = ['pointer', 'hover', 'block-overflow']; | ||
exports.cssnextMediaQueryTypes = cssnextMediaQueryTypes; | ||
var reactNativeMediaQueryTypes = ['android', 'dom', 'ios', 'macos', 'web', 'windows']; | ||
exports.reactNativeMediaQueryTypes = reactNativeMediaQueryTypes; | ||
var mediaQueryTypes = defaultTypes.concat(cssnextMediaQueryTypes).concat(reactNativeMediaQueryTypes); | ||
exports.mediaQueryTypes = mediaQueryTypes; |
@@ -7,6 +7,7 @@ "use strict"; | ||
exports.remToPx = void 0; | ||
var remToPx = exports.remToPx = function remToPx(value) { | ||
var remToPx = function remToPx(value) { | ||
return value.replace(/(\d*\.?\d+)rem/g, function (match, m1) { | ||
return parseFloat(m1, 10) * 16 + 'px'; | ||
}); | ||
}; | ||
}; | ||
exports.remToPx = remToPx; |
@@ -7,6 +7,7 @@ "use strict"; | ||
exports.allEqual = void 0; | ||
var allEqual = exports.allEqual = function allEqual(arr) { | ||
var allEqual = function allEqual(arr) { | ||
return arr.every(function (v) { | ||
return v === arr[0]; | ||
}); | ||
}; | ||
}; | ||
exports.allEqual = allEqual; |
@@ -7,6 +7,7 @@ "use strict"; | ||
exports.values = void 0; | ||
var values = exports.values = function values(obj) { | ||
var values = function values(obj) { | ||
return Object.keys(obj).map(function (key) { | ||
return obj[key]; | ||
}); | ||
}; | ||
}; | ||
exports.values = values; |
{ | ||
"name": "taro-css-to-react-native", | ||
"description": "Convert CSS text to a React Native stylesheet object", | ||
"version": "4.0.1-alpha.1", | ||
"author": "O2Team", | ||
"version": "4.0.1", | ||
"main": "dist/index.js", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"dist", | ||
"src", | ||
"index.d.ts" | ||
"index.d.ts", | ||
"CHANGELOG.md", | ||
"README.md" | ||
], | ||
@@ -46,16 +46,16 @@ "repository": { | ||
}, | ||
"engines": { | ||
"node": ">= 18" | ||
}, | ||
"dependencies": { | ||
"camelize": "^1.0.1", | ||
"camelize": "^1.0.0", | ||
"css": "^3.0.0", | ||
"css-color-keywords": "^1.0.0", | ||
"css-mediaquery": "^0.1.2", | ||
"postcss-value-parser": "^4.2.0" | ||
"postcss-value-parser": "^3.3.0" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^7.14.5", | ||
"babel-jest": "^29.5.0", | ||
"jest": "^29.3.1", | ||
"jest-cli": "^29.3.1" | ||
}, | ||
"scripts": { | ||
"prod": "pnpm run build", | ||
"prebuild": "pnpm run clean", | ||
"clean": "rimraf --impl=move-remove ./dist", | ||
"build": "babel src --ignore *.spec.js --out-dir ./dist", | ||
@@ -62,0 +62,0 @@ "test": "jest" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
111742
3031
1
4
2
+ Addedpostcss-value-parser@3.3.1(transitive)
- Removedpostcss-value-parser@4.2.0(transitive)
Updatedcamelize@^1.0.0
Updatedpostcss-value-parser@^3.3.0