@aeaton/react-prosemirror
Advanced tools
Comparing version 0.22.1 to 2.0.0-alpha.3
{ | ||
"name": "@aeaton/react-prosemirror", | ||
"version": "0.22.1", | ||
"description": "A React component for ProseMirror", | ||
"main": "dist", | ||
"version": "2.0.0-alpha.3", | ||
"main": "index.js", | ||
"source": "index.ts", | ||
"types": "index.d.ts", | ||
"files": [ | ||
"dist", | ||
"src" | ||
"**/*.{js,jsx,d.ts}", | ||
"style" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"author": "Alf Eaton <eaton.alf@gmail.com>", | ||
"license": "MIT", | ||
"repository": "hubgit/react-prosemirror", | ||
"dependencies": { | ||
"classnames": "^2.2.5", | ||
"lodash": "^4.17.4", | ||
"prosemirror-model": "^1.0.0", | ||
"prosemirror-state": "^1.1.0", | ||
"prosemirror-view": "^1.1.1" | ||
"@aeaton/prosemirror-transformers": "^2.0.0-alpha.3" | ||
}, | ||
"devDependencies": { | ||
"babel-core": "^6.26.0", | ||
"babel-loader": "^7.1.2", | ||
"babel-preset-env": "^1.6.1", | ||
"babel-preset-react": "^6.24.1", | ||
"babel-preset-stage-2": "^6.24.1", | ||
"clean-webpack-plugin": "^0.1.17", | ||
"css-loader": "^0.28.7", | ||
"style-loader": "^0.20.1", | ||
"webpack": "^3.8.1", | ||
"webpack-node-externals": "^1.6.0" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.3.0", | ||
"react-dom": "^16.3.0" | ||
"prosemirror-model": "^1.13.1", | ||
"prosemirror-state": "^1.3.4", | ||
"prosemirror-view": "^1.17.3", | ||
"react": "^17.0.1" | ||
}, | ||
"scripts": { | ||
"prepublishOnly": "npm run build", | ||
"build": "webpack --progress" | ||
} | ||
"gitHead": "3e8f8b94fe38fdfa49aa0253111af8cdc3ad4f54" | ||
} |
## Installation | ||
`npm install @aeaton/react-prosemirror --save` | ||
`npm install @aeaton/react-prosemirror` | ||
@@ -17,46 +17,18 @@ or | ||
```js | ||
import React from 'react' | ||
import { HtmlEditor } from '@aeaton/react-prosemirror' | ||
import { options } from '@aeaton/react-prosemirror-config-default' | ||
```jsx | ||
import { HtmlEditor, Editor, Toolbar } from '@aeaton/react-prosemirror' | ||
import { schema, plugins, toolbar } from '@aeaton/react-prosemirror-config-default' | ||
const CustomEditor = ({ value, onChange }) => ( | ||
export const CustomEditor = ({ value, handleChange }) => ( | ||
<HtmlEditor | ||
options={options} | ||
schema={schema} | ||
plugins={plugins} | ||
value={value} | ||
onChange={onChange} | ||
/> | ||
handleChange={handleChange} | ||
> | ||
<Toolbar toolbar={toolbar} /> | ||
<Editor /> | ||
</HtmlEditor> | ||
) | ||
export default CustomEditor | ||
``` | ||
Use a `render` prop to add the menu bar: | ||
```js | ||
import React from 'react' | ||
import { HtmlEditor, MenuBar } from '@aeaton/react-prosemirror' | ||
import { options, menu } from '@aeaton/react-prosemirror-config-default' | ||
const CustomEditor = ({ value, onChange }) => ( | ||
<HtmlEditor | ||
options={options} | ||
value={value} | ||
onChange={onChange} | ||
render={({ editor, view }) => ( | ||
<div> | ||
<MenuBar menu={menu} view={view} /> | ||
{editor} | ||
</div> | ||
)} | ||
/> | ||
) | ||
export default CustomEditor | ||
``` | ||
## Development | ||
1. Run `lerna run build` | ||
2. Run `lerna publish` | ||
3. Run `lerna run deploy` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5
0
25
14314
303
2
34
1
+ Added@aeaton/prosemirror-transformers@2.0.2(transitive)
+ Added@types/linkify-it@5.0.0(transitive)
+ Added@types/markdown-it@14.1.2(transitive)
+ Added@types/mdurl@2.0.0(transitive)
+ Addedargparse@2.0.1(transitive)
+ Addedentities@2.1.04.5.0(transitive)
+ Addedlinkify-it@3.0.35.0.0(transitive)
+ Addedmarkdown-it@12.3.214.1.0(transitive)
+ Addedmdurl@1.0.12.0.0(transitive)
+ Addedprosemirror-markdown@1.13.1(transitive)
+ Addedpunycode.js@2.3.1(transitive)
+ Addedreact@17.0.2(transitive)
+ Addeduc.micro@1.0.62.1.0(transitive)
- Removedclassnames@^2.2.5
- Removedlodash@^4.17.4
- Removedprosemirror-model@^1.0.0
- Removedprosemirror-state@^1.1.0
- Removedprosemirror-view@^1.1.1
- Removedclassnames@2.5.1(transitive)
- Removedlodash@4.17.21(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact@16.14.0(transitive)
- Removedreact-dom@16.14.0(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedscheduler@0.19.1(transitive)