i18n and rtl examples updated

This commit is contained in:
Peter Savchenko 2026-02-18 15:32:29 +03:00
commit cc624cad2e
3 changed files with 23 additions and 16 deletions

View file

@ -50,7 +50,6 @@
<script src="https://cdn.jsdelivr.net/npm/@editorjs/image@latest"></script><!-- Image -->
<script src="https://cdn.jsdelivr.net/npm/@editorjs/delimiter@latest"></script><!-- Delimiter -->
<script src="https://cdn.jsdelivr.net/npm/@editorjs/list@latest"></script><!-- List -->
<script src="https://cdn.jsdelivr.net/npm/@editorjs/checklist@latest"></script><!-- Checklist -->
<script src="https://cdn.jsdelivr.net/npm/@editorjs/quote@latest"></script><!-- Quote -->
<script src="https://cdn.jsdelivr.net/npm/@editorjs/code@latest"></script><!-- Code -->
<script src="https://cdn.jsdelivr.net/npm/@editorjs/embed@latest"></script><!-- Embed -->
@ -112,11 +111,6 @@
shortcut: 'CMD+SHIFT+L'
},
checklist: {
class: Checklist,
inlineToolbar: true,
},
quote: {
class: Quote,
inlineToolbar: true,
@ -202,7 +196,7 @@
/**
* Translation of "Convert To" at the Block Tunes Popover
*/
"Convert to": "Конвертировать в"
"Convert to": "Конвертировать в",
}
},
@ -212,7 +206,8 @@
"toolNames": {
"Text": "Параграф",
"Heading": "Заголовок",
"List": "Список",
"Ordered List": "Нумерованный список",
"Unordered List": "Маркированный список",
"Warning": "Примечание",
"Checklist": "Чеклист",
"Quote": "Цитата",
@ -270,7 +265,12 @@
"Wrong response format from the server": "Неполадки на сервере",
},
"header": {
"Header": "Заголовок",
"Heading 1": "Заголовок 1",
"Heading 2": "Заголовок 2",
"Heading 3": "Заголовок 3",
"Heading 4": "Заголовок 4",
"Heading 5": "Заголовок 5",
"Heading 6": "Заголовок 6",
},
"paragraph": {
"Enter something": "Введите текст"
@ -278,6 +278,7 @@
"list": {
"Ordered": "Нумерованный",
"Unordered": "Маркированный",
"Checklist": "Чеклист",
},
/**
* Translation of "Convert To" at the Inline Toolbar hint
@ -298,7 +299,8 @@
* Also, there are few internal block tunes: "delete", "moveUp" and "moveDown"
*/
"delete": {
"Delete": "Удалить"
"Delete": "Удалить",
"Click to delete": "Подтвердить удаление"
},
"moveUp": {
"Move up": "Переместить вверх"

View file

@ -120,12 +120,6 @@
inlineToolbar: ['link'],
},
list: {
class: List,
inlineToolbar: true,
shortcut: 'CMD+SHIFT+L'
},
checklist: {
class: Checklist,
inlineToolbar: true,

View file

@ -623,6 +623,9 @@ export default class Dom {
/**
* If no node found or last node is empty, return null
* - The root node has no text nodes at all
* - The TreeWalker couldn't find any text nodes in the DOM tree
* - The root node itself is null or invalid
*/
if (!lastTextNode) {
return {
@ -633,6 +636,14 @@ export default class Dom {
const textContent = lastTextNode.textContent;
/**
* - The text node exists but has no content (textContent is null)
* - The text node exists but has empty content (textContent.length === 0)
* This could be due to:
* - Empty text nodes (<span></span>)
* - Nodes with only whitespace
* - Nodes that were cleared but not removed
*/
if (textContent === null || textContent.length === 0) {
return {
node: null,