mirror of
https://github.com/codex-team/editor.js
synced 2024-06-10 09:52:36 +02:00
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
This commit is contained in:
parent
3382da1000
commit
74fdc9194b
3
.babelrc
3
.babelrc
|
@ -2,7 +2,8 @@
|
|||
"presets": [
|
||||
["@babel/preset-env", {
|
||||
"modules": "umd",
|
||||
"useBuiltIns": "entry"
|
||||
"useBuiltIns": "entry",
|
||||
"corejs": 3
|
||||
}]
|
||||
],
|
||||
"plugins": [
|
||||
|
|
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -46,6 +46,3 @@
|
|||
[submodule "example/tools/warning"]
|
||||
path = example/tools/warning
|
||||
url = https://github.com/editor-js/warning
|
||||
[submodule "src/components/external/codex.tooltips"]
|
||||
path = src/components/external/codex.tooltips
|
||||
url = https://github.com/codex-team/codex.tooltips
|
||||
|
|
57
dist/editor.js
vendored
57
dist/editor.js
vendored
File diff suppressed because one or more lines are too long
65
dist/editor.js.LICENSE
vendored
Normal file
65
dist/editor.js.LICENSE
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
/*!
|
||||
* Editor.js
|
||||
*
|
||||
* @version 2.16.1
|
||||
*
|
||||
* @licence Apache-2.0
|
||||
* @author CodeX <https://codex.so>
|
||||
*
|
||||
* @uses html-janitor
|
||||
* @licence Apache-2.0 (https://github.com/guardian/html-janitor/blob/master/LICENSE)
|
||||
*/
|
||||
|
||||
/**
|
||||
* If developer uses editor's API, then he can customize sanitize restrictions.
|
||||
* Or, sanitizing config can be defined globally in editors initialization. That config will be used everywhere
|
||||
* At least, if there is no config overrides, that API uses Default configuration
|
||||
*
|
||||
* @uses https://www.npmjs.com/package/html-janitor
|
||||
* @license https://github.com/guardian/html-janitor/blob/master/LICENSE
|
||||
*
|
||||
* @param {SanitizerConfig} config - sanitizer extension
|
||||
*/
|
||||
|
||||
/**
|
||||
* Editor.js
|
||||
*
|
||||
* Short Description (눈_눈;)
|
||||
* @version 2.0
|
||||
*
|
||||
* @licence Apache-2.0
|
||||
* @author CodeX-Team <https://ifmo.su>
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Codex JavaScript Notification module
|
||||
* https://github.com/codex-team/js-notifier
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Library for handling keyboard shortcuts
|
||||
* @copyright CodeX (https://codex.so)
|
||||
* @license MIT
|
||||
* @author CodeX (https://codex.so)
|
||||
* @version 1.1.1
|
||||
*/
|
||||
|
||||
/**
|
||||
* Base Paragraph Block for the Editor.js.
|
||||
* Represents simple paragraph
|
||||
*
|
||||
* @author CodeX (team@codex.so)
|
||||
* @copyright CodeX 2018
|
||||
* @license The MIT License (MIT)
|
||||
*/
|
||||
|
||||
/*!
|
||||
* CodeX.Tooltips
|
||||
*
|
||||
* @version 1.0.0
|
||||
*
|
||||
* @licence MIT
|
||||
* @author CodeX <https://codex.so>
|
||||
*
|
||||
*
|
||||
*/
|
2
dist/editor.licenses.txt
vendored
2
dist/editor.licenses.txt
vendored
|
@ -163,7 +163,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
|
|||
|
||||
core-js
|
||||
MIT
|
||||
Copyright (c) 2014-2018 Denis Pushkarev
|
||||
Copyright (c) 2014-2019 Denis Pushkarev
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
|
|
@ -1,20 +1,29 @@
|
|||
# Changelog
|
||||
|
||||
### 2.16.1
|
||||
|
||||
- `Fix` — Fix Firefox bug with incorrect height and cursor position of empty content editable elements [#947](https://github.com/codex-team/editor.js/issues/947) [#876](https://github.com/codex-team/editor.js/issues/876) [#608](https://github.com/codex-team/editor.js/issues/608) [#876](https://github.com/codex-team/editor.js/issues/876)
|
||||
- `Fix` — Set initial hidden Inline Toolbar position [#979](https://github.com/codex-team/editor.js/issues/979)
|
||||
- `Fix` — Fix issue with CodeX.Toolips TypeScript definitions [#978](https://github.com/codex-team/editor.js/issues/978)
|
||||
- `Fix` — Fix some issues with Inline and Tunes toolbars.
|
||||
- `Fix` - Fix `minHeight` option with zero-value issue [#724](https://github.com/codex-team/editor.js/issues/724)
|
||||
- `Improvements` — Disable Conversion Toolbar if there are no Tools to convert [#984](https://github.com/codex-team/editor.js/issues/984)
|
||||
|
||||
### 2.16
|
||||
|
||||
- `Improvements` — Inline Toolbar design improved
|
||||
- `Improvements` — Conversion Toolbar now included in the Inline Toolbar [#853](https://github.com/codex-team/editor.js/issues/853)
|
||||
- `Improvements` — All buttons now have beautiful Tooltips provided by [CodeX Tooltips](https://github.com/codex-team/codex.tooltips)
|
||||
- `New` — new Tooltips API for displaying tooltips near your custom elements
|
||||
- `New` *API* — Block [lifecycle hooks](tools.md#block-lifecycle-hooks)
|
||||
- `New` *Inline Tools API* — Ability to specify Tool's title via `title` static getter.
|
||||
— `New` *API* — Block [lifecycle hooks](tools.md#block-lifecycle-hooks)
|
||||
— `New` *Inline Tools API* — Ability to specify Tool's title via `title` static getter.
|
||||
- `Fix` — On selection from end to start backspace is working as expected now [#869](https://github.com/codex-team/editor.js/issues/869)
|
||||
- `Fix` — Fix flipper with empty dom iterator [#926](https://github.com/codex-team/editor.js/issues/926)
|
||||
- `Fix` — Normalize node before walking through children at `isEmpty` method [943](https://github.com/codex-team/editor.js/issues/943)
|
||||
- `Fix` — Fixed Grammarly conflict [#779](https://github.com/codex-team/editor.js/issues/779)
|
||||
- `Improvements` — Module Listeners now correctly removes events with options [#904](https://github.com/codex-team/editor.js/pull/904)
|
||||
- `Improvements` — Styles API: `.cdx-block` default vertical margins decreased from 0.7 to 0.4 ems.
|
||||
- `Fix` — Fixed History Back on block deletion by Backspace in Firefox [#967](https://github.com/codex-team/editor.js/pull/967)
|
||||
— `Fix` — Fix flipper with empty dom iterator [#926](https://github.com/codex-team/editor.js/issues/926)
|
||||
- `Fix` — Normalize node before walking through children at `isEmpty` method [#943](https://github.com/codex-team/editor.js/issues/943)
|
||||
— `Fix` — Fixed Grammarly conflict [#779](https://github.com/codex-team/editor.js/issues/779)
|
||||
— `Improvements` — Module Listeners now correctly removes events with options [#904](https://github.com/codex-team/editor.js/pull/904)
|
||||
— `Improvements` — Styles API: `.cdx-block` default vertical margins decreased from 0.7 to 0.4 ems.
|
||||
— `Fix` — Fixed History Back on block deletion by Backspace in Firefox [#967](https://github.com/codex-team/editor.js/pull/967)
|
||||
- `Fix` — Fixed `getRangeCount` call if range count is 0 [#938](https://github.com/codex-team/editor.js/issues/938)
|
||||
- `New` — Log levels now available to suppress Editor.js console messages [#962](https://github.com/codex-team/editor.js/issues/962)
|
||||
- `Fix` — Fixed wrong navigation on block deletion
|
||||
|
|
32
package.json
32
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@editorjs/editorjs",
|
||||
"version": "2.16.0",
|
||||
"version": "2.16.1",
|
||||
"description": "Editor.js — Native JS, based on API and Open Source",
|
||||
"main": "dist/editor.js",
|
||||
"types": "./types/index.d.ts",
|
||||
|
@ -28,22 +28,23 @@
|
|||
"url": "git+https://github.com/codex-team/editor.js.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.3.4",
|
||||
"@babel/plugin-transform-runtime": "^7.3.4",
|
||||
"@babel/core": "^7.7.5",
|
||||
"@babel/plugin-transform-runtime": "^7.7.5",
|
||||
"@babel/polyfill": "^7.2.5",
|
||||
"@babel/preset-env": "^7.3.4",
|
||||
"@babel/preset-env": "^7.7.5",
|
||||
"@babel/register": "^7.0.0",
|
||||
"@babel/runtime": "^7.3.4",
|
||||
"@babel/runtime": "^7.7.5",
|
||||
"@codexteam/shortcuts": "^1.1.1",
|
||||
"@types/webpack": "^4.4.25",
|
||||
"@types/webpack-env": "^1.13.9",
|
||||
"babel-loader": "^8.0.5",
|
||||
"babel-plugin-add-module-exports": "^1.0.0",
|
||||
"babel-plugin-class-display-name": "^2.1.0",
|
||||
"css-loader": "^2.1.1",
|
||||
"core-js": "3",
|
||||
"css-loader": "^3.2.1",
|
||||
"cssnano": "^4.1.10",
|
||||
"eslint": "^5.15.1",
|
||||
"eslint-loader": "^2.1.2",
|
||||
"eslint": "^6.7.2",
|
||||
"eslint-loader": "^3.0.3",
|
||||
"extract-text-webpack-plugin": "^3.0.2",
|
||||
"html-janitor": "^2.0.4",
|
||||
"license-webpack-plugin": "^2.1.1",
|
||||
|
@ -53,15 +54,15 @@
|
|||
"postcss-nested": "^4.1.2",
|
||||
"postcss-nested-ancestors": "^2.0.0",
|
||||
"postcss-preset-env": "^6.6.0",
|
||||
"raw-loader": "^1.0.0",
|
||||
"rimraf": "^2.6.3",
|
||||
"stylelint": "^9.10.1",
|
||||
"raw-loader": "^4.0.0",
|
||||
"rimraf": "^3.0.0",
|
||||
"stylelint": "^12.0.0",
|
||||
"svg-sprite-generator": "^0.0.7",
|
||||
"terser-webpack-plugin": "^1.2.3",
|
||||
"ts-loader": "^5.3.3",
|
||||
"terser-webpack-plugin": "^2.2.2",
|
||||
"ts-loader": "^6.2.1",
|
||||
"tslint": "^5.14.0",
|
||||
"tslint-loader": "^3.5.4",
|
||||
"typescript": "^3.3.3333",
|
||||
"typescript": "^3.7.3",
|
||||
"webpack": "^4.29.6",
|
||||
"webpack-cli": "^3.2.3"
|
||||
},
|
||||
|
@ -70,6 +71,7 @@
|
|||
"url": "https://opencollective.com/editorjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"codex-notifier": "^1.1.2"
|
||||
"codex-notifier": "^1.1.2",
|
||||
"codex-tooltip": "^1.0.0"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -160,7 +160,7 @@ export default class Core {
|
|||
* Height of Editor's bottom area that allows to set focus on the last Block
|
||||
* @type {number}
|
||||
*/
|
||||
this.config.minHeight = this.config.minHeight || 300;
|
||||
this.config.minHeight = this.config.minHeight !== undefined ? this.config.minHeight : 300 ;
|
||||
|
||||
/**
|
||||
* Initial block type
|
||||
|
|
1
src/components/external/codex.tooltips
vendored
1
src/components/external/codex.tooltips
vendored
|
@ -1 +0,0 @@
|
|||
Subproject commit 72a7c01b6589fbe5591f63d0501c898a47d22875
|
|
@ -1,6 +1,6 @@
|
|||
import Module from '../../__module';
|
||||
import { Tooltip } from '../../../../types/api';
|
||||
import {TooltipContent, TooltipOptions} from '../../external/codex.tooltips';
|
||||
import {TooltipContent, TooltipOptions} from 'codex-tooltip';
|
||||
|
||||
/**
|
||||
* @class TooltipAPI
|
||||
|
|
|
@ -141,6 +141,15 @@ export default class ConversionToolbar extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if it has more than one tool available for convert in
|
||||
*/
|
||||
public hasTools(): boolean {
|
||||
const tools = Object.keys(this.tools); // available tools in array representation
|
||||
|
||||
return !(tools.length === 1 && tools.shift() === this.config.initialBlock);
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces one Block with another
|
||||
* For that Tools must provide import/export methods
|
||||
|
|
|
@ -144,6 +144,10 @@ export default class InlineToolbar extends Module {
|
|||
*/
|
||||
this.addTools();
|
||||
|
||||
/**
|
||||
* Prepare conversion toolbar.
|
||||
* If it has any conversion tool then it will be enabled in the Inline Toolbar
|
||||
*/
|
||||
this.prepareConversionToolbar();
|
||||
|
||||
/**
|
||||
|
@ -273,10 +277,17 @@ export default class InlineToolbar extends Module {
|
|||
this.buttonsList = this.nodes.buttons.querySelectorAll(`.${this.CSS.inlineToolButton}`);
|
||||
this.opened = true;
|
||||
|
||||
/**
|
||||
* Change Conversion Dropdown content for current tool
|
||||
*/
|
||||
this.setConversionTogglerContent();
|
||||
if (this.Editor.ConversionToolbar.hasTools()) {
|
||||
/**
|
||||
* Change Conversion Dropdown content for current tool
|
||||
*/
|
||||
this.setConversionTogglerContent();
|
||||
} else {
|
||||
/**
|
||||
* hide Conversion Dropdown with there are no tools
|
||||
*/
|
||||
this.nodes.conversionToggler.hidden = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get currently visible buttons to pass it to the Flipper
|
||||
|
@ -289,6 +300,15 @@ export default class InlineToolbar extends Module {
|
|||
this.flipper.activate(visibleTools as HTMLElement[]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if node is contained by Inline Toolbar
|
||||
*
|
||||
* @param {Node} node — node to chcek
|
||||
*/
|
||||
public containsNode(node: Node): boolean {
|
||||
return this.nodes.wrapper.contains(node);
|
||||
}
|
||||
|
||||
/**
|
||||
* Need to show Inline Toolbar or not
|
||||
*/
|
||||
|
|
|
@ -3,7 +3,7 @@ import Module from '../__module';
|
|||
/**
|
||||
* Use external module CodeX Tooltip
|
||||
*/
|
||||
import CodeXTooltips, { TooltipContent, TooltipOptions } from '../external/codex.tooltips';
|
||||
import CodeXTooltips, { TooltipContent, TooltipOptions } from 'codex-tooltip';
|
||||
import {ModuleConfig} from '../../types-internal/module-config';
|
||||
|
||||
/**
|
||||
|
|
|
@ -496,16 +496,11 @@ export default class UI extends Module {
|
|||
this.Editor.ConversionToolbar.close();
|
||||
}
|
||||
|
||||
if (Selection.isAtEditor) {
|
||||
/**
|
||||
* Focus clicked Block.
|
||||
* Workaround case when user clicks on the bottom of editor
|
||||
*/
|
||||
if (Selection.anchorNode === this.nodes.redactor) {
|
||||
this.Editor.Caret.setToTheLastBlock();
|
||||
} else {
|
||||
this.Editor.BlockManager.setCurrentBlockByChildNode(Selection.anchorNode);
|
||||
}
|
||||
/**
|
||||
* Clear Selection if user clicked somewhere
|
||||
*/
|
||||
if (!this.Editor.CrossBlockSelection.isCrossBlockSelectionStarted) {
|
||||
this.Editor.BlockSelection.clearSelection(event);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -625,6 +620,14 @@ export default class UI extends Module {
|
|||
* We need to skip such firings
|
||||
*/
|
||||
if (!focusedElement || !focusedElement.closest(`.${Block.CSS.content}`)) {
|
||||
|
||||
/**
|
||||
* If new selection is not on Inline Toolbar, we need to close it
|
||||
*/
|
||||
if (!this.Editor.InlineToolbar.containsNode(focusedElement)) {
|
||||
this.Editor.InlineToolbar.close();
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,18 @@
|
|||
outline: none;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
/**
|
||||
* Workaround Firefox bug with cursor position on empty content editable elements with ::before pseudo
|
||||
* https://bugzilla.mozilla.org/show_bug.cgi?id=904846
|
||||
*/
|
||||
&[data-placeholder]::before {
|
||||
position: static !important;
|
||||
display: inline-block;
|
||||
width: 0;
|
||||
white-space: nowrap;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
visibility: hidden;
|
||||
transition: transform 150ms ease, opacity 250ms ease;
|
||||
will-change: transform, opacity;
|
||||
top: 0;
|
||||
left: 0;
|
||||
|
||||
&--showed {
|
||||
opacity: 1;
|
||||
|
|
|
@ -14,6 +14,14 @@
|
|||
&--hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/**
|
||||
* Workaround firefox bug: empty content editable elements has collapsed height
|
||||
* https://bugzilla.mozilla.org/show_bug.cgi?id=1098151#c18
|
||||
*/
|
||||
[contenteditable]:empty::after {
|
||||
content: "\feff ";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
2
types/api/tooltip.d.ts
vendored
2
types/api/tooltip.d.ts
vendored
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* Tooltip API
|
||||
*/
|
||||
import {TooltipContent, TooltipOptions} from '../../src/components/external/codex.tooltips';
|
||||
import {TooltipContent, TooltipOptions} from 'codex-tooltip';
|
||||
|
||||
export interface Tooltip {
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue