@ckeditor/ckeditor5-track-changes 36.0.1 → 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.
- package/build/track-changes.js +1 -1
- package/ckeditor5-metadata.json +10 -0
- package/package.json +20 -5
- package/src/augmentation.d.ts +36 -0
- package/src/augmentation.js +23 -0
- package/src/commands/acceptsuggestioncommand.d.ts +20 -0
- package/src/commands/acceptsuggestioncommand.js +1 -1
- package/src/commands/discardsuggestioncommand.d.ts +20 -0
- package/src/commands/discardsuggestioncommand.js +1 -1
- package/src/commands/executeonallsuggestionscommand.d.ts +20 -0
- package/src/commands/executeonallsuggestionscommand.js +1 -1
- package/src/commands/executeonselectedsuggestionscommand.d.ts +20 -0
- package/src/commands/executeonselectedsuggestionscommand.js +1 -1
- package/src/commands/trackchangescommand.d.ts +22 -0
- package/src/commands/trackchangescommand.js +1 -1
- package/src/index.d.ts +12 -0
- package/src/index.js +1 -1
- package/src/integrations/alignment.d.ts +13 -0
- package/src/integrations/alignment.js +1 -1
- package/src/integrations/basicstyles.d.ts +13 -0
- package/src/integrations/basicstyles.js +1 -1
- package/src/integrations/blockquote.d.ts +13 -0
- package/src/integrations/blockquote.js +1 -1
- package/src/integrations/ckbox.d.ts +13 -0
- package/src/integrations/ckbox.js +1 -1
- package/src/integrations/codeblock.d.ts +13 -0
- package/src/integrations/codeblock.js +1 -1
- package/src/integrations/comments.d.ts +10 -0
- package/src/integrations/comments.js +1 -1
- package/src/integrations/deletecommand.d.ts +12 -0
- package/src/integrations/deletecommand.js +1 -1
- package/src/integrations/documentlist.d.ts +13 -0
- package/src/integrations/documentlist.js +1 -1
- package/src/integrations/documentlistproperties.d.ts +25 -0
- package/src/integrations/documentlistproperties.js +1 -1
- package/src/integrations/entercommand.d.ts +11 -0
- package/src/integrations/entercommand.js +1 -1
- package/src/integrations/findandreplace.d.ts +17 -0
- package/src/integrations/findandreplace.js +1 -1
- package/src/integrations/font.d.ts +13 -0
- package/src/integrations/font.js +1 -1
- package/src/integrations/heading.d.ts +13 -0
- package/src/integrations/heading.js +1 -1
- package/src/integrations/highlight.d.ts +13 -0
- package/src/integrations/highlight.js +1 -1
- package/src/integrations/horizontalline.d.ts +13 -0
- package/src/integrations/horizontalline.js +1 -1
- package/src/integrations/htmlembed.d.ts +13 -0
- package/src/integrations/htmlembed.js +1 -1
- package/src/integrations/image.d.ts +13 -0
- package/src/integrations/image.js +1 -1
- package/src/integrations/imagereplace.d.ts +19 -0
- package/src/integrations/imagereplace.js +1 -1
- package/src/integrations/importword.d.ts +14 -0
- package/src/integrations/importword.js +1 -1
- package/src/integrations/indent.d.ts +13 -0
- package/src/integrations/indent.js +1 -1
- package/src/integrations/inputcommand.d.ts +11 -0
- package/src/integrations/inputcommand.js +1 -1
- package/src/integrations/link.d.ts +13 -0
- package/src/integrations/link.js +1 -1
- package/src/integrations/list.d.ts +13 -0
- package/src/integrations/list.js +1 -1
- package/src/integrations/listproperties.d.ts +25 -0
- package/src/integrations/listproperties.js +1 -1
- package/src/integrations/mediaembed.d.ts +13 -0
- package/src/integrations/mediaembed.js +1 -1
- package/src/integrations/mention.d.ts +13 -0
- package/src/integrations/mention.js +1 -1
- package/src/integrations/pagebreak.d.ts +13 -0
- package/src/integrations/pagebreak.js +1 -1
- package/src/integrations/paragraph.d.ts +13 -0
- package/src/integrations/paragraph.js +1 -1
- package/src/integrations/removeformat.d.ts +13 -0
- package/src/integrations/removeformat.js +1 -1
- package/src/integrations/restrictededitingmode.d.ts +13 -0
- package/src/integrations/restrictededitingmode.js +1 -1
- package/src/integrations/shiftentercommand.d.ts +11 -0
- package/src/integrations/shiftentercommand.js +1 -1
- package/src/integrations/standardeditingmode.d.ts +13 -0
- package/src/integrations/standardeditingmode.js +1 -1
- package/src/integrations/style.d.ts +14 -0
- package/src/integrations/style.js +1 -1
- package/src/integrations/table.d.ts +38 -0
- package/src/integrations/table.js +1 -1
- package/src/integrations/tablecaption.d.ts +17 -0
- package/src/integrations/tablecaption.js +1 -1
- package/src/integrations/tableclipboard.d.ts +17 -0
- package/src/integrations/tableclipboard.js +1 -1
- package/src/integrations/tablecolumnresize.d.ts +22 -0
- package/src/integrations/tablecolumnresize.js +1 -1
- package/src/integrations/tableheadings.d.ts +17 -0
- package/src/integrations/tableheadings.js +1 -1
- package/src/integrations/tablemergesplit.d.ts +17 -0
- package/src/integrations/tablemergesplit.js +1 -1
- package/src/integrations/tableproperties.d.ts +23 -0
- package/src/integrations/tableproperties.js +1 -1
- package/src/integrations/title.d.ts +13 -0
- package/src/integrations/title.js +1 -1
- package/src/integrations/undo.d.ts +13 -0
- package/src/integrations/undo.js +1 -1
- package/src/integrations/utils.d.ts +17 -0
- package/src/integrations/utils.js +1 -1
- package/src/suggestion.d.ts +266 -0
- package/src/suggestion.js +1 -1
- package/src/suggestiondescriptionfactory.d.ts +151 -0
- package/src/suggestiondescriptionfactory.js +1 -1
- package/src/trackchanges.d.ts +222 -0
- package/src/trackchanges.js +1 -1
- package/src/trackchangesconfig.d.ts +53 -0
- package/src/trackchangesconfig.js +23 -0
- package/src/trackchangesdata.d.ts +38 -0
- package/src/trackchangesdata.js +1 -1
- package/src/trackchangesediting.d.ts +391 -0
- package/src/trackchangesediting.js +1 -1
- package/src/trackchangesui.d.ts +34 -0
- package/src/trackchangesui.js +1 -1
- package/src/ui/suggestioncontroller.d.ts +36 -0
- package/src/ui/suggestioncontroller.js +1 -1
- package/src/ui/view/basesuggestionthreadview.d.ts +166 -0
- package/src/ui/view/basesuggestionthreadview.js +1 -1
- package/src/ui/view/suggestionthreadview.d.ts +184 -0
- package/src/ui/view/suggestionthreadview.js +1 -1
- package/src/utils/common-translations.d.ts +5 -0
- package/src/utils/common-translations.js +1 -1
- package/src/utils/utils.d.ts +26 -0
- 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
|
+
};
|
package/src/trackchanges.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
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
|
+
}
|
package/src/trackchangesdata.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
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;}
|