@ckeditor/ckeditor5-comments 38.1.1 → 38.2.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.
- package/build/comments.js +1 -1
- package/package.json +4 -3
- package/src/annotations/annotation.d.ts +86 -86
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.d.ts +94 -94
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.d.ts +150 -150
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.d.ts +228 -228
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.d.ts +63 -63
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.d.ts +86 -86
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.d.ts +81 -81
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.d.ts +96 -96
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.d.ts +25 -25
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.d.ts +86 -86
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.d.ts +51 -51
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.d.ts +28 -28
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.d.ts +73 -73
- package/src/annotations/widesidebar.js +1 -1
- package/src/augmentation.d.ts +48 -48
- package/src/comments/addcommentthreadcommand.d.ts +31 -31
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.d.ts +27 -27
- package/src/comments/commentsarchive.js +1 -1
- package/src/comments/commentsarchiveui.d.ts +34 -34
- package/src/comments/commentsarchiveui.js +1 -1
- package/src/comments/commentsediting.d.ts +75 -75
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1088 -1088
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.d.ts +29 -29
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.d.ts +13 -13
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.d.ts +17 -17
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.d.ts +32 -32
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.d.ts +27 -27
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +32 -32
- package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
- package/src/comments/ui/commentthreadcontroller.d.ts +64 -64
- package/src/comments/ui/commentthreadcontroller.js +1 -1
- package/src/comments/ui/view/basecommentthreadview.d.ts +108 -108
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.d.ts +108 -108
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.d.ts +9 -9
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.d.ts +10 -10
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.d.ts +82 -82
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.d.ts +34 -34
- package/src/comments/ui/view/commentsarchiveview.js +1 -1
- package/src/comments/ui/view/commentslistview.d.ts +96 -96
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.d.ts +46 -46
- package/src/comments/ui/view/commentthreadheaderview.js +1 -1
- package/src/comments/ui/view/commentthreadinputview.d.ts +37 -37
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.d.ts +113 -113
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.d.ts +239 -239
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.d.ts +31 -31
- package/src/comments.js +1 -1
- package/src/commentsonly.d.ts +29 -29
- package/src/commentsonly.js +1 -1
- package/src/config.d.ts +172 -172
- package/src/index.d.ts +21 -21
- package/src/index.js +1 -1
- package/src/utils/common-translations.d.ts +5 -5
- package/src/utils/common-translations.js +1 -1
- package/src/utils/createmutationobserver.d.ts +13 -13
- package/src/utils/createmutationobserver.js +1 -1
|
@@ -1,239 +1,239 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/commentview
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { type Locale } from 'ckeditor5/src/utils';
|
|
6
|
-
import { ButtonView, type TemplateDefinition, type ViewCollection, type DropdownView } from 'ckeditor5/src/ui';
|
|
7
|
-
import { UserView } from 'ckeditor5-collaboration
|
|
8
|
-
import BaseCommentView from './basecommentview';
|
|
9
|
-
import type { Comment } from '../../commentsrepository';
|
|
10
|
-
import type CommentInputView from './commentinputview';
|
|
11
|
-
import type { CommentViewConfig } from '../../../config';
|
|
12
|
-
declare const CommentView_base: import("ckeditor5/src/utils").Mixed<typeof BaseCommentView, import("@ckeditor/ckeditor5-collaboration-core/src/utils/confirmmixin").ConfirmApi>;
|
|
13
|
-
/**
|
|
14
|
-
* The default view for comment.
|
|
15
|
-
*/
|
|
16
|
-
export default class CommentView extends CommentView_base {
|
|
17
|
-
locale: Locale;
|
|
18
|
-
isConfirm: boolean;
|
|
19
|
-
cancelConfirm: () => void;
|
|
20
|
-
showConfirm: (key: string, element: unknown) => Promise<void>;
|
|
21
|
-
/**
|
|
22
|
-
* A property used by the template.
|
|
23
|
-
*
|
|
24
|
-
* It works as a visual indicator for the user that an action is about to be performed.
|
|
25
|
-
* The value of this property is used in setting the CSS class.
|
|
26
|
-
* The property is used when the user interacts with the view.
|
|
27
|
-
*
|
|
28
|
-
* @observable
|
|
29
|
-
*/
|
|
30
|
-
actionIndicator: string | null;
|
|
31
|
-
/**
|
|
32
|
-
* Comment editor placeholder value.
|
|
33
|
-
*
|
|
34
|
-
* @observable
|
|
35
|
-
*/
|
|
36
|
-
placeholder: string;
|
|
37
|
-
/**
|
|
38
|
-
* Comment creation date.
|
|
39
|
-
*
|
|
40
|
-
* @observable
|
|
41
|
-
*/
|
|
42
|
-
authoredAt: Date;
|
|
43
|
-
/**
|
|
44
|
-
* Comment resolved date.
|
|
45
|
-
*
|
|
46
|
-
* @observable
|
|
47
|
-
*/
|
|
48
|
-
resolvedAt: Date | null;
|
|
49
|
-
/**
|
|
50
|
-
* Collection for UI elements that manage the comment.
|
|
51
|
-
*
|
|
52
|
-
* Elements that may be found in the action bar (depending on the comment view properties):
|
|
53
|
-
*
|
|
54
|
-
* * the resolve comment thread button (only if the comment is the first comment),
|
|
55
|
-
* * a dropdown with actions ({@link ~CommentView#dropdown `dropdown`}).
|
|
56
|
-
*/
|
|
57
|
-
actionBar: ViewCollection;
|
|
58
|
-
/**
|
|
59
|
-
* View collection which holds all the comments dropdown elements.
|
|
60
|
-
*
|
|
61
|
-
* May include, depending on the view properties:
|
|
62
|
-
*
|
|
63
|
-
* * {@link ~CommentView#editButton `editButton`},
|
|
64
|
-
* * {@link ~CommentView#removeButton `removeButton`}.
|
|
65
|
-
*/
|
|
66
|
-
items: ViewCollection<ButtonView>;
|
|
67
|
-
/**
|
|
68
|
-
* Dropdown containing comment action buttons defined in {@link ~CommentView#items `items`}.
|
|
69
|
-
*/
|
|
70
|
-
dropdown: DropdownView;
|
|
71
|
-
/**
|
|
72
|
-
* Edit button view. Edit button switches the comment to the editing mode.
|
|
73
|
-
*/
|
|
74
|
-
editButton: ButtonView;
|
|
75
|
-
/**
|
|
76
|
-
* Remove button view. Remove button shows a confirmation box that fires the `removeComment` event when submitted.
|
|
77
|
-
*/
|
|
78
|
-
removeButton: ButtonView;
|
|
79
|
-
/**
|
|
80
|
-
* User view for the comment. Presents the comment author.
|
|
81
|
-
*/
|
|
82
|
-
userView: UserView;
|
|
83
|
-
/**
|
|
84
|
-
* @inheritDoc
|
|
85
|
-
*/
|
|
86
|
-
constructor(locale: Locale, model: Comment, config: CommentViewConfig);
|
|
87
|
-
/**
|
|
88
|
-
* Returns a template definition that will be passed to {@link module:ui/view~View#setTemplate}.
|
|
89
|
-
*
|
|
90
|
-
* Overwrite this method if you want to set a custom template for the comment view.
|
|
91
|
-
*
|
|
92
|
-
* The default template looks as follows:
|
|
93
|
-
*
|
|
94
|
-
* ```ts
|
|
95
|
-
* const bind = this.bindTemplate;
|
|
96
|
-
*
|
|
97
|
-
* {
|
|
98
|
-
* tag: 'li',
|
|
99
|
-
*
|
|
100
|
-
* attributes: {
|
|
101
|
-
* class: [
|
|
102
|
-
* 'ck-comment__wrapper',
|
|
103
|
-
* bind.if( 'isConfirm', 'ck-comment--remove-confirmation' )
|
|
104
|
-
* ],
|
|
105
|
-
* tabindex: -1
|
|
106
|
-
* },
|
|
107
|
-
*
|
|
108
|
-
* children: [
|
|
109
|
-
* {
|
|
110
|
-
* tag: 'div',
|
|
111
|
-
*
|
|
112
|
-
* attributes: {
|
|
113
|
-
* class: [
|
|
114
|
-
* 'ck-comment',
|
|
115
|
-
* 'ck-annotation',
|
|
116
|
-
* bind.if( 'isSystemComment', 'ck-comment--info' ),
|
|
117
|
-
* bind.if( 'isEditMode', 'ck-comment--edit' ),
|
|
118
|
-
* bind.to( 'actionIndicator', value => value ? `ck-comment--${ value }` : '' )
|
|
119
|
-
* ],
|
|
120
|
-
* 'data-author-id': this._model.author.id,
|
|
121
|
-
* 'data-comment-id': this._model.id
|
|
122
|
-
* },
|
|
123
|
-
*
|
|
124
|
-
* children: [
|
|
125
|
-
* this.userView,
|
|
126
|
-
* {
|
|
127
|
-
* tag: 'div',
|
|
128
|
-
*
|
|
129
|
-
* attributes: {
|
|
130
|
-
* class: [ 'ck-comment__main', 'ck-annotation__main' ]
|
|
131
|
-
* },
|
|
132
|
-
*
|
|
133
|
-
* children: [
|
|
134
|
-
* {
|
|
135
|
-
* tag: 'div',
|
|
136
|
-
*
|
|
137
|
-
* attributes: {
|
|
138
|
-
* class: [ 'ck-comment__info', 'ck-annotation__info' ]
|
|
139
|
-
* },
|
|
140
|
-
*
|
|
141
|
-
* children: [
|
|
142
|
-
* {
|
|
143
|
-
* tag: 'span',
|
|
144
|
-
*
|
|
145
|
-
* children: [
|
|
146
|
-
* {
|
|
147
|
-
* text: this.userView.name
|
|
148
|
-
* }
|
|
149
|
-
* ],
|
|
150
|
-
*
|
|
151
|
-
* attributes: {
|
|
152
|
-
* class: [ 'ck-comment__info-name', 'ck-annotation__info-name' ]
|
|
153
|
-
* }
|
|
154
|
-
* },
|
|
155
|
-
* {
|
|
156
|
-
* tag: 'time',
|
|
157
|
-
*
|
|
158
|
-
* attributes: {
|
|
159
|
-
* datetime: bind.to( 'authoredAt' ),
|
|
160
|
-
* class: [ 'ck-comment__info-time', 'ck-annotation__info-time' ]
|
|
161
|
-
* },
|
|
162
|
-
*
|
|
163
|
-
* children: [
|
|
164
|
-
* {
|
|
165
|
-
* text: bind.to( 'authoredAt', value => this._config.formatDateTime( value ) )
|
|
166
|
-
* }
|
|
167
|
-
* ]
|
|
168
|
-
* }
|
|
169
|
-
* ]
|
|
170
|
-
* },
|
|
171
|
-
* {
|
|
172
|
-
* tag: 'div',
|
|
173
|
-
*
|
|
174
|
-
* attributes: {
|
|
175
|
-
* class: [
|
|
176
|
-
* 'ck-comment__actions',
|
|
177
|
-
* 'ck-annotation__actions',
|
|
178
|
-
* bind.if( 'isEditMode', 'ck-comment__actions--hidden' ),
|
|
179
|
-
* bind.if( 'isEditMode', 'ck-annotation__actions--hidden' )
|
|
180
|
-
* ]
|
|
181
|
-
* },
|
|
182
|
-
*
|
|
183
|
-
* children: this.actionBar
|
|
184
|
-
* },
|
|
185
|
-
* {
|
|
186
|
-
* tag: 'div',
|
|
187
|
-
*
|
|
188
|
-
* attributes: {
|
|
189
|
-
* class: [ 'ck-annotation__content-wrapper' ]
|
|
190
|
-
* },
|
|
191
|
-
*
|
|
192
|
-
* children: this.visibleView
|
|
193
|
-
* },
|
|
194
|
-
* {
|
|
195
|
-
* tag: 'div',
|
|
196
|
-
*
|
|
197
|
-
* attributes: {
|
|
198
|
-
* class: [ 'ck-comment__external' ]
|
|
199
|
-
* },
|
|
200
|
-
*
|
|
201
|
-
* children: [ {
|
|
202
|
-
* text: this.getExternalCommentNote()
|
|
203
|
-
* } ]
|
|
204
|
-
* }
|
|
205
|
-
* ]
|
|
206
|
-
* }
|
|
207
|
-
*
|
|
208
|
-
* ]
|
|
209
|
-
* }
|
|
210
|
-
* ]
|
|
211
|
-
* }
|
|
212
|
-
* ```
|
|
213
|
-
*
|
|
214
|
-
* @returns Definition of comment thread view's template.
|
|
215
|
-
*/
|
|
216
|
-
getTemplate(): TemplateDefinition;
|
|
217
|
-
/**
|
|
218
|
-
* @inheritDoc
|
|
219
|
-
*/
|
|
220
|
-
protected _createCommentInputView(): CommentInputView;
|
|
221
|
-
/**
|
|
222
|
-
* Gets the translated note which indicates that the comment comes from an external source.
|
|
223
|
-
*/
|
|
224
|
-
getExternalCommentNote(): string;
|
|
225
|
-
/**
|
|
226
|
-
* Gets the translated notification text which indicates that author name comes from an external source.
|
|
227
|
-
*/
|
|
228
|
-
getUserViewNotificationText(): string | null;
|
|
229
|
-
/**
|
|
230
|
-
* @inheritDoc
|
|
231
|
-
*/
|
|
232
|
-
render(): void;
|
|
233
|
-
}
|
|
234
|
-
declare module 'ckeditor5/src/ui' {
|
|
235
|
-
interface DropdownView {
|
|
236
|
-
isVisible: boolean;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/commentview
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
6
|
+
import { ButtonView, type TemplateDefinition, type ViewCollection, type DropdownView } from 'ckeditor5/src/ui.js';
|
|
7
|
+
import { UserView } from 'ckeditor5-collaboration';
|
|
8
|
+
import BaseCommentView from './basecommentview.js';
|
|
9
|
+
import type { Comment } from '../../commentsrepository.js';
|
|
10
|
+
import type CommentInputView from './commentinputview.js';
|
|
11
|
+
import type { CommentViewConfig } from '../../../config.js';
|
|
12
|
+
declare const CommentView_base: import("ckeditor5/src/utils.js").Mixed<typeof BaseCommentView, import("@ckeditor/ckeditor5-collaboration-core/src/utils/confirmmixin.js").ConfirmApi>;
|
|
13
|
+
/**
|
|
14
|
+
* The default view for comment.
|
|
15
|
+
*/
|
|
16
|
+
export default class CommentView extends CommentView_base {
|
|
17
|
+
locale: Locale;
|
|
18
|
+
isConfirm: boolean;
|
|
19
|
+
cancelConfirm: () => void;
|
|
20
|
+
showConfirm: (key: string, element: unknown) => Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* A property used by the template.
|
|
23
|
+
*
|
|
24
|
+
* It works as a visual indicator for the user that an action is about to be performed.
|
|
25
|
+
* The value of this property is used in setting the CSS class.
|
|
26
|
+
* The property is used when the user interacts with the view.
|
|
27
|
+
*
|
|
28
|
+
* @observable
|
|
29
|
+
*/
|
|
30
|
+
actionIndicator: string | null;
|
|
31
|
+
/**
|
|
32
|
+
* Comment editor placeholder value.
|
|
33
|
+
*
|
|
34
|
+
* @observable
|
|
35
|
+
*/
|
|
36
|
+
placeholder: string;
|
|
37
|
+
/**
|
|
38
|
+
* Comment creation date.
|
|
39
|
+
*
|
|
40
|
+
* @observable
|
|
41
|
+
*/
|
|
42
|
+
authoredAt: Date;
|
|
43
|
+
/**
|
|
44
|
+
* Comment resolved date.
|
|
45
|
+
*
|
|
46
|
+
* @observable
|
|
47
|
+
*/
|
|
48
|
+
resolvedAt: Date | null;
|
|
49
|
+
/**
|
|
50
|
+
* Collection for UI elements that manage the comment.
|
|
51
|
+
*
|
|
52
|
+
* Elements that may be found in the action bar (depending on the comment view properties):
|
|
53
|
+
*
|
|
54
|
+
* * the resolve comment thread button (only if the comment is the first comment),
|
|
55
|
+
* * a dropdown with actions ({@link ~CommentView#dropdown `dropdown`}).
|
|
56
|
+
*/
|
|
57
|
+
actionBar: ViewCollection;
|
|
58
|
+
/**
|
|
59
|
+
* View collection which holds all the comments dropdown elements.
|
|
60
|
+
*
|
|
61
|
+
* May include, depending on the view properties:
|
|
62
|
+
*
|
|
63
|
+
* * {@link ~CommentView#editButton `editButton`},
|
|
64
|
+
* * {@link ~CommentView#removeButton `removeButton`}.
|
|
65
|
+
*/
|
|
66
|
+
items: ViewCollection<ButtonView>;
|
|
67
|
+
/**
|
|
68
|
+
* Dropdown containing comment action buttons defined in {@link ~CommentView#items `items`}.
|
|
69
|
+
*/
|
|
70
|
+
dropdown: DropdownView;
|
|
71
|
+
/**
|
|
72
|
+
* Edit button view. Edit button switches the comment to the editing mode.
|
|
73
|
+
*/
|
|
74
|
+
editButton: ButtonView;
|
|
75
|
+
/**
|
|
76
|
+
* Remove button view. Remove button shows a confirmation box that fires the `removeComment` event when submitted.
|
|
77
|
+
*/
|
|
78
|
+
removeButton: ButtonView;
|
|
79
|
+
/**
|
|
80
|
+
* User view for the comment. Presents the comment author.
|
|
81
|
+
*/
|
|
82
|
+
userView: UserView;
|
|
83
|
+
/**
|
|
84
|
+
* @inheritDoc
|
|
85
|
+
*/
|
|
86
|
+
constructor(locale: Locale, model: Comment, config: CommentViewConfig);
|
|
87
|
+
/**
|
|
88
|
+
* Returns a template definition that will be passed to {@link module:ui/view~View#setTemplate}.
|
|
89
|
+
*
|
|
90
|
+
* Overwrite this method if you want to set a custom template for the comment view.
|
|
91
|
+
*
|
|
92
|
+
* The default template looks as follows:
|
|
93
|
+
*
|
|
94
|
+
* ```ts
|
|
95
|
+
* const bind = this.bindTemplate;
|
|
96
|
+
*
|
|
97
|
+
* {
|
|
98
|
+
* tag: 'li',
|
|
99
|
+
*
|
|
100
|
+
* attributes: {
|
|
101
|
+
* class: [
|
|
102
|
+
* 'ck-comment__wrapper',
|
|
103
|
+
* bind.if( 'isConfirm', 'ck-comment--remove-confirmation' )
|
|
104
|
+
* ],
|
|
105
|
+
* tabindex: -1
|
|
106
|
+
* },
|
|
107
|
+
*
|
|
108
|
+
* children: [
|
|
109
|
+
* {
|
|
110
|
+
* tag: 'div',
|
|
111
|
+
*
|
|
112
|
+
* attributes: {
|
|
113
|
+
* class: [
|
|
114
|
+
* 'ck-comment',
|
|
115
|
+
* 'ck-annotation',
|
|
116
|
+
* bind.if( 'isSystemComment', 'ck-comment--info' ),
|
|
117
|
+
* bind.if( 'isEditMode', 'ck-comment--edit' ),
|
|
118
|
+
* bind.to( 'actionIndicator', value => value ? `ck-comment--${ value }` : '' )
|
|
119
|
+
* ],
|
|
120
|
+
* 'data-author-id': this._model.author.id,
|
|
121
|
+
* 'data-comment-id': this._model.id
|
|
122
|
+
* },
|
|
123
|
+
*
|
|
124
|
+
* children: [
|
|
125
|
+
* this.userView,
|
|
126
|
+
* {
|
|
127
|
+
* tag: 'div',
|
|
128
|
+
*
|
|
129
|
+
* attributes: {
|
|
130
|
+
* class: [ 'ck-comment__main', 'ck-annotation__main' ]
|
|
131
|
+
* },
|
|
132
|
+
*
|
|
133
|
+
* children: [
|
|
134
|
+
* {
|
|
135
|
+
* tag: 'div',
|
|
136
|
+
*
|
|
137
|
+
* attributes: {
|
|
138
|
+
* class: [ 'ck-comment__info', 'ck-annotation__info' ]
|
|
139
|
+
* },
|
|
140
|
+
*
|
|
141
|
+
* children: [
|
|
142
|
+
* {
|
|
143
|
+
* tag: 'span',
|
|
144
|
+
*
|
|
145
|
+
* children: [
|
|
146
|
+
* {
|
|
147
|
+
* text: this.userView.name
|
|
148
|
+
* }
|
|
149
|
+
* ],
|
|
150
|
+
*
|
|
151
|
+
* attributes: {
|
|
152
|
+
* class: [ 'ck-comment__info-name', 'ck-annotation__info-name' ]
|
|
153
|
+
* }
|
|
154
|
+
* },
|
|
155
|
+
* {
|
|
156
|
+
* tag: 'time',
|
|
157
|
+
*
|
|
158
|
+
* attributes: {
|
|
159
|
+
* datetime: bind.to( 'authoredAt' ),
|
|
160
|
+
* class: [ 'ck-comment__info-time', 'ck-annotation__info-time' ]
|
|
161
|
+
* },
|
|
162
|
+
*
|
|
163
|
+
* children: [
|
|
164
|
+
* {
|
|
165
|
+
* text: bind.to( 'authoredAt', value => this._config.formatDateTime( value ) )
|
|
166
|
+
* }
|
|
167
|
+
* ]
|
|
168
|
+
* }
|
|
169
|
+
* ]
|
|
170
|
+
* },
|
|
171
|
+
* {
|
|
172
|
+
* tag: 'div',
|
|
173
|
+
*
|
|
174
|
+
* attributes: {
|
|
175
|
+
* class: [
|
|
176
|
+
* 'ck-comment__actions',
|
|
177
|
+
* 'ck-annotation__actions',
|
|
178
|
+
* bind.if( 'isEditMode', 'ck-comment__actions--hidden' ),
|
|
179
|
+
* bind.if( 'isEditMode', 'ck-annotation__actions--hidden' )
|
|
180
|
+
* ]
|
|
181
|
+
* },
|
|
182
|
+
*
|
|
183
|
+
* children: this.actionBar
|
|
184
|
+
* },
|
|
185
|
+
* {
|
|
186
|
+
* tag: 'div',
|
|
187
|
+
*
|
|
188
|
+
* attributes: {
|
|
189
|
+
* class: [ 'ck-annotation__content-wrapper' ]
|
|
190
|
+
* },
|
|
191
|
+
*
|
|
192
|
+
* children: this.visibleView
|
|
193
|
+
* },
|
|
194
|
+
* {
|
|
195
|
+
* tag: 'div',
|
|
196
|
+
*
|
|
197
|
+
* attributes: {
|
|
198
|
+
* class: [ 'ck-comment__external' ]
|
|
199
|
+
* },
|
|
200
|
+
*
|
|
201
|
+
* children: [ {
|
|
202
|
+
* text: this.getExternalCommentNote()
|
|
203
|
+
* } ]
|
|
204
|
+
* }
|
|
205
|
+
* ]
|
|
206
|
+
* }
|
|
207
|
+
*
|
|
208
|
+
* ]
|
|
209
|
+
* }
|
|
210
|
+
* ]
|
|
211
|
+
* }
|
|
212
|
+
* ```
|
|
213
|
+
*
|
|
214
|
+
* @returns Definition of comment thread view's template.
|
|
215
|
+
*/
|
|
216
|
+
getTemplate(): TemplateDefinition;
|
|
217
|
+
/**
|
|
218
|
+
* @inheritDoc
|
|
219
|
+
*/
|
|
220
|
+
protected _createCommentInputView(): CommentInputView;
|
|
221
|
+
/**
|
|
222
|
+
* Gets the translated note which indicates that the comment comes from an external source.
|
|
223
|
+
*/
|
|
224
|
+
getExternalCommentNote(): string;
|
|
225
|
+
/**
|
|
226
|
+
* Gets the translated notification text which indicates that author name comes from an external source.
|
|
227
|
+
*/
|
|
228
|
+
getUserViewNotificationText(): string | null;
|
|
229
|
+
/**
|
|
230
|
+
* @inheritDoc
|
|
231
|
+
*/
|
|
232
|
+
render(): void;
|
|
233
|
+
}
|
|
234
|
+
declare module 'ckeditor5/src/ui' {
|
|
235
|
+
interface DropdownView {
|
|
236
|
+
isVisible: boolean;
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
export {};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1a88=['bind','EXTERNAL_COMMENT','isRemovable','pencil','ck-comment--edit','Delete\x20comment?','EXTERNAL_IMPORT_WORD_AVATAR','ck-annotation__user','isSystemComment','author','mouseleave','isExternal','isEditable','ck-comment__info','panelPosition','_createDropdown','Reply...','ck-comment--remove-confirmation','removeButton','ck-comment__main','getUserViewNotificationText','_attachActions','ck-comment__info-name','listenTo','fire','ck-comment__external','label','attributes','ck-annotation__info','ck-annotation__info-time','authoredAt','div','focus','addMany','resolvedAt','name','children','ck-comment--','@external','locale','importWord','removeComment','_model','createCollection','span','edit','isEnabled','add','buttonView','isVisible','creator','extendTemplate','_config','ck-annotation__main','Show\x20more\x20items','placeholder','icon','remove','change:isRemovable','ck-comment__actions','withText','change:isEnabled','panelView','EXTERNAL_IMPORT_WORD_COMMENT','set','cancelConfirm','actionBar','setTemplate','element','ck-comment__user','EXTERNAL_AVATAR','actionIndicator','dropdown','ck-annotation__actions--hidden','change:isVisible','_createRemoveButton','render','visibleView','isReadOnly','items','blur','userView','Edit','_createCommentInputView','isConfirm','Remove','some','push','mouseenter','editButton','getExternalCommentNote','getTemplate','time','switchToEditMode','isEditMode','execute','_createEditButton'];(function(_0x267ab3,_0x1a880f){const _0x5eea3d=function(_0x2374a0){while(--_0x2374a0){_0x267ab3['push'](_0x267ab3['shift']());}};_0x5eea3d(++_0x1a880f);}(_0x1a88,0x105));const _0x5eea=function(_0x267ab3,_0x1a880f){_0x267ab3=_0x267ab3-0x0;let _0x5eea3d=_0x1a88[_0x267ab3];return _0x5eea3d;};import{ButtonView as _0x1bdbc3,createDropdown as _0x402a1d,ListView as _0x5e0c85,ListItemView as _0x40c5bf}from'ckeditor5/src/ui.js';import{icons as _0x37d64b}from'ckeditor5/src/core.js';import{UserView as _0x136cc0,ConfirmMixin as _0x31c7cb}from'ckeditor5-collaboration';import _0x4cf623 from'./basecommentview.js';import _0x5974f5 from'../../../../theme/icons/remove-comment.svg';import{getTranslation as _0x2df098}from'../../../utils/common-translations.js';export default class ut extends _0x31c7cb(_0x4cf623){constructor(_0x1d64f4,_0x166890,_0x41b862){super(_0x1d64f4,_0x166890,_0x41b862),this[_0x5eea('0x5e')](_0x5eea('0x4'),null),this['set'](_0x5eea('0x55'),_0x2df098(_0x1d64f4,_0x5eea('0x2e'))),this[_0x5eea('0x1e')](_0x5eea('0x3c'))['to'](_0x166890),this[_0x5eea('0x1e')](_0x5eea('0x40'))['to'](_0x166890),this[_0x5eea('0x60')]=this[_0x5eea('0x49')](),this[_0x5eea('0x26')]||(this[_0x5eea('0x16')]=this[_0x5eea('0x1d')](),this[_0x5eea('0x30')]=this[_0x5eea('0x8')](),this['items']=this[_0x5eea('0x49')](),this[_0x5eea('0xc')][_0x5eea('0x3f')]([this[_0x5eea('0x16')],this[_0x5eea('0x30')]]),this[_0x5eea('0x5')]=this[_0x5eea('0x2d')](),this[_0x5eea('0x60')]['add'](this[_0x5eea('0x5')])),this['userView']=new _0x136cc0(_0x1d64f4,_0x166890[_0x5eea('0x27')],this[_0x5eea('0x32')]()),this[_0x5eea('0xe')][_0x5eea('0x51')]({'attributes':{'class':[_0x5eea('0x2'),_0x5eea('0x25')]}}),this[_0x5eea('0x35')](_0x166890,_0x5eea('0x58'),()=>this[_0x5eea('0x5f')]()),this[_0x5eea('0x0')](this[_0x5eea('0x18')]());}[_0x5eea('0x18')](){const _0x23a0e9=this['bindTemplate'],_0x5a7927=[{'tag':_0x5eea('0x3d'),'attributes':{'class':[_0x5eea('0x2b'),_0x5eea('0x3a')]},'children':[{'tag':_0x5eea('0x4a'),'children':[{'text':this[_0x5eea('0xe')][_0x5eea('0x41')]}],'attributes':{'class':[_0x5eea('0x34'),'ck-annotation__info-name']}},{'tag':_0x5eea('0x19'),'attributes':{'datetime':_0x23a0e9['to'](_0x5eea('0x3c')),'class':['ck-comment__info-time',_0x5eea('0x3b')]},'children':[{'text':_0x23a0e9['to'](_0x5eea('0x3c'),_0xc2ccd1=>this[_0x5eea('0x52')]['formatDateTime'](_0xc2ccd1))}]}]},{'tag':_0x5eea('0x3d'),'attributes':{'class':[_0x5eea('0x59'),'ck-annotation__actions',_0x23a0e9['if'](_0x5eea('0x1b'),'ck-comment__actions--hidden'),_0x23a0e9['if'](_0x5eea('0x1b'),_0x5eea('0x6'))]},'children':this[_0x5eea('0x60')]},{'tag':_0x5eea('0x3d'),'attributes':{'class':['ck-annotation__content-wrapper']},'children':this[_0x5eea('0xa')]}];return this[_0x5eea('0x48')][_0x5eea('0x29')]&&_0x5a7927[_0x5eea('0x14')]({'tag':_0x5eea('0x3d'),'attributes':{'class':[_0x5eea('0x37')]},'children':[{'text':this[_0x5eea('0x17')]()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper',_0x23a0e9['if'](_0x5eea('0x11'),_0x5eea('0x2f'))],'tabindex':-0x1},'children':[{'tag':_0x5eea('0x3d'),'attributes':{'class':['ck-comment','ck-annotation',_0x23a0e9['if'](_0x5eea('0x1b'),_0x5eea('0x22')),_0x23a0e9['if']('isSystemComment','ck-comment--info'),_0x23a0e9['to'](_0x5eea('0x4'),_0x4bb351=>_0x4bb351?_0x5eea('0x43')+_0x4bb351:'')],'data-author-id':this[_0x5eea('0x48')][_0x5eea('0x27')]['id'],'data-comment-id':this[_0x5eea('0x48')]['id']},'children':[this[_0x5eea('0xe')],{'tag':_0x5eea('0x3d'),'attributes':{'class':[_0x5eea('0x31'),_0x5eea('0x53')]},'children':_0x5a7927}]}]};}[_0x5eea('0x1d')](){const _0x1a9fbb=new _0x1bdbc3(this[_0x5eea('0x45')]);return _0x1a9fbb[_0x5eea('0x38')]=_0x2df098(this[_0x5eea('0x45')],_0x5eea('0xf')),_0x1a9fbb['icon']=_0x37d64b[_0x5eea('0x21')],_0x1a9fbb[_0x5eea('0x5a')]=!0x0,_0x1a9fbb[_0x5eea('0x51')]({'attributes':{'class':'ck-comment--edit'}}),_0x1a9fbb[_0x5eea('0x1e')](_0x5eea('0x4c'))['to'](this[_0x5eea('0x48')],'isReadOnly',_0x5bb990=>!_0x5bb990),_0x1a9fbb[_0x5eea('0x1e')]('isVisible')['to'](this[_0x5eea('0x48')],_0x5eea('0x2a')),_0x1a9fbb['on'](_0x5eea('0x1c'),()=>this[_0x5eea('0x1a')]()),_0x1a9fbb;}[_0x5eea('0x8')](){const _0x9c33ca=new _0x1bdbc3(this['locale']);return _0x9c33ca[_0x5eea('0x38')]=_0x2df098(this[_0x5eea('0x45')],_0x5eea('0x12')),_0x9c33ca[_0x5eea('0x56')]=_0x5974f5,_0x9c33ca['withText']=!0x0,_0x9c33ca[_0x5eea('0x51')]({'attributes':{'class':'ck-comment--remove'}}),_0x9c33ca[_0x5eea('0x1e')](_0x5eea('0x4c'))['to'](this[_0x5eea('0x48')],_0x5eea('0xb'),_0x190493=>!_0x190493),_0x9c33ca[_0x5eea('0x1e')](_0x5eea('0x4f'))['to'](this['_model'],_0x5eea('0x20')),_0x9c33ca['on']('execute',()=>{this['showConfirm'](_0x2df098(this[_0x5eea('0x45')],_0x5eea('0x23')),this[_0x5eea('0x1')])['then'](()=>{this[_0x5eea('0x36')](_0x5eea('0x47'),this[_0x5eea('0x48')]['id']);});}),_0x9c33ca;}[_0x5eea('0x2d')](){const _0x363ab2=_0x402a1d(this[_0x5eea('0x45')]),_0x5270b5=_0x363ab2[_0x5eea('0x5c')][_0x5eea('0x42')],_0x36627f=new _0x5e0c85(this[_0x5eea('0x45')]),_0x5004aa=(_0x2ae64f,_0x4013f2=-0x1)=>{const _0xa7ba50=new _0x40c5bf(this[_0x5eea('0x45')]);_0xa7ba50[_0x5eea('0x42')]['add'](_0x2ae64f);const _0x24f74e=_0x4013f2>-0x1?_0x4013f2:_0x36627f[_0x5eea('0xc')]['length'];_0x36627f[_0x5eea('0xc')][_0x5eea('0x4d')](_0xa7ba50,_0x24f74e),_0x363ab2['listenTo'](_0x2ae64f,_0x5eea('0x5b'),()=>{_0x363ab2[_0x5eea('0x4c')]=[...this[_0x5eea('0xc')]][_0x5eea('0x13')](_0x4441a7=>_0x4441a7[_0x5eea('0x4c')]);}),_0x363ab2[_0x5eea('0x35')](_0x2ae64f,_0x5eea('0x7'),()=>{_0x363ab2['buttonView'][_0x5eea('0x4f')]=[...this['items']][_0x5eea('0x13')](_0x22fabd=>_0x22fabd[_0x5eea('0x4f')]);});};_0x363ab2[_0x5eea('0x2c')]='sw',_0x363ab2[_0x5eea('0x4e')]['set']({'label':_0x2df098(this[_0x5eea('0x45')],_0x5eea('0x54')),'icon':_0x37d64b['threeVerticalDots']}),_0x363ab2['isEnabled']=[...this['items']][_0x5eea('0x13')](_0x4b4a90=>_0x4b4a90[_0x5eea('0x4c')]),_0x363ab2[_0x5eea('0x4e')]['isVisible']=[...this['items']]['some'](_0x3ae07a=>_0x3ae07a[_0x5eea('0x4f')]);for(const _0x12b2ab of this[_0x5eea('0xc')])_0x5004aa(_0x12b2ab);return _0x5270b5['add'](_0x36627f),_0x363ab2[_0x5eea('0x35')](this[_0x5eea('0xc')],_0x5eea('0x4d'),(_0x1eab5a,_0x1f26c6,_0x114793)=>{_0x5004aa(_0x1f26c6,_0x114793);}),_0x363ab2[_0x5eea('0x35')](this[_0x5eea('0xc')],_0x5eea('0x57'),(_0x3d4c6d,_0x110200,_0x38c20e)=>{_0x36627f['items'][_0x5eea('0x57')](_0x38c20e);}),_0x363ab2;}[_0x5eea('0x33')](_0x1d664b,_0x2d9a69){const _0x5061f8=_0x1d664b&&_0x1d664b[_0x5eea('0x1')];_0x5061f8&&(this[_0x5eea('0x35')](_0x5061f8,_0x5eea('0x15'),()=>this['actionIndicator']=_0x2d9a69),this[_0x5eea('0x35')](_0x5061f8,_0x5eea('0x3e'),()=>this[_0x5eea('0x4')]=_0x2d9a69),this[_0x5eea('0x35')](_0x5061f8,_0x5eea('0x28'),()=>this[_0x5eea('0x4')]=null),this[_0x5eea('0x35')](_0x5061f8,_0x5eea('0xd'),()=>this[_0x5eea('0x4')]=null));}['_createCommentInputView'](){const _0x2a7f87=super[_0x5eea('0x10')]();return _0x2a7f87[_0x5eea('0x1e')](_0x5eea('0x55'))['to'](this),_0x2a7f87;}[_0x5eea('0x17')](){return _0x5eea('0x46')===this['_model']['attributes'][_0x5eea('0x44')]['source']?_0x2df098(this['locale'],_0x5eea('0x5d')):_0x2df098(this[_0x5eea('0x45')],_0x5eea('0x1f'));}[_0x5eea('0x32')](){return this['_model'][_0x5eea('0x29')]?_0x5eea('0x46')===this['_model'][_0x5eea('0x39')][_0x5eea('0x44')]['source']?_0x2df098(this[_0x5eea('0x45')],_0x5eea('0x24'),this['_model'][_0x5eea('0x50')][_0x5eea('0x41')]):_0x2df098(this[_0x5eea('0x45')],_0x5eea('0x3'),this[_0x5eea('0x48')]['creator'][_0x5eea('0x41')]):null;}[_0x5eea('0x9')](){super[_0x5eea('0x9')](),this[_0x5eea('0x33')](this['editButton'],_0x5eea('0x4b')),this[_0x5eea('0x33')](this[_0x5eea('0x30')],'remove');}}
|
package/src/comments.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { Plugin } from 'ckeditor5/src/core';
|
|
6
|
-
import CommentsRepository from './comments/commentsrepository';
|
|
7
|
-
import CommentsEditing from './comments/commentsediting';
|
|
8
|
-
import CommentsUI from './comments/commentsui';
|
|
9
|
-
import CommentsOnly from './commentsonly';
|
|
10
|
-
import WideSidebar from './annotations/widesidebar';
|
|
11
|
-
import NarrowSidebar from './annotations/narrowsidebar';
|
|
12
|
-
import InlineAnnotations from './annotations/inlineannotations';
|
|
13
|
-
import CommentsArchiveUI from './comments/commentsarchiveui';
|
|
14
|
-
import CommentsArchive from './comments/commentsarchive';
|
|
15
|
-
/**
|
|
16
|
-
* The comments plugin, which brings both the UI part and the editing part of this feature.
|
|
17
|
-
*
|
|
18
|
-
* It registers {@link module:comments/comments/addcommentthreadcommand~AddCommentThreadCommand the `AddCommentThreadCommand` command}.
|
|
19
|
-
*
|
|
20
|
-
* To learn more about the comments feature refer to the {@glink features/collaboration/comments/comments Comments} guide.
|
|
21
|
-
*/
|
|
22
|
-
export default class Comments extends Plugin {
|
|
23
|
-
/**
|
|
24
|
-
* @inheritDoc
|
|
25
|
-
*/
|
|
26
|
-
static get requires(): readonly [typeof CommentsRepository, typeof CommentsEditing, typeof CommentsUI, typeof CommentsArchive, typeof CommentsArchiveUI, typeof CommentsOnly, typeof WideSidebar, typeof NarrowSidebar, typeof InlineAnnotations];
|
|
27
|
-
/**
|
|
28
|
-
* @inheritDoc
|
|
29
|
-
*/
|
|
30
|
-
static get pluginName(): "Comments";
|
|
31
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Plugin } from 'ckeditor5/src/core.js';
|
|
6
|
+
import CommentsRepository from './comments/commentsrepository.js';
|
|
7
|
+
import CommentsEditing from './comments/commentsediting.js';
|
|
8
|
+
import CommentsUI from './comments/commentsui.js';
|
|
9
|
+
import CommentsOnly from './commentsonly.js';
|
|
10
|
+
import WideSidebar from './annotations/widesidebar.js';
|
|
11
|
+
import NarrowSidebar from './annotations/narrowsidebar.js';
|
|
12
|
+
import InlineAnnotations from './annotations/inlineannotations.js';
|
|
13
|
+
import CommentsArchiveUI from './comments/commentsarchiveui.js';
|
|
14
|
+
import CommentsArchive from './comments/commentsarchive.js';
|
|
15
|
+
/**
|
|
16
|
+
* The comments plugin, which brings both the UI part and the editing part of this feature.
|
|
17
|
+
*
|
|
18
|
+
* It registers {@link module:comments/comments/addcommentthreadcommand~AddCommentThreadCommand the `AddCommentThreadCommand` command}.
|
|
19
|
+
*
|
|
20
|
+
* To learn more about the comments feature refer to the {@glink features/collaboration/comments/comments Comments} guide.
|
|
21
|
+
*/
|
|
22
|
+
export default class Comments extends Plugin {
|
|
23
|
+
/**
|
|
24
|
+
* @inheritDoc
|
|
25
|
+
*/
|
|
26
|
+
static get requires(): readonly [typeof CommentsRepository, typeof CommentsEditing, typeof CommentsUI, typeof CommentsArchive, typeof CommentsArchiveUI, typeof CommentsOnly, typeof WideSidebar, typeof NarrowSidebar, typeof InlineAnnotations];
|
|
27
|
+
/**
|
|
28
|
+
* @inheritDoc
|
|
29
|
+
*/
|
|
30
|
+
static get pluginName(): "Comments";
|
|
31
|
+
}
|
package/src/comments.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x268d=['pluginName','Comments','requires'];(function(_0x26a609,_0x268df6){var _0x30bea5=function(_0x2aa15d){while(--_0x2aa15d){_0x26a609['push'](_0x26a609['shift']());}};_0x30bea5(++_0x268df6);}(_0x268d,0x106));var _0x30be=function(_0x26a609,_0x268df6){_0x26a609=_0x26a609-0x0;var _0x30bea5=_0x268d[_0x26a609];return _0x30bea5;};import{Plugin as _0x43619f}from'ckeditor5/src/core.js';import _0x382f88 from'./comments/commentsrepository.js';import _0x4d6d36 from'./comments/commentsediting.js';import _0x4652d0 from'./comments/commentsui.js';import _0x30c05e from'./commentsonly.js';import _0x350844 from'./annotations/widesidebar.js';import _0x45a26b from'./annotations/narrowsidebar.js';import _0x434cc5 from'./annotations/inlineannotations.js';import _0x411446 from'./comments/commentsarchiveui.js';import _0x7dedad from'./comments/commentsarchive.js';export default class f extends _0x43619f{static get[_0x30be('0x1')](){return[_0x382f88,_0x4d6d36,_0x4652d0,_0x7dedad,_0x411446,_0x30c05e,_0x350844,_0x45a26b,_0x434cc5];}static get[_0x30be('0x2')](){return _0x30be('0x0');}}
|