@ckeditor/ckeditor5-track-changes 39.0.2 → 40.0.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 (136) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +1 -1
  3. package/build/track-changes.js +1 -1
  4. package/package.json +3 -3
  5. package/src/augmentation.d.ts +40 -40
  6. package/src/commands/acceptsuggestioncommand.d.ts +24 -24
  7. package/src/commands/acceptsuggestioncommand.js +1 -1
  8. package/src/commands/discardsuggestioncommand.d.ts +24 -24
  9. package/src/commands/discardsuggestioncommand.js +1 -1
  10. package/src/commands/executeonallsuggestionscommand.d.ts +24 -24
  11. package/src/commands/executeonallsuggestionscommand.js +1 -1
  12. package/src/commands/executeonselectedsuggestionscommand.d.ts +24 -24
  13. package/src/commands/executeonselectedsuggestionscommand.js +1 -1
  14. package/src/commands/trackchangescommand.d.ts +26 -26
  15. package/src/commands/trackchangescommand.js +1 -1
  16. package/src/index.d.ts +16 -16
  17. package/src/integrations/aiassistant.d.ts +17 -0
  18. package/src/integrations/aiassistant.js +23 -0
  19. package/src/integrations/alignment.d.ts +17 -17
  20. package/src/integrations/alignment.js +1 -1
  21. package/src/integrations/basicstyles.d.ts +17 -17
  22. package/src/integrations/basicstyles.js +1 -1
  23. package/src/integrations/blockquote.d.ts +17 -17
  24. package/src/integrations/blockquote.js +1 -1
  25. package/src/integrations/ckbox.d.ts +17 -17
  26. package/src/integrations/ckbox.js +1 -1
  27. package/src/integrations/codeblock.d.ts +17 -17
  28. package/src/integrations/codeblock.js +1 -1
  29. package/src/integrations/comments.d.ts +14 -14
  30. package/src/integrations/comments.js +1 -1
  31. package/src/integrations/deletecommand.d.ts +17 -17
  32. package/src/integrations/deletecommand.js +1 -1
  33. package/src/integrations/documentlist.d.ts +17 -17
  34. package/src/integrations/documentlist.js +1 -1
  35. package/src/integrations/documentlistproperties.d.ts +29 -29
  36. package/src/integrations/documentlistproperties.js +1 -1
  37. package/src/integrations/entercommand.d.ts +16 -16
  38. package/src/integrations/entercommand.js +1 -1
  39. package/src/integrations/findandreplace.d.ts +21 -21
  40. package/src/integrations/findandreplace.js +1 -1
  41. package/src/integrations/font.d.ts +17 -17
  42. package/src/integrations/font.js +1 -1
  43. package/src/integrations/formatpainter.d.ts +17 -17
  44. package/src/integrations/formatpainter.js +1 -1
  45. package/src/integrations/heading.d.ts +17 -17
  46. package/src/integrations/heading.js +1 -1
  47. package/src/integrations/highlight.d.ts +17 -17
  48. package/src/integrations/highlight.js +1 -1
  49. package/src/integrations/horizontalline.d.ts +17 -17
  50. package/src/integrations/horizontalline.js +1 -1
  51. package/src/integrations/htmlembed.d.ts +17 -17
  52. package/src/integrations/htmlembed.js +1 -1
  53. package/src/integrations/image.d.ts +17 -17
  54. package/src/integrations/image.js +1 -1
  55. package/src/integrations/imagereplace.d.ts +23 -23
  56. package/src/integrations/imagereplace.js +1 -1
  57. package/src/integrations/importword.d.ts +18 -18
  58. package/src/integrations/importword.js +1 -1
  59. package/src/integrations/indent.d.ts +17 -17
  60. package/src/integrations/indent.js +1 -1
  61. package/src/integrations/inputcommand.d.ts +16 -16
  62. package/src/integrations/inputcommand.js +1 -1
  63. package/src/integrations/link.d.ts +17 -17
  64. package/src/integrations/link.js +1 -1
  65. package/src/integrations/list.d.ts +17 -17
  66. package/src/integrations/list.js +1 -1
  67. package/src/integrations/listproperties.d.ts +29 -29
  68. package/src/integrations/listproperties.js +1 -1
  69. package/src/integrations/mediaembed.d.ts +17 -17
  70. package/src/integrations/mediaembed.js +1 -1
  71. package/src/integrations/mention.d.ts +17 -17
  72. package/src/integrations/mention.js +1 -1
  73. package/src/integrations/pagebreak.d.ts +17 -17
  74. package/src/integrations/pagebreak.js +1 -1
  75. package/src/integrations/paragraph.d.ts +17 -17
  76. package/src/integrations/paragraph.js +1 -1
  77. package/src/integrations/removeformat.d.ts +17 -17
  78. package/src/integrations/removeformat.js +1 -1
  79. package/src/integrations/restrictededitingmode.d.ts +17 -17
  80. package/src/integrations/restrictededitingmode.js +1 -1
  81. package/src/integrations/shiftentercommand.d.ts +16 -16
  82. package/src/integrations/shiftentercommand.js +1 -1
  83. package/src/integrations/standardeditingmode.d.ts +17 -17
  84. package/src/integrations/standardeditingmode.js +1 -1
  85. package/src/integrations/style.d.ts +18 -18
  86. package/src/integrations/style.js +1 -1
  87. package/src/integrations/table.d.ts +42 -42
  88. package/src/integrations/table.js +1 -1
  89. package/src/integrations/tablecaption.d.ts +22 -22
  90. package/src/integrations/tablecaption.js +1 -1
  91. package/src/integrations/tableclipboard.d.ts +19 -19
  92. package/src/integrations/tableclipboard.js +1 -1
  93. package/src/integrations/tablecolumnresize.d.ts +26 -26
  94. package/src/integrations/tablecolumnresize.js +1 -1
  95. package/src/integrations/tableheadings.d.ts +22 -22
  96. package/src/integrations/tableheadings.js +1 -1
  97. package/src/integrations/tablemergesplit.d.ts +22 -22
  98. package/src/integrations/tablemergesplit.js +1 -1
  99. package/src/integrations/tableofcontents.d.ts +17 -17
  100. package/src/integrations/tableofcontents.js +1 -1
  101. package/src/integrations/tableproperties.d.ts +27 -27
  102. package/src/integrations/tableproperties.js +1 -1
  103. package/src/integrations/template.d.ts +17 -17
  104. package/src/integrations/template.js +1 -1
  105. package/src/integrations/title.d.ts +17 -17
  106. package/src/integrations/title.js +1 -1
  107. package/src/integrations/undo.d.ts +17 -17
  108. package/src/integrations/undo.js +1 -1
  109. package/src/integrations/utils.d.ts +21 -21
  110. package/src/integrations/utils.js +1 -1
  111. package/src/suggestion.d.ts +276 -276
  112. package/src/suggestion.js +1 -1
  113. package/src/suggestiondescriptionfactory.d.ts +163 -163
  114. package/src/suggestiondescriptionfactory.js +1 -1
  115. package/src/trackchanges.d.ts +244 -244
  116. package/src/trackchanges.js +1 -1
  117. package/src/trackchangesconfig.d.ts +75 -75
  118. package/src/trackchangesdata.d.ts +41 -41
  119. package/src/trackchangesdata.js +1 -1
  120. package/src/trackchangesediting.d.ts +468 -467
  121. package/src/trackchangesediting.js +1 -1
  122. package/src/trackchangesui.d.ts +38 -38
  123. package/src/trackchangesui.js +1 -1
  124. package/src/ui/suggestioncontroller.d.ts +37 -37
  125. package/src/ui/suggestioncontroller.js +1 -1
  126. package/src/ui/view/basesuggestionthreadview.d.ts +170 -170
  127. package/src/ui/view/basesuggestionthreadview.js +1 -1
  128. package/src/ui/view/suggestionthreadview.d.ts +182 -182
  129. package/src/ui/view/suggestionthreadview.js +1 -1
  130. package/src/utils/common-translations.d.ts +9 -9
  131. package/src/utils/common-translations.js +1 -1
  132. package/src/utils/utils.d.ts +30 -30
  133. package/src/utils/utils.js +1 -1
  134. package/theme/icons/track-changes-accept.svg +1 -1
  135. package/theme/icons/track-changes-discard.svg +1 -1
  136. package/theme/icons/track-changes.svg +1 -1
