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.
@@ -8,7 +8,7 @@ import unitless from '@emotion/unitless';
8
8
  import supportsColor from 'supports-color';
9
9
  import hoist from 'hoist-non-react-statics';
10
10
 
11
- //
11
+ //
12
12
 
13
13
  /* eslint-disable no-bitwise */
14
14
  var AD_REPLACER_R = /(a)(d)/gi;
@@ -36,7 +36,7 @@ function generateAlphabeticName(code) {
36
36
  return (getAlphabeticChar(x % charsLength) + name).replace(AD_REPLACER_R, '$1-$2');
37
37
  }
38
38
 
39
- //
39
+ //
40
40
 
41
41
  /* eslint-disable */
42
42
  var SEED = 5381; // When we have separate strings it's useful to run a progressive
@@ -57,34 +57,34 @@ var hash = function hash(x) {
57
57
  return phash(SEED, x);
58
58
  };
59
59
 
60
- //
60
+ //
61
61
  var generateComponentId = (function (str) {
62
62
  return generateAlphabeticName(hash(str) >>> 0);
63
63
  });
64
64
 
65
- //
65
+ //
66
66
  function getComponentName(target) {
67
67
  return (process.env.NODE_ENV !== 'production' ? typeof target === 'string' && target : false) || // $FlowFixMe
68
68
  target.displayName || // $FlowFixMe
69
69
  target.name || 'Component';
70
70
  }
71
71
 
72
- //
72
+ //
73
73
  function isFunction(test) {
74
74
  return typeof test === 'function';
75
75
  }
76
76
 
77
- //
77
+ //
78
78
  function isStatelessFunction(test) {
79
79
  return typeof test === 'function' && !(test.prototype && test.prototype.isReactComponent);
80
80
  }
81
81
 
82
- //
82
+ //
83
83
  var isPlainObject = (function (x) {
84
84
  return x !== null && typeof x === 'object' && (x.toString ? x.toString() : Object.prototype.toString.call(x)) === '[object Object]' && !typeOf(x);
85
85
  });
86
86
 
87
- //
87
+ //
88
88
  function isStyledComponent(target) {
89
89
  return target && typeof target.styledComponentId === 'string';
90
90
  }
@@ -144,16 +144,16 @@ function _objectWithoutPropertiesLoose(source, excluded) {
144
144
  return target;
145
145
  }
146
146
 
147
- //
147
+ //
148
148
  var SC_ATTR = typeof process !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR) || 'data-styled';
149
149
  var SC_ATTR_ACTIVE = 'active';
150
150
  var SC_ATTR_VERSION = 'data-styled-version';
151
- var SC_VERSION = "5.3.2";
151
+ var SC_VERSION = "5.3.3";
152
152
  var SPLITTER = '/*!sc*/\n';
153
153
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
154
154
  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
155
155
 
156
- //
156
+ //
157
157
  var EMPTY_ARRAY = Object.freeze([]);
158
158
  var EMPTY_OBJECT = Object.freeze({});
159
159
 
@@ -177,7 +177,7 @@ var errorMap = {
177
177
  "17": "CSSStyleSheet could not be found on HTMLStyleElement.\nHas styled-components' style tag been unmounted or altered by another script?\n"
178
178
  };
179
179
 
180
- //
180
+ //
181
181
  var ERRORS = process.env.NODE_ENV !== 'production' ? errorMap : {};
182
182
  /**
183
183
  * super basic version of sprintf
@@ -214,7 +214,7 @@ function throwStyledComponentsError(code) {
214
214
  }
215
215
  }
216
216
 
217
- //
217
+ //
218
218
  /** Create a GroupedTag with an underlying Tag implementation */
219
219
 
