@ckeditor/ckeditor5-track-changes 36.0.0 → 37.0.0-rc.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 +21 -6
  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 _0x2ec9=['TrackChanges','getSuggestions','pluginName','requires','editor','adapter','plugins','Comments','addSuggestionData','get'];(function(_0x5e54a3,_0x2ec938){var _0x34f74d=function(_0x151d42){while(--_0x151d42){_0x5e54a3['push'](_0x5e54a3['shift']());}};_0x34f74d(++_0x2ec938);}(_0x2ec9,0x1f0));var _0x34f7=function(_0x5e54a3,_0x2ec938){_0x5e54a3=_0x5e54a3-0x0;var _0x34f74d=_0x2ec9[_0x5e54a3];return _0x34f74d;};import{Plugin as _0x392369}from'ckeditor5/src/core';import _0x25cbda from'./trackchangesui';import _0x169b85 from'./trackchangesediting';import'ckeditor5-collaboration/src/collaboration-core';export default class k extends _0x392369{static get[_0x34f7('0x7')](){return[_0x169b85,_0x25cbda,_0x34f7('0x1')];}static get[_0x34f7('0x6')](){return _0x34f7('0x4');}set[_0x34f7('0x9')](_0x371ce6){this[_0x34f7('0x8')][_0x34f7('0x0')]['get'](_0x169b85)[_0x34f7('0x9')]=_0x371ce6;}get[_0x34f7('0x9')](){return this[_0x34f7('0x8')][_0x34f7('0x0')][_0x34f7('0x3')](_0x169b85)[_0x34f7('0x9')];}['addSuggestion'](_0x4dcca9){return this[_0x34f7('0x8')][_0x34f7('0x0')]['get'](_0x169b85)[_0x34f7('0x2')](_0x4dcca9);}[_0x34f7('0x5')](_0x1ab63a){return this['editor']['plugins'][_0x34f7('0x3')](_0x169b85)[_0x34f7('0x5')](_0x1ab63a);}['getSuggestion'](_0xcdddb){return this[_0x34f7('0x8')][_0x34f7('0x0')]['get'](_0x169b85)['getSuggestion'](_0xcdddb);}}
