@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
|
@@ -1,177 +1,177 @@
|
|
|
1
1
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { type Locale, type PriorityString } from
|
|
6
|
-
import type { ModelSchema, ModelElement } from
|
|
7
|
-
import { type Suggestion } from
|
|
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
|
+
import { type Locale, type PriorityString } from "@ckeditor/ckeditor5-utils";
|
|
6
|
+
import type { ModelSchema, ModelElement } from "@ckeditor/ckeditor5-engine";
|
|
7
|
+
import { type Suggestion } from "./suggestion.js";
|
|
8
8
|
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
* Creates descriptions for suggestions and suggestions chains.
|
|
10
|
+
*
|
|
11
|
+
* The class manages everything related to generating descriptions for suggestions. Here, you register labels for elements,
|
|
12
|
+
* attributes, or custom callback for non-regular cases.
|
|
13
|
+
*
|
|
14
|
+
* One or more suggestions that are grouped together (based ond various conditions) create "suggestion chain".
|
|
15
|
+
* In such chain one suggestion may impact other suggestion when it comes to the description of the whole chain.
|
|
16
|
+
* For example, insertion next to deletion results in "Replaced" description.
|
|
17
|
+
*/
|
|
18
18
|
export declare class SuggestionDescriptionFactory {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
-
|
|
19
|
+
constructor(schema: ModelSchema, locale: Locale);
|
|
20
|
+
/**
|
|
21
|
+
* Returns descriptions for given suggestion chain.
|
|
22
|
+
*
|
|
23
|
+
* The structure of the descriptions array is as follows (explained on an example):
|
|
24
|
+
*
|
|
25
|
+
* ```ts
|
|
26
|
+
* [
|
|
27
|
+
* { type: 'insertion', content: '*Insert:* 2 paragraphs' },
|
|
28
|
+
* { type: 'insertion', content: '*Insert:* image },
|
|
29
|
+
* { type: 'replace', content: '*Replace:* "Foo" *with* "Bar"' }
|
|
30
|
+
* ]
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* In above example there are three description instances (or lines). Two new (empty) paragraphs were added,
|
|
34
|
+
* an image was added and then "Foo" text was removed and "Bar" text was added. For example, above structure could be rendered as:
|
|
35
|
+
*
|
|
36
|
+
* ```html
|
|
37
|
+
* <p><strong>Insert:</strong> 2 paragraphs</p>
|
|
38
|
+
* <p><strong>Insert:</strong> image</p>
|
|
39
|
+
* <p><strong>Replace:</strong> "Foo" <strong>with</strong> "Bar"</p>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
getDescriptions(suggestions: Array<Suggestion>): Array<SuggestionDescription>;
|
|
43
|
+
/**
|
|
44
|
+
* Registers a callback function that returns a custom description for a suggestion.
|
|
45
|
+
*
|
|
46
|
+
* Registered callback is fired for a suggestion whenever there is a need to generate a description for that suggestion.
|
|
47
|
+
*
|
|
48
|
+
* The callback takes the suggestion instance as a parameter and should return
|
|
49
|
+
* {@link module:track-changes/suggestiondescriptionfactory~SuggestionDescription description object} or a falsy value
|
|
50
|
+
* if the suggestion was not handled by the callback.
|
|
51
|
+
*
|
|
52
|
+
* Example of a description callback for the bold style:
|
|
53
|
+
*
|
|
54
|
+
* ```ts
|
|
55
|
+
* suggestionDescriptionFactory.registerDescriptionCallback( suggestion => {
|
|
56
|
+
* const { data } = suggestion;
|
|
57
|
+
*
|
|
58
|
+
* // Omit suggestions that are not bold style suggestions.
|
|
59
|
+
* if ( !data || data.commandName !== 'bold' ) {
|
|
60
|
+
* return;
|
|
61
|
+
* }
|
|
62
|
+
*
|
|
63
|
+
* const isSet = !!data.commandParams[ 0 ].forceValue;
|
|
64
|
+
* const content = isSet ? '*Set format:* bold' : '*Remove format:* bold';
|
|
65
|
+
*
|
|
66
|
+
* return {
|
|
67
|
+
* type: 'format',
|
|
68
|
+
* content
|
|
69
|
+
* };
|
|
70
|
+
* } );
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
registerDescriptionCallback(callback: SuggestionDescriptionCallback): void;
|
|
74
|
+
/**
|
|
75
|
+
* For given `elementName` registers how this element will be labeled in a description (for example when it is added
|
|
76
|
+
* or removed).
|
|
77
|
+
*
|
|
78
|
+
* Instead of a string name you may provide a matching function that takes item {@link module:engine/model/item~ModelItem} as an input
|
|
79
|
+
* and should return boolean value.
|
|
80
|
+
*
|
|
81
|
+
* Provided label callback takes one parameter, `quantity`, and is expected to return the label for the element as a string.
|
|
82
|
+
*
|
|
83
|
+
* A simple use case without using internationalization:
|
|
84
|
+
*
|
|
85
|
+
* ```ts
|
|
86
|
+
* suggestionDescriptionFactory.registerElementLabel(
|
|
87
|
+
* 'paragraph',
|
|
88
|
+
* quantity => quantity == 1 ? 'paragraph' : quantity + ' paragraphs'
|
|
89
|
+
* );
|
|
90
|
+
* ```
|
|
91
|
+
*
|
|
92
|
+
* If you want your feature to be localized to other languages, use localization service:
|
|
93
|
+
*
|
|
94
|
+
* ```ts
|
|
95
|
+
* const t = editor.locale.t; // Remember that you have to use function named `t`.
|
|
96
|
+
*
|
|
97
|
+
* suggestionDescriptionFactory.registerElementLabel(
|
|
98
|
+
* 'paragraph',
|
|
99
|
+
* quantity => t( { string: 'paragraph', plural: '%0 paragraphs', id: 'ELEMENT_PARAGRAPH' }, quantity )
|
|
100
|
+
* );
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
registerElementLabel(elementNameOrCallback: string | Function, labelCallback: SuggestionLabelCallback, priority?: PriorityString): void;
|
|
104
|
+
/**
|
|
105
|
+
* For given `attributeName` registers how this attribute will be labeled in a description (for example when it is added
|
|
106
|
+
* or removed).
|
|
107
|
+
*
|
|
108
|
+
* Example usage with internationalization:
|
|
109
|
+
*
|
|
110
|
+
* ```ts
|
|
111
|
+
* const t = editor.locale.t; // Remember that you have to use function named `t`.
|
|
112
|
+
*
|
|
113
|
+
* suggestionDescriptionFactory.registerAttributeLabel(
|
|
114
|
+
* 'bold',
|
|
115
|
+
* t( 'bold' )
|
|
116
|
+
* );
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
registerAttributeLabel(attributeName: string, attributeLabel: string): void;
|
|
120
|
+
/**
|
|
121
|
+
* Returns label registered for given element or the element name if there is no label registered for it.
|
|
122
|
+
*/
|
|
123
|
+
getItemLabel(element: ModelElement, quantity?: number): string;
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
126
|
+
* A description for the suggestion.
|
|
127
|
+
*
|
|
128
|
+
* ```ts
|
|
129
|
+
* {
|
|
130
|
+
* type: 'format',
|
|
131
|
+
* label: '*Set format:* bold'
|
|
132
|
+
* }
|
|
133
|
+
* ```
|
|
134
|
+
*
|
|
135
|
+
* A description for the color-related suggestions like font color may specify the `color` property that will provide a better UX
|
|
136
|
+
* by displaying a color box next to the suggestion.
|
|
137
|
+
*
|
|
138
|
+
* ```ts
|
|
139
|
+
* {
|
|
140
|
+
* type: 'format',
|
|
141
|
+
* label: '*Set font color:*',
|
|
142
|
+
* color: {
|
|
143
|
+
* value: 'hsl( 60, 60%, 60% )',
|
|
144
|
+
* title: 'yellow'
|
|
145
|
+
* }
|
|
146
|
+
* }
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
149
|
export interface SuggestionDescription {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
150
|
+
type: "insertion" | "deletion" | "replace" | "format";
|
|
151
|
+
/**
|
|
152
|
+
* Description label. You may use `*` to bold part of the label.
|
|
153
|
+
*/
|
|
154
|
+
content: string;
|
|
155
|
+
/**
|
|
156
|
+
* The optional `color` property used for color-related suggestions.
|
|
157
|
+
* The object should provide the `value` (for displaying the color) and `title` (for describing the color) fields.
|
|
158
|
+
*/
|
|
159
|
+
color?: {
|
|
160
|
+
value: string;
|
|
161
|
+
title: string;
|
|
162
|
+
};
|
|
163
163
|
}
|
|
164
164
|
export type SuggestionDescriptionCallback = (suggestion: Suggestion) => SuggestionDescription | SuggestionDescriptionItem | undefined;
|
|
165
165
|
export type SuggestionLabelCallback = (quantity: number) => string;
|
|
166
166
|
/**
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
167
|
+
* An intermediate state which is easier to operate on when consecutive suggestion
|
|
168
|
+
* ranges are traversed.
|
|
169
|
+
*/
|
|
170
170
|
export interface SuggestionDescriptionItem {
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
171
|
+
type: "text" | "addEmptyContainer" | "addObject" | "removeEmptyContainer" | "removeObject" | "addContainer" | "removeContainer" | "addFormat" | "removeFormat";
|
|
172
|
+
add?: string;
|
|
173
|
+
remove?: string;
|
|
174
|
+
element?: ModelElement;
|
|
175
|
+
quantity?: number;
|
|
176
|
+
key?: string;
|
|
177
177
|
}
|