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