taro-css-to-react-native 3.6.0-canary.9 → 3.6.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2018
3
+ Copyright (c) 2018 O2Team
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -19,3 +19,121 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
19
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
20
  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
21
  SOFTWARE.
22
+
23
+ ========================================================================
24
+
25
+ MIT (react-devtools):
26
+ The following files embed [react-devtools](https://github.com/facebook/react) MIT:
27
+ `/packages/taro-plugin-react-devtools/src/backend/index.js`
28
+ See `/LICENSE` for details of the license.
29
+
30
+ ==================
31
+
32
+ MIT (vue-devtools):
33
+ The following files embed [vue-devtools](https://github.com/vuejs/devtools) MIT:
34
+ `/packages/taro-plugin-vue-devtools/src/backend/*`
35
+ See `/LICENSE` for details of the license.
36
+
37
+ ==================
38
+
39
+ MIT (vite):
40
+ The following files embed [vite](https://github.com/vitejs/vite) MIT:
41
+ `/packages/taro-webpack5-prebundle/src/prebundle/scanImport.ts`,
42
+ `/packages/taro-webpack5-prebundle/src/prebundle/bundle.ts`,
43
+ `/packages/taro-webpack5-prebundle/src/h5.ts`,
44
+ `/packages/taro-webpack5-prebundle/src/min.ts`
45
+ See `/LICENSE` for details of the license.
46
+
47
+ ==================
48
+
49
+ MIT (webpack):
50
+ The following files embed [webpack](https://github.com/webpack/webpack) MIT:
51
+ `/packages/taro-webpack5-prebundle/src/webpack/TaroContainerEntryModule.ts`,
52
+ `/packages/taro-webpack5-prebundle/src/webpack/TaroContainerPlugin.ts`,
53
+ `/packages/taro-webpack5-prebundle/src/webpack/TaroContainerReferencePlugin.ts`,
54
+ `/packages/taro-webpack5-prebundle/src/webpack/TaroModuleFederationPlugin.ts`
55
+ See `/LICENSE` for details of the license.
56
+
57
+ ==================
58
+
59
+ MIT (sizzle):
60
+ The following files embed [sizzle](https://github.com/jquery/sizzle) MIT:
61
+ `/packages/taro-extends/src/jquery/sizzle.js`
62
+ See `/LICENSE.txt` for details of the license.
63
+
64
+ ==================
65
+
66
+ MIT (zepto):
67
+ The following files embed [zepto](https://github.com/madrobby/zepto) MIT:
68
+ `/packages/taro-extends/src/jquery/zepto.js`,
69
+ `/packages/taro-extends/src/jquery/event.js`
70
+ See `/MIT-LICENSE` for details of the license.
71
+
72
+ ==================
73
+
74
+ MIT (css-to-react-native):
75
+ The following files embed [css-to-react-native](https://github.com/styled-components/css-to-react-native) MIT:
76
+ `/packages/css-to-react-native/src/css-to-react-native/*`
77
+ See `/LICENSE.md` for details of the license.
78
+
79
+ ==================
80
+
81
+ MIT (reactify-wc):
82
+ The following files embed [reactify-wc](https://github.com/BBKolton/reactify-wc) MIT:
83
+ `/packages/taro-components-library-react/src/component-lib/reactify-wc.ts`
84
+ See `/LICENSE` for details of the license.
85
+
86
+ ==================
87
+
88
+ MIT (ant-design-mobile-rn):
89
+ The following files embed [ant-design-mobile-rn](https://github.com/ant-design/ant-design-mobile-rn) MIT:
90
+ `/packages/taro-components-rn/src/components/Swiper/carousel.tsx`
91
+ See `/LICENSE` for details of the license.
92
+
93
+ ==================
94
+
95
+ MIT (react-wx-images-viewer):
96
+ The following files embed [react-wx-images-viewer](https://github.com/react-ld/react-wx-images-viewer) MIT:
97
+ `/packages/taro-h5/src/api/media/image/previewImage.ts`
98
+ See `/LICENSE` for details of the license.
99
+
100
+ ==================
101
+
102
+ MIT (webpack-contrib/css-loader):
103
+ The following files embed [webpack-contrib/css-loader](https://github.com/webpack-contrib/css-loader) MIT:
104
+ `/packages/taro-rn-style-transformer/src/utils/index.ts`
105
+ See `/LICENSE` for details of the license.
106
+
107
+ ==================
108
+
109
+ MIT (react-native):
110
+ The following files embed [react-native](https://github.com/facebook/react-native) MIT:
111
+ `/packages/taro-rn-style-transformer/src/transforms/StyleSheet/*`
112
+ See `/LICENSE` for details of the license.
113
+
114
+ ==================
115
+
116
+ MIT (myrne/performance-now):
117
+ The following files embed [myrne/performance-now](https://github.com/myrne/performance-now) MIT:
118
+ `/packages/taro-runtime/src/bom/raf.ts`
119
+ See `/LICENSE` for details of the license.
120
+
121
+ ==================
122
+
123
+ Apache (chameleon-api):
124
+ The following files embed [chameleon-api](https://github.com/chameleon-team/chameleon-api) Apache:
125
+ `/packages/taro-h5/src/api/device/clipboard.ts`
126
+
127
+ ==================
128
+
129
+ MIT (uni-app):
130
+ The following files embed [uni-app](https://github.com/dcloudio/uni-app) MIT:
131
+ `/packages/taro-components-rn/src/components/Video/index.tsx`
132
+ See `/LICENSE` for details of the license.
133
+
134
+ ==================
135
+
136
+ MIT (miniprogram-render):
137
+ The following files embed [miniprogram-render](https://github.com/Tencent/kbone) MIT:
138
+ `/packages/taro-plugin-http/src/runtime/Cookie.ts`
139
+ See `/LICENSE` for details of the license.
@@ -4,22 +4,26 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
- 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); }
7
+
8
8
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
- 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); } }
9
+
10
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
11
+
10
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
11
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
- 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); }
13
+
13
14
  var SYMBOL_MATCH = 'SYMBOL_MATCH';
15
+
14
16
  var TokenStream = /*#__PURE__*/function () {
15
17
  function TokenStream(nodes, parent) {
16
18
  _classCallCheck(this, TokenStream);
19
+
17
20
  this.index = 0;
18
21
  this.nodes = nodes;
19
22
  this.functionName = parent != null ? parent.value : null;
20
23
  this.lastValue = null;
21
24
  this.rewindIndex = -1;
22
25
  }
26
+
23
27
  _createClass(TokenStream, [{
24
28
  key: "node",
25
29
  get: function get() {
@@ -40,15 +44,18 @@ var TokenStream = /*#__PURE__*/function () {
40
44
  value: function value() {
41
45
  if (!this.hasTokens()) return null;
42
46
  var node = this.node;
47
+
43
48
  for (var i = 0; i < arguments.length; i += 1) {
44
49
  var tokenDescriptor = i < 0 || arguments.length <= i ? undefined : arguments[i];
45
50
  var value = tokenDescriptor(node);
51
+
46
52
  if (value !== null) {
47
53
  this.index += 1;
48
54
  this.lastValue = value;
49
55
  return value;
50
56
  }
51
57
  }
58
+
52
59
  return null;
53
60
  }
54
61
  }, {
@@ -87,6 +94,7 @@ var TokenStream = /*#__PURE__*/function () {
87
94
  key: "throw",
88
95
  value: function _throw() {
89
96
  var _this$node;
97
+
90
98
  throw new Error("Unexpected token type: ".concat((_this$node = this.node) === null || _this$node === void 0 ? void 0 : _this$node.type));
91
99
  }
92
100
  }, {
@@ -102,6 +110,8 @@ var TokenStream = /*#__PURE__*/function () {
102
110
  this.lastValue = null;
103
111
  }
104
112
  }]);
113
+
105
114
  return TokenStream;
106
115
  }();
116
+
107
117
  exports["default"] = TokenStream;
@@ -4,29 +4,34 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.transformRawValue = exports.getStylesForProperty = exports.getPropertyName = exports["default"] = void 0;
7
+
7
8
  var _camelize = _interopRequireDefault(require("camelize"));
9
+
8
10
  var _postcssValueParser = _interopRequireDefault(require("postcss-value-parser"));
11
+
9
12
  var _TokenStream = _interopRequireDefault(require("./TokenStream"));
13
+
10
14
  var _index = _interopRequireDefault(require("./transforms/index"));
15
+
11
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
12
- 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); }
13
- 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; }
14
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
15
- 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); }
17
+
18
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
+
16
20
  // Note if this is wrong, you'll need to change tokenTypes.js too
17
21
  var numberOrLengthRe = /^([+-]?(?:\d*\.)?\d+(?:[Ee][+-]?\d+)?)((?:px)|(?:vw$)|(?:vh$)|(?:vmin$)|(?:vmax$))?$/i;
18
22
  var boolRe = /^true|false$/i;
19
23
  var nullRe = /^null$/i;
20
- var undefinedRe = /^undefined$/i;
24
+ var undefinedRe = /^undefined$/i; // Undocumented export
21
25
 
22
- // Undocumented export
23
26
  var transformRawValue = function transformRawValue(input) {
24
27
  var value = input.trim();
25
28
  var numberMatch = value.match(numberOrLengthRe);
29
+
26
30
  if (numberMatch !== null) {
27
31
  var num = Number(numberMatch[1]);
28
32
  var unit = numberMatch[2];
29
33
  var isViewportUnit = ['vw', 'vh', 'vmin', 'vmax'].includes(unit);
34
+
30
35
  if (isViewportUnit) {
31
36
  return "scaleVu2dp(".concat(num, ", '").concat(unit, "')");
32
37
  } else if (/(\d+)px/.test(value)) {
@@ -35,6 +40,7 @@ var transformRawValue = function transformRawValue(input) {
35
40
  return num;
36
41
  }
37
42
  }
43
+
38
44
  var boolMatch = input.match(boolRe);
39
45
  if (boolMatch !== null) return boolMatch[0].toLowerCase() === 'true';
40
46
  var nullMatch = input.match(nullRe);
@@ -43,13 +49,16 @@ var transformRawValue = function transformRawValue(input) {
43
49
  if (undefinedMatch !== null) return undefined;
44
50
  return value;
45
51
  };
52
+
46
53
  exports.transformRawValue = transformRawValue;
54
+
47
55
  var baseTransformShorthandValue = function baseTransformShorthandValue(propName, inputValue) {
48
56
  // const ast = parse(inputValue.trim().replace(/PX|Px|pX$/g, ""));
49
57
  var ast = (0, _postcssValueParser["default"])(inputValue);
50
58
  var tokenStream = new _TokenStream["default"](ast.nodes);
51
59
  return _index["default"][propName](tokenStream);
52
60
  };
61
+
53
62
  var checkBaseTransformShorthandValue = function checkBaseTransformShorthandValue(propName, inputValue) {
54
63
  try {
55
64
  return baseTransformShorthandValue(propName, inputValue);
@@ -57,21 +66,29 @@ var checkBaseTransformShorthandValue = function checkBaseTransformShorthandValue
57
66
  throw new Error("".concat(e.message, " Failed to parse declaration \"").concat(propName, ": ").concat(inputValue, "\""));
58
67
  }
59
68
  };
69
+
60
70
  var transformShorthandValue = process.env.NODE_ENV === 'production' ? baseTransformShorthandValue : checkBaseTransformShorthandValue;
71
+
61
72
  var getStylesForProperty = function getStylesForProperty(propName, inputValue, allowShorthand) {
62
73
  var isRawValue = allowShorthand === false || !(propName in _index["default"]);
63
74
  var propValue = isRawValue ? transformRawValue(inputValue) : transformShorthandValue(propName, inputValue.trim());
64
75
  return propValue && propValue.$merge ? propValue.$merge : _defineProperty({}, propName, propValue);
65
76
  };
77
+
66
78
  exports.getStylesForProperty = getStylesForProperty;
79
+
67
80
  var getPropertyName = function getPropertyName(propName) {
68
81
  var isCustomProp = /^--\w+/.test(propName);
82
+
69
83
  if (isCustomProp) {
70
84
  return propName;
71
85
  }
86
+
72
87
  return (0, _camelize["default"])(propName);
73
88
  };
89
+
74
90
  exports.getPropertyName = getPropertyName;
91
+
75
92
  var _default = function _default(rules) {
76
93
  var shorthandBlacklist = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
77
94
  return rules.reduce(function (accum, rule) {
@@ -81,4 +98,5 @@ var _default = function _default(rules) {
81
98
  return Object.assign(accum, getStylesForProperty(propertyName, value, allowShorthand));
82
99
  }, {});
83
100
  };
101
+
84
102
  exports["default"] = _default;
@@ -4,48 +4,58 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.tokens = exports.regExpToken = void 0;
7
+
7
8
  var _cssColorKeywords = _interopRequireDefault(require("css-color-keywords"));
9
+
8
10
  var _postcssValueParser = require("postcss-value-parser");
11
+
9
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
10
- /* eslint-disable react/display-name */
11
13
 
14
+ /* eslint-disable react/display-name */
12
15
  var matchString = function matchString(node) {
13
16
  if (node.type !== 'string') return null;
14
17
  return node.value.replace(/\\([0-9a-f]{1,6})(?:\s|$)/gi, function (match, charCode) {
15
18
  return String.fromCharCode(parseInt(charCode, 16));
16
19
  }).replace(/\\/g, '');
17
20
  };
21
+
18
22
  var hexColorRe = /^(#(?:[0-9a-f]{3,4}){1,2})$/i;
19
23
  var cssFunctionNameRe = /^(rgba?|hsla?|hwb|lab|lch|gray|color)$/;
24
+
20
25
  var matchColor = function matchColor(node) {
21
26
  if (node.type === 'word' && (hexColorRe.test(node.value) || node.value in _cssColorKeywords["default"] || node.value === 'transparent')) {
22
27
  return node.value;
23
28
  } else if (node.type === 'function' && cssFunctionNameRe.test(node.value)) {
24
29
  return (0, _postcssValueParser.stringify)(node);
25
30
  }
31
+
26
32
  return null;
27
33
  };
34
+
28
35
  var noneRe = /^(none)$/i;
29
36
  var autoRe = /^(auto)$/i;
30
- var identRe = /(^-?[_a-z][_a-z0-9-]*$)/i;
31
- // Note if these are wrong, you'll need to change index.js too
32
- var numberRe = /^([+-]?(?:\d*\.)?\d+(?:[Ee][+-]?\d+)?)$/;
33
- // Note lengthRe is sneaky: you can omit units for 0
37
+ var identRe = /(^-?[_a-z][_a-z0-9-]*$)/i; // Note if these are wrong, you'll need to change index.js too
38
+
39
+ var numberRe = /^([+-]?(?:\d*\.)?\d+(?:[Ee][+-]?\d+)?)$/; // Note lengthRe is sneaky: you can omit units for 0
40
+
34
41
  var lengthRe = /^(0$|(?:[+-]?(?:\d*\.)?\d+(?:[Ee][+-]?\d+)?)((?=px$)|(?=Px$)|(?=PX$)|(?=pX$)|(?=vw$)|(?=vh$)|(?=vmin$)|(?=vmax$)))/;
35
42
  var unsupportedUnitRe = /^([+-]?(?:\d*\.)?\d+(?:[Ee][+-]?\d+)?(ch|em|ex|rem|cm|mm|in|pc|pt))$/;
36
43
  var angleRe = /^([+-]?(?:\d*\.)?\d+(?:[Ee][+-]?\d+)?(?:deg|rad))$/;
37
44
  var percentRe = /^([+-]?(?:\d*\.)?\d+(?:[Ee][+-]?\d+)?%)$/;
38
45
  var viewportUnitRe = /(\d+)(vw|vh|vmin|vmax)/;
46
+
39
47
  var noopToken = function noopToken(predicate) {
40
48
  return function (node) {
41
49
  return predicate(node) ? '<token>' : null;
42
50
  };
43
51
  };
52
+
44
53
  var valueForTypeToken = function valueForTypeToken(type) {
45
54
  return function (node) {
46
55
  return node.type === type ? node.value : null;
47
56
  };
48
57
  };
58
+
49
59
  var functionValueForTypeToken = function functionValueForTypeToken(type) {
50
60
  return function (node) {
51
61
  if (node.type === type) {
@@ -59,19 +69,23 @@ var functionValueForTypeToken = function functionValueForTypeToken(type) {
59
69
  return "".concat(node.value, "(").concat(result.join(', '), ")");
60
70
  }
61
71
  }
72
+
62
73
  return null;
63
74
  };
64
75
  };
76
+
65
77
  var regExpToken = function regExpToken(regExp) {
66
78
  var transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : String;
67
79
  return function (node) {
68
80
  var _node$value$match;
81
+
69
82
  if (node.type !== 'word') return null;
70
83
  var match = node.value.match(regExp);
71
84
  if (match === null) return null;
72
85
  var value = transform(match[1]);
73
86
  var unit = (_node$value$match = node.value.match(viewportUnitRe)) === null || _node$value$match === void 0 ? void 0 : _node$value$match[2];
74
87
  var isViewportUnit = ['vh', 'vw', 'vmin', 'vmax'].includes(unit);
88
+
75
89
  if (isViewportUnit) {
76
90
  return "scaleVu2dp(".concat(value, ", '").concat(unit, "')");
77
91
  } else if (/(\d+)px/.test(node.value)) {
@@ -81,6 +95,7 @@ var regExpToken = function regExpToken(regExp) {
81
95
  }
82
96
  };
83
97
  };
98
+
84
99
  exports.regExpToken = regExpToken;
85
100
  var tokens = {
86
101
  SPACE: noopToken(function (node) {
@@ -4,19 +4,22 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.borderWidth = exports.borderTop = exports.borderRight = exports.borderRadius = exports.borderLeft = exports.borderColor = exports.borderBottom = exports.border = void 0;
7
+
7
8
  var _tokenTypes = require("../tokenTypes");
9
+
8
10
  var _util = require("./util");
9
- 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); }
10
- 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; }
11
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
12
- 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); }
11
+
12
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
+
13
14
  var WORD = _tokenTypes.tokens.WORD,
14
- FUNC = _tokenTypes.tokens.FUNC,
15
- COLOR = _tokenTypes.tokens.COLOR,
16
- LENGTH = _tokenTypes.tokens.LENGTH,
17
- UNSUPPORTED_LENGTH_UNIT = _tokenTypes.tokens.UNSUPPORTED_LENGTH_UNIT;
15
+ FUNC = _tokenTypes.tokens.FUNC,
16
+ COLOR = _tokenTypes.tokens.COLOR,
17
+ LENGTH = _tokenTypes.tokens.LENGTH,
18
+ UNSUPPORTED_LENGTH_UNIT = _tokenTypes.tokens.UNSUPPORTED_LENGTH_UNIT;
19
+
18
20
  function borderDirectionFactory() {
19
21
  var _anyOrderFactory;
22
+
20
23
  var direction = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
21
24
  var prefix = "border".concat(direction);
22
25
  return (0, _util.anyOrderFactory)((_anyOrderFactory = {}, _defineProperty(_anyOrderFactory, "".concat(prefix, "Width"), {
@@ -30,6 +33,7 @@ function borderDirectionFactory() {
30
33
  "default": 'solid'
31
34
  }), _anyOrderFactory));
32
35
  }
36
+
33
37
  var border = borderDirectionFactory();
34
38
  exports.border = border;
35
39
  var borderTop = borderDirectionFactory('Top');
@@ -4,12 +4,15 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+
7
8
  var _util = require("./util");
9
+
8
10
  var _default = function _default(tokenStream) {
9
11
  var _parseShadow = (0, _util.parseShadow)(tokenStream),
10
- offset = _parseShadow.offset,
11
- radius = _parseShadow.radius,
12
- color = _parseShadow.color;
12
+ offset = _parseShadow.offset,
13
+ radius = _parseShadow.radius,
14
+ color = _parseShadow.color;
15
+
13
16
  return {
14
17
  $merge: {
15
18
  shadowOffset: offset,
@@ -19,4 +22,5 @@ var _default = function _default(tokenStream) {
19
22
  }
20
23
  };
21
24
  };
25
+
22
26
  exports["default"] = _default;
@@ -4,19 +4,23 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+
7
8
  var _tokenTypes = require("../tokenTypes");
9
+
8
10
  var NONE = _tokenTypes.tokens.NONE,
9
- AUTO = _tokenTypes.tokens.AUTO,
10
- NUMBER = _tokenTypes.tokens.NUMBER,
11
- LENGTH = _tokenTypes.tokens.LENGTH,
12
- SPACE = _tokenTypes.tokens.SPACE;
11
+ AUTO = _tokenTypes.tokens.AUTO,
12
+ NUMBER = _tokenTypes.tokens.NUMBER,
13
+ LENGTH = _tokenTypes.tokens.LENGTH,
14
+ SPACE = _tokenTypes.tokens.SPACE;
13
15
  var defaultFlexGrow = 1;
14
16
  var defaultFlexShrink = 1;
15
17
  var defaultFlexBasis = 0;
18
+
16
19
  var _default = function _default(tokenStream) {
17
20
  var flexGrow;
18
21
  var flexShrink;
19
22
  var flexBasis;
23
+
20
24
  if (tokenStream.matches(NONE)) {
21
25
  tokenStream.expectEmpty();
22
26
  return {
@@ -27,7 +31,9 @@ var _default = function _default(tokenStream) {
27
31
  }
28
32
  };
29
33
  }
34
+
30
35
  tokenStream.saveRewindPoint();
36
+
31
37
  if (tokenStream.matches(AUTO) && !tokenStream.hasTokens()) {
32
38
  return {
33
39
  $merge: {
@@ -37,13 +43,17 @@ var _default = function _default(tokenStream) {
37
43
  }
38
44
  };
39
45
  }
46
+
40
47
  tokenStream.rewind();
41
48
  var partsParsed = 0;
49
+
42
50
  while (partsParsed < 2 && tokenStream.hasTokens()) {
43
51
  if (partsParsed !== 0) tokenStream.expect(SPACE);
52
+
44
53
  if (typeof flexGrow === 'undefined' && tokenStream.matches(NUMBER)) {
45
54
  flexGrow = tokenStream.lastValue;
46
55
  tokenStream.saveRewindPoint();
56
+
47
57
  if (tokenStream.matches(SPACE) && tokenStream.matches(NUMBER)) {
48
58
  flexShrink = tokenStream.lastValue;
49
59
  } else {
@@ -56,8 +66,10 @@ var _default = function _default(tokenStream) {
56
66
  } else {
57
67
  tokenStream["throw"]();
58
68
  }
69
+
59
70
  partsParsed += 1;
60
71
  }
72
+
61
73
  tokenStream.expectEmpty();
62
74
  if (typeof flexGrow === 'undefined') flexGrow = defaultFlexGrow;
63
75
  if (typeof flexShrink === 'undefined') flexShrink = defaultFlexShrink;
@@ -70,4 +82,5 @@ var _default = function _default(tokenStream) {
70
82
  }
71
83
  };
72
84
  };
85
+
73
86
  exports["default"] = _default;
@@ -4,14 +4,18 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+
7
8
  var _tokenTypes = require("../tokenTypes");
9
+
8
10
  var _fontFamily = _interopRequireDefault(require("./fontFamily"));
11
+
9
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
+
10
14
  var SPACE = _tokenTypes.tokens.SPACE,
11
- LENGTH = _tokenTypes.tokens.LENGTH,
12
- UNSUPPORTED_LENGTH_UNIT = _tokenTypes.tokens.UNSUPPORTED_LENGTH_UNIT,
13
- NUMBER = _tokenTypes.tokens.NUMBER,
14
- SLASH = _tokenTypes.tokens.SLASH;
15
+ LENGTH = _tokenTypes.tokens.LENGTH,
16
+ UNSUPPORTED_LENGTH_UNIT = _tokenTypes.tokens.UNSUPPORTED_LENGTH_UNIT,
17
+ NUMBER = _tokenTypes.tokens.NUMBER,
18
+ SLASH = _tokenTypes.tokens.SLASH;
15
19
  var NORMAL = (0, _tokenTypes.regExpToken)(/^(normal)$/);
16
20
  var STYLE = (0, _tokenTypes.regExpToken)(/^(italic)$/);
17
21
  var WEIGHT = (0, _tokenTypes.regExpToken)(/^([1-9]00|bold)$/);
@@ -19,15 +23,16 @@ var VARIANT = (0, _tokenTypes.regExpToken)(/^(small-caps)$/);
19
23
  var defaultFontStyle = 'normal';
20
24
  var defaultFontWeight = 'normal';
21
25
  var defaultFontVariant = [];
26
+
22
27
  var _default = function _default(tokenStream) {
23
28
  var fontStyle;
24
29
  var fontWeight;
25
- var fontVariant;
26
- // let fontSize;
27
- var lineHeight;
28
- // let fontFamily;
30
+ var fontVariant; // let fontSize;
31
+
32
+ var lineHeight; // let fontFamily;
29
33
 
30
34
  var numStyleWeightVariantMatched = 0;
35
+
31
36
  while (numStyleWeightVariantMatched < 3 && tokenStream.hasTokens()) {
32
37
  if (tokenStream.matches(NORMAL)) {
33
38
  /* pass */
@@ -40,10 +45,13 @@ var _default = function _default(tokenStream) {
40
45
  } else {
41
46
  break;
42
47
  }
48
+
43
49
  tokenStream.expect(SPACE);
44
50
  numStyleWeightVariantMatched += 1;
45
51
  }
52
+
46
53
  var fontSize = tokenStream.expect(LENGTH, UNSUPPORTED_LENGTH_UNIT);
54
+
47
55
  if (tokenStream.matches(SLASH)) {
48
56
  if (tokenStream.matches(NUMBER)) {
49
57
  var size = typeof fontSize === 'string' ? fontSize.replace(/scalePx2dp\((\d+)\)/, '$1') : fontSize;
@@ -52,6 +60,7 @@ var _default = function _default(tokenStream) {
52
60
  lineHeight = tokenStream.expect(LENGTH, UNSUPPORTED_LENGTH_UNIT);
53
61
  }
54
62
  }
63
+
55
64
  tokenStream.expect(SPACE);
56
65
  var fontFamily = (0, _fontFamily["default"])(tokenStream);
57
66
  if (typeof fontStyle === 'undefined') fontStyle = defaultFontStyle;
@@ -69,4 +78,5 @@ var _default = function _default(tokenStream) {
69
78
  $merge: out
70
79
  };
71
80
  };
81
+
72
82
  exports["default"] = _default;
@@ -4,23 +4,30 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports["default"] = void 0;
7
+
7
8
  var _tokenTypes = require("../tokenTypes");
9
+
8
10
  var SPACE = _tokenTypes.tokens.SPACE,
9
- IDENT = _tokenTypes.tokens.IDENT,
10
- STRING = _tokenTypes.tokens.STRING;
11
+ IDENT = _tokenTypes.tokens.IDENT,
12
+ STRING = _tokenTypes.tokens.STRING;
13
+
11
14
  var _default = function _default(tokenStream) {
12
15
  var fontFamily;
16
+
13
17
  if (tokenStream.matches(STRING)) {
14
18
  fontFamily = tokenStream.lastValue;
15
19
  } else {
16
20
  fontFamily = tokenStream.expect(IDENT);
21
+
17
22
  while (tokenStream.hasTokens()) {
18
23
  tokenStream.expect(SPACE);
19
24
  var nextIdent = tokenStream.expect(IDENT);
20
25
  fontFamily += " ".concat(nextIdent);
21
26
  }
22
27
  }
28
+
23
29
  tokenStream.expectEmpty();
24
30
  return fontFamily;
25
31
  };
32
+
26
33
  exports["default"] = _default;