@ckeditor/ckeditor5-comments 42.0.2 → 43.0.0-alpha.1

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 (309) hide show
  1. package/CHANGELOG.md +1 -256
  2. package/build/comments.js +2 -2
  3. package/build/translations/af.js +1 -1
  4. package/build/translations/ar.js +1 -1
  5. package/build/translations/bg.js +1 -1
  6. package/build/translations/bn.js +1 -1
  7. package/build/translations/bs.js +1 -1
  8. package/build/translations/ca.js +1 -1
  9. package/build/translations/cs.js +1 -1
  10. package/build/translations/da.js +1 -1
  11. package/build/translations/de-ch.js +1 -1
  12. package/build/translations/de.js +1 -1
  13. package/build/translations/el.js +1 -1
  14. package/build/translations/en-au.js +1 -1
  15. package/build/translations/es-co.js +1 -1
  16. package/build/translations/es.js +1 -1
  17. package/build/translations/et.js +1 -1
  18. package/build/translations/fa.js +1 -1
  19. package/build/translations/fi.js +1 -1
  20. package/build/translations/fr.js +1 -1
  21. package/build/translations/gl.js +1 -1
  22. package/build/translations/he.js +1 -1
  23. package/build/translations/hi.js +1 -1
  24. package/build/translations/hr.js +1 -1
  25. package/build/translations/hu.js +1 -1
  26. package/build/translations/id.js +1 -1
  27. package/build/translations/it.js +1 -1
  28. package/build/translations/ja.js +1 -1
  29. package/build/translations/jv.js +1 -1
  30. package/build/translations/ko.js +1 -1
  31. package/build/translations/lt.js +1 -1
  32. package/build/translations/lv.js +1 -1
  33. package/build/translations/ms.js +1 -1
  34. package/build/translations/nl.js +1 -1
  35. package/build/translations/no.js +1 -1
  36. package/build/translations/pl.js +1 -1
  37. package/build/translations/pt-br.js +1 -1
  38. package/build/translations/pt.js +1 -1
  39. package/build/translations/ro.js +1 -1
  40. package/build/translations/ru.js +1 -1
  41. package/build/translations/sk.js +1 -1
  42. package/build/translations/sq.js +1 -1
  43. package/build/translations/sr-latn.js +1 -1
  44. package/build/translations/sr.js +1 -1
  45. package/build/translations/sv.js +1 -1
  46. package/build/translations/th.js +1 -1
  47. package/build/translations/ti.js +1 -1
  48. package/build/translations/tk.js +1 -1
  49. package/build/translations/tr.js +1 -1
  50. package/build/translations/tt.js +1 -1
  51. package/build/translations/ug.js +1 -1
  52. package/build/translations/uk.js +1 -1
  53. package/build/translations/ur.js +1 -1
  54. package/build/translations/vi.js +1 -1
  55. package/build/translations/zh-cn.js +1 -1
  56. package/build/translations/zh.js +1 -1
  57. package/dist/annotations/annotations.d.ts +1 -1
  58. package/dist/annotations/sidebar.d.ts +2 -2
  59. package/dist/annotations/view/annotationview.d.ts +4 -4
  60. package/dist/annotations/view/sidebaritemview.d.ts +7 -3
  61. package/dist/annotations/view/sidebarview.d.ts +25 -4
  62. package/dist/comments/commentsediting.d.ts +8 -0
  63. package/dist/comments/commentsrepository.d.ts +14 -2
  64. package/dist/comments/ui/view/basecommentthreadview.d.ts +32 -3
  65. package/dist/comments/ui/view/basecommentview.d.ts +41 -3
  66. package/dist/comments/ui/view/commentinputview.d.ts +17 -2
  67. package/dist/comments/ui/view/commentsarchiveview.d.ts +11 -3
  68. package/dist/comments/ui/view/commentslistview.d.ts +17 -5
  69. package/dist/comments/ui/view/commentthreadheadercontextview.d.ts +25 -0
  70. package/dist/comments/ui/view/commentthreadheaderview.d.ts +29 -3
  71. package/dist/comments/ui/view/commentthreadinputview.d.ts +13 -2
  72. package/dist/comments/ui/view/commentthreadview.d.ts +11 -6
  73. package/dist/comments/ui/view/commentview.d.ts +9 -12
  74. package/dist/index-editor.css +33 -2
  75. package/dist/index.css +95 -2
  76. package/dist/index.d.ts +1 -0
  77. package/dist/index.js +9 -9
  78. package/dist/translations/af.js +1 -1
  79. package/dist/translations/af.umd.js +1 -1
  80. package/dist/translations/ar.js +1 -1
  81. package/dist/translations/ar.umd.js +1 -1
  82. package/dist/translations/bg.js +1 -1
  83. package/dist/translations/bg.umd.js +1 -1
  84. package/dist/translations/bn.js +1 -1
  85. package/dist/translations/bn.umd.js +1 -1
  86. package/dist/translations/bs.js +1 -1
  87. package/dist/translations/bs.umd.js +1 -1
  88. package/dist/translations/ca.js +1 -1
  89. package/dist/translations/ca.umd.js +1 -1
  90. package/dist/translations/cs.js +1 -1
  91. package/dist/translations/cs.umd.js +1 -1
  92. package/dist/translations/da.js +1 -1
  93. package/dist/translations/da.umd.js +1 -1
  94. package/dist/translations/de-ch.js +1 -1
  95. package/dist/translations/de-ch.umd.js +1 -1
  96. package/dist/translations/de.js +1 -1
  97. package/dist/translations/de.umd.js +1 -1
  98. package/dist/translations/el.js +1 -1
  99. package/dist/translations/el.umd.js +1 -1
  100. package/dist/translations/en-au.js +1 -1
  101. package/dist/translations/en-au.umd.js +1 -1
  102. package/dist/translations/en.js +1 -1
  103. package/dist/translations/en.umd.js +1 -1
  104. package/dist/translations/es-co.js +1 -1
  105. package/dist/translations/es-co.umd.js +1 -1
  106. package/dist/translations/es.js +1 -1
  107. package/dist/translations/es.umd.js +1 -1
  108. package/dist/translations/et.js +1 -1
  109. package/dist/translations/et.umd.js +1 -1
  110. package/dist/translations/fa.js +1 -1
  111. package/dist/translations/fa.umd.js +1 -1
  112. package/dist/translations/fi.js +1 -1
  113. package/dist/translations/fi.umd.js +1 -1
  114. package/dist/translations/fr.js +1 -1
  115. package/dist/translations/fr.umd.js +1 -1
  116. package/dist/translations/gl.js +1 -1
  117. package/dist/translations/gl.umd.js +1 -1
  118. package/dist/translations/he.js +1 -1
  119. package/dist/translations/he.umd.js +1 -1
  120. package/dist/translations/hi.js +1 -1
  121. package/dist/translations/hi.umd.js +1 -1
  122. package/dist/translations/hr.js +1 -1
  123. package/dist/translations/hr.umd.js +1 -1
  124. package/dist/translations/hu.js +1 -1
  125. package/dist/translations/hu.umd.js +1 -1
  126. package/dist/translations/id.js +1 -1
  127. package/dist/translations/id.umd.js +1 -1
  128. package/dist/translations/it.js +1 -1
  129. package/dist/translations/it.umd.js +1 -1
  130. package/dist/translations/ja.js +1 -1
  131. package/dist/translations/ja.umd.js +1 -1
  132. package/dist/translations/jv.js +1 -1
  133. package/dist/translations/jv.umd.js +1 -1
  134. package/dist/translations/ko.js +1 -1
  135. package/dist/translations/ko.umd.js +1 -1
  136. package/dist/translations/lt.js +1 -1
  137. package/dist/translations/lt.umd.js +1 -1
  138. package/dist/translations/lv.js +1 -1
  139. package/dist/translations/lv.umd.js +1 -1
  140. package/dist/translations/ms.js +1 -1
  141. package/dist/translations/ms.umd.js +1 -1
  142. package/dist/translations/nl.js +1 -1
  143. package/dist/translations/nl.umd.js +1 -1
  144. package/dist/translations/no.js +1 -1
  145. package/dist/translations/no.umd.js +1 -1
  146. package/dist/translations/pl.js +1 -1
  147. package/dist/translations/pl.umd.js +1 -1
  148. package/dist/translations/pt-br.js +1 -1
  149. package/dist/translations/pt-br.umd.js +1 -1
  150. package/dist/translations/pt.js +1 -1
  151. package/dist/translations/pt.umd.js +1 -1
  152. package/dist/translations/ro.js +1 -1
  153. package/dist/translations/ro.umd.js +1 -1
  154. package/dist/translations/ru.js +1 -1
  155. package/dist/translations/ru.umd.js +1 -1
  156. package/dist/translations/sk.js +1 -1
  157. package/dist/translations/sk.umd.js +1 -1
  158. package/dist/translations/sq.js +1 -1
  159. package/dist/translations/sq.umd.js +1 -1
  160. package/dist/translations/sr-latn.js +1 -1
  161. package/dist/translations/sr-latn.umd.js +1 -1
  162. package/dist/translations/sr.js +1 -1
  163. package/dist/translations/sr.umd.js +1 -1
  164. package/dist/translations/sv.js +1 -1
  165. package/dist/translations/sv.umd.js +1 -1
  166. package/dist/translations/th.js +1 -1
  167. package/dist/translations/th.umd.js +1 -1
  168. package/dist/translations/ti.js +1 -1
  169. package/dist/translations/ti.umd.js +1 -1
  170. package/dist/translations/tk.js +1 -1
  171. package/dist/translations/tk.umd.js +1 -1
  172. package/dist/translations/tr.js +1 -1
  173. package/dist/translations/tr.umd.js +1 -1
  174. package/dist/translations/tt.js +1 -1
  175. package/dist/translations/tt.umd.js +1 -1
  176. package/dist/translations/ug.js +1 -1
  177. package/dist/translations/ug.umd.js +1 -1
  178. package/dist/translations/uk.js +1 -1
  179. package/dist/translations/uk.umd.js +1 -1
  180. package/dist/translations/ur.js +1 -1
  181. package/dist/translations/ur.umd.js +1 -1
  182. package/dist/translations/vi.js +1 -1
  183. package/dist/translations/vi.umd.js +1 -1
  184. package/dist/translations/zh-cn.js +1 -1
  185. package/dist/translations/zh-cn.umd.js +1 -1
  186. package/dist/translations/zh.js +1 -1
  187. package/dist/translations/zh.umd.js +1 -1
  188. package/dist/utils/common-translations.d.ts +1 -1
  189. package/lang/contexts.json +15 -0
  190. package/lang/translations/af.po +62 -0
  191. package/lang/translations/ar.po +68 -2
  192. package/lang/translations/bg.po +64 -2
  193. package/lang/translations/bn.po +64 -2
  194. package/lang/translations/bs.po +63 -0
  195. package/lang/translations/ca.po +64 -2
  196. package/lang/translations/cs.po +66 -2
  197. package/lang/translations/da.po +64 -2
  198. package/lang/translations/de-ch.po +62 -0
  199. package/lang/translations/de.po +64 -2
  200. package/lang/translations/el.po +64 -2
  201. package/lang/translations/en-au.po +62 -0
  202. package/lang/translations/en.po +64 -2
  203. package/lang/translations/es-co.po +63 -0
  204. package/lang/translations/es.po +65 -2
  205. package/lang/translations/et.po +64 -2
  206. package/lang/translations/fa.po +62 -0
  207. package/lang/translations/fi.po +64 -2
  208. package/lang/translations/fr.po +65 -2
  209. package/lang/translations/gl.po +64 -2
  210. package/lang/translations/he.po +65 -2
  211. package/lang/translations/hi.po +64 -2
  212. package/lang/translations/hr.po +63 -0
  213. package/lang/translations/hu.po +64 -2
  214. package/lang/translations/id.po +63 -2
  215. package/lang/translations/it.po +65 -2
  216. package/lang/translations/ja.po +63 -2
  217. package/lang/translations/jv.po +61 -0
  218. package/lang/translations/ko.po +63 -2
  219. package/lang/translations/lt.po +66 -2
  220. package/lang/translations/lv.po +65 -2
  221. package/lang/translations/ms.po +63 -2
  222. package/lang/translations/nl.po +64 -2
  223. package/lang/translations/no.po +64 -2
  224. package/lang/translations/pl.po +66 -2
  225. package/lang/translations/pt-br.po +65 -2
  226. package/lang/translations/pt.po +65 -2
  227. package/lang/translations/ro.po +65 -2
  228. package/lang/translations/ru.po +66 -2
  229. package/lang/translations/sk.po +66 -2
  230. package/lang/translations/sq.po +62 -0
  231. package/lang/translations/sr-latn.po +65 -2
  232. package/lang/translations/sr.po +65 -2
  233. package/lang/translations/sv.po +64 -2
  234. package/lang/translations/th.po +63 -2
  235. package/lang/translations/ti.po +62 -0
  236. package/lang/translations/tk.po +62 -0
  237. package/lang/translations/tr.po +64 -2
  238. package/lang/translations/tt.po +61 -0
  239. package/lang/translations/ug.po +64 -2
  240. package/lang/translations/uk.po +66 -2
  241. package/lang/translations/ur.po +62 -0
  242. package/lang/translations/vi.po +63 -2
  243. package/lang/translations/zh-cn.po +63 -2
  244. package/lang/translations/zh.po +63 -2
  245. package/package.json +14 -13
  246. package/src/annotations/annotation.js +2 -2
  247. package/src/annotations/annotationcollection.js +1 -1
  248. package/src/annotations/annotations.d.ts +1 -1
  249. package/src/annotations/annotations.js +1 -1
  250. package/src/annotations/annotationsuis.js +1 -1
  251. package/src/annotations/editorannotations.js +1 -1
  252. package/src/annotations/inlineannotations.js +1 -1
  253. package/src/annotations/narrowsidebar.js +1 -1
  254. package/src/annotations/sidebar.d.ts +2 -2
  255. package/src/annotations/sidebar.js +1 -1
  256. package/src/annotations/view/annotationcounterbuttonview.js +1 -1
  257. package/src/annotations/view/annotationview.d.ts +4 -4
  258. package/src/annotations/view/annotationview.js +1 -1
  259. package/src/annotations/view/sidebaritemview.d.ts +7 -3
  260. package/src/annotations/view/sidebaritemview.js +1 -1
  261. package/src/annotations/view/sidebarview.d.ts +25 -4
  262. package/src/annotations/view/sidebarview.js +1 -1
  263. package/src/annotations/widesidebar.js +1 -1
  264. package/src/comments/addcommentthreadcommand.js +1 -1
  265. package/src/comments/commentsarchive.js +1 -1
  266. package/src/comments/commentsarchiveui.js +1 -1
  267. package/src/comments/commentsediting.d.ts +8 -0
  268. package/src/comments/commentsediting.js +1 -1
  269. package/src/comments/commentsrepository.d.ts +14 -2
  270. package/src/comments/commentsrepository.js +3 -3
  271. package/src/comments/commentsui.js +1 -1
  272. package/src/comments/integrations/clipboard.js +1 -1
  273. package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
  274. package/src/comments/integrations/importword.js +1 -1
  275. package/src/comments/ui/commenteditor/commenteditor.js +2 -2
  276. package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
  277. package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
  278. package/src/comments/ui/commentthreadcontroller.js +2 -2
  279. package/src/comments/ui/view/basecommentthreadview.d.ts +32 -3
  280. package/src/comments/ui/view/basecommentthreadview.js +1 -1
  281. package/src/comments/ui/view/basecommentview.d.ts +41 -3
  282. package/src/comments/ui/view/basecommentview.js +1 -1
  283. package/src/comments/ui/view/collapsedcommentsview.js +1 -1
  284. package/src/comments/ui/view/commentcontentview.js +1 -1
  285. package/src/comments/ui/view/commentinputview.d.ts +17 -2
  286. package/src/comments/ui/view/commentinputview.js +1 -1
  287. package/src/comments/ui/view/commentsarchiveview.d.ts +11 -3
  288. package/src/comments/ui/view/commentsarchiveview.js +1 -1
  289. package/src/comments/ui/view/commentslistview.d.ts +17 -5
  290. package/src/comments/ui/view/commentslistview.js +1 -1
  291. package/src/comments/ui/view/commentthreadheadercontextview.d.ts +21 -0
  292. package/src/comments/ui/view/commentthreadheadercontextview.js +23 -0
  293. package/src/comments/ui/view/commentthreadheaderview.d.ts +29 -3
  294. package/src/comments/ui/view/commentthreadheaderview.js +1 -1
  295. package/src/comments/ui/view/commentthreadinputview.d.ts +13 -2
  296. package/src/comments/ui/view/commentthreadinputview.js +1 -1
  297. package/src/comments/ui/view/commentthreadview.d.ts +11 -6
  298. package/src/comments/ui/view/commentthreadview.js +2 -2
  299. package/src/comments/ui/view/commentview.d.ts +9 -12
  300. package/src/comments/ui/view/commentview.js +2 -2
  301. package/src/comments.js +1 -1
  302. package/src/commentsonly.js +1 -1
  303. package/src/index.d.ts +1 -0
  304. package/src/index.js +1 -1
  305. package/src/utils/common-translations.d.ts +1 -1
  306. package/src/utils/common-translations.js +1 -1
  307. package/src/utils/createmutationobserver.js +1 -1
  308. package/theme/comment.css +6 -0
  309. package/theme/commentthread.css +43 -2
