@ckeditor/ckeditor5-comments 41.2.1 → 41.3.0-alpha.2

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/dist/content-index.css +332 -0
  3. package/dist/editor-index.css +902 -0
  4. package/dist/index.css +1874 -0
  5. package/dist/translations/af.d.ts +8 -0
  6. package/dist/translations/af.js +23 -0
  7. package/dist/translations/ar.d.ts +8 -0
  8. package/dist/translations/ar.js +23 -0
  9. package/dist/translations/bg.d.ts +8 -0
  10. package/dist/translations/bg.js +23 -0
  11. package/dist/translations/bn.d.ts +8 -0
  12. package/dist/translations/bn.js +23 -0
  13. package/dist/translations/bs.d.ts +8 -0
  14. package/dist/translations/bs.js +23 -0
  15. package/dist/translations/ca.d.ts +8 -0
  16. package/dist/translations/ca.js +23 -0
  17. package/dist/translations/cs.d.ts +8 -0
  18. package/dist/translations/cs.js +23 -0
  19. package/dist/translations/da.d.ts +8 -0
  20. package/dist/translations/da.js +23 -0
  21. package/dist/translations/de-ch.d.ts +8 -0
  22. package/dist/translations/de-ch.js +23 -0
  23. package/dist/translations/de.d.ts +8 -0
  24. package/dist/translations/de.js +23 -0
  25. package/dist/translations/el.d.ts +8 -0
  26. package/dist/translations/el.js +23 -0
  27. package/dist/translations/en-au.d.ts +8 -0
  28. package/dist/translations/en-au.js +23 -0
  29. package/dist/translations/en.d.ts +8 -0
  30. package/dist/translations/en.js +23 -0
  31. package/dist/translations/es-co.d.ts +8 -0
  32. package/dist/translations/es-co.js +23 -0
  33. package/dist/translations/es.d.ts +8 -0
  34. package/dist/translations/es.js +23 -0
  35. package/dist/translations/et.d.ts +8 -0
  36. package/dist/translations/et.js +23 -0
  37. package/dist/translations/fa.d.ts +8 -0
  38. package/dist/translations/fa.js +23 -0
  39. package/dist/translations/fi.d.ts +8 -0
  40. package/dist/translations/fi.js +23 -0
  41. package/dist/translations/fr.d.ts +8 -0
  42. package/dist/translations/fr.js +23 -0
  43. package/dist/translations/gl.d.ts +8 -0
  44. package/dist/translations/gl.js +23 -0
  45. package/dist/translations/he.d.ts +8 -0
  46. package/dist/translations/he.js +23 -0
  47. package/dist/translations/hi.d.ts +8 -0
  48. package/dist/translations/hi.js +23 -0
  49. package/dist/translations/hr.d.ts +8 -0
  50. package/dist/translations/hr.js +23 -0
  51. package/dist/translations/hu.d.ts +8 -0
  52. package/dist/translations/hu.js +23 -0
  53. package/dist/translations/id.d.ts +8 -0
  54. package/dist/translations/id.js +23 -0
  55. package/dist/translations/it.d.ts +8 -0
  56. package/dist/translations/it.js +23 -0
  57. package/dist/translations/ja.d.ts +8 -0
  58. package/dist/translations/ja.js +23 -0
  59. package/dist/translations/jv.d.ts +8 -0
  60. package/dist/translations/jv.js +23 -0
  61. package/dist/translations/ko.d.ts +8 -0
  62. package/dist/translations/ko.js +23 -0
  63. package/dist/translations/lt.d.ts +8 -0
  64. package/dist/translations/lt.js +23 -0
  65. package/dist/translations/lv.d.ts +8 -0
  66. package/dist/translations/lv.js +23 -0
  67. package/dist/translations/ms.d.ts +8 -0
  68. package/dist/translations/ms.js +23 -0
  69. package/dist/translations/nl.d.ts +8 -0
  70. package/dist/translations/nl.js +23 -0
  71. package/dist/translations/no.d.ts +8 -0
  72. package/dist/translations/no.js +23 -0
  73. package/dist/translations/pl.d.ts +8 -0
  74. package/dist/translations/pl.js +23 -0
  75. package/dist/translations/pt-br.d.ts +8 -0
  76. package/dist/translations/pt-br.js +23 -0
  77. package/dist/translations/pt.d.ts +8 -0
  78. package/dist/translations/pt.js +23 -0
  79. package/dist/translations/ro.d.ts +8 -0
  80. package/dist/translations/ro.js +23 -0
  81. package/dist/translations/ru.d.ts +8 -0
  82. package/dist/translations/ru.js +23 -0
  83. package/dist/translations/sk.d.ts +8 -0
  84. package/dist/translations/sk.js +23 -0
  85. package/dist/translations/sq.d.ts +8 -0
  86. package/dist/translations/sq.js +23 -0
  87. package/dist/translations/sr-latn.d.ts +8 -0
  88. package/dist/translations/sr-latn.js +23 -0
  89. package/dist/translations/sr.d.ts +8 -0
  90. package/dist/translations/sr.js +23 -0
  91. package/dist/translations/sv.d.ts +8 -0
  92. package/dist/translations/sv.js +23 -0
  93. package/dist/translations/th.d.ts +8 -0
  94. package/dist/translations/th.js +23 -0
  95. package/dist/translations/tk.d.ts +8 -0
  96. package/dist/translations/tk.js +23 -0
  97. package/dist/translations/tr.d.ts +8 -0
  98. package/dist/translations/tr.js +23 -0
  99. package/dist/translations/tt.d.ts +8 -0
  100. package/dist/translations/tt.js +23 -0
  101. package/dist/translations/ug.d.ts +8 -0
  102. package/dist/translations/ug.js +23 -0
  103. package/dist/translations/uk.d.ts +8 -0
  104. package/dist/translations/uk.js +23 -0
  105. package/dist/translations/ur.d.ts +8 -0
  106. package/dist/translations/ur.js +23 -0
  107. package/dist/translations/vi.d.ts +8 -0
  108. package/dist/translations/vi.js +23 -0
  109. package/dist/translations/zh-cn.d.ts +8 -0
  110. package/dist/translations/zh-cn.js +23 -0
  111. package/dist/translations/zh.d.ts +8 -0
  112. package/dist/translations/zh.js +23 -0
  113. package/dist/types/annotations/annotation.d.ts +94 -0
  114. package/dist/types/annotations/annotationcollection.d.ts +102 -0
  115. package/dist/types/annotations/annotations.d.ts +158 -0
  116. package/dist/types/annotations/annotationsuis.d.ts +236 -0
  117. package/dist/types/annotations/editorannotations.d.ts +71 -0
  118. package/dist/types/annotations/inlineannotations.d.ts +94 -0
  119. package/dist/types/annotations/narrowsidebar.d.ts +89 -0
  120. package/dist/types/annotations/sidebar.d.ts +104 -0
  121. package/dist/types/annotations/view/annotationcounterbuttonview.d.ts +33 -0
  122. package/dist/types/annotations/view/annotationview.d.ts +94 -0
  123. package/dist/types/annotations/view/sidebaritemview.d.ts +59 -0
  124. package/dist/types/annotations/view/sidebarview.d.ts +36 -0
  125. package/dist/types/annotations/widesidebar.d.ts +81 -0
  126. package/dist/types/augmentation.d.ts +56 -0
  127. package/dist/types/comments/addcommentthreadcommand.d.ts +39 -0
  128. package/dist/types/comments/commentsarchive.d.ts +35 -0
  129. package/dist/types/comments/commentsarchiveui.d.ts +42 -0
  130. package/dist/types/comments/commentsediting.d.ts +84 -0
  131. package/dist/types/comments/commentsrepository.d.ts +1134 -0
  132. package/dist/types/comments/commentsui.d.ts +37 -0
  133. package/dist/types/comments/integrations/clipboard.d.ts +30 -0
  134. package/dist/types/comments/integrations/commentsrestrictededitingmode.d.ts +21 -0
  135. package/dist/types/comments/integrations/importword.d.ts +25 -0
  136. package/dist/types/comments/ui/commenteditor/commenteditor.d.ts +40 -0
  137. package/dist/types/comments/ui/commenteditor/commenteditorui.d.ts +35 -0
  138. package/dist/types/comments/ui/commenteditor/commenteditoruiview.d.ts +40 -0
  139. package/dist/types/comments/ui/commentthreadcontroller.d.ts +68 -0
  140. package/dist/types/comments/ui/view/basecommentthreadview.d.ts +123 -0
  141. package/dist/types/comments/ui/view/basecommentview.d.ts +116 -0
  142. package/dist/types/comments/ui/view/collapsedcommentsview.d.ts +17 -0
  143. package/dist/types/comments/ui/view/commentcontentview.d.ts +18 -0
  144. package/dist/types/comments/ui/view/commentinputview.d.ts +90 -0
  145. package/dist/types/comments/ui/view/commentsarchiveview.d.ts +42 -0
  146. package/dist/types/comments/ui/view/commentslistview.d.ts +104 -0
  147. package/dist/types/comments/ui/view/commentthreadheaderview.d.ts +54 -0
  148. package/dist/types/comments/ui/view/commentthreadinputview.d.ts +45 -0
  149. package/dist/types/comments/ui/view/commentthreadview.d.ts +122 -0
  150. package/dist/types/comments/ui/view/commentview.d.ts +247 -0
  151. package/dist/types/comments.d.ts +39 -0
  152. package/dist/types/commentsonly.d.ts +37 -0
  153. package/dist/types/config.d.ts +202 -0
  154. package/dist/types/index.d.ts +28 -0
  155. package/dist/types/utils/common-translations.d.ts +13 -0
  156. package/dist/types/utils/createmutationobserver.d.ts +18 -0
  157. package/package.json +4 -3
  158. package/src/annotations/annotation.js +1 -1
  159. package/src/annotations/annotationcollection.js +1 -1
  160. package/src/annotations/annotations.js +1 -1
  161. package/src/annotations/annotationsuis.js +1 -1
  162. package/src/annotations/editorannotations.js +1 -1
  163. package/src/annotations/inlineannotations.js +1 -1
  164. package/src/annotations/narrowsidebar.js +1 -1
  165. package/src/annotations/sidebar.js +1 -1
  166. package/src/annotations/view/annotationcounterbuttonview.js +1 -1
  167. package/src/annotations/view/annotationview.js +1 -1
  168. package/src/annotations/view/sidebaritemview.js +1 -1
  169. package/src/annotations/view/sidebarview.js +1 -1
  170. package/src/annotations/widesidebar.js +1 -1
  171. package/src/comments/addcommentthreadcommand.js +1 -1
  172. package/src/comments/commentsarchive.js +1 -1
  173. package/src/comments/commentsarchiveui.js +1 -1
  174. package/src/comments/commentsediting.js +1 -1
  175. package/src/comments/commentsrepository.js +1 -1
  176. package/src/comments/commentsui.js +1 -1
  177. package/src/comments/integrations/clipboard.js +1 -1
  178. package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
  179. package/src/comments/integrations/importword.js +1 -1
  180. package/src/comments/ui/commenteditor/commenteditor.js +1 -1
  181. package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
  182. package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
  183. package/src/comments/ui/commentthreadcontroller.js +1 -1
  184. package/src/comments/ui/view/basecommentthreadview.js +1 -1
  185. package/src/comments/ui/view/basecommentview.js +1 -1
  186. package/src/comments/ui/view/collapsedcommentsview.js +1 -1
  187. package/src/comments/ui/view/commentcontentview.js +1 -1
  188. package/src/comments/ui/view/commentinputview.js +1 -1
  189. package/src/comments/ui/view/commentsarchiveview.js +1 -1
  190. package/src/comments/ui/view/commentslistview.js +1 -1
  191. package/src/comments/ui/view/commentthreadheaderview.js +1 -1
  192. package/src/comments/ui/view/commentthreadinputview.js +1 -1
  193. package/src/comments/ui/view/commentthreadview.js +1 -1
  194. package/src/comments/ui/view/commentview.js +1 -1
  195. package/src/comments.js +1 -1
  196. package/src/commentsonly.js +1 -1
  197. package/src/config.d.ts +17 -10
  198. package/src/index.d.ts +1 -1
  199. package/src/index.js +1 -1
  200. package/src/utils/common-translations.js +1 -1
  201. package/src/utils/createmutationobserver.js +1 -1
