-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
da6eb17
commit 1f6905f
Showing
7 changed files
with
13,662 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
/node_modules | ||
/umd | ||
npm-debug.log* | ||
.docz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { css } from 'docz-plugin-css'; | ||
import { svgr } from 'docz-plugin-svgr'; | ||
|
||
export default { | ||
themeConfig: { | ||
mode: 'dark' | ||
}, | ||
plugins: [ | ||
svgr(), | ||
css() | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.exports = { | ||
type: 'react-component', | ||
npm: { | ||
esModules: true, | ||
umd: false | ||
} | ||
} | ||
type: 'react-component', | ||
npm: { | ||
esModules: true, | ||
umd: false | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
--- | ||
name: react-json-editor | ||
route: / | ||
--- | ||
|
||
import { Playground, PropsTable } from 'docz' | ||
import JsonPathEditor from './'; | ||
|
||
# React JSON Path editor | ||
|
||
[![Travis][build-badge]][build] | ||
[![npm package][npm-badge]][npm] | ||
[![Coveralls][coveralls-badge]][coveralls] | ||
|
||
A react component that enables simple jsonpath editing by providing autocompletion and preview evaluation in a JSON editor | ||
|
||
<PropsTable of={JsonPathEditor} /> | ||
|
||
## Basic usage | ||
|
||
The editor won't be displayed rigth under the field due to the offset of the playground | ||
|
||
<Playground> | ||
<JsonPathEditor/> | ||
</Playground> | ||
|
||
## With editor position | ||
|
||
With editor position fixing the display issue when the component is encapsulated | ||
|
||
<Playground> | ||
<JsonPathEditor editorPosition={{ x: 31, y: 55 }}/> | ||
</Playground> | ||
|
||
## With a default value | ||
|
||
<Playground> | ||
<JsonPathEditor value='$.' editorPosition={{ x: 31, y: 55 }}/> | ||
</Playground> | ||
|
||
## With a prop | ||
|
||
<Playground> | ||
<JsonPathEditor inputProps={{style: {background: 'black', color: 'white'}}} editorPosition={{ x: 31, y: 55 }}/> | ||
</Playground> | ||
|
||
|
||
## With a callback on change | ||
|
||
<Playground> | ||
<JsonPathEditor onChange={(newValue) => { console.log(newValue) }} editorPosition={{ x: 31, y: 55 }}/> | ||
</Playground> | ||
|
||
## With a json | ||
|
||
<Playground> | ||
<JsonPathEditor json={{ | ||
"data": [{ | ||
"type": "articles", | ||
"id": "1", | ||
"attributes": { | ||
"title": "JSON API paints my bikeshed!", | ||
"body": "The shortest article. Ever.", | ||
"created": "2015-05-22T14:56:29.000Z", | ||
"updated": "2015-05-22T14:56:28.000Z" | ||
}, | ||
"relationships": { | ||
"author": { | ||
"data": {"id": "42", "type": "people"} | ||
} | ||
} | ||
}], | ||
"included": [ | ||
{ | ||
"type": "people", | ||
"id": "42", | ||
"attributes": { | ||
"name": "John", | ||
"age": 80, | ||
"gender": "male" | ||
} | ||
} | ||
] | ||
}} editorPosition={{ x: 31, y: 55 }}/> | ||
</Playground> | ||
|
||
[build-badge]: https://img.shields.io/travis/JeanBaptisteWATENBERG/react-jsonpath-editor/master.png?style=flat-square | ||
[build]: https://travis-ci.org/JeanBaptisteWATENBERG/react-jsonpath-editor | ||
|
||
[npm-badge]: https://img.shields.io/npm/v/react-jsonpath-editor.png?style=flat-square | ||
[npm]: https://www.npmjs.com/package/react-jsonpath-editor | ||
|
||
[coveralls-badge]: https://img.shields.io/coveralls/JeanBaptisteWATENBERG/react-jsonpath-editor/master.png?style=flat-square | ||
[coveralls]: https://coveralls.io/github/JeanBaptisteWATENBERG/react-jsonpath-editor |
Oops, something went wrong.