Package Exports
- editify
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (editify) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Editify
A pure implementation of WYSIWYG HTML editor all we needed.
Install
yarn add editifyUsage (commonjs)
<div id="editor">
  <p>This line is editable!</p>
</div>import { Editify } from 'editify';
const editor = new Editify('editor');
editify.on('change', function(html, text) {
  console.log('change event: new html: ', html);
  console.log('change event: new text: ', text);
});
editify.on('selectionchange', function(selection) {
  console.log('selectionchange event: selected text: ', selection.toString());
});Usage (umd)
<head>
  <script src="./editify.js"></script>
  <script>
    window.onload = function() {
      const editify = new Editify.Editify('editor');
      editify.on('change', function(html, text) {
        console.log('change event: new html: ', html);
        console.log('change event: new text: ', text);
      });
      editify.on('selectionchange', function(selection) {
        console.log('selectionchange event: selected text: ', selection.toString());
      });
    }
  </script>
</head>
<body>
  <div id="editor">
    <p>This line is editable!</p>
  </div>
</body>Usage (next.js)
export default function EditifyPage() {
  const onChange = (html: string, text: string) => {
    console.log('change event: new html: ', html);
    console.log('change event: new text: ', text);
  };
  const onSelectionChange = (selection: Selection) => {
    console.log('selectionchange event: selected text: ', selection.toString());
  };
  React.useEffect(() => {
    // editify can be used only in client side
    const { Editify } = require("editify");
    const editor = new Editify("editor");
    editor.on("change", onChange);
    editor.on("selectionchange", onSelectionChange);
    return () => {
      editor.off("change", onChange);
      editor.off("selectionchange", onSelectionChange);
    };
  }, []);
  return (
    <div id="editor">
      <p>This line is editable!</p>
    </div>
  );
}Roadmaps
- contenteditable
-  on changeevent
-  on selectionchangeevent
-  toolbar (fixed)-  inline: bold- toggle
 
-  inline: italic- toggle
 
-  inline: color- toggle
 
-  inline: link- insert
- edit
- remove
 
-  list- toggle
- indent: tab
- indent: shift+tab
 
-  image- insert
- edit
- remove
 
-  PDF- insert
- edit
- remove
 
-  table-  insert- 2 * 2 cells
 
-  edit- cell
- add row
- add column
- remove row
- remove column
 
- remove
- cmd: tab
- cmd: shift+tab
 
-  insert
 
-  inline: bold
- toolbar (hovered)
- undo / redo