@ckeditor/ckeditor5-comments 38.0.1 → 38.1.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/build/translations/en-au.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sq.js +1 -0
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sq.po +111 -0
- package/package.json +10 -8
- 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 -227
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.d.ts +63 -62
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.d.ts +86 -84
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.d.ts +81 -80
- 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 -72
- 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 -25
- package/src/comments/commentsarchive.js +1 -1
- package/src/comments/commentsarchiveui.d.ts +34 -32
- package/src/comments/commentsarchiveui.js +1 -1
- package/src/comments/commentsediting.d.ts +75 -71
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1088 -1084
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.d.ts +29 -25
- 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 -22
- package/src/comments.js +1 -1
- package/src/commentsonly.d.ts +29 -28
- package/src/commentsonly.js +1 -1
- package/src/config.d.ts +172 -172
- package/src/index.d.ts +21 -19
- 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/src/collaboration-core';
|
|
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';
|
|
6
|
+
import { ButtonView, type TemplateDefinition, type ViewCollection, type DropdownView } from 'ckeditor5/src/ui';
|
|
7
|
+
import { UserView } from 'ckeditor5-collaboration/src/collaboration-core';
|
|
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 {};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x26ac=['isExternal','ck-annotation__main','source','isReadOnly','push','ck-comment__main','resolvedAt','attributes','render','ck-comment--','setTemplate','importWord','remove','EXTERNAL_COMMENT','isEnabled','mouseenter','ck-annotation__info-name','creator','isEditMode','edit','ck-comment--edit','EXTERNAL_IMPORT_WORD_COMMENT','length','listenTo','name','isVisible','pencil','ck-annotation__actions','time','blur','removeButton','isEditable','bind','ck-annotation__user','change:isEnabled','items','editButton','authoredAt','ck-annotation__info-time','change:isRemovable','children','ck-comment','panelView','buttonView','panelPosition','getUserViewNotificationText','ck-comment__info-name','icon','actionBar','ck-comment--info','formatDateTime','div','getExternalCommentNote','ck-annotation__info','_createCommentInputView','_attachActions','then','actionIndicator','isSystemComment','removeComment','span','@external','ck-comment--remove-confirmation','add','dropdown','Show\x20more\x20items','placeholder','isConfirm','ck-comment__info-time','Delete\x20comment?','Remove','change:isVisible','some','set','label','_createRemoveButton','locale','createCollection','execute','withText','author','extendTemplate','switchToEditMode','Edit','_model','isRemovable','ck-comment__actions','getTemplate','element','userView','ck-comment__external','EXTERNAL_IMPORT_WORD_AVATAR','_createDropdown'];(function(_0x11a3c3,_0x26ac23){const _0x5a29ba=function(_0x26a302){while(--_0x26a302){_0x11a3c3['push'](_0x11a3c3['shift']());}};_0x5a29ba(++_0x26ac23);}(_0x26ac,0xae));const _0x5a29=function(_0x11a3c3,_0x26ac23){_0x11a3c3=_0x11a3c3-0x0;let _0x5a29ba=_0x26ac[_0x11a3c3];return _0x5a29ba;};import{ButtonView as _0x505842,createDropdown as _0x479015,ListView as _0x22236f,ListItemView as _0x1f58c4}from'ckeditor5/src/ui';import{icons as _0xe99b0d}from'ckeditor5/src/core';import{UserView as _0x1aa75f,ConfirmMixin as _0x4f2861}from'ckeditor5-collaboration/src/collaboration-core';import _0x5094f1 from'./basecommentview';import _0x89efdc from'../../../../theme/icons/remove-comment.svg';import{getTranslation as _0x24f284}from'../../../utils/common-translations';export default class ut extends _0x4f2861(_0x5094f1){constructor(_0x144aaf,_0x2f5ea9,_0x2cd8eb){super(_0x144aaf,_0x2f5ea9,_0x2cd8eb),this[_0x5a29('0x55')](_0x5a29('0x45'),null),this[_0x5a29('0x55')](_0x5a29('0x4e'),_0x24f284(_0x144aaf,'Reply...')),this[_0x5a29('0x2c')](_0x5a29('0x31'))['to'](_0x2f5ea9),this[_0x5a29('0x2c')](_0x5a29('0x12'))['to'](_0x2f5ea9),this[_0x5a29('0x3c')]=this['createCollection'](),this['isSystemComment']||(this['editButton']=this['_createEditButton'](),this[_0x5a29('0x2a')]=this[_0x5a29('0x57')](),this[_0x5a29('0x2f')]=this[_0x5a29('0x59')](),this[_0x5a29('0x2f')]['addMany']([this[_0x5a29('0x30')],this[_0x5a29('0x2a')]]),this[_0x5a29('0x4c')]=this[_0x5a29('0xb')](),this[_0x5a29('0x3c')]['add'](this[_0x5a29('0x4c')])),this[_0x5a29('0x8')]=new _0x1aa75f(_0x144aaf,_0x2f5ea9['author'],this[_0x5a29('0x39')]()),this[_0x5a29('0x8')][_0x5a29('0x0')]({'attributes':{'class':['ck-comment__user',_0x5a29('0x2d')]}}),this[_0x5a29('0x23')](_0x2f5ea9,_0x5a29('0x33'),()=>this['cancelConfirm']()),this[_0x5a29('0x16')](this[_0x5a29('0x6')]());}[_0x5a29('0x6')](){const _0x515da2=this['bindTemplate'],_0x6ab6ce=[{'tag':'div','attributes':{'class':['ck-comment__info',_0x5a29('0x41')]},'children':[{'tag':_0x5a29('0x48'),'children':[{'text':this['userView'][_0x5a29('0x24')]}],'attributes':{'class':[_0x5a29('0x3a'),_0x5a29('0x1c')]}},{'tag':_0x5a29('0x28'),'attributes':{'datetime':_0x515da2['to']('authoredAt'),'class':[_0x5a29('0x50'),_0x5a29('0x32')]},'children':[{'text':_0x515da2['to'](_0x5a29('0x31'),_0x2ec907=>this['_config'][_0x5a29('0x3e')](_0x2ec907))}]}]},{'tag':_0x5a29('0x3f'),'attributes':{'class':[_0x5a29('0x5'),_0x5a29('0x27'),_0x515da2['if'](_0x5a29('0x1e'),'ck-comment__actions--hidden'),_0x515da2['if'](_0x5a29('0x1e'),'ck-annotation__actions--hidden')]},'children':this['actionBar']},{'tag':_0x5a29('0x3f'),'attributes':{'class':['ck-annotation__content-wrapper']},'children':this['visibleView']}];return this[_0x5a29('0x3')][_0x5a29('0xc')]&&_0x6ab6ce[_0x5a29('0x10')]({'tag':_0x5a29('0x3f'),'attributes':{'class':[_0x5a29('0x9')]},'children':[{'text':this[_0x5a29('0x40')]()}]}),{'tag':'li','attributes':{'class':['ck-comment__wrapper',_0x515da2['if'](_0x5a29('0x4f'),_0x5a29('0x4a'))],'tabindex':-0x1},'children':[{'tag':_0x5a29('0x3f'),'attributes':{'class':[_0x5a29('0x35'),'ck-annotation',_0x515da2['if'](_0x5a29('0x1e'),_0x5a29('0x20')),_0x515da2['if'](_0x5a29('0x46'),_0x5a29('0x3d')),_0x515da2['to'](_0x5a29('0x45'),_0x49b734=>_0x49b734?_0x5a29('0x15')+_0x49b734:'')],'data-author-id':this['_model'][_0x5a29('0x5c')]['id'],'data-comment-id':this[_0x5a29('0x3')]['id']},'children':[this[_0x5a29('0x8')],{'tag':_0x5a29('0x3f'),'attributes':{'class':[_0x5a29('0x11'),_0x5a29('0xd')]},'children':_0x6ab6ce}]}]};}['_createEditButton'](){const _0x19075d=new _0x505842(this[_0x5a29('0x58')]);return _0x19075d[_0x5a29('0x56')]=_0x24f284(this['locale'],_0x5a29('0x2')),_0x19075d[_0x5a29('0x3b')]=_0xe99b0d[_0x5a29('0x26')],_0x19075d[_0x5a29('0x5b')]=!0x0,_0x19075d[_0x5a29('0x0')]({'attributes':{'class':_0x5a29('0x20')}}),_0x19075d[_0x5a29('0x2c')](_0x5a29('0x1a'))['to'](this[_0x5a29('0x3')],'isReadOnly',_0x46d4cc=>!_0x46d4cc),_0x19075d[_0x5a29('0x2c')](_0x5a29('0x25'))['to'](this['_model'],_0x5a29('0x2b')),_0x19075d['on'](_0x5a29('0x5a'),()=>this[_0x5a29('0x1')]()),_0x19075d;}['_createRemoveButton'](){const _0x141202=new _0x505842(this['locale']);return _0x141202[_0x5a29('0x56')]=_0x24f284(this[_0x5a29('0x58')],_0x5a29('0x52')),_0x141202[_0x5a29('0x3b')]=_0x89efdc,_0x141202['withText']=!0x0,_0x141202['extendTemplate']({'attributes':{'class':'ck-comment--remove'}}),_0x141202[_0x5a29('0x2c')](_0x5a29('0x1a'))['to'](this[_0x5a29('0x3')],_0x5a29('0xf'),_0x4a5be4=>!_0x4a5be4),_0x141202[_0x5a29('0x2c')]('isVisible')['to'](this[_0x5a29('0x3')],_0x5a29('0x4')),_0x141202['on'](_0x5a29('0x5a'),()=>{this['showConfirm'](_0x24f284(this['locale'],_0x5a29('0x51')),this[_0x5a29('0x7')])[_0x5a29('0x44')](()=>{this['fire'](_0x5a29('0x47'),this[_0x5a29('0x3')]['id']);});}),_0x141202;}[_0x5a29('0xb')](){const _0x31fd00=_0x479015(this[_0x5a29('0x58')]),_0x4c72eb=_0x31fd00[_0x5a29('0x36')]['children'],_0x3c1b77=new _0x22236f(this[_0x5a29('0x58')]),_0x5a5eff=(_0xd29221,_0x15a52c=-0x1)=>{const _0x318039=new _0x1f58c4(this['locale']);_0x318039[_0x5a29('0x34')][_0x5a29('0x4b')](_0xd29221);const _0x15f60a=_0x15a52c>-0x1?_0x15a52c:_0x3c1b77[_0x5a29('0x2f')][_0x5a29('0x22')];_0x3c1b77['items'][_0x5a29('0x4b')](_0x318039,_0x15f60a),_0x31fd00[_0x5a29('0x23')](_0xd29221,_0x5a29('0x2e'),()=>{_0x31fd00[_0x5a29('0x1a')]=[...this['items']][_0x5a29('0x54')](_0x5d9d19=>_0x5d9d19[_0x5a29('0x1a')]);}),_0x31fd00['listenTo'](_0xd29221,_0x5a29('0x53'),()=>{_0x31fd00[_0x5a29('0x37')]['isVisible']=[...this[_0x5a29('0x2f')]][_0x5a29('0x54')](_0x2528d3=>_0x2528d3['isVisible']);});};_0x31fd00[_0x5a29('0x38')]='sw',_0x31fd00['buttonView'][_0x5a29('0x55')]({'label':_0x24f284(this[_0x5a29('0x58')],_0x5a29('0x4d')),'icon':_0xe99b0d['threeVerticalDots']}),_0x31fd00[_0x5a29('0x1a')]=[...this[_0x5a29('0x2f')]][_0x5a29('0x54')](_0x3ac17a=>_0x3ac17a[_0x5a29('0x1a')]),_0x31fd00[_0x5a29('0x37')][_0x5a29('0x25')]=[...this[_0x5a29('0x2f')]][_0x5a29('0x54')](_0x1f8e3e=>_0x1f8e3e[_0x5a29('0x25')]);for(const _0x3c11a0 of this[_0x5a29('0x2f')])_0x5a5eff(_0x3c11a0);return _0x4c72eb[_0x5a29('0x4b')](_0x3c1b77),_0x31fd00['listenTo'](this[_0x5a29('0x2f')],'add',(_0x380240,_0x2ed319,_0x266c14)=>{_0x5a5eff(_0x2ed319,_0x266c14);}),_0x31fd00[_0x5a29('0x23')](this['items'],_0x5a29('0x18'),(_0x126d32,_0x30d294,_0xdd7f8d)=>{_0x3c1b77[_0x5a29('0x2f')]['remove'](_0xdd7f8d);}),_0x31fd00;}[_0x5a29('0x43')](_0x4bb9b1,_0x461547){const _0x3aea0c=_0x4bb9b1&&_0x4bb9b1['element'];_0x3aea0c&&(this[_0x5a29('0x23')](_0x3aea0c,_0x5a29('0x1b'),()=>this['actionIndicator']=_0x461547),this[_0x5a29('0x23')](_0x3aea0c,'focus',()=>this[_0x5a29('0x45')]=_0x461547),this[_0x5a29('0x23')](_0x3aea0c,'mouseleave',()=>this[_0x5a29('0x45')]=null),this[_0x5a29('0x23')](_0x3aea0c,_0x5a29('0x29'),()=>this[_0x5a29('0x45')]=null));}[_0x5a29('0x42')](){const _0x4d94a5=super[_0x5a29('0x42')]();return _0x4d94a5[_0x5a29('0x2c')](_0x5a29('0x4e'))['to'](this),_0x4d94a5;}[_0x5a29('0x40')](){return _0x5a29('0x17')===this['_model'][_0x5a29('0x13')][_0x5a29('0x49')][_0x5a29('0xe')]?_0x24f284(this[_0x5a29('0x58')],_0x5a29('0x21')):_0x24f284(this[_0x5a29('0x58')],_0x5a29('0x19'));}['getUserViewNotificationText'](){return this[_0x5a29('0x3')][_0x5a29('0xc')]?_0x5a29('0x17')===this[_0x5a29('0x3')][_0x5a29('0x13')][_0x5a29('0x49')][_0x5a29('0xe')]?_0x24f284(this['locale'],_0x5a29('0xa'),this[_0x5a29('0x3')][_0x5a29('0x1d')][_0x5a29('0x24')]):_0x24f284(this['locale'],'EXTERNAL_AVATAR',this[_0x5a29('0x3')][_0x5a29('0x1d')]['name']):null;}[_0x5a29('0x14')](){super['render'](),this[_0x5a29('0x43')](this['editButton'],_0x5a29('0x1f')),this['_attachActions'](this[_0x5a29('0x2a')],_0x5a29('0x18'));}}
|
package/src/comments.d.ts
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { Plugin
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
+
}
|
package/src/comments.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x1ba9=['pluginName','requires'];(function(_0x48d2cc,_0x1ba93c){var _0x51db4e=function(_0x3ae4d0){while(--_0x3ae4d0){_0x48d2cc['push'](_0x48d2cc['shift']());}};_0x51db4e(++_0x1ba93c);}(_0x1ba9,0x196));var _0x51db=function(_0x48d2cc,_0x1ba93c){_0x48d2cc=_0x48d2cc-0x0;var _0x51db4e=_0x1ba9[_0x48d2cc];return _0x51db4e;};import{Plugin as _0x7fdaef}from'ckeditor5/src/core';import _0x50e57c from'./comments/commentsrepository';import _0xb20671 from'./comments/commentsediting';import _0x3c1e3c from'./comments/commentsui';import _0x39915b from'./commentsonly';import _0x20cb7d from'./annotations/widesidebar';import _0x46db0d from'./annotations/narrowsidebar';import _0x1f1df6 from'./annotations/inlineannotations';import _0x3ce769 from'./comments/commentsarchiveui';import _0x551e18 from'./comments/commentsarchive';export default class f extends _0x7fdaef{static get[_0x51db('0x1')](){return[_0x50e57c,_0xb20671,_0x3c1e3c,_0x551e18,_0x3ce769,_0x39915b,_0x20cb7d,_0x46db0d,_0x1f1df6];}static get[_0x51db('0x0')](){return'Comments';}}
|