styled-components 5.3.2 → 5.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "styled-components",
3
- "version": "5.3.2",
3
+ "version": "5.3.3",
4
4
  "description": "Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress",
5
5
  "main": "dist/styled-components.cjs.js",
6
6
  "jsnext:main": "dist/styled-components.esm.js",
@@ -15,7 +15,7 @@ var unitless = _interopDefault(require('@emotion/unitless'));
15
15
  var supportsColor = _interopDefault(require('supports-color'));
16
16
  var hoist = _interopDefault(require('hoist-non-react-statics'));
17
17
 
18
- //
18
+ //
19
19
 
20
20
  /* eslint-disable no-bitwise */
21
21
  var AD_REPLACER_R = /(a)(d)/gi;
@@ -43,7 +43,7 @@ function generateAlphabeticName(code) {
43
43
  return (getAlphabeticChar(x % charsLength) + name).replace(AD_REPLACER_R, '$1-$2');
44
44
  }
45
45
 
46
- //
46
+ //
47
47
 
48
48
  /* eslint-disable */
49
49
  var SEED = 5381; // When we have separate strings it's useful to run a progressive
@@ -64,34 +64,34 @@ var hash = function hash(x) {
64
64
  return phash(SEED, x);
65
65
  };
66
66
 
67
- //
67
+ //
68
68
  var generateComponentId = (function (str) {
69
69
  return generateAlphabeticName(hash(str) >>> 0);
70
70
  });
71
71
 
72
- //
72
+ //
73
73
  function getComponentName(target) {
74
74
  return (process.env.NODE_ENV !== 'production' ? typeof target === 'string' && target : false) || // $FlowFixMe
75
75
  target.displayName || // $FlowFixMe
76
76
  target.name || 'Component';
77
77
  }
78
78
 
79
- //
79
+ //
80
80
  function isFunction(test) {
81
81
  return typeof test === 'function';
82
82
  }
83
83
 
84
- //
84
+ //
85
85
  function isStatelessFunction(test) {
86
86
  return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent);
87
87
  }
88
88
 
89
- //
89
+ //
90
90
  var isPlainObject = (function (x) {
91
91
  return x !== null && typeof x === 'object' && (x.toString ? x.toString() : Object.prototype.toString.call(x)) === '[object Object]' && !reactIs.typeOf(x);
92
92
  });
93
93
 
94
- //
94
+ //
95
95
  function isStyledComponent(target) {
96
96
  return target && typeof target.styledComponentId === 'string';
97
97
  }
@@ -151,16 +151,16 @@ function _objectWithoutPropertiesLoose(source, excluded) {
151
151
  return target;
152
152
  }
153
153
 
154
- //
154
+ //
155
155
  var SC_ATTR = typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
156
156
  var SC_ATTR_ACTIVE = 'active';
157
157
  var SC_ATTR_VERSION = 'data-styled-version';
158
- var SC_VERSION = "5.3.2";
158
+ var SC_VERSION = "5.3.3";
159
159
  var SPLITTER = '/*!sc*/\n';
160
160
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
161
161
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean' ? SC_DISABLE_SPEEDY : typeof process !== 'undefined' && typeof process.env.REACT_APP_SC_DISABLE_SPEEDY !== 'undefined' && process.env.REACT_APP_SC_DISABLE_SPEEDY !== '' ? process.env.REACT_APP_SC_DISABLE_SPEEDY === 'false' ? false : process.env.REACT_APP_SC_DISABLE_SPEEDY : typeof process !== 'undefined' && typeof process.env.SC_DISABLE_SPEEDY !== 'undefined' && process.env.SC_DISABLE_SPEEDY !== '' ? process.env.SC_DISABLE_SPEEDY === 'false' ? false : process.env.SC_DISABLE_SPEEDY : process.env.NODE_ENV !== 'production'); // Shared empty execution context when generating static styles
162
162
 
163
- //
163
+ //
164
164
  var EMPTY_ARRAY = Object.freeze([]);
