@ckeditor/ckeditor5-track-changes 39.0.1 → 40.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 (185) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/LICENSE.md +6 -6
  3. package/README.md +14 -14
  4. package/build/track-changes.js +1 -1
  5. package/lang/translations/ar.po +1 -0
  6. package/lang/translations/az.po +1 -0
  7. package/lang/translations/bg.po +1 -0
  8. package/lang/translations/bn.po +1 -0
  9. package/lang/translations/ca.po +1 -0
  10. package/lang/translations/cs.po +1 -0
  11. package/lang/translations/da.po +1 -0
  12. package/lang/translations/de.po +1 -0
  13. package/lang/translations/el.po +1 -0
  14. package/lang/translations/en-au.po +1 -0
  15. package/lang/translations/en.po +1 -0
  16. package/lang/translations/es.po +1 -0
  17. package/lang/translations/et.po +1 -0
  18. package/lang/translations/fi.po +1 -0
  19. package/lang/translations/fr.po +1 -0
  20. package/lang/translations/gl.po +1 -0
  21. package/lang/translations/he.po +1 -0
  22. package/lang/translations/hi.po +1 -0
  23. package/lang/translations/hr.po +1 -0
  24. package/lang/translations/hu.po +1 -0
  25. package/lang/translations/id.po +1 -0
  26. package/lang/translations/it.po +1 -0
  27. package/lang/translations/ja.po +1 -0
  28. package/lang/translations/ko.po +1 -0
  29. package/lang/translations/lt.po +1 -0
  30. package/lang/translations/lv.po +1 -0
  31. package/lang/translations/ms.po +1 -0
  32. package/lang/translations/nl.po +1 -0
  33. package/lang/translations/no.po +1 -0
  34. package/lang/translations/pl.po +1 -0
  35. package/lang/translations/pt-br.po +1 -0
  36. package/lang/translations/pt.po +1 -0
  37. package/lang/translations/ro.po +1 -0
  38. package/lang/translations/ru.po +1 -0
  39. package/lang/translations/sk.po +1 -0
  40. package/lang/translations/sq.po +1 -0
  41. package/lang/translations/sr-latn.po +1 -0
  42. package/lang/translations/sr.po +1 -0
  43. package/lang/translations/sv.po +1 -0
  44. package/lang/translations/th.po +1 -0
  45. package/lang/translations/tk.po +1 -0
  46. package/lang/translations/tr.po +1 -0
  47. package/lang/translations/tt.po +1 -0
  48. package/lang/translations/uk.po +1 -0
  49. package/lang/translations/ur.po +1 -0
  50. package/lang/translations/vi.po +1 -0
  51. package/lang/translations/zh-cn.po +1 -0
  52. package/lang/translations/zh.po +1 -0
  53. package/package.json +3 -7
  54. package/src/augmentation.d.ts +40 -40
  55. package/src/commands/acceptsuggestioncommand.d.ts +24 -24
  56. package/src/commands/acceptsuggestioncommand.js +1 -1
  57. package/src/commands/discardsuggestioncommand.d.ts +24 -24
  58. package/src/commands/discardsuggestioncommand.js +1 -1
  59. package/src/commands/executeonallsuggestionscommand.d.ts +24 -24
  60. package/src/commands/executeonallsuggestionscommand.js +1 -1
  61. package/src/commands/executeonselectedsuggestionscommand.d.ts +24 -24
  62. package/src/commands/executeonselectedsuggestionscommand.js +1 -1
  63. package/src/commands/trackchangescommand.d.ts +26 -26
  64. package/src/commands/trackchangescommand.js +1 -1
  65. package/src/index.d.ts +16 -16
  66. package/src/integrations/aiassistant.d.ts +17 -0
  67. package/src/integrations/aiassistant.js +23 -0
  68. package/src/integrations/alignment.d.ts +17 -17
  69. package/src/integrations/alignment.js +1 -1
  70. package/src/integrations/basicstyles.d.ts +17 -17
  71. package/src/integrations/basicstyles.js +1 -1
  72. package/src/integrations/blockquote.d.ts +17 -17
  73. package/src/integrations/blockquote.js +1 -1
  74. package/src/integrations/ckbox.d.ts +17 -17
  75. package/src/integrations/ckbox.js +1 -1
  76. package/src/integrations/codeblock.d.ts +17 -17
  77. package/src/integrations/codeblock.js +1 -1
  78. package/src/integrations/comments.d.ts +14 -14
  79. package/src/integrations/comments.js +1 -1
  80. package/src/integrations/deletecommand.d.ts +17 -17
  81. package/src/integrations/deletecommand.js +1 -1
  82. package/src/integrations/documentlist.d.ts +17 -17
  83. package/src/integrations/documentlist.js +1 -1
  84. package/src/integrations/documentlistproperties.d.ts +29 -29
  85. package/src/integrations/documentlistproperties.js +1 -1
  86. package/src/integrations/entercommand.d.ts +16 -16
  87. package/src/integrations/entercommand.js +1 -1
  88. package/src/integrations/findandreplace.d.ts +21 -21
  89. package/src/integrations/findandreplace.js +1 -1
  90. package/src/integrations/font.d.ts +17 -17
  91. package/src/integrations/font.js +1 -1
  92. package/src/integrations/formatpainter.d.ts +17 -17
  93. package/src/integrations/formatpainter.js +1 -1
  94. package/src/integrations/heading.d.ts +17 -17
  95. package/src/integrations/heading.js +1 -1
  96. package/src/integrations/highlight.d.ts +17 -17
  97. package/src/integrations/highlight.js +1 -1
  98. package/src/integrations/horizontalline.d.ts +17 -17
  99. package/src/integrations/horizontalline.js +1 -1
  100. package/src/integrations/htmlembed.d.ts +17 -17
  101. package/src/integrations/htmlembed.js +1 -1
  102. package/src/integrations/image.d.ts +17 -17
  103. package/src/integrations/image.js +1 -1
  104. package/src/integrations/imagereplace.d.ts +23 -23
  105. package/src/integrations/imagereplace.js +1 -1
  106. package/src/integrations/importword.d.ts +18 -18
  107. package/src/integrations/importword.js +1 -1
  108. package/src/integrations/indent.d.ts +17 -17
  109. package/src/integrations/indent.js +1 -1
  110. package/src/integrations/inputcommand.d.ts +16 -16
  111. package/src/integrations/inputcommand.js +1 -1
  112. package/src/integrations/link.d.ts +17 -17
  113. package/src/integrations/link.js +1 -1
  114. package/src/integrations/list.d.ts +17 -17
  115. package/src/integrations/list.js +1 -1
  116. package/src/integrations/listproperties.d.ts +29 -29
  117. package/src/integrations/listproperties.js +1 -1
  118. package/src/integrations/mediaembed.d.ts +17 -17
  119. package/src/integrations/mediaembed.js +1 -1
  120. package/src/integrations/mention.d.ts +17 -17
  121. package/src/integrations/mention.js +1 -1
  122. package/src/integrations/pagebreak.d.ts +17 -17
  123. package/src/integrations/pagebreak.js +1 -1
  124. package/src/integrations/paragraph.d.ts +17 -17
  125. package/src/integrations/paragraph.js +1 -1
  126. package/src/integrations/removeformat.d.ts +17 -17
  127. package/src/integrations/removeformat.js +1 -1
  128. package/src/integrations/restrictededitingmode.d.ts +17 -17
  129. package/src/integrations/restrictededitingmode.js +1 -1
  130. package/src/integrations/shiftentercommand.d.ts +16 -16
  131. package/src/integrations/shiftentercommand.js +1 -1
  132. package/src/integrations/standardeditingmode.d.ts +17 -17
  133. package/src/integrations/standardeditingmode.js +1 -1
  134. package/src/integrations/style.d.ts +18 -18
  135. package/src/integrations/style.js +1 -1
  136. package/src/integrations/table.d.ts +42 -42
  137. package/src/integrations/table.js +1 -1
  138. package/src/integrations/tablecaption.d.ts +22 -22
  139. package/src/integrations/tablecaption.js +1 -1
  140. package/src/integrations/tableclipboard.d.ts +19 -19
  141. package/src/integrations/tableclipboard.js +1 -1
  142. package/src/integrations/tablecolumnresize.d.ts +26 -26
  143. package/src/integrations/tablecolumnresize.js +1 -1
  144. package/src/integrations/tableheadings.d.ts +22 -22
  145. package/src/integrations/tableheadings.js +1 -1
  146. package/src/integrations/tablemergesplit.d.ts +22 -22
  147. package/src/integrations/tablemergesplit.js +1 -1
  148. package/src/integrations/tableofcontents.d.ts +17 -17
  149. package/src/integrations/tableofcontents.js +1 -1
  150. package/src/integrations/tableproperties.d.ts +27 -27
  151. package/src/integrations/tableproperties.js +1 -1
  152. package/src/integrations/template.d.ts +17 -17
  153. package/src/integrations/template.js +1 -1
  154. package/src/integrations/title.d.ts +17 -17
  155. package/src/integrations/title.js +1 -1
  156. package/src/integrations/undo.d.ts +17 -17
  157. package/src/integrations/undo.js +1 -1
  158. package/src/integrations/utils.d.ts +21 -21
  159. package/src/integrations/utils.js +1 -1
  160. package/src/suggestion.d.ts +276 -276
  161. package/src/suggestion.js +1 -1
  162. package/src/suggestiondescriptionfactory.d.ts +163 -163
  163. package/src/suggestiondescriptionfactory.js +1 -1
  164. package/src/trackchanges.d.ts +244 -244
  165. package/src/trackchanges.js +1 -1
  166. package/src/trackchangesconfig.d.ts +75 -75
  167. package/src/trackchangesdata.d.ts +41 -41
  168. package/src/trackchangesdata.js +1 -1
  169. package/src/trackchangesediting.d.ts +468 -439
  170. package/src/trackchangesediting.js +1 -1
  171. package/src/trackchangesui.d.ts +38 -38
  172. package/src/trackchangesui.js +1 -1
  173. package/src/ui/suggestioncontroller.d.ts +37 -37
  174. package/src/ui/suggestioncontroller.js +1 -1
  175. package/src/ui/view/basesuggestionthreadview.d.ts +170 -170
  176. package/src/ui/view/basesuggestionthreadview.js +1 -1
  177. package/src/ui/view/suggestionthreadview.d.ts +182 -182
  178. package/src/ui/view/suggestionthreadview.js +1 -1
  179. package/src/utils/common-translations.d.ts +9 -9
  180. package/src/utils/common-translations.js +1 -1
  181. package/src/utils/utils.d.ts +30 -30
  182. package/src/utils/utils.js +1 -1
  183. package/theme/icons/track-changes-accept.svg +1 -1
  184. package/theme/icons/track-changes-discard.svg +1 -1
  185. package/theme/icons/track-changes.svg +1 -1
