{"id":13626574,"url":"https://github.com/aghontpi/dnde","last_synced_at":"2025-03-16T09:33:41.387Z","repository":{"id":46206560,"uuid":"405326300","full_name":"aghontpi/dnde","owner":"aghontpi","description":"Drag and drop react email editor","archived":false,"fork":false,"pushed_at":"2022-01-25T08:58:05.000Z","size":36427,"stargazers_count":60,"open_issues_count":5,"forks_count":20,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-16T00:46:41.591Z","etag":null,"topics":["drag-and-drop","drag-n-drop","editor","email-editor","email-template","mjml-api","react","react-email","react-email-component","react-email-editor"],"latest_commit_sha":null,"homepage":"https://dnde.bluepie.in","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aghontpi.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog/README.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-11T08:34:38.000Z","updated_at":"2024-12-14T15:36:46.000Z","dependencies_parsed_at":"2022-07-25T00:02:05.983Z","dependency_job_id":null,"html_url":"https://github.com/aghontpi/dnde","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aghontpi%2Fdnde","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aghontpi%2Fdnde/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aghontpi%2Fdnde/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aghontpi%2Fdnde/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aghontpi","download_url":"https://codeload.github.com/aghontpi/dnde/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243809844,"owners_count":20351407,"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":["drag-and-drop","drag-n-drop","editor","email-editor","email-template","mjml-api","react","react-email","react-email-component","react-email-editor"],"created_at":"2024-08-01T21:02:24.115Z","updated_at":"2025-03-16T09:33:40.706Z","avatar_url":"https://github.com/aghontpi.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/aghontpi/dnde/master/public/dnde-banner.svg\"/\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003ci\u003eDrag and Drop E-mail Editor\u003c/i\u003e\n  \u003cbr/\u003e\n  \u003cbr/\u003e\n  \u003ca href=\"https://github.com/aghontpi/dnde/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/v/release/aghontpi/dnde?include_prereleases\u0026style=flat-square\u0026label=github-release\" alt=\"release\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/dnd-email-editor\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/dnd-email-editor?style=flat-square\" alt=\"npm\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/aghontpi/dnde/blob/master/LICENSE\"\u003e\u003cimg src=\"https://img.shields.io/github/license/aghontpi/dnde?style=flat-square\" alt=\"license\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n[license-badge]: https://img.shields.io/github/license/aghontpi/dnde?style=flat-square\n[license file]: https://github.com/aghontpi/dnde/blob/master/LICENSE\n[badge]: https://img.shields.io/github/v/release/aghontpi/dnde?include_prereleases\u0026style=flat-square\u0026label=github-release\n[release link]: https://github.com/aghontpi/dnde/releases\n[npm badge]: https://img.shields.io/npm/v/dnd-email-editor?style=flat-square\n[npm link]: https://www.npmjs.com/package/dnd-email-editor\n\n\u003ch2 align=\"center\"\u003e screens / live demo \u003ca href=\"https://dnde.bluepie.in\"\u003ehere\u003c/a\u003e\u003c/h2\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/aghontpi/dnde/master/Screenshots/previews(25-oct-2021).gif\"  width=\"50%\" /\u003e\n\u003c/p\u003e\n\n## Installation\n\n```bash\n# Yarn\nyarn add dnd-email-editor\n\n# NPM\nnpm install dnd-email-editor\n\n```\n\n## What's included\n\nProps that can be passed to the component:\n\n|      Prop      |  Type   | Default | Optional | Description                                                                                                                              |\n| :------------: | :-----: | :-----: | :------: | ---------------------------------------------------------------------------------------------------------------------------------------- |\n|   `preview`    | boolean | `true`  |   true   | show/hide the inbuilt preview button.                                                                                                    |\n| `showUndoRedo` | boolean | `true`  |   true   | show/hide the inbuilt undo/redo button. \u003cbr/\u003e\u003cbr/\u003e You can create your own undoredo functionality with `undoredo` from api methods below |\n\nEditor exposes these api methods\n\n- `getHtml` - export the design as html content\n- `getJson` - export as json string, this string can then be used with `loadJson`\n- `loadJson` - load an existing design from json string\n- `undoredo` - undo and redo actions\n\n## Usage\n\n- Importing\n\n```typescript\nimport Editor from 'dnd-email-editor';\n\nreturn \u003cEditor /\u003e;\n```\n\n- Setup a `ref` using `useRef` and pass it to editor\n\n```typescript\nconst ref = React.useRef(null);\n\nreturn \u003cEditor ref={ref} /\u003e;\n```\n\n- Using `getHtml()`, `getJson()`, `loadJson()`, `undoredo`\n\n```typescript\nconst logValues = () =\u003e {\n  if (ref.current) {\n    const html = ref.current.getHtml();\n    const json = ref.current.getJson();\n    console.log(html, json);\n  }\n};\n\nconst loadJson = (json: string) =\u003e {\n  if (ref.current) {\n    ref.current.loadJson(json);\n  }\n};\n\nconst performUndoAction = () =\u003e {\n  if (ref.current) {\n    ref.current.undoActionCallback();\n\n    // to check if undo is possible\n    console.log('is undo empty: ', ref.current.isUndoEmpty());\n  }\n};\n\nconst performRedoAction = () =\u003e {\n  if (ref.current) {\n    ref.current.redoActionCallback();\n\n    // to check if redo is possible\n    console.log('is redo empty: ', ref.current.isRedoEmpty());\n  }\n};\n```\n\n- Typescript\n\nInorder to use typescript and get cool definitions, just pass the type to the ref\n\n```diff\nimport Editor from 'dnd-email-editor';\n\nconst ExampleComponent = () =\u003e {\n\n- const ref = useRef(null);\n+ const ref = useRef\u003cEditor\u003e(null);\n\n  return (\n    \u003cEditor ref={ref}/\u003e\n  );\n\n}\n```\n\n## Purpose\n\nThere are soo many drag and drop editors that helps in **creating website** but **not mails**, because mails differ a lot from `a normal html webpage`\n\n- even if there are `mail editors` available, they are paid and not `open-source`.\n\nOne such example would be `unlayer`, It claims to be opensource but its not.\n\n- Looking at their source code, they only provide their loader-script and call it as `open-source`\n- later they ask you to pay for its features.\n\nthe above reasons and also I was inspired by drag-n-drop editors in general, so I decided to make one.\n\n## Features\n\n- Responsive and mobile friendly emails\n- Design emails by drag and drop\n- Import/Export designs\n  - Export/Import as JSON\n  - Export as HTML\n- Manage Fonts\n  - add custom fonts\n  - list / add/ deletefonts\n- Go back and forth with `Undo / Redo`\n- Preview the design in the browser (Mobile \u0026 PC)\n\n## Built with\n\n- [React](https://facebook.github.io/react/)\n- [MJML](https://mjml.io/)\n- [antd](https://ant.design/)\n\n## Inspired by\n\n- [MailJet](https://www.mailjet.com/)\n- [Unlayer](https://unlayer.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faghontpi%2Fdnde","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faghontpi%2Fdnde","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faghontpi%2Fdnde/lists"}