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.15.1 #888

Merged
merged 37 commits into from
Sep 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
5aeb65b
Feature: mobile ux improvements (#802)
neSpecc Jun 20, 2019
33cc273
Added typeof method (#812)
gohabereg Jun 25, 2019
a6194c1
[Feature/issue-704]: Conversion toolbar (#787)
khaydarov Jun 29, 2019
f28a632
Enable cross-block mouse selection (#737)
gohabereg Jun 30, 2019
e6c5753
Add support of different link types (#817)
gohabereg Jun 30, 2019
979d51b
[Fix]: issue with leading new lines (#816)
gohabereg Jun 30, 2019
491fe92
[Fix] Tool setting types (#825)
gohabereg Jun 30, 2019
b64b41c
[Feature]: insert() API method (#814)
gohabereg Jun 30, 2019
8b328ed
[Fix]: Handle native inputs changes (#815)
gohabereg Jun 30, 2019
2243f55
[Feature] Keyboard cbs (#824)
gohabereg Jun 30, 2019
a0cb018
Updated Readme.md (#811)
Prateek93a Jun 30, 2019
38d1abf
Update CHANGELOG.md
neSpecc Jul 1, 2019
a923846
Add option to disable paste handling (#813)
gohabereg Jul 1, 2019
3b75965
Fix: hide Inlie Toolbar when user strart typing
neSpecc Jul 1, 2019
7a81e63
Merge branch 'release/2.15' of https://github.com/codex-team/editor.j…
neSpecc Jul 1, 2019
745e3cc
Enable cbs only for left mouse button
gohabereg Jul 1, 2019
de846fb
Change changelog order
gohabereg Jul 1, 2019
b9c79b9
Update submodules
gohabereg Jul 1, 2019
a29ca1f
Update bundle
gohabereg Jul 1, 2019
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
0ec3d14
Merge branch 'master' into release/2.15
neSpecc Sep 8, 2019
7157624
Merge branch 'release/2.16' into release/2.15
neSpecc Sep 8, 2019
068b7f3
rebuild
neSpecc Sep 8, 2019
3167ebd
Update CHANGELOG.md
neSpecc Sep 8, 2019
8a8fccc
Fix flipper tab after enter behaviour (#889)
neSpecc Sep 8, 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
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# These are supported funding model platforms

github: codex-team/editor.js
github: neSpecc
patreon: editorjs
open_collective: editorjs
2 changes: 1 addition & 1 deletion CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @neSpecc @gohabereg @khaydarov @talyguryn
* @neSpecc @gohabereg @khaydarov
86 changes: 37 additions & 49 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,35 @@
[![](https://flat.badgen.net/npm/license/@editorjs/editorjs)](https://www.npmjs.com/package/@editorjs/editorjs)
[![Join the chat at https://gitter.im/codex-team/editor.js](https://badges.gitter.im/codex-team/editor.js.svg)](https://gitter.im/codex-team/editor.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

## Version 2.0 is here!
| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari-ios/safari-ios_48x48.png" alt="iOS Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>iOS Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
| --------- | --------- | --------- | --------- | --------- | --------- |
| Edge 12+ | Firefox 18+ | Chrome 49+ | Safari 10+ | Safari 10+ | Opera 36+

We are glad to introduce the next version of Editor.js. Totally new core, structure and plugins — that was an impressive adventure 🤓.
## If you like a project 💗💗💗

Join [public Telegram-chat](//t.me/codex_editor) or [Gitter-channel](https://gitter.im/codex-team/editor.js) where you can always find a support.
If you like Editor.js you can support project improvements and development of new features with a donation to our collective.

### Browsers support
👉 [https://opencollective.com/editorjs](https://opencollective.com/editorjs)

👉 Bitcoin: `3DCCemgtE6GrzehVpU6Sa2RJHFUUh8iT9q`

### Sponsors

| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt="IE / Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>IE / Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari-ios/safari-ios_48x48.png" alt="iOS Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>iOS Safari | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/opera/opera_48x48.png" alt="Opera" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Opera |
| --------- | --------- | --------- | --------- | --------- | --------- |
| Edge 12+ | Firefox 18+ | Chrome 49+ | Safari 10+ | Safari 10+ | Opera 36+
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/editorjs#sponsor)]

<a href="https://opencollective.com/editorjs/sponsor/0/website" target="_blank"><img src="https://opencollective.com/editorjs/sponsor/0/avatar.svg"></a>

### Backers

Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/editorjs#backer)]

<a href="https://opencollective.com/editorjs#backers" target="_blank"><img src="https://opencollective.com/editorjs/backers.svg?width=890"></a>

### Contributors

## ⭐️ If you like a project
This project exists thanks to all the people who contribute. <img src="https://opencollective.com/editorjs/contributors.svg?width=890&button=false" />

If you like Editor.js you can support project improvements and development of new features with a small donation on [Open Collective](https://opencollective.com/editorjs) or [Patreon](https://www.patreon.com/editorjs)
We are really welcome new contributors. If you want to make some code with us, please take a look at the [Good First Tasks](https://github.com/codex-team/editor.js/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+task%22). You can write to us on `team@codex.so` or via special [Telegram chat](https://t.me/editorjsdev), or any other way.

## Documentation

Expand All @@ -37,15 +51,13 @@ Please, visit [https://editorjs.io/](https://editorjs.io) to view all documentat

You can join a [Gitter-channel](https://gitter.im/codex-team/editor.js) or [Telegram-chat](//t.me/codex_editor) and ask a question.

---

## Changelog

See a whole [Changelog](/docs/CHANGELOG.md)

# So how to use Editor.js
## So how to use Editor.js

## Basics
### Basics

Editor.js is a Block-Styled editor. Blocks are structural units, of which the Entry is composed.
For example, `Paragraph`, `Heading`, `Image`, `Video`, `List` are Blocks. Each Block is represented by Plugin.
Expand All @@ -69,7 +81,7 @@ or apply Tool's settings, if it provided. For example, set a Heading level or Li

![](https://capella.pics/01a55381-46cd-47c7-b92e-34765434f2ca.jpg)

## Shortcuts
### Shortcuts

We really appreciate shortcuts. So there are few presets.

Expand Down Expand Up @@ -103,15 +115,15 @@ var editor = new EditorJS({
```


# Installation Guide
## Installation Guide

There are few steps to run Editor.js on your site.

1. [Load Editor's core](#load-editors-core)
2. [Load Tools](#load-tools)
3. [Initialize Editor's instance](#create-editor-instance)

## Load Editor's core
### Load Editor's core

Firstly you need to get Editor.js itself. It is a [minified script](dist/editor.js) with Editor's core and some default must-have tools.

Expand All @@ -121,7 +133,7 @@ Choose the most usable method of getting Editor for you.
- Source from CDN
- Local file from project

### Node.js
#### Node.js

Install the package via NPM or Yarn

Expand All @@ -135,7 +147,7 @@ Include module in your application
const EditorJS = require('@editorjs/editorjs');
```

### Use from CDN
#### Use from CDN

You can load specific version of package from [jsDelivr CDN](https://www.jsdelivr.com/package/npm/@editorjs/editorjs).

Expand All @@ -147,15 +159,15 @@ Then require this script.
<script src="..."></script>
```

### Save sources to project
#### Save sources to project

Copy [editor.js](build/editor.js) file to your project and load it.
Copy [editor.js](dist/editor.js) file to your project and load it.

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

## Load Tools
### Load Tools

Each Block at the Editor.js is represented by [Tools](docs/tools.md). There are simple external scripts with their own logic. Probably you want to use several Block Tools that should be connected.

Expand All @@ -171,7 +183,7 @@ Check [Editor.js's community](https://github.com/editor-js/) to see more ready-t
<script src="https://cdn.jsdelivr.net/npm/codex.editor.header@2.0.4/dist/bundle.js"></script>
```

## Create Editor instance
### Create Editor instance

Create an instance of Editor.js and pass [Configuration Object](types/configs/editor-config.d.ts) with `holderId` and tools list.

Expand Down Expand Up @@ -217,7 +229,7 @@ var editor = new EditorJS({
});
```

## Saving Data
### Saving Data

Call `editor.save()` and handle returned Promise with saved data.

Expand All @@ -228,39 +240,15 @@ editor.save()
});
```

## Example
### Example

Take a look at the [example.html](example/example.html) to view more detailed examples.

## Credits and references

- We use [HTMLJanitor](https://github.com/guardian/html-janitor) module in our Sanitizer module.

# Support project improvements

Love Editor.js? Please consider supporting our collective:

👉 [https://opencollective.com/editorjs](https://opencollective.com/editorjs)

👉 [Patreon](https://www.patreon.com/editorjs)

## Contributors

This project exists thanks to all the people who contribute. <img src="https://opencollective.com/editorjs/contributors.svg?width=890&button=false" />

## Backers

Thank you to all our backers! 🙏 [[Become a backer](https://opencollective.com/editorjs#backer)]

<a href="https://opencollective.com/editorjs#backers" target="_blank"><img src="https://opencollective.com/editorjs/backers.svg?width=890"></a>

## Sponsors

Support this project by becoming a sponsor. Your logo will show up here with a link to your website. [[Become a sponsor](https://opencollective.com/editorjs#sponsor)]

<a href="https://opencollective.com/editorjs/sponsor/0/website" target="_blank"><img src="https://opencollective.com/editorjs/sponsor/0/avatar.svg"></a>

# About team
## About team

We are CodeX and we build products for developers and makers.

Expand Down
10 changes: 5 additions & 5 deletions dist/editor.js

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

### 2.15.1

- `Refactoring` — Constants of tools settings separated by internal and external to correspond API
- `Refactoring` — Created universal Flipper class that responses for navigation by keyboard inside of any Toolbars
- `Fix` — First CMD+A on block with now uses default behaviour. Fixed problem with second CMD+A after selection clearing [#827](https://github.com/codex-team/editor.js/issues/827)
- `Improvements` — Style of inline selection and selected blocks improved
- `Fix` - Fixed problem when property 'observer' in modificationObserver is not defined

### 2.15

- `New` — New [`blocks.insert()`](api.md) API method [#715](https://github.com/codex-team/editor.js/issues/715).
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@editorjs/editorjs",
"version": "2.15.0",
"version": "2.15.1",
"description": "Editor.js — Native JS, based on API and Open Source",
"main": "dist/editor.js",
"types": "./types/index.d.ts",
Expand Down
79 changes: 0 additions & 79 deletions src/components/dom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,85 +519,6 @@ export default class Dom {
}, []);
}

/**
* Leafs nodes inside the target list from active element
*
* @param {HTMLElement[]} nodeList - target list of nodes
* @param {number} activeIndex — index of active node. By default it must be -1
* @param {string} direction - leaf direction. Can be 'left' or 'right'
* @param {string} activeCSSClass - css class that will be added
*
* @return {Number} index of active node
*/
public static leafNodesAndReturnIndex(
nodeList: HTMLElement[],
activeIndex: number,
direction: string,
activeCSSClass: string,
): number {
/**
* If activeButtonIndex === -1 then we have no chosen Tool in Toolbox
*/
if (activeIndex === -1) {
/**
* Normalize "previous" Tool index depending on direction.
* We need to do this to highlight "first" Tool correctly
*
* Order of Tools: [0] [1] ... [n - 1]
* [0 = n] because of: n % n = 0 % n
*
* Direction 'right': for [0] the [n - 1] is a previous index
* [n - 1] -> [0]
*
* Direction 'left': for [n - 1] the [0] is a previous index
* [n - 1] <- [0]
*
* @type {number}
*/
activeIndex = direction === 'right' ? -1 : 0;
} else {
/**
* If we have chosen Tool then remove highlighting
*/
nodeList[activeIndex].classList.remove(activeCSSClass);
}

/**
* Count index for next Tool
*/
if (direction === 'right') {
/**
* If we go right then choose next (+1) Tool
* @type {number}
*/
activeIndex = (activeIndex + 1) % nodeList.length;
} else {
/**
* If we go left then choose previous (-1) Tool
* Before counting module we need to add length before because of "The JavaScript Modulo Bug"
* @type {number}
*/
activeIndex = (nodeList.length + activeIndex - 1) % nodeList.length;
}

if (Dom.isNativeInput(nodeList[activeIndex])) {
/**
* Focus input
*/
nodeList[activeIndex].focus();
}

/**
* Highlight new chosen Tool
*/
nodeList[activeIndex].classList.add(activeCSSClass);

/**
* Return Active index
*/
return activeIndex;
}

/*
* Helper for get holder from {string} or return HTMLElement
* @param element
Expand Down
Loading