Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xstyled/core

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xstyled/core - npm Package Compare versions

Comparing version 1.18.1 to 1.19.0

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

# [1.19.0](https://github.com/smooth-code/xstyled/tree/master/packages/core/compare/v1.18.1...v1.19.0) (2020-09-10)
**Note:** Version bump only for package @xstyled/core
## [1.18.1](https://github.com/smooth-code/xstyled/tree/master/packages/core/compare/v1.18.0...v1.18.1) (2020-08-10)

@@ -8,0 +16,0 @@

74

dist/xstyled-core.cjs.js

@@ -5,10 +5,14 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var React = _interopDefault(require('react'));
var React = require('react');
var system = require('@xstyled/system');
var _objectWithoutPropertiesLoose = _interopDefault(require('@babel/runtime/helpers/objectWithoutPropertiesLoose'));
var _extends = _interopDefault(require('@babel/runtime/helpers/extends'));
var _objectWithoutPropertiesLoose = require('@babel/runtime/helpers/objectWithoutPropertiesLoose');
var _extends = require('@babel/runtime/helpers/extends');
var util = require('@xstyled/util');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var _objectWithoutPropertiesLoose__default = /*#__PURE__*/_interopDefaultLegacy(_objectWithoutPropertiesLoose);
var _extends__default = /*#__PURE__*/_interopDefaultLegacy(_extends);
/* eslint-disable no-undef */

