Skip to content

Commit

Permalink
merge remote-tracking branch 'upstream/next' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Oct 6, 2024
2 parents c87db1d + 3aa164d commit 7f82603
Show file tree
Hide file tree
Showing 219 changed files with 9,259 additions and 9,576 deletions.
22 changes: 21 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,25 @@
"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"],
}
}
]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ dist/

coverage/
.nyc_output/
.vscode/launch.json
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,17 @@ Take a look at the [example.html](example/example.html) to view more detailed ex

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

- 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
Expand Down
8 changes: 7 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import { defineConfig } from 'cypress';
import path from 'node:path';
import vitePreprocessor from 'cypress-vite';

export default defineConfig({
env: {
Expand All @@ -12,14 +14,18 @@ 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) {
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('./test/cypress/plugins/index.ts')(on, config);
require('@cypress/code-coverage/task')(on, config);
},
specPattern: 'test/cypress/tests/**/*.cy.{js,jsx,ts,tsx}',
supportFile: 'test/cypress/support/index.ts',
Expand Down
63 changes: 63 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,68 @@
# Changelog

### 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.
- `Improvment` - 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
- `Impovement`*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
Expand Down
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
32 changes: 16 additions & 16 deletions example/example-dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,22 +89,22 @@
Read more in Tool's README file. For example:
https://github.com/editor-js/header#installation
-->
<script src="./tools/header/dist/bundle.js" onload="document.getElementById('hint-tools').hidden = true"></script><!-- Header -->
<script src="./tools/simple-image/dist/bundle.js"></script><!-- Image -->
<script src="./tools/delimiter/dist/bundle.js"></script><!-- Delimiter -->
<!-- <script src="./tools/list/dist/bundle.js"></script> List-->
<script src="./tools/nested-list/dist/nested-list.js"></script><!-- Nested List -->
<script src="./tools/checklist/dist/bundle.js"></script><!-- Checklist -->
<script src="./tools/quote/dist/bundle.js"></script><!-- Quote -->
<script src="./tools/code/dist/bundle.js"></script><!-- Code -->
<script src="./tools/embed/dist/bundle.js"></script><!-- Embed -->
<script src="./tools/table/dist/table.js"></script><!-- Table -->
<script src="./tools/link/dist/bundle.js"></script><!-- Link -->
<script src="./tools/raw/dist/bundle.js"></script><!-- Raw -->
<script src="./tools/warning/dist/bundle.js"></script><!-- Warning -->

<script src="./tools/marker/dist/bundle.js"></script><!-- Marker -->
<script src="./tools/inline-code/dist/bundle.js"></script><!-- Inline Code -->
<script src="./tools/header/dist/header.umd.js" onload="document.getElementById('hint-tools').hidden = true"></script><!-- Header -->
<script src="./tools/simple-image/dist/simple-image.umd.js"></script><!-- Image -->
<script src="./tools/delimiter/dist/delimiter.umd.js"></script><!-- Delimiter -->
<!-- <script src="./tools/list/dist/list.umd.js"></script> List-->
<script src="./tools/nested-list/dist/nested-list.umd.js"></script><!-- Nested List -->
<script src="./tools/checklist/dist/checklist.umd.js"></script><!-- Checklist -->
<script src="./tools/quote/dist/quote.umd.js"></script><!-- Quote -->
<script src="./tools/code/dist/code.umd.js"></script><!-- Code -->
<script src="./tools/embed/dist/embed.umd.js"></script><!-- Embed -->
<script src="./tools/table/dist/table.umd.js"></script><!-- Table -->
<script src="./tools/link/dist/link.umd.js"></script><!-- Link -->
<script src="./tools/raw/dist/raw.umd.js"></script><!-- Raw -->
<script src="./tools/warning/dist/warning.umd.js"></script><!-- Warning -->

<script src="./tools/marker/dist/marker.umd.js"></script><!-- Marker -->
<script src="./tools/inline-code/dist/inline-code.umd.js"></script><!-- Inline Code -->

<!-- Load Editor.js's Core -->
<script src="../dist/editorjs.umd.js" onload="document.getElementById('hint-core').hidden = true;"></script>
Expand Down
2 changes: 1 addition & 1 deletion example/tools/code
2 changes: 1 addition & 1 deletion example/tools/embed
2 changes: 1 addition & 1 deletion example/tools/header
2 changes: 1 addition & 1 deletion example/tools/image
2 changes: 1 addition & 1 deletion example/tools/inline-code
2 changes: 1 addition & 1 deletion example/tools/link
2 changes: 1 addition & 1 deletion example/tools/list
Submodule list updated from f0e9f0 to a6dc6a
2 changes: 1 addition & 1 deletion example/tools/marker
2 changes: 1 addition & 1 deletion example/tools/nested-list
2 changes: 1 addition & 1 deletion example/tools/quote
2 changes: 1 addition & 1 deletion example/tools/raw
2 changes: 1 addition & 1 deletion example/tools/simple-image
2 changes: 1 addition & 1 deletion example/tools/table
2 changes: 1 addition & 1 deletion example/tools/text-variant-tune
2 changes: 1 addition & 1 deletion example/tools/warning
5 changes: 4 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
*/
header: {
class: Header,
inlineToolbar: ['marker', 'link'],
inlineToolbar: ['link', 'marker'],
config: {
placeholder: 'Header'
},
Expand Down Expand Up @@ -203,6 +203,9 @@
*/
// defaultBlock: 'paragraph',

placeholder: 'Write something or press / to select a tool',
autofocus: true,

/**
* Initial Editor data
*/
Expand Down
Loading

0 comments on commit 7f82603

Please sign in to comment.