@ckeditor/ckeditor5-track-changes 36.0.1 → 37.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 (127) hide show
  1. package/build/track-changes.js +1 -1
  2. package/ckeditor5-metadata.json +10 -0
  3. package/package.json +20 -5
  4. package/src/augmentation.d.ts +36 -0
  5. package/src/augmentation.js +23 -0
  6. package/src/commands/acceptsuggestioncommand.d.ts +20 -0
  7. package/src/commands/acceptsuggestioncommand.js +1 -1
  8. package/src/commands/discardsuggestioncommand.d.ts +20 -0
  9. package/src/commands/discardsuggestioncommand.js +1 -1
  10. package/src/commands/executeonallsuggestionscommand.d.ts +20 -0
  11. package/src/commands/executeonallsuggestionscommand.js +1 -1
  12. package/src/commands/executeonselectedsuggestionscommand.d.ts +20 -0
  13. package/src/commands/executeonselectedsuggestionscommand.js +1 -1
  14. package/src/commands/trackchangescommand.d.ts +22 -0
  15. package/src/commands/trackchangescommand.js +1 -1
  16. package/src/index.d.ts +12 -0
  17. package/src/index.js +1 -1
  18. package/src/integrations/alignment.d.ts +13 -0
  19. package/src/integrations/alignment.js +1 -1
  20. package/src/integrations/basicstyles.d.ts +13 -0
  21. package/src/integrations/basicstyles.js +1 -1
  22. package/src/integrations/blockquote.d.ts +13 -0
  23. package/src/integrations/blockquote.js +1 -1
  24. package/src/integrations/ckbox.d.ts +13 -0
  25. package/src/integrations/ckbox.js +1 -1
  26. package/src/integrations/codeblock.d.ts +13 -0
  27. package/src/integrations/codeblock.js +1 -1
  28. package/src/integrations/comments.d.ts +10 -0
  29. package/src/integrations/comments.js +1 -1
  30. package/src/integrations/deletecommand.d.ts +12 -0
  31. package/src/integrations/deletecommand.js +1 -1
  32. package/src/integrations/documentlist.d.ts +13 -0
  33. package/src/integrations/documentlist.js +1 -1
  34. package/src/integrations/documentlistproperties.d.ts +25 -0
  35. package/src/integrations/documentlistproperties.js +1 -1
  36. package/src/integrations/entercommand.d.ts +11 -0
  37. package/src/integrations/entercommand.js +1 -1
  38. package/src/integrations/findandreplace.d.ts +17 -0
  39. package/src/integrations/findandreplace.js +1 -1
  40. package/src/integrations/font.d.ts +13 -0
  41. package/src/integrations/font.js +1 -1
  42. package/src/integrations/heading.d.ts +13 -0
  43. package/src/integrations/heading.js +1 -1
  44. package/src/integrations/highlight.d.ts +13 -0
  45. package/src/integrations/highlight.js +1 -1
  46. package/src/integrations/horizontalline.d.ts +13 -0
  47. package/src/integrations/horizontalline.js +1 -1
  48. package/src/integrations/htmlembed.d.ts +13 -0
  49. package/src/integrations/htmlembed.js +1 -1
  50. package/src/integrations/image.d.ts +13 -0
  51. package/src/integrations/image.js +1 -1
  52. package/src/integrations/imagereplace.d.ts +19 -0
  53. package/src/integrations/imagereplace.js +1 -1
  54. package/src/integrations/importword.d.ts +14 -0
  55. package/src/integrations/importword.js +1 -1
  56. package/src/integrations/indent.d.ts +13 -0
  57. package/src/integrations/indent.js +1 -1
  58. package/src/integrations/inputcommand.d.ts +11 -0
  59. package/src/integrations/inputcommand.js +1 -1
  60. package/src/integrations/link.d.ts +13 -0
  61. package/src/integrations/link.js +1 -1
  62. package/src/integrations/list.d.ts +13 -0
  63. package/src/integrations/list.js +1 -1
  64. package/src/integrations/listproperties.d.ts +25 -0
  65. package/src/integrations/listproperties.js +1 -1
  66. package/src/integrations/mediaembed.d.ts +13 -0
  67. package/src/integrations/mediaembed.js +1 -1
  68. package/src/integrations/mention.d.ts +13 -0
  69. package/src/integrations/mention.js +1 -1
  70. package/src/integrations/pagebreak.d.ts +13 -0
  71. package/src/integrations/pagebreak.js +1 -1
  72. package/src/integrations/paragraph.d.ts +13 -0
  73. package/src/integrations/paragraph.js +1 -1
  74. package/src/integrations/removeformat.d.ts +13 -0
  75. package/src/integrations/removeformat.js +1 -1
  76. package/src/integrations/restrictededitingmode.d.ts +13 -0
  77. package/src/integrations/restrictededitingmode.js +1 -1
  78. package/src/integrations/shiftentercommand.d.ts +11 -0
  79. package/src/integrations/shiftentercommand.js +1 -1
  80. package/src/integrations/standardeditingmode.d.ts +13 -0
  81. package/src/integrations/standardeditingmode.js +1 -1
  82. package/src/integrations/style.d.ts +14 -0
  83. package/src/integrations/style.js +1 -1
  84. package/src/integrations/table.d.ts +38 -0
  85. package/src/integrations/table.js +1 -1
  86. package/src/integrations/tablecaption.d.ts +17 -0
  87. package/src/integrations/tablecaption.js +1 -1
  88. package/src/integrations/tableclipboard.d.ts +17 -0
  89. package/src/integrations/tableclipboard.js +1 -1
  90. package/src/integrations/tablecolumnresize.d.ts +22 -0
  91. package/src/integrations/tablecolumnresize.js +1 -1
  92. package/src/integrations/tableheadings.d.ts +17 -0
  93. package/src/integrations/tableheadings.js +1 -1
  94. package/src/integrations/tablemergesplit.d.ts +17 -0
  95. package/src/integrations/tablemergesplit.js +1 -1
  96. package/src/integrations/tableproperties.d.ts +23 -0
  97. package/src/integrations/tableproperties.js +1 -1
  98. package/src/integrations/title.d.ts +13 -0
  99. package/src/integrations/title.js +1 -1
  100. package/src/integrations/undo.d.ts +13 -0
  101. package/src/integrations/undo.js +1 -1
  102. package/src/integrations/utils.d.ts +17 -0
  103. package/src/integrations/utils.js +1 -1
  104. package/src/suggestion.d.ts +266 -0
  105. package/src/suggestion.js +1 -1
  106. package/src/suggestiondescriptionfactory.d.ts +151 -0
  107. package/src/suggestiondescriptionfactory.js +1 -1
  108. package/src/trackchanges.d.ts +222 -0
  109. package/src/trackchanges.js +1 -1
  110. package/src/trackchangesconfig.d.ts +53 -0
  111. package/src/trackchangesconfig.js +23 -0
  112. package/src/trackchangesdata.d.ts +38 -0
  113. package/src/trackchangesdata.js +1 -1
  114. package/src/trackchangesediting.d.ts +391 -0
  115. package/src/trackchangesediting.js +1 -1
  116. package/src/trackchangesui.d.ts +34 -0
  117. package/src/trackchangesui.js +1 -1
  118. package/src/ui/suggestioncontroller.d.ts +36 -0
  119. package/src/ui/suggestioncontroller.js +1 -1
  120. package/src/ui/view/basesuggestionthreadview.d.ts +166 -0
  121. package/src/ui/view/basesuggestionthreadview.js +1 -1
  122. package/src/ui/view/suggestionthreadview.d.ts +184 -0
  123. package/src/ui/view/suggestionthreadview.js +1 -1
  124. package/src/utils/common-translations.d.ts +5 -0
  125. package/src/utils/common-translations.js +1 -1
  126. package/src/utils/utils.d.ts +26 -0
  127. package/src/utils/utils.js +1 -1
