{"id":13758257,"url":"https://github.com/samuelmeuli/draft-js-list-plugin","last_synced_at":"2025-05-06T21:48:59.071Z","repository":{"id":57215946,"uuid":"204336848","full_name":"samuelmeuli/draft-js-list-plugin","owner":"samuelmeuli","description":"📝 Better lists for Draft.js","archived":false,"fork":false,"pushed_at":"2020-07-18T03:47:04.000Z","size":1371,"stargazers_count":14,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-21T21:02:07.174Z","etag":null,"topics":["draft-js","draft-js-plugins","react","text-editor"],"latest_commit_sha":null,"homepage":"https://draft-js-list-plugin.samuelmeuli.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samuelmeuli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-08-25T18:55:11.000Z","updated_at":"2022-06-15T21:15:41.000Z","dependencies_parsed_at":"2022-08-26T13:42:00.155Z","dependency_job_id":null,"html_url":"https://github.com/samuelmeuli/draft-js-list-plugin","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Fdraft-js-list-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Fdraft-js-list-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Fdraft-js-list-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samuelmeuli%2Fdraft-js-list-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samuelmeuli","download_url":"https://codeload.github.com/samuelmeuli/draft-js-list-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249675568,"owners_count":21309324,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["draft-js","draft-js-plugins","react","text-editor"],"created_at":"2024-08-03T13:00:23.345Z","updated_at":"2025-04-19T10:30:54.245Z","avatar_url":"https://github.com/samuelmeuli.png","language":"TypeScript","readme":"# Draft.js List Plugin\n\n**Better lists for Draft.js**\n\n- **Automatically creates lists when lines begin with `*`, `1.` or similar**\n- **Allows creating nested lists using the tab key**\n- Simple setup\n- TypeScript type definitions\n\n→ **[Demo](https://draft-js-list-plugin.samuelmeuli.com)**\n\n\u003cimg src=\"./.github/demo.gif\" alt=\"Plugin demo\" width=\"70%\"\u003e\n\n## Usage\n\nThis plugin requires you to have [`draft-js-plugins`](https://github.com/draft-js-plugins/draft-js-plugins) set up in your project.\n\nInstall the plugin using NPM:\n\n```sh\nnpm install draft-js-list-plugin\n```\n\nImport the list plugin in your Editor component:\n\n```jsx\nimport React, { Component } from \"react\";\nimport PluginEditor from \"draft-js-plugins-editor\";\nimport createListPlugin from \"draft-js-list-plugin\";\n\n// Make sure to import `Draft.css` somewhere\nimport \"draft-js/dist/Draft.css\";\n\nconst listPlugin = createListPlugin();\nconst plugins = [listPlugin];\n\nexport default class Editor extends Component {\n\t// ...\n\n\trender() {\n\t\tconst { editorState } = this.state;\n\n\t\treturn (\n\t\t\t\u003cPluginEditor\n\t\t\t\t// ...\n\t\t\t\teditorState={editorState}\n\t\t\t\tplugins={plugins}\n\t\t\t/\u003e\n\t\t);\n\t}\n}\n```\n\nSee [Editor.tsx](./demo/src/Editor.tsx) for a full example.\n\n## Configuration\n\nYou can pass options to the plugin the following way:\n\n```jsx\nconst listPlugin = createListPlugin({\n\t// Your options\n});\n```\n\nSupported options:\n\n- **`allowNestedLists`** (`boolean`): Whether the user should be able to create sublists (nested lists). Default: `true`\n- **`maxDepth`** (`number`): Allows you to control how deep the list nesting can be. Default: `4`\n- **`olRegex`** (`RegExp`): Regular expression for determining whether a numbered list should be started. Default: `/\\d\\./`\n- **`ulChars`** (`string[]`): List of characters with which bullet lists can be started. Default: `[\"-\", \"–\", \"*\"]`\n\n## Development\n\nRequirements: Node.js, Yarn\n\n1. Clone this repository: `git clone REPO_URL`\n2. Install all dependencies: `yarn`\n3. Generate the library bundle: `yarn start`\n4. View the demo on `localhost:3000`\n\nSuggestions and contributions are always welcome! Please discuss larger changes via issue before submitting a pull request.\n","funding_links":[],"categories":["Plugins and Decorators Built for Draft.js"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmeuli%2Fdraft-js-list-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamuelmeuli%2Fdraft-js-list-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamuelmeuli%2Fdraft-js-list-plugin/lists"}