Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/2.16.1 #990

Merged
merged 56 commits into from
Dec 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
c221a64
2.16.0
Jul 8, 2019
fdeae3f
[Refactor] Separate internal and external settings (#845)
gohabereg Jul 10, 2019
af581d3
Enable flipping tools via standalone class (#830)
khaydarov Jul 15, 2019
0d1c86c
fixed a link in readme.md (#856)
Jul 30, 2019
52669d7
Fix Block selection via CMD+A (#829)
khaydarov Jul 31, 2019
d22667d
Improve style of selected blocks (#858)
neSpecc Jul 31, 2019
e2ca2a6
Fix case when property 'observer' in modificationObserver is not defi…
VLZH Sep 7, 2019
1623839
Bump lodash.template from 4.4.0 to 4.5.0 (#885)
dependabot[bot] Sep 8, 2019
3ab0435
Bump eslint-utils from 1.3.1 to 1.4.2 (#886)
dependabot[bot] Sep 8, 2019
749894b
Bump mixin-deep from 1.3.1 to 1.3.2 (#887)
dependabot[bot] Sep 8, 2019
bbcc13a
update bundle and readme
neSpecc Sep 8, 2019
fc9e13a
Update README.md
neSpecc Sep 8, 2019
3bfaa20
upd codeowners, fix funding
neSpecc Sep 8, 2019
72ee05a
Merge branch 'master' into release/2.16
neSpecc Oct 3, 2019
56839f7
Minor Docs Fix according to main Readme (#916)
ChaituVR Oct 20, 2019
a438185
Inline Toolbar now contains Conversion Toolbar (#932)
neSpecc Nov 20, 2019
a9c4649
Block lifecycle hooks (#906)
gohabereg Nov 21, 2019
d086b6d
[Fix] Arrow selection (#964)
gohabereg Nov 30, 2019
ea3c767
[issue-926]: fix dom iterator leafing when items are empty (#958)
khaydarov Nov 30, 2019
461f9a5
Issue 869 (#963)
gohabereg Nov 30, 2019
3e2bf87
Fix issue 943 (#965)
gohabereg Nov 30, 2019
36f69f0
[Draft] Feature/tooltip enhancements (#907)
khaydarov Nov 30, 2019
b19cb06
[issue-779]: Grammarly conflicts (#956)
khaydarov Nov 30, 2019
2e9faf1
Submodule Header now on master
neSpecc Nov 30, 2019
0689c82
Submodule Marker now on master
neSpecc Nov 30, 2019
533512e
Submodule Paragraph now on master
neSpecc Nov 30, 2019
7547e11
Submodule InlineCode now on master
neSpecc Nov 30, 2019
0d54c94
Submodule Simple Image now on master
neSpecc Nov 30, 2019
fa4b282
[issue-868]: Deleting multiple blocks triggers back button in Firefox…
khaydarov Nov 30, 2019
729f2ea
pass options on removeEventListener (#904)
MarinaZadoyanchuk Nov 30, 2019
1e20882
[Fix] Selection rangecount (#968)
gohabereg Nov 30, 2019
bee449b
Fix #952 (#969)
neSpecc Nov 30, 2019
fdcedb2
Update codex.tooltips
neSpecc Nov 30, 2019
053e25e
Merge branch 'release/2.16' of https://github.com/codex-team/editor.j…
neSpecc Nov 30, 2019
2729f8f
Selection bugfix (#970)
khaydarov Nov 30, 2019
c6f5be6
remove inline toolbar closing on cross block selection mouse up due t…
khaydarov Nov 30, 2019
cff5434
[Feature] Log levels (#971)
gohabereg Nov 30, 2019
ba2fe25
Decrease margins (#973)
neSpecc Nov 30, 2019
9661916
Update src/components/domIterator.ts
neSpecc Nov 30, 2019
6682034
[Fix] Fix delete blocks api method (#974)
gohabereg Nov 30, 2019
f3f94e3
Update docs/usage.md
neSpecc Nov 30, 2019
5910fa8
rm unused
neSpecc Nov 30, 2019
630cb76
Update yarn.lock file
Nov 30, 2019
f50abf4
Merge branch 'release/2.16' of github.com:codex-team/editor.js into r…
Nov 30, 2019
755f429
upd bundle, changelog
neSpecc Nov 30, 2019
964652d
Resolve Firefox issues (#981)
neSpecc Dec 3, 2019
f262bd7
Set initial hidden Inline Toolbar position (#982)
neSpecc Dec 3, 2019
4a9c65d
[Fix] tooltip types (#986)
gohabereg Dec 7, 2019
22b6f80
Fix to set minHeight 0px (#987)
hata6502 Dec 7, 2019
952c148
[Fix] Selection issues (#988)
gohabereg Dec 7, 2019
3476413
[Dev] Update dependencies (#989)
gohabereg Dec 7, 2019
738019f
Merge branch 'master' into release/2.16
neSpecc Dec 7, 2019
a1917da
Delete codex.tooltips
neSpecc Dec 7, 2019
83fcf82
Update submodules
Dec 7, 2019
aae8ca6
Fix/hide conversion toolbar (#991)
khaydarov Dec 7, 2019
7525427
Update CHANGELOG.md
neSpecc Dec 7, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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