Skip to content

Commit 7f82603

Browse files
merge remote-tracking branch 'upstream/next' into next
2 parents c87db1d + 3aa164d commit 7f82603

File tree

219 files changed

+9259
-9576
lines changed

Some content is hidden

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

219 files changed

+9259
-9576
lines changed

.eslintrc

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,25 @@
3434
"unknown": true,
3535
"requestAnimationFrame": true,
3636
"navigator": true
37-
}
37+
},
38+
"rules": {
39+
"jsdoc/require-returns-type": "off",
40+
"@typescript-eslint/strict-boolean-expressions": "warn",
41+
"@typescript-eslint/consistent-type-imports": "error",
42+
"@typescript-eslint/consistent-type-exports": "error"
43+
},
44+
"overrides": [
45+
{
46+
"files": [
47+
"tsconfig.json",
48+
"package.json",
49+
"tsconfig.*.json",
50+
"tslint.json"
51+
],
52+
"rules": {
53+
"quotes": [1, "double"],
54+
"semi": [1, "never"],
55+
}
56+
}
57+
]
3858
}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ dist/
1717

1818
coverage/
1919
.nyc_output/
20+
.vscode/launch.json

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,17 @@ Take a look at the [example.html](example/example.html) to view more detailed ex
120120

121121
<img align="right" width="342" src="./assets/roadmap.png" style="margin-left: 30px">
122122

123-
- Unified Toolbox
123+
- Unified Toolbars
124124
- [x] Block Tunes moved left
125125
- [x] Toolbox becomes vertical
126126
- [x] Ability to display several Toolbox buttons by the single Tool
127127
- [x] Block Tunes become vertical
128-
- [ ] Block Tunes support nested menus
129-
- [ ] Conversion Toolbar uses Unified Toolbox
130-
- [ ] Conversion Toolbar added to the Block Tunes
128+
- [x] Block Tunes support nested menus
129+
- [x] Block Tunes support separators
130+
- [x] Conversion Menu added to the Block Tunes
131+
- [x] Unified Toolbar supports hints
132+
- [x] Conversion Toolbar uses Unified Toolbar
133+
- [x] Inline Toolbar uses Unified Toolbar
131134
- Collaborative editing
132135
- [ ] Implement Inline Tools JSON format
133136
- [ ] Operations Observer, Executor, Manager, Transformer

cypress.config.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import { defineConfig } from 'cypress';
2+
import path from 'node:path';
3+
import vitePreprocessor from 'cypress-vite';
24

