mirror of
https://github.com/codex-team/editor.js
synced 2026-03-16 15:45:47 +01:00
* 2.16.0 * [Refactor] Separate internal and external settings (#845) * Enable flipping tools via standalone class (#830) * Enable flipping tools via standalone class * use flipper to refactor (#842) * use flipper to refactor * save changes * update * fix flipper on inline toolbar * ready for testing * requested changes * update doc * updates * destroy flippers * some requested changes * update * update * ready * update * last changes * update docs * Hghl active button of CT, simplify activate/deactivate * separate dom iterator * unhardcode directions * fixed a link in readme.md (#856) * Fix Block selection via CMD+A (#829) * Fix Block selection via CMD+A * Delete editor.js.map * update * update * Update CHANGELOG.md * Improve style of selected blocks (#858) * Cross-block-selection style improved * Update CHANGELOG.md * Fix case when property 'observer' in modificationObserver is not defined (#866) * Bump lodash.template from 4.4.0 to 4.5.0 (#885) Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0) Signed-off-by: dependabot[bot] <support@github.com> * Bump eslint-utils from 1.3.1 to 1.4.2 (#886) Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2. - [Release notes](https://github.com/mysticatea/eslint-utils/releases) - [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2) Signed-off-by: dependabot[bot] <support@github.com> * Bump mixin-deep from 1.3.1 to 1.3.2 (#887) Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2) Signed-off-by: dependabot[bot] <support@github.com> * update bundle and readme * Update README.md * upd codeowners, fix funding * Minor Docs Fix according to main Readme (#916) * Inline Toolbar now contains Conversion Toolbar (#932) * Block lifecycle hooks (#906) * [Fix] Arrow selection (#964) * Fix arrow selection * Add docs * [issue-926]: fix dom iterator leafing when items are empty (#958) * [issue-926]: fix dom iterator leafing when items are empty * update Changelog * Issue 869 (#963) * Fix issue 943 (#965) * [Draft] Feature/tooltip enhancements (#907) * initial * update * make module standalone * use tooltips as external module * update * build via prod mode * add tooltips as external module * add declaration file and options param * add api tooltip * update * removed submodule * removed due to the incorrect setip * setup tooltips again * wip * update tooltip module * toolbox, inline toolbar * Tooltips in block tunes not uses shorthand * shorthand in a plus and block settings * fix doc * Update tools-inline.md * Delete tooltip.css * Update CHANGELOG.md * Update codex.tooltips * Update api.md * [issue-779]: Grammarly conflicts (#956) * grammarly conflicts * update * upd bundle * Submodule Header now on master * Submodule Marker now on master * Submodule Paragraph now on master * Submodule InlineCode now on master * Submodule Simple Image now on master * [issue-868]: Deleting multiple blocks triggers back button in Firefox (#967) * Deleting multiple blocks triggers back button in Firefox @evgenusov * Update editor.js * Update CHANGELOG.md * pass options on removeEventListener (#904) * pass options on removeEventListener by removeAll * rebuild * Merge branch 'release/2.16' into pr/904 * Update CHANGELOG.md * Update inline.ts * [Fix] Selection rangecount (#968) * Fix #952 (#969) * Update codex.tooltips * Selection bugfix (#970) * Selection bugfix * fix cross block selection * close inline toolbar when blocks selected via shift * remove inline toolbar closing on cross block selection mouse up due to the bug (#972) * [Feature] Log levels (#971) * Decrease margins (#973) * Decrease margins * Update editor.licenses.txt * Update src/components/domIterator.ts Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * [Fix] Fix delete blocks api method (#974) * Update docs/usage.md Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * rm unused * Update yarn.lock file * upd bundle, changelog * Resolve Firefox issues (#981) * Resolve Firefox issues * use firefox hack only for empty c-e divs * Set initial hidden Inline Toolbar position (#982) Resolves #979 * [Fix] tooltip types (#986) * Add tooltip as a package * Fix to set minHeight 0px (#987) * Release 2.16 (#966) * 2.16.0 * [Refactor] Separate internal and external settings (#845) * Enable flipping tools via standalone class (#830) * Enable flipping tools via standalone class * use flipper to refactor (#842) * use flipper to refactor * save changes * update * fix flipper on inline toolbar * ready for testing * requested changes * update doc * updates * destroy flippers * some requested changes * update * update * ready * update * last changes * update docs * Hghl active button of CT, simplify activate/deactivate * separate dom iterator * unhardcode directions * fixed a link in readme.md (#856) * Fix Block selection via CMD+A (#829) * Fix Block selection via CMD+A * Delete editor.js.map * update * update * Update CHANGELOG.md * Improve style of selected blocks (#858) * Cross-block-selection style improved * Update CHANGELOG.md * Fix case when property 'observer' in modificationObserver is not defined (#866) * Bump lodash.template from 4.4.0 to 4.5.0 (#885) Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0) Signed-off-by: dependabot[bot] <support@github.com> * Bump eslint-utils from 1.3.1 to 1.4.2 (#886) Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2. - [Release notes](https://github.com/mysticatea/eslint-utils/releases) - [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2) Signed-off-by: dependabot[bot] <support@github.com> * Bump mixin-deep from 1.3.1 to 1.3.2 (#887) Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2) Signed-off-by: dependabot[bot] <support@github.com> * update bundle and readme * Update README.md * upd codeowners, fix funding * Minor Docs Fix according to main Readme (#916) * Inline Toolbar now contains Conversion Toolbar (#932) * Block lifecycle hooks (#906) * [Fix] Arrow selection (#964) * Fix arrow selection * Add docs * [issue-926]: fix dom iterator leafing when items are empty (#958) * [issue-926]: fix dom iterator leafing when items are empty * update Changelog * Issue 869 (#963) * Fix issue 943 (#965) * [Draft] Feature/tooltip enhancements (#907) * initial * update * make module standalone * use tooltips as external module * update * build via prod mode * add tooltips as external module * add declaration file and options param * add api tooltip * update * removed submodule * removed due to the incorrect setip * setup tooltips again * wip * update tooltip module * toolbox, inline toolbar * Tooltips in block tunes not uses shorthand * shorthand in a plus and block settings * fix doc * Update tools-inline.md * Delete tooltip.css * Update CHANGELOG.md * Update codex.tooltips * Update api.md * [issue-779]: Grammarly conflicts (#956) * grammarly conflicts * update * upd bundle * Submodule Header now on master * Submodule Marker now on master * Submodule Paragraph now on master * Submodule InlineCode now on master * Submodule Simple Image now on master * [issue-868]: Deleting multiple blocks triggers back button in Firefox (#967) * Deleting multiple blocks triggers back button in Firefox @evgenusov * Update editor.js * Update CHANGELOG.md * pass options on removeEventListener (#904) * pass options on removeEventListener by removeAll * rebuild * Merge branch 'release/2.16' into pr/904 * Update CHANGELOG.md * Update inline.ts * [Fix] Selection rangecount (#968) * Fix #952 (#969) * Update codex.tooltips * Selection bugfix (#970) * Selection bugfix * fix cross block selection * close inline toolbar when blocks selected via shift * remove inline toolbar closing on cross block selection mouse up due to the bug (#972) * [Feature] Log levels (#971) * Decrease margins (#973) * Decrease margins * Update editor.licenses.txt * Update src/components/domIterator.ts Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * [Fix] Fix delete blocks api method (#974) * Update docs/usage.md Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * rm unused * Update yarn.lock file * upd bundle, changelog * Fix changeling list items (#975) * Update changelog (#976) * Fix to set minHeight 0px * upd version * Update CHANGELOG.md * upd bundle * [Fix] Selection issues (#988) * [Dev] Update dependencies (#989) * Delete codex.tooltips * Update submodules * Fix/hide conversion toolbar (#991) * Hide conversion toolbar if there is no conversion tool * update changelog * update comment * updates * improve code * Update Changelog * Update CHANGELOG.md * fix some problems at example * Update CHANGELOG.md * Fix: bind editor when calling onChange (#1048) * Release/2.16.1 (#990) * 2.16.0 * [Refactor] Separate internal and external settings (#845) * Enable flipping tools via standalone class (#830) * Enable flipping tools via standalone class * use flipper to refactor (#842) * use flipper to refactor * save changes * update * fix flipper on inline toolbar * ready for testing * requested changes * update doc * updates * destroy flippers * some requested changes * update * update * ready * update * last changes * update docs * Hghl active button of CT, simplify activate/deactivate * separate dom iterator * unhardcode directions * fixed a link in readme.md (#856) * Fix Block selection via CMD+A (#829) * Fix Block selection via CMD+A * Delete editor.js.map * update * update * Update CHANGELOG.md * Improve style of selected blocks (#858) * Cross-block-selection style improved * Update CHANGELOG.md * Fix case when property 'observer' in modificationObserver is not defined (#866) * Bump lodash.template from 4.4.0 to 4.5.0 (#885) Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0) Signed-off-by: dependabot[bot] <support@github.com> * Bump eslint-utils from 1.3.1 to 1.4.2 (#886) Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2. - [Release notes](https://github.com/mysticatea/eslint-utils/releases) - [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2) Signed-off-by: dependabot[bot] <support@github.com> * Bump mixin-deep from 1.3.1 to 1.3.2 (#887) Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2) Signed-off-by: dependabot[bot] <support@github.com> * update bundle and readme * Update README.md * upd codeowners, fix funding * Minor Docs Fix according to main Readme (#916) * Inline Toolbar now contains Conversion Toolbar (#932) * Block lifecycle hooks (#906) * [Fix] Arrow selection (#964) * Fix arrow selection * Add docs * [issue-926]: fix dom iterator leafing when items are empty (#958) * [issue-926]: fix dom iterator leafing when items are empty * update Changelog * Issue 869 (#963) * Fix issue 943 (#965) * [Draft] Feature/tooltip enhancements (#907) * initial * update * make module standalone * use tooltips as external module * update * build via prod mode * add tooltips as external module * add declaration file and options param * add api tooltip * update * removed submodule * removed due to the incorrect setip * setup tooltips again * wip * update tooltip module * toolbox, inline toolbar * Tooltips in block tunes not uses shorthand * shorthand in a plus and block settings * fix doc * Update tools-inline.md * Delete tooltip.css * Update CHANGELOG.md * Update codex.tooltips * Update api.md * [issue-779]: Grammarly conflicts (#956) * grammarly conflicts * update * upd bundle * Submodule Header now on master * Submodule Marker now on master * Submodule Paragraph now on master * Submodule InlineCode now on master * Submodule Simple Image now on master * [issue-868]: Deleting multiple blocks triggers back button in Firefox (#967) * Deleting multiple blocks triggers back button in Firefox @evgenusov * Update editor.js * Update CHANGELOG.md * pass options on removeEventListener (#904) * pass options on removeEventListener by removeAll * rebuild * Merge branch 'release/2.16' into pr/904 * Update CHANGELOG.md * Update inline.ts * [Fix] Selection rangecount (#968) * Fix #952 (#969) * Update codex.tooltips * Selection bugfix (#970) * Selection bugfix * fix cross block selection * close inline toolbar when blocks selected via shift * remove inline toolbar closing on cross block selection mouse up due to the bug (#972) * [Feature] Log levels (#971) * Decrease margins (#973) * Decrease margins * Update editor.licenses.txt * Update src/components/domIterator.ts Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * [Fix] Fix delete blocks api method (#974) * Update docs/usage.md Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * rm unused * Update yarn.lock file * upd bundle, changelog * Resolve Firefox issues (#981) * Resolve Firefox issues * use firefox hack only for empty c-e divs * Set initial hidden Inline Toolbar position (#982) Resolves #979 * [Fix] tooltip types (#986) * Add tooltip as a package * Fix to set minHeight 0px (#987) * Release 2.16 (#966) * 2.16.0 * [Refactor] Separate internal and external settings (#845) * Enable flipping tools via standalone class (#830) * Enable flipping tools via standalone class * use flipper to refactor (#842) * use flipper to refactor * save changes * update * fix flipper on inline toolbar * ready for testing * requested changes * update doc * updates * destroy flippers * some requested changes * update * update * ready * update * last changes * update docs * Hghl active button of CT, simplify activate/deactivate * separate dom iterator * unhardcode directions * fixed a link in readme.md (#856) * Fix Block selection via CMD+A (#829) * Fix Block selection via CMD+A * Delete editor.js.map * update * update * Update CHANGELOG.md * Improve style of selected blocks (#858) * Cross-block-selection style improved * Update CHANGELOG.md * Fix case when property 'observer' in modificationObserver is not defined (#866) * Bump lodash.template from 4.4.0 to 4.5.0 (#885) Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0) Signed-off-by: dependabot[bot] <support@github.com> * Bump eslint-utils from 1.3.1 to 1.4.2 (#886) Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2. - [Release notes](https://github.com/mysticatea/eslint-utils/releases) - [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2) Signed-off-by: dependabot[bot] <support@github.com> * Bump mixin-deep from 1.3.1 to 1.3.2 (#887) Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2) Signed-off-by: dependabot[bot] <support@github.com> * update bundle and readme * Update README.md * upd codeowners, fix funding * Minor Docs Fix according to main Readme (#916) * Inline Toolbar now contains Conversion Toolbar (#932) * Block lifecycle hooks (#906) * [Fix] Arrow selection (#964) * Fix arrow selection * Add docs * [issue-926]: fix dom iterator leafing when items are empty (#958) * [issue-926]: fix dom iterator leafing when items are empty * update Changelog * Issue 869 (#963) * Fix issue 943 (#965) * [Draft] Feature/tooltip enhancements (#907) * initial * update * make module standalone * use tooltips as external module * update * build via prod mode * add tooltips as external module * add declaration file and options param * add api tooltip * update * removed submodule * removed due to the incorrect setip * setup tooltips again * wip * update tooltip module * toolbox, inline toolbar * Tooltips in block tunes not uses shorthand * shorthand in a plus and block settings * fix doc * Update tools-inline.md * Delete tooltip.css * Update CHANGELOG.md * Update codex.tooltips * Update api.md * [issue-779]: Grammarly conflicts (#956) * grammarly conflicts * update * upd bundle * Submodule Header now on master * Submodule Marker now on master * Submodule Paragraph now on master * Submodule InlineCode now on master * Submodule Simple Image now on master * [issue-868]: Deleting multiple blocks triggers back button in Firefox (#967) * Deleting multiple blocks triggers back button in Firefox @evgenusov * Update editor.js * Update CHANGELOG.md * pass options on removeEventListener (#904) * pass options on removeEventListener by removeAll * rebuild * Merge branch 'release/2.16' into pr/904 * Update CHANGELOG.md * Update inline.ts * [Fix] Selection rangecount (#968) * Fix #952 (#969) * Update codex.tooltips * Selection bugfix (#970) * Selection bugfix * fix cross block selection * close inline toolbar when blocks selected via shift * remove inline toolbar closing on cross block selection mouse up due to the bug (#972) * [Feature] Log levels (#971) * Decrease margins (#973) * Decrease margins * Update editor.licenses.txt * Update src/components/domIterator.ts Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * [Fix] Fix delete blocks api method (#974) * Update docs/usage.md Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * rm unused * Update yarn.lock file * upd bundle, changelog * Fix changeling list items (#975) * Update changelog (#976) * Fix to set minHeight 0px * upd version * Update CHANGELOG.md * upd bundle * [Fix] Selection issues (#988) * [Dev] Update dependencies (#989) * Delete codex.tooltips * Update submodules * Fix/hide conversion toolbar (#991) * Hide conversion toolbar if there is no conversion tool * update changelog * update comment * updates * improve code * Update Changelog * Update CHANGELOG.md * Update CHANGELOG.md * Fix: bind editor when calling onChange fixes #999 * send api as a parameter * upd bundle * Update CHANGELOG.md Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * updated some wording. (#1044) * Release/2.16.1 (#990) * 2.16.0 * [Refactor] Separate internal and external settings (#845) * Enable flipping tools via standalone class (#830) * Enable flipping tools via standalone class * use flipper to refactor (#842) * use flipper to refactor * save changes * update * fix flipper on inline toolbar * ready for testing * requested changes * update doc * updates * destroy flippers * some requested changes * update * update * ready * update * last changes * update docs * Hghl active button of CT, simplify activate/deactivate * separate dom iterator * unhardcode directions * fixed a link in readme.md (#856) * Fix Block selection via CMD+A (#829) * Fix Block selection via CMD+A * Delete editor.js.map * update * update * Update CHANGELOG.md * Improve style of selected blocks (#858) * Cross-block-selection style improved * Update CHANGELOG.md * Fix case when property 'observer' in modificationObserver is not defined (#866) * Bump lodash.template from 4.4.0 to 4.5.0 (#885) Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0) Signed-off-by: dependabot[bot] <support@github.com> * Bump eslint-utils from 1.3.1 to 1.4.2 (#886) Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2. - [Release notes](https://github.com/mysticatea/eslint-utils/releases) - [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2) Signed-off-by: dependabot[bot] <support@github.com> * Bump mixin-deep from 1.3.1 to 1.3.2 (#887) Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2) Signed-off-by: dependabot[bot] <support@github.com> * update bundle and readme * Update README.md * upd codeowners, fix funding * Minor Docs Fix according to main Readme (#916) * Inline Toolbar now contains Conversion Toolbar (#932) * Block lifecycle hooks (#906) * [Fix] Arrow selection (#964) * Fix arrow selection * Add docs * [issue-926]: fix dom iterator leafing when items are empty (#958) * [issue-926]: fix dom iterator leafing when items are empty * update Changelog * Issue 869 (#963) * Fix issue 943 (#965) * [Draft] Feature/tooltip enhancements (#907) * initial * update * make module standalone * use tooltips as external module * update * build via prod mode * add tooltips as external module * add declaration file and options param * add api tooltip * update * removed submodule * removed due to the incorrect setip * setup tooltips again * wip * update tooltip module * toolbox, inline toolbar * Tooltips in block tunes not uses shorthand * shorthand in a plus and block settings * fix doc * Update tools-inline.md * Delete tooltip.css * Update CHANGELOG.md * Update codex.tooltips * Update api.md * [issue-779]: Grammarly conflicts (#956) * grammarly conflicts * update * upd bundle * Submodule Header now on master * Submodule Marker now on master * Submodule Paragraph now on master * Submodule InlineCode now on master * Submodule Simple Image now on master * [issue-868]: Deleting multiple blocks triggers back button in Firefox (#967) * Deleting multiple blocks triggers back button in Firefox @evgenusov * Update editor.js * Update CHANGELOG.md * pass options on removeEventListener (#904) * pass options on removeEventListener by removeAll * rebuild * Merge branch 'release/2.16' into pr/904 * Update CHANGELOG.md * Update inline.ts * [Fix] Selection rangecount (#968) * Fix #952 (#969) * Update codex.tooltips * Selection bugfix (#970) * Selection bugfix * fix cross block selection * close inline toolbar when blocks selected via shift * remove inline toolbar closing on cross block selection mouse up due to the bug (#972) * [Feature] Log levels (#971) * Decrease margins (#973) * Decrease margins * Update editor.licenses.txt * Update src/components/domIterator.ts Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * [Fix] Fix delete blocks api method (#974) * Update docs/usage.md Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * rm unused * Update yarn.lock file * upd bundle, changelog * Resolve Firefox issues (#981) * Resolve Firefox issues * use firefox hack only for empty c-e divs * Set initial hidden Inline Toolbar position (#982) Resolves #979 * [Fix] tooltip types (#986) * Add tooltip as a package * Fix to set minHeight 0px (#987) * Release 2.16 (#966) * 2.16.0 * [Refactor] Separate internal and external settings (#845) * Enable flipping tools via standalone class (#830) * Enable flipping tools via standalone class * use flipper to refactor (#842) * use flipper to refactor * save changes * update * fix flipper on inline toolbar * ready for testing * requested changes * update doc * updates * destroy flippers * some requested changes * update * update * ready * update * last changes * update docs * Hghl active button of CT, simplify activate/deactivate * separate dom iterator * unhardcode directions * fixed a link in readme.md (#856) * Fix Block selection via CMD+A (#829) * Fix Block selection via CMD+A * Delete editor.js.map * update * update * Update CHANGELOG.md * Improve style of selected blocks (#858) * Cross-block-selection style improved * Update CHANGELOG.md * Fix case when property 'observer' in modificationObserver is not defined (#866) * Bump lodash.template from 4.4.0 to 4.5.0 (#885) Bumps [lodash.template](https://github.com/lodash/lodash) from 4.4.0 to 4.5.0. - [Release notes](https://github.com/lodash/lodash/releases) - [Commits](https://github.com/lodash/lodash/compare/4.4.0...4.5.0) Signed-off-by: dependabot[bot] <support@github.com> * Bump eslint-utils from 1.3.1 to 1.4.2 (#886) Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2. - [Release notes](https://github.com/mysticatea/eslint-utils/releases) - [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2) Signed-off-by: dependabot[bot] <support@github.com> * Bump mixin-deep from 1.3.1 to 1.3.2 (#887) Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2) Signed-off-by: dependabot[bot] <support@github.com> * update bundle and readme * Update README.md * upd codeowners, fix funding * Minor Docs Fix according to main Readme (#916) * Inline Toolbar now contains Conversion Toolbar (#932) * Block lifecycle hooks (#906) * [Fix] Arrow selection (#964) * Fix arrow selection * Add docs * [issue-926]: fix dom iterator leafing when items are empty (#958) * [issue-926]: fix dom iterator leafing when items are empty * update Changelog * Issue 869 (#963) * Fix issue 943 (#965) * [Draft] Feature/tooltip enhancements (#907) * initial * update * make module standalone * use tooltips as external module * update * build via prod mode * add tooltips as external module * add declaration file and options param * add api tooltip * update * removed submodule * removed due to the incorrect setip * setup tooltips again * wip * update tooltip module * toolbox, inline toolbar * Tooltips in block tunes not uses shorthand * shorthand in a plus and block settings * fix doc * Update tools-inline.md * Delete tooltip.css * Update CHANGELOG.md * Update codex.tooltips * Update api.md * [issue-779]: Grammarly conflicts (#956) * grammarly conflicts * update * upd bundle * Submodule Header now on master * Submodule Marker now on master * Submodule Paragraph now on master * Submodule InlineCode now on master * Submodule Simple Image now on master * [issue-868]: Deleting multiple blocks triggers back button in Firefox (#967) * Deleting multiple blocks triggers back button in Firefox @evgenusov * Update editor.js * Update CHANGELOG.md * pass options on removeEventListener (#904) * pass options on removeEventListener by removeAll * rebuild * Merge branch 'release/2.16' into pr/904 * Update CHANGELOG.md * Update inline.ts * [Fix] Selection rangecount (#968) * Fix #952 (#969) * Update codex.tooltips * Selection bugfix (#970) * Selection bugfix * fix cross block selection * close inline toolbar when blocks selected via shift * remove inline toolbar closing on cross block selection mouse up due to the bug (#972) * [Feature] Log levels (#971) * Decrease margins (#973) * Decrease margins * Update editor.licenses.txt * Update src/components/domIterator.ts Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * [Fix] Fix delete blocks api method (#974) * Update docs/usage.md Co-Authored-By: Murod Khaydarov <murod.haydarov@gmail.com> * rm unused * Update yarn.lock file * upd bundle, changelog * Fix changeling list items (#975) * Update changelog (#976) * Fix to set minHeight 0px * upd version * Update CHANGELOG.md * upd bundle * [Fix] Selection issues (#988) * [Dev] Update dependencies (#989) * Delete codex.tooltips * Update submodules * Fix/hide conversion toolbar (#991) * Hide conversion toolbar if there is no conversion tool * update changelog * update comment * updates * improve code * Update Changelog * Update CHANGELOG.md * Update CHANGELOG.md * updated some wording. * Update installation.md * Update CHANGELOG.md Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * Fix grammar in readme.md (#1008) * Update editor.js * Paste listener on editors instead of document (#1025) * Paste listener on editors instead of document * add changelog Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * Bump acorn from 6.4.0 to 6.4.1 (#1059) Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1. - [Release notes](https://github.com/acornjs/acorn/releases) - [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Fix flipper activate/deactivate when conversionToolbarOpened (#1001) * Fix flipper activate/deactivate when conversionToolbarOpened * fix bug with flipping inline toolbar * update changelog * added comment for new condition * upd bundle Co-authored-by: Murod Khaydarov <murod.haydarov@gmail.com> Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * [Issue-1057]: open new window by clicking anchor with ctrl (#1062) * open new window when anchor clicked with ctrl * delete source maps * update function name * update * update changelog * Fix settings box-sizing (#1013) * Improvements: new Block Settings button style (#1064) * [Feature] In-house copy paste (#1060) * New block lifecycle hook and BlockToolAPI: "moved" (#1007) * Update CHANGELOG.md * feat: add swapped lifecycle hook * feat: deprecate swap and add move instead * feat: set fromIndex by default, add MoveEvent, add indices checks in blockManager * refactor: MoveEvent interface more event-like; docs: added docs for MoveEvent * fix asterix alignment due to tslint error * fix tslint * extending CustomEvent * update bundle * Update CHANGELOG.md Co-authored-by: Peter Savchenko <specc.dev@gmail.com> Co-authored-by: Murod Khaydarov <murod.haydarov@gmail.com> * Change paste function of text/plain (#1014) Co-authored-by: Georgy Berezhnoy <gohabereg@gmail.com> * Improve paste function of multiple lines (#1016) Co-authored-by: Georgy Berezhnoy <gohabereg@gmail.com> * 2.17.0 * Update bundle Co-authored-by: georgyb <yegor.berezhnoi@3d4medical.com> Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com> Co-authored-by: Christof Jans <christof@loopfx.com> Co-authored-by: Peter Savchenko <specc.dev@gmail.com> Co-authored-by: VladimirZhdanov <vlzh@pm.me> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Chaitanya <yourchaitu@gmail.com> Co-authored-by: Marina <marina.zadoyanchuk@gmail.com> Co-authored-by: Hata <hato6502@gmail.com> Co-authored-by: Mohamed El Bahja <mohamed.jss11@gmail.Com> Co-authored-by: Danny Rubio <drbe4t@gmail.com> Co-authored-by: darrelfrancis <20881844+darrelfrancis@users.noreply.github.com> Co-authored-by: Emmanuel Francis Ramos Jr <ponnex@gmail.com> Co-authored-by: Andrey Blinov <andrey.blinoff@gmail.com> Co-authored-by: Stefan Natter <stefan@natter.at> Co-authored-by: Georgy Berezhnoy <gohabereg@gmail.com>
483 lines
14 KiB
Markdown
483 lines
14 KiB
Markdown
# Editor.js Tools
|
||
|
||
Editor.js is a block-oriented editor. It means that entry composed with the list of `Blocks` of different types: `Texts`, `Headers`, `Images`, `Quotes` etc.
|
||
|
||
`Tool` — is a class that provide custom `Block` type. All Tools represented by `Plugins`.
|
||
|
||
Each Tool should have an installation guide.
|
||
|
||
## Tool class structure
|
||
|
||
### constructor()
|
||
|
||
Each Tool's instance called with an params object.
|
||
|
||
| Param | Type | Description |
|
||
| ------ | ------------------- | ----------------------------------------------- |
|
||
| api | [`IAPI`][iapi-link] | Editor.js's API methods |
|
||
| config | `object` | Special configuration params passed in «config» |
|
||
| data | `object` | Data to be rendered in this Tool |
|
||
|
||
[iapi-link]: ../src/types-internal/api.ts
|
||
|
||
#### Example
|
||
|
||
```javascript
|
||
constructor({data, config, api}) {
|
||
this.data = data;
|
||
this.api = api;
|
||
this.config = config;
|
||
// ...
|
||
}
|
||
```
|
||
|
||
### render()
|
||
|
||
Method that returns Tool's element {HTMLElement} that will be placed into Editor.
|
||
|
||
### save()
|
||
|
||
Process Tool's element created by `render()` function in DOM and return Block's data.
|
||
|
||
### validate(data: BlockToolData): boolean|Promise\<boolean\> _optional_
|
||
|
||
Allows to check correctness of Tool's data. If data didn't pass the validation it won't be saved. Receives Tool's `data` as input param and returns `boolean` result of validation.
|
||
|
||
### merge() _optional_
|
||
|
||
Method that specifies how to merge two `Blocks` of the same type, for example on `Backspace` keypress.
|
||
Method does accept data object in same format as the `Render` and it should provide logic how to combine new
|
||
data with the currently stored value.
|
||
|
||
## Internal Tool Settings
|
||
|
||
Options that Tool can specify. All settings should be passed as static properties of Tool's class.
|
||
|
||
| Name | Type | Default Value | Description |
|
||
| -- | -- | -- | -- |
|
||
| `toolbox` | _Object_ | `undefined` | Pass here `icon` and `title` to display this `Tool` in the Editor's `Toolbox` <br /> `icon` - HTML string with icon for Toolbox <br /> `title` - optional title to display in Toolbox |
|
||
| `enableLineBreaks` | _Boolean_ | `false` | With this option, Editor.js won't handle Enter keydowns. Can be helpful for Tools like `<code>` where line breaks should be handled by default behaviour. |
|
||
| `isInline` | _Boolean_ | `false` | Describes Tool as a [Tool for the Inline Toolbar](tools-inline.md) |
|
||
| `sanitize` | _Object_ | `undefined` | Config for automatic sanitizing of saved data. See [Sanitize](#sanitize) section. |
|
||
| `conversionConfig` | _Object_ | `undefined` | Config allows Tool to specify how it can be converted into/from another Tool. See [Conversion config](#conversion-config) section. |
|
||
|
||
## User configuration
|
||
|
||
All Tools can be configured by users. You can set up some of available settings along with Tool's class
|
||
to the `tools` property of Editor Config.
|
||
|
||
```javascript
|
||
var editor = new EditorJS({
|
||
holderId : 'editorjs',
|
||
tools: {
|
||
text: {
|
||
class: Text,
|
||
inlineToolbar : true,
|
||
// other settings..
|
||
},
|
||
header: Header
|
||
},
|
||
initialBlock : 'text',
|
||
});
|
||
```
|
||
|
||
There are few options available by Editor.js.
|
||
|
||
| Name | Type | Default Value | Description |
|
||
| -- | -- | -- | -- |
|
||
| `inlineToolbar` | _Boolean/Array_ | `false` | Pass `true` to enable the Inline Toolbar with all Tools, or pass an array with specified Tools list |
|
||
| `config` | _Object_ | `null` | User's configuration for Plugin.
|
||
|
||
## Paste handling
|
||
|
||
Editor.js handles paste on Blocks and provides API for Tools to process the pasted data.
|
||
|
||
When user pastes content into Editor, pasted content will be splitted into blocks.
|
||
|
||
1. If plain text will be pasted, it will be splitted by new line characters
|
||
2. If HTML string will be pasted, it will be splitted by block tags
|
||
|
||
Also Editor API allows you to define your own pasting scenario. You can either:
|
||
|
||
1. Specify **HTML tags**, that can be represented by your Tool. For example, Image Tool can handle `<img>` tags.
|
||
If tags you specified will be found on content pasting, your Tool will be rendered.
|
||
2. Specify **RegExp** for pasted strings. If pattern has been matched, your Tool will be rendered.
|
||
3. Specify **MIME type** or **extensions** of files that can be handled by your Tool on pasting by drag-n-drop or from clipboard.
|
||
|
||
For each scenario, you should do 2 next things:
|
||
|
||
1. Define static getter `pasteConfig` in Tool class. Specify handled patterns there.
|
||
2. Define public method `onPaste` that will handle PasteEvent to process pasted data.
|
||
|
||
### HTML tags handling
|
||
|
||
To handle pasted HTML elements object returned from `pasteConfig` getter should contain following field:
|
||
|
||
| Name | Type | Description |
|
||
| -- | -- | -- |
|
||
| `tags` | `String[]` | _Optional_. Should contain all tag names you want to be extracted from pasted data and processed by your `onPaste` method |
|
||
|
||
For correct work you MUST provide `onPaste` handler at least for `initialBlock` Tool.
|
||
|
||
> Example
|
||
|
||
Header Tool can handle `H1`-`H6` tags using paste handling API
|
||
|
||
```javascript
|
||
static get pasteConfig() {
|
||
return {
|
||
tags: ['H1', 'H2', 'H3', 'H4', 'H5', 'H6'],
|
||
}
|
||
}
|
||
```
|
||
|
||
> Same tag can be handled by one (first specified) Tool only.
|
||
|
||
### RegExp patterns handling
|
||
|
||
Your Tool can analyze text by RegExp patterns to substitute pasted string with data you want. Object returned from `pasteConfig` getter should contain following field to use patterns:
|
||
|
||
| Name | Type | Description |
|
||
| -- | -- | -- |
|
||
| `patterns` | `Object` | _Optional_. `patterns` object contains RegExp patterns with their names as object's keys |
|
||
|
||
**Note** Editor will check pattern's full match, so don't forget to handle all available chars in there.
|
||
|
||
Pattern will be processed only if paste was on `initialBlock` Tool and pasted string length is less than 450 characters.
|
||
|
||
> Example
|
||
|
||
You can handle YouTube links and insert embeded video instead:
|
||
|
||
```javascript
|
||
static get pasteConfig() {
|
||
return {
|
||
patterns: {
|
||
youtube: /http(?:s?):\/\/(?:www\.)?youtu(?:be\.com\/watch\?v=|\.be\/)([\w\-\_]*)(&(amp;)?[\w\?=]*)?/
|
||
},
|
||
}
|
||
}
|
||
```
|
||
|
||
### Files pasting
|
||
|
||
Your Tool can handle files pasted or dropped into the Editor.
|
||
|
||
To handle file you should provide `files` property in your `pasteConfig` configuration object.
|
||
|
||
`files` property is an object with the following fields:
|
||
|
||
| Name | Type | Description |
|
||
| ---- | ---- | ----------- |
|
||
| `extensions` | `string[]` | _Optional_ Array of extensions your Tool can handle |
|
||
| `mimeTypes` | `sring[]` | _Optional_ Array of MIME types your Tool can handle |
|
||
|
||
Example
|
||
|
||
```javascript
|
||
static get pasteConfig() {
|
||
return {
|
||
files: {
|
||
mimeTypes: ['image/png'],
|
||
extensions: ['json']
|
||
}
|
||
}
|
||
}
|
||
```
|
||
|
||
### Pasted data handling
|
||
|
||
If you registered some paste substitutions in `pasteConfig` property, you **should** provide `onPaste` callback in your Tool class.
|
||
`onPaste` should be public non-static method. It accepts custom _PasteEvent_ object as argument.
|
||
|
||
PasteEvent is an alias for three types of events - `tag`, `pattern` and `file`. You can get the type from _PasteEvent_ object's `type` property.
|
||
Each of these events provide `detail` property with info about pasted content.
|
||
|
||
| Type | Detail |
|
||
| ----- | ------ |
|
||
| `tag` | `data` - pasted HTML element |
|
||
| `pattern` | `key` - matched pattern key you specified in `pasteConfig` object <br /> `data` - pasted string |
|
||
| `file` | `file` - pasted file |
|
||
|
||
Example
|
||
|
||
```javascript
|
||
onPaste (event) {
|
||
switch (event.type) {
|
||
case 'tag':
|
||
const element = event.detail.data;
|
||
|
||
this.handleHTMLPaste(element);
|
||
break;
|
||
|
||
case 'pattern':
|
||
const text = event.detail.data;
|
||
const key = event.detail.key;
|
||
|
||
this.handlePatternPaste(key, text);
|
||
break;
|
||
|
||
case 'file':
|
||
const file = event.detail.file;
|
||
|
||
this.handleFilePaste(file);
|
||
break;
|
||
}
|
||
}
|
||
```
|
||
|
||
### Disable paste handling
|
||
|
||
If you need to disable paste handling on your Tool for some reason, you can provide `false` as `pasteConfig` value.
|
||
That way paste event won't be processed if fired on your Tool:
|
||
|
||
```javascript
|
||
static get pasteConfig {
|
||
return false;
|
||
}
|
||
```
|
||
|
||
## Sanitize <a name="sanitize"></a>
|
||
|
||
Editor.js provides [API](sanitizer.md) to clean taint strings.
|
||
Use it manually at the `save()` method or or pass `sanitizer` config to do it automatically.
|
||
|
||
### Sanitizer Configuration
|
||
|
||
The example of sanitizer configuration
|
||
|
||
```javascript
|
||
let sanitizerConfig = {
|
||
b: true, // leave <b>
|
||
p: true, // leave <p>
|
||
}
|
||
```
|
||
|
||
Keys of config object is tags and the values is a rules.
|
||
|
||
#### Rule
|
||
|
||
Rule can be boolean, object or function. Object is a dictionary of rules for tag's attributes.
|
||
|
||
You can set `true`, to allow tag with all attributes or `false|{}` to remove all attributes,
|
||
but leave tag.
|
||
|
||
Also you can pass special attributes that you want to leave.
|
||
|
||
```javascript
|
||
a: {
|
||
href: true
|
||
}
|
||
```
|
||
|
||
If you want to use a custom handler, use should specify a function
|
||
that returns a rule.
|
||
|
||
```javascript
|
||
b: function(el) {
|
||
return !el.textContent.includes('bad text');
|
||
}
|
||
```
|
||
|
||
or
|
||
|
||
```javascript
|
||
a: function(el) {
|
||
let anchorHref = el.getAttribute('href');
|
||
if (anchorHref && anchorHref.substring(0, 4) === 'http') {
|
||
return {
|
||
href: true,
|
||
target: '_blank'
|
||
}
|
||
} else {
|
||
return {
|
||
href: true
|
||
}
|
||
}
|
||
}
|
||
```
|
||
|
||
### Manual sanitize
|
||
|
||
Call API method `sanitizer.clean()` at the save method for each field in returned data.
|
||
|
||
```javascript
|
||
save() {
|
||
return {
|
||
text: this.api.sanitizer.clean(taintString, sanitizerConfig)
|
||
}
|
||
}
|
||
```
|
||
|
||
### Automatic sanitize
|
||
|
||
If you pass the sanitizer config as static getter, Editor.js will automatically sanitize your saved data.
|
||
|
||
Note that if your Tool is allowed to use the Inline Toolbar, we will get sanitizing rules for each Inline Tool
|
||
and merge with your passed config.
|
||
|
||
You can define rules for each field
|
||
|
||
```javascript
|
||
static get sanitize() {
|
||
return {
|
||
text: {},
|
||
items: {
|
||
b: true, // leave <b>
|
||
a: false, // remove <a>
|
||
}
|
||
}
|
||
}
|
||
```
|
||
|
||
Don't forget to set the rule for each embedded subitems otherwise they will
|
||
not be sanitized.
|
||
|
||
if you want to sanitize everything and get data without any tags, use `{}` or just
|
||
ignore field in case if you want to get pure HTML
|
||
|
||
```javascript
|
||
static get sanitize() {
|
||
return {
|
||
text: {},
|
||
items: {}, // this rules will be used for all properties of this object
|
||
// or
|
||
items: {
|
||
// other objects here won't be sanitized
|
||
subitems: {
|
||
// leave <a> and <b> in subitems
|
||
a: true,
|
||
b: true,
|
||
}
|
||
}
|
||
}
|
||
}
|
||
```
|
||
|
||
## Conversion config <a name="conversion-config"></a>
|
||
|
||
Editor.js has a Conversion Toolbar that allows user to convert one Block to another.
|
||
|
||

|
||
|
||
1. You can add ability to your Tool to be converted. Specify «export» property of `conversionConfig`.
|
||
2. You can add ability to convert other Tools to your Tool. Specify «import» property of `conversionConfig`.
|
||
|
||
Conversion Toolbar will be shown only near Blocks that specified an «export» rule, when user selected almost all block's content.
|
||
This Toolbar will contain only Tools that specified an «import» rule.
|
||
|
||
Example:
|
||
|
||
```js
|
||
class Header {
|
||
constructor(){
|
||
this.data = {
|
||
text: '',
|
||
level: 2
|
||
}
|
||
}
|
||
|
||
/**
|
||
* Rules specified how our Tool can be converted to/from other Tool.
|
||
*/
|
||
static get conversionConfig() {
|
||
return {
|
||
export: 'text', // this property of tool data will be used as string to pass to other tool
|
||
import: 'text' // to this property imported string will be passed
|
||
};
|
||
}
|
||
}
|
||
```
|
||
|
||
### Your Tool -> other Tool
|
||
|
||
The «export» field specifies how to represent your Tool's data as a string to pass it to other tool.
|
||
|
||
It can be a `String` or a `Function`.
|
||
|
||
`String` means a key of your Tool data object that should be used as string to export.
|
||
|
||
`Function` is a method that accepts your Tool data and compose a string to export from it. See example below:
|
||
|
||
```js
|
||
class ListTool {
|
||
constructor(){
|
||
this.data = {
|
||
items: [
|
||
'Fisrt item',
|
||
'Second item',
|
||
'Third item'
|
||
],
|
||
type: 'ordered'
|
||
}
|
||
}
|
||
|
||
static get conversionConfig() {
|
||
return {
|
||
export: (data) => {
|
||
return data.items.join('.'); // in this example, all list items will be concatenated to an export string
|
||
},
|
||
// ... import rule
|
||
};
|
||
}
|
||
}
|
||
```
|
||
|
||
### Other Tool -> your Tool
|
||
|
||
The «import» rule specifies how to create your Tool's data object from the string created by original block.
|
||
|
||
It can be a `String` or a `Function`.
|
||
|
||
`String` means the key in tool data that will be filled by an exported string.
|
||
For example, `import: 'text'` means that `constructor` of your block will accept a `data` object with `text` property filled with string composed by original block.
|
||
|
||
`Function` allows you to specify own logic, how a string should be converted to your tool data. For example:
|
||
|
||
```js
|
||
class ListTool {
|
||
constructor(data){
|
||
this.data = data || {
|
||
items: [],
|
||
type: 'unordered'
|
||
}
|
||
}
|
||
|
||
static get conversionConfig() {
|
||
return {
|
||
// ... export rule
|
||
|
||
/**
|
||
* In this example, List Tool creates items by splitting original text by a dot symbol.
|
||
*/
|
||
import: (string) => {
|
||
const items = string.split('.');
|
||
|
||
return {
|
||
items: items.filter( (text) => text.trim() !== ''),
|
||
type: 'unordered'
|
||
};
|
||
}
|
||
};
|
||
}
|
||
}
|
||
```
|
||
|
||
## Block Lifecycle hooks
|
||
|
||
### `rendered()`
|
||
|
||
Called after Block contents is added to the page
|
||
|
||
### `updated()`
|
||
|
||
Called each time Block contents is updated
|
||
|
||
### `removed()`
|
||
|
||
Called after Block contents is removed from the page but before Block instance deleted
|
||
|
||
### `moved(MoveEvent)`
|
||
|
||
Called after Block was moved. `MoveEvent` contains `fromIndex` and `toIndex`
|
||
respectively.
|