@ckeditor/ckeditor5-track-changes 48.2.0 → 48.3.0-alpha.1
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/dist/augmentation.d.ts +42 -42
- package/dist/commands/acceptsuggestioncommand.d.ts +19 -19
- package/dist/commands/discardsuggestioncommand.d.ts +19 -19
- package/dist/commands/executeonallsuggestionscommand.d.ts +19 -19
- package/dist/commands/executeonselectedsuggestionscommand.d.ts +19 -19
- package/dist/commands/previewfinalcontentcommand.d.ts +21 -21
- package/dist/commands/trackchangescommand.d.ts +21 -21
- package/dist/index.d.ts +23 -23
- package/dist/index.js +4 -4
- package/dist/integrations/ai.d.ts +12 -12
- package/dist/integrations/aiassistant.d.ts +12 -12
- package/dist/integrations/aiquickactions.d.ts +12 -12
- package/dist/integrations/alignment.d.ts +12 -12
- package/dist/integrations/basicstyles.d.ts +12 -12
- package/dist/integrations/blockquote.d.ts +12 -12
- package/dist/integrations/bookmark.d.ts +12 -12
- package/dist/integrations/casechange.d.ts +12 -12
- package/dist/integrations/ckbox.d.ts +12 -12
- package/dist/integrations/codeblock.d.ts +12 -12
- package/dist/integrations/comments.d.ts +9 -9
- package/dist/integrations/deletecommand.d.ts +12 -12
- package/dist/integrations/emoji.d.ts +12 -12
- package/dist/integrations/entercommand.d.ts +11 -11
- package/dist/integrations/findandreplace.d.ts +16 -16
- package/dist/integrations/font.d.ts +12 -12
- package/dist/integrations/footnotes.d.ts +12 -12
- package/dist/integrations/formatpainter.d.ts +12 -12
- package/dist/integrations/generalhtmlsupport.d.ts +24 -24
- package/dist/integrations/heading.d.ts +12 -12
- package/dist/integrations/highlight.d.ts +12 -12
- package/dist/integrations/horizontalline.d.ts +12 -12
- package/dist/integrations/htmlembed.d.ts +12 -12
- package/dist/integrations/image.d.ts +12 -12
- package/dist/integrations/imagereplace.d.ts +12 -12
- package/dist/integrations/imagestyle.d.ts +12 -12
- package/dist/integrations/importword.d.ts +13 -13
- package/dist/integrations/indent.d.ts +12 -12
- package/dist/integrations/inputcommand.d.ts +11 -11
- package/dist/integrations/legacylist.d.ts +12 -12
- package/dist/integrations/legacylistproperties.d.ts +24 -24
- package/dist/integrations/lineheight.d.ts +12 -12
- package/dist/integrations/link.d.ts +12 -12
- package/dist/integrations/list.d.ts +12 -12
- package/dist/integrations/listproperties.d.ts +15 -15
- package/dist/integrations/mediaembed.d.ts +12 -12
- package/dist/integrations/mediaembedstyle.d.ts +13 -13
- package/dist/integrations/mention.d.ts +12 -12
- package/dist/integrations/mergefields.d.ts +12 -12
- package/dist/integrations/multilevellist.d.ts +19 -19
- package/dist/integrations/pagebreak.d.ts +12 -12
- package/dist/integrations/paragraph.d.ts +12 -12
- package/dist/integrations/removeformat.d.ts +12 -12
- package/dist/integrations/replacesourcecommand.d.ts +13 -13
- package/dist/integrations/restrictededitingmode.d.ts +12 -12
- package/dist/integrations/shiftentercommand.d.ts +9 -9
- package/dist/integrations/standardeditingmode.d.ts +12 -12
- package/dist/integrations/style.d.ts +29 -29
- package/dist/integrations/table.d.ts +34 -34
- package/dist/integrations/tablecaption.d.ts +17 -17
- package/dist/integrations/tableclipboard.d.ts +15 -15
- package/dist/integrations/tablecolumnresize.d.ts +21 -21
- package/dist/integrations/tablefooters.d.ts +17 -17
- package/dist/integrations/tableheadings.d.ts +17 -17
- package/dist/integrations/tablelayout.d.ts +12 -12
- package/dist/integrations/tablemergesplit.d.ts +17 -17
- package/dist/integrations/tableofcontents.d.ts +12 -12
- package/dist/integrations/tableproperties.d.ts +30 -30
- package/dist/integrations/template.d.ts +12 -12
- package/dist/integrations/title.d.ts +12 -12
- package/dist/integrations/undo.d.ts +12 -12
- package/dist/integrations/uploadcare.d.ts +12 -12
- package/dist/integrations/utils.d.ts +8 -8
- package/dist/suggestion.d.ts +285 -283
- package/dist/suggestiondescriptionfactory.d.ts +165 -165
- package/dist/trackchanges.d.ts +178 -178
- package/dist/trackchangesconfig.d.ts +136 -103
- package/dist/trackchangesdata.d.ts +59 -59
- package/dist/trackchangesediting.d.ts +565 -565
- package/dist/trackchangespreview.d.ts +26 -26
- package/dist/trackchangesui.d.ts +52 -52
- package/dist/translations/af.js +1 -1
- package/dist/translations/af.umd.js +1 -1
- package/dist/translations/ar.js +1 -1
- package/dist/translations/ar.umd.js +1 -1
- package/dist/translations/ast.js +1 -1
- package/dist/translations/ast.umd.js +1 -1
- package/dist/translations/az.js +1 -1
- package/dist/translations/az.umd.js +1 -1
- package/dist/translations/be.js +1 -1
- package/dist/translations/be.umd.js +1 -1
- package/dist/translations/bg.js +1 -1
- package/dist/translations/bg.umd.js +1 -1
- package/dist/translations/bn.js +1 -1
- package/dist/translations/bn.umd.js +1 -1
- package/dist/translations/bs.js +1 -1
- package/dist/translations/bs.umd.js +1 -1
- package/dist/translations/ca.js +1 -1
- package/dist/translations/ca.umd.js +1 -1
- package/dist/translations/cs.js +1 -1
- package/dist/translations/cs.umd.js +1 -1
- package/dist/translations/da.js +1 -1
- package/dist/translations/da.umd.js +1 -1
- package/dist/translations/de-ch.js +1 -1
- package/dist/translations/de-ch.umd.js +1 -1
- package/dist/translations/de.js +1 -1
- package/dist/translations/de.umd.js +1 -1
- package/dist/translations/el.js +1 -1
- package/dist/translations/el.umd.js +1 -1
- package/dist/translations/en-au.js +1 -1
- package/dist/translations/en-au.umd.js +1 -1
- package/dist/translations/en-gb.js +1 -1
- package/dist/translations/en-gb.umd.js +1 -1
- package/dist/translations/en.js +1 -1
- package/dist/translations/en.umd.js +1 -1
- package/dist/translations/eo.js +1 -1
- package/dist/translations/eo.umd.js +1 -1
- package/dist/translations/es-co.js +1 -1
- package/dist/translations/es-co.umd.js +1 -1
- package/dist/translations/es.js +1 -1
- package/dist/translations/es.umd.js +1 -1
- package/dist/translations/et.js +1 -1
- package/dist/translations/et.umd.js +1 -1
- package/dist/translations/eu.js +1 -1
- package/dist/translations/eu.umd.js +1 -1
- package/dist/translations/fa.js +1 -1
- package/dist/translations/fa.umd.js +1 -1
- package/dist/translations/fi.js +1 -1
- package/dist/translations/fi.umd.js +1 -1
- package/dist/translations/fr.js +1 -1
- package/dist/translations/fr.umd.js +1 -1
- package/dist/translations/gl.js +1 -1
- package/dist/translations/gl.umd.js +1 -1
- package/dist/translations/gu.js +1 -1
- package/dist/translations/gu.umd.js +1 -1
- package/dist/translations/he.js +1 -1
- package/dist/translations/he.umd.js +1 -1
- package/dist/translations/hi.js +1 -1
- package/dist/translations/hi.umd.js +1 -1
- package/dist/translations/hr.js +1 -1
- package/dist/translations/hr.umd.js +1 -1
- package/dist/translations/hu.js +1 -1
- package/dist/translations/hu.umd.js +1 -1
- package/dist/translations/hy.js +1 -1
- package/dist/translations/hy.umd.js +1 -1
- package/dist/translations/id.js +1 -1
- package/dist/translations/id.umd.js +1 -1
- package/dist/translations/it.js +1 -1
- package/dist/translations/it.umd.js +1 -1
- package/dist/translations/ja.js +1 -1
- package/dist/translations/ja.umd.js +1 -1
- package/dist/translations/jv.js +1 -1
- package/dist/translations/jv.umd.js +1 -1
- package/dist/translations/kk.js +1 -1
- package/dist/translations/kk.umd.js +1 -1
- package/dist/translations/km.js +1 -1
- package/dist/translations/km.umd.js +1 -1
- package/dist/translations/kn.js +1 -1
- package/dist/translations/kn.umd.js +1 -1
- package/dist/translations/ko.js +1 -1
- package/dist/translations/ko.umd.js +1 -1
- package/dist/translations/ku.js +1 -1
- package/dist/translations/ku.umd.js +1 -1
- package/dist/translations/lt.js +1 -1
- package/dist/translations/lt.umd.js +1 -1
- package/dist/translations/lv.js +1 -1
- package/dist/translations/lv.umd.js +1 -1
- package/dist/translations/ms.js +1 -1
- package/dist/translations/ms.umd.js +1 -1
- package/dist/translations/nb.js +1 -1
- package/dist/translations/nb.umd.js +1 -1
- package/dist/translations/ne.js +1 -1
- package/dist/translations/ne.umd.js +1 -1
- package/dist/translations/nl.js +1 -1
- package/dist/translations/nl.umd.js +1 -1
- package/dist/translations/no.js +1 -1
- package/dist/translations/no.umd.js +1 -1
- package/dist/translations/oc.js +1 -1
- package/dist/translations/oc.umd.js +1 -1
- package/dist/translations/pl.js +1 -1
- package/dist/translations/pl.umd.js +1 -1
- package/dist/translations/pt-br.js +1 -1
- package/dist/translations/pt-br.umd.js +1 -1
- package/dist/translations/pt.js +1 -1
- package/dist/translations/pt.umd.js +1 -1
- package/dist/translations/ro.js +1 -1
- package/dist/translations/ro.umd.js +1 -1
- package/dist/translations/ru.js +1 -1
- package/dist/translations/ru.umd.js +1 -1
- package/dist/translations/si.js +1 -1
- package/dist/translations/si.umd.js +1 -1
- package/dist/translations/sk.js +1 -1
- package/dist/translations/sk.umd.js +1 -1
- package/dist/translations/sl.js +1 -1
- package/dist/translations/sl.umd.js +1 -1
- package/dist/translations/sq.js +1 -1
- package/dist/translations/sq.umd.js +1 -1
- package/dist/translations/sr-latn.js +1 -1
- package/dist/translations/sr-latn.umd.js +1 -1
- package/dist/translations/sr.js +1 -1
- package/dist/translations/sr.umd.js +1 -1
- package/dist/translations/sv.js +1 -1
- package/dist/translations/sv.umd.js +1 -1
- package/dist/translations/th.js +1 -1
- package/dist/translations/th.umd.js +1 -1
- package/dist/translations/ti.js +1 -1
- package/dist/translations/ti.umd.js +1 -1
- package/dist/translations/tk.js +1 -1
- package/dist/translations/tk.umd.js +1 -1
- package/dist/translations/tr.js +1 -1
- package/dist/translations/tr.umd.js +1 -1
- package/dist/translations/tt.js +1 -1
- package/dist/translations/tt.umd.js +1 -1
- package/dist/translations/ug.js +1 -1
- package/dist/translations/ug.umd.js +1 -1
- package/dist/translations/uk.js +1 -1
- package/dist/translations/uk.umd.js +1 -1
- package/dist/translations/ur.js +1 -1
- package/dist/translations/ur.umd.js +1 -1
- package/dist/translations/uz.js +1 -1
- package/dist/translations/uz.umd.js +1 -1
- package/dist/translations/vi.js +1 -1
- package/dist/translations/vi.umd.js +1 -1
- package/dist/translations/zh-cn.js +1 -1
- package/dist/translations/zh-cn.umd.js +1 -1
- package/dist/translations/zh.js +1 -1
- package/dist/translations/zh.umd.js +1 -1
- package/dist/ui/suggestioncontroller.d.ts +34 -33
- package/dist/ui/view/basesuggestionthreadview.d.ts +192 -191
- package/dist/ui/view/suggestionthreadview.d.ts +89 -89
- package/dist/ui/view/suggestionview.d.ts +219 -183
- package/dist/ui/view/trackchangespreviewview.d.ts +0 -4
- package/dist/utils/common-translations.d.ts +6 -6
- package/dist/utils/utils.d.ts +23 -23
- package/package.json +25 -25
package/dist/suggestion.d.ts
CHANGED
|
@@ -1,292 +1,294 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
* @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
4
|
+
*/
|
|
5
5
|
/**
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import { ModelElement, type Marker, type Model, type ModelRange, type ModelItem } from
|
|
10
|
-
import type
|
|
11
|
-
import type {
|
|
12
|
-
import type {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
prototype: import("@ckeditor/ckeditor5-utils").Observable;
|
|
16
|
-
};
|
|
6
|
+
* @module track-changes/suggestion
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { ModelElement, type Marker, type Model, type ModelRange, type ModelItem } from "@ckeditor/ckeditor5-engine";
|
|
10
|
+
import { type ObservableMixinConstructor } from "@ckeditor/ckeditor5-utils";
|
|
11
|
+
import type { User } from "@ckeditor/ckeditor5-collaboration-core";
|
|
12
|
+
import type { CommentThread } from "@ckeditor/ckeditor5-comments";
|
|
13
|
+
import type { SuggestionFormatData, SuggestionAttributeData } from "./trackchangesediting.js";
|
|
14
|
+
declare const _SuggestionBase: ObservableMixinConstructor;
|
|
17
15
|
/**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
export declare class Suggestion extends
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
16
|
+
* Represents a singular suggestion that is tracked by track changes plugin.
|
|
17
|
+
*
|
|
18
|
+
* `Suggestion` instances are created and handled by {@link module:track-changes/trackchanges~TrackChanges track changes plugin}.
|
|
19
|
+
*/
|
|
20
|
+
export declare class Suggestion extends _SuggestionBase {
|
|
21
|
+
/**
|
|
22
|
+
* Suggestion ID.
|
|
23
|
+
*/
|
|
24
|
+
readonly id: string;
|
|
25
|
+
/**
|
|
26
|
+
* Suggestion type.
|
|
27
|
+
*/
|
|
28
|
+
type: SuggestionType;
|
|
29
|
+
/**
|
|
30
|
+
* Suggestion sub-type.
|
|
31
|
+
*
|
|
32
|
+
* This is an additional identifier for suggestions. Two suggestions of the same type may have different sub-types to differentiate
|
|
33
|
+
* suggestions behavior and handle interactions between suggestions.
|
|
34
|
+
*
|
|
35
|
+
* Sub-type is used for:
|
|
36
|
+
*
|
|
37
|
+
* * suggestions joining (only suggestions with the same sub-type can be joined),
|
|
38
|
+
* * suggestions custom callbacks (fired when adding, deleting and joining suggestions).
|
|
39
|
+
*/
|
|
40
|
+
subType: string | null;
|
|
41
|
+
/**
|
|
42
|
+
* The author of the change marked by the suggestion.
|
|
43
|
+
*/
|
|
44
|
+
author: User;
|
|
45
|
+
/**
|
|
46
|
+
* The user which saved the suggestion data in the database.
|
|
47
|
+
*
|
|
48
|
+
* Usually the same as author but may be different in some cases (e.g. when suggestion was added from an external source).
|
|
49
|
+
*/
|
|
50
|
+
creator: User;
|
|
51
|
+
/**
|
|
52
|
+
* Additional suggestion data.
|
|
53
|
+
*/
|
|
54
|
+
data: SuggestionFormatData | SuggestionAttributeData | null;
|
|
55
|
+
/**
|
|
56
|
+
* Date when the suggestion was saved in the database.
|
|
57
|
+
*/
|
|
58
|
+
createdAt: Date | null;
|
|
59
|
+
/**
|
|
60
|
+
* Date when the change marked by the suggestion was made.
|
|
61
|
+
*
|
|
62
|
+
* Usually the same as {@link #createdAt `createdAt`} but may be different in some cases
|
|
63
|
+
* (e.g. when suggestion was added from an external source).
|
|
64
|
+
*
|
|
65
|
+
* @observable
|
|
66
|
+
*/
|
|
67
|
+
authoredAt: Date | null;
|
|
68
|
+
/**
|
|
69
|
+
* Custom suggestion attributes. See also {@link #setAttribute} and {@link #removeAttribute}.
|
|
70
|
+
*
|
|
71
|
+
* @observable
|
|
72
|
+
*/
|
|
73
|
+
attributes: {
|
|
74
|
+
[k: string]: unknown;
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Previous suggestion in suggestions chain.
|
|
78
|
+
*
|
|
79
|
+
* Chained suggestions should be handled as one entity.
|
|
80
|
+
*
|
|
81
|
+
* @observable
|
|
82
|
+
*/
|
|
83
|
+
previous: Suggestion | null;
|
|
84
|
+
/**
|
|
85
|
+
* Next suggestion in suggestions chain.
|
|
86
|
+
*
|
|
87
|
+
* Chained suggestions should be handled as one entity.
|
|
88
|
+
*
|
|
89
|
+
* @observable
|
|
90
|
+
*/
|
|
91
|
+
next: Suggestion | null;
|
|
92
|
+
/**
|
|
93
|
+
* Comment thread model for comments added to this suggestion.
|
|
94
|
+
*
|
|
95
|
+
* @observable
|
|
96
|
+
*/
|
|
97
|
+
commentThread: CommentThread | null;
|
|
98
|
+
constructor(model: Model, options: SuggestionOptions);
|
|
99
|
+
/**
|
|
100
|
+
* The flag indicating whether the suggestion comes from an external source.
|
|
101
|
+
*/
|
|
102
|
+
get isExternal(): boolean;
|
|
103
|
+
/**
|
|
104
|
+
* AI source identifier when the suggestion was produced by an AI feature, otherwise `null`.
|
|
105
|
+
*/
|
|
106
|
+
get aiSource(): string | null;
|
|
107
|
+
/**
|
|
108
|
+
* The first (most-previous) suggestion in this suggestion chain.
|
|
109
|
+
*/
|
|
110
|
+
get head(): Suggestion;
|
|
111
|
+
/**
|
|
112
|
+
* Informs whether suggestion has at least one comment.
|
|
113
|
+
*/
|
|
114
|
+
get hasComments(): boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Informs whether the suggestion is a multi-range suggestion or a single-range suggestion.
|
|
117
|
+
*
|
|
118
|
+
* This is evaluated basing on the marker name belonging to this suggestion.
|
|
119
|
+
* Even if only one marker belongs to the suggestion at a given time it can still be a multi range suggestion.
|
|
120
|
+
*/
|
|
121
|
+
get isMultiRange(): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Informs whether the suggestion is still in the editor content.
|
|
124
|
+
*
|
|
125
|
+
* Returns `true` if there is at least one marker suggestion in the editor content.
|
|
126
|
+
*/
|
|
127
|
+
get isInContent(): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Binds given marker name to this suggestion.
|
|
130
|
+
*/
|
|
131
|
+
addMarkerName(markerName: string): void;
|
|
132
|
+
/**
|
|
133
|
+
* Returns all names of markers belonging to this suggestion.
|
|
134
|
+
*/
|
|
135
|
+
getMarkerNames(): Array<string>;
|
|
136
|
+
/**
|
|
137
|
+
* Returns all markers belonging to this suggestion.
|
|
138
|
+
*/
|
|
139
|
+
getMarkers(): Array<Marker>;
|
|
140
|
+
/**
|
|
141
|
+
* Returns the first marker belonging to this suggestion, i.e the first marker that was added to this suggestion
|
|
142
|
+
* and not removed yet.
|
|
143
|
+
*
|
|
144
|
+
* This method is useful if you know that the suggestion has only one marker and want to process it.
|
|
145
|
+
*/
|
|
146
|
+
getFirstMarker(): Marker | null;
|
|
147
|
+
/**
|
|
148
|
+
* Removes all markers from the suggestion and the editor content.
|
|
149
|
+
*/
|
|
150
|
+
removeMarkers(): void;
|
|
151
|
+
/**
|
|
152
|
+
* Removes marker with the given name from the suggestion and the editor content.
|
|
153
|
+
*/
|
|
154
|
+
removeMarker(markerName: string): void;
|
|
155
|
+
/**
|
|
156
|
+
* Adds a new range to this suggestion. It is assumed that the suggestion is a multi-range suggestion.
|
|
157
|
+
*
|
|
158
|
+
* A marker name is generated from this suggestion's properties and a marker with that name is created and set to a given `range`.
|
|
159
|
+
*/
|
|
160
|
+
addRange(range: ModelRange): void;
|
|
161
|
+
/**
|
|
162
|
+
* Checks if given `range` is intersecting with any of the ranges of markers belonging to this suggestion.
|
|
163
|
+
*/
|
|
164
|
+
isIntersectingWithRange(range: ModelRange): boolean;
|
|
165
|
+
/**
|
|
166
|
+
* Returns all ranges of all markers belonging to this suggestion.
|
|
167
|
+
*/
|
|
168
|
+
getRanges(): Array<ModelRange>;
|
|
169
|
+
/**
|
|
170
|
+
* Returns all {@link module:engine/model/item~ModelItem model items} that are in this suggestion.
|
|
171
|
+
*/
|
|
172
|
+
getItems(): Array<ModelItem>;
|
|
173
|
+
/**
|
|
174
|
+
* Returns the first range belonging to this suggestion, i.e. the range of the first marker that was added to
|
|
175
|
+
* this suggestion and not removed yet.
|
|
176
|
+
*
|
|
177
|
+
* This method is useful if you know that the suggestion has only one marker and want to process its range.
|
|
178
|
+
*/
|
|
179
|
+
getFirstRange(): ModelRange | null;
|
|
180
|
+
/**
|
|
181
|
+
* Returns the model element contained in the suggestion.
|
|
182
|
+
*
|
|
183
|
+
* A {@link module:engine/model/element~ModelElement model element} is considered as contained if there is exactly
|
|
184
|
+
* one range in the suggestion, and that range contains exactly one element.
|
|
185
|
+
*
|
|
186
|
+
* Returns `null` if there is no contained element.
|
|
187
|
+
*/
|
|
188
|
+
getContainedElement(): ModelElement | null;
|
|
189
|
+
/**
|
|
190
|
+
* Accepts the suggestion.
|
|
191
|
+
*/
|
|
192
|
+
accept(): void;
|
|
193
|
+
/**
|
|
194
|
+
* Discards the suggestion.
|
|
195
|
+
*/
|
|
196
|
+
discard(): void;
|
|
197
|
+
/**
|
|
198
|
+
* Returns all suggestions that are in this suggestion chain.
|
|
199
|
+
*/
|
|
200
|
+
getAllAdjacentSuggestions(): Array<Suggestion>;
|
|
201
|
+
/**
|
|
202
|
+
* Adds suggestion attribute.
|
|
203
|
+
*
|
|
204
|
+
* Suggestion attributes are custom data that can be set and used by features
|
|
205
|
+
* built around suggestions. Use it to store your feature data with other suggestion data.
|
|
206
|
+
*
|
|
207
|
+
* ```ts
|
|
208
|
+
* suggestion.setAttribute( 'isImportant', true );
|
|
209
|
+
* ```
|
|
210
|
+
*
|
|
211
|
+
* You can group multiple values in an object, using dot notation:
|
|
212
|
+
*
|
|
213
|
+
* ```ts
|
|
214
|
+
* suggestion.setAttribute( 'customData.type', 'image' );
|
|
215
|
+
* suggestion.setAttribute( 'customData.src', 'foo.jpg' );
|
|
216
|
+
* ```
|
|
217
|
+
*
|
|
218
|
+
* Attributes set on the suggestion can be accessed through `attribute` property:
|
|
219
|
+
*
|
|
220
|
+
* ```ts
|
|
221
|
+
* const isImportant = suggestion.attributes.isImportant;
|
|
222
|
+
* const type = suggestion.attributes.customData.type;
|
|
223
|
+
* ```
|
|
224
|
+
*
|
|
225
|
+
* You can also observe `attributes` property or bind other properties to it:
|
|
226
|
+
*
|
|
227
|
+
* ```ts
|
|
228
|
+
* myObj.bind( 'customData' ).to( suggestion, 'attributes', attributes => attributes.customData );
|
|
229
|
+
* ```
|
|
230
|
+
*
|
|
231
|
+
* Whenever `setAttribute()` or `removeAttribute()` is called, `attributes` property
|
|
232
|
+
* is re-set and observables are refreshed.
|
|
233
|
+
*/
|
|
234
|
+
setAttribute(name: string, value: unknown): void;
|
|
235
|
+
/**
|
|
236
|
+
* Removes suggestion attribute.
|
|
237
|
+
*
|
|
238
|
+
* See also {@link #setAttribute}
|
|
239
|
+
*/
|
|
240
|
+
removeAttribute(name: string): void;
|
|
241
|
+
toJSON(): SuggestionJSON;
|
|
242
|
+
/**
|
|
243
|
+
* Returns a random string that can be used as additional identifier for the marker name for suggestions that are multi range.
|
|
244
|
+
*/
|
|
245
|
+
static getMultiRangeId(): string;
|
|
244
246
|
}
|
|
245
247
|
export interface SuggestionOptions {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
248
|
+
id: string;
|
|
249
|
+
type: SuggestionType;
|
|
250
|
+
subType: string | null;
|
|
251
|
+
attributes: {
|
|
252
|
+
[k: string]: unknown;
|
|
253
|
+
};
|
|
254
|
+
author: User;
|
|
255
|
+
creator: User;
|
|
256
|
+
onAccept: Function;
|
|
257
|
+
onDiscard: Function;
|
|
258
|
+
onAttributesChange: Function;
|
|
259
|
+
originalSuggestionId?: string | null;
|
|
258
260
|
}
|
|
259
261
|
export interface SuggestionJSON {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
262
|
+
/**
|
|
263
|
+
* Suggestion ID.
|
|
264
|
+
*/
|
|
265
|
+
id: string;
|
|
266
|
+
/**
|
|
267
|
+
* Contains the information about the type and subtype of the suggestion.
|
|
268
|
+
*/
|
|
269
|
+
type: string;
|
|
270
|
+
/**
|
|
271
|
+
* The ID of the author.
|
|
272
|
+
*/
|
|
273
|
+
authorId: string;
|
|
274
|
+
/**
|
|
275
|
+
* Date when the suggestion was saved in the database.
|
|
276
|
+
*/
|
|
277
|
+
createdAt: Date | null;
|
|
278
|
+
/**
|
|
279
|
+
* Informs whether suggestion has at least one comment.
|
|
280
|
+
*/
|
|
281
|
+
hasComments?: boolean;
|
|
282
|
+
/**
|
|
283
|
+
* Additional suggestion data.
|
|
284
|
+
*/
|
|
285
|
+
data?: SuggestionFormatData | SuggestionAttributeData | null;
|
|
286
|
+
/**
|
|
287
|
+
* Custom suggestion attributes.
|
|
288
|
+
*/
|
|
289
|
+
attributes: {
|
|
290
|
+
[k: string]: unknown;
|
|
291
|
+
};
|
|
290
292
|
}
|
|
291
|
-
export type SuggestionType =
|
|
293
|
+
export type SuggestionType = "insertion" | "deletion" | "formatInline" | "formatBlock" | "attribute";
|
|
292
294
|
export {};
|