diff --git a/cypress.config.ts b/cypress.config.ts index ed2c10f0..11ac2de2 100644 --- a/cypress.config.ts +++ b/cypress.config.ts @@ -11,9 +11,22 @@ export default defineConfig({ // We've imported your old cypress plugins here. // You may want to clean this up later by importing these. setupNodeEvents(on, config) { - return require('./test/cypress/plugins/index.ts')(on, config); + /** + * Plugin for cypress that adds better terminal output for easier debugging. + * Prints cy commands, browser console logs, cy.request and cy.intercept data. Great for your pipelines. + * https://github.com/archfz/cypress-terminal-report + */ + require('cypress-terminal-report/src/installLogsPrinter')(on); + + require('./test/cypress/plugins/index.ts')(on, config); }, specPattern: 'test/cypress/tests/**/*.cy.{js,jsx,ts,tsx}', supportFile: 'test/cypress/support/index.ts', }, + 'retries': { + // Configure retry attempts for `cypress run` + 'runMode': 2, + // Configure retry attempts for `cypress open` + 'openMode': 0, + }, }); diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6600d997..daaaee87 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -3,12 +3,21 @@ ### 2.28.0 - `New` - Block ids now displayed in DOM via a data-id attribute. Could be useful for plugins that want access a Block's element by id. -- `New` - The `.convert(blockId, newType)` API method added +- `New` - The `blocks.convert(blockId, newType)` API method added. It allows to convert existed Block to a Block of another type. +- `New` - The `blocks.insertMany()` API method added. It allows to insert several Blocks to specified index. - `Improvement` - The Delete keydown at the end of the Block will now work opposite a Backspace at the start. Next Block will be removed (if empty) or merged with the current one. - `Improvement` - The Delete keydown will work like a Backspace when several Blocks are selected. - `Improvement` - If we have two empty Blocks, and press Backspace at the start of the second one, the previous will be removed instead of current. - `Improvement` - Tools shortcuts could be used to convert one Block to another. - `Improvement` - Tools shortcuts displayed in the Conversion Toolbar +- `Improvement` - Initialization Loader has been removed. +- `Improvement` - Selection style won't override your custom style for `::selection` outside the editor. +- `Improvement` - Performance optimizations: initialization speed increased, `blocks.render()` API method optimized. Big documents will be displayed faster. +- `Improvement` - "Editor saving" log removed +- `Improvement` - "I'm ready" log removed +- `Improvement` - The stub-block style simplified. +- `Improvement` - If some Block's tool will throw an error during construction, we will show Stub block instead of skipping it during render +- `Improvement` - Call of `blocks.clear()` now will trigger onChange will "block-removed" event for all removed blocks. ### 2.27.2 diff --git a/index.html b/index.html index 43c8b4ae..03037f39 100644 --- a/index.html +++ b/index.html @@ -404,6 +404,8 @@ localStorage.setItem('theme', document.body.classList.contains("dark-mode") ? 'dark' : 'default'); }) + + window.editor = editor; diff --git a/package.json b/package.json index bbb0329f..d5540e50 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@editorjs/editorjs", - "version": "2.28.0-rc.1", + "version": "2.28.0-rc.2", "description": "Editor.js — Native JS, based on API and Open Source", "main": "dist/editorjs.umd.js", "module": "dist/editorjs.mjs", @@ -44,7 +44,7 @@ "@editorjs/code": "^2.7.0", "@editorjs/delimiter": "^1.2.0", "@editorjs/header": "^2.7.0", - "@editorjs/paragraph": "^2.9.0", + "@editorjs/paragraph": "^2.10.0", "@editorjs/simple-image": "^1.4.1", "@types/node": "^18.15.11", "chai-subset": "^1.6.0", @@ -53,6 +53,7 @@ "core-js": "3.30.0", "cypress": "^12.9.0", "cypress-intellij-reporter": "^0.0.7", + "cypress-terminal-report": "^5.3.2", "eslint": "^8.37.0", "eslint-config-codex": "^1.7.1", "eslint-plugin-chai-friendly": "^0.7.2", diff --git a/src/components/block/index.ts b/src/components/block/index.ts index d568f25d..b47fe781 100644 --- a/src/components/block/index.ts +++ b/src/components/block/index.ts @@ -252,15 +252,20 @@ export default class Block extends EventsDispatcher { this.holder = this.compose(); /** - * Start watching block mutations + * Bind block events in RIC for optimizing of constructing process time */ - this.watchBlockMutations(); + window.requestIdleCallback(() => { + /** + * Start watching block mutations + */ + this.watchBlockMutations(); - /** - * Mutation observer doesn't track changes in "" and "