23
+ var _0x4a6b=['requires','plugins','getSuggestions','addSuggestion','get','editor','adapter','Comments','getSuggestion'];(function(_0x584dd6,_0x4a6b0a){var _0x3af6a5=function(_0x1afa53){while(--_0x1afa53){_0x584dd6['push'](_0x584dd6['shift']());}};_0x3af6a5(++_0x4a6b0a);}(_0x4a6b,0x1d7));var _0x3af6=function(_0x584dd6,_0x4a6b0a){_0x584dd6=_0x584dd6-0x0;var _0x3af6a5=_0x4a6b[_0x584dd6];return _0x3af6a5;};import{Plugin as _0x203b58}from'ckeditor5/src/core';import _0x106c0b from'./trackchangesui';import _0x5ae3f2 from'./trackchangesediting';import'ckeditor5-collaboration/src/collaboration-core';export default class k extends _0x203b58{static get[_0x3af6('0x6')](){return[_0x5ae3f2,_0x106c0b,_0x3af6('0x4')];}static get['pluginName'](){return'TrackChanges';}set[_0x3af6('0x3')](_0x732650){this['editor']['plugins'][_0x3af6('0x1')](_0x5ae3f2)[_0x3af6('0x3')]=_0x732650;}get[_0x3af6('0x3')](){return this[_0x3af6('0x2')]['plugins'][_0x3af6('0x1')](_0x5ae3f2)[_0x3af6('0x3')];}[_0x3af6('0x0')](_0x19a22d){return this[_0x3af6('0x2')][_0x3af6('0x7')]['get'](_0x5ae3f2)['addSuggestionData'](_0x19a22d);}['getSuggestions']({skipNotAttached:_0x9b03c2=!0x1,toJSON:_0xe86d56=!0x1}={}){return this[_0x3af6('0x2')][_0x3af6('0x7')][_0x3af6('0x1')](_0x5ae3f2)[_0x3af6('0x8')]({'skipNotAttached':_0x9b03c2,'toJSON':_0xe86d56});}[_0x3af6('0x5')](_0x367e27){return this[_0x3af6('0x2')]['plugins']['get'](_0x5ae3f2)[_0x3af6('0x5')](_0x367e27);}}
@@ -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 _0x37b8=['data','_adapter','find','getUser','get','init','names','editorCreator','config','plugins','TrackChangesEditing','WordCount','execute','reduce','trackChangesData','discardAllSuggestions','push','initialData','RevisionTracker','concat','create','extraPlugins','map','CommentsRepository','acceptAllSuggestions','includes','trackChangesData.editorCreator','model','TrackChangesDataGetter','getDataWithDiscardedSuggestions','Users','every','addSuggestionData','result','users','set','document','string','WebSocketGateway','getSuggestions','editor','appendChild','Pagination','destroy','pluginName','builtinPlugins','context','useAnonymousUser','requires','TrackChangesData','define','toolbar','function','getDataWithAcceptedSuggestions'];(function(_0x3c9e6c,_0x37b8e1){const _0x2ea25f=function(_0x3fc7a){while(--_0x3fc7a){_0x3c9e6c['push'](_0x3c9e6c['shift']());}};_0x2ea25f(++_0x37b8e1);}(_0x37b8,0x162));const _0x2ea2=function(_0x3c9e6c,_0x37b8e1){_0x3c9e6c=_0x3c9e6c-0x0;let _0x2ea25f=_0x37b8[_0x3c9e6c];return _0x2ea25f;};import{Plugin as _0x2eeda3}from'ckeditor5/src/core';import{CKEditorError as _0x2c1ed2}from'ckeditor5/src/utils';import _0x2023c7 from'./trackchangesediting';const D=[_0x2ea2('0x29'),_0x2ea2('0x10'),_0x2ea2('0x15')],w=[_0x2ea2('0x8'),_0x2ea2('0x2a'),'Autosave',_0x2ea2('0x23'),_0x2ea2('0xc')];export default class y extends _0x2eeda3{static get['requires'](){return[_0x2023c7];}static get['pluginName'](){return _0x2ea2('0x13');}[_0x2ea2('0x1d')](){const _0x4bf28e=this[_0x2ea2('0xa')];if(_0x4bf28e[_0x2ea2('0x20')][_0x2ea2('0x14')](_0x2ea2('0x32'),_0x572127=>_0x4bf28e['constructor'][_0x2ea2('0x2c')]('',_0x572127)),_0x2ea2('0x16')!=typeof _0x4bf28e[_0x2ea2('0x20')][_0x2ea2('0x1c')]('trackChangesData')[_0x2ea2('0x1f')])throw new _0x2c1ed2('track-changes-data-invalid-editor-creator');}[_0x2ea2('0x17')](_0x4bf57d){return T(this['editor'],!0x0,_0x4bf57d);}[_0x2ea2('0x35')](_0x4ce19a){return T(this[_0x2ea2('0xa')],!0x1,_0x4ce19a);}}class S extends _0x2eeda3{static get['pluginName'](){return _0x2ea2('0x34');}['init'](){this[_0x2ea2('0x3')]='end',this['editor'][_0x2ea2('0x21')][_0x2ea2('0x1c')](_0x2ea2('0x2f'))[_0x2ea2('0x19')]={'getCommentThread':()=>new Promise(()=>{})},this[_0x2ea2('0xa')][_0x2ea2('0x21')]['get'](_0x2ea2('0x22'))[_0x2ea2('0x19')]=null;}}async function T(_0xd9027,_0x78d933,_0x429ddc){const _0x5af8a2=function(_0x39717a){const _0x3aea50={};for(const _0x2825d8 of _0x39717a[_0x2ea2('0x20')][_0x2ea2('0x1e')]())D[_0x2ea2('0x31')](_0x2825d8)||(_0x3aea50[_0x2825d8]=_0x39717a[_0x2ea2('0x20')][_0x2ea2('0x1c')](_0x2825d8));const _0x320336=_0x39717a['constructor'][_0x2ea2('0xf')]||[],_0xf0aca4=_0x3aea50[_0x2ea2('0x2d')]||[];delete _0x3aea50['extraPlugins'];const _0x5c50b7=_0x320336[_0x2ea2('0x2b')](_0x3aea50[_0x2ea2('0x21')])[_0x2ea2('0x2b')](_0xf0aca4)[_0x2ea2('0x2e')](_0x239d6c=>_0x2ea2('0x7')==typeof _0x239d6c?_0x320336[_0x2ea2('0x1a')](_0x5d8f73=>_0x5d8f73['pluginName']==_0x239d6c):_0x239d6c),_0x46567f=Array['from'](new Set(_0x5c50b7)),_0x101e98=new Map();return _0x3aea50[_0x2ea2('0x21')]=_0x46567f['filter'](_0x3ad78a=>A(_0x3ad78a,_0x101e98)),_0x3aea50[_0x2ea2('0x21')][_0x2ea2('0x28')](S),_0x3aea50[_0x2ea2('0x21')]['push'](_0x2023c7),_0x3aea50;}(_0xd9027),_0x1c3f39=document['createDocumentFragment'](),_0x2d8b71=_0xd9027[_0x2ea2('0x20')][_0x2ea2('0x1c')](_0x2ea2('0x26'))[_0x2ea2('0x1f')],_0x27bb97=await _0x2d8b71(_0x5af8a2,()=>function(_0x4e1717){const _0x4cfcd3=document['createElement']('div');return _0x4e1717[_0x2ea2('0xb')](_0x4cfcd3),_0x4cfcd3;}(_0x1c3f39));!function(_0x307099,_0x46de50){const _0x2870ba=_0x307099[_0x2ea2('0x33')][_0x2ea2('0x6')]['getRootNames']()[_0x2ea2('0x25')]((_0x13dcde,_0x13b71d)=>(_0x13dcde[_0x13b71d]=_0x307099['data']['get']({'rootName':_0x13b71d}),_0x13dcde),{}),_0x4ac16f=_0x307099['plugins'][_0x2ea2('0x1c')](_0x2ea2('0x0'))[_0x2ea2('0x4')][_0x2ea2('0x2e')](_0x58baad=>({'id':_0x58baad['id']})),_0x3827ac=_0x307099[_0x2ea2('0x21')][_0x2ea2('0x1c')](_0x2ea2('0x22'))[_0x2ea2('0x9')]({'skipNotAttached':!0x0,'toJSON':!0x0}),_0x5690bc=_0x46de50['plugins'][_0x2ea2('0x1c')](_0x2ea2('0x0')),_0x3f59bd=_0x46de50[_0x2ea2('0x21')][_0x2ea2('0x1c')](_0x2ea2('0x22'));for(const _0x1ad55d of _0x4ac16f)_0x5690bc[_0x2ea2('0x1b')](_0x1ad55d['id'])||_0x5690bc['addUser'](_0x1ad55d);_0x5690bc['me']||_0x5690bc[_0x2ea2('0x11')]();for(const _0x5720ef of _0x3827ac)_0x3f59bd[_0x2ea2('0x2')](_0x5720ef);_0x46de50[_0x2ea2('0x18')][_0x2ea2('0x5')](_0x2870ba);}(_0xd9027,_0x27bb97),_0x27bb97[_0x2ea2('0x24')](_0x78d933?_0x2ea2('0x30'):_0x2ea2('0x27'));const _0x45cbd9=_0x27bb97[_0x2ea2('0x18')]['get'](_0x429ddc);return await _0x27bb97[_0x2ea2('0xd')](),_0x45cbd9;}function A(_0x23d0e5,_0x49a90b){const _0x1d5932='function'==typeof _0x23d0e5?_0x23d0e5[_0x2ea2('0xe')]||_0x23d0e5['name']:_0x23d0e5;if(_0x49a90b['has'](_0x1d5932))return _0x49a90b['get'](_0x1d5932);if(_0x49a90b['set'](_0x1d5932,!0x0),_0x1d5932&&w[_0x2ea2('0x31')](_0x1d5932))return _0x49a90b[_0x2ea2('0x5')](_0x1d5932,!0x1),!0x1;if(!_0x23d0e5[_0x2ea2('0x12')])return _0x49a90b[_0x2ea2('0x5')](_0x1d5932,!0x0),!0x0;const _0x3274d0=_0x23d0e5[_0x2ea2('0x12')][_0x2ea2('0x1')](_0xc2f404=>A(_0xc2f404,_0x49a90b));return _0x49a90b[_0x2ea2('0x5')](_0x1d5932,_0x3274d0),_0x3274d0;}
23
+ const _0xf044=['addSuggestionData','get','TrackChangesDataGetter','document','set','div','appendChild','TrackChangesData','has','toolbar','Pagination','map','init','users','names','concat','string','getSuggestions','acceptAllSuggestions','requires','name','destroy','end','plugins','WebSocketGateway','builtinPlugins','every','constructor','getDataWithAcceptedSuggestions','trackChangesData','getUser','RevisionTracker','function','extraPlugins','initialData','TrackChangesEditing','Users','create','filter','define','data','push','config','editorCreator','pluginName','CommentsRepository','result','createElement','getRootNames','WordCount','editor','createDocumentFragment','context','includes','model'];(function(_0x3c8d1f,_0xf044a4){const _0x52a6a0=function(_0x17ec5e){while(--_0x17ec5e){_0x3c8d1f['push'](_0x3c8d1f['shift']());}};_0x52a6a0(++_0xf044a4);}(_0xf044,0x162));const _0x52a6=function(_0x3c8d1f,_0xf044a4){_0x3c8d1f=_0x3c8d1f-0x0;let _0x52a6a0=_0xf044[_0x3c8d1f];return _0x52a6a0;};import{Plugin as _0x5ce03c}from'ckeditor5/src/core';import{CKEditorError as _0x1c637e}from'ckeditor5/src/utils';import _0x40f7f3 from'./trackchangesediting';const C=[_0x52a6('0xa'),_0x52a6('0x1c'),_0x52a6('0x28')],w=[_0x52a6('0x0'),_0x52a6('0x7'),'Autosave',_0x52a6('0x19'),_0x52a6('0x29')];export default class T extends _0x5ce03c{static get[_0x52a6('0x32')](){return[_0x40f7f3];}static get[_0x52a6('0x14')](){return _0x52a6('0x26');}['init'](){const _0x148f8f=this[_0x52a6('0x1a')];if(_0x148f8f[_0x52a6('0x12')][_0x52a6('0xf')]('trackChangesData.editorCreator',_0x8cdae9=>_0x148f8f[_0x52a6('0x3')][_0x52a6('0xd')]('',_0x8cdae9)),_0x52a6('0x8')!=typeof _0x148f8f['config'][_0x52a6('0x20')]('trackChangesData')[_0x52a6('0x13')])throw new _0x1c637e('track-changes-data-invalid-editor-creator');}[_0x52a6('0x4')](_0x574a40){return D(this[_0x52a6('0x1a')],!0x0,_0x574a40);}['getDataWithDiscardedSuggestions'](_0x175049){return D(this[_0x52a6('0x1a')],!0x1,_0x175049);}}class P extends _0x5ce03c{static get['pluginName'](){return _0x52a6('0x21');}constructor(_0x5ee1f6){super(_0x5ee1f6),this[_0x52a6('0x16')]=_0x52a6('0x35');}[_0x52a6('0x2b')](){this[_0x52a6('0x1a')][_0x52a6('0x36')]['get'](_0x52a6('0x15'))['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[_0x52a6('0x1a')][_0x52a6('0x36')][_0x52a6('0x20')]('TrackChangesEditing')['_adapter']=null;}}async function D(_0x36ea03,_0x71a7d7,_0x486b53){const _0x348fcc=function(_0x12472b){const _0x260d2c={};for(const _0x5ac9ff of _0x12472b[_0x52a6('0x12')][_0x52a6('0x2d')]())C[_0x52a6('0x1d')](_0x5ac9ff)||(_0x260d2c[_0x5ac9ff]=_0x12472b['config'][_0x52a6('0x20')](_0x5ac9ff));const _0x57af44=_0x12472b['constructor'][_0x52a6('0x1')]||[],_0x1dc6d0=_0x260d2c[_0x52a6('0x9')]||[];delete _0x260d2c['extraPlugins'];const _0x826293=_0x57af44['concat'](_0x260d2c['plugins'])[_0x52a6('0x2e')](_0x1dc6d0)[_0x52a6('0x2a')](_0x2a24da=>_0x52a6('0x2f')==typeof _0x2a24da?_0x57af44['find'](_0x26e680=>_0x26e680['pluginName']==_0x2a24da):_0x2a24da),_0x353ffd=Array['from'](new Set(_0x826293)),_0x5b78e5=new Map();return _0x260d2c['plugins']=_0x353ffd[_0x52a6('0xe')](_0x1c4948=>v(_0x1c4948,_0x5b78e5)),_0x260d2c['plugins'][_0x52a6('0x11')](P),_0x260d2c[_0x52a6('0x36')]['push'](_0x40f7f3),_0x260d2c;}(_0x36ea03),_0x443231=document[_0x52a6('0x1b')](),_0x34c6c9=_0x36ea03['config'][_0x52a6('0x20')](_0x52a6('0x5'))[_0x52a6('0x13')],_0x4761a3=await _0x34c6c9(_0x348fcc,()=>function(_0x3fd2c0){const _0x23213e=document[_0x52a6('0x17')](_0x52a6('0x24'));return _0x3fd2c0[_0x52a6('0x25')](_0x23213e),_0x23213e;}(_0x443231));!function(_0xdfeb54,_0x461d44){const _0x229411=_0xdfeb54[_0x52a6('0x1e')][_0x52a6('0x22')][_0x52a6('0x18')]()['reduce']((_0xa51e2a,_0x3e6c14)=>(_0xa51e2a[_0x3e6c14]=_0xdfeb54[_0x52a6('0x10')][_0x52a6('0x20')]({'rootName':_0x3e6c14}),_0xa51e2a),{}),_0x4eaaea=_0xdfeb54['plugins'][_0x52a6('0x20')](_0x52a6('0xc'))[_0x52a6('0x2c')][_0x52a6('0x2a')](_0x54573d=>({'id':_0x54573d['id'],'name':_0x54573d[_0x52a6('0x33')]})),_0x2b4f73=_0xdfeb54[_0x52a6('0x36')][_0x52a6('0x20')]('TrackChangesEditing')[_0x52a6('0x30')]({'skipNotAttached':!0x0,'toJSON':!0x0}),_0x387145=_0x461d44[_0x52a6('0x36')][_0x52a6('0x20')]('Users'),_0x1e8c3a=_0x461d44[_0x52a6('0x36')][_0x52a6('0x20')](_0x52a6('0xb'));for(const _0x40dcfa of _0x4eaaea)_0x387145[_0x52a6('0x6')](_0x40dcfa['id'])||_0x387145['addUser'](_0x40dcfa);_0x387145['me']||_0x387145['useAnonymousUser']();for(const _0x438702 of _0x2b4f73)_0x1e8c3a[_0x52a6('0x1f')](_0x438702);_0x461d44[_0x52a6('0x10')][_0x52a6('0x23')](_0x229411);}(_0x36ea03,_0x4761a3),_0x4761a3['execute'](_0x71a7d7?_0x52a6('0x31'):'discardAllSuggestions');const _0x363b3c=_0x4761a3['data'][_0x52a6('0x20')](_0x486b53);return await _0x4761a3[_0x52a6('0x34')](),_0x363b3c;}function v(_0x410152,_0x2d9f40){const _0x8aeccf=_0x52a6('0x8')==typeof _0x410152?_0x410152[_0x52a6('0x14')]||_0x410152[_0x52a6('0x33')]:_0x410152;if(_0x2d9f40[_0x52a6('0x27')](_0x8aeccf))return _0x2d9f40[_0x52a6('0x20')](_0x8aeccf);if(_0x2d9f40[_0x52a6('0x23')](_0x8aeccf,!0x0),_0x8aeccf&&w[_0x52a6('0x1d')](_0x8aeccf))return _0x2d9f40[_0x52a6('0x23')](_0x8aeccf,!0x1),!0x1;if(!_0x410152['requires'])return _0x2d9f40['set'](_0x8aeccf,!0x0),!0x0;const _0x320b4b=_0x410152['requires'][_0x52a6('0x2')](_0x3caeb4=>v(_0x3caeb4,_0x2d9f40));return _0x2d9f40[_0x52a6('0x23')](_0x8aeccf,_0x320b4b),_0x320b4b;}