@@ -0,0 +1,25 @@
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 { View, type FocusableView } from 'ckeditor5/src/ui.js';
10
+ import type { Locale } from 'ckeditor5/src/utils.js';
11
+ /**
12
+ * A view displaying the context of a comment thread. The context is a piece of text from editor content
13
+ * that comment was created on. It gives users a better understanding of what is discussed in the thread.
14
+ */
15
+ export default class CommentThreadHeaderContextView extends View implements FocusableView {
16
+ /**
17
+ * The text of the content, it corresponds to some of the content in the editor.
18
+ */
19
+ contextValue: string;
20
+ constructor(locale: Locale);
21
+ /**
22
+ * @inheritDoc
23
+ */
24
+ focus(): void;
25
+ }
@@ -9,14 +9,15 @@
9
9
  /**
10
10
  * @module comments/comments/ui/view/commentthreadheaderview
11
11
  */
12
- import { View, ButtonView } from 'ckeditor5/src/ui.js';
13
- import type { Locale } from 'ckeditor5/src/utils.js';
12
+ import { View, ButtonView, FocusCycler, type FocusableView, type ViewCollection } from 'ckeditor5/src/ui.js';
13
+ import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
14
14
  import type { CommentThread } from '../../commentsrepository.js';
15
+ import CommentThreadHeaderContextView from './commentthreadheadercontextview.js';
15
16
  export declare const MAX_CONTENT_LENGTH = 150;
