@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,108 +1,108 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/basecommentthreadview
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { View } from 'ckeditor5/src/ui';
|
|
6
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
7
|
-
import CommentThreadInputView from './commentthreadinputview';
|
|
8
|
-
import CommentsListView from './commentslistview';
|
|
9
|
-
import CommentThreadHeaderView from './commentthreadheaderview';
|
|
10
|
-
import type { User } from 'ckeditor5-collaboration
|
|
11
|
-
import type { CommentThread } from '../../commentsrepository';
|
|
12
|
-
import type { CommentThreadConfig } from '../../../config';
|
|
13
|
-
/**
|
|
14
|
-
* An abstract comment thread view class that should be used as a base for comment thread view implementations.
|
|
15
|
-
* It provides some behaviors, flags and building blocks to use when creating a custom comment thread view class.
|
|
16
|
-
*
|
|
17
|
-
* For the usage examples check the {@glink features/collaboration/annotations/annotations-custom-view Custom annotation view} guide.
|
|
18
|
-
*/
|
|
19
|
-
export default class BaseCommentThreadView extends View {
|
|
20
|
-
locale: Locale;
|
|
21
|
-
/**
|
|
22
|
-
* Informs whether the comment thread view is in active state ("highlighted").
|
|
23
|
-
* A comment thread view is in this state when it is focused or was activated by the user in any other way.
|
|
24
|
-
*
|
|
25
|
-
* @observable
|
|
26
|
-
*/
|
|
27
|
-
isActive: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Informs whether the comment thread has any changes that have not been saved.
|
|
30
|
-
*
|
|
31
|
-
* @observable
|
|
32
|
-
*/
|
|
33
|
-
isDirty: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* The number of comments.
|
|
36
|
-
*
|
|
37
|
-
* @observable
|
|
38
|
-
*/
|
|
39
|
-
readonly length: number;
|
|
40
|
-
/**
|
|
41
|
-
* The list of comment views. It should be used as a part of the view template.
|
|
42
|
-
*
|
|
43
|
-
* @readonly
|
|
44
|
-
*/
|
|
45
|
-
readonly commentsListView: CommentsListView;
|
|
46
|
-
/**
|
|
47
|
-
* The comment thread header. It should be used as a part of the view template.
|
|
48
|
-
* This header is used only for resolved comment threads.
|
|
49
|
-
*
|
|
50
|
-
* @readonly
|
|
51
|
-
*/
|
|
52
|
-
readonly commentThreadHeaderView: CommentThreadHeaderView;
|
|
53
|
-
/**
|
|
54
|
-
* The comment input area view. It should be used as a part of the view template.
|
|
55
|
-
*
|
|
56
|
-
* @readonly
|
|
57
|
-
*/
|
|
58
|
-
readonly commentThreadInputView: CommentThreadInputView;
|
|
59
|
-
/**
|
|
60
|
-
* @param locale The localization service instance.
|
|
61
|
-
* @param model The model on which the view will base.
|
|
62
|
-
* @param localUser The current local user.
|
|
63
|
-
* @param config Additional view configuration.
|
|
64
|
-
*/
|
|
65
|
-
constructor(locale: Locale, model: CommentThread, localUser: User, config: CommentThreadConfig);
|
|
66
|
-
/**
|
|
67
|
-
* Focuses the view.
|
|
68
|
-
*/
|
|
69
|
-
focus(): void;
|
|
70
|
-
/**
|
|
71
|
-
* @inheritDoc
|
|
72
|
-
*/
|
|
73
|
-
destroy(): void;
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Fired when a user created a first comment in the comment thread. Then the comment thread is submitted and saved.
|
|
77
|
-
*
|
|
78
|
-
* @eventName ~BaseCommentThreadView#submitCommentThread
|
|
79
|
-
*/
|
|
80
|
-
export type UISubmitCommentThreadEvent = {
|
|
81
|
-
name: 'submitCommentThread';
|
|
82
|
-
args: [];
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Fired when a user performed an action that should lead to removing the comment thread.
|
|
86
|
-
*
|
|
87
|
-
* This event is not fired by default by any component created by `BaseCommentThreadView`.
|
|
88
|
-
* If you create a view class extending `BaseCommentThreadView`, you should provide
|
|
89
|
-
* a UI element that will fire this event.
|
|
90
|
-
*
|
|
91
|
-
* This event is fired by default when an empty comment thread view (with no comments)
|
|
92
|
-
* loses focus.
|
|
93
|
-
*
|
|
94
|
-
* @eventName ~BaseCommentThreadView#removeCommentThread
|
|
95
|
-
*/
|
|
96
|
-
export type UIRemoveCommentThreadEvent = {
|
|
97
|
-
name: 'removeCommentThread';
|
|
98
|
-
args: [];
|
|
99
|
-
};
|
|
100
|
-
/**
|
|
101
|
-
* Fired when a user performed an action that should lead to resolve the comment thread.
|
|
102
|
-
*
|
|
103
|
-
* @eventName ~BaseCommentThreadView#resolveCommentThread
|
|
104
|
-
*/
|
|
105
|
-
export type UIResolveCommentThreadEvent = {
|
|
106
|
-
name: 'resolveCommentThread';
|
|
107
|
-
args: [id: string];
|
|
108
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/basecommentthreadview
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { View } from 'ckeditor5/src/ui.js';
|
|
6
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
7
|
+
import CommentThreadInputView from './commentthreadinputview.js';
|
|
8
|
+
import CommentsListView from './commentslistview.js';
|
|
9
|
+
import CommentThreadHeaderView from './commentthreadheaderview.js';
|
|
10
|
+
import type { User } from 'ckeditor5-collaboration';
|
|
11
|
+
import type { CommentThread } from '../../commentsrepository.js';
|
|
12
|
+
import type { CommentThreadConfig } from '../../../config.js';
|
|
13
|
+
/**
|
|
14
|
+
* An abstract comment thread view class that should be used as a base for comment thread view implementations.
|
|
15
|
+
* It provides some behaviors, flags and building blocks to use when creating a custom comment thread view class.
|
|
16
|
+
*
|
|
17
|
+
* For the usage examples check the {@glink features/collaboration/annotations/annotations-custom-view Custom annotation view} guide.
|
|
18
|
+
*/
|
|
19
|
+
export default class BaseCommentThreadView extends View {
|
|
20
|
+
locale: Locale;
|
|
21
|
+
/**
|
|
22
|
+
* Informs whether the comment thread view is in active state ("highlighted").
|
|
23
|
+
* A comment thread view is in this state when it is focused or was activated by the user in any other way.
|
|
24
|
+
*
|
|
25
|
+
* @observable
|
|
26
|
+
*/
|
|
27
|
+
isActive: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Informs whether the comment thread has any changes that have not been saved.
|
|
30
|
+
*
|
|
31
|
+
* @observable
|
|
32
|
+
*/
|
|
33
|
+
isDirty: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The number of comments.
|
|
36
|
+
*
|
|
37
|
+
* @observable
|
|
38
|
+
*/
|
|
39
|
+
readonly length: number;
|
|
40
|
+
/**
|
|
41
|
+
* The list of comment views. It should be used as a part of the view template.
|
|
42
|
+
*
|
|
43
|
+
* @readonly
|
|
44
|
+
*/
|
|
45
|
+
readonly commentsListView: CommentsListView;
|
|
46
|
+
/**
|
|
47
|
+
* The comment thread header. It should be used as a part of the view template.
|
|
48
|
+
* This header is used only for resolved comment threads.
|
|
49
|
+
*
|
|
50
|
+
* @readonly
|
|
51
|
+
*/
|
|
52
|
+
readonly commentThreadHeaderView: CommentThreadHeaderView;
|
|
53
|
+
/**
|
|
54
|
+
* The comment input area view. It should be used as a part of the view template.
|
|
55
|
+
*
|
|
56
|
+
* @readonly
|
|
57
|
+
*/
|
|
58
|
+
readonly commentThreadInputView: CommentThreadInputView;
|
|
59
|
+
/**
|
|
60
|
+
* @param locale The localization service instance.
|
|
61
|
+
* @param model The model on which the view will base.
|
|
62
|
+
* @param localUser The current local user.
|
|
63
|
+
* @param config Additional view configuration.
|
|
64
|
+
*/
|
|
65
|
+
constructor(locale: Locale, model: CommentThread, localUser: User, config: CommentThreadConfig);
|
|
66
|
+
/**
|
|
67
|
+
* Focuses the view.
|
|
68
|
+
*/
|
|
69
|
+
focus(): void;
|
|
70
|
+
/**
|
|
71
|
+
* @inheritDoc
|
|
72
|
+
*/
|
|
73
|
+
destroy(): void;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Fired when a user created a first comment in the comment thread. Then the comment thread is submitted and saved.
|
|
77
|
+
*
|
|
78
|
+
* @eventName ~BaseCommentThreadView#submitCommentThread
|
|
79
|
+
*/
|
|
80
|
+
export type UISubmitCommentThreadEvent = {
|
|
81
|
+
name: 'submitCommentThread';
|
|
82
|
+
args: [];
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Fired when a user performed an action that should lead to removing the comment thread.
|
|
86
|
+
*
|
|
87
|
+
* This event is not fired by default by any component created by `BaseCommentThreadView`.
|
|
88
|
+
* If you create a view class extending `BaseCommentThreadView`, you should provide
|
|
89
|
+
* a UI element that will fire this event.
|
|
90
|
+
*
|
|
91
|
+
* This event is fired by default when an empty comment thread view (with no comments)
|
|
92
|
+
* loses focus.
|
|
93
|
+
*
|
|
94
|
+
* @eventName ~BaseCommentThreadView#removeCommentThread
|
|
95
|
+
*/
|
|
96
|
+
export type UIRemoveCommentThreadEvent = {
|
|
97
|
+
name: 'removeCommentThread';
|
|
98
|
+
args: [];
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Fired when a user performed an action that should lead to resolve the comment thread.
|
|
102
|
+
*
|
|
103
|
+
* @eventName ~BaseCommentThreadView#resolveCommentThread
|
|
104
|
+
*/
|
|
105
|
+
export type UIResolveCommentThreadEvent = {
|
|
106
|
+
name: 'resolveCommentThread';
|
|
107
|
+
args: [id: string];
|
|
108
|
+
};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x7f08=['assign','Reply...','cancel','showInput','submit','isDirty','removeCommentThread','updateComment','hasDirtyComment','placeholder','commentThreadInputView','isResolved','focus','isActive','addComment','_createCommentThreadInputView','set','delegate','Reply','fire','bind','commentThreadHeaderView','Comment','_localUser','isReadOnly','length','isResolvable','editorConfig','CommentView','removeComment','_model','editorReady','isSubmitted','locale','destroy','disabledSubmit','value','stop','commentInputView','commentsListView','_config','reopenCommentThread','editorDestroyed'];(function(_0x286dd8,_0x7f08c7){const _0x60821d=function(_0x56fc0e){while(--_0x56fc0e){_0x286dd8['push'](_0x286dd8['shift']());}};_0x60821d(++_0x7f08c7);}(_0x7f08,0x10d));const _0x6082=function(_0x286dd8,_0x7f08c7){_0x286dd8=_0x286dd8-0x0;let _0x60821d=_0x7f08[_0x286dd8];return _0x60821d;};import{View as _0x43363f}from'ckeditor5/src/ui.js';import _0x4851bb from'./commentthreadinputview.js';import _0x159d60 from'./commentslistview.js';import _0x17b2a4 from'./commentthreadheaderview.js';import{getTranslation as _0x5c351a}from'../../../utils/common-translations.js';export default class Tt extends _0x43363f{constructor(_0x26cf1d,_0x3696f6,_0x5e3847,_0x3c39e9){super(_0x26cf1d),this[_0x6082('0x5')]('isActive',!0x1),this[_0x6082('0x5')](_0x6082('0x25'),!0x1),this[_0x6082('0x13')]=_0x3696f6,this[_0x6082('0xc')]=_0x5e3847,this['_config']=_0x3c39e9,this[_0x6082('0xa')]=new _0x17b2a4(_0x26cf1d,_0x3696f6),this['commentThreadHeaderView'][_0x6082('0x6')](_0x6082('0x1e'))['to'](this),this['commentsListView']=new _0x159d60(_0x26cf1d,_0x3696f6,Object[_0x6082('0x20')]({'CommentView':this[_0x6082('0x1d')][_0x6082('0x11')]},_0x3c39e9)),this[_0x6082('0x1c')][_0x6082('0x6')](_0x6082('0x12'))['to'](this),this['commentsListView']['delegate'](_0x6082('0x27'))['to'](this),this[_0x6082('0x1c')][_0x6082('0x6')]('resolveCommentThread')['to'](this),this[_0x6082('0x1c')][_0x6082('0x6')](_0x6082('0x14'))['to'](this),this[_0x6082('0x1c')][_0x6082('0x6')](_0x6082('0x1f'))['to'](this),this[_0x6082('0x1c')][_0x6082('0x9')](_0x6082('0x2'))['to'](this),this['set'](_0x6082('0xe'),this['commentsListView'][_0x6082('0xe')]),this[_0x6082('0x9')](_0x6082('0xe'))['to'](this[_0x6082('0x1c')],_0x6082('0xe')),this[_0x6082('0x2a')]=this['_createCommentThreadInputView'](),this['commentThreadInputView'][_0x6082('0x6')](_0x6082('0x14'))['to'](this),this[_0x6082('0x2a')][_0x6082('0x6')](_0x6082('0x1f'))['to'](this),this['on'](_0x6082('0x12'),()=>this[_0x6082('0x1')]()),this[_0x6082('0x9')](_0x6082('0x25'))['to'](this[_0x6082('0x1c')],_0x6082('0x28'),this['commentThreadInputView']['commentInputView'],_0x6082('0x19'),(_0x3b0e22,_0x5a3af2)=>_0x3b0e22||!!_0x5a3af2);}[_0x6082('0x1')](){this['element'][_0x6082('0x1')]();}['destroy'](){this[_0x6082('0x25')]=!0x1,this[_0x6082('0x1c')]['destroy'](),this[_0x6082('0x2a')][_0x6082('0x17')](),super[_0x6082('0x17')]();}[_0x6082('0x4')](){const _0x174838=new _0x4851bb(this['locale'],this[_0x6082('0xc')],this[_0x6082('0x1d')][_0x6082('0x10')]),_0x28e2fa=_0x174838[_0x6082('0x1b')];return _0x174838['bind'](_0x6082('0x23'))['to'](this,_0x6082('0x2'),this['_model'],_0x6082('0xd'),this[_0x6082('0x13')],_0x6082('0x0'),_0x28e2fa,_0x6082('0x19'),(_0x555cc5,_0x353c30,_0xfe2883,_0x476473)=>!!_0x476473||_0xfe2883&&!_0x353c30||_0x555cc5&&!_0x353c30),_0x28e2fa['bind'](_0x6082('0x29'))['to'](this,'length',this['_model'],_0x6082('0xf'),this[_0x6082('0x13')],_0x6082('0x0'),(_0x9051da,_0xd461ac,_0x4e6e7a)=>{let _0x34060e;return _0x34060e=_0x4e6e7a&&_0xd461ac?'Reply\x20to\x20reopen\x20discussion...':_0x9051da?_0x6082('0x21'):'Write\x20a\x20comment...',_0x5c351a(this[_0x6082('0x16')],_0x34060e);}),_0x28e2fa[_0x6082('0x9')]('submitLabel')['to'](this,'length',_0x523cf5=>_0x5c351a(this['locale'],_0x523cf5?_0x6082('0x7'):_0x6082('0xb'))),_0x28e2fa['on'](_0x6082('0x24'),(_0x294fdb,_0x402f3d)=>{this['fire'](_0x6082('0x3'),_0x402f3d),this['_model']['isResolved']&&this[_0x6082('0x13')]['isResolvable']&&this[_0x6082('0x8')](_0x6082('0x1e'),this[_0x6082('0x13')]['id']),this['_model'][_0x6082('0x15')]||this[_0x6082('0x8')]('submitCommentThread');}),_0x28e2fa['on'](_0x6082('0x22'),()=>{this[_0x6082('0x1')]();}),_0x28e2fa[_0x6082('0x9')](_0x6082('0x18'))['to'](this[_0x6082('0x13')],_0x6082('0xd')),_0x28e2fa['on'](_0x6082('0x22'),_0x547797=>{0x0==this[_0x6082('0xe')]&&(this['fire'](_0x6082('0x26')),_0x547797[_0x6082('0x1a')]());}),this['on']('change:isActive',(_0x21d6cd,_0x68ff79,_0x4f215e)=>{_0x4f215e||this['length']||_0x28e2fa[_0x6082('0x19')]||this[_0x6082('0x8')](_0x6082('0x26'));}),_0x174838;}}
|
|
@@ -1,108 +1,108 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/basecommentview
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { View, type ViewCollection } from 'ckeditor5/src/ui';
|
|
6
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
7
|
-
import type { Comment } from '../../commentsrepository';
|
|
8
|
-
import type { CommentViewConfig } from '../../../config';
|
|
9
|
-
/**
|
|
10
|
-
* An abstract comment view class that should be used as a base for comment view implementations.
|
|
11
|
-
*
|
|
12
|
-
* It provides some behaviors, flags and building blocks to use when creating a custom comment view class.
|
|
13
|
-
*/
|
|
14
|
-
export default class BaseCommentView extends View {
|
|
15
|
-
locale: Locale;
|
|
16
|
-
/**
|
|
17
|
-
* Informs whether the comment view is in the editing mode.
|
|
18
|
-
*
|
|
19
|
-
* @observable
|
|
20
|
-
*/
|
|
21
|
-
isEditMode: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Flag indicating whether the comment view displays an actual comment (`false`) or is a system message (`true`).
|
|
24
|
-
* System message comment should not include any UI elements which allow for editing the comment as it is not an actual comment.
|
|
25
|
-
*
|
|
26
|
-
* @readonly
|
|
27
|
-
*/
|
|
28
|
-
isSystemComment: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* Stores the currently displayed sub-view.
|
|
31
|
-
*
|
|
32
|
-
* This is a collection that always includes one view: comment content view or comment input view.
|
|
33
|
-
* Depending whether the comment is in editing mode or not, one of the views is in the collection.
|
|
34
|
-
* When the comment mode changes, the content of this collection also changes.
|
|
35
|
-
*
|
|
36
|
-
* By default, the comment is in the "content mode" and this view collection stores the comment content view.
|
|
37
|
-
*/
|
|
38
|
-
readonly visibleView: ViewCollection;
|
|
39
|
-
/**
|
|
40
|
-
* @param locale The localization service instance.
|
|
41
|
-
* @param model The model on which the view will base.
|
|
42
|
-
* @param config Additional view configuration.
|
|
43
|
-
*/
|
|
44
|
-
constructor(locale: Locale, model: Comment, config: CommentViewConfig);
|
|
45
|
-
/**
|
|
46
|
-
* Expands the view.
|
|
47
|
-
*/
|
|
48
|
-
expand(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Collapses the view.
|
|
51
|
-
*/
|
|
52
|
-
collapse(): void;
|
|
53
|
-
/**
|
|
54
|
-
* Focuses the view.
|
|
55
|
-
*/
|
|
56
|
-
focus(): void;
|
|
57
|
-
/**
|
|
58
|
-
* @inheritDoc
|
|
59
|
-
*/
|
|
60
|
-
destroy(): Promise<void>;
|
|
61
|
-
/**
|
|
62
|
-
* Switches the comment to the editing mode.
|
|
63
|
-
*/
|
|
64
|
-
switchToEditMode(): void;
|
|
65
|
-
/**
|
|
66
|
-
* Switches the comment back from the editing mode to the content display mode.
|
|
67
|
-
*/
|
|
68
|
-
switchToDisplayMode(): void;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Fired when a user performed an action that should lead to creating a new comment in the comment thread.
|
|
72
|
-
*
|
|
73
|
-
* This event is fired by default when the comment input field of the comment thread is submitted.
|
|
74
|
-
*
|
|
75
|
-
* @eventName ~BaseCommentView#addComment
|
|
76
|
-
* @param content The content of the new comment.
|
|
77
|
-
*/
|
|
78
|
-
export type UIAddCommentEvent = {
|
|
79
|
-
name: 'addComment';
|
|
80
|
-
args: [content: string];
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Fired when a user performed an action that should lead to updating the comment content.
|
|
84
|
-
*
|
|
85
|
-
* This event is fired by default when the comment input field of a comment is submitted.
|
|
86
|
-
*
|
|
87
|
-
* @param commentId The ID of the updated comment.
|
|
88
|
-
* @param commentContent The updated comment content.
|
|
89
|
-
* @eventName ~BaseCommentView#updateComment
|
|
90
|
-
*/
|
|
91
|
-
export type UIUpdateCommentEvent = {
|
|
92
|
-
name: 'updateComment';
|
|
93
|
-
args: [commentId: string, commentContent: string];
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Fired when a user performed an action that should lead to removing a comment.
|
|
97
|
-
*
|
|
98
|
-
* This event is not fired by default by any component created by {@link module:comments/comments/ui/view/basecommentview~BaseCommentView}.
|
|
99
|
-
* If you create a view class extending {@link module:comments/comments/ui/view/basecommentview~BaseCommentView} you should provide
|
|
100
|
-
* a UI element that will fire this event.
|
|
101
|
-
*
|
|
102
|
-
* @param commentId The ID of the removed comment.
|
|
103
|
-
* @eventName ~BaseCommentView#removeComment
|
|
104
|
-
*/
|
|
105
|
-
export type UIRemoveCommentEvent = {
|
|
106
|
-
name: 'removeComment';
|
|
107
|
-
args: [commentId: string];
|
|
108
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/basecommentview
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
|
|
6
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
7
|
+
import type { Comment } from '../../commentsrepository.js';
|
|
8
|
+
import type { CommentViewConfig } from '../../../config.js';
|
|
9
|
+
/**
|
|
10
|
+
* An abstract comment view class that should be used as a base for comment view implementations.
|
|
11
|
+
*
|
|
12
|
+
* It provides some behaviors, flags and building blocks to use when creating a custom comment view class.
|
|
13
|
+
*/
|
|
14
|
+
export default class BaseCommentView extends View {
|
|
15
|
+
locale: Locale;
|
|
16
|
+
/**
|
|
17
|
+
* Informs whether the comment view is in the editing mode.
|
|
18
|
+
*
|
|
19
|
+
* @observable
|
|
20
|
+
*/
|
|
21
|
+
isEditMode: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Flag indicating whether the comment view displays an actual comment (`false`) or is a system message (`true`).
|
|
24
|
+
* System message comment should not include any UI elements which allow for editing the comment as it is not an actual comment.
|
|
25
|
+
*
|
|
26
|
+
* @readonly
|
|
27
|
+
*/
|
|
28
|
+
isSystemComment: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Stores the currently displayed sub-view.
|
|
31
|
+
*
|
|
32
|
+
* This is a collection that always includes one view: comment content view or comment input view.
|
|
33
|
+
* Depending whether the comment is in editing mode or not, one of the views is in the collection.
|
|
34
|
+
* When the comment mode changes, the content of this collection also changes.
|
|
35
|
+
*
|
|
36
|
+
* By default, the comment is in the "content mode" and this view collection stores the comment content view.
|
|
37
|
+
*/
|
|
38
|
+
readonly visibleView: ViewCollection;
|
|
39
|
+
/**
|
|
40
|
+
* @param locale The localization service instance.
|
|
41
|
+
* @param model The model on which the view will base.
|
|
42
|
+
* @param config Additional view configuration.
|
|
43
|
+
*/
|
|
44
|
+
constructor(locale: Locale, model: Comment, config: CommentViewConfig);
|
|
45
|
+
/**
|
|
46
|
+
* Expands the view.
|
|
47
|
+
*/
|
|
48
|
+
expand(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Collapses the view.
|
|
51
|
+
*/
|
|
52
|
+
collapse(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Focuses the view.
|
|
55
|
+
*/
|
|
56
|
+
focus(): void;
|
|
57
|
+
/**
|
|
58
|
+
* @inheritDoc
|
|
59
|
+
*/
|
|
60
|
+
destroy(): Promise<void>;
|
|
61
|
+
/**
|
|
62
|
+
* Switches the comment to the editing mode.
|
|
63
|
+
*/
|
|
64
|
+
switchToEditMode(): void;
|
|
65
|
+
/**
|
|
66
|
+
* Switches the comment back from the editing mode to the content display mode.
|
|
67
|
+
*/
|
|
68
|
+
switchToDisplayMode(): void;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Fired when a user performed an action that should lead to creating a new comment in the comment thread.
|
|
72
|
+
*
|
|
73
|
+
* This event is fired by default when the comment input field of the comment thread is submitted.
|
|
74
|
+
*
|
|
75
|
+
* @eventName ~BaseCommentView#addComment
|
|
76
|
+
* @param content The content of the new comment.
|
|
77
|
+
*/
|
|
78
|
+
export type UIAddCommentEvent = {
|
|
79
|
+
name: 'addComment';
|
|
80
|
+
args: [content: string];
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Fired when a user performed an action that should lead to updating the comment content.
|
|
84
|
+
*
|
|
85
|
+
* This event is fired by default when the comment input field of a comment is submitted.
|
|
86
|
+
*
|
|
87
|
+
* @param commentId The ID of the updated comment.
|
|
88
|
+
* @param commentContent The updated comment content.
|
|
89
|
+
* @eventName ~BaseCommentView#updateComment
|
|
90
|
+
*/
|
|
91
|
+
export type UIUpdateCommentEvent = {
|
|
92
|
+
name: 'updateComment';
|
|
93
|
+
args: [commentId: string, commentContent: string];
|
|
94
|
+
};
|
|
95
|
+
/**
|
|
96
|
+
* Fired when a user performed an action that should lead to removing a comment.
|
|
97
|
+
*
|
|
98
|
+
* This event is not fired by default by any component created by {@link module:comments/comments/ui/view/basecommentview~BaseCommentView}.
|
|
99
|
+
* If you create a view class extending {@link module:comments/comments/ui/view/basecommentview~BaseCommentView} you should provide
|
|
100
|
+
* a UI element that will fire this event.
|
|
101
|
+
*
|
|
102
|
+
* @param commentId The ID of the removed comment.
|
|
103
|
+
* @eventName ~BaseCommentView#removeComment
|
|
104
|
+
*/
|
|
105
|
+
export type UIRemoveCommentEvent = {
|
|
106
|
+
name: 'removeComment';
|
|
107
|
+
args: [commentId: string];
|
|
108
|
+
};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x264d=['submit','switchToDisplayMode','isCollapsed','add','visibleView','maxCommentCharsWhenCollapsed','isReadOnly','collapse','once','set','content','editorReady','destroy','_createCommentInputView','fire','_createCommentContentView','_config','bind','focus','Save','expand','element','remove','get','createEditor','submitLabel','editorDestroyed','isSystemComment','isEditMode','disabledSubmit','_model','delegate','locale','editorConfig'];(function(_0x505f1e,_0x264d95){const _0xa9f4bd=function(_0x2ccda1){while(--_0x2ccda1){_0x505f1e['push'](_0x505f1e['shift']());}};_0xa9f4bd(++_0x264d95);}(_0x264d,0x1b5));const _0xa9f4=function(_0x505f1e,_0x264d95){_0x505f1e=_0x505f1e-0x0;let _0xa9f4bd=_0x264d[_0x505f1e];return _0xa9f4bd;};import{View as _0x187486}from'ckeditor5/src/ui.js';import{trimHtml as _0x178e8d}from'ckeditor5-collaboration';import _0x513c08 from'./commentcontentview.js';import _0x6ad2c6 from'./commentinputview.js';import{getTranslation as _0x1bd162}from'../../../utils/common-translations.js';export default class Yt extends _0x187486{constructor(_0x203ced,_0x4dbf55,_0x1ba9fa){super(_0x203ced),this[_0xa9f4('0x1')]=_0x4dbf55,this[_0xa9f4('0x15')]=_0x1ba9fa,this[_0xa9f4('0x20')]=!!this['_config'][_0xa9f4('0x20')],this[_0xa9f4('0xe')](_0xa9f4('0x21'),!0x1),this[_0xa9f4('0xe')](_0xa9f4('0x7'),!0x0),this[_0xa9f4('0x9')]=this['createCollection'](),this['visibleView'][_0xa9f4('0x8')](this['_createCommentContentView']());}[_0xa9f4('0x19')](){this[_0xa9f4('0x7')]=!0x1;}[_0xa9f4('0xc')](){this[_0xa9f4('0x21')]||(this[_0xa9f4('0x7')]=!0x0);}['focus'](){this[_0xa9f4('0x1a')][_0xa9f4('0x17')]();}async[_0xa9f4('0x11')](){await this[_0xa9f4('0x9')][_0xa9f4('0x1c')](0x0)[_0xa9f4('0x11')](),super[_0xa9f4('0x11')]();}['switchToEditMode'](){this[_0xa9f4('0x21')]||(this[_0xa9f4('0x21')]=!0x0,this[_0xa9f4('0x9')][_0xa9f4('0x1b')](0x0)[_0xa9f4('0x11')](),this[_0xa9f4('0x9')]['add'](this[_0xa9f4('0x12')]()));}[_0xa9f4('0x6')](){this[_0xa9f4('0x21')]&&(this['isEditMode']=!0x1,this[_0xa9f4('0x9')][_0xa9f4('0x1b')](0x0)[_0xa9f4('0x11')](),this[_0xa9f4('0x9')][_0xa9f4('0x8')](this[_0xa9f4('0x14')]()));}[_0xa9f4('0x14')](){const _0x5881b6=new _0x513c08(this[_0xa9f4('0x3')]);return _0x5881b6['bind'](_0xa9f4('0xf'))['to'](this[_0xa9f4('0x1')],'content',this,_0xa9f4('0x7'),(_0xa0037d,_0x2b7215)=>_0x2b7215?_0x178e8d(_0xa0037d,{'limit':this[_0xa9f4('0x15')][_0xa9f4('0xa')]}):_0xa0037d),_0x5881b6;}[_0xa9f4('0x12')](){this[_0xa9f4('0x15')]['editorConfig']||(this['_config'][_0xa9f4('0x4')]={}),this[_0xa9f4('0x15')][_0xa9f4('0x4')]['initialData']=this[_0xa9f4('0x1')][_0xa9f4('0xf')];const _0x37072b=new _0x6ad2c6(this['locale'],this['_config']['editorConfig']);return _0x37072b['value']=this[_0xa9f4('0x1')][_0xa9f4('0xf')],_0x37072b[_0xa9f4('0x16')](_0xa9f4('0x0'))['to'](this[_0xa9f4('0x1')],_0xa9f4('0xb')),_0x37072b[_0xa9f4('0x1e')]=_0x1bd162(this[_0xa9f4('0x3')],_0xa9f4('0x18')),_0x37072b['on'](_0xa9f4('0x5'),(_0x2bb7f3,_0xb57855)=>{this[_0xa9f4('0x13')]('updateComment',this[_0xa9f4('0x1')]['id'],_0xb57855),this[_0xa9f4('0x6')](),this[_0xa9f4('0x17')]();}),_0x37072b['on']('cancel',()=>{this[_0xa9f4('0x6')](),this[_0xa9f4('0x17')]();}),_0x37072b[_0xa9f4('0xd')](_0xa9f4('0x10'),()=>{_0x37072b[_0xa9f4('0x17')]();}),_0x37072b[_0xa9f4('0x1d')](),_0x37072b[_0xa9f4('0x2')](_0xa9f4('0x10'))['to'](this),_0x37072b[_0xa9f4('0x2')](_0xa9f4('0x1f'))['to'](this),_0x37072b;}}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/collapsedcommentsview
|
|
3
|
-
*/
|
|
4
|
-
import { View } from 'ckeditor5/src/ui';
|
|
5
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
6
|
-
export default class CollapsedCommentsView extends View {
|
|
7
|
-
count: number | undefined;
|
|
8
|
-
constructor(locale: Locale);
|
|
9
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/collapsedcommentsview
|
|
3
|
+
*/
|
|
4
|
+
import { View } from 'ckeditor5/src/ui.js';
|
|
5
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
6
|
+
export default class CollapsedCommentsView extends View {
|
|
7
|
+
count: number | undefined;
|
|
8
|
+
constructor(locale: Locale);
|
|
9
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x4379=['setTemplate','bindTemplate','count','set','NUMBER_OF_COMMENTS','ck-thread__comment-count'];(function(_0x329075,_0x4379e1){const _0x8d721a=function(_0x5655f0){while(--_0x5655f0){_0x329075['push'](_0x329075['shift']());}};_0x8d721a(++_0x4379e1);}(_0x4379,0x138));const _0x8d72=function(_0x329075,_0x4379e1){_0x329075=_0x329075-0x0;let _0x8d721a=_0x4379[_0x329075];return _0x8d721a;};import{View as _0x17b6cb}from'ckeditor5/src/ui.js';import{getTranslation as _0x1ee972}from'../../../utils/common-translations.js';export default class Zt extends _0x17b6cb{constructor(_0x5a6393){super(_0x5a6393);const _0x1db0a0=this[_0x8d72('0x1')];this[_0x8d72('0x3')](_0x8d72('0x2'),void 0x0),this[_0x8d72('0x0')]({'tag':'li','attributes':{'class':_0x8d72('0x5')},'children':[{'text':_0x1db0a0['to']('count',_0x4f8201=>_0x1ee972(_0x5a6393,_0x8d72('0x4'),_0x4f8201))}]});}}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/commentcontentview
|
|
3
|
-
*/
|
|
4
|
-
import { View } from 'ckeditor5/src/ui';
|
|
5
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
6
|
-
export default class CommentContentView extends View {
|
|
7
|
-
content: string;
|
|
8
|
-
constructor(locale: Locale);
|
|
9
|
-
render(): void;
|
|
10
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/commentcontentview
|
|
3
|
+
*/
|
|
4
|
+
import { View } from 'ckeditor5/src/ui.js';
|
|
5
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
6
|
+
export default class CommentContentView extends View {
|
|
7
|
+
content: string;
|
|
8
|
+
constructor(locale: Locale);
|
|
9
|
+
render(): void;
|
|
10
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x3990=['element','setTemplate','div','content','set','render'];(function(_0x4faa1e,_0x399036){var _0x526331=function(_0x583847){while(--_0x583847){_0x4faa1e['push'](_0x4faa1e['shift']());}};_0x526331(++_0x399036);}(_0x3990,0x1b2));var _0x5263=function(_0x4faa1e,_0x399036){_0x4faa1e=_0x4faa1e-0x0;var _0x526331=_0x3990[_0x4faa1e];return _0x526331;};import{View as _0x25bf05}from'ckeditor5/src/ui.js';export default class Ut extends _0x25bf05{constructor(_0x31a186){super(_0x31a186),this[_0x5263('0x2')]('content',''),this[_0x5263('0x5')]({'tag':_0x5263('0x0'),'attributes':{'class':['ck-comment__content','ck-annotation__content']}});}[_0x5263('0x3')](){super[_0x5263('0x3')](),this['on']('change:content',(_0x57f9c2,_0x5de9a0,_0x536a8f)=>{this[_0x5263('0x4')]['innerHTML']=_0x536a8f;}),this[_0x5263('0x4')]['innerHTML']=this[_0x5263('0x1')];}}
|