Skip to content

Commit f68cfd5

Browse files
Merge branch 'codex-team:next' into next
2 parents 7ec0b4a + e40768f commit f68cfd5

File tree

119 files changed

+5428
-2174
lines changed

Some content is hidden

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

119 files changed

+5428
-2174
lines changed

.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,8 @@
3434
"unknown": true,
3535
"requestAnimationFrame": true,
3636
"navigator": true
37+
},
38+
"rules": {
39+
"jsdoc/require-returns-type": "off"
3740
}
3841
}

cypress.config.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export default defineConfig({
1212
// We've imported your old cypress plugins here.
1313
// You may want to clean this up later by importing these.
1414
setupNodeEvents(on, config) {
15+
on('file:preprocessor', require('cypress-vite')(config));
16+
1517
/**
1618
* Plugin for cypress that adds better terminal output for easier debugging.
1719
* Prints cy commands, browser console logs, cy.request and cy.intercept data. Great for your pipelines.

docs/CHANGELOG.md

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
11
# Changelog
22

3-
### 2.30.1
4-
5-
`New` – Block Tunes now supports nesting items
6-
73
### 2.30.0
84

5+
- `New` – Block Tunes now supports nesting items
6+
- `New` – Block Tunes now supports separator items
7+
- `New` – "Convert to" control is now also available in Block Tunes
98
- `Improvement` — The ability to merge blocks of different types (if both tools provide the conversionConfig)
109
- `Fix``onChange` will be called when removing the entire text within a descendant element of a block.
1110
- `Fix` - Unexpected new line on Enter press with selected block without caret
1211
- `Fix` - Search input autofocus loosing after Block Tunes opening
1312
- `Fix` - Block removing while Enter press on Block Tunes
13+
- `Fix` – Unwanted scroll on first typing on iOS devices
14+
- `Fix` - Unwanted soft line break on Enter press after period and space (". |") on iOS devices
15+
- `Fix` - Caret lost after block conversion on mobile devices.
16+
- `Fix` - Caret lost after Backspace at the start of block when previoius block is not convertable
17+
- `Improvement` - The API `blocks.convert()` now returns the new block API
18+
- `Improvement` - The API `caret.setToBlock()` now can accept either BlockAPI or block index or block id
19+
- `New`*Menu Config* – New item type – HTML
20+
`Refactoring` – Switched to Vite as Cypress bundler
21+
`New`*Menu Config* – Default and HTML items now support hints
22+
- `New` – Inline Toolbar has new look 💅
23+
- `New` – Inline Tool's `render()` now supports [Menu Config](https://editorjs.io/menu-config/) format
24+
- `New`*ToolsAPI* – All installed block tools now accessible via ToolsAPI `getBlockTools()` method
25+
- `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
26+
- `Impovement`*MenuConfig* – TunesMenuConfig deprecated, use MenuConfig type instead
27+
- `New`*BlocksAPI* – Exposed `getBlockByElement()` method that helps find block by any child html element
28+
`Fix` — Deleting whitespaces at the start/end of the block
29+
`Improvement`*Types*`BlockToolConstructorOptions` type improved, `block` and `config` are not optional anymore
30+
- `Improvement` - The Plus button and Block Tunes toggler are now better aligned with large line-height blocks, such as Headings
1431

1532
### 2.29.1
1633

index.html

Lines changed: 1 addition & 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
},

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@editorjs/editorjs",
3-
"version": "2.30.0-rc.3",
3+
"version": "2.30.0-rc.13",
44
"description": "Editor.js — Native JS, based on API and Open Source",
55
"main": "dist/editorjs.umd.js",
66
"module": "dist/editorjs.mjs",
@@ -56,6 +56,7 @@
5656
"cypress-intellij-reporter": "^0.0.7",
5757
"cypress-plugin-tab": "^1.0.5",
5858
"cypress-terminal-report": "^5.3.2",
59+
"cypress-vite": "^1.5.0",
5960
"eslint": "^8.37.0",
6061
"eslint-config-codex": "^1.7.1",
6162
"eslint-plugin-chai-friendly": "^0.7.2",

src/components/block-tunes/block-tune-delete.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66
import { API, BlockTune } from '../../../types';
77
import { IconCross } from '@codexteam/icons';
8-
import { TunesMenuConfig } from '../../../types/tools';
8+
import { MenuConfig } from '../../../types/tools/menu-config';
99

1010
/**
1111
*
@@ -35,7 +35,7 @@ export default class DeleteTune implements BlockTune {
3535
/**
3636
* Tune's appearance in block settings menu
3737
*/
38-
public render(): TunesMenuConfig {
38+
public render(): MenuConfig {
3939
return {
4040
icon: IconCross,
4141
title: this.api.i18n.t('Delete'),

src/components/block/api.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import Block from './index';
2-
import { BlockToolData, ToolConfig } from '../../../types/tools';
2+
import { BlockToolData, ToolConfig, ToolboxConfigEntry } from '../../../types/tools';
33
import { SavedData } from '../../../types/data-formats';
44
import { BlockAPI as BlockAPIInterface } from '../../../types/api';
55

@@ -128,6 +128,14 @@ function BlockAPI(
128128
dispatchChange(): void {
129129
block.dispatchChange();
130130
},
131+
132+
/**
133+
* Tool could specify several entries to be displayed at the Toolbox (for example, "Heading 1", "Heading 2", "Heading 3")
134+
* This method returns the entry that is related to the Block (depended on the Block data)
135+
*/
136+
getActiveToolboxEntry(): Promise<ToolboxConfigEntry | undefined> {
137+
return block.getActiveToolboxEntry();
138+
},
131139
};
132140

133141
Object.setPrototypeOf(this, blockAPI);

0 commit comments

Comments
 (0)