@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.
- 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 _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
|
+
}
|
package/src/trackchangesdata.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
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;}
|