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