@ckeditor/ckeditor5-comments 41.3.0-alpha.3 → 41.3.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 (201) hide show
  1. package/build/comments.js +1 -1
  2. package/package.json +3 -4
  3. package/src/annotations/annotation.js +1 -1
  4. package/src/annotations/annotationcollection.js +1 -1
  5. package/src/annotations/annotations.js +1 -1
  6. package/src/annotations/annotationsuis.js +1 -1
  7. package/src/annotations/editorannotations.js +1 -1
  8. package/src/annotations/inlineannotations.js +1 -1
  9. package/src/annotations/narrowsidebar.js +1 -1
  10. package/src/annotations/sidebar.js +1 -1
  11. package/src/annotations/view/annotationcounterbuttonview.js +1 -1
  12. package/src/annotations/view/annotationview.js +1 -1
  13. package/src/annotations/view/sidebaritemview.js +1 -1
  14. package/src/annotations/view/sidebarview.js +1 -1
  15. package/src/annotations/widesidebar.js +1 -1
  16. package/src/comments/addcommentthreadcommand.js +1 -1
  17. package/src/comments/commentsarchive.js +1 -1
  18. package/src/comments/commentsarchiveui.d.ts +2 -2
  19. package/src/comments/commentsarchiveui.js +1 -1
  20. package/src/comments/commentsediting.js +1 -1
  21. package/src/comments/commentsrepository.js +1 -1
  22. package/src/comments/commentsui.js +1 -1
  23. package/src/comments/integrations/clipboard.js +1 -1
  24. package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
  25. package/src/comments/integrations/importword.js +1 -1
  26. package/src/comments/ui/commenteditor/commenteditor.js +1 -1
  27. package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
  28. package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
  29. package/src/comments/ui/commentthreadcontroller.js +1 -1
  30. package/src/comments/ui/view/basecommentthreadview.js +1 -1
  31. package/src/comments/ui/view/basecommentview.js +1 -1
  32. package/src/comments/ui/view/collapsedcommentsview.js +1 -1
  33. package/src/comments/ui/view/commentcontentview.js +1 -1
  34. package/src/comments/ui/view/commentinputview.js +1 -1
  35. package/src/comments/ui/view/commentsarchiveview.js +1 -1
  36. package/src/comments/ui/view/commentslistview.js +1 -1
  37. package/src/comments/ui/view/commentthreadheaderview.js +1 -1
  38. package/src/comments/ui/view/commentthreadinputview.js +1 -1
  39. package/src/comments/ui/view/commentthreadview.js +1 -1
  40. package/src/comments/ui/view/commentview.js +1 -1
  41. package/src/comments.js +1 -1
  42. package/src/commentsonly.js +1 -1
  43. package/src/index.js +1 -1
  44. package/src/utils/common-translations.js +1 -1
  45. package/src/utils/createmutationobserver.js +1 -1
  46. package/theme/commentsarchive.css +1 -1
  47. package/dist/content-index.css +0 -332
  48. package/dist/editor-index.css +0 -902
  49. package/dist/index.css +0 -1874
  50. package/dist/translations/af.d.ts +0 -8
  51. package/dist/translations/af.js +0 -23
  52. package/dist/translations/ar.d.ts +0 -8
  53. package/dist/translations/ar.js +0 -23
  54. package/dist/translations/bg.d.ts +0 -8
  55. package/dist/translations/bg.js +0 -23
  56. package/dist/translations/bn.d.ts +0 -8
  57. package/dist/translations/bn.js +0 -23
  58. package/dist/translations/bs.d.ts +0 -8
  59. package/dist/translations/bs.js +0 -23
  60. package/dist/translations/ca.d.ts +0 -8
  61. package/dist/translations/ca.js +0 -23
  62. package/dist/translations/cs.d.ts +0 -8
  63. package/dist/translations/cs.js +0 -23
  64. package/dist/translations/da.d.ts +0 -8
  65. package/dist/translations/da.js +0 -23
  66. package/dist/translations/de-ch.d.ts +0 -8
  67. package/dist/translations/de-ch.js +0 -23
  68. package/dist/translations/de.d.ts +0 -8
  69. package/dist/translations/de.js +0 -23
  70. package/dist/translations/el.d.ts +0 -8
  71. package/dist/translations/el.js +0 -23
  72. package/dist/translations/en-au.d.ts +0 -8
  73. package/dist/translations/en-au.js +0 -23
  74. package/dist/translations/en.d.ts +0 -8
  75. package/dist/translations/en.js +0 -23
  76. package/dist/translations/es-co.d.ts +0 -8
  77. package/dist/translations/es-co.js +0 -23
  78. package/dist/translations/es.d.ts +0 -8
  79. package/dist/translations/es.js +0 -23
  80. package/dist/translations/et.d.ts +0 -8
  81. package/dist/translations/et.js +0 -23
  82. package/dist/translations/fa.d.ts +0 -8
  83. package/dist/translations/fa.js +0 -23
  84. package/dist/translations/fi.d.ts +0 -8
  85. package/dist/translations/fi.js +0 -23
  86. package/dist/translations/fr.d.ts +0 -8
  87. package/dist/translations/fr.js +0 -23
  88. package/dist/translations/gl.d.ts +0 -8
  89. package/dist/translations/gl.js +0 -23
  90. package/dist/translations/he.d.ts +0 -8
  91. package/dist/translations/he.js +0 -23
  92. package/dist/translations/hi.d.ts +0 -8
  93. package/dist/translations/hi.js +0 -23
  94. package/dist/translations/hr.d.ts +0 -8
  95. package/dist/translations/hr.js +0 -23
  96. package/dist/translations/hu.d.ts +0 -8
  97. package/dist/translations/hu.js +0 -23
  98. package/dist/translations/id.d.ts +0 -8
  99. package/dist/translations/id.js +0 -23
  100. package/dist/translations/it.d.ts +0 -8
  101. package/dist/translations/it.js +0 -23
  102. package/dist/translations/ja.d.ts +0 -8
  103. package/dist/translations/ja.js +0 -23
  104. package/dist/translations/jv.d.ts +0 -8
  105. package/dist/translations/jv.js +0 -23
  106. package/dist/translations/ko.d.ts +0 -8
  107. package/dist/translations/ko.js +0 -23
  108. package/dist/translations/lt.d.ts +0 -8
  109. package/dist/translations/lt.js +0 -23
  110. package/dist/translations/lv.d.ts +0 -8
  111. package/dist/translations/lv.js +0 -23
  112. package/dist/translations/ms.d.ts +0 -8
  113. package/dist/translations/ms.js +0 -23
  114. package/dist/translations/nl.d.ts +0 -8
  115. package/dist/translations/nl.js +0 -23
  116. package/dist/translations/no.d.ts +0 -8
  117. package/dist/translations/no.js +0 -23
  118. package/dist/translations/pl.d.ts +0 -8
  119. package/dist/translations/pl.js +0 -23
  120. package/dist/translations/pt-br.d.ts +0 -8
  121. package/dist/translations/pt-br.js +0 -23
  122. package/dist/translations/pt.d.ts +0 -8
  123. package/dist/translations/pt.js +0 -23
  124. package/dist/translations/ro.d.ts +0 -8
  125. package/dist/translations/ro.js +0 -23
  126. package/dist/translations/ru.d.ts +0 -8
  127. package/dist/translations/ru.js +0 -23
  128. package/dist/translations/sk.d.ts +0 -8
  129. package/dist/translations/sk.js +0 -23
  130. package/dist/translations/sq.d.ts +0 -8
  131. package/dist/translations/sq.js +0 -23
  132. package/dist/translations/sr-latn.d.ts +0 -8
  133. package/dist/translations/sr-latn.js +0 -23
  134. package/dist/translations/sr.d.ts +0 -8
  135. package/dist/translations/sr.js +0 -23
  136. package/dist/translations/sv.d.ts +0 -8
  137. package/dist/translations/sv.js +0 -23
  138. package/dist/translations/th.d.ts +0 -8
  139. package/dist/translations/th.js +0 -23
  140. package/dist/translations/tk.d.ts +0 -8
  141. package/dist/translations/tk.js +0 -23
  142. package/dist/translations/tr.d.ts +0 -8
  143. package/dist/translations/tr.js +0 -23
  144. package/dist/translations/tt.d.ts +0 -8
  145. package/dist/translations/tt.js +0 -23
  146. package/dist/translations/ug.d.ts +0 -8
  147. package/dist/translations/ug.js +0 -23
  148. package/dist/translations/uk.d.ts +0 -8
  149. package/dist/translations/uk.js +0 -23
  150. package/dist/translations/ur.d.ts +0 -8
  151. package/dist/translations/ur.js +0 -23
  152. package/dist/translations/vi.d.ts +0 -8
  153. package/dist/translations/vi.js +0 -23
  154. package/dist/translations/zh-cn.d.ts +0 -8
  155. package/dist/translations/zh-cn.js +0 -23
  156. package/dist/translations/zh.d.ts +0 -8
  157. package/dist/translations/zh.js +0 -23
  158. package/dist/types/annotations/annotation.d.ts +0 -94
  159. package/dist/types/annotations/annotationcollection.d.ts +0 -102
  160. package/dist/types/annotations/annotations.d.ts +0 -158
  161. package/dist/types/annotations/annotationsuis.d.ts +0 -236
  162. package/dist/types/annotations/editorannotations.d.ts +0 -71
  163. package/dist/types/annotations/inlineannotations.d.ts +0 -94
  164. package/dist/types/annotations/narrowsidebar.d.ts +0 -89
  165. package/dist/types/annotations/sidebar.d.ts +0 -104
  166. package/dist/types/annotations/view/annotationcounterbuttonview.d.ts +0 -33
  167. package/dist/types/annotations/view/annotationview.d.ts +0 -94
  168. package/dist/types/annotations/view/sidebaritemview.d.ts +0 -59
  169. package/dist/types/annotations/view/sidebarview.d.ts +0 -36
  170. package/dist/types/annotations/widesidebar.d.ts +0 -81
  171. package/dist/types/augmentation.d.ts +0 -56
  172. package/dist/types/comments/addcommentthreadcommand.d.ts +0 -39
  173. package/dist/types/comments/commentsarchive.d.ts +0 -35
  174. package/dist/types/comments/commentsarchiveui.d.ts +0 -42
  175. package/dist/types/comments/commentsediting.d.ts +0 -84
  176. package/dist/types/comments/commentsrepository.d.ts +0 -1134
  177. package/dist/types/comments/commentsui.d.ts +0 -37
  178. package/dist/types/comments/integrations/clipboard.d.ts +0 -30
  179. package/dist/types/comments/integrations/commentsrestrictededitingmode.d.ts +0 -21
  180. package/dist/types/comments/integrations/importword.d.ts +0 -25
  181. package/dist/types/comments/ui/commenteditor/commenteditor.d.ts +0 -40
  182. package/dist/types/comments/ui/commenteditor/commenteditorui.d.ts +0 -35
  183. package/dist/types/comments/ui/commenteditor/commenteditoruiview.d.ts +0 -40
  184. package/dist/types/comments/ui/commentthreadcontroller.d.ts +0 -68
  185. package/dist/types/comments/ui/view/basecommentthreadview.d.ts +0 -123
  186. package/dist/types/comments/ui/view/basecommentview.d.ts +0 -116
  187. package/dist/types/comments/ui/view/collapsedcommentsview.d.ts +0 -17
  188. package/dist/types/comments/ui/view/commentcontentview.d.ts +0 -18
  189. package/dist/types/comments/ui/view/commentinputview.d.ts +0 -90
  190. package/dist/types/comments/ui/view/commentsarchiveview.d.ts +0 -42
  191. package/dist/types/comments/ui/view/commentslistview.d.ts +0 -104
  192. package/dist/types/comments/ui/view/commentthreadheaderview.d.ts +0 -54
  193. package/dist/types/comments/ui/view/commentthreadinputview.d.ts +0 -45
  194. package/dist/types/comments/ui/view/commentthreadview.d.ts +0 -122
  195. package/dist/types/comments/ui/view/commentview.d.ts +0 -247
  196. package/dist/types/comments.d.ts +0 -39
  197. package/dist/types/commentsonly.d.ts +0 -37
  198. package/dist/types/config.d.ts +0 -202
  199. package/dist/types/index.d.ts +0 -28
  200. package/dist/types/utils/common-translations.d.ts +0 -13
  201. package/dist/types/utils/createmutationobserver.d.ts +0 -18
