@ckeditor/ckeditor5-track-changes 48.8.1-alpha.4 → 49.0.0-alpha.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.
Files changed (238) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/augmentation.d.ts +42 -42
  3. package/dist/commands/acceptsuggestioncommand.d.ts +19 -19
  4. package/dist/commands/discardsuggestioncommand.d.ts +19 -19
  5. package/dist/commands/executeonallsuggestionscommand.d.ts +19 -19
  6. package/dist/commands/executeonselectedsuggestionscommand.d.ts +19 -19
  7. package/dist/commands/previewfinalcontentcommand.d.ts +21 -21
  8. package/dist/commands/trackchangescommand.d.ts +21 -21
  9. package/dist/index-editor.css +20 -8
  10. package/dist/index.css +13 -1
  11. package/dist/index.d.ts +25 -23
  12. package/dist/index.js +4 -4
  13. package/dist/integrations/ai.d.ts +12 -12
  14. package/dist/integrations/aiassistant.d.ts +12 -12
  15. package/dist/integrations/aiquickactions.d.ts +12 -12
  16. package/dist/integrations/alignment.d.ts +12 -12
  17. package/dist/integrations/basicstyles.d.ts +12 -12
  18. package/dist/integrations/blockquote.d.ts +12 -12
  19. package/dist/integrations/bookmark.d.ts +12 -12
  20. package/dist/integrations/casechange.d.ts +12 -12
  21. package/dist/integrations/ckbox.d.ts +12 -12
  22. package/dist/integrations/clipboard.d.ts +30 -0
  23. package/dist/integrations/codeblock.d.ts +12 -12
  24. package/dist/integrations/comments.d.ts +9 -9
  25. package/dist/integrations/deletecommand.d.ts +12 -12
  26. package/dist/integrations/emoji.d.ts +12 -12
  27. package/dist/integrations/entercommand.d.ts +11 -11
  28. package/dist/integrations/findandreplace.d.ts +16 -16
  29. package/dist/integrations/font.d.ts +12 -12
  30. package/dist/integrations/footnotes.d.ts +12 -12
  31. package/dist/integrations/formatpainter.d.ts +12 -12
  32. package/dist/integrations/generalhtmlsupport.d.ts +29 -0
  33. package/dist/integrations/heading.d.ts +12 -12
  34. package/dist/integrations/highlight.d.ts +12 -12
  35. package/dist/integrations/horizontalline.d.ts +12 -12
  36. package/dist/integrations/htmlembed.d.ts +12 -12
  37. package/dist/integrations/image.d.ts +12 -12
  38. package/dist/integrations/imagereplace.d.ts +12 -12
  39. package/dist/integrations/imagestyle.d.ts +12 -12
  40. package/dist/integrations/importword.d.ts +13 -13
  41. package/dist/integrations/indent.d.ts +12 -12
  42. package/dist/integrations/inputcommand.d.ts +11 -11
  43. package/dist/integrations/legacylist.d.ts +12 -12
  44. package/dist/integrations/legacylistproperties.d.ts +24 -24
  45. package/dist/integrations/lineheight.d.ts +12 -12
  46. package/dist/integrations/link.d.ts +12 -12
  47. package/dist/integrations/list.d.ts +12 -12
  48. package/dist/integrations/listproperties.d.ts +15 -15
  49. package/dist/integrations/mediaembed.d.ts +12 -12
  50. package/dist/integrations/mediaembedstyle.d.ts +18 -0
  51. package/dist/integrations/mention.d.ts +12 -12
  52. package/dist/integrations/mergefields.d.ts +12 -12
  53. package/dist/integrations/multilevellist.d.ts +19 -19
  54. package/dist/integrations/pagebreak.d.ts +12 -12
  55. package/dist/integrations/paragraph.d.ts +12 -12
  56. package/dist/integrations/removeformat.d.ts +12 -12
  57. package/dist/integrations/replacesourcecommand.d.ts +13 -13
  58. package/dist/integrations/restrictededitingmode.d.ts +12 -12
  59. package/dist/integrations/shiftentercommand.d.ts +9 -9
  60. package/dist/integrations/standardeditingmode.d.ts +12 -12
  61. package/dist/integrations/style.d.ts +29 -12
  62. package/dist/integrations/table.d.ts +34 -34
  63. package/dist/integrations/tablecaption.d.ts +17 -17
  64. package/dist/integrations/tableclipboard.d.ts +15 -15
  65. package/dist/integrations/tablecolumnresize.d.ts +25 -21
  66. package/dist/integrations/tablefooters.d.ts +17 -17
  67. package/dist/integrations/tableheadings.d.ts +17 -17
  68. package/dist/integrations/tablelayout.d.ts +12 -12
  69. package/dist/integrations/tablemergesplit.d.ts +17 -17
  70. package/dist/integrations/tableofcontents.d.ts +12 -12
  71. package/dist/integrations/tableproperties.d.ts +30 -30
  72. package/dist/integrations/template.d.ts +12 -12
  73. package/dist/integrations/title.d.ts +12 -12
  74. package/dist/integrations/undo.d.ts +12 -12
  75. package/dist/integrations/uploadcare.d.ts +12 -12
  76. package/dist/integrations/utils.d.ts +8 -8
  77. package/dist/suggestion.d.ts +285 -283
  78. package/dist/suggestiondescriptionfactory.d.ts +165 -165
  79. package/dist/trackchanges.d.ts +178 -178
  80. package/dist/trackchangesconfig.d.ts +150 -103
  81. package/dist/trackchangesdata.d.ts +59 -59
  82. package/dist/trackchangesediting.d.ts +566 -563
  83. package/dist/trackchangespreview.d.ts +25 -26
  84. package/dist/trackchangesui.d.ts +52 -52
  85. package/dist/translations/af.js +1 -1
  86. package/dist/translations/af.umd.js +1 -1
  87. package/dist/translations/ar.js +1 -1
  88. package/dist/translations/ar.umd.js +1 -1
  89. package/dist/translations/ast.js +1 -1
  90. package/dist/translations/ast.umd.js +1 -1
  91. package/dist/translations/az.js +1 -1
  92. package/dist/translations/az.umd.js +1 -1
  93. package/dist/translations/be.js +1 -1
  94. package/dist/translations/be.umd.js +1 -1
  95. package/dist/translations/bg.js +1 -1
  96. package/dist/translations/bg.umd.js +1 -1
  97. package/dist/translations/bn.js +1 -1
  98. package/dist/translations/bn.umd.js +1 -1
  99. package/dist/translations/bs.js +1 -1
  100. package/dist/translations/bs.umd.js +1 -1
  101. package/dist/translations/ca.js +1 -1
  102. package/dist/translations/ca.umd.js +1 -1
  103. package/dist/translations/cs.js +1 -1
  104. package/dist/translations/cs.umd.js +1 -1
  105. package/dist/translations/da.js +1 -1
  106. package/dist/translations/da.umd.js +1 -1
  107. package/dist/translations/de-ch.js +1 -1
  108. package/dist/translations/de-ch.umd.js +1 -1
  109. package/dist/translations/de.js +1 -1
  110. package/dist/translations/de.umd.js +1 -1
  111. package/dist/translations/el.js +1 -1
  112. package/dist/translations/el.umd.js +1 -1
  113. package/dist/translations/en-au.js +1 -1
  114. package/dist/translations/en-au.umd.js +1 -1
  115. package/dist/translations/en-gb.js +1 -1
  116. package/dist/translations/en-gb.umd.js +1 -1
  117. package/dist/translations/en.js +1 -1
  118. package/dist/translations/en.umd.js +1 -1
  119. package/dist/translations/eo.js +1 -1
  120. package/dist/translations/eo.umd.js +1 -1
  121. package/dist/translations/es-co.js +1 -1
  122. package/dist/translations/es-co.umd.js +1 -1
  123. package/dist/translations/es.js +1 -1
  124. package/dist/translations/es.umd.js +1 -1
  125. package/dist/translations/et.js +1 -1
  126. package/dist/translations/et.umd.js +1 -1
  127. package/dist/translations/eu.js +1 -1
  128. package/dist/translations/eu.umd.js +1 -1
  129. package/dist/translations/fa.js +1 -1
  130. package/dist/translations/fa.umd.js +1 -1
  131. package/dist/translations/fi.js +1 -1
  132. package/dist/translations/fi.umd.js +1 -1
  133. package/dist/translations/fr.js +1 -1
  134. package/dist/translations/fr.umd.js +1 -1
  135. package/dist/translations/gl.js +1 -1
  136. package/dist/translations/gl.umd.js +1 -1
  137. package/dist/translations/gu.js +1 -1
  138. package/dist/translations/gu.umd.js +1 -1
  139. package/dist/translations/he.js +1 -1
  140. package/dist/translations/he.umd.js +1 -1
  141. package/dist/translations/hi.js +1 -1
  142. package/dist/translations/hi.umd.js +1 -1
  143. package/dist/translations/hr.js +1 -1
  144. package/dist/translations/hr.umd.js +1 -1
  145. package/dist/translations/hu.js +1 -1
  146. package/dist/translations/hu.umd.js +1 -1
  147. package/dist/translations/hy.js +1 -1
  148. package/dist/translations/hy.umd.js +1 -1
  149. package/dist/translations/id.js +1 -1
  150. package/dist/translations/id.umd.js +1 -1
  151. package/dist/translations/it.js +1 -1
  152. package/dist/translations/it.umd.js +1 -1
  153. package/dist/translations/ja.js +1 -1
  154. package/dist/translations/ja.umd.js +1 -1
  155. package/dist/translations/jv.js +1 -1
  156. package/dist/translations/jv.umd.js +1 -1
  157. package/dist/translations/kk.js +1 -1
  158. package/dist/translations/kk.umd.js +1 -1
  159. package/dist/translations/km.js +1 -1
  160. package/dist/translations/km.umd.js +1 -1
  161. package/dist/translations/kn.js +1 -1
  162. package/dist/translations/kn.umd.js +1 -1
  163. package/dist/translations/ko.js +1 -1
  164. package/dist/translations/ko.umd.js +1 -1
  165. package/dist/translations/ku.js +1 -1
  166. package/dist/translations/ku.umd.js +1 -1
  167. package/dist/translations/lt.js +1 -1
  168. package/dist/translations/lt.umd.js +1 -1
  169. package/dist/translations/lv.js +1 -1
  170. package/dist/translations/lv.umd.js +1 -1
  171. package/dist/translations/ms.js +1 -1
  172. package/dist/translations/ms.umd.js +1 -1
  173. package/dist/translations/nb.js +1 -1
  174. package/dist/translations/nb.umd.js +1 -1
  175. package/dist/translations/ne.js +1 -1
  176. package/dist/translations/ne.umd.js +1 -1
  177. package/dist/translations/nl.js +1 -1
  178. package/dist/translations/nl.umd.js +1 -1
  179. package/dist/translations/no.js +1 -1
  180. package/dist/translations/no.umd.js +1 -1
  181. package/dist/translations/oc.js +1 -1
  182. package/dist/translations/oc.umd.js +1 -1
  183. package/dist/translations/pl.js +1 -1
  184. package/dist/translations/pl.umd.js +1 -1
  185. package/dist/translations/pt-br.js +1 -1
  186. package/dist/translations/pt-br.umd.js +1 -1
  187. package/dist/translations/pt.js +1 -1
  188. package/dist/translations/pt.umd.js +1 -1
  189. package/dist/translations/ro.js +1 -1
  190. package/dist/translations/ro.umd.js +1 -1
  191. package/dist/translations/ru.js +1 -1
  192. package/dist/translations/ru.umd.js +1 -1
  193. package/dist/translations/si.js +1 -1
  194. package/dist/translations/si.umd.js +1 -1
  195. package/dist/translations/sk.js +1 -1
  196. package/dist/translations/sk.umd.js +1 -1
  197. package/dist/translations/sl.js +1 -1
  198. package/dist/translations/sl.umd.js +1 -1
  199. package/dist/translations/sq.js +1 -1
  200. package/dist/translations/sq.umd.js +1 -1
  201. package/dist/translations/sr-latn.js +1 -1
  202. package/dist/translations/sr-latn.umd.js +1 -1
  203. package/dist/translations/sr.js +1 -1
  204. package/dist/translations/sr.umd.js +1 -1
  205. package/dist/translations/sv.js +1 -1
  206. package/dist/translations/sv.umd.js +1 -1
  207. package/dist/translations/th.js +1 -1
  208. package/dist/translations/th.umd.js +1 -1
  209. package/dist/translations/ti.js +1 -1
  210. package/dist/translations/ti.umd.js +1 -1
  211. package/dist/translations/tk.js +1 -1
  212. package/dist/translations/tk.umd.js +1 -1
  213. package/dist/translations/tr.js +1 -1
  214. package/dist/translations/tr.umd.js +1 -1
  215. package/dist/translations/tt.js +1 -1
  216. package/dist/translations/tt.umd.js +1 -1
  217. package/dist/translations/ug.js +1 -1
  218. package/dist/translations/ug.umd.js +1 -1
  219. package/dist/translations/uk.js +1 -1
  220. package/dist/translations/uk.umd.js +1 -1
  221. package/dist/translations/ur.js +1 -1
  222. package/dist/translations/ur.umd.js +1 -1
  223. package/dist/translations/uz.js +1 -1
  224. package/dist/translations/uz.umd.js +1 -1
  225. package/dist/translations/vi.js +1 -1
  226. package/dist/translations/vi.umd.js +1 -1
  227. package/dist/translations/zh-cn.js +1 -1
  228. package/dist/translations/zh-cn.umd.js +1 -1
  229. package/dist/translations/zh.js +1 -1
  230. package/dist/translations/zh.umd.js +1 -1
  231. package/dist/ui/suggestioncontroller.d.ts +34 -33
  232. package/dist/ui/view/basesuggestionthreadview.d.ts +192 -191
  233. package/dist/ui/view/suggestionthreadview.d.ts +89 -89
  234. package/dist/ui/view/suggestionview.d.ts +220 -183
  235. package/dist/ui/view/trackchangespreviewview.d.ts +0 -4
  236. package/dist/utils/common-translations.d.ts +6 -6
  237. package/dist/utils/utils.d.ts +23 -23
  238. package/package.json +26 -26