220
220
  var makeGroupedTag = function makeGroupedTag(tag) {
@@ -308,7 +308,7 @@ var DefaultGroupedTag = /*#__PURE__*/function () {
308
308
  return DefaultGroupedTag;
309
309
  }();
310
310
 
311
- //
311
+ //
312
312
  var MAX_SMI = 1 << 31 - 1;
313
313
  var groupIDRegister = new Map();
314
314
  var reverseRegister = new Map();
@@ -344,7 +344,7 @@ var setGroupForId = function setGroupForId(id, group) {
344
344
  reverseRegister.set(group, id);
345
345
  };
346
346
 
347
- //
347
+ //
348
348
  var SELECTOR = "style[" + SC_ATTR + "][" + SC_ATTR_VERSION + "=\"" + SC_VERSION + "\"]";
349
349
  var MARKER_RE = new RegExp("^" + SC_ATTR + "\\.g(\\d+)\\[id=\"([\\w\\d-]+)\"\\].*?\"([^\"]*)");
350
350
  var outputSheet = function outputSheet(sheet) {
@@ -390,7 +390,7 @@ var rehydrateNamesFromContent = function rehydrateNamesFromContent(sheet, id, co
390
390
  };
391
391
 
392
392
  var rehydrateSheetFromTag = function rehydrateSheetFromTag(sheet, style) {
393
- var parts = (style.innerHTML || '').split(SPLITTER);
393
+ var parts = (style.textContent || '').split(SPLITTER);
394
394
  var rules = [];
395
395
 
396
396
  for (var i = 0, l = parts.length; i < l; i++) {
@@ -434,14 +434,14 @@ var rehydrateSheet = function rehydrateSheet(sheet) {
434
434
  }
435
435
  };
436
436
 
437
- //
437
+ //
438
438
 
439
439
  /* eslint-disable camelcase, no-undef */
440
440
  var getNonce = function getNonce() {
441
441
  return typeof window !== 'undefined' ? typeof window.__webpack_nonce__ !== 'undefined' ? window.__webpack_nonce__ : null : null;
442
442
  };
443
443
 
444
- //
444
+ //
445
445
  var ELEMENT_TYPE = 1;
446
446
  /* Node.ELEMENT_TYPE */
447
447
 
@@ -499,7 +499,7 @@ var getSheet = function getSheet(tag) {
499
499
  return undefined;
500
500
  };
501
501
 
502
- //
502
+ //
503
503
  /** Create a CSSStyleSheet-like tag depending on the environment */
504
504
 
505
505
  var makeTag = function makeTag(_ref) {
@@ -899,7 +899,7 @@ function createStylisInstance(_temp) {
899
899
  return stringifyRules;
900
900
  }
901
901
 
902
- //
902
+ //
903
903
  var StyleSheetContext = React.createContext();
904
904
  var StyleSheetConsumer = StyleSheetContext.Consumer;
905
905
  var StylisContext = React.createContext();
@@ -907,7 +907,7 @@ var StylisConsumer = StylisContext.Consumer;
907
907
  var masterSheet = new StyleSheet();
908
908
  var masterStylis = createStylisInstance();
909
909
 
910
- //
910
+ //
911
911
 
912
912
  var Keyframes = /*#__PURE__*/function () {
913
913
  function Keyframes(name, rules) {
@@ -947,7 +947,7 @@ var Keyframes = /*#__PURE__*/function () {
947
947
  return Keyframes;
948
948
  }();
949
949
 
950
- //
950
+ //
951
951
 
952
952
  /**
953
953
  * inlined version of
@@ -982,7 +982,7 @@ function hyphenateStyleName(string) {
982
982
  return uppercaseCheck.test(string) ? string.replace(uppercasePattern, prefixAndLowerCase).replace(msPattern, '-ms-') : string;
983
983
  }
984
984
 
985
- //
985
+ //
986
986
 
987
987
  function addUnitIfNeeded(name, value) {
988
988
  // https://github.com/amilajack/eslint-plugin-flowtype-errors/issues/133
@@ -998,7 +998,7 @@ function addUnitIfNeeded(name, value) {
998
998
  return String(value).trim();
999
999
  }
1000
1000
 
1001
- //
1001
+ //
1002
1002
  /**
1003
1003
  * It's falsish not falsy because 0 is allowed.
1004
1004
  */
@@ -1073,7 +1073,7 @@ function flatten(chunk, executionContext, styleSheet, stylisInstance) {
1073
1073
  return isPlainObject(chunk) ? objToCssArray(chunk) : chunk.toString();
1074
1074
  }
1075
1075
 
1076
- //
1076
+ //
1077
1077
  var printed = {};
1078
1078
  function warnOnce(message) {
1079
1079
  if (printed[message]) return;
@@ -1081,7 +1081,7 @@ function warnOnce(message) {
1081
1081
  if (typeof console !== 'undefined' && console.warn) console.warn(message);
1082
1082
  }
1083
1083
 
1084
- //
1084
+ //
1085
1085
  var SINGLE_QUOTE = "'".charCodeAt(0);
1086
1086
  var DOUBLE_QUOTE = '"'.charCodeAt(0);
1087
1087
  var BACKSLASH = '\\'.charCodeAt(0);
@@ -1352,7 +1352,7 @@ function tokenize(input, options) {
1352
1352
  return tokens;
1353
1353
  }
1354
1354
 
1355
- //
1355
+ //
1356
1356
  var HIGHLIGHT_THEME = {
1357
1357
  brackets: [36, 39],
1358
1358
  // cyan
@@ -1630,7 +1630,7 @@ var CssSyntaxError = /*#__PURE__*/function () {
1630
1630
  return CssSyntaxError;
1631
1631
  }();
1632
1632
 
1633
- //
1633
+ //
1634
1634
 
1635
1635
  /* eslint-disable valid-jsdoc */
1636
1636
  var defaultRaw = {
@@ -1976,7 +1976,7 @@ var Stringifier = /*#__PURE__*/function () {
1976
1976
  return Stringifier;
1977
1977
  }();
1978
1978
 
1979
- //
1979
+ //
1980
1980
  function stringify(node, builder) {
1981
1981
  var str = new Stringifier(builder);
1982
1982
  str.stringify(node);
@@ -2787,7 +2787,7 @@ var Comment = /*#__PURE__*/function (_Node) {
2787
2787
  return Comment;
2788
2788
  }(Node);
2789
2789
 
2790
- //
2790
+ //
2791
2791
 
2792
2792
  var Parser = /*#__PURE__*/function () {
2793
2793
  function Parser(input) {
@@ -3313,7 +3313,7 @@ var Parser = /*#__PURE__*/function () {
3313
3313
  return Parser;
3314
3314
  }();
3315
3315
 
3316
- //
3316
+ //
3317
3317
  function parse(css, opts) {
3318
3318
  if (opts && opts.safe) {
3319
3319
  throw new Error('Option safe was removed. ' + 'Use parser: require("postcss-safe-parser")');
@@ -4269,7 +4269,7 @@ var AtRule = /*#__PURE__*/function (_Container) {
4269
4269
  return AtRule;
4270
4270
  }(Container);
4271
4271
 
4272
- //
4272
+ //
4273
4273
 
4274
4274
  /**
4275
4275
  * Contains helpers for safely splitting lists of CSS values,
@@ -4462,7 +4462,7 @@ var Rule = /*#__PURE__*/function (_Container) {
4462
4462
  return Rule;
4463
4463
  }(Container);
4464
4464
 
4465
- //
4465
+ //
4466
4466
 
4467
4467
  /**
4468
4468
  * Represents a plugin’s warning. It can be created using {@link Node#warn}.
@@ -5145,7 +5145,7 @@ var LazyResult = /*#__PURE__*/function () {
5145
5145
  return LazyResult;
5146
5146
  }();
5147
5147
 
5148
- //
5148
+ //
5149
5149
  /**
5150
5150
  * @callback builder
5151
5151
  * @param {string} part - part of generated CSS connected to this node
@@ -5736,7 +5736,7 @@ var SafeParser = /*#__PURE__*/function (_Parser) {
5736
5736
  return SafeParser;
5737
5737
  }(Parser);
5738
5738
 
5739
- //
5739
+ //
5740
5740
  function safeParse(css, opts) {
5741
5741
  var input = new Input(css, opts);
5742
5742
  var parser = new SafeParser(input);
@@ -5745,7 +5745,7 @@ function safeParse(css, opts) {
5745
5745
  return parser.root;
5746
5746
  }
5747
5747
 
5748
- //
5748
+ //
5749
5749
  var generated = {};
5750
5750
  /*
5751
5751
  InlineStyle takes arbitrary CSS and generates a flat object
@@ -5860,7 +5860,7 @@ function mixinDeep(target) {
5860
5860
  return target;
5861
5861
  }
5862
5862
 
5863
- //
5863
+ //
5864
5864
  var determineTheme = (function (props, providedTheme, defaultProps) {
5865
5865
  if (defaultProps === void 0) {
5866
5866
  defaultProps = EMPTY_OBJECT;
@@ -5869,12 +5869,12 @@ var determineTheme = (function (props, providedTheme, defaultProps) {
5869
5869
  return props.theme !== defaultProps.theme && props.theme || providedTheme || defaultProps.theme;
5870
5870
  });
5871
5871
 
5872
- //
5872
+ //
5873
5873
  function isTag(target) {
5874
5874
  return typeof target === 'string' && (process.env.NODE_ENV !== 'production' ? target.charAt(0) === target.charAt(0).toLowerCase() : true);
5875
5875
  }
5876
5876
 
5877
- //
5877
+ //
5878
5878
  function generateDisplayName(target) {
5879
5879
  return isTag(target) ? "styled." + target : "Styled(" + getComponentName(target) + ")";
5880
5880
  }
@@ -6142,7 +6142,7 @@ var _StyledNativeComponent = (function (InlineStyle) {
6142
6142
  return createStyledNativeComponent;
6143
6143
  });
6144
6144
 
6145
- //
6145
+ //
6146
6146
  var interleave = (function (strings, interpolations) {
6147
6147
  var result = [strings[0]];
6148
6148
 
@@ -6153,7 +6153,7 @@ var interleave = (function (strings, interpolations) {
6153
6153
  return result;
6154
6154
  });
6155
6155
 
6156
- //
6156
+ //
6157
6157
  /**
6158
6158
  * Used when flattening object styles to determine if we should
6159
6159
  * expand an array of styles.
@@ -6249,13 +6249,13 @@ var withTheme = (function (Component) {
6249
6249
  return WithTheme;
6250
6250
  });
6251
6251
 
6252
- //
6252
+ //
6253
6253
 
6254
6254
  var useTheme = function useTheme() {
6255
6255
  return useContext(ThemeContext);
6256
6256
  };
6257
6257
 
6258
- //
6258
+ //
6259
6259
 
6260
6260
  var InlineStyle = _InlineStyle(reactPrimitives.StyleSheet);
6261
6261