@@ -1,244 +1,244 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module track-changes/trackchanges
7
- * @publicApi
8
- */
9
- import { Plugin } from 'ckeditor5/src/core';
10
- import TrackChangesUI from './trackchangesui';
11
- import TrackChangesEditing from './trackchangesediting';
12
- import 'ckeditor5-collaboration/src/collaboration-core';
13
- import type { default as Suggestion, SuggestionJSON } from './suggestion';
14
- import type SuggestionThreadView from './ui/view/suggestionthreadview';
15
- /**
16
- * A plugin that provides track changes mode for the editor. In track changes mode, all insertions are visually marked and all deletions
17
- * are not deleted but also visually marked. Unsupported commands are disabled when the editor is in the track changes mode.
18
- *
19
- * To learn how to integrate the track changes feature with your editor, refer to the
20
- * {@glink features/collaboration/track-changes/track-changes-integration Track changes integration} guide.
21
- *
22
- * Basic API:
23
- *
24
- * ```ts
25
- * // Get the track changes plugin:
26
- * const trackChangesPlugin = editor.plugins.get( 'TrackChanges' );
27
- *
28
- * // Add a suggestion:
29
- * trackChangesPlugin.addSuggestion( suggestionData );
30
- *
31
- * // Get all suggestions:
32
- * trackChangesPlugin.getSuggestions();
33
- *
34
- * // Set the adapter:
35
- * trackChangesPlugin.adapter = {
36
- * // ...
37
- * }
38
- * ```
39
- *
40
- * The plugin registers several commands:
41
- *
42
- * * `trackChanges` – Toggles the track changes mode in the editor.
43
- * * `acceptSuggestion` – Accepts a suggestion with the specified ID.
44
- * * `discardSuggestion` – Discards a suggestion with the specified ID.
45
- * * `acceptAllSuggestions` – Accepts all suggestions.
46
- * * `discardAllSuggestions` – Discards all suggestions.
47
- * * `acceptSelectedSuggestions` – Accepts all suggestions in the current selection.
48
- * * `discardSelectedSuggestions` – Discards all suggestions in the current selection.
49
- *
50
- * Examples:
51
- *
52
- * ```ts
53
- * editor.execute( 'trackChanges' );
54
- * editor.execute( 'acceptSuggestion', 'suggestion-1' );
55
- * editor.execute( 'discardSuggestion', 'suggestion-1' );
56
- * editor.execute( 'acceptAllSuggestions' );
57
- * editor.execute( 'discardAllSuggestions' );
58
- * editor.execute( 'acceptSelectedSuggestions' );
59
- * editor.execute( 'discardSelectedSuggestions' )
60
- * ```
61
- *
62
- * Note that there is no command to add a suggestion. This is because suggestions
63
- * are added automatically when editing commands are executed while the editor is in track
64
- * changes mode. For instance:
65
- *
66
- * ```ts
67
- * // Turn on the track changes mode:
68
- * editor.execute( 'trackChanges' );
69
- *
70
- * // Insert some text. It will be automatically inserted as a suggestion:
71
- * editor.execute( 'input', { text: 'foo' } );
72
- * ```
73
- */
74
- export default class TrackChanges extends Plugin {
75
- static get requires(): readonly [typeof TrackChangesEditing, typeof TrackChangesUI, "Comments"];
76
- static get pluginName(): "TrackChanges";
77
- /**
78
- * An adapter object that should communicate with the data source to fetch or save the suggestion data.
79
- *
80
- * This is a shorthand to {@link module:track-changes/trackchangesediting~TrackChangesEditing#adapter `TrackChangesEditing#adapter`}.
81
- */
82
- set adapter(adapter: TrackChangesAdapter | null);
83
- get adapter(): TrackChangesAdapter | null;
84
- /**
85
- * Adds suggestion data.
86
- *
87
- * Use this method to load the suggestion data during the editor initialization if you do not use the adapter integration.
88
- */
89
- addSuggestion(suggestionData: SuggestionData): Suggestion;
90
- getSuggestions(options: {
91
- skipNotAttached?: boolean;
92
- toJSON: true;
93
- }): Array<SuggestionJSON>;
94
- getSuggestions(options?: {
95
- skipNotAttached?: boolean;
96
- toJSON?: false;
97
- }): Array<Suggestion>;
98
- getSuggestions(options: {
99
- skipNotAttached?: boolean;
100
- toJSON: boolean;
101
- }): Array<Suggestion> | Array<SuggestionJSON>;
102
- /**
103
- * Returns the suggestion instance for a given ID.
104
- */
105
- getSuggestion(id: string): Suggestion;
106
- }
107
- /**
108
- * The configuration of the track changes feature.
109
- *
110
- * Example:
111
- *
112
- * ```ts
113
- * ClassicEditor
114
- * .create( {
115
- * // Track changes feature configuration.
116
- * trackChanges: {
117
- * // Do not allow users to comment suggestions (default is `false`).
118
- * disableComments: true,
119
- * // Do not track styling and formatting changes (default is `default`).
120
- * trackFormatChanges: 'never',
121
- * // Merges suggestion changes inside a block. (default is `true`).
122
- * mergeNestedSuggestions: true
123
- * }
124
- * } )
125
- * .then( ... )
126
- * .catch( ... );
127
- * ```
128
- *
129
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
130
- */
131
- export interface TrackChangesConfig {
132
- /**
133
- * A property that specifies if the comments for suggestions are enabled or disabled.
134
- * When the option is set to `true`, the comment thread UI for suggestions will be hidden
135
- * and commenting suggestions will be disabled.
136
- *
137
- * Suggestion thread views will be marked with the additional `ck-suggestion--disabled-comments` class when the suggestion comments
138
- * are disabled.
139
- */
140
- disableComments: boolean;
141
- /**
142
- * A property that specifies whether format changes should be tracked.
143
- *
144
- * Format changes are all changes other than insertions and deletions, including: styling, structure, widgets properties, etc.
145
- *
146
- * Possible values are:
147
- *
148
- * * `'always'` - all changes are going to be tracked independently (without merging).
149
- * * `'default'` - format changes made inside your own insertion suggestion will be merged with it.
150
- * * `'never'` - format changes will not be tracked.
151
- *
152
- * Defaults to `'default'`.
153
- */
154
- trackFormatChanges: 'never' | 'default' | 'always';
155
- /**
156
- * Specifies whether suggestions on an object (e.g. image, table) should be automatically merged
157
- * with suggestions inside the object (e.g. image caption, table cell).
158
- *
159
- * For example, when set to `true`, creating a table and writing some text inside the table will result in one suggestion.
160
- * When set to `false`, it will be two separate suggestions, one for the inserted table and one for the inserted text.
161
- *
162
- * Keep in mind that only suggestions from the same author and of the same type are merged this way.
163
- */
164
- mergeNestedSuggestions: boolean;
165
- /**
166
- * A view class to be used to create suggestion thread views.
167
- *
168
- * {@link module:track-changes/ui/view/suggestionthreadview~SuggestionThreadView} is used by default
169
- * when this property is not set.
170
- */
171
- SuggestionThreadView?: typeof SuggestionThreadView;
172
- }
173
- /**
174
- * Track changes adapter.
175
- *
176
- * The track changes adapter is an object that communicates asynchronously with the data source to fetch or save the suggestion data.
177
- * It is used internally by the track changes feature whenever a suggestion is loaded, created or deleted.
178
- *
179
- * The adapter is optional. You might need to provide it if you are {@glink features/collaboration/track-changes/track-changes-integration}
180
- * using the track changes feature without real-time collaboration.
181
- *
182
- * To set the adapter, overwrite {@link module:track-changes/trackchanges~TrackChanges#adapter the `TrackChanges#adapter` property}.
183
- */
184
- export interface TrackChangesAdapter {
185
- /**
186
- * Called each time the suggestion data is needed.
187
- *
188
- * The method should return a promise that resolves with the suggestion data object.
189
- *
190
- * @param id The ID of the suggestion to get.
191
- */
192
- getSuggestion(id: string): Promise<SuggestionData>;
193
- /**
194
- * Called each time a new suggestion is created.
195
- *
196
- * The method should save the suggestion data in the database
197
- * and return a promise that should be resolved when the save is
198
- * completed.
199
- *
200
- * If the promise resolves with an object with the `createdAt` property,
201
- * this suggestion property will be updated in the suggestion in the editor.
202
- * This lets you update the suggestion data with server-side information.
203
- *
204
- * The `suggestionData` object does not expect the `authorId` property.
205
- * For security reasons, the author of the suggestion should be set
206
- * on the server side.
207
- *
208
- * If `suggestionData.originalSuggestionId` is set, the new suggestion should
209
- * have the `authorId` property set to the same as the suggestion with
210
- * `originalSuggestionId`. This happens when one user splits
211
- * another user's suggestion, creating a new suggestion as a result. See
212
- * {@glink features/collaboration/track-changes/track-changes-integration#implementation Track changes integration} guide.
213
- *
214
- * **Note:** Failure to properly handle this property will result in editor crash in some scenarios.
215
- *
216
- * In any other case, use the current (local) user to set `authorId`.
217
- *
218
- * The `suggestionData` object does not expect the `createdAt` property either.
219
- * You should use the server-side time generator to ensure that all users
220
- * see the same date.
221
- *
222
- * It is recommended to stringify `suggestionData.attributes` value to JSON and save it as a string in your database,
223
- * and then to parse the strings when loading suggestions.
224
- */
225
- addSuggestion(suggestionData: AddSuggestionInput): Promise<SuggestionData>;
226
- /**
227
- * Called each time the suggestion properties change.
228
- *
229
- * The method should update the suggestion properties in the database
230
- * and return a promise that should be resolved when the save is
231
- * completed.
232
- *
233
- * Keep in mind that the `data` parameter only contains those
234
- * properties of a suggestion which changed.
235
- */
236
- updateSuggestion(id: string, suggestionData: UpdateSuggestionInput): Promise<void>;
237
- }
238
- export type SuggestionData = SuggestionJSON & {
239
- originalSuggestionId?: string | null;
240
- };
241
- export type AddSuggestionInput = Omit<SuggestionData, 'authorId' | 'createdAt'>;
242
- export type UpdateSuggestionInput = Partial<Pick<SuggestionJSON, 'hasComments' | 'attributes'>> & {
243
- state?: 'open' | 'accepted' | 'rejected';
244
- };
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module track-changes/trackchanges
7
+ * @publicApi
8
+ */
9
+ import { Plugin } from 'ckeditor5/src/core';
10
+ import TrackChangesUI from './trackchangesui';
11
+ import TrackChangesEditing from './trackchangesediting';
12
+ import 'ckeditor5-collaboration/src/collaboration-core';
13
+ import type { default as Suggestion, SuggestionJSON } from './suggestion';
14
+ import type SuggestionThreadView from './ui/view/suggestionthreadview';
15
+ /**
16
+ * A plugin that provides track changes mode for the editor. In track changes mode, all insertions are visually marked and all deletions
17
+ * are not deleted but also visually marked. Unsupported commands are disabled when the editor is in the track changes mode.
18
+ *
19
+ * To learn how to integrate the track changes feature with your editor, refer to the
20
+ * {@glink features/collaboration/track-changes/track-changes-integration Track changes integration} guide.
21
+ *
22
+ * Basic API:
23
+ *
24
+ * ```ts
25
+ * // Get the track changes plugin:
26
+ * const trackChangesPlugin = editor.plugins.get( 'TrackChanges' );
27
+ *
28
+ * // Add a suggestion:
29
+ * trackChangesPlugin.addSuggestion( suggestionData );
30
+ *
31
+ * // Get all suggestions:
32
+ * trackChangesPlugin.getSuggestions();
33
+ *
34
+ * // Set the adapter:
35
+ * trackChangesPlugin.adapter = {
36
+ * // ...
37
+ * }
38
+ * ```
39
+ *
40
+ * The plugin registers several commands:
41
+ *
42
+ * * `trackChanges` &ndash; Toggles the track changes mode in the editor.
43
+ * * `acceptSuggestion` &ndash; Accepts a suggestion with the specified ID.
44
+ * * `discardSuggestion` &ndash; Discards a suggestion with the specified ID.
45
+ * * `acceptAllSuggestions` &ndash; Accepts all suggestions.
46
+ * * `discardAllSuggestions` &ndash; Discards all suggestions.
47
+ * * `acceptSelectedSuggestions` &ndash; Accepts all suggestions in the current selection.
48
+ * * `discardSelectedSuggestions` &ndash; Discards all suggestions in the current selection.
49
+ *
50
+ * Examples:
51
+ *
52
+ * ```ts
53
+ * editor.execute( 'trackChanges' );
54
+ * editor.execute( 'acceptSuggestion', 'suggestion-1' );
55
+ * editor.execute( 'discardSuggestion', 'suggestion-1' );
56
+ * editor.execute( 'acceptAllSuggestions' );
57
+ * editor.execute( 'discardAllSuggestions' );
58
+ * editor.execute( 'acceptSelectedSuggestions' );
59
+ * editor.execute( 'discardSelectedSuggestions' )
60
+ * ```
61
+ *
62
+ * Note that there is no command to add a suggestion. This is because suggestions
63
+ * are added automatically when editing commands are executed while the editor is in track
64
+ * changes mode. For instance:
65
+ *
66
+ * ```ts
67
+ * // Turn on the track changes mode:
68
+ * editor.execute( 'trackChanges' );
69
+ *
70
+ * // Insert some text. It will be automatically inserted as a suggestion:
71
+ * editor.execute( 'input', { text: 'foo' } );
72
+ * ```
73
+ */
74
+ export default class TrackChanges extends Plugin {
75
+ static get requires(): readonly [typeof TrackChangesEditing, typeof TrackChangesUI, "Comments"];
76
+ static get pluginName(): "TrackChanges";
77
+ /**
78
+ * An adapter object that should communicate with the data source to fetch or save the suggestion data.
79
+ *
80
+ * This is a shorthand to {@link module:track-changes/trackchangesediting~TrackChangesEditing#adapter `TrackChangesEditing#adapter`}.
81
+ */
82
+ set adapter(adapter: TrackChangesAdapter | null);
83
+ get adapter(): TrackChangesAdapter | null;
84
+ /**
85
+ * Adds suggestion data.
86
+ *
87
+ * Use this method to load the suggestion data during the editor initialization if you do not use the adapter integration.
88
+ */
89
+ addSuggestion(suggestionData: SuggestionData): Suggestion;
90
+ getSuggestions(options: {
91
+ skipNotAttached?: boolean;
92
+ toJSON: true;
93
+ }): Array<SuggestionJSON>;
94
+ getSuggestions(options?: {
95
+ skipNotAttached?: boolean;
96
+ toJSON?: false;
97
+ }): Array<Suggestion>;
98
+ getSuggestions(options: {
99
+ skipNotAttached?: boolean;
100
+ toJSON: boolean;
101
+ }): Array<Suggestion> | Array<SuggestionJSON>;
102
+ /**
103
+ * Returns the suggestion instance for a given ID.
104
+ */
105
+ getSuggestion(id: string): Suggestion;
106
+ }
107
+ /**
108
+ * The configuration of the track changes feature.
109
+ *
110
+ * Example:
111
+ *
112
+ * ```ts
113
+ * ClassicEditor
114
+ * .create( {
115
+ * // Track changes feature configuration.
116
+ * trackChanges: {
117
+ * // Do not allow users to comment suggestions (default is `false`).
118
+ * disableComments: true,
119
+ * // Do not track styling and formatting changes (default is `default`).
120
+ * trackFormatChanges: 'never',
121
+ * // Merges suggestion changes inside a block. (default is `true`).
122
+ * mergeNestedSuggestions: true
123
+ * }
124
+ * } )
125
+ * .then( ... )
126
+ * .catch( ... );
127
+ * ```
128
+ *
129
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
130
+ */
131
+ export interface TrackChangesConfig {
132
+ /**
133
+ * A property that specifies if the comments for suggestions are enabled or disabled.
134
+ * When the option is set to `true`, the comment thread UI for suggestions will be hidden
135
+ * and commenting suggestions will be disabled.
136
+ *
137
+ * Suggestion thread views will be marked with the additional `ck-suggestion--disabled-comments` class when the suggestion comments
138
+ * are disabled.
139
+ */
140
+ disableComments: boolean;
141
+ /**
142
+ * A property that specifies whether format changes should be tracked.
143
+ *
144
+ * Format changes are all changes other than insertions and deletions, including: styling, structure, widgets properties, etc.
145
+ *
146
+ * Possible values are:
147
+ *
148
+ * * `'always'` - all changes are going to be tracked independently (without merging).
149
+ * * `'default'` - format changes made inside your own insertion suggestion will be merged with it.
150
+ * * `'never'` - format changes will not be tracked.
151
+ *
152
+ * Defaults to `'default'`.
153
+ */
154
+ trackFormatChanges: 'never' | 'default' | 'always';
155
+ /**
156
+ * Specifies whether suggestions on an object (e.g. image, table) should be automatically merged
157
+ * with suggestions inside the object (e.g. image caption, table cell).
158
+ *
159
+ * For example, when set to `true`, creating a table and writing some text inside the table will result in one suggestion.
160
+ * When set to `false`, it will be two separate suggestions, one for the inserted table and one for the inserted text.
161
+ *
162
+ * Keep in mind that only suggestions from the same author and of the same type are merged this way.
163
+ */
164
+ mergeNestedSuggestions: boolean;
165
+ /**
166
+ * A view class to be used to create suggestion thread views.
167
+ *
168
+ * {@link module:track-changes/ui/view/suggestionthreadview~SuggestionThreadView} is used by default
169
+ * when this property is not set.
170
+ */
171
+ SuggestionThreadView?: typeof SuggestionThreadView;
172
+ }
173
+ /**
174
+ * Track changes adapter.
175
+ *
176
+ * The track changes adapter is an object that communicates asynchronously with the data source to fetch or save the suggestion data.
177
+ * It is used internally by the track changes feature whenever a suggestion is loaded, created or deleted.
178
+ *
179
+ * The adapter is optional. You might need to provide it if you are {@glink features/collaboration/track-changes/track-changes-integration}
180
+ * using the track changes feature without real-time collaboration.
181
+ *
182
+ * To set the adapter, overwrite {@link module:track-changes/trackchanges~TrackChanges#adapter the `TrackChanges#adapter` property}.
183
+ */
184
+ export interface TrackChangesAdapter {
185
+ /**
186
+ * Called each time the suggestion data is needed.
187
+ *
188
+ * The method should return a promise that resolves with the suggestion data object.
189
+ *
190
+ * @param id The ID of the suggestion to get.
191
+ */
192
+ getSuggestion(id: string): Promise<SuggestionData>;
193
+ /**
194
+ * Called each time a new suggestion is created.
195
+ *
196
+ * The method should save the suggestion data in the database
197
+ * and return a promise that should be resolved when the save is
198
+ * completed.
199
+ *
200
+ * If the promise resolves with an object with the `createdAt` property,
201
+ * this suggestion property will be updated in the suggestion in the editor.
202
+ * This lets you update the suggestion data with server-side information.
203
+ *
204
+ * The `suggestionData` object does not expect the `authorId` property.
205
+ * For security reasons, the author of the suggestion should be set
206
+ * on the server side.
207
+ *
208
+ * If `suggestionData.originalSuggestionId` is set, the new suggestion should
209
+ * have the `authorId` property set to the same as the suggestion with
210
+ * `originalSuggestionId`. This happens when one user splits
211
+ * another user's suggestion, creating a new suggestion as a result. See
212
+ * {@glink features/collaboration/track-changes/track-changes-integration#implementation Track changes integration} guide.
213
+ *
214
+ * **Note:** Failure to properly handle this property will result in editor crash in some scenarios.
215
+ *
216
+ * In any other case, use the current (local) user to set `authorId`.
217
+ *
218
+ * The `suggestionData` object does not expect the `createdAt` property either.
219
+ * You should use the server-side time generator to ensure that all users
220
+ * see the same date.
221
+ *
222
+ * It is recommended to stringify `suggestionData.attributes` value to JSON and save it as a string in your database,
223
+ * and then to parse the strings when loading suggestions.
224
+ */
225
+ addSuggestion(suggestionData: AddSuggestionInput): Promise<SuggestionData>;
226
+ /**
227
+ * Called each time the suggestion properties change.
228
+ *
229
+ * The method should update the suggestion properties in the database
230
+ * and return a promise that should be resolved when the save is
231
+ * completed.
232
+ *
233
+ * Keep in mind that the `data` parameter only contains those
234
+ * properties of a suggestion which changed.
235
+ */
236
+ updateSuggestion(id: string, suggestionData: UpdateSuggestionInput): Promise<void>;
237
+ }
238
+ export type SuggestionData = SuggestionJSON & {
239
+ originalSuggestionId?: string | null;
240
+ };
241
+ export type AddSuggestionInput = Omit<SuggestionData, 'authorId' | 'createdAt'>;
242
+ export type UpdateSuggestionInput = Partial<Pick<SuggestionJSON, 'hasComments' | 'attributes'>> & {
243
+ state?: 'open' | 'accepted' | 'rejected';
244
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- var _0x1848=['plugins','pluginName','getSuggestions','Comments','editor','adapter','addSuggestionData','get','addSuggestion'];(function(_0x298b0b,_0x184805){var _0x1f9fe9=function(_0x144e7e){while(--_0x144e7e){_0x298b0b['push'](_0x298b0b['shift']());}};_0x1f9fe9(++_0x184805);}(_0x1848,0x112));var _0x1f9f=function(_0x298b0b,_0x184805){_0x298b0b=_0x298b0b-0x0;var _0x1f9fe9=_0x1848[_0x298b0b];return _0x1f9fe9;};import{Plugin as _0x283f1a}from'ckeditor5/src/core';import _0x314c8c from'./trackchangesui';import _0x3dfd88 from'./trackchangesediting';import'ckeditor5-collaboration/src/collaboration-core';export default class k extends _0x283f1a{static get['requires'](){return[_0x3dfd88,_0x314c8c,_0x1f9f('0x8')];}static get[_0x1f9f('0x6')](){return'TrackChanges';}set[_0x1f9f('0x1')](_0x243281){this['editor'][_0x1f9f('0x5')][_0x1f9f('0x3')](_0x3dfd88)[_0x1f9f('0x1')]=_0x243281;}get[_0x1f9f('0x1')](){return this[_0x1f9f('0x0')][_0x1f9f('0x5')][_0x1f9f('0x3')](_0x3dfd88)[_0x1f9f('0x1')];}[_0x1f9f('0x4')](_0x2051e2){return this['editor'][_0x1f9f('0x5')][_0x1f9f('0x3')](_0x3dfd88)[_0x1f9f('0x2')](_0x2051e2);}[_0x1f9f('0x7')]({skipNotAttached:_0x3eaf36=!0x1,toJSON:_0x243c99=!0x1}={}){return this[_0x1f9f('0x0')][_0x1f9f('0x5')][_0x1f9f('0x3')](_0x3dfd88)[_0x1f9f('0x7')]({'skipNotAttached':_0x3eaf36,'toJSON':_0x243c99});}['getSuggestion'](_0x5ce496){return this[_0x1f9f('0x0')][_0x1f9f('0x5')][_0x1f9f('0x3')](_0x3dfd88)['getSuggestion'](_0x5ce496);}}
23
+ var _0x12bf=['plugins','adapter','TrackChanges','addSuggestion','get','pluginName','Comments','getSuggestions','addSuggestionData','editor','getSuggestion'];(function(_0x3f2f9d,_0x12bfb0){var _0x161a13=function(_0x369cc1){while(--_0x369cc1){_0x3f2f9d['push'](_0x3f2f9d['shift']());}};_0x161a13(++_0x12bfb0);}(_0x12bf,0x16d));var _0x161a=function(_0x3f2f9d,_0x12bfb0){_0x3f2f9d=_0x3f2f9d-0x0;var _0x161a13=_0x12bf[_0x3f2f9d];return _0x161a13;};import{Plugin as _0xe9c300}from'ckeditor5/src/core';import _0x289221 from'./trackchangesui';import _0x3d300f from'./trackchangesediting';import'ckeditor5-collaboration/src/collaboration-core';export default class k extends _0xe9c300{static get['requires'](){return[_0x3d300f,_0x289221,_0x161a('0x4')];}static get[_0x161a('0x3')](){return _0x161a('0x0');}set['adapter'](_0x2427ba){this[_0x161a('0x7')][_0x161a('0x9')]['get'](_0x3d300f)[_0x161a('0xa')]=_0x2427ba;}get[_0x161a('0xa')](){return this[_0x161a('0x7')][_0x161a('0x9')][_0x161a('0x2')](_0x3d300f)[_0x161a('0xa')];}[_0x161a('0x1')](_0x30292d){return this[_0x161a('0x7')][_0x161a('0x9')][_0x161a('0x2')](_0x3d300f)[_0x161a('0x6')](_0x30292d);}[_0x161a('0x5')]({skipNotAttached:_0x549aca=!0x1,toJSON:_0x441144=!0x1}={}){return this[_0x161a('0x7')][_0x161a('0x9')][_0x161a('0x2')](_0x3d300f)['getSuggestions']({'skipNotAttached':_0x549aca,'toJSON':_0x441144});}[_0x161a('0x8')](_0x1dd5f2){return this[_0x161a('0x7')][_0x161a('0x9')]['get'](_0x3d300f)[_0x161a('0x8')](_0x1dd5f2);}}