@@ -1,574 +1,577 @@
1
1
  /**
2
- * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
- */
2
+ * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
4
+ */
5
5
  /**
6
- * @module track-changes/trackchangesediting
7
- * @publicApi
8
- */
9
- import { Plugin, PendingActions, type Editor } from '@ckeditor/ckeditor5-core';
10
- import { type ModelRange, type ModelElement } from '@ckeditor/ckeditor5-engine';
11
- import { Users, DocumentCompare, SuggestionsConversion } from '@ckeditor/ckeditor5-collaboration-core';
12
- import { CommentsRepository } from '@ckeditor/ckeditor5-comments';
13
- import { TrackChangesCommand } from './commands/trackchangescommand.js';
14
- import { Suggestion, type SuggestionJSON } from './suggestion.js';
15
- import { SuggestionDescriptionFactory } from './suggestiondescriptionfactory.js';
16
- import { TrackChangesAIAssistant } from './integrations/aiassistant.js';
17
- import { TrackChangesAI } from './integrations/ai.js';
18
- import { TrackChangesAIQuickActions } from './integrations/aiquickactions.js';
19
- import { TrackChangesAlignment } from './integrations/alignment.js';
20
- import { TrackChangesBasicStyles } from './integrations/basicstyles.js';
21
- import { TrackChangesBlockQuote } from './integrations/blockquote.js';
22
- import { TrackChangesBookmark } from './integrations/bookmark.js';
23
- import { TrackChangesCaseChange } from './integrations/casechange.js';
24
- import { TrackChangesCKBox } from './integrations/ckbox.js';
25
- import { TrackChangesCodeBlock } from './integrations/codeblock.js';
26
- import { TrackChangesComments } from './integrations/comments.js';
27
- import { TrackChangesDeleteCommand } from './integrations/deletecommand.js';
28
- import { TrackChangesList } from './integrations/list.js';
29
- import { TrackChangesDocumentListProperties } from './integrations/listproperties.js';
30
- import { TrackChangesEmoji } from './integrations/emoji.js';
31
- import { TrackChangesEnterCommand } from './integrations/entercommand.js';
32
- import { TrackChangesFindAndReplace } from './integrations/findandreplace.js';
33
- import { TrackChangesFont } from './integrations/font.js';
34
- import { TrackChangesFootnotes } from './integrations/footnotes.js';
35
- import { TrackChangesFormatPainter } from './integrations/formatpainter.js';
36
- import { TrackChangesHeading } from './integrations/heading.js';
37
- import { TrackChangesHighlight } from './integrations/highlight.js';
38
- import { TrackChangesHorizontalLine } from './integrations/horizontalline.js';
39
- import { TrackChangesHtmlEmbed } from './integrations/htmlembed.js';
40
- import { TrackChangesImage } from './integrations/image.js';
41
- import { TrackChangesImageReplace } from './integrations/imagereplace.js';
42
- import { TrackChangesImageStyle } from './integrations/imagestyle.js';
43
- import { TrackChangesImportWord } from './integrations/importword.js';
44
- import { TrackChangesIndent } from './integrations/indent.js';
45
- import { TrackChangesInputCommand } from './integrations/inputcommand.js';
46
- import { TrackChangesLink } from './integrations/link.js';
47
- import { TrackChangesLegacyList } from './integrations/legacylist.js';
48
- import { TrackChangesLegacyListProperties } from './integrations/legacylistproperties.js';
49
- import { TrackChangesMediaEmbed } from './integrations/mediaembed.js';
50
- import { TrackChangesMention } from './integrations/mention.js';
51
- import { TrackChangesMergeFields } from './integrations/mergefields.js';
52
- import { TrackChangesMultiLevelList } from './integrations/multilevellist.js';
53
- import { TrackChangesPageBreak } from './integrations/pagebreak.js';
54
- import { TrackChangesParagraph } from './integrations/paragraph.js';
55
- import { TrackChangesReplaceSourceCommand } from './integrations/replacesourcecommand.js';
56
- import { TrackChangesRemoveFormat } from './integrations/removeformat.js';
57
- import { TrackChangesRestrictedEditingMode } from './integrations/restrictededitingmode.js';
58
- import { TrackChangesShiftEnterCommand } from './integrations/shiftentercommand.js';
59
- import { TrackChangesStandardEditingMode } from './integrations/standardeditingmode.js';
60
- import { TrackChangesStylesDropdown } from './integrations/style.js';
61
- import { TrackChangesTable } from './integrations/table.js';
62
- import { TrackChangesTableMergeSplit } from './integrations/tablemergesplit.js';
63
- import { TrackChangesTableHeadings } from './integrations/tableheadings.js';
64
- import { TrackChangesTableFooters } from './integrations/tablefooters.js';
65
- import { TrackChangesTableLayout } from './integrations/tablelayout.js';
66
- import { TrackChangesTableClipboard } from './integrations/tableclipboard.js';
67
- import { TrackChangesTableColumnResize } from './integrations/tablecolumnresize.js';
68
- import { TrackChangesTemplate } from './integrations/template.js';
69
- import { TrackChangesTableOfContents } from './integrations/tableofcontents.js';
70
- import { TrackChangesTitle } from './integrations/title.js';
71
- import { TrackChangesUploadcare } from './integrations/uploadcare.js';
72
- import { TrackChangesUndo } from './integrations/undo.js';
73
- import { TrackChangesTableCaption } from './integrations/tablecaption.js';
74
- import { TrackChangesTableProperties } from './integrations/tableproperties.js';
75
- import { TrackChangesLineHeight } from './integrations/lineheight.js';
76
- import type { SuggestionData, TrackChangesAdapter } from './trackchanges.js';
6
+ * @module track-changes/trackchangesediting
7
+ * @publicApi
8
+ */
9
+ import { Plugin, PendingActions, type Editor, type PluginDependenciesOf } from "@ckeditor/ckeditor5-core";
10
+ import { type ModelRange, type ModelElement } from "@ckeditor/ckeditor5-engine";
11
+ import { Users, SuggestionsConversion } from "@ckeditor/ckeditor5-collaboration-core";
12
+ import { CommentsRepository } from "@ckeditor/ckeditor5-comments";
13
+ import { TrackChangesCommand } from "./commands/trackchangescommand.js";
14
+ import { Suggestion, type SuggestionJSON } from "./suggestion.js";
15
+ import { SuggestionDescriptionFactory } from "./suggestiondescriptionfactory.js";
16
+ import { TrackChangesAIAssistant } from "./integrations/aiassistant.js";
17
+ import { TrackChangesAI } from "./integrations/ai.js";
18
+ import { TrackChangesAIQuickActions } from "./integrations/aiquickactions.js";
19
+ import { TrackChangesAlignment } from "./integrations/alignment.js";
20
+ import { TrackChangesBasicStyles } from "./integrations/basicstyles.js";
21
+ import { TrackChangesBlockQuote } from "./integrations/blockquote.js";
22
+ import { TrackChangesBookmark } from "./integrations/bookmark.js";
23
+ import { TrackChangesCaseChange } from "./integrations/casechange.js";
24
+ import { TrackChangesCKBox } from "./integrations/ckbox.js";
25
+ import { TrackChangesClipboard } from "./integrations/clipboard.js";
26
+ import { TrackChangesCodeBlock } from "./integrations/codeblock.js";
27
+ import { TrackChangesComments } from "./integrations/comments.js";
28
+ import { TrackChangesDeleteCommand } from "./integrations/deletecommand.js";
29
+ import { TrackChangesList } from "./integrations/list.js";
30
+ import { TrackChangesDocumentListProperties } from "./integrations/listproperties.js";
31
+ import { TrackChangesEmoji } from "./integrations/emoji.js";
32
+ import { TrackChangesEnterCommand } from "./integrations/entercommand.js";
33
+ import { TrackChangesFindAndReplace } from "./integrations/findandreplace.js";
34
+ import { TrackChangesFont } from "./integrations/font.js";
35
+ import { TrackChangesFootnotes } from "./integrations/footnotes.js";
36
+ import { TrackChangesFormatPainter } from "./integrations/formatpainter.js";
37
+ import { TrackChangesGeneralHtmlSupport } from "./integrations/generalhtmlsupport.js";
38
+ import { TrackChangesHeading } from "./integrations/heading.js";
39
+ import { TrackChangesHighlight } from "./integrations/highlight.js";
40
+ import { TrackChangesHorizontalLine } from "./integrations/horizontalline.js";
41
+ import { TrackChangesHtmlEmbed } from "./integrations/htmlembed.js";
42
+ import { TrackChangesImage } from "./integrations/image.js";
43
+ import { TrackChangesImageReplace } from "./integrations/imagereplace.js";
44
+ import { TrackChangesImageStyle } from "./integrations/imagestyle.js";
45
+ import { TrackChangesImportWord } from "./integrations/importword.js";
46
+ import { TrackChangesIndent } from "./integrations/indent.js";
47
+ import { TrackChangesInputCommand } from "./integrations/inputcommand.js";
48
+ import { TrackChangesLink } from "./integrations/link.js";
49
+ import { TrackChangesLegacyList } from "./integrations/legacylist.js";
50
+ import { TrackChangesLegacyListProperties } from "./integrations/legacylistproperties.js";
51
+ import { TrackChangesMediaEmbed } from "./integrations/mediaembed.js";
52
+ import { TrackChangesMediaEmbedStyle } from "./integrations/mediaembedstyle.js";
53
+ import { TrackChangesMention } from "./integrations/mention.js";
54
+ import { TrackChangesMergeFields } from "./integrations/mergefields.js";
55
+ import { TrackChangesMultiLevelList } from "./integrations/multilevellist.js";
56
+ import { TrackChangesPageBreak } from "./integrations/pagebreak.js";
57
+ import { TrackChangesParagraph } from "./integrations/paragraph.js";
58
+ import { TrackChangesReplaceSourceCommand } from "./integrations/replacesourcecommand.js";
59
+ import { TrackChangesRemoveFormat } from "./integrations/removeformat.js";
60
+ import { TrackChangesRestrictedEditingMode } from "./integrations/restrictededitingmode.js";
61
+ import { TrackChangesShiftEnterCommand } from "./integrations/shiftentercommand.js";
62
+ import { TrackChangesStandardEditingMode } from "./integrations/standardeditingmode.js";
63
+ import { TrackChangesStylesDropdown } from "./integrations/style.js";
64
+ import { TrackChangesTable } from "./integrations/table.js";
65
+ import { TrackChangesTableMergeSplit } from "./integrations/tablemergesplit.js";
66
+ import { TrackChangesTableHeadings } from "./integrations/tableheadings.js";
67
+ import { TrackChangesTableFooters } from "./integrations/tablefooters.js";
68
+ import { TrackChangesTableLayout } from "./integrations/tablelayout.js";
69
+ import { TrackChangesTableClipboard } from "./integrations/tableclipboard.js";
70
+ import { TrackChangesTableColumnResize } from "./integrations/tablecolumnresize.js";
71
+ import { TrackChangesTemplate } from "./integrations/template.js";
72
+ import { TrackChangesTableOfContents } from "./integrations/tableofcontents.js";
73
+ import { TrackChangesTitle } from "./integrations/title.js";
74
+ import { TrackChangesUploadcare } from "./integrations/uploadcare.js";
75
+ import { TrackChangesUndo } from "./integrations/undo.js";
76
+ import { TrackChangesTableCaption } from "./integrations/tablecaption.js";
77
+ import { TrackChangesTableProperties } from "./integrations/tableproperties.js";
78
+ import { TrackChangesLineHeight } from "./integrations/lineheight.js";
79
+ import type { SuggestionData, TrackChangesAdapter } from "./trackchanges.js";
77
80
  /**
78
- * Provides editing part of the {@link module:track-changes/trackchanges~TrackChanges track changes plugin}.
79
- */
81
+ * Provides editing part of the {@link module:track-changes/trackchanges~TrackChanges track changes plugin}.
82
+ */
80
83
  export declare class TrackChangesEditing extends Plugin {
81
- /**
82
- * List of names of active (highlighted) markers.
83
- *
84
- * @observable
85
- */
86
- activeMarkers: Array<string>;
87
- /**
88
- * Descriptions factory which generates descriptions for the suggestions created by the track changes plugin.
89
- */
90
- descriptionFactory: SuggestionDescriptionFactory;
91
- /**
92
- * Reference to command that turns the track changes mode on and off.
93
- */
94
- trackChangesCommand: TrackChangesCommand;
95
- static get requires(): readonly [typeof CommentsRepository, typeof SuggestionsConversion, typeof Users, typeof PendingActions, typeof DocumentCompare, typeof TrackChangesAIAssistant, typeof TrackChangesAI, typeof TrackChangesAIQuickActions, typeof TrackChangesAlignment, typeof TrackChangesBasicStyles, typeof TrackChangesBlockQuote, typeof TrackChangesBookmark, typeof TrackChangesCKBox, typeof TrackChangesCaseChange, typeof TrackChangesCodeBlock, typeof TrackChangesComments, typeof TrackChangesDeleteCommand, typeof TrackChangesEmoji, typeof TrackChangesEnterCommand, typeof TrackChangesFindAndReplace, typeof TrackChangesFont, typeof TrackChangesFootnotes, typeof TrackChangesFormatPainter, typeof TrackChangesHeading, typeof TrackChangesHighlight, typeof TrackChangesHorizontalLine, typeof TrackChangesHtmlEmbed, typeof TrackChangesImage, typeof TrackChangesImageStyle, typeof TrackChangesImageReplace, typeof TrackChangesImportWord, typeof TrackChangesIndent, typeof TrackChangesInputCommand, typeof TrackChangesLegacyList, typeof TrackChangesLegacyListProperties, typeof TrackChangesMultiLevelList, typeof TrackChangesLink, typeof TrackChangesList, typeof TrackChangesLineHeight, typeof TrackChangesDocumentListProperties, typeof TrackChangesMediaEmbed, typeof TrackChangesMention, typeof TrackChangesMergeFields, typeof TrackChangesPageBreak, typeof TrackChangesParagraph, typeof TrackChangesReplaceSourceCommand, typeof TrackChangesRemoveFormat, typeof TrackChangesRestrictedEditingMode, typeof TrackChangesShiftEnterCommand, typeof TrackChangesStandardEditingMode, typeof TrackChangesStylesDropdown, typeof TrackChangesTable, typeof TrackChangesTableMergeSplit, typeof TrackChangesTableHeadings, typeof TrackChangesTableFooters, typeof TrackChangesTableLayout, typeof TrackChangesTableCaption, typeof TrackChangesTableClipboard, typeof TrackChangesTableColumnResize, typeof TrackChangesTableOfContents, typeof TrackChangesTableProperties, typeof TrackChangesTemplate, typeof TrackChangesTitle, typeof TrackChangesUploadcare, typeof TrackChangesUndo];
96
- static get pluginName(): "TrackChangesEditing";
97
- /**
98
- * @inheritDoc
99
- */
100
- static get isOfficialPlugin(): true;
101
- /**
102
- * @inheritDoc
103
- */
104
- static get isPremiumPlugin(): true;
105
- /**
106
- * @inheritDoc
107
- */
108
- constructor(editor: Editor);
109
- /**
110
- * @inheritDoc
111
- */
112
- init(): void;
113
- /**
114
- * @inheritDoc
115
- */
116
- afterInit(): void;
117
- /**
118
- * An adapter object that should communicate with the data source to fetch or save the suggestion data.
119
- */
120
- set adapter(adapter: TrackChangesAdapter | null);
121
- get adapter(): TrackChangesAdapter | null;
122
- getSuggestions(options?: {
123
- skipNotAttached?: boolean;
124
- toJSON?: false;
125
- }): Array<Suggestion>;
126
- getSuggestions(options: {
127
- skipNotAttached?: boolean;
128
- toJSON: true;
129
- }): Array<SuggestionJSON>;
130
- getSuggestions(options: {
131
- skipNotAttached?: boolean;
132
- toJSON: boolean;
133
- }): Array<Suggestion> | Array<SuggestionJSON>;
134
- /**
135
- * Returns {@link module:track-changes/suggestion~Suggestion suggestion} for given `id`.
136
- */
137
- getSuggestion(id: string): Suggestion;
138
- /**
139
- * Checks if {@link module:track-changes/suggestion~Suggestion suggestion} of given `id` exist.
140
- */
141
- hasSuggestion(id: string): boolean;
142
- /**
143
- * Adds suggestion data.
144
- */
145
- addSuggestionData(data: SuggestionData): Suggestion;
146
- /**
147
- * Accept all adjacent suggestions.
148
- */
149
- acceptSuggestion(suggestion: Suggestion): void;
150
- /**
151
- * Discard all adjacent suggestions.
152
- */
153
- discardSuggestion(suggestion: Suggestion): void;
154
- /**
155
- * Enables command with given `commandName` in track changes mode.
156
- *
157
- * When a command gets enabled in track changes mode, its original `execute()` method is overwritten by provided `callback()`
158
- * function. The `callback()` should provide alternative logic to be executed instead.
159
- *
160
- * The `callback()` function is passed one or more parameters:
161
- *
162
- * * the first parameter is `executeCommand()`, a function that upon calling will fire the original `execute()` method,
163
- * * then, all the parameters passed to original `execute()` call are passed.
164
- *
165
- * Using those parameters it is possible to call the original command in the `callback()` (or skip it) and also do
166
- * something before and/or after that call.
167
- *
168
- * If `callback` is not set then the command will work the same both when track changes is on and off.
169
- *
170
- * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
171
- * features} guide to learn more about enabling your feature in the suggestion mode.
172
- */
173
- enableCommand(commandName: string, callback?: Function): void;
174
- /**
175
- * Temporarily disable track changes to accept or discard a suggestion without intercepting original calls.
176
- */
177
- forceDefaultExecution(callback: Function): unknown;
178
- /**
179
- * Marks a single-range insertion suggestion on the given `range`.
180
- *
181
- * It is expected that given `range` is a range on just-created content and does not intersect with any other suggestion ranges.
182
- *
183
- * ```ts
184
- * trackChangesPlugin.markInsertion( insertionRange );
185
- * trackChangesPlugin.markInsertion( insertionRange, 'customInsertion' );
186
- * ```
187
- *
188
- * This method should be used in `callback()` in
189
- * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
190
- * to inform the track changes plugin about a suggestion that happened.
191
- *
192
- * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
193
- * this method are bound with one undo step.
194
- *
195
- * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
196
- * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
197
- * the existing suggestion).
198
- *
199
- * See {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
200
- * features guide} to learn more about enabling your feature in the suggestion mode.
201
- *
202
- * @param range Range on content which got inserted.
203
- * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. If not set,
204
- * suggestion will be a generic insertion suggestion. Only suggestions with the same sub type will be joined.
205
- * @param attributes Custom suggestion attributes.
206
- * @returns Suggestion created or expanded as a result of execution of this
207
- * method. Returns `null` if given `range` was collapsed (so no suggestion was created or expanded).
208
- */
209
- markInsertion(range: ModelRange, subType?: string | null, attributes?: Record<string, unknown>): Suggestion | null;
210
- /**
211
- * Marks a multi-range insertion suggestion spanning over given `ranges`.
212
- *
213
- * It is expected that given `ranges` are ranges on just-created content and do not intersect with any other suggestion ranges.
214
- *
215
- * Each range of a multi-range insertion suggestion should contain exactly one element and should not be created on a text content.
216
- *
217
- * ```ts
218
- * trackChangesPlugin.markMultiRangeInsertion( insertionRanges );
219
- * trackChangesPlugin.markMultiRangeInsertion( insertionRanges, 'customInsertion' );
220
- * ```
221
- *
222
- * This method should be used in `callback()` in
223
- * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
224
- * to inform the track changes plugin about a suggestion that happened.
225
- *
226
- * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
227
- * this method are bound with one undo step.
228
- *
229
- * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
230
- * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
231
- * the existing suggestion).
232
- *
233
- * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
234
- * features} guide to learn more about enabling your feature in the suggestion mode.
235
- *
236
- * @param ranges Ranges which got inserted.
237
- * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. Only suggestions
238
- * with the same subtype will be joined.
239
- * @param attributes Custom suggestion attributes.
240
- * @returns {module:track-changes/suggestion~Suggestion} Suggestion created or expanded as a result of execution of this method.
241
- */
242
- markMultiRangeInsertion(ranges: Array<ModelRange>, subType?: string, attributes?: Record<string, unknown>): Suggestion;
243
- /**
244
- * Marks an inline format suggestion on the given `range`.
245
- *
246
- * This type of format suggestion is suitable for formatting (attribute) changes on inline elements and text.
247
- * Changes like adding bold or setting a link use this type of format suggestion.
248
- *
249
- * Inline format suggestions are directly coupled with editor commands and represent a command execution on given `range`.
250
- *
251
- * ```ts
252
- * trackChangesPlugin.markInlineFormat( formattedRange, {
253
- * commandName: 'bold',
254
- * commandParams: [ { forceValue: true } ]
255
- * } );
256
- *
257
- * trackChangesPlugin.markInlineFormat( formattedRange, formatData, 'customSubType' );
258
- * ```
259
- *
260
- * This method should be used in `callback()` in
261
- * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
262
- * to inform the track changes plugin about a suggestion that happened.
263
- *
264
- * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
265
- * this method are bound with one undo step.
266
- *
267
- * When a format suggestion is accepted the command is executed based on parameters passed in `formatData`.
268
- *
269
- * If an inline format suggestion is marked inside the local user's insertion suggestion, the change is applied directly
270
- * and no suggestion is created. This supports partial intersections with insertion suggestions.
271
- *
272
- * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
273
- * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
274
- * the existing suggestion).
275
- *
276
- * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
277
- * features} guide to learn more about enabling your feature in the suggestion mode.
278
- *
279
- * @param range Range on which the change happened.
280
- * @param formatData Command parameters.
281
- * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. If not set
282
- * (which is the default and recommended use) the sub type value is a string hash generated from `formatData`. This guarantees that
283
- * all inline format suggestions that perform the same changes have the same sub type (and can be properly handled).
284
- * @param attributes Custom suggestion attributes.
285
- */
286
- markInlineFormat(range: ModelRange, formatData: SuggestionFormatData, subType?: string | null, attributes?: Record<string, unknown>): null;
287
- /**
288
- * Marks a block format suggestion on the given `range`.
289
- *
290
- * Block format suggestions are directly coupled with editor commands and represent a command execution on the given range or element.
291
- *
292
- * This type of format suggestion is suitable for formatting (attribute) changes on block elements.
293
- * Changes like resizing image, applying block quote or changing header type use this type of format suggestion.
294
- *
295
- * Pass element if the suggestion should be marked exactly on that element. This is suitable if the command modifies exactly given
296
- * element (for example, changes an attribute of that element). If such element is split, an additional suggestion is
297
- * created for the new element:
298
- *
299
- * [<paragraph>Foobar]</paragraph> --> [<paragraph>Foo]</paragraph>[<paragraph>bar]</paragraph>
300
- *
301
- * Pass range for suggestions representing commands that can be executed on multiple blocks at once. This is suitable for commands
302
- * which modifies all the block elements found in given range (those commands usually operate on selection ranges). This creates
303
- * only one suggestion for the whole range and do not create additional suggestions if blocks in the range are split:
304
- *
305
- * [<paragraph>Foobar]</paragraph> --> [<paragraph>Foo</paragraph><paragraph>Bar]</paragraph>
306
- *
307
- * Example of marking block format suggestion on an element:
308
- *
309
- * ```ts
310
- * trackChangesPlugin.markBlockFormat( paragraphElement, {
311
- * commandName: 'heading',
312
- * commandParams: [ { value: 'heading1' } ],
313
- * formatGroupId: 'blockName'
314
- * } );
315
- * ```
316
- *
317
- * Example of marking block format suggestion on a range:
318
- *
319
- * ```ts
320
- * plugin.markBlockFormat( selectionRange, {
321
- * commandName: 'blockQuote',
322
- * commandParams: [ { forceValue: true } ]
323
- * } );
324
- * ```
325
- *
326
- * If you pass a range, it should start before the first element to change and end:
327
- *
328
- * * for blocks (like paragraph, list item, heading, etc.): at the end of the last element to change,
329
- * * for objects (like image, table, media embed, etc.): after the last element to change.
330
- *
331
- * ```xml
332
- * [<paragraph>Foo</paragraph><paragraph>Bar]</paragraph><paragraph>Xyz</paragraph>
333
- * [<paragraph>Foo</paragraph><imageBlock src="foo.jpg"></imageBlock>]<paragraph>Xyz</paragraph>
334
- * ```
335
- *
336
- * This method should be used in `callback()` in
337
- * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
338
- * to inform the track changes plugin about a suggestion that happened.
339
- *
340
- * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
341
- * this method are bound with one undo step.
342
- *
343
- * When a format suggestion is accepted the command is executed based on parameters passed in `formatData`.
344
- *
345
- * If a block format suggestion is marked inside the local user's insertion suggestion, the change is applied directly
346
- * and no suggestion is created. Note that this does not support partial intersections with insertion suggestions
347
- * (as opposed to inline format suggestions).
348
- *
349
- * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
350
- * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
351
- * the existing suggestion).
352
- *
353
- * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
354
- * features} guide to learn more about enabling your feature in the suggestion mode.
355
- *
356
- * @param elementOrRange Element or range on which the change happened.
357
- * @param formatData Command parameters and additional suggestion parameters.
358
- * @param affectedElements Elements (other than `elementOrRange`) that are
359
- * also affected by the command execution. This parameter is used when the effect of the command execution is larger than
360
- * `elementOrRange`. It is used when determining whether the change should be applied directly or if the suggestion should be created.
361
- * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. If not set
362
- * (which is the default and recommended use) the sub type value is a string hash generated from `formatData`. This guarantees that
363
- * all block format suggestions that perform the same changes have the same sub types (and can be properly handled).
364
- * @param attributes Custom suggestion attributes.
365
- */
366
- markBlockFormat(elementOrRange: ModelElement | ModelRange, formatData: SuggestionFormatData, affectedElements?: Array<ModelElement>, subType?: string | null, attributes?: Record<string, unknown>): Suggestion | null;
367
- /**
368
- * Marks a multi-range block format suggestion on given `elements`.
369
- *
370
- * See {@link module:track-changes/trackchangesediting~TrackChangesEditing#markBlockFormat `TrackChangesEditing#markBlockFormat()`}
371
- * to learn more about block format suggestions. Note that this method can be used only on elements (not on ranges).
372
- *
373
- * This method is useful for creating a format suggestion on multiple elements which are not siblings, so one range cannot be used.
374
- *
375
- * This method should be used in `callback()` in
376
- * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
377
- * to inform the track changes plugin about a suggestion that happened.
378
- *
379
- * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
380
- * this method are bound with one undo step.
381
- *
382
- * When a format suggestion is accepted the command is executed based on parameters passed in `formatData`.
383
- *
384
- * If a block format suggestion is marked inside the local user's insertion suggestion, the change is applied directly
385
- * and no suggestion is created. Note that this does not support partial intersections with insertion suggestions
386
- * (as opposed to inline format suggestions).
387
- *
388
- * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
389
- * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
390
- * the existing suggestion).
391
- *
392
- * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
393
- * features} guide to learn more about enabling your feature in the suggestion mode.
394
- *
395
- * @param elementsOrRanges Elements or ranges
396
- * on which the change happened.
397
- * @param formatData Command parameters and additional suggestion parameters.
398
- * @param affectedElements Elements (other than `elementOrRange`) that are
399
- * also affected by the command execution. This parameter is used when the effect of the command execution is larger than
400
- * `elementOrRange`. It is used when determining whether the change should be applied directly or if the suggestion should be created.
401
- * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. If not set
402
- * (which is the default and recommended use) the sub type value is a string hash generated from `formatData`. This guarantees that
403
- * all block format suggestions that perform the same changes have the same sub types (and can be properly handled).
404
- * @param attributes Custom suggestion attributes.
405
- */
406
- markMultiRangeBlockFormat(elementsOrRanges: Array<ModelElement> | Array<ModelRange>, formatData: SuggestionFormatData, affectedElements?: Array<ModelElement>, subType?: string | null, attributes?: Record<string, unknown>): Suggestion | null;
407
- /**
408
- * Marks a single-range deletion suggestion on given `range`.
409
- *
410
- * If the `range` to mark intersects with or contains insertion suggestions created by the local user,
411
- * those suggestions may be removed in a part or in the whole together with their content.
412
- *
413
- * ```ts
414
- * trackChangesPlugin.markDeletion( deletedRange );
415
- * trackChangesPlugin.markDeletion( deletedRange, 'customDeletion' );
416
- * ```
417
- *
418
- * This method should be used in `callback()` in
419
- * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
420
- * to inform the track changes plugin about a suggestion that happened.
421
- *
422
- * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
423
- * this method are bound with one undo step.
424
- *
425
- * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
426
- * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
427
- * the existing suggestion).
428
- *
429
- * See {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
430
- * features guide} to learn more about enabling your feature in the suggestion mode.
431
- *
432
- * @param range Range which should be marked as deletion suggestion.
433
- * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. If not set,
434
- * suggestion will be a generic insertion suggestion. Only suggestions with the same sub type will be joined.
435
- * @param attributes Custom suggestion attributes.
436
- * @returns Suggestion created or expanded as a result of execution of this
437
- * method. Returns `null` if given `range` was collapsed or the deletion was in insertion (so no suggestion was created or expanded).
438
- */
439
- markDeletion(range: ModelRange, subType?: string | null, attributes?: Record<string, unknown>): Suggestion | null;
440
- /**
441
- * Marks a multi-range deletion suggestion spanning over given `ranges`.
442
- *
443
- * Each range of a multi-range deletion suggestion should contain exactly one element and should not be created on a text content.
444
- *
445
- * If the `ranges` to mark contain or are contained in insertion suggestions created by the local user, those
446
- * insertion suggestions may be removed together with their content.
447
- *
448
- * ```ts
449
- * trackChangesPlugin.markMultiRangeDeletion( deletedRanges );
450
- * trackChangesPlugin.markMultiRangeDeletion( deletedRanges, 'customDeletion' );
451
- * ```
452
- *
453
- * This method should be used in `callback()` in
454
- * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
455
- * to inform the track changes plugin about a suggestion that happened.
456
- *
457
- * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
458
- * this method are bound with one undo step.
459
- *
460
- * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
461
- * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
462
- * the existing suggestion).
463
- *
464
- * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
465
- * features} guide to learn more about enabling your feature in the suggestion mode.
466
- *
467
- * @param ranges Ranges which should be marked as deletion suggestion.
468
- * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set.
469
- * Only suggestions with the same sub type will be joined.
470
- * @param attributes Custom suggestion attributes.
471
- * @returns Suggestion created or expanded as a result of execution of this method.
472
- */
473
- markMultiRangeDeletion(ranges: Array<ModelRange>, subType?: string, attributes?: Record<string, unknown>): Suggestion | null;
474
- /**
475
- * Marks a single-range attribute suggestion on the given `range`.
476
- *
477
- * Note: all nodes in the given `range` must have the same current value of `key` attribute.
478
- *
479
- * Note: if a block attribute is marked, `range` should include only a single model element.
480
- *
481
- * `attributes` is a required value and must include `groupId: string` property. The group id is used to group attribute suggestions
482
- * together. All suggestions with the same `groupId` will be put into one suggestion chain. By default, all attribute suggestions
483
- * created during the same batch have the same `groupId`.
484
- *
485
- * It's possible that more than one suggestion will be created by this method if there are already suggestions with the same
486
- * `key` but a different `oldValue` intersecting with the given `range`.
487
- *
488
- * It is guaranteed that there will be no "conflicting" suggestions, that is, there will be no two intersecting suggestions for
489
- * the same attribute `key`. If there is a conflicting suggestion, it will be partially or fully replaced by a new suggestion.
490
- *
491
- * This method should be used in `callback()` in
492
- * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
493
- * to inform the track changes plugin about a suggestion that happened.
494
- *
495
- * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
496
- * this method are bound with one undo step.
497
- *
498
- * See {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
499
- * features guide} to learn more about enabling your feature in the suggestion mode.
500
- *
501
- * @param range Range for which the attribute has changed.
502
- * @param key Key of the attribute that changed.
503
- * @param oldValue Previous value of the attribute.
504
- * @param newValue New value of the attribute.
505
- * @param attributes Suggestion attributes. Must include `groupId`.
506
- */
507
- markAttributeChange(range: ModelRange, key: string, oldValue: unknown, newValue: unknown, attributes: {
508
- groupId: string;
509
- [key: string]: any;
510
- }): Array<Suggestion>;
511
- /**
512
- * Enables default attributes suggestions integration for given command.
513
- *
514
- * @param commandName Name of the command to integrate.
515
- */
516
- enableDefaultAttributesIntegration(commandName: string): void;
517
- /**
518
- * Starts a new tracking session, stopping all newly created suggestions from being joined with the previously existing ones,
519
- * even if they meet the merging criteria. It returns an id that can be later used to continue the session by calling this method
520
- * with said id as an argument.
521
- */
522
- startTrackingSession(id?: string | null): string | null;
523
- /**
524
- * Executes given callback and then finds all attribute and rename changes that have been made during that callback. For all these
525
- * changes, creates proper attribute suggestions. Additionally cleans up existing, conflicting attribute suggestions if they intersect
526
- * with the newly created suggestions.
527
- *
528
- * @param callback Function to call and check for attribute and rename changes. Usually this executes an editor command.
529
- */
530
- recordAttributeChanges(callback: () => void): void;
84
+ /**
85
+ * List of names of active (highlighted) markers.
86
+ *
87
+ * @observable
88
+ */
89
+ activeMarkers: Array<string>;
90
+ /**
91
+ * Descriptions factory which generates descriptions for the suggestions created by the track changes plugin.
92
+ */
93
+ descriptionFactory: SuggestionDescriptionFactory;
94
+ /**
95
+ * Reference to command that turns the track changes mode on and off.
96
+ */
97
+ trackChangesCommand: TrackChangesCommand;
98
+ static get requires(): PluginDependenciesOf<[CommentsRepository, SuggestionsConversion, Users, PendingActions, TrackChangesAIAssistant, TrackChangesAI, TrackChangesAIQuickActions, TrackChangesAlignment, TrackChangesBasicStyles, TrackChangesBlockQuote, TrackChangesBookmark, TrackChangesCKBox, TrackChangesCaseChange, TrackChangesClipboard, TrackChangesCodeBlock, TrackChangesComments, TrackChangesDeleteCommand, TrackChangesEmoji, TrackChangesEnterCommand, TrackChangesFindAndReplace, TrackChangesFont, TrackChangesFootnotes, TrackChangesFormatPainter, TrackChangesGeneralHtmlSupport, TrackChangesHeading, TrackChangesHighlight, TrackChangesHorizontalLine, TrackChangesHtmlEmbed, TrackChangesImage, TrackChangesImageStyle, TrackChangesImageReplace, TrackChangesImportWord, TrackChangesIndent, TrackChangesInputCommand, TrackChangesLegacyList, TrackChangesLegacyListProperties, TrackChangesMultiLevelList, TrackChangesLink, TrackChangesList, TrackChangesLineHeight, TrackChangesDocumentListProperties, TrackChangesMediaEmbed, TrackChangesMediaEmbedStyle, TrackChangesMention, TrackChangesMergeFields, TrackChangesPageBreak, TrackChangesParagraph, TrackChangesReplaceSourceCommand, TrackChangesRemoveFormat, TrackChangesRestrictedEditingMode, TrackChangesShiftEnterCommand, TrackChangesStandardEditingMode, TrackChangesStylesDropdown, TrackChangesTable, TrackChangesTableMergeSplit, TrackChangesTableHeadings, TrackChangesTableFooters, TrackChangesTableLayout, TrackChangesTableCaption, TrackChangesTableClipboard, TrackChangesTableColumnResize, TrackChangesTableOfContents, TrackChangesTableProperties, TrackChangesTemplate, TrackChangesTitle, TrackChangesUploadcare, TrackChangesUndo]>;
99
+ static get pluginName(): "TrackChangesEditing";
100
+ /**
101
+ * @inheritDoc
102
+ */
103
+ static override get isOfficialPlugin(): true;
104
+ /**
105
+ * @inheritDoc
106
+ */
107
+ static override get isPremiumPlugin(): true;
108
+ /**
109
+ * @inheritDoc
110
+ */
111
+ constructor(editor: Editor);
112
+ /**
113
+ * @inheritDoc
114
+ */
115
+ init(): void;
116
+ /**
117
+ * @inheritDoc
118
+ */
119
+ afterInit(): void;
120
+ /**
121
+ * An adapter object that should communicate with the data source to fetch or save the suggestion data.
122
+ */
123
+ set adapter(adapter: TrackChangesAdapter | null);
124
+ get adapter(): TrackChangesAdapter | null;
125
+ getSuggestions(options?: {
126
+ skipNotAttached?: boolean;
127
+ toJSON?: false;
128
+ }): Array<Suggestion>;
129
+ getSuggestions(options: {
130
+ skipNotAttached?: boolean;
131
+ toJSON: true;
132
+ }): Array<SuggestionJSON>;
133
+ getSuggestions(options: {
134
+ skipNotAttached?: boolean;
135
+ toJSON: boolean;
136
+ }): Array<Suggestion> | Array<SuggestionJSON>;
137
+ /**
138
+ * Returns {@link module:track-changes/suggestion~Suggestion suggestion} for given `id`.
139
+ */
140
+ getSuggestion(id: string): Suggestion;
141
+ /**
142
+ * Checks if {@link module:track-changes/suggestion~Suggestion suggestion} of given `id` exist.
143
+ */
144
+ hasSuggestion(id: string): boolean;
145
+ /**
146
+ * Adds suggestion data.
147
+ */
148
+ addSuggestionData(data: SuggestionData): Suggestion;
149
+ /**
150
+ * Accept all adjacent suggestions.
151
+ */
152
+ acceptSuggestion(suggestion: Suggestion): void;
153
+ /**
154
+ * Discard all adjacent suggestions.
155
+ */
156
+ discardSuggestion(suggestion: Suggestion): void;
157
+ /**
158
+ * Enables command with given `commandName` in track changes mode.
159
+ *
160
+ * When a command gets enabled in track changes mode, its original `execute()` method is overwritten by provided `callback()`
161
+ * function. The `callback()` should provide alternative logic to be executed instead.
162
+ *
163
+ * The `callback()` function is passed one or more parameters:
164
+ *
165
+ * * the first parameter is `executeCommand()`, a function that upon calling will fire the original `execute()` method,
166
+ * * then, all the parameters passed to original `execute()` call are passed.
167
+ *
168
+ * Using those parameters it is possible to call the original command in the `callback()` (or skip it) and also do
169
+ * something before and/or after that call.
170
+ *
171
+ * If `callback` is not set then the command will work the same both when track changes is on and off.
172
+ *
173
+ * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
174
+ * features} guide to learn more about enabling your feature in the suggestion mode.
175
+ */
176
+ enableCommand(commandName: string, callback?: Function): void;
177
+ /**
178
+ * Temporarily disable track changes to accept or discard a suggestion without intercepting original calls.
179
+ */
180
+ forceDefaultExecution(callback: Function): unknown;
181
+ /**
182
+ * Marks a single-range insertion suggestion on the given `range`.
183
+ *
184
+ * It is expected that given `range` is a range on just-created content and does not intersect with any other suggestion ranges.
185
+ *
186
+ * ```ts
187
+ * trackChangesPlugin.markInsertion( insertionRange );
188
+ * trackChangesPlugin.markInsertion( insertionRange, 'customInsertion' );
189
+ * ```
190
+ *
191
+ * This method should be used in `callback()` in
192
+ * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
193
+ * to inform the track changes plugin about a suggestion that happened.
194
+ *
195
+ * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
196
+ * this method are bound with one undo step.
197
+ *
198
+ * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
199
+ * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
200
+ * the existing suggestion).
201
+ *
202
+ * See {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
203
+ * features guide} to learn more about enabling your feature in the suggestion mode.
204
+ *
205
+ * @param range Range on content which got inserted.
206
+ * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. If not set,
207
+ * suggestion will be a generic insertion suggestion. Only suggestions with the same sub type will be joined.
208
+ * @param attributes Custom suggestion attributes.
209
+ * @returns Suggestion created or expanded as a result of execution of this
210
+ * method. Returns `null` if given `range` was collapsed (so no suggestion was created or expanded).
211
+ */
212
+ markInsertion(range: ModelRange, subType?: string | null, attributes?: Record<string, unknown>): Suggestion | null;
213
+ /**
214
+ * Marks a multi-range insertion suggestion spanning over given `ranges`.
215
+ *
216
+ * It is expected that given `ranges` are ranges on just-created content and do not intersect with any other suggestion ranges.
217
+ *
218
+ * Each range of a multi-range insertion suggestion should contain exactly one element and should not be created on a text content.
219
+ *
220
+ * ```ts
221
+ * trackChangesPlugin.markMultiRangeInsertion( insertionRanges );
222
+ * trackChangesPlugin.markMultiRangeInsertion( insertionRanges, 'customInsertion' );
223
+ * ```
224
+ *
225
+ * This method should be used in `callback()` in
226
+ * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
227
+ * to inform the track changes plugin about a suggestion that happened.
228
+ *
229
+ * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
230
+ * this method are bound with one undo step.
231
+ *
232
+ * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
233
+ * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
234
+ * the existing suggestion).
235
+ *
236
+ * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
237
+ * features} guide to learn more about enabling your feature in the suggestion mode.
238
+ *
239
+ * @param ranges Ranges which got inserted.
240
+ * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. Only suggestions
241
+ * with the same subtype will be joined.
242
+ * @param attributes Custom suggestion attributes.
243
+ * @returns {module:track-changes/suggestion~Suggestion} Suggestion created or expanded as a result of execution of this method.
244
+ */
245
+ markMultiRangeInsertion(ranges: Array<ModelRange>, subType?: string, attributes?: Record<string, unknown>): Suggestion;
246
+ /**
247
+ * Marks an inline format suggestion on the given `range`.
248
+ *
249
+ * This type of format suggestion is suitable for formatting (attribute) changes on inline elements and text.
250
+ * Changes like adding bold or setting a link use this type of format suggestion.
251
+ *
252
+ * Inline format suggestions are directly coupled with editor commands and represent a command execution on given `range`.
253
+ *
254
+ * ```ts
255
+ * trackChangesPlugin.markInlineFormat( formattedRange, {
256
+ * commandName: 'bold',
257
+ * commandParams: [ { forceValue: true } ]
258
+ * } );
259
+ *
260
+ * trackChangesPlugin.markInlineFormat( formattedRange, formatData, 'customSubType' );
261
+ * ```
262
+ *
263
+ * This method should be used in `callback()` in
264
+ * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
265
+ * to inform the track changes plugin about a suggestion that happened.
266
+ *
267
+ * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
268
+ * this method are bound with one undo step.
269
+ *
270
+ * When a format suggestion is accepted the command is executed based on parameters passed in `formatData`.
271
+ *
272
+ * If an inline format suggestion is marked inside the local user's insertion suggestion, the change is applied directly
273
+ * and no suggestion is created. This supports partial intersections with insertion suggestions.
274
+ *
275
+ * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
276
+ * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
277
+ * the existing suggestion).
278
+ *
279
+ * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
280
+ * features} guide to learn more about enabling your feature in the suggestion mode.
281
+ *
282
+ * @param range Range on which the change happened.
283
+ * @param formatData Command parameters.
284
+ * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. If not set
285
+ * (which is the default and recommended use) the sub type value is a string hash generated from `formatData`. This guarantees that
286
+ * all inline format suggestions that perform the same changes have the same sub type (and can be properly handled).
287
+ * @param attributes Custom suggestion attributes.
288
+ */
289
+ markInlineFormat(range: ModelRange, formatData: SuggestionFormatData, subType?: string | null, attributes?: Record<string, unknown>): null;
290
+ /**
291
+ * Marks a block format suggestion on the given `range`.
292
+ *
293
+ * Block format suggestions are directly coupled with editor commands and represent a command execution on the given range or element.
294
+ *
295
+ * This type of format suggestion is suitable for formatting (attribute) changes on block elements.
296
+ * Changes like resizing image, applying block quote or changing header type use this type of format suggestion.
297
+ *
298
+ * Pass element if the suggestion should be marked exactly on that element. This is suitable if the command modifies exactly given
299
+ * element (for example, changes an attribute of that element). If such element is split, an additional suggestion is
300
+ * created for the new element:
301
+ *
302
+ * [<paragraph>Foobar]</paragraph> --> [<paragraph>Foo]</paragraph>[<paragraph>bar]</paragraph>
303
+ *
304
+ * Pass range for suggestions representing commands that can be executed on multiple blocks at once. This is suitable for commands
305
+ * which modifies all the block elements found in given range (those commands usually operate on selection ranges). This creates
306
+ * only one suggestion for the whole range and do not create additional suggestions if blocks in the range are split:
307
+ *
308
+ * [<paragraph>Foobar]</paragraph> --> [<paragraph>Foo</paragraph><paragraph>Bar]</paragraph>
309
+ *
310
+ * Example of marking block format suggestion on an element:
311
+ *
312
+ * ```ts
313
+ * trackChangesPlugin.markBlockFormat( paragraphElement, {
314
+ * commandName: 'heading',
315
+ * commandParams: [ { value: 'heading1' } ],
316
+ * formatGroupId: 'blockName'
317
+ * } );
318
+ * ```
319
+ *
320
+ * Example of marking block format suggestion on a range:
321
+ *
322
+ * ```ts
323
+ * plugin.markBlockFormat( selectionRange, {
324
+ * commandName: 'blockQuote',
325
+ * commandParams: [ { forceValue: true } ]
326
+ * } );
327
+ * ```
328
+ *
329
+ * If you pass a range, it should start before the first element to change and end:
330
+ *
331
+ * * for blocks (like paragraph, list item, heading, etc.): at the end of the last element to change,
332
+ * * for objects (like image, table, media embed, etc.): after the last element to change.
333
+ *
334
+ * ```xml
335
+ * [<paragraph>Foo</paragraph><paragraph>Bar]</paragraph><paragraph>Xyz</paragraph>
336
+ * [<paragraph>Foo</paragraph><imageBlock src="foo.jpg"></imageBlock>]<paragraph>Xyz</paragraph>
337
+ * ```
338
+ *
339
+ * This method should be used in `callback()` in
340
+ * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
341
+ * to inform the track changes plugin about a suggestion that happened.
342
+ *
343
+ * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
344
+ * this method are bound with one undo step.
345
+ *
346
+ * When a format suggestion is accepted the command is executed based on parameters passed in `formatData`.
347
+ *
348
+ * If a block format suggestion is marked inside the local user's insertion suggestion, the change is applied directly
349
+ * and no suggestion is created. Note that this does not support partial intersections with insertion suggestions
350
+ * (as opposed to inline format suggestions).
351
+ *
352
+ * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
353
+ * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
354
+ * the existing suggestion).
355
+ *
356
+ * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
357
+ * features} guide to learn more about enabling your feature in the suggestion mode.
358
+ *
359
+ * @param elementOrRange Element or range on which the change happened.
360
+ * @param formatData Command parameters and additional suggestion parameters.
361
+ * @param affectedElements Elements (other than `elementOrRange`) that are
362
+ * also affected by the command execution. This parameter is used when the effect of the command execution is larger than
363
+ * `elementOrRange`. It is used when determining whether the change should be applied directly or if the suggestion should be created.
364
+ * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. If not set
365
+ * (which is the default and recommended use) the sub type value is a string hash generated from `formatData`. This guarantees that
366
+ * all block format suggestions that perform the same changes have the same sub types (and can be properly handled).
367
+ * @param attributes Custom suggestion attributes.
368
+ */
369
+ markBlockFormat(elementOrRange: ModelElement | ModelRange, formatData: SuggestionFormatData, affectedElements?: Array<ModelElement>, subType?: string | null, attributes?: Record<string, unknown>): Suggestion | null;
370
+ /**
371
+ * Marks a multi-range block format suggestion on given `elements`.
372
+ *
373
+ * See {@link module:track-changes/trackchangesediting~TrackChangesEditing#markBlockFormat `TrackChangesEditing#markBlockFormat()`}
374
+ * to learn more about block format suggestions. Note that this method can be used only on elements (not on ranges).
375
+ *
376
+ * This method is useful for creating a format suggestion on multiple elements which are not siblings, so one range cannot be used.
377
+ *
378
+ * This method should be used in `callback()` in
379
+ * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
380
+ * to inform the track changes plugin about a suggestion that happened.
381
+ *
382
+ * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
383
+ * this method are bound with one undo step.
384
+ *
385
+ * When a format suggestion is accepted the command is executed based on parameters passed in `formatData`.
386
+ *
387
+ * If a block format suggestion is marked inside the local user's insertion suggestion, the change is applied directly
388
+ * and no suggestion is created. Note that this does not support partial intersections with insertion suggestions
389
+ * (as opposed to inline format suggestions).
390
+ *
391
+ * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
392
+ * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
393
+ * the existing suggestion).
394
+ *
395
+ * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
396
+ * features} guide to learn more about enabling your feature in the suggestion mode.
397
+ *
398
+ * @param elementsOrRanges Elements or ranges
399
+ * on which the change happened.
400
+ * @param formatData Command parameters and additional suggestion parameters.
401
+ * @param affectedElements Elements (other than `elementOrRange`) that are
402
+ * also affected by the command execution. This parameter is used when the effect of the command execution is larger than
403
+ * `elementOrRange`. It is used when determining whether the change should be applied directly or if the suggestion should be created.
404
+ * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. If not set
405
+ * (which is the default and recommended use) the sub type value is a string hash generated from `formatData`. This guarantees that
406
+ * all block format suggestions that perform the same changes have the same sub types (and can be properly handled).
407
+ * @param attributes Custom suggestion attributes.
408
+ */
409
+ markMultiRangeBlockFormat(elementsOrRanges: Array<ModelElement> | Array<ModelRange>, formatData: SuggestionFormatData, affectedElements?: Array<ModelElement>, subType?: string | null, attributes?: Record<string, unknown>): Suggestion | null;
410
+ /**
411
+ * Marks a single-range deletion suggestion on given `range`.
412
+ *
413
+ * If the `range` to mark intersects with or contains insertion suggestions created by the local user,
414
+ * those suggestions may be removed in a part or in the whole together with their content.
415
+ *
416
+ * ```ts
417
+ * trackChangesPlugin.markDeletion( deletedRange );
418
+ * trackChangesPlugin.markDeletion( deletedRange, 'customDeletion' );
419
+ * ```
420
+ *
421
+ * This method should be used in `callback()` in
422
+ * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
423
+ * to inform the track changes plugin about a suggestion that happened.
424
+ *
425
+ * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
426
+ * this method are bound with one undo step.
427
+ *
428
+ * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
429
+ * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
430
+ * the existing suggestion).
431
+ *
432
+ * See {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
433
+ * features guide} to learn more about enabling your feature in the suggestion mode.
434
+ *
435
+ * @param range Range which should be marked as deletion suggestion.
436
+ * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set. If not set,
437
+ * suggestion will be a generic insertion suggestion. Only suggestions with the same sub type will be joined.
438
+ * @param attributes Custom suggestion attributes.
439
+ * @returns Suggestion created or expanded as a result of execution of this
440
+ * method. Returns `null` if given `range` was collapsed or the deletion was in insertion (so no suggestion was created or expanded).
441
+ */
442
+ markDeletion(range: ModelRange, subType?: string | null, attributes?: Record<string, unknown>): Suggestion | null;
443
+ /**
444
+ * Marks a multi-range deletion suggestion spanning over given `ranges`.
445
+ *
446
+ * Each range of a multi-range deletion suggestion should contain exactly one element and should not be created on a text content.
447
+ *
448
+ * If the `ranges` to mark contain or are contained in insertion suggestions created by the local user, those
449
+ * insertion suggestions may be removed together with their content.
450
+ *
451
+ * ```ts
452
+ * trackChangesPlugin.markMultiRangeDeletion( deletedRanges );
453
+ * trackChangesPlugin.markMultiRangeDeletion( deletedRanges, 'customDeletion' );
454
+ * ```
455
+ *
456
+ * This method should be used in `callback()` in
457
+ * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
458
+ * to inform the track changes plugin about a suggestion that happened.
459
+ *
460
+ * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
461
+ * this method are bound with one undo step.
462
+ *
463
+ * If possible, the new suggestion will be joined with an existing suggestion (of the same type). This happens only if
464
+ * the suggestions are created by the same user and have similar attributes (i.e. passed `attributes` do not conflict with
465
+ * the existing suggestion).
466
+ *
467
+ * See the {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
468
+ * features} guide to learn more about enabling your feature in the suggestion mode.
469
+ *
470
+ * @param ranges Ranges which should be marked as deletion suggestion.
471
+ * @param subType Suggestion {@link module:track-changes/suggestion~Suggestion#subType} to set.
472
+ * Only suggestions with the same sub type will be joined.
473
+ * @param attributes Custom suggestion attributes.
474
+ * @returns Suggestion created or expanded as a result of execution of this method.
475
+ */
476
+ markMultiRangeDeletion(ranges: Array<ModelRange>, subType?: string, attributes?: Record<string, unknown>): Suggestion | null;
477
+ /**
478
+ * Marks a single-range attribute suggestion on the given `range`.
479
+ *
480
+ * Note: all nodes in the given `range` must have the same current value of `key` attribute.
481
+ *
482
+ * Note: if a block attribute is marked, `range` should include only a single model element.
483
+ *
484
+ * `attributes` is a required value and must include `groupId: string` property. The group id is used to group attribute suggestions
485
+ * together. All suggestions with the same `groupId` will be put into one suggestion chain. By default, all attribute suggestions
486
+ * created during the same batch have the same `groupId`.
487
+ *
488
+ * It's possible that more than one suggestion will be created by this method if there are already suggestions with the same
489
+ * `key` but a different `oldValue` intersecting with the given `range`.
490
+ *
491
+ * It is guaranteed that there will be no "conflicting" suggestions, that is, there will be no two intersecting suggestions for
492
+ * the same attribute `key`. If there is a conflicting suggestion, it will be partially or fully replaced by a new suggestion.
493
+ *
494
+ * This method should be used in `callback()` in
495
+ * {@link module:track-changes/trackchangesediting~TrackChangesEditing#enableCommand `TrackChangesEditing#enableCommand`}
496
+ * to inform the track changes plugin about a suggestion that happened.
497
+ *
498
+ * Always call this method inside `model.change()` or `model.enqueueChange()` block to ensure that all operations performed by
499
+ * this method are bound with one undo step.
500
+ *
501
+ * See {@glink features/collaboration/track-changes/track-changes-custom-features Integrating track changes with custom
502
+ * features guide} to learn more about enabling your feature in the suggestion mode.
503
+ *
504
+ * @param range Range for which the attribute has changed.
505
+ * @param key Key of the attribute that changed.
506
+ * @param oldValue Previous value of the attribute.
507
+ * @param newValue New value of the attribute.
508
+ * @param attributes Suggestion attributes. Must include `groupId`.
509
+ */
510
+ markAttributeChange(range: ModelRange, key: string, oldValue: unknown, newValue: unknown, attributes: {
511
+ groupId: string;
512
+ [key: string]: any;
513
+ }): Array<Suggestion>;
514
+ /**
515
+ * Enables default attributes suggestions integration for given command.
516
+ *
517
+ * @param commandName Name of the command to integrate.
518
+ */
519
+ enableDefaultAttributesIntegration(commandName: string): void;
520
+ /**
521
+ * Starts a new tracking session, stopping all newly created suggestions from being joined with the previously existing ones,
522
+ * even if they meet the merging criteria. It returns an id that can be later used to continue the session by calling this method
523
+ * with said id as an argument.
524
+ */
525
+ startTrackingSession(id?: string | null): string | null;
526
+ /**
527
+ * Executes given callback and then finds all attribute and rename changes that have been made during that callback. For all these
528
+ * changes, creates proper attribute suggestions. Additionally cleans up existing, conflicting attribute suggestions if they intersect
529
+ * with the newly created suggestions.
530
+ *
531
+ * @param callback Function to call and check for attribute and rename changes. Usually this executes an editor command.
532
+ */
533
+ recordAttributeChanges(callback: () => void): void;
531
534
  }