@@ -1,37 +1,37 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- import type { Editor } from 'ckeditor5/src/core';
6
- import type Suggestion from '../suggestion';
7
- import type BaseSuggestionThreadView from './view/basesuggestionthreadview';
8
- import type { CommentThreadController } from '@ckeditor/ckeditor5-comments';
9
- declare const SuggestionController_base: {
10
- new (): import("ckeditor5/src/utils").Observable;
11
- prototype: import("ckeditor5/src/utils").Observable;
12
- };
13
- /**
14
- * A controller for a suggestion.
15
- *
16
- * It takes a suggestion thread view, listens to events fired by that view and based on them performs actions
17
- * on the provided suggestion model.
18
- */
19
- export default class SuggestionController extends SuggestionController_base {
20
- model: Suggestion;
21
- view: BaseSuggestionThreadView;
22
- commentThreadController: CommentThreadController;
23
- constructor(editor: Editor, model: Suggestion, view: BaseSuggestionThreadView, commentThreadController: CommentThreadController);
24
- /**
25
- * Accepts the suggestion that belongs to this controller.
26
- */
27
- acceptSuggestion(): void;
28
- /**
29
- * Discards the suggestion that belongs to this controller.
30
- */
31
- discardSuggestion(): void;
32
- /**
33
- * Destroys `SuggestionController` instance.
34
- */
35
- destroy(): void;
36
- }
37
- export {};
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ import type { Editor } from 'ckeditor5/src/core';
6
+ import type Suggestion from '../suggestion';
7
+ import type BaseSuggestionThreadView from './view/basesuggestionthreadview';
8
+ import type { CommentThreadController } from '@ckeditor/ckeditor5-comments';
9
+ declare const SuggestionController_base: {
10
+ new (): import("ckeditor5/src/utils").Observable;
11
+ prototype: import("ckeditor5/src/utils").Observable;
12
+ };
13
+ /**
14
+ * A controller for a suggestion.
15
+ *
16
+ * It takes a suggestion thread view, listens to events fired by that view and based on them performs actions
17
+ * on the provided suggestion model.
18
+ */
19
+ export default class SuggestionController extends SuggestionController_base {
20
+ model: Suggestion;
21
+ view: BaseSuggestionThreadView;
22
+ commentThreadController: CommentThreadController;
23
+ constructor(editor: Editor, model: Suggestion, view: BaseSuggestionThreadView, commentThreadController: CommentThreadController);
24
+ /**
25
+ * Accepts the suggestion that belongs to this controller.
26
+ */
27
+ acceptSuggestion(): void;
28
+ /**
29
+ * Discards the suggestion that belongs to this controller.
30
+ */
31
+ discardSuggestion(): void;
32
+ /**
33
+ * Destroys `SuggestionController` instance.
34
+ */
35
+ destroy(): void;
36
+ }
37
+ export {};
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x5296=['commands','acceptSuggestion','execute','listenTo','_pendingAction','unbind','commentThreadController','model','add','remove','PendingActions','_removePendingAction','_editor','_discardCommand','canEditAt','locale','canAccept','plugins','_setPendingAction','discardSuggestion','get','change:isDirty','isDirty','destroy','canDiscard','bind','_acceptCommand','getRanges','view','isEnabled','PENDING_ACTION_SUGGESTION'];(function(_0x181e37,_0x52960c){const _0x161798=function(_0x556e26){while(--_0x556e26){_0x181e37['push'](_0x181e37['shift']());}};_0x161798(++_0x52960c);}(_0x5296,0xc9));const _0x1617=function(_0x181e37,_0x52960c){_0x181e37=_0x181e37-0x0;let _0x161798=_0x5296[_0x181e37];return _0x161798;};import{ObservableMixin as _0x52f326}from'ckeditor5/src/utils';import{getTranslation as _0x5abf55}from'../utils/common-translations';export default class qt extends _0x52f326(){constructor(_0x16c196,_0x3078e2,_0x566aba,_0x104de8){super(),this[_0x1617('0x17')]=_0x3078e2,this[_0x1617('0xd')]=_0x566aba,this[_0x1617('0x16')]=_0x104de8,this[_0x1617('0x1c')]=_0x16c196,this[_0x1617('0xb')]=_0x16c196[_0x1617('0x10')][_0x1617('0x5')](_0x1617('0x11')),this[_0x1617('0x1d')]=_0x16c196['commands'][_0x1617('0x5')]('discardSuggestion'),this[_0x1617('0xd')][_0x1617('0xa')](_0x1617('0xe'))['to'](this[_0x1617('0xb')],this[_0x1617('0x1d')],(_0x2d5aa4,_0x209423)=>_0x2d5aa4||_0x209423),this[_0x1617('0xd')][_0x1617('0xa')]('canAccept')['to'](this[_0x1617('0xb')],_0x1617('0xe'),_0x5b2e86=>_0x5b2e86&&this[_0x1617('0x1c')]['model'][_0x1617('0x1e')](_0x3078e2[_0x1617('0xc')]())),this[_0x1617('0xd')][_0x1617('0xa')]('canDiscard')['to'](this[_0x1617('0x1d')],_0x1617('0xe'),_0x4124fc=>_0x4124fc&&this[_0x1617('0x1c')]['model']['canEditAt'](_0x3078e2['getRanges']())),this['_pendingAction']=null,_0x566aba[_0x1617('0x7')]&&this[_0x1617('0x3')](),this['listenTo'](_0x566aba,_0x1617('0x11'),()=>this[_0x1617('0x11')]()),this['listenTo'](_0x566aba,_0x1617('0x4'),()=>this['discardSuggestion']()),this[_0x1617('0x13')](_0x566aba,_0x1617('0x6'),()=>{_0x566aba[_0x1617('0x7')]?this[_0x1617('0x3')]():this[_0x1617('0x1b')]();});}[_0x1617('0x11')](){this[_0x1617('0xb')][_0x1617('0x12')](this[_0x1617('0x17')]['id']);}[_0x1617('0x4')](){this[_0x1617('0x1d')][_0x1617('0x12')](this['model']['id']);}['destroy'](){this['view']['unbind'](_0x1617('0xe')),this[_0x1617('0xd')][_0x1617('0x15')](_0x1617('0x1')),this[_0x1617('0xd')][_0x1617('0x15')](_0x1617('0x9')),this['stopListening'](),this[_0x1617('0x16')][_0x1617('0x8')](),this[_0x1617('0x14')]&&this[_0x1617('0x1b')]();}[_0x1617('0x3')](){const _0x46d54b=_0x5abf55(this['_editor'][_0x1617('0x0')],_0x1617('0xf'));this['_pendingAction']=this['_editor'][_0x1617('0x2')][_0x1617('0x5')]('PendingActions')[_0x1617('0x18')](_0x46d54b);}['_removePendingAction'](){null!==this['_pendingAction']&&this['_editor'][_0x1617('0x2')]['get'](_0x1617('0x1a'))[_0x1617('0x19')](this[_0x1617('0x14')]),this[_0x1617('0x14')]=null;}}
23
+ const _0x571a=['_removePendingAction','listenTo','commands','acceptSuggestion','_setPendingAction','destroy','canEditAt','_editor','_pendingAction','view','bind','get','plugins','PENDING_ACTION_SUGGESTION','add','discardSuggestion','canAccept','unbind','_discardCommand','PendingActions','model','isEnabled','locale','execute','canDiscard','commentThreadController','isDirty','_acceptCommand','stopListening','getRanges'];(function(_0x20a447,_0x571a81){const _0x546ed2=function(_0x164a2b){while(--_0x164a2b){_0x20a447['push'](_0x20a447['shift']());}};_0x546ed2(++_0x571a81);}(_0x571a,0xed));const _0x546e=function(_0x20a447,_0x571a81){_0x20a447=_0x20a447-0x0;let _0x546ed2=_0x571a[_0x20a447];return _0x546ed2;};import{ObservableMixin as _0x3ead9b}from'ckeditor5/src/utils';import{getTranslation as _0x129563}from'../utils/common-translations';export default class Gt extends _0x3ead9b(){constructor(_0x26f362,_0x2b8529,_0x132492,_0xc5ebdf){super(),this[_0x546e('0x17')]=_0x2b8529,this[_0x546e('0xc')]=_0x132492,this[_0x546e('0x1c')]=_0xc5ebdf,this[_0x546e('0xa')]=_0x26f362,this['_acceptCommand']=_0x26f362[_0x546e('0x5')][_0x546e('0xe')](_0x546e('0x6')),this[_0x546e('0x15')]=_0x26f362[_0x546e('0x5')][_0x546e('0xe')](_0x546e('0x12')),this['view'][_0x546e('0xd')](_0x546e('0x18'))['to'](this[_0x546e('0x0')],this['_discardCommand'],(_0x511451,_0x235e21)=>_0x511451||_0x235e21),this[_0x546e('0xc')]['bind']('canAccept')['to'](this[_0x546e('0x0')],_0x546e('0x18'),_0xeb5fe6=>_0xeb5fe6&&this['_editor'][_0x546e('0x17')]['canEditAt'](_0x2b8529[_0x546e('0x2')]())),this[_0x546e('0xc')][_0x546e('0xd')](_0x546e('0x1b'))['to'](this[_0x546e('0x15')],_0x546e('0x18'),_0x56bd1b=>_0x56bd1b&&this[_0x546e('0xa')][_0x546e('0x17')][_0x546e('0x9')](_0x2b8529['getRanges']())),this[_0x546e('0xb')]=null,_0x132492[_0x546e('0x1d')]&&this[_0x546e('0x7')](),this[_0x546e('0x4')](_0x132492,_0x546e('0x6'),()=>this['acceptSuggestion']()),this[_0x546e('0x4')](_0x132492,'discardSuggestion',()=>this[_0x546e('0x12')]()),this['listenTo'](_0x132492,'change:isDirty',()=>{_0x132492[_0x546e('0x1d')]?this[_0x546e('0x7')]():this[_0x546e('0x3')]();});}['acceptSuggestion'](){this[_0x546e('0x0')][_0x546e('0x1a')](this[_0x546e('0x17')]['id']);}[_0x546e('0x12')](){this[_0x546e('0x15')][_0x546e('0x1a')](this['model']['id']);}[_0x546e('0x8')](){this[_0x546e('0xc')][_0x546e('0x14')](_0x546e('0x18')),this['view']['unbind'](_0x546e('0x13')),this[_0x546e('0xc')][_0x546e('0x14')](_0x546e('0x1b')),this[_0x546e('0x1')](),this[_0x546e('0x1c')][_0x546e('0x8')](),this[_0x546e('0xb')]&&this[_0x546e('0x3')]();}[_0x546e('0x7')](){const _0x317222=_0x129563(this[_0x546e('0xa')][_0x546e('0x19')],_0x546e('0x10'));this['_pendingAction']=this['_editor'][_0x546e('0xf')]['get'](_0x546e('0x16'))[_0x546e('0x11')](_0x317222);}['_removePendingAction'](){null!==this[_0x546e('0xb')]&&this[_0x546e('0xa')][_0x546e('0xf')][_0x546e('0xe')](_0x546e('0x16'))['remove'](this[_0x546e('0xb')]),this[_0x546e('0xb')]=null;}}
@@ -1,170 +1,170 @@
1
- /**
2
- * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
- */
5
- /**
6
- * @module track-changes/ui/view/basesuggestionthreadview
7
- * @publicApi
8
- */
9
- import { View } from 'ckeditor5/src/ui';
10
- import type { Locale } from 'ckeditor5/src/utils';
11
- import type { EditorConfig } from 'ckeditor5/src/core';
12
- import type Suggestion from '../../suggestion';
13
- import type { CommentsListView, CommentThreadInputView, CommentView } from '@ckeditor/ckeditor5-comments';
14
- import type { User } from 'ckeditor5-collaboration/src/collaboration-core';
15
- import type { Description } from '../../suggestiondescriptionfactory';
16
- /**
17
- * An abstract suggestion thread view class that should be used as a base for suggestion thread view implementations.
18
- * It provides some behaviors, flags and building blocks to use when creating a custom suggestion thread view class.
19
- *
20
- * All events fired by {@link module:comments/comments/ui/view/basecommentview~BaseCommentView}
21
- * are delegated to {@link module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView}.
22
- * This means that {@link module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView} can also fire these
23
- * events to communicate with CKEditor 5 collaboration features.
24
- *
25
- * For the usage examples check the {@glink features/collaboration/annotations/annotations-custom-view
26
- * Annotations custom view} guide.
27
- */
28
- export default abstract class BaseSuggestionThreadView extends View {
29
- /**
30
- * The list of comment views. It should be used as a part of the view template when present.
31
- */
32
- commentsListView: CommentsListView | null;
33
- /**
34
- * The comment input area view. It should be used as a part of the view template when present.
35
- */
36
- commentThreadInputView: CommentThreadInputView | null;
37
- /**
38
- * A boolean value that informs if the comment thread view is in the active state ("highlighted").
39
- * A comment thread view is in this state when it is focused or was activated by the user in any different way.
40
- *
41
- * @observable
42
- */
43
- isActive: boolean;
44
- /**
45
- * Suggestion creation date.
46
- *
47
- * @observable
48
- */
49
- authoredAt: Date | null;
50
- /**
51
- * Flag that indicates whether suggestion acceptation is possible.
52
- *
53
- * @observable
54
- */
55
- canAccept: boolean;
56
- /**
57
- * Flag that indicates whether suggestion discarding is possible.
58
- *
59
- * @observable
60
- */
61
- canDiscard: boolean;
62
- /**
63
- * Stores description entries generated for this suggestion that describe what is the suggested change.
64
- * They are used to create the final description presented in the suggestion view to the user.
65
- *
66
- * Note that one suggestion may include multiple changes.
67
- *
68
- * Most cases are simple and include just one description item:
69
- *
70
- * ```ts
71
- * [
72
- * { type: 'insertion', content: '*Insert:* "Foo"' }
73
- * ]
74
- * ```
75
- *
76
- * This description item represents a suggestion for inserting the "Foo" text. The `type` property describes the performed action
77
- * while the `content` property contains additional information about the action and is optional.
78
- *
79
- * A more complex example is presented below:
80
- *
81
- * ```ts
82
- * [
83
- * { type: 'insertion', content: '*Insert:* 2 paragraphs' },
84
- * { type: 'insertion', content: '*Insert:* image' },
85
- * { type: 'replace', content: '*Replace:* "Foo" *with* "Bar"' }
86
- * ]
87
- * ```
88
- *
89
- * In this example, there are three description instances (or lines). Two new (empty) paragraphs were added,
90
- * an image was added and then "Foo" text was replaced by "Bar". The above structure could be rendered as:
91
- *
92
- * ```html
93
- * <p><strong>Insert:</strong> 2 paragraphs</p>
94
- * <p><strong>Insert:</strong> image</p>
95
- * <p><strong>Replace:</strong> "Foo" <strong>with</strong> "Bar"</p>
96
- * ```
97
- *
98
- * @observable
99
- */
100
- descriptionParts: Array<Description>;
101
- /**
102
- * Informs whether the suggestion thread has any changes that have not been saved.
103
- *
104
- * @observable
105
- */
106
- isDirty: boolean;
107
- /**
108
- * Informs whether the suggestion can be accepted or discarded.
109
- *
110
- * @observable
111
- */
112
- isEnabled: boolean;
113
- /**
114
- * The number of items in the view, where the suggestion itself counts as one.
115
- *
116
- * In other words, it is equal to the number of comments in the suggestion thread view plus one.
117
- *
118
- * @observable
119
- */
120
- readonly length: number;
121
- constructor(locale: Locale, model: Suggestion, localUser: User, config: SuggestionThreadConfig);
122
- /**
123
- * Focuses the view.
124
- */
125
- focus(): void;
126
- /**
127
- * @inheritDoc
128
- */
129
- destroy(): void;
130
- }
131
- /**
132
- * Fired when a user performed an action that should lead to accepting the suggestion.
133
- *
134
- * This event is not fired by default by any component created by `BaseSuggestionThreadView`.
135
- * If you create a view class extending `BaseSuggestionCommentView`, you should provide
136
- * a UI element that will fire this event.
137
- *
138
- * @eventName ~BaseSuggestionThreadView#acceptSuggestion
139
- */
140
- export type AcceptSuggestionEvent = {
141
- name: 'acceptSuggestion';
142
- args: [];
143
- };
144
- /**
145
- * Fired when a user performed an action that should lead to discarding the suggestion.
146
- *
147
- * This event is not fired by default by any component created by `BaseSuggestionThreadView`.
148
- * If you create a view class extending `BaseSuggestionCommentView`, you should provide
149
- * a UI element that will fire this event.
150
- *
151
- * @eventName ~BaseSuggestionThreadView#discardSuggestion
152
- */
153
- export type DiscardSuggestionEvent = {
154
- name: 'discardSuggestion';
155
- args: [];
156
- };
157
- /**
158
- * Config used for suggestion thread views.
159
- */
160
- export interface SuggestionThreadConfig {
161
- disableComments: boolean;
162
- editorConfig: EditorConfig;
163
- maxCommentsWhenCollapsed: number;
164
- maxThreadTotalWeight: number;
165
- maxCommentCharsWhenCollapsed: number;
166
- formatDateTime: (date: Date | string) => string;
167
- CommentView: typeof CommentView;
168
- CommentsListView: typeof CommentsListView;
169
- CommentThreadInputView: typeof CommentThreadInputView;
170
- }
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module track-changes/ui/view/basesuggestionthreadview
7
+ * @publicApi
8
+ */
9
+ import { View } from 'ckeditor5/src/ui';
10
+ import type { Locale } from 'ckeditor5/src/utils';
11
+ import type { EditorConfig } from 'ckeditor5/src/core';
12
+ import type Suggestion from '../../suggestion';
13
+ import type { CommentsListView, CommentThreadInputView, CommentView } from '@ckeditor/ckeditor5-comments';
14
+ import type { User } from 'ckeditor5-collaboration/src/collaboration-core';
15
+ import type { Description } from '../../suggestiondescriptionfactory';
16
+ /**
17
+ * An abstract suggestion thread view class that should be used as a base for suggestion thread view implementations.
18
+ * It provides some behaviors, flags and building blocks to use when creating a custom suggestion thread view class.
19
+ *
20
+ * All events fired by {@link module:comments/comments/ui/view/basecommentview~BaseCommentView}
21
+ * are delegated to {@link module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView}.
22
+ * This means that {@link module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView} can also fire these
23
+ * events to communicate with CKEditor 5 collaboration features.
24
+ *
25
+ * For the usage examples check the {@glink features/collaboration/annotations/annotations-custom-view
26
+ * Annotations custom view} guide.
27
+ */
28
+ export default abstract class BaseSuggestionThreadView extends View {
29
+ /**
30
+ * The list of comment views. It should be used as a part of the view template when present.
31
+ */
32
+ commentsListView: CommentsListView | null;
33
+ /**
34
+ * The comment input area view. It should be used as a part of the view template when present.
35
+ */
36
+ commentThreadInputView: CommentThreadInputView | null;
37
+ /**
38
+ * A boolean value that informs if the comment thread view is in the active state ("highlighted").
39
+ * A comment thread view is in this state when it is focused or was activated by the user in any different way.
40
+ *
41
+ * @observable
42
+ */
43
+ isActive: boolean;
44
+ /**
45
+ * Suggestion creation date.
46
+ *
47
+ * @observable
48
+ */
49
+ authoredAt: Date | null;
50
+ /**
51
+ * Flag that indicates whether suggestion acceptation is possible.
52
+ *
53
+ * @observable
54
+ */
55
+ canAccept: boolean;
56
+ /**
57
+ * Flag that indicates whether suggestion discarding is possible.
58
+ *
59
+ * @observable
60
+ */
61
+ canDiscard: boolean;
62
+ /**
63
+ * Stores description entries generated for this suggestion that describe what is the suggested change.
64
+ * They are used to create the final description presented in the suggestion view to the user.
65
+ *
66
+ * Note that one suggestion may include multiple changes.
67
+ *
68
+ * Most cases are simple and include just one description item:
69
+ *
70
+ * ```ts
71
+ * [
72
+ * { type: 'insertion', content: '*Insert:* "Foo"' }
73
+ * ]
74
+ * ```
75
+ *
76
+ * This description item represents a suggestion for inserting the "Foo" text. The `type` property describes the performed action
77
+ * while the `content` property contains additional information about the action and is optional.
78
+ *
79
+ * A more complex example is presented below:
80
+ *
81
+ * ```ts
82
+ * [
83
+ * { type: 'insertion', content: '*Insert:* 2 paragraphs' },
84
+ * { type: 'insertion', content: '*Insert:* image' },
85
+ * { type: 'replace', content: '*Replace:* "Foo" *with* "Bar"' }
86
+ * ]
87
+ * ```
88
+ *
89
+ * In this example, there are three description instances (or lines). Two new (empty) paragraphs were added,
90
+ * an image was added and then "Foo" text was replaced by "Bar". The above structure could be rendered as:
91
+ *
92
+ * ```html
93
+ * <p><strong>Insert:</strong> 2 paragraphs</p>
94
+ * <p><strong>Insert:</strong> image</p>
95
+ * <p><strong>Replace:</strong> "Foo" <strong>with</strong> "Bar"</p>
96
+ * ```
97
+ *
98
+ * @observable
99
+ */
100
+ descriptionParts: Array<Description>;
101
+ /**
102
+ * Informs whether the suggestion thread has any changes that have not been saved.
103
+ *
104
+ * @observable
105
+ */
106
+ isDirty: boolean;
107
+ /**
108
+ * Informs whether the suggestion can be accepted or discarded.
109
+ *
110
+ * @observable
111
+ */
112
+ isEnabled: boolean;
113
+ /**
114
+ * The number of items in the view, where the suggestion itself counts as one.
115
+ *
116
+ * In other words, it is equal to the number of comments in the suggestion thread view plus one.
117
+ *
118
+ * @observable
119
+ */
120
+ readonly length: number;
121
+ constructor(locale: Locale, model: Suggestion, localUser: User, config: SuggestionThreadConfig);
122
+ /**
123
+ * Focuses the view.
124
+ */
125
+ focus(): void;
126
+ /**
127
+ * @inheritDoc
128
+ */
129
+ destroy(): void;
130
+ }
131
+ /**
132
+ * Fired when a user performed an action that should lead to accepting the suggestion.
133
+ *
134
+ * This event is not fired by default by any component created by `BaseSuggestionThreadView`.
135
+ * If you create a view class extending `BaseSuggestionCommentView`, you should provide
136
+ * a UI element that will fire this event.
137
+ *
138
+ * @eventName ~BaseSuggestionThreadView#acceptSuggestion
139
+ */
140
+ export type AcceptSuggestionEvent = {
141
+ name: 'acceptSuggestion';
142
+ args: [];
143
+ };
144
+ /**
145
+ * Fired when a user performed an action that should lead to discarding the suggestion.
146
+ *
147
+ * This event is not fired by default by any component created by `BaseSuggestionThreadView`.
148
+ * If you create a view class extending `BaseSuggestionCommentView`, you should provide
149
+ * a UI element that will fire this event.
150
+ *
151
+ * @eventName ~BaseSuggestionThreadView#discardSuggestion
152
+ */
153
+ export type DiscardSuggestionEvent = {
154
+ name: 'discardSuggestion';
155
+ args: [];
156
+ };
157
+ /**
158
+ * Config used for suggestion thread views.
159
+ */
160
+ export interface SuggestionThreadConfig {
161
+ disableComments: boolean;
162
+ editorConfig: EditorConfig;
163
+ maxCommentsWhenCollapsed: number;
164
+ maxThreadTotalWeight: number;
165
+ maxCommentCharsWhenCollapsed: number;
166
+ formatDateTime: (date: Date | string) => string;
167
+ CommentView: typeof CommentView;
168
+ CommentsListView: typeof CommentsListView;
169
+ CommentThreadInputView: typeof CommentThreadInputView;
170
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x4cd4=['removeComment','commentThread','isEnabled','bind','isReadOnly','disableComments','isDirty','_localUser','length','showInput','authoredAt','_model','_config','descriptionParts','canAccept','_createCommentViews','destroy','editorConfig','setData','hasDirtyComment','locale','commentsListView','submit','set','commentThreadInputView','isActive','value','delegate','focus','editor','assign','commentInputView','disabledSubmit'];(function(_0x56bda4,_0x4cd470){const _0x3a3bde=function(_0x2c501e){while(--_0x2c501e){_0x56bda4['push'](_0x56bda4['shift']());}};_0x3a3bde(++_0x4cd470);}(_0x4cd4,0x1d0));const _0x3a3b=function(_0x56bda4,_0x4cd470){_0x56bda4=_0x56bda4-0x0;let _0x3a3bde=_0x4cd4[_0x56bda4];return _0x3a3bde;};import{View as _0x25b166}from'ckeditor5/src/ui';export default class ii extends _0x25b166{constructor(_0x1e7cff,_0x2de4b8,_0x3c5db3,_0x423990){super(_0x1e7cff),this[_0x3a3b('0x13')]=null,this[_0x3a3b('0x16')]=null,this[_0x3a3b('0x15')]('isActive',!0x1),this[_0x3a3b('0x15')](_0x3a3b('0x8'),_0x2de4b8[_0x3a3b('0x8')]),this[_0x3a3b('0x1')]('authoredAt')['to'](_0x2de4b8),this['set'](_0x3a3b('0xb'),[]),this[_0x3a3b('0x15')](_0x3a3b('0x4'),!0x1),this[_0x3a3b('0x15')](_0x3a3b('0x0'),!0x1),this[_0x3a3b('0x15')](_0x3a3b('0xc'),!0x1),this['set']('canDiscard',!0x1),this[_0x3a3b('0x9')]=_0x2de4b8,this[_0x3a3b('0x5')]=_0x3c5db3,this['_config']=_0x423990,_0x423990[_0x3a3b('0x3')]?this[_0x3a3b('0x15')]('length',0x1):this[_0x3a3b('0xd')]();}[_0x3a3b('0x1a')](){this['element'][_0x3a3b('0x1a')]();}[_0x3a3b('0xe')](){this[_0x3a3b('0x13')]&&this[_0x3a3b('0x13')][_0x3a3b('0xe')](),this[_0x3a3b('0x16')]&&this[_0x3a3b('0x16')][_0x3a3b('0xe')](),super[_0x3a3b('0xe')]();}['_createCommentViews'](){const {CommentsListView:_0x2c59c9}=this['_config'];this[_0x3a3b('0x13')]=new _0x2c59c9(this[_0x3a3b('0x12')],this['_model'][_0x3a3b('0x20')],Object[_0x3a3b('0x1c')]({'CommentView':this[_0x3a3b('0xa')]['CommentView']},this[_0x3a3b('0xa')])),this[_0x3a3b('0x13')][_0x3a3b('0x19')](_0x3a3b('0x1f'))['to'](this),this[_0x3a3b('0x13')][_0x3a3b('0x19')]('updateComment')['to'](this),this[_0x3a3b('0x13')][_0x3a3b('0x1')](_0x3a3b('0x17'))['to'](this),this['set'](_0x3a3b('0x6'),this['commentsListView']['length']+0x1),this[_0x3a3b('0x1')](_0x3a3b('0x6'))['to'](this[_0x3a3b('0x13')],_0x3a3b('0x6'),_0xb71376=>_0xb71376+0x1),this[_0x3a3b('0x16')]=this['_createCommentThreadInputView'](),this['on'](_0x3a3b('0x1f'),()=>this[_0x3a3b('0x1a')]()),this['bind'](_0x3a3b('0x4'))['to'](this['commentsListView'],_0x3a3b('0x11'),this[_0x3a3b('0x16')][_0x3a3b('0x1d')],_0x3a3b('0x18'),(_0x5463a8,_0x237809)=>_0x5463a8||!!_0x237809);}['_createCommentThreadInputView'](){const {CommentThreadInputView:_0xd41b3b}=this['_config'],_0x4a0203=new _0xd41b3b(this[_0x3a3b('0x12')],this['_localUser'],this[_0x3a3b('0xa')][_0x3a3b('0xf')]),_0x33b849=_0x4a0203[_0x3a3b('0x1d')];return _0x4a0203[_0x3a3b('0x1')](_0x3a3b('0x7'))['to'](this,_0x3a3b('0x17'),this['_model']['commentThread'],_0x3a3b('0x2'),_0x33b849,'value',(_0x15ef5e,_0x54a8bf,_0x3d99df)=>!!_0x3d99df||_0x15ef5e&&!_0x54a8bf),_0x33b849['on'](_0x3a3b('0x14'),(_0x45071c,_0x5dcf45)=>{this['fire']('addComment',_0x5dcf45),_0x33b849[_0x3a3b('0x1b')][_0x3a3b('0x10')]('');}),_0x33b849['on']('cancel',()=>this['focus']()),_0x33b849[_0x3a3b('0x1')](_0x3a3b('0x1e'))['to'](this[_0x3a3b('0x9')]['commentThread'],'isReadOnly'),_0x4a0203;}}
23
+ const _0x4526=['showInput','assign','CommentView','locale','delegate','canAccept','hasDirtyComment','updateComment','descriptionParts','bind','_createCommentThreadInputView','_model','destroy','fire','value','authoredAt','isActive','disableComments','set','submit','focus','_createCommentViews','removeComment','disabledSubmit','isReadOnly','_config','length','isDirty','commentsListView','isEnabled','commentInputView','commentThread','commentThreadInputView','addComment','setData'];(function(_0x1c9597,_0x4526dc){const _0x2969a2=function(_0x18d4a4){while(--_0x18d4a4){_0x1c9597['push'](_0x1c9597['shift']());}};_0x2969a2(++_0x4526dc);}(_0x4526,0xdc));const _0x2969=function(_0x1c9597,_0x4526dc){_0x1c9597=_0x1c9597-0x0;let _0x2969a2=_0x4526[_0x1c9597];return _0x2969a2;};import{View as _0x31a273}from'ckeditor5/src/ui';export default class ii extends _0x31a273{constructor(_0x4b651d,_0x387431,_0x41a730,_0x24686e){super(_0x4b651d),this[_0x2969('0x12')]=null,this[_0x2969('0x16')]=null,this['set'](_0x2969('0x6'),!0x1),this[_0x2969('0x8')](_0x2969('0x5'),_0x387431[_0x2969('0x5')]),this[_0x2969('0x22')](_0x2969('0x5'))['to'](_0x387431),this[_0x2969('0x8')](_0x2969('0x21'),[]),this[_0x2969('0x8')](_0x2969('0x11'),!0x1),this[_0x2969('0x8')](_0x2969('0x13'),!0x1),this[_0x2969('0x8')](_0x2969('0x1e'),!0x1),this[_0x2969('0x8')]('canDiscard',!0x1),this[_0x2969('0x1')]=_0x387431,this['_localUser']=_0x41a730,this[_0x2969('0xf')]=_0x24686e,_0x24686e[_0x2969('0x7')]?this[_0x2969('0x8')](_0x2969('0x10'),0x1):this[_0x2969('0xb')]();}['focus'](){this['element'][_0x2969('0xa')]();}[_0x2969('0x2')](){this[_0x2969('0x12')]&&this[_0x2969('0x12')][_0x2969('0x2')](),this['commentThreadInputView']&&this[_0x2969('0x16')]['destroy'](),super[_0x2969('0x2')]();}[_0x2969('0xb')](){const {CommentsListView:_0x497576}=this[_0x2969('0xf')];this[_0x2969('0x12')]=new _0x497576(this['locale'],this['_model']['commentThread'],Object[_0x2969('0x1a')]({'CommentView':this[_0x2969('0xf')][_0x2969('0x1b')]},this['_config'])),this[_0x2969('0x12')][_0x2969('0x1d')](_0x2969('0xc'))['to'](this),this[_0x2969('0x12')][_0x2969('0x1d')](_0x2969('0x20'))['to'](this),this[_0x2969('0x12')][_0x2969('0x22')](_0x2969('0x6'))['to'](this),this[_0x2969('0x8')](_0x2969('0x10'),this[_0x2969('0x12')][_0x2969('0x10')]+0x1),this['bind']('length')['to'](this['commentsListView'],'length',_0x5c1203=>_0x5c1203+0x1),this['commentThreadInputView']=this[_0x2969('0x0')](),this['on'](_0x2969('0xc'),()=>this[_0x2969('0xa')]()),this[_0x2969('0x22')](_0x2969('0x11'))['to'](this['commentsListView'],_0x2969('0x1f'),this[_0x2969('0x16')]['commentInputView'],_0x2969('0x4'),(_0x2bf85f,_0xbf046c)=>_0x2bf85f||!!_0xbf046c);}[_0x2969('0x0')](){const {CommentThreadInputView:_0x4db2e1}=this[_0x2969('0xf')],_0x1b0f62=new _0x4db2e1(this[_0x2969('0x1c')],this['_localUser'],this[_0x2969('0xf')]['editorConfig']),_0x35efc0=_0x1b0f62[_0x2969('0x14')];return _0x1b0f62[_0x2969('0x22')](_0x2969('0x19'))['to'](this,_0x2969('0x6'),this[_0x2969('0x1')]['commentThread'],_0x2969('0xe'),_0x35efc0,_0x2969('0x4'),(_0x19f758,_0x161662,_0x2ed42d)=>!!_0x2ed42d||_0x19f758&&!_0x161662),_0x35efc0['on'](_0x2969('0x9'),(_0x4e2b1d,_0x4de29c)=>{this[_0x2969('0x3')](_0x2969('0x17'),_0x4de29c),_0x35efc0['editor'][_0x2969('0x18')]('');}),_0x35efc0['on']('cancel',()=>this[_0x2969('0xa')]()),_0x35efc0[_0x2969('0x22')](_0x2969('0xd'))['to'](this[_0x2969('0x1')][_0x2969('0x15')],_0x2969('0xe')),_0x1b0f62;}}