165
165
  var EMPTY_OBJECT = Object.freeze({});
166
166
 
@@ -184,7 +184,7 @@ var errorMap = {
184
184
  "17": "CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n"
185
185
  };
186
186
 
187
- //
187
+ //
188
188
  var ERRORS = process.env.NODE_ENV !== 'production' ? errorMap : {};
189
189
  /**
190
190
  * super basic version of sprintf
@@ -221,7 +221,7 @@ function throwStyledComponentsError(code) {
221
221
  }
222
222
  }
223
223
 
224
- //
224
+ //
225
225
  /** Create a GroupedTag with an underlying Tag implementation */
226
226
 
227
227
  var makeGroupedTag = function makeGroupedTag(tag) {
@@ -315,7 +315,7 @@ var DefaultGroupedTag = /*#__PURE__*/function () {
315
315
  return DefaultGroupedTag;
316
316
  }();
317
317
 
318
- //
318
+ //
319
319
  var MAX_SMI = 1 << 31 - 1;
320
320
  var groupIDRegister = new Map();
321
321
  var reverseRegister = new Map();
@@ -351,7 +351,7 @@ var setGroupForId = function setGroupForId(id, group) {
351
351
  reverseRegister.set(group, id);
352
352
  };
353
353
 
354
- //
354
+ //
355
355
  var SELECTOR = "style[" + SC_ATTR + "][" + SC_ATTR_VERSION + "=\"" + SC_VERSION + "\"]";
356
356
  var MARKER_RE = new RegExp("^" + SC_ATTR + "\\.g(\\d+)\\[id=\"([\\w\\d-]+)\"\\].*?\"([^\"]*)");
357
357
  var outputSheet = function outputSheet(sheet) {
@@ -397,7 +397,7 @@ var rehydrateNamesFromContent = function rehydrateNamesFromContent(sheet, id, co
397
397
  };
398
398
 
399
399
  var rehydrateSheetFromTag = function rehydrateSheetFromTag(sheet, style) {
400
- var parts = (style.innerHTML || '').split(SPLITTER);
400
+ var parts = (style.textContent || '').split(SPLITTER);
401
401
  var rules = [];
402
402
 
403
403
  for (var i = 0, l = parts.length; i < l; i++) {
@@ -441,14 +441,14 @@ var rehydrateSheet = function rehydrateSheet(sheet) {
441
441
  }
442
442
  };
443
443
 
444
- //
444
+ //
445
445
 
446
446
  /* eslint-disable camelcase, no-undef */
447
447
  var getNonce = function getNonce() {
448
448
  return typeof window !== 'undefined' ? typeof window.__webpack_nonce__ !== 'undefined' ? window.__webpack_nonce__ : null : null;
449
449
  };
450
450
 
451
- //
451
+ //
452
452
  var ELEMENT_TYPE = 1;
453
453
  /* Node.ELEMENT_TYPE */
454
454
 
@@ -506,7 +506,7 @@ var getSheet = function getSheet(tag) {
506
506
  return undefined;
507
507
  };
508
508
 
509
- //
509
+ //
510
510
  /** Create a CSSStyleSheet-like tag depending on the environment */
511
511
 
512
512
  var makeTag = function makeTag(_ref) {
@@ -906,7 +906,7 @@ function createStylisInstance(_temp) {
906
906
  return stringifyRules;
907
907
  }
908
908
 
909
- //
909
+ //
910
910
  var StyleSheetContext = React__default.createContext();
911
911
  var StyleSheetConsumer = StyleSheetContext.Consumer;
912
912
  var StylisContext = React__default.createContext();
@@ -914,7 +914,7 @@ var StylisConsumer = StylisContext.Consumer;
914
914
  var masterSheet = new StyleSheet();
915
915
  var masterStylis = createStylisInstance();
916
916
 
917
- //
917
+ //
918
918
 
919
919
  var Keyframes = /*#__PURE__*/function () {
920
920
  function Keyframes(name, rules) {
@@ -954,7 +954,7 @@ var Keyframes = /*#__PURE__*/function () {
954
954
  return Keyframes;
955
955
  }();
956
956
 
957
- //
957
+ //
958
958
 
959
959
  /**
960
960
  * inlined version of
@@ -989,7 +989,7 @@ function hyphenateStyleName(string) {
989
989
  return uppercaseCheck.test(string) ? string.replace(uppercasePattern, prefixAndLowerCase).replace(msPattern, '-ms-') : string;
990
990
  }
991
991
 
992
- //
992
+ //
993
993
 
994
994
  function addUnitIfNeeded(name, value) {
995
995
  // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
@@ -1005,7 +1005,7 @@ function addUnitIfNeeded(name, value) {
1005
1005
  return String(value).trim();
1006
1006
  }
1007
1007
 
1008
- //
1008
+ //
1009
1009
  /**
1010
1010
  * It's falsish not falsy because 0 is allowed.
1011
1011
  */
@@ -1080,7 +1080,7 @@ function flatten(chunk, executionContext, styleSheet, stylisInstance) {
1080
1080
  return isPlainObject(chunk) ? objToCssArray(chunk) : chunk.toString();
1081
1081
  }
1082
1082
 
1083
- //
1083
+ //
1084
1084
  var printed = {};
1085
1085
  function warnOnce(message) {
1086
1086
  if (printed[message]) return;
@@ -1088,7 +1088,7 @@ function warnOnce(message) {
1088
1088
  if (typeof console !== 'undefined' && console.warn) console.warn(message);
1089
1089
  }
1090
1090
 
1091
- //
1091
+ //
1092
1092
  var SINGLE_QUOTE = "'".charCodeAt(0);
1093
1093
  var DOUBLE_QUOTE = '"'.charCodeAt(0);
1094
1094
  var BACKSLASH = '\\'.charCodeAt(0);
@@ -1359,7 +1359,7 @@ function tokenize(input, options) {
1359
1359
  return tokens;
1360
1360
  }
1361
1361
 
1362
- //
1362
+ //
1363
1363
  var HIGHLIGHT_THEME = {
1364
1364
  brackets: [36, 39],
1365
1365
  // cyan
@@ -1637,7 +1637,7 @@ var CssSyntaxError = /*#__PURE__*/function () {
1637
1637
  return CssSyntaxError;
1638
1638
  }();
1639
1639
 
1640
- //
1640
+ //
1641
1641
 
1642
1642
  /* eslint-disable valid-jsdoc */
1643
1643
  var defaultRaw = {
@@ -1983,7 +1983,7 @@ var Stringifier = /*#__PURE__*/function () {
1983
1983
  return Stringifier;
1984
1984
  }();
1985
1985
 
1986
- //
1986
+ //
1987
1987
  function stringify(node, builder) {
1988
1988
  var str = new Stringifier(builder);
1989
1989
  str.stringify(node);
@@ -2794,7 +2794,7 @@ var Comment = /*#__PURE__*/function (_Node) {
2794
2794
  return Comment;
2795
2795
  }(Node);
2796
2796
 
2797
- //
2797
+ //
2798
2798
 
2799
2799
  var Parser = /*#__PURE__*/function () {
2800
2800
  function Parser(input) {
@@ -3320,7 +3320,7 @@ var Parser = /*#__PURE__*/function () {
3320
3320
  return Parser;
3321
3321
  }();
3322
3322
 
3323
- //
3323
+ //
3324
3324
  function parse(css, opts) {
3325
3325
  if (opts && opts.safe) {
3326
3326
  throw new Error('Option safe was removed. ' + 'Use parser: require("postcss-safe-parser")');
@@ -4276,7 +4276,7 @@ var AtRule = /*#__PURE__*/function (_Container) {
4276
4276
  return AtRule;
4277
4277
  }(Container);
4278
4278
 
4279
- //
4279
+ //
4280
4280
 
4281
4281
  /**
4282
4282
  * Contains helpers for safely splitting lists of CSS values,
@@ -4469,7 +4469,7 @@ var Rule = /*#__PURE__*/function (_Container) {
4469
4469
  return Rule;
4470
4470
  }(Container);
4471
4471
 
4472
- //
4472
+ //
4473
4473
 
4474
4474
  /**
4475
4475
  * Represents a plugin’s warning. It can be created using {@link Node#warn}.
@@ -5152,7 +5152,7 @@ var LazyResult = /*#__PURE__*/function () {
5152
5152
  return LazyResult;
5153
5153
  }();
5154
5154
 
5155
- //
5155
+ //
5156
5156
  /**
5157
5157
  * @callback builder
5158
5158
  * @param {string} part - part of generated CSS connected to this node
@@ -5743,7 +5743,7 @@ var SafeParser = /*#__PURE__*/function (_Parser) {
5743
5743
  return SafeParser;
5744
5744
  }(Parser);
5745
5745
 
5746
- //
5746
+ //
5747
5747
  function safeParse(css, opts) {
5748
5748
  var input = new Input(css, opts);
5749
5749
  var parser = new SafeParser(input);
@@ -5752,7 +5752,7 @@ function safeParse(css, opts) {
5752
5752
  return parser.root;
5753
5753
  }
5754
5754
 
5755
- //
5755
+ //
5756
5756
  var generated = {};
5757
5757
  /*
5758
5758
  InlineStyle takes arbitrary CSS and generates a flat object
@@ -5867,7 +5867,7 @@ function mixinDeep(target) {
5867
5867
  return target;
5868
5868
  }
5869
5869
 
5870
- //
5870
+ //
5871
5871
  var determineTheme = (function (props, providedTheme, defaultProps) {
5872
5872
  if (defaultProps === void 0) {
5873
5873
  defaultProps = EMPTY_OBJECT;
@@ -5876,12 +5876,12 @@ var determineTheme = (function (props, providedTheme, defaultProps) {
5876
5876
  return props.theme !== defaultProps.theme && props.theme || providedTheme || defaultProps.theme;
5877
5877
  });
5878
5878
 
5879
- //
5879
+ //
5880
5880
  function isTag(target) {
5881
5881
  return typeof target === 'string' && (process.env.NODE_ENV !== 'production' ? target.charAt(0) === target.charAt(0).toLowerCase() : true);
5882
5882
  }
5883
5883
 
5884
- //
5884
+ //
5885
5885
  function generateDisplayName(target) {
5886
5886
  return isTag(target) ? "styled." + target : "Styled(" + getComponentName(target) + ")";
5887
5887
  }
@@ -6149,7 +6149,7 @@ var _StyledNativeComponent = (function (InlineStyle) {
6149
6149
  return createStyledNativeComponent;
6150
6150
  });
6151
6151
 
6152
- //
6152
+ //
6153
6153
  var interleave = (function (strings, interpolations) {
6154
6154
  var result = [strings[0]];
6155
6155
 
@@ -6160,7 +6160,7 @@ var interleave = (function (strings, interpolations) {
6160
6160
  return result;
6161
6161
  });
6162
6162
 
6163
- //
6163
+ //
6164
6164
  /**
6165
6165
  * Used when flattening object styles to determine if we should
6166
6166
  * expand an array of styles.
@@ -6256,13 +6256,13 @@ var withTheme = (function (Component) {
6256
6256
  return WithTheme;
6257
6257
  });
6258
6258
 
6259
- //
6259
+ //
6260
6260
 
6261
6261
  var useTheme = function useTheme() {
6262
6262
  return React.useContext(ThemeContext);
6263
6263
  };
6264
6264
 
6265
- //
6265
+ //
6266
6266
 
6267
6267
  var InlineStyle = _InlineStyle(reactPrimitives.StyleSheet);
6268
6268