@@ -47,7 +51,7 @@ function useThemeBreakpoints(theme) {

function useViewportWidth() {
var _React$useState = React.useState(typeof window === 'undefined' ? null : window.innerWidth),
var _React$useState = React__default['default'].useState(typeof window === 'undefined' ? null : window.innerWidth),
width = _React$useState[0],
setWidth = _React$useState[1];
React.useEffect(function () {
React__default['default'].useEffect(function () {
function handleResize() {

@@ -69,3 +73,3 @@ setWidth(window.innerWidth);

var width = useViewportWidth();
return React.useMemo(function () {
return React__default['default'].useMemo(function () {
return Object.keys(breakpoints).reverse().find(function (breakpoint) {

@@ -376,4 +380,4 @@ return width > breakpoints[breakpoint];

function getModeTheme(theme, mode) {
return _extends({}, theme, {
colors: _extends({}, theme.colors, theme.colors.modes[mode])
return _extends__default['default']({}, theme, {
colors: _extends__default['default']({}, theme.colors, theme.colors.modes[mode])
});

@@ -419,3 +423,3 @@ }

modes = _theme$colors.modes,
colors = _objectWithoutPropertiesLoose(_theme$colors, ["modes"]);
colors = _objectWithoutPropertiesLoose__default['default'](_theme$colors, ["modes"]);

@@ -429,5 +433,5 @@ var styles = toCustomPropertiesDeclarations(colors, XSTYLED_COLORS_PREFIX, theme);

modes = _modeTheme$colors.modes,
colors = _objectWithoutPropertiesLoose(_modeTheme$colors, ["modes"]);
colors = _objectWithoutPropertiesLoose__default['default'](_modeTheme$colors, ["modes"]);
return toCustomPropertiesDeclarations(_extends({}, colors, modes[mode]), XSTYLED_COLORS_PREFIX, modeTheme);
return toCustomPropertiesDeclarations(_extends__default['default']({}, colors, modes[mode]), XSTYLED_COLORS_PREFIX, modeTheme);
}

@@ -462,3 +466,3 @@

function useSystemMode(theme) {
var configs = React.useMemo(function () {
var configs = React__default['default'].useMemo(function () {
if (!hasMediaQueryEnabled(theme)) return [];

@@ -475,3 +479,3 @@ return SYSTEM_MODES.map(function (mode) {

var _React$useState = React.useState(function () {
var _React$useState = React__default['default'].useState(function () {
var config = configs.find(function (config) {

@@ -485,3 +489,3 @@ return config.mql.matches;

React.useEffect(function () {
React__default['default'].useEffect(function () {
var cleans = configs.filter(function (_ref2) {

@@ -520,3 +524,3 @@ var mql = _ref2.mql;

var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;
var useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React__default['default'].useLayoutEffect : React__default['default'].useEffect;
function useColorModeState(theme, _temp2) {

@@ -530,3 +534,3 @@ var _ref5 = _temp2 === void 0 ? {} : _temp2,

var _React$useState2 = React.useState(function () {
var _React$useState2 = React__default['default'].useState(function () {
if (!hasColorModes(theme)) return null;

@@ -540,4 +544,4 @@ return defaultColorMode;

var customPropertiesEnabled = hasCustomPropertiesEnabled(theme);
var manualSetRef = React.useRef(false);
var manuallySetMode = React.useCallback(function (value) {
var manualSetRef = React__default['default'].useRef(false);
var manuallySetMode = React__default['default'].useCallback(function (value) {
manualSetRef.current = true;

@@ -586,3 +590,3 @@ setMode(value);

function useColorModeTheme(theme, mode) {
var customPropertiesTheme = React.useMemo(function () {
var customPropertiesTheme = React__default['default'].useMemo(function () {
if (!hasCustomPropertiesEnabled(theme)) return null;

@@ -593,6 +597,6 @@ if (!hasColorModes(theme)) return theme;

modes = _theme$colors2.modes,
colors = _objectWithoutPropertiesLoose(_theme$colors2, ["modes"]);
colors = _objectWithoutPropertiesLoose__default['default'](_theme$colors2, ["modes"]);
return _extends({}, theme, {
colors: _extends({}, toCustomPropertiesReferences(colors, XSTYLED_COLORS_PREFIX, theme), {
return _extends__default['default']({}, theme, {
colors: _extends__default['default']({}, toCustomPropertiesReferences(colors, XSTYLED_COLORS_PREFIX, theme), {
modes: modes

@@ -603,3 +607,3 @@ }),

}, [theme]);
var swapModeTheme = React.useMemo(function () {
var swapModeTheme = React__default['default'].useMemo(function () {
if (hasCustomPropertiesEnabled(theme)) return null;

@@ -609,3 +613,3 @@ if (!hasColorModes(theme)) return theme;

if (mode === getInitialColorModeName(theme)) {
return _extends({}, theme, {
return _extends__default['default']({}, theme, {
__colorMode: mode

@@ -615,4 +619,4 @@ });

return _extends({}, theme, {
colors: _extends({}, theme.colors, theme.colors.modes[mode]),
return _extends__default['default']({}, theme, {
colors: _extends__default['default']({}, theme.colors, theme.colors.modes[mode]),
__colorMode: mode,

@@ -624,5 +628,5 @@ __rawColors: theme.colors

}
var ColorModeContext = /*#__PURE__*/React.createContext();
var ColorModeContext = /*#__PURE__*/React__default['default'].createContext();
function useColorMode() {
var colorModeState = React.useContext(ColorModeContext);
var colorModeState = React__default['default'].useContext(ColorModeContext);

@@ -644,3 +648,3 @@ if (!colorModeState) {

targetSelector = _ref7.targetSelector;
var theme = React.useContext(ThemeContext);
var theme = React__default['default'].useContext(ThemeContext);

@@ -655,7 +659,7 @@ if (!theme) {

var colorModeTheme = useColorModeTheme(theme, colorState[0]);
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ColorModeStyle, {
return /*#__PURE__*/React__default['default'].createElement(React__default['default'].Fragment, null, /*#__PURE__*/React__default['default'].createElement(ColorModeStyle, {
targetSelector: targetSelector
}), /*#__PURE__*/React.createElement(ThemeProvider, {
}), /*#__PURE__*/React__default['default'].createElement(ThemeProvider, {
theme: colorModeTheme
}, /*#__PURE__*/React.createElement(ColorModeContext.Provider, {
}, /*#__PURE__*/React__default['default'].createElement(ColorModeContext.Provider, {
value: colorState

@@ -677,3 +681,3 @@ }, children)));

function getColorModeInitScriptElement(options) {
return /*#__PURE__*/React.createElement("script", {
return /*#__PURE__*/React__default['default'].createElement("script", {
key: "xstyled-color-mode-init",

@@ -680,0 +684,0 @@ dangerouslySetInnerHTML: {

{
"name": "@xstyled/core",
"description": "xstyled core utilities",
"version": "1.18.1",
"version": "1.19.0",
"sideEffects": false,

@@ -25,6 +25,6 @@ "main": "dist/xstyled-core.cjs.js",

"dependencies": {
"@babel/runtime": "^7.10.5",
"@xstyled/system": "^1.17.2"
"@babel/runtime": "^7.11.2",
"@xstyled/system": "^1.19.0"
},
"gitHead": "a0797170bac3b952dc08d68cc69e678d9582df16"
"gitHead": "f25ca826b25490a88c097768661d99f25b8cfa1f"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc