styled-components 6.0.0-beta.11 → 6.0.0-beta.13

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 (36) hide show
  1. package/dist/base.d.ts +0 -5
  2. package/dist/constructors/constructWithOptions.d.ts +4 -4
  3. package/dist/hoc/withTheme.d.ts +1 -1
  4. package/dist/models/StyleSheetManager.d.ts +3 -3
  5. package/dist/models/ThemeProvider.d.ts +3 -3
  6. package/dist/sheet/Sheet.d.ts +3 -3
  7. package/dist/sheet/types.d.ts +1 -1
  8. package/dist/styled-components.browser.cjs.js +16 -13
  9. package/dist/styled-components.browser.cjs.js.map +1 -1
  10. package/dist/styled-components.browser.esm.js +16 -13
  11. package/dist/styled-components.browser.esm.js.map +1 -1
  12. package/dist/styled-components.cjs.js +14 -8
  13. package/dist/styled-components.cjs.js.map +1 -1
  14. package/dist/styled-components.esm.js +14 -8
  15. package/dist/styled-components.esm.js.map +1 -1
  16. package/dist/styled-components.js +22 -19
  17. package/dist/styled-components.js.map +1 -1
  18. package/dist/styled-components.min.js +1 -1
  19. package/dist/styled-components.min.js.map +1 -1
  20. package/dist/tsconfig.tsbuildinfo +1 -1
  21. package/dist/types.d.ts +18 -18
  22. package/dist/utils/hoist.d.ts +3 -3
  23. package/dist/utils/stylis.d.ts +1 -1
  24. package/native/dist/base.d.ts +0 -5
  25. package/native/dist/constructors/constructWithOptions.d.ts +4 -4
  26. package/native/dist/hoc/withTheme.d.ts +1 -1
  27. package/native/dist/models/StyleSheetManager.d.ts +3 -3
  28. package/native/dist/models/ThemeProvider.d.ts +3 -3
  29. package/native/dist/sheet/Sheet.d.ts +3 -3
  30. package/native/dist/sheet/types.d.ts +1 -1
  31. package/native/dist/styled-components.native.cjs.js +1 -1
  32. package/native/dist/styled-components.native.esm.js +1 -1
  33. package/native/dist/types.d.ts +18 -18
  34. package/native/dist/utils/hoist.d.ts +3 -3
  35. package/native/dist/utils/stylis.d.ts +1 -1
  36. package/package.json +20 -24
@@ -8,7 +8,7 @@ var SC_ATTR = (typeof process !== 'undefined' && typeof process.env !== 'undefin
8
8
  'data-styled';
9
9
  var SC_ATTR_ACTIVE = 'active';
10
10
  var SC_ATTR_VERSION = 'data-styled-version';
11
- var SC_VERSION = "6.0.0-beta.11";
11
+ var SC_VERSION = "6.0.0-beta.13";
12
12
  var SPLITTER = '/*!sc*/\n';
13
13
  var IS_BROWSER = typeof undefined !== 'undefined' ;
14
14
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -1541,7 +1541,11 @@ function createStyledComponent(target, options, rules) {
1541
1541
  checkDynamicCreation(displayName, styledComponentId);
1542
1542
  WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName, styledComponentId);
1543
1543
  }
1544
- WrappedStyledComponent.toString = function () { return ".".concat(WrappedStyledComponent.styledComponentId); };
1544
+ // If the Object prototype is frozen, the "toString" property is non-writable. This means that any objects which inherit this property
1545
+ // cannot have the property changed using an assignment. If using strict mode, attempting that will cause an error. If not using strict
1546
+ // mode, attempting that will be silently ignored.
1547
+ // However, we can still explicitly shadow the prototype's "toString" property by defining a new "toString" property on this object.
1548
+ Object.defineProperty(WrappedStyledComponent, 'toString', { value: function () { return ".".concat(WrappedStyledComponent.styledComponentId); } });
1545
1549
  if (isCompositeComponent) {
1546
1550
  var compositeComponentTarget = target;
1547
1551
  hoistNonReactStatics(WrappedStyledComponent, compositeComponentTarget, {
@@ -1838,17 +1842,19 @@ var __PRIVATE__ = {
1838
1842
  if (process.env.NODE_ENV !== 'production' &&
1839
1843
  typeof navigator !== 'undefined' &&
1840
1844
  navigator.product === 'ReactNative') {
1841
- console.warn("It looks like you've imported 'styled-components' on React Native.\n" +
1842
- "Perhaps you're looking to import 'styled-components/native'?\n" +
1843
- 'Read more about this at https://www.styled-components.com/docs/basics#react-native');
1845
+ console.warn("It looks like you've imported 'styled-components' on React Native.\nPerhaps you're looking to import 'styled-components/native'?\nRead more about this at https://www.styled-components.com/docs/basics#react-native");
1844
1846
  }
1847
+ var windowGlobalKey = "__sc-".concat(SC_ATTR, "__");
1845
1848
  /* Warning if there are several instances of styled-components */
1846
1849
  if (process.env.NODE_ENV !== 'production' &&
1847
1850
  process.env.NODE_ENV !== 'test' &&
1848
1851
  typeof undefined !== 'undefined') {
1849
- undefined['__styled-components-init__'] || (undefined['__styled-components-init__'] = 0);
1850
- if (undefined['__styled-components-init__'] === 1) ;
1851
- undefined['__styled-components-init__'] += 1;
1852
+ // @ts-expect-error dynamic key not in undefined object
1853
+ undefined[windowGlobalKey] || (undefined[windowGlobalKey] = 0);
1854
+ // @ts-expect-error dynamic key not in undefined object
1855
+ if (undefined[windowGlobalKey] === 1) ;
1856
+ // @ts-expect-error dynamic key not in undefined object
1857
+ undefined[windowGlobalKey] += 1;
1852
1858
  }
1853
1859
 
1854
1860
  export { ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, __PRIVATE__, createGlobalStyle, css, styled as default, isStyledComponent, keyframes, styled, useTheme, SC_VERSION as version, withTheme };