@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,46 +1,46 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/commentthreadheaderview
|
|
3
|
-
*/
|
|
4
|
-
import { View, ButtonView } from 'ckeditor5/src/ui';
|
|
5
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
6
|
-
import type { CommentThread } from '../../commentsrepository';
|
|
7
|
-
export declare const MAX_CONTENT_LENGTH = 150;
|
|
8
|
-
/**
|
|
9
|
-
* A view for the comment thread header.
|
|
10
|
-
*/
|
|
11
|
-
export default class CommentThreadHeaderView extends View {
|
|
12
|
-
locale: Locale;
|
|
13
|
-
/**
|
|
14
|
-
* Defines whether the context value exists.
|
|
15
|
-
*
|
|
16
|
-
* @observable
|
|
17
|
-
*/
|
|
18
|
-
hasContext: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Context value to display in the header.
|
|
21
|
-
*
|
|
22
|
-
* @observable
|
|
23
|
-
*/
|
|
24
|
-
contextValue: string;
|
|
25
|
-
/**
|
|
26
|
-
* Button view for the button which reopen the comment thread.
|
|
27
|
-
*/
|
|
28
|
-
reopenButtonView: ButtonView;
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
constructor(locale: Locale, model: CommentThread);
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
render(): void;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Fired when a user performed an action that should lead to reopen the resolved comment thread.
|
|
40
|
-
*
|
|
41
|
-
* @eventName ~CommentThreadHeaderView#reopenCommentThread
|
|
42
|
-
*/
|
|
43
|
-
export type UIReopenCommentThreadEvent = {
|
|
44
|
-
name: 'reopenCommentThread';
|
|
45
|
-
args: [id: string];
|
|
46
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/commentthreadheaderview
|
|
3
|
+
*/
|
|
4
|
+
import { View, ButtonView } from 'ckeditor5/src/ui.js';
|
|
5
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
6
|
+
import type { CommentThread } from '../../commentsrepository.js';
|
|
7
|
+
export declare const MAX_CONTENT_LENGTH = 150;
|
|
8
|
+
/**
|
|
9
|
+
* A view for the comment thread header.
|
|
10
|
+
*/
|
|
11
|
+
export default class CommentThreadHeaderView extends View {
|
|
12
|
+
locale: Locale;
|
|
13
|
+
/**
|
|
14
|
+
* Defines whether the context value exists.
|
|
15
|
+
*
|
|
16
|
+
* @observable
|
|
17
|
+
*/
|
|
18
|
+
hasContext: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Context value to display in the header.
|
|
21
|
+
*
|
|
22
|
+
* @observable
|
|
23
|
+
*/
|
|
24
|
+
contextValue: string;
|
|
25
|
+
/**
|
|
26
|
+
* Button view for the button which reopen the comment thread.
|
|
27
|
+
*/
|
|
28
|
+
reopenButtonView: ButtonView;
|
|
29
|
+
/**
|
|
30
|
+
* @inheritDoc
|
|
31
|
+
*/
|
|
32
|
+
constructor(locale: Locale, model: CommentThread);
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
render(): void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Fired when a user performed an action that should lead to reopen the resolved comment thread.
|
|
40
|
+
*
|
|
41
|
+
* @eventName ~CommentThreadHeaderView#reopenCommentThread
|
|
42
|
+
*/
|
|
43
|
+
export type UIReopenCommentThreadEvent = {
|
|
44
|
+
name: 'reopenCommentThread';
|
|
45
|
+
args: [id: string];
|
|
46
|
+
};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x5082=['classList','icon','ck-annotation__actions','reopenCommentThread','listenTo','bind','lastIndexOf','querySelector','render','tooltip','mouseleave','substring','div','length','_trimContextValue','ck-context','reopenButtonView','ck-context-wrapper','overlay','fire','remove','context','span','locale','_createReopenButton','isReadOnly','ck-context--quotes','bindTemplate','value','.ck-context__value','...','hasContext','contextValue','_attachContextActions','.ck-context','label','_model','ck-context__value','Reopen'];(function(_0x20d351,_0x508277){const _0x16be7d=function(_0x41fbe0){while(--_0x41fbe0){_0x20d351['push'](_0x20d351['shift']());}};_0x16be7d(++_0x508277);}(_0x5082,0xed));const _0x16be=function(_0x20d351,_0x508277){_0x20d351=_0x20d351-0x0;let _0x16be7d=_0x5082[_0x20d351];return _0x16be7d;};import{View as _0x2364ef,ButtonView as _0x59fa77}from'ckeditor5/src/ui.js';import{getTranslation as _0x36b754}from'../../../utils/common-translations.js';import _0x4b2b34 from'../../../../theme/icons/undo.svg';export const MAX_CONTENT_LENGTH=0x96;export default class Rt extends _0x2364ef{constructor(_0x314303,_0xd3df4d){super(_0x314303);const _0x35bdb8=this[_0x16be('0x18')];this[_0x16be('0x21')]=_0xd3df4d,this[_0x16be('0xd')]=this[_0x16be('0x15')](),this[_0x16be('0x2')](_0x16be('0x1c'))['to'](this['_model'],_0x16be('0x12'),_0x2f9b44=>!!_0x2f9b44),this[_0x16be('0x2')](_0x16be('0x1d'))['to'](this[_0x16be('0x21')],_0x16be('0x12'),_0x139c59=>_0x139c59&&_0x139c59[_0x16be('0x19')]?this[_0x16be('0xb')](_0x139c59[_0x16be('0x19')]):_0x36b754(this[_0x16be('0x14')],'Comment\x20was\x20made\x20on\x20an\x20element')),this['setTemplate']({'tag':_0x16be('0x9'),'attributes':{'class':['ck-thread__header']},'children':[{'tag':_0x16be('0x9'),'attributes':{'class':[_0x16be('0xe')]},'children':[{'tag':_0x16be('0x9'),'attributes':{'class':[_0x16be('0xc'),_0x35bdb8['if'](_0x16be('0x1c'),_0x16be('0x17'))]},'children':[{'tag':_0x16be('0x13'),'attributes':{'class':[_0x16be('0x22')]},'children':[{'text':_0x35bdb8['to']('contextValue')}]}]}]},{'tag':_0x16be('0x9'),'attributes':{'class':[_0x16be('0x26')]},'children':[this[_0x16be('0xd')]]}]});}[_0x16be('0x5')](){super[_0x16be('0x5')](),this[_0x16be('0x1e')]();}[_0x16be('0x15')](){const _0x30af88=new _0x59fa77(this[_0x16be('0x14')]);return _0x30af88[_0x16be('0x20')]=_0x36b754(this[_0x16be('0x14')],_0x16be('0x23')),_0x30af88[_0x16be('0x6')]=_0x36b754(this[_0x16be('0x14')],_0x16be('0x23')),_0x30af88[_0x16be('0x25')]=_0x4b2b34,_0x30af88['bind']('isEnabled')['to'](this[_0x16be('0x21')],_0x16be('0x16'),_0x56a1a9=>!_0x56a1a9),_0x30af88[_0x16be('0x2')]('isVisible')['to'](this[_0x16be('0x21')],'isResolvable'),_0x30af88['on']('execute',()=>{this[_0x16be('0x10')](_0x16be('0x0'),this[_0x16be('0x21')]['id']);}),_0x30af88;}['_trimContextValue'](_0x105748){if(_0x105748[_0x16be('0xa')]<0x96)return _0x105748;const _0x11a864=_0x105748[_0x16be('0x3')]('\x20',0x93);return _0x105748[_0x16be('0x8')](0x0,_0x11a864>-0x1?_0x11a864:0x93)+_0x16be('0x1b');}[_0x16be('0x1e')](){const _0x3b7d99=this['element'][_0x16be('0x4')](_0x16be('0x1f')),_0x47b09d=_0x3b7d99[_0x16be('0x4')](_0x16be('0x1a'));this['listenTo'](_0x3b7d99,'mouseenter',()=>{_0x47b09d['offsetWidth']<_0x47b09d['scrollWidth']&&_0x3b7d99[_0x16be('0x24')]['add'](_0x16be('0xf'));}),this[_0x16be('0x1')](_0x3b7d99,_0x16be('0x7'),()=>{_0x3b7d99[_0x16be('0x24')][_0x16be('0x11')](_0x16be('0xf'));});}}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/commentthreadinputview
|
|
3
|
-
*/
|
|
4
|
-
import { View } from 'ckeditor5/src/ui';
|
|
5
|
-
import CommentInputView from './commentinputview';
|
|
6
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
7
|
-
import type { EditorConfig } from 'ckeditor5/src/core';
|
|
8
|
-
import { UserView, type User } from 'ckeditor5-collaboration
|
|
9
|
-
/**
|
|
10
|
-
* View that represents comment input area for a comment thread. Includes editor, user view and buttons.
|
|
11
|
-
*/
|
|
12
|
-
export default class CommentThreadInputView extends View {
|
|
13
|
-
/**
|
|
14
|
-
* Specifies whether the comment input view should be visible (`true`) or hidden (`false`).
|
|
15
|
-
*
|
|
16
|
-
* @observable
|
|
17
|
-
*/
|
|
18
|
-
showInput: boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Comment input view.
|
|
21
|
-
*/
|
|
22
|
-
commentInputView: CommentInputView;
|
|
23
|
-
/**
|
|
24
|
-
* User view for the input area. Presents the local user.
|
|
25
|
-
*/
|
|
26
|
-
userView: UserView;
|
|
27
|
-
/**
|
|
28
|
-
* @param locale The localization service instance.
|
|
29
|
-
* @param localUser Current local user.
|
|
30
|
-
* @param editorConfig
|
|
31
|
-
*/
|
|
32
|
-
constructor(locale: Locale, localUser: User, editorConfig: EditorConfig);
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
destroy(): Promise<void>;
|
|
37
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/commentthreadinputview
|
|
3
|
+
*/
|
|
4
|
+
import { View } from 'ckeditor5/src/ui.js';
|
|
5
|
+
import CommentInputView from './commentinputview.js';
|
|
6
|
+
import type { Locale } from 'ckeditor5/src/utils.js';
|
|
7
|
+
import type { EditorConfig } from 'ckeditor5/src/core.js';
|
|
8
|
+
import { UserView, type User } from 'ckeditor5-collaboration';
|
|
9
|
+
/**
|
|
10
|
+
* View that represents comment input area for a comment thread. Includes editor, user view and buttons.
|
|
11
|
+
*/
|
|
12
|
+
export default class CommentThreadInputView extends View {
|
|
13
|
+
/**
|
|
14
|
+
* Specifies whether the comment input view should be visible (`true`) or hidden (`false`).
|
|
15
|
+
*
|
|
16
|
+
* @observable
|
|
17
|
+
*/
|
|
18
|
+
showInput: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Comment input view.
|
|
21
|
+
*/
|
|
22
|
+
commentInputView: CommentInputView;
|
|
23
|
+
/**
|
|
24
|
+
* User view for the input area. Presents the local user.
|
|
25
|
+
*/
|
|
26
|
+
userView: UserView;
|
|
27
|
+
/**
|
|
28
|
+
* @param locale The localization service instance.
|
|
29
|
+
* @param localUser Current local user.
|
|
30
|
+
* @param editorConfig
|
|
31
|
+
*/
|
|
32
|
+
constructor(locale: Locale, localUser: User, editorConfig: EditorConfig);
|
|
33
|
+
/**
|
|
34
|
+
* @inheritDoc
|
|
35
|
+
*/
|
|
36
|
+
destroy(): Promise<void>;
|
|
37
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x214b=['ck-comment__input-container','destroy','commentInputView','delegate','isFocused','editorReady','set','showInput','userView','ck-thread__input','then','setTemplate','bindTemplate','value','ck-thread__user','ck-comment__input-container--active','showButtons','extendTemplate','createEditor','focusTracker','bind'];(function(_0x54bd99,_0x214b9c){var _0x3d9d63=function(_0x530353){while(--_0x530353){_0x54bd99['push'](_0x54bd99['shift']());}};_0x3d9d63(++_0x214b9c);}(_0x214b,0x1c8));var _0x3d9d=function(_0x54bd99,_0x214b9c){_0x54bd99=_0x54bd99-0x0;var _0x3d9d63=_0x214b[_0x54bd99];return _0x3d9d63;};import{View as _0x324c2c}from'ckeditor5/src/ui.js';import _0x237cf5 from'./commentinputview.js';import{UserView as _0x552bf1}from'ckeditor5-collaboration';export default class wt extends _0x324c2c{constructor(_0x7f9254,_0x54457b,_0xa77a9f){super(_0x7f9254),this[_0x3d9d('0x8')]=new _0x237cf5(_0x7f9254,_0xa77a9f),this[_0x3d9d('0x8')][_0x3d9d('0x5')](_0x3d9d('0x1'))['to'](this[_0x3d9d('0x8')][_0x3d9d('0x4')],_0x3d9d('0xa'),this['commentInputView'],_0x3d9d('0x13'),(_0x5e6250,_0x11f928)=>_0x5e6250||!!_0x11f928),this[_0x3d9d('0xc')](_0x3d9d('0xd'),!0x1),this['on']('change:showInput',()=>{this['showInput']&&!this[_0x3d9d('0x8')]['editor']&&this[_0x3d9d('0x8')][_0x3d9d('0x3')]();}),this[_0x3d9d('0x8')][_0x3d9d('0x9')](_0x3d9d('0xb'))['to'](this),this[_0x3d9d('0x8')][_0x3d9d('0x9')]('editorDestroyed')['to'](this),this[_0x3d9d('0xe')]=new _0x552bf1(_0x7f9254,_0x54457b),this[_0x3d9d('0xe')][_0x3d9d('0x2')]({'attributes':{'class':_0x3d9d('0x14')}}),this[_0x3d9d('0x8')][_0x3d9d('0x2')]({'attributes':{'class':_0x3d9d('0xf')}}),this[_0x3d9d('0x11')]({'tag':'div','attributes':{'class':[_0x3d9d('0x6'),this[_0x3d9d('0x12')]['if'](_0x3d9d('0xd'),_0x3d9d('0x0'))]},'children':[this[_0x3d9d('0xe')],this[_0x3d9d('0x8')]]});}[_0x3d9d('0x7')](){return this[_0x3d9d('0x8')][_0x3d9d('0x7')]()[_0x3d9d('0x10')](()=>super['destroy']());}}
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/commentthreadview
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { type Locale } from 'ckeditor5/src/utils';
|
|
6
|
-
import { type User } from 'ckeditor5-collaboration
|
|
7
|
-
import { ButtonView, type TemplateDefinition, type ViewCollection } from 'ckeditor5/src/ui';
|
|
8
|
-
import BaseCommentThreadView from './basecommentthreadview';
|
|
9
|
-
import type { CommentThread } from '../../commentsrepository';
|
|
10
|
-
import type { CommentThreadConfig } from '../../../config';
|
|
11
|
-
declare const CommentThreadView_base: import("ckeditor5/src/utils").Mixed<typeof BaseCommentThreadView, import("@ckeditor/ckeditor5-collaboration-core/src/utils/confirmmixin").ConfirmApi>;
|
|
12
|
-
/**
|
|
13
|
-
* The default view for comment thread.
|
|
14
|
-
*/
|
|
15
|
-
export default class CommentThreadView extends CommentThreadView_base {
|
|
16
|
-
isConfirm: boolean;
|
|
17
|
-
cancelConfirm: () => void;
|
|
18
|
-
showConfirm: (key: string, element: unknown) => Promise<void>;
|
|
19
|
-
/**
|
|
20
|
-
* The locale instance.
|
|
21
|
-
*/
|
|
22
|
-
readonly locale: Locale;
|
|
23
|
-
/**
|
|
24
|
-
* A property used by the template.
|
|
25
|
-
*
|
|
26
|
-
* It works as a visual indicator for the user that an action is about to be performed.
|
|
27
|
-
* The value of this property is used in setting the CSS class.
|
|
28
|
-
* The property is used when the user interacts with the view.
|
|
29
|
-
*
|
|
30
|
-
* @observable
|
|
31
|
-
*/
|
|
32
|
-
actionIndicator: string | null;
|
|
33
|
-
/**
|
|
34
|
-
* View collection which holds all comment thread children elements.
|
|
35
|
-
*
|
|
36
|
-
* These views are:
|
|
37
|
-
*
|
|
38
|
-
* * {@link ~CommentThreadView#commentThreadHeaderView `commentThreadHeaderView`} (added at the beginning when the comment thread is
|
|
39
|
-
* resolved),
|
|
40
|
-
* * {@link ~CommentThreadView#commentsListView `commentsListView`},
|
|
41
|
-
* * {@link ~CommentThreadView#commentThreadInputView `commentThreadInputView`}.
|
|
42
|
-
*
|
|
43
|
-
* @readonly
|
|
44
|
-
*/
|
|
45
|
-
readonly commentThreadChildren: ViewCollection;
|
|
46
|
-
/**
|
|
47
|
-
* `ConfirmView` uses this element as a container for confirmation dialog.
|
|
48
|
-
*
|
|
49
|
-
* The element is set after `view#render()` is called.
|
|
50
|
-
*
|
|
51
|
-
* @member {HTMLElement|null} #containerElement
|
|
52
|
-
*/
|
|
53
|
-
containerElement: HTMLElement | null;
|
|
54
|
-
/**
|
|
55
|
-
* Resolve button view. Resolve button fires the 'resolveCommentThread' event when submitted.
|
|
56
|
-
*
|
|
57
|
-
* @readonly
|
|
58
|
-
*/
|
|
59
|
-
readonly resolveButton: ButtonView;
|
|
60
|
-
/**
|
|
61
|
-
* @inheritDoc
|
|
62
|
-
*/
|
|
63
|
-
constructor(locale: Locale, model: CommentThread, localUser: User, config: CommentThreadConfig);
|
|
64
|
-
/**
|
|
65
|
-
* Returns a template definition that will be passed to {@link module:ui/view~View#setTemplate}.
|
|
66
|
-
*
|
|
67
|
-
* Overwrite this method if you want to set a custom template for the comment thread view.
|
|
68
|
-
*
|
|
69
|
-
* The default template looks as follows:
|
|
70
|
-
*
|
|
71
|
-
* ```ts
|
|
72
|
-
* const bind = this.bindTemplate;
|
|
73
|
-
*
|
|
74
|
-
* {
|
|
75
|
-
* tag: 'div',
|
|
76
|
-
*
|
|
77
|
-
* attributes: {
|
|
78
|
-
* class: [
|
|
79
|
-
* 'ck-thread',
|
|
80
|
-
* 'ck-reset_all-excluded',
|
|
81
|
-
* bind.if( 'isActive', 'ck-thread--active' ),
|
|
82
|
-
* bind.if( 'isConfirm', 'ck-thread--remove-confirmation' ),
|
|
83
|
-
* bind.to( 'actionIndicator', value => value ? `ck-thread--${ value }` : '' )
|
|
84
|
-
* ],
|
|
85
|
-
* 'data-thread-id': this._model.id,
|
|
86
|
-
* // Needed for managing focus after adding new comment.
|
|
87
|
-
* tabindex: -1
|
|
88
|
-
* },
|
|
89
|
-
*
|
|
90
|
-
* children: [
|
|
91
|
-
* {
|
|
92
|
-
* tag: 'div',
|
|
93
|
-
* attributes: {
|
|
94
|
-
* class: 'ck-thread__container'
|
|
95
|
-
* },
|
|
96
|
-
* children: this.commentThreadChildren
|
|
97
|
-
* }
|
|
98
|
-
* ]
|
|
99
|
-
* };
|
|
100
|
-
* ```
|
|
101
|
-
*
|
|
102
|
-
* See the {@glink features/collaboration/annotations/annotations-custom-view Annotation custom view guide} to learn more about
|
|
103
|
-
* the possible annotation customizations.
|
|
104
|
-
*
|
|
105
|
-
* @returns The definition of a comment thread view's template.
|
|
106
|
-
*/
|
|
107
|
-
getTemplate(): TemplateDefinition;
|
|
108
|
-
/**
|
|
109
|
-
* @inheritDoc
|
|
110
|
-
*/
|
|
111
|
-
render(): void;
|
|
112
|
-
}
|
|
113
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/commentthreadview
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
6
|
+
import { type User } from 'ckeditor5-collaboration';
|
|
7
|
+
import { ButtonView, type TemplateDefinition, type ViewCollection } from 'ckeditor5/src/ui.js';
|
|
8
|
+
import BaseCommentThreadView from './basecommentthreadview.js';
|
|
9
|
+
import type { CommentThread } from '../../commentsrepository.js';
|
|
10
|
+
import type { CommentThreadConfig } from '../../../config.js';
|
|
11
|
+
declare const CommentThreadView_base: import("ckeditor5/src/utils.js").Mixed<typeof BaseCommentThreadView, import("@ckeditor/ckeditor5-collaboration-core/src/utils/confirmmixin.js").ConfirmApi>;
|
|
12
|
+
/**
|
|
13
|
+
* The default view for comment thread.
|
|
14
|
+
*/
|
|
15
|
+
export default class CommentThreadView extends CommentThreadView_base {
|
|
16
|
+
isConfirm: boolean;
|
|
17
|
+
cancelConfirm: () => void;
|
|
18
|
+
showConfirm: (key: string, element: unknown) => Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* The locale instance.
|
|
21
|
+
*/
|
|
22
|
+
readonly locale: Locale;
|
|
23
|
+
/**
|
|
24
|
+
* A property used by the template.
|
|
25
|
+
*
|
|
26
|
+
* It works as a visual indicator for the user that an action is about to be performed.
|
|
27
|
+
* The value of this property is used in setting the CSS class.
|
|
28
|
+
* The property is used when the user interacts with the view.
|
|
29
|
+
*
|
|
30
|
+
* @observable
|
|
31
|
+
*/
|
|
32
|
+
actionIndicator: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* View collection which holds all comment thread children elements.
|
|
35
|
+
*
|
|
36
|
+
* These views are:
|
|
37
|
+
*
|
|
38
|
+
* * {@link ~CommentThreadView#commentThreadHeaderView `commentThreadHeaderView`} (added at the beginning when the comment thread is
|
|
39
|
+
* resolved),
|
|
40
|
+
* * {@link ~CommentThreadView#commentsListView `commentsListView`},
|
|
41
|
+
* * {@link ~CommentThreadView#commentThreadInputView `commentThreadInputView`}.
|
|
42
|
+
*
|
|
43
|
+
* @readonly
|
|
44
|
+
*/
|
|
45
|
+
readonly commentThreadChildren: ViewCollection;
|
|
46
|
+
/**
|
|
47
|
+
* `ConfirmView` uses this element as a container for confirmation dialog.
|
|
48
|
+
*
|
|
49
|
+
* The element is set after `view#render()` is called.
|
|
50
|
+
*
|
|
51
|
+
* @member {HTMLElement|null} #containerElement
|
|
52
|
+
*/
|
|
53
|
+
containerElement: HTMLElement | null;
|
|
54
|
+
/**
|
|
55
|
+
* Resolve button view. Resolve button fires the 'resolveCommentThread' event when submitted.
|
|
56
|
+
*
|
|
57
|
+
* @readonly
|
|
58
|
+
*/
|
|
59
|
+
readonly resolveButton: ButtonView;
|
|
60
|
+
/**
|
|
61
|
+
* @inheritDoc
|
|
62
|
+
*/
|
|
63
|
+
constructor(locale: Locale, model: CommentThread, localUser: User, config: CommentThreadConfig);
|
|
64
|
+
/**
|
|
65
|
+
* Returns a template definition that will be passed to {@link module:ui/view~View#setTemplate}.
|
|
66
|
+
*
|
|
67
|
+
* Overwrite this method if you want to set a custom template for the comment thread view.
|
|
68
|
+
*
|
|
69
|
+
* The default template looks as follows:
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* const bind = this.bindTemplate;
|
|
73
|
+
*
|
|
74
|
+
* {
|
|
75
|
+
* tag: 'div',
|
|
76
|
+
*
|
|
77
|
+
* attributes: {
|
|
78
|
+
* class: [
|
|
79
|
+
* 'ck-thread',
|
|
80
|
+
* 'ck-reset_all-excluded',
|
|
81
|
+
* bind.if( 'isActive', 'ck-thread--active' ),
|
|
82
|
+
* bind.if( 'isConfirm', 'ck-thread--remove-confirmation' ),
|
|
83
|
+
* bind.to( 'actionIndicator', value => value ? `ck-thread--${ value }` : '' )
|
|
84
|
+
* ],
|
|
85
|
+
* 'data-thread-id': this._model.id,
|
|
86
|
+
* // Needed for managing focus after adding new comment.
|
|
87
|
+
* tabindex: -1
|
|
88
|
+
* },
|
|
89
|
+
*
|
|
90
|
+
* children: [
|
|
91
|
+
* {
|
|
92
|
+
* tag: 'div',
|
|
93
|
+
* attributes: {
|
|
94
|
+
* class: 'ck-thread__container'
|
|
95
|
+
* },
|
|
96
|
+
* children: this.commentThreadChildren
|
|
97
|
+
* }
|
|
98
|
+
* ]
|
|
99
|
+
* };
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* See the {@glink features/collaboration/annotations/annotations-custom-view Annotation custom view guide} to learn more about
|
|
103
|
+
* the possible annotation customizations.
|
|
104
|
+
*
|
|
105
|
+
* @returns The definition of a comment thread view's template.
|
|
106
|
+
*/
|
|
107
|
+
getTemplate(): TemplateDefinition;
|
|
108
|
+
/**
|
|
109
|
+
* @inheritDoc
|
|
110
|
+
*/
|
|
111
|
+
render(): void;
|
|
112
|
+
}
|
|
113
|
+
export {};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1001=['isEnabled','showConfirm','getTemplate','setTemplate','commentViews','containerElement','commentsListView','bind','createCollection','remove','isActive','icon','ck-thread--remove-confirmation','ck-thread--','change:isReadOnly','isReadOnly','actionIndicator','_boundFirstCommentView','resolveButton','isResolvable','set','tooltip','commentThreadChildren','check','change:isResolved','listenTo','_createResolveButton','querySelector','add','commentThreadInputView','ck-comment--resolve','render','isSystemComment','Delete\x20comment\x20thread?','locale','execute','_bindFirstCommentView','get','bindTemplate','div','ck-reset_all-excluded','Resolve','_model','actionBar','ck-thread--active','addMany','cancelConfirm','commentThreadHeaderView','length','stop','_cancelAllConfirms','isResolved','removeButton','change:isActive','extendTemplate'];(function(_0x196cd3,_0x1001a9){const _0x1ceeba=function(_0x52a0f2){while(--_0x52a0f2){_0x196cd3['push'](_0x196cd3['shift']());}};_0x1ceeba(++_0x1001a9);}(_0x1001,0xce));const _0x1cee=function(_0x196cd3,_0x1001a9){_0x196cd3=_0x196cd3-0x0;let _0x1ceeba=_0x1001[_0x196cd3];return _0x1ceeba;};import{ConfirmMixin as _0x300966}from'ckeditor5-collaboration';import{ButtonView as _0x318935}from'ckeditor5/src/ui.js';import{icons as _0x3f9481}from'ckeditor5/src/core.js';import _0x5bd235 from'./basecommentthreadview.js';import{getTranslation as _0x3aaf3b}from'../../../utils/common-translations.js';export default class lt extends _0x300966(_0x5bd235){constructor(_0x22bf68,_0x9e1b52,_0xaa2923,_0x2a3eb1){super(_0x22bf68,_0x9e1b52,_0xaa2923,_0x2a3eb1),this['commentThreadChildren']=this[_0x1cee('0x16')](),this[_0x1cee('0x24')][_0x1cee('0x4')]([this[_0x1cee('0x14')],this[_0x1cee('0x2b')]]),this['_model'][_0x1cee('0xa')]&&this['commentThreadChildren'][_0x1cee('0x2a')](this['commentThreadHeaderView'],0x0),this[_0x1cee('0x1')]['on'](_0x1cee('0x26'),(_0x437204,_0x2ea199,_0x4a746c)=>{_0x4a746c?this[_0x1cee('0x24')]['add'](this[_0x1cee('0x6')],0x0):this[_0x1cee('0x24')]['remove'](this[_0x1cee('0x6')]);}),this[_0x1cee('0x22')]('actionIndicator',null),this['containerElement']=null,this[_0x1cee('0x1f')]=null,this[_0x1cee('0x30')]=_0x22bf68,this['resolveButton']=this[_0x1cee('0x28')](),this[_0x1cee('0x11')](this['getTemplate']()),this['on'](_0x1cee('0xc'),(_0x4208c4,_0x1ee72a,_0x31a214)=>{_0x31a214||this[_0x1cee('0x9')]();}),this[_0x1cee('0x27')](this['_model'],_0x1cee('0x1c'),(_0x31aca5,_0x2a312f,_0x5bd1e6)=>{_0x5bd1e6&&this['_cancelAllConfirms']();}),this[_0x1cee('0x7')]>0x0&&this['_bindFirstCommentView'](),this[_0x1cee('0x27')](this[_0x1cee('0x14')][_0x1cee('0x12')],_0x1cee('0x2a'),()=>{this['_bindFirstCommentView']();});}[_0x1cee('0x10')](){const _0x4e66f9=this[_0x1cee('0x34')];return{'tag':_0x1cee('0x35'),'attributes':{'class':['ck-thread',_0x1cee('0x36'),_0x4e66f9['if'](_0x1cee('0x18'),_0x1cee('0x3')),_0x4e66f9['if']('isConfirm',_0x1cee('0x1a')),_0x4e66f9['to']('actionIndicator',_0x59fe82=>_0x59fe82?_0x1cee('0x1b')+_0x59fe82:'')],'data-thread-id':this[_0x1cee('0x1')]['id'],'tabindex':-0x1},'children':[{'tag':_0x1cee('0x35'),'attributes':{'class':'ck-thread__container'},'children':this[_0x1cee('0x24')]}]};}[_0x1cee('0x2d')](){super[_0x1cee('0x2d')](),this['containerElement']=this['element'][_0x1cee('0x29')]('.ck-thread__container');}[_0x1cee('0x9')](){this[_0x1cee('0x5')]();for(const _0x49fd89 of this[_0x1cee('0x14')][_0x1cee('0x12')])_0x49fd89['cancelConfirm']();}[_0x1cee('0x32')](){const {locale:_0x4ef5af}=this,_0x579fff=this['commentsListView']['commentViews'][_0x1cee('0x33')](0x0);_0x579fff===this[_0x1cee('0x1f')]||_0x579fff[_0x1cee('0x2e')]||(this[_0x1cee('0x1f')]=_0x579fff,this['unbind'](_0x1cee('0x1e')),this[_0x1cee('0x15')](_0x1cee('0x1e'))['to'](_0x579fff,_0x1cee('0x1e'),_0x1f9842=>_0x1cee('0x17')===_0x1f9842?'remove':null),_0x579fff['placeholder']=_0x3aaf3b(_0x4ef5af,'Write\x20a\x20comment...'),_0x579fff[_0x1cee('0xb')]['on'](_0x1cee('0x31'),_0xfc897f=>{_0xfc897f[_0x1cee('0x8')](),this[_0x1cee('0xf')](_0x3aaf3b(_0x4ef5af,_0x1cee('0x2f')),this[_0x1cee('0x13')])['then'](()=>{this['fire']('removeCommentThread');});},{'priority':'high'}),_0x579fff[_0x1cee('0x2')]['add'](this[_0x1cee('0x20')],0x0));}[_0x1cee('0x28')](){const _0x508793=new _0x318935(this[_0x1cee('0x30')]);return _0x508793['label']=_0x3aaf3b(this[_0x1cee('0x30')],_0x1cee('0x0')),_0x508793[_0x1cee('0x23')]=_0x3aaf3b(this['locale'],'Resolve'),_0x508793[_0x1cee('0x19')]=_0x3f9481[_0x1cee('0x25')],_0x508793[_0x1cee('0xd')]({'attributes':{'class':_0x1cee('0x2c')}}),_0x508793[_0x1cee('0x15')](_0x1cee('0xe'))['to'](this[_0x1cee('0x1')],_0x1cee('0x1d'),_0x386624=>!_0x386624),_0x508793[_0x1cee('0x15')]('isVisible')['to'](this['_model'],_0x1cee('0x21'),this[_0x1cee('0x1')],_0x1cee('0xa'),(_0x120f0d,_0x463368)=>_0x120f0d&&!_0x463368),_0x508793['on'](_0x1cee('0x31'),()=>{this['fire']('resolveCommentThread',this[_0x1cee('0x1')]['id']);}),_0x508793;}}
|