Skip to content

Commit

Permalink
Release/2.16.1 (codex-team#990)
Browse files Browse the repository at this point in the history
* 2.16.0

* [Refactor] Separate internal and external settings (codex-team#845)

* Enable flipping tools via standalone class (codex-team#830)

* Enable flipping tools via standalone class

* use flipper to refactor (codex-team#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 (codex-team#856)

* Fix Block selection via CMD+A (codex-team#829)

* Fix Block selection via CMD+A

* Delete editor.js.map

* update

* update

* Update CHANGELOG.md

* Improve style of selected blocks (codex-team#858)

* Cross-block-selection style improved

* Update CHANGELOG.md

* Fix case when property 'observer' in modificationObserver is not defined (codex-team#866)

* Bump lodash.template from 4.4.0 to 4.5.0 (codex-team#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](lodash/lodash@4.4.0...4.5.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump eslint-utils from 1.3.1 to 1.4.2 (codex-team#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](mysticatea/eslint-utils@v1.3.1...v1.4.2)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump mixin-deep from 1.3.1 to 1.3.2 (codex-team#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](jonschlinkert/mixin-deep@1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <[email protected]>

* update bundle and readme

* Update README.md

* upd codeowners, fix funding

* Minor Docs Fix according to main Readme (codex-team#916)

* Inline Toolbar now contains Conversion Toolbar (codex-team#932)

* Block lifecycle hooks (codex-team#906)

* [Fix] Arrow selection (codex-team#964)

* Fix arrow selection

* Add docs

* [issue-926]: fix dom iterator leafing when items are empty (codex-team#958)

* [issue-926]: fix dom iterator leafing when items are empty

* update Changelog

* Issue 869 (codex-team#963)

* Fix issue 943 (codex-team#965)

* [Draft] Feature/tooltip enhancements (codex-team#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 (codex-team#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 (codex-team#967)

* Deleting multiple blocks triggers back button in Firefox

@evgenusov

* Update editor.js

* Update CHANGELOG.md

* pass options on removeEventListener (codex-team#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 (codex-team#968)

* Fix codex-team#952 (codex-team#969)

* Update codex.tooltips

* Selection bugfix (codex-team#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 (codex-team#972)

* [Feature] Log levels (codex-team#971)

* Decrease margins (codex-team#973)

* Decrease margins

* Update editor.licenses.txt

* Update src/components/domIterator.ts

Co-Authored-By: Murod Khaydarov <[email protected]>

* [Fix] Fix delete blocks api method (codex-team#974)

* Update docs/usage.md

Co-Authored-By: Murod Khaydarov <[email protected]>

* rm unused

* Update yarn.lock file

* upd bundle, changelog

* Resolve Firefox issues (codex-team#981)

* Resolve Firefox issues

* use firefox hack only for empty c-e divs

* Set initial hidden Inline Toolbar position (codex-team#982)

Resolves codex-team#979

* [Fix] tooltip types (codex-team#986)

* Add tooltip as a package

* Fix to set minHeight 0px (codex-team#987)

* Release 2.16 (codex-team#966)

* 2.16.0

* [Refactor] Separate internal and external settings (codex-team#845)

* Enable flipping tools via standalone class (codex-team#830)

* Enable flipping tools via standalone class

* use flipper to refactor (codex-team#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 (codex-team#856)

* Fix Block selection via CMD+A (codex-team#829)

* Fix Block selection via CMD+A

* Delete editor.js.map

* update

* update

* Update CHANGELOG.md

* Improve style of selected blocks (codex-team#858)

* Cross-block-selection style improved

* Update CHANGELOG.md

* Fix case when property 'observer' in modificationObserver is not defined (codex-team#866)

* Bump lodash.template from 4.4.0 to 4.5.0 (codex-team#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](lodash/lodash@4.4.0...4.5.0)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump eslint-utils from 1.3.1 to 1.4.2 (codex-team#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](mysticatea/eslint-utils@v1.3.1...v1.4.2)

Signed-off-by: dependabot[bot] <[email protected]>

* Bump mixin-deep from 1.3.1 to 1.3.2 (codex-team#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](jonschlinkert/mixin-deep@1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <[email protected]>

* update bundle and readme

* Update README.md

* upd codeowners, fix funding

* Minor Docs Fix according to main Readme (codex-team#916)

* Inline Toolbar now contains Conversion Toolbar (codex-team#932)

* Block lifecycle hooks (codex-team#906)

* [Fix] Arrow selection (codex-team#964)

* Fix arrow selection

* Add docs

* [issue-926]: fix dom iterator leafing when items are empty (codex-team#958)

* [issue-926]: fix dom iterator leafing when items are empty

* update Changelog

* Issue 869 (codex-team#963)

* Fix issue 943 (codex-team#965)

* [Draft] Feature/tooltip enhancements (codex-team#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 (codex-team#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 (codex-team#967)

* Deleting multiple blocks triggers back button in Firefox

@evgenusov

* Update editor.js

* Update CHANGELOG.md

* pass options on removeEventListener (codex-team#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 (codex-team#968)

* Fix codex-team#952 (codex-team#969)

* Update codex.tooltips

* Selection bugfix (codex-team#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 (codex-team#972)

* [Feature] Log levels (codex-team#971)

* Decrease margins (codex-team#973)

* Decrease margins

* Update editor.licenses.txt

* Update src/components/domIterator.ts

Co-Authored-By: Murod Khaydarov <[email protected]>

* [Fix] Fix delete blocks api method (codex-team#974)

* Update docs/usage.md

Co-Authored-By: Murod Khaydarov <[email protected]>

* rm unused

* Update yarn.lock file

* upd bundle, changelog

* Fix changeling list items (codex-team#975)

* Update changelog (codex-team#976)

* Fix to set minHeight 0px

* upd version

* Update CHANGELOG.md

* upd bundle

* [Fix] Selection issues (codex-team#988)

* [Dev] Update dependencies (codex-team#989)

* Delete codex.tooltips

* Update submodules

* Fix/hide conversion toolbar (codex-team#991)

* Hide conversion toolbar if there is no conversion tool

* update changelog

* update comment

* updates

* improve code

* Update Changelog

* Update CHANGELOG.md
  • Loading branch information
neSpecc authored Dec 7, 2019
1 parent 3382da1 commit 74fdc91
Show file tree
Hide file tree
Showing 19 changed files with 864 additions and 1,300 deletions.
3 changes: 2 additions & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"presets": [
["@babel/preset-env", {
"modules": "umd",
"useBuiltIns": "entry"
"useBuiltIns": "entry",
"corejs": 3
}]
],
"plugins": [
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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 changes: 2 additions & 55 deletions dist/editor.js

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions dist/editor.js.LICENSE
Original file line number Diff line number Diff line change
@@ -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 ([email protected])
* @copyright CodeX 2018
* @license The MIT License (MIT)
*/

/*!
* CodeX.Tooltips
*
* @version 1.0.0
*
* @licence MIT
* @author CodeX <https://codex.so>
*
*
*/
2 changes: 1 addition & 1 deletion dist/editor.licenses.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
25 changes: 17 additions & 8 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
32 changes: 17 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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"
},
Expand All @@ -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"
}
}
2 changes: 1 addition & 1 deletion src/components/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/components/external/codex.tooltips
Submodule codex.tooltips deleted from 72a7c0
2 changes: 1 addition & 1 deletion src/components/modules/api/tooltip.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down
9 changes: 9 additions & 0 deletions src/components/modules/toolbar/conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 24 additions & 4 deletions src/components/modules/toolbar/inline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();

/**
Expand Down Expand Up @@ -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
Expand All @@ -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
*/
Expand Down
2 changes: 1 addition & 1 deletion src/components/modules/tooltip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/**
Expand Down
23 changes: 13 additions & 10 deletions src/components/modules/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down Expand Up @@ -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;
}

Expand Down
12 changes: 12 additions & 0 deletions src/styles/export.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

/**
Expand Down
2 changes: 2 additions & 0 deletions src/styles/inline-toolbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
visibility: hidden;
transition: transform 150ms ease, opacity 250ms ease;
will-change: transform, opacity;
top: 0;
left: 0;

&--showed {
opacity: 1;
Expand Down
8 changes: 8 additions & 0 deletions src/styles/ui.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 ";
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion types/api/tooltip.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* Tooltip API
*/
import {TooltipContent, TooltipOptions} from '../../src/components/external/codex.tooltips';
import {TooltipContent, TooltipOptions} from 'codex-tooltip';

export interface Tooltip {
/**
Expand Down
Loading

0 comments on commit 74fdc91

Please sign in to comment.