@ckeditor/ckeditor5-track-changes 36.0.1 → 37.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x6b39=['PendingActions','_editor','remove','PENDING_ACTION_SUGGESTION','add','locale','stopListening','_acceptCommand','unbind','_removePendingAction','_setPendingAction','get','_pendingAction','listenTo','destroy','commands','commentThreadController','bind','model','isDirty','discardSuggestion','isEnabled','execute','view','acceptSuggestion','plugins'];(function(_0x5933a8,_0x6b398a){const _0x511870=function(_0x4fbe54){while(--_0x4fbe54){_0x5933a8['push'](_0x5933a8['shift']());}};_0x511870(++_0x6b398a);}(_0x6b39,0x1db));const _0x5118=function(_0x5933a8,_0x6b398a){_0x5933a8=_0x5933a8-0x0;let _0x511870=_0x6b39[_0x5933a8];return _0x511870;};import{ObservableMixin as _0x45fa99,mix as _0x49f214}from'ckeditor5/src/utils';import{getTranslation as _0x535e59}from'../utils/common-translations';export default class Ot{constructor(_0x57e43f,_0x10ac79,_0x597a98,_0x470e61){this[_0x5118('0xb')]=_0x10ac79,this[_0x5118('0x10')]=_0x597a98,this[_0x5118('0x9')]=_0x470e61,this[_0x5118('0x14')]=_0x57e43f,this['_acceptCommand']=_0x57e43f[_0x5118('0x8')][_0x5118('0x4')]('acceptSuggestion'),this['_discardCommand']=_0x57e43f[_0x5118('0x8')][_0x5118('0x4')](_0x5118('0xd')),this[_0x5118('0x10')][_0x5118('0xa')](_0x5118('0xe'))['to'](this['_acceptCommand']),this[_0x5118('0x5')]=null,_0x597a98[_0x5118('0xc')]&&this[_0x5118('0x3')](),this[_0x5118('0x6')](_0x597a98,_0x5118('0x11'),()=>this[_0x5118('0x11')]()),this[_0x5118('0x6')](_0x597a98,_0x5118('0xd'),()=>this['discardSuggestion']()),this[_0x5118('0x6')](_0x597a98,'change:isDirty',()=>{_0x597a98['isDirty']?this[_0x5118('0x3')]():this[_0x5118('0x2')]();});}[_0x5118('0x11')](){this[_0x5118('0x0')][_0x5118('0xf')](this['model']['id']);}['discardSuggestion'](){this['_discardCommand']['execute'](this[_0x5118('0xb')]['id']);}[_0x5118('0x7')](){this[_0x5118('0x10')][_0x5118('0x1')](_0x5118('0xe')),this[_0x5118('0x19')](),this[_0x5118('0x9')]['destroy'](),this[_0x5118('0x5')]&&this[_0x5118('0x2')]();}['_setPendingAction'](){const _0x11f3f3=_0x535e59(this[_0x5118('0x14')][_0x5118('0x18')],_0x5118('0x16'));this[_0x5118('0x5')]=this[_0x5118('0x14')][_0x5118('0x12')]['get'](_0x5118('0x13'))[_0x5118('0x17')](_0x11f3f3);}[_0x5118('0x2')](){this[_0x5118('0x14')][_0x5118('0x12')]['get']('PendingActions')[_0x5118('0x15')](this[_0x5118('0x5')]),this['_pendingAction']=null;}}_0x49f214(Ot,_0x45fa99);
23
+ const _0x4b48=['execute','change:isDirty','get','isEnabled','isDirty','commentThreadController','_discardCommand','_setPendingAction','add','_removePendingAction','listenTo','canAccept','_editor','destroy','stopListening','bind','PendingActions','unbind','model','discardSuggestion','_acceptCommand','_pendingAction','view','plugins','commands','acceptSuggestion','canDiscard','PENDING_ACTION_SUGGESTION','remove'];(function(_0x353be4,_0x4b4862){const _0x4dd35e=function(_0x1f8e90){while(--_0x1f8e90){_0x353be4['push'](_0x353be4['shift']());}};_0x4dd35e(++_0x4b4862);}(_0x4b48,0x143));const _0x4dd3=function(_0x353be4,_0x4b4862){_0x353be4=_0x353be4-0x0;let _0x4dd35e=_0x4b48[_0x353be4];return _0x4dd35e;};import{ObservableMixin as _0x558af1}from'ckeditor5/src/utils';import{getTranslation as _0x24c257}from'../utils/common-translations';export default class Lt extends _0x558af1(){constructor(_0x342d5a,_0x52fc2a,_0x1247cc,_0x2c2110){super(),this['model']=_0x52fc2a,this[_0x4dd3('0x12')]=_0x1247cc,this[_0x4dd3('0x1')]=_0x2c2110,this['_editor']=_0x342d5a,this[_0x4dd3('0x10')]=_0x342d5a[_0x4dd3('0x14')]['get'](_0x4dd3('0x15')),this[_0x4dd3('0x2')]=_0x342d5a['commands']['get'](_0x4dd3('0xf')),this[_0x4dd3('0x12')][_0x4dd3('0xb')](_0x4dd3('0x1c'))['to'](this['_acceptCommand'],this['_discardCommand'],(_0x390a25,_0x212a37)=>_0x390a25||_0x212a37),this[_0x4dd3('0x12')]['bind'](_0x4dd3('0x7'))['to'](this[_0x4dd3('0x10')],'isEnabled'),this['view']['bind'](_0x4dd3('0x16'))['to'](this[_0x4dd3('0x2')],_0x4dd3('0x1c')),this[_0x4dd3('0x11')]=null,_0x1247cc[_0x4dd3('0x0')]&&this[_0x4dd3('0x3')](),this[_0x4dd3('0x6')](_0x1247cc,_0x4dd3('0x15'),()=>this[_0x4dd3('0x15')]()),this[_0x4dd3('0x6')](_0x1247cc,_0x4dd3('0xf'),()=>this['discardSuggestion']()),this[_0x4dd3('0x6')](_0x1247cc,_0x4dd3('0x1a'),()=>{_0x1247cc[_0x4dd3('0x0')]?this[_0x4dd3('0x3')]():this[_0x4dd3('0x5')]();});}['acceptSuggestion'](){this['_acceptCommand']['execute'](this['model']['id']);}['discardSuggestion'](){this['_discardCommand'][_0x4dd3('0x19')](this[_0x4dd3('0xe')]['id']);}[_0x4dd3('0x9')](){this['view'][_0x4dd3('0xd')](_0x4dd3('0x1c')),this[_0x4dd3('0x12')][_0x4dd3('0xd')](_0x4dd3('0x7')),this[_0x4dd3('0x12')]['unbind'](_0x4dd3('0x16')),this[_0x4dd3('0xa')](),this[_0x4dd3('0x1')][_0x4dd3('0x9')](),this[_0x4dd3('0x11')]&&this[_0x4dd3('0x5')]();}['_setPendingAction'](){const _0x580d83=_0x24c257(this[_0x4dd3('0x8')]['locale'],_0x4dd3('0x17'));this[_0x4dd3('0x11')]=this[_0x4dd3('0x8')][_0x4dd3('0x13')][_0x4dd3('0x1b')](_0x4dd3('0xc'))[_0x4dd3('0x4')](_0x580d83);}[_0x4dd3('0x5')](){null!==this[_0x4dd3('0x11')]&&this[_0x4dd3('0x8')]['plugins'][_0x4dd3('0x1b')]('PendingActions')[_0x4dd3('0x18')](this['_pendingAction']),this[_0x4dd3('0x11')]=null;}}
@@ -0,0 +1,166 @@
1
+ /**
2
+ * @module track-changes/ui/view/basesuggestionthreadview
3
+ * @publicApi
4
+ */
5
+ import { View } from 'ckeditor5/src/ui';
6
+ import type { Locale } from 'ckeditor5/src/utils';
7
+ import type { EditorConfig } from 'ckeditor5/src/core';
8
+ import type Suggestion from '../../suggestion';
9
+ import type { CommentsListView, CommentThreadInputView, CommentView } from '@ckeditor/ckeditor5-comments';
10
+ import type { User } from 'ckeditor5-collaboration/src/collaboration-core';
11
+ import type { Description } from '../../suggestiondescriptionfactory';
12
+ /**
13
+ * An abstract suggestion thread view class that should be used as a base for suggestion thread view implementations.
14
+ * It provides some behaviors, flags and building blocks to use when creating a custom suggestion thread view class.
15
+ *
16
+ * All events fired by {@link module:comments/comments/ui/view/basecommentview~BaseCommentView}
17
+ * are delegated to {@link module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView}.
18
+ * This means that {@link module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView} can also fire these
19
+ * events to communicate with CKEditor 5 collaboration features.
20
+ *
21
+ * For the usage examples check the {@glink features/collaboration/annotations/annotations-custom-view
22
+ * Annotations custom view} guide.
23
+ */
24
+ export default abstract class BaseSuggestionThreadView extends View {
25
+ /**
26
+ * The list of comment views. It should be used as a part of the view template when present.
27
+ */
28
+ commentsListView: CommentsListView | null;
29
+ /**
30
+ * The comment input area view. It should be used as a part of the view template when present.
31
+ */
32
+ commentThreadInputView: CommentThreadInputView | null;
33
+ /**
34
+ * A boolean value that informs if the comment thread view is in the active state ("highlighted").
35
+ * A comment thread view is in this state when it is focused or was activated by the user in any different way.
36
+ *
37
+ * @observable
38
+ */
39
+ isActive: boolean;
40
+ /**
41
+ * Suggestion creation date.
42
+ *
43
+ * @observable
44
+ */
45
+ authoredAt: Date | null;
46
+ /**
47
+ * Flag that indicates whether suggestion acceptation is possible.
48
+ *
49
+ * @observable
50
+ */
51
+ canAccept: boolean;
52
+ /**
53
+ * Flag that indicates whether suggestion discarding is possible.
54
+ *
55
+ * @observable
56
+ */
57
+ canDiscard: boolean;
58
+ /**
59
+ * Stores description entries generated for this suggestion that describe what is the suggested change.
60
+ * They are used to create the final description presented in the suggestion view to the user.
61
+ *
62
+ * Note that one suggestion may include multiple changes.
63
+ *
64
+ * Most cases are simple and include just one description item:
65
+ *
66
+ * ```ts
67
+ * [
68
+ * { type: 'insertion', content: '*Insert:* "Foo"' }
69
+ * ]
70
+ * ```
71
+ *
72
+ * This description item represents a suggestion for inserting the "Foo" text. The `type` property describes the performed action
73
+ * while the `content` property contains additional information about the action and is optional.
74
+ *
75
+ * A more complex example is presented below:
76
+ *
77
+ * ```ts
78
+ * [
79
+ * { type: 'insertion', content: '*Insert:* 2 paragraphs' },
80
+ * { type: 'insertion', content: '*Insert:* image' },
81
+ * { type: 'replace', content: '*Replace:* "Foo" *with* "Bar"' }
82
+ * ]
83
+ * ```
84
+ *
85
+ * In this example, there are three description instances (or lines). Two new (empty) paragraphs were added,
86
+ * an image was added and then "Foo" text was replaced by "Bar". The above structure could be rendered as:
87
+ *
88
+ * ```html
89
+ * <p><strong>Insert:</strong> 2 paragraphs</p>
90
+ * <p><strong>Insert:</strong> image</p>
91
+ * <p><strong>Replace:</strong> "Foo" <strong>with</strong> "Bar"</p>
92
+ * ```
93
+ *
94
+ * @observable
95
+ */
96
+ descriptionParts: Array<Description>;
97
+ /**
98
+ * Informs whether the suggestion thread has any changes that have not been saved.
99
+ *
100
+ * @observable
101
+ */
102
+ isDirty: boolean;
103
+ /**
104
+ * Informs whether the suggestion can be accepted or discarded.
105
+ *
106
+ * @observable
107
+ */
108
+ isEnabled: boolean;
109
+ /**
110
+ * The number of items in the view, where the suggestion itself counts as one.
111
+ *
112
+ * In other words, it is equal to the number of comments in the suggestion thread view plus one.
113
+ *
114
+ * @observable
115
+ */
116
+ readonly length: number;
117
+ constructor(locale: Locale, model: Suggestion, localUser: User, config: SuggestionThreadConfig);
118
+ /**
119
+ * Focuses the view.
120
+ */
121
+ focus(): void;
122
+ /**
123
+ * @inheritDoc
124
+ */
125
+ destroy(): void;
126
+ }
127
+ /**
128
+ * Fired when a user performed an action that should lead to accepting the suggestion.
129
+ *
130
+ * This event is not fired by default by any component created by `BaseSuggestionThreadView`.
131
+ * If you create a view class extending `BaseSuggestionCommentView`, you should provide
132
+ * a UI element that will fire this event.
133
+ *
134
+ * @eventName ~BaseSuggestionThreadView#acceptSuggestion
135
+ */
136
+ export type AcceptSuggestionEvent = {
137
+ name: 'acceptSuggestion';
138
+ args: [];
139
+ };
140
+ /**
141
+ * Fired when a user performed an action that should lead to discarding the suggestion.
142
+ *
143
+ * This event is not fired by default by any component created by `BaseSuggestionThreadView`.
144
+ * If you create a view class extending `BaseSuggestionCommentView`, you should provide
145
+ * a UI element that will fire this event.
146
+ *
147
+ * @eventName ~BaseSuggestionThreadView#discardSuggestion
148
+ */
149
+ export type DiscardSuggestionEvent = {
150
+ name: 'discardSuggestion';
151
+ args: [];
152
+ };
153
+ /**
154
+ * Config used for suggestion thread views.
155
+ */
156
+ export interface SuggestionThreadConfig {
157
+ disableComments: boolean;
158
+ editorConfig: EditorConfig;
159
+ maxCommentsWhenCollapsed: number;
160
+ maxThreadTotalWeight: number;
161
+ maxCommentCharsWhenCollapsed: number;
162
+ formatDateTime: (date: Date | string) => string;
163
+ CommentView: typeof CommentView;
164
+ CommentsListView: typeof CommentsListView;
165
+ CommentThreadInputView: typeof CommentThreadInputView;
166
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4073=['editorConfig','cancel','disabledSubmit','commentsListView','CommentView','addComment','commentThreadInputView','isEnabled','descriptionParts','element','assign','destroy','isActive','value','isDirty','_createCommentThreadInputView','focus','fire','isReadOnly','length','updateComment','_config','disableComments','_createCommentViews','_localUser','hasDirtyComment','commentThread','removeComment','_model','commentInputView','bind','set','delegate','authoredAt','submit','editor','locale'];(function(_0x340399,_0x407347){const _0x260977=function(_0x4cfe56){while(--_0x4cfe56){_0x340399['push'](_0x340399['shift']());}};_0x260977(++_0x407347);}(_0x4073,0x13e));const _0x2609=function(_0x340399,_0x407347){_0x340399=_0x340399-0x0;let _0x260977=_0x4073[_0x340399];return _0x260977;};import{View as _0x7b0373}from'ckeditor5/src/ui';export default class ii extends _0x7b0373{constructor(_0x35226e,_0x3bdff6,_0x4b8539,_0x2dafe1){super(_0x35226e),this[_0x2609('0x12')]=null,this[_0x2609('0x15')]=null,this[_0x2609('0x9')](_0x2609('0x1b'),!0x1),this[_0x2609('0x9')](_0x2609('0xb'),_0x3bdff6[_0x2609('0xb')]),this[_0x2609('0x8')]('authoredAt')['to'](_0x3bdff6),this[_0x2609('0x9')](_0x2609('0x17'),[]),this[_0x2609('0x9')](_0x2609('0x1d'),!0x1),this[_0x2609('0x9')](_0x2609('0x16'),!0x1),this[_0x2609('0x6')]=_0x3bdff6,this[_0x2609('0x2')]=_0x4b8539,this[_0x2609('0x24')]=_0x2dafe1,_0x2dafe1[_0x2609('0x0')]?this[_0x2609('0x9')](_0x2609('0x22'),0x1):this[_0x2609('0x1')]();}[_0x2609('0x1f')](){this[_0x2609('0x18')][_0x2609('0x1f')]();}[_0x2609('0x1a')](){this[_0x2609('0x12')]&&this[_0x2609('0x12')][_0x2609('0x1a')](),this[_0x2609('0x15')]&&this[_0x2609('0x15')][_0x2609('0x1a')](),super[_0x2609('0x1a')]();}[_0x2609('0x1')](){const {CommentsListView:_0x3b1c50}=this[_0x2609('0x24')];this['commentsListView']=new _0x3b1c50(this[_0x2609('0xe')],this[_0x2609('0x6')][_0x2609('0x4')],Object[_0x2609('0x19')]({'CommentView':this[_0x2609('0x24')][_0x2609('0x13')]},this[_0x2609('0x24')])),this['commentsListView'][_0x2609('0xa')](_0x2609('0x5'))['to'](this),this[_0x2609('0x12')][_0x2609('0xa')](_0x2609('0x23'))['to'](this),this[_0x2609('0x12')][_0x2609('0x8')](_0x2609('0x1b'))['to'](this),this[_0x2609('0x9')]('length',this[_0x2609('0x12')][_0x2609('0x22')]+0x1),this[_0x2609('0x8')](_0x2609('0x22'))['to'](this[_0x2609('0x12')],_0x2609('0x22'),_0xb25996=>_0xb25996+0x1),this[_0x2609('0x15')]=this[_0x2609('0x1e')](),this['on'](_0x2609('0x5'),()=>this[_0x2609('0x1f')]()),this[_0x2609('0x8')]('isDirty')['to'](this[_0x2609('0x12')],_0x2609('0x3'),this[_0x2609('0x15')][_0x2609('0x7')],_0x2609('0x1c'),(_0x106752,_0x827965)=>_0x106752||!!_0x827965);}[_0x2609('0x1e')](){const {CommentThreadInputView:_0x170b52}=this[_0x2609('0x24')],_0x53e0cc=new _0x170b52(this['locale'],this[_0x2609('0x2')],this[_0x2609('0x24')][_0x2609('0xf')]),_0x19b894=_0x53e0cc[_0x2609('0x7')];return _0x53e0cc[_0x2609('0x8')]('showInput')['to'](this,_0x2609('0x1b'),this[_0x2609('0x6')]['commentThread'],_0x2609('0x21'),_0x19b894,_0x2609('0x1c'),(_0x25e63d,_0x5aa17c,_0x26f5a2)=>!!_0x26f5a2||_0x25e63d&&!_0x5aa17c),_0x19b894['on'](_0x2609('0xc'),(_0x5eb62a,_0x5294b8)=>{this[_0x2609('0x20')](_0x2609('0x14'),_0x5294b8),_0x19b894[_0x2609('0xd')]['setData']('');}),_0x19b894['on'](_0x2609('0x10'),()=>this[_0x2609('0x1f')]()),_0x19b894[_0x2609('0x8')](_0x2609('0x11'))['to'](this['_model'][_0x2609('0x4')],_0x2609('0x21')),_0x53e0cc;}}
23
+ const _0x5189=['_model','disabledSubmit','commentInputView','hasDirtyComment','isActive','set','_localUser','submit','destroy','CommentView','_createCommentViews','cancel','bind','descriptionParts','disableComments','length','assign','value','authoredAt','isEnabled','commentsListView','setData','commentThread','fire','isReadOnly','delegate','addComment','_config','element','isDirty','editor','commentThreadInputView','focus','canDiscard','removeComment','locale'];(function(_0x282308,_0x51893c){const _0x5e6ad8=function(_0x1bedf3){while(--_0x1bedf3){_0x282308['push'](_0x282308['shift']());}};_0x5e6ad8(++_0x51893c);}(_0x5189,0x10c));const _0x5e6a=function(_0x282308,_0x51893c){_0x282308=_0x282308-0x0;let _0x5e6ad8=_0x5189[_0x282308];return _0x5e6ad8;};import{View as _0x5d8d8d}from'ckeditor5/src/ui';export default class ii extends _0x5d8d8d{constructor(_0x529888,_0x301d96,_0x53df55,_0x1afa32){super(_0x529888),this[_0x5e6a('0x4')]=null,this[_0x5e6a('0xf')]=null,this[_0x5e6a('0x19')](_0x5e6a('0x18'),!0x1),this[_0x5e6a('0x19')]('authoredAt',_0x301d96[_0x5e6a('0x2')]),this['bind'](_0x5e6a('0x2'))['to'](_0x301d96),this[_0x5e6a('0x19')](_0x5e6a('0x21'),[]),this[_0x5e6a('0x19')](_0x5e6a('0xd'),!0x1),this[_0x5e6a('0x19')](_0x5e6a('0x3'),!0x1),this[_0x5e6a('0x19')]('canAccept',!0x1),this[_0x5e6a('0x19')](_0x5e6a('0x11'),!0x1),this[_0x5e6a('0x14')]=_0x301d96,this[_0x5e6a('0x1a')]=_0x53df55,this[_0x5e6a('0xb')]=_0x1afa32,_0x1afa32[_0x5e6a('0x22')]?this['set']('length',0x1):this[_0x5e6a('0x1e')]();}[_0x5e6a('0x10')](){this[_0x5e6a('0xc')][_0x5e6a('0x10')]();}[_0x5e6a('0x1c')](){this[_0x5e6a('0x4')]&&this[_0x5e6a('0x4')]['destroy'](),this['commentThreadInputView']&&this[_0x5e6a('0xf')]['destroy'](),super[_0x5e6a('0x1c')]();}['_createCommentViews'](){const {CommentsListView:_0xed15e2}=this[_0x5e6a('0xb')];this['commentsListView']=new _0xed15e2(this[_0x5e6a('0x13')],this[_0x5e6a('0x14')]['commentThread'],Object[_0x5e6a('0x0')]({'CommentView':this['_config'][_0x5e6a('0x1d')]},this[_0x5e6a('0xb')])),this[_0x5e6a('0x4')][_0x5e6a('0x9')](_0x5e6a('0x12'))['to'](this),this[_0x5e6a('0x4')]['delegate']('updateComment')['to'](this),this[_0x5e6a('0x4')]['bind']('isActive')['to'](this),this[_0x5e6a('0x19')](_0x5e6a('0x23'),this[_0x5e6a('0x4')]['length']+0x1),this[_0x5e6a('0x20')]('length')['to'](this['commentsListView'],_0x5e6a('0x23'),_0x5e1df4=>_0x5e1df4+0x1),this['commentThreadInputView']=this['_createCommentThreadInputView'](),this['on']('removeComment',()=>this[_0x5e6a('0x10')]()),this[_0x5e6a('0x20')](_0x5e6a('0xd'))['to'](this[_0x5e6a('0x4')],_0x5e6a('0x17'),this['commentThreadInputView'][_0x5e6a('0x16')],_0x5e6a('0x1'),(_0x3ec517,_0x27195d)=>_0x3ec517||!!_0x27195d);}['_createCommentThreadInputView'](){const {CommentThreadInputView:_0x5681f8}=this[_0x5e6a('0xb')],_0x40d08e=new _0x5681f8(this['locale'],this[_0x5e6a('0x1a')],this['_config']['editorConfig']),_0x149341=_0x40d08e[_0x5e6a('0x16')];return _0x40d08e[_0x5e6a('0x20')]('showInput')['to'](this,_0x5e6a('0x18'),this[_0x5e6a('0x14')]['commentThread'],_0x5e6a('0x8'),_0x149341,_0x5e6a('0x1'),(_0x39621,_0x41d969,_0x15a12c)=>!!_0x15a12c||_0x39621&&!_0x41d969),_0x149341['on'](_0x5e6a('0x1b'),(_0x2cfba4,_0x9abea8)=>{this[_0x5e6a('0x7')](_0x5e6a('0xa'),_0x9abea8),_0x149341[_0x5e6a('0xe')][_0x5e6a('0x5')]('');}),_0x149341['on'](_0x5e6a('0x1f'),()=>this['focus']()),_0x149341[_0x5e6a('0x20')](_0x5e6a('0x15'))['to'](this[_0x5e6a('0x14')][_0x5e6a('0x6')],'isReadOnly'),_0x40d08e;}}
@@ -0,0 +1,184 @@
1
+ /**
2
+ * @module track-changes/ui/view/suggestionthreadview
3
+ * @publicApi
4
+ */
5
+ import { default as BaseSuggestionThreadView, type SuggestionThreadConfig } from './basesuggestionthreadview';
6
+ import { ButtonView, type TemplateDefinition } from 'ckeditor5/src/ui';
7
+ import { UserView, type User } from 'ckeditor5-collaboration/src/collaboration-core';
8
+ import type { Locale } from 'ckeditor5/src/utils';
9
+ import type Suggestion from '../../suggestion';
10
+ /**
11
+ * The default view for a suggestion thread.
12
+ *
13
+ * This view can be replaced by other view by overwriting the
14
+ * {@link module:track-changes/trackchanges~TrackChangesConfig#SuggestionThreadView} configuration.
15
+ *
16
+ * @extends module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView
17
+ */
18
+ export default class SuggestionThreadView extends BaseSuggestionThreadView {
19
+ /**
20
+ * The suggestion thread view type.
21
+ *
22
+ * This value is not equal to the suggestion (model) type. It is evaluated based on the type of the first suggestion for
23
+ * the suggestion thread view template purposes.
24
+ *
25
+ * @observable
26
+ */
27
+ type: 'format' | 'replace' | 'deletion' | 'insertion' | '';
28
+ /**
29
+ * A suggestion description explaining what has been changed. To be presented to the user.
30
+ *
31
+ * @observable
32
+ */
33
+ description: string;
34
+ /**
35
+ * A user view for the suggestion author.
36
+ */
37
+ userView: UserView;
38
+ /**
39
+ * A button view for the button that accepts the suggestion.
40
+ */
41
+ acceptButton: ButtonView | null;
42
+ /**
43
+ * A button view for the button that discards the suggestion.
44
+ */
45
+ discardButton: ButtonView | null;
46
+ constructor(locale: Locale, model: Suggestion, localUser: User, config: SuggestionThreadConfig);
47
+ /**
48
+ * Returns a template definition that will be passed to {@link module:ui/view~View#setTemplate}.
49
+ *
50
+ * Overwrite this method if you want to set a custom template for the suggestion thread view.
51
+ *
52
+ * The template looks as follows:
53
+ *
54
+ * ```ts
55
+ * {
56
+ * tag: 'div',
57
+ * attributes: {
58
+ * class: [
59
+ * 'ck-suggestion-wrapper',
60
+ * bind.if( 'isActive', 'ck-suggestion-wrapper--active' ),
61
+ * bind.to( 'type', value => `ck-suggestion-${ value }` ),
62
+ * this._config.disableComments && 'ck-suggestion--disabled-comments'
63
+ * ],
64
+ * 'data-suggestion-id': this._model.id,
65
+ * 'data-thread-id': this._model.commentThread.id,
66
+ * 'data-author-id': this._model.author.id,
67
+ * // Needed for managing focus after adding a new comment.
68
+ * tabindex: -1
69
+ * },
70
+ * children: [
71
+ * {
72
+ * tag: 'div',
73
+ *
74
+ * attributes: {
75
+ * class: [
76
+ * 'ck-suggestion',
77
+ * 'ck-annotation'
78
+ * ]
79
+ * },
80
+ *
81
+ * children: [
82
+ * this.userView,
83
+ * {
84
+ * tag: 'div',
85
+ *
86
+ * attributes: {
87
+ * class: [ 'ck-suggestion__main', 'ck-annotation__main' ]
88
+ * },
89
+ *
90
+ * children: [
91
+ * {
92
+ * tag: 'div',
93
+ *
94
+ * attributes: {
95
+ * class: [ 'ck-suggestion__info', 'ck-annotation__info' ]
96
+ * },
97
+ *
98
+ * children: [
99
+ * {
100
+ * tag: 'span',
101
+ *
102
+ * children: [
103
+ * {
104
+ * text: this.userView.name
105
+ * }
106
+ * ],
107
+ *
108
+ * attributes: {
109
+ * class: [ 'ck-suggestion__info-name', 'ck-annotation__info-name' ]
110
+ * }
111
+ * },
112
+ * {
113
+ * tag: 'time',
114
+ *
115
+ * attributes: {
116
+ * datetime: bind.to( 'authoredAt' ),
117
+ * class: [ 'ck-comment__info-time', 'ck-annotation__info-time' ]
118
+ * },
119
+ *
120
+ * children: [
121
+ * {
122
+ * text: bind.to( 'authoredAt', value => this._config.formatDateTime( value ) )
123
+ * }
124
+ * ]
125
+ * }
126
+ * ]
127
+ * },
128
+ * {
129
+ * tag: 'div',
130
+ *
131
+ * attributes: {
132
+ * class: [
133
+ * 'ck-suggestion__actions',
134
+ * 'ck-annotation__actions'
135
+ * ]
136
+ * },
137
+ *
138
+ * children: [
139
+ * this.acceptButton,
140
+ * this.discardButton
141
+ * ]
142
+ * },
143
+ * {
144
+ * tag: 'div',
145
+ *
146
+ * attributes: {
147
+ * class: [ 'ck-annotation__content-wrapper' ]
148
+ * }
149
+ * },
150
+ * {
151
+ * tag: 'div',
152
+ *
153
+ * attributes: {
154
+ * class: [ 'ck-comment__external' ]
155
+ * },
156
+ *
157
+ * children: [ {
158
+ * text: getTranslation( this.locale, 'EXTERNAL_SUGGESTION' )
159
+ * } ]
160
+ * }
161
+ * ]
162
+ * }
163
+ * ]
164
+ * },
165
+ * this.commentsListView,
166
+ * this.commentThreadInputView
167
+ * ]
168
+ * }
169
+ * ```
170
+ */
171
+ getTemplate(): TemplateDefinition;
172
+ /**
173
+ * @inheritDoc
174
+ */
175
+ render(): void;
176
+ /**
177
+ * Gets the translated note which indicates that the suggestion comes from an external source.
178
+ */
179
+ getExternalSuggestionNote(): string;
180
+ /**
181
+ * Gets the translated notification text which indicates that the author name comes from an external source.
182
+ */
183
+ getUserViewNotificationText(): string | null;
184
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x348e=['extendTemplate','split','innerText','value','isEnabled','discardButton','getExternalSuggestionNote','importWord','color','setTemplate','ck-comment__external','ck-comment__info-time','source','ck-suggestion__main','isActive','ck-annotation','userView','\x22\x20title=\x22','span','commentThread','_descriptionElement','getUserViewNotificationText','change:description','cancel','type','ck-annotation__main','locale','name','acceptButton','acceptSuggestion','<p>','ck-suggestion--discard','ck-suggestion--disabled-comments','ck-annotation__user','disableComments','commentThreadInputView','element','push','Accept\x20suggestion','ck-suggestion__user','EXTERNAL_IMPORT_WORD_AVATAR','isExternal','@external','fire','bind','ck-suggestion--accept','ck-annotation__info-time','children','author','</span>','createElement','_model','innerHTML','check','<span\x20class=\x22ck-suggestion-type\x22>','attributes','Discard\x20suggestion','.ck-annotation__content-wrapper','set','join','title','_config','commentsListView','</p>','descriptionParts','ck-suggestion__info-name','render','ck-annotation__info-name','ck-annotation__actions','getTemplate','div','content','_createButton','ck-suggestion-','authoredAt','EXTERNAL_IMPORT_WORD_SUGGESTION','creator'];(function(_0x1b89f6,_0x348efb){const _0x3519a1=function(_0x38160d){while(--_0x38160d){_0x1b89f6['push'](_0x1b89f6['shift']());}};_0x3519a1(++_0x348efb);}(_0x348e,0xd7));const _0x3519=function(_0x1b89f6,_0x348efb){_0x1b89f6=_0x1b89f6-0x0;let _0x3519a1=_0x348e[_0x1b89f6];return _0x3519a1;};import{getTranslation as _0x28bf13}from'../../utils/common-translations';import _0x55ac49 from'./basesuggestionthreadview';import{ButtonView as _0x60d07c}from'ckeditor5/src/ui';import{icons as _0xb882ab}from'ckeditor5/src/core';import{trimHtml as _0x59a2d3,UserView as _0x1c1b48}from'ckeditor5-collaboration/src/collaboration-core';export default class qt extends _0x55ac49{constructor(_0x115eca,_0x3f2a30,_0x4c0f82,_0x16adee){super(_0x115eca,_0x3f2a30,_0x4c0f82,_0x16adee),this['set']('type',''),this[_0x3519('0x3c')]('type')['to'](this,_0x3519('0x3'),_0x374333=>_0x374333&&_0x374333[0x0]?_0x374333[0x0]['type']:''),this[_0x3519('0x3c')]('description')['to'](this,'descriptionParts',this,_0x3519('0x1e'),(_0xa240b0,_0x1699fd)=>{let _0x4a7791='';for(const _0x491f37 of _0xa240b0)_0x4a7791+=_0x3519('0x2e')+ns(_0x491f37[_0x3519('0xa')],_0x491f37[_0x3519('0x18')])+_0x3519('0x2');return _0x1699fd?_0x4a7791:_0x59a2d3(_0x4a7791,{'limit':0x8c});}),this[_0x3519('0x24')]=null,this[_0x3519('0x2c')]=this['_createButton'](_0x28bf13(_0x115eca,_0x3519('0x36')),_0xb882ab[_0x3519('0x45')],_0x3519('0x3d'),_0x3519('0x2d'),'sw'),this[_0x3519('0x15')]=this[_0x3519('0xb')](_0x28bf13(_0x115eca,_0x3519('0x48')),_0xb882ab[_0x3519('0x27')],_0x3519('0x2f'),'discardSuggestion','sw'),this[_0x3519('0x20')]=new _0x1c1b48(_0x115eca,this[_0x3519('0x43')][_0x3519('0x40')],this[_0x3519('0x25')]()),this['userView'][_0x3519('0x10')]({'attributes':{'class':[_0x3519('0x37'),_0x3519('0x31')]}}),this[_0x3519('0x19')](this[_0x3519('0x8')]());}[_0x3519('0x8')](){const _0x257238=this['bindTemplate'],_0x42fe3a=[{'tag':_0x3519('0x9'),'attributes':{'class':['ck-suggestion__info','ck-annotation__info']},'children':[{'tag':_0x3519('0x22'),'children':[{'text':this[_0x3519('0x20')]['name']}],'attributes':{'class':[_0x3519('0x4'),_0x3519('0x6')]}},{'tag':'time','attributes':{'datetime':_0x257238['to'](_0x3519('0xd')),'class':[_0x3519('0x1b'),_0x3519('0x3e')]},'children':[{'text':_0x257238['to']('authoredAt',_0x2374b3=>this[_0x3519('0x0')]['formatDateTime'](_0x2374b3))}]}]},{'tag':_0x3519('0x9'),'attributes':{'class':['ck-suggestion__actions',_0x3519('0x7')]},'children':[this[_0x3519('0x2c')],this[_0x3519('0x15')]]},{'tag':_0x3519('0x9'),'attributes':{'class':['ck-annotation__content-wrapper']}}];this[_0x3519('0x43')][_0x3519('0x39')]&&_0x42fe3a[_0x3519('0x35')]({'tag':'div','attributes':{'class':[_0x3519('0x1a')]},'children':[{'text':this[_0x3519('0x16')]()}]});const _0x3756c5={'tag':_0x3519('0x9'),'attributes':{'class':['ck-suggestion-wrapper',_0x257238['if'](_0x3519('0x1e'),'ck-suggestion-wrapper--active'),_0x257238['to'](_0x3519('0x28'),_0x126471=>_0x3519('0xc')+_0x126471),this['_config'][_0x3519('0x32')]&&_0x3519('0x30')],'data-suggestion-id':this['_model']['id'],'data-thread-id':this[_0x3519('0x43')][_0x3519('0x23')]['id'],'data-author-id':this['_model'][_0x3519('0x40')]['id'],'tabindex':-0x1},'children':[{'tag':_0x3519('0x9'),'attributes':{'class':['ck-suggestion',_0x3519('0x1f')]},'children':[this[_0x3519('0x20')],{'tag':'div','attributes':{'class':[_0x3519('0x1d'),_0x3519('0x29')]},'children':_0x42fe3a}]}]};return this[_0x3519('0x1')]&&this[_0x3519('0x33')]&&_0x3756c5[_0x3519('0x3f')][_0x3519('0x35')](this[_0x3519('0x1')],this[_0x3519('0x33')]),_0x3756c5;}[_0x3519('0x5')](){super[_0x3519('0x5')](),this[_0x3519('0x24')]=this[_0x3519('0x34')]['querySelector'](_0x3519('0x49')),this[_0x3519('0x24')]['innerHTML']=this['description'],this['on'](_0x3519('0x26'),(_0x156b67,_0x3b0183,_0x54bcf9)=>{this['_descriptionElement'][_0x3519('0x44')]=_0x54bcf9;});}[_0x3519('0xb')](_0x48fc9d,_0x4d9dcc,_0x320902,_0x4a4ce9,_0x22f9d2){const _0x571fec=new _0x60d07c(this['locale']);return _0x571fec[_0x3519('0x4a')]({'label':_0x48fc9d,'icon':_0x4d9dcc,'tooltip':!0x0,'tooltipPosition':_0x22f9d2}),_0x571fec[_0x3519('0x10')]({'attributes':{'class':_0x320902}}),_0x571fec['on']('execute',()=>{this[_0x3519('0x3b')](_0x4a4ce9,this[_0x3519('0x43')]['id']);}),_0x571fec[_0x3519('0x3c')](_0x3519('0x14'))['to'](this),_0x571fec;}[_0x3519('0x16')](){return _0x3519('0x17')===this[_0x3519('0x43')][_0x3519('0x47')][_0x3519('0x3a')]['source']?_0x28bf13(this[_0x3519('0x2a')],_0x3519('0xe')):_0x28bf13(this[_0x3519('0x2a')],'EXTERNAL_SUGGESTION');}[_0x3519('0x25')](){return this['_model']['isExternal']?_0x3519('0x17')===this[_0x3519('0x43')][_0x3519('0x47')][_0x3519('0x3a')][_0x3519('0x1c')]?_0x28bf13(this[_0x3519('0x2a')],_0x3519('0x38'),this['_model']['creator']['name']):_0x28bf13(this[_0x3519('0x2a')],'EXTERNAL_AVATAR',this['_model'][_0x3519('0xf')][_0x3519('0x2b')]):null;}}function ns(_0x72858,_0x61422){let _0x278ab8='';return _0x278ab8+=_0x72858[_0x3519('0x11')]('*')['map']((_0x44c81e,_0x1b6cda)=>_0x1b6cda%0x2!=0x0?_0x3519('0x46')+os(_0x44c81e)+_0x3519('0x41'):os(_0x44c81e))[_0x3519('0x4b')](''),_0x61422&&(_0x278ab8+='<span\x20class=\x22ck-suggestion-color\x22\x20style=\x22background-color:\x20'+_0x61422[_0x3519('0x13')]+_0x3519('0x21')+_0x61422[_0x3519('0x4c')]+'\x22></span>'),_0x278ab8;}function os(_0x320441){const _0x386bc6=document[_0x3519('0x42')]('span');return _0x386bc6[_0x3519('0x12')]=_0x320441,_0x386bc6[_0x3519('0x44')];}
23
+ const _0x598d=['acceptButton','Discard\x20suggestion','join','ck-suggestion__info-name','title','ck-annotation__actions','creator','ck-suggestion--disabled-comments','bindTemplate','type','</span>','ck-suggestion','authoredAt','name','_createButton','@external','\x22\x20title=\x22','extendTemplate','_descriptionElement','execute','_model','ck-suggestion-wrapper','render','ck-annotation__content-wrapper','description','createElement','EXTERNAL_SUGGESTION','author','innerText','push','ck-suggestion--accept','ck-annotation__main','element','EXTERNAL_AVATAR','map','check','<span\x20class=\x22ck-suggestion-color\x22\x20style=\x22background-color:\x20','ck-suggestion--discard','importWord','ck-suggestion__info','content','ck-annotation__user','commentThread','descriptionParts','canDiscard','ck-annotation__info-name','commentThreadInputView','getTemplate','querySelector','ck-suggestion-','source','ck-comment__external','div','getUserViewNotificationText','Accept\x20suggestion','EXTERNAL_IMPORT_WORD_AVATAR','getExternalSuggestionNote','value','setTemplate','ck-suggestion-wrapper--active','bind','commentsListView','span','isExternal','formatDateTime','userView','_config','discardSuggestion','attributes','ck-suggestion__user','EXTERNAL_IMPORT_WORD_SUGGESTION','</p>','disableComments','set','discardButton','isEnabled','.ck-annotation__content-wrapper','isActive','locale','change:description','innerHTML','ck-annotation'];(function(_0x26afa4,_0x598d0a){const _0x2f8593=function(_0xf7efc4){while(--_0xf7efc4){_0x26afa4['push'](_0x26afa4['shift']());}};_0x2f8593(++_0x598d0a);}(_0x598d,0x106));const _0x2f85=function(_0x26afa4,_0x598d0a){_0x26afa4=_0x26afa4-0x0;let _0x2f8593=_0x598d[_0x26afa4];return _0x2f8593;};import{getTranslation as _0x4fa08f}from'../../utils/common-translations';import{default as _0x20de95}from'./basesuggestionthreadview';import{ButtonView as _0x2674b2}from'ckeditor5/src/ui';import{icons as _0x387611}from'ckeditor5/src/core';import{trimHtml as _0xba01b9,UserView as _0x26637c}from'ckeditor5-collaboration/src/collaboration-core';export default class Rt extends _0x20de95{constructor(_0x3da6b1,_0x92e0a8,_0x130139,_0x3a6650){super(_0x3da6b1,_0x92e0a8,_0x130139,_0x3a6650),this[_0x2f85('0x39')](_0x2f85('0x4b'),''),this['bind']('type')['to'](this,_0x2f85('0x1b'),_0x311bc5=>_0x311bc5&&_0x311bc5[0x0]?_0x311bc5[0x0][_0x2f85('0x4b')]:''),this[_0x2f85('0x2c')]('description')['to'](this,_0x2f85('0x1b'),this,_0x2f85('0x3d'),(_0x1f8337,_0x1dd943)=>{let _0x59aa23='';for(const _0x25717b of _0x1f8337)_0x59aa23+='<p>'+ns(_0x25717b[_0x2f85('0x18')],_0x25717b['color'])+_0x2f85('0x37');return _0x1dd943?_0x59aa23:_0xba01b9(_0x59aa23,{'limit':0x8c});}),this[_0x2f85('0x2')]=null,this[_0x2f85('0x42')]=this[_0x2f85('0x50')](_0x4fa08f(_0x3da6b1,_0x2f85('0x26')),_0x387611[_0x2f85('0x13')],_0x2f85('0xe'),'acceptSuggestion','sw'),this[_0x2f85('0x42')][_0x2f85('0x2c')](_0x2f85('0x3b'))['to'](this,'canAccept'),this[_0x2f85('0x3a')]=this[_0x2f85('0x50')](_0x4fa08f(_0x3da6b1,_0x2f85('0x43')),_0x387611['cancel'],_0x2f85('0x15'),_0x2f85('0x33'),'sw'),this[_0x2f85('0x3a')][_0x2f85('0x2c')](_0x2f85('0x3b'))['to'](this,_0x2f85('0x1c')),this['userView']=new _0x26637c(_0x3da6b1,this[_0x2f85('0x4')][_0x2f85('0xb')],this[_0x2f85('0x25')]()),this['userView'][_0x2f85('0x1')]({'attributes':{'class':[_0x2f85('0x35'),_0x2f85('0x19')]}}),this[_0x2f85('0x2a')](this[_0x2f85('0x1f')]());}['getTemplate'](){const _0x1a1313=this[_0x2f85('0x4a')],_0xb4ace5=[{'tag':_0x2f85('0x24'),'attributes':{'class':[_0x2f85('0x17'),'ck-annotation__info']},'children':[{'tag':_0x2f85('0x2e'),'children':[{'text':this[_0x2f85('0x31')][_0x2f85('0x4f')]}],'attributes':{'class':[_0x2f85('0x45'),_0x2f85('0x1d')]}},{'tag':'time','attributes':{'datetime':_0x1a1313['to']('authoredAt'),'class':['ck-comment__info-time','ck-annotation__info-time']},'children':[{'text':_0x1a1313['to'](_0x2f85('0x4e'),_0x52d329=>this['_config'][_0x2f85('0x30')](_0x52d329))}]}]},{'tag':_0x2f85('0x24'),'attributes':{'class':['ck-suggestion__actions',_0x2f85('0x47')]},'children':[this[_0x2f85('0x42')],this[_0x2f85('0x3a')]]},{'tag':_0x2f85('0x24'),'attributes':{'class':[_0x2f85('0x7')]}}];this['_model']['isExternal']&&_0xb4ace5['push']({'tag':_0x2f85('0x24'),'attributes':{'class':[_0x2f85('0x23')]},'children':[{'text':this[_0x2f85('0x28')]()}]});const _0x1722d7={'tag':_0x2f85('0x24'),'attributes':{'class':[_0x2f85('0x5'),_0x1a1313['if'](_0x2f85('0x3d'),_0x2f85('0x2b')),_0x1a1313['to']('type',_0x3a0128=>_0x2f85('0x21')+_0x3a0128),this[_0x2f85('0x32')][_0x2f85('0x38')]&&_0x2f85('0x49')],'data-suggestion-id':this[_0x2f85('0x4')]['id'],'data-thread-id':this[_0x2f85('0x4')][_0x2f85('0x1a')]['id'],'data-author-id':this[_0x2f85('0x4')]['author']['id'],'tabindex':-0x1},'children':[{'tag':_0x2f85('0x24'),'attributes':{'class':[_0x2f85('0x4d'),_0x2f85('0x41')]},'children':[this[_0x2f85('0x31')],{'tag':'div','attributes':{'class':['ck-suggestion__main',_0x2f85('0xf')]},'children':_0xb4ace5}]}]};return this['commentsListView']&&this[_0x2f85('0x1e')]&&_0x1722d7['children'][_0x2f85('0xd')](this[_0x2f85('0x2d')],this[_0x2f85('0x1e')]),_0x1722d7;}[_0x2f85('0x6')](){super[_0x2f85('0x6')](),this['_descriptionElement']=this[_0x2f85('0x10')][_0x2f85('0x20')](_0x2f85('0x3c')),this[_0x2f85('0x2')][_0x2f85('0x40')]=this[_0x2f85('0x8')],this['on'](_0x2f85('0x3f'),(_0x2c3e2d,_0x4ee725,_0x2e1df8)=>{this['_descriptionElement'][_0x2f85('0x40')]=_0x2e1df8;});}[_0x2f85('0x50')](_0x2af5e5,_0x110f5b,_0xa27ecd,_0x4fca2e,_0x3cb709){const _0x4f007f=new _0x2674b2(this[_0x2f85('0x3e')]);return _0x4f007f[_0x2f85('0x39')]({'label':_0x2af5e5,'icon':_0x110f5b,'tooltip':!0x0,'tooltipPosition':_0x3cb709}),_0x4f007f[_0x2f85('0x1')]({'attributes':{'class':_0xa27ecd}}),_0x4f007f['on'](_0x2f85('0x3'),()=>{this['fire'](_0x4fca2e,this[_0x2f85('0x4')]['id']);}),_0x4f007f;}['getExternalSuggestionNote'](){return _0x2f85('0x16')===this[_0x2f85('0x4')][_0x2f85('0x34')][_0x2f85('0x51')][_0x2f85('0x22')]?_0x4fa08f(this[_0x2f85('0x3e')],_0x2f85('0x36')):_0x4fa08f(this[_0x2f85('0x3e')],_0x2f85('0xa'));}[_0x2f85('0x25')](){return this[_0x2f85('0x4')][_0x2f85('0x2f')]?_0x2f85('0x16')===this['_model'][_0x2f85('0x34')][_0x2f85('0x51')][_0x2f85('0x22')]?_0x4fa08f(this[_0x2f85('0x3e')],_0x2f85('0x27'),this[_0x2f85('0x4')][_0x2f85('0x48')][_0x2f85('0x4f')]):_0x4fa08f(this[_0x2f85('0x3e')],_0x2f85('0x11'),this[_0x2f85('0x4')][_0x2f85('0x48')]['name']):null;}}function ns(_0x2575cb,_0x445ec2){let _0x5c7ca9='';return _0x5c7ca9+=_0x2575cb['split']('*')[_0x2f85('0x12')]((_0x2af999,_0x5c2304)=>_0x5c2304%0x2!=0x0?'<span\x20class=\x22ck-suggestion-type\x22>'+os(_0x2af999)+_0x2f85('0x4c'):os(_0x2af999))[_0x2f85('0x44')](''),_0x445ec2&&(_0x5c7ca9+=_0x2f85('0x14')+_0x445ec2[_0x2f85('0x29')]+_0x2f85('0x0')+_0x445ec2[_0x2f85('0x46')]+'\x22></span>'),_0x5c7ca9;}function os(_0x282bc0){const _0x3856bc=document[_0x2f85('0x9')](_0x2f85('0x2e'));return _0x3856bc[_0x2f85('0xc')]=_0x282bc0,_0x3856bc[_0x2f85('0x40')];}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @module track-changes/utils/common-translations
3
+ */
4
+ import { type Locale } from 'ckeditor5/src/utils';
5
+ export declare function getTranslation(locale: Locale, id: string, values?: number | string | ReadonlyArray<number | string>): string;
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export function getTranslation(_0x2c908c,_0x3d6105,_0x228b04){const t=_0x2c908c['t'];switch(_0x3d6105){case'Track\x20changes':return t('Track\x20changes');case'Accept\x20suggestion':return t('Accept\x20suggestion');case'Discard\x20suggestion':return t('Discard\x20suggestion');case'Accept\x20all\x20suggestions':return t('Accept\x20all\x20suggestions');case'Accept\x20all\x20selected\x20suggestions':return t('Accept\x20all\x20selected\x20suggestions');case'Discard\x20all\x20suggestions':return t('Discard\x20all\x20suggestions');case'Discard\x20all\x20selected\x20suggestions':return t('Discard\x20all\x20selected\x20suggestions');case'*Reset\x20font\x20size*':return t('*Reset\x20font\x20size*');case'*Reset\x20font\x20family*':return t('*Reset\x20font\x20family*');case'*Reset\x20font\x20color*':return t('*Reset\x20font\x20color*');case'*Reset\x20font\x20background\x20color*':return t('*Reset\x20font\x20background\x20color*');case'*Remove\x20image\x20text\x20alternative*':return t('*Remove\x20image\x20text\x20alternative*');case'*Reset\x20image\x20width*':return t('*Reset\x20image\x20width*');case'*Remove\x20link*':return t('*Remove\x20link*');case'*Check\x20item*':return t('*Check\x20item*');case'*Uncheck\x20item*':return t('*Uncheck\x20item*');case'*Remove\x20all\x20formatting*':return t('*Remove\x20all\x20formatting*');case'*Replace\x20table\x20cells*':return t('*Replace\x20table\x20cells*');case'*Merge\x20cells*':return t('*Merge\x20cells*');case'*Split\x20cell:*\x20vertically':return t('*Split\x20cell:*\x20vertically');case'*Split\x20cell:*\x20horizontally':return t('*Split\x20cell:*\x20horizontally');case'*Indent:*\x20%0':return t('*Indent:*\x20%0',_0x228b04);case'*Outdent:*\x20%0':return t('*Outdent:*\x20%0',_0x228b04);case'*Change\x20to:*\x20%0':return t('*Change\x20to:*\x20%0',_0x228b04);case'*Insert:*\x20%0':return t('*Insert:*\x20%0',_0x228b04);case'*Format:*\x20%0':return t('*Format:*\x20%0',_0x228b04);case'*Format:*\x20change\x20table\x20properties':return t('*Format:*\x20change\x20table\x20properties');case'*Format:*\x20change\x20table\x20cell\x20properties':return t('*Format:*\x20change\x20table\x20cell\x20properties');case'*Format:*\x20insert\x20into\x20%0':return t('*Format:*\x20insert\x20into\x20%0',_0x228b04);case'*Format:*\x20remove\x20from\x20%0':return t('*Format:*\x20remove\x20from\x20%0',_0x228b04);case'*Format:*\x20replace\x20image\x20URL':return t('*Format:*\x20replace\x20image\x20URL');case'*Format:*\x20resize\x20table':return t('*Format:*\x20resize\x20table');case'*Format:*\x20set\x20order\x20to\x20reversed':return t('*Format:*\x20set\x20order\x20to\x20reversed');case'*Format:*\x20set\x20order\x20to\x20regular':return t('*Format:*\x20set\x20order\x20to\x20regular');case'*Format:*\x20set\x20start\x20index\x20to\x20%0':return t('*Format:*\x20set\x20start\x20index\x20to\x20%0',_0x228b04);case'*Change\x20%0\x20content*':return t('*Change\x20%0\x20content*',_0x228b04);case'*Remove:*\x20%0':return t('*Remove:*\x20%0',_0x228b04);case'*Merge:*\x20%0':return t('*Merge:*\x20%0',_0x228b04);case'*Split:*\x20%0':return t('*Split:*\x20%0',_0x228b04);case'*Remove\x20format:*\x20%0':return t('*Remove\x20format:*\x20%0',_0x228b04);case'*Set\x20font\x20size:*\x20%0':return t('*Set\x20font\x20size:*\x20%0',_0x228b04);case'*Set\x20font\x20family:*\x20%0':return t('*Set\x20font\x20family:*\x20%0',_0x228b04);case'*Set\x20font\x20color:*\x20%0':return t('*Set\x20font\x20color:*\x20%0',_0x228b04);case'*Set\x20font\x20background\x20color:*\x20%0':return t('*Set\x20font\x20background\x20color:*\x20%0',_0x228b04);case'*Set\x20image\x20text\x20alternative:*\x20%0':return t('*Set\x20image\x20text\x20alternative:*\x20%0',_0x228b04);case'*Set\x20image\x20width:*\x20%0':return t('*Set\x20image\x20width:*\x20%0',_0x228b04);case'*Set\x20link:*\x20%0':return t('*Set\x20link:*\x20%0',_0x228b04);case'*Set\x20highlight:*\x20%0':return t('*Set\x20highlight:*\x20%0',_0x228b04);case'*Remove\x20highlight*':return t('*Remove\x20highlight*');case'FORMAT_HIGHLIGHT':return t({'string':'highlight','id':'FORMAT_HIGHLIGHT'});case'FORMAT_RESTRICTED_ENABLED':return t({'string':'*Enable\x20in\x20restricted\x20editing\x20mode*','id':'FORMAT_RESTRICTED_ENABLED'});case'FORMAT_RESTRICTED_DISABLED':return t({'string':'*Disable\x20in\x20restricted\x20editing\x20mode*','id':'FORMAT_RESTRICTED_DISABLED'});case'ELEMENT_TABLE':return t({'string':'table','plural':'%0\x20tables','id':'ELEMENT_TABLE'},_0x228b04);case'ELEMENT_PARAGRAPH':return t({'string':'paragraph','plural':'%0\x20paragraphs','id':'ELEMENT_PARAGRAPH'},_0x228b04);case'ELEMENT_PAGE_BREAK':return t({'string':'page\x20break','plural':'%0\x20page\x20breaks','id':'ELEMENT_PAGE_BREAK'},_0x228b04);case'ELEMENT_MEDIA':return t({'string':'media\x20item','plural':'%0\x20media\x20items','id':'ELEMENT_MEDIA'},_0x228b04);case'ELEMENT_IMAGE':return t({'string':'image','plural':'%0\x20images','id':'ELEMENT_IMAGE'},_0x228b04);case'ELEMENT_INLINE_IMAGE':return t({'string':'image','plural':'%0\x20images','id':'ELEMENT_INLINE_IMAGE'},_0x228b04);case'FORMAT_SIDE_IMAGE':return t({'string':'side\x20image','id':'FORMAT_SIDE_IMAGE'});case'ELEMENT_CAPTION':return t({'string':'caption','id':'ELEMENT_CAPTION'});case'ELEMENT_HORIZONTAL_LINE':return t({'string':'horizontal\x20line','plural':'%0\x20horizontal\x20lines','id':'ELEMENT_HORIZONTAL_LINE'},_0x228b04);case'ELEMENT_HTML_EMBED':return t({'string':'HTML\x20embed','plural':'%0\x20HTML\x20embeds','id':'ELEMENT_HTML_EMBED'},_0x228b04);case'ELEMENT_HEADING':return t({'string':'heading\x20(level\x20%1)','plural':'%0\x20headings\x20(level\x20%1)','id':'ELEMENT_HEADING'},_0x228b04);case'ELEMENT_HEADING_CUSTOM':return t({'string':'heading\x20(%1)','plural':'%0\x20headings\x20(%1)','id':'ELEMENT_HEADING_CUSTOM'},_0x228b04);case'ELEMENT_LIST_ITEM':return t({'string':'list\x20item','plural':'%0\x20list\x20items','id':'ELEMENT_LIST_ITEM'},_0x228b04);case'ELEMENT_BULLETED_LIST':return t({'string':'bulleted\x20list','id':'ELEMENT_BULLETED_LIST'});case'ELEMENT_BULLETED_LIST_CIRCLE':return t({'string':'bulleted\x20list\x20(circle)','id':'ELEMENT_BULLETED_LIST_CIRCLE'});case'ELEMENT_BULLETED_LIST_DISC':return t({'string':'bulleted\x20list\x20(disc)','id':'ELEMENT_BULLETED_LIST_DISC'});case'ELEMENT_BULLETED_LIST_SQUARE':return t({'string':'bulleted\x20list\x20(square)','id':'ELEMENT_BULLETED_LIST_SQUARE'});case'ELEMENT_NUMBERED_LIST':return t({'string':'numbered\x20list','id':'ELEMENT_NUMBERED_LIST'});case'ELEMENT_NUMBERED_LIST_DECIMAL':return t({'string':'numbered\x20list\x20(decimal)','id':'ELEMENT_NUMBERED_LIST_DECIMAL'});case'ELEMENT_NUMBERED_LIST_DECIMAL_LEADING_ZERO':return t({'string':'numbered\x20list\x20(decimal\x20with\x20leading\x20zero)','id':'ELEMENT_NUMBERED_LIST_DECIMAL_LEADING_ZERO'});case'ELEMENT_NUMBERED_LIST_LOWER_LATIN':return t({'string':'numbered\x20list\x20(lower-latin)','id':'ELEMENT_NUMBERED_LIST_LOWER_LATIN'});case'ELEMENT_NUMBERED_LIST_LOWER_ROMAN':return t({'string':'numbered\x20list\x20(lower-roman)','id':'ELEMENT_NUMBERED_LIST_LOWER_ROMAN'});case'ELEMENT_NUMBERED_LIST_UPPER_LATIN':return t({'string':'numbered\x20list\x20(upper-latin)','id':'ELEMENT_NUMBERED_LIST_UPPER_LATIN'});case'ELEMENT_NUMBERED_LIST_UPPER_ROMAN':return t({'string':'numbered\x20list\x20(upper-roman)','id':'ELEMENT_NUMBERED_LIST_UPPER_ROMAN'});case'ELEMENT_TODO_LIST':return t({'string':'to-do\x20list','id':'ELEMENT_TODO_LIST'});case'REPLACE_TEXT':return t({'string':'*Replace:*\x20%0\x20*with*\x20%1','id':'REPLACE_TEXT'},_0x228b04);case'ELEMENT_SPACE':return t({'string':'space','plural':'%0\x20spaces','id':'ELEMENT_SPACE'},_0x228b04);case'FORMAT_ALIGN_TO_LEFT':return t({'string':'align\x20to\x20left','id':'FORMAT_ALIGN_TO_LEFT'});case'FORMAT_ALIGN_TO_RIGHT':return t({'string':'align\x20to\x20right','id':'FORMAT_ALIGN_TO_RIGHT'});case'FORMAT_ALIGN_TO_CENTER':return t({'string':'align\x20to\x20center','id':'FORMAT_ALIGN_TO_CENTER'});case'FORMAT_JUSTIFY_TEXT':return t({'string':'justify','id':'FORMAT_JUSTIFY_TEXT'});case'FORMAT_BOLD':return t({'string':'bold','id':'FORMAT_BOLD'});case'FORMAT_ITALIC':return t({'string':'italic','id':'FORMAT_ITALIC'});case'FORMAT_UNDERLINE':return t({'string':'underline','id':'FORMAT_UNDERLINE'});case'FORMAT_CODE':return t({'string':'code','id':'FORMAT_CODE'});case'FORMAT_STRIKETHROUGH':return t({'string':'strikethrough','id':'FORMAT_STRIKETHROUGH'});case'FORMAT_SUBSCRIPT':return t({'string':'subscript','id':'FORMAT_SUBSCRIPT'});case'FORMAT_SUPERSCRIPT':return t({'string':'superscript','id':'FORMAT_SUPERSCRIPT'});case'ELEMENT_BLOCK_QUOTE':return t({'string':'block\x20quote','id':'ELEMENT_BLOCK_QUOTE'});case'ELEMENT_CODE_BLOCK':return t({'string':'code\x20block','plural':'%0\x20code\x20blocks','id':'ELEMENT_CODE_BLOCK'},_0x228b04);case'FORMAT_HEADER_COLUMN':return t({'string':'header\x20column','id':'FORMAT_HEADER_COLUMN'});case'FORMAT_REGULAR_COLUMN':return t({'string':'regular\x20column','id':'FORMAT_REGULAR_COLUMN'});case'FORMAT_HEADER_ROW':return t({'string':'header\x20row','id':'FORMAT_HEADER_ROW'});case'FORMAT_REGULAR_ROW':return t({'string':'regular\x20row','id':'FORMAT_REGULAR_ROW'});case'PENDING_ACTION_SUGGESTION':return t({'string':'Unsaved\x20change\x20in\x20suggestion.','id':'PENDING_ACTION_SUGGESTION'});case'ELEMENT_TABLE_WITH_TEXT':return t({'string':'table\x20*with\x20text*\x20%0','id':'ELEMENT_TABLE_WITH_TEXT'},_0x228b04);case'ELEMENT_TABLE_ROW':return t({'string':'table\x20row','plural':'%0\x20table\x20rows','id':'ELEMENT_TABLE_ROW'},_0x228b04);case'ELEMENT_TABLE_ROW_WITH_TEXT':return t({'string':'table\x20row\x20*with\x20text*\x20%1','plural':'%0\x20table\x20rows\x20*with\x20text*\x20%1','id':'ELEMENT_TABLE_ROW_WITH_TEXT'},_0x228b04);case'ELEMENT_TABLE_COLUMN':return t({'string':'table\x20column','plural':'%0\x20table\x20columns','id':'ELEMENT_TABLE_COLUMN'},_0x228b04);case'ELEMENT_TABLE_COLUMN_WITH_TEXT':return t({'string':'table\x20column\x20*with\x20text*\x20%1','plural':'%0\x20table\x20columns\x20*with\x20text*\x20%1','id':'ELEMENT_TABLE_COLUMN_WITH_TEXT'},_0x228b04);case'ELEMENT_LINE_BREAK':return t({'id':'ELEMENT_LINE_BREAK','string':'line\x20break','plural':'%0\x20line\x20breaks'},_0x228b04);case'ELEMENT_TITLE':return t({'id':'ELEMENT_TITLE','string':'title'});case'EXTERNAL_SUGGESTION':return t({'id':'EXTERNAL_SUGGESTION','string':'This\x20suggestion\x20comes\x20from\x20an\x20external\x20source.'});case'EXTERNAL_IMPORT_WORD_SUGGESTION':return t({'string':'This\x20suggestion\x20comes\x20from\x20an\x20imported\x20Word\x20file.','id':'EXTERNAL_IMPORT_WORD_SUGGESTION'});case'EXTERNAL_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20external\x20source\x20(added\x20by\x20%0)','id':'EXTERNAL_AVATAR'},_0x228b04);case'EXTERNAL_IMPORT_WORD_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20a\x20Word\x20document\x20imported\x20by\x20%0','id':'EXTERNAL_IMPORT_WORD_AVATAR'},_0x228b04);}}
23
+ export function getTranslation(_0x523604,_0x5bdbd5,_0xd50920){const t=_0x523604['t'];switch(_0x5bdbd5){case'Track\x20changes':return t('Track\x20changes');case'Accept\x20suggestion':return t('Accept\x20suggestion');case'Discard\x20suggestion':return t('Discard\x20suggestion');case'Accept\x20all\x20suggestions':return t('Accept\x20all\x20suggestions');case'Accept\x20all\x20selected\x20suggestions':return t('Accept\x20all\x20selected\x20suggestions');case'Discard\x20all\x20suggestions':return t('Discard\x20all\x20suggestions');case'Discard\x20all\x20selected\x20suggestions':return t('Discard\x20all\x20selected\x20suggestions');case'*Reset\x20font\x20size*':return t('*Reset\x20font\x20size*');case'*Reset\x20font\x20family*':return t('*Reset\x20font\x20family*');case'*Reset\x20font\x20color*':return t('*Reset\x20font\x20color*');case'*Reset\x20font\x20background\x20color*':return t('*Reset\x20font\x20background\x20color*');case'*Remove\x20image\x20text\x20alternative*':return t('*Remove\x20image\x20text\x20alternative*');case'*Reset\x20image\x20width*':return t('*Reset\x20image\x20width*');case'*Remove\x20link*':return t('*Remove\x20link*');case'*Check\x20item*':return t('*Check\x20item*');case'*Uncheck\x20item*':return t('*Uncheck\x20item*');case'*Remove\x20all\x20formatting*':return t('*Remove\x20all\x20formatting*');case'*Replace\x20table\x20cells*':return t('*Replace\x20table\x20cells*');case'*Merge\x20cells*':return t('*Merge\x20cells*');case'*Split\x20cell:*\x20vertically':return t('*Split\x20cell:*\x20vertically');case'*Split\x20cell:*\x20horizontally':return t('*Split\x20cell:*\x20horizontally');case'*Indent:*\x20%0':return t('*Indent:*\x20%0',_0xd50920);case'*Outdent:*\x20%0':return t('*Outdent:*\x20%0',_0xd50920);case'*Change\x20to:*\x20%0':return t('*Change\x20to:*\x20%0',_0xd50920);case'*Insert:*\x20%0':return t('*Insert:*\x20%0',_0xd50920);case'*Format:*\x20%0':return t('*Format:*\x20%0',_0xd50920);case'*Format:*\x20change\x20table\x20properties':return t('*Format:*\x20change\x20table\x20properties');case'*Format:*\x20change\x20table\x20cell\x20properties':return t('*Format:*\x20change\x20table\x20cell\x20properties');case'*Format:*\x20insert\x20into\x20%0':return t('*Format:*\x20insert\x20into\x20%0',_0xd50920);case'*Format:*\x20remove\x20from\x20%0':return t('*Format:*\x20remove\x20from\x20%0',_0xd50920);case'*Format:*\x20replace\x20image\x20URL':return t('*Format:*\x20replace\x20image\x20URL');case'*Format:*\x20resize\x20table':return t('*Format:*\x20resize\x20table');case'*Format:*\x20set\x20order\x20to\x20reversed':return t('*Format:*\x20set\x20order\x20to\x20reversed');case'*Format:*\x20set\x20order\x20to\x20regular':return t('*Format:*\x20set\x20order\x20to\x20regular');case'*Format:*\x20set\x20start\x20index\x20to\x20%0':return t('*Format:*\x20set\x20start\x20index\x20to\x20%0',_0xd50920);case'*Change\x20%0\x20content*':return t('*Change\x20%0\x20content*',_0xd50920);case'*Remove:*\x20%0':return t('*Remove:*\x20%0',_0xd50920);case'*Merge:*\x20%0':return t('*Merge:*\x20%0',_0xd50920);case'*Split:*\x20%0':return t('*Split:*\x20%0',_0xd50920);case'*Remove\x20format:*\x20%0':return t('*Remove\x20format:*\x20%0',_0xd50920);case'*Set\x20font\x20size:*\x20%0':return t('*Set\x20font\x20size:*\x20%0',_0xd50920);case'*Set\x20font\x20family:*\x20%0':return t('*Set\x20font\x20family:*\x20%0',_0xd50920);case'*Set\x20font\x20color:*\x20%0':return t('*Set\x20font\x20color:*\x20%0',_0xd50920);case'*Set\x20font\x20background\x20color:*\x20%0':return t('*Set\x20font\x20background\x20color:*\x20%0',_0xd50920);case'*Set\x20image\x20text\x20alternative:*\x20%0':return t('*Set\x20image\x20text\x20alternative:*\x20%0',_0xd50920);case'*Set\x20image\x20width:*\x20%0':return t('*Set\x20image\x20width:*\x20%0',_0xd50920);case'*Set\x20link:*\x20%0':return t('*Set\x20link:*\x20%0',_0xd50920);case'*Set\x20highlight:*\x20%0':return t('*Set\x20highlight:*\x20%0',_0xd50920);case'*Remove\x20highlight*':return t('*Remove\x20highlight*');case'FORMAT_HIGHLIGHT':return t({'string':'highlight','id':'FORMAT_HIGHLIGHT'});case'FORMAT_RESTRICTED_ENABLED':return t({'string':'*Enable\x20in\x20restricted\x20editing\x20mode*','id':'FORMAT_RESTRICTED_ENABLED'});case'FORMAT_RESTRICTED_DISABLED':return t({'string':'*Disable\x20in\x20restricted\x20editing\x20mode*','id':'FORMAT_RESTRICTED_DISABLED'});case'ELEMENT_TABLE':return t({'string':'table','plural':'%0\x20tables','id':'ELEMENT_TABLE'},_0xd50920);case'ELEMENT_PARAGRAPH':return t({'string':'paragraph','plural':'%0\x20paragraphs','id':'ELEMENT_PARAGRAPH'},_0xd50920);case'ELEMENT_PAGE_BREAK':return t({'string':'page\x20break','plural':'%0\x20page\x20breaks','id':'ELEMENT_PAGE_BREAK'},_0xd50920);case'ELEMENT_MEDIA':return t({'string':'media\x20item','plural':'%0\x20media\x20items','id':'ELEMENT_MEDIA'},_0xd50920);case'ELEMENT_IMAGE':return t({'string':'image','plural':'%0\x20images','id':'ELEMENT_IMAGE'},_0xd50920);case'ELEMENT_INLINE_IMAGE':return t({'string':'image','plural':'%0\x20images','id':'ELEMENT_INLINE_IMAGE'},_0xd50920);case'FORMAT_SIDE_IMAGE':return t({'string':'side\x20image','id':'FORMAT_SIDE_IMAGE'});case'ELEMENT_CAPTION':return t({'string':'caption','id':'ELEMENT_CAPTION'});case'ELEMENT_HORIZONTAL_LINE':return t({'string':'horizontal\x20line','plural':'%0\x20horizontal\x20lines','id':'ELEMENT_HORIZONTAL_LINE'},_0xd50920);case'ELEMENT_HTML_EMBED':return t({'string':'HTML\x20embed','plural':'%0\x20HTML\x20embeds','id':'ELEMENT_HTML_EMBED'},_0xd50920);case'ELEMENT_HEADING':return t({'string':'heading\x20(level\x20%1)','plural':'%0\x20headings\x20(level\x20%1)','id':'ELEMENT_HEADING'},_0xd50920);case'ELEMENT_HEADING_CUSTOM':return t({'string':'heading\x20(%1)','plural':'%0\x20headings\x20(%1)','id':'ELEMENT_HEADING_CUSTOM'},_0xd50920);case'ELEMENT_LIST_ITEM':return t({'string':'list\x20item','plural':'%0\x20list\x20items','id':'ELEMENT_LIST_ITEM'},_0xd50920);case'ELEMENT_BULLETED_LIST':return t({'string':'bulleted\x20list','id':'ELEMENT_BULLETED_LIST'});case'ELEMENT_BULLETED_LIST_CIRCLE':return t({'string':'bulleted\x20list\x20(circle)','id':'ELEMENT_BULLETED_LIST_CIRCLE'});case'ELEMENT_BULLETED_LIST_DISC':return t({'string':'bulleted\x20list\x20(disc)','id':'ELEMENT_BULLETED_LIST_DISC'});case'ELEMENT_BULLETED_LIST_SQUARE':return t({'string':'bulleted\x20list\x20(square)','id':'ELEMENT_BULLETED_LIST_SQUARE'});case'ELEMENT_NUMBERED_LIST':return t({'string':'numbered\x20list','id':'ELEMENT_NUMBERED_LIST'});case'ELEMENT_NUMBERED_LIST_DECIMAL':return t({'string':'numbered\x20list\x20(decimal)','id':'ELEMENT_NUMBERED_LIST_DECIMAL'});case'ELEMENT_NUMBERED_LIST_DECIMAL_LEADING_ZERO':return t({'string':'numbered\x20list\x20(decimal\x20with\x20leading\x20zero)','id':'ELEMENT_NUMBERED_LIST_DECIMAL_LEADING_ZERO'});case'ELEMENT_NUMBERED_LIST_LOWER_LATIN':return t({'string':'numbered\x20list\x20(lower-latin)','id':'ELEMENT_NUMBERED_LIST_LOWER_LATIN'});case'ELEMENT_NUMBERED_LIST_LOWER_ROMAN':return t({'string':'numbered\x20list\x20(lower-roman)','id':'ELEMENT_NUMBERED_LIST_LOWER_ROMAN'});case'ELEMENT_NUMBERED_LIST_UPPER_LATIN':return t({'string':'numbered\x20list\x20(upper-latin)','id':'ELEMENT_NUMBERED_LIST_UPPER_LATIN'});case'ELEMENT_NUMBERED_LIST_UPPER_ROMAN':return t({'string':'numbered\x20list\x20(upper-roman)','id':'ELEMENT_NUMBERED_LIST_UPPER_ROMAN'});case'ELEMENT_TODO_LIST':return t({'string':'to-do\x20list','id':'ELEMENT_TODO_LIST'});case'REPLACE_TEXT':return t({'string':'*Replace:*\x20%0\x20*with*\x20%1','id':'REPLACE_TEXT'},_0xd50920);case'ELEMENT_SPACE':return t({'string':'space','plural':'%0\x20spaces','id':'ELEMENT_SPACE'},_0xd50920);case'FORMAT_ALIGN_TO_LEFT':return t({'string':'align\x20to\x20left','id':'FORMAT_ALIGN_TO_LEFT'});case'FORMAT_ALIGN_TO_RIGHT':return t({'string':'align\x20to\x20right','id':'FORMAT_ALIGN_TO_RIGHT'});case'FORMAT_ALIGN_TO_CENTER':return t({'string':'align\x20to\x20center','id':'FORMAT_ALIGN_TO_CENTER'});case'FORMAT_JUSTIFY_TEXT':return t({'string':'justify','id':'FORMAT_JUSTIFY_TEXT'});case'FORMAT_BOLD':return t({'string':'bold','id':'FORMAT_BOLD'});case'FORMAT_ITALIC':return t({'string':'italic','id':'FORMAT_ITALIC'});case'FORMAT_UNDERLINE':return t({'string':'underline','id':'FORMAT_UNDERLINE'});case'FORMAT_CODE':return t({'string':'code','id':'FORMAT_CODE'});case'FORMAT_STRIKETHROUGH':return t({'string':'strikethrough','id':'FORMAT_STRIKETHROUGH'});case'FORMAT_SUBSCRIPT':return t({'string':'subscript','id':'FORMAT_SUBSCRIPT'});case'FORMAT_SUPERSCRIPT':return t({'string':'superscript','id':'FORMAT_SUPERSCRIPT'});case'ELEMENT_BLOCK_QUOTE':return t({'string':'block\x20quote','id':'ELEMENT_BLOCK_QUOTE'});case'ELEMENT_CODE_BLOCK':return t({'string':'code\x20block','plural':'%0\x20code\x20blocks','id':'ELEMENT_CODE_BLOCK'},_0xd50920);case'FORMAT_HEADER_COLUMN':return t({'string':'header\x20column','id':'FORMAT_HEADER_COLUMN'});case'FORMAT_REGULAR_COLUMN':return t({'string':'regular\x20column','id':'FORMAT_REGULAR_COLUMN'});case'FORMAT_HEADER_ROW':return t({'string':'header\x20row','id':'FORMAT_HEADER_ROW'});case'FORMAT_REGULAR_ROW':return t({'string':'regular\x20row','id':'FORMAT_REGULAR_ROW'});case'PENDING_ACTION_SUGGESTION':return t({'string':'Unsaved\x20change\x20in\x20suggestion.','id':'PENDING_ACTION_SUGGESTION'});case'ELEMENT_TABLE_WITH_TEXT':return t({'string':'table\x20*with\x20text*\x20%0','id':'ELEMENT_TABLE_WITH_TEXT'},_0xd50920);case'ELEMENT_TABLE_ROW':return t({'string':'table\x20row','plural':'%0\x20table\x20rows','id':'ELEMENT_TABLE_ROW'},_0xd50920);case'ELEMENT_TABLE_ROW_WITH_TEXT':return t({'string':'table\x20row\x20*with\x20text*\x20%1','plural':'%0\x20table\x20rows\x20*with\x20text*\x20%1','id':'ELEMENT_TABLE_ROW_WITH_TEXT'},_0xd50920);case'ELEMENT_TABLE_COLUMN':return t({'string':'table\x20column','plural':'%0\x20table\x20columns','id':'ELEMENT_TABLE_COLUMN'},_0xd50920);case'ELEMENT_TABLE_COLUMN_WITH_TEXT':return t({'string':'table\x20column\x20*with\x20text*\x20%1','plural':'%0\x20table\x20columns\x20*with\x20text*\x20%1','id':'ELEMENT_TABLE_COLUMN_WITH_TEXT'},_0xd50920);case'ELEMENT_LINE_BREAK':return t({'id':'ELEMENT_LINE_BREAK','string':'line\x20break','plural':'%0\x20line\x20breaks'},_0xd50920);case'ELEMENT_TITLE':return t({'id':'ELEMENT_TITLE','string':'title'});case'EXTERNAL_SUGGESTION':return t({'id':'EXTERNAL_SUGGESTION','string':'This\x20suggestion\x20comes\x20from\x20an\x20external\x20source.'});case'EXTERNAL_IMPORT_WORD_SUGGESTION':return t({'string':'This\x20suggestion\x20comes\x20from\x20an\x20imported\x20Word\x20file.','id':'EXTERNAL_IMPORT_WORD_SUGGESTION'});case'EXTERNAL_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20external\x20source\x20(added\x20by\x20%0)','id':'EXTERNAL_AVATAR'},_0xd50920);case'EXTERNAL_IMPORT_WORD_AVATAR':return t({'string':'Displayed\x20author\x20name\x20comes\x20from\x20a\x20Word\x20document\x20imported\x20by\x20%0','id':'EXTERNAL_IMPORT_WORD_AVATAR'},_0xd50920);default:return _0x5bdbd5;}}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @module track-changes/utils/utils
3
+ */
4
+ import type { Command } from 'ckeditor5/src/core';
5
+ import type { DocumentSelection, Model } from 'ckeditor5/src/engine';
6
+ import type Suggestion from '../suggestion';
7
+ import type { Description } from '../suggestiondescriptionfactory';
8
+ /**
9
+ * Used in tests for easy suggestion comparison.
10
+ */
11
+ export declare function normalizeDescription(description: Array<Description> | Description): string;
12
+ export declare function sortSuggestions(suggestions: Array<Suggestion>): Array<Suggestion>;
13
+ /**
14
+ * From the list of passed `suggestions` returns those that are selected by given `selection`.
15
+ */
16
+ export declare function getSelectedSuggestions(selection: DocumentSelection, suggestions: Array<Suggestion>): Set<Suggestion>;
17
+ /**
18
+ * How many suggestion actions should be put into one batch when multiple suggestions are accepted or discarded.
19
+ */
20
+ export declare const MAX_SUGGESTION_ACTIONS_IN_BATCH = 100;
21
+ /**
22
+ * Executes given `command` for given `suggestions`. If there is a lot of suggestions, the command executions is split into batches.
23
+ * There is at most `MAX_SUGGESTION_ACTIONS_IN_BATCH` exeuctions in one batch. As a result, this limits number of actions to be done
24
+ * in one undo step but may create multiple undo steps.
25
+ */
26
+ export declare function executeCommandForSuggestions(model: Model, command: Command, suggestions: Array<Suggestion>): void;
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x2823=['createRange','add','deletion','\x20[color\x20','createPositionAfter','length','replace','isMultiRange','isTouching','isArray','createPositionBefore','join','value','end','content','from','isIntersecting','change','getRange','start','sort','type','color','getRanges','createPositionAt','next','splice','isCollapsed'];(function(_0x5790ed,_0x282310){const _0x5e5fda=function(_0x5c3dca){while(--_0x5c3dca){_0x5790ed['push'](_0x5790ed['shift']());}};_0x5e5fda(++_0x282310);}(_0x2823,0x1d4));const _0x5e5f=function(_0x5790ed,_0x282310){_0x5790ed=_0x5790ed-0x0;let _0x5e5fda=_0x2823[_0x5790ed];return _0x5e5fda;};export function normalizeDescription(_0x53d79b){return Array[_0x5e5f('0x11')](_0x53d79b)||(_0x53d79b=[_0x53d79b]),_0x53d79b['map'](_0x5a98c3=>{const _0xce6e50=_0x5a98c3[_0x5e5f('0x16')][_0x5e5f('0xe')](/\*/g,''),_0x5a683a=_0x5a98c3[_0x5e5f('0x2')]?_0x5e5f('0xb')+_0x5a98c3[_0x5e5f('0x2')][_0x5e5f('0x14')]+']':'';return'['+_0x5a98c3['type']+']\x20'+_0xce6e50+_0x5a683a;})[_0x5e5f('0x13')](';\x20');}export function sortSuggestions(_0x30d179){return _0x30d179[_0x5e5f('0x0')]((_0x29e19b,_0x4d5108)=>_0x5e5f('0xa')==_0x29e19b[_0x5e5f('0x1')]&&'deletion'!=_0x4d5108[_0x5e5f('0x1')]?-0x1:_0x5e5f('0xa')!=_0x29e19b[_0x5e5f('0x1')]&&_0x5e5f('0xa')==_0x4d5108[_0x5e5f('0x1')]?0x1:0x0);}export function getSelectedSuggestions(_0x22e4c8,_0x1402d2){const _0x176691=Array[_0x5e5f('0x17')](_0x22e4c8[_0x5e5f('0x3')]()),_0x45f456=new Set();for(const _0x1480fe of _0x1402d2)if(_0x1480fe['isInContent'])for(const _0x3d20b2 of _0x176691)for(const _0x426cb7 of _0x1480fe['getMarkers']()){const _0x462859=_0x426cb7[_0x5e5f('0x1a')]();(_0x3d20b2[_0x5e5f('0x18')](_0x462859)||_0x22e4c8[_0x5e5f('0x7')]&&!_0x1480fe[_0x5e5f('0xf')]&&_0x1480fe[_0x5e5f('0x5')]&&_0x462859[_0x5e5f('0x15')][_0x5e5f('0x10')](_0x3d20b2[_0x5e5f('0x1b')]))&&_0x45f456[_0x5e5f('0x9')](_0x1480fe);}return _0x45f456;}export function getRangesOfBlockGroups(_0x4338cc,_0x4652ee){let _0x277d1a,_0x9ee09=0x0;const _0x510ad1=[],_0xaaade=_0x4652ee['schema'];for(;_0x9ee09<_0x4338cc[_0x5e5f('0xd')];){const _0x490c58=_0x4338cc[_0x9ee09],_0x52c898=_0x4338cc[_0x9ee09+0x1];_0x277d1a||(_0x277d1a=_0x4652ee['createPositionBefore'](_0x490c58)),no(_0x4652ee,_0x490c58,_0x52c898)||(_0x510ad1['push'](_0x4652ee[_0x5e5f('0x8')](_0x277d1a,_0xaaade['isObject'](_0x490c58)?_0x4652ee[_0x5e5f('0xc')](_0x490c58):_0x4652ee[_0x5e5f('0x4')](_0x490c58,_0x5e5f('0x15')))),_0x277d1a=null),_0x9ee09++;}return _0x510ad1;}function no(_0x395457,_0x2246d5,_0x313f72){if(!_0x313f72)return!0x1;const _0x10f0b7=_0x395457[_0x5e5f('0xc')](_0x2246d5),_0x27c704=_0x395457[_0x5e5f('0x12')](_0x313f72);return _0x10f0b7[_0x5e5f('0x10')](_0x27c704);}export const MAX_SUGGESTION_ACTIONS_IN_BATCH=0x64;export function executeCommandForSuggestions(_0x573268,_0x969c92,_0x311cf6){for(;_0x311cf6[_0x5e5f('0xd')];){const _0x14befe=_0x311cf6[_0x5e5f('0x6')](0x0,MAX_SUGGESTION_ACTIONS_IN_BATCH);_0x573268[_0x5e5f('0x19')](()=>{for(const _0x291b1d of _0x14befe)_0x291b1d['isInContent']&&_0x969c92['execute'](_0x291b1d['id']);});}}
23
+ const _0x6bf1=['createRange','isTouching','value','length','type','getRanges','isObject','createPositionAfter','from','getRange','deletion','isMultiRange','isInContent','end','createPositionBefore','color','start','next','getMarkers','add','execute','schema','join','map','\x20[color\x20','isCollapsed','content'];(function(_0x309749,_0x6bf12a){const _0x4bccb2=function(_0x512c98){while(--_0x512c98){_0x309749['push'](_0x309749['shift']());}};_0x4bccb2(++_0x6bf12a);}(_0x6bf1,0x130));const _0x4bcc=function(_0x309749,_0x6bf12a){_0x309749=_0x309749-0x0;let _0x4bccb2=_0x6bf1[_0x309749];return _0x4bccb2;};export function normalizeDescription(_0x5c8d69){return Array['isArray'](_0x5c8d69)||(_0x5c8d69=[_0x5c8d69]),_0x5c8d69[_0x4bcc('0x10')](_0x205519=>{const _0x1a64a2=_0x205519[_0x4bcc('0x13')]['replace'](/\*/g,''),_0x2cb04a=_0x205519[_0x4bcc('0x8')]?_0x4bcc('0x11')+_0x205519[_0x4bcc('0x8')][_0x4bcc('0x16')]+']':'';return'['+_0x205519[_0x4bcc('0x18')]+']\x20'+_0x1a64a2+_0x2cb04a;})[_0x4bcc('0xf')](';\x20');}export function sortSuggestions(_0x274978){return _0x274978['sort']((_0x3b65e8,_0x652e4e)=>_0x4bcc('0x3')==_0x3b65e8[_0x4bcc('0x18')]&&'deletion'!=_0x652e4e['type']?-0x1:_0x4bcc('0x3')!=_0x3b65e8[_0x4bcc('0x18')]&&'deletion'==_0x652e4e[_0x4bcc('0x18')]?0x1:0x0);}export function getSelectedSuggestions(_0x1ad5dc,_0x320eb8){const _0x5d510d=Array[_0x4bcc('0x1')](_0x1ad5dc[_0x4bcc('0x19')]()),_0x4d76c2=new Set();for(const _0x4183a5 of _0x320eb8)if(_0x4183a5[_0x4bcc('0x5')])for(const _0x183d0f of _0x5d510d)for(const _0x313018 of _0x4183a5[_0x4bcc('0xb')]()){const _0x22deb3=_0x313018[_0x4bcc('0x2')]();(_0x183d0f['isIntersecting'](_0x22deb3)||_0x1ad5dc[_0x4bcc('0x12')]&&!_0x4183a5[_0x4bcc('0x4')]&&_0x4183a5[_0x4bcc('0xa')]&&_0x22deb3[_0x4bcc('0x6')][_0x4bcc('0x15')](_0x183d0f[_0x4bcc('0x9')]))&&_0x4d76c2[_0x4bcc('0xc')](_0x4183a5);}return _0x4d76c2;}export function getRangesOfBlockGroups(_0x2be67b,_0x1f5c92){let _0x4c859c,_0x39b556=0x0;const _0x2bb6f9=[],_0x284e1f=_0x1f5c92[_0x4bcc('0xe')];for(;_0x39b556<_0x2be67b[_0x4bcc('0x17')];){const _0x1db959=_0x2be67b[_0x39b556],_0x54fe52=_0x2be67b[_0x39b556+0x1];_0x4c859c||(_0x4c859c=_0x1f5c92[_0x4bcc('0x7')](_0x1db959)),oo(_0x1f5c92,_0x1db959,_0x54fe52)||(_0x2bb6f9['push'](_0x1f5c92[_0x4bcc('0x14')](_0x4c859c,_0x284e1f[_0x4bcc('0x1a')](_0x1db959)?_0x1f5c92['createPositionAfter'](_0x1db959):_0x1f5c92['createPositionAt'](_0x1db959,_0x4bcc('0x6')))),_0x4c859c=null),_0x39b556++;}return _0x2bb6f9;}function oo(_0x3178a3,_0x256373,_0x1cc509){if(!_0x1cc509)return!0x1;const _0x49a456=_0x3178a3[_0x4bcc('0x0')](_0x256373),_0x45485e=_0x3178a3[_0x4bcc('0x7')](_0x1cc509);return _0x49a456['isTouching'](_0x45485e);}export const MAX_SUGGESTION_ACTIONS_IN_BATCH=0x64;export function executeCommandForSuggestions(_0x759f69,_0x15bc0d,_0x50bbe7){for(;_0x50bbe7[_0x4bcc('0x17')];){const _0x3ed523=_0x50bbe7['splice'](0x0,0x64);_0x759f69['change'](()=>{for(const _0x266b92 of _0x3ed523)_0x266b92['isInContent']&&_0x15bc0d[_0x4bcc('0xd')](_0x266b92['id']);});}}