@mdaemon/html-editor-react 1.12.0 → 1.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ npm install @mdaemon/html-editor-react
|
|
|
19
19
|
**Peer dependencies:** `react` and `react-dom` (v18 or v19).
|
|
20
20
|
|
|
21
21
|
**TipTap:** the editor is built on TipTap 3, and this package tracks the same version the
|
|
22
|
-
engine uses — currently **3.32.0** (`@mdaemon/html-editor` `^1.
|
|
22
|
+
engine uses — currently **3.32.0** (`@mdaemon/html-editor` `^1.18.0`,
|
|
23
23
|
`@tiptap/react` `^3.32.0`). If your app depends on any `@tiptap/*` package directly, keep
|
|
24
24
|
it on that version too: ProseMirror throws at runtime if two copies of `@tiptap/core` /
|
|
25
25
|
`@tiptap/pm` end up in the bundle. If you only use `<Editor>` or `useEditor`, there is
|
|
@@ -261,7 +261,7 @@ The `config` prop (or `useEditor`'s `config` option) accepts an `EditorConfig` o
|
|
|
261
261
|
| `table_default_styles` | `Record<string, string>` | `{ 'border-collapse': 'collapse', width: '100%' }` | Style of a table the user inserts. |
|
|
262
262
|
| `table_default_header_rows` | `number` | `0` | Header rows of an inserted table. |
|
|
263
263
|
| `table_default_header_cols` | `number` | `0` | Header columns of an inserted table. |
|
|
264
|
-
| `table_tab_navigation` | `boolean` | `true` | Tab and Shift+Tab move between table cells. `false` makes them
|
|
264
|
+
| `table_tab_navigation` | `boolean` | `true` | Tab and Shift+Tab move between table cells. `false` makes them work in a cell as they do outside a table: Tab types a tab at the cursor, and Shift+Tab outdents. |
|
|
265
265
|
| `quickbars_selection_toolbar` | `string` | `'bold italic \| quicklink blockquote'` | Inline floating toolbar shown over a text selection. |
|
|
266
266
|
| `quickbars_image_toolbar` | `boolean` | `false` | Inline floating toolbar shown when an image is selected. |
|
|
267
267
|
| `quickbars_insert_toolbar` | `boolean` | `false` | Inline floating toolbar shown on empty lines for quick insertion. |
|
|
@@ -439,7 +439,7 @@ tiptap?.chain().focus().setBlockFontSize('14pt').run();
|
|
|
439
439
|
|
|
440
440
|
### Increase / Decrease Indent
|
|
441
441
|
|
|
442
|
-
The `indent` / `outdent` toolbar buttons, `execCommand('indent' | 'outdent')`, and the <kbd>Tab</kbd> / <kbd>Shift</kbd>+<kbd>Tab</kbd> keys all resolve to the same behavior, chosen by what is under the cursor:
|
|
442
|
+
The `indent` / `outdent` toolbar buttons, `execCommand('indent' | 'outdent')`, and the <kbd>Tab</kbd> / <kbd>Shift</kbd>+<kbd>Tab</kbd> keys all resolve to the same behavior, chosen by what is under the cursor (with one exception for <kbd>Tab</kbd> — see [Tab Characters](#tab-characters)):
|
|
443
443
|
|
|
444
444
|
| Context | Increase indent | Decrease indent |
|
|
445
445
|
|---------|-----------------|-----------------|
|
|
@@ -450,6 +450,14 @@ The `indent` / `outdent` toolbar buttons, `execCommand('indent' | 'outdent')`, a
|
|
|
450
450
|
|
|
451
451
|
Inside a list the indent is written to the `<li>` rather than to the paragraph inside it, so the bullet or number moves with the text. Because it is an inline `margin-left`, it survives in the exported HTML — in a mail client, say — without the editor's stylesheet. In a table, <kbd>Tab</kbd> still moves between cells (unless `table_tab_navigation: false`); the toolbar buttons indent the paragraph in the cell.
|
|
452
452
|
|
|
453
|
+
<kbd>Backspace</kbd> at the start of an indented paragraph or heading removes one indent step, instead of joining the line to the one above. An empty line is still removed in one press.
|
|
454
|
+
|
|
455
|
+
### Tab Characters
|
|
456
|
+
|
|
457
|
+
In a paragraph or heading, <kbd>Tab</kbd> with nothing selected types a tab at the cursor, wherever it is in the line, as a word processor does. To indent the whole paragraph, select text in it first, or use the `indent` button. In a list, a code block or a table, <kbd>Tab</kbd> works as described above; with `table_tab_navigation: false`, <kbd>Tab</kbd> in a cell types a tab too.
|
|
458
|
+
|
|
459
|
+
A tab is written as `<span style="white-space: pre;">	</span>`, the form other editors use, so it keeps its tab stops in exported HTML instead of collapsing to a space. `setContent()`, `insertContent()` and paste read that span back as a tab, as well as tabs in `white-space: pre-wrap` text (as Google Docs writes) and in pasted plain text. A tab is one character: one <kbd>Backspace</kbd> or <kbd>Delete</kbd> removes it, and one undo takes it back. See the [engine docs](https://github.com/mdaemon-technologies/MDHTMLEditor#tab-characters) for the details.
|
|
460
|
+
|
|
453
461
|
### Ordered List Numbering
|
|
454
462
|
|
|
455
463
|
An ordered list's numbering style is preserved rather than normalized to `1, 2, 3`. `<ol type="A">`, `type="a"`, `type="I"`, `type="i"` and `start="5"` round-trip through `setContent()` / `getContent()` and render as written. A list that states its style with CSS instead (`<ol style="list-style-type:upper-alpha">`) is read the same way and exported as `<ol type="A">`.
|
|
@@ -709,7 +717,7 @@ Buttons after `||` begin collapsed behind a toggle (`...`) button.
|
|
|
709
717
|
| `tablecellvalign`, `tablecellborderwidth`, `tablecellborderstyle`, `tablecellbackgroundcolor`, `tablecellbordercolor` | Cell vertical alignment, border and background menus and pickers |
|
|
710
718
|
| `hr` | Insert horizontal rule |
|
|
711
719
|
| `charmap` | Special character picker |
|
|
712
|
-
| `emoticons` | Emoji picker with
|
|
720
|
+
| `emoticons` | Emoji picker, searchable by English name and keywords, with each emoji's name as its tooltip |
|
|
713
721
|
| `code` | Open HTML source code editor dialog |
|
|
714
722
|
| `link` | Insert/edit hyperlink (with the caret on a link, edits that link in place) |
|
|
715
723
|
| `unlink` | Remove the link at the cursor |
|
|
@@ -896,12 +904,13 @@ setGetFileSrc((path) => `https://cdn.example.com${path}`);
|
|
|
896
904
|
| Ctrl/Cmd + Shift + Z | Redo |
|
|
897
905
|
| Ctrl/Cmd + F | Find & Replace |
|
|
898
906
|
| Ctrl + Alt + C (Cmd + Option + C on macOS) | Toggle code sample |
|
|
899
|
-
| Tab |
|
|
907
|
+
| Tab | Types a tab at the cursor in a paragraph or heading ([details](#tab-characters)), indents the selected paragraphs when there is a selection, nests or indents a list item, inserts a tab in a code block, or moves to the next table cell (unless `table_tab_navigation: false`) ([details](#lists--indentation)) |
|
|
900
908
|
| Shift + Tab | Decrease indent — un-nests a list item, moves to the previous table cell, or removes block indent ([details](#lists--indentation)) |
|
|
909
|
+
| Backspace | Removes a tab in one press. At the start of an indented paragraph or heading, removes one indent step |
|
|
901
910
|
| Esc, then Tab | Move focus to the next element outside the editor (keyboard escape) |
|
|
902
911
|
| Esc, then Shift + Tab | Move focus to the previous element outside the editor |
|
|
903
912
|
|
|
904
|
-
> `Tab` is captured
|
|
913
|
+
> `Tab` is captured by the editor, so the `Esc`-then-`Tab` sequence provides a
|
|
905
914
|
> keyboard escape (WCAG 2.1.2, "No Keyboard Trap"). `Esc` arms the escape for a single
|
|
906
915
|
> key press; any other key disarms it.
|
|
907
916
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mdaemon/html-editor-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.18.0",
|
|
4
4
|
"description": "React wrapper for MDHTMLEditor",
|
|
5
5
|
"homepage": "https://github.com/mdaemon-technologies/MDHTMLEditor-react",
|
|
6
6
|
"repository": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"react-dom": "^19.0.0 || ^18.0.0"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@mdaemon/html-editor": "^1.
|
|
59
|
+
"@mdaemon/html-editor": "^1.18.0",
|
|
60
60
|
"@tiptap/react": "^3.32.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|