@@ -0,0 +1,222 @@
1
+ /**
2
+ * @module track-changes/trackchanges
3
+ * @publicApi
4
+ */
5
+ import { Plugin, type PluginDependencies } from 'ckeditor5/src/core';
6
+ import 'ckeditor5-collaboration/src/collaboration-core';
7
+ import type { default as Suggestion, SuggestionJSON } from './suggestion';
8
+ import type SuggestionThreadView from './ui/view/suggestionthreadview';
9
+ /**
10
+ * A plugin that provides track changes mode for the editor. In track changes mode, all insertions are visually marked and all deletions
11
+ * are not deleted but also visually marked. Unsupported commands are disabled when the editor is in the track changes mode.
12
+ *
13
+ * To learn how to integrate the track changes feature with your editor, refer to the
14
+ * {@glink features/collaboration/track-changes/track-changes-integration Track changes integration} guide.
15
+ *
16
+ * Basic API:
17
+ *
18
+ * ```ts
19
+ * // Get the track changes plugin:
20
+ * const trackChangesPlugin = editor.plugins.get( 'TrackChanges' );
21
+ *
22
+ * // Add a suggestion:
23
+ * trackChangesPlugin.addSuggestion( suggestionData );
24
+ *
25
+ * // Get all suggestions:
26
+ * trackChangesPlugin.getSuggestions();
27
+ *
28
+ * // Set the adapter:
29
+ * trackChangesPlugin.adapter = {
30
+ * // ...
31
+ * }
32
+ * ```
33
+ *
34
+ * The plugin registers several commands:
35
+ *
36
+ * * `trackChanges` – Toggles the track changes mode in the editor.
37
+ * * `acceptSuggestion` – Accepts a suggestion with the specified ID.
38
+ * * `discardSuggestion` – Discards a suggestion with the specified ID.
39
+ * * `acceptAllSuggestions` – Accepts all suggestions.
40
+ * * `discardAllSuggestions` – Discards all suggestions.
41
+ * * `acceptSelectedSuggestions` – Accepts all suggestions in the current selection.
42
+ * * `discardSelectedSuggestions` – Discards all suggestions in the current selection.
43
+ *
44
+ * Examples:
45
+ *
46
+ * ```ts
47
+ * editor.execute( 'trackChanges' );
48
+ * editor.execute( 'acceptSuggestion', 'suggestion-1' );
49
+ * editor.execute( 'discardSuggestion', 'suggestion-1' );
50
+ * editor.execute( 'acceptAllSuggestions' );
51
+ * editor.execute( 'discardAllSuggestions' );
52
+ * editor.execute( 'acceptSelectedSuggestions' );
53
+ * editor.execute( 'discardSelectedSuggestions' )
54
+ * ```
55
+ *
56
+ * Note that there is no command to add a suggestion. This is because suggestions
57
+ * are added automatically when editing commands are executed while the editor is in track
58
+ * changes mode. For instance:
59
+ *
60
+ * ```ts
61
+ * // Turn on the track changes mode:
62
+ * editor.execute( 'trackChanges' );
63
+ *
64
+ * // Insert some text. It will be automatically inserted as a suggestion:
65
+ * editor.execute( 'input', { text: 'foo' } );
66
+ * ```
67
+ *
68
+ * @extends module:core/plugin~Plugin
69
+ */
70
+ export default class TrackChanges extends Plugin {
71
+ static get requires(): PluginDependencies;
72
+ static get pluginName(): 'TrackChanges';
73
+ /**
74
+ * An adapter object that should communicate with the data source to fetch or save the suggestion data.
75
+ *
76
+ * This is a shorthand to {@link module:track-changes/trackchangesediting~TrackChangesEditing#adapter `TrackChangesEditing#adapter`}.
77
+ */
78
+ set adapter(adapter: TrackChangesAdapter | null);
79
+ get adapter(): TrackChangesAdapter | null;
80
+ /**
81
+ * Adds suggestion data.
82
+ *
83
+ * Use this method to load the suggestion data during the editor initialization if you do not use the adapter integration.
84
+ */
85
+ addSuggestion(suggestionData: SuggestionData): Suggestion;
86
+ getSuggestions(options: {
87
+ skipNotAttached?: boolean;
88
+ toJSON: true;
89
+ }): Array<SuggestionJSON>;
90
+ getSuggestions(options?: {
91
+ skipNotAttached?: boolean;
92
+ toJSON?: false;
93
+ }): Array<Suggestion>;
94
+ getSuggestions(options: {
95
+ skipNotAttached?: boolean;
96
+ toJSON: boolean;
97
+ }): Array<Suggestion> | Array<SuggestionJSON>;
98
+ /**
99
+ * Returns the suggestion instance for a given ID.
100
+ */
101
+ getSuggestion(id: string): Suggestion;
102
+ }
103
+ /**
104
+ * The configuration of the track changes feature.
105
+ *
106
+ * Example:
107
+ *
108
+ * ```ts
109
+ * ClassicEditor
110
+ * .create( {
111
+ * // Track changes feature configuration.
112
+ * trackChanges: {
113
+ * // Do not allow users to comment suggestions (default is `false`).
114
+ * disableComments: true,
115
+ * // Do not track styling and formatting changes (default is `true`).
116
+ * trackFormatChanges: false
117
+ * }
118
+ * } )
119
+ * .then( ... )
120
+ * .catch( ... );
121
+ * ```
122
+ *
123
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
124
+ */
125
+ export interface TrackChangesConfig {
126
+ /**
127
+ * A property that specifies if the comments for suggestions are enabled or disabled.
128
+ * When the option is set to `true`, the comment thread UI for suggestions will be hidden
129
+ * and commenting suggestions will be disabled.
130
+ *
131
+ * Suggestion thread views will be marked with the additional `ck-suggestion--disabled-comments` class when the suggestion comments
132
+ * are disabled.
133
+ */
134
+ disableComments: boolean;
135
+ /**
136
+ * A property that specifies whether format changes should be tracked (`true`) or not (`false`).
137
+ *
138
+ * Format changes are all changes other than insertions and deletions, including: styling, structure, widgets properties, etc.
139
+ *
140
+ * Defaults to `true`.
141
+ */
142
+ trackFormatChanges: boolean;
143
+ /**
144
+ * A view class to be used to create suggestion thread views.
145
+ *
146
+ * {@link module:track-changes/ui/view/suggestionthreadview~SuggestionThreadView} is used by default
147
+ * when this property is not set.
148
+ */
149
+ SuggestionThreadView?: typeof SuggestionThreadView;
150
+ }
151
+ /**
152
+ * Track changes adapter.
153
+ *
154
+ * The track changes adapter is an object that communicates asynchronously with the data source to fetch or save the suggestion data.
155
+ * It is used internally by the track changes feature whenever a suggestion is loaded, created or deleted.
156
+ *
157
+ * The adapter is optional. You might need to provide it if you are {@glink features/collaboration/track-changes/track-changes-integration}
158
+ * using the track changes feature without real-time collaboration.
159
+ *
160
+ * To set the adapter, overwrite {@link module:track-changes/trackchanges~TrackChanges#adapter the `TrackChanges#adapter` property}.
161
+ */
162
+ export interface TrackChangesAdapter {
163
+ /**
164
+ * Called each time the suggestion data is needed.
165
+ *
166
+ * The method should return a promise that resolves with the suggestion data object.
167
+ *
168
+ * @param id The ID of the suggestion to get.
169
+ */
170
+ getSuggestion(id: string): Promise<SuggestionData>;
171
+ /**
172
+ * Called each time a new suggestion is created.
173
+ *
174
+ * The method should save the suggestion data in the database
175
+ * and return a promise that should be resolved when the save is
176
+ * completed.
177
+ *
178
+ * If the promise resolves with an object with the `createdAt` property,
179
+ * this suggestion property will be updated in the suggestion in the editor.
180
+ * This lets you update the suggestion data with server-side information.
181
+ *
182
+ * The `suggestionData` object does not expect the `authorId` property.
183
+ * For security reasons, the author of the suggestion should be set
184
+ * on the server side.
185
+ *
186
+ * If `suggestionData.originalSuggestionId` is set, the new suggestion should
187
+ * have the `authorId` property set to the same as the suggestion with
188
+ * `originalSuggestionId`. This happens when one user splits
189
+ * another user's suggestion, creating a new suggestion as a result. See
190
+ * {@glink features/collaboration/track-changes/track-changes-integration#implementation Track changes integration} guide.
191
+ *
192
+ * **Note:** Failure to properly handle this property will result in editor crash in some scenarios.
193
+ *
194
+ * In any other case, use the current (local) user to set `authorId`.
195
+ *
196
+ * The `suggestionData` object does not expect the `createdAt` property either.
197
+ * You should use the server-side time generator to ensure that all users
198
+ * see the same date.
199
+ *
200
+ * It is recommended to stringify `suggestionData.attributes` value to JSON and save it as a string in your database,
201
+ * and then to parse the strings when loading suggestions.
202
+ */
203
+ addSuggestion(suggestionData: AddSuggestionInput): Promise<SuggestionData>;
204
+ /**
205
+ * Called each time the suggestion properties change.
206
+ *
207
+ * The method should update the suggestion properties in the database
208
+ * and return a promise that should be resolved when the save is
209
+ * completed.
210
+ *
211
+ * Keep in mind that the `data` parameter only contains those
212
+ * properties of a suggestion which changed.
213
+ */
214
+ updateSuggestion(id: string, suggestionData: UpdateSuggestionInput): Promise<void>;
215
+ }
216
+ export type SuggestionData = SuggestionJSON & {
217
+ originalSuggestionId?: string | null;
218
+ };
219
+ export type AddSuggestionInput = Omit<SuggestionData, 'authorId' | 'createdAt'>;
220
+ export type UpdateSuggestionInput = Partial<Pick<SuggestionJSON, 'hasComments' | 'attributes'>> & {
221
+ state?: 'open' | 'accepted' | 'rejected';
222
+ };
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- var _0x3401=['getSuggestions','getSuggestion','Comments','get','pluginName','addSuggestionData','addSuggestion','adapter','plugins','editor'];(function(_0x3bb1b8,_0x3401ae){var _0x3bab64=function(_0x404868){while(--_0x404868){_0x3bb1b8['push'](_0x3bb1b8['shift']());}};_0x3bab64(++_0x3401ae);}(_0x3401,0x15e));var _0x3bab=function(_0x3bb1b8,_0x3401ae){_0x3bb1b8=_0x3bb1b8-0x0;var _0x3bab64=_0x3401[_0x3bb1b8];return _0x3bab64;};import{Plugin as _0x124aff}from'ckeditor5/src/core';import _0x4d11d2 from'./trackchangesui';import _0x5176dc from'./trackchangesediting';import'ckeditor5-collaboration/src/collaboration-core';export default class k extends _0x124aff{static get['requires'](){return[_0x5176dc,_0x4d11d2,_0x3bab('0x2')];}static get[_0x3bab('0x4')](){return'TrackChanges';}set[_0x3bab('0x7')](_0xc716fc){this[_0x3bab('0x9')]['plugins'][_0x3bab('0x3')](_0x5176dc)[_0x3bab('0x7')]=_0xc716fc;}get[_0x3bab('0x7')](){return this[_0x3bab('0x9')]['plugins']['get'](_0x5176dc)[_0x3bab('0x7')];}[_0x3bab('0x6')](_0x50421d){return this[_0x3bab('0x9')][_0x3bab('0x8')][_0x3bab('0x3')](_0x5176dc)[_0x3bab('0x5')](_0x50421d);}['getSuggestions'](_0x137c0b){return this[_0x3bab('0x9')][_0x3bab('0x8')][_0x3bab('0x3')](_0x5176dc)[_0x3bab('0x0')](_0x137c0b);}[_0x3bab('0x1')](_0x1b667a){return this[_0x3bab('0x9')][_0x3bab('0x8')][_0x3bab('0x3')](_0x5176dc)[_0x3bab('0x1')](_0x1b667a);}}
23
+ var _0xc61a=['getSuggestions','getSuggestion','editor','addSuggestion','TrackChanges','Comments','requires','get','adapter','plugins'];(function(_0x54cb26,_0xc61ae1){var _0x51bed3=function(_0x294f6c){while(--_0x294f6c){_0x54cb26['push'](_0x54cb26['shift']());}};_0x51bed3(++_0xc61ae1);}(_0xc61a,0x1c8));var _0x51be=function(_0x54cb26,_0xc61ae1){_0x54cb26=_0x54cb26-0x0;var _0x51bed3=_0xc61a[_0x54cb26];return _0x51bed3;};import{Plugin as _0xc86b69}from'ckeditor5/src/core';import _0x41eda8 from'./trackchangesui';import _0x58529a from'./trackchangesediting';import'ckeditor5-collaboration/src/collaboration-core';export default class k extends _0xc86b69{static get[_0x51be('0x0')](){return[_0x58529a,_0x41eda8,_0x51be('0x9')];}static get['pluginName'](){return _0x51be('0x8');}set[_0x51be('0x2')](_0x4fbd98){this[_0x51be('0x6')][_0x51be('0x3')][_0x51be('0x1')](_0x58529a)['adapter']=_0x4fbd98;}get[_0x51be('0x2')](){return this[_0x51be('0x6')][_0x51be('0x3')][_0x51be('0x1')](_0x58529a)[_0x51be('0x2')];}[_0x51be('0x7')](_0x525ca9){return this[_0x51be('0x6')]['plugins']['get'](_0x58529a)['addSuggestionData'](_0x525ca9);}[_0x51be('0x4')]({skipNotAttached:_0x4315c0=!0x1,toJSON:_0x33ad87=!0x1}={}){return this[_0x51be('0x6')][_0x51be('0x3')][_0x51be('0x1')](_0x58529a)[_0x51be('0x4')]({'skipNotAttached':_0x4315c0,'toJSON':_0x33ad87});}['getSuggestion'](_0x3a9be6){return this[_0x51be('0x6')]['plugins'][_0x51be('0x1')](_0x58529a)[_0x51be('0x5')](_0x3a9be6);}}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * @module track-changes/trackchangesconfig
3
+ * @publicApi
4
+ */
5
+ import type SuggestionThreadView from './ui/view/suggestionthreadview';
6
+ /**
7
+ * The configuration of the track changes feature.
8
+ *
9
+ * Example:
10
+ *
11
+ * ```ts
12
+ * ClassicEditor
13
+ * .create( {
14
+ * // Track changes feature configuration.
15
+ * trackChanges: {
16
+ * // Do not allow users to comment suggestions (default is `false`).
17
+ * disableComments: true,
18
+ * // Do not track styling and formatting changes (default is `true`).
19
+ * trackFormatChanges: false
20
+ * }
21
+ * } )
22
+ * .then( ... )
23
+ * .catch( ... );
24
+ * ```
25
+ *
26
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
27
+ */
28
+ export interface TrackChangesConfig {
29
+ /**
30
+ * A property that specifies if the comments for suggestions are enabled or disabled.
31
+ * When the option is set to `true`, the comment thread UI for suggestions will be hidden
32
+ * and commenting suggestions will be disabled.
33
+ *
34
+ * Suggestion thread views will be marked with the additional `ck-suggestion--disabled-comments` class when the suggestion comments
35
+ * are disabled.
36
+ */
37
+ disableComments: boolean;
38
+ /**
39
+ * A property that specifies whether format changes should be tracked (`true`) or not (`false`).
40
+ *
41
+ * Format changes are all changes other than insertions and deletions, including: styling, structure, widgets properties, etc.
42
+ *
43
+ * Defaults to `true`.
44
+ */
45
+ trackFormatChanges: boolean;
46
+ /**
47
+ * A view class to be used to create suggestion thread views.
48
+ *
49
+ * {@link module:track-changes/ui/view/suggestionthreadview~SuggestionThreadView} is used by default
50
+ * when this property is not set.
51
+ */
52
+ SuggestionThreadView?: typeof SuggestionThreadView;
53
+ }
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ *
4
+ *
5
+ *
6
+ *
7
+ * +---------------------------------------------------------------------------------+
8
+ * | |
9
+ * | Hello stranger! |
10
+ * | |
11
+ * | |
12
+ * | What you're currently looking at is the source code of a legally protected, |
13
+ * | proprietary software. Any attempts to deobfuscate / disassemble this code |
14
+ * | are forbidden and will result in legal consequences. |
15
+ * | |
16
+ * | |
17
+ * +---------------------------------------------------------------------------------+
18
+ *
19
+ *
20
+ *
21
+ *
22
+ */
23
+ export{};
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @module track-changes/trackchangesdata
3
+ * @publicApi
4
+ */
5
+ import { Plugin, type PluginDependencies } from 'ckeditor5/src/core';
6
+ /**
7
+ * This plugin returns the editor data with accepted or discarded suggestions without modifying the editor content.
8
+ *
9
+ * @extends module:core/plugin~Plugin
10
+ */
11
+ export default class TrackChangesData extends Plugin {
12
+ /**
13
+ * @inheritDoc
14
+ */
15
+ static get requires(): PluginDependencies;
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ static get pluginName(): 'TrackChangesData';
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ init(): void;
24
+ /**
25
+ * Returns the editor data with all the suggestions accepted.
26
+ *
27
+ * @param options Options for {@link module:engine/controller/datacontroller~DataController#get}.
28
+ * @returns A promise which resolves with the output data.
29
+ */
30
+ getDataWithAcceptedSuggestions(options: Record<string, unknown>): Promise<string>;
31
+ /**
32
+ * Returns the editor data with all the suggestions discarded.
33
+ *
34
+ * @param options Options for {@link module:engine/controller/datacontroller~DataController#get}.
35
+ * @returns A promise which resolves with the output data.
36
+ */
37
+ getDataWithDiscardedSuggestions(options: Record<string, unknown>): Promise<string>;
38
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xf511=['TrackChangesData','discardAllSuggestions','requires','acceptAllSuggestions','CommentsRepository','string','_adapter','config','appendChild','from','TrackChangesEditing','filter','WebSocketGateway','get','trackChangesData','plugins','addUser','every','getUser','WordCount','create','map','data','has','find','context','includes','reduce','result','pluginName','useAnonymousUser','editorCreator','addSuggestionData','Autosave','editor','Pagination','execute','track-changes-data-invalid-editor-creator','concat','constructor','function','users','name','extraPlugins','TrackChangesDataGetter','createDocumentFragment','model','set','Users','destroy'];(function(_0x8ec17b,_0xf511ab){const _0x54db7c=function(_0x1a8d53){while(--_0x1a8d53){_0x8ec17b['push'](_0x8ec17b['shift']());}};_0x54db7c(++_0xf511ab);}(_0xf511,0x89));const _0x54db=function(_0x8ec17b,_0xf511ab){_0x8ec17b=_0x8ec17b-0x0;let _0x54db7c=_0xf511[_0x8ec17b];return _0x54db7c;};import{Plugin as _0x320580}from'ckeditor5/src/core';import{CKEditorError as _0x1c27c4}from'ckeditor5/src/utils';import _0x4945ad from'./trackchangesediting';const D=['initialData',_0x54db('0x26'),'toolbar'],w=[_0x54db('0x19'),'RevisionTracker',_0x54db('0x2e'),_0x54db('0x20'),_0x54db('0x30')];export default class y extends _0x320580{static get[_0x54db('0xf')](){return[_0x4945ad];}static get[_0x54db('0x2a')](){return _0x54db('0xd');}['init'](){const _0x4723c7=this['editor'];if(_0x4723c7[_0x54db('0x14')]['define']('trackChangesData.editorCreator',_0x453200=>_0x4723c7[_0x54db('0x2')][_0x54db('0x21')]('',_0x453200)),_0x54db('0x3')!=typeof _0x4723c7[_0x54db('0x14')][_0x54db('0x1a')](_0x54db('0x1b'))[_0x54db('0x2c')])throw new _0x1c27c4(_0x54db('0x0'));}['getDataWithAcceptedSuggestions'](_0x762390){return T(this[_0x54db('0x2f')],!0x0,_0x762390);}['getDataWithDiscardedSuggestions'](_0x69f9d2){return T(this[_0x54db('0x2f')],!0x1,_0x69f9d2);}}class S extends _0x320580{static get[_0x54db('0x2a')](){return _0x54db('0x7');}['init'](){this[_0x54db('0x29')]='end',this['editor']['plugins']['get'](_0x54db('0x11'))['_adapter']={'getCommentThread':()=>new Promise(()=>{})},this['editor'][_0x54db('0x1c')][_0x54db('0x1a')](_0x54db('0x17'))[_0x54db('0x13')]=null;}}async function T(_0x4ad6e1,_0x2b5529,_0x4b05b3){const _0x25641d=function(_0x3cecb3){const _0x55b307={};for(const _0x280b30 of _0x3cecb3[_0x54db('0x14')]['names']())D[_0x54db('0x27')](_0x280b30)||(_0x55b307[_0x280b30]=_0x3cecb3[_0x54db('0x14')]['get'](_0x280b30));const _0x2c2918=_0x3cecb3[_0x54db('0x2')]['builtinPlugins']||[],_0x17449e=_0x55b307[_0x54db('0x6')]||[];delete _0x55b307[_0x54db('0x6')];const _0x33ac38=_0x2c2918['concat'](_0x55b307['plugins'])[_0x54db('0x1')](_0x17449e)[_0x54db('0x22')](_0x25f5dc=>_0x54db('0x12')==typeof _0x25f5dc?_0x2c2918[_0x54db('0x25')](_0x222157=>_0x222157[_0x54db('0x2a')]==_0x25f5dc):_0x25f5dc),_0x1e51f0=Array[_0x54db('0x16')](new Set(_0x33ac38)),_0x10928b=new Map();return _0x55b307[_0x54db('0x1c')]=_0x1e51f0[_0x54db('0x18')](_0x35b005=>A(_0x35b005,_0x10928b)),_0x55b307[_0x54db('0x1c')]['push'](S),_0x55b307[_0x54db('0x1c')]['push'](_0x4945ad),_0x55b307;}(_0x4ad6e1),_0x64854=document[_0x54db('0x8')](),_0x1e385d=_0x4ad6e1[_0x54db('0x14')][_0x54db('0x1a')](_0x54db('0x1b'))['editorCreator'],_0x29c268=await _0x1e385d(_0x25641d,()=>function(_0x31ebfb){const _0x363502=document['createElement']('div');return _0x31ebfb[_0x54db('0x15')](_0x363502),_0x363502;}(_0x64854));!function(_0x4d446c,_0x1729da){const _0x225d72=_0x4d446c[_0x54db('0x9')]['document']['getRootNames']()[_0x54db('0x28')]((_0x399952,_0x5c5740)=>(_0x399952[_0x5c5740]=_0x4d446c['data'][_0x54db('0x1a')]({'rootName':_0x5c5740}),_0x399952),{}),_0x46988f=_0x4d446c[_0x54db('0x1c')][_0x54db('0x1a')]('Users')[_0x54db('0x4')]['map'](_0x393f6d=>({'id':_0x393f6d['id']})),_0x36639a=_0x4d446c[_0x54db('0x1c')][_0x54db('0x1a')](_0x54db('0x17'))['getSuggestions']({'skipNotAttached':!0x0,'toJSON':!0x0}),_0x24ff73=_0x1729da[_0x54db('0x1c')]['get'](_0x54db('0xb')),_0x23dca6=_0x1729da[_0x54db('0x1c')][_0x54db('0x1a')]('TrackChangesEditing');for(const _0x566d66 of _0x46988f)_0x24ff73[_0x54db('0x1f')](_0x566d66['id'])||_0x24ff73[_0x54db('0x1d')](_0x566d66);_0x24ff73['me']||_0x24ff73[_0x54db('0x2b')]();for(const _0xd9a01 of _0x36639a)_0x23dca6[_0x54db('0x2d')](_0xd9a01);_0x1729da['data'][_0x54db('0xa')](_0x225d72);}(_0x4ad6e1,_0x29c268),_0x29c268[_0x54db('0x31')](_0x2b5529?_0x54db('0x10'):_0x54db('0xe'));const _0x340e84=_0x29c268[_0x54db('0x23')][_0x54db('0x1a')](_0x4b05b3);return await _0x29c268[_0x54db('0xc')](),_0x340e84;}function A(_0x7b2a16,_0x2ec9ee){const _0x34d999=_0x54db('0x3')==typeof _0x7b2a16?_0x7b2a16[_0x54db('0x2a')]||_0x7b2a16[_0x54db('0x5')]:_0x7b2a16;if(_0x2ec9ee[_0x54db('0x24')](_0x34d999))return _0x2ec9ee[_0x54db('0x1a')](_0x34d999);if(_0x2ec9ee['set'](_0x34d999,!0x0),_0x34d999&&w[_0x54db('0x27')](_0x34d999))return _0x2ec9ee[_0x54db('0xa')](_0x34d999,!0x1),!0x1;if(!_0x7b2a16[_0x54db('0xf')])return _0x2ec9ee[_0x54db('0xa')](_0x34d999,!0x0),!0x0;const _0x4d1b7d=_0x7b2a16[_0x54db('0xf')][_0x54db('0x1e')](_0x251bc6=>A(_0x251bc6,_0x2ec9ee));return _0x2ec9ee[_0x54db('0xa')](_0x34d999,_0x4d1b7d),_0x4d1b7d;}
23
+ const _0x31d8=['requires','data','_adapter','push','map','addUser','destroy','execute','reduce','getRootNames','create','trackChangesData.editorCreator','config','Pagination','editor','Users','includes','get','plugins','filter','TrackChangesData','context','editorCreator','Autosave','getDataWithDiscardedSuggestions','initialData','end','function','constructor','getSuggestions','model','document','createElement','pluginName','from','getDataWithAcceptedSuggestions','trackChangesData','CommentsRepository','toolbar','addSuggestionData','find','set','init','every','result','useAnonymousUser','name','extraPlugins','concat','RevisionTracker','discardAllSuggestions','names','TrackChangesEditing','acceptAllSuggestions','createDocumentFragment'];(function(_0x47019f,_0x31d858){const _0x56bf3b=function(_0x73786){while(--_0x73786){_0x47019f['push'](_0x47019f['shift']());}};_0x56bf3b(++_0x31d858);}(_0x31d8,0x18e));const _0x56bf=function(_0x47019f,_0x31d858){_0x47019f=_0x47019f-0x0;let _0x56bf3b=_0x31d8[_0x47019f];return _0x56bf3b;};import{Plugin as _0x2077db}from'ckeditor5/src/core';import{CKEditorError as _0x4c5bcd}from'ckeditor5/src/utils';import _0x4a4e5e from'./trackchangesediting';const C=[_0x56bf('0xc'),_0x56bf('0x8'),_0x56bf('0x19')],w=['WebSocketGateway',_0x56bf('0x24'),_0x56bf('0xa'),'WordCount',_0x56bf('0x0')];export default class T extends _0x2077db{static get[_0x56bf('0x2a')](){return[_0x4a4e5e];}static get['pluginName'](){return _0x56bf('0x7');}[_0x56bf('0x1d')](){const _0x4e1a1b=this['editor'];if(_0x4e1a1b[_0x56bf('0x36')]['define'](_0x56bf('0x35'),_0x47de40=>_0x4e1a1b[_0x56bf('0xf')][_0x56bf('0x34')]('',_0x47de40)),_0x56bf('0xe')!=typeof _0x4e1a1b[_0x56bf('0x36')]['get']('trackChangesData')['editorCreator'])throw new _0x4c5bcd('track-changes-data-invalid-editor-creator');}[_0x56bf('0x16')](_0x4d2ded){return D(this[_0x56bf('0x1')],!0x0,_0x4d2ded);}[_0x56bf('0xb')](_0xb4ce32){return D(this[_0x56bf('0x1')],!0x1,_0xb4ce32);}}class P extends _0x2077db{static get[_0x56bf('0x14')](){return'TrackChangesDataGetter';}constructor(_0xe0f74b){super(_0xe0f74b),this[_0x56bf('0x1f')]=_0x56bf('0xd');}[_0x56bf('0x1d')](){this[_0x56bf('0x1')][_0x56bf('0x5')]['get'](_0x56bf('0x18'))['adapter']={'addCommentThread':()=>new Promise(()=>{}),'getCommentThread':()=>new Promise(()=>{}),'updateCommentThread':()=>new Promise(()=>{}),'resolveCommentThread':()=>new Promise(()=>{}),'reopenCommentThread':()=>new Promise(()=>{}),'removeCommentThread':()=>new Promise(()=>{}),'addComment':()=>new Promise(()=>{}),'updateComment':()=>new Promise(()=>{}),'removeComment':()=>new Promise(()=>{})},this[_0x56bf('0x1')]['plugins'][_0x56bf('0x4')](_0x56bf('0x27'))[_0x56bf('0x2c')]=null;}}async function D(_0x11c25e,_0x1ced7c,_0x4778df){const _0x4f1a45=function(_0x19fee0){const _0x563429={};for(const _0x194c3c of _0x19fee0[_0x56bf('0x36')][_0x56bf('0x26')]())C[_0x56bf('0x3')](_0x194c3c)||(_0x563429[_0x194c3c]=_0x19fee0[_0x56bf('0x36')][_0x56bf('0x4')](_0x194c3c));const _0x206e3f=_0x19fee0[_0x56bf('0xf')]['builtinPlugins']||[],_0x4c85e2=_0x563429[_0x56bf('0x22')]||[];delete _0x563429[_0x56bf('0x22')];const _0x1ff4f8=_0x206e3f[_0x56bf('0x23')](_0x563429[_0x56bf('0x5')])[_0x56bf('0x23')](_0x4c85e2)[_0x56bf('0x2e')](_0x29010e=>'string'==typeof _0x29010e?_0x206e3f[_0x56bf('0x1b')](_0xb4650f=>_0xb4650f[_0x56bf('0x14')]==_0x29010e):_0x29010e),_0x25b5ca=Array[_0x56bf('0x15')](new Set(_0x1ff4f8)),_0x55a1fe=new Map();return _0x563429[_0x56bf('0x5')]=_0x25b5ca[_0x56bf('0x6')](_0x1bd028=>v(_0x1bd028,_0x55a1fe)),_0x563429[_0x56bf('0x5')][_0x56bf('0x2d')](P),_0x563429['plugins'][_0x56bf('0x2d')](_0x4a4e5e),_0x563429;}(_0x11c25e),_0x3bdb4c=document[_0x56bf('0x29')](),_0x2dd452=_0x11c25e[_0x56bf('0x36')]['get'](_0x56bf('0x17'))[_0x56bf('0x9')],_0x548694=await _0x2dd452(_0x4f1a45,()=>function(_0x4269bc){const _0x578989=document[_0x56bf('0x13')]('div');return _0x4269bc['appendChild'](_0x578989),_0x578989;}(_0x3bdb4c));!function(_0x4d7895,_0x3eae9c){const _0x563bf2=_0x4d7895[_0x56bf('0x11')][_0x56bf('0x12')][_0x56bf('0x33')]()[_0x56bf('0x32')]((_0x82158,_0x58ebe8)=>(_0x82158[_0x58ebe8]=_0x4d7895['data']['get']({'rootName':_0x58ebe8}),_0x82158),{}),_0x388898=_0x4d7895[_0x56bf('0x5')][_0x56bf('0x4')]('Users')['users'][_0x56bf('0x2e')](_0x65b675=>({'id':_0x65b675['id'],'name':_0x65b675['name']})),_0x567965=_0x4d7895[_0x56bf('0x5')][_0x56bf('0x4')]('TrackChangesEditing')[_0x56bf('0x10')]({'skipNotAttached':!0x0,'toJSON':!0x0}),_0x5b450c=_0x3eae9c[_0x56bf('0x5')][_0x56bf('0x4')](_0x56bf('0x2')),_0x59c59e=_0x3eae9c[_0x56bf('0x5')][_0x56bf('0x4')](_0x56bf('0x27'));for(const _0x4c0966 of _0x388898)_0x5b450c['getUser'](_0x4c0966['id'])||_0x5b450c[_0x56bf('0x2f')](_0x4c0966);_0x5b450c['me']||_0x5b450c[_0x56bf('0x20')]();for(const _0x116252 of _0x567965)_0x59c59e[_0x56bf('0x1a')](_0x116252);_0x3eae9c[_0x56bf('0x2b')][_0x56bf('0x1c')](_0x563bf2);}(_0x11c25e,_0x548694),_0x548694[_0x56bf('0x31')](_0x1ced7c?_0x56bf('0x28'):_0x56bf('0x25'));const _0x47641c=_0x548694[_0x56bf('0x2b')][_0x56bf('0x4')](_0x4778df);return await _0x548694[_0x56bf('0x30')](),_0x47641c;}function v(_0x12ee32,_0x4d0d2d){const _0x20e8d2='function'==typeof _0x12ee32?_0x12ee32[_0x56bf('0x14')]||_0x12ee32[_0x56bf('0x21')]:_0x12ee32;if(_0x4d0d2d['has'](_0x20e8d2))return _0x4d0d2d[_0x56bf('0x4')](_0x20e8d2);if(_0x4d0d2d[_0x56bf('0x1c')](_0x20e8d2,!0x0),_0x20e8d2&&w[_0x56bf('0x3')](_0x20e8d2))return _0x4d0d2d[_0x56bf('0x1c')](_0x20e8d2,!0x1),!0x1;if(!_0x12ee32[_0x56bf('0x2a')])return _0x4d0d2d[_0x56bf('0x1c')](_0x20e8d2,!0x0),!0x0;const _0x18d18f=_0x12ee32['requires'][_0x56bf('0x1e')](_0x16b2a3=>v(_0x16b2a3,_0x4d0d2d));return _0x4d0d2d[_0x56bf('0x1c')](_0x20e8d2,_0x18d18f),_0x18d18f;}