532
535
  /**
533
- * Command parameters and additional suggestion parameters. Passed value is also saved in
534
- * {@link module:track-changes/suggestion~Suggestion#data `Suggestion#data`} property.
535
- */
536
+ * Command parameters and additional suggestion parameters. Passed value is also saved in
537
+ * {@link module:track-changes/suggestion~Suggestion#data `Suggestion#data`} property.
538
+ */
536
539
  export type SuggestionFormatData = {
537
- /**
538
- * Name of the command to execute when the suggestion is accepted.
539
- */
540
- commandName: string;
541
- /**
542
- * Parameters with which the command should be executed.
543
- */
544
- commandParams: Array<any>;
545
- /**
546
- * Additional grouping parameter for suggestions. If a suggestion
547
- * would be set on an element which already has a different suggestion with the same `formatGroupId`, the new suggestion will overwrite
548
- * the old one (the old one will be removed). Defaults to `commandName` parameter, so different suggestions of the same command
549
- * overwrite each other. Using this parameter you might expand this behavior so that multiple commands overwrite each other.
550
- */
551
- formatGroupId?: string;
552
- /**
553
- * True when format suggestion uses ranges.
554
- */
555
- multipleBlocks?: boolean;
556
- [i: string]: unknown;
540
+ /**
541
+ * Name of the command to execute when the suggestion is accepted.
542
+ */
543
+ commandName: string;
544
+ /**
545
+ * Parameters with which the command should be executed.
546
+ */
547
+ commandParams: Array<any>;
548
+ /**
549
+ * Additional grouping parameter for suggestions. If a suggestion
550
+ * would be set on an element which already has a different suggestion with the same `formatGroupId`, the new suggestion will overwrite
551
+ * the old one (the old one will be removed). Defaults to `commandName` parameter, so different suggestions of the same command
552
+ * overwrite each other. Using this parameter you might expand this behavior so that multiple commands overwrite each other.
553
+ */
554
+ formatGroupId?: string;
555
+ /**
556
+ * True when format suggestion uses ranges.
557
+ */
558
+ multipleBlocks?: boolean;
559
+ [i: string]: unknown;
557
560
  };
558
561
  /**
559
- * Attribute suggestion parameters.
560
- */
562
+ * Attribute suggestion parameters.
563
+ */
561
564
  export type SuggestionAttributeData = {
562
- /**
563
- * Attribute key.
564
- */
565
- key: string;
566
- /**
567
- * Attribute's original value before the change happened.
568
- */
569
- oldValue: unknown;
570
- /**
571
- * Attribute's value after the change happened.
572
- */
573
- newValue: unknown;
565
+ /**
566
+ * Attribute key.
567
+ */
568
+ key: string;
569
+ /**
570
+ * Attribute's original value before the change happened.
571
+ */
572
+ oldValue: unknown;
573
+ /**
574
+ * Attribute's value after the change happened.
575
+ */
576
+ newValue: unknown;
574
577
  };