@ckeditor/ckeditor5-track-changes 38.1.0 → 38.1.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/build/track-changes.js +1 -1
- package/package.json +3 -3
- package/src/augmentation.d.ts +36 -36
- package/src/commands/acceptsuggestioncommand.d.ts +20 -20
- package/src/commands/acceptsuggestioncommand.js +1 -1
- package/src/commands/discardsuggestioncommand.d.ts +20 -20
- package/src/commands/discardsuggestioncommand.js +1 -1
- package/src/commands/executeonallsuggestionscommand.d.ts +20 -20
- package/src/commands/executeonallsuggestionscommand.js +1 -1
- package/src/commands/executeonselectedsuggestionscommand.d.ts +20 -20
- package/src/commands/executeonselectedsuggestionscommand.js +1 -1
- package/src/commands/trackchangescommand.d.ts +22 -22
- package/src/commands/trackchangescommand.js +1 -1
- package/src/index.d.ts +12 -12
- package/src/integrations/alignment.d.ts +13 -13
- package/src/integrations/alignment.js +1 -1
- package/src/integrations/basicstyles.d.ts +13 -13
- package/src/integrations/basicstyles.js +1 -1
- package/src/integrations/blockquote.d.ts +13 -13
- package/src/integrations/blockquote.js +1 -1
- package/src/integrations/ckbox.d.ts +13 -13
- package/src/integrations/ckbox.js +1 -1
- package/src/integrations/codeblock.d.ts +13 -13
- package/src/integrations/codeblock.js +1 -1
- package/src/integrations/comments.d.ts +10 -10
- package/src/integrations/comments.js +1 -1
- package/src/integrations/deletecommand.d.ts +13 -13
- package/src/integrations/deletecommand.js +1 -1
- package/src/integrations/documentlist.d.ts +13 -13
- package/src/integrations/documentlist.js +1 -1
- package/src/integrations/documentlistproperties.d.ts +25 -25
- package/src/integrations/documentlistproperties.js +1 -1
- package/src/integrations/entercommand.d.ts +12 -12
- package/src/integrations/entercommand.js +1 -1
- package/src/integrations/findandreplace.d.ts +17 -17
- package/src/integrations/findandreplace.js +1 -1
- package/src/integrations/font.d.ts +13 -13
- package/src/integrations/font.js +1 -1
- package/src/integrations/formatpainter.d.ts +13 -13
- package/src/integrations/formatpainter.js +1 -1
- package/src/integrations/heading.d.ts +13 -13
- package/src/integrations/heading.js +1 -1
- package/src/integrations/highlight.d.ts +13 -13
- package/src/integrations/highlight.js +1 -1
- package/src/integrations/horizontalline.d.ts +13 -13
- package/src/integrations/horizontalline.js +1 -1
- package/src/integrations/htmlembed.d.ts +13 -13
- package/src/integrations/htmlembed.js +1 -1
- package/src/integrations/image.d.ts +13 -13
- package/src/integrations/image.js +1 -1
- package/src/integrations/imagereplace.d.ts +19 -19
- package/src/integrations/imagereplace.js +1 -1
- package/src/integrations/importword.d.ts +14 -14
- package/src/integrations/importword.js +1 -1
- package/src/integrations/indent.d.ts +13 -13
- package/src/integrations/indent.js +1 -1
- package/src/integrations/inputcommand.d.ts +12 -12
- package/src/integrations/inputcommand.js +1 -1
- package/src/integrations/link.d.ts +13 -13
- package/src/integrations/link.js +1 -1
- package/src/integrations/list.d.ts +13 -13
- package/src/integrations/list.js +1 -1
- package/src/integrations/listproperties.d.ts +25 -25
- package/src/integrations/listproperties.js +1 -1
- package/src/integrations/mediaembed.d.ts +13 -13
- package/src/integrations/mediaembed.js +1 -1
- package/src/integrations/mention.d.ts +13 -13
- package/src/integrations/mention.js +1 -1
- package/src/integrations/pagebreak.d.ts +13 -13
- package/src/integrations/pagebreak.js +1 -1
- package/src/integrations/paragraph.d.ts +13 -13
- package/src/integrations/paragraph.js +1 -1
- package/src/integrations/removeformat.d.ts +13 -13
- package/src/integrations/removeformat.js +1 -1
- package/src/integrations/restrictededitingmode.d.ts +13 -13
- package/src/integrations/restrictededitingmode.js +1 -1
- package/src/integrations/shiftentercommand.d.ts +12 -12
- package/src/integrations/shiftentercommand.js +1 -1
- package/src/integrations/standardeditingmode.d.ts +13 -13
- package/src/integrations/standardeditingmode.js +1 -1
- package/src/integrations/style.d.ts +14 -14
- package/src/integrations/style.js +1 -1
- package/src/integrations/table.d.ts +38 -38
- package/src/integrations/table.js +1 -1
- package/src/integrations/tablecaption.d.ts +18 -18
- package/src/integrations/tablecaption.js +1 -1
- package/src/integrations/tableclipboard.d.ts +18 -18
- package/src/integrations/tableclipboard.js +1 -1
- package/src/integrations/tablecolumnresize.d.ts +22 -22
- package/src/integrations/tablecolumnresize.js +1 -1
- package/src/integrations/tableheadings.d.ts +18 -18
- package/src/integrations/tableheadings.js +1 -1
- package/src/integrations/tablemergesplit.d.ts +18 -18
- package/src/integrations/tablemergesplit.js +1 -1
- package/src/integrations/tableofcontents.d.ts +13 -13
- package/src/integrations/tableofcontents.js +1 -1
- package/src/integrations/tableproperties.d.ts +23 -23
- package/src/integrations/tableproperties.js +1 -1
- package/src/integrations/template.d.ts +13 -13
- package/src/integrations/template.js +1 -1
- package/src/integrations/title.d.ts +13 -13
- package/src/integrations/title.js +1 -1
- package/src/integrations/undo.d.ts +13 -13
- package/src/integrations/undo.js +1 -1
- package/src/integrations/utils.d.ts +17 -17
- package/src/integrations/utils.js +1 -1
- package/src/suggestion.d.ts +266 -266
- package/src/suggestion.js +1 -1
- package/src/suggestiondescriptionfactory.d.ts +151 -151
- package/src/suggestiondescriptionfactory.js +1 -1
- package/src/trackchanges.d.ts +240 -240
- package/src/trackchanges.js +1 -1
- package/src/trackchangesconfig.d.ts +71 -71
- package/src/trackchangesdata.d.ts +37 -37
- package/src/trackchangesdata.js +1 -1
- package/src/trackchangesediting.d.ts +435 -435
- package/src/trackchangesediting.js +1 -1
- package/src/trackchangesui.d.ts +34 -34
- package/src/trackchangesui.js +1 -1
- package/src/ui/suggestioncontroller.d.ts +36 -36
- package/src/ui/suggestioncontroller.js +1 -1
- package/src/ui/view/basesuggestionthreadview.d.ts +166 -166
- package/src/ui/view/basesuggestionthreadview.js +1 -1
- package/src/ui/view/suggestionthreadview.d.ts +182 -182
- package/src/ui/view/suggestionthreadview.js +1 -1
- package/src/utils/common-translations.d.ts +5 -5
- package/src/utils/common-translations.js +1 -1
- package/src/utils/utils.d.ts +26 -26
- package/src/utils/utils.js +1 -1
|
@@ -1,151 +1,151 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module track-changes/suggestiondescriptionfactory
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { type Locale, type PriorityString } from 'ckeditor5/src/utils';
|
|
6
|
-
import type { Schema, Element } from 'ckeditor5/src/engine';
|
|
7
|
-
import type Suggestion from './suggestion';
|
|
8
|
-
/**
|
|
9
|
-
* Creates descriptions for suggestion chains.
|
|
10
|
-
*
|
|
11
|
-
* One or more suggestions that are next to each other create "suggestion chain". In such chain one suggestion may
|
|
12
|
-
* impact other suggestion when it comes to the description of the whole chain. For example, insertion next to deletion
|
|
13
|
-
* results in "Replaced" description.
|
|
14
|
-
*/
|
|
15
|
-
export default class SuggestionDescriptionFactory {
|
|
16
|
-
constructor(schema: Schema, locale: Locale);
|
|
17
|
-
/**
|
|
18
|
-
* Returns descriptions for given suggestion chain.
|
|
19
|
-
*
|
|
20
|
-
* The structure of the descriptions array is as follows (explained on an example):
|
|
21
|
-
*
|
|
22
|
-
* ```ts
|
|
23
|
-
* [
|
|
24
|
-
* { type: 'insertion', content: '*Insert:* 2 paragraphs' },
|
|
25
|
-
* { type: 'insertion', content: '*Insert:* image },
|
|
26
|
-
* { type: 'replace', content: '*Replace:* "Foo" *with* "Bar"' }
|
|
27
|
-
* ]
|
|
28
|
-
* ```
|
|
29
|
-
*
|
|
30
|
-
* In above example there are three description instances (or lines). Two new (empty) paragraphs were added,
|
|
31
|
-
* an image was added and then "Foo" text was removed and "Bar" text was added. For example, above structure could be rendered as:
|
|
32
|
-
*
|
|
33
|
-
* ```html
|
|
34
|
-
* <p><strong>Insert:</strong> 2 paragraphs</p>
|
|
35
|
-
* <p><strong>Insert:</strong> image</p>
|
|
36
|
-
* <p><strong>Replace:</strong> "Foo" <strong>with</strong> "Bar"</p>
|
|
37
|
-
* ```
|
|
38
|
-
*/
|
|
39
|
-
getDescriptions(suggestions: Array<Suggestion>): Array<Description>;
|
|
40
|
-
/**
|
|
41
|
-
* Registers a callback function that returns a custom description for a suggestion.
|
|
42
|
-
*
|
|
43
|
-
* Registered callback is fired for a suggestion whenever there is a need to generate a description for that suggestion.
|
|
44
|
-
*
|
|
45
|
-
* The callback takes the suggestion instance as a parameter and should return
|
|
46
|
-
* {@link module:track-changes/suggestiondescriptionfactory~Description description object} or a falsy value
|
|
47
|
-
* if the suggestion was not handled by the callback.
|
|
48
|
-
*
|
|
49
|
-
* Example of a description callback for the bold style:
|
|
50
|
-
*
|
|
51
|
-
* ```ts
|
|
52
|
-
* suggestionDescriptionFactory.registerDescriptionCallback( suggestion => {
|
|
53
|
-
* const { data } = suggestion;
|
|
54
|
-
*
|
|
55
|
-
* // Omit suggestions that are not bold style suggestions.
|
|
56
|
-
* if ( !data || data.commandName !== 'bold' ) {
|
|
57
|
-
* return;
|
|
58
|
-
* }
|
|
59
|
-
*
|
|
60
|
-
* const isSet = !!data.commandParams[ 0 ].forceValue;
|
|
61
|
-
* const content = isSet ? '*Set format:* bold' : '*Remove format:* bold';
|
|
62
|
-
*
|
|
63
|
-
* return {
|
|
64
|
-
* type: 'format',
|
|
65
|
-
* content
|
|
66
|
-
* };
|
|
67
|
-
* } );
|
|
68
|
-
* ```
|
|
69
|
-
*/
|
|
70
|
-
registerDescriptionCallback(callback: DescriptionCallback): void;
|
|
71
|
-
/**
|
|
72
|
-
* For given `elementName` registers how this element will be labeled in a description (for example when it is added
|
|
73
|
-
* or removed).
|
|
74
|
-
*
|
|
75
|
-
* Instead of a string name you may provide a matching function that takes item {@link module:engine/model/item~Item} as an input
|
|
76
|
-
* and should return boolean value.
|
|
77
|
-
*
|
|
78
|
-
* Provided label callback takes one parameter, `quantity`, and is expected to return the label for the element as a string.
|
|
79
|
-
*
|
|
80
|
-
* A simple use case without using internationalization:
|
|
81
|
-
*
|
|
82
|
-
* ```ts
|
|
83
|
-
* suggestionDescriptionFactory.registerElementLabel(
|
|
84
|
-
* 'paragraph',
|
|
85
|
-
* quantity => quantity == 1 ? 'paragraph' : quantity + ' paragraphs'
|
|
86
|
-
* );
|
|
87
|
-
* ```
|
|
88
|
-
*
|
|
89
|
-
* If you want your feature to be localized to other languages, use localization service:
|
|
90
|
-
*
|
|
91
|
-
* ```ts
|
|
92
|
-
* const t = editor.locale.t; // Remember that you have to use function named `t`.
|
|
93
|
-
*
|
|
94
|
-
* suggestionDescriptionFactory.registerElementLabel(
|
|
95
|
-
* 'paragraph',
|
|
96
|
-
* quantity => t( { string: 'paragraph', plural: '%0 paragraphs', id: 'ELEMENT_PARAGRAPH' }, quantity )
|
|
97
|
-
* );
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
|
-
registerElementLabel(elementNameOrCallback: string | Function, labelCallback: LabelCallback, priority?: PriorityString): void;
|
|
101
|
-
/**
|
|
102
|
-
* Returns label registered for given element or the element name if there is no label registered for it.
|
|
103
|
-
*/
|
|
104
|
-
getItemLabel(element: Element, quantity?: number): string;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* A description for the suggestion.
|
|
108
|
-
*
|
|
109
|
-
* ```ts
|
|
110
|
-
* {
|
|
111
|
-
* type: 'format',
|
|
112
|
-
* label: '*Set format:* bold'
|
|
113
|
-
* }
|
|
114
|
-
* ```
|
|
115
|
-
*
|
|
116
|
-
* A description for the color-related suggestions like font color may specify the `color` property that will provide a better UX
|
|
117
|
-
* by displaying a color box next to the suggestion.
|
|
118
|
-
*
|
|
119
|
-
* ```ts
|
|
120
|
-
* {
|
|
121
|
-
* type: 'format',
|
|
122
|
-
* label: '*Set font color:*',
|
|
123
|
-
* color: {
|
|
124
|
-
* value: 'hsl( 60, 60%, 60% )',
|
|
125
|
-
* title: 'yellow'
|
|
126
|
-
* }
|
|
127
|
-
* }
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
export interface Description {
|
|
131
|
-
type: 'insertion' | 'deletion' | 'replace' | 'format';
|
|
132
|
-
/**
|
|
133
|
-
* Description label. You may use `*` to bold part of the label.
|
|
134
|
-
*/
|
|
135
|
-
content: string;
|
|
136
|
-
/**
|
|
137
|
-
* The optional `color` property used for color-related suggestions.
|
|
138
|
-
* The object should provide the `value` (for displaying the color) and `title` (for describing the color) fields.
|
|
139
|
-
*/
|
|
140
|
-
color?: {
|
|
141
|
-
value: string;
|
|
142
|
-
title: string;
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
export type DescriptionCallback = (suggestion: Suggestion) => Description | DescriptionItem | undefined;
|
|
146
|
-
export type LabelCallback = (quantity: number) => string;
|
|
147
|
-
export interface LabelCallbackObject {
|
|
148
|
-
matchingCallback: (element: Element) => boolean;
|
|
149
|
-
label: LabelCallback;
|
|
150
|
-
priority: PriorityString;
|
|
151
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module track-changes/suggestiondescriptionfactory
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { type Locale, type PriorityString } from 'ckeditor5/src/utils';
|
|
6
|
+
import type { Schema, Element } from 'ckeditor5/src/engine';
|
|
7
|
+
import type Suggestion from './suggestion';
|
|
8
|
+
/**
|
|
9
|
+
* Creates descriptions for suggestion chains.
|
|
10
|
+
*
|
|
11
|
+
* One or more suggestions that are next to each other create "suggestion chain". In such chain one suggestion may
|
|
12
|
+
* impact other suggestion when it comes to the description of the whole chain. For example, insertion next to deletion
|
|
13
|
+
* results in "Replaced" description.
|
|
14
|
+
*/
|
|
15
|
+
export default class SuggestionDescriptionFactory {
|
|
16
|
+
constructor(schema: Schema, locale: Locale);
|
|
17
|
+
/**
|
|
18
|
+
* Returns descriptions for given suggestion chain.
|
|
19
|
+
*
|
|
20
|
+
* The structure of the descriptions array is as follows (explained on an example):
|
|
21
|
+
*
|
|
22
|
+
* ```ts
|
|
23
|
+
* [
|
|
24
|
+
* { type: 'insertion', content: '*Insert:* 2 paragraphs' },
|
|
25
|
+
* { type: 'insertion', content: '*Insert:* image },
|
|
26
|
+
* { type: 'replace', content: '*Replace:* "Foo" *with* "Bar"' }
|
|
27
|
+
* ]
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* In above example there are three description instances (or lines). Two new (empty) paragraphs were added,
|
|
31
|
+
* an image was added and then "Foo" text was removed and "Bar" text was added. For example, above structure could be rendered as:
|
|
32
|
+
*
|
|
33
|
+
* ```html
|
|
34
|
+
* <p><strong>Insert:</strong> 2 paragraphs</p>
|
|
35
|
+
* <p><strong>Insert:</strong> image</p>
|
|
36
|
+
* <p><strong>Replace:</strong> "Foo" <strong>with</strong> "Bar"</p>
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
getDescriptions(suggestions: Array<Suggestion>): Array<Description>;
|
|
40
|
+
/**
|
|
41
|
+
* Registers a callback function that returns a custom description for a suggestion.
|
|
42
|
+
*
|
|
43
|
+
* Registered callback is fired for a suggestion whenever there is a need to generate a description for that suggestion.
|
|
44
|
+
*
|
|
45
|
+
* The callback takes the suggestion instance as a parameter and should return
|
|
46
|
+
* {@link module:track-changes/suggestiondescriptionfactory~Description description object} or a falsy value
|
|
47
|
+
* if the suggestion was not handled by the callback.
|
|
48
|
+
*
|
|
49
|
+
* Example of a description callback for the bold style:
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* suggestionDescriptionFactory.registerDescriptionCallback( suggestion => {
|
|
53
|
+
* const { data } = suggestion;
|
|
54
|
+
*
|
|
55
|
+
* // Omit suggestions that are not bold style suggestions.
|
|
56
|
+
* if ( !data || data.commandName !== 'bold' ) {
|
|
57
|
+
* return;
|
|
58
|
+
* }
|
|
59
|
+
*
|
|
60
|
+
* const isSet = !!data.commandParams[ 0 ].forceValue;
|
|
61
|
+
* const content = isSet ? '*Set format:* bold' : '*Remove format:* bold';
|
|
62
|
+
*
|
|
63
|
+
* return {
|
|
64
|
+
* type: 'format',
|
|
65
|
+
* content
|
|
66
|
+
* };
|
|
67
|
+
* } );
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
registerDescriptionCallback(callback: DescriptionCallback): void;
|
|
71
|
+
/**
|
|
72
|
+
* For given `elementName` registers how this element will be labeled in a description (for example when it is added
|
|
73
|
+
* or removed).
|
|
74
|
+
*
|
|
75
|
+
* Instead of a string name you may provide a matching function that takes item {@link module:engine/model/item~Item} as an input
|
|
76
|
+
* and should return boolean value.
|
|
77
|
+
*
|
|
78
|
+
* Provided label callback takes one parameter, `quantity`, and is expected to return the label for the element as a string.
|
|
79
|
+
*
|
|
80
|
+
* A simple use case without using internationalization:
|
|
81
|
+
*
|
|
82
|
+
* ```ts
|
|
83
|
+
* suggestionDescriptionFactory.registerElementLabel(
|
|
84
|
+
* 'paragraph',
|
|
85
|
+
* quantity => quantity == 1 ? 'paragraph' : quantity + ' paragraphs'
|
|
86
|
+
* );
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* If you want your feature to be localized to other languages, use localization service:
|
|
90
|
+
*
|
|
91
|
+
* ```ts
|
|
92
|
+
* const t = editor.locale.t; // Remember that you have to use function named `t`.
|
|
93
|
+
*
|
|
94
|
+
* suggestionDescriptionFactory.registerElementLabel(
|
|
95
|
+
* 'paragraph',
|
|
96
|
+
* quantity => t( { string: 'paragraph', plural: '%0 paragraphs', id: 'ELEMENT_PARAGRAPH' }, quantity )
|
|
97
|
+
* );
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
registerElementLabel(elementNameOrCallback: string | Function, labelCallback: LabelCallback, priority?: PriorityString): void;
|
|
101
|
+
/**
|
|
102
|
+
* Returns label registered for given element or the element name if there is no label registered for it.
|
|
103
|
+
*/
|
|
104
|
+
getItemLabel(element: Element, quantity?: number): string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* A description for the suggestion.
|
|
108
|
+
*
|
|
109
|
+
* ```ts
|
|
110
|
+
* {
|
|
111
|
+
* type: 'format',
|
|
112
|
+
* label: '*Set format:* bold'
|
|
113
|
+
* }
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
116
|
+
* A description for the color-related suggestions like font color may specify the `color` property that will provide a better UX
|
|
117
|
+
* by displaying a color box next to the suggestion.
|
|
118
|
+
*
|
|
119
|
+
* ```ts
|
|
120
|
+
* {
|
|
121
|
+
* type: 'format',
|
|
122
|
+
* label: '*Set font color:*',
|
|
123
|
+
* color: {
|
|
124
|
+
* value: 'hsl( 60, 60%, 60% )',
|
|
125
|
+
* title: 'yellow'
|
|
126
|
+
* }
|
|
127
|
+
* }
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export interface Description {
|
|
131
|
+
type: 'insertion' | 'deletion' | 'replace' | 'format';
|
|
132
|
+
/**
|
|
133
|
+
* Description label. You may use `*` to bold part of the label.
|
|
134
|
+
*/
|
|
135
|
+
content: string;
|
|
136
|
+
/**
|
|
137
|
+
* The optional `color` property used for color-related suggestions.
|
|
138
|
+
* The object should provide the `value` (for displaying the color) and `title` (for describing the color) fields.
|
|
139
|
+
*/
|
|
140
|
+
color?: {
|
|
141
|
+
value: string;
|
|
142
|
+
title: string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export type DescriptionCallback = (suggestion: Suggestion) => Description | DescriptionItem | undefined;
|
|
146
|
+
export type LabelCallback = (quantity: number) => string;
|
|
147
|
+
export interface LabelCallbackObject {
|
|
148
|
+
matchingCallback: (element: Element) => boolean;
|
|
149
|
+
label: LabelCallback;
|
|
150
|
+
priority: PriorityString;
|
|
151
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5540=['getDescriptions','ELEMENT_SPACE','*Split:*\x20%0','getFirstRange','_customCallbacks','add','function','isObject','isInContent','name','set','_locale','EmptyContainer','softBreak','_resolveDescriptionItems','addContainer','_itemLabels','removeContainer','getWalker','_itemLabelsCallbacks','getItemLabel','indexOf','normal','$text','isEqual','type','elementEnd','_addDescriptionItems','addObject','*Merge:*\x20%0','REPLACE_TEXT','nextSibling','insertion','data','replace','*Remove:*\x20%0','text','$textProxy','pop','$1\x20$2','item','match','get','element','matchingCallback','deletion','skip','label','isEmpty','Container','quantity','remove','previousSibling','registerDescriptionCallback','addEmptyContainer','_schema','length','*Insert:*\x20%0','start','end','Object','push'];(function(_0x39763f,_0x554074){const _0x1adb38=function(_0x2f9367){while(--_0x2f9367){_0x39763f['push'](_0x39763f['shift']());}};_0x1adb38(++_0x554074);}(_0x5540,0x155));const _0x1adb=function(_0x39763f,_0x554074){_0x39763f=_0x39763f-0x0;let _0x1adb38=_0x5540[_0x39763f];return _0x1adb38;};import{getTranslation as _0x262fa7}from'./utils/common-translations';import{priorities as _0x2248b2,insertToPriorityArray as _0x130d79}from'ckeditor5/src/utils';export default class m{constructor(_0x4fdd42,_0x1329dd){this['_customCallbacks']=[],this[_0x1adb('0x2f')]=new Map(),this[_0x1adb('0x32')]=[],this[_0x1adb('0x18')]=_0x4fdd42,this[_0x1adb('0x2a')]=_0x1329dd;}[_0x1adb('0x1f')](_0x58dfae){const _0x1a1513=[];for(let _0x246473=0x0;_0x246473<_0x58dfae[_0x1adb('0x19')];_0x246473++){const _0x22b92e=_0x58dfae[_0x246473];if(!_0x22b92e[_0x1adb('0x27')])continue;let _0x1c7f49=!0x1;for(const _0x3b2be4 of this[_0x1adb('0x23')]){const _0x329d16=_0x3b2be4(_0x22b92e);if(_0x329d16){_0x1adb('0x38')in _0x329d16&&_0x1a1513[_0x1adb('0x1e')](_0x329d16),_0x1c7f49=!0x0;break;}}if(!_0x1c7f49){this['_addDescriptionItems'](_0x1a1513,_0x22b92e);const _0x57d2b9=_0x58dfae[_0x246473+0x1];if(_0x57d2b9&&!_0x22b92e['getFirstRange']()[_0x1adb('0x1c')][_0x1adb('0x37')](_0x57d2b9[_0x1adb('0x22')]()[_0x1adb('0x1b')])){const _0x4e6326=_0x1a1513[_0x1a1513[_0x1adb('0x19')]-0x1],_0x364759=_0x1adb('0x1')==_0x22b92e[_0x1adb('0x38')]?'add':_0x1adb('0x14');_0x4e6326&&_0x1adb('0x5')==_0x4e6326[_0x1adb('0x38')]&&(_0x4e6326[_0x364759]+='\x0a');}}}return this[_0x1adb('0x2d')](_0x1a1513);}[_0x1adb('0x16')](_0x141291){this['_customCallbacks'][_0x1adb('0x1e')](_0x141291);}['registerElementLabel'](_0x3b3aed,_0x101840,_0x1e820a=_0x2248b2[_0x1adb('0x35')]){_0x1adb('0x25')==typeof _0x3b3aed?_0x130d79(this['_itemLabelsCallbacks'],{'matchingCallback':_0x3b3aed,'label':_0x101840,'priority':_0x1e820a}):this['_itemLabels'][_0x1adb('0x29')](_0x3b3aed,_0x101840);}[_0x1adb('0x33')](_0x13147e,_0x53b3c6=0x1){let _0x3bd561;for(const _0x320ef1 of this['_itemLabelsCallbacks'])if(_0x320ef1[_0x1adb('0xd')](_0x13147e)){_0x3bd561=_0x320ef1[_0x1adb('0x10')];break;}return _0x3bd561||(_0x3bd561=this[_0x1adb('0x2f')][_0x1adb('0xb')](_0x13147e[_0x1adb('0x28')])),_0x3bd561?_0x3bd561(_0x53b3c6):0x1!==_0x53b3c6?_0x53b3c6+'\x20'+_0x13147e[_0x1adb('0x28')]+'s':''+_0x13147e['name'];}[_0x1adb('0x3a')](_0x36aa18,_0x1e2883){const _0x190e66=_0x1e2883[_0x1adb('0x22')]()[_0x1adb('0x31')](),_0x5c3088=_0x1adb('0x1')==_0x1e2883[_0x1adb('0x38')]?_0x1adb('0x24'):_0x1adb('0x14');for(const _0x2e06bb of _0x190e66){const _0x36b456=_0x2e06bb['item'],_0x393933=_0x36aa18[_0x36aa18[_0x1adb('0x19')]-0x1];if(_0x36b456['is'](_0x1adb('0x6')))_0x393933&&_0x393933[_0x1adb('0x38')][_0x1adb('0x34')](_0x1adb('0x12'))>-0x1&&_0x36aa18['pop'](),_0x393933&&_0x1adb('0x5')==_0x393933['type']?_0x393933[_0x5c3088]+=_0x36b456[_0x1adb('0x2')]:_0x36aa18['push']({'type':_0x1adb('0x5'),'add':_0x1adb('0x24')==_0x5c3088?_0x36b456['data']:'','remove':_0x1adb('0x14')==_0x5c3088?_0x36b456[_0x1adb('0x2')]:''});else{if(this['_schema'][_0x1adb('0x26')](_0x36b456)){const _0xe4435b=_0x36b456;if(_0x393933&&_0x393933['type'][_0x1adb('0x34')](_0x1adb('0x12'))>-0x1&&_0x36aa18[_0x1adb('0x7')](),_0x1adb('0x39')==_0x2e06bb['type'])continue;_0x393933&&_0x393933[_0x1adb('0x38')]==_0x5c3088+'Object'&&_0x393933['element'][_0x1adb('0x28')]==_0xe4435b[_0x1adb('0x28')]?_0x393933[_0x1adb('0x13')]++:_0x36aa18['push']({'type':_0x5c3088+_0x1adb('0x1d'),'element':_0xe4435b,'quantity':0x1}),_0x190e66[_0x1adb('0xf')](_0x313779=>!(_0x1adb('0x39')==_0x313779[_0x1adb('0x38')]&&_0x313779[_0x1adb('0x9')]==_0x36b456));}else{if(this[_0x1adb('0x18')]['checkChild'](_0x36b456,_0x1adb('0x36'))||_0x36b456['is'](_0x1adb('0xc'),_0x1adb('0x2c'))){const _0x2de86c=_0x36b456;if('add'==_0x5c3088&&'elementStart'==_0x2e06bb[_0x1adb('0x38')]||_0x1adb('0x14')==_0x5c3088&&_0x1adb('0x39')==_0x2e06bb[_0x1adb('0x38')])continue;if(_0x393933&&-0x1==_0x393933[_0x1adb('0x38')][_0x1adb('0x34')](_0x1adb('0x12'))){'text'==_0x393933[_0x1adb('0x38')]&&(_0x393933[_0x5c3088]+='\x0a');continue;}let _0x487c50;if(_0x487c50=_0x1adb('0x24')==_0x5c3088?_0x2de86c[_0x1adb('0x0')]&&!this[_0x1adb('0x18')][_0x1adb('0x26')](_0x2de86c[_0x1adb('0x0')])?_0x2de86c[_0x1adb('0x0')]:null:_0x2de86c['previousSibling']&&!this[_0x1adb('0x18')][_0x1adb('0x26')](_0x2de86c['previousSibling'])?_0x2de86c[_0x1adb('0x15')]:null,_0x2de86c['isEmpty']||_0x487c50&&_0x487c50[_0x1adb('0x11')]){const _0x5f165e=_0x487c50&&_0x487c50[_0x1adb('0x11')]?_0x487c50:_0x2de86c;_0x393933&&_0x393933[_0x1adb('0x38')]==_0x5c3088+_0x1adb('0x2b')&&_0x393933[_0x1adb('0xc')][_0x1adb('0x28')]==_0x5f165e['name']?_0x393933[_0x1adb('0x13')]++:_0x36aa18[_0x1adb('0x1e')]({'type':_0x5c3088+_0x1adb('0x2b'),'element':_0x5f165e,'quantity':0x1});}else _0x36aa18['push']({'type':_0x5c3088+_0x1adb('0x12'),'element':_0x2de86c});}}}}}[_0x1adb('0x2d')](_0x260f09){const _0x12ceab=this['_locale'],_0x49b323=[];for(const _0x4524ae of _0x260f09){switch(_0x4524ae[_0x1adb('0x38')]){case'text':if(_0x4524ae[_0x1adb('0x24')]=_0x4524ae[_0x1adb('0x24')][_0x1adb('0x3')](/(\S)\u000A+(\S)/g,'$1\x20$2')['replace'](/\u000A/g,''),_0x4524ae[_0x1adb('0x14')]=_0x4524ae[_0x1adb('0x14')]['replace'](/(\S)\u000A+(\S)/g,_0x1adb('0x8'))[_0x1adb('0x3')](/\u000A/g,''),''!=_0x4524ae[_0x1adb('0x24')]&&''!=_0x4524ae[_0x1adb('0x14')]){_0x49b323[_0x1adb('0x1e')]({'type':_0x1adb('0x3'),'content':_0x262fa7(_0x12ceab,_0x1adb('0x3d'),['\x22'+_0x4524ae[_0x1adb('0x14')]+'\x22','\x22'+_0x4524ae[_0x1adb('0x24')]+'\x22'])});continue;}if(null!=_0x4524ae[_0x1adb('0x24')][_0x1adb('0xa')](/^ +$/)){_0x49b323[_0x1adb('0x1e')]({'type':_0x1adb('0x1'),'content':_0x262fa7(_0x12ceab,_0x1adb('0x1a'),_0x262fa7(_0x12ceab,_0x1adb('0x20'),_0x4524ae[_0x1adb('0x24')][_0x1adb('0x19')]))});continue;}if(null!=_0x4524ae[_0x1adb('0x14')][_0x1adb('0xa')](/^ +$/)){_0x49b323[_0x1adb('0x1e')]({'type':_0x1adb('0xe'),'content':_0x262fa7(_0x12ceab,'*Remove:*\x20%0',_0x262fa7(_0x12ceab,_0x1adb('0x20'),_0x4524ae[_0x1adb('0x14')][_0x1adb('0x19')]))});continue;}if(''!=_0x4524ae[_0x1adb('0x24')]){_0x49b323[_0x1adb('0x1e')]({'type':_0x1adb('0x1'),'content':_0x262fa7(_0x12ceab,_0x1adb('0x1a'),'\x22'+_0x4524ae['add']+'\x22')});continue;}_0x49b323[_0x1adb('0x1e')]({'type':_0x1adb('0xe'),'content':_0x262fa7(_0x12ceab,_0x1adb('0x4'),'\x22'+_0x4524ae['remove']+'\x22')});continue;case _0x1adb('0x17'):case _0x1adb('0x3b'):_0x49b323[_0x1adb('0x1e')]({'type':_0x1adb('0x1'),'content':_0x262fa7(_0x12ceab,'*Insert:*\x20%0',this[_0x1adb('0x33')](_0x4524ae[_0x1adb('0xc')],_0x4524ae[_0x1adb('0x13')]))});continue;case'removeEmptyContainer':case'removeObject':_0x49b323[_0x1adb('0x1e')]({'type':'deletion','content':_0x262fa7(_0x12ceab,_0x1adb('0x4'),this['getItemLabel'](_0x4524ae[_0x1adb('0xc')],_0x4524ae[_0x1adb('0x13')]))});continue;case _0x1adb('0x2e'):_0x49b323[_0x1adb('0x1e')]({'type':_0x1adb('0x1'),'content':_0x262fa7(_0x12ceab,_0x1adb('0x21'),this[_0x1adb('0x33')](_0x4524ae[_0x1adb('0xc')],_0x4524ae[_0x1adb('0x13')]))});continue;case _0x1adb('0x30'):_0x49b323['push']({'type':_0x1adb('0xe'),'content':_0x262fa7(_0x12ceab,_0x1adb('0x3c'),this[_0x1adb('0x33')](_0x4524ae[_0x1adb('0xc')],_0x4524ae[_0x1adb('0x13')]))});continue;}_0x49b323[_0x1adb('0x1e')](_0x4524ae);}return _0x49b323;}}
|