styled-components 6.0.7 → 6.0.8

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.
Files changed (35) hide show
  1. package/dist/base.d.ts +1 -1
  2. package/dist/constructors/constructWithOptions.d.ts +1 -1
  3. package/dist/constructors/styled.d.ts +3 -45
  4. package/dist/hoc/withTheme.d.ts +1 -1
  5. package/dist/index.d.ts +2 -2
  6. package/dist/native/index.d.ts +4 -4
  7. package/dist/styled-components.browser.cjs.js +1 -1
  8. package/dist/styled-components.browser.cjs.js.map +1 -1
  9. package/dist/styled-components.browser.esm.js +1 -1
  10. package/dist/styled-components.browser.esm.js.map +1 -1
  11. package/dist/styled-components.cjs.js +1 -1
  12. package/dist/styled-components.cjs.js.map +1 -1
  13. package/dist/styled-components.esm.js +1 -1
  14. package/dist/styled-components.esm.js.map +1 -1
  15. package/dist/styled-components.js +16 -8
  16. package/dist/styled-components.js.map +1 -1
  17. package/dist/styled-components.min.js +1 -1
  18. package/dist/styled-components.min.js.map +1 -1
  19. package/dist/test/utils.d.ts +3 -45
  20. package/dist/types.d.ts +27 -5
  21. package/dist/utils/domElements.d.ts +3 -1
  22. package/native/dist/base.d.ts +1 -1
  23. package/native/dist/constructors/constructWithOptions.d.ts +1 -1
  24. package/native/dist/constructors/styled.d.ts +3 -45
  25. package/native/dist/hoc/withTheme.d.ts +1 -1
  26. package/native/dist/index.d.ts +2 -2
  27. package/native/dist/native/index.d.ts +4 -4
  28. package/native/dist/styled-components.native.cjs.js +1 -1
  29. package/native/dist/styled-components.native.cjs.js.map +1 -1
  30. package/native/dist/styled-components.native.esm.js +1 -1
  31. package/native/dist/styled-components.native.esm.js.map +1 -1
  32. package/native/dist/test/utils.d.ts +3 -45
  33. package/native/dist/types.d.ts +27 -5
  34. package/native/dist/utils/domElements.d.ts +3 -1
  35. package/package.json +3 -2
@@ -4,11 +4,13 @@
4
4
  (global = global || self, global.styled = factory(global.React));
5
5
  })(this, (function (React) { 'use strict';
6
6
 
7
- var SC_ATTR = (typeof process !== 'undefined' && typeof process.env !== 'undefined' && (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR)) ||
7
+ var SC_ATTR = (typeof process !== 'undefined' &&
8
+ typeof process.env !== 'undefined' &&
9
+ (process.env.REACT_APP_SC_ATTR || process.env.SC_ATTR)) ||
8
10
  'data-styled';
9
11
  var SC_ATTR_ACTIVE = 'active';
10
12
  var SC_ATTR_VERSION = 'data-styled-version';
11
- var SC_VERSION = "6.0.7";
13
+ var SC_VERSION = "6.0.8";
12
14
  var SPLITTER = '/*!sc*/\n';
13
15
  var IS_BROWSER = typeof window !== 'undefined' && 'HTMLElement' in window;
14
16
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -765,7 +767,12 @@
765
767
  if (!shallowequal(plugins, props.stylisPlugins))
766
768
  setPlugins(props.stylisPlugins);
767
769
  }, [props.stylisPlugins]);
768
- return (React.createElement(StyleSheetContext.Provider, { value: { shouldForwardProp: props.shouldForwardProp, styleSheet: resolvedStyleSheet, stylis: stylis } },
770
+ var styleSheetContextValue = React.useMemo(function () { return ({
771
+ shouldForwardProp: props.shouldForwardProp,
772
+ styleSheet: resolvedStyleSheet,
773
+ stylis: stylis,
774
+ }); }, [props.shouldForwardProp, resolvedStyleSheet, stylis]);
775
+ return (React.createElement(StyleSheetContext.Provider, { value: styleSheetContextValue },
769
776
  React.createElement(StylisContext.Provider, { value: stylis }, props.children)));
770
777
  }
771
778
 
@@ -1535,7 +1542,7 @@
1535
1542
  });
1536
1543
 
1537
1544
  // Thanks to ReactDOMFactories for this handy list!
1538
- var domElements = new Set([
1545
+ var elements = [
1539
1546
  'a',
1540
1547
  'abbr',
1541
1548
  'address',
@@ -1581,7 +1588,6 @@
1581
1588
  'h4',
1582
1589
  'h5',
1583
1590
  'h6',
1584
- 'head',
1585
1591
  'header',
1586
1592
  'hgroup',
1587
1593
  'hr',
@@ -1641,7 +1647,6 @@
1641
1647
  'th',
1642
1648
  'thead',
1643
1649
  'time',
1644
- 'title',
1645
1650
  'tr',
1646
1651
  'track',
1647
1652
  'u',
@@ -1671,7 +1676,8 @@
1671
1676
  'svg',
1672
1677
  'text',
1673
1678
  'tspan',
1674
- ]);
1679
+ ];
1680
+ var domElements = new Set(elements);
1675
1681
 
1676
1682
  // Source: https://www.w3.org/TR/cssom-1/#serialize-an-identifier
1677
1683
  // Control characters and non-letter first symbols are not supported
@@ -1781,7 +1787,8 @@
1781
1787
  }
1782
1788
  else if (partRule) {
1783
1789
  var partString = joinStringArray(flatten(partRule, executionContext, styleSheet, stylis));
1784
- dynamicHash = phash(dynamicHash, partString);
1790
+ // The same value can switch positions in the array, so we include "i" in the hash.
1791
+ dynamicHash = phash(dynamicHash, partString + i);
1785
1792
  css += partString;
1786
1793
  }
1787
1794
  }
@@ -2019,6 +2026,7 @@
2019
2026
  var styled = baseStyled;
2020
2027
  // Shorthands for all valid HTML Elements
2021
2028
  domElements.forEach(function (domElement) {
2029
+ // @ts-expect-error some react typing bs
2022
2030
  styled[domElement] = baseStyled(domElement);
2023
2031
  });
2024
2032