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.
- package/dist/base.d.ts +0 -5
- package/dist/constructors/constructWithOptions.d.ts +4 -4
- package/dist/hoc/withTheme.d.ts +1 -1
- package/dist/models/StyleSheetManager.d.ts +3 -3
- package/dist/models/ThemeProvider.d.ts +3 -3
- package/dist/sheet/Sheet.d.ts +3 -3
- package/dist/sheet/types.d.ts +1 -1
- package/dist/styled-components.browser.cjs.js +16 -13
- package/dist/styled-components.browser.cjs.js.map +1 -1
- package/dist/styled-components.browser.esm.js +16 -13
- package/dist/styled-components.browser.esm.js.map +1 -1
- package/dist/styled-components.cjs.js +14 -8
- package/dist/styled-components.cjs.js.map +1 -1
- package/dist/styled-components.esm.js +14 -8
- package/dist/styled-components.esm.js.map +1 -1
- package/dist/styled-components.js +22 -19
- package/dist/styled-components.js.map +1 -1
- package/dist/styled-components.min.js +1 -1
- package/dist/styled-components.min.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +18 -18
- package/dist/utils/hoist.d.ts +3 -3
- package/dist/utils/stylis.d.ts +1 -1
- package/native/dist/base.d.ts +0 -5
- package/native/dist/constructors/constructWithOptions.d.ts +4 -4
- package/native/dist/hoc/withTheme.d.ts +1 -1
- package/native/dist/models/StyleSheetManager.d.ts +3 -3
- package/native/dist/models/ThemeProvider.d.ts +3 -3
- package/native/dist/sheet/Sheet.d.ts +3 -3
- package/native/dist/sheet/types.d.ts +1 -1
- package/native/dist/styled-components.native.cjs.js +1 -1
- package/native/dist/styled-components.native.esm.js +1 -1
- package/native/dist/types.d.ts +18 -18
- package/native/dist/utils/hoist.d.ts +3 -3
- package/native/dist/utils/stylis.d.ts +1 -1
- 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
|
+
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'
|
|
@@ -1541,7 +1541,11 @@ function createStyledComponent(target, options, rules) {
|
|
|
1541
1541
|
checkDynamicCreation(displayName, styledComponentId);
|
|
1542
1542
|
WrappedStyledComponent.warnTooManyClasses = createWarnTooManyClasses(displayName, styledComponentId);
|
|
1543
1543
|
}
|
|
1544
|
-
|
|
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, {
|
|
@@ -1812,22 +1816,21 @@ var __PRIVATE__ = {
|
|
|
1812
1816
|
if (process.env.NODE_ENV !== 'production' &&
|
|
1813
1817
|
typeof navigator !== 'undefined' &&
|
|
1814
1818
|
navigator.product === 'ReactNative') {
|
|
1815
|
-
console.warn("It looks like you've imported 'styled-components' on React Native.\
|
|
1816
|
-
"Perhaps you're looking to import 'styled-components/native'?\n" +
|
|
1817
|
-
'Read more about this at https://www.styled-components.com/docs/basics#react-native');
|
|
1819
|
+
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");
|
|
1818
1820
|
}
|
|
1821
|
+
var windowGlobalKey = "__sc-".concat(SC_ATTR, "__");
|
|
1819
1822
|
/* Warning if there are several instances of styled-components */
|
|
1820
1823
|
if (process.env.NODE_ENV !== 'production' &&
|
|
1821
1824
|
process.env.NODE_ENV !== 'test' &&
|
|
1822
1825
|
typeof window !== 'undefined') {
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
window[
|
|
1826
|
+
// @ts-expect-error dynamic key not in window object
|
|
1827
|
+
window[windowGlobalKey] || (window[windowGlobalKey] = 0);
|
|
1828
|
+
// @ts-expect-error dynamic key not in window object
|
|
1829
|
+
if (window[windowGlobalKey] === 1) {
|
|
1830
|
+
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.");
|
|
1831
|
+
}
|
|
1832
|
+
// @ts-expect-error dynamic key not in window object
|
|
1833
|
+
window[windowGlobalKey] += 1;
|
|
1831
1834
|
}
|
|
1832
1835
|
|
|
1833
1836
|
export { ServerStyleSheet, StyleSheetConsumer, StyleSheetContext, StyleSheetManager, ThemeConsumer, ThemeContext, ThemeProvider, __PRIVATE__, createGlobalStyle, css, styled as default, isStyledComponent, keyframes, styled, useTheme, SC_VERSION as version, withTheme };
|