{"bugs":{"url":"https://github.com/facebook/draft-js/issues"},"dist":{"shasum":"dd272d9c9e1299c3bd94f5f4aac3ac2784551d4c","tarball":"https://registry.npmjs.org/draft-js/-/draft-js-0.11.2.tgz","fileCount":337,"integrity":"sha512-JU96XdAigQ4hAmyBMVXps6RQ8+dMhhNI1dDJPMP6OeHuSv+uwDzDg/7lxGQ1PEq+1Q6575jtvxDa7Aw3vy0WHA==","signatures":[{"sig":"MEYCIQDoaZTMYGeVONzfMVf+ht7dTUgydCMt4Y3WlG4Ln+OdoAIhAOli50Ob2Oh6yhLP5IOMR2G7duLom2NVEk/H/phmbni/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1742086,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdkmVtCRA9TVsSAnZWagAAQtEP/0sYgmmcCedfolVVkuxy\n6ezAtWjAayNw31WibK5MnuPtH1rKpEcKqTSpLN1fBwPb6cBnlKvkJe/AEhhW\n5TOFL2/OogMVbk3QdtOdWW3cbrhnbPxcydgGsiFZgqomHEpqbGuGRz/Itfdk\nMFewqHlE82qa9h2uY6XSe7Voi86qhHoCSdLa+dwXJfhIpRwKOjOcNHzyWw2z\nM8pMiqQdMSl/QvKHuFc3NFEh7ngA7qOZxZzXp+PqU5lhqQ9o+491lRAdc5xr\nyFWcO/Z4s/dcYMkxU5XZfzNSA/4n+jvdMxA28umkDGiYSx4EDRT39ZnrE6JY\nkNfrsUGTwsKkwQoSSraxwgf/rFALlApBBcqeyDDmR0kbGsr4rzT6fBJBkHKP\neeHfy+yeuolMZXBtv8PEzjynO2Hbb55Cx72NdWpL7Nl9MqN+/yQEe02Z0QcX\nWx8MU8ONCMRcvflIpb36vOTv8xR8L/d0YmF3xF3R4gUc0Vuk6L3Uj9BIbpuK\nuSSCYa9yoCGy5W5v1BsegX0kKStMvx+USknnTT4s7aphrw1Zhl12tOBKiIQA\n9nWVv63vkoQyg2fU/ZFQvIJyfv9ExBijAMzRam8QchG4I+WrkNWNO5WtpjKl\nctUhxX5uOR6gNfPsPUlqz2b1iVFKbDrlGy0ovQt4flp+5VjFl6X+f+BJyfHN\n8f04\r\n=NHdx\r\n-----END PGP SIGNATURE-----\r\n"},"jest":{"haste":{"hasteImplModulePath":"<rootDir>/scripts/jest/hasteImpl.js"},"roots":["<rootDir>/src/"],"globals":{"__DEV__":true},"rootDir":"./","automock":true,"transform":{".*":"<rootDir>/scripts/jest/preprocessor.js"},"setupFiles":["<rootDir>/scripts/jest/shims.js"],"transformIgnorePatterns":["<rootDir>/node_modules/"],"modulePathIgnorePatterns":["<rootDir>/lib/","<rootDir>/node_modules/"],"unmockedModulePathPatterns":["<rootDir>/node_modules/fbjs/node_modules/","<rootDir>/node_modules/fbjs/lib/UserAgent.js","<rootDir>/node_modules/fbjs/lib/UserAgentData.js","<rootDir>/node_modules/fbjs-scripts/","<rootDir>/node_modules/immutable/","<rootDir>/node_modules/object-assign/","<rootDir>/node_modules/react/","<rootDir>/node_modules/react-dom/"]},"main":"lib/Draft.js","name":"draft-js","style":"dist/Draft.css","readme":"# [Draft.js](http://draftjs.org/) [![Build Status](https://img.shields.io/travis/facebook/draft-js/master.svg?style=flat)](https://travis-ci.org/facebook/draft-js) [![npm version](https://img.shields.io/npm/v/draft-js.svg?style=flat)](https://yarn.pm/draft-js)\n\n![Live Demo](https://media.giphy.com/media/XHUjaxELpc11SiRSqN/giphy.gif)\n\nDraft.js is a JavaScript rich text editor framework, built for React and\nbacked by an immutable model.\n\n- **Extensible and Customizable:** We provide the building blocks to enable\nthe creation of a broad variety of rich text composition experiences, from\nsimple text styles to embedded media.\n- **Declarative Rich Text:** Draft.js fits seamlessly into\n[React](http://facebook.github.io/react/) applications,\nabstracting away the details of rendering, selection, and input behavior with a\nfamiliar declarative API.\n- **Immutable Editor State:** The Draft.js model is built\nwith [immutable-js](https://facebook.github.io/immutable-js/), offering\nan API with functional state updates and aggressively leveraging data persistence\nfor scalable memory usage.\n\n[Learn how to use Draft.js in your own project.](https://draftjs.org/docs/getting-started.html)\n\n## API Notice\n\nBefore getting started, please be aware that we recently changed the API of\nEntity storage in Draft. The latest version, `v0.10.0`, supports both the old\nand new API.  Following that up will be `v0.11.0` which will remove the old API.\nIf you are interested in helping out, or tracking the progress, please follow\n[issue 839](https://github.com/facebook/draft-js/issues/839).\n\n## Getting Started\n\nCurrently Draft.js is distributed via npm. It depends on React and React DOM which must also be installed.\n\n```\nnpm install --save draft-js react react-dom\n\nor\n\nyarn add draft-js react react-dom\n```\n\n### Using Draft.js\n\n```javascript\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport {Editor, EditorState} from 'draft-js';\n\nclass MyEditor extends React.Component {\n  constructor(props) {\n    super(props);\n    this.state = {editorState: EditorState.createEmpty()};\n    this.onChange = (editorState) => this.setState({editorState});\n    this.setEditor = (editor) => {\n      this.editor = editor;\n    };\n    this.focusEditor = () => {\n      if (this.editor) {\n        this.editor.focus();\n      }\n    };\n  }\n\n  componentDidMount() {\n    this.focusEditor();\n  }\n\n  render() {\n    return (\n      <div style={styles.editor} onClick={this.focusEditor}>\n        <Editor\n          ref={this.setEditor}\n          editorState={this.state.editorState}\n          onChange={this.onChange}\n        />\n      </div>\n    );\n  }\n}\n\nconst styles = {\n  editor: {\n    border: '1px solid gray',\n    minHeight: '6em'\n  }\n};\n\nReactDOM.render(\n  <MyEditor />,\n  document.getElementById('container')\n);\n```\n\nSince the release of React 16.8, you can use [Hooks](https://reactjs.org/docs/hooks-intro.html) as a way to work with `EditorState` without using a class.\n\n\n```js\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport {Editor, EditorState} from 'draft-js';\n\nfunction MyEditor() {\n  const [editorState, setEditorState] = React.useState(\n    EditorState.createEmpty()\n  );\n\n  const editor = React.useRef(null);\n\n  function focusEditor() {\n    editor.current.focus();\n  }\n\n  React.useEffect(() => {\n    focusEditor()\n  }, []);\n\n  return (\n    <div onClick={focusEditor}>\n      <Editor\n        ref={editor}\n        editorState={editorState}\n        onChange={editorState => setEditorState(editorState)}\n      />\n    </div>\n  );\n}\n\n```\n\nNote that the editor itself is only as tall as its contents. In order to give users a visual cue, we recommend setting a border and a minimum height via the `.DraftEditor-root` CSS selector, or using a wrapper div like in the above example.\n\nBecause Draft.js supports unicode, you must have the following meta tag in the `<head>` `</head>` block of your HTML file:\n\n```html\n<meta charset=\"utf-8\" />\n```\nFurther examples of how Draft.js can be used are provided below.\n\n### Examples\n\nVisit http://draftjs.org/ to try out a simple rich editor example.\n\nThe repository includes a variety of different editor examples to demonstrate\nsome of the features offered by the framework.\n\nTo run the examples, first build Draft.js locally:\n\n```\ngit clone https://github.com/facebook/draft-js.git\ncd draft-js\nnpm install\nnpm run build\n```\n\nthen open the example HTML files in your browser.\n\nDraft.js is used in production on Facebook, including status and\ncomment inputs, [Notes](https://www.facebook.com/notes/), and\n[messenger.com](https://www.messenger.com).\n\n## Browser Support\n\n| ![IE / Edge](https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/edge.png) <br /> IE / Edge | ![Firefox](https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/firefox.png) <br /> Firefox | ![Chrome](https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/chrome.png) <br /> Chrome | ![Safari](https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/safari.png ) <br /> Safari | ![iOS Safari](https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/safari-ios.png) <br />iOS Safari | ![Chrome for Android](https://raw.githubusercontent.com/godban/browsers-support-badges/master/src/images/chrome-android.png) <br/> Chrome for Android |\n| --------- | --------- | --------- | --------- | --------- | --------- |\n| IE11, Edge [1, 2]| last 2 versions| last 2 versions| last 2 versions| not fully supported [3] | not fully supported [3]\n\n[1] May need a shim or a polyfill for some syntax used in Draft.js ([docs](https://draftjs.org/docs/advanced-topics-issues-and-pitfalls.html#polyfills)).\n\n[2] IME inputs have known issues in these browsers, especially Korean ([docs](https://draftjs.org/docs/advanced-topics-issues-and-pitfalls.html#ime-and-internet-explorer)).\n\n[3] There are known issues with mobile browsers, especially on Android ([docs](https://draftjs.org/docs/advanced-topics-issues-and-pitfalls.html#mobile-not-yet-supported)).\n\n## Resources and Ecosystem\n\nCheck out this curated list of articles and open-sourced projects/utilities: [Awesome Draft-JS](https://github.com/nikgraf/awesome-draft-js).\n\n## Discussion and Support\n\nJoin our [Slack team](https://draftjs.herokuapp.com)!\n\n## Contribute\n\nWe actively welcome pull requests. Learn how to\n[contribute](https://github.com/facebook/draft-js/blob/master/CONTRIBUTING.md).\n\n## License\n\nDraft.js is [MIT licensed](https://github.com/facebook/draft-js/blob/master/LICENSE).\n\nExamples provided in this repository and in the documentation are separately\nlicensed.\n","gitHead":"42a9d8b04315cbe7bd7a2fa01e29387c6fae09e1","license":"MIT","scripts":{"dev":"gulp dev","flow":"flow src","lint":"eslint .","test":"cross-env NODE_ENV=test jest","build":"gulp","format":"eslint . --fix","pretest":"node node_modules/fbjs-scripts/node/check-dev-engines.js package.json","test-ci":"cross-env NODE_ENV=test npm run lint && npm run flow && npm run test","postbuild":"node node_modules/fbjs-scripts/node/check-lib-requires.js lib","prepublish":"npm run build"},"_npmUser":{"name":"claudiopro","email":"claudio.procida@gmail.com"},"homepage":"http://draftjs.org/","keywords":["draftjs","editor","react","richtext"],"devEngines":{"npm":"2.x || 3.x || 5.x || 6.x","node":"8.x || 9.x || 10.x"},"repository":{"url":"git+https://github.com/facebook/draft-js.git","type":"git"},"_npmVersion":"6.4.1","description":"A React framework for building text editors.","directories":{},"maintainers":[{"name":"claudiopro","email":"claudio.procida@gmail.com"},{"name":"fb","email":"opensource+npm@fb.com"},{"name":"flarnie","email":"flarnie.npm@gmail.com"},{"name":"sophiebits","email":"npm@sophiebits.com"},{"name":"zpao","email":"paul@oshannessy.com"}],"_nodeVersion":"10.14.2","dependencies":{"fbjs":"^1.0.0","immutable":"~3.7.4","object-assign":"^4.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"del":"^2.2.0","gulp":"^4.0.0","jest":"^24.1.0","react":"^16.8.0","envify":"^3.4.0","eslint":"^5.16.0","gulp-if":"^2.0.2","es6-shim":"^0.34.4","flow-bin":"^0.92.0","prettier":"1.13.6","through2":"^2.0.1","cross-env":"^5.1.3","gulp-util":"^3.0.6","react-dom":"^16.8.0","gulp-babel":"^8.0.0","@babel/core":"^7.3.4","gulp-header":"1.8.2","gulp-rename":"^1.2.2","gulp-uglify":"^1.2.0","babel-eslint":"^8.1.1","fbjs-scripts":"^1.1.0","gulp-flatten":"^0.2.0","vinyl-buffer":"^1.0.0","gulp-clean-css":"^2.0.3","gulp-derequire":"^2.1.0","webpack-stream":"^4.0.0","gulp-concat-css":"^2.2.0","babel-preset-fbjs":"^3.2.0","eslint-config-fbjs":"^2.0.0","eslint-plugin-babel":"^4.1.1","eslint-plugin-react":"^7.3.0","eslint-plugin-relay":"^0.0.8","react-test-renderer":"^16.0.0","stats-webpack-plugin":"^0.6.2","eslint-config-prettier":"^2.6.0","eslint-plugin-flowtype":"^2.17.1","eslint-plugin-jsx-a11y":"^6.0.2","eslint-plugin-prettier":"^2.3.1","uglifyjs-webpack-plugin":"^1.1.6","@babel/plugin-proposal-optional-chaining":"^7.6.0","@babel/plugin-proposal-nullish-coalescing-operator":"^7.4.4"},"peerDependencies":{"react":"^0.14.0 || ^15.0.0-rc || ^16.0.0-rc || ^16.0.0","react-dom":"^0.14.0 || ^15.0.0-rc || ^16.0.0-rc || ^16.0.0"},"_npmOperationalInternal":{"tmp":"tmp/draft-js_0.11.2_1569875308882_0.9354598712542075","host":"s3://npm-registry-packages"},"_id":"draft-js@0.11.2","version":"0.11.2"}