@ckeditor/ckeditor5-track-changes 36.0.1 → 37.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/track-changes.js +1 -1
- package/ckeditor5-metadata.json +10 -0
- package/package.json +20 -5
- package/src/augmentation.d.ts +36 -0
- package/src/augmentation.js +23 -0
- package/src/commands/acceptsuggestioncommand.d.ts +20 -0
- package/src/commands/acceptsuggestioncommand.js +1 -1
- package/src/commands/discardsuggestioncommand.d.ts +20 -0
- package/src/commands/discardsuggestioncommand.js +1 -1
- package/src/commands/executeonallsuggestionscommand.d.ts +20 -0
- package/src/commands/executeonallsuggestionscommand.js +1 -1
- package/src/commands/executeonselectedsuggestionscommand.d.ts +20 -0
- package/src/commands/executeonselectedsuggestionscommand.js +1 -1
- package/src/commands/trackchangescommand.d.ts +22 -0
- package/src/commands/trackchangescommand.js +1 -1
- package/src/index.d.ts +12 -0
- package/src/index.js +1 -1
- package/src/integrations/alignment.d.ts +13 -0
- package/src/integrations/alignment.js +1 -1
- package/src/integrations/basicstyles.d.ts +13 -0
- package/src/integrations/basicstyles.js +1 -1
- package/src/integrations/blockquote.d.ts +13 -0
- package/src/integrations/blockquote.js +1 -1
- package/src/integrations/ckbox.d.ts +13 -0
- package/src/integrations/ckbox.js +1 -1
- package/src/integrations/codeblock.d.ts +13 -0
- package/src/integrations/codeblock.js +1 -1
- package/src/integrations/comments.d.ts +10 -0
- package/src/integrations/comments.js +1 -1
- package/src/integrations/deletecommand.d.ts +12 -0
- package/src/integrations/deletecommand.js +1 -1
- package/src/integrations/documentlist.d.ts +13 -0
- package/src/integrations/documentlist.js +1 -1
- package/src/integrations/documentlistproperties.d.ts +25 -0
- package/src/integrations/documentlistproperties.js +1 -1
- package/src/integrations/entercommand.d.ts +11 -0
- package/src/integrations/entercommand.js +1 -1
- package/src/integrations/findandreplace.d.ts +17 -0
- package/src/integrations/findandreplace.js +1 -1
- package/src/integrations/font.d.ts +13 -0
- package/src/integrations/font.js +1 -1
- package/src/integrations/heading.d.ts +13 -0
- package/src/integrations/heading.js +1 -1
- package/src/integrations/highlight.d.ts +13 -0
- package/src/integrations/highlight.js +1 -1
- package/src/integrations/horizontalline.d.ts +13 -0
- package/src/integrations/horizontalline.js +1 -1
- package/src/integrations/htmlembed.d.ts +13 -0
- package/src/integrations/htmlembed.js +1 -1
- package/src/integrations/image.d.ts +13 -0
- package/src/integrations/image.js +1 -1
- package/src/integrations/imagereplace.d.ts +19 -0
- package/src/integrations/imagereplace.js +1 -1
- package/src/integrations/importword.d.ts +14 -0
- package/src/integrations/importword.js +1 -1
- package/src/integrations/indent.d.ts +13 -0
- package/src/integrations/indent.js +1 -1
- package/src/integrations/inputcommand.d.ts +11 -0
- package/src/integrations/inputcommand.js +1 -1
- package/src/integrations/link.d.ts +13 -0
- package/src/integrations/link.js +1 -1
- package/src/integrations/list.d.ts +13 -0
- package/src/integrations/list.js +1 -1
- package/src/integrations/listproperties.d.ts +25 -0
- package/src/integrations/listproperties.js +1 -1
- package/src/integrations/mediaembed.d.ts +13 -0
- package/src/integrations/mediaembed.js +1 -1
- package/src/integrations/mention.d.ts +13 -0
- package/src/integrations/mention.js +1 -1
- package/src/integrations/pagebreak.d.ts +13 -0
- package/src/integrations/pagebreak.js +1 -1
- package/src/integrations/paragraph.d.ts +13 -0
- package/src/integrations/paragraph.js +1 -1
- package/src/integrations/removeformat.d.ts +13 -0
- package/src/integrations/removeformat.js +1 -1
- package/src/integrations/restrictededitingmode.d.ts +13 -0
- package/src/integrations/restrictededitingmode.js +1 -1
- package/src/integrations/shiftentercommand.d.ts +11 -0
- package/src/integrations/shiftentercommand.js +1 -1
- package/src/integrations/standardeditingmode.d.ts +13 -0
- package/src/integrations/standardeditingmode.js +1 -1
- package/src/integrations/style.d.ts +14 -0
- package/src/integrations/style.js +1 -1
- package/src/integrations/table.d.ts +38 -0
- package/src/integrations/table.js +1 -1
- package/src/integrations/tablecaption.d.ts +17 -0
- package/src/integrations/tablecaption.js +1 -1
- package/src/integrations/tableclipboard.d.ts +17 -0
- package/src/integrations/tableclipboard.js +1 -1
- package/src/integrations/tablecolumnresize.d.ts +22 -0
- package/src/integrations/tablecolumnresize.js +1 -1
- package/src/integrations/tableheadings.d.ts +17 -0
- package/src/integrations/tableheadings.js +1 -1
- package/src/integrations/tablemergesplit.d.ts +17 -0
- package/src/integrations/tablemergesplit.js +1 -1
- package/src/integrations/tableproperties.d.ts +23 -0
- package/src/integrations/tableproperties.js +1 -1
- package/src/integrations/title.d.ts +13 -0
- package/src/integrations/title.js +1 -1
- package/src/integrations/undo.d.ts +13 -0
- package/src/integrations/undo.js +1 -1
- package/src/integrations/utils.d.ts +17 -0
- package/src/integrations/utils.js +1 -1
- package/src/suggestion.d.ts +266 -0
- package/src/suggestion.js +1 -1
- package/src/suggestiondescriptionfactory.d.ts +151 -0
- package/src/suggestiondescriptionfactory.js +1 -1
- package/src/trackchanges.d.ts +222 -0
- package/src/trackchanges.js +1 -1
- package/src/trackchangesconfig.d.ts +53 -0
- package/src/trackchangesconfig.js +23 -0
- package/src/trackchangesdata.d.ts +38 -0
- package/src/trackchangesdata.js +1 -1
- package/src/trackchangesediting.d.ts +391 -0
- package/src/trackchangesediting.js +1 -1
- package/src/trackchangesui.d.ts +34 -0
- package/src/trackchangesui.js +1 -1
- package/src/ui/suggestioncontroller.d.ts +36 -0
- package/src/ui/suggestioncontroller.js +1 -1
- package/src/ui/view/basesuggestionthreadview.d.ts +166 -0
- package/src/ui/view/basesuggestionthreadview.js +1 -1
- package/src/ui/view/suggestionthreadview.d.ts +184 -0
- package/src/ui/view/suggestionthreadview.js +1 -1
- package/src/utils/common-translations.d.ts +5 -0
- package/src/utils/common-translations.js +1 -1
- package/src/utils/utils.d.ts +26 -0
- package/src/utils/utils.js +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Editor } from 'ckeditor5/src/core';
|
|
2
|
+
import type { Range, Model, Element, DowncastAddMarkerEvent } from 'ckeditor5/src/engine';
|
|
3
|
+
import type { GetCallback } from 'ckeditor5/src/utils';
|
|
4
|
+
/**
|
|
5
|
+
* Searches given `range` and returns all sub-ranges containing items with given `attributeKey`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function getRangesWithAttribute(attributeKey: string, range: Range, model: Model): Array<Range>;
|
|
8
|
+
/**
|
|
9
|
+
* For given `element`, if it is a list item, returns all list items that would be affected by renaming `element` to a different element.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getElementsAffectedByListItemRename(element: Element): Array<Element>;
|
|
12
|
+
/**
|
|
13
|
+
* Returns the conversion function for down-casting split/merge markers.
|
|
14
|
+
*/
|
|
15
|
+
export declare function downcastSplitMergeMarker(editor: Editor, type: 'split' | 'merge', { showActiveMarker }?: {
|
|
16
|
+
showActiveMarker?: boolean | undefined;
|
|
17
|
+
}): GetCallback<DowncastAddMarkerEvent>;
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x10ff=['isContent','schema','markerRange','bindElementToMarker','TrackChangesEditing','hasAttribute','get','isLimit','getWalker','getItems','push','span','isAtEnd','includes','item','addHighlight','getAttribute','previousPosition','elementEnd','toViewElement','activeMarkers','markerName','element','nextSibling','isBlock','listItem','writer','insert','createUIElement','mapper','listIndent'];(function(_0x391dc6,_0x10ff87){const _0x555a98=function(_0x1c8b64){while(--_0x1c8b64){_0x391dc6['push'](_0x391dc6['shift']());}};_0x555a98(++_0x10ff87);}(_0x10ff,0x154));const _0x555a=function(_0x391dc6,_0x10ff87){_0x391dc6=_0x391dc6-0x0;let _0x555a98=_0x10ff[_0x391dc6];return _0x555a98;};export function getRangesWithAttribute(_0x457a74,_0x4e701e,_0x17aff2){const _0x2615e0=[];for(const _0xc0c53b of _0x4e701e[_0x555a('0xa')]())_0xc0c53b[_0x555a('0x6')](_0x457a74)&&_0x2615e0[_0x555a('0xb')](_0x17aff2['createRangeOn'](_0xc0c53b));return _0x2615e0;}export function getElementsAffectedByListItemRename(_0x2ff21c){const _0x3441d0=[];if(_0x2ff21c['is'](_0x555a('0x17'),_0x555a('0x1a'))){let _0x3de319=_0x2ff21c[_0x555a('0x18')];for(;_0x3de319&&_0x3de319['is'](_0x555a('0x17'),_0x555a('0x1a'))&&_0x3de319[_0x555a('0x11')](_0x555a('0x0'))>0x0;)_0x3441d0[_0x555a('0xb')](_0x3de319),_0x3de319=_0x3de319[_0x555a('0x18')];}return _0x3441d0;}export function downcastSplitMergeMarker(_0x2f6628,_0xbcbf0a,{showActiveMarker:_0x44d7de=!0x0}={}){const _0x130a8f=_0x2f6628['plugins'][_0x555a('0x7')](_0x555a('0x5'));return(_0x525d07,_0x271edc,_0x4529a6)=>{if(!_0x4529a6['consumable']['test'](_0x271edc[_0x555a('0x3')],_0x525d07['name']))return;const _0x4448a0=_0x271edc[_0x555a('0x3')][_0x555a('0x9')](),_0x4458f3=_0x271edc[_0x555a('0x3')]['start'],_0x37b3ae=_0x2f6628['model'][_0x555a('0x2')];let _0x3688a6=null,_0x4fabed=null,_0x26eb44=!0x1,_0x58aac4=!0x1;for(const _0x466931 of _0x4448a0){const _0x2f5dd1=_0x466931[_0x555a('0xf')];_0x26eb44=_0x26eb44||_0x37b3ae[_0x555a('0x1')](_0x2f5dd1);const _0x52e590=_0x4529a6[_0x555a('0x1e')][_0x555a('0x14')](_0x2f5dd1);if(_0x52e590&&_0x52e590['getCustomProperty'](_0x555a('0x10')))return;_0x555a('0x13')==_0x466931['type']&&(_0x37b3ae[_0x555a('0x19')](_0x2f5dd1)&&!_0x37b3ae[_0x555a('0x8')](_0x2f5dd1)&&(_0x2f5dd1[_0x555a('0x18')]||_0x4458f3[_0x555a('0xd')]?_0x3688a6&&_0x3688a6['parent']==_0x2f5dd1||(_0x3688a6=_0x2f5dd1,_0xf17379(_0x466931[_0x555a('0x12')]),_0x58aac4=!0x0):_0x4fabed=_0x4fabed||_0x466931['previousPosition']));}function _0xf17379(_0x49e073){const _0x1601fe=_0x4529a6[_0x555a('0x1b')][_0x555a('0x1d')](_0x555a('0xc'),{'class':'ck-suggestion-marker-'+_0xbcbf0a}),_0x4fb16a=_0x4529a6[_0x555a('0x1e')]['toViewPosition'](_0x49e073);_0x44d7de&&_0x130a8f[_0x555a('0x15')][_0x555a('0xe')](_0x271edc[_0x555a('0x16')])&&_0x4529a6['writer']['addClass']('ck-suggestion-marker--active',_0x1601fe),_0x4529a6[_0x555a('0x1b')][_0x555a('0x1c')](_0x4fb16a,_0x1601fe),_0x4529a6[_0x555a('0x1e')][_0x555a('0x4')](_0x1601fe,_0x271edc[_0x555a('0x16')]);}_0x26eb44||_0x58aac4||!_0x4fabed||_0xf17379(_0x4fabed);};}
|
|
@@ -0,0 +1,266 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module track-changes/suggestion
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Element, type Marker, type Model, type Range, type Item } from 'ckeditor5/src/engine';
|
|
6
|
+
import type { User } from 'ckeditor5-collaboration/src/collaboration-core';
|
|
7
|
+
import type { CommentThread } from '@ckeditor/ckeditor5-comments/src/comments/commentsrepository';
|
|
8
|
+
import type { FormatData } from './trackchangesediting';
|
|
9
|
+
declare const Suggestion_base: {
|
|
10
|
+
new (): import("ckeditor5/src/utils").Observable;
|
|
11
|
+
prototype: import("ckeditor5/src/utils").Observable;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Represents a singular suggestion that is tracked by track changes plugin.
|
|
15
|
+
*
|
|
16
|
+
* `Suggestion` instances are created and handled by {@link module:track-changes/trackchanges~TrackChanges track changes plugin}.
|
|
17
|
+
*/
|
|
18
|
+
export default class Suggestion extends Suggestion_base {
|
|
19
|
+
/**
|
|
20
|
+
* Suggestion ID.
|
|
21
|
+
*/
|
|
22
|
+
readonly id: string;
|
|
23
|
+
/**
|
|
24
|
+
* Suggestion type.
|
|
25
|
+
*/
|
|
26
|
+
type: SuggestionType;
|
|
27
|
+
/**
|
|
28
|
+
* Suggestion sub-type.
|
|
29
|
+
*
|
|
30
|
+
* This is an additional identifier for suggestions. Two suggestions of the same type may have different sub-types to differentiate
|
|
31
|
+
* suggestions behavior and handle interactions between suggestions.
|
|
32
|
+
*
|
|
33
|
+
* Sub-type is used for:
|
|
34
|
+
*
|
|
35
|
+
* * suggestions joining (only suggestions with the same sub-type can be joined),
|
|
36
|
+
* * suggestions custom callbacks (fired when adding, deleting and joining suggestions).
|
|
37
|
+
*/
|
|
38
|
+
subType: string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The author of the change marked by the suggestion.
|
|
41
|
+
*/
|
|
42
|
+
author: User;
|
|
43
|
+
/**
|
|
44
|
+
* The user which saved the suggestion data in the database.
|
|
45
|
+
*
|
|
46
|
+
* Usually the same as author but may be different in some cases (e.g. when suggestion was added from an external source).
|
|
47
|
+
*/
|
|
48
|
+
creator: User;
|
|
49
|
+
/**
|
|
50
|
+
* The flag indicating whether the suggestion comes from an external source.
|
|
51
|
+
*/
|
|
52
|
+
isExternal: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Additional suggestion data.
|
|
55
|
+
*/
|
|
56
|
+
data: FormatData | null;
|
|
57
|
+
/**
|
|
58
|
+
* Date when the suggestion was saved in the database.
|
|
59
|
+
*/
|
|
60
|
+
createdAt: Date | null;
|
|
61
|
+
/**
|
|
62
|
+
* Date when the change marked by the suggestion was made.
|
|
63
|
+
*
|
|
64
|
+
* Usually the same as {@link #createdAt `createdAt`} but may be different in some cases
|
|
65
|
+
* (e.g. when suggestion was added from an external source).
|
|
66
|
+
*
|
|
67
|
+
* @observable
|
|
68
|
+
*/
|
|
69
|
+
authoredAt: Date | null;
|
|
70
|
+
/**
|
|
71
|
+
* Custom suggestion attributes. See also {@link #setAttribute} and {@link #removeAttribute}.
|
|
72
|
+
*
|
|
73
|
+
* @observable
|
|
74
|
+
*/
|
|
75
|
+
attributes: {
|
|
76
|
+
[k: string]: unknown;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Previous suggestion in suggestions chain.
|
|
80
|
+
*
|
|
81
|
+
* Chained suggestions should be handled as one entity.
|
|
82
|
+
*
|
|
83
|
+
* @observable
|
|
84
|
+
*/
|
|
85
|
+
previous: Suggestion | null;
|
|
86
|
+
/**
|
|
87
|
+
* Next suggestion in suggestions chain.
|
|
88
|
+
*
|
|
89
|
+
* Chained suggestions should be handled as one entity.
|
|
90
|
+
*
|
|
91
|
+
* @observable
|
|
92
|
+
*/
|
|
93
|
+
next: Suggestion | null;
|
|
94
|
+
/**
|
|
95
|
+
* Comment thread model for comments added to this suggestion.
|
|
96
|
+
*
|
|
97
|
+
* @observable
|
|
98
|
+
*/
|
|
99
|
+
commentThread: CommentThread | null;
|
|
100
|
+
constructor(model: Model, options: SuggestionOptions);
|
|
101
|
+
/**
|
|
102
|
+
* The first (most-previous) suggestion in this suggestion chain.
|
|
103
|
+
*/
|
|
104
|
+
get head(): Suggestion;
|
|
105
|
+
/**
|
|
106
|
+
* Informs whether suggestion has at least one comment.
|
|
107
|
+
*/
|
|
108
|
+
get hasComments(): boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Informs whether the suggestion is a multi-range suggestion or a single-range suggestion.
|
|
111
|
+
*
|
|
112
|
+
* This is evaluated basing on the marker name belonging to this suggestion.
|
|
113
|
+
* Even if only one marker belongs to the suggestion at a given time it can still be a multi range suggestion.
|
|
114
|
+
*/
|
|
115
|
+
get isMultiRange(): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Informs whether the suggestion is still in the editor content.
|
|
118
|
+
*
|
|
119
|
+
* Returns `true` if there is at least one marker suggestion in the editor content.
|
|
120
|
+
*/
|
|
121
|
+
get isInContent(): boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Binds given marker name to this suggestion.
|
|
124
|
+
*/
|
|
125
|
+
addMarkerName(markerName: string): void;
|
|
126
|
+
/**
|
|
127
|
+
* Returns all names of markers belonging to this suggestion.
|
|
128
|
+
*/
|
|
129
|
+
getMarkerNames(): Array<string>;
|
|
130
|
+
/**
|
|
131
|
+
* Returns all markers belonging to this suggestion.
|
|
132
|
+
*/
|
|
133
|
+
getMarkers(): Array<Marker>;
|
|
134
|
+
/**
|
|
135
|
+
* Returns the first marker belonging to this suggestion, i.e the first marker that was added to this suggestion
|
|
136
|
+
* and not removed yet.
|
|
137
|
+
*
|
|
138
|
+
* This method is useful if you know that the suggestion has only one marker and want to process it.
|
|
139
|
+
*/
|
|
140
|
+
getFirstMarker(): Marker | null;
|
|
141
|
+
/**
|
|
142
|
+
* Removes all markers from the suggestion and the editor content.
|
|
143
|
+
*/
|
|
144
|
+
removeMarkers(): void;
|
|
145
|
+
/**
|
|
146
|
+
* Removes marker with the given name from the suggestion and the editor content.
|
|
147
|
+
*/
|
|
148
|
+
removeMarker(markerName: string): void;
|
|
149
|
+
/**
|
|
150
|
+
* Adds a new range to this suggestion. It is assumed that the suggestion is a multi-range suggestion.
|
|
151
|
+
*
|
|
152
|
+
* A marker name is generated from this suggestion's properties and a marker with that name is created and set to a given `range`.
|
|
153
|
+
*/
|
|
154
|
+
addRange(range: Range): void;
|
|
155
|
+
/**
|
|
156
|
+
* Checks if given `range` is intersecting with any of the ranges of markers belonging to this suggestion.
|
|
157
|
+
*/
|
|
158
|
+
isIntersectingWithRange(range: Range): boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Returns all ranges of all markers belonging to this suggestion.
|
|
161
|
+
*/
|
|
162
|
+
getRanges(): Array<Range>;
|
|
163
|
+
/**
|
|
164
|
+
* Returns all {@link module:engine/model/item~Item model items} that are in this suggestion.
|
|
165
|
+
*/
|
|
166
|
+
getItems(): Array<Item>;
|
|
167
|
+
/**
|
|
168
|
+
* Returns the first range belonging to this suggestion, i.e. the range of the first marker that was added to
|
|
169
|
+
* this suggestion and not removed yet.
|
|
170
|
+
*
|
|
171
|
+
* This method is useful if you know that the suggestion has only one marker and want to process its range.
|
|
172
|
+
*/
|
|
173
|
+
getFirstRange(): Range | null;
|
|
174
|
+
/**
|
|
175
|
+
* Returns the model element contained in the suggestion.
|
|
176
|
+
*
|
|
177
|
+
* A {@link module:engine/model/element~Element model element} is considered as contained if there is exactly
|
|
178
|
+
* one range in the suggestion, and that range contains exactly one element.
|
|
179
|
+
*
|
|
180
|
+
* Returns `null` if there is no contained element.
|
|
181
|
+
*/
|
|
182
|
+
getContainedElement(): Element | null;
|
|
183
|
+
/**
|
|
184
|
+
* Accepts the suggestion.
|
|
185
|
+
*/
|
|
186
|
+
accept(): void;
|
|
187
|
+
/**
|
|
188
|
+
* Discards the suggestion.
|
|
189
|
+
*/
|
|
190
|
+
discard(): void;
|
|
191
|
+
/**
|
|
192
|
+
* Returns all suggestions that are in this suggestion chain.
|
|
193
|
+
*/
|
|
194
|
+
getAllAdjacentSuggestions(): Array<Suggestion>;
|
|
195
|
+
/**
|
|
196
|
+
* Adds suggestion attribute.
|
|
197
|
+
*
|
|
198
|
+
* Suggestion attributes are custom data that can be set and used by features
|
|
199
|
+
* built around suggestions. Use it to store your feature data with other suggestion data.
|
|
200
|
+
*
|
|
201
|
+
* ```ts
|
|
202
|
+
* suggestion.setAttribute( 'isImportant', true );
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* You can group multiple values in an object, using dot notation:
|
|
206
|
+
*
|
|
207
|
+
* ```ts
|
|
208
|
+
* suggestion.setAttribute( 'customData.type', 'image' );
|
|
209
|
+
* suggestion.setAttribute( 'customData.src', 'foo.jpg' );
|
|
210
|
+
* ```
|
|
211
|
+
*
|
|
212
|
+
* Attributes set on the suggestion can be accessed through `attribute` property:
|
|
213
|
+
*
|
|
214
|
+
* ```ts
|
|
215
|
+
* const isImportant = suggestion.attributes.isImportant;
|
|
216
|
+
* const type = suggestion.attributes.customData.type;
|
|
217
|
+
* ```
|
|
218
|
+
*
|
|
219
|
+
* You can also observe `attributes` property or bind other properties to it:
|
|
220
|
+
*
|
|
221
|
+
* ```ts
|
|
222
|
+
* myObj.bind( 'customData' ).to( suggestion, 'attributes', attributes => attributes.customData );
|
|
223
|
+
* ```
|
|
224
|
+
*
|
|
225
|
+
* Whenever `setAttribute()` or `removeAttribute()` is called, `attributes` property
|
|
226
|
+
* is re-set and observables are refreshed.
|
|
227
|
+
*/
|
|
228
|
+
setAttribute(name: string, value: unknown): void;
|
|
229
|
+
/**
|
|
230
|
+
* Removes suggestion attribute.
|
|
231
|
+
*
|
|
232
|
+
* See also {@link #setAttribute}
|
|
233
|
+
*/
|
|
234
|
+
removeAttribute(name: string): void;
|
|
235
|
+
toJSON(): SuggestionJSON;
|
|
236
|
+
/**
|
|
237
|
+
* Returns a random string that can be used as additional identifier for the marker name for suggestions that are multi range.
|
|
238
|
+
*/
|
|
239
|
+
static getMultiRangeId(): string;
|
|
240
|
+
}
|
|
241
|
+
export interface SuggestionOptions {
|
|
242
|
+
id: string;
|
|
243
|
+
type: SuggestionType;
|
|
244
|
+
subType: string | null;
|
|
245
|
+
attributes: {
|
|
246
|
+
[k: string]: unknown;
|
|
247
|
+
};
|
|
248
|
+
author: User;
|
|
249
|
+
creator: User;
|
|
250
|
+
onAccept: Function;
|
|
251
|
+
onDiscard: Function;
|
|
252
|
+
onAttributesChange: Function;
|
|
253
|
+
}
|
|
254
|
+
export interface SuggestionJSON {
|
|
255
|
+
id: string;
|
|
256
|
+
type: string;
|
|
257
|
+
authorId: string;
|
|
258
|
+
createdAt: Date | null;
|
|
259
|
+
hasComments?: boolean;
|
|
260
|
+
data?: FormatData | null;
|
|
261
|
+
attributes: {
|
|
262
|
+
[k: string]: unknown;
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
export type SuggestionType = 'insertion' | 'deletion' | 'formatInline' | 'formatBlock';
|
|
266
|
+
export {};
|
package/src/suggestion.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x26a9=['getMarkers','onAttributesChange','decorate','setAttribute','addRange','nodeBefore','onDiscard','substr','change','get','type','getContainedElement','add','toJSON','commentThread','markers','_onAccept','isIntersecting','removeAttribute','start','attributes','createdAt','isInContent','discard','removeMarker','creator','_onDiscard','from','push','getRanges','subType','split','next','getRange','authoredAt','hasComments','_model','getMultiRangeId','removeMarkers','onAccept','_markerNames','_saved','_onAttributesChange','length','head','author','filter','data','set','getMarkerNames','end','isIntersectingWithRange','getFirstMarker','map','accept','previous'];(function(_0x8e1a45,_0x26a936){const _0x7d93c3=function(_0x6ce4d){while(--_0x6ce4d){_0x8e1a45['push'](_0x8e1a45['shift']());}};_0x7d93c3(++_0x26a936);}(_0x26a9,0x89));const _0x7d93=function(_0x8e1a45,_0x26a936){_0x8e1a45=_0x8e1a45-0x0;let _0x7d93c3=_0x26a9[_0x8e1a45];return _0x7d93c3;};import{Element as _0x1fdb3a}from'ckeditor5/src/engine';import{ObservableMixin as _0x3719cf,uid as _0x567783}from'ckeditor5/src/utils';import{cloneDeep as _0x4d91a6,isEqual as _0x30739d,set as _0x2f742c,unset as _0x4343d6}from'lodash-es';export default class u extends _0x3719cf(){constructor(_0x1b82a2,_0x2c0f96){super(),this['id']=_0x2c0f96['id'],this[_0x7d93('0x29')]=_0x2c0f96[_0x7d93('0x29')],this[_0x7d93('0x5')]=_0x2c0f96[_0x7d93('0x5')]||null,this[_0x7d93('0x14')]=_0x2c0f96[_0x7d93('0x14')],this[_0x7d93('0x0')]=_0x2c0f96[_0x7d93('0x0')]||_0x2c0f96['author'],this['isExternal']=Boolean(_0x2c0f96['attributes']&&_0x2c0f96['attributes']['@external']),this[_0x7d93('0x16')]=null,this[_0x7d93('0xb')]=_0x1b82a2,this[_0x7d93('0x2f')]=_0x2c0f96[_0x7d93('0xe')],this[_0x7d93('0x1')]=_0x2c0f96[_0x7d93('0x25')],this[_0x7d93('0x11')]=_0x2c0f96[_0x7d93('0x20')],this[_0x7d93('0xf')]=new Set(),this[_0x7d93('0x34')]=null,this[_0x7d93('0x17')](_0x7d93('0x9'),null),this[_0x7d93('0x17')]('attributes',_0x2c0f96[_0x7d93('0x33')]||{}),this['set']('previous',null),this[_0x7d93('0x17')](_0x7d93('0x7'),null),this['set'](_0x7d93('0x2d'),null),this[_0x7d93('0x17')](_0x7d93('0x10'),!0x1),this[_0x7d93('0x21')](_0x7d93('0x1d')),this[_0x7d93('0x21')](_0x7d93('0x36'));}get[_0x7d93('0x13')](){let _0x4dddaf=this;for(;_0x4dddaf[_0x7d93('0x1e')];)_0x4dddaf=_0x4dddaf[_0x7d93('0x1e')];return _0x4dddaf;}get[_0x7d93('0xa')](){return!!this['commentThread']&&this[_0x7d93('0x2d')][_0x7d93('0x12')]>0x0;}get['isMultiRange'](){if(0x0==this['_markerNames']['size'])return!0x1;return 0x6==Array[_0x7d93('0x2')](this[_0x7d93('0xf')])[0x0][_0x7d93('0x6')](':')['length'];}get[_0x7d93('0x35')](){return null!==this[_0x7d93('0x1b')]();}['addMarkerName'](_0x3f608d){this[_0x7d93('0xf')][_0x7d93('0x2b')](_0x3f608d);}[_0x7d93('0x18')](){return Array['from'](this[_0x7d93('0xf')]);}[_0x7d93('0x1f')](){return this[_0x7d93('0x18')]()['map'](_0x240d8b=>this['_model'][_0x7d93('0x2e')][_0x7d93('0x28')](_0x240d8b))[_0x7d93('0x15')](_0x1c75cf=>_0x1c75cf);}[_0x7d93('0x1b')](){return this[_0x7d93('0x1f')]()[0x0]||null;}[_0x7d93('0xd')](){this[_0x7d93('0xb')]['change'](_0x2bfb37=>{for(const _0x481b32 of this[_0x7d93('0x1f')]())_0x2bfb37[_0x7d93('0x37')](_0x481b32);}),this['_markerNames']['clear']();}[_0x7d93('0x37')](_0xbddf03){this[_0x7d93('0xb')][_0x7d93('0x27')](_0x2152a6=>{_0x2152a6[_0x7d93('0x37')](_0xbddf03);}),this[_0x7d93('0xf')]['delete'](_0xbddf03);}[_0x7d93('0x23')](_0x5a2967){const _0xc60b80='suggestion:'+this[_0x7d93('0x29')]+':'+this['subType']+':'+this['id']+':'+this[_0x7d93('0x0')]['id']+':'+u['getMultiRangeId']();this['addMarkerName'](_0xc60b80),this['_model'][_0x7d93('0x27')](_0x32af94=>{_0x32af94['addMarker'](_0xc60b80,{'range':_0x5a2967,'usingOperation':!0x0,'affectsData':!0x0});});}[_0x7d93('0x1a')](_0x3ba00d){for(const _0x2c8840 of this['getRanges']())if(_0x2c8840[_0x7d93('0x30')](_0x3ba00d))return!0x0;return!0x1;}[_0x7d93('0x4')](){return this[_0x7d93('0x1f')]()[_0x7d93('0x1c')](_0x297c31=>_0x297c31[_0x7d93('0x8')]());}['getItems'](){return this[_0x7d93('0x4')]()['reduce']((_0x4c7854,_0x2932f8)=>[..._0x4c7854,..._0x2932f8['getItems']()],[]);}['getFirstRange'](){var _0x5b4c4c;return(null===(_0x5b4c4c=this[_0x7d93('0x1b')]())||void 0x0===_0x5b4c4c?void 0x0:_0x5b4c4c[_0x7d93('0x8')]())||null;}[_0x7d93('0x2a')](){const _0x11c830=this['getRanges']();if(0x1!=_0x11c830['length'])return null;const _0x526465=_0x11c830[0x0],_0x38ce04=_0x526465[_0x7d93('0x32')]['nodeAfter'],_0x211442=_0x526465[_0x7d93('0x19')][_0x7d93('0x24')];return _0x38ce04 instanceof _0x1fdb3a?_0x38ce04!=_0x211442?null:_0x38ce04:null;}[_0x7d93('0x1d')](){this[_0x7d93('0x2f')](this[_0x7d93('0x4')](),this['data'],this[_0x7d93('0x33')]),this[_0x7d93('0xd')]();}[_0x7d93('0x36')](){this['_onDiscard'](this[_0x7d93('0x4')](),this[_0x7d93('0x16')],this['attributes']),this[_0x7d93('0xd')]();}['getAllAdjacentSuggestions'](){const _0x8774e6=[];let _0x3d484f=this[_0x7d93('0x13')];for(;_0x3d484f;)_0x8774e6[_0x7d93('0x3')](_0x3d484f),_0x3d484f=_0x3d484f[_0x7d93('0x7')];return _0x8774e6;}[_0x7d93('0x22')](_0x47d7aa,_0x42501f){const _0xc45324=_0x4d91a6(this[_0x7d93('0x33')]);_0x2f742c(_0xc45324,_0x47d7aa,_0x42501f),_0x30739d(_0xc45324,this[_0x7d93('0x33')])||(this['attributes']=_0xc45324,this[_0x7d93('0x11')](_0xc45324));}[_0x7d93('0x31')](_0x13d583){const _0x2afbdc=_0x4d91a6(this[_0x7d93('0x33')]);_0x4343d6(_0x2afbdc,_0x13d583),_0x30739d(_0x2afbdc,this[_0x7d93('0x33')])||(this[_0x7d93('0x33')]=_0x2afbdc,this['_onAttributesChange'](this['attributes']));}[_0x7d93('0x2c')](){return{'id':this['id'],'type':this[_0x7d93('0x5')]?this[_0x7d93('0x29')]+':'+this[_0x7d93('0x5')]:this[_0x7d93('0x29')],'authorId':this[_0x7d93('0x0')]['id'],'createdAt':this[_0x7d93('0x34')],'hasComments':this[_0x7d93('0xa')],'data':this[_0x7d93('0x16')],'attributes':this['attributes']};}static[_0x7d93('0xc')](){return _0x567783()[_0x7d93('0x26')](0x1,0x5);}}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x27d6=['addObject','item','isEmpty','_locale','*Remove:*\x20%0','addContainer','_addDescriptionItems','addEmptyContainer','_schema','normal','isObject','_itemLabels','getWalker','removeObject','matchingCallback','indexOf','elementEnd','previousSibling','end','data','add','skip','_itemLabelsCallbacks','replace','getFirstRange','match','getItemLabel','$1\x20$2','Object','type','Container','isEqual','registerElementLabel','*Merge:*\x20%0','remove','function','name','text','$textProxy','_customCallbacks','_resolveDescriptionItems','push','EmptyContainer','element','quantity','nextSibling','*Split:*\x20%0','length','REPLACE_TEXT','*Insert:*\x20%0','deletion','isInContent','start','ELEMENT_SPACE','insertion','pop'];(function(_0x3ca25f,_0x27d638){const _0x26148a=function(_0x27be6d){while(--_0x27be6d){_0x3ca25f['push'](_0x3ca25f['shift']());}};_0x26148a(++_0x27d638);}(_0x27d6,0x162));const _0x2614=function(_0x3ca25f,_0x27d638){_0x3ca25f=_0x3ca25f-0x0;let _0x26148a=_0x27d6[_0x3ca25f];return _0x26148a;};import{getTranslation as _0x503418}from'./utils/common-translations';import{priorities as _0x17db74,insertToPriorityArray as _0x183c11}from'ckeditor5/src/utils';export default class m{constructor(_0x263e1d,_0x352f76){this[_0x2614('0x15')]=[],this[_0x2614('0x31')]=new Map(),this[_0x2614('0x4')]=[],this[_0x2614('0x2e')]=_0x263e1d,this[_0x2614('0x29')]=_0x352f76;}['getDescriptions'](_0x287a25){const _0x465fe9=[];for(let _0x3556a2=0x0;_0x3556a2<_0x287a25[_0x2614('0x1d')];_0x3556a2++){const _0x3d0ff8=_0x287a25[_0x3556a2];if(!_0x3d0ff8[_0x2614('0x21')])continue;let _0x424f3d=!0x1;for(const _0x5b3bda of this['_customCallbacks']){const _0x209ccd=_0x5b3bda(_0x3d0ff8);if(_0x209ccd){_0x2614('0xb')in _0x209ccd&&_0x465fe9['push'](_0x209ccd),_0x424f3d=!0x0;break;}}if(!_0x424f3d){this[_0x2614('0x2c')](_0x465fe9,_0x3d0ff8);const _0x31024c=_0x287a25[_0x3556a2+0x1];if(_0x31024c&&!_0x3d0ff8[_0x2614('0x6')]()[_0x2614('0x0')][_0x2614('0xd')](_0x31024c[_0x2614('0x6')]()[_0x2614('0x22')])){const _0x2786ea=_0x465fe9[_0x465fe9[_0x2614('0x1d')]-0x1],_0x5a0fcd='insertion'==_0x3d0ff8[_0x2614('0xb')]?'add':_0x2614('0x10');_0x2786ea&&_0x2614('0x13')==_0x2786ea[_0x2614('0xb')]&&(_0x2786ea[_0x5a0fcd]+='\x0a');}}}return this[_0x2614('0x16')](_0x465fe9);}['registerDescriptionCallback'](_0x415ace){this[_0x2614('0x15')][_0x2614('0x17')](_0x415ace);}[_0x2614('0xe')](_0x1fc53c,_0x4b807f,_0x464cfb=_0x17db74[_0x2614('0x2f')]){_0x2614('0x11')==typeof _0x1fc53c?_0x183c11(this[_0x2614('0x4')],{'matchingCallback':_0x1fc53c,'label':_0x4b807f,'priority':_0x464cfb}):this[_0x2614('0x31')]['set'](_0x1fc53c,_0x4b807f);}['getItemLabel'](_0x3c753f,_0xe8bcc5=0x1){let _0x338367;for(const _0x2d380d of this['_itemLabelsCallbacks'])if(_0x2d380d[_0x2614('0x34')](_0x3c753f)){_0x338367=_0x2d380d['label'];break;}return _0x338367||(_0x338367=this[_0x2614('0x31')]['get'](_0x3c753f[_0x2614('0x12')])),_0x338367?_0x338367(_0xe8bcc5):0x1!==_0xe8bcc5?_0xe8bcc5+'\x20'+_0x3c753f[_0x2614('0x12')]+'s':''+_0x3c753f['name'];}[_0x2614('0x2c')](_0x39b70f,_0x19218a){const _0x278c11=_0x19218a[_0x2614('0x6')]()[_0x2614('0x32')](),_0x3e147f='insertion'==_0x19218a[_0x2614('0xb')]?'add':_0x2614('0x10');for(const _0x3928e6 of _0x278c11){const _0x4f2073=_0x3928e6['item'],_0xd3d279=_0x39b70f[_0x39b70f['length']-0x1];if(_0x4f2073['is'](_0x2614('0x14')))_0xd3d279&&_0xd3d279['type'][_0x2614('0x35')](_0x2614('0xc'))>-0x1&&_0x39b70f[_0x2614('0x25')](),_0xd3d279&&_0x2614('0x13')==_0xd3d279[_0x2614('0xb')]?_0xd3d279[_0x3e147f]+=_0x4f2073[_0x2614('0x1')]:_0x39b70f[_0x2614('0x17')]({'type':_0x2614('0x13'),'add':_0x2614('0x2')==_0x3e147f?_0x4f2073[_0x2614('0x1')]:'','remove':_0x2614('0x10')==_0x3e147f?_0x4f2073[_0x2614('0x1')]:''});else{if(this[_0x2614('0x2e')][_0x2614('0x30')](_0x4f2073)){const _0x206cce=_0x4f2073;if(_0xd3d279&&_0xd3d279[_0x2614('0xb')][_0x2614('0x35')](_0x2614('0xc'))>-0x1&&_0x39b70f['pop'](),'elementEnd'==_0x3928e6['type'])continue;_0xd3d279&&_0xd3d279[_0x2614('0xb')]==_0x3e147f+_0x2614('0xa')&&_0xd3d279[_0x2614('0x19')]['name']==_0x206cce[_0x2614('0x12')]?_0xd3d279[_0x2614('0x1a')]++:_0x39b70f['push']({'type':_0x3e147f+'Object','element':_0x206cce,'quantity':0x1}),_0x278c11[_0x2614('0x3')](_0x5f13a5=>!(_0x2614('0x36')==_0x5f13a5[_0x2614('0xb')]&&_0x5f13a5[_0x2614('0x27')]==_0x4f2073));}else{if(this[_0x2614('0x2e')]['checkChild'](_0x4f2073,'$text')||_0x4f2073['is']('element','softBreak')){const _0x5365f5=_0x4f2073;if(_0x2614('0x2')==_0x3e147f&&'elementStart'==_0x3928e6[_0x2614('0xb')]||_0x2614('0x10')==_0x3e147f&&_0x2614('0x36')==_0x3928e6[_0x2614('0xb')])continue;if(_0xd3d279&&-0x1==_0xd3d279[_0x2614('0xb')][_0x2614('0x35')]('Container')){'text'==_0xd3d279[_0x2614('0xb')]&&(_0xd3d279[_0x3e147f]+='\x0a');continue;}let _0x3c8235;if(_0x3c8235=_0x2614('0x2')==_0x3e147f?_0x5365f5[_0x2614('0x1b')]&&!this[_0x2614('0x2e')]['isObject'](_0x5365f5[_0x2614('0x1b')])?_0x5365f5[_0x2614('0x1b')]:null:_0x5365f5[_0x2614('0x37')]&&!this['_schema']['isObject'](_0x5365f5[_0x2614('0x37')])?_0x5365f5[_0x2614('0x37')]:null,_0x5365f5['isEmpty']||_0x3c8235&&_0x3c8235[_0x2614('0x28')]){const _0x2107f1=_0x3c8235&&_0x3c8235['isEmpty']?_0x3c8235:_0x5365f5;_0xd3d279&&_0xd3d279['type']==_0x3e147f+_0x2614('0x18')&&_0xd3d279[_0x2614('0x19')][_0x2614('0x12')]==_0x2107f1[_0x2614('0x12')]?_0xd3d279[_0x2614('0x1a')]++:_0x39b70f[_0x2614('0x17')]({'type':_0x3e147f+_0x2614('0x18'),'element':_0x2107f1,'quantity':0x1});}else _0x39b70f['push']({'type':_0x3e147f+_0x2614('0xc'),'element':_0x5365f5});}}}}}[_0x2614('0x16')](_0x3924b4){const _0x314151=this[_0x2614('0x29')],_0x2c3822=[];for(const _0x2aa72e of _0x3924b4){switch(_0x2aa72e[_0x2614('0xb')]){case _0x2614('0x13'):if(_0x2aa72e['add']=_0x2aa72e[_0x2614('0x2')][_0x2614('0x5')](/(\S)\u000A+(\S)/g,_0x2614('0x9'))[_0x2614('0x5')](/\u000A/g,''),_0x2aa72e[_0x2614('0x10')]=_0x2aa72e[_0x2614('0x10')][_0x2614('0x5')](/(\S)\u000A+(\S)/g,_0x2614('0x9'))[_0x2614('0x5')](/\u000A/g,''),''!=_0x2aa72e['add']&&''!=_0x2aa72e['remove']){_0x2c3822[_0x2614('0x17')]({'type':_0x2614('0x5'),'content':_0x503418(_0x314151,_0x2614('0x1e'),['\x22'+_0x2aa72e[_0x2614('0x10')]+'\x22','\x22'+_0x2aa72e[_0x2614('0x2')]+'\x22'])});continue;}if(null!=_0x2aa72e[_0x2614('0x2')][_0x2614('0x7')](/^ +$/)){_0x2c3822[_0x2614('0x17')]({'type':_0x2614('0x24'),'content':_0x503418(_0x314151,_0x2614('0x1f'),_0x503418(_0x314151,_0x2614('0x23'),_0x2aa72e[_0x2614('0x2')]['length']))});continue;}if(null!=_0x2aa72e[_0x2614('0x10')][_0x2614('0x7')](/^ +$/)){_0x2c3822[_0x2614('0x17')]({'type':_0x2614('0x20'),'content':_0x503418(_0x314151,_0x2614('0x2a'),_0x503418(_0x314151,_0x2614('0x23'),_0x2aa72e[_0x2614('0x10')][_0x2614('0x1d')]))});continue;}if(''!=_0x2aa72e[_0x2614('0x2')]){_0x2c3822[_0x2614('0x17')]({'type':_0x2614('0x24'),'content':_0x503418(_0x314151,_0x2614('0x1f'),'\x22'+_0x2aa72e['add']+'\x22')});continue;}_0x2c3822[_0x2614('0x17')]({'type':_0x2614('0x20'),'content':_0x503418(_0x314151,_0x2614('0x2a'),'\x22'+_0x2aa72e[_0x2614('0x10')]+'\x22')});continue;case _0x2614('0x2d'):case _0x2614('0x26'):_0x2c3822[_0x2614('0x17')]({'type':_0x2614('0x24'),'content':_0x503418(_0x314151,_0x2614('0x1f'),this[_0x2614('0x8')](_0x2aa72e[_0x2614('0x19')],_0x2aa72e[_0x2614('0x1a')]))});continue;case'removeEmptyContainer':case _0x2614('0x33'):_0x2c3822['push']({'type':_0x2614('0x20'),'content':_0x503418(_0x314151,'*Remove:*\x20%0',this[_0x2614('0x8')](_0x2aa72e[_0x2614('0x19')],_0x2aa72e['quantity']))});continue;case _0x2614('0x2b'):_0x2c3822[_0x2614('0x17')]({'type':_0x2614('0x24'),'content':_0x503418(_0x314151,_0x2614('0x1c'),this[_0x2614('0x8')](_0x2aa72e[_0x2614('0x19')],_0x2aa72e[_0x2614('0x1a')]))});continue;case'removeContainer':_0x2c3822[_0x2614('0x17')]({'type':'deletion','content':_0x503418(_0x314151,_0x2614('0xf'),this[_0x2614('0x8')](_0x2aa72e[_0x2614('0x19')],_0x2aa72e['quantity']))});continue;}_0x2c3822['push'](_0x2aa72e);}return _0x2c3822;}}
|