@cloudflare/style-container 7.8.46 → 7.11.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/lib/applyTheme.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3
+ 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); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.InvalidComponentError = exports.default = void 0;
8
+ exports.default = exports.InvalidComponentError = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -17,15 +17,13 @@ var _reactDisplayName = _interopRequireDefault(require("react-display-name"));
17
17
 
18
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
19
 
20
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
20
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
21
21
 
22
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
22
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
23
 
24
24
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
25
25
 
26
- function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
27
-
28
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
26
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
29
27
 
30
28
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
31
29
 
@@ -33,17 +31,21 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
33
31
 
34
32
  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); } }
35
33
 
36
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
34
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
37
35
 
38
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
36
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
39
37
 
40
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
38
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
41
39
 
42
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
40
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
43
41
 
44
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
42
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
45
43
 
46
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
44
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
45
+
46
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
47
+
48
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
47
49
 
48
50
  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; }
49
51
 
@@ -59,10 +61,12 @@ function applyTheme(ComponentToWrap) {
59
61
  var ThemedComponent = /*#__PURE__*/function (_Component) {
60
62
  _inherits(ThemedComponent, _Component);
61
63
 
64
+ var _super = _createSuper(ThemedComponent);
65
+
62
66
  function ThemedComponent() {
63
67
  _classCallCheck(this, ThemedComponent);
64
68
 
65
- return _possibleConstructorReturn(this, _getPrototypeOf(ThemedComponent).apply(this, arguments));
69
+ return _super.apply(this, arguments);
66
70
  }
67
71
 
68
72
  _createClass(ThemedComponent, [{
@@ -90,20 +94,19 @@ exports.default = _default;
90
94
  var InvalidComponentError = /*#__PURE__*/function (_Error) {
91
95
  _inherits(InvalidComponentError, _Error);
92
96
 
97
+ var _super2 = _createSuper(InvalidComponentError);
98
+
93
99
  function InvalidComponentError(component) {
94
100
  var _this;
95
101
 
96
102
  _classCallCheck(this, InvalidComponentError);
97
103
 
98
- _this = _possibleConstructorReturn(this, _getPrototypeOf(InvalidComponentError).call(this, "applyTheme received an invalid first argument: ".concat(component)));
99
-
100
- _defineProperty(_assertThisInitialized(_assertThisInitialized(_this)), "component", void 0);
101
-
104
+ _this = _super2.call(this, "applyTheme received an invalid first argument: ".concat(component));
102
105
  _this.component = component;
103
106
  return _this;
104
107
  }
105
108
 
106
- return InvalidComponentError;
107
- }(_wrapNativeSuper(Error));
109
+ return _createClass(InvalidComponentError);
110
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
108
111
 
109
112
  exports.InvalidComponentError = InvalidComponentError;
@@ -19,11 +19,9 @@ var EMPTY_PASSTHROUGH_PROPS = []; // the order of these overloads is important t
19
19
  // correctly resolve to the right function signature
20
20
 
21
21
  function createComponent(rule, base, passthroughProps) {
22
- var _base2, _passthroughProps;
22
+ var _base = base !== null && base !== void 0 ? base : 'div';
23
23
 
24
- var _base = (_base2 = base) !== null && _base2 !== void 0 ? _base2 : 'div';
25
-
26
- var Component = (0, _reactFela.createComponent)(rule, _base, (_passthroughProps = passthroughProps) !== null && _passthroughProps !== void 0 ? _passthroughProps : _base._isFelaComponent ? // fela merges the passthrough props of nested style components,
24
+ var Component = (0, _reactFela.createComponent)(rule, _base, passthroughProps !== null && passthroughProps !== void 0 ? passthroughProps : _base._isFelaComponent ? // fela merges the passthrough props of nested style components,
27
25
  // so if we're wrapping another style component we want to defer
28
26
  // determining passthrough props to a leaf-level component
29
27
  EMPTY_PASSTHROUGH_PROPS : typeof _base !== 'string' ? // A plain React component
@@ -3,8 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ exports.default = exports.colorProps = exports.borderWidthProps = exports.borderStyleProps = exports.borderRadiusProps = void 0;
6
7
  exports.filterStyleProps = filterStyleProps;
7
- exports.borderRadiusProps = exports.borderWidthProps = exports.borderStyleProps = exports.sizeProps = exports.spacingProps = exports.colorProps = exports.default = exports.styleRuleProps = void 0;
8
+ exports.styleRuleProps = exports.spacingProps = exports.sizeProps = void 0;
8
9
 
9
10
  var _reactDisplayName = _interopRequireDefault(require("react-display-name"));
10
11
 
@@ -20,9 +21,13 @@ var _types = require("./types");
20
21
 
21
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
22
23
 
23
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
24
+ 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); }
24
25
 
25
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
26
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
27
+
28
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
29
+
30
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
26
31
 
27
32
  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; }
28
33
 
@@ -59,7 +64,7 @@ var shorthandSpacingProps = {
59
64
  px: ['paddingLeft', 'paddingRight'],
60
65
  py: ['paddingTop', 'paddingBottom']
61
66
  };
62
- var spacingProps = longhandSpacingProps.concat(_toConsumableArray((0, _types.objectKeys)(shorthandSpacingProps)));
67
+ var spacingProps = [].concat(longhandSpacingProps, _toConsumableArray((0, _types.objectKeys)(shorthandSpacingProps)));
63
68
  exports.spacingProps = spacingProps;
64
69
  var sizeProps = ['width', 'height', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight'];
65
70
  exports.sizeProps = sizeProps;
@@ -72,9 +77,7 @@ exports.borderWidthProps = borderWidthProps;
72
77
  var borderRadiusProps = ['borderRadius', 'borderTopLeftRadius', 'borderTopRightRadius', 'borderBottomLeftRadius', 'borderbottomRightRadius'];
73
78
  exports.borderRadiusProps = borderRadiusProps;
74
79
  var additionalProps = ['fontSize', 'fontWeight', 'textAlign', 'display', 'width', 'verticalAlign', 'alignItems', 'alignSelf', 'justifyContent', 'textDecoration', 'textTransform', 'boxSizing', 'cursor', 'flexDirection', 'flexBasis', 'flexGrow'];
75
-
76
- var styleRuleProps = _toConsumableArray(spacingProps).concat(sizeProps, colorProps, borderStyleProps, borderWidthProps, borderRadiusProps, additionalProps);
77
-
80
+ var styleRuleProps = [].concat(_toConsumableArray(spacingProps), sizeProps, colorProps, borderStyleProps, borderWidthProps, borderRadiusProps, additionalProps);
78
81
  exports.styleRuleProps = styleRuleProps;
79
82
  var stylesRulePropsSet = new Set(styleRuleProps); // Function to remove styling attributes from a Props object
80
83
 
@@ -103,42 +106,28 @@ var makePropTypes = function makePropTypes() {
103
106
  verticalAlign: sizePropType
104
107
  };
105
108
 
106
- var _arr = _toConsumableArray(spacingProps).concat(borderWidthProps, borderRadiusProps);
107
-
108
- for (var _i = 0; _i < _arr.length; _i++) {
109
+ for (var _i = 0, _arr = [].concat(_toConsumableArray(spacingProps), borderWidthProps, borderRadiusProps); _i < _arr.length; _i++) {
109
110
  var prop = _arr[_i];
110
111
  propTypes[prop] = scalePropType;
111
112
  }
112
113
 
113
- var _arr2 = colorProps.concat(borderStyleProps);
114
-
115
- for (var _i2 = 0; _i2 < _arr2.length; _i2++) {
114
+ for (var _i2 = 0, _arr2 = [].concat(colorProps, borderStyleProps); _i2 < _arr2.length; _i2++) {
116
115
  var _prop = _arr2[_i2];
117
116
  propTypes[_prop] = _propTypes.default.string;
118
117
  }
119
118
 
120
- var _iteratorNormalCompletion = true;
121
- var _didIteratorError = false;
122
- var _iteratorError = undefined;
119
+ var _iterator = _createForOfIteratorHelper(sizeProps),
120
+ _step;
123
121
 
124
122
  try {
125
- for (var _iterator = sizeProps[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
123
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
126
124
  var _prop2 = _step.value;
127
125
  propTypes[_prop2] = sizePropType;
128
126
  }
129
127
  } catch (err) {
130
- _didIteratorError = true;
131
- _iteratorError = err;
128
+ _iterator.e(err);
132
129
  } finally {
133
- try {
134
- if (!_iteratorNormalCompletion && _iterator.return != null) {
135
- _iterator.return();
136
- }
137
- } finally {
138
- if (_didIteratorError) {
139
- throw _iteratorError;
140
- }
141
- }
130
+ _iterator.f();
142
131
  }
143
132
 
144
133
  return propTypes;
@@ -275,9 +264,7 @@ var emptyRule = function emptyRule() {
275
264
  };
276
265
 
277
266
  var makeStyledRule = function makeStyledRule(rule) {
278
- var _rule;
279
-
280
- var combinedRules = (0, _fela.combineRules)((_rule = rule) !== null && _rule !== void 0 ? _rule : emptyRule, propsRule);
267
+ var combinedRules = (0, _fela.combineRules)(rule !== null && rule !== void 0 ? rule : emptyRule, propsRule);
281
268
  return function (props, renderer) {
282
269
  return processRules(combinedRules(props, renderer));
283
270
  };
package/lib/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3
+ 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); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -22,10 +22,10 @@ var _exportNames = {
22
22
  isValidElementProp: true,
23
23
  filterValidElementProps: true
24
24
  };
25
- Object.defineProperty(exports, "combineRules", {
25
+ Object.defineProperty(exports, "FelaTheme", {
26
26
  enumerable: true,
27
27
  get: function get() {
28
- return _fela.combineRules;
28
+ return _reactFela.FelaTheme;
29
29
  }
30
30
  });
31
31
  Object.defineProperty(exports, "ThemeProvider", {
@@ -34,28 +34,34 @@ Object.defineProperty(exports, "ThemeProvider", {
34
34
  return _reactFela.ThemeProvider;
35
35
  }
36
36
  });
37
- Object.defineProperty(exports, "connect", {
37
+ Object.defineProperty(exports, "applyStaticStyles", {
38
38
  enumerable: true,
39
39
  get: function get() {
40
- return _reactFela.connect;
40
+ return _applyStaticStyles.default;
41
41
  }
42
42
  });
43
- Object.defineProperty(exports, "FelaTheme", {
43
+ Object.defineProperty(exports, "applyTheme", {
44
44
  enumerable: true,
45
45
  get: function get() {
46
- return _reactFela.FelaTheme;
46
+ return _applyTheme.default;
47
47
  }
48
48
  });
49
- Object.defineProperty(exports, "applyStaticStyles", {
49
+ Object.defineProperty(exports, "ariaAttributes", {
50
50
  enumerable: true,
51
51
  get: function get() {
52
- return _applyStaticStyles.default;
52
+ return _isValidElementProp.ariaAttributes;
53
53
  }
54
54
  });
55
- Object.defineProperty(exports, "applyTheme", {
55
+ Object.defineProperty(exports, "combineRules", {
56
56
  enumerable: true,
57
57
  get: function get() {
58
- return _applyTheme.default;
58
+ return _fela.combineRules;
59
+ }
60
+ });
61
+ Object.defineProperty(exports, "connect", {
62
+ enumerable: true,
63
+ get: function get() {
64
+ return _reactFela.connect;
59
65
  }
60
66
  });
61
67
  Object.defineProperty(exports, "createComponent", {
@@ -82,16 +88,10 @@ Object.defineProperty(exports, "filterStyleProps", {
82
88
  return _createStyledComponent.filterStyleProps;
83
89
  }
84
90
  });
85
- Object.defineProperty(exports, "withRenderer", {
86
- enumerable: true,
87
- get: function get() {
88
- return _withRenderer.default;
89
- }
90
- });
91
- Object.defineProperty(exports, "ariaAttributes", {
91
+ Object.defineProperty(exports, "filterValidElementProps", {
92
92
  enumerable: true,
93
93
  get: function get() {
94
- return _isValidElementProp.ariaAttributes;
94
+ return _isValidElementProp.filterValidElementProps;
95
95
  }
96
96
  });
97
97
  Object.defineProperty(exports, "isValidElementProp", {
@@ -100,10 +100,10 @@ Object.defineProperty(exports, "isValidElementProp", {
100
100
  return _isValidElementProp.isValidElementProp;
101
101
  }
102
102
  });
103
- Object.defineProperty(exports, "filterValidElementProps", {
103
+ Object.defineProperty(exports, "withRenderer", {
104
104
  enumerable: true,
105
105
  get: function get() {
106
- return _isValidElementProp.filterValidElementProps;
106
+ return _withRenderer.default;
107
107
  }
108
108
  });
109
109
  exports.withTheme = void 0;
@@ -131,6 +131,7 @@ var _types = require("./types");
131
131
  Object.keys(_types).forEach(function (key) {
132
132
  if (key === "default" || key === "__esModule") return;
133
133
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
134
+ if (key in exports && exports[key] === _types[key]) return;
134
135
  Object.defineProperty(exports, key, {
135
136
  enumerable: true,
136
137
  get: function get() {
@@ -139,9 +140,9 @@ Object.keys(_types).forEach(function (key) {
139
140
  });
140
141
  });
141
142
 
142
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
143
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
143
144
 
144
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
145
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
145
146
 
146
147
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
147
148
 
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = exports.filterValidElementProps = exports.isValidElementProp = exports.ariaAttributes = void 0;
6
+ exports.isValidElementProp = exports.filterValidElementProps = exports.default = exports.ariaAttributes = void 0;
7
7
 
8
8
  var _memoize = _interopRequireDefault(require("lodash/memoize"));
9
9
 
@@ -11,7 +11,9 @@ var _pickBy = _interopRequireDefault(require("lodash/pickBy"));
11
11
 
12
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
13
 
14
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }
14
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
+
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
15
17
 
16
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; }
17
19
 
@@ -43,7 +45,7 @@ var globalAttributes = [
43
45
  'autoCapitalize', 'autoCorrect', 'autoSave', // 'color', probably best to not allow this attribute
44
46
  'itemProp', 'itemScope', 'itemType', 'itemID', 'itemRef', 'results', 'security', 'unselectable'];
45
47
  var htmlElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr'];
46
- var ariaAttributes = ['aria-activedescendant', 'aria-atomic', 'aria-autocomplete', 'aria-busy', 'aria-checked', 'aria-colcount', 'aria-colindex', 'aria-colspan', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-errormessage', 'aria-expanded', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-level', 'aria-live', 'aria-modal', 'aria-multiline', 'aria-multiselectable', 'aria-orientation', 'aria-owns', 'aria-placeholder', 'aria-posinset', 'aria-pressed', 'aria-readonly', 'aria-relevant', 'aria-required', 'aria-roledescription', 'aria-rowcount', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-setsize', 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext'];
48
+ var ariaAttributes = ['aria-activedescendant', 'aria-atomic', 'aria-autocomplete', 'aria-busy', 'aria-checked', 'aria-colcount', 'aria-colindex', 'aria-colspan', 'aria-controls', 'aria-current', 'aria-describedby', 'aria-details', 'aria-disabled', 'aria-dropeffect', 'aria-errormessage', 'aria-expanded', 'aria-flowto', 'aria-grabbed', 'aria-haspopup', 'aria-hidden', 'aria-invalid', 'aria-keyshortcuts', 'aria-label', 'aria-labelledby', 'aria-level', 'aria-live', 'aria-modal', 'aria-multiline', 'aria-multiselectable', 'aria-orientation', 'aria-owns', 'aria-placeholder', 'aria-posinset', 'aria-pressed', 'aria-readonly', 'aria-relevant', 'aria-required', 'aria-roledescription', 'aria-rowcount', 'aria-rowindex', 'aria-rowspan', 'aria-selected', 'aria-setsize', 'aria-sort', 'aria-valuemax', 'aria-valuemin', 'aria-valuenow', 'aria-valuetext', 'role'];
47
49
  exports.ariaAttributes = ariaAttributes;
48
50
  var extendedAttributes = {
49
51
  a: ['download', 'href', 'hrefLang', 'media', 'rel', 'target', 'type', 'referrerPolicy'],
@@ -113,7 +115,7 @@ var svgRegexMap = svgElements.reduce(function (map, tag) {
113
115
  return Object.assign(map, _defineProperty({}, tag, new RegExp("^(?:".concat(patterns, ")$"))));
114
116
  }, {});
115
117
 
116
- var elementRegexMap = _objectSpread({}, htmlRegexMap, svgRegexMap);
118
+ var elementRegexMap = _objectSpread(_objectSpread({}, htmlRegexMap), svgRegexMap);
117
119
 
118
120
  var isValidElementProp = (0, _memoize.default)(function (tag, attr) {
119
121
  var regex = elementRegexMap[tag];
package/lib/types.js CHANGED
@@ -3,13 +3,13 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.objectKeys = objectKeys;
7
6
  Object.defineProperty(exports, "ThemeProvider", {
8
7
  enumerable: true,
9
8
  get: function get() {
10
9
  return _reactFela.ThemeProvider;
11
10
  }
12
11
  });
12
+ exports.objectKeys = objectKeys;
13
13
 
14
14
  var _reactFela = require("react-fela");
15
15
 
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
3
+ 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); }
4
4
 
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
@@ -15,11 +15,11 @@ var _reactFela = require("react-fela");
15
15
 
16
16
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
17
 
18
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
18
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
19
19
 
20
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
20
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
21
21
 
22
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
22
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
23
23
 
24
24
  function withRenderer(ComponentToWrap) {
25
25
  var WithRendererComponent = function WithRendererComponent(props) {
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "@cloudflare/style-container",
3
3
  "description": "Cloudflare Style Container",
4
- "version": "7.8.46",
5
- "types": "./dist/index.d.ts",
4
+ "version": "7.11.0",
6
5
  "main": "lib/index.js",
7
6
  "module": "es/index.js",
8
7
  "author": "Vojtech Miksu <vojtech@cloudflare.com>",
9
8
  "license": "BSD-3-Clause",
10
9
  "publishConfig": {
11
- "registry": "https://registry.npmjs.org/",
12
- "access": "public"
10
+ "access": "public",
11
+ "main": "lib/index.js",
12
+ "module": "es/index.js",
13
+ "types": "./dist/index.d.ts"
13
14
  },
14
15
  "dependencies": {
15
- "@cloudflare/style-const": "^5.3.14",
16
16
  "@cloudflare/types": "^6.15.15",
17
17
  "fela": "^11.6.1",
18
18
  "fela-tools": "^11.6.1",
@@ -22,6 +22,7 @@
22
22
  "react-fela": "^11.6.1"
23
23
  },
24
24
  "peerDependencies": {
25
+ "@cloudflare/style-const": "^5.3.14",
25
26
  "react": "^15.0.0-0 || ^16.0.0-0 || ^17.0.0-0"
26
27
  },
27
28
  "stratus": {
@@ -34,5 +35,5 @@
34
35
  "test-coverage": "stratus test --coverage",
35
36
  "test-watch": "stratus test --watch"
36
37
  },
37
- "gitHead": "db9637310d476ef91a50177d026526ca40cb9330"
38
- }
38
+ "types": "./dist/index.d.ts"
39
+ }