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 @@
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 window !== 'undefined' && 'HTMLElement' in window;
14
14
  var DISABLE_SPEEDY = Boolean(typeof SC_DISABLE_SPEEDY === 'boolean'
@@ -1420,28 +1420,23 @@
1420
1420
  /* Warning if you've imported this file on React Native */
1421
1421
  if (typeof navigator !== 'undefined' &&
1422
1422
  navigator.product === 'ReactNative') {
1423
- console.warn("It looks like you've imported 'styled-components' on React Native.\n" +
1424
- "Perhaps you're looking to import 'styled-components/native'?\n" +
1425
- 'Read more about this at https://www.styled-components.com/docs/basics#react-native');
1423
+ 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");
1426
1424
  }
1425
+ var windowGlobalKey = "__sc-".concat(SC_ATTR, "__");
1427
1426
  /* Warning if there are several instances of styled-components */
1428
1427
  if (typeof window !== 'undefined') {
1429
- window['__styled-components-init__'] || (window['__styled-components-init__'] = 0);
1430
- if (window['__styled-components-init__'] === 1) {
1431
- console.warn("It looks like there are several instances of 'styled-components' initialized in this application. " +
1432
- 'This may cause dynamic styles to not render properly, errors during the rehydration process, ' +
1433
- 'a missing theme prop, and makes your application bigger without good reason.\n\n' +
1434
- 'See https://s-c.sh/2BAXzed for more info.');
1435
- }
1436
- window['__styled-components-init__'] += 1;
1428
+ // @ts-expect-error dynamic key not in window object
1429
+ window[windowGlobalKey] || (window[windowGlobalKey] = 0);
1430
+ // @ts-expect-error dynamic key not in window object
1431
+ if (window[windowGlobalKey] === 1) {
1432
+ console.warn("It looks like there are several instances of 'styled-components' initialized in this application. This may cause dynamic styles to not render properly, errors during the rehydration process, a missing theme prop, and makes your application bigger without good reason.\n\nSee https://s-c.sh/2BAXzed for more info.");
1433
+ }
1434
+ // @ts-expect-error dynamic key not in window object
1435
+ window[windowGlobalKey] += 1;
1437
1436
  }
1438
1437
 
1439
1438
  var secondary = /*#__PURE__*/Object.freeze({
1440
1439
  __proto__: null,
1441
- createGlobalStyle: createGlobalStyle,
1442
- css: css,
1443
- isStyledComponent: isStyledComponent,
1444
- keyframes: keyframes,
1445
1440
  ServerStyleSheet: ServerStyleSheet,
1446
1441
  StyleSheetConsumer: StyleSheetConsumer,
1447
1442
  StyleSheetContext: StyleSheetContext,
@@ -1449,10 +1444,14 @@
1449
1444
  ThemeConsumer: ThemeConsumer,
1450
1445
  ThemeContext: ThemeContext,
1451
1446
  ThemeProvider: ThemeProvider,
1447
+ __PRIVATE__: __PRIVATE__,
1448
+ createGlobalStyle: createGlobalStyle,
1449
+ css: css,
1450
+ isStyledComponent: isStyledComponent,
1451
+ keyframes: keyframes,
1452
1452
  useTheme: useTheme,
1453
1453
  version: SC_VERSION,
1454
- withTheme: withTheme,
1455
- __PRIVATE__: __PRIVATE__
1454
+ withTheme: withTheme
1456
1455
  });
1457
1456
 
1458
1457
  var LIMIT = 200;
@@ -1909,7 +1908,11 @@
1909
1908
  checkDynamicCreation(displayName, styledComponentId);
1910
1909
  WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName, styledComponentId);
1911
1910
  }
1912
- WrappedStyledComponent.toString = function () { return ".".concat(WrappedStyledComponent.styledComponentId); };
1911
+ // If the Object prototype is frozen, the "toString" property is non-writable. This means that any objects which inherit this property
1912
+ // cannot have the property changed using an assignment. If using strict mode, attempting that will cause an error. If not using strict
1913
+ // mode, attempting that will be silently ignored.
1914
+ // However, we can still explicitly shadow the prototype's "toString" property by defining a new "toString" property on this object.
1915
+ Object.defineProperty(WrappedStyledComponent, 'toString', { value: function () { return ".".concat(WrappedStyledComponent.styledComponentId); } });
1913
1916
  if (isCompositeComponent) {
1914
1917
  var compositeComponentTarget = target;
1915
1918
  hoistNonReactStatics(WrappedStyledComponent, compositeComponentTarget, {