@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,82 +1,82 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/commentinputview
|
|
3
|
-
*/
|
|
4
|
-
import { View, ButtonView } from 'ckeditor5/src/ui';
|
|
5
|
-
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils';
|
|
6
|
-
import { type EditorConfig, type DataApi } from 'ckeditor5/src/core';
|
|
7
|
-
import CommentEditor from '../commenteditor/commenteditor';
|
|
8
|
-
/**
|
|
9
|
-
* A view for the comment input section that includes a comment editor.
|
|
10
|
-
*/
|
|
11
|
-
export default class CommentInputView extends View {
|
|
12
|
-
/**
|
|
13
|
-
* Comment editor.
|
|
14
|
-
*/
|
|
15
|
-
editor: CommentEditor & DataApi | null;
|
|
16
|
-
/**
|
|
17
|
-
* The input value (comment editor content).
|
|
18
|
-
*
|
|
19
|
-
* @observable
|
|
20
|
-
*/
|
|
21
|
-
value: string;
|
|
22
|
-
/**
|
|
23
|
-
* When set to `true` it is not possible to submit the commit.
|
|
24
|
-
*
|
|
25
|
-
* @observable
|
|
26
|
-
*/
|
|
27
|
-
disabledSubmit: boolean;
|
|
28
|
-
/**
|
|
29
|
-
* Specifies whether the buttons should be visible (`true`) or hidden (`false`).
|
|
30
|
-
*
|
|
31
|
-
* @observable
|
|
32
|
-
*/
|
|
33
|
-
showButtons: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* The comment editor placeholder.
|
|
36
|
-
*
|
|
37
|
-
* @observable
|
|
38
|
-
*/
|
|
39
|
-
placeholder: string;
|
|
40
|
-
/**
|
|
41
|
-
* The submit button label.
|
|
42
|
-
*
|
|
43
|
-
* @observable
|
|
44
|
-
*/
|
|
45
|
-
submitLabel: string;
|
|
46
|
-
element: HTMLElement;
|
|
47
|
-
/**
|
|
48
|
-
* Keystroke handler for the view.
|
|
49
|
-
*/
|
|
50
|
-
keystrokes: KeystrokeHandler;
|
|
51
|
-
/**
|
|
52
|
-
* Focus tracker for the view.
|
|
53
|
-
*/
|
|
54
|
-
focusTracker: FocusTracker;
|
|
55
|
-
/**
|
|
56
|
-
* Button view for the button which submits the comment.
|
|
57
|
-
*/
|
|
58
|
-
submitButtonView: ButtonView;
|
|
59
|
-
/**
|
|
60
|
-
* Button view for the button which cancels comment input.
|
|
61
|
-
*/
|
|
62
|
-
cancelButtonView: ButtonView;
|
|
63
|
-
constructor(locale: Locale, editorConfig?: EditorConfig);
|
|
64
|
-
/**
|
|
65
|
-
* @inheritDoc
|
|
66
|
-
*/
|
|
67
|
-
render(): void;
|
|
68
|
-
/**
|
|
69
|
-
* Creates the comment editor instance.
|
|
70
|
-
*
|
|
71
|
-
* @returns Promise resolved after the editor instance is initialized.
|
|
72
|
-
*/
|
|
73
|
-
createEditor(): Promise<CommentEditor | undefined>;
|
|
74
|
-
/**
|
|
75
|
-
* Focuses the view.
|
|
76
|
-
*/
|
|
77
|
-
focus(): void;
|
|
78
|
-
/**
|
|
79
|
-
* @inheritDoc
|
|
80
|
-
*/
|
|
81
|
-
destroy(): Promise<void>;
|
|
82
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/commentinputview
|
|
3
|
+
*/
|
|
4
|
+
import { View, ButtonView } from 'ckeditor5/src/ui.js';
|
|
5
|
+
import { FocusTracker, KeystrokeHandler, type Locale } from 'ckeditor5/src/utils.js';
|
|
6
|
+
import { type EditorConfig, type DataApi } from 'ckeditor5/src/core.js';
|
|
7
|
+
import CommentEditor from '../commenteditor/commenteditor.js';
|
|
8
|
+
/**
|
|
9
|
+
* A view for the comment input section that includes a comment editor.
|
|
10
|
+
*/
|
|
11
|
+
export default class CommentInputView extends View {
|
|
12
|
+
/**
|
|
13
|
+
* Comment editor.
|
|
14
|
+
*/
|
|
15
|
+
editor: CommentEditor & DataApi | null;
|
|
16
|
+
/**
|
|
17
|
+
* The input value (comment editor content).
|
|
18
|
+
*
|
|
19
|
+
* @observable
|
|
20
|
+
*/
|
|
21
|
+
value: string;
|
|
22
|
+
/**
|
|
23
|
+
* When set to `true` it is not possible to submit the commit.
|
|
24
|
+
*
|
|
25
|
+
* @observable
|
|
26
|
+
*/
|
|
27
|
+
disabledSubmit: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Specifies whether the buttons should be visible (`true`) or hidden (`false`).
|
|
30
|
+
*
|
|
31
|
+
* @observable
|
|
32
|
+
*/
|
|
33
|
+
showButtons: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The comment editor placeholder.
|
|
36
|
+
*
|
|
37
|
+
* @observable
|
|
38
|
+
*/
|
|
39
|
+
placeholder: string;
|
|
40
|
+
/**
|
|
41
|
+
* The submit button label.
|
|
42
|
+
*
|
|
43
|
+
* @observable
|
|
44
|
+
*/
|
|
45
|
+
submitLabel: string;
|
|
46
|
+
element: HTMLElement;
|
|
47
|
+
/**
|
|
48
|
+
* Keystroke handler for the view.
|
|
49
|
+
*/
|
|
50
|
+
keystrokes: KeystrokeHandler;
|
|
51
|
+
/**
|
|
52
|
+
* Focus tracker for the view.
|
|
53
|
+
*/
|
|
54
|
+
focusTracker: FocusTracker;
|
|
55
|
+
/**
|
|
56
|
+
* Button view for the button which submits the comment.
|
|
57
|
+
*/
|
|
58
|
+
submitButtonView: ButtonView;
|
|
59
|
+
/**
|
|
60
|
+
* Button view for the button which cancels comment input.
|
|
61
|
+
*/
|
|
62
|
+
cancelButtonView: ButtonView;
|
|
63
|
+
constructor(locale: Locale, editorConfig?: EditorConfig);
|
|
64
|
+
/**
|
|
65
|
+
* @inheritDoc
|
|
66
|
+
*/
|
|
67
|
+
render(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Creates the comment editor instance.
|
|
70
|
+
*
|
|
71
|
+
* @returns Promise resolved after the editor instance is initialized.
|
|
72
|
+
*/
|
|
73
|
+
createEditor(): Promise<CommentEditor | undefined>;
|
|
74
|
+
/**
|
|
75
|
+
* Focuses the view.
|
|
76
|
+
*/
|
|
77
|
+
focus(): void;
|
|
78
|
+
/**
|
|
79
|
+
* @inheritDoc
|
|
80
|
+
*/
|
|
81
|
+
destroy(): Promise<void>;
|
|
82
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2a66=['forEach','editor','_initializeFocusCycling','_editorCreationPromise','setData','editorReady','keystrokes','document','submit','add','then','Reply...','low','trim','high','firstChild','destroy','submitButtonView','label','getData','submitLabel','disabledSubmit','ck-comment__input-actions--submit','ck-comment__input-actions','focus','placeholder','bind','fire','length','initialData','withText','editorDestroyed','Reply','_createCancelButton','setTemplate','value','focusNext','createEditor','ck-comment__input-wrapper','cancelButtonView','Cancel','_isDestroyed','insertBefore','_editorConfig','create','element','focusTracker','ck-comment__input-actions--active','shift\x20+\x20tab','Esc','showButtons','view','render','set','stop','extendTemplate','_createSubmitButton','execute'];(function(_0x42ccba,_0x2a66c6){const _0x217bfd=function(_0x1be933){while(--_0x1be933){_0x42ccba['push'](_0x42ccba['shift']());}};_0x217bfd(++_0x2a66c6);}(_0x2a66,0x75));const _0x217b=function(_0x42ccba,_0x2a66c6){_0x42ccba=_0x42ccba-0x0;let _0x217bfd=_0x2a66[_0x42ccba];return _0x217bfd;};import{View as _0x5bc6db,ViewCollection as _0x10ac06,FocusCycler as _0x3f0152,ButtonView as _0x2fe632}from'ckeditor5/src/ui.js';import{FocusTracker as _0x38a830,KeystrokeHandler as _0x3ca2e3}from'ckeditor5/src/utils.js';import _0x6f58e from'../commenteditor/commenteditor.js';import{getTranslation as _0xe47260}from'../../../utils/common-translations.js';export default class Xt extends _0x5bc6db{constructor(_0x3811dc,_0xa351f0={}){super(_0x3811dc),this[_0x217b('0x0')]=null,this[_0x217b('0x2a')]=_0xa351f0,this['keystrokes']=new _0x3ca2e3(),this['focusTracker']=new _0x38a830(),this[_0x217b('0x34')](_0x217b('0x22'),_0xa351f0[_0x217b('0x1c')]||''),this[_0x217b('0x34')](_0x217b('0x14'),!0x1),this[_0x217b('0x34')](_0x217b('0x31'),!0x0),this['set'](_0x217b('0x18'),_0xe47260(_0x3811dc,_0x217b('0xa'))),this['set'](_0x217b('0x13'),_0xe47260(_0x3811dc,_0x217b('0x1f'))),this[_0x217b('0x10')]=this['_createSubmitButton'](),this['cancelButtonView']=this[_0x217b('0x20')](),this[_0x217b('0x21')]({'tag':'div','attributes':{'class':[_0x217b('0x25')]},'children':[{'tag':'div','attributes':{'class':[_0x217b('0x16'),this['bindTemplate']['if']('showButtons',_0x217b('0x2e'))]},'children':[this['submitButtonView'],this[_0x217b('0x26')]]}]}),this[_0x217b('0x5')][_0x217b('0x34')](_0x217b('0x30'),(_0x436f48,_0x413f3a)=>{this[_0x217b('0x26')]['fire']('execute'),_0x413f3a();}),this['on'](_0x217b('0x7'),(_0x1009d3,_0x332923)=>{_0x332923[_0x217b('0x1b')]>0xfde8?(alert(_0xe47260(_0x3811dc,'TOO_LONG_COMMENT_ALERT',[_0x332923[_0x217b('0x1b')],0xfde8])),_0x1009d3[_0x217b('0x35')]()):this['editor'][_0x217b('0x3')]('');},{'priority':_0x217b('0xd')});}[_0x217b('0x33')](){super[_0x217b('0x33')](),this[_0x217b('0x5')]['listenTo'](this[_0x217b('0x2c')]),this[_0x217b('0x2d')][_0x217b('0x8')](this['element']);}[_0x217b('0x24')](){return this[_0x217b('0x0')]||(this[_0x217b('0x0')]=new _0x6f58e(this['_editorConfig']),this[_0x217b('0x2')]=this[_0x217b('0x0')][_0x217b('0x2b')]()[_0x217b('0x9')](()=>{if(this[_0x217b('0x28')])return;const _0x49498a=this[_0x217b('0x0')];this[_0x217b('0x2c')][_0x217b('0x29')](_0x49498a['ui'][_0x217b('0x2c')],this['element'][_0x217b('0xe')]),_0x49498a['model'][_0x217b('0x6')]['on']('change',()=>this[_0x217b('0x22')]=_0x49498a[_0x217b('0x12')]()),_0x49498a[_0x217b('0x19')](_0x217b('0x18'))['to'](this),this[_0x217b('0x1')](this[_0x217b('0x0')]),this['fire'](_0x217b('0x4'),this[_0x217b('0x0')]);})),this[_0x217b('0x2')];}[_0x217b('0x17')](){this[_0x217b('0x0')]&&this['editor'][_0x217b('0x17')]();}async[_0x217b('0xf')](){this['_isDestroyed']||(this[_0x217b('0x28')]=!0x0,this[_0x217b('0x0')]&&(await this[_0x217b('0x2')],await this[_0x217b('0x0')]['destroy'](),this[_0x217b('0x1a')](_0x217b('0x1e'),this[_0x217b('0x0')])),await super[_0x217b('0xf')]());}[_0x217b('0x37')](){const {locale:_0x4459e4}=this,_0x519517=new _0x2fe632(_0x4459e4);return _0x519517[_0x217b('0x36')]({'attributes':{'class':[_0x217b('0x15')]}}),_0x519517[_0x217b('0x1d')]=!0x0,_0x519517['bind'](_0x217b('0x11'))['to'](this,_0x217b('0x13')),_0x519517['on']('execute',()=>{this[_0x217b('0x1a')](_0x217b('0x7'),this[_0x217b('0x22')]);}),_0x519517['bind']('isEnabled')['to'](this,'value',this,_0x217b('0x14'),(_0x2ac65a,_0xaef5f2)=>!_0xaef5f2&&!!_0x2ac65a[_0x217b('0xc')]()),_0x519517;}['_createCancelButton'](){const {locale:_0x2e1d91}=this,_0x482437=new _0x2fe632(_0x2e1d91);return _0x482437[_0x217b('0x36')]({'attributes':{'class':['ck-comment__input-actions--cancel']}}),_0x482437[_0x217b('0x11')]=_0xe47260(_0x2e1d91,_0x217b('0x27')),_0x482437['withText']=!0x0,_0x482437['on'](_0x217b('0x38'),()=>{this['editor']['setData'](''),this[_0x217b('0x1a')]('cancel');}),_0x482437;}[_0x217b('0x1')](_0x5a77ff){const _0x1eb96a=this[_0x217b('0x2d')],_0x1ea22b=new _0x10ac06();[_0x5a77ff['ui'][_0x217b('0x32')],this['submitButtonView'],this[_0x217b('0x26')]][_0x217b('0x39')](_0x187d62=>{_0x1ea22b['add'](_0x187d62),_0x1eb96a[_0x217b('0x8')](_0x187d62[_0x217b('0x2c')]);});const _0x5dd40b=new _0x3f0152({'focusables':_0x1ea22b,'focusTracker':_0x1eb96a});this[_0x217b('0x5')]['set']('tab',(_0x5f2bcc,_0x40c614)=>{_0x5dd40b[_0x217b('0x23')](),_0x40c614();},{'priority':'low'}),this['keystrokes']['set'](_0x217b('0x2f'),(_0x15280d,_0xfeb5d3)=>{_0x5dd40b['focusPrevious'](),_0xfeb5d3();},{'priority':_0x217b('0xb')});}}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/commentslistview
|
|
3
|
-
*/
|
|
4
|
-
import { View, type ViewCollection } from 'ckeditor5/src/ui';
|
|
5
|
-
import { type Locale } from 'ckeditor5/src/utils';
|
|
6
|
-
import type AnnotationView from '../../../annotations/view/annotationview';
|
|
7
|
-
/**
|
|
8
|
-
* A view representing the content of comments archive.
|
|
9
|
-
*/
|
|
10
|
-
export default class CommentsArchiveView extends View {
|
|
11
|
-
/**
|
|
12
|
-
* The flag indicating whether there are items to display in the comments archive.
|
|
13
|
-
*
|
|
14
|
-
* @observable
|
|
15
|
-
*/
|
|
16
|
-
isEmpty: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* @param locale The localization service instance.
|
|
19
|
-
* @param annotationViews Resolved comment thread annotation views to render inside the comments archive.
|
|
20
|
-
*/
|
|
21
|
-
constructor(locale: Locale, annotationViews: ViewCollection<AnnotationView>);
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
render(): void;
|
|
26
|
-
/**
|
|
27
|
-
* @inheritDoc
|
|
28
|
-
*/
|
|
29
|
-
destroy(): void;
|
|
30
|
-
/**
|
|
31
|
-
* @inheritDoc
|
|
32
|
-
*/
|
|
33
|
-
focus(): void;
|
|
34
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/commentslistview
|
|
3
|
+
*/
|
|
4
|
+
import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
|
|
5
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
6
|
+
import type AnnotationView from '../../../annotations/view/annotationview.js';
|
|
7
|
+
/**
|
|
8
|
+
* A view representing the content of comments archive.
|
|
9
|
+
*/
|
|
10
|
+
export default class CommentsArchiveView extends View {
|
|
11
|
+
/**
|
|
12
|
+
* The flag indicating whether there are items to display in the comments archive.
|
|
13
|
+
*
|
|
14
|
+
* @observable
|
|
15
|
+
*/
|
|
16
|
+
isEmpty: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* @param locale The localization service instance.
|
|
19
|
+
* @param annotationViews Resolved comment thread annotation views to render inside the comments archive.
|
|
20
|
+
*/
|
|
21
|
+
constructor(locale: Locale, annotationViews: ViewCollection<AnnotationView>);
|
|
22
|
+
/**
|
|
23
|
+
* @inheritDoc
|
|
24
|
+
*/
|
|
25
|
+
render(): void;
|
|
26
|
+
/**
|
|
27
|
+
* @inheritDoc
|
|
28
|
+
*/
|
|
29
|
+
destroy(): void;
|
|
30
|
+
/**
|
|
31
|
+
* @inheritDoc
|
|
32
|
+
*/
|
|
33
|
+
focus(): void;
|
|
34
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x829e=['remove','isEmpty','_focusCycler','bindTemplate','ck-comments-archive__info','set','shift\x20+\x20tab','COMMENTS_ARCHIVE','element','isActive','listenTo','destroy','length','focus','ck-comments-archive','auto','_focusables','_focusTracker','arrowup','_keystrokes','selectstart','setTemplate','stopPropagation','ck-hidden','tab','add','arrowdown','ck-comments-archive__content','div','arrowleft'];(function(_0x1e4e2d,_0x829e5b){const _0x475fc4=function(_0xfa218d){while(--_0xfa218d){_0x1e4e2d['push'](_0x1e4e2d['shift']());}};_0x475fc4(++_0x829e5b);}(_0x829e,0x6b));const _0x475f=function(_0x1e4e2d,_0x829e5b){_0x1e4e2d=_0x1e4e2d-0x0;let _0x475fc4=_0x829e[_0x1e4e2d];return _0x475fc4;};import{View as _0x15a209,FocusCycler as _0x59c058}from'ckeditor5/src/ui.js';import{FocusTracker as _0x3b9bb4,KeystrokeHandler as _0x180b56}from'ckeditor5/src/utils.js';import{getTranslation as _0x19d29c}from'../../../utils/common-translations.js';export default class K extends _0x15a209{constructor(_0x1342e8,_0x59fd67){super(_0x1342e8),this[_0x475f('0x12')]('isEmpty',!_0x59fd67[_0x475f('0x19')]),this[_0x475f('0x0')]=new _0x3b9bb4(),this[_0x475f('0x2')]=new _0x180b56(),this[_0x475f('0x1d')]=_0x59fd67,this[_0x475f('0xf')]=new _0x59c058({'focusables':this[_0x475f('0x1d')],'focusTracker':this[_0x475f('0x0')],'keystrokeHandler':this[_0x475f('0x2')],'actions':{'focusPrevious':_0x475f('0x13'),'focusNext':_0x475f('0x7')}}),this['listenTo'](_0x59fd67,_0x475f('0x8'),()=>{this[_0x475f('0xe')]=!0x1;}),this[_0x475f('0x17')](_0x59fd67,_0x475f('0xd'),(_0x25c5c9,_0x247d48)=>{_0x247d48[_0x475f('0x16')]&&this[_0x475f('0x1a')](),_0x59fd67[_0x475f('0x19')]||(this[_0x475f('0xe')]=!0x0);});const _0x38c592=this[_0x475f('0x10')];this[_0x475f('0x4')]({'tag':_0x475f('0xb'),'attributes':{'dir':_0x475f('0x1c'),'class':['ck',_0x475f('0x1b')],'tabindex':-0x1},'children':[{'tag':'p','attributes':{'class':['ck-comments-archive__header\x20']},'children':[{'text':_0x19d29c(_0x1342e8,_0x475f('0x14'))}]},{'tag':'div','attributes':{'class':[_0x475f('0xa')]},'children':[{'tag':_0x475f('0xb'),'children':_0x59fd67},{'tag':'p','attributes':{'class':[_0x475f('0x11'),_0x38c592['if'](_0x475f('0xe'),_0x475f('0x6'),_0x214df3=>!_0x214df3)]},'children':[{'text':_0x19d29c(_0x1342e8,'EMPTY_COMMENTS_ARCHIVE')}]}]}]});}['render'](){super['render'](),this[_0x475f('0x2')]['listenTo'](this[_0x475f('0x15')]);const _0x280e4b=_0x133a63=>_0x133a63['stopPropagation']();this[_0x475f('0x2')][_0x475f('0x12')]('arrowright',_0x280e4b),this[_0x475f('0x2')]['set'](_0x475f('0xc'),_0x280e4b),this[_0x475f('0x2')]['set'](_0x475f('0x1'),_0x280e4b),this[_0x475f('0x2')][_0x475f('0x12')](_0x475f('0x9'),_0x280e4b),this[_0x475f('0x17')](this['element'],_0x475f('0x3'),(_0x3e9231,_0x12392a)=>{_0x12392a[_0x475f('0x5')]();},{'priority':'high'});}[_0x475f('0x18')](){super[_0x475f('0x18')](),this[_0x475f('0x0')][_0x475f('0x18')](),this[_0x475f('0x2')]['destroy']();}['focus'](){this[_0x475f('0x15')][_0x475f('0x1a')]();}}
|
|
@@ -1,96 +1,96 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module comments/comments/ui/view/commentslistview
|
|
3
|
-
*/
|
|
4
|
-
import { View, type ViewCollection } from 'ckeditor5/src/ui';
|
|
5
|
-
import { type Locale } from 'ckeditor5/src/utils';
|
|
6
|
-
import type { CommentThread } from '../../commentsrepository';
|
|
7
|
-
import type CommentView from './commentview';
|
|
8
|
-
import type { CommentThreadConfig } from '../../../config';
|
|
9
|
-
/**
|
|
10
|
-
* A view representing the list of comments. It should be used as a part of the comment thread view.
|
|
11
|
-
*/
|
|
12
|
-
export default class CommentsListView extends View {
|
|
13
|
-
locale: Locale;
|
|
14
|
-
/**
|
|
15
|
-
* Informs whether the list contains any comment view that is in the editing mode.
|
|
16
|
-
*
|
|
17
|
-
* @observable
|
|
18
|
-
*/
|
|
19
|
-
hasDirtyComment: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Number of comments in the list.
|
|
22
|
-
*
|
|
23
|
-
* @observable
|
|
24
|
-
*/
|
|
25
|
-
length: number;
|
|
26
|
-
/**
|
|
27
|
-
* Informs whether the comments list view is in the active state ("highlighted").
|
|
28
|
-
* Comment list view is in that state when it is focused or it was activated by the user in any different way.
|
|
29
|
-
*
|
|
30
|
-
* @observable
|
|
31
|
-
*/
|
|
32
|
-
isActive: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* View collection which holds all comment views to be displayed.
|
|
35
|
-
* It may also contain collapsed count view if the comments list view is collapsed and some comment views are hidden.
|
|
36
|
-
*
|
|
37
|
-
* @readonly
|
|
38
|
-
*/
|
|
39
|
-
readonly visibleViews: ViewCollection;
|
|
40
|
-
/**
|
|
41
|
-
* View collection which holds all comment views created for given comment thread.
|
|
42
|
-
*
|
|
43
|
-
* @readonly
|
|
44
|
-
*/
|
|
45
|
-
readonly commentViews: ViewCollection;
|
|
46
|
-
/**
|
|
47
|
-
* Comment view used to display information that comment has been resolved.
|
|
48
|
-
*
|
|
49
|
-
* @readonly
|
|
50
|
-
*/
|
|
51
|
-
resolvedCommentView: CommentView | null;
|
|
52
|
-
/**
|
|
53
|
-
* @param locale The localization service instance.
|
|
54
|
-
* @param model The model on which the view will base.
|
|
55
|
-
* @param config Additional view configuration.
|
|
56
|
-
*/
|
|
57
|
-
constructor(locale: Locale, model: CommentThread, config: CommentThreadConfig);
|
|
58
|
-
/**
|
|
59
|
-
* @inheritDoc
|
|
60
|
-
*/
|
|
61
|
-
render(): void;
|
|
62
|
-
/**
|
|
63
|
-
* Focuses the view.
|
|
64
|
-
*/
|
|
65
|
-
focus(): void;
|
|
66
|
-
/**
|
|
67
|
-
* @inheritDoc
|
|
68
|
-
*/
|
|
69
|
-
destroy(): void;
|
|
70
|
-
/**
|
|
71
|
-
* Refreshes the list of the visible views.
|
|
72
|
-
*
|
|
73
|
-
* When doing so, it performs a minimal amount of changes, so that views are not re-added, which might cause undesirable effects
|
|
74
|
-
* like focus loss or glitches due to CSS animations.
|
|
75
|
-
*
|
|
76
|
-
* The comments list may be collapsed or expanded:
|
|
77
|
-
*
|
|
78
|
-
* * it is expanded, if it {@link ~#isActive is active},
|
|
79
|
-
* * it is expanded, if {@link module:comments/comments/commentsrepository~CommentThread#weight comment thread weight}
|
|
80
|
-
* is lower than allowed (`config.comments.maxThreadTotalWeight`),
|
|
81
|
-
* * it is expanded, if it {@link ~#hasDirtyComment has any comments in edit mode},
|
|
82
|
-
* * it is collapsed, if neither of above is true.
|
|
83
|
-
*
|
|
84
|
-
* When comments list is in collapsed state, it displays at most `config.comments.maxCommentsWhenCollapsed` comment views:
|
|
85
|
-
*
|
|
86
|
-
* * first comment view,
|
|
87
|
-
* * {@link ~#_collapsedCommentsView collapsed comments counter} (if there are any hidden views),
|
|
88
|
-
* * appropriate number of the comments from the bottom of the thread.
|
|
89
|
-
*
|
|
90
|
-
* All the comments are also {@link module:comments/comments/ui/view/basecommentview~BaseCommentView#collapse set to collapsed state}.
|
|
91
|
-
*
|
|
92
|
-
* When comments list in in expanded state, it displays all comment views for all comments. All the comments are also
|
|
93
|
-
* {@link module:comments/comments/ui/view/basecommentview~BaseCommentView#expand set to expanded state}.
|
|
94
|
-
*/
|
|
95
|
-
refreshVisibleViews(): void;
|
|
96
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module comments/comments/ui/view/commentslistview
|
|
3
|
+
*/
|
|
4
|
+
import { View, type ViewCollection } from 'ckeditor5/src/ui.js';
|
|
5
|
+
import { type Locale } from 'ckeditor5/src/utils.js';
|
|
6
|
+
import type { CommentThread } from '../../commentsrepository.js';
|
|
7
|
+
import type CommentView from './commentview.js';
|
|
8
|
+
import type { CommentThreadConfig } from '../../../config.js';
|
|
9
|
+
/**
|
|
10
|
+
* A view representing the list of comments. It should be used as a part of the comment thread view.
|
|
11
|
+
*/
|
|
12
|
+
export default class CommentsListView extends View {
|
|
13
|
+
locale: Locale;
|
|
14
|
+
/**
|
|
15
|
+
* Informs whether the list contains any comment view that is in the editing mode.
|
|
16
|
+
*
|
|
17
|
+
* @observable
|
|
18
|
+
*/
|
|
19
|
+
hasDirtyComment: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Number of comments in the list.
|
|
22
|
+
*
|
|
23
|
+
* @observable
|
|
24
|
+
*/
|
|
25
|
+
length: number;
|
|
26
|
+
/**
|
|
27
|
+
* Informs whether the comments list view is in the active state ("highlighted").
|
|
28
|
+
* Comment list view is in that state when it is focused or it was activated by the user in any different way.
|
|
29
|
+
*
|
|
30
|
+
* @observable
|
|
31
|
+
*/
|
|
32
|
+
isActive: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* View collection which holds all comment views to be displayed.
|
|
35
|
+
* It may also contain collapsed count view if the comments list view is collapsed and some comment views are hidden.
|
|
36
|
+
*
|
|
37
|
+
* @readonly
|
|
38
|
+
*/
|
|
39
|
+
readonly visibleViews: ViewCollection;
|
|
40
|
+
/**
|
|
41
|
+
* View collection which holds all comment views created for given comment thread.
|
|
42
|
+
*
|
|
43
|
+
* @readonly
|
|
44
|
+
*/
|
|
45
|
+
readonly commentViews: ViewCollection;
|
|
46
|
+
/**
|
|
47
|
+
* Comment view used to display information that comment has been resolved.
|
|
48
|
+
*
|
|
49
|
+
* @readonly
|
|
50
|
+
*/
|
|
51
|
+
resolvedCommentView: CommentView | null;
|
|
52
|
+
/**
|
|
53
|
+
* @param locale The localization service instance.
|
|
54
|
+
* @param model The model on which the view will base.
|
|
55
|
+
* @param config Additional view configuration.
|
|
56
|
+
*/
|
|
57
|
+
constructor(locale: Locale, model: CommentThread, config: CommentThreadConfig);
|
|
58
|
+
/**
|
|
59
|
+
* @inheritDoc
|
|
60
|
+
*/
|
|
61
|
+
render(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Focuses the view.
|
|
64
|
+
*/
|
|
65
|
+
focus(): void;
|
|
66
|
+
/**
|
|
67
|
+
* @inheritDoc
|
|
68
|
+
*/
|
|
69
|
+
destroy(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Refreshes the list of the visible views.
|
|
72
|
+
*
|
|
73
|
+
* When doing so, it performs a minimal amount of changes, so that views are not re-added, which might cause undesirable effects
|
|
74
|
+
* like focus loss or glitches due to CSS animations.
|
|
75
|
+
*
|
|
76
|
+
* The comments list may be collapsed or expanded:
|
|
77
|
+
*
|
|
78
|
+
* * it is expanded, if it {@link ~#isActive is active},
|
|
79
|
+
* * it is expanded, if {@link module:comments/comments/commentsrepository~CommentThread#weight comment thread weight}
|
|
80
|
+
* is lower than allowed (`config.comments.maxThreadTotalWeight`),
|
|
81
|
+
* * it is expanded, if it {@link ~#hasDirtyComment has any comments in edit mode},
|
|
82
|
+
* * it is collapsed, if neither of above is true.
|
|
83
|
+
*
|
|
84
|
+
* When comments list is in collapsed state, it displays at most `config.comments.maxCommentsWhenCollapsed` comment views:
|
|
85
|
+
*
|
|
86
|
+
* * first comment view,
|
|
87
|
+
* * {@link ~#_collapsedCommentsView collapsed comments counter} (if there are any hidden views),
|
|
88
|
+
* * appropriate number of the comments from the bottom of the thread.
|
|
89
|
+
*
|
|
90
|
+
* All the comments are also {@link module:comments/comments/ui/view/basecommentview~BaseCommentView#collapse set to collapsed state}.
|
|
91
|
+
*
|
|
92
|
+
* When comments list in in expanded state, it displays all comment views for all comments. All the comments are also
|
|
93
|
+
* {@link module:comments/comments/ui/view/basecommentview~BaseCommentView#expand set to expanded state}.
|
|
94
|
+
*/
|
|
95
|
+
refreshVisibleViews(): void;
|
|
96
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1050=['from','weight','locale','expand','resolveCommentThread','set','delete','isEditMode','commentUpdated','isActive','commentViews','element','resolvedAt','maxThreadTotalWeight','editorConfig','insert','add','updateComment','render','_collapsedCommentsView','setTemplate','CommentView','remove','comments','_model','formatDateTime','_findOptimalIndex','_calculatePosition','maxCommentCharsWhenCollapsed','change:isEditMode','refreshVisibleViews','listenTo','_updateHasDirtyComment','bind','ck-thread__comments','resolvedCommentView','editorDestroyed','resolvedBy','visibleViews','length','_handleRemoveCommentModel','_handleNewCommentModel','destroy','_rearrangeCollapse','change:isResolved','delegate','hasDirtyComment','authoredAt','count','_config','resolved','createCollection','_handleInfoComment','focus','removeComment','maxCommentsWhenCollapsed','_rearrangeExpand','collapse'];(function(_0x537031,_0x105044){const _0x1f54ab=function(_0xbed12a){while(--_0xbed12a){_0x537031['push'](_0x537031['shift']());}};_0x1f54ab(++_0x105044);}(_0x1050,0x1c2));const _0x1f54=function(_0x537031,_0x105044){_0x537031=_0x537031-0x0;let _0x1f54ab=_0x1050[_0x537031];return _0x1f54ab;};import{View as _0x44b6bc}from'ckeditor5/src/ui.js';import{diff as _0xd6848a,Collection as _0x14eb67}from'ckeditor5/src/utils.js';import{getTranslation as _0x3b16e7}from'../../../utils/common-translations.js';import _0x2a3d54 from'./collapsedcommentsview.js';export default class vt extends _0x44b6bc{constructor(_0x11de42,_0x5765c4,_0x1a8e8e){super(_0x11de42),this['set'](_0x1f54('0x2'),!0x1),this[_0x1f54('0x13')](_0x1f54('0x35'),_0x5765c4[_0x1f54('0x25')][_0x1f54('0x35')]),this[_0x1f54('0x13')]('isActive',!0x1),this['_model']=_0x5765c4,this[_0x1f54('0x5')]=_0x1a8e8e,this[_0x1f54('0x18')]=this['createCollection'](),this[_0x1f54('0x34')]=this[_0x1f54('0x7')](),this[_0x1f54('0x31')]=null,this[_0x1f54('0x21')]=new _0x2a3d54(_0x11de42),this[_0x1f54('0x21')][_0x1f54('0x2f')](_0x1f54('0x4'))['to'](this,_0x1f54('0x35'),_0x283f0c=>_0x283f0c-this[_0x1f54('0x5')][_0x1f54('0xb')]);for(const _0x2eaac2 of _0x5765c4[_0x1f54('0x25')])this[_0x1f54('0x37')](_0x2eaac2);this[_0x1f54('0x8')](),this[_0x1f54('0x2d')](_0x5765c4[_0x1f54('0x25')],_0x1f54('0x1e'),(_0xc442cd,_0x5d076a)=>{const _0x235f39=this[_0x1f54('0x29')](_0x5d076a);this['length']++,this['_handleNewCommentModel'](_0x5d076a,_0x235f39),this[_0x1f54('0x2c')]();}),this[_0x1f54('0x2d')](_0x5765c4[_0x1f54('0x25')],_0x1f54('0x24'),(_0x4949ad,_0x1357b3)=>{this[_0x1f54('0x35')]--,this[_0x1f54('0x36')](_0x1357b3),this[_0x1f54('0x2c')]();}),this['listenTo'](_0x5765c4,_0x1f54('0x16'),()=>this['refreshVisibleViews']()),this['listenTo'](_0x5765c4,_0x1f54('0x0'),()=>this[_0x1f54('0x8')]()),this['on']('change:isActive',()=>this[_0x1f54('0x2c')]()),this['on']('change:hasDirtyComment',()=>this['refreshVisibleViews']()),this[_0x1f54('0x22')]({'tag':'ul','attributes':{'class':[_0x1f54('0x30')]},'children':this[_0x1f54('0x34')]});}get['_shouldCollapse'](){return this[_0x1f54('0x26')][_0x1f54('0xf')]>this[_0x1f54('0x5')][_0x1f54('0x1b')]&&!this[_0x1f54('0x17')]&&!this[_0x1f54('0x2')];}[_0x1f54('0x20')](){super[_0x1f54('0x20')](),this[_0x1f54('0x2c')]();}['focus'](){this[_0x1f54('0x19')][_0x1f54('0x9')]();}[_0x1f54('0x38')](){this[_0x1f54('0x21')][_0x1f54('0x38')]();for(const _0x2e7f72 of this[_0x1f54('0x18')])_0x2e7f72[_0x1f54('0x38')]();super[_0x1f54('0x38')]();}[_0x1f54('0x2c')](){this['_shouldCollapse']?this[_0x1f54('0x39')]():this[_0x1f54('0xc')]();}['_handleNewCommentModel'](_0x4139fb,_0x3f3e14){const _0x442dea=new this['_config'][(_0x1f54('0x23'))](this['locale'],_0x4139fb,{'maxCommentCharsWhenCollapsed':this[_0x1f54('0x5')][_0x1f54('0x2a')],'formatDateTime':this[_0x1f54('0x5')][_0x1f54('0x27')],'editorConfig':this[_0x1f54('0x5')][_0x1f54('0x1c')]});_0x442dea['viewUid']=_0x4139fb['id'],_0x442dea[_0x1f54('0x1')](_0x1f54('0xa'))['to'](this),_0x442dea['delegate'](_0x1f54('0x1f'))['to'](this),_0x442dea[_0x1f54('0x1')](_0x1f54('0x12'))['to'](this),_0x442dea[_0x1f54('0x1')]('editorReady')['to'](this),_0x442dea[_0x1f54('0x1')](_0x1f54('0x32'))['to'](this),this[_0x1f54('0x2d')](_0x442dea,_0x1f54('0x2b'),()=>this[_0x1f54('0x2e')]()),this[_0x1f54('0x18')][_0x1f54('0x1e')](_0x442dea,_0x3f3e14);}[_0x1f54('0x29')](_0x5dbd37){const _0x5e30da=this[_0x1f54('0x26')][_0x1f54('0x28')](_0x5dbd37);return this[_0x1f54('0x31')]?this[_0x1f54('0x31')]['authoredAt']>_0x5dbd37[_0x1f54('0x3')]?_0x5e30da-0x1:_0x5e30da:_0x5e30da-0x1;}[_0x1f54('0x8')](){if(this[_0x1f54('0x26')][_0x1f54('0x33')]&&this[_0x1f54('0x26')][_0x1f54('0x1a')]){const _0x31de3e={'id':_0x1f54('0x6'),'author':this[_0x1f54('0x26')][_0x1f54('0x33')],'authoredAt':this[_0x1f54('0x26')][_0x1f54('0x1a')],'content':_0x3b16e7(this[_0x1f54('0x10')],'Marked\x20as\x20resolved'),'attributes':{}};this[_0x1f54('0x31')]=new this['_config'][(_0x1f54('0x23'))](this[_0x1f54('0x10')],_0x31de3e,{'maxCommentCharsWhenCollapsed':this[_0x1f54('0x5')][_0x1f54('0x2a')],'formatDateTime':this[_0x1f54('0x5')]['formatDateTime'],'editorConfig':this['_config'][_0x1f54('0x1c')],'isSystemComment':!0x0}),this[_0x1f54('0x18')][_0x1f54('0x1e')](this[_0x1f54('0x31')],this[_0x1f54('0x26')]['_findOptimalIndex'](_0x31de3e));}else this[_0x1f54('0x31')]&&(this[_0x1f54('0x18')][_0x1f54('0x24')](this[_0x1f54('0x31')]),this[_0x1f54('0x31')]['destroy'](),this[_0x1f54('0x31')]=null);this[_0x1f54('0x2c')]();}[_0x1f54('0x36')](_0x4e625a){const _0xa6b6b0=this[_0x1f54('0x18')][_0x1f54('0x24')](_0x4e625a['id']);this['stopListening'](_0xa6b6b0),_0xa6b6b0[_0x1f54('0x15')]&&this[_0x1f54('0x2e')](),_0xa6b6b0[_0x1f54('0x38')]();}[_0x1f54('0x2e')](){this['hasDirtyComment']=Array[_0x1f54('0xe')](this[_0x1f54('0x18')])['some'](_0x567966=>_0x567966[_0x1f54('0x15')]);}[_0x1f54('0x39')](){const _0x4462a9=function(_0x1a9010){const _0x19b24d=new _0x14eb67();for(const _0x4d89bc of _0x1a9010)_0x19b24d[_0x1f54('0x1e')](_0x4d89bc);return _0x19b24d;}(this[_0x1f54('0x18')]),_0x47691f=this['_collapsedCommentsView'][_0x1f54('0x4')];for(let _0x3b4511=0x1;_0x3b4511<=_0x47691f;_0x3b4511++)_0x4462a9[_0x1f54('0x24')](0x1);for(const _0x560ee2 of _0x4462a9)_0x560ee2[_0x1f54('0xd')]();_0x47691f>0x0&&_0x4462a9[_0x1f54('0x1e')](this[_0x1f54('0x21')],0x1),ss(_0xd6848a(Array[_0x1f54('0xe')](this[_0x1f54('0x34')]),Array[_0x1f54('0xe')](_0x4462a9)),this['visibleViews'],_0x4462a9);}[_0x1f54('0xc')](){ss(_0xd6848a(Array[_0x1f54('0xe')](this[_0x1f54('0x34')]),Array['from'](this[_0x1f54('0x18')])),this[_0x1f54('0x34')],this[_0x1f54('0x18')]);for(const _0x46d44a of this[_0x1f54('0x34')])_0x46d44a[_0x1f54('0x11')]();}}function ss(_0x1ca2a9,_0x3d42c1,_0x599b90){let _0x56eaa8=0x0;for(const _0x4885cc of _0x1ca2a9)switch(_0x4885cc){case _0x1f54('0x1d'):_0x3d42c1[_0x1f54('0x1e')](_0x599b90['get'](_0x56eaa8),_0x56eaa8),_0x56eaa8++;break;case _0x1f54('0x14'):_0x3d42c1[_0x1f54('0x24')](_0x56eaa8);break;case'equal':_0x56eaa8++;}}
|