@ckeditor/ckeditor5-comments 41.3.1 → 41.4.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/comments.js +1 -1
- package/dist/index-content.css +4 -0
- package/dist/index-editor.css +596 -0
- package/dist/index.css +926 -0
- package/dist/index.js +23 -0
- package/dist/translations/af.d.ts +8 -0
- package/dist/translations/af.js +23 -0
- package/dist/translations/ar.d.ts +8 -0
- package/dist/translations/ar.js +23 -0
- package/dist/translations/bg.d.ts +8 -0
- package/dist/translations/bg.js +23 -0
- package/dist/translations/bn.d.ts +8 -0
- package/dist/translations/bn.js +23 -0
- package/dist/translations/bs.d.ts +8 -0
- package/dist/translations/bs.js +23 -0
- package/dist/translations/ca.d.ts +8 -0
- package/dist/translations/ca.js +23 -0
- package/dist/translations/cs.d.ts +8 -0
- package/dist/translations/cs.js +23 -0
- package/dist/translations/da.d.ts +8 -0
- package/dist/translations/da.js +23 -0
- package/dist/translations/de-ch.d.ts +8 -0
- package/dist/translations/de-ch.js +23 -0
- package/dist/translations/de.d.ts +8 -0
- package/dist/translations/de.js +23 -0
- package/dist/translations/el.d.ts +8 -0
- package/dist/translations/el.js +23 -0
- package/dist/translations/en-au.d.ts +8 -0
- package/dist/translations/en-au.js +23 -0
- package/dist/translations/en.d.ts +8 -0
- package/dist/translations/en.js +23 -0
- package/dist/translations/es-co.d.ts +8 -0
- package/dist/translations/es-co.js +23 -0
- package/dist/translations/es.d.ts +8 -0
- package/dist/translations/es.js +23 -0
- package/dist/translations/et.d.ts +8 -0
- package/dist/translations/et.js +23 -0
- package/dist/translations/fa.d.ts +8 -0
- package/dist/translations/fa.js +23 -0
- package/dist/translations/fi.d.ts +8 -0
- package/dist/translations/fi.js +23 -0
- package/dist/translations/fr.d.ts +8 -0
- package/dist/translations/fr.js +23 -0
- package/dist/translations/gl.d.ts +8 -0
- package/dist/translations/gl.js +23 -0
- package/dist/translations/he.d.ts +8 -0
- package/dist/translations/he.js +23 -0
- package/dist/translations/hi.d.ts +8 -0
- package/dist/translations/hi.js +23 -0
- package/dist/translations/hr.d.ts +8 -0
- package/dist/translations/hr.js +23 -0
- package/dist/translations/hu.d.ts +8 -0
- package/dist/translations/hu.js +23 -0
- package/dist/translations/id.d.ts +8 -0
- package/dist/translations/id.js +23 -0
- package/dist/translations/it.d.ts +8 -0
- package/dist/translations/it.js +23 -0
- package/dist/translations/ja.d.ts +8 -0
- package/dist/translations/ja.js +23 -0
- package/dist/translations/jv.d.ts +8 -0
- package/dist/translations/jv.js +23 -0
- package/dist/translations/ko.d.ts +8 -0
- package/dist/translations/ko.js +23 -0
- package/dist/translations/lt.d.ts +8 -0
- package/dist/translations/lt.js +23 -0
- package/dist/translations/lv.d.ts +8 -0
- package/dist/translations/lv.js +23 -0
- package/dist/translations/ms.d.ts +8 -0
- package/dist/translations/ms.js +23 -0
- package/dist/translations/nl.d.ts +8 -0
- package/dist/translations/nl.js +23 -0
- package/dist/translations/no.d.ts +8 -0
- package/dist/translations/no.js +23 -0
- package/dist/translations/pl.d.ts +8 -0
- package/dist/translations/pl.js +23 -0
- package/dist/translations/pt-br.d.ts +8 -0
- package/dist/translations/pt-br.js +23 -0
- package/dist/translations/pt.d.ts +8 -0
- package/dist/translations/pt.js +23 -0
- package/dist/translations/ro.d.ts +8 -0
- package/dist/translations/ro.js +23 -0
- package/dist/translations/ru.d.ts +8 -0
- package/dist/translations/ru.js +23 -0
- package/dist/translations/sk.d.ts +8 -0
- package/dist/translations/sk.js +23 -0
- package/dist/translations/sq.d.ts +8 -0
- package/dist/translations/sq.js +23 -0
- package/dist/translations/sr-latn.d.ts +8 -0
- package/dist/translations/sr-latn.js +23 -0
- package/dist/translations/sr.d.ts +8 -0
- package/dist/translations/sr.js +23 -0
- package/dist/translations/sv.d.ts +8 -0
- package/dist/translations/sv.js +23 -0
- package/dist/translations/th.d.ts +8 -0
- package/dist/translations/th.js +23 -0
- package/dist/translations/tk.d.ts +8 -0
- package/dist/translations/tk.js +23 -0
- package/dist/translations/tr.d.ts +8 -0
- package/dist/translations/tr.js +23 -0
- package/dist/translations/tt.d.ts +8 -0
- package/dist/translations/tt.js +23 -0
- package/dist/translations/ug.d.ts +8 -0
- package/dist/translations/ug.js +23 -0
- package/dist/translations/uk.d.ts +8 -0
- package/dist/translations/uk.js +23 -0
- package/dist/translations/ur.d.ts +8 -0
- package/dist/translations/ur.js +23 -0
- package/dist/translations/vi.d.ts +8 -0
- package/dist/translations/vi.js +23 -0
- package/dist/translations/zh-cn.d.ts +8 -0
- package/dist/translations/zh-cn.js +23 -0
- package/dist/translations/zh.d.ts +8 -0
- package/dist/translations/zh.js +23 -0
- package/dist/types/annotations/annotation.d.ts +94 -0
- package/dist/types/annotations/annotationcollection.d.ts +102 -0
- package/dist/types/annotations/annotations.d.ts +158 -0
- package/dist/types/annotations/annotationsuis.d.ts +236 -0
- package/dist/types/annotations/editorannotations.d.ts +71 -0
- package/dist/types/annotations/inlineannotations.d.ts +94 -0
- package/dist/types/annotations/narrowsidebar.d.ts +89 -0
- package/dist/types/annotations/sidebar.d.ts +104 -0
- package/dist/types/annotations/view/annotationcounterbuttonview.d.ts +33 -0
- package/dist/types/annotations/view/annotationview.d.ts +94 -0
- package/dist/types/annotations/view/sidebaritemview.d.ts +59 -0
- package/dist/types/annotations/view/sidebarview.d.ts +36 -0
- package/dist/types/annotations/widesidebar.d.ts +81 -0
- package/dist/types/augmentation.d.ts +56 -0
- package/dist/types/comments/addcommentthreadcommand.d.ts +39 -0
- package/dist/types/comments/commentsarchive.d.ts +35 -0
- package/dist/types/comments/commentsarchiveui.d.ts +42 -0
- package/dist/types/comments/commentsediting.d.ts +84 -0
- package/dist/types/comments/commentsrepository.d.ts +1134 -0
- package/dist/types/comments/commentsui.d.ts +37 -0
- package/dist/types/comments/integrations/clipboard.d.ts +30 -0
- package/dist/types/comments/integrations/commentsrestrictededitingmode.d.ts +21 -0
- package/dist/types/comments/integrations/importword.d.ts +25 -0
- package/dist/types/comments/ui/commenteditor/commenteditor.d.ts +40 -0
- package/dist/types/comments/ui/commenteditor/commenteditorui.d.ts +35 -0
- package/dist/types/comments/ui/commenteditor/commenteditoruiview.d.ts +40 -0
- package/dist/types/comments/ui/commentthreadcontroller.d.ts +68 -0
- package/dist/types/comments/ui/view/basecommentthreadview.d.ts +123 -0
- package/dist/types/comments/ui/view/basecommentview.d.ts +116 -0
- package/dist/types/comments/ui/view/collapsedcommentsview.d.ts +17 -0
- package/dist/types/comments/ui/view/commentcontentview.d.ts +18 -0
- package/dist/types/comments/ui/view/commentinputview.d.ts +90 -0
- package/dist/types/comments/ui/view/commentsarchiveview.d.ts +42 -0
- package/dist/types/comments/ui/view/commentslistview.d.ts +104 -0
- package/dist/types/comments/ui/view/commentthreadheaderview.d.ts +54 -0
- package/dist/types/comments/ui/view/commentthreadinputview.d.ts +45 -0
- package/dist/types/comments/ui/view/commentthreadview.d.ts +122 -0
- package/dist/types/comments/ui/view/commentview.d.ts +247 -0
- package/dist/types/comments.d.ts +39 -0
- package/dist/types/commentsonly.d.ts +37 -0
- package/dist/types/config.d.ts +202 -0
- package/dist/types/index.d.ts +28 -0
- package/dist/types/utils/common-translations.d.ts +13 -0
- package/dist/types/utils/createmutationobserver.d.ts +18 -0
- package/package.json +4 -3
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.js +1 -1
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.js +1 -1
- package/src/comments/commentsarchiveui.js +1 -1
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/clipboard.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
- package/src/comments/ui/commentthreadcontroller.js +1 -1
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.js +1 -1
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.js +1 -1
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.js +1 -1
- package/src/commentsonly.js +1 -1
- package/src/index.js +1 -1
- package/src/utils/common-translations.js +1 -1
- 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
|
+
}
|