diff --git a/.babelrc b/.babelrc
deleted file mode 100644
index 3cb084c98..000000000
--- a/.babelrc
+++ /dev/null
@@ -1,19 +0,0 @@
-{
- "presets": [
- ["@babel/preset-env", {
- "modules": "umd",
- "useBuiltIns": "entry",
- "corejs": 3
- }]
- ],
- "plugins": [
- "babel-plugin-add-module-exports",
- "babel-plugin-class-display-name",
- "@babel/plugin-transform-runtime"
- ],
- "env": {
- "test": {
- "plugins": [ "istanbul" ]
- }
- }
-}
diff --git a/.eslintrc b/.eslintrc
index ef5665480..4504754c2 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -31,6 +31,28 @@
"ClientRect": true,
"ArrayLike": true,
"InputEvent": true,
- "unknown": true
- }
+ "unknown": true,
+ "requestAnimationFrame": true,
+ "navigator": true
+ },
+ "rules": {
+ "jsdoc/require-returns-type": "off",
+ "@typescript-eslint/strict-boolean-expressions": "warn",
+ "@typescript-eslint/consistent-type-imports": "error",
+ "@typescript-eslint/consistent-type-exports": "error"
+ },
+ "overrides": [
+ {
+ "files": [
+ "tsconfig.json",
+ "package.json",
+ "tsconfig.*.json",
+ "tslint.json"
+ ],
+ "rules": {
+ "quotes": [1, "double"],
+ "semi": [1, "never"],
+ }
+ }
+ ]
}
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 78639a6ca..d7b90d07e 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1,5 +1,5 @@
# These are supported funding model platforms
-github: neSpecc
patreon: editorjs
open_collective: editorjs
+custom: https://codex.so/donate
\ No newline at end of file
diff --git a/.github/workflows/bump-version-on-merge-next.yml b/.github/workflows/bump-version-on-merge-next.yml
index d1e94ea01..023bf8097 100644
--- a/.github/workflows/bump-version-on-merge-next.yml
+++ b/.github/workflows/bump-version-on-merge-next.yml
@@ -1,7 +1,14 @@
name: Bump version on merge
+# Caution:
+# the use of "pull_request_target" trigger allows to successfully
+# run workflow even when triggered from a fork. The trigger grants
+# access to repo's secrets and gives write permission to the runner.
+# This can be used to run malicious code on untrusted PR, so, please
+# DO NOT checkout any PR's ongoing commits (aka github.event.pull_request.head.sha)
+# while using this trigger.
on:
- pull_request:
+ pull_request_target:
branches:
- next
types: [closed]
@@ -11,6 +18,8 @@ jobs:
check-for-no-version-changing:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
+ permissions:
+ actions: write
steps:
# Checkout to target branch
- uses: actions/checkout@v2
@@ -32,16 +41,22 @@ jobs:
uses: codex-team/action-nodejs-package-info@v1
# Stop workflow and do not bump version if it was changed already
- - name: Stop workflow and do not bump version if it was changed already
- uses: actions/github-script@v3
+ - name: Stop workflow if version was changed already
if: steps.packageOld.outputs.version != steps.packageNew.outputs.version
- with:
- script: |
- core.setFailed('Version was changed! ${{ steps.packageOld.outputs.version }} -> ${{ steps.packageNew.outputs.version }}')
+ run: |
+ curl -L \
+ -X POST \
+ -H "Accept: application/vnd.github+json" \
+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
+ -H "X-GitHub-Api-Version: 2022-11-28" \
+ https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel
bump-version:
needs: check-for-no-version-changing
runs-on: ubuntu-latest
+ permissions:
+ contents: write
+ pull-requests: write
steps:
# Checkout to target branch
- uses: actions/checkout@v2
@@ -49,8 +64,7 @@ jobs:
# Setup node environment
- uses: actions/setup-node@v1
with:
- node-version: 15
- registry-url: https://registry.npmjs.org/
+ node-version: 16
# Bump version to the next prerelease (patch) with rc suffix
- name: Suggest the new version
diff --git a/.github/workflows/create-a-release-draft.yml b/.github/workflows/create-a-release-draft.yml
index 4016b7b80..02ffb1b33 100644
--- a/.github/workflows/create-a-release-draft.yml
+++ b/.github/workflows/create-a-release-draft.yml
@@ -1,7 +1,14 @@
name: Create a release draft
+# Caution:
+# the use of "pull_request_target" trigger allows to successfully
+# run workflow even when triggered from a fork. The trigger grants
+# access to repo's secrets and gives write permission to the runner.
+# This can be used to run malicious code on untrusted PR, so, please
+# DO NOT checkout any PR's ongoing commits (aka github.event.pull_request.head.sha)
+# while using this trigger.
on:
- pull_request:
+ pull_request_target:
branches:
- next
types: [closed]
@@ -11,7 +18,12 @@ jobs:
check-version-changing:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
+ permissions:
+ actions: write
steps:
+ - uses: actions/setup-node@v3
+ with:
+ node-version: 16
# Checkout to target branch
- uses: actions/checkout@v2
with:
@@ -33,16 +45,21 @@ jobs:
# Stop workflow if version was not changed
- name: Stop workflow if version was not changed
- uses: actions/github-script@v3
if: steps.packageOld.outputs.version == steps.packageNew.outputs.version
- with:
- script: |
- core.setFailed('No version changes. ${{ steps.packageOld.outputs.version }}')
+ run: |
+ curl -L \
+ -X POST \
+ -H "Accept: application/vnd.github+json" \
+ -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
+ -H "X-GitHub-Api-Version: 2022-11-28" \
+ https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/cancel
# Create a new draft release
release-draft:
needs: check-version-changing
runs-on: ubuntu-latest
+ permissions:
+ contents: write
steps:
# Checkout to target branch
- uses: actions/checkout@v2
@@ -53,8 +70,7 @@ jobs:
# Setup node environment
- uses: actions/setup-node@v1
with:
- node-version: 14.17.0
- registry-url: https://registry.npmjs.org/
+ node-version: 16
# Prepare, build and publish project
- name: Install dependencies
@@ -87,15 +103,26 @@ jobs:
# If version name contains "-rc" suffix than mark a "pre-release" checkbox
prerelease: ${{ contains(steps.package.outputs.version, '-rc') }}
- # Build and upload target Editor.js build to release as artifact
+ # Build and upload target Editor.js UMD build to release as artifact
+ - name: Upload Release Asset
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ steps.create_release.outputs.upload_url }}
+ asset_path: dist/editorjs.umd.js
+ asset_name: editorjs.umd.js
+ asset_content_type: application/javascript
+
+ # Build and upload target Editor.js MJS build to release as artifact
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: dist/editor.js
- asset_name: editor.js
+ asset_path: dist/editorjs.mjs
+ asset_name: editorjs.mjs
asset_content_type: application/javascript
# Send a notification message
diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml
index b7607a99c..e9ed6ae24 100644
--- a/.github/workflows/cypress.yml
+++ b/.github/workflows/cypress.yml
@@ -1,45 +1,28 @@
-name: Tests
+name: Cypress
+
on: [pull_request]
+
jobs:
- firefox:
- runs-on: ubuntu-latest
- container:
- image: cypress/browsers:node14.17.0-chrome88-ff89
- options: --user 1001
+ run-tests:
+ strategy:
+ matrix:
+ browser: [firefox, chrome, edge]
+
+ runs-on: ubuntu-22.04
steps:
+ - uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
- node-version: 16
- - uses: actions/checkout@v2
- - run: yarn ci:pull_paragraph
- - uses: cypress-io/github-action@v2
+ node-version: 18
+
+ - name: Setup Firefox
+ if: matrix.browser == 'firefox'
+ uses: browser-actions/setup-firefox@v1
with:
- config: video=false
- browser: firefox
- build: yarn build
- chrome:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/setup-node@v3
- with:
- node-version: 16
- - uses: actions/checkout@v2
- - run: yarn ci:pull_paragraph
- - uses: cypress-io/github-action@v2
- with:
- config: video=false
- browser: chrome
- build: yarn build
- edge:
- runs-on: windows-latest
- steps:
- - uses: actions/setup-node@v3
- with:
- node-version: 16
- - uses: actions/checkout@v2
- - run: yarn ci:pull_paragraph
- - uses: cypress-io/github-action@v2
+ firefox-version: '115.0esr'
+
+ - uses: cypress-io/github-action@v6
with:
config: video=false
- browser: edge
- build: yarn build
+ browser: ${{ matrix.browser }}
+ build: yarn build:test
diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml
index 052c68355..c85e5ca9b 100644
--- a/.github/workflows/eslint.yml
+++ b/.github/workflows/eslint.yml
@@ -9,16 +9,17 @@ jobs:
steps:
- uses: actions/checkout@v2
- - name: Cache node modules
- uses: actions/cache@v1
+ - uses: actions/setup-node@v3
with:
- path: node_modules
+ node-version: 18
+
+ - name: Cache dependencies
+ uses: actions/cache@v4
+ with:
+ path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
- ${{ runner.OS }}-build-${{ env.cache-name }}-
- ${{ runner.OS }}-build-
- ${{ runner.OS }}-
-
- - run: yarn install
+ ${{ runner.os }}-node-
+ - run: yarn
- run: yarn lint
diff --git a/.github/workflows/publish-package-to-npm.yml b/.github/workflows/publish-package-to-npm.yml
index a614f700e..e867a7ede 100644
--- a/.github/workflows/publish-package-to-npm.yml
+++ b/.github/workflows/publish-package-to-npm.yml
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# Checkout to target branch
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
with:
# Pull submodules
submodules: 'recursive'
@@ -22,7 +22,7 @@ jobs:
# Setup node environment
- uses: actions/setup-node@v1
with:
- node-version: 14.17.0
+ node-version: 16
registry-url: https://registry.npmjs.org/
# Prepare, build and publish project
@@ -46,9 +46,11 @@ jobs:
notify:
needs: publish
runs-on: ubuntu-latest
+ env:
+ GITHUB_LINK: ${{ github.server_url }}/${{ github.repository }}/releases/tag/${{ github.ref_name }}
steps:
# Checkout to target branch
- - uses: actions/checkout@v2
+ - uses: actions/checkout@v4
- name: Get package info
id: package
@@ -58,6 +60,6 @@ jobs:
uses: codex-team/action-codexbot-notify@v1
with:
webhook: ${{ secrets.CODEX_BOT_NOTIFY_EDITORJS_PUBLIC_CHAT }}
- message: '📦 [${{ steps.package.outputs.name }}](${{ steps.package.outputs.npmjs-link }}) ${{ steps.package.outputs.version }} was published'
+ message: '📦 [${{ steps.package.outputs.name }} ${{ steps.package.outputs.version }}](${{ env.GITHUB_LINK }}) was published'
parse_mode: 'markdown'
disable_web_page_preview: true
diff --git a/.gitignore b/.gitignore
index db93fc475..150d50708 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,3 +17,4 @@ dist/
coverage/
.nyc_output/
+.vscode/launch.json
diff --git a/.gitmodules b/.gitmodules
deleted file mode 100644
index ad185a9e5..000000000
--- a/.gitmodules
+++ /dev/null
@@ -1,57 +0,0 @@
-[submodule "example/tools/inline-code"]
- path = example/tools/inline-code
- url = https://github.com/editor-js/inline-code
-[submodule "example/tools/header"]
- path = example/tools/header
- url = https://github.com/editor-js/header
-[submodule "example/tools/delimiter"]
- path = example/tools/delimiter
- url = https://github.com/editor-js/delimiter
-[submodule "example/tools/list"]
- path = example/tools/list
- url = https://github.com/editor-js/list
-[submodule "example/tools/quote"]
- path = example/tools/quote
- url = https://github.com/editor-js/quote
-[submodule "example/tools/simple-image"]
- path = example/tools/simple-image
- url = https://github.com/editor-js/simple-image
-[submodule "src/tools/paragraph"]
- path = src/tools/paragraph
- url = https://github.com/editor-js/paragraph
-[submodule "example/tools/marker"]
- path = example/tools/marker
- url = https://github.com/editor-js/marker
-[submodule "example/tools/code"]
- path = example/tools/code
- url = https://github.com/editor-js/code
-[submodule "example/tools/image"]
- path = example/tools/image
- url = https://github.com/editor-js/image
-[submodule "example/tools/embed"]
- path = example/tools/embed
- url = https://github.com/editor-js/embed
-[submodule "example/tools/table"]
- path = example/tools/table
- url = https://github.com/editor-js/table
-[submodule "example/tools/checklist"]
- path = example/tools/checklist
- url = https://github.com/editor-js/checklist
-[submodule "example/tools/link"]
- path = example/tools/link
- url = https://github.com/editor-js/link
-[submodule "example/tools/raw"]
- path = example/tools/raw
- url = https://github.com/editor-js/raw
-[submodule "example/tools/warning"]
- path = example/tools/warning
- url = https://github.com/editor-js/warning
-[submodule "example/tools/underline"]
- path = example/tools/underline
- url = https://github.com/editor-js/underline
-[submodule "example/tools/nested-list"]
- path = example/tools/nested-list
- url = https://github.com/editor-js/nested-list
-[submodule "example/tools/text-variant-tune"]
- path = example/tools/text-variant-tune
- url = https://github.com/editor-js/text-variant-tune
diff --git a/.npmignore b/.npmignore
index 98ed3edfa..c549183e3 100644
--- a/.npmignore
+++ b/.npmignore
@@ -1,22 +1,6 @@
-.idea
-.github
-docs
-example
-src
-test
-.babelrc
-.editorconfig
-.eslintignore
-.eslintrc
-.git
-.gitmodules
-.jshintrc
-.postcssrc.yml
-.stylelintrc
-CODEOWNERS
-cypress.json
-tsconfig.json
-tslint.json
-webpack.config.js
-yarn.lock
-devserver.js
+*
+!/dist/**/*
+!/types/**/*
+!/LICENSE
+!/README.md
+!/package.json
diff --git a/.nvmrc b/.nvmrc
new file mode 100644
index 000000000..ef33d6510
--- /dev/null
+++ b/.nvmrc
@@ -0,0 +1 @@
+v18.20.1
diff --git a/.postcssrc.yml b/.postcssrc.yml
index b2a67d586..c52a3b2a8 100644
--- a/.postcssrc.yml
+++ b/.postcssrc.yml
@@ -1,8 +1,4 @@
plugins:
- # Consumes files by @import rule
- # https://github.com/postcss/postcss-import
- postcss-import: {}
-
# Apply custom property sets via @apply rule
# https://github.com/pascalduez/postcss-apply
postcss-apply: {}
@@ -26,16 +22,6 @@ plugins:
# https://github.com/csstools/postcss-preset-env#preserve
preserve: false
- # Enable or disable specific polyfills
- # https://github.com/csstools/postcss-preset-env#features
- #
- # List of available plugins
- # https://github.com/csstools/postcss-preset-env/blob/master/src/lib/plugins-by-id.js
- features:
- # Modify colors using the color-mod() function in CSS
- # https://github.com/jonathantneal/postcss-color-mod-function
- color-mod-function: {}
-
# Nested rules unwrapper
# https://github.com/postcss/postcss-nested
#
@@ -43,7 +29,3 @@ plugins:
# 'postcss-nesting' feature but it does not work with BEM
# Report: https://github.com/csstools/postcss-preset-env/issues/40
postcss-nested: {}
-
- # Compression tool
- # https://github.com/cssnano/cssnano
- cssnano: {}
diff --git a/.vscode/settings.json b/.vscode/settings.json
index 8b3ac96d3..5d01b0ef3 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -8,6 +8,7 @@
"colspan",
"contenteditable",
"contentless",
+ "Convertable",
"cssnano",
"cssnext",
"Debouncer",
@@ -34,6 +35,7 @@
"textareas",
"twitterwidget",
"typeof",
+ "Unmergeable",
"viewports"
]
}
diff --git a/README.md b/README.md
index 2ea846ead..eff9df7e1 100644
--- a/README.md
+++ b/README.md
@@ -116,14 +116,17 @@ Take a look at the [example.html](example/example.html) to view more detailed ex
-- Unified Toolbox
+- Unified Toolbars
- [x] Block Tunes moved left
- [x] Toolbox becomes vertical
- [x] Ability to display several Toolbox buttons by the single Tool
- [x] Block Tunes become vertical
- - [ ] Block Tunes support nested menus
- - [ ] Conversion Toolbar uses Unified Toolbox
- - [ ] Conversion Toolbar added to the Block Tunes
+ - [x] Block Tunes support nested menus
+ - [x] Block Tunes support separators
+ - [x] Conversion Menu added to the Block Tunes
+ - [x] Unified Toolbar supports hints
+ - [x] Conversion Toolbar uses Unified Toolbar
+ - [x] Inline Toolbar uses Unified Toolbar
- Collaborative editing
- [ ] Implement Inline Tools JSON format
- [ ] Operations Observer, Executor, Manager, Transformer
diff --git a/cypress.config.ts b/cypress.config.ts
new file mode 100644
index 000000000..58f69cfe7
--- /dev/null
+++ b/cypress.config.ts
@@ -0,0 +1,39 @@
+import { defineConfig } from 'cypress';
+import path from 'node:path';
+import vitePreprocessor from 'cypress-vite';
+
+export default defineConfig({
+ env: {
+ NODE_ENV: 'test',
+ },
+ fixturesFolder: 'test/cypress/fixtures',
+ screenshotsFolder: 'test/cypress/screenshots',
+ video: false,
+ videosFolder: 'test/cypress/videos',
+ e2e: {
+ // We've imported your old cypress plugins here.
+ // You may want to clean this up later by importing these.
+ setupNodeEvents(on, config) {
+ on('file:preprocessor', vitePreprocessor({
+ configFile: path.resolve(__dirname, './vite.config.test.js'),
+ }));
+
+ /**
+ * 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('@cypress/code-coverage/task')(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/cypress.json b/cypress.json
deleted file mode 100644
index 2bed0b88a..000000000
--- a/cypress.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "env": {
- "NODE_ENV": "test"
- },
- "fixturesFolder": "test/cypress/fixtures",
- "integrationFolder": "test/cypress/tests",
- "screenshotsFolder": "test/cypress/screenshots",
- "videosFolder": "test/cypress/videos",
- "supportFile": "test/cypress/support/index.ts",
- "pluginsFile": "test/cypress/plugins/index.ts"
-}
diff --git a/devserver.js b/devserver.js
deleted file mode 100644
index 5087a7b47..000000000
--- a/devserver.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/**
- * Server for testing example page on mobile devices.
- *
- * Usage:
- * 1. run `yarn devserver:start`
- * 2. Open `http://{ip_address}:3000/example/example-dev.html`
- * where {ip_address} is IP of your machine.
- *
- * Also, can serve static files from `/example` or `/dist` on any device in local network.
- */
-const path = require('path');
-const fs = require('fs');
-const http = require('http');
-const { networkInterfaces } = require('os');
-
-const port = 3000;
-const localhost = '127.0.0.1';
-const nonRoutableAddress = '0.0.0.0';
-const host = getHost();
-const server = http.createServer(serveStatic([
- '/example',
- '/dist',
-]));
-
-server.listen(port, nonRoutableAddress, () => {
- console.log(`
-
-${wrapInColor('Editor.js 💖', consoleColors.hiColor)} devserver is running ᕕ(⌐■_■)ᕗ ✨
----------------------------------------------
-${wrapInColor('http://' + host + ':' + port + '/example/example-dev.html', consoleColors.fgGreen)}
----------------------------------------------
-Page can be opened from any device connected to the same local network.
-`);
-
- if (host === localhost) {
- console.log(wrapInColor('Looks like you are not connected to any Network so you couldn\'t debug the Editor on your mobile device at the moment.', consoleColors.fgRed));
- }
-});
-
-/**
- * Serves files from specified directories
- *
- * @param {string[]} paths - directories files from which should be served
- * @returns {Function}
- */
-function serveStatic(paths) {
- return (request, response) => {
- const resource = request.url;
- const isPathAllowed = paths.find(p => resource.startsWith(p));
-
- if (!isPathAllowed) {
- response.writeHead(404);
- response.end();
-
- return;
- }
- const filePath = path.join(__dirname, resource);
-
- try {
- const stat = fs.statSync(filePath);
-
- response.writeHead(200, {
- 'Content-Length': stat.size,
- });
- const readStream = fs.createReadStream(filePath);
-
- readStream.on('error', e => {
- throw e;
- });
- readStream.pipe(response);
- } catch (e) {
- response.writeHead(500);
- response.end(e.toString());
- }
- };
-}
-
-/**
- * Returns IP address of a machine
- *
- * @returns {string}
- */
-function getHost() {
- const nets = networkInterfaces();
- const results = {};
-
- for (const name of Object.keys(nets)) {
- for (const net of nets[name]) {
- // Skip over non-IPv4 and internal (i.e. 127.0.0.1) addresses
- if (net.family === 'IPv4' && !net.internal) {
- if (!results[name]) {
- results[name] = [];
- }
- results[name].push(net.address);
- }
- }
- }
-
- /**
- * Offline case
- */
- if (Object.keys(results).length === 0) {
- return localhost;
- }
-
- return results['en0'][0];
-}
-
-/**
- * Terminal output colors
- */
-const consoleColors = {
- fgMagenta: 35,
- fgRed: 31,
- fgGreen: 32,
- hiColor: 1,
-};
-
-/**
- * Set a terminal color to the message
- *
- * @param {string} msg - text to wrap
- * @param {string} color - color
- * @returns {string}
- */
-function wrapInColor(msg, color) {
- return '\x1b[' + color + 'm' + msg + '\x1b[0m';
-}
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 996914d37..751942620 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -1,11 +1,199 @@
# Changelog
+### 2.31.3
+
+- `Fix` - Prevent text formatting removal when applying link
+
+### 2.31.2
+
+- `Fix` - Prevent link removal when applying bold to linked text
+
+### 2.31.1
+
+- `Fix` - Prevent the warning from appearing when `readOnly` mode is initially set to `true`
+
+### 2.31.0
+
+- `New` - Inline tools (those with `isReadOnlySupported` specified) can now be used in read-only mode
+- `New` - Inline tools (those with `isReadOnlySupported` specified) shortcuts now work in read-only mode
+- `Improvement` - Block manager passes target tool config to the `conversionConfig.import` method on conversion
+- `Fix` - Fix selection of first block in read-only initialization with "autofocus=true"
+- `Fix` - Incorrect caret position after blocks merging in Safari
+- `Fix` - Several toolbox items exported by the one tool have the same shortcut displayed in toolbox
+- `Improvement` - The current block reference will be updated in read-only mode when blocks are clicked
+- `Fix` - codex-notifier and codex-tooltip moved from devDependencies to dependencies in package.json to solve type errors
+- `Fix` - Handle whitespace input in empty placeholder elements to prevent caret from moving unexpectedly to the end of the placeholder
+- `Fix` - Fix the memory leak issue in `Shortcuts` class
+- `Fix` - Fix when / overides selected text outside of the editor
+- `DX` - Tools submodules removed from the repository
+- `Improvement` - Shift + Down/Up will allow to select next/previous line instead of Inline Toolbar flipping
+- `Improvement` - The API `caret.setToBlock()` offset now works across the entire block content, not just the first or last node.
+- `Improvement` - The API `blocks.renderFromHTML()` became async and now can be awaited.
+- `Fix` - `blocks.renderFromHTML()` — Error "Can't find a Block to remove." fixed
+- `Fix` - The API `.clear()` index invalidation fixed
+
+
+
+### 2.30.7
+
+- `Fix` - Link insertion in Safari fixed
+
+### 2.30.6
+
+- `Fix` – Fix the display of ‘Convert To’ near blocks that do not have the ‘conversionConfig.export’ rule specified
+- `Fix` – The Plus button does not appear when the editor is loaded in an iframe in Chrome
+- `Fix` - Prevent inline toolbar from closing in nested instance of editor
+
+### 2.30.5
+
+– `Fix` – Fix exported types
+
+### 2.30.4
+
+- `Fix` - Tool's exporting types added
+
+### 2.30.3
+
+- `Fix` – I18n in nested popover
+
+### 2.30.2
+
+- `Fix` – The onChange callback won't be fired when editor is initialized in the Read-Only mode
+- `Fix` – Convert To supports i18n again
+- `Fix` – Prevent form submit on inline tool click
+
+### 2.30.1
+
+- `Fix` – Remove fake selection after multiple "convert to" inline tool toggles
+
+### 2.30.0
+
+- `New` – Block Tunes now supports nesting items
+- `New` – Block Tunes now supports separator items
+- `New` – *Menu Config* – New item type – HTML
+- `New` – *Menu Config* – Default and HTML items now support hints
+- `New` – Inline Toolbar has new look 💅
+- `New` – Inline Tool's `render()` now supports [Menu Config](https://editorjs.io/menu-config/) format
+- `New` – *ToolsAPI* – All installed block tools now accessible via ToolsAPI `getBlockTools()` method
+- `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
+- `New` – *BlocksAPI* – Exposed `getBlockByElement()` method that helps find block by any child html element
+- `New` – "Convert to" control is now also available in Block Tunes
+- `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.
+- `Improvement` — Now Paragraph placeholder will be shown for the current paragraph, not only the first one.
+- `Improvement` - The API `blocks.update` now accepts `tunes` data as optional third argument and makes `data` - block data as optional.
+- `Improvement` — The ability to merge blocks of different types (if both tools provide the conversionConfig)
+- `Improvement` - The API `blocks.convert()` now returns the new block API
+- `Improvement` - The API `caret.setToBlock()` now can accept either BlockAPI or block index or block id
+- `Improvement` – *MenuConfig* – `TunesMenuConfig` type is deprecated, use the `MenuConfig` instead
+– `Improvement` — *Types* — `BlockToolConstructorOptions` type improved, `block` and `config` are not optional anymore
+- `Improvement` - The Plus button and Block Tunes toggler are now better aligned with large line-height blocks, such as Headings
+- `Improvement` — Creating links on Android devices: now the mobile keyboard will have an "Enter" key for accepting the inserted link.
+- `Improvement` — Placeholders will stay visible on inputs focus.
+– `Refactoring` – Switched to Vite as Cypress bundler
+- `Fix` — `onChange` will be called when removing the entire text within a descendant element of a block.
+- `Fix` - Unexpected new line on Enter press with selected block without caret
+- `Fix` - Search input autofocus loosing after Block Tunes opening
+- `Fix` - Block removing while Enter press on Block Tunes
+- `Fix` – Unwanted scroll on first typing on iOS devices
+- `Fix` - Unwanted soft line break on Enter press after period and space (". |") on iOS devices
+- `Fix` - Caret lost after block conversion on mobile devices.
+- `Fix` - Caret lost after Backspace at the start of block when previoius block is not convertable
+– `Fix` — Deleting whitespaces at the start/end of the block
+- `Fix` — The problem caused by missed "import type" in block mutation event types resolved
+
+### 2.29.1
+
+- `Fix` — Toolbox wont be shown when Slash pressed with along with Shift or Alt
+- `Fix` — Toolbox will be opened when Slash pressed in non-US keyboard layout where there is no physical '/' key.
+
+### 2.29.0
+
+- `New` — Editor Config now has the `style.nonce` attribute that could be used to allowlist editor style tag for Content Security Policy "style-src"
+- `New` — Toolbox now will be opened by '/' in empty Block instead of Tab
+- `New` — Block Tunes now will be opened by 'CMD+/' instead of Tab in non-empty block
+- `New` — Tab now will navigate through Blocks. In last block Tab will navigate to the next input on page.
+- `Fix` — Passing an empty array via initial data or `blocks.render()` won't break the editor
+- `Fix` — Layout did not shrink when a large document cleared in Chrome
+- `Fix` — Multiple Tooltip elements creation fixed
+- `Fix` — When the focusing Block is out of the viewport, the page will be scrolled.
+- `Fix` - Compiler error "This import is never used as a value and must use 'import type'..." fixed
+- `Fix` — `blocks.render()` won't lead the `onChange` call in Safari
+- `Fix` — Editor wrapper element growing on the Inline Toolbar close
+- `Fix` — Fix errors thrown by clicks on a document when the editor is being initialized
+- `Fix` — Caret losing on Mobile Devices when adding a block via Toolbox or via Backspace at the beginning of a Block
+- `Improvement` — Now you can set focus via arrows/Tab to "contentless" (decorative) blocks like Delimiter which have no inputs.
+- `Improvement` — Inline Toolbar sometimes opened in an incorrect position. Now it will be aligned by the left side of the selected text. And won't overflow the right side of the text column.
+- `Improvement` - Now the `data-mutation-free` supports deep nesting, so you can mark some element with it to prevent the onChange call caused by child element mutating
+- `Improvement` - Now the `data-mutation-free` also allows to skip "characterData" mutations (eg. text content change)
+- `Refactoring` — `ce-block--focused` class toggling removed as unused.
+
+### 2.28.2
+
+- `Fix` — Get rid of redundant logs from the build
+
+### 2.28.1
+
+- `Fix` — Some Block were be skipped on saving after pasting them as HTML
+
+### 2.28.0
+
+- `New` - Block ids now displayed in DOM via a data-id attribute. Could be useful for plugins that want to access a Block's element by id.
+- `New` - The `blocks.convert(blockId, newType)` API method was added. It allows to convert existing Block to a Block of another type.
+- `New` - The `blocks.insertMany()` API method added. It allows to insert several Blocks to the 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 the 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 is simplified.
+- `Improvement` - If some Block's tool throws an error during construction, we will show Stub block instead of skipping it during render
+- `Improvement` - Call of `blocks.clear()` now will trigger onChange with "block-removed" event for all removed blocks.
+- `Improvement` - The `blocks.clear()` now can be awaited.
+- `Improvement` - `BlockMutationType` and `BlockMutationEvent` types exported
+- `Improvement` - `blocks.update(id, data)` now can accept partial data object — it will update only passed properties, others will remain the same.
+- `Improvement` - `blocks.update(id, data)` now will trigger onChange with only `block-change` event.
+- `Improvement` - `blocks.update(id, data)` will return a promise with BlockAPI object of the changed block.
+
+
+### 2.27.2
+
+- `Fix` - `onChange` won't be called when element with data-mutation-free changes some attribute
+
+### 2.27.1
+
+- `Fix` - `onChange` will be called on removing the whole text in a block
+
### 2.27.0
-- `Refactoring` — Popover class refactored.
+- `New` — *Toolbar API* — Added a new method for toggling the toolbox.
+- `New` — Added types for block mutation events
+- `New` — Batching added to the `onChange` callback. Now the second argument can contain an array of CustomEvents as well as a single one. Multiple changes made in a short period of time will be batched under a single `onChange` call.
- `Improvement` — *Toolbox* — Number of `close()` method calls optimized.
-- `Improvement` — The `onChange` callback won't be triggered only if all mutations contain nodes with the `data-mutation-free` attributes.
-- `Fix` — Resolve compiler error from importing the BlockToolData type
+- `Improvement` — The `onChange` callback can be muted if all mutations contain nodes with the `data-mutation-free` attribute.
+- `Improvement` — Pressing "Enter" at the end of a Block won't lead to redundant `block-changed` event triggering. Only `block-added` event will be dispatched.
+- `Improvement` — The block mutation handler is now called on every block change (including background changes), instead of only when a block is focused
+- `Improvement` — Number of caret saving method calls optimized for Block Tunes opening/closing.
+- `Improvement` — Package size reduced by removing redundant files.
+- `Refactoring` — Switched from Webpack to Vite as the build system.
+- `Refactoring` — *Dependencies* — Upgraded Cypress to v12 and related libraries to the latest versions.
+- `Refactoring` — *Dependencies* — Upgraded TypeScript to v5.
+- `Refactoring` — `EventDispatcher` types improved. Now we can pass `EventsMap` via generic to specify a map of event names and their payloads that can be used in a particular EventDispatcher instance.
+- `Refactoring` — All events in common editor Event Bus now have own type declarations.
+- `Refactoring` — Removed the block mutation observer from blocks and attached a single observer to the editor's blocks wrapper element.
+- `Refactoring` — Removed the debounce from the block mutation handler and used batching instead.
+- `Refactoring` — Refactored the popover class for better performance and maintenance.
+- `Fix` — The `onChange` callback won't trigger when block tunes are opened or closed.
+- `Fix` — Resolved a compiler error caused by importing the `BlockToolData` type.
+- `Fix` — Resolved a problem where the document would scroll to the beginning after moving a block above the viewport.
+- `Fix`- Fixed several bugs caused by browser extensions — Removed the search for a block's container in the DOM on saving and kept it in memory instead, updating it when the tool changes a container element.
+- `Fix` — *ToolsAPI* — `pasteConfig` getter with `false` value could be used to disable paste handling by Editor.js core. Could be useful if your tool has its own paste handler.
+- `CI` — Ubuntu container is now used for Edge tests runner.
+- `CI` — Node 16 is used for GitHib Actions.
### 2.26.5
@@ -46,6 +234,7 @@
- `Improvement` — *CodeStyle* — [CodeX ESLint Config](https://github.com/codex-team/eslint-config) has bee updated. All ESLint/Spelling issues resolved
- `Improvement` — *ToolsAPI* — The `icon` property of the `toolbox` getter became optional.
+
### 2.25.0
- `New` — *Tools API* — Introducing new feature — toolbox now can have multiple entries for one tool!
diff --git a/docs/api.md b/docs/api.md
index 3f009185d..4c7f708de 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -79,7 +79,7 @@ use 'move' instead)
`insert(type?: string, data?: BlockToolData, config?: ToolConfig, index?: number, needToFocus?: boolean)` - insert new Block with passed parameters
-`update(id: string, data: BlockToolData)` - updates data for the block with passed id
+`update(id: string, data?: BlockToolData, tunes?: {[name: string]: BlockTuneData})` - updates block data and block tunes for the block with passed id
#### SanitizerAPI
@@ -180,7 +180,7 @@ this.api.notifier.show({
});
```
-
+
Check out [`codex-notifier` package page](https://github.com/codex-team/js-notifier) on GitHub to find docs, params and examples.
@@ -203,8 +203,6 @@ After executing the `destroy` method, editor inctance becomes an empty object. T
Methods for showing Tooltip helper near your elements. Parameters are the same as in [CodeX Tooltips](http://github.com/codex-team/codex.tooltips) lib.
-
-
#### Show
Method shows tooltip with custom content on passed element
diff --git a/docs/assets/01a55381-46cd-47c7-b92e-34765434f2ca.jpg b/docs/assets/01a55381-46cd-47c7-b92e-34765434f2ca.jpg
new file mode 100644
index 000000000..cd81469f7
Binary files /dev/null and b/docs/assets/01a55381-46cd-47c7-b92e-34765434f2ca.jpg differ
diff --git a/docs/assets/14fcdbe4-d6eb-41d4-b66e-e0e86ccf1a4b.jpg b/docs/assets/14fcdbe4-d6eb-41d4-b66e-e0e86ccf1a4b.jpg
new file mode 100644
index 000000000..803ac0281
Binary files /dev/null and b/docs/assets/14fcdbe4-d6eb-41d4-b66e-e0e86ccf1a4b.jpg differ
diff --git a/docs/assets/57267bab-f2f0-411b-a9d1-69abee6abab5.jpg b/docs/assets/57267bab-f2f0-411b-a9d1-69abee6abab5.jpg
new file mode 100644
index 000000000..beb554a8d
Binary files /dev/null and b/docs/assets/57267bab-f2f0-411b-a9d1-69abee6abab5.jpg differ
diff --git a/docs/assets/6c1f708b-a30c-4ffd-a427-5b59a1a472e0.jpg b/docs/assets/6c1f708b-a30c-4ffd-a427-5b59a1a472e0.jpg
new file mode 100644
index 000000000..a0018baa7
Binary files /dev/null and b/docs/assets/6c1f708b-a30c-4ffd-a427-5b59a1a472e0.jpg differ
diff --git a/docs/assets/796de9eb-bbe0-485c-bc8f-9a4cb76641b7.jpg b/docs/assets/796de9eb-bbe0-485c-bc8f-9a4cb76641b7.jpg
new file mode 100644
index 000000000..b05ac15a9
Binary files /dev/null and b/docs/assets/796de9eb-bbe0-485c-bc8f-9a4cb76641b7.jpg differ
diff --git a/docs/assets/79ce946a-d636-41cd-aa96-d3bc5ecfde03.jpg b/docs/assets/79ce946a-d636-41cd-aa96-d3bc5ecfde03.jpg
new file mode 100644
index 000000000..8430c5f94
Binary files /dev/null and b/docs/assets/79ce946a-d636-41cd-aa96-d3bc5ecfde03.jpg differ
diff --git a/docs/assets/7ccbcfcd-1c49-4674-bea7-71021468a1bd.jpg b/docs/assets/7ccbcfcd-1c49-4674-bea7-71021468a1bd.jpg
new file mode 100644
index 000000000..f5960e89a
Binary files /dev/null and b/docs/assets/7ccbcfcd-1c49-4674-bea7-71021468a1bd.jpg differ
diff --git a/docs/installation.md b/docs/installation.md
index 6d90c6355..6ee6b19a8 100644
--- a/docs/installation.md
+++ b/docs/installation.md
@@ -69,7 +69,7 @@ Check [Editor.js's community](https://github.com/editor-js/) to see Tools exampl
## Create Editor instance
Create an instance of Editor.js and pass [Configuration Object](../src/types-internal/editor-config.ts).
-At least the `holderId` option is required.
+At least the `holder` option is required.
```html
yarn build
- yarn pull_tools && yarn tools:update
-