Skip to content

Commit ac93017

Browse files
authored
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
1 parent 0600233 commit ac93017

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+3892
-2307
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@
4646
[submodule "example/tools/warning"]
4747
path = example/tools/warning
4848
url = https://github.com/editor-js/warning
49+
[submodule "src/components/external/codex.tooltips"]
50+
path = src/components/external/codex.tooltips
51+
url = https://github.com/codex-team/codex.tooltips

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175

176176
END OF TERMS AND CONDITIONS
177177

178-
Copyright © 2015-2018 CodeX
178+
Copyright © 2015-present CodeX
179179

180180
Licensed under the Apache License, Version 2.0 (the "License");
181181
you may not use this file except in compliance with the License.

dist/editor.js

+18-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/editor.licenses.txt

+34-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
MIT
33
MIT License
44

5-
Copyright (c) 2014-2018 Sebastian McKenzie and other contributors
5+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
66

77
Permission is hereby granted, free of charge, to any person obtaining
88
a copy of this software and associated documentation files (the
@@ -28,7 +28,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2828
MIT
2929
MIT License
3030

31-
Copyright (c) 2014-2018 Sebastian McKenzie <[email protected]>
31+
Copyright (c) 2014-present Sebastian McKenzie and other contributors
3232

3333
Permission is hereby granted, free of charge, to any person obtaining
3434
a copy of this software and associated documentation files (the
@@ -150,6 +150,17 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
150150
SOFTWARE.
151151

152152

153+
codex-tooltip
154+
MIT
155+
Copyright 2019 CodeX https://codex.so
156+
157+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
158+
159+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
160+
161+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
162+
163+
153164
core-js
154165
MIT
155166
Copyright (c) 2014-2018 Denis Pushkarev
@@ -379,3 +390,24 @@ Apache License
379390

380391
regenerator-runtime
381392
MIT
393+
MIT License
394+
395+
Copyright (c) 2014-present, Facebook, Inc.
396+
397+
Permission is hereby granted, free of charge, to any person obtaining a copy
398+
of this software and associated documentation files (the "Software"), to deal
399+
in the Software without restriction, including without limitation the rights
400+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
401+
copies of the Software, and to permit persons to whom the Software is
402+
furnished to do so, subject to the following conditions:
403+
404+
The above copyright notice and this permission notice shall be included in all
405+
copies or substantial portions of the Software.
406+
407+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
408+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
409+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
410+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
411+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
412+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
413+
SOFTWARE.

dist/sprite.svg

+12-6
Loading

docs/CHANGELOG.md

+19
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,24 @@
11
# Changelog
22

3+
### 2.16
4+
5+
- `Improvements` — Inline Toolbar design improved
6+
- `Improvements` — Conversion Toolbar now included in the Inline Toolbar [#853](https://github.com/codex-team/editor.js/issues/853)
7+
- `Improvements` — All buttons now have beautiful Tooltips provided by [CodeX Tooltips](https://github.com/codex-team/codex.tooltips)
8+
- `New` — new Tooltips API for displaying tooltips near your custom elements
9+
`New` *API* — Block [lifecycle hooks](tools.md#block-lifecycle-hooks)
10+
`New` *Inline Tools API* — Ability to specify Tool's title via `title` static getter.
11+
- `Fix` — On selection from end to start backspace is working as expected now [#869](https://github.com/codex-team/editor.js/issues/869)
12+
`Fix` — Fix flipper with empty dom iterator [#926](https://github.com/codex-team/editor.js/issues/926)
13+
- `Fix` — Normalize node before walking through children at `isEmpty` method [943](https://github.com/codex-team/editor.js/issues/943)
14+
`Fix` — Fixed Grammarly conflict [#779](https://github.com/codex-team/editor.js/issues/779)
15+
`Improvements` — Module Listeners now correctly removes events with options [#904](https://github.com/codex-team/editor.js/pull/904)
16+
`Improvements` — Styles API: `.cdx-block` default vertical margins decreased from 0.7 to 0.4 ems.
17+
`Fix` — Fixed History Back on block deletion by Backspace in Firefox [#967](https://github.com/codex-team/editor.js/pull/967)
18+
- `Fix` — Fixed `getRangeCount` call if range count is 0 [#938](https://github.com/codex-team/editor.js/issues/938)
19+
- `New` — Log levels now available to suppress Editor.js console messages [#962](https://github.com/codex-team/editor.js/issues/962)
20+
- `Fix` — Fixed wrong navigation on block deletion
21+
322
### 2.15.1
423

524
- `Refactoring` — Constants of tools settings separated by internal and external to correspond API

docs/api.md

+50-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,55 @@ It makes following steps:
160160

161161
After executing the `destroy` method, editor inctance becomes an empty object. This way you will free occupied JS Heap on your page.
162162

163-
### Shorthands
163+
### Tooltip API
164+
165+
Methods for showing Tooltip helper near your elements. Parameters are the same as in [CodeX Tooltips](http://github.com/codex-team/codex.tooltips) lib.
166+
167+
![](https://capella.pics/00e7094a-fdb9-429b-8015-9c56f19b4ef5.jpg)
168+
169+
#### Show
170+
171+
Method shows tooltip with custom content on passed element
172+
173+
```js
174+
this.api.tooltip.show(element, content, options);
175+
```
176+
177+
| parameter | type | description |
178+
| -- | -- | -- |
179+
| `element` | _HTMLElement_ | Tooltip will be showed near this element |
180+
| `content` | _String_ or _Node_ | Content that will be appended to the Tooltip |
181+
| `options` | _Object_ | Some displaying options, see below |
182+
183+
Available showing options
184+
185+
| name | type | action |
186+
| -- | -- | -- |
187+
| placement | `top`, `bottom`, `left`, `right` | Where to place the tooltip. Default value is `bottom' |
188+
| marginTop | _Number_ | Offset above the tooltip with `top` placement |
189+
| marginBottom | _Number_ | Offset below the tooltip with `bottom` placement |
190+
| marginLeft | _Number_ | Offset at left from the tooltip with `left` placement |
191+
| marginRight | _Number_ | Offset at right from the tooltip with `right` placement |
192+
| delay | _Number_ | Delay before showing, in ms. Default is `70` |
193+
| hidingDelay | _Number_ | Delay before hiding, in ms. Default is `0` |
194+
195+
#### Hide
196+
197+
Method hides the Tooltip.
198+
199+
```js
200+
this.api.tooltip.hide();
201+
```
202+
203+
#### onHover
204+
205+
Decorator for showing tooltip near some element by "mouseenter" and hide by "mouseleave".
206+
207+
```js
208+
this.api.tooltip.onHover(element, content, options);
209+
```
210+
211+
### API Shorthands
164212

165213
Editor`s API provides some shorthands for API methods.
166214

@@ -179,3 +227,4 @@ const editor = EditorJS();
179227
editor.focus();
180228
editor.save();
181229
```
230+

docs/installation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Then require this script.
4444

4545
### Save sources to project
4646

47-
Copy [editorjs.js](../dist/editor.js) file to your project and load it.
47+
Copy [editor.js](../dist/editor.js) file to your project and load it.
4848

4949
```html
5050
<script src="editor.js"></script>

docs/tools-inline.md

+25
Original file line numberDiff line numberDiff line change
@@ -123,3 +123,28 @@ static get sanitize() {
123123
```
124124

125125
Read more about Sanitizer configuration at the [Tools#sanitize](tools.md#sanitize)
126+
127+
### Specifying a title
128+
129+
You can pass your Tool's title via `title` static getter. It can be used, for example, in the Tooltip with
130+
icon description that appears by hover.
131+
132+
![](https://capella.pics/00e7094a-fdb9-429b-8015-9c56f19b4ef5.jpg)
133+
134+
```ts
135+
export default class BoldInlineTool implements InlineTool {
136+
/**
137+
* Specifies Tool as Inline Toolbar Tool
138+
*
139+
* @return {boolean}
140+
*/
141+
public static isInline = true;
142+
143+
/**
144+
* Title for hover-tooltip
145+
*/
146+
public static title: string = 'Bold';
147+
148+
// ... other methods
149+
}
150+
```

docs/tools.md

+14
Original file line numberDiff line numberDiff line change
@@ -462,3 +462,17 @@ class ListTool {
462462
}
463463
}
464464
```
465+
466+
## Block Lifecycle hooks
467+
468+
### `rendered()`
469+
470+
Called after Block contents is added to the page
471+
472+
### `updated()`
473+
474+
Called each time Block contents is updated
475+
476+
### `removed()`
477+
478+
Called after Block contents is removed from the page but before Block instance deleted

docs/usage.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -102,4 +102,26 @@ var editor = new EditorJS({
102102

103103
```
104104

105-
If you are using your custom `Initial Block`, `placeholder` property is passed in `config` to your Tool constructor.
105+
If you are using your custom `Initial Block`, `placeholder` property is passed in `config` to your Tool constructor.
106+
107+
## Log level
108+
109+
You can specify log level for Editor.js console messages via `logLevel` property of configuration:
110+
111+
```js
112+
var editor = new EditorJS({
113+
//...
114+
logLevel: 'WARN'
115+
//..
116+
})
117+
```
118+
119+
Possible values:
120+
121+
| Value | Description |
122+
| ----- | ---------------------------- |
123+
| `VERBOSE` | Show all messages |
124+
| `INFO` | Show info and debug messages |
125+
| `WARN` | Show errors and warns only |
126+
| `ERROR` | Show errors only |
127+

example/example-dev.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@
265265
{
266266
type: 'image',
267267
data: {
268-
url: 'https://codex.so/upload/redactor_images/o_e48549d1855c7fc1807308dd14990126.jpg',
268+
url: 'https://capella.pics/bbe6896c-ca1f-439e-8cb6-ebfda0d397d6.jpg',
269269
caption: '',
270270
stretched: false,
271271
withBorder: true,

example/example.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@
254254
{
255255
type: 'image',
256256
data: {
257-
url: 'https://codex.so/upload/redactor_images/o_e48549d1855c7fc1807308dd14990126.jpg',
257+
url: 'https://capella.pics/bbe6896c-ca1f-439e-8cb6-ebfda0d397d6.jpg',
258258
caption: '',
259259
stretched: false,
260260
withBorder: true,

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@editorjs/editorjs",
3-
"version": "2.15.1",
3+
"version": "2.16.0",
44
"description": "Editor.js — Native JS, based on API and Open Source",
55
"main": "dist/editor.js",
66
"types": "./types/index.d.ts",

src/assets/bold.svg

+1-1
Loading

src/assets/italic.svg

+2-2
Loading

0 commit comments

Comments
 (0)