@richscripts/richtexteditor 2.14.1 → 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 +182 -10
- package/angular/build-manifest.json +23 -0
- package/angular/index.d.ts +71 -76
- package/angular/index.mjs +2 -0
- package/angular/package.json +4 -0
- package/headless/index.d.ts +3 -1
- package/headless/index.js +72 -16
- package/index.d.ts +40 -52
- package/integrations/initialization-scope.js +27 -0
- package/integrations/native-mount.js +30 -0
- package/integrations/shared.d.ts +23 -1
- package/integrations/shared.js +68 -22
- package/package.json +25 -3
- package/react/index.js +118 -37
- package/react/index.mjs +29 -0
- package/richtexteditor/all_plugins.js +8816 -2373
- package/richtexteditor/all_plugins.min.js +77 -59
- package/richtexteditor/lang/emoji/LICENSE-CLDR.txt +41 -0
- package/richtexteditor/lang/emoji/rte-emoji-de.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-es.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-fr.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-it.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ja.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ko.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-nl.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-pt-pt.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-pt.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-ru.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-zh-Hans.js +3 -0
- package/richtexteditor/lang/emoji/rte-emoji-zh-Hant.js +3 -0
- package/richtexteditor/lang/rte-lang-af.js +1 -0
- package/richtexteditor/lang/rte-lang-ar.js +1 -0
- package/richtexteditor/lang/rte-lang-bg.js +1 -0
- package/richtexteditor/lang/rte-lang-bn.js +1 -0
- package/richtexteditor/lang/rte-lang-bs.js +1 -0
- package/richtexteditor/lang/rte-lang-ca.js +1 -0
- package/richtexteditor/lang/rte-lang-cs.js +1 -0
- package/richtexteditor/lang/rte-lang-cy.js +1 -0
- package/richtexteditor/lang/rte-lang-da.js +1 -0
- package/richtexteditor/lang/rte-lang-de.js +1050 -2
- package/richtexteditor/lang/rte-lang-el.js +1 -0
- package/richtexteditor/lang/rte-lang-en.js +1 -0
- package/richtexteditor/lang/rte-lang-es.js +1056 -2
- package/richtexteditor/lang/rte-lang-et.js +1 -0
- package/richtexteditor/lang/rte-lang-fa.js +1 -0
- package/richtexteditor/lang/rte-lang-fi.js +1 -0
- package/richtexteditor/lang/rte-lang-fil.js +1 -0
- package/richtexteditor/lang/rte-lang-fj.js +1 -0
- package/richtexteditor/lang/rte-lang-fr.js +1056 -2
- package/richtexteditor/lang/rte-lang-ga.js +1 -0
- package/richtexteditor/lang/rte-lang-gu.js +1 -0
- package/richtexteditor/lang/rte-lang-he.js +1 -0
- package/richtexteditor/lang/rte-lang-hi.js +1 -0
- package/richtexteditor/lang/rte-lang-hr.js +1 -0
- package/richtexteditor/lang/rte-lang-ht.js +1 -0
- package/richtexteditor/lang/rte-lang-hu.js +1 -0
- package/richtexteditor/lang/rte-lang-id.js +1 -0
- package/richtexteditor/lang/rte-lang-is.js +1 -0
- package/richtexteditor/lang/rte-lang-it.js +1056 -2
- package/richtexteditor/lang/rte-lang-ja.js +1056 -2
- package/richtexteditor/lang/rte-lang-kn.js +1 -0
- package/richtexteditor/lang/rte-lang-ko.js +1056 -2
- package/richtexteditor/lang/rte-lang-lt.js +1 -0
- package/richtexteditor/lang/rte-lang-lv.js +1 -0
- package/richtexteditor/lang/rte-lang-mg.js +1 -0
- package/richtexteditor/lang/rte-lang-mi.js +1 -0
- package/richtexteditor/lang/rte-lang-ml.js +1 -0
- package/richtexteditor/lang/rte-lang-mr.js +1 -0
- package/richtexteditor/lang/rte-lang-ms.js +1 -0
- package/richtexteditor/lang/rte-lang-mt.js +1 -0
- package/richtexteditor/lang/rte-lang-mww.js +1 -0
- package/richtexteditor/lang/rte-lang-nb.js +1 -0
- package/richtexteditor/lang/rte-lang-nl.js +1056 -2
- package/richtexteditor/lang/rte-lang-otq.js +1 -0
- package/richtexteditor/lang/rte-lang-pa.js +1 -0
- package/richtexteditor/lang/rte-lang-pl.js +1 -0
- package/richtexteditor/lang/rte-lang-pt-pt.js +1056 -2
- package/richtexteditor/lang/rte-lang-pt.js +1056 -2
- package/richtexteditor/lang/rte-lang-ro.js +1 -0
- package/richtexteditor/lang/rte-lang-ru.js +1056 -2
- package/richtexteditor/lang/rte-lang-sk.js +1 -0
- package/richtexteditor/lang/rte-lang-sl.js +1 -0
- package/richtexteditor/lang/rte-lang-sm.js +1 -0
- package/richtexteditor/lang/rte-lang-sr-Cyrl.js +1 -0
- package/richtexteditor/lang/rte-lang-sr-Latn.js +1 -0
- package/richtexteditor/lang/rte-lang-sv.js +1 -0
- package/richtexteditor/lang/rte-lang-sw.js +1 -0
- package/richtexteditor/lang/rte-lang-ta.js +1 -0
- package/richtexteditor/lang/rte-lang-te.js +1 -0
- package/richtexteditor/lang/rte-lang-th.js +1 -0
- package/richtexteditor/lang/rte-lang-tlh-Latn.js +1 -0
- package/richtexteditor/lang/rte-lang-tlh-Piqd.js +1 -0
- package/richtexteditor/lang/rte-lang-to.js +1 -0
- package/richtexteditor/lang/rte-lang-tr.js +1 -0
- package/richtexteditor/lang/rte-lang-ty.js +1 -0
- package/richtexteditor/lang/rte-lang-uk.js +1 -0
- package/richtexteditor/lang/rte-lang-ur.js +1 -0
- package/richtexteditor/lang/rte-lang-vi.js +1 -0
- package/richtexteditor/lang/rte-lang-yua.js +1 -0
- package/richtexteditor/lang/rte-lang-zh-Hans.js +1050 -2
- package/richtexteditor/lang/rte-lang-zh-Hant.js +1050 -2
- package/richtexteditor/plugins/a11yenhance.js +4 -1
- package/richtexteditor/plugins/a11yenhance.min.js +1 -1
- package/richtexteditor/plugins/accessibilitychecker.js +256 -64
- package/richtexteditor/plugins/accessibilitychecker.min.js +1 -1
- package/richtexteditor/plugins/aitoolkit.js +1057 -386
- package/richtexteditor/plugins/aitoolkit.min.js +7 -7
- package/richtexteditor/plugins/all_plugins.js +8816 -2373
- package/richtexteditor/plugins/all_plugins.min.js +77 -59
- package/richtexteditor/plugins/autocorrect.js +66 -31
- package/richtexteditor/plugins/autocorrect.min.js +1 -1
- package/richtexteditor/plugins/autoembed.js +18 -1
- package/richtexteditor/plugins/autoembed.min.js +1 -1
- package/richtexteditor/plugins/blocktypes.js +18 -9
- package/richtexteditor/plugins/blocktypes.min.js +1 -1
- package/richtexteditor/plugins/bookmarkcard.js +12 -5
- package/richtexteditor/plugins/bookmarkcard.min.js +2 -2
- package/richtexteditor/plugins/changecase.js +72 -19
- package/richtexteditor/plugins/changecase.min.js +1 -1
- package/richtexteditor/plugins/charlimit.js +62 -2
- package/richtexteditor/plugins/charlimit.min.js +2 -2
- package/richtexteditor/plugins/comments.js +460 -61
- package/richtexteditor/plugins/comments.min.js +4 -3
- package/richtexteditor/plugins/contentminimap.js +28 -9
- package/richtexteditor/plugins/contentminimap.min.js +1 -1
- package/richtexteditor/plugins/crdt-engine.js +27 -1
- package/richtexteditor/plugins/crossreference.js +1 -1
- package/richtexteditor/plugins/crossreference.min.js +1 -1
- package/richtexteditor/plugins/dialoga11y.js +26 -4
- package/richtexteditor/plugins/dialoga11y.min.js +1 -1
- package/richtexteditor/plugins/dictation.js +1 -1
- package/richtexteditor/plugins/documentimport.js +250 -59
- package/richtexteditor/plugins/documentimport.min.js +4 -4
- package/richtexteditor/plugins/documentoutline.js +47 -8
- package/richtexteditor/plugins/documentoutline.min.js +1 -1
- package/richtexteditor/plugins/docxexport.js +233 -32
- package/richtexteditor/plugins/docxexport.min.js +2 -2
- package/richtexteditor/plugins/draghandle.js +267 -3
- package/richtexteditor/plugins/draghandle.min.js +1 -1
- package/richtexteditor/plugins/emailtoolkit.js +28 -14
- package/richtexteditor/plugins/emailtoolkit.min.js +1 -1
- package/richtexteditor/plugins/emojiautocomplete.js +111 -57
- package/richtexteditor/plugins/emojiautocomplete.min.js +1 -1
- package/richtexteditor/plugins/footnotes.js +65 -11
- package/richtexteditor/plugins/footnotes.min.js +1 -1
- package/richtexteditor/plugins/formatpainter.js +10 -0
- package/richtexteditor/plugins/formatpainter.min.js +1 -1
- package/richtexteditor/plugins/formattingmarks.js +6 -6
- package/richtexteditor/plugins/formattingmarks.min.js +1 -1
- package/richtexteditor/plugins/gapcursor.js +60 -0
- package/richtexteditor/plugins/gapcursor.min.js +1 -1
- package/richtexteditor/plugins/ghostcomplete.js +1 -1
- package/richtexteditor/plugins/html2pdf.js +8 -8
- package/richtexteditor/plugins/html2pdf.min.js +1 -1
- package/richtexteditor/plugins/imageeditor.js +31 -12
- package/richtexteditor/plugins/imageeditor.min.js +1 -1
- package/richtexteditor/plugins/importstyles.js +1 -1
- package/richtexteditor/plugins/inlinecode.js +25 -0
- package/richtexteditor/plugins/inlinecode.min.js +1 -1
- package/richtexteditor/plugins/insertcode.js +29 -11
- package/richtexteditor/plugins/insertcode.min.js +6 -6
- package/richtexteditor/plugins/insertemoji.js +113 -16
- package/richtexteditor/plugins/insertemoji.min.js +1 -1
- package/richtexteditor/plugins/insertgallery.js +46 -40
- package/richtexteditor/plugins/insertgallery.min.js +1 -1
- package/richtexteditor/plugins/inserttemplate.js +43 -19
- package/richtexteditor/plugins/inserttemplate.min.js +1 -1
- package/richtexteditor/plugins/keyboarda11y.js +66 -3
- package/richtexteditor/plugins/keyboarda11y.min.js +1 -1
- package/richtexteditor/plugins/layouttable.js +20 -0
- package/richtexteditor/plugins/layouttable.min.js +1 -1
- package/richtexteditor/plugins/linkchecker.js +29 -9
- package/richtexteditor/plugins/linkchecker.min.js +1 -1
- package/richtexteditor/plugins/localdraft.js +51 -7
- package/richtexteditor/plugins/localdraft.min.js +1 -1
- package/richtexteditor/plugins/markdownexport.js +159 -0
- package/richtexteditor/plugins/markdownexport.min.js +2 -2
- package/richtexteditor/plugins/mathdialog.js +11 -5
- package/richtexteditor/plugins/mathdialog.min.js +1 -1
- package/richtexteditor/plugins/mentionplugin.js +90 -27
- package/richtexteditor/plugins/mentionplugin.min.js +1 -1
- package/richtexteditor/plugins/mermaiddiagram.js +14 -8
- package/richtexteditor/plugins/mermaiddiagram.min.js +2 -2
- package/richtexteditor/plugins/multilevellist.js +4 -0
- package/richtexteditor/plugins/multilevellist.min.js +1 -1
- 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 +1752 -1167
- package/richtexteditor/plugins/pdfexport.min.js +28 -13
- package/richtexteditor/plugins/permanentpen.js +3 -3
- package/richtexteditor/plugins/permanentpen.min.js +1 -1
- package/richtexteditor/plugins/readabilitystats.js +25 -11
- package/richtexteditor/plugins/readabilitystats.min.js +1 -1
- package/richtexteditor/plugins/readaloud.js +30 -16
- package/richtexteditor/plugins/readaloud.min.js +1 -1
- package/richtexteditor/plugins/restrictedediting.js +166 -0
- package/richtexteditor/plugins/restrictedediting.min.js +2 -2
- package/richtexteditor/plugins/revisionhistory.js +173 -41
- package/richtexteditor/plugins/revisionhistory.min.js +3 -3
- package/richtexteditor/plugins/rubyannotation.js +21 -11
- package/richtexteditor/plugins/rubyannotation.min.js +1 -1
- package/richtexteditor/plugins/sanitizer.js +119 -7
- package/richtexteditor/plugins/sanitizer.min.js +1 -1
- package/richtexteditor/plugins/slashcommand.js +32 -18
- package/richtexteditor/plugins/slashcommand.min.js +2 -2
- package/richtexteditor/plugins/smartchips.js +39 -25
- package/richtexteditor/plugins/smartchips.min.js +2 -2
- package/richtexteditor/plugins/spellcheck.js +20 -11
- package/richtexteditor/plugins/spellcheck.min.js +2 -2
- package/richtexteditor/plugins/stateinspector.js +21 -11
- package/richtexteditor/plugins/stateinspector.min.js +2 -2
- package/richtexteditor/plugins/structured-content-bridge.js +90 -32
- package/richtexteditor/plugins/structured-content-bridge.min.js +8 -8
- package/richtexteditor/plugins/tableofcontents.js +5 -2
- package/richtexteditor/plugins/tableofcontents.min.js +1 -1
- package/richtexteditor/plugins/tabletools.js +388 -3
- package/richtexteditor/plugins/tabletools.min.js +1 -1
- package/richtexteditor/plugins/textdirection.js +19 -6
- package/richtexteditor/plugins/textdirection.min.js +1 -1
- package/richtexteditor/plugins/textpartlanguage.js +161 -32
- package/richtexteditor/plugins/textpartlanguage.min.js +1 -1
- package/richtexteditor/plugins/todolist.js +90 -6
- package/richtexteditor/plugins/todolist.min.js +1 -1
- package/richtexteditor/plugins/trackedchanges.js +1812 -25
- package/richtexteditor/plugins/trackedchanges.min.js +5 -3
- package/richtexteditor/plugins/wordexport.js +2 -2
- package/richtexteditor/plugins/yjscollab.js +11 -6
- package/richtexteditor/plugins/yjscollab.min.js +1 -1
- package/richtexteditor/plugins/zz_richtextbox_dialog_style.js +22 -13
- package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -1
- package/richtexteditor/rte-config.js +144 -86
- package/richtexteditor/rte-headless.js +19 -4
- package/richtexteditor/rte-watchdog.js +3 -1
- package/richtexteditor/rte-webcomponent.js +91 -16
- package/richtexteditor/rte.js +146 -88
- package/richtexteditor/runtime/colorpicker_more_ns.htm +3 -1
- package/scripts/build-angular.mjs +97 -0
- package/svelte/index.d.ts +2 -1
- package/svelte/index.js +80 -9
- package/vue/index.js +130 -34
- package/angular/component.ts +0 -297
- package/angular/index.ts +0 -24
package/angular/component.ts
DELETED
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AfterViewInit,
|
|
3
|
-
Component,
|
|
4
|
-
ElementRef,
|
|
5
|
-
EventEmitter,
|
|
6
|
-
Input,
|
|
7
|
-
OnChanges,
|
|
8
|
-
OnDestroy,
|
|
9
|
-
Output,
|
|
10
|
-
SimpleChanges,
|
|
11
|
-
ViewChild
|
|
12
|
-
} from "@angular/core";
|
|
13
|
-
import type {
|
|
14
|
-
RichTextEditorAccessibilityResult,
|
|
15
|
-
RichTextEditorAiToolkit,
|
|
16
|
-
RichTextEditorCollab,
|
|
17
|
-
RichTextEditorComments,
|
|
18
|
-
RichTextEditorDictation,
|
|
19
|
-
RichTextEditorDocumentMetrics,
|
|
20
|
-
RichTextEditorDocumentOutlineItem,
|
|
21
|
-
RichTextEditorFootnoteItem,
|
|
22
|
-
RichTextEditorInstance,
|
|
23
|
-
RichTextEditorMentions,
|
|
24
|
-
RichTextEditorPageSetup,
|
|
25
|
-
RichTextEditorReviewLedger,
|
|
26
|
-
RichTextEditorRevisionHistory,
|
|
27
|
-
RichTextEditorSlashCommands,
|
|
28
|
-
RichTextEditorStructuredDocument,
|
|
29
|
-
RichTextEditorStructuredInput,
|
|
30
|
-
RichTextEditorTableOfContentsItem,
|
|
31
|
-
RichTextEditorTableOfContentsOptions,
|
|
32
|
-
RichTextEditorTextStatistics,
|
|
33
|
-
RichTextEditorValueFormat
|
|
34
|
-
} from "../index";
|
|
35
|
-
import * as shared from "../integrations/shared";
|
|
36
|
-
|
|
37
|
-
export interface RichTextEditorAngularChangeEvent {
|
|
38
|
-
editor: RichTextEditorInstance;
|
|
39
|
-
value: string | RichTextEditorStructuredDocument;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@Component({
|
|
43
|
-
selector: "rich-text-editor",
|
|
44
|
-
standalone: true,
|
|
45
|
-
template: '<div #host class="rte-angular-host"></div>',
|
|
46
|
-
styles: [`
|
|
47
|
-
:host {
|
|
48
|
-
display: block;
|
|
49
|
-
min-height: 360px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.rte-angular-host {
|
|
53
|
-
min-height: 360px;
|
|
54
|
-
}
|
|
55
|
-
`]
|
|
56
|
-
})
|
|
57
|
-
export class RichTextEditorAngularComponent implements AfterViewInit, OnChanges, OnDestroy {
|
|
58
|
-
@Input() assetBasePath = "/richtexteditor";
|
|
59
|
-
@Input() autoload = true;
|
|
60
|
-
@Input() config: Record<string, unknown> = {};
|
|
61
|
-
@Input() value?: RichTextEditorStructuredInput;
|
|
62
|
-
@Input() valueFormat: RichTextEditorValueFormat = "html";
|
|
63
|
-
// Quiet period before the document is serialised and `change` is emitted.
|
|
64
|
-
// 0 restores the pre-2.6 behaviour of emitting on every keystroke.
|
|
65
|
-
@Input() changeDelay = 120;
|
|
66
|
-
|
|
67
|
-
@Output() change = new EventEmitter<RichTextEditorAngularChangeEvent>();
|
|
68
|
-
@Output() error = new EventEmitter<Error>();
|
|
69
|
-
@Output() ready = new EventEmitter<RichTextEditorInstance>();
|
|
70
|
-
|
|
71
|
-
@ViewChild("host", { static: true }) hostRef!: ElementRef<HTMLDivElement>;
|
|
72
|
-
|
|
73
|
-
private changeHandler: (() => void) | null = null;
|
|
74
|
-
private emitChange: ((() => void) & { flush(): void; cancel(): void }) | null = null;
|
|
75
|
-
private lastEmitted: unknown;
|
|
76
|
-
private editor: RichTextEditorInstance | null = null;
|
|
77
|
-
|
|
78
|
-
async ngAfterViewInit(): Promise<void> {
|
|
79
|
-
try {
|
|
80
|
-
if (this.autoload === false) {
|
|
81
|
-
shared.installStructuredContentBridge();
|
|
82
|
-
} else {
|
|
83
|
-
await shared.loadRichTextEditorAssets({ basePath: this.assetBasePath });
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
this.editor = shared.createEditor(this.hostRef.nativeElement, this.config || {});
|
|
87
|
-
|
|
88
|
-
if (this.value !== undefined) {
|
|
89
|
-
this.syncEditor(this.value);
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Coalesce: the editor fires `change` per keystroke and getEditorValue
|
|
93
|
-
// serialises the whole document (78 ms on a 3000-paragraph document).
|
|
94
|
-
// See shared.createChangeCoalescer.
|
|
95
|
-
this.emitChange = shared.createChangeCoalescer(() => {
|
|
96
|
-
if (!this.editor) {
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
this.lastEmitted = shared.getEditorValue(this.editor, this.valueFormat);
|
|
101
|
-
this.change.emit({
|
|
102
|
-
editor: this.editor,
|
|
103
|
-
value: this.lastEmitted
|
|
104
|
-
});
|
|
105
|
-
}, this.changeDelay == null ? 120 : this.changeDelay);
|
|
106
|
-
|
|
107
|
-
this.changeHandler = () => { this.emitChange(); };
|
|
108
|
-
|
|
109
|
-
this.editor.attachEvent("change", this.changeHandler);
|
|
110
|
-
this.ready.emit(this.editor);
|
|
111
|
-
} catch (loadError) {
|
|
112
|
-
this.error.emit(loadError as Error);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
ngOnChanges(changes: SimpleChanges): void {
|
|
117
|
-
if (!this.editor) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (changes["value"] || changes["valueFormat"]) {
|
|
122
|
-
this.syncEditor(this.value);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
ngOnDestroy(): void {
|
|
127
|
-
if (this.editor) {
|
|
128
|
-
// Flush first, or the last keystroke before teardown is lost.
|
|
129
|
-
if (this.emitChange) { this.emitChange.flush(); }
|
|
130
|
-
if (this.changeHandler && typeof this.editor.detachEvent === "function") {
|
|
131
|
-
this.editor.detachEvent("change", this.changeHandler);
|
|
132
|
-
}
|
|
133
|
-
// Tear down instance-level global listeners so unmounting doesn't leak.
|
|
134
|
-
if (typeof this.editor.destroy === "function") {
|
|
135
|
-
try { this.editor.destroy(); } catch (e) { /* ignore */ }
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
this.hostRef.nativeElement.innerHTML = "";
|
|
140
|
-
this.editor = null;
|
|
141
|
-
this.changeHandler = null;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
focus(): void {
|
|
145
|
-
if (this.editor) {
|
|
146
|
-
this.editor.focus();
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
getEditor(): RichTextEditorInstance | null {
|
|
151
|
-
return this.editor;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
getHTMLCode(): string {
|
|
155
|
-
return this.editor ? this.editor.getHTMLCode() : "";
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
setHTMLCode(value: string): void {
|
|
159
|
-
if (this.editor) {
|
|
160
|
-
this.editor.setHTMLCode(value || "");
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
getJSON(): RichTextEditorStructuredDocument | null {
|
|
165
|
-
return this.editor ? this.editor.getJSON() : null;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
setJSON(value: RichTextEditorStructuredInput): void {
|
|
169
|
-
if (this.editor) {
|
|
170
|
-
this.editor.setJSON(value);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
getTextStatistics(): RichTextEditorTextStatistics | null {
|
|
175
|
-
if (!this.editor || typeof this.editor.getTextStatistics !== "function") {
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
return this.editor.getTextStatistics();
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
getSelectionStatistics(): RichTextEditorTextStatistics | null {
|
|
182
|
-
if (!this.editor || typeof this.editor.getSelectionStatistics !== "function") {
|
|
183
|
-
return null;
|
|
184
|
-
}
|
|
185
|
-
return this.editor.getSelectionStatistics();
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
getDocumentMetrics(): RichTextEditorDocumentMetrics | null {
|
|
189
|
-
if (!this.editor || typeof this.editor.getDocumentMetrics !== "function") {
|
|
190
|
-
return null;
|
|
191
|
-
}
|
|
192
|
-
return this.editor.getDocumentMetrics();
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
getDocumentPageSetup(): RichTextEditorPageSetup | null {
|
|
196
|
-
if (!this.editor || typeof this.editor.getDocumentPageSetup !== "function") {
|
|
197
|
-
return null;
|
|
198
|
-
}
|
|
199
|
-
return this.editor.getDocumentPageSetup();
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
setDocumentPageSetup(pageSetup: RichTextEditorPageSetup | null): RichTextEditorAngularComponent | null {
|
|
203
|
-
if (!this.editor || typeof this.editor.setDocumentPageSetup !== "function") {
|
|
204
|
-
return null;
|
|
205
|
-
}
|
|
206
|
-
this.editor.setDocumentPageSetup(pageSetup);
|
|
207
|
-
return this;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
getDocumentOutline(): RichTextEditorDocumentOutlineItem[] {
|
|
211
|
-
if (!this.editor) {
|
|
212
|
-
return [];
|
|
213
|
-
}
|
|
214
|
-
return shared.getDocumentOutline(this.editor.getJSON());
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
getFootnotes(): RichTextEditorFootnoteItem[] {
|
|
218
|
-
if (!this.editor) {
|
|
219
|
-
return [];
|
|
220
|
-
}
|
|
221
|
-
return shared.getFootnotes(this.editor.getJSON());
|
|
222
|
-
}
|
|
223
|
-
|
|
224
|
-
getTableOfContents(options?: RichTextEditorTableOfContentsOptions): RichTextEditorTableOfContentsItem[] {
|
|
225
|
-
if (!this.editor) {
|
|
226
|
-
return [];
|
|
227
|
-
}
|
|
228
|
-
return shared.getTableOfContents(this.editor.getJSON(), options);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
syncTableOfContents(options?: RichTextEditorTableOfContentsOptions): RichTextEditorStructuredDocument | null {
|
|
232
|
-
if (!this.editor) {
|
|
233
|
-
return null;
|
|
234
|
-
}
|
|
235
|
-
var documentModel = shared.syncTableOfContents(this.editor.getJSON(), options);
|
|
236
|
-
this.editor.setJSON(documentModel);
|
|
237
|
-
return documentModel;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
auditAccessibility(): RichTextEditorAccessibilityResult | null {
|
|
241
|
-
if (!this.editor) {
|
|
242
|
-
return null;
|
|
243
|
-
}
|
|
244
|
-
return shared.auditAccessibility(this.editor.getJSON());
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
getAiToolkit(): RichTextEditorAiToolkit | null | undefined {
|
|
248
|
-
return this.getPluginNamespace("aiToolkit");
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
getDictation(): RichTextEditorDictation | null | undefined {
|
|
252
|
-
return this.getPluginNamespace("dictation");
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
getRevisionHistory(): RichTextEditorRevisionHistory | null | undefined {
|
|
256
|
-
return this.getPluginNamespace("revisionHistory");
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
getCollab(): RichTextEditorCollab | null | undefined {
|
|
260
|
-
return this.getPluginNamespace("collab");
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
getSlashCommands(): RichTextEditorSlashCommands | null | undefined {
|
|
264
|
-
return this.getPluginNamespace("slashCommands");
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
getMentions(): RichTextEditorMentions | null | undefined {
|
|
268
|
-
return this.getPluginNamespace("mentions");
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
getComments(): RichTextEditorComments | null | undefined {
|
|
272
|
-
return this.getPluginNamespace("comments");
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
getReviewLedger(): RichTextEditorReviewLedger | null | undefined {
|
|
276
|
-
return this.getPluginNamespace("reviewLedger");
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
private getPluginNamespace<T>(name: string): T | null | undefined {
|
|
280
|
-
if (!this.editor) {
|
|
281
|
-
return null;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
return (this.editor as unknown as Record<string, T | undefined>)[name];
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
private syncEditor(nextValue: RichTextEditorStructuredInput | undefined): void {
|
|
288
|
-
if (!this.editor || nextValue === undefined) {
|
|
289
|
-
return;
|
|
290
|
-
}
|
|
291
|
-
|
|
292
|
-
var nextHtml = shared.normalizeStructuredContent(nextValue);
|
|
293
|
-
if (this.editor.getHTMLCode() !== nextHtml) {
|
|
294
|
-
shared.setEditorValue(this.editor, nextValue, this.valueFormat);
|
|
295
|
-
}
|
|
296
|
-
}
|
|
297
|
-
}
|
package/angular/index.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
RichTextEditorAngularComponent,
|
|
3
|
-
type RichTextEditorAngularChangeEvent
|
|
4
|
-
} from "./component";
|
|
5
|
-
|
|
6
|
-
export {
|
|
7
|
-
auditAccessibility,
|
|
8
|
-
auditLinks,
|
|
9
|
-
createStructuredContent,
|
|
10
|
-
createStructuredDocument,
|
|
11
|
-
fromMarkdown,
|
|
12
|
-
getDocumentPageSetup,
|
|
13
|
-
getDocumentMetrics,
|
|
14
|
-
getDocumentOutline,
|
|
15
|
-
getFootnotes,
|
|
16
|
-
getTableOfContents,
|
|
17
|
-
getTextStatistics,
|
|
18
|
-
loadRichTextEditorAssets,
|
|
19
|
-
renderHTML,
|
|
20
|
-
setDocumentPageSetup,
|
|
21
|
-
syncTableOfContents,
|
|
22
|
-
toMarkdown,
|
|
23
|
-
validateStructuredContent
|
|
24
|
-
} from "../integrations/shared";
|