@ckeditor/ckeditor5-track-changes 36.0.1 → 37.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/build/track-changes.js +1 -1
  2. package/ckeditor5-metadata.json +10 -0
  3. package/package.json +20 -5
  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 _0xae45=['isBlock','isLimit','getCustomProperty','schema','get','ck-suggestion-marker--active','markerName','isContent','getItems','hasAttribute','span','isAtEnd','toViewElement','consumable','addClass','push','elementEnd','parent','previousPosition','markerRange','writer','mapper','TrackChangesEditing','model','nextSibling','ck-suggestion-marker-','test','item','type','listIndent','name','element','addHighlight','getWalker','bindElementToMarker','toViewPosition','listItem','activeMarkers','plugins','getAttribute'];(function(_0x3e62f5,_0xae457d){const _0xd59cef=function(_0x3e762f){while(--_0x3e762f){_0x3e62f5['push'](_0x3e62f5['shift']());}};_0xd59cef(++_0xae457d);}(_0xae45,0x16a));const _0xd59c=function(_0x3e62f5,_0xae457d){_0x3e62f5=_0x3e62f5-0x0;let _0xd59cef=_0xae45[_0x3e62f5];return _0xd59cef;};export function getRangesWithAttribute(_0x48a801,_0x2f35cb,_0x4e4c52){const _0x147dcb=[];for(const _0x23e393 of _0x2f35cb[_0xd59c('0x6')]())_0x23e393[_0xd59c('0x7')](_0x48a801)&&_0x147dcb[_0xd59c('0xd')](_0x4e4c52['createRangeOn'](_0x23e393));return _0x147dcb;}export function getElementsAffectedByListItemRename(_0x2c5e2d){const _0x475a01=[];if(_0x2c5e2d['is']('element','listItem')){let _0x46f24=_0x2c5e2d[_0xd59c('0x16')];for(;_0x46f24&&_0x46f24['is'](_0xd59c('0x1d'),_0xd59c('0x22'))&&_0x46f24[_0xd59c('0x25')](_0xd59c('0x1b'))>0x0;)_0x475a01[_0xd59c('0xd')](_0x46f24),_0x46f24=_0x46f24[_0xd59c('0x16')];}return _0x475a01;}export function downcastSplitMergeMarker(_0x201e20,_0x3717c3,{showActiveMarker:_0x2679e7=!0x0}={}){const _0x51d26e=_0x201e20[_0xd59c('0x24')][_0xd59c('0x2')](_0xd59c('0x14'));return(_0x5c1c47,_0x476159,_0x2f1bd7)=>{if(!_0x2f1bd7[_0xd59c('0xb')][_0xd59c('0x18')](_0x476159['markerRange'],_0x5c1c47[_0xd59c('0x1c')]))return;const _0x1e38c5=_0x476159[_0xd59c('0x11')][_0xd59c('0x1f')](),_0xa83910=_0x476159[_0xd59c('0x11')]['start'],_0x5ac129=_0x201e20[_0xd59c('0x15')][_0xd59c('0x1')];let _0x39cff5=null,_0x129210=null,_0x3b4ba0=!0x1,_0x5b2a47=!0x1;for(const _0x15e761 of _0x1e38c5){const _0x4a0e82=_0x15e761[_0xd59c('0x19')];_0x3b4ba0=_0x3b4ba0||_0x5ac129[_0xd59c('0x5')](_0x4a0e82);const _0x4b0157=_0x2f1bd7['mapper'][_0xd59c('0xa')](_0x4a0e82);if(_0x4b0157&&_0x4b0157[_0xd59c('0x0')](_0xd59c('0x1e')))return;_0xd59c('0xe')==_0x15e761[_0xd59c('0x1a')]&&(_0x5ac129[_0xd59c('0x26')](_0x4a0e82)&&!_0x5ac129[_0xd59c('0x27')](_0x4a0e82)&&(_0x4a0e82[_0xd59c('0x16')]||_0xa83910[_0xd59c('0x9')]?_0x39cff5&&_0x39cff5[_0xd59c('0xf')]==_0x4a0e82||(_0x39cff5=_0x4a0e82,_0x1497b7(_0x15e761[_0xd59c('0x10')]),_0x5b2a47=!0x0):_0x129210=_0x129210||_0x15e761[_0xd59c('0x10')]));}function _0x1497b7(_0x5bc430){const _0x2e0f8c=_0x2f1bd7[_0xd59c('0x12')]['createUIElement'](_0xd59c('0x8'),{'class':_0xd59c('0x17')+_0x3717c3}),_0xac336f=_0x2f1bd7[_0xd59c('0x13')][_0xd59c('0x21')](_0x5bc430);_0x2679e7&&_0x51d26e[_0xd59c('0x23')]['includes'](_0x476159[_0xd59c('0x4')])&&_0x2f1bd7[_0xd59c('0x12')][_0xd59c('0xc')](_0xd59c('0x3'),_0x2e0f8c),_0x2f1bd7[_0xd59c('0x12')]['insert'](_0xac336f,_0x2e0f8c),_0x2f1bd7[_0xd59c('0x13')][_0xd59c('0x20')](_0x2e0f8c,_0x476159[_0xd59c('0x4')]);}_0x3b4ba0||_0x5b2a47||!_0x129210||_0x1497b7(_0x129210);};}
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 _0x3209=['isIntersecting','size','getMultiRangeId','head','end','decorate','map','getRanges','add','_onAccept','subType','removeMarker','getMarkers','nodeBefore','getItems','_saved','@external','getMarkerNames','author','isMultiRange','commentThread','from','removeAttribute','getAllAdjacentSuggestions','start','change','_model','getFirstMarker','data','setAttribute','next','delete','get','discard','isIntersectingWithRange','getRange','filter','attributes','removeMarkers','createdAt','set','split','previous','clear','_onAttributesChange','nodeAfter','creator','onAttributesChange','hasComments','isInContent','onAccept','_markerNames','push','_onDiscard','type','getFirstRange','substr','authoredAt','addMarkerName','accept'];(function(_0x289cc0,_0x320919){const _0x3ef90a=function(_0x45c2e5){while(--_0x45c2e5){_0x289cc0['push'](_0x289cc0['shift']());}};_0x3ef90a(++_0x320919);}(_0x3209,0x6e));const _0x3ef9=function(_0x289cc0,_0x320919){_0x289cc0=_0x289cc0-0x0;let _0x3ef90a=_0x3209[_0x289cc0];return _0x3ef90a;};import{Element as _0x73cfc3}from'ckeditor5/src/engine';import{ObservableMixin as _0x5ca108,mix as _0x63632,uid as _0x1adafa}from'ckeditor5/src/utils';import{cloneDeep as _0x255cac,isEqual as _0x1ce58c,set as _0x2aeae1,unset as _0x50b38e}from'lodash-es';export default class o{constructor(_0x351fbc,_0xe08bdb){this['id']=_0xe08bdb['id'],this[_0x3ef9('0x4')]=_0xe08bdb[_0x3ef9('0x4')],this[_0x3ef9('0x14')]=_0xe08bdb[_0x3ef9('0x14')]||null,this[_0x3ef9('0x1c')]=_0xe08bdb[_0x3ef9('0x1c')],this[_0x3ef9('0x38')]=_0xe08bdb[_0x3ef9('0x38')]||_0xe08bdb['author'],this['isExternal']=Boolean(_0xe08bdb[_0x3ef9('0x2f')]&&_0xe08bdb[_0x3ef9('0x2f')][_0x3ef9('0x1a')]),this[_0x3ef9('0x26')]=null,this[_0x3ef9('0x24')]=_0x351fbc,this[_0x3ef9('0x13')]=_0xe08bdb[_0x3ef9('0x0')],this[_0x3ef9('0x3')]=_0xe08bdb['onDiscard'],this[_0x3ef9('0x36')]=_0xe08bdb[_0x3ef9('0x39')],this['_markerNames']=new Set(),this[_0x3ef9('0x31')]=null,this[_0x3ef9('0x32')](_0x3ef9('0x7'),null),this[_0x3ef9('0x32')](_0x3ef9('0x2f'),_0xe08bdb[_0x3ef9('0x2f')]||{}),this[_0x3ef9('0x32')](_0x3ef9('0x34'),null),this[_0x3ef9('0x32')](_0x3ef9('0x28'),null),this[_0x3ef9('0x32')](_0x3ef9('0x1e'),null),this['set'](_0x3ef9('0x19'),!0x1),this[_0x3ef9('0xf')](_0x3ef9('0x9')),this[_0x3ef9('0xf')]('discard');}get[_0x3ef9('0xd')](){let _0x53a211=this;for(;_0x53a211[_0x3ef9('0x34')];)_0x53a211=_0x53a211[_0x3ef9('0x34')];return _0x53a211;}get[_0x3ef9('0x3a')](){return!!this['commentThread']&&this[_0x3ef9('0x1e')]['length']>0x0;}get[_0x3ef9('0x1d')](){if(0x0==this[_0x3ef9('0x1')][_0x3ef9('0xb')])return!0x1;return 0x6==Array[_0x3ef9('0x1f')](this[_0x3ef9('0x1')])[0x0][_0x3ef9('0x33')](':')['length'];}get[_0x3ef9('0x3b')](){return null!==this[_0x3ef9('0x25')]();}[_0x3ef9('0x8')](_0xc64907){this[_0x3ef9('0x1')][_0x3ef9('0x12')](_0xc64907);}[_0x3ef9('0x1b')](){return Array[_0x3ef9('0x1f')](this['_markerNames']);}[_0x3ef9('0x16')](){return this['getMarkerNames']()['map'](_0x4c9856=>this[_0x3ef9('0x24')]['markers'][_0x3ef9('0x2a')](_0x4c9856))[_0x3ef9('0x2e')](_0x75c6e2=>_0x75c6e2);}['getFirstMarker'](){return this[_0x3ef9('0x16')]()[0x0]||null;}[_0x3ef9('0x30')](){this[_0x3ef9('0x24')][_0x3ef9('0x23')](_0x4c9699=>{for(const _0xfea378 of this['getMarkers']())_0x4c9699['removeMarker'](_0xfea378);}),this[_0x3ef9('0x1')][_0x3ef9('0x35')]();}[_0x3ef9('0x15')](_0x40a733){this[_0x3ef9('0x24')][_0x3ef9('0x23')](_0x4ad4f7=>{_0x4ad4f7[_0x3ef9('0x15')](_0x40a733);}),this['_markerNames'][_0x3ef9('0x29')](_0x40a733);}['addRange'](_0x135d0a){const _0x48a71b='suggestion:'+this[_0x3ef9('0x4')]+':'+this['subType']+':'+this['id']+':'+this[_0x3ef9('0x38')]['id']+':'+o[_0x3ef9('0xc')]();this[_0x3ef9('0x8')](_0x48a71b),this['_model'][_0x3ef9('0x23')](_0xf4fd43=>{_0xf4fd43['addMarker'](_0x48a71b,{'range':_0x135d0a,'usingOperation':!0x0,'affectsData':!0x0});});}[_0x3ef9('0x2c')](_0x5b4e3d){for(const _0x106506 of this['getRanges']())if(_0x106506[_0x3ef9('0xa')](_0x5b4e3d))return!0x0;return!0x1;}[_0x3ef9('0x11')](){return this['getMarkers']()[_0x3ef9('0x10')](_0xa6ba9a=>_0xa6ba9a[_0x3ef9('0x2d')]());}['getItems'](){return this[_0x3ef9('0x11')]()['reduce']((_0x1a77b7,_0x3cc473)=>[..._0x1a77b7,..._0x3cc473[_0x3ef9('0x18')]()],[]);}[_0x3ef9('0x5')](){return this[_0x3ef9('0x25')]()[_0x3ef9('0x2d')]();}['getContainedElement'](){const _0x3bcefd=this['getRanges']();if(0x1!=_0x3bcefd['length'])return null;const _0x51d73a=_0x3bcefd[0x0],_0x28eb66=_0x51d73a[_0x3ef9('0x22')][_0x3ef9('0x37')],_0x4d1e33=_0x51d73a[_0x3ef9('0xe')][_0x3ef9('0x17')];return _0x28eb66 instanceof _0x73cfc3?_0x28eb66!=_0x4d1e33?null:_0x28eb66:null;}[_0x3ef9('0x9')](){this[_0x3ef9('0x13')](this[_0x3ef9('0x11')](),this[_0x3ef9('0x26')],this[_0x3ef9('0x2f')]),this[_0x3ef9('0x30')]();}[_0x3ef9('0x2b')](){this[_0x3ef9('0x3')](this[_0x3ef9('0x11')](),this[_0x3ef9('0x26')],this[_0x3ef9('0x2f')]),this[_0x3ef9('0x30')]();}[_0x3ef9('0x21')](){const _0x25063d=[];let _0x29bad8=this[_0x3ef9('0xd')];for(;_0x29bad8;)_0x25063d[_0x3ef9('0x2')](_0x29bad8),_0x29bad8=_0x29bad8[_0x3ef9('0x28')];return _0x25063d;}[_0x3ef9('0x27')](_0x16f2e2,_0xd30006){const _0x29b8d9=_0x255cac(this[_0x3ef9('0x2f')]);_0x2aeae1(_0x29b8d9,_0x16f2e2,_0xd30006),_0x1ce58c(_0x29b8d9,this[_0x3ef9('0x2f')])||(this[_0x3ef9('0x2f')]=_0x29b8d9,this[_0x3ef9('0x36')](_0x29b8d9));}[_0x3ef9('0x20')](_0x59a2b3){const _0x3db005=_0x255cac(this['attributes']);_0x50b38e(_0x3db005,_0x59a2b3),_0x1ce58c(_0x3db005,this[_0x3ef9('0x2f')])||(this[_0x3ef9('0x2f')]=_0x3db005,this[_0x3ef9('0x36')](this[_0x3ef9('0x2f')]));}['toJSON'](){return{'id':this['id'],'type':this[_0x3ef9('0x14')]?this['type']+':'+this[_0x3ef9('0x14')]:this[_0x3ef9('0x4')],'authorId':this['creator']['id'],'createdAt':this[_0x3ef9('0x31')],'hasComments':this[_0x3ef9('0x3a')],'data':this[_0x3ef9('0x26')],'attributes':this[_0x3ef9('0x2f')]};}static['getMultiRangeId'](){return _0x1adafa()[_0x3ef9('0x6')](0x1,0x5);}}_0x63632(o,_0x5ca108);
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 _0x5d89=['$1\x20$2','registerDescriptionCallback','push','*Split:*\x20%0','textProxy','Container','isEmpty','start','addObject','_resolveDescriptionItems','elementEnd','get','_customCallbacks','checkChild','getFirstRange','getItemLabel','data','ELEMENT_SPACE','name','_schema','REPLACE_TEXT','match','insertion','function','*Remove:*\x20%0','length','elementStart','removeContainer','Object','getDescriptions','element','text','isEqual','isObject','_itemLabels','end','item','remove','removeEmptyContainer','*Merge:*\x20%0','EmptyContainer','*Insert:*\x20%0','type','softBreak','indexOf','removeObject','quantity','registerElementLabel','_locale','nextSibling','add','_addDescriptionItems','addEmptyContainer','getWalker','matchingCallback','replace','previousSibling','_itemLabelsCallbacks','deletion','$text'];(function(_0x308abe,_0x5d8932){const _0x1610dc=function(_0x51e90a){while(--_0x51e90a){_0x308abe['push'](_0x308abe['shift']());}};_0x1610dc(++_0x5d8932);}(_0x5d89,0x130));const _0x1610=function(_0x308abe,_0x5d8932){_0x308abe=_0x308abe-0x0;let _0x1610dc=_0x5d89[_0x308abe];return _0x1610dc;};import{getTranslation as _0x26adf6}from'./utils/common-translations';import{priorities as _0x272fb0,insertToPriorityArray as _0x16b162}from'ckeditor5/src/utils';export default class f{constructor(_0x5313c2,_0x1871d5){this[_0x1610('0x8')]=[],this[_0x1610('0x1e')]=new Map(),this['_itemLabelsCallbacks']=[],this[_0x1610('0xf')]=_0x5313c2,this['_locale']=_0x1871d5;}[_0x1610('0x19')](_0x4f6e08){const _0x153de1=[];for(let _0x1f3bec=0x0;_0x1f3bec<_0x4f6e08[_0x1610('0x15')];_0x1f3bec++){const _0x3bdd8c=_0x4f6e08[_0x1f3bec];if(!_0x3bdd8c['isInContent'])continue;let _0x743f5e=!0x1;for(const _0x2324e7 of this[_0x1610('0x8')]){const _0x3685fe=_0x2324e7(_0x3bdd8c);if(_0x3685fe){_0x3685fe[_0x1610('0x26')]&&_0x153de1[_0x1610('0x3a')](_0x3685fe),_0x743f5e=!0x0;break;}}if(!_0x743f5e){this[_0x1610('0x2f')](_0x153de1,_0x3bdd8c);const _0x265c0f=_0x4f6e08[_0x1f3bec+0x1];if(_0x265c0f&&!_0x3bdd8c[_0x1610('0xa')]()[_0x1610('0x1f')][_0x1610('0x1c')](_0x265c0f[_0x1610('0xa')]()[_0x1610('0x3')])){const _0x4aaf97=_0x153de1[_0x153de1[_0x1610('0x15')]-0x1],_0x4dc529=_0x1610('0x12')==_0x3bdd8c[_0x1610('0x26')]?_0x1610('0x2e'):'remove';_0x4aaf97&&'text'==_0x4aaf97[_0x1610('0x26')]&&(_0x4aaf97[_0x4dc529]+='\x0a');}}}return this['_resolveDescriptionItems'](_0x153de1);}[_0x1610('0x39')](_0x57424b){this[_0x1610('0x8')][_0x1610('0x3a')](_0x57424b);}[_0x1610('0x2b')](_0x30491e,_0x54386a,_0x2eaae9=_0x272fb0['normal']){_0x1610('0x13')==typeof _0x30491e?_0x16b162(this[_0x1610('0x35')],{'matchingCallback':_0x30491e,'label':_0x54386a,'priority':_0x2eaae9}):this[_0x1610('0x1e')]['set'](_0x30491e,_0x54386a);}[_0x1610('0xb')](_0x5bf834,_0x10643d=0x1){let _0x57c73e;for(const _0x4b0abd of this[_0x1610('0x35')])if(_0x4b0abd[_0x1610('0x32')](_0x5bf834)){_0x57c73e=_0x4b0abd['label'];break;}return _0x57c73e||(_0x57c73e=this[_0x1610('0x1e')][_0x1610('0x7')](_0x5bf834[_0x1610('0xe')])),_0x57c73e?_0x57c73e(_0x10643d):0x1!==_0x10643d?_0x10643d+'\x20'+_0x5bf834[_0x1610('0xe')]+'s':''+_0x5bf834[_0x1610('0xe')];}['_addDescriptionItems'](_0x5141d6,_0x12abf3){const _0x3f270c=_0x12abf3[_0x1610('0xa')]()[_0x1610('0x31')](),_0x23841d=_0x1610('0x12')==_0x12abf3[_0x1610('0x26')]?_0x1610('0x2e'):'remove';for(const _0x309a33 of _0x3f270c){const _0x1e9bea=_0x309a33['item'],_0x1b1e35=_0x5141d6[_0x5141d6[_0x1610('0x15')]-0x1];if(_0x1e9bea['is'](_0x1610('0x0')))_0x1b1e35&&_0x1b1e35[_0x1610('0x26')]['indexOf']('Container')>-0x1&&_0x5141d6['pop'](),_0x1b1e35&&_0x1610('0x1b')==_0x1b1e35[_0x1610('0x26')]?_0x1b1e35[_0x23841d]+=_0x1e9bea[_0x1610('0xc')]:_0x5141d6[_0x1610('0x3a')]({'type':_0x1610('0x1b'),'add':_0x1610('0x2e')==_0x23841d?_0x1e9bea[_0x1610('0xc')]:'','remove':_0x1610('0x21')==_0x23841d?_0x1e9bea['data']:''});else{if(this['_schema']['isObject'](_0x1e9bea)){if(_0x1b1e35&&_0x1b1e35['type'][_0x1610('0x28')](_0x1610('0x1'))>-0x1&&_0x5141d6['pop'](),_0x1610('0x6')==_0x309a33[_0x1610('0x26')])continue;_0x1b1e35&&_0x1b1e35[_0x1610('0x26')]==_0x23841d+_0x1610('0x18')&&_0x1b1e35[_0x1610('0x1a')]['name']==_0x1e9bea[_0x1610('0xe')]?_0x1b1e35[_0x1610('0x2a')]++:_0x5141d6[_0x1610('0x3a')]({'type':_0x23841d+_0x1610('0x18'),'element':_0x1e9bea,'quantity':0x1}),_0x3f270c['skip'](_0x3961cf=>!(_0x1610('0x6')==_0x3961cf[_0x1610('0x26')]&&_0x3961cf[_0x1610('0x20')]==_0x1e9bea));}else{if(this['_schema'][_0x1610('0x9')](_0x1e9bea,_0x1610('0x37'))||_0x1e9bea['is']('element',_0x1610('0x27'))){if(_0x1610('0x2e')==_0x23841d&&_0x1610('0x16')==_0x309a33[_0x1610('0x26')]||_0x1610('0x21')==_0x23841d&&'elementEnd'==_0x309a33[_0x1610('0x26')])continue;if(_0x1b1e35&&-0x1==_0x1b1e35[_0x1610('0x26')][_0x1610('0x28')](_0x1610('0x1'))){_0x1610('0x1b')==_0x1b1e35[_0x1610('0x26')]&&(_0x1b1e35[_0x23841d]+='\x0a');continue;}let _0x53b9a2;if(_0x53b9a2=_0x1610('0x2e')==_0x23841d?_0x1e9bea[_0x1610('0x2d')]&&!this['_schema']['isObject'](_0x1e9bea['nextSibling'])?_0x1e9bea['nextSibling']:null:_0x1e9bea[_0x1610('0x34')]&&!this[_0x1610('0xf')][_0x1610('0x1d')](_0x1e9bea[_0x1610('0x34')])?_0x1e9bea[_0x1610('0x34')]:null,_0x1e9bea[_0x1610('0x2')]||_0x53b9a2&&_0x53b9a2['isEmpty']){const _0x2cb29d=_0x53b9a2&&_0x53b9a2['isEmpty']?_0x53b9a2:_0x1e9bea;_0x1b1e35&&_0x1b1e35[_0x1610('0x26')]==_0x23841d+_0x1610('0x24')&&_0x1b1e35[_0x1610('0x1a')][_0x1610('0xe')]==_0x2cb29d['name']?_0x1b1e35['quantity']++:_0x5141d6[_0x1610('0x3a')]({'type':_0x23841d+_0x1610('0x24'),'element':_0x2cb29d,'quantity':0x1});}else _0x5141d6[_0x1610('0x3a')]({'type':_0x23841d+_0x1610('0x1'),'element':_0x1e9bea});}}}}}[_0x1610('0x5')](_0x707ccb){const _0x4530e7=this[_0x1610('0x2c')],_0x40e093=[];for(const _0x1b3ea of _0x707ccb){switch(_0x1b3ea[_0x1610('0x26')]){case _0x1610('0x1b'):if(_0x1b3ea[_0x1610('0x2e')]=_0x1b3ea['add'][_0x1610('0x33')](/(\S)\u000A+(\S)/g,_0x1610('0x38'))[_0x1610('0x33')](/\u000A/g,''),_0x1b3ea[_0x1610('0x21')]=_0x1b3ea[_0x1610('0x21')][_0x1610('0x33')](/(\S)\u000A+(\S)/g,_0x1610('0x38'))['replace'](/\u000A/g,''),''!=_0x1b3ea[_0x1610('0x2e')]&&''!=_0x1b3ea['remove']){_0x40e093[_0x1610('0x3a')]({'type':_0x1610('0x33'),'content':_0x26adf6(_0x4530e7,_0x1610('0x10'),['\x22'+_0x1b3ea[_0x1610('0x21')]+'\x22','\x22'+_0x1b3ea[_0x1610('0x2e')]+'\x22'])});continue;}if(null!=_0x1b3ea[_0x1610('0x2e')][_0x1610('0x11')](/^ +$/)){_0x40e093[_0x1610('0x3a')]({'type':_0x1610('0x12'),'content':_0x26adf6(_0x4530e7,_0x1610('0x25'),_0x26adf6(_0x4530e7,_0x1610('0xd'),_0x1b3ea[_0x1610('0x2e')][_0x1610('0x15')]))});continue;}if(null!=_0x1b3ea['remove'][_0x1610('0x11')](/^ +$/)){_0x40e093[_0x1610('0x3a')]({'type':_0x1610('0x36'),'content':_0x26adf6(_0x4530e7,'*Remove:*\x20%0',_0x26adf6(_0x4530e7,'ELEMENT_SPACE',_0x1b3ea[_0x1610('0x21')][_0x1610('0x15')]))});continue;}if(''!=_0x1b3ea['add']){_0x40e093['push']({'type':_0x1610('0x12'),'content':_0x26adf6(_0x4530e7,_0x1610('0x25'),'\x22'+_0x1b3ea[_0x1610('0x2e')]+'\x22')});continue;}_0x40e093['push']({'type':'deletion','content':_0x26adf6(_0x4530e7,'*Remove:*\x20%0','\x22'+_0x1b3ea[_0x1610('0x21')]+'\x22')});continue;case _0x1610('0x30'):case _0x1610('0x4'):_0x40e093[_0x1610('0x3a')]({'type':'insertion','content':_0x26adf6(_0x4530e7,_0x1610('0x25'),this[_0x1610('0xb')](_0x1b3ea[_0x1610('0x1a')],_0x1b3ea['quantity']))});continue;case _0x1610('0x22'):case _0x1610('0x29'):_0x40e093[_0x1610('0x3a')]({'type':_0x1610('0x36'),'content':_0x26adf6(_0x4530e7,_0x1610('0x14'),this[_0x1610('0xb')](_0x1b3ea[_0x1610('0x1a')],_0x1b3ea[_0x1610('0x2a')]))});continue;case'addContainer':_0x40e093[_0x1610('0x3a')]({'type':_0x1610('0x12'),'content':_0x26adf6(_0x4530e7,_0x1610('0x3b'),this[_0x1610('0xb')](_0x1b3ea['element'],_0x1b3ea[_0x1610('0x2a')]))});continue;case _0x1610('0x17'):_0x40e093[_0x1610('0x3a')]({'type':_0x1610('0x36'),'content':_0x26adf6(_0x4530e7,_0x1610('0x23'),this[_0x1610('0xb')](_0x1b3ea['element'],_0x1b3ea[_0x1610('0x2a')]))});continue;}_0x40e093['push'](_0x1b3ea);}return _0x40e093;}}
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;}}