@@ -0,0 +1,42 @@
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/commentslistview
11
+ */
12
+ import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
13
+ import { type Locale } from 'ckeditor5/src/utils.js';
14
+ import type AnnotationView from '../../../annotations/view/annotationview.js';
15
+ /**
16
+ * A view representing the content of comments archive.
17
+ */
18
+ export default class CommentsArchiveView extends View {
19
+ /**
20
+ * The flag indicating whether there are items to display in the comments archive.
21
+ *
22
+ * @observable
23
+ */
24
+ isEmpty: boolean;
25
+ /**
26
+ * @param locale The localization service instance.
27
+ * @param annotationViews Resolved comment thread annotation views to render inside the comments archive.
28
+ */
29
+ constructor(locale: Locale, annotationViews: ViewCollection<AnnotationView>);
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ render(): void;
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ destroy(): void;
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ focus(): void;
42
+ }
@@ -0,0 +1,104 @@
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/commentslistview
11
+ */
12
+ import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
13
+ import { type Locale } from 'ckeditor5/src/utils.js';
14
+ import type { CommentThread } from '../../commentsrepository.js';
15
+ import type CommentView from './commentview.js';
16
+ import type { CommentThreadConfig } from '../../../config.js';
17
+ /**
18
+ * A view representing the list of comments. It should be used as a part of the comment thread view.
19
+ */
20
+ export default class CommentsListView extends View {
21
+ locale: Locale;
22
+ /**
23
+ * Informs whether the list contains any comment view that is in the editing mode.
24
+ *
25
+ * @observable
26
+ */
27
+ hasDirtyComment: boolean;
28
+ /**
29
+ * Number of comments in the list.
30
+ *
31
+ * @observable
32
+ */
33
+ length: number;
34
+ /**
35
+ * Informs whether the comments list view is in the active state ("highlighted").
36
+ * Comment list view is in that state when it is focused or it was activated by the user in any different way.
37
+ *
38
+ * @observable
39
+ */
40
+ isActive: boolean;
41
+ /**
42
+ * View collection which holds all comment views to be displayed.
43
+ * It may also contain collapsed count view if the comments list view is collapsed and some comment views are hidden.
44
+ *
45
+ * @readonly
46
+ */
47
+ readonly visibleViews: ViewCollection;
48
+ /**
49
+ * View collection which holds all comment views created for given comment thread.
50
+ *
51
+ * @readonly
52
+ */
53
+ readonly commentViews: ViewCollection;
54
+ /**
55
+ * Comment view used to display information that comment has been resolved.
56
+ *
57
+ * @readonly
58
+ */
59
+ resolvedCommentView: CommentView | null;
60
+ /**
61
+ * @param locale The localization service instance.
62
+ * @param model The model on which the view will base.
63
+ * @param config Additional view configuration.
64
+ */
65
+ constructor(locale: Locale, model: CommentThread, config: CommentThreadConfig);
66
+ /**
67
+ * @inheritDoc
68
+ */
69
+ render(): void;
70
+ /**
71
+ * Focuses the view.
72
+ */
73
+ focus(): void;
74
+ /**
75
+ * @inheritDoc
76
+ */
77
+ destroy(): void;
78
+ /**
79
+ * Refreshes the list of the visible views.
80
+ *
81
+ * When doing so, it performs a minimal amount of changes, so that views are not re-added, which might cause undesirable effects
82
+ * like focus loss or glitches due to CSS animations.
83
+ *
84
+ * The comments list may be collapsed or expanded:
85
+ *
86
+ * * it is expanded, if it {@link ~#isActive is active},
87
+ * * it is expanded, if {@link module:comments/comments/commentsrepository~CommentThread#weight comment thread weight}
88
+ * is lower than allowed (`config.comments.maxThreadTotalWeight`),
89
+ * * it is expanded, if it {@link ~#hasDirtyComment has any comments in edit mode},
90
+ * * it is collapsed, if neither of above is true.
91
+ *
92
+ * When comments list is in collapsed state, it displays at most `config.comments.maxCommentsWhenCollapsed` comment views:
93
+ *
94
+ * * first comment view,
95
+ * * {@link ~#_collapsedCommentsView collapsed comments counter} (if there are any hidden views),
96
+ * * appropriate number of the comments from the bottom of the thread.
97
+ *
98
+ * All the comments are also {@link module:comments/comments/ui/view/basecommentview~BaseCommentView#collapse set to collapsed state}.
99
+ *
100
+ * When comments list in in expanded state, it displays all comment views for all comments. All the comments are also
101
+ * {@link module:comments/comments/ui/view/basecommentview~BaseCommentView#expand set to expanded state}.
102
+ */
103
+ refreshVisibleViews(): void;
104
+ }
@@ -0,0 +1,54 @@
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/commentthreadheaderview
11
+ */
12
+ import { View, ButtonView } from 'ckeditor5/src/ui.js';
13
+ import type { Locale } from 'ckeditor5/src/utils.js';
14
+ import type { CommentThread } from '../../commentsrepository.js';
15
+ export declare const MAX_CONTENT_LENGTH = 150;
16
+ /**
17
+ * A view for the comment thread header.
18
+ */
19
+ export default class CommentThreadHeaderView extends View {
20
+ locale: Locale;
21
+ /**
22
+ * Defines whether the context value exists.
23
+ *
24
+ * @observable
25
+ */
26
+ hasContext: boolean;
27
+ /**
28
+ * Context value to display in the header.
29
+ *
30
+ * @observable
31
+ */
32
+ contextValue: string;
33
+ /**
34
+ * Button view for the button which reopen the comment thread.
35
+ */
36
+ reopenButtonView: ButtonView;
37
+ /**
38
+ * @inheritDoc
39
+ */
40
+ constructor(locale: Locale, model: CommentThread);
41
+ /**
42
+ * @inheritDoc
43
+ */
44
+ render(): void;
45
+ }
46
+ /**
47
+ * Fired when a user performed an action that should lead to reopen the resolved comment thread.
48
+ *
49
+ * @eventName ~CommentThreadHeaderView#reopenCommentThread
50
+ */
51
+ export type UIReopenCommentThreadEvent = {
52
+ name: 'reopenCommentThread';
53
+ args: [id: string];
54
+ };
@@ -0,0 +1,45 @@
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/commentthreadinputview
11
+ */
12
+ import { View } from 'ckeditor5/src/ui.js';
13
+ import CommentInputView from './commentinputview.js';
14
+ import type { Locale } from 'ckeditor5/src/utils.js';
15
+ import type { EditorConfig } from 'ckeditor5/src/core.js';
16
+ import { UserView, type User } from 'ckeditor5-collaboration/src/collaboration-core.js';
17
+ /**
18
+ * View that represents comment input area for a comment thread. Includes editor, user view and buttons.
19
+ */
20
+ export default class CommentThreadInputView extends View {
21
+ /**
22
+ * Specifies whether the comment input view should be visible (`true`) or hidden (`false`).
23
+ *
24
+ * @observable
25
+ */
26
+ showInput: boolean;
27
+ /**
28
+ * Comment input view.
29
+ */
30
+ commentInputView: CommentInputView;
31
+ /**
32
+ * User view for the input area. Presents the local user.
33
+ */
34
+ userView: UserView;
35
+ /**
36
+ * @param locale The localization service instance.
37
+ * @param localUser Current local user.
38
+ * @param editorConfig
39
+ */
40
+ constructor(locale: Locale, localUser: User, editorConfig: EditorConfig);
41
+ /**
42
+ * @inheritDoc
43
+ */
44
+ destroy(): Promise<void>;
45
+ }
@@ -0,0 +1,122 @@
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/commentthreadview
11
+ * @publicApi
12
+ */
13
+ import { type Locale } from 'ckeditor5/src/utils.js';
14
+ import { type User } from 'ckeditor5-collaboration/src/collaboration-core.js';
15
+ import { ButtonView, type TemplateDefinition, type ViewCollection } from 'ckeditor5/src/ui.js';
16
+ import BaseCommentThreadView from './basecommentthreadview.js';
17
+ import type { CommentThread } from '../../commentsrepository.js';
18
+ import type { CommentThreadConfig } from '../../../config.js';
19
+ declare const CommentThreadView_base: import("ckeditor5/src/utils.js").Mixed<typeof BaseCommentThreadView, import("@ckeditor/ckeditor5-collaboration-core/src/utils/confirmmixin.js").ConfirmApi>;
20
+ /**
21
+ * The default view for comment thread.
22
+ */
23
+ export default class CommentThreadView extends CommentThreadView_base {
24
+ isConfirm: boolean;
25
+ cancelConfirm: () => void;
26
+ showConfirm: (key: string, element: unknown) => Promise<void>;
27
+ /**
28
+ * The locale instance.
29
+ */
30
+ readonly locale: Locale;
31
+ /**
32
+ * A property used by the template.
33
+ *
34
+ * It works as a visual indicator for the user that an action is about to be performed.
35
+ * The value of this property is used in setting the CSS class.
36
+ * The property is used when the user interacts with the view.
37
+ *
38
+ * @observable
39
+ */
40
+ actionIndicator: string | null;
41
+ /**
42
+ * View collection which holds all comment thread children elements.
43
+ *
44
+ * These views are:
45
+ *
46
+ * * {@link ~CommentThreadView#commentThreadHeaderView `commentThreadHeaderView`} (added at the beginning when the comment thread is
47
+ * resolved),
48
+ * * {@link ~CommentThreadView#commentsListView `commentsListView`},
49
+ * * {@link ~CommentThreadView#commentThreadInputView `commentThreadInputView`}.
50
+ *
51
+ * @readonly
52
+ */
53
+ readonly commentThreadChildren: ViewCollection;
54
+ /**
55
+ * `ConfirmView` uses this element as a container for confirmation dialog.
56
+ *
57
+ * The element is set after `view#render()` is called.
58
+ *
59
+ * @member {HTMLElement|null} #containerElement
60
+ */
61
+ containerElement: HTMLElement | null;
62
+ /**
63
+ * Resolve button view. Resolve button fires the 'resolveCommentThread' event when submitted.
64
+ *
65
+ * @readonly
66
+ */
67
+ readonly resolveButton: ButtonView;
68
+ /**
69
+ * @inheritDoc
70
+ */
71
+ constructor(locale: Locale, model: CommentThread, localUser: User, config: CommentThreadConfig);
72
+ /**
73
+ * Returns a template definition that will be passed to {@link module:ui/view~View#setTemplate}.
74
+ *
75
+ * Overwrite this method if you want to set a custom template for the comment thread view.
76
+ *
77
+ * The default template looks as follows:
78
+ *
79
+ * ```ts
80
+ * const bind = this.bindTemplate;
81
+ *
82
+ * {
83
+ * tag: 'div',
84
+ *
85
+ * attributes: {
86
+ * class: [
87
+ * 'ck-thread',
88
+ * 'ck-reset_all-excluded',
89
+ * bind.if( 'isActive', 'ck-thread--active' ),
90
+ * bind.if( 'isUnlinked', 'ck-thread--unlinked' ),
91
+ * bind.if( 'isConfirm', 'ck-thread--remove-confirmation' ),
92
+ * bind.to( 'actionIndicator', value => value ? `ck-thread--${ value }` : '' )
93
+ * ],
94
+ * 'data-thread-id': this._model.id,
95
+ * // Needed for managing focus after adding new comment.
96
+ * tabindex: -1
97
+ * },
98
+ *
99
+ * children: [
100
+ * {
101
+ * tag: 'div',
102
+ * attributes: {
103
+ * class: 'ck-thread__container'
104
+ * },
105
+ * children: this.commentThreadChildren
106
+ * }
107
+ * ]
108
+ * };
109
+ * ```
110
+ *
111
+ * See the {@glink features/collaboration/annotations/annotations-custom-view Annotation custom view guide} to learn more about
112
+ * the possible annotation customizations.
113
+ *
114
+ * @returns The definition of a comment thread view's template.
115
+ */
116
+ getTemplate(): TemplateDefinition;
117
+ /**
118
+ * @inheritDoc
119
+ */
120
+ render(): void;
121
+ }
122
+ export {};
@@ -0,0 +1,247 @@
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/commentview
11
+ * @publicApi
12
+ */
13
+ import { type Locale } from 'ckeditor5/src/utils.js';
14
+ import { ButtonView, type TemplateDefinition, type ViewCollection, type DropdownView } from 'ckeditor5/src/ui.js';
15
+ import { UserView } from 'ckeditor5-collaboration/src/collaboration-core.js';
16
+ import BaseCommentView from './basecommentview.js';
17
+ import type { Comment } from '../../commentsrepository.js';
18
+ import type CommentInputView from './commentinputview.js';
19
+ import type { CommentViewConfig } from '../../../config.js';
20
+ declare const CommentView_base: import("ckeditor5/src/utils.js").Mixed<typeof BaseCommentView, import("@ckeditor/ckeditor5-collaboration-core/src/utils/confirmmixin.js").ConfirmApi>;
21
+ /**
22
+ * The default view for comment.
23
+ */
24
+ export default class CommentView extends CommentView_base {
25
+ locale: Locale;
26
+ isConfirm: boolean;
27
+ cancelConfirm: () => void;
28
+ showConfirm: (key: string, element: unknown) => Promise<void>;
29
+ /**
30
+ * A property used by the template.
31
+ *
32
+ * It works as a visual indicator for the user that an action is about to be performed.
33
+ * The value of this property is used in setting the CSS class.
34
+ * The property is used when the user interacts with the view.
35
+ *
36
+ * @observable
37
+ */
38
+ actionIndicator: string | null;
39
+ /**
40
+ * Comment editor placeholder value.
41
+ *
42
+ * @observable
43
+ */
44
+ placeholder: string;
45
+ /**
46
+ * Comment creation date.
47
+ *
48
+ * @observable
49
+ */
50
+ authoredAt: Date;
51
+ /**
52
+ * Comment resolved date.
53
+ *
54
+ * @observable
55
+ */
56
+ resolvedAt: Date | null;
57
+ /**
58
+ * Collection for UI elements that manage the comment.
59
+ *
60
+ * Elements that may be found in the action bar (depending on the comment view properties):
61
+ *
62
+ * * the resolve comment thread button (only if the comment is the first comment),
63
+ * * a dropdown with actions ({@link ~CommentView#dropdown `dropdown`}).
64
+ */
65
+ actionBar: ViewCollection;
66
+ /**
67
+ * View collection which holds all the comments dropdown elements.
68
+ *
69
+ * May include, depending on the view properties:
70
+ *
71
+ * * {@link ~CommentView#editButton `editButton`},
72
+ * * {@link ~CommentView#removeButton `removeButton`}.
73
+ */
74
+ items: ViewCollection<ButtonView>;
75
+ /**
76
+ * Dropdown containing comment action buttons defined in {@link ~CommentView#items `items`}.
77
+ */
78
+ dropdown: DropdownView;
79
+ /**
80
+ * Edit button view. Edit button switches the comment to the editing mode.
81
+ */
82
+ editButton: ButtonView;
83
+ /**
84
+ * Remove button view. Remove button shows a confirmation box that fires the `removeComment` event when submitted.
85
+ */
86
+ removeButton: ButtonView;
87
+ /**
88
+ * User view for the comment. Presents the comment author.
89
+ */
90
+ userView: UserView;
91
+ /**
92
+ * @inheritDoc
93
+ */
94
+ constructor(locale: Locale, model: Comment, config: CommentViewConfig);
95
+ /**
96
+ * Returns a template definition that will be passed to {@link module:ui/view~View#setTemplate}.
97
+ *
98
+ * Overwrite this method if you want to set a custom template for the comment view.
99
+ *
100
+ * The default template looks as follows:
101
+ *
102
+ * ```ts
103
+ * const bind = this.bindTemplate;
104
+ *
105
+ * {
106
+ * tag: 'li',
107
+ *
108
+ * attributes: {
109
+ * class: [
110
+ * 'ck-comment__wrapper',
111
+ * bind.if( 'isConfirm', 'ck-comment--remove-confirmation' )
112
+ * ],
113
+ * tabindex: -1
114
+ * },
115
+ *
116
+ * children: [
117
+ * {
118
+ * tag: 'div',
119
+ *
120
+ * attributes: {
121
+ * class: [
122
+ * 'ck-comment',
123
+ * 'ck-annotation',
124
+ * bind.if( 'isSystemComment', 'ck-comment--info' ),
125
+ * bind.if( 'isEditMode', 'ck-comment--edit' ),
126
+ * bind.to( 'actionIndicator', value => value ? `ck-comment--${ value }` : '' )
127
+ * ],
128
+ * 'data-author-id': this._model.author.id,
129
+ * 'data-comment-id': this._model.id
130
+ * },
131
+ *
132
+ * children: [
133
+ * this.userView,
134
+ * {
135
+ * tag: 'div',
136
+ *
137
+ * attributes: {
138
+ * class: [ 'ck-comment__main', 'ck-annotation__main' ]
139
+ * },
140
+ *
141
+ * children: [
142
+ * {
143
+ * tag: 'div',
144
+ *
145
+ * attributes: {
146
+ * class: [ 'ck-comment__info', 'ck-annotation__info' ]
147
+ * },
148
+ *
149
+ * children: [
150
+ * {
151
+ * tag: 'span',
152
+ *
153
+ * children: [
154
+ * {
155
+ * text: this.userView.name
156
+ * }
157
+ * ],
158
+ *
159
+ * attributes: {
160
+ * class: [ 'ck-comment__info-name', 'ck-annotation__info-name' ]
161
+ * }
162
+ * },
163
+ * {
164
+ * tag: 'time',
165
+ *
166
+ * attributes: {
167
+ * datetime: bind.to( 'authoredAt' ),
168
+ * class: [ 'ck-comment__info-time', 'ck-annotation__info-time' ]
169
+ * },
170
+ *
171
+ * children: [
172
+ * {
173
+ * text: bind.to( 'authoredAt', value => this._config.formatDateTime( value ) )
174
+ * }
175
+ * ]
176
+ * }
177
+ * ]
178
+ * },
179
+ * {
180
+ * tag: 'div',
181
+ *
182
+ * attributes: {
183
+ * class: [
184
+ * 'ck-comment__actions',
185
+ * 'ck-annotation__actions',
186
+ * bind.if( 'isEditMode', 'ck-comment__actions--hidden' ),
187
+ * bind.if( 'isEditMode', 'ck-annotation__actions--hidden' )
188
+ * ]
189
+ * },
190
+ *
191
+ * children: this.actionBar
192
+ * },
193
+ * {
194
+ * tag: 'div',
195
+ *
196
+ * attributes: {
197
+ * class: [ 'ck-annotation__content-wrapper' ]
198
+ * },
199
+ *
200
+ * children: this.visibleView
201
+ * },
202
+ * {
203
+ * tag: 'div',
204
+ *
205
+ * attributes: {
206
+ * class: [ 'ck-comment__external' ]
207
+ * },
208
+ *
209
+ * children: [ {
210
+ * text: this.getExternalCommentNote()
211
+ * } ]
212
+ * }
213
+ * ]
214
+ * }
215
+ *
216
+ * ]
217
+ * }
218
+ * ]
219
+ * }
220
+ * ```
221
+ *
222
+ * @returns Definition of comment thread view's template.
223
+ */
224
+ getTemplate(): TemplateDefinition;
225
+ /**
226
+ * @inheritDoc
227
+ */
228
+ protected _createCommentInputView(): CommentInputView;
229
+ /**
230
+ * Gets the translated note which indicates that the comment comes from an external source.
231
+ */
232
+ getExternalCommentNote(): string;
233
+ /**
234
+ * Gets the translated notification text which indicates that author name comes from an external source.
235
+ */
236
+ getUserViewNotificationText(): string | null;
237
+ /**
238
+ * @inheritDoc
239
+ */
240
+ render(): void;
241
+ }
242
+ declare module 'ckeditor5/src/ui' {
243
+ interface DropdownView {
244
+ isVisible: boolean;
245
+ }
246
+ }
247
+ export {};
@@ -0,0 +1,39 @@
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
11
+ * @publicApi
12
+ */
13
+ import { Plugin } from 'ckeditor5/src/core.js';
14
+ import CommentsRepository from './comments/commentsrepository.js';
15
+ import CommentsEditing from './comments/commentsediting.js';
16
+ import CommentsUI from './comments/commentsui.js';
17
+ import CommentsOnly from './commentsonly.js';
18
+ import WideSidebar from './annotations/widesidebar.js';
19
+ import NarrowSidebar from './annotations/narrowsidebar.js';
20
+ import InlineAnnotations from './annotations/inlineannotations.js';
21
+ import CommentsArchiveUI from './comments/commentsarchiveui.js';
22
+ import CommentsArchive from './comments/commentsarchive.js';
23
+ /**
24
+ * The comments plugin, which brings both the UI part and the editing part of this feature.
25
+ *
26
+ * It registers {@link module:comments/comments/addcommentthreadcommand~AddCommentThreadCommand the `AddCommentThreadCommand` command}.
27
+ *
28
+ * To learn more about the comments feature refer to the {@glink features/collaboration/comments/comments Comments} guide.
29
+ */
30
+ export default class Comments extends Plugin {
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ static get requires(): readonly [typeof CommentsRepository, typeof CommentsEditing, typeof CommentsUI, typeof CommentsArchive, typeof CommentsArchiveUI, typeof CommentsOnly, typeof WideSidebar, typeof NarrowSidebar, typeof InlineAnnotations];
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ static get pluginName(): "Comments";
39
+ }
@@ -0,0 +1,37 @@
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/commentsonly
11
+ * @publicApi
12
+ */
13
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
14
+ import CommentsEditing from './comments/commentsediting.js';
15
+ /**
16
+ * The `CommentsOnly` plugin allows you to put the editor in a mode where a user can only add, edit or delete comments.
17
+ *
18
+ * Check the {@glink features/collaboration/comments/comments-only-mode Comments-only mode} guide to learn how to use this plugin.
19
+ */
20
+ export default class CommentsOnly extends Plugin {
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ static get pluginName(): "CommentsOnly";
25
+ /**
26
+ * @inheritDoc
27
+ */
28
+ static get requires(): readonly [typeof CommentsEditing];
29
+ /**
30
+ * @inheritDoc
31
+ */
32
+ constructor(editor: Editor);
33
+ /**
34
+ * @inheritDoc
35
+ */
36
+ afterInit(): void;
37
+ }