@richscripts/richtexteditor 2.15.0 → 2.16.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 +9 -0
- package/angular/build-manifest.json +4 -4
- package/angular/index.mjs +1 -1
- package/index.d.ts +42 -33
- package/integrations/shared.js +10 -0
- package/package.json +1 -1
- package/richtexteditor/all_plugins.js +2062 -1542
- package/richtexteditor/all_plugins.min.js +76 -61
- package/richtexteditor/lang/rte-lang-de.js +33 -0
- package/richtexteditor/lang/rte-lang-es.js +33 -0
- package/richtexteditor/lang/rte-lang-fr.js +33 -0
- package/richtexteditor/lang/rte-lang-it.js +33 -0
- package/richtexteditor/lang/rte-lang-ja.js +33 -0
- package/richtexteditor/lang/rte-lang-ko.js +33 -0
- package/richtexteditor/lang/rte-lang-nl.js +33 -0
- package/richtexteditor/lang/rte-lang-pt-pt.js +33 -0
- package/richtexteditor/lang/rte-lang-pt.js +33 -0
- package/richtexteditor/lang/rte-lang-ru.js +33 -0
- package/richtexteditor/lang/rte-lang-zh-Hans.js +33 -0
- package/richtexteditor/lang/rte-lang-zh-Hant.js +33 -0
- package/richtexteditor/plugins/a11yenhance.js +3 -1
- package/richtexteditor/plugins/a11yenhance.min.js +1 -1
- package/richtexteditor/plugins/accessibilitychecker.js +7 -7
- package/richtexteditor/plugins/accessibilitychecker.min.js +1 -1
- package/richtexteditor/plugins/aitoolkit.js +91 -83
- package/richtexteditor/plugins/aitoolkit.min.js +4 -4
- package/richtexteditor/plugins/all_plugins.js +2062 -1542
- package/richtexteditor/plugins/all_plugins.min.js +76 -61
- package/richtexteditor/plugins/autoembed.js +1 -1
- package/richtexteditor/plugins/autoembed.min.js +1 -1
- package/richtexteditor/plugins/charlimit.js +2 -2
- package/richtexteditor/plugins/charlimit.min.js +2 -2
- package/richtexteditor/plugins/comments.js +2 -2
- package/richtexteditor/plugins/comments.min.js +2 -2
- package/richtexteditor/plugins/contentminimap.js +3 -3
- package/richtexteditor/plugins/contentminimap.min.js +1 -1
- package/richtexteditor/plugins/crdt-engine.js +27 -1
- package/richtexteditor/plugins/documentimport.js +30 -8
- package/richtexteditor/plugins/documentimport.min.js +4 -4
- package/richtexteditor/plugins/docxexport.js +30 -1
- package/richtexteditor/plugins/docxexport.min.js +2 -2
- package/richtexteditor/plugins/emojiautocomplete.js +1 -1
- package/richtexteditor/plugins/emojiautocomplete.min.js +1 -1
- package/richtexteditor/plugins/html2pdf.js +7 -7
- package/richtexteditor/plugins/html2pdf.min.js +1 -1
- package/richtexteditor/plugins/imageeditor.js +19 -6
- package/richtexteditor/plugins/imageeditor.min.js +1 -1
- package/richtexteditor/plugins/insertcode.js +8 -8
- package/richtexteditor/plugins/insertcode.min.js +4 -4
- package/richtexteditor/plugins/insertemoji.js +4 -4
- package/richtexteditor/plugins/insertemoji.min.js +1 -1
- package/richtexteditor/plugins/insertgallery.js +4 -4
- package/richtexteditor/plugins/insertgallery.min.js +1 -1
- package/richtexteditor/plugins/inserttemplate.js +10 -2
- package/richtexteditor/plugins/inserttemplate.min.js +1 -1
- package/richtexteditor/plugins/markdownexport.js +1 -1
- package/richtexteditor/plugins/markdownexport.min.js +2 -2
- package/richtexteditor/plugins/mentionplugin.js +2 -2
- package/richtexteditor/plugins/mentionplugin.min.js +1 -1
- package/richtexteditor/plugins/mermaiddiagram.js +5 -5
- package/richtexteditor/plugins/mermaiddiagram.min.js +2 -2
- package/richtexteditor/plugins/nodetypes.js +1 -1
- package/richtexteditor/plugins/nodetypes.min.js +1 -1
- package/richtexteditor/plugins/pagination.js +2 -2
- package/richtexteditor/plugins/pagination.min.js +1 -1
- package/richtexteditor/plugins/pdfexport.js +1751 -1366
- package/richtexteditor/plugins/pdfexport.min.js +28 -13
- package/richtexteditor/plugins/readaloud.js +1 -1
- package/richtexteditor/plugins/readaloud.min.js +1 -1
- package/richtexteditor/plugins/revisionhistory.js +4 -4
- package/richtexteditor/plugins/revisionhistory.min.js +2 -2
- package/richtexteditor/plugins/rubyannotation.js +2 -2
- package/richtexteditor/plugins/rubyannotation.min.js +1 -1
- package/richtexteditor/plugins/sanitizer.js +57 -4
- package/richtexteditor/plugins/sanitizer.min.js +1 -1
- package/richtexteditor/plugins/slashcommand.js +2 -2
- package/richtexteditor/plugins/slashcommand.min.js +2 -2
- package/richtexteditor/plugins/smartchips.js +3 -3
- package/richtexteditor/plugins/smartchips.min.js +1 -1
- package/richtexteditor/plugins/spellcheck.js +3 -3
- package/richtexteditor/plugins/spellcheck.min.js +1 -1
- package/richtexteditor/plugins/stateinspector.js +2 -2
- package/richtexteditor/plugins/stateinspector.min.js +2 -2
- package/richtexteditor/plugins/structured-content-bridge.js +34 -8
- package/richtexteditor/plugins/structured-content-bridge.min.js +5 -5
- package/richtexteditor/plugins/textdirection.js +1 -1
- package/richtexteditor/plugins/textdirection.min.js +1 -1
- package/richtexteditor/plugins/trackedchanges.js +1 -1
- package/richtexteditor/plugins/trackedchanges.min.js +1 -1
- package/richtexteditor/plugins/yjscollab.js +2 -2
- package/richtexteditor/plugins/yjscollab.min.js +1 -1
- package/richtexteditor/rte-config.js +14 -36
- package/richtexteditor/rte-watchdog.js +3 -1
- package/richtexteditor/rte-webcomponent.js +3 -1
- package/richtexteditor/rte.js +16 -38
- package/richtexteditor/runtime/colorpicker_more_ns.htm +3 -1
package/index.d.ts
CHANGED
|
@@ -1056,20 +1056,20 @@ export interface RichTextEditorInstance {
|
|
|
1056
1056
|
* supported (`bold`, `italic`, `insertimage`, …) along with a number of
|
|
1057
1057
|
* editor-specific commands (`source`, `fullscreen`, `ai-ask`, …).
|
|
1058
1058
|
*/
|
|
1059
|
-
execCommand(command: RichTextEditorCommand, value?: unknown): unknown;
|
|
1060
|
-
/** Record an undo checkpoint around a custom DOM edit. */
|
|
1061
|
-
recordUndo(): void;
|
|
1062
|
-
/** Set the selected ordered list's start (including zero). False outside a list. */
|
|
1063
|
-
setListStart(start: number): boolean;
|
|
1064
|
-
/** Continue from the nearest preceding sibling ordered list. False if unavailable. */
|
|
1065
|
-
continueListNumbering(): boolean;
|
|
1066
|
-
/** Toggle the selected table's caption. False outside a table. */
|
|
1067
|
-
toggleTableCaption(): boolean;
|
|
1068
|
-
/** Cancel pending uploads; late callbacks cannot change the document. */
|
|
1069
|
-
cancelUploads(reason?: string): number;
|
|
1070
|
-
getPendingUploadCount(): number;
|
|
1071
|
-
/** Upload embedded data-image URLs through the configured handler. */
|
|
1072
|
-
uploadEmbeddedImages(done?: (summary: { uploaded: number; failed: number; skipped: number; errors: string[] }) => void): void;
|
|
1059
|
+
execCommand(command: RichTextEditorCommand, value?: unknown): unknown;
|
|
1060
|
+
/** Record an undo checkpoint around a custom DOM edit. */
|
|
1061
|
+
recordUndo(): void;
|
|
1062
|
+
/** Set the selected ordered list's start (including zero). False outside a list. */
|
|
1063
|
+
setListStart(start: number): boolean;
|
|
1064
|
+
/** Continue from the nearest preceding sibling ordered list. False if unavailable. */
|
|
1065
|
+
continueListNumbering(): boolean;
|
|
1066
|
+
/** Toggle the selected table's caption. False outside a table. */
|
|
1067
|
+
toggleTableCaption(): boolean;
|
|
1068
|
+
/** Cancel pending uploads; late callbacks cannot change the document. */
|
|
1069
|
+
cancelUploads(reason?: string): number;
|
|
1070
|
+
getPendingUploadCount(): number;
|
|
1071
|
+
/** Upload embedded data-image URLs through the configured handler. */
|
|
1072
|
+
uploadEmbeddedImages(done?: (summary: { uploaded: number; failed: number; skipped: number; errors: string[] }) => void): void;
|
|
1073
1073
|
/** Returns true when the command is enabled in the current selection context. */
|
|
1074
1074
|
isCommandEnabled(command: RichTextEditorCommand): boolean;
|
|
1075
1075
|
/** Returns true when the command's effect is currently active (e.g. selection is bold). */
|
|
@@ -1649,25 +1649,25 @@ export interface RichTextEditorInstance {
|
|
|
1649
1649
|
// Constructor
|
|
1650
1650
|
// =====================
|
|
1651
1651
|
|
|
1652
|
-
export type RichTextEditorUploadCallback = (url: string | null, error?: string) => void;
|
|
1653
|
-
export type RichTextEditorUploadHandle = void | (() => void) | { abort(): void };
|
|
1654
|
-
export type RichTextEditorUploadHandler = (
|
|
1655
|
-
file: File,
|
|
1656
|
-
callback: RichTextEditorUploadCallback,
|
|
1657
|
-
index?: number,
|
|
1658
|
-
files?: File[]
|
|
1659
|
-
) => RichTextEditorUploadHandle;
|
|
1660
|
-
|
|
1661
|
-
export interface RichTextEditorConfig {
|
|
1662
|
-
/** Custom uploader; return an abort handle if requests can be cancelled. */
|
|
1663
|
-
file_upload_handler?: RichTextEditorUploadHandler;
|
|
1664
|
-
/** Scan embedded images and upload through the handler; default false. */
|
|
1665
|
-
automaticUploads?: boolean;
|
|
1666
|
-
automaticUploadsDelay?: number;
|
|
1667
|
-
/** Extra upload attempts after the first; default zero. */
|
|
1668
|
-
uploadRetryCount?: number;
|
|
1669
|
-
/** Initial retry delay in milliseconds; doubles on subsequent retries. */
|
|
1670
|
-
uploadRetryDelay?: number;
|
|
1652
|
+
export type RichTextEditorUploadCallback = (url: string | null, error?: string) => void;
|
|
1653
|
+
export type RichTextEditorUploadHandle = void | (() => void) | { abort(): void };
|
|
1654
|
+
export type RichTextEditorUploadHandler = (
|
|
1655
|
+
file: File,
|
|
1656
|
+
callback: RichTextEditorUploadCallback,
|
|
1657
|
+
index?: number,
|
|
1658
|
+
files?: File[]
|
|
1659
|
+
) => RichTextEditorUploadHandle;
|
|
1660
|
+
|
|
1661
|
+
export interface RichTextEditorConfig {
|
|
1662
|
+
/** Custom uploader; return an abort handle if requests can be cancelled. */
|
|
1663
|
+
file_upload_handler?: RichTextEditorUploadHandler;
|
|
1664
|
+
/** Scan embedded images and upload through the handler; default false. */
|
|
1665
|
+
automaticUploads?: boolean;
|
|
1666
|
+
automaticUploadsDelay?: number;
|
|
1667
|
+
/** Extra upload attempts after the first; default zero. */
|
|
1668
|
+
uploadRetryCount?: number;
|
|
1669
|
+
/** Initial retry delay in milliseconds; doubles on subsequent retries. */
|
|
1670
|
+
uploadRetryDelay?: number;
|
|
1671
1671
|
toolbar?: string | string[];
|
|
1672
1672
|
height?: string | number;
|
|
1673
1673
|
width?: string | number;
|
|
@@ -2046,6 +2046,15 @@ declare global {
|
|
|
2046
2046
|
interface Window {
|
|
2047
2047
|
RichTextEditor: RichTextEditorConstructor;
|
|
2048
2048
|
RTE_DefaultConfig?: RichTextEditorConfig;
|
|
2049
|
+
/**
|
|
2050
|
+
* The editor's Trusted Types policy, "richtexteditor", for plugins that write HTML or a script URL to a sink.
|
|
2051
|
+
* Under CSP `require-trusted-types-for 'script'` the results are TrustedHTML / TrustedScriptURL; without Trusted
|
|
2052
|
+
* Types they are the input unchanged. Typed as string so they assign to innerHTML and src.
|
|
2053
|
+
*/
|
|
2054
|
+
RTE_TrustedTypes?: {
|
|
2055
|
+
html(value: string): string;
|
|
2056
|
+
scriptURL(value: string): string;
|
|
2057
|
+
};
|
|
2049
2058
|
}
|
|
2050
2059
|
}
|
|
2051
2060
|
|
package/integrations/shared.js
CHANGED
|
@@ -3797,6 +3797,16 @@ function repairAccessibilityIssue(value, issue, options) {
|
|
|
3797
3797
|
return workingDocument;
|
|
3798
3798
|
}
|
|
3799
3799
|
|
|
3800
|
+
// A queued repair is not permission to overwrite newer author edits. The
|
|
3801
|
+
// same problem must still exist at this node in the current document.
|
|
3802
|
+
var stillPresent = auditAccessibility(workingDocument).issues.some(function (currentIssue) {
|
|
3803
|
+
return currentIssue.code === normalizedIssue.code &&
|
|
3804
|
+
resolveAccessibilityIssueNodePath(currentIssue) === nodePath;
|
|
3805
|
+
});
|
|
3806
|
+
if (!stillPresent) {
|
|
3807
|
+
return workingDocument;
|
|
3808
|
+
}
|
|
3809
|
+
|
|
3800
3810
|
if (normalizedIssue.code === "image-missing-alt") {
|
|
3801
3811
|
var altText = normalizePlainText(normalizedOptions.altText);
|
|
3802
3812
|
if (!altText) {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.16.0",
|
|
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": {
|