@@ -1,37 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/comments/commentsui
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- import CommentsRepository from './commentsrepository.js';
14
- import CommentsEditing from './commentsediting.js';
15
- import EditorAnnotations from '../annotations/editorannotations.js';
16
- import Annotations from '../annotations/annotations.js';
17
- /**
18
- * Creates `comment` {@link module:ui/button/buttonview~ButtonView ui button} and binds with
19
- * {@link module:comments/comments/addcommentthreadcommand~AddCommentThreadCommand}.
20
- *
21
- * Because of CommentsRepository handles UI of CommentThreads responsibility of this plugin is limited to
22
- * adjusting comments UX for the editor purpose.
23
- */
24
- export default class CommentsUI extends Plugin {
25
- /**
26
- * @inheritDoc
27
- */
28
- static get pluginName(): "CommentsUI";
29
- /**
30
- * @inheritDoc
31
- */
32
- static get requires(): readonly [typeof CommentsRepository, typeof CommentsEditing, typeof EditorAnnotations, typeof Annotations];
33
- /**
34
- * @inheritDoc
35
- */
36
- init(): void;
37
- }
@@ -1,30 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/integrations/clipboard
11
- */
12
- import { Plugin, type Editor } from 'ckeditor5/src/core.js';
13
- import { ClipboardPipeline, ClipboardMarkersUtils } from 'ckeditor5/src/clipboard.js';
14
- /**
15
- * Provides comments plugin integration for the clipboard feature.
16
- */
17
- export default class CommentsClipboard extends Plugin {
18
- /**
19
- * @inheritDoc
20
- */
21
- constructor(editor: Editor);
22
- /**
23
- * @inheritDoc
24
- */
25
- static get requires(): readonly [typeof ClipboardMarkersUtils, typeof ClipboardPipeline];
26
- /**
27
- * @inheritDoc
28
- */
29
- afterInit(): void;
30
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/comments/integrations/commentsrestrictededitingmode
11
- */
12
- import { Plugin } from 'ckeditor5/src/core.js';
13
- /**
14
- * Provides comments plugin integration for restricted editing mode feature from restricted editing package.
15
- */
16
- export default class CommentsRestrictedEditingMode extends Plugin {
17
- /**
18
- * @inheritDoc
19
- */
20
- afterInit(): void;
21
- }
@@ -1,25 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/integrations/importword
11
- */
12
- import { Plugin, type Editor } from 'ckeditor5/src/core.js';
13
- /**
14
- * Provides comments plugin integration for the import from Word feature.
15
- */
16
- export default class CommentsImportWord extends Plugin {
17
- /**
18
- * @inheritDoc
19
- */
20
- constructor(editor: Editor);
21
- /**
22
- * @inheritDoc
23
- */
24
- afterInit(): void;
25
- }
@@ -1,40 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/comments/ui/commenteditor/commenteditor
11
- */
12
- import { Editor, type EditorConfig } from 'ckeditor5/src/core.js';
13
- import CommentEditorUI from './commenteditorui.js';
14
- import { type PlaceholderableElement } from 'ckeditor5/src/engine.js';
15
- declare const CommentEditor_base: import("ckeditor5/src/utils.js").Mixed<typeof Editor, import("ckeditor5/src/utils.js").Observable>;
16
- export default class CommentEditor extends CommentEditor_base {
17
- static defaultPlugins: EditorConfig['plugins'];
18
- /**
19
- * The input placeholder.
20
- *
21
- * @observable
22
- */
23
- placeholder: string;
24
- placeholderElement: PlaceholderableElement | undefined;
25
- ui: CommentEditorUI;
26
- /**
27
- * @inheritDoc
28
- */
29
- constructor(config?: EditorConfig);
30
- create(): Promise<unknown>;
31
- /**
32
- * @inheritDoc
33
- */
34
- destroy(): Promise<void>;
35
- /**
36
- * Place the selection at the end of the editor data and focus the editable.
37
- */
38
- focus(): void;
39
- }
40
- export {};
@@ -1,35 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/comments/ui/commenteditor/commenteditorui
11
- */
12
- import { EditorUI } from 'ckeditor5/src/ui.js';
13
- import type { Editor } from 'ckeditor5/src/core.js';
14
- import CommentEditorUIView from './commenteditoruiview.js';
15
- export default class CommentEditorUI extends EditorUI {
16
- /**
17
- * The main (top–most) view of the editor UI.
18
- */
19
- readonly view: CommentEditorUIView;
20
- /**
21
- * Creates an instance of the classic editor UI class.
22
- *
23
- * @param editor The editor instance.
24
- */
25
- constructor(editor: Editor);
26
- /**
27
- * @inheritDoc
28
- */
29
- get element(): HTMLElement | null;
30
- init(): void;
31
- /**
32
- * @inheritDoc
33
- */
34
- destroy(): void;
35
- }
@@ -1,40 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/comments/ui/commenteditor/commenteditoruiview
11
- */
12
- import { InlineEditableUIView, EditorUIView, type ViewCollection } from 'ckeditor5/src/ui.js';
13
- import { type Locale } from 'ckeditor5/src/utils.js';
14
- import type { EditingView } from 'ckeditor5/src/engine.js';
15
- export default class CommentEditorUIView extends EditorUIView {
16
- /**
17
- * Collection of the child views located in the main (`.ck-editor__main`)
18
- * area of the UI.
19
- */
20
- readonly main: ViewCollection;
21
- /**
22
- * Editable UI view.
23
- */
24
- editable: InlineEditableUIView;
25
- /**
26
- * Creates an instance of the comments editor UI view.
27
- *
28
- * @param locale The locale instance.
29
- * @param editingView The editing view instance this view is related to.
30
- */
31
- constructor(locale: Locale, editingView: EditingView);
32
- /**
33
- * @inheritDoc
34
- */
35
- render(): void;
36
- /**
37
- * Focusable interface required by a FocusCycler.
38
- */
39
- focus(): void;
40
- }
@@ -1,68 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- import type { CommentThread } from '../commentsrepository.js';
10
- import type { default as BaseCommentThreadView } from './view/basecommentthreadview.js';
11
- declare const CommentThreadController_base: {
12
- new (): import("ckeditor5/src/utils.js").Observable;
13
- prototype: import("ckeditor5/src/utils.js").Observable;
14
- };
15
- /**
16
- * Controller for a comment thread.
17
- *
18
- * It takes a comment thread view, listens to events fired by that view and based on them performs actions on a comment thread model.
19
- */
20
- export default class CommentThreadController extends CommentThreadController_base {
21
- model: CommentThread;
22
- view: BaseCommentThreadView;
23
- /**
24
- * @param model Comment thread model.
25
- * @param view Comment thread view.
26
- */
27
- constructor(model: CommentThread, view: BaseCommentThreadView);
28
- /**
29
- * Submits the comment thread.
30
- */
31
- submit(): void;
32
- /**
33
- * Removes the comment thread.
34
- */
35
- remove(): void;
36
- /**
37
- * Resolves the comment thread.
38
- */
39
- resolve(): void;
40
- /**
41
- * Reopens the comment thread.
42
- */
43
- reopen(): void;
44
- /**
45
- * Adds a comment to the comment thread.
46
- *
47
- * @param commentContent Comment content.
48
- */
49
- addComment(commentContent: string): void;
50
- /**
51
- * Updates a comment that belongs to the comment thread.
52
- *
53
- * @param commentId Id of the comment to update.
54
- * @param commentContent Updated comment content.
55
- */
56
- updateComment(commentId: string, commentContent: string): void;
57
- /**
58
- * Removes a comment from the comment thread.
59
- *
60
- * @param commentId Id of the comment to remove.
61
- */
62
- removeComment(commentId: string): void;
63
- /**
64
- * Destroys `CommentThreadController` instance.
65
- */
66
- destroy(): void;
67
- }
68
- export {};
@@ -1,123 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/comments/ui/view/basecommentthreadview
11
- * @publicApi
12
- */
13
- import { View } from 'ckeditor5/src/ui.js';
14
- import type { Locale } from 'ckeditor5/src/utils.js';
15
- import CommentThreadInputView from './commentthreadinputview.js';
16
- import CommentsListView from './commentslistview.js';
17
- import CommentThreadHeaderView from './commentthreadheaderview.js';
18
- import type { User } from 'ckeditor5-collaboration/src/collaboration-core.js';
19
- import type { CommentThread } from '../../commentsrepository.js';
20
- import type { CommentThreadConfig } from '../../../config.js';
21
- /**
22
- * An abstract comment thread view class that should be used as a base for comment thread view implementations.
23
- * It provides some behaviors, flags and building blocks to use when creating a custom comment thread view class.
24
- *
25
- * For the usage examples check the {@glink features/collaboration/annotations/annotations-custom-view Custom annotation view} guide.
26
- */
27
- export default class BaseCommentThreadView extends View {
28
- locale: Locale;
29
- /**
30
- * Informs whether the comment thread view is in active state ("highlighted").
31
- * A comment thread view is in this state when it is focused or was activated by the user in any other way.
32
- *
33
- * @observable
34
- */
35
- isActive: boolean;
36
- /**
37
- * Informs whether the comment thread view is in unlinked state.
38
- * A comment thread view is in this state when its corresponding target has been removed from the content.
39
- *
40
- * @observable
41
- */
42
- isUnlinked: boolean;
43
- /**
44
- * Informs whether the comment thread has any changes that have not been saved.
45
- *
46
- * @observable
47
- */
48
- isDirty: boolean;
49
- /**
50
- * The number of comments.
51
- *
52
- * @observable
53
- */
54
- readonly length: number;
55
- /**
56
- * The list of comment views. It should be used as a part of the view template.
57
- *
58
- * @readonly
59
- */
60
- readonly commentsListView: CommentsListView;
61
- /**
62
- * The comment thread header. It should be used as a part of the view template.
63
- * This header is used only for resolved comment threads.
64
- *
65
- * @readonly
66
- */
67
- readonly commentThreadHeaderView: CommentThreadHeaderView;
68
- /**
69
- * The comment input area view. It should be used as a part of the view template.
70
- *
71
- * @readonly
72
- */
73
- readonly commentThreadInputView: CommentThreadInputView;
74
- /**
75
- * @param locale The localization service instance.
76
- * @param model The model on which the view will base.
77
- * @param localUser The current local user.
78
- * @param config Additional view configuration.
79
- */
80
- constructor(locale: Locale, model: CommentThread, localUser: User, config: CommentThreadConfig);
81
- /**
82
- * Focuses the view.
83
- */
84
- focus(): void;
85
- /**
86
- * @inheritDoc
87
- */
88
- destroy(): Promise<void>;
89
- }
90
- /**
91
- * Fired when a user created a first comment in the comment thread. Then the comment thread is submitted and saved.
92
- *
93
- * @eventName ~BaseCommentThreadView#submitCommentThread
94
- */
95
- export type UISubmitCommentThreadEvent = {
96
- name: 'submitCommentThread';
97
- args: [];
98
- };
99
- /**
100
- * Fired when a user performed an action that should lead to removing the comment thread.
101
- *
102
- * This event is not fired by default by any component created by `BaseCommentThreadView`.
103
- * If you create a view class extending `BaseCommentThreadView`, you should provide
104
- * a UI element that will fire this event.
105
- *
106
- * This event is fired by default when an empty comment thread view (with no comments)
107
- * loses focus.
108
- *
109
- * @eventName ~BaseCommentThreadView#removeCommentThread
110
- */
111
- export type UIRemoveCommentThreadEvent = {
112
- name: 'removeCommentThread';
113
- args: [];
114
- };
115
- /**
116
- * Fired when a user performed an action that should lead to resolve the comment thread.
117
- *
118
- * @eventName ~BaseCommentThreadView#resolveCommentThread
119
- */
120
- export type UIResolveCommentThreadEvent = {
121
- name: 'resolveCommentThread';
122
- args: [id: string];
123
- };
@@ -1,116 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/comments/ui/view/basecommentview
11
- * @publicApi
12
- */
13
- import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
14
- import type { Locale } from 'ckeditor5/src/utils.js';
15
- import type { Comment } from '../../commentsrepository.js';
16
- import type { CommentViewConfig } from '../../../config.js';
17
- /**
18
- * An abstract comment view class that should be used as a base for comment view implementations.
19
- *
20
- * It provides some behaviors, flags and building blocks to use when creating a custom comment view class.
21
- */
22
- export default class BaseCommentView extends View {
23
- locale: Locale;
24
- /**
25
- * Informs whether the comment view is in the editing mode.
26
- *
27
- * @observable
28
- */
29
- isEditMode: boolean;
30
- /**
31
- * Flag indicating whether the comment view displays an actual comment (`false`) or is a system message (`true`).
32
- * System message comment should not include any UI elements which allow for editing the comment as it is not an actual comment.
33
- *
34
- * @readonly
35
- */
36
- isSystemComment: boolean;
37
- /**
38
- * Stores the currently displayed sub-view.
39
- *
40
- * This is a collection that always includes one view: comment content view or comment input view.
41
- * Depending whether the comment is in editing mode or not, one of the views is in the collection.
42
- * When the comment mode changes, the content of this collection also changes.
43
- *
44
- * By default, the comment is in the "content mode" and this view collection stores the comment content view.
45
- */
46
- readonly visibleView: ViewCollection;
47
- /**
48
- * @param locale The localization service instance.
49
- * @param model The model on which the view will base.
50
- * @param config Additional view configuration.
51
- */
52
- constructor(locale: Locale, model: Comment, config: CommentViewConfig);
53
- /**
54
- * Expands the view.
55
- */
56
- expand(): void;
57
- /**
58
- * Collapses the view.
59
- */
60
- collapse(): void;
61
- /**
62
- * Focuses the view.
63
- */
64
- focus(): void;
65
- /**
66
- * @inheritDoc
67
- */
68
- destroy(): Promise<void>;
69
- /**
70
- * Switches the comment to the editing mode.
71
- */
72
- switchToEditMode(): void;
73
- /**
74
- * Switches the comment back from the editing mode to the content display mode.
75
- */
76
- switchToDisplayMode(): void;
77
- }
78
- /**
79
- * Fired when a user performed an action that should lead to creating a new comment in the comment thread.
80
- *
81
- * This event is fired by default when the comment input field of the comment thread is submitted.
82
- *
83
- * @eventName ~BaseCommentView#addComment
84
- * @param content The content of the new comment.
85
- */
86
- export type UIAddCommentEvent = {
87
- name: 'addComment';
88
- args: [content: string];
89
- };
90
- /**
91
- * Fired when a user performed an action that should lead to updating the comment content.
92
- *
93
- * This event is fired by default when the comment input field of a comment is submitted.
94
- *
95
- * @param commentId The ID of the updated comment.
96
- * @param commentContent The updated comment content.
97
- * @eventName ~BaseCommentView#updateComment
98
- */
99
- export type UIUpdateCommentEvent = {
100
- name: 'updateComment';
101
- args: [commentId: string, commentContent: string];
102
- };
103
- /**
104
- * Fired when a user performed an action that should lead to removing a comment.
105
- *
106
- * This event is not fired by default by any component created by {@link module:comments/comments/ui/view/basecommentview~BaseCommentView}.
107
- * If you create a view class extending {@link module:comments/comments/ui/view/basecommentview~BaseCommentView} you should provide
108
- * a UI element that will fire this event.
109
- *
110
- * @param commentId The ID of the removed comment.
111
- * @eventName ~BaseCommentView#removeComment
112
- */
113
- export type UIRemoveCommentEvent = {
114
- name: 'removeComment';
115
- args: [commentId: string];
116
- };
@@ -1,17 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/comments/ui/view/collapsedcommentsview
11
- */
12
- import { View } from 'ckeditor5/src/ui.js';
13
- import type { Locale } from 'ckeditor5/src/utils.js';
14
- export default class CollapsedCommentsView extends View {
15
- count: number | undefined;
16
- constructor(locale: Locale);
17
- }
@@ -1,18 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/comments/ui/view/commentcontentview
11
- */
12
- import { View } from 'ckeditor5/src/ui.js';
13
- import type { Locale } from 'ckeditor5/src/utils.js';
14
- export default class CommentContentView extends View {
15
- content: string;
16
- constructor(locale: Locale);
17
- render(): void;
18
- }
@@ -1,90 +0,0 @@
1
- /**
2
- * @license Copyright (c) 2003-2024, 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
- * @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
7
- * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
8
- */
9
- /**
10
- * @module comments/comments/ui/view/commentinputview
11
- */
12
- import { View, ButtonView } from 'ckeditor5/src/ui.js';
13
- import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
14
- import { type EditorConfig, type DataApi } from 'ckeditor5/src/core.js';
15
- import CommentEditor from '../commenteditor/commenteditor.js';
16
- /**
17
- * A view for the comment input section that includes a comment editor.
18
- */
19
- export default class CommentInputView extends View {
20
- /**
21
- * Comment editor.
22
- */
23
- editor: CommentEditor & DataApi | null;
24
- /**
25
- * The input value (comment editor content).
26
- *
27
- * @observable
28
- */
29
- value: string;
30
- /**
31
- * When set to `true` it is not possible to submit the commit.
32
- *
33
- * @observable
34
- */
35
- disabledSubmit: boolean;
36
- /**
37
- * Specifies whether the buttons should be visible (`true`) or hidden (`false`).
38
- *
39
- * @observable
40
- */
41
- showButtons: boolean;
42
- /**
43
- * The comment editor placeholder.
44
- *
45
- * @observable
46
- */
47
- placeholder: string;
48
- /**
49
- * The submit button label.
50
- *
51
- * @observable
52
- */
53
- submitLabel: string;
54
- element: HTMLElement;
55
- /**
56
- * Keystroke handler for the view.
57
- */
58
- keystrokes: KeystrokeHandler;
59
- /**
60
- * Focus tracker for the view.
61
- */
62
- focusTracker: FocusTracker;
63
- /**
64
- * Button view for the button which submits the comment.
65
- */
66
- submitButtonView: ButtonView;
67
- /**
68
- * Button view for the button which cancels comment input.
69
- */
70
- cancelButtonView: ButtonView;
71
- constructor(locale: Locale, editorConfig?: EditorConfig);
72
- /**
73
- * @inheritDoc
74
- */
75
- render(): void;
76
- /**
77
- * Creates the comment editor instance.
78
- *
79
- * @returns Promise resolved after the editor instance is initialized.
80
- */
81
- createEditor(): Promise<CommentEditor | undefined>;
82
- /**
83
- * Focuses the view.
84
- */
85
- focus(): void;
86
- /**
87
- * @inheritDoc
88
- */
89
- destroy(): Promise<void>;
90
- }