@richscripts/richtexteditor 2.5.4 → 2.6.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 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 headerless tables. Use `accessibilityCheckerAutoOpen` to keep the workflow visible during review passes.
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)* &mdash; 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)* &mdash; `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 &mdash; `crashedPermanently` hands you the last good snapshot.
24
+ - **Shadow DOM** *(new in 2.6)* &mdash; 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** &mdash; 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** &mdash; `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 &mdash; 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 &mdash; 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
@@ -1,142 +1,142 @@
1
- {
2
- "name": "@richscripts/richtexteditor",
3
- "publishConfig": {
4
- "access": "public"
5
- },
6
- "version": "2.5.4",
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
- "main": "./richtexteditor/rte.js",
9
- "bin": {
10
- "rte-migration-report": "./migration/cli.js"
11
- },
12
- "scripts": {
13
- "test:server": "node tests/run-all.test.js",
14
- "test:admin": "node tests/run-all.test.js",
15
- "test": "node tests/run-all.test.js",
16
- "smoke:pack": "node tests/smoke-pack.js",
17
- "artifact:migration": "node scripts/build-migration-fidelity-artifact.js",
18
- "artifact:migration:runtime": "npm --prefix vendor-runtime-tests ci && npm --prefix vendor-runtime-tests run generate && node scripts/build-migration-fidelity-artifact.js",
19
- "guard:protected": "node tests/guard-protected-bundle.js",
20
- "prepublishOnly": "node tests/guard-protected-bundle.js"
21
- },
22
- "types": "./index.d.ts",
23
- "style": "./richtexteditor/rte_theme_default.css",
24
- "exports": {
25
- ".": {
26
- "types": "./index.d.ts",
27
- "default": "./richtexteditor/rte.js"
28
- },
29
- "./angular": {
30
- "types": "./angular/index.d.ts",
31
- "default": "./angular/index.ts"
32
- },
33
- "./react": {
34
- "types": "./react/index.d.ts",
35
- "default": "./react/index.js"
36
- },
37
- "./vue": {
38
- "types": "./vue/index.d.ts",
39
- "default": "./vue/index.js"
40
- },
41
- "./svelte": {
42
- "types": "./svelte/index.d.ts",
43
- "default": "./svelte/index.js"
44
- },
45
- "./headless": {
46
- "types": "./headless/index.d.ts",
47
- "default": "./headless/index.js"
48
- },
49
- "./migration": {
50
- "types": "./migration/index.d.ts",
51
- "default": "./migration/index.js"
52
- },
53
- "./server": {
54
- "types": "./server/index.d.ts",
55
- "default": "./server/index.js"
56
- },
57
- "./admin": {
58
- "types": "./admin/index.d.ts",
59
- "default": "./admin/index.js"
60
- },
61
- "./integrations/shared": {
62
- "types": "./integrations/shared.d.ts",
63
- "default": "./integrations/shared.js"
64
- },
65
- "./richtexteditor/*": "./richtexteditor/*",
66
- "./package.json": "./package.json"
67
- },
68
- "files": [
69
- "angular",
70
- "admin",
71
- "headless",
72
- "index.d.ts",
73
- "integrations",
74
- "migration",
75
- "react",
76
- "richtexteditor",
77
- "server",
78
- "svelte",
79
- "vue"
80
- ],
81
- "peerDependencies": {
82
- "react": ">=18",
83
- "svelte": ">=3",
84
- "vue": ">=3"
85
- },
86
- "peerDependenciesMeta": {
87
- "react": {
88
- "optional": true
89
- },
90
- "svelte": {
91
- "optional": true
92
- },
93
- "vue": {
94
- "optional": true
95
- }
96
- },
97
- "keywords": [
98
- "rich-text-editor",
99
- "wysiwyg",
100
- "editor",
101
- "html-editor",
102
- "structured-content",
103
- "json",
104
- "markdown",
105
- "react",
106
- "vue",
107
- "angular",
108
- "svelte",
109
- "headless",
110
- "use-editor",
111
- "ssr",
112
- "server-rendering",
113
- "text-editor",
114
- "contenteditable",
115
- "toolbar",
116
- "formatting",
117
- "image-editor",
118
- "pdf-export",
119
- "i18n",
120
- "plugins",
121
- "javascript",
122
- "vanilla-js",
123
- "no-dependencies",
124
- "slash-commands",
125
- "mentions",
126
- "track-changes",
127
- "comments",
128
- "revision-history",
129
- "collaboration",
130
- "yjs",
131
- "crdt",
132
- "ai-toolkit",
133
- "ai-editor"
134
- ],
135
- "author": "CuteSoft Components Inc.",
136
- "license": "SEE LICENSE IN http://richtexteditor.com/license.aspx",
137
- "homepage": "https://richtexteditor.com",
138
- "repository": {
139
- "type": "git",
140
- "url": "git+https://github.com/richtexteditor/richtexteditor.git"
141
- }
142
- }
1
+ {
2
+ "name": "@richscripts/richtexteditor",
3
+ "publishConfig": {
4
+ "access": "public"
5
+ },
6
+ "version": "2.6.0",
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
+ "main": "./richtexteditor/rte.js",
9
+ "bin": {
10
+ "rte-migration-report": "./migration/cli.js"
11
+ },
12
+ "scripts": {
13
+ "test:server": "node tests/run-all.test.js",
14
+ "test:admin": "node tests/run-all.test.js",
15
+ "test": "node tests/run-all.test.js",
16
+ "smoke:pack": "node tests/smoke-pack.js",
17
+ "artifact:migration": "node scripts/build-migration-fidelity-artifact.js",
18
+ "artifact:migration:runtime": "npm --prefix vendor-runtime-tests ci && npm --prefix vendor-runtime-tests run generate && node scripts/build-migration-fidelity-artifact.js",
19
+ "guard:protected": "node tests/guard-protected-bundle.js",
20
+ "prepublishOnly": "node tests/guard-protected-bundle.js"
21
+ },
22
+ "types": "./index.d.ts",
23
+ "style": "./richtexteditor/rte_theme_default.css",
24
+ "exports": {
25
+ ".": {
26
+ "types": "./index.d.ts",
27
+ "default": "./richtexteditor/rte.js"
28
+ },
29
+ "./angular": {
30
+ "types": "./angular/index.d.ts",
31
+ "default": "./angular/index.ts"
32
+ },
33
+ "./react": {
34
+ "types": "./react/index.d.ts",
35
+ "default": "./react/index.js"
36
+ },
37
+ "./vue": {
38
+ "types": "./vue/index.d.ts",
39
+ "default": "./vue/index.js"
40
+ },
41
+ "./svelte": {
42
+ "types": "./svelte/index.d.ts",
43
+ "default": "./svelte/index.js"
44
+ },
45
+ "./headless": {
46
+ "types": "./headless/index.d.ts",
47
+ "default": "./headless/index.js"
48
+ },
49
+ "./migration": {
50
+ "types": "./migration/index.d.ts",
51
+ "default": "./migration/index.js"
52
+ },
53
+ "./server": {
54
+ "types": "./server/index.d.ts",
55
+ "default": "./server/index.js"
56
+ },
57
+ "./admin": {
58
+ "types": "./admin/index.d.ts",
59
+ "default": "./admin/index.js"
60
+ },
61
+ "./integrations/shared": {
62
+ "types": "./integrations/shared.d.ts",
63
+ "default": "./integrations/shared.js"
64
+ },
65
+ "./richtexteditor/*": "./richtexteditor/*",
66
+ "./package.json": "./package.json"
67
+ },
68
+ "files": [
69
+ "angular",
70
+ "admin",
71
+ "headless",
72
+ "index.d.ts",
73
+ "integrations",
74
+ "migration",
75
+ "react",
76
+ "richtexteditor",
77
+ "server",
78
+ "svelte",
79
+ "vue"
80
+ ],
81
+ "peerDependencies": {
82
+ "react": ">=18",
83
+ "svelte": ">=3",
84
+ "vue": ">=3"
85
+ },
86
+ "peerDependenciesMeta": {
87
+ "react": {
88
+ "optional": true
89
+ },
90
+ "svelte": {
91
+ "optional": true
92
+ },
93
+ "vue": {
94
+ "optional": true
95
+ }
96
+ },
97
+ "keywords": [
98
+ "rich-text-editor",
99
+ "wysiwyg",
100
+ "editor",
101
+ "html-editor",
102
+ "structured-content",
103
+ "json",
104
+ "markdown",
105
+ "react",
106
+ "vue",
107
+ "angular",
108
+ "svelte",
109
+ "headless",
110
+ "use-editor",
111
+ "ssr",
112
+ "server-rendering",
113
+ "text-editor",
114
+ "contenteditable",
115
+ "toolbar",
116
+ "formatting",
117
+ "image-editor",
118
+ "pdf-export",
119
+ "i18n",
120
+ "plugins",
121
+ "javascript",
122
+ "vanilla-js",
123
+ "no-dependencies",
124
+ "slash-commands",
125
+ "mentions",
126
+ "track-changes",
127
+ "comments",
128
+ "revision-history",
129
+ "collaboration",
130
+ "yjs",
131
+ "crdt",
132
+ "ai-toolkit",
133
+ "ai-editor"
134
+ ],
135
+ "author": "CuteSoft Components Inc.",
136
+ "license": "SEE LICENSE IN http://richtexteditor.com/license.aspx",
137
+ "homepage": "https://richtexteditor.com",
138
+ "repository": {
139
+ "type": "git",
140
+ "url": "git+https://github.com/richtexteditor/richtexteditor.git"
141
+ }
142
+ }