@richscripts/richtexteditor 2.5.4 → 2.6.1
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 +29 -2
- package/package.json +1 -1
- package/richtexteditor/CHANGELOG.md +2714 -2201
- package/richtexteditor/all_plugins.js +2008 -1272
- package/richtexteditor/all_plugins.min.js +52 -52
- package/richtexteditor/plugins/accessibilitychecker.js +60 -3
- package/richtexteditor/plugins/aitoolkit.js +24 -6
- package/richtexteditor/plugins/aitoolkit.min.css +1 -0
- package/richtexteditor/plugins/all_plugins.js +2008 -1272
- package/richtexteditor/plugins/all_plugins.min.js +52 -52
- package/richtexteditor/plugins/documentimport.js +1279 -1263
- package/richtexteditor/plugins/layouttable.js +383 -0
- package/richtexteditor/plugins/shadowdom.js +252 -0
- package/richtexteditor/plugins/slashcommand.js +8 -0
- package/richtexteditor/rte-headless.js +360 -0
- package/richtexteditor/rte-watchdog.js +303 -0
- package/richtexteditor/rte-webcomponent.js +351 -0
- package/richtexteditor/rte.js +2 -2
- package/richtexteditor/rte_mobile.min.css +1 -0
- package/richtexteditor/rte_theme_default.min.css +1 -0
- package/richtexteditor/runtime/richtexteditor_content.min.css +1 -0
- package/richtexteditor/runtime/richtexteditor_preview.min.css +1 -0
package/README.md
CHANGED
|
@@ -17,8 +17,11 @@ A full collaborative-document workspace, not just a textarea replacement:
|
|
|
17
17
|
- **Dictation** — Web Speech API integration (`editor.dictation.toggle()`) with multi-language support.
|
|
18
18
|
- **DOCX import + export** — import Word documents through `editor.aiToolkit.importDocx({ file?, mode? })` and generate deterministic HTML → .docx via `editor.aiToolkit.exportDocx({ filename })`; preserves headings, lists, tables, images.
|
|
19
19
|
- **Structured content bridge** — `editor.getJSON()` / `setJSON()`, `fromMarkdown()` / `toMarkdown()`, `renderHTML()`, `validateStructuredContent()` — for SSR, JSON storage, and Markdown round-trip. The packaged schema now preserves merge fields, ordered-list marker styles (`A` / `a` / `I` / `i`), table-of-contents blocks, footnotes, and editor page breaks instead of collapsing them into opaque HTML.
|
|
20
|
-
- **Accessibility audit helper** — `RichTextEditor.auditAccessibility()` / `auditAccessibility()` catches empty headings, skipped heading levels, missing image alt text, and tables without header cells in browser or Node workflows.
|
|
21
|
-
- **In-editor accessibility repair panel** — the packaged `accessibilitychecker` plugin adds a side panel (`editor.accessibilityChecker.open/close/toggle/run/repair`) with focused fixes for missing image alt text, empty headings, skipped heading levels, and
|
|
20
|
+
- **Accessibility audit helper** — `RichTextEditor.auditAccessibility()` / `auditAccessibility()` catches empty headings, skipped heading levels, missing image alt text, and tables without header cells in browser or Node workflows. Tables marked `role="presentation"` are exempt from the header rule and checked for the opposite fault instead — data-table markup on a layout table.
|
|
21
|
+
- **In-editor accessibility repair panel** — the packaged `accessibilitychecker` plugin adds a side panel (`editor.accessibilityChecker.open/close/toggle/run/repair`) with focused fixes for missing image alt text, empty headings, skipped heading levels, headerless tables, unmarked language runs, and layout tables that still carry header cells. Use `accessibilityCheckerAutoOpen` to keep the workflow visible during review passes.
|
|
22
|
+
- **Layout tables** *(new in 2.6)* — a `<table>` that only positions content is not a data table, and marking it as one makes a screen reader announce relationships that do not exist. `editor.setTableLayoutMode("layout")` writes `role="presentation"` and strips `<th>` / `scope` / `<caption>`; `insertLayoutTable(rows, cols)` starts one for an email or signature layout. Nested data tables keep their headers.
|
|
23
|
+
- **Crash recovery** *(new in 2.6)* — `richtexteditor/rte-watchdog.js` snapshots the document, notices when the editing surface has actually died, recreates the instance and restores the text. It ignores errors from unrelated page code, and stops after repeated crashes instead of looping — `crashedPermanently` hands you the last good snapshot.
|
|
24
|
+
- **Shadow DOM** *(new in 2.6)* — the packaged `shadowdom` plugin copies the editor's own stylesheets into the shadow root that contains it. Without it the editor edits correctly and renders completely unstyled there, because no document stylesheet crosses a shadow boundary.
|
|
22
25
|
- **Restricted editing templates** — the packaged `restrictedediting` plugin lets apps lock the document root while keeping marked islands editable (`editor.restrictedEditing.enable/disable/toggle/list/goToNext/goToPrevious`). Mark reusable fields with `data-rte-editable` in template HTML or call `editor.restrictedEditing.markSelection({ label })` while authoring.
|
|
23
26
|
- **Document outline + TOC helpers** — `RichTextEditor.getDocumentOutline()` / `getDocumentOutline()` extracts a flat heading outline (`id`, `text`, `level`, `path`), while `getTableOfContents()` returns a nested tree and `syncTableOfContents()` repopulates packaged TOC blocks from live headings.
|
|
24
27
|
The same TOC helpers can also persist TinyMCE-style display settings such as `ordered`, `orderedListType`, and `includeTitle` for numbered or titleless navigation blocks.
|
|
@@ -340,6 +343,30 @@ code — keep it in a component that renders in the browser.
|
|
|
340
343
|
|
|
341
344
|
Options: `value`, `config`, `assetBasePath`, `onReady`, `onUpdate`, `onChange`, `onError`.
|
|
342
345
|
|
|
346
|
+
## Web component
|
|
347
|
+
|
|
348
|
+
For pages that use none of the framework bindings above — Rails, Laravel, Blazor, Django,
|
|
349
|
+
htmx, plain HTML.
|
|
350
|
+
|
|
351
|
+
```html
|
|
352
|
+
<script src="richtexteditor/rte-config.js"></script>
|
|
353
|
+
<script src="richtexteditor/rte.js"></script>
|
|
354
|
+
<script src="richtexteditor/rte-webcomponent.js"></script>
|
|
355
|
+
|
|
356
|
+
<form method="post">
|
|
357
|
+
<rich-text-editor name="body" value="<p>Hello</p>"></rich-text-editor>
|
|
358
|
+
<button>Save</button>
|
|
359
|
+
</form>
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
That form posts `body=...` with no glue code. The element is form-associated, so `form.reset()`,
|
|
363
|
+
`required` and `form.elements.body` behave the way they do for a `<textarea>`.
|
|
364
|
+
|
|
365
|
+
Attributes: `value`, `name`, `toolbar`, `height`, `width`, `readonly`, `disabled`, `required`,
|
|
366
|
+
`shadow`, `config` (JSON). Properties: `.value`, `.editor`, `.ready` (a Promise). Events: `input`,
|
|
367
|
+
`change`. It renders in the light DOM by default; `shadow` opts into encapsulation and relies on
|
|
368
|
+
the `shadowdom` plugin for styling.
|
|
369
|
+
|
|
343
370
|
## Headless (bring your own UI)
|
|
344
371
|
|
|
345
372
|
`@richscripts/richtexteditor/headless` is the same core the Svelte action uses, available directly
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.6.1",
|
|
7
7
|
"description": "A full-featured JavaScript rich text editor (WYSIWYG) with toolbar, plugins, i18n support, a built-in AI Toolkit (Ask AI, AI Chat, AI Review drawer, BYOK resolver), structured content APIs (JSON/Markdown), and an optional collaboration / review stack: slash commands, @mentions, human-author Track Changes, threaded comments, revision history, and Yjs-backed presence. Ships first-class React, Vue, Angular and Svelte bindings, a headless \"bring your own UI\" core, and server-safe conversion helpers.",
|
|
8
8
|
"main": "./richtexteditor/rte.js",
|
|
9
9
|
"bin": {
|