35
export default defineConfig({
46
env: {
@@ -12,14 +14,18 @@ export default defineConfig({
1214
// We've imported your old cypress plugins here.
1315
// You may want to clean this up later by importing these.
1416
setupNodeEvents(on, config) {
17+
on('file:preprocessor', vitePreprocessor({
18+
configFile: path.resolve(__dirname, './vite.config.test.js'),
19+
}));
20+
1521
/**
1622
* Plugin for cypress that adds better terminal output for easier debugging.
1723
* Prints cy commands, browser console logs, cy.request and cy.intercept data. Great for your pipelines.
1824
* https://github.com/archfz/cypress-terminal-report
1925
*/
2026
require('cypress-terminal-report/src/installLogsPrinter')(on);
2127

22-
require('./test/cypress/plugins/index.ts')(on, config);
28+
require('@cypress/code-coverage/task')(on, config);
2329
},
2430
specPattern: 'test/cypress/tests/**/*.cy.{js,jsx,ts,tsx}',
2531
supportFile: 'test/cypress/support/index.ts',

docs/CHANGELOG.md

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,68 @@
11
# Changelog
22

3+
### 2.30.6
4+
5+
`Fix` – Fix the display of ‘Convert To’ near blocks that do not have the ‘conversionConfig.export’ rule specified
6+
`Fix` – The Plus button does not appear when the editor is loaded in an iframe in Chrome
7+
- `Fix` - Prevent inline toolbar from closing in nested instance of editor
8+
9+
### 2.30.5
10+
11+
`Fix` – Fix exported types
12+
13+
### 2.30.4
14+
15+
- `Fix` - Tool's exporting types added
16+
17+
### 2.30.3
18+
19+
- `Fix` – I18n in nested popover
20+
21+
### 2.30.2
22+
23+
- `Fix` – The onChange callback won't be fired when editor is initialized in the Read-Only mode
24+
- `Fix` – Convert To supports i18n again
25+
- `Fix` – Prevent form submit on inline tool click
26+
27+
### 2.30.1
28+
29+
- `Fix` – Remove fake selection after multiple "convert to" inline tool toggles
30+
31+
### 2.30.0
32+
33+
- `New` – Block Tunes now supports nesting items
34+
- `New` – Block Tunes now supports separator items
35+
- `New`*Menu Config* – New item type – HTML
36+
`New`*Menu Config* – Default and HTML items now support hints
37+
- `New` – Inline Toolbar has new look 💅
38+
- `New` – Inline Tool's `render()` now supports [Menu Config](https://editorjs.io/menu-config/) format
39+
- `New`*ToolsAPI* – All installed block tools now accessible via ToolsAPI `getBlockTools()` method
40+
- `New`*SelectionAPI* – Exposed methods `save()` and `restore()` that allow to save selection to be able to temporally move focus away, methods `setFakeBackground()` and `removeFakeBackground()` that allow to immitate selection while focus moved away
41+
- `New`*BlocksAPI* – Exposed `getBlockByElement()` method that helps find block by any child html element
42+
- `New` – "Convert to" control is now also available in Block Tunes
43+
- `New` — Editor.js now supports contenteditable placeholders out of the box. Just add `data-placeholder` or `data-placeholder-active` attribute to make it work. The first one will work like native placeholder while the second one will show placeholder only when block is current.
44+
- `Improvement` — Now Paragraph placeholder will be shown for the current paragraph, not only the first one.
45+
- `Improvment` - The API `blocks.update` now accepts `tunes` data as optional third argument and makes `data` - block data as optional.
46+
- `Improvement` — The ability to merge blocks of different types (if both tools provide the conversionConfig)
47+
- `Improvement` - The API `blocks.convert()` now returns the new block API
48+
- `Improvement` - The API `caret.setToBlock()` now can accept either BlockAPI or block index or block id
49+
- `Impovement`*MenuConfig*`TunesMenuConfig` type is deprecated, use the `MenuConfig` instead
50+
`Improvement`*Types*`BlockToolConstructorOptions` type improved, `block` and `config` are not optional anymore
51+
- `Improvement` - The Plus button and Block Tunes toggler are now better aligned with large line-height blocks, such as Headings
52+
- `Improvement` — Creating links on Android devices: now the mobile keyboard will have an "Enter" key for accepting the inserted link.
53+
- `Improvement` — Placeholders will stay visible on inputs focus.
54+
`Refactoring` – Switched to Vite as Cypress bundler
55+
- `Fix``onChange` will be called when removing the entire text within a descendant element of a block.
56+
- `Fix` - Unexpected new line on Enter press with selected block without caret
57+
- `Fix` - Search input autofocus loosing after Block Tunes opening
58+
- `Fix` - Block removing while Enter press on Block Tunes
59+
- `Fix` – Unwanted scroll on first typing on iOS devices
60+
- `Fix` - Unwanted soft line break on Enter press after period and space (". |") on iOS devices
61+
- `Fix` - Caret lost after block conversion on mobile devices.
62+
- `Fix` - Caret lost after Backspace at the start of block when previoius block is not convertable
63+
`Fix` — Deleting whitespaces at the start/end of the block
64+
- `Fix` — The problem caused by missed "import type" in block mutation event types resolved
65+
366
### 2.29.1
467

568
- `Fix` — Toolbox wont be shown when Slash pressed with along with Shift or Alt

docs/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ use 'move' instead)
7979

8080
`insert(type?: string, data?: BlockToolData, config?: ToolConfig, index?: number, needToFocus?: boolean)` - insert new Block with passed parameters
8181

82-
`update(id: string, data: BlockToolData)` - updates data for the block with passed id
82+
`update(id: string, data?: BlockToolData, tunes?: {[name: string]: BlockTuneData})` - updates block data and block tunes for the block with passed id
8383

8484
#### SanitizerAPI
8585

example/example-dev.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -89,22 +89,22 @@
8989
Read more in Tool's README file. For example:
9090
https://github.com/editor-js/header#installation
9191
-->
92-
<script src="./tools/header/dist/bundle.js" onload="document.getElementById('hint-tools').hidden = true"></script><!-- Header -->
93-
<script src="./tools/simple-image/dist/bundle.js"></script><!-- Image -->
94-
<script src="./tools/delimiter/dist/bundle.js"></script><!-- Delimiter -->
95-
<!-- <script src="./tools/list/dist/bundle.js"></script> List-->
96-
<script src="./tools/nested-list/dist/nested-list.js"></script><!-- Nested List -->
97-
<script src="./tools/checklist/dist/bundle.js"></script><!-- Checklist -->
98-
<script src="./tools/quote/dist/bundle.js"></script><!-- Quote -->
99-
<script src="./tools/code/dist/bundle.js"></script><!-- Code -->
100-
<script src="./tools/embed/dist/bundle.js"></script><!-- Embed -->
101-
<script src="./tools/table/dist/table.js"></script><!-- Table -->
102-
<script src="./tools/link/dist/bundle.js"></script><!-- Link -->
103-
<script src="./tools/raw/dist/bundle.js"></script><!-- Raw -->
104-
<script src="./tools/warning/dist/bundle.js"></script><!-- Warning -->
105-
106-
<script src="./tools/marker/dist/bundle.js"></script><!-- Marker -->
107-
<script src="./tools/inline-code/dist/bundle.js"></script><!-- Inline Code -->
92+
<script src="./tools/header/dist/header.umd.js" onload="document.getElementById('hint-tools').hidden = true"></script><!-- Header -->
93+
<script src="./tools/simple-image/dist/simple-image.umd.js"></script><!-- Image -->
94+
<script src="./tools/delimiter/dist/delimiter.umd.js"></script><!-- Delimiter -->
95+
<!-- <script src="./tools/list/dist/list.umd.js"></script> List-->
96+
<script src="./tools/nested-list/dist/nested-list.umd.js"></script><!-- Nested List -->
97+
<script src="./tools/checklist/dist/checklist.umd.js"></script><!-- Checklist -->
98+
<script src="./tools/quote/dist/quote.umd.js"></script><!-- Quote -->
99+
<script src="./tools/code/dist/code.umd.js"></script><!-- Code -->
100+
<script src="./tools/embed/dist/embed.umd.js"></script><!-- Embed -->
101+
<script src="./tools/table/dist/table.umd.js"></script><!-- Table -->
102+
<script src="./tools/link/dist/link.umd.js"></script><!-- Link -->
103+
<script src="./tools/raw/dist/raw.umd.js"></script><!-- Raw -->
104+
<script src="./tools/warning/dist/warning.umd.js"></script><!-- Warning -->
105+
106+
<script src="./tools/marker/dist/marker.umd.js"></script><!-- Marker -->
107+
<script src="./tools/inline-code/dist/inline-code.umd.js"></script><!-- Inline Code -->
108108

109109
<!-- Load Editor.js's Core -->
110110
<script src="../dist/editorjs.umd.js" onload="document.getElementById('hint-core').hidden = true;"></script>

example/tools/list

Submodule list updated from f0e9f01 to a6dc6a6

example/tools/nested-list

index.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
*/
133133
header: {
134134
class: Header,
135-
inlineToolbar: ['marker', 'link'],
135+
inlineToolbar: ['link', 'marker'],
136136
config: {
137137
placeholder: 'Header'
138138
},
@@ -203,6 +203,9 @@
203203
*/
204204
// defaultBlock: 'paragraph',
205205

206+
placeholder: 'Write something or press / to select a tool',
207+
autofocus: true,
208+
206209
/**
207210
* Initial Editor data
208211
*/

0 commit comments

Comments
 (0)