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

react-with-direction

Package Overview
Dependencies
Maintainers
4
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-with-direction - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0

dist/AutoDirectionProvider.js

3

CHANGELOG.md
# Change Log
## v1.3.0
- [New] Add `AutoDirectionProvider` component for automatically detected direction.
## v1.2.0

@@ -4,0 +7,0 @@ - [New] Add `inline` option; if specified, will render a `span` instead of a `div`.

27

package.json
{
"name": "react-with-direction",
"version": "1.2.0",
"version": "1.3.0",
"description": "Components to provide and consume RTL or LTR direction in React",

@@ -19,5 +19,6 @@ "author": "Yaniv Zimet <yaniv.zimet@airbnb.com>",

"test": "npm run test:only",
"test:watch": "npm run test:only -- --watchAll",
"clean": "rimraf dist",
"react": "enzyme-adapter-react-install 16",
"prepublish": "safe-publish-latest"
"prepublish": "safe-publish-latest && npm run build"
},

@@ -28,4 +29,5 @@ "dependencies": {

"deepmerge": "^1.5.1",
"direction": "^1.0.1",
"hoist-non-react-statics": "^2.3.1",
"object.assign": "^4.0.4",
"object.assign": "^4.1.0",
"object.values": "^1.0.4",

@@ -39,22 +41,21 @@ "prop-types": "^15.6.0"

"babel-preset-airbnb": "^2.4.0",
"casual": "^1.5.17",
"casual": "^1.5.19",
"chai": "^4.1.2",
"chai-enzyme": "^1.0.0-beta.0",
"enzyme": "^3.2.0",
"enzyme-adapter-react-helper": "^1.0.3",
"eslint": "^4.11.0",
"enzyme": "^3.3.0",
"enzyme-adapter-react-helper": "^1.2.2",
"eslint": "^4.15.0",
"eslint-config-airbnb": "^16.1.0",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-react": "^7.5.1",
"jest": "^21.2.1",
"react": "^0.14 || ^15 || ^16",
"react-dom": "^0.14 || ^15 || ^16",
"react-test-renderer": "^0.14 || ^15 || ^16",
"rimraf": "^2.6.2",
"safe-publish-latest": "^1.1.1",
"sinon": "^4.1.2",
"sinon": "^4.1.6",
"sinon-chai": "^2.14.0",
"sinon-sandbox": "^1.0.2",
"webpack": "^3.7.1"
"webpack": "^3.10.0"
},

@@ -61,0 +62,0 @@ "peerDependencies": {

@@ -66,2 +66,22 @@ # react-with-direction <sup>[![Version Badge][npm-version-svg]][package-url]</sup>

## AutoDirectionProvider
Use `AutoDirectionProvider` around, for example, user-generated content where the text direction is unknown or may change. This renders a `DirectionProvider` with the `direction` prop automatically set based on the `text` prop provided.
Direction will be determined based on the first strong LTR/RTL character in the `text` string. Strings with no strong direction (e.g., numbers) will inherit the direction from its nearest `DirectionProvider` ancestor or default to LTR.
Usage example:
```js
import AutoDirectionProvider from 'react-with-direction/dist/AutoDirectionProvider';
```
```js
<AutoDirectionProvider text={userGeneratedContent}>
<ExampleComponent>
{userGeneratedContent}
</ExampleComponent>
</AutoDirectionProvider>
```
[package-url]: https://npmjs.org/package/react-with-direction

@@ -68,0 +88,0 @@ [npm-version-svg]: http://versionbadg.es/airbnb/react-with-direction.svg

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