@ckeditor/ckeditor5-track-changes 36.0.1 → 37.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/track-changes.js +1 -1
- package/ckeditor5-metadata.json +10 -0
- package/package.json +20 -5
- package/src/augmentation.d.ts +36 -0
- package/src/augmentation.js +23 -0
- package/src/commands/acceptsuggestioncommand.d.ts +20 -0
- package/src/commands/acceptsuggestioncommand.js +1 -1
- package/src/commands/discardsuggestioncommand.d.ts +20 -0
- package/src/commands/discardsuggestioncommand.js +1 -1
- package/src/commands/executeonallsuggestionscommand.d.ts +20 -0
- package/src/commands/executeonallsuggestionscommand.js +1 -1
- package/src/commands/executeonselectedsuggestionscommand.d.ts +20 -0
- package/src/commands/executeonselectedsuggestionscommand.js +1 -1
- package/src/commands/trackchangescommand.d.ts +22 -0
- package/src/commands/trackchangescommand.js +1 -1
- package/src/index.d.ts +12 -0
- package/src/index.js +1 -1
- package/src/integrations/alignment.d.ts +13 -0
- package/src/integrations/alignment.js +1 -1
- package/src/integrations/basicstyles.d.ts +13 -0
- package/src/integrations/basicstyles.js +1 -1
- package/src/integrations/blockquote.d.ts +13 -0
- package/src/integrations/blockquote.js +1 -1
- package/src/integrations/ckbox.d.ts +13 -0
- package/src/integrations/ckbox.js +1 -1
- package/src/integrations/codeblock.d.ts +13 -0
- package/src/integrations/codeblock.js +1 -1
- package/src/integrations/comments.d.ts +10 -0
- package/src/integrations/comments.js +1 -1
- package/src/integrations/deletecommand.d.ts +12 -0
- package/src/integrations/deletecommand.js +1 -1
- package/src/integrations/documentlist.d.ts +13 -0
- package/src/integrations/documentlist.js +1 -1
- package/src/integrations/documentlistproperties.d.ts +25 -0
- package/src/integrations/documentlistproperties.js +1 -1
- package/src/integrations/entercommand.d.ts +11 -0
- package/src/integrations/entercommand.js +1 -1
- package/src/integrations/findandreplace.d.ts +17 -0
- package/src/integrations/findandreplace.js +1 -1
- package/src/integrations/font.d.ts +13 -0
- package/src/integrations/font.js +1 -1
- package/src/integrations/heading.d.ts +13 -0
- package/src/integrations/heading.js +1 -1
- package/src/integrations/highlight.d.ts +13 -0
- package/src/integrations/highlight.js +1 -1
- package/src/integrations/horizontalline.d.ts +13 -0
- package/src/integrations/horizontalline.js +1 -1
- package/src/integrations/htmlembed.d.ts +13 -0
- package/src/integrations/htmlembed.js +1 -1
- package/src/integrations/image.d.ts +13 -0
- package/src/integrations/image.js +1 -1
- package/src/integrations/imagereplace.d.ts +19 -0
- package/src/integrations/imagereplace.js +1 -1
- package/src/integrations/importword.d.ts +14 -0
- package/src/integrations/importword.js +1 -1
- package/src/integrations/indent.d.ts +13 -0
- package/src/integrations/indent.js +1 -1
- package/src/integrations/inputcommand.d.ts +11 -0
- package/src/integrations/inputcommand.js +1 -1
- package/src/integrations/link.d.ts +13 -0
- package/src/integrations/link.js +1 -1
- package/src/integrations/list.d.ts +13 -0
- package/src/integrations/list.js +1 -1
- package/src/integrations/listproperties.d.ts +25 -0
- package/src/integrations/listproperties.js +1 -1
- package/src/integrations/mediaembed.d.ts +13 -0
- package/src/integrations/mediaembed.js +1 -1
- package/src/integrations/mention.d.ts +13 -0
- package/src/integrations/mention.js +1 -1
- package/src/integrations/pagebreak.d.ts +13 -0
- package/src/integrations/pagebreak.js +1 -1
- package/src/integrations/paragraph.d.ts +13 -0
- package/src/integrations/paragraph.js +1 -1
- package/src/integrations/removeformat.d.ts +13 -0
- package/src/integrations/removeformat.js +1 -1
- package/src/integrations/restrictededitingmode.d.ts +13 -0
- package/src/integrations/restrictededitingmode.js +1 -1
- package/src/integrations/shiftentercommand.d.ts +11 -0
- package/src/integrations/shiftentercommand.js +1 -1
- package/src/integrations/standardeditingmode.d.ts +13 -0
- package/src/integrations/standardeditingmode.js +1 -1
- package/src/integrations/style.d.ts +14 -0
- package/src/integrations/style.js +1 -1
- package/src/integrations/table.d.ts +38 -0
- package/src/integrations/table.js +1 -1
- package/src/integrations/tablecaption.d.ts +17 -0
- package/src/integrations/tablecaption.js +1 -1
- package/src/integrations/tableclipboard.d.ts +17 -0
- package/src/integrations/tableclipboard.js +1 -1
- package/src/integrations/tablecolumnresize.d.ts +22 -0
- package/src/integrations/tablecolumnresize.js +1 -1
- package/src/integrations/tableheadings.d.ts +17 -0
- package/src/integrations/tableheadings.js +1 -1
- package/src/integrations/tablemergesplit.d.ts +17 -0
- package/src/integrations/tablemergesplit.js +1 -1
- package/src/integrations/tableproperties.d.ts +23 -0
- package/src/integrations/tableproperties.js +1 -1
- package/src/integrations/title.d.ts +13 -0
- package/src/integrations/title.js +1 -1
- package/src/integrations/undo.d.ts +13 -0
- package/src/integrations/undo.js +1 -1
- package/src/integrations/utils.d.ts +17 -0
- package/src/integrations/utils.js +1 -1
- package/src/suggestion.d.ts +266 -0
- package/src/suggestion.js +1 -1
- package/src/suggestiondescriptionfactory.d.ts +151 -0
- package/src/suggestiondescriptionfactory.js +1 -1
- package/src/trackchanges.d.ts +222 -0
- package/src/trackchanges.js +1 -1
- package/src/trackchangesconfig.d.ts +53 -0
- package/src/trackchangesconfig.js +23 -0
- package/src/trackchangesdata.d.ts +38 -0
- package/src/trackchangesdata.js +1 -1
- package/src/trackchangesediting.d.ts +391 -0
- package/src/trackchangesediting.js +1 -1
- package/src/trackchangesui.d.ts +34 -0
- package/src/trackchangesui.js +1 -1
- package/src/ui/suggestioncontroller.d.ts +36 -0
- package/src/ui/suggestioncontroller.js +1 -1
- package/src/ui/view/basesuggestionthreadview.d.ts +166 -0
- package/src/ui/view/basesuggestionthreadview.js +1 -1
- package/src/ui/view/suggestionthreadview.d.ts +184 -0
- package/src/ui/view/suggestionthreadview.js +1 -1
- package/src/utils/common-translations.d.ts +5 -0
- package/src/utils/common-translations.js +1 -1
- package/src/utils/utils.d.ts +26 -0
- package/src/utils/utils.js +1 -1
|
@@ -0,0 +1,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 _0x1ed2=['get','previousPosition','toViewPosition','activeMarkers','element','toViewElement','getCustomProperty','markerName','isBlock','mapper','ck-suggestion-marker--active','hasAttribute','listIndent','push','isContent','span','insert','nextSibling','addHighlight','isLimit','TrackChangesEditing','item','includes','ck-suggestion-marker-','createUIElement','writer','name','start','markerRange','consumable','isAtEnd','createRangeOn','plugins','bindElementToMarker'];(function(_0x512dd5,_0x1ed230){const _0x2316a7=function(_0xd44490){while(--_0xd44490){_0x512dd5['push'](_0x512dd5['shift']());}};_0x2316a7(++_0x1ed230);}(_0x1ed2,0x1b9));const _0x2316=function(_0x512dd5,_0x1ed230){_0x512dd5=_0x512dd5-0x0;let _0x2316a7=_0x1ed2[_0x512dd5];return _0x2316a7;};export function getRangesWithAttribute(_0x5c3ed7,_0x36f399,_0x4bc5c4){const _0x492314=[];for(const _0x1e80b8 of _0x36f399['getItems']())_0x1e80b8[_0x2316('0xc')](_0x5c3ed7)&&_0x492314[_0x2316('0xe')](_0x4bc5c4[_0x2316('0x20')](_0x1e80b8));return _0x492314;}export function getElementsAffectedByListItemRename(_0x2ce7e9){const _0x338c39=[];if(_0x2ce7e9['is'](_0x2316('0x5'),'listItem')){let _0x3dafab=_0x2ce7e9[_0x2316('0x12')];for(;_0x3dafab&&_0x3dafab['is'](_0x2316('0x5'),'listItem')&&_0x3dafab['getAttribute'](_0x2316('0xd'))>0x0;)_0x338c39[_0x2316('0xe')](_0x3dafab),_0x3dafab=_0x3dafab['nextSibling'];}return _0x338c39;}export function downcastSplitMergeMarker(_0x10cf57,_0x1c317a,{showActiveMarker:_0x1688b4=!0x0}={}){const _0x317448=_0x10cf57[_0x2316('0x21')][_0x2316('0x1')](_0x2316('0x15'));return(_0x509fa5,_0x67ca7a,_0x421a0b)=>{if(!_0x421a0b[_0x2316('0x1e')]['test'](_0x67ca7a[_0x2316('0x1d')],_0x509fa5[_0x2316('0x1b')]))return;const _0x3ec57f=_0x67ca7a['markerRange']['getWalker'](),_0x495528=_0x67ca7a[_0x2316('0x1d')][_0x2316('0x1c')],_0xb24156=_0x10cf57['model']['schema'];let _0x5f1b7f=null,_0x26dd04=null,_0x13328b=!0x1,_0x534b5c=!0x1;for(const _0xbde93b of _0x3ec57f){const _0x13f29b=_0xbde93b[_0x2316('0x16')];_0x13328b=_0x13328b||_0xb24156[_0x2316('0xf')](_0x13f29b);const _0x30a3dc=_0x421a0b[_0x2316('0xa')][_0x2316('0x6')](_0x13f29b);if(_0x30a3dc&&_0x30a3dc[_0x2316('0x7')](_0x2316('0x13')))return;'elementEnd'==_0xbde93b['type']&&(_0xb24156[_0x2316('0x9')](_0x13f29b)&&!_0xb24156[_0x2316('0x14')](_0x13f29b)&&(_0x13f29b[_0x2316('0x12')]||_0x495528[_0x2316('0x1f')]?_0x5f1b7f&&_0x5f1b7f['parent']==_0x13f29b||(_0x5f1b7f=_0x13f29b,_0xd4611f(_0xbde93b[_0x2316('0x2')]),_0x534b5c=!0x0):_0x26dd04=_0x26dd04||_0xbde93b[_0x2316('0x2')]));}function _0xd4611f(_0x2aae40){const _0x195f9b=_0x421a0b['writer'][_0x2316('0x19')](_0x2316('0x10'),{'class':_0x2316('0x18')+_0x1c317a}),_0x237e4e=_0x421a0b[_0x2316('0xa')][_0x2316('0x3')](_0x2aae40);_0x1688b4&&_0x317448[_0x2316('0x4')][_0x2316('0x17')](_0x67ca7a['markerName'])&&_0x421a0b[_0x2316('0x1a')]['addClass'](_0x2316('0xb'),_0x195f9b),_0x421a0b[_0x2316('0x1a')][_0x2316('0x11')](_0x237e4e,_0x195f9b),_0x421a0b[_0x2316('0xa')][_0x2316('0x0')](_0x195f9b,_0x67ca7a[_0x2316('0x8')]);}_0x13328b||_0x534b5c||!_0x26dd04||_0xd4611f(_0x26dd04);};}
|
|
@@ -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 _0x1364=['subType','set','addRange','creator','getMarkerNames','isIntersectingWithRange','onAttributesChange','from','removeAttribute','getRange','size','filter','discard','hasComments','head','_onAttributesChange','end','get','getAllAdjacentSuggestions','_markerNames','onAccept','nodeBefore','@external','add','change','clear','getItems','getContainedElement','addMarkerName','start','getMarkers','isExternal','removeMarkers','map','type','_model','author','suggestion:','onDiscard','getRanges','_onDiscard','reduce','getMultiRangeId','substr','isInContent','push','attributes','data','getFirstRange','removeMarker','isMultiRange','createdAt','addMarker','previous','authoredAt','_onAccept','length','toJSON','getFirstMarker','split','setAttribute','accept','decorate','nodeAfter','commentThread'];(function(_0x20bcae,_0x136451){const _0x116048=function(_0xc9f79e){while(--_0xc9f79e){_0x20bcae['push'](_0x20bcae['shift']());}};_0x116048(++_0x136451);}(_0x1364,0x6c));const _0x1160=function(_0x20bcae,_0x136451){_0x20bcae=_0x20bcae-0x0;let _0x116048=_0x1364[_0x20bcae];return _0x116048;};import{Element as _0x4568c0}from'ckeditor5/src/engine';import{ObservableMixin as _0x380a53,uid as _0x32b771}from'ckeditor5/src/utils';import{cloneDeep as _0x15ce27,isEqual as _0x43651e,set as _0x2a2e6a,unset as _0x33b08f}from'lodash-es';export default class u extends _0x380a53(){constructor(_0x501842,_0x45f4a8){super(),this['id']=_0x45f4a8['id'],this[_0x1160('0x38')]=_0x45f4a8[_0x1160('0x38')],this[_0x1160('0x16')]=_0x45f4a8[_0x1160('0x16')]||null,this['author']=_0x45f4a8[_0x1160('0x3a')],this[_0x1160('0x19')]=_0x45f4a8['creator']||_0x45f4a8[_0x1160('0x3a')],this[_0x1160('0x35')]=Boolean(_0x45f4a8[_0x1160('0x3')]&&_0x45f4a8[_0x1160('0x3')][_0x1160('0x2c')]),this[_0x1160('0x4')]=null,this[_0x1160('0x39')]=_0x501842,this[_0x1160('0xc')]=_0x45f4a8[_0x1160('0x2a')],this[_0x1160('0x3e')]=_0x45f4a8[_0x1160('0x3c')],this['_onAttributesChange']=_0x45f4a8[_0x1160('0x1c')],this[_0x1160('0x29')]=new Set(),this['createdAt']=null,this[_0x1160('0x17')](_0x1160('0xb'),null),this[_0x1160('0x17')](_0x1160('0x3'),_0x45f4a8[_0x1160('0x3')]||{}),this[_0x1160('0x17')]('previous',null),this[_0x1160('0x17')]('next',null),this[_0x1160('0x17')](_0x1160('0x15'),null),this['set']('_saved',!0x1),this[_0x1160('0x13')]('accept'),this[_0x1160('0x13')](_0x1160('0x22'));}get['head'](){let _0xcf41fc=this;for(;_0xcf41fc[_0x1160('0xa')];)_0xcf41fc=_0xcf41fc[_0x1160('0xa')];return _0xcf41fc;}get[_0x1160('0x23')](){return!!this[_0x1160('0x15')]&&this[_0x1160('0x15')][_0x1160('0xd')]>0x0;}get[_0x1160('0x7')](){if(0x0==this['_markerNames'][_0x1160('0x20')])return!0x1;return 0x6==Array['from'](this[_0x1160('0x29')])[0x0][_0x1160('0x10')](':')[_0x1160('0xd')];}get[_0x1160('0x1')](){return null!==this['getFirstMarker']();}[_0x1160('0x32')](_0x1f6488){this['_markerNames'][_0x1160('0x2d')](_0x1f6488);}[_0x1160('0x1a')](){return Array[_0x1160('0x1d')](this[_0x1160('0x29')]);}[_0x1160('0x34')](){return this[_0x1160('0x1a')]()[_0x1160('0x37')](_0x76e787=>this['_model']['markers'][_0x1160('0x27')](_0x76e787))[_0x1160('0x21')](_0x2d588d=>_0x2d588d);}[_0x1160('0xf')](){return this['getMarkers']()[0x0]||null;}[_0x1160('0x36')](){this[_0x1160('0x39')][_0x1160('0x2e')](_0x1b50e4=>{for(const _0x43e862 of this[_0x1160('0x34')]())_0x1b50e4['removeMarker'](_0x43e862);}),this[_0x1160('0x29')][_0x1160('0x2f')]();}[_0x1160('0x6')](_0x2eafb1){this[_0x1160('0x39')][_0x1160('0x2e')](_0x454738=>{_0x454738[_0x1160('0x6')](_0x2eafb1);}),this[_0x1160('0x29')]['delete'](_0x2eafb1);}[_0x1160('0x18')](_0x56099d){const _0x56eb26=_0x1160('0x3b')+this[_0x1160('0x38')]+':'+this[_0x1160('0x16')]+':'+this['id']+':'+this[_0x1160('0x19')]['id']+':'+u[_0x1160('0x40')]();this[_0x1160('0x32')](_0x56eb26),this[_0x1160('0x39')][_0x1160('0x2e')](_0x66d7af=>{_0x66d7af[_0x1160('0x9')](_0x56eb26,{'range':_0x56099d,'usingOperation':!0x0,'affectsData':!0x0});});}[_0x1160('0x1b')](_0x9aca45){for(const _0x1af23a of this[_0x1160('0x3d')]())if(_0x1af23a['isIntersecting'](_0x9aca45))return!0x0;return!0x1;}[_0x1160('0x3d')](){return this[_0x1160('0x34')]()[_0x1160('0x37')](_0x1fe8a4=>_0x1fe8a4[_0x1160('0x1f')]());}[_0x1160('0x30')](){return this['getRanges']()[_0x1160('0x3f')]((_0x249108,_0x4d78ba)=>[..._0x249108,..._0x4d78ba[_0x1160('0x30')]()],[]);}[_0x1160('0x5')](){var _0x1f8678;return(null===(_0x1f8678=this[_0x1160('0xf')]())||void 0x0===_0x1f8678?void 0x0:_0x1f8678['getRange']())||null;}[_0x1160('0x31')](){const _0x55d001=this[_0x1160('0x3d')]();if(0x1!=_0x55d001[_0x1160('0xd')])return null;const _0x25f55e=_0x55d001[0x0],_0x55cdad=_0x25f55e[_0x1160('0x33')][_0x1160('0x14')],_0x5da427=_0x25f55e[_0x1160('0x26')][_0x1160('0x2b')];return _0x55cdad instanceof _0x4568c0?_0x55cdad!=_0x5da427?null:_0x55cdad:null;}[_0x1160('0x12')](){this[_0x1160('0xc')](this[_0x1160('0x3d')](),this[_0x1160('0x4')],this[_0x1160('0x3')]),this['removeMarkers']();}[_0x1160('0x22')](){this[_0x1160('0x3e')](this[_0x1160('0x3d')](),this[_0x1160('0x4')],this[_0x1160('0x3')]),this[_0x1160('0x36')]();}[_0x1160('0x28')](){const _0x5552dd=[];let _0x39d7e3=this[_0x1160('0x24')];for(;_0x39d7e3;)_0x5552dd[_0x1160('0x2')](_0x39d7e3),_0x39d7e3=_0x39d7e3['next'];return _0x5552dd;}[_0x1160('0x11')](_0x16c4c8,_0x33831c){const _0x1f593b=_0x15ce27(this['attributes']);_0x2a2e6a(_0x1f593b,_0x16c4c8,_0x33831c),_0x43651e(_0x1f593b,this['attributes'])||(this[_0x1160('0x3')]=_0x1f593b,this[_0x1160('0x25')](_0x1f593b));}[_0x1160('0x1e')](_0x3a764b){const _0x14c49d=_0x15ce27(this[_0x1160('0x3')]);_0x33b08f(_0x14c49d,_0x3a764b),_0x43651e(_0x14c49d,this[_0x1160('0x3')])||(this[_0x1160('0x3')]=_0x14c49d,this[_0x1160('0x25')](this[_0x1160('0x3')]));}[_0x1160('0xe')](){return{'id':this['id'],'type':this[_0x1160('0x16')]?this[_0x1160('0x38')]+':'+this[_0x1160('0x16')]:this[_0x1160('0x38')],'authorId':this[_0x1160('0x19')]['id'],'createdAt':this[_0x1160('0x8')],'hasComments':this['hasComments'],'data':this[_0x1160('0x4')],'attributes':this[_0x1160('0x3')]};}static[_0x1160('0x40')](){return _0x32b771()[_0x1160('0x0')](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 _0x16a8=['addObject','push','_addDescriptionItems','_schema','get','item','registerDescriptionCallback','addEmptyContainer','end','function','deletion','skip','replace','quantity','match','_itemLabels','*Insert:*\x20%0','REPLACE_TEXT','add','set','_itemLabelsCallbacks','text','elementEnd','isEqual','data','_resolveDescriptionItems','element','getFirstRange','removeObject','elementStart','type','nextSibling','checkChild','getItemLabel','_customCallbacks','remove','label','normal','isEmpty','isInContent','removeContainer','previousSibling','indexOf','pop','getDescriptions','removeEmptyContainer','$textProxy','Container','*Remove:*\x20%0','isObject','ELEMENT_SPACE','Object','addContainer','*Merge:*\x20%0','getWalker','*Split:*\x20%0','EmptyContainer','name','length','$1\x20$2','start','insertion'];(function(_0x9933b5,_0x16a864){const _0x28f4c8=function(_0xb3cc5a){while(--_0xb3cc5a){_0x9933b5['push'](_0x9933b5['shift']());}};_0x28f4c8(++_0x16a864);}(_0x16a8,0x8c));const _0x28f4=function(_0x9933b5,_0x16a864){_0x9933b5=_0x9933b5-0x0;let _0x28f4c8=_0x16a8[_0x9933b5];return _0x28f4c8;};import{getTranslation as _0xf62a54}from'./utils/common-translations';import{priorities as _0x32d0b2,insertToPriorityArray as _0x429c91}from'ckeditor5/src/utils';export default class m{constructor(_0x209faa,_0x5904e7){this[_0x28f4('0x12')]=[],this[_0x28f4('0x3d')]=new Map(),this[_0x28f4('0x4')]=[],this['_schema']=_0x209faa,this['_locale']=_0x5904e7;}[_0x28f4('0x1c')](_0x1fabbd){const _0x1b0513=[];for(let _0x2c5dbd=0x0;_0x2c5dbd<_0x1fabbd[_0x28f4('0x2a')];_0x2c5dbd++){const _0x87955b=_0x1fabbd[_0x2c5dbd];if(!_0x87955b[_0x28f4('0x17')])continue;let _0x492767=!0x1;for(const _0x1525b0 of this[_0x28f4('0x12')]){const _0x57170b=_0x1525b0(_0x87955b);if(_0x57170b){'type'in _0x57170b&&_0x1b0513['push'](_0x57170b),_0x492767=!0x0;break;}}if(!_0x492767){this[_0x28f4('0x30')](_0x1b0513,_0x87955b);const _0x413697=_0x1fabbd[_0x2c5dbd+0x1];if(_0x413697&&!_0x87955b['getFirstRange']()[_0x28f4('0x36')][_0x28f4('0x7')](_0x413697[_0x28f4('0xb')]()[_0x28f4('0x2c')])){const _0x461c45=_0x1b0513[_0x1b0513[_0x28f4('0x2a')]-0x1],_0x4e5cfd='insertion'==_0x87955b['type']?_0x28f4('0x2'):_0x28f4('0x13');_0x461c45&&_0x28f4('0x5')==_0x461c45[_0x28f4('0xe')]&&(_0x461c45[_0x4e5cfd]+='\x0a');}}}return this['_resolveDescriptionItems'](_0x1b0513);}[_0x28f4('0x34')](_0x5d3bca){this['_customCallbacks'][_0x28f4('0x2f')](_0x5d3bca);}['registerElementLabel'](_0x1398ca,_0x403dcc,_0xb721d0=_0x32d0b2[_0x28f4('0x15')]){_0x28f4('0x37')==typeof _0x1398ca?_0x429c91(this[_0x28f4('0x4')],{'matchingCallback':_0x1398ca,'label':_0x403dcc,'priority':_0xb721d0}):this['_itemLabels'][_0x28f4('0x3')](_0x1398ca,_0x403dcc);}['getItemLabel'](_0x3d2cc5,_0x33939d=0x1){let _0x200430;for(const _0x170920 of this[_0x28f4('0x4')])if(_0x170920['matchingCallback'](_0x3d2cc5)){_0x200430=_0x170920[_0x28f4('0x14')];break;}return _0x200430||(_0x200430=this['_itemLabels'][_0x28f4('0x32')](_0x3d2cc5[_0x28f4('0x29')])),_0x200430?_0x200430(_0x33939d):0x1!==_0x33939d?_0x33939d+'\x20'+_0x3d2cc5['name']+'s':''+_0x3d2cc5[_0x28f4('0x29')];}['_addDescriptionItems'](_0x387b7a,_0x4ca9bb){const _0x3dafd5=_0x4ca9bb[_0x28f4('0xb')]()[_0x28f4('0x26')](),_0x5e61a6=_0x28f4('0x2d')==_0x4ca9bb[_0x28f4('0xe')]?_0x28f4('0x2'):'remove';for(const _0xda5ef5 of _0x3dafd5){const _0x38d8b1=_0xda5ef5[_0x28f4('0x33')],_0xba1d7=_0x387b7a[_0x387b7a[_0x28f4('0x2a')]-0x1];if(_0x38d8b1['is'](_0x28f4('0x1e')))_0xba1d7&&_0xba1d7[_0x28f4('0xe')][_0x28f4('0x1a')]('Container')>-0x1&&_0x387b7a[_0x28f4('0x1b')](),_0xba1d7&&'text'==_0xba1d7[_0x28f4('0xe')]?_0xba1d7[_0x5e61a6]+=_0x38d8b1[_0x28f4('0x8')]:_0x387b7a[_0x28f4('0x2f')]({'type':_0x28f4('0x5'),'add':'add'==_0x5e61a6?_0x38d8b1['data']:'','remove':_0x28f4('0x13')==_0x5e61a6?_0x38d8b1[_0x28f4('0x8')]:''});else{if(this['_schema']['isObject'](_0x38d8b1)){const _0x576282=_0x38d8b1;if(_0xba1d7&&_0xba1d7[_0x28f4('0xe')][_0x28f4('0x1a')]('Container')>-0x1&&_0x387b7a[_0x28f4('0x1b')](),_0x28f4('0x6')==_0xda5ef5[_0x28f4('0xe')])continue;_0xba1d7&&_0xba1d7['type']==_0x5e61a6+'Object'&&_0xba1d7[_0x28f4('0xa')]['name']==_0x576282['name']?_0xba1d7['quantity']++:_0x387b7a[_0x28f4('0x2f')]({'type':_0x5e61a6+_0x28f4('0x23'),'element':_0x576282,'quantity':0x1}),_0x3dafd5[_0x28f4('0x39')](_0x33a1ab=>!(_0x28f4('0x6')==_0x33a1ab['type']&&_0x33a1ab['item']==_0x38d8b1));}else{if(this[_0x28f4('0x31')][_0x28f4('0x10')](_0x38d8b1,'$text')||_0x38d8b1['is'](_0x28f4('0xa'),'softBreak')){const _0x318a72=_0x38d8b1;if(_0x28f4('0x2')==_0x5e61a6&&_0x28f4('0xd')==_0xda5ef5['type']||'remove'==_0x5e61a6&&_0x28f4('0x6')==_0xda5ef5[_0x28f4('0xe')])continue;if(_0xba1d7&&-0x1==_0xba1d7[_0x28f4('0xe')]['indexOf'](_0x28f4('0x1f'))){'text'==_0xba1d7[_0x28f4('0xe')]&&(_0xba1d7[_0x5e61a6]+='\x0a');continue;}let _0x5a5d8d;if(_0x5a5d8d=_0x28f4('0x2')==_0x5e61a6?_0x318a72[_0x28f4('0xf')]&&!this[_0x28f4('0x31')][_0x28f4('0x21')](_0x318a72[_0x28f4('0xf')])?_0x318a72[_0x28f4('0xf')]:null:_0x318a72[_0x28f4('0x19')]&&!this['_schema'][_0x28f4('0x21')](_0x318a72[_0x28f4('0x19')])?_0x318a72['previousSibling']:null,_0x318a72[_0x28f4('0x16')]||_0x5a5d8d&&_0x5a5d8d['isEmpty']){const _0x55368a=_0x5a5d8d&&_0x5a5d8d[_0x28f4('0x16')]?_0x5a5d8d:_0x318a72;_0xba1d7&&_0xba1d7[_0x28f4('0xe')]==_0x5e61a6+_0x28f4('0x28')&&_0xba1d7[_0x28f4('0xa')]['name']==_0x55368a[_0x28f4('0x29')]?_0xba1d7[_0x28f4('0x3b')]++:_0x387b7a[_0x28f4('0x2f')]({'type':_0x5e61a6+_0x28f4('0x28'),'element':_0x55368a,'quantity':0x1});}else _0x387b7a['push']({'type':_0x5e61a6+'Container','element':_0x318a72});}}}}}[_0x28f4('0x9')](_0x1e5331){const _0x59f5c4=this['_locale'],_0x12ae52=[];for(const _0x2ce6fa of _0x1e5331){switch(_0x2ce6fa[_0x28f4('0xe')]){case _0x28f4('0x5'):if(_0x2ce6fa[_0x28f4('0x2')]=_0x2ce6fa[_0x28f4('0x2')][_0x28f4('0x3a')](/(\S)\u000A+(\S)/g,_0x28f4('0x2b'))['replace'](/\u000A/g,''),_0x2ce6fa[_0x28f4('0x13')]=_0x2ce6fa['remove'][_0x28f4('0x3a')](/(\S)\u000A+(\S)/g,_0x28f4('0x2b'))[_0x28f4('0x3a')](/\u000A/g,''),''!=_0x2ce6fa[_0x28f4('0x2')]&&''!=_0x2ce6fa[_0x28f4('0x13')]){_0x12ae52['push']({'type':_0x28f4('0x3a'),'content':_0xf62a54(_0x59f5c4,_0x28f4('0x1'),['\x22'+_0x2ce6fa[_0x28f4('0x13')]+'\x22','\x22'+_0x2ce6fa['add']+'\x22'])});continue;}if(null!=_0x2ce6fa[_0x28f4('0x2')][_0x28f4('0x3c')](/^ +$/)){_0x12ae52['push']({'type':'insertion','content':_0xf62a54(_0x59f5c4,_0x28f4('0x0'),_0xf62a54(_0x59f5c4,_0x28f4('0x22'),_0x2ce6fa[_0x28f4('0x2')][_0x28f4('0x2a')]))});continue;}if(null!=_0x2ce6fa[_0x28f4('0x13')][_0x28f4('0x3c')](/^ +$/)){_0x12ae52[_0x28f4('0x2f')]({'type':'deletion','content':_0xf62a54(_0x59f5c4,_0x28f4('0x20'),_0xf62a54(_0x59f5c4,_0x28f4('0x22'),_0x2ce6fa[_0x28f4('0x13')][_0x28f4('0x2a')]))});continue;}if(''!=_0x2ce6fa[_0x28f4('0x2')]){_0x12ae52[_0x28f4('0x2f')]({'type':_0x28f4('0x2d'),'content':_0xf62a54(_0x59f5c4,_0x28f4('0x0'),'\x22'+_0x2ce6fa['add']+'\x22')});continue;}_0x12ae52[_0x28f4('0x2f')]({'type':_0x28f4('0x38'),'content':_0xf62a54(_0x59f5c4,_0x28f4('0x20'),'\x22'+_0x2ce6fa[_0x28f4('0x13')]+'\x22')});continue;case _0x28f4('0x35'):case _0x28f4('0x2e'):_0x12ae52['push']({'type':_0x28f4('0x2d'),'content':_0xf62a54(_0x59f5c4,_0x28f4('0x0'),this[_0x28f4('0x11')](_0x2ce6fa[_0x28f4('0xa')],_0x2ce6fa[_0x28f4('0x3b')]))});continue;case _0x28f4('0x1d'):case _0x28f4('0xc'):_0x12ae52[_0x28f4('0x2f')]({'type':_0x28f4('0x38'),'content':_0xf62a54(_0x59f5c4,_0x28f4('0x20'),this[_0x28f4('0x11')](_0x2ce6fa[_0x28f4('0xa')],_0x2ce6fa['quantity']))});continue;case _0x28f4('0x24'):_0x12ae52[_0x28f4('0x2f')]({'type':_0x28f4('0x2d'),'content':_0xf62a54(_0x59f5c4,_0x28f4('0x27'),this[_0x28f4('0x11')](_0x2ce6fa[_0x28f4('0xa')],_0x2ce6fa[_0x28f4('0x3b')]))});continue;case _0x28f4('0x18'):_0x12ae52[_0x28f4('0x2f')]({'type':_0x28f4('0x38'),'content':_0xf62a54(_0x59f5c4,_0x28f4('0x25'),this[_0x28f4('0x11')](_0x2ce6fa[_0x28f4('0xa')],_0x2ce6fa[_0x28f4('0x3b')]))});continue;}_0x12ae52['push'](_0x2ce6fa);}return _0x12ae52;}}
|