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

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,94 @@
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/annotations/view/annotationview
11
+ * @publicApi
12
+ */
13
+ import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
14
+ import { FocusTracker, KeystrokeHandler, type Rect, type Locale } from 'ckeditor5/src/utils.js';
15
+ import '../../../theme/annotation.css';
16
+ /**
17
+ * A wrapping view for any view added to the `Annotations` plugin.
18
+ *
19
+ * It introduces functionalities that make the given view ready to be used as an annotation, such as focus tracking, height resizing,
20
+ * and other observable properties that help share current annotation state across different UIs.
21
+ */
22
+ export default class AnnotationView extends View {
23
+ /**
24
+ * Tracks focus on the annotation view.
25
+ *
26
+ * Add a DOM element to this focus tracker to prevent blurring annotation view
27
+ * when the DOM element is focused.
28
+ */
29
+ readonly focusTracker: FocusTracker;
30
+ readonly id: string;
31
+ readonly keystrokes: KeystrokeHandler;
32
+ /**
33
+ * Target rectangle to which the annotation should be attached.
34
+ *
35
+ * @observable
36
+ */
37
+ targetRect: Rect | null;
38
+ /**
39
+ * Annotation view height.
40
+ *
41
+ * @observable
42
+ */
43
+ height: number;
44
+ /**
45
+ * Informs if an annotation is active.
46
+ *
47
+ * @observable
48
+ */
49
+ isActive: boolean;
50
+ /**
51
+ * Informs if there are unsaved changes in the annotation.
52
+ *
53
+ * @observable
54
+ */
55
+ isDirty: boolean;
56
+ /**
57
+ * The number of items in the annotation.
58
+ *
59
+ * @observable
60
+ */
61
+ length: number;
62
+ /**
63
+ * @observable
64
+ */
65
+ type: string;
66
+ element: HTMLElement;
67
+ /**
68
+ * Collection for content views.
69
+ */
70
+ content: ViewCollection;
71
+ /**
72
+ * The inner annotation view.
73
+ */
74
+ mainView: AnnotationMainView;
75
+ /**
76
+ * @inheritDoc
77
+ */
78
+ constructor(locale: Locale, mainView: AnnotationMainView);
79
+ /**
80
+ * @inheritDoc
81
+ */
82
+ render(): void;
83
+ /**
84
+ * @inheritDoc
85
+ */
86
+ destroy(): void;
87
+ /**
88
+ * Focuses the annotation view.
89
+ */
90
+ focus(): void;
91
+ }
92
+ export interface AnnotationMainView extends View {
93
+ isActive: boolean;
94
+ }
@@ -0,0 +1,59 @@
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/annotations/view/sidebaritemview
11
+ * @publicApi
12
+ */
13
+ import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
14
+ import { type Locale } from 'ckeditor5/src/utils.js';
15
+ /**
16
+ * A wrapper view that wraps given {@link module:ui/view~View} to display it as a {@link module:comments/annotations/sidebar~Sidebar} item.
17
+ */
18
+ export default class SidebarItemView extends View {
19
+ element: HTMLElement;
20
+ /**
21
+ * The item top offset.
22
+ * Setting `0` as the initial value makes new items falling from heaven.
23
+ *
24
+ * @observable
25
+ */
26
+ top: number;
27
+ /**
28
+ * @observable
29
+ */
30
+ bottom: number;
31
+ /**
32
+ * @observable
33
+ */
34
+ height: number;
35
+ /**
36
+ * @observable
37
+ */
38
+ isAnimationDisabled: boolean;
39
+ /**
40
+ * A collection of content views.
41
+ */
42
+ content: ViewCollection;
43
+ /**
44
+ * @inheritDoc
45
+ */
46
+ constructor(locale: Locale);
47
+ /**
48
+ * @inheritDoc
49
+ */
50
+ render(): void;
51
+ /**
52
+ * Updates {@link #height the height property} according to the element's DOM height.
53
+ */
54
+ updateHeight(): void;
55
+ /**
56
+ * @inheritDoc
57
+ */
58
+ destroy(): void;
59
+ }
@@ -0,0 +1,36 @@
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/annotations/view/sidebarview
11
+ * @publicApi
12
+ */
13
+ import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
14
+ import { type Locale } from 'ckeditor5/src/utils.js';
15
+ import '../../../theme/sidebar.css';
16
+ /**
17
+ * The sidebar view class that displays the collection of sidebar item views.
18
+ */
19
+ export default class SidebarView extends View {
20
+ /**
21
+ * @observable
22
+ */
23
+ minHeight: number | null;
24
+ /**
25
+ * @observable
26
+ */
27
+ class: string;
28
+ /**
29
+ * A collection of sidebar item views.
30
+ */
31
+ list: ViewCollection;
32
+ /**
33
+ * @inheritDoc
34
+ */
35
+ constructor(locale: Locale);
36
+ }
@@ -0,0 +1,81 @@
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/annotations/widesidebar
11
+ * @publicApi
12
+ */
13
+ import { ContextPlugin, Context, type Editor } from 'ckeditor5/src/core.js';
14
+ import AnnotationsUIs, { type AnnotationsUI } from './annotationsuis.js';
15
+ import Sidebar from './sidebar.js';
16
+ import type Annotation from './annotation.js';
17
+ import type { default as AnnotationCollection } from './annotationcollection.js';
18
+ /**
19
+ * The wide sidebar UI for displaying annotations.
20
+ *
21
+ * In this implementation {@link module:comments/annotations/sidebar~Sidebar the sidebar} displays full
22
+ * {@link module:comments/annotations/view/annotationview~AnnotationView annotation views}.
23
+ *
24
+ * To activate this UI use one of the following:
25
+ *
26
+ * ```ts
27
+ * editor.plugins.get( 'AnnotationsUIs' ).switchTo( 'wideSidebar' );
28
+ * editor.plugins.get( 'AnnotationsUIs' ).activate( 'wideSidebar', filter );
29
+ * ```
30
+ *
31
+ * See {@link module:comments/annotations/annotationsuis~AnnotationsUIs}.
32
+ */
33
+ export default class WideSidebar extends ContextPlugin implements AnnotationsUI<ContextPlugin> {
34
+ /**
35
+ * An active annotation tracked by this UI.
36
+ *
37
+ * @observable
38
+ */
39
+ activeAnnotation: Annotation | null;
40
+ isAttached: boolean;
41
+ /**
42
+ * A collection of annotations controlled by this UI.
43
+ *
44
+ * This property is readonly and should not be operated on directly. Use it only to read which annotations are added to this UI.
45
+ *
46
+ * It is set to `null` if `WideSidebar` is not {@link module:comments/annotations/widesidebar~WideSidebar#attach attached}.
47
+ */
48
+ annotations: AnnotationCollection | null;
49
+ /**
50
+ * @inheritDoc
51
+ */
52
+ static get requires(): readonly [typeof Sidebar, typeof AnnotationsUIs];
53
+ /**
54
+ * @inheritDoc
55
+ */
56
+ static get pluginName(): "WideSidebar";
57
+ /**
58
+ * @inheritDoc
59
+ */
60
+ constructor(context: Context | Editor);
61
+ /**
62
+ * @inheritDoc
63
+ */
64
+ init(): void;
65
+ /**
66
+ * Sets the active annotation for this UI.
67
+ */
68
+ setActiveAnnotation(annotation: Annotation | null): void;
69
+ /**
70
+ * @inheritDoc
71
+ */
72
+ attach(annotations: AnnotationCollection): void;
73
+ /**
74
+ * @inheritDoc
75
+ */
76
+ detach(): void;
77
+ /**
78
+ * @inheritDoc
79
+ */
80
+ destroy(): void;
81
+ }
@@ -0,0 +1,56 @@
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 { CommentsConfig, SidebarConfig, Annotations, AnnotationsUIs, EditorAnnotations, CommentsRepository, CommentsUI } from './index.js';
10
+ declare module '@ckeditor/ckeditor5-core' {
11
+ interface EditorConfig {
12
+ /**
13
+ * The configuration of the comments feature.
14
+ * Introduced by the {@link module:comments/comments~Comments} feature.
15
+ *
16
+ * Read more in {@link module:comments/config~CommentsConfig}.
17
+ *
18
+ * ```ts
19
+ * ClassicEditor
20
+ * .create( {
21
+ * comments: ... // Locale editor configuration.
22
+ * } )
23
+ * .then( ... )
24
+ * .catch( ... );
25
+ * ```
26
+ *
27
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
28
+ */
29
+ comments?: CommentsConfig;
30
+ /**
31
+ * The configuration of the sidebar feature.
32
+ * Introduced by the {@link module:comments/annotations/sidebar~Sidebar} feature.
33
+ */
34
+ sidebar?: SidebarConfig;
35
+ /**
36
+ * Enables {@link module:comments/commentsonly~CommentsOnly comments-only mode} when the editor initializes.
37
+ *
38
+ * ```ts
39
+ * ClassicEditor
40
+ * .create( {
41
+ * commentsOnly: true
42
+ * } )
43
+ * .then( ... )
44
+ * .catch( ... );
45
+ * ```
46
+ */
47
+ commentsOnly?: boolean;
48
+ }
49
+ interface PluginsMap {
50
+ [Annotations.pluginName]: Annotations;
51
+ [AnnotationsUIs.pluginName]: AnnotationsUIs;
52
+ [EditorAnnotations.pluginName]: EditorAnnotations;
53
+ [CommentsRepository.pluginName]: CommentsRepository;
54
+ [CommentsUI.pluginName]: CommentsUI;
55
+ }
56
+ }
@@ -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/addcommentthreadcommand
11
+ * @publicApi
12
+ */
13
+ import { Command } from 'ckeditor5/src/core.js';
14
+ /**
15
+ * Adds a new CommentMarker what automatically adds corresponding CommentThread to the CommentsEditing#threads collection.
16
+ * Note this command adds only a CommentThread draft, to make is public marker has to be changed to be managed using operation.
17
+ *
18
+ * ```ts
19
+ * // If `threadId` is not specified, `addCommentThread()` will generate a unique ID and use it:
20
+ * editor.execute( 'addCommentThread' );
21
+ *
22
+ * // If you want to specify the exact thread ID, pass it through the optional `threadId` configuration parameter.
23
+ * editor.execute( 'addCommentThread', { threadId: 'thread-1' } );
24
+ * ```
25
+ */
26
+ export default class AddCommentThreadCommand extends Command {
27
+ /**
28
+ * @inheritDoc
29
+ */
30
+ refresh(): void;
31
+ /**
32
+ * @fires execute
33
+ * @param options Options for executed command.
34
+ * @param options.threadId Id of comment marker that will be added.
35
+ */
36
+ execute({ threadId }?: {
37
+ threadId?: string | undefined;
38
+ }): void;
39
+ }
@@ -0,0 +1,35 @@
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/commentsarchive
11
+ * @publicApi
12
+ */
13
+ import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core.js';
14
+ import { Collection } from 'ckeditor5/src/utils.js';
15
+ import CommentsRepository, { type CommentThread } from './commentsrepository.js';
16
+ import Annotations from '../annotations/annotations.js';
17
+ /**
18
+ * This plugin handles all operations on archived threads needed for the comments archive.
19
+ */
20
+ export default class CommentsArchive extends ContextPlugin {
21
+ archivedThreads: Collection<CommentThread>;
22
+ /**
23
+ * @inheritDoc
24
+ */
25
+ static get pluginName(): "CommentsArchive";
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static get requires(): readonly [typeof CommentsRepository, typeof Annotations];
30
+ constructor(context: Context | Editor);
31
+ /**
32
+ * @inheritDoc
33
+ */
34
+ init(): void;
35
+ }
@@ -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/commentsarchiveui
11
+ * @publicApi
12
+ */
13
+ import '../../theme/commentsarchive.css';
14
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
15
+ import { ViewCollection } from 'ckeditor5/src/ui.js';
16
+ import CommentsArchiveView from './ui/view/commentsarchiveview.js';
17
+ import CommentsArchive from './commentsarchive.js';
18
+ import type AnnotationView from '../annotations/view/annotationview.js';
19
+ /**
20
+ * Creates comments archive {@link module:ui/dropdown/dropdownview~DropdownView ui dropdown} and binds with
21
+ * archived comment thread annotation views.
22
+ */
23
+ export default class CommentsArchiveUI extends Plugin {
24
+ commentsArchiveView: CommentsArchiveView | undefined;
25
+ annotationViews: ViewCollection<AnnotationView>;
26
+ /**
27
+ * @inheritDoc
28
+ */
29
+ static get pluginName(): "CommentsArchiveUI";
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ static get requires(): readonly [typeof CommentsArchive];
34
+ /**
35
+ * @inheritDoc
36
+ */
37
+ constructor(editor: Editor);
38
+ /**
39
+ * @inheritDoc
40
+ */
41
+ init(): void;
42
+ }
@@ -0,0 +1,84 @@
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/commentsediting
11
+ */
12
+ import { Plugin, type Editor } from 'ckeditor5/src/core.js';
13
+ import type { Marker } from 'ckeditor5/src/engine.js';
14
+ import CommentsRepository from './commentsrepository.js';
15
+ import EditorAnnotations from '../annotations/editorannotations.js';
16
+ import CommentsRestrictedEditingMode from './integrations/commentsrestrictededitingmode.js';
17
+ import CommentsImportWord from './integrations/importword.js';
18
+ import CommentsClipboard from './integrations/clipboard.js';
19
+ import '../../theme/commentmarker.css';
20
+ /**
21
+ * Plugin that keeps in sync comments in {@link module:comments/comments/commentsrepository~CommentsRepository} with
22
+ * {@link module:engine/model/markercollection~Marker comment markers}.
23
+ */
24
+ export default class CommentsEditing extends Plugin {
25
+ /**
26
+ * If set to `true`, the plugin won't load comment thread for the new marker immediately after the marker is added to the editor.
27
+ * Instead, the plugin will wait until the flag will be set to `false` and then load missing comments.
28
+ *
29
+ * It's useful to hold fetching comments from the server when comments are used with real-time collaboration.
30
+ * When a user connects to an existing document, the operations from the history need to be applied one by one.
31
+ * An operation which added a new comment marker might be followed by an operation which removes that marker, so it's not
32
+ * necessary to make an additional request then.
33
+ *
34
+ * @observable
35
+ */
36
+ isThreadsLoadingPaused: boolean;
37
+ /**
38
+ * Name of the active comment marker.
39
+ *
40
+ * Markers conversion checks if comment should be marked as active and adds/removes additional css class during the conversion.
41
+ *
42
+ * @observable
43
+ */
44
+ activeMarker: string | null;
45
+ /**
46
+ * @inheritDoc
47
+ */
48
+ static get requires(): readonly [typeof CommentsRepository, typeof EditorAnnotations, typeof CommentsRestrictedEditingMode, typeof CommentsImportWord, typeof CommentsClipboard];
49
+ /**
50
+ * @inheritDoc
51
+ */
52
+ static get pluginName(): "CommentsEditing";
53
+ /**
54
+ * @inheritDoc
55
+ */
56
+ constructor(editor: Editor);
57
+ /**
58
+ * @inheritDoc
59
+ */
60
+ init(): void;
61
+ /**
62
+ * @inheritDoc
63
+ */
64
+ destroy(): void;
65
+ /**
66
+ * Returns `true` if there is at least one marker in the content that is related to a comment thread with given `threadId`.
67
+ *
68
+ * @param threadId Comment thread id.
69
+ */
70
+ hasMarkerForId(threadId: string): boolean;
71
+ /**
72
+ * Returns all markers that are related to the comment thread with the given `threadId`.
73
+ *
74
+ * @param threadId Comment thread id.
75
+ * @returns Array with all markers related to given comment thread.
76
+ */
77
+ getAllMarkersForId(threadId: string): Array<Marker>;
78
+ /**
79
+ * Scrolls editing view to the first thread marker.
80
+ *
81
+ * @param threadId Comment thread id.
82
+ */
83
+ scrollToThreadMarker(threadId: string): void;
84
+ }