16
17
  /**
17
18
  * A view for the comment thread header.
18
19
  */
19
- export default class CommentThreadHeaderView extends View {
20
+ export default class CommentThreadHeaderView extends View implements FocusableView {
20
21
  locale: Locale;
21
22
  /**
22
23
  * Defines whether the context value exists.
@@ -34,6 +35,27 @@ export default class CommentThreadHeaderView extends View {
34
35
  * Button view for the button which reopen the comment thread.
35
36
  */
36
37
  reopenButtonView: ButtonView;
38
+ /**
39
+ * The view that displays the context of the comment thread to the user, for instance,
40
+ * the part of text the thread (first comment) relates to.
41
+ */
42
+ contextView: CommentThreadHeaderContextView;
43
+ /**
44
+ * The collection of focusable sub-views in the header.
45
+ */
46
+ readonly focusables: ViewCollection<FocusableView>;
47
+ /**
48
+ * Tracks information about DOM focus in the header view.
49
+ */
50
+ readonly focusTracker: FocusTracker;
51
+ /**
52
+ * Instance of the {@link module:utils/keystrokehandler~KeystrokeHandler}.
53
+ */
54
+ readonly keystrokes: KeystrokeHandler;
55
+ /**
56
+ * Helps cycling over focusable {@link #commentThreadChildren} in the header view.
57
+ */
58
+ readonly focusCycler: FocusCycler;
37
59
  /**
38
60
  * @inheritDoc
39
61
  */
@@ -42,6 +64,10 @@ export default class CommentThreadHeaderView extends View {
42
64
  * @inheritDoc
43
65
  */
44
66
  render(): void;
67
+ /**
68
+ * @inheritDoc
69
+ */
70
+ focus(): void;
45
71
  }
46
72
  /**
47
73
  * Fired when a user performed an action that should lead to reopen the resolved comment thread.
@@ -9,7 +9,7 @@
9
9
  /**
10
10
  * @module comments/comments/ui/view/commentthreadinputview
11
11
  */
12
- import { View } from 'ckeditor5/src/ui.js';
12
+ import { type FocusableView, type FocusCycler, View } from 'ckeditor5/src/ui.js';
13
13
  import CommentInputView from './commentinputview.js';
14
14
  import type { Locale } from 'ckeditor5/src/utils.js';
15
15
  import type { EditorConfig } from 'ckeditor5/src/core.js';
@@ -17,7 +17,7 @@ import { UserView, type User } from 'ckeditor5-collaboration/src/collaboration-c
17
17
  /**
18
18
  * View that represents comment input area for a comment thread. Includes editor, user view and buttons.
19
19
  */
20
- export default class CommentThreadInputView extends View {
20
+ export default class CommentThreadInputView extends View implements FocusableView {
21
21
  /**
22
22
  * Specifies whether the comment input view should be visible (`true`) or hidden (`false`).
23
23
  *
@@ -28,6 +28,13 @@ export default class CommentThreadInputView extends View {
28
28
  * Comment input view.
29
29
  */
30
30
  commentInputView: CommentInputView;
31
+ /**
32
+ * Helps move focus between focusable elements.
33
+ *
34
+ * **Note:** This property is a proxy is exposed for parent views to discover and use focus cycling capabilities of the view
35
+ * while in fact the actual implementation is in the {@link #commentInputView}.
36
+ */
37
+ focusCycler: FocusCycler;
31
38
  /**
32
39
  * User view for the input area. Presents the local user.
33
40
  */
@@ -42,4 +49,8 @@ export default class CommentThreadInputView extends View {
42
49
  * @inheritDoc
43
50
  */
44
51
  destroy(): Promise<void>;
52
+ /**
53
+ * @inheritDoc
54
+ */
55
+ focus(direction?: 1 | -1): void;
45
56
  }
@@ -11,8 +11,8 @@
11
11
  * @publicApi
12
12
  */
13
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';
14
+ import { LateFocusButtonView, type User } from 'ckeditor5-collaboration/src/collaboration-core.js';
15
+ import { type View, type ViewWithFocusCycler, type TemplateDefinition, type ViewCollection } from 'ckeditor5/src/ui.js';
16
16
  import BaseCommentThreadView from './basecommentthreadview.js';
17
17
  import type { CommentThread } from '../../commentsrepository.js';
18
18
  import type { CommentThreadConfig } from '../../../config.js';
@@ -20,7 +20,7 @@ declare const CommentThreadView_base: import("ckeditor5/src/utils.js").Mixed<typ
20
20
  /**
21
21
  * The default view for comment thread.
22
22
  */
23
- export default class CommentThreadView extends /* #__PURE__ -- @preserve */ CommentThreadView_base {
23
+ export default class CommentThreadView extends /* #__PURE__ -- @preserve */ CommentThreadView_base implements ViewWithFocusCycler {
24
24
  isConfirm: boolean;
25
25
  cancelConfirm: () => void;
26
26
  showConfirm: (key: string, element: unknown) => Promise<void>;
@@ -50,7 +50,7 @@ export default class CommentThreadView extends /* #__PURE__ -- @preserve */ Comm
50
50
  *
51
51
  * @readonly
52
52
  */
53
- readonly commentThreadChildren: ViewCollection;
53
+ readonly commentThreadChildren: ViewCollection<View>;
54
54
  /**
55
55
  * `ConfirmView` uses this element as a container for confirmation dialog.
56
56
  *
@@ -64,7 +64,7 @@ export default class CommentThreadView extends /* #__PURE__ -- @preserve */ Comm
64
64
  *
65
65
  * @readonly
66
66
  */
67
- readonly resolveButton: ButtonView;
67
+ readonly resolveButton: LateFocusButtonView;
68
68
  /**
69
69
  * @inheritDoc
70
70
  */
@@ -84,8 +84,10 @@ export default class CommentThreadView extends /* #__PURE__ -- @preserve */ Comm
84
84
  *
85
85
  * attributes: {
86
86
  * class: [
87
+ * 'ck',
87
88
  * 'ck-thread',
88
89
  * 'ck-reset_all-excluded',
90
+ * 'ck-rounded-corners',
89
91
  * bind.if( 'isActive', 'ck-thread--active' ),
90
92
  * bind.if( 'isUnlinked', 'ck-thread--unlinked' ),
91
93
  * bind.if( 'isConfirm', 'ck-thread--remove-confirmation' ),
@@ -93,7 +95,10 @@ export default class CommentThreadView extends /* #__PURE__ -- @preserve */ Comm
93
95
  * ],
94
96
  * 'data-thread-id': this._model.id,
95
97
  * // Needed for managing focus after adding new comment.
96
- * tabindex: -1
98
+ * tabindex: 0,
99
+ * role: 'listitem',
100
+ * 'aria-label': bind.to( 'ariaLabel' ),
101
+ * 'aria-describedby': this.ariaDescriptionView.id
97
102
  * },
98
103
  *
99
104
  * children: [
@@ -11,7 +11,7 @@
11
11
  * @publicApi
12
12
  */
13
13
  import { type Locale } from 'ckeditor5/src/utils.js';
14
- import { ButtonView, type TemplateDefinition, type ViewCollection, type DropdownView } from 'ckeditor5/src/ui.js';
14
+ import { ButtonView, type TemplateDefinition, type DropdownView, type FocusableView, type ViewCollection } from 'ckeditor5/src/ui.js';
15
15
  import { UserView } from 'ckeditor5-collaboration/src/collaboration-core.js';
16
16
  import BaseCommentView from './basecommentview.js';
17
17
  import type { Comment } from '../../commentsrepository.js';
@@ -62,7 +62,7 @@ export default class CommentView extends /* #__PURE__ -- @preserve */ CommentVie
62
62
  * * the resolve comment thread button (only if the comment is the first comment),
63
63
  * * a dropdown with actions ({@link ~CommentView#dropdown `dropdown`}).
64
64
  */
65
- actionBar: ViewCollection;
65
+ actionBar: ViewCollection<FocusableView>;
66
66
  /**
67
67
  * View collection which holds all the comments dropdown elements.
68
68
  *
@@ -110,7 +110,10 @@ export default class CommentView extends /* #__PURE__ -- @preserve */ CommentVie
110
110
  * 'ck-comment__wrapper',
111
111
  * bind.if( 'isConfirm', 'ck-comment--remove-confirmation' )
112
112
  * ],
113
- * tabindex: -1
113
+ * tabindex: -1,
114
+ * 'aria-label': bind.to( 'ariaLabel' ),
115
+ * 'aria-describedby': this.ariaDescriptionView.id,
116
+ * role: 'listitem'
114
117
  * },
115
118
  *
116
119
  * children: [
@@ -126,7 +129,8 @@ export default class CommentView extends /* #__PURE__ -- @preserve */ CommentVie
126
129
  * bind.to( 'actionIndicator', value => value ? `ck-comment--${ value }` : '' )
127
130
  * ],
128
131
  * 'data-author-id': this._model.author.id,
129
- * 'data-comment-id': this._model.id
132
+ * 'data-comment-id': this._model.id,
133
+ * role: 'group'
130
134
  * },
131
135
  *
132
136
  * children: [
@@ -199,6 +203,7 @@ export default class CommentView extends /* #__PURE__ -- @preserve */ CommentVie
199
203
  *
200
204
  * children: this.visibleView
201
205
  * },
206
+ * this.ariaDescriptionView,
202
207
  * {
203
208
  * tag: 'div',
204
209
  *
@@ -226,14 +231,6 @@ export default class CommentView extends /* #__PURE__ -- @preserve */ CommentVie
226
231
  * @inheritDoc
227
232
  */
228
233
  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
234
  /**
238
235
  * @inheritDoc
239
236
  */
@@ -101,6 +101,10 @@
101
101
  border-top-left-radius:var(--ck-border-radius);
102
102
  }
103
103
 
104
+ .ck .ck-comment__wrapper:focus{
105
+ background:var(--ck-color-button-default-hover-background);
106
+ }
107
+
104
108
  .ck .ck-comment::after{
105
109
  content:'';
106
110
  display:block;
@@ -234,13 +238,23 @@
234
238
  }
235
239
 
236
240
  .ck .ck-thread{
241
+ border-radius:0;
242
+ }
243
+
244
+ .ck-rounded-corners .ck .ck-thread, .ck .ck-thread.ck-rounded-corners{
245
+ border-radius:var(--ck-border-radius);
246
+ }
247
+
248
+ .ck .ck-thread{
249
+
237
250
  width:100%;
238
251
  color:var(--ck-color-base-text);
239
252
  outline:0;
240
253
  background-color:var(--ck-color-base-background);
241
254
  overflow:hidden;
242
- transition:all 300ms ease;
243
- border-radius:var(--ck-border-radius);
255
+ transition-property:color, background-color, width, outline;
256
+ transition-duration:300ms;
257
+ transition-timing-function:ease;
244
258
  }
245
259
 
246
260
  @media (prefers-reduced-motion: reduce){
@@ -250,6 +264,16 @@
250
264
  }
251
265
  }
252
266
 
267
+ .ck .ck-thread:focus{
268
+ outline:var(--ck-focus-ring);
269
+ box-shadow:0 0 0 4px var(--ck-color-focus-outer-shadow);
270
+ }
271
+ .ck-balloon-panel:has( .ck-thread:focus){
272
+ outline:none;
273
+ border:var(--ck-focus-ring);
274
+ box-shadow:var(--ck-drop-shadow), var(--ck-focus-outer-shadow);
275
+ }
276
+
253
277
  .ck .ck-thread__header{
254
278
  display:flex;
255
279
  justify-content:space-between;
@@ -293,8 +317,15 @@
293
317
  .ck .ck-thread__header .ck-context .ck-context__value{
294
318
  overflow:hidden;
295
319
  text-overflow:ellipsis;
320
+ border:1px solid transparent;
296
321
  }
297
322
 
323
+ .ck .ck-thread__header .ck-context .ck-context__value:focus{
324
+ outline:none;
325
+ border:var(--ck-focus-ring);
326
+ box-shadow:var(--ck-focus-outer-shadow), 0 0;
327
+ }
328
+
298
329
  .ck .ck-thread__header .ck-context.overlay{
299
330
  display:inline-block;
300
331
  position:absolute;
package/dist/index.css CHANGED
@@ -106,6 +106,19 @@
106
106
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
107
107
  */
108
108
 
109
+ /*
110
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
111
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
112
+ */
113
+
114
+ /**
115
+ * A helper to combine multiple shadows.
116
+ */
117
+
118
+ /**
119
+ * Gives an element a drop shadow so it looks like a floating panel.
120
+ */
121
+
109
122
  :root {
110
123
  --ck-color-comment-background: hsl(210, 52%, 97%);
111
124
  --ck-color-comment-separator: hsl(210, 52%, 87%);
@@ -136,6 +149,10 @@
136
149
  border-top-left-radius: var(--ck-border-radius);
137
150
  }
138
151
 
152
+ .ck .ck-comment__wrapper:focus {
153
+ background: var(--ck-color-button-default-hover-background);
154
+ }
155
+
139
156
  .ck .ck-comment::after {
140
157
  content: '';
141
158
  display: block;
@@ -273,6 +290,34 @@ We are styling resetting list-style because of parent <ul> element. */
273
290
  * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
274
291
  */
275
292
 
293
+ /*
294
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
295
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
296
+ */
297
+
298
+ /**
299
+ * A visual style of focused element's border.
300
+ */
301
+ /*
302
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
303
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
304
+ */
305
+ /**
306
+ * A helper to combine multiple shadows.
307
+ */
308
+ /**
309
+ * Gives an element a drop shadow so it looks like a floating panel.
310
+ */
311
+ /*
312
+ * Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
313
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
314
+ */
315
+ /**
316
+ * Implements rounded corner interface for .ck-rounded-corners class.
317
+ *
318
+ * @see $ck-border-radius
319
+ */
320
+
276
321
  :root {
277
322
  --ck-color-thread-remove-background: var(--ck-color-comment-remove-background);
278
323
  --ck-color-comment-count: hsl(210, 52%, 57%);
@@ -285,13 +330,28 @@ We are styling resetting list-style because of parent <ul> element. */
285
330
  }
286
331
 
287
332
  .ck .ck-thread {
333
+ border-radius: 0;
334
+ }
335
+
336
+ .ck-rounded-corners .ck .ck-thread, .ck .ck-thread.ck-rounded-corners {
337
+ border-radius: var(--ck-border-radius);
338
+ }
339
+
340
+ .ck .ck-thread {
341
+
288
342
  width: 100%;
289
343
  color: var(--ck-color-base-text);
290
344
  outline: 0;
291
345
  background-color: var(--ck-color-base-background);
292
346
  overflow: hidden;
293
- transition: all 300ms ease;
294
- border-radius: var(--ck-border-radius);
347
+
348
+ /*
349
+ * Beware: Using "transition: all" breaks focus management (unable to obtain focus on show)
350
+ * because the view is displayed in a dialog that gets toggled via "visibility" property.
351
+ */
352
+ transition-property: color, background-color, width, outline;
353
+ transition-duration: 300ms;
354
+ transition-timing-function: ease;
295
355
  }
296
356
 
297
357
  @media (prefers-reduced-motion: reduce) {
@@ -301,6 +361,31 @@ We are styling resetting list-style because of parent <ul> element. */
301
361
  }
302
362
  }
303
363
 
364
+ .ck .ck-thread:focus {
365
+ /*
366
+ * We cannot use the ck-focus-ring mixin here because it adds a border that would need to stay transparent
367
+ * in non-focused state and create an odd space inside the surrounding annotation container.
368
+ */
369
+ outline: var(--ck-focus-ring);
370
+
371
+ /*
372
+ * We cannot use the ck-box-shadow mixin because we're using outline instead of border (see the comment above).
373
+ * And the shadow size has to be custom because outline is rendered on top of the shadow.
374
+ */
375
+ box-shadow: 0 0 0 4px var(--ck-color-focus-outer-shadow);
376
+ }
377
+
378
+ /*
379
+ * In case of inline annotations, their focus styles get hoisted to the balloon panel to work around overflow that would
380
+ * otherwise get them cropped..
381
+ */
382
+ .ck-balloon-panel:has( .ck-thread:focus ) {
383
+ /* Disable native outline. */
384
+ outline: none;
385
+ border: var(--ck-focus-ring);
386
+ box-shadow: var(--ck-drop-shadow), var(--ck-focus-outer-shadow);
387
+ }
388
+
304
389
  .ck .ck-thread__header {
305
390
  display: flex;
306
391
  justify-content: space-between;
@@ -344,8 +429,16 @@ We are styling resetting list-style because of parent <ul> element. */
344
429
  .ck .ck-thread__header .ck-context .ck-context__value {
345
430
  overflow: hidden;
346
431
  text-overflow: ellipsis;
432
+ border: 1px solid transparent;
347
433
  }
348
434
 
435
+ .ck .ck-thread__header .ck-context .ck-context__value:focus {
436
+ /* Disable native outline. */
437
+ outline: none;
438
+ border: var(--ck-focus-ring);
439
+ box-shadow: var(--ck-focus-outer-shadow), 0 0;
440
+ }
441
+
349
442
  .ck .ck-thread__header .ck-context.overlay {
350
443
  display: inline-block;
351
444
  position: absolute;
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ export { default as BaseCommentView } from './comments/ui/view/basecommentview.j
22
22
  export { default as BaseCommentThreadView } from './comments/ui/view/basecommentthreadview.js';
23
23
  export { default as CommentsListView } from './comments/ui/view/commentslistview.js';
24
24
  export { default as CommentView } from './comments/ui/view/commentview.js';
25
+ export { default as CommentThreadView } from './comments/ui/view/commentthreadview.js';
25
26
  export { default as CommentThreadInputView } from './comments/ui/view/commentthreadinputview.js';
26
27
  export type { CommentsConfig, SidebarConfig, CommentsClipboardCopyConfig } from './config.js';
27
28
  export type { default as CommentsEditing } from './comments/commentsediting.js';