{"_id":"91-easy-email-editor","name":"91-easy-email-editor","dist-tags":{"latest":"4.11.2-alpha.0"},"versions":{"4.11.2-alpha.0":{"name":"91-easy-email-editor","license":"MIT","description":"Email editor","version":"4.11.2-alpha.0","author":{"name":"hsuehpe"},"repository":{"type":"git","url":"git+https://github.com/hsuehpe/easy-email.git"},"keywords":["email editor core"],"main":"lib/index.js","types":"lib/index.d.ts","scripts":{"dev":"vite","typings":"tsc --declaration --emitDeclarationOnly --project tsconfig.lib.json && tsc-alias -p tsconfig.alias.json","build":"rimraf lib && npm run typings && vite build --config vite.config.ts","format":"eslint --fix  --ext .tsx,.ts,.tsx src/"},"husky":{"hooks":{"pre-commit":"yarn test && yarn lint-staged"}},"lint-staged":{"src/*.{js,jsx,ts,tsx}, example/*.{js,jsx,ts,tsx}":["yarn lint"]},"dependencies":{"final-form":"^4.20.4","final-form-arrays":"^3.0.2","final-form-set-field-touched":"^1.0.1","is-hotkey":"^0.2.0","lodash":"^4.17.21","react-final-form-arrays":"^3.1.3","react-use":"^17.3.1"},"devDependencies":{"@types/final-form-set-field-touched":"^1.0.0","@types/is-hotkey":"^0.1.7","@types/lodash":"^4.14.178","@types/node":"^16.11.7","@types/react":"17.0.2","@types/react-dom":"^17.0.11","@typescript-eslint/eslint-plugin":"^5.22.0","@typescript-eslint/parser":"^4.28.3","eslint":"^7.31.0","eslint-config-prettier":"^8.3.0","eslint-loader":"^4.0.2","eslint-plugin-import":"^2.23.4","eslint-plugin-prettier":"^3.4.0","eslint-plugin-react":"^7.24.0","eslint-plugin-react-hooks":"^4.2.0","mjml-browser":"^4.10.4","react":"^17.0.2","react-dom":"^17.0.2","react-final-form":"^6.5.7","rimraf":"^3.0.2","sass":"^1.43.4","tsc-alias":"^1.4.1","typescript":"^4.6.3","vite":"^2.6.14"},"peerDependencies":{"easy-email-core":"^4.3.6","mjml-browser":"^4.10.4","react":"^17.0.2","react-dom":"^17.0.2","react-final-form":"^6.5.7"},"gitHead":"0ede8e4c7ac29716e1f18fdb11b7d8bc68c8bf35","bugs":{"url":"https://github.com/hsuehpe/easy-email/issues"},"homepage":"https://github.com/hsuehpe/easy-email#readme","_id":"91-easy-email-editor@4.11.2-alpha.0","_nodeVersion":"16.4.2","_npmVersion":"lerna/4.0.0/node@v16.4.2+arm64 (darwin)","dist":{"integrity":"sha512-qa9QeieaYACxN0QdnEASBlUK54uCQxtWNwb8gGJ3cqlIuYhwB13P9VgZzEYpm5mlx/mczI7iX8l7wAXv9TR8hg==","shasum":"e85709199f232e5ef5896efd8ceec601ac253dac","tarball":"https://registry.npmjs.org/91-easy-email-editor/-/91-easy-email-editor-4.11.2-alpha.0.tgz","fileCount":81,"unpackedSize":1324346,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHWeRCbZmlXz5r/5zYL16CE/5Cvh1jZrkWEUPQgk9PyvAiEA30faIENK70w25wr0PuO8MGtscUAu1rMGGpiILnpEbcQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkMsuvACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmojJQ//edzIMgCkZWY6WRT7ifcUpi2NLqJzQhWjgb4iqmNQPBwoKpYd\r\nO8kkTo4KI88/c3088ZrkGXHkwWCVFU29KD1/pN6/D7vJ8+Qs6X753penKMup\r\nWf+7/Usju/DzDDeheyiz42qkifJnxeV30+Q/mKqfqYJcT5TvRdxwAkcwU9lf\r\nbtsUKITuneVpxB44ccBri1E18LrRgSChDmHPIezZ07rcDu6EQ9MJj3MoOZcU\r\nUFGh0trTLIKGZt/q7S2U3NezpZV553TzxycEGqPWtIOEwFLB8mfdiCZx0Bi/\r\nFdPb9ecH1BVLvbmZw1tvhGNqdl5rbGNTWKHywqmf+jnMs0NHHdmS1eg6pvWZ\r\nSj55nd4KTh4C8uSEPxZi6m6sznPmHDbV1z5Q9ytgADzv3aYyZMu5ufhol39k\r\nC3ddF19tPEFi+m9hhzs5iCWKGghIg+kNEz3ePgSEMiLPd3bJ55ormZn5fcDN\r\n8TqDOWK0lp6gVO7mk4Zy7Mg18z4UbCrxhYc5cIWHoJwQaZTi1xZ8dZaNbQ2X\r\nzdADAmMCMq0ymU4NDhBYr7/JR6RwDSvNtn3hKK3hBUub+NG6MS1e+qGcaPjX\r\nGlufMu58ZKYN4kOVrANs9GHtBNPcZR3iD3/b3IWVoPoh4fpofNuJ45pWmslJ\r\nykID3xq2n3pVxYX7hK0WwI/lgFyNwWKwkms=\r\n=Amp8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"hsuehpe","email":"bewitchsky@gmail.com"},"directories":{},"maintainers":[{"name":"hsuehpe","email":"bewitchsky@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/91-easy-email-editor_4.11.2-alpha.0_1681050543360_0.3374275519977199"},"_hasShrinkwrap":false}},"time":{"created":"2023-04-09T14:29:03.360Z","4.11.2-alpha.0":"2023-04-09T14:29:03.548Z","modified":"2023-04-09T14:29:03.723Z"},"maintainers":[{"name":"hsuehpe","email":"bewitchsky@gmail.com"}],"description":"Email editor","homepage":"https://github.com/hsuehpe/easy-email#readme","keywords":["email editor core"],"repository":{"type":"git","url":"git+https://github.com/hsuehpe/easy-email.git"},"author":{"name":"hsuehpe"},"bugs":{"url":"https://github.com/hsuehpe/easy-email/issues"},"license":"MIT","readme":"# Easy-email-editor\n\n## Introduction\n\nEmail render and preview container.\n\n## usage\n\n```sh\n$ npm install --save easy-email-editor\n```\n\nor\n\n```sh\n$ yarn add easy-email-editor\n```\n\n```js\nimport React from \"react\";\nimport { BlockManager } from \"easy-email-core\";\nimport { EmailEditor, EmailEditorProvider } from \"easy-email-editor\";\nimport \"easy-email-editor/lib/style.css\";\n\nconst initialValues = {\n  subject: \"Welcome to Easy-email\",\n  subTitle: \"Nice to meet you!\",\n  content: BlockManager.getBlockByType(BasicType.PAGE).create({}),\n};\n\nexport function App() {\n  return (\n    <EmailEditorProvider data={initialValues} height={\"calc(100vh - 72px)\"}>\n      {({ values }) => {\n        return <EmailEditor />;\n      }}\n    </EmailEditorProvider>\n  );\n}\n```\n\n## customize\n\nIf you customize the UI yourself,maybe you need to know\n\n- hooks\n\n  - useActiveTab // current tab is edit or preview\n  - useBlock // includes addBlock、moveBlock、removeBlock、undo, redo, etc.\n  - useHoverIdx // hover block related, dragging status related, dragging direction related\n  - useEditorProps // get props from EmailEditorProvider\n  - useEditorContext // get form state and initialized status\n  - useFocusIdx // focus block related\n\n- utils (These are some very simple methods, it is best to look at the implementation)\n\n  - getBlockNodeByIdx\n  - getBlockNodes\n  - getShadowRoot\n  - scrollBlockEleIntoView\n\n- components\n  - BlockAvatarWrapper // allow drag and drop to editor\n","readmeFilename":"readme.md"}