@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.
Files changed (244) hide show
  1. package/README.md +182 -10
  2. package/angular/build-manifest.json +23 -0
  3. package/angular/index.d.ts +71 -76
  4. package/angular/index.mjs +2 -0
  5. package/angular/package.json +4 -0
  6. package/headless/index.d.ts +3 -1
  7. package/headless/index.js +72 -16
  8. package/index.d.ts +40 -52
  9. package/integrations/initialization-scope.js +27 -0
  10. package/integrations/native-mount.js +30 -0
  11. package/integrations/shared.d.ts +23 -1
  12. package/integrations/shared.js +68 -22
  13. package/package.json +25 -3
  14. package/react/index.js +118 -37
  15. package/react/index.mjs +29 -0
  16. package/richtexteditor/all_plugins.js +8816 -2373
  17. package/richtexteditor/all_plugins.min.js +77 -59
  18. package/richtexteditor/lang/emoji/LICENSE-CLDR.txt +41 -0
  19. package/richtexteditor/lang/emoji/rte-emoji-de.js +3 -0
  20. package/richtexteditor/lang/emoji/rte-emoji-es.js +3 -0
  21. package/richtexteditor/lang/emoji/rte-emoji-fr.js +3 -0
  22. package/richtexteditor/lang/emoji/rte-emoji-it.js +3 -0
  23. package/richtexteditor/lang/emoji/rte-emoji-ja.js +3 -0
  24. package/richtexteditor/lang/emoji/rte-emoji-ko.js +3 -0
  25. package/richtexteditor/lang/emoji/rte-emoji-nl.js +3 -0
  26. package/richtexteditor/lang/emoji/rte-emoji-pt-pt.js +3 -0
  27. package/richtexteditor/lang/emoji/rte-emoji-pt.js +3 -0
  28. package/richtexteditor/lang/emoji/rte-emoji-ru.js +3 -0
  29. package/richtexteditor/lang/emoji/rte-emoji-zh-Hans.js +3 -0
  30. package/richtexteditor/lang/emoji/rte-emoji-zh-Hant.js +3 -0
  31. package/richtexteditor/lang/rte-lang-af.js +1 -0
  32. package/richtexteditor/lang/rte-lang-ar.js +1 -0
  33. package/richtexteditor/lang/rte-lang-bg.js +1 -0
  34. package/richtexteditor/lang/rte-lang-bn.js +1 -0
  35. package/richtexteditor/lang/rte-lang-bs.js +1 -0
  36. package/richtexteditor/lang/rte-lang-ca.js +1 -0
  37. package/richtexteditor/lang/rte-lang-cs.js +1 -0
  38. package/richtexteditor/lang/rte-lang-cy.js +1 -0
  39. package/richtexteditor/lang/rte-lang-da.js +1 -0
  40. package/richtexteditor/lang/rte-lang-de.js +1050 -2
  41. package/richtexteditor/lang/rte-lang-el.js +1 -0
  42. package/richtexteditor/lang/rte-lang-en.js +1 -0
  43. package/richtexteditor/lang/rte-lang-es.js +1056 -2
  44. package/richtexteditor/lang/rte-lang-et.js +1 -0
  45. package/richtexteditor/lang/rte-lang-fa.js +1 -0
  46. package/richtexteditor/lang/rte-lang-fi.js +1 -0
  47. package/richtexteditor/lang/rte-lang-fil.js +1 -0
  48. package/richtexteditor/lang/rte-lang-fj.js +1 -0
  49. package/richtexteditor/lang/rte-lang-fr.js +1056 -2
  50. package/richtexteditor/lang/rte-lang-ga.js +1 -0
  51. package/richtexteditor/lang/rte-lang-gu.js +1 -0
  52. package/richtexteditor/lang/rte-lang-he.js +1 -0
  53. package/richtexteditor/lang/rte-lang-hi.js +1 -0
  54. package/richtexteditor/lang/rte-lang-hr.js +1 -0
  55. package/richtexteditor/lang/rte-lang-ht.js +1 -0
  56. package/richtexteditor/lang/rte-lang-hu.js +1 -0
  57. package/richtexteditor/lang/rte-lang-id.js +1 -0
  58. package/richtexteditor/lang/rte-lang-is.js +1 -0
  59. package/richtexteditor/lang/rte-lang-it.js +1056 -2
  60. package/richtexteditor/lang/rte-lang-ja.js +1056 -2
  61. package/richtexteditor/lang/rte-lang-kn.js +1 -0
  62. package/richtexteditor/lang/rte-lang-ko.js +1056 -2
  63. package/richtexteditor/lang/rte-lang-lt.js +1 -0
  64. package/richtexteditor/lang/rte-lang-lv.js +1 -0
  65. package/richtexteditor/lang/rte-lang-mg.js +1 -0
  66. package/richtexteditor/lang/rte-lang-mi.js +1 -0
  67. package/richtexteditor/lang/rte-lang-ml.js +1 -0
  68. package/richtexteditor/lang/rte-lang-mr.js +1 -0
  69. package/richtexteditor/lang/rte-lang-ms.js +1 -0
  70. package/richtexteditor/lang/rte-lang-mt.js +1 -0
  71. package/richtexteditor/lang/rte-lang-mww.js +1 -0
  72. package/richtexteditor/lang/rte-lang-nb.js +1 -0
  73. package/richtexteditor/lang/rte-lang-nl.js +1056 -2
  74. package/richtexteditor/lang/rte-lang-otq.js +1 -0
  75. package/richtexteditor/lang/rte-lang-pa.js +1 -0
  76. package/richtexteditor/lang/rte-lang-pl.js +1 -0
  77. package/richtexteditor/lang/rte-lang-pt-pt.js +1056 -2
  78. package/richtexteditor/lang/rte-lang-pt.js +1056 -2
  79. package/richtexteditor/lang/rte-lang-ro.js +1 -0
  80. package/richtexteditor/lang/rte-lang-ru.js +1056 -2
  81. package/richtexteditor/lang/rte-lang-sk.js +1 -0
  82. package/richtexteditor/lang/rte-lang-sl.js +1 -0
  83. package/richtexteditor/lang/rte-lang-sm.js +1 -0
  84. package/richtexteditor/lang/rte-lang-sr-Cyrl.js +1 -0
  85. package/richtexteditor/lang/rte-lang-sr-Latn.js +1 -0
  86. package/richtexteditor/lang/rte-lang-sv.js +1 -0
  87. package/richtexteditor/lang/rte-lang-sw.js +1 -0
  88. package/richtexteditor/lang/rte-lang-ta.js +1 -0
  89. package/richtexteditor/lang/rte-lang-te.js +1 -0
  90. package/richtexteditor/lang/rte-lang-th.js +1 -0
  91. package/richtexteditor/lang/rte-lang-tlh-Latn.js +1 -0
  92. package/richtexteditor/lang/rte-lang-tlh-Piqd.js +1 -0
  93. package/richtexteditor/lang/rte-lang-to.js +1 -0
  94. package/richtexteditor/lang/rte-lang-tr.js +1 -0
  95. package/richtexteditor/lang/rte-lang-ty.js +1 -0
  96. package/richtexteditor/lang/rte-lang-uk.js +1 -0
  97. package/richtexteditor/lang/rte-lang-ur.js +1 -0
  98. package/richtexteditor/lang/rte-lang-vi.js +1 -0
  99. package/richtexteditor/lang/rte-lang-yua.js +1 -0
  100. package/richtexteditor/lang/rte-lang-zh-Hans.js +1050 -2
  101. package/richtexteditor/lang/rte-lang-zh-Hant.js +1050 -2
  102. package/richtexteditor/plugins/a11yenhance.js +4 -1
  103. package/richtexteditor/plugins/a11yenhance.min.js +1 -1
  104. package/richtexteditor/plugins/accessibilitychecker.js +256 -64
  105. package/richtexteditor/plugins/accessibilitychecker.min.js +1 -1
  106. package/richtexteditor/plugins/aitoolkit.js +1057 -386
  107. package/richtexteditor/plugins/aitoolkit.min.js +7 -7
  108. package/richtexteditor/plugins/all_plugins.js +8816 -2373
  109. package/richtexteditor/plugins/all_plugins.min.js +77 -59
  110. package/richtexteditor/plugins/autocorrect.js +66 -31
  111. package/richtexteditor/plugins/autocorrect.min.js +1 -1
  112. package/richtexteditor/plugins/autoembed.js +18 -1
  113. package/richtexteditor/plugins/autoembed.min.js +1 -1
  114. package/richtexteditor/plugins/blocktypes.js +18 -9
  115. package/richtexteditor/plugins/blocktypes.min.js +1 -1
  116. package/richtexteditor/plugins/bookmarkcard.js +12 -5
  117. package/richtexteditor/plugins/bookmarkcard.min.js +2 -2
  118. package/richtexteditor/plugins/changecase.js +72 -19
  119. package/richtexteditor/plugins/changecase.min.js +1 -1
  120. package/richtexteditor/plugins/charlimit.js +62 -2
  121. package/richtexteditor/plugins/charlimit.min.js +2 -2
  122. package/richtexteditor/plugins/comments.js +460 -61
  123. package/richtexteditor/plugins/comments.min.js +4 -3
  124. package/richtexteditor/plugins/contentminimap.js +28 -9
  125. package/richtexteditor/plugins/contentminimap.min.js +1 -1
  126. package/richtexteditor/plugins/crdt-engine.js +27 -1
  127. package/richtexteditor/plugins/crossreference.js +1 -1
  128. package/richtexteditor/plugins/crossreference.min.js +1 -1
  129. package/richtexteditor/plugins/dialoga11y.js +26 -4
  130. package/richtexteditor/plugins/dialoga11y.min.js +1 -1
  131. package/richtexteditor/plugins/dictation.js +1 -1
  132. package/richtexteditor/plugins/documentimport.js +250 -59
  133. package/richtexteditor/plugins/documentimport.min.js +4 -4
  134. package/richtexteditor/plugins/documentoutline.js +47 -8
  135. package/richtexteditor/plugins/documentoutline.min.js +1 -1
  136. package/richtexteditor/plugins/docxexport.js +233 -32
  137. package/richtexteditor/plugins/docxexport.min.js +2 -2
  138. package/richtexteditor/plugins/draghandle.js +267 -3
  139. package/richtexteditor/plugins/draghandle.min.js +1 -1
  140. package/richtexteditor/plugins/emailtoolkit.js +28 -14
  141. package/richtexteditor/plugins/emailtoolkit.min.js +1 -1
  142. package/richtexteditor/plugins/emojiautocomplete.js +111 -57
  143. package/richtexteditor/plugins/emojiautocomplete.min.js +1 -1
  144. package/richtexteditor/plugins/footnotes.js +65 -11
  145. package/richtexteditor/plugins/footnotes.min.js +1 -1
  146. package/richtexteditor/plugins/formatpainter.js +10 -0
  147. package/richtexteditor/plugins/formatpainter.min.js +1 -1
  148. package/richtexteditor/plugins/formattingmarks.js +6 -6
  149. package/richtexteditor/plugins/formattingmarks.min.js +1 -1
  150. package/richtexteditor/plugins/gapcursor.js +60 -0
  151. package/richtexteditor/plugins/gapcursor.min.js +1 -1
  152. package/richtexteditor/plugins/ghostcomplete.js +1 -1
  153. package/richtexteditor/plugins/html2pdf.js +8 -8
  154. package/richtexteditor/plugins/html2pdf.min.js +1 -1
  155. package/richtexteditor/plugins/imageeditor.js +31 -12
  156. package/richtexteditor/plugins/imageeditor.min.js +1 -1
  157. package/richtexteditor/plugins/importstyles.js +1 -1
  158. package/richtexteditor/plugins/inlinecode.js +25 -0
  159. package/richtexteditor/plugins/inlinecode.min.js +1 -1
  160. package/richtexteditor/plugins/insertcode.js +29 -11
  161. package/richtexteditor/plugins/insertcode.min.js +6 -6
  162. package/richtexteditor/plugins/insertemoji.js +113 -16
  163. package/richtexteditor/plugins/insertemoji.min.js +1 -1
  164. package/richtexteditor/plugins/insertgallery.js +46 -40
  165. package/richtexteditor/plugins/insertgallery.min.js +1 -1
  166. package/richtexteditor/plugins/inserttemplate.js +43 -19
  167. package/richtexteditor/plugins/inserttemplate.min.js +1 -1
  168. package/richtexteditor/plugins/keyboarda11y.js +66 -3
  169. package/richtexteditor/plugins/keyboarda11y.min.js +1 -1
  170. package/richtexteditor/plugins/layouttable.js +20 -0
  171. package/richtexteditor/plugins/layouttable.min.js +1 -1
  172. package/richtexteditor/plugins/linkchecker.js +29 -9
  173. package/richtexteditor/plugins/linkchecker.min.js +1 -1
  174. package/richtexteditor/plugins/localdraft.js +51 -7
  175. package/richtexteditor/plugins/localdraft.min.js +1 -1
  176. package/richtexteditor/plugins/markdownexport.js +159 -0
  177. package/richtexteditor/plugins/markdownexport.min.js +2 -2
  178. package/richtexteditor/plugins/mathdialog.js +11 -5
  179. package/richtexteditor/plugins/mathdialog.min.js +1 -1
  180. package/richtexteditor/plugins/mentionplugin.js +90 -27
  181. package/richtexteditor/plugins/mentionplugin.min.js +1 -1
  182. package/richtexteditor/plugins/mermaiddiagram.js +14 -8
  183. package/richtexteditor/plugins/mermaiddiagram.min.js +2 -2
  184. package/richtexteditor/plugins/multilevellist.js +4 -0
  185. package/richtexteditor/plugins/multilevellist.min.js +1 -1
  186. package/richtexteditor/plugins/nodetypes.js +1 -1
  187. package/richtexteditor/plugins/nodetypes.min.js +1 -1
  188. package/richtexteditor/plugins/pagination.js +2 -2
  189. package/richtexteditor/plugins/pagination.min.js +1 -1
  190. package/richtexteditor/plugins/pdfexport.js +1752 -1167
  191. package/richtexteditor/plugins/pdfexport.min.js +28 -13
  192. package/richtexteditor/plugins/permanentpen.js +3 -3
  193. package/richtexteditor/plugins/permanentpen.min.js +1 -1
  194. package/richtexteditor/plugins/readabilitystats.js +25 -11
  195. package/richtexteditor/plugins/readabilitystats.min.js +1 -1
  196. package/richtexteditor/plugins/readaloud.js +30 -16
  197. package/richtexteditor/plugins/readaloud.min.js +1 -1
  198. package/richtexteditor/plugins/restrictedediting.js +166 -0
  199. package/richtexteditor/plugins/restrictedediting.min.js +2 -2
  200. package/richtexteditor/plugins/revisionhistory.js +173 -41
  201. package/richtexteditor/plugins/revisionhistory.min.js +3 -3
  202. package/richtexteditor/plugins/rubyannotation.js +21 -11
  203. package/richtexteditor/plugins/rubyannotation.min.js +1 -1
  204. package/richtexteditor/plugins/sanitizer.js +119 -7
  205. package/richtexteditor/plugins/sanitizer.min.js +1 -1
  206. package/richtexteditor/plugins/slashcommand.js +32 -18
  207. package/richtexteditor/plugins/slashcommand.min.js +2 -2
  208. package/richtexteditor/plugins/smartchips.js +39 -25
  209. package/richtexteditor/plugins/smartchips.min.js +2 -2
  210. package/richtexteditor/plugins/spellcheck.js +20 -11
  211. package/richtexteditor/plugins/spellcheck.min.js +2 -2
  212. package/richtexteditor/plugins/stateinspector.js +21 -11
  213. package/richtexteditor/plugins/stateinspector.min.js +2 -2
  214. package/richtexteditor/plugins/structured-content-bridge.js +90 -32
  215. package/richtexteditor/plugins/structured-content-bridge.min.js +8 -8
  216. package/richtexteditor/plugins/tableofcontents.js +5 -2
  217. package/richtexteditor/plugins/tableofcontents.min.js +1 -1
  218. package/richtexteditor/plugins/tabletools.js +388 -3
  219. package/richtexteditor/plugins/tabletools.min.js +1 -1
  220. package/richtexteditor/plugins/textdirection.js +19 -6
  221. package/richtexteditor/plugins/textdirection.min.js +1 -1
  222. package/richtexteditor/plugins/textpartlanguage.js +161 -32
  223. package/richtexteditor/plugins/textpartlanguage.min.js +1 -1
  224. package/richtexteditor/plugins/todolist.js +90 -6
  225. package/richtexteditor/plugins/todolist.min.js +1 -1
  226. package/richtexteditor/plugins/trackedchanges.js +1812 -25
  227. package/richtexteditor/plugins/trackedchanges.min.js +5 -3
  228. package/richtexteditor/plugins/wordexport.js +2 -2
  229. package/richtexteditor/plugins/yjscollab.js +11 -6
  230. package/richtexteditor/plugins/yjscollab.min.js +1 -1
  231. package/richtexteditor/plugins/zz_richtextbox_dialog_style.js +22 -13
  232. package/richtexteditor/plugins/zz_richtextbox_dialog_style.min.js +1 -1
  233. package/richtexteditor/rte-config.js +144 -86
  234. package/richtexteditor/rte-headless.js +19 -4
  235. package/richtexteditor/rte-watchdog.js +3 -1
  236. package/richtexteditor/rte-webcomponent.js +91 -16
  237. package/richtexteditor/rte.js +146 -88
  238. package/richtexteditor/runtime/colorpicker_more_ns.htm +3 -1
  239. package/scripts/build-angular.mjs +97 -0
  240. package/svelte/index.d.ts +2 -1
  241. package/svelte/index.js +80 -9
  242. package/vue/index.js +130 -34
  243. package/angular/component.ts +0 -297
  244. package/angular/index.ts +0 -24
@@ -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";