@ckeditor/ckeditor5-track-changes 36.0.0 → 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.
Files changed (127) hide show
  1. package/build/track-changes.js +1 -1
  2. package/ckeditor5-metadata.json +10 -0
  3. package/package.json +21 -6
  4. package/src/augmentation.d.ts +36 -0
  5. package/src/augmentation.js +23 -0
  6. package/src/commands/acceptsuggestioncommand.d.ts +20 -0
  7. package/src/commands/acceptsuggestioncommand.js +1 -1
  8. package/src/commands/discardsuggestioncommand.d.ts +20 -0
  9. package/src/commands/discardsuggestioncommand.js +1 -1
  10. package/src/commands/executeonallsuggestionscommand.d.ts +20 -0
  11. package/src/commands/executeonallsuggestionscommand.js +1 -1
  12. package/src/commands/executeonselectedsuggestionscommand.d.ts +20 -0
  13. package/src/commands/executeonselectedsuggestionscommand.js +1 -1
  14. package/src/commands/trackchangescommand.d.ts +22 -0
  15. package/src/commands/trackchangescommand.js +1 -1
  16. package/src/index.d.ts +12 -0
  17. package/src/index.js +1 -1
  18. package/src/integrations/alignment.d.ts +13 -0
  19. package/src/integrations/alignment.js +1 -1
  20. package/src/integrations/basicstyles.d.ts +13 -0
  21. package/src/integrations/basicstyles.js +1 -1
  22. package/src/integrations/blockquote.d.ts +13 -0
  23. package/src/integrations/blockquote.js +1 -1
  24. package/src/integrations/ckbox.d.ts +13 -0
  25. package/src/integrations/ckbox.js +1 -1
  26. package/src/integrations/codeblock.d.ts +13 -0
  27. package/src/integrations/codeblock.js +1 -1
  28. package/src/integrations/comments.d.ts +10 -0
  29. package/src/integrations/comments.js +1 -1
  30. package/src/integrations/deletecommand.d.ts +12 -0
  31. package/src/integrations/deletecommand.js +1 -1
  32. package/src/integrations/documentlist.d.ts +13 -0
  33. package/src/integrations/documentlist.js +1 -1
  34. package/src/integrations/documentlistproperties.d.ts +25 -0
  35. package/src/integrations/documentlistproperties.js +1 -1
  36. package/src/integrations/entercommand.d.ts +11 -0
  37. package/src/integrations/entercommand.js +1 -1
  38. package/src/integrations/findandreplace.d.ts +17 -0
  39. package/src/integrations/findandreplace.js +1 -1
  40. package/src/integrations/font.d.ts +13 -0
  41. package/src/integrations/font.js +1 -1
  42. package/src/integrations/heading.d.ts +13 -0
  43. package/src/integrations/heading.js +1 -1
  44. package/src/integrations/highlight.d.ts +13 -0
  45. package/src/integrations/highlight.js +1 -1
  46. package/src/integrations/horizontalline.d.ts +13 -0
  47. package/src/integrations/horizontalline.js +1 -1
  48. package/src/integrations/htmlembed.d.ts +13 -0
  49. package/src/integrations/htmlembed.js +1 -1
  50. package/src/integrations/image.d.ts +13 -0
  51. package/src/integrations/image.js +1 -1
  52. package/src/integrations/imagereplace.d.ts +19 -0
  53. package/src/integrations/imagereplace.js +1 -1
  54. package/src/integrations/importword.d.ts +14 -0
  55. package/src/integrations/importword.js +1 -1
  56. package/src/integrations/indent.d.ts +13 -0
  57. package/src/integrations/indent.js +1 -1
  58. package/src/integrations/inputcommand.d.ts +11 -0
  59. package/src/integrations/inputcommand.js +1 -1
  60. package/src/integrations/link.d.ts +13 -0
  61. package/src/integrations/link.js +1 -1
  62. package/src/integrations/list.d.ts +13 -0
  63. package/src/integrations/list.js +1 -1
  64. package/src/integrations/listproperties.d.ts +25 -0
  65. package/src/integrations/listproperties.js +1 -1
  66. package/src/integrations/mediaembed.d.ts +13 -0
  67. package/src/integrations/mediaembed.js +1 -1
  68. package/src/integrations/mention.d.ts +13 -0
  69. package/src/integrations/mention.js +1 -1
  70. package/src/integrations/pagebreak.d.ts +13 -0
  71. package/src/integrations/pagebreak.js +1 -1
  72. package/src/integrations/paragraph.d.ts +13 -0
  73. package/src/integrations/paragraph.js +1 -1
  74. package/src/integrations/removeformat.d.ts +13 -0
  75. package/src/integrations/removeformat.js +1 -1
  76. package/src/integrations/restrictededitingmode.d.ts +13 -0
  77. package/src/integrations/restrictededitingmode.js +1 -1
  78. package/src/integrations/shiftentercommand.d.ts +11 -0
  79. package/src/integrations/shiftentercommand.js +1 -1
  80. package/src/integrations/standardeditingmode.d.ts +13 -0
  81. package/src/integrations/standardeditingmode.js +1 -1
  82. package/src/integrations/style.d.ts +14 -0
  83. package/src/integrations/style.js +1 -1
  84. package/src/integrations/table.d.ts +38 -0
  85. package/src/integrations/table.js +1 -1
  86. package/src/integrations/tablecaption.d.ts +17 -0
  87. package/src/integrations/tablecaption.js +1 -1
  88. package/src/integrations/tableclipboard.d.ts +17 -0
  89. package/src/integrations/tableclipboard.js +1 -1
  90. package/src/integrations/tablecolumnresize.d.ts +22 -0
  91. package/src/integrations/tablecolumnresize.js +1 -1
  92. package/src/integrations/tableheadings.d.ts +17 -0
  93. package/src/integrations/tableheadings.js +1 -1
  94. package/src/integrations/tablemergesplit.d.ts +17 -0
  95. package/src/integrations/tablemergesplit.js +1 -1
  96. package/src/integrations/tableproperties.d.ts +23 -0
  97. package/src/integrations/tableproperties.js +1 -1
  98. package/src/integrations/title.d.ts +13 -0
  99. package/src/integrations/title.js +1 -1
  100. package/src/integrations/undo.d.ts +13 -0
  101. package/src/integrations/undo.js +1 -1
  102. package/src/integrations/utils.d.ts +17 -0
  103. package/src/integrations/utils.js +1 -1
  104. package/src/suggestion.d.ts +266 -0
  105. package/src/suggestion.js +1 -1
  106. package/src/suggestiondescriptionfactory.d.ts +151 -0
  107. package/src/suggestiondescriptionfactory.js +1 -1
  108. package/src/trackchanges.d.ts +222 -0
  109. package/src/trackchanges.js +1 -1
  110. package/src/trackchangesconfig.d.ts +53 -0
  111. package/src/trackchangesconfig.js +23 -0
  112. package/src/trackchangesdata.d.ts +38 -0
  113. package/src/trackchangesdata.js +1 -1
  114. package/src/trackchangesediting.d.ts +391 -0
  115. package/src/trackchangesediting.js +1 -1
  116. package/src/trackchangesui.d.ts +34 -0
  117. package/src/trackchangesui.js +1 -1
  118. package/src/ui/suggestioncontroller.d.ts +36 -0
  119. package/src/ui/suggestioncontroller.js +1 -1
  120. package/src/ui/view/basesuggestionthreadview.d.ts +166 -0
  121. package/src/ui/view/basesuggestionthreadview.js +1 -1
  122. package/src/ui/view/suggestionthreadview.d.ts +184 -0
  123. package/src/ui/view/suggestionthreadview.js +1 -1
  124. package/src/utils/common-translations.d.ts +5 -0
  125. package/src/utils/common-translations.js +1 -1
  126. package/src/utils/utils.d.ts +26 -0
  127. 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 _0x249d=['createRangeOn','span','markerName','name','mapper','consumable','isContent','nextSibling','element','createUIElement','getItems','addClass','toViewPosition','get','push','TrackChangesEditing','toViewElement','isBlock','type','listItem','test','includes','start','getWalker','markerRange','addHighlight','previousPosition','elementEnd','writer','ck-suggestion-marker-','item','listIndent','activeMarkers','bindElementToMarker','getAttribute'];(function(_0x210e01,_0x249d30){const _0x15ebb2=function(_0x196545){while(--_0x196545){_0x210e01['push'](_0x210e01['shift']());}};_0x15ebb2(++_0x249d30);}(_0x249d,0xee));const _0x15eb=function(_0x210e01,_0x249d30){_0x210e01=_0x210e01-0x0;let _0x15ebb2=_0x249d[_0x210e01];return _0x15ebb2;};export function getRangesWithAttribute(_0x6dc7cf,_0x2a1d98,_0x5e88e2){const _0x562b2b=[];for(const _0x487368 of _0x2a1d98[_0x15eb('0x11')]())_0x487368['hasAttribute'](_0x6dc7cf)&&_0x562b2b[_0x15eb('0x15')](_0x5e88e2[_0x15eb('0x7')](_0x487368));return _0x562b2b;}export function getElementsAffectedByListItemRename(_0x5b5b56){const _0x4963ff=[];if(_0x5b5b56['is'](_0x15eb('0xf'),_0x15eb('0x1a'))){let _0x1a7577=_0x5b5b56[_0x15eb('0xe')];for(;_0x1a7577&&_0x1a7577['is'](_0x15eb('0xf'),_0x15eb('0x1a'))&&_0x1a7577[_0x15eb('0x6')](_0x15eb('0x3'))>0x0;)_0x4963ff[_0x15eb('0x15')](_0x1a7577),_0x1a7577=_0x1a7577[_0x15eb('0xe')];}return _0x4963ff;}export function downcastSplitMergeMarker(_0x55f953,_0x303bbf,{showActiveMarker:_0x1cad8f=!0x0}={}){const _0x3483c3=_0x55f953['plugins'][_0x15eb('0x14')](_0x15eb('0x16'));return(_0x3ce661,_0x154006,_0x39221a)=>{if(!_0x39221a[_0x15eb('0xc')][_0x15eb('0x1b')](_0x154006[_0x15eb('0x1f')],_0x3ce661[_0x15eb('0xa')]))return;const _0x27a0b1=_0x154006[_0x15eb('0x1f')][_0x15eb('0x1e')](),_0x135278=_0x154006[_0x15eb('0x1f')][_0x15eb('0x1d')],_0x80dada=_0x55f953['model']['schema'];let _0x3b0233=null,_0x8d5002=null,_0x12fda4=!0x1,_0x4f715d=!0x1;for(const _0x7af28d of _0x27a0b1){const _0x284369=_0x7af28d[_0x15eb('0x2')];_0x12fda4=_0x12fda4||_0x80dada[_0x15eb('0xd')](_0x284369);const _0x5ef84c=_0x39221a[_0x15eb('0xb')][_0x15eb('0x17')](_0x284369);if(_0x5ef84c&&_0x5ef84c['getCustomProperty'](_0x15eb('0x20')))return;_0x15eb('0x22')==_0x7af28d[_0x15eb('0x19')]&&(_0x80dada[_0x15eb('0x18')](_0x284369)&&!_0x80dada['isLimit'](_0x284369)&&(_0x284369[_0x15eb('0xe')]||_0x135278['isAtEnd']?_0x3b0233&&_0x3b0233['parent']==_0x284369||(_0x3b0233=_0x284369,_0x3db27d(_0x7af28d[_0x15eb('0x21')]),_0x4f715d=!0x0):_0x8d5002=_0x8d5002||_0x7af28d[_0x15eb('0x21')]));}function _0x3db27d(_0x498dcc){const _0x166bdf=_0x39221a[_0x15eb('0x0')][_0x15eb('0x10')](_0x15eb('0x8'),{'class':_0x15eb('0x1')+_0x303bbf}),_0x373473=_0x39221a[_0x15eb('0xb')][_0x15eb('0x13')](_0x498dcc);_0x1cad8f&&_0x3483c3[_0x15eb('0x4')][_0x15eb('0x1c')](_0x154006[_0x15eb('0x9')])&&_0x39221a[_0x15eb('0x0')][_0x15eb('0x12')]('ck-suggestion-marker--active',_0x166bdf),_0x39221a[_0x15eb('0x0')]['insert'](_0x373473,_0x166bdf),_0x39221a['mapper'][_0x15eb('0x5')](_0x166bdf,_0x154006['markerName']);}_0x12fda4||_0x4f715d||!_0x8d5002||_0x3db27d(_0x8d5002);};}
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 _0x4ca7=['start','addMarkerName','subType','addMarker','_model','data','next','hasComments','onAccept','getMarkers','attributes','_onDiscard','createdAt','getAllAdjacentSuggestions','getMarkerNames','filter','@external','_markerNames','addRange','accept','isIntersecting','nodeBefore','get','nodeAfter','getRanges','getContainedElement','markers','commentThread','end','getRange','clear','toJSON','isInContent','isIntersectingWithRange','decorate','_onAccept','removeMarkers','authoredAt','map','type','isMultiRange','getFirstMarker','head','isExternal','suggestion:','split','set','removeMarker','discard','creator','add','_onAttributesChange','author','onAttributesChange','push'];(function(_0x2c8a61,_0x4ca73d){const _0x2f55ae=function(_0x6e38e4){while(--_0x6e38e4){_0x2c8a61['push'](_0x2c8a61['shift']());}};_0x2f55ae(++_0x4ca73d);}(_0x4ca7,0x11f));const _0x2f55=function(_0x2c8a61,_0x4ca73d){_0x2c8a61=_0x2c8a61-0x0;let _0x2f55ae=_0x4ca7[_0x2c8a61];return _0x2f55ae;};import{Element as _0x3a47a1}from'ckeditor5/src/engine';import{ObservableMixin as _0x45ddf8,mix as _0x10b0bf,uid as _0x41f425}from'ckeditor5/src/utils';import{cloneDeep as _0x493417,isEqual as _0x4e7721,set as _0x1b5b7a,unset as _0x17a8d6}from'lodash-es';export default class o{constructor(_0x1a4f9a,_0x2b05f3){this['id']=_0x2b05f3['id'],this[_0x2f55('0x1b')]=_0x2b05f3[_0x2f55('0x1b')],this[_0x2f55('0x2d')]=_0x2b05f3[_0x2f55('0x2d')]||null,this[_0x2f55('0x28')]=_0x2b05f3[_0x2f55('0x28')],this['creator']=_0x2b05f3[_0x2f55('0x25')]||_0x2b05f3[_0x2f55('0x28')],this[_0x2f55('0x1f')]=Boolean(_0x2b05f3[_0x2f55('0x35')]&&_0x2b05f3[_0x2f55('0x35')][_0x2f55('0x4')]),this[_0x2f55('0x30')]=null,this[_0x2f55('0x2f')]=_0x1a4f9a,this[_0x2f55('0x17')]=_0x2b05f3[_0x2f55('0x33')],this[_0x2f55('0x36')]=_0x2b05f3['onDiscard'],this[_0x2f55('0x27')]=_0x2b05f3[_0x2f55('0x29')],this[_0x2f55('0x5')]=new Set(),this[_0x2f55('0x0')]=null,this['set'](_0x2f55('0x19'),null),this[_0x2f55('0x22')](_0x2f55('0x35'),_0x2b05f3[_0x2f55('0x35')]||{}),this['set']('previous',null),this['set']('next',null),this[_0x2f55('0x22')](_0x2f55('0xf'),null),this[_0x2f55('0x22')]('_saved',!0x1),this[_0x2f55('0x16')](_0x2f55('0x7')),this[_0x2f55('0x16')](_0x2f55('0x24'));}get[_0x2f55('0x1e')](){let _0x1ef8ff=this;for(;_0x1ef8ff['previous'];)_0x1ef8ff=_0x1ef8ff['previous'];return _0x1ef8ff;}get[_0x2f55('0x32')](){return!!this['commentThread']&&this['commentThread']['length']>0x0;}get[_0x2f55('0x1c')](){if(0x0==this[_0x2f55('0x5')]['size'])return!0x1;return 0x6==Array['from'](this[_0x2f55('0x5')])[0x0][_0x2f55('0x21')](':')['length'];}get[_0x2f55('0x14')](){return null!==this[_0x2f55('0x1d')]();}[_0x2f55('0x2c')](_0x219c05){this['_markerNames'][_0x2f55('0x26')](_0x219c05);}[_0x2f55('0x2')](){return Array['from'](this[_0x2f55('0x5')]);}[_0x2f55('0x34')](){return this[_0x2f55('0x2')]()[_0x2f55('0x1a')](_0x6847c6=>this[_0x2f55('0x2f')][_0x2f55('0xe')][_0x2f55('0xa')](_0x6847c6))[_0x2f55('0x3')](_0x43c4b5=>_0x43c4b5);}[_0x2f55('0x1d')](){return this[_0x2f55('0x34')]()[0x0]||null;}[_0x2f55('0x18')](){this[_0x2f55('0x2f')]['change'](_0x3d9f9e=>{for(const _0x32db39 of this[_0x2f55('0x34')]())_0x3d9f9e[_0x2f55('0x23')](_0x32db39);}),this[_0x2f55('0x5')][_0x2f55('0x12')]();}['removeMarker'](_0x3f44dc){this[_0x2f55('0x2f')]['change'](_0x4f8791=>{_0x4f8791['removeMarker'](_0x3f44dc);}),this[_0x2f55('0x5')]['delete'](_0x3f44dc);}[_0x2f55('0x6')](_0x32219c){const _0xf2b618=_0x2f55('0x20')+this['type']+':'+this[_0x2f55('0x2d')]+':'+this['id']+':'+this[_0x2f55('0x25')]['id']+':'+o['getMultiRangeId']();this['addMarkerName'](_0xf2b618),this[_0x2f55('0x2f')]['change'](_0x4cfd29=>{_0x4cfd29[_0x2f55('0x2e')](_0xf2b618,{'range':_0x32219c,'usingOperation':!0x0,'affectsData':!0x0});});}[_0x2f55('0x15')](_0x5b978a){for(const _0x5ae994 of this[_0x2f55('0xc')]())if(_0x5ae994[_0x2f55('0x8')](_0x5b978a))return!0x0;return!0x1;}[_0x2f55('0xc')](){return this[_0x2f55('0x34')]()[_0x2f55('0x1a')](_0x32b761=>_0x32b761['getRange']());}['getItems'](){return this[_0x2f55('0xc')]()['reduce']((_0x47bd24,_0x56ab84)=>[..._0x47bd24,..._0x56ab84['getItems']()],[]);}['getFirstRange'](){return this[_0x2f55('0x1d')]()[_0x2f55('0x11')]();}[_0x2f55('0xd')](){const _0x3e80ba=this['getRanges']();if(0x1!=_0x3e80ba['length'])return null;const _0x584516=_0x3e80ba[0x0],_0x2c6b71=_0x584516[_0x2f55('0x2b')][_0x2f55('0xb')],_0x409339=_0x584516[_0x2f55('0x10')][_0x2f55('0x9')];return _0x2c6b71 instanceof _0x3a47a1?_0x2c6b71!=_0x409339?null:_0x2c6b71:null;}[_0x2f55('0x7')](){this[_0x2f55('0x17')](this['getRanges'](),this[_0x2f55('0x30')],this[_0x2f55('0x35')]),this[_0x2f55('0x18')]();}[_0x2f55('0x24')](){this['_onDiscard'](this['getRanges'](),this[_0x2f55('0x30')],this[_0x2f55('0x35')]),this[_0x2f55('0x18')]();}[_0x2f55('0x1')](){const _0x2717fa=[];let _0x578f16=this[_0x2f55('0x1e')];for(;_0x578f16;)_0x2717fa[_0x2f55('0x2a')](_0x578f16),_0x578f16=_0x578f16[_0x2f55('0x31')];return _0x2717fa;}['setAttribute'](_0x3e7d17,_0x9c110c){const _0x3561bb=_0x493417(this[_0x2f55('0x35')]);_0x1b5b7a(_0x3561bb,_0x3e7d17,_0x9c110c),_0x4e7721(_0x3561bb,this['attributes'])||(this['attributes']=_0x3561bb,this[_0x2f55('0x27')](_0x3561bb));}['removeAttribute'](_0x1cec75){const _0x1be117=_0x493417(this[_0x2f55('0x35')]);_0x17a8d6(_0x1be117,_0x1cec75),_0x4e7721(_0x1be117,this[_0x2f55('0x35')])||(this[_0x2f55('0x35')]=_0x1be117,this['_onAttributesChange'](this[_0x2f55('0x35')]));}[_0x2f55('0x13')](){return{'id':this['id'],'type':this['subType']?this[_0x2f55('0x1b')]+':'+this[_0x2f55('0x2d')]:this[_0x2f55('0x1b')],'authorId':this[_0x2f55('0x25')]['id'],'createdAt':this[_0x2f55('0x0')],'hasComments':this['hasComments'],'data':this[_0x2f55('0x30')],'attributes':this[_0x2f55('0x35')]};}static['getMultiRangeId'](){return _0x41f425()['substr'](0x1,0x5);}}_0x10b0bf(o,_0x45ddf8);
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 _0x2b48=['deletion','remove','_customCallbacks','*Split:*\x20%0','removeContainer','getFirstRange','normal','nextSibling','_addDescriptionItems','REPLACE_TEXT','isEmpty','*Remove:*\x20%0','matchingCallback','removeObject','*Merge:*\x20%0','softBreak','element','function','type','previousSibling','_schema','length','elementStart','add','text','label','removeEmptyContainer','getItemLabel','replace','isEqual','name','isObject','push','EmptyContainer','_itemLabelsCallbacks','addObject','_itemLabels','$1\x20$2','_resolveDescriptionItems','ELEMENT_SPACE','quantity','indexOf','skip','pop','Container','checkChild','elementEnd','match','*Insert:*\x20%0','getDescriptions','Object','registerElementLabel','get','data','addContainer','start','_locale','addEmptyContainer','insertion'];(function(_0x174c4e,_0x2b487e){const _0x473e87=function(_0x185f6b){while(--_0x185f6b){_0x174c4e['push'](_0x174c4e['shift']());}};_0x473e87(++_0x2b487e);}(_0x2b48,0xc5));const _0x473e=function(_0x174c4e,_0x2b487e){_0x174c4e=_0x174c4e-0x0;let _0x473e87=_0x2b48[_0x174c4e];return _0x473e87;};import{getTranslation as _0x2611e1}from'./utils/common-translations';import{priorities as _0x5e1d08,insertToPriorityArray as _0x13462c}from'ckeditor5/src/utils';export default class f{constructor(_0x56de77,_0x1dec71){this[_0x473e('0x29')]=[],this['_itemLabels']=new Map(),this[_0x473e('0xe')]=[],this[_0x473e('0x0')]=_0x56de77,this[_0x473e('0x24')]=_0x1dec71;}[_0x473e('0x1d')](_0xb9965c){const _0x144cc7=[];for(let _0x3cbba2=0x0;_0x3cbba2<_0xb9965c[_0x473e('0x1')];_0x3cbba2++){const _0x2c6dc3=_0xb9965c[_0x3cbba2];if(!_0x2c6dc3['isInContent'])continue;let _0x525177=!0x1;for(const _0x5dbe51 of this[_0x473e('0x29')]){const _0x3e64c3=_0x5dbe51(_0x2c6dc3);if(_0x3e64c3){_0x3e64c3['type']&&_0x144cc7[_0x473e('0xc')](_0x3e64c3),_0x525177=!0x0;break;}}if(!_0x525177){this[_0x473e('0x2f')](_0x144cc7,_0x2c6dc3);const _0xa8d758=_0xb9965c[_0x3cbba2+0x1];if(_0xa8d758&&!_0x2c6dc3['getFirstRange']()['end'][_0x473e('0x9')](_0xa8d758[_0x473e('0x2c')]()[_0x473e('0x23')])){const _0x3a7634=_0x144cc7[_0x144cc7[_0x473e('0x1')]-0x1],_0xb829d5=_0x473e('0x26')==_0x2c6dc3[_0x473e('0x39')]?_0x473e('0x3'):_0x473e('0x28');_0x3a7634&&'text'==_0x3a7634[_0x473e('0x39')]&&(_0x3a7634[_0xb829d5]+='\x0a');}}}return this[_0x473e('0x12')](_0x144cc7);}['registerDescriptionCallback'](_0x1b5fbe){this[_0x473e('0x29')][_0x473e('0xc')](_0x1b5fbe);}[_0x473e('0x1f')](_0x757c08,_0x2c14f6,_0x222c8e=_0x5e1d08[_0x473e('0x2d')]){_0x473e('0x38')==typeof _0x757c08?_0x13462c(this[_0x473e('0xe')],{'matchingCallback':_0x757c08,'label':_0x2c14f6,'priority':_0x222c8e}):this[_0x473e('0x10')]['set'](_0x757c08,_0x2c14f6);}[_0x473e('0x7')](_0x5dcdf4,_0x374eb9=0x1){let _0x22ce06;for(const _0x5f0eb7 of this[_0x473e('0xe')])if(_0x5f0eb7[_0x473e('0x33')](_0x5dcdf4)){_0x22ce06=_0x5f0eb7[_0x473e('0x5')];break;}return _0x22ce06||(_0x22ce06=this[_0x473e('0x10')][_0x473e('0x20')](_0x5dcdf4[_0x473e('0xa')])),_0x22ce06?_0x22ce06(_0x374eb9):0x1!==_0x374eb9?_0x374eb9+'\x20'+_0x5dcdf4[_0x473e('0xa')]+'s':''+_0x5dcdf4['name'];}[_0x473e('0x2f')](_0x4a955a,_0x59fc78){const _0x579d1f=_0x59fc78[_0x473e('0x2c')]()['getWalker'](),_0x324484=_0x473e('0x26')==_0x59fc78[_0x473e('0x39')]?_0x473e('0x3'):_0x473e('0x28');for(const _0x5cb0cf of _0x579d1f){const _0xea7cf1=_0x5cb0cf['item'],_0x286f80=_0x4a955a[_0x4a955a[_0x473e('0x1')]-0x1];if(_0xea7cf1['is']('textProxy'))_0x286f80&&_0x286f80[_0x473e('0x39')]['indexOf'](_0x473e('0x18'))>-0x1&&_0x4a955a[_0x473e('0x17')](),_0x286f80&&'text'==_0x286f80['type']?_0x286f80[_0x324484]+=_0xea7cf1[_0x473e('0x21')]:_0x4a955a[_0x473e('0xc')]({'type':_0x473e('0x4'),'add':_0x473e('0x3')==_0x324484?_0xea7cf1['data']:'','remove':_0x473e('0x28')==_0x324484?_0xea7cf1[_0x473e('0x21')]:''});else{if(this[_0x473e('0x0')][_0x473e('0xb')](_0xea7cf1)){if(_0x286f80&&_0x286f80[_0x473e('0x39')][_0x473e('0x15')]('Container')>-0x1&&_0x4a955a['pop'](),_0x473e('0x1a')==_0x5cb0cf[_0x473e('0x39')])continue;_0x286f80&&_0x286f80[_0x473e('0x39')]==_0x324484+_0x473e('0x1e')&&_0x286f80[_0x473e('0x37')][_0x473e('0xa')]==_0xea7cf1[_0x473e('0xa')]?_0x286f80['quantity']++:_0x4a955a[_0x473e('0xc')]({'type':_0x324484+_0x473e('0x1e'),'element':_0xea7cf1,'quantity':0x1}),_0x579d1f[_0x473e('0x16')](_0x9ea3ca=>!(_0x473e('0x1a')==_0x9ea3ca[_0x473e('0x39')]&&_0x9ea3ca['item']==_0xea7cf1));}else{if(this['_schema'][_0x473e('0x19')](_0xea7cf1,'$text')||_0xea7cf1['is'](_0x473e('0x37'),_0x473e('0x36'))){if(_0x473e('0x3')==_0x324484&&_0x473e('0x2')==_0x5cb0cf[_0x473e('0x39')]||_0x473e('0x28')==_0x324484&&_0x473e('0x1a')==_0x5cb0cf[_0x473e('0x39')])continue;if(_0x286f80&&-0x1==_0x286f80['type'][_0x473e('0x15')](_0x473e('0x18'))){_0x473e('0x4')==_0x286f80[_0x473e('0x39')]&&(_0x286f80[_0x324484]+='\x0a');continue;}let _0x11656c;if(_0x11656c=_0x473e('0x3')==_0x324484?_0xea7cf1[_0x473e('0x2e')]&&!this['_schema'][_0x473e('0xb')](_0xea7cf1[_0x473e('0x2e')])?_0xea7cf1[_0x473e('0x2e')]:null:_0xea7cf1[_0x473e('0x3a')]&&!this[_0x473e('0x0')][_0x473e('0xb')](_0xea7cf1[_0x473e('0x3a')])?_0xea7cf1[_0x473e('0x3a')]:null,_0xea7cf1[_0x473e('0x31')]||_0x11656c&&_0x11656c[_0x473e('0x31')]){const _0x53c51a=_0x11656c&&_0x11656c[_0x473e('0x31')]?_0x11656c:_0xea7cf1;_0x286f80&&_0x286f80[_0x473e('0x39')]==_0x324484+_0x473e('0xd')&&_0x286f80[_0x473e('0x37')]['name']==_0x53c51a['name']?_0x286f80[_0x473e('0x14')]++:_0x4a955a[_0x473e('0xc')]({'type':_0x324484+_0x473e('0xd'),'element':_0x53c51a,'quantity':0x1});}else _0x4a955a[_0x473e('0xc')]({'type':_0x324484+_0x473e('0x18'),'element':_0xea7cf1});}}}}}[_0x473e('0x12')](_0x32670d){const _0xea4979=this['_locale'],_0x1cc8ea=[];for(const _0x1d835c of _0x32670d){switch(_0x1d835c[_0x473e('0x39')]){case _0x473e('0x4'):if(_0x1d835c['add']=_0x1d835c[_0x473e('0x3')][_0x473e('0x8')](/(\S)\u000A+(\S)/g,_0x473e('0x11'))[_0x473e('0x8')](/\u000A/g,''),_0x1d835c[_0x473e('0x28')]=_0x1d835c[_0x473e('0x28')]['replace'](/(\S)\u000A+(\S)/g,_0x473e('0x11'))[_0x473e('0x8')](/\u000A/g,''),''!=_0x1d835c[_0x473e('0x3')]&&''!=_0x1d835c[_0x473e('0x28')]){_0x1cc8ea['push']({'type':_0x473e('0x8'),'content':_0x2611e1(_0xea4979,_0x473e('0x30'),['\x22'+_0x1d835c['remove']+'\x22','\x22'+_0x1d835c[_0x473e('0x3')]+'\x22'])});continue;}if(null!=_0x1d835c[_0x473e('0x3')]['match'](/^ +$/)){_0x1cc8ea[_0x473e('0xc')]({'type':_0x473e('0x26'),'content':_0x2611e1(_0xea4979,_0x473e('0x1c'),_0x2611e1(_0xea4979,'ELEMENT_SPACE',_0x1d835c[_0x473e('0x3')][_0x473e('0x1')]))});continue;}if(null!=_0x1d835c[_0x473e('0x28')][_0x473e('0x1b')](/^ +$/)){_0x1cc8ea['push']({'type':_0x473e('0x27'),'content':_0x2611e1(_0xea4979,_0x473e('0x32'),_0x2611e1(_0xea4979,_0x473e('0x13'),_0x1d835c[_0x473e('0x28')][_0x473e('0x1')]))});continue;}if(''!=_0x1d835c[_0x473e('0x3')]){_0x1cc8ea[_0x473e('0xc')]({'type':_0x473e('0x26'),'content':_0x2611e1(_0xea4979,_0x473e('0x1c'),'\x22'+_0x1d835c[_0x473e('0x3')]+'\x22')});continue;}_0x1cc8ea[_0x473e('0xc')]({'type':_0x473e('0x27'),'content':_0x2611e1(_0xea4979,_0x473e('0x32'),'\x22'+_0x1d835c[_0x473e('0x28')]+'\x22')});continue;case _0x473e('0x25'):case _0x473e('0xf'):_0x1cc8ea[_0x473e('0xc')]({'type':'insertion','content':_0x2611e1(_0xea4979,_0x473e('0x1c'),this[_0x473e('0x7')](_0x1d835c[_0x473e('0x37')],_0x1d835c[_0x473e('0x14')]))});continue;case _0x473e('0x6'):case _0x473e('0x34'):_0x1cc8ea['push']({'type':'deletion','content':_0x2611e1(_0xea4979,_0x473e('0x32'),this[_0x473e('0x7')](_0x1d835c[_0x473e('0x37')],_0x1d835c[_0x473e('0x14')]))});continue;case _0x473e('0x22'):_0x1cc8ea[_0x473e('0xc')]({'type':_0x473e('0x26'),'content':_0x2611e1(_0xea4979,_0x473e('0x2a'),this['getItemLabel'](_0x1d835c[_0x473e('0x37')],_0x1d835c['quantity']))});continue;case _0x473e('0x2b'):_0x1cc8ea['push']({'type':_0x473e('0x27'),'content':_0x2611e1(_0xea4979,_0x473e('0x35'),this[_0x473e('0x7')](_0x1d835c[_0x473e('0x37')],_0x1d835c[_0x473e('0x14')]))});continue;}_0x1cc8ea[_0x473e('0xc')](_0x1d835c);}return _0x1cc8ea;}}
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;}}