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

react-with-styles-interface-aphrodite

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-with-styles-interface-aphrodite - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

test/withRTLExtension_test.js

3

CHANGELOG.md

@@ -0,1 +1,4 @@

## v2.0.1
- Fix RTL support for pseudoselectors and match media queries
## v2.0.0

@@ -2,0 +5,0 @@ - Add RTL support in the resolve method

12

lib/withRTLExtension.js

@@ -7,2 +7,4 @@ Object.defineProperty(exports, "__esModule", {

var styleDefRegex = /\.[^{}]+\{[^{}]+\}/g;
/*

@@ -22,11 +24,7 @@ * When automatically flipping CSS styles in our interface, instead of determining RTL/LTR context

// generated may include more than one style definition. We want to prefix each one individually.
// This primarily happens for pseudo selectors for which generated looks like
// .classname::selector{...}.classname::otherselector{...}
// This is the only case we really worry about, and as a result, we split on '}.' which marks the
// end of style definition and beginning of a new one.
var styleDefs = generated.split('}.').map(function (g) {
// generated may include more than one style definition (pseudoselectors, matchmedia, etc.).
// We want to prefix each one individually.
return generated.replace(styleDefRegex, function (g) {
return '[dir="rtl"] ' + String(g);
});
return styleDefs.join('}.');
}

@@ -33,0 +31,0 @@

{
"name": "react-with-styles-interface-aphrodite",
"version": "2.0.0",
"version": "2.0.1",
"description": "react-with-styles interface for Aphrodite",

@@ -50,6 +50,9 @@ "main": "lib/aphroditeInterface.js",

"eslint": "^3.13.1",
"eslint-config-airbnb-base": "^11.0.1",
"eslint-config-airbnb": "^15.1.0",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-react": "^7.3.0",
"in-publish": "^2.0.0",
"mocha": "^3.2.0",
"prop-types": "^15.5.10",
"react": "^15.4.2",

@@ -56,0 +59,0 @@ "react-dom": "^15.4.2",

export const RTL_SELECTOR = '_rtl';
const styleDefRegex = /\.[^{}]+\{[^{}]+\}/g;
/*

@@ -17,9 +19,5 @@ * When automatically flipping CSS styles in our interface, instead of determining RTL/LTR context

// generated may include more than one style definition. We want to prefix each one individually.
// This primarily happens for pseudo selectors for which generated looks like
// .classname::selector{...}.classname::otherselector{...}
// This is the only case we really worry about, and as a result, we split on '}.' which marks the
// end of style definition and beginning of a new one.
const styleDefs = generated.split('}.').map(g => `[dir="rtl"] ${g}`);
return styleDefs.join('}.');
// generated may include more than one style definition (pseudoselectors, matchmedia, etc.).
// We want to prefix each one individually.
return generated.replace(styleDefRegex, g => `[dir="rtl"] ${g}`);
}

@@ -26,0 +24,0 @@

Sorry, the diff of this file is not supported yet

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