@ckeditor/ckeditor5-comments 36.0.1 → 37.0.0
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 +2 -2
- package/build/translations/af.js +1 -1
- package/build/translations/ar.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.js +1 -1
- package/build/translations/bs.js +1 -1
- package/build/translations/ca.js +1 -1
- package/build/translations/cs.js +1 -1
- package/build/translations/da.js +1 -1
- package/build/translations/de-ch.js +1 -1
- package/build/translations/de.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/es-co.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.js +1 -1
- package/build/translations/fa.js +1 -1
- package/build/translations/fi.js +1 -1
- package/build/translations/fr.js +1 -1
- package/build/translations/gl.js +1 -1
- package/build/translations/he.js +1 -1
- package/build/translations/hi.js +1 -1
- package/build/translations/hr.js +1 -1
- package/build/translations/hu.js +1 -1
- package/build/translations/id.js +1 -1
- package/build/translations/it.js +1 -1
- package/build/translations/ja.js +1 -1
- package/build/translations/jv.js +1 -1
- package/build/translations/ko.js +1 -1
- package/build/translations/lt.js +1 -1
- package/build/translations/lv.js +1 -1
- package/build/translations/ms.js +1 -1
- package/build/translations/nl.js +1 -1
- package/build/translations/no.js +1 -1
- package/build/translations/pl.js +1 -1
- package/build/translations/pt-br.js +1 -1
- package/build/translations/pt.js +1 -1
- package/build/translations/ro.js +1 -1
- package/build/translations/ru.js +1 -1
- package/build/translations/sk.js +1 -1
- package/build/translations/sr-latn.js +1 -1
- package/build/translations/sr.js +1 -1
- package/build/translations/sv.js +1 -1
- package/build/translations/th.js +1 -1
- package/build/translations/tk.js +1 -1
- package/build/translations/tr.js +1 -1
- package/build/translations/tt.js +1 -1
- package/build/translations/ug.js +1 -1
- package/build/translations/uk.js +1 -1
- package/build/translations/ur.js +1 -1
- package/build/translations/vi.js +1 -1
- package/build/translations/zh-cn.js +1 -1
- package/build/translations/zh.js +1 -1
- package/lang/contexts.json +8 -1
- package/lang/translations/af.po +28 -0
- package/lang/translations/ar.po +28 -0
- package/lang/translations/bg.po +28 -0
- package/lang/translations/bn.po +28 -0
- package/lang/translations/bs.po +28 -0
- package/lang/translations/ca.po +28 -0
- package/lang/translations/cs.po +28 -0
- package/lang/translations/da.po +28 -0
- package/lang/translations/de-ch.po +28 -0
- package/lang/translations/de.po +28 -0
- package/lang/translations/el.po +28 -0
- package/lang/translations/en-au.po +28 -0
- package/lang/translations/en.po +28 -0
- package/lang/translations/es-co.po +28 -0
- package/lang/translations/es.po +28 -0
- package/lang/translations/et.po +28 -0
- package/lang/translations/fa.po +28 -0
- package/lang/translations/fi.po +28 -0
- package/lang/translations/fr.po +28 -0
- package/lang/translations/gl.po +28 -0
- package/lang/translations/he.po +28 -0
- package/lang/translations/hi.po +28 -0
- package/lang/translations/hr.po +28 -0
- package/lang/translations/hu.po +28 -0
- package/lang/translations/id.po +28 -0
- package/lang/translations/it.po +28 -0
- package/lang/translations/ja.po +28 -0
- package/lang/translations/jv.po +28 -0
- package/lang/translations/ko.po +28 -0
- package/lang/translations/lt.po +28 -0
- package/lang/translations/lv.po +28 -0
- package/lang/translations/ms.po +28 -0
- package/lang/translations/nl.po +28 -0
- package/lang/translations/no.po +28 -0
- package/lang/translations/pl.po +28 -0
- package/lang/translations/pt-br.po +28 -0
- package/lang/translations/pt.po +28 -0
- package/lang/translations/ro.po +28 -0
- package/lang/translations/ru.po +28 -0
- package/lang/translations/sk.po +28 -0
- package/lang/translations/sr-latn.po +28 -0
- package/lang/translations/sr.po +29 -1
- package/lang/translations/sv.po +28 -0
- package/lang/translations/th.po +28 -0
- package/lang/translations/tk.po +28 -0
- package/lang/translations/tr.po +28 -0
- package/lang/translations/tt.po +28 -0
- package/lang/translations/ug.po +28 -0
- package/lang/translations/uk.po +28 -0
- package/lang/translations/ur.po +28 -0
- package/lang/translations/vi.po +28 -0
- package/lang/translations/zh-cn.po +28 -0
- package/lang/translations/zh.po +28 -0
- package/package.json +19 -3
- package/src/annotations/annotation.d.ts +86 -0
- package/src/annotations/annotation.js +1 -1
- package/src/annotations/annotationcollection.d.ts +94 -0
- package/src/annotations/annotationcollection.js +1 -1
- package/src/annotations/annotations.d.ts +150 -0
- package/src/annotations/annotations.js +1 -1
- package/src/annotations/annotationsuis.d.ts +227 -0
- package/src/annotations/annotationsuis.js +1 -1
- package/src/annotations/editorannotations.d.ts +62 -0
- package/src/annotations/editorannotations.js +1 -1
- package/src/annotations/inlineannotations.d.ts +84 -0
- package/src/annotations/inlineannotations.js +1 -1
- package/src/annotations/narrowsidebar.d.ts +80 -0
- package/src/annotations/narrowsidebar.js +1 -1
- package/src/annotations/sidebar.d.ts +96 -0
- package/src/annotations/sidebar.js +1 -1
- package/src/annotations/view/annotationcounterbuttonview.d.ts +25 -0
- package/src/annotations/view/annotationcounterbuttonview.js +1 -1
- package/src/annotations/view/annotationview.d.ts +86 -0
- package/src/annotations/view/annotationview.js +1 -1
- package/src/annotations/view/sidebaritemview.d.ts +51 -0
- package/src/annotations/view/sidebaritemview.js +1 -1
- package/src/annotations/view/sidebarview.d.ts +28 -0
- package/src/annotations/view/sidebarview.js +1 -1
- package/src/annotations/widesidebar.d.ts +72 -0
- package/src/annotations/widesidebar.js +1 -1
- package/src/augmentation.d.ts +54 -0
- package/src/augmentation.js +23 -0
- package/src/comments/addcommentthreadcommand.d.ts +31 -0
- package/src/comments/addcommentthreadcommand.js +1 -1
- package/src/comments/commentsarchive.d.ts +25 -0
- package/src/comments/commentsarchive.js +23 -0
- package/src/comments/commentsarchiveui.d.ts +32 -0
- package/src/comments/commentsarchiveui.js +23 -0
- package/src/comments/commentsediting.d.ts +71 -0
- package/src/comments/commentsediting.js +1 -1
- package/src/comments/commentsrepository.d.ts +1009 -0
- package/src/comments/commentsrepository.js +1 -1
- package/src/comments/commentsui.d.ts +25 -0
- package/src/comments/commentsui.js +1 -1
- package/src/comments/integrations/commentsrestrictededitingmode.d.ts +13 -0
- package/src/comments/integrations/commentsrestrictededitingmode.js +1 -1
- package/src/comments/integrations/importword.d.ts +17 -0
- package/src/comments/integrations/importword.js +1 -1
- package/src/comments/ui/commenteditor/commenteditor.d.ts +32 -0
- package/src/comments/ui/commenteditor/commenteditor.js +1 -1
- package/src/comments/ui/commenteditor/commenteditorui.d.ts +27 -0
- package/src/comments/ui/commenteditor/commenteditorui.js +1 -1
- package/src/comments/ui/commenteditor/commenteditoruiview.d.ts +32 -0
- package/src/comments/ui/commenteditor/commenteditoruiview.js +1 -1
- package/src/comments/ui/commentthreadcontroller.d.ts +64 -0
- package/src/comments/ui/commentthreadcontroller.js +1 -1
- package/src/comments/ui/view/basecommentthreadview.d.ts +108 -0
- package/src/comments/ui/view/basecommentthreadview.js +1 -1
- package/src/comments/ui/view/basecommentview.d.ts +108 -0
- package/src/comments/ui/view/basecommentview.js +1 -1
- package/src/comments/ui/view/collapsedcommentsview.d.ts +9 -0
- package/src/comments/ui/view/collapsedcommentsview.js +1 -1
- package/src/comments/ui/view/commentcontentview.d.ts +10 -0
- package/src/comments/ui/view/commentcontentview.js +1 -1
- package/src/comments/ui/view/commentinputview.d.ts +76 -0
- package/src/comments/ui/view/commentinputview.js +1 -1
- package/src/comments/ui/view/commentsarchiveview.d.ts +34 -0
- package/src/comments/ui/view/commentsarchiveview.js +23 -0
- package/src/comments/ui/view/commentslistview.d.ts +96 -0
- package/src/comments/ui/view/commentslistview.js +1 -1
- package/src/comments/ui/view/commentthreadheaderview.d.ts +46 -0
- package/src/comments/ui/view/commentthreadheaderview.js +23 -0
- package/src/comments/ui/view/commentthreadinputview.d.ts +37 -0
- package/src/comments/ui/view/commentthreadinputview.js +1 -1
- package/src/comments/ui/view/commentthreadview.d.ts +108 -0
- package/src/comments/ui/view/commentthreadview.js +1 -1
- package/src/comments/ui/view/commentview.d.ts +231 -0
- package/src/comments/ui/view/commentview.js +1 -1
- package/src/comments.d.ts +22 -0
- package/src/comments.js +1 -1
- package/src/commentsonly.d.ts +28 -0
- package/src/commentsonly.js +1 -1
- package/src/config.d.ts +172 -0
- package/src/config.js +23 -0
- package/src/index.d.ts +19 -0
- package/src/index.js +1 -1
- package/src/utils/common-translations.d.ts +5 -0
- package/src/utils/common-translations.js +1 -1
- package/src/utils/createmutationobserver.d.ts +13 -0
- package/src/utils/createmutationobserver.js +1 -1
- package/theme/annotation.css +1 -0
- package/theme/comment.css +31 -0
- package/theme/commentsarchive.css +40 -0
- package/theme/commentthread.css +68 -1
- package/theme/icons/add-comment.svg +1 -1
- package/theme/icons/comments-archive.svg +11 -0
- package/theme/icons/undo.svg +1 -0
- package/theme/sidebar.css +4 -0
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
element: HTMLElement;
|
|
41
|
+
/**
|
|
42
|
+
* Keystroke handler for the view.
|
|
43
|
+
*/
|
|
44
|
+
keystrokes: KeystrokeHandler;
|
|
45
|
+
/**
|
|
46
|
+
* Focus tracker for the view.
|
|
47
|
+
*/
|
|
48
|
+
focusTracker: FocusTracker;
|
|
49
|
+
/**
|
|
50
|
+
* Button view for the button which submits the comment.
|
|
51
|
+
*/
|
|
52
|
+
submitButtonView: ButtonView;
|
|
53
|
+
/**
|
|
54
|
+
* Button view for the button which cancels comment input.
|
|
55
|
+
*/
|
|
56
|
+
cancelButtonView: ButtonView;
|
|
57
|
+
constructor(locale: Locale, editorConfig?: EditorConfig);
|
|
58
|
+
/**
|
|
59
|
+
* @inheritDoc
|
|
60
|
+
*/
|
|
61
|
+
render(): void;
|
|
62
|
+
/**
|
|
63
|
+
* Creates the comment editor instance.
|
|
64
|
+
*
|
|
65
|
+
* @returns Promise resolved after the editor instance is initialized.
|
|
66
|
+
*/
|
|
67
|
+
createEditor(): Promise<CommentEditor | undefined>;
|
|
68
|
+
/**
|
|
69
|
+
* Focuses the view.
|
|
70
|
+
*/
|
|
71
|
+
focus(): void;
|
|
72
|
+
/**
|
|
73
|
+
* @inheritDoc
|
|
74
|
+
*/
|
|
75
|
+
destroy(): Promise<void>;
|
|
76
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1fff=['element','extendTemplate','editorReady','_editorConfig','ck-comment__input-actions','setTemplate','model','destroy','view','disabledSubmit','trim','submitButtonView','ck-comment__input-actions--submit','document','Reply...','value','submit','focusNext','change','initialData','Esc','div','render','keystrokes','setData','focusTracker','cancelButtonView','focusPrevious','check','length','set','fire','placeholder','_initializeFocusCycling','getData','execute','_createSubmitButton','low','TOO_LONG_COMMENT_ALERT','icon','showButtons','editor','forEach','ck-comment__input-actions--cancel','bindTemplate','_isDestroyed','tab','create','Submit','ck-comment__input-wrapper','high','bind','cancel','label','add','firstChild','Cancel','ck-comment__input-actions--active','_editorCreationPromise'];(function(_0x18129d,_0x1fffeb){const _0xeebf72=function(_0x52c066){while(--_0x52c066){_0x18129d['push'](_0x18129d['shift']());}};_0xeebf72(++_0x1fffeb);}(_0x1fff,0xc9));const _0xeebf=function(_0x18129d,_0x1fffeb){_0x18129d=_0x18129d-0x0;let _0xeebf72=_0x1fff[_0x18129d];return _0xeebf72;};import{View as _0x539c71,ViewCollection as _0x2d457b,FocusCycler as _0x275f4b,ButtonView as _0x1fbbf8}from'ckeditor5/src/ui';import{FocusTracker as _0x245544,KeystrokeHandler as _0x2a7f1a}from'ckeditor5/src/utils';import{icons as _0x173133}from'ckeditor5/src/core';import _0x1d435d from'../commenteditor/commenteditor';import{getTranslation as _0x36a6a1}from'../../../utils/common-translations';export default class Wt extends _0x539c71{constructor(_0x26bd63,_0x30d499={}){super(_0x26bd63),this[_0xeebf('0x11')]=null,this['_editorConfig']=_0x30d499,this[_0xeebf('0x3a')]=new _0x2a7f1a(),this[_0xeebf('0x1')]=new _0x245544(),this[_0xeebf('0x6')](_0xeebf('0x32'),_0x30d499[_0xeebf('0x36')]||''),this['set'](_0xeebf('0x2c'),!0x1),this['set'](_0xeebf('0x10'),!0x0),this[_0xeebf('0x6')](_0xeebf('0x8'),_0x36a6a1(_0x26bd63,_0xeebf('0x31'))),this[_0xeebf('0x2e')]=this[_0xeebf('0xc')](),this[_0xeebf('0x2')]=this['_createCancelButton'](),this[_0xeebf('0x28')]({'tag':_0xeebf('0x38'),'attributes':{'class':[_0xeebf('0x19')]},'children':[{'tag':_0xeebf('0x38'),'attributes':{'class':[_0xeebf('0x27'),this[_0xeebf('0x14')]['if']('showButtons',_0xeebf('0x21'))]},'children':[this[_0xeebf('0x2e')],this[_0xeebf('0x2')]]}]}),this[_0xeebf('0x3a')][_0xeebf('0x6')](_0xeebf('0x37'),(_0x33981f,_0x1153e6)=>{this[_0xeebf('0x2')][_0xeebf('0x7')](_0xeebf('0xb')),_0x1153e6();}),this['on'](_0xeebf('0x33'),(_0x5b91ea,_0x10e63c)=>{_0x10e63c[_0xeebf('0x5')]>0xfde8?(alert(_0x36a6a1(_0x26bd63,_0xeebf('0xe'),[_0x10e63c['length'],0xfde8])),_0x5b91ea['stop']()):this[_0xeebf('0x11')]['setData']('');},{'priority':_0xeebf('0x1a')});}[_0xeebf('0x39')](){super['render'](),this['keystrokes']['listenTo'](this[_0xeebf('0x23')]),this[_0xeebf('0x1')][_0xeebf('0x1e')](this['element']);}['createEditor'](){return this[_0xeebf('0x11')]||(this['editor']=new _0x1d435d(this[_0xeebf('0x26')]),this[_0xeebf('0x22')]=this[_0xeebf('0x11')][_0xeebf('0x17')]()['then'](()=>{if(this['_isDestroyed'])return;const _0x2cbf13=this[_0xeebf('0x11')];this[_0xeebf('0x23')]['insertBefore'](_0x2cbf13['ui'][_0xeebf('0x23')],this[_0xeebf('0x23')][_0xeebf('0x1f')]),_0x2cbf13[_0xeebf('0x29')][_0xeebf('0x30')]['on'](_0xeebf('0x35'),()=>this[_0xeebf('0x32')]=_0x2cbf13[_0xeebf('0xa')]()),_0x2cbf13[_0xeebf('0x1b')](_0xeebf('0x8'))['to'](this),this[_0xeebf('0x9')](this[_0xeebf('0x11')]),this[_0xeebf('0x7')](_0xeebf('0x25'));})),this[_0xeebf('0x22')];}['focus'](){this[_0xeebf('0x11')]&&this['editor']['focus']();}async[_0xeebf('0x2a')](){this[_0xeebf('0x15')]||(this['_isDestroyed']=!0x0,this['editor']&&(await this[_0xeebf('0x22')],await this[_0xeebf('0x11')][_0xeebf('0x2a')]()),await super[_0xeebf('0x2a')]());}[_0xeebf('0xc')](){const {locale:_0x527d90}=this,_0x183f6b=new _0x1fbbf8(_0x527d90);return _0x183f6b[_0xeebf('0x24')]({'attributes':{'class':[_0xeebf('0x2f')]}}),_0x183f6b[_0xeebf('0x1d')]=_0x36a6a1(_0x527d90,_0xeebf('0x18')),_0x183f6b[_0xeebf('0xf')]=_0x173133[_0xeebf('0x4')],_0x183f6b['on'](_0xeebf('0xb'),()=>{this[_0xeebf('0x7')](_0xeebf('0x33'),this['value']);}),_0x183f6b[_0xeebf('0x1b')]('isEnabled')['to'](this,_0xeebf('0x32'),this,_0xeebf('0x2c'),(_0x724ad3,_0x27a9e5)=>!_0x27a9e5&&!!_0x724ad3[_0xeebf('0x2d')]()),_0x183f6b;}['_createCancelButton'](){const {locale:_0x541fef}=this,_0x381d56=new _0x1fbbf8(_0x541fef);return _0x381d56[_0xeebf('0x24')]({'attributes':{'class':[_0xeebf('0x13')]}}),_0x381d56['label']=_0x36a6a1(_0x541fef,_0xeebf('0x20')),_0x381d56[_0xeebf('0xf')]=_0x173133[_0xeebf('0x1c')],_0x381d56['on'](_0xeebf('0xb'),()=>{this['editor'][_0xeebf('0x0')](''),this[_0xeebf('0x7')]('cancel');}),_0x381d56;}[_0xeebf('0x9')](_0x3dd99e){const _0x3684ab=this[_0xeebf('0x1')],_0x55deb5=new _0x2d457b();[_0x3dd99e['ui'][_0xeebf('0x2b')],this[_0xeebf('0x2e')],this[_0xeebf('0x2')]][_0xeebf('0x12')](_0x43ba0e=>{_0x55deb5[_0xeebf('0x1e')](_0x43ba0e),_0x3684ab[_0xeebf('0x1e')](_0x43ba0e[_0xeebf('0x23')]);});const _0xd9ccff=new _0x275f4b({'focusables':_0x55deb5,'focusTracker':_0x3684ab});this[_0xeebf('0x3a')][_0xeebf('0x6')](_0xeebf('0x16'),(_0x1ca423,_0x4be506)=>{_0xd9ccff[_0xeebf('0x34')](),_0x4be506();},{'priority':_0xeebf('0xd')}),this[_0xeebf('0x3a')][_0xeebf('0x6')]('shift\x20+\x20tab',(_0x44ac9d,_0x115372)=>{_0xd9ccff[_0xeebf('0x3')](),_0x115372();},{'priority':_0xeebf('0xd')});}}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const _0x1ece=['ck-comments-archive','element','focus','setTemplate','bindTemplate','ck-comments-archive__info','shift\x20+\x20tab','stopPropagation','isActive','length','arrowup','_focusCycler','selectstart','_keystrokes','set','destroy','div','high','ck-comments-archive__header\x20','arrowleft','ck-comments-archive__content','isEmpty','_focusTracker','tab','listenTo'];(function(_0x3b446a,_0x1ece34){const _0x4668ce=function(_0x149453){while(--_0x149453){_0x3b446a['push'](_0x3b446a['shift']());}};_0x4668ce(++_0x1ece34);}(_0x1ece,0x15d));const _0x4668=function(_0x3b446a,_0x1ece34){_0x3b446a=_0x3b446a-0x0;let _0x4668ce=_0x1ece[_0x3b446a];return _0x4668ce;};import{View as _0x30aad9,FocusCycler as _0x3a31ab}from'ckeditor5/src/ui';import{FocusTracker as _0x48ef28,KeystrokeHandler as _0x9aee7b}from'ckeditor5/src/utils';import{getTranslation as _0x547f45}from'../../../utils/common-translations';export default class K extends _0x30aad9{constructor(_0x4e25f1,_0x300c8c){super(_0x4e25f1),this[_0x4668('0xf')](_0x4668('0x16'),!_0x300c8c['length']),this[_0x4668('0x17')]=new _0x48ef28(),this[_0x4668('0xe')]=new _0x9aee7b(),this['_focusables']=_0x300c8c,this[_0x4668('0xc')]=new _0x3a31ab({'focusables':this['_focusables'],'focusTracker':this[_0x4668('0x17')],'keystrokeHandler':this[_0x4668('0xe')],'actions':{'focusPrevious':_0x4668('0x7'),'focusNext':_0x4668('0x18')}}),this['listenTo'](_0x300c8c,'add',()=>{this[_0x4668('0x16')]=!0x1;}),this[_0x4668('0x0')](_0x300c8c,'remove',(_0x454c6d,_0x2cae2f)=>{_0x2cae2f[_0x4668('0x9')]&&this[_0x4668('0x3')](),_0x300c8c[_0x4668('0xa')]||(this['isEmpty']=!0x0);});const _0x1999e2=this[_0x4668('0x5')];this[_0x4668('0x4')]({'tag':_0x4668('0x11'),'attributes':{'dir':'auto','class':['ck',_0x4668('0x1')],'tabindex':-0x1},'children':[{'tag':'p','attributes':{'class':[_0x4668('0x13')]},'children':[{'text':_0x547f45(_0x4e25f1,'COMMENTS_ARCHIVE')}]},{'tag':_0x4668('0x11'),'attributes':{'class':[_0x4668('0x15')]},'children':[{'tag':_0x4668('0x11'),'children':_0x300c8c},{'tag':'p','attributes':{'class':[_0x4668('0x6'),_0x1999e2['if'](_0x4668('0x16'),'ck-hidden',_0x1f6377=>!_0x1f6377)]},'children':[{'text':_0x547f45(_0x4e25f1,'EMPTY_COMMENTS_ARCHIVE')}]}]}]});}['render'](){super['render'](),this[_0x4668('0xe')]['listenTo'](this[_0x4668('0x2')]);const _0x28d25e=_0xeb1594=>_0xeb1594['stopPropagation']();this[_0x4668('0xe')][_0x4668('0xf')]('arrowright',_0x28d25e),this[_0x4668('0xe')]['set'](_0x4668('0x14'),_0x28d25e),this[_0x4668('0xe')][_0x4668('0xf')](_0x4668('0xb'),_0x28d25e),this[_0x4668('0xe')][_0x4668('0xf')]('arrowdown',_0x28d25e),this[_0x4668('0x0')](this[_0x4668('0x2')],_0x4668('0xd'),(_0x1e5832,_0x1de7e8)=>{_0x1de7e8[_0x4668('0x8')]();},{'priority':_0x4668('0x12')});}[_0x4668('0x10')](){super[_0x4668('0x10')](),this['_focusTracker'][_0x4668('0x10')](),this[_0x4668('0xe')][_0x4668('0x10')]();}['focus'](){this[_0x4668('0x2')][_0x4668('0x3')]();}}
|
|
@@ -0,0 +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
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x1161=['authoredAt','formatDateTime','_config','isEditMode','isResolved','from','CommentView','add','change:isResolved','_collapsedCommentsView','change:hasDirtyComment','resolveCommentThread','set','_updateHasDirtyComment','maxCommentCharsWhenCollapsed','visibleViews','resolved','length','element','removeComment','remove','locale','collapse','count','delete','render','resolvedAt','_findOptimalIndex','_rearrangeExpand','resolvedBy','focus','stopListening','change:isActive','equal','maxCommentsWhenCollapsed','expand','refreshVisibleViews','_calculatePosition','commentViews','updateComment','destroy','isActive','_model','Marked\x20as\x20resolved','editorConfig','_handleRemoveCommentModel','hasDirtyComment','_rearrangeCollapse','setTemplate','comments','_handleNewCommentModel','commentUpdated','delegate','listenTo','viewUid','ck-thread__comments','resolvedCommentView','_handleInfoComment','get'];(function(_0x23c387,_0x11617e){const _0x3dedb1=function(_0x108296){while(--_0x108296){_0x23c387['push'](_0x23c387['shift']());}};_0x3dedb1(++_0x11617e);}(_0x1161,0xfa));const _0x3ded=function(_0x23c387,_0x11617e){_0x23c387=_0x23c387-0x0;let _0x3dedb1=_0x1161[_0x23c387];return _0x3dedb1;};import{View as _0x57c969}from'ckeditor5/src/ui';import{diff as _0x1699c3,Collection as _0x317462}from'ckeditor5/src/utils';import{getTranslation as _0x1e0c53}from'../../../utils/common-translations';import _0x20ff99 from'./collapsedcommentsview';export default class vt extends _0x57c969{constructor(_0x4df269,_0x25ddda,_0x257ad7){super(_0x4df269),this[_0x3ded('0x39')](_0x3ded('0x20'),!0x1),this[_0x3ded('0x39')]('length',_0x25ddda[_0x3ded('0x23')]['length']),this[_0x3ded('0x39')]('isActive',!0x1),this['_model']=_0x25ddda,this[_0x3ded('0x2f')]=_0x257ad7,this['commentViews']=this['createCollection'](),this[_0x3ded('0x1')]=this['createCollection'](),this['resolvedCommentView']=null,this[_0x3ded('0x36')]=new _0x20ff99(_0x4df269),this['_collapsedCommentsView']['bind'](_0x3ded('0x9'))['to'](this,_0x3ded('0x3'),_0x546cc8=>_0x546cc8-this[_0x3ded('0x2f')][_0x3ded('0x14')]);for(const _0xe5d768 of _0x25ddda[_0x3ded('0x23')])this['_handleNewCommentModel'](_0xe5d768);this['_handleInfoComment'](),this['listenTo'](_0x25ddda['comments'],_0x3ded('0x34'),(_0x80aa7a,_0x213083)=>{const _0x367f1f=this[_0x3ded('0x17')](_0x213083);this[_0x3ded('0x3')]++,this[_0x3ded('0x24')](_0x213083,_0x367f1f),this[_0x3ded('0x16')]();}),this[_0x3ded('0x27')](_0x25ddda[_0x3ded('0x23')],'remove',(_0x3f1736,_0x454d21)=>{this[_0x3ded('0x3')]--,this[_0x3ded('0x1f')](_0x454d21),this['refreshVisibleViews']();}),this['listenTo'](_0x25ddda,_0x3ded('0x25'),()=>this[_0x3ded('0x16')]()),this[_0x3ded('0x27')](_0x25ddda,_0x3ded('0x35'),()=>this['_handleInfoComment']()),this['on'](_0x3ded('0x12'),()=>this[_0x3ded('0x16')]()),this['on'](_0x3ded('0x37'),()=>this[_0x3ded('0x16')]()),this[_0x3ded('0x22')]({'tag':'ul','attributes':{'class':[_0x3ded('0x29')]},'children':this['visibleViews']});}get['_shouldCollapse'](){return this[_0x3ded('0x1c')]['weight']>this[_0x3ded('0x2f')]['maxThreadTotalWeight']&&!this[_0x3ded('0x1b')]&&!this['hasDirtyComment'];}['render'](){super[_0x3ded('0xb')](),this[_0x3ded('0x16')]();}[_0x3ded('0x10')](){this[_0x3ded('0x4')]['focus']();}[_0x3ded('0x1a')](){this[_0x3ded('0x36')][_0x3ded('0x1a')]();for(const _0x1976fc of this['commentViews'])_0x1976fc[_0x3ded('0x1a')]();super[_0x3ded('0x1a')]();}[_0x3ded('0x16')](){this['_shouldCollapse']?this['_rearrangeCollapse']():this[_0x3ded('0xe')]();}[_0x3ded('0x24')](_0x5870cd,_0x3fdd9a){const _0x4f89b6=new this['_config'][(_0x3ded('0x33'))](this['locale'],_0x5870cd,{'maxCommentCharsWhenCollapsed':this[_0x3ded('0x2f')][_0x3ded('0x0')],'formatDateTime':this['_config'][_0x3ded('0x2e')],'editorConfig':this[_0x3ded('0x2f')]['editorConfig']});_0x4f89b6[_0x3ded('0x28')]=_0x5870cd['id'],_0x4f89b6[_0x3ded('0x26')](_0x3ded('0x5'))['to'](this),_0x4f89b6[_0x3ded('0x26')](_0x3ded('0x19'))['to'](this),_0x4f89b6[_0x3ded('0x26')](_0x3ded('0x38'))['to'](this),this['listenTo'](_0x4f89b6,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this[_0x3ded('0x18')][_0x3ded('0x34')](_0x4f89b6,_0x3fdd9a);}[_0x3ded('0x17')](_0x1a4f4a){const _0x287bcb=this['_model'][_0x3ded('0xd')](_0x1a4f4a);return this[_0x3ded('0x2a')]?this['resolvedCommentView'][_0x3ded('0x2d')]>_0x1a4f4a[_0x3ded('0x2d')]?_0x287bcb-0x1:_0x287bcb:_0x287bcb-0x1;}[_0x3ded('0x2b')](){if(this[_0x3ded('0x1c')][_0x3ded('0x31')]){const _0x499725={'id':_0x3ded('0x2'),'author':this[_0x3ded('0x1c')][_0x3ded('0xf')],'authoredAt':this['_model'][_0x3ded('0xc')],'content':_0x1e0c53(this['locale'],_0x3ded('0x1d')),'attributes':{}};this[_0x3ded('0x2a')]=new this['_config'][(_0x3ded('0x33'))](this[_0x3ded('0x7')],_0x499725,{'maxCommentCharsWhenCollapsed':this[_0x3ded('0x2f')]['maxCommentCharsWhenCollapsed'],'formatDateTime':this[_0x3ded('0x2f')]['formatDateTime'],'editorConfig':this[_0x3ded('0x2f')][_0x3ded('0x1e')],'isSystemComment':!0x0}),this[_0x3ded('0x18')][_0x3ded('0x34')](this[_0x3ded('0x2a')],this[_0x3ded('0x1c')][_0x3ded('0xd')](_0x499725));}else this[_0x3ded('0x2a')]&&(this[_0x3ded('0x18')][_0x3ded('0x6')](this[_0x3ded('0x2a')]),this[_0x3ded('0x2a')]['destroy'](),this[_0x3ded('0x2a')]=null);this['refreshVisibleViews']();}[_0x3ded('0x1f')](_0x5187f2){const _0x52e7cb=this[_0x3ded('0x18')][_0x3ded('0x6')](_0x5187f2['id']);this[_0x3ded('0x11')](_0x52e7cb),_0x52e7cb[_0x3ded('0x30')]&&this[_0x3ded('0x3a')](),_0x52e7cb['destroy']();}[_0x3ded('0x3a')](){this[_0x3ded('0x20')]=Array['from'](this[_0x3ded('0x18')])['some'](_0x262344=>_0x262344[_0x3ded('0x30')]);}[_0x3ded('0x21')](){const _0x1b2307=function(_0x5f23e0){const _0x330483=new _0x317462();for(const _0x21122d of _0x5f23e0)_0x330483[_0x3ded('0x34')](_0x21122d);return _0x330483;}(this['commentViews']),_0x15194f=this[_0x3ded('0x36')]['count'];for(let _0x147a52=0x1;_0x147a52<=_0x15194f;_0x147a52++)_0x1b2307[_0x3ded('0x6')](0x1);for(const _0x3a0b2d of _0x1b2307)_0x3a0b2d[_0x3ded('0x8')]();_0x15194f>0x0&&_0x1b2307[_0x3ded('0x34')](this['_collapsedCommentsView'],0x1),ss(_0x1699c3(Array[_0x3ded('0x32')](this['visibleViews']),Array[_0x3ded('0x32')](_0x1b2307)),this[_0x3ded('0x1')],_0x1b2307);}[_0x3ded('0xe')](){ss(_0x1699c3(Array['from'](this[_0x3ded('0x1')]),Array['from'](this[_0x3ded('0x18')])),this[_0x3ded('0x1')],this['commentViews']);for(const _0x2b2b83 of this[_0x3ded('0x1')])_0x2b2b83[_0x3ded('0x15')]();}}function ss(_0x228db1,_0x4e1d39,_0x34dcb7){let _0x1ba1a8=0x0;for(const _0x4c4cfe of _0x228db1)switch(_0x4c4cfe){case'insert':_0x4e1d39[_0x3ded('0x34')](_0x34dcb7[_0x3ded('0x2c')](_0x1ba1a8),_0x1ba1a8),_0x1ba1a8++;break;case _0x3ded('0xa'):_0x4e1d39['remove'](_0x1ba1a8);break;case _0x3ded('0x13'):_0x1ba1a8++;}}
|
|
@@ -0,0 +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
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const _0x2b35=['length','value','render','tooltip','overlay','locale','remove','.ck-context','reopenCommentThread','isVisible','querySelector','setTemplate','bindTemplate','mouseleave','label','add','ck-context','contextValue','_createReopenButton','_trimContextValue','lastIndexOf','mouseenter','isResolvable','.ck-context__value','substring','listenTo','_model','context','ck-context-wrapper','hasContext','reopenButtonView','ck-thread__header','offsetWidth','ck-context--quotes','ck-annotation__actions','div','_attachContextActions','Reopen','classList','bind'];(function(_0x34bf3a,_0x2b3574){const _0x10bf0f=function(_0x4b85cb){while(--_0x4b85cb){_0x34bf3a['push'](_0x34bf3a['shift']());}};_0x10bf0f(++_0x2b3574);}(_0x2b35,0x141));const _0x10bf=function(_0x34bf3a,_0x2b3574){_0x34bf3a=_0x34bf3a-0x0;let _0x10bf0f=_0x2b35[_0x34bf3a];return _0x10bf0f;};import{View as _0x2e645a,ButtonView as _0x5842ad}from'ckeditor5/src/ui';import{getTranslation as _0x34c580}from'../../../utils/common-translations';import _0x10288a from'../../../../theme/icons/undo.svg';export const MAX_CONTENT_LENGTH=0x96;export default class Tt extends _0x2e645a{constructor(_0x4a4cf4,_0x386186){super(_0x4a4cf4);const _0xac9a5a=this[_0x10bf('0xb')];this[_0x10bf('0x19')]=_0x386186,this[_0x10bf('0x1d')]=this[_0x10bf('0x11')](),this['bind']('hasContext')['to'](this[_0x10bf('0x19')],_0x10bf('0x1a'),_0x21f381=>!!_0x21f381),this[_0x10bf('0x26')](_0x10bf('0x10'))['to'](this['_model'],_0x10bf('0x1a'),_0x3b0e16=>_0x3b0e16&&_0x3b0e16[_0x10bf('0x0')]?this['_trimContextValue'](_0x3b0e16[_0x10bf('0x0')]):_0x34c580(this[_0x10bf('0x4')],'Comment\x20was\x20made\x20on\x20an\x20element')),this[_0x10bf('0xa')]({'tag':_0x10bf('0x22'),'attributes':{'class':[_0x10bf('0x1e')]},'children':[{'tag':_0x10bf('0x22'),'attributes':{'class':[_0x10bf('0x1b')]},'children':[{'tag':'div','attributes':{'class':[_0x10bf('0xf'),_0xac9a5a['if'](_0x10bf('0x1c'),_0x10bf('0x20'))]},'children':[{'tag':'span','attributes':{'class':['ck-context__value']},'children':[{'text':_0xac9a5a['to']('contextValue')}]}]}]},{'tag':_0x10bf('0x22'),'attributes':{'class':[_0x10bf('0x21')]},'children':[this['reopenButtonView']]}]});}[_0x10bf('0x1')](){super['render'](),this[_0x10bf('0x23')]();}['_createReopenButton'](){const _0x555f3e=new _0x5842ad(this[_0x10bf('0x4')]);return _0x555f3e[_0x10bf('0xd')]=_0x34c580(this[_0x10bf('0x4')],'Reopen'),_0x555f3e[_0x10bf('0x2')]=_0x34c580(this['locale'],_0x10bf('0x24')),_0x555f3e['icon']=_0x10288a,_0x555f3e[_0x10bf('0x26')](_0x10bf('0x8'))['to'](this[_0x10bf('0x19')],_0x10bf('0x15')),_0x555f3e['on']('execute',()=>{this['fire'](_0x10bf('0x7'),this[_0x10bf('0x19')]['id']);}),_0x555f3e;}[_0x10bf('0x12')](_0x3dd266){if(_0x3dd266[_0x10bf('0x27')]<0x96)return _0x3dd266;const _0x556732=_0x3dd266[_0x10bf('0x13')]('\x20',0x93);return _0x3dd266[_0x10bf('0x17')](0x0,_0x556732>-0x1?_0x556732:0x93)+'...';}[_0x10bf('0x23')](){const _0xfd08e1=this['element'][_0x10bf('0x9')](_0x10bf('0x6')),_0x2bab84=_0xfd08e1['querySelector'](_0x10bf('0x16'));this[_0x10bf('0x18')](_0xfd08e1,_0x10bf('0x14'),()=>{_0x2bab84[_0x10bf('0x1f')]<_0x2bab84['scrollWidth']&&_0xfd08e1[_0x10bf('0x25')][_0x10bf('0xe')](_0x10bf('0x3'));}),this[_0x10bf('0x18')](_0xfd08e1,_0x10bf('0xc'),()=>{_0xfd08e1['classList'][_0x10bf('0x5')](_0x10bf('0x3'));});}}
|
|
@@ -0,0 +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/src/collaboration-core';
|
|
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 _0x4105=['bindTemplate','userView','destroy','isFocused','change:showInput','then','showInput','setTemplate','ck-thread__user','commentInputView','extendTemplate','editor','ck-comment__input-container--active','focusTracker','bind'];(function(_0x3bee46,_0x410576){var _0x26eb45=function(_0x3aa8b5){while(--_0x3aa8b5){_0x3bee46['push'](_0x3bee46['shift']());}};_0x26eb45(++_0x410576);}(_0x4105,0x15f));var _0x26eb=function(_0x3bee46,_0x410576){_0x3bee46=_0x3bee46-0x0;var _0x26eb45=_0x4105[_0x3bee46];return _0x26eb45;};import{View as _0x5d2f1c}from'ckeditor5/src/ui';import _0x340cc1 from'./commentinputview';import{UserView as _0x51abf4}from'ckeditor5-collaboration/src/collaboration-core';export default class wt extends _0x5d2f1c{constructor(_0x3a082b,_0x10052b,_0x556b77){super(_0x3a082b),this[_0x26eb('0x3')]=new _0x340cc1(_0x3a082b,_0x556b77),this[_0x26eb('0x3')][_0x26eb('0x8')]('showButtons')['to'](this[_0x26eb('0x3')][_0x26eb('0x7')],_0x26eb('0xc'),this[_0x26eb('0x3')],'value',(_0x460b4f,_0x454942)=>_0x460b4f||!!_0x454942),this['set'](_0x26eb('0x0'),!0x1),this['on'](_0x26eb('0xd'),()=>{this[_0x26eb('0x0')]&&!this['commentInputView'][_0x26eb('0x5')]&&this[_0x26eb('0x3')]['createEditor']();}),this[_0x26eb('0xa')]=new _0x51abf4(_0x3a082b,_0x10052b),this[_0x26eb('0xa')][_0x26eb('0x4')]({'attributes':{'class':_0x26eb('0x2')}}),this[_0x26eb('0x3')][_0x26eb('0x4')]({'attributes':{'class':'ck-thread__input'}}),this[_0x26eb('0x1')]({'tag':'div','attributes':{'class':['ck-comment__input-container',this[_0x26eb('0x9')]['if'](_0x26eb('0x0'),_0x26eb('0x6'))]},'children':[this[_0x26eb('0xa')],this[_0x26eb('0x3')]]});}[_0x26eb('0xb')](){return this[_0x26eb('0x3')][_0x26eb('0xb')]()[_0x26eb('0xe')](()=>super[_0x26eb('0xb')]());}}
|
|
@@ -0,0 +1,108 @@
|
|
|
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/src/collaboration-core';
|
|
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
|
+
* @readonly
|
|
37
|
+
*/
|
|
38
|
+
readonly commentThreadChildren: ViewCollection;
|
|
39
|
+
/**
|
|
40
|
+
* `ConfirmView` uses this element as a container for confirmation dialog.
|
|
41
|
+
*
|
|
42
|
+
* The element is set after `view#render()` is called.
|
|
43
|
+
*
|
|
44
|
+
* @member {HTMLElement|null} #containerElement
|
|
45
|
+
*/
|
|
46
|
+
containerElement: HTMLElement | null;
|
|
47
|
+
/**
|
|
48
|
+
* Resolve button view. Resolve button fires the 'resolveCommentThread' event when submitted.
|
|
49
|
+
*
|
|
50
|
+
* @readonly
|
|
51
|
+
*/
|
|
52
|
+
readonly resolveButton: ButtonView;
|
|
53
|
+
/**
|
|
54
|
+
* @inheritDoc
|
|
55
|
+
*/
|
|
56
|
+
constructor(locale: Locale, model: CommentThread, localUser: User, config: CommentThreadConfig);
|
|
57
|
+
/**
|
|
58
|
+
* Returns a template definition that will be passed to {@link module:ui/view~View#setTemplate}.
|
|
59
|
+
*
|
|
60
|
+
* Overwrite this method if you want to set a custom template for the comment thread view.
|
|
61
|
+
*
|
|
62
|
+
* The default template looks as follows:
|
|
63
|
+
*
|
|
64
|
+
* ```ts
|
|
65
|
+
* const bind = this.bindTemplate;
|
|
66
|
+
*
|
|
67
|
+
* {
|
|
68
|
+
* tag: 'div',
|
|
69
|
+
*
|
|
70
|
+
* attributes: {
|
|
71
|
+
* class: [
|
|
72
|
+
* 'ck-thread',
|
|
73
|
+
* bind.if( 'isActive', 'ck-thread--active' ),
|
|
74
|
+
* bind.if( 'isConfirm', 'ck-thread--remove-confirmation' ),
|
|
75
|
+
* bind.to( 'actionIndicator', value => value ? `ck-thread--${ value }` : '' )
|
|
76
|
+
* ],
|
|
77
|
+
* 'data-thread-id': this._model.id,
|
|
78
|
+
* // Needed for managing focus after adding new comment.
|
|
79
|
+
* tabindex: -1
|
|
80
|
+
* },
|
|
81
|
+
*
|
|
82
|
+
* children: [
|
|
83
|
+
* {
|
|
84
|
+
* tag: 'div',
|
|
85
|
+
* attributes: {
|
|
86
|
+
* class: 'ck-thread__container'
|
|
87
|
+
* },
|
|
88
|
+
* children: [
|
|
89
|
+
* this.commentsListView,
|
|
90
|
+
* this.commentThreadInputView
|
|
91
|
+
* ]
|
|
92
|
+
* }
|
|
93
|
+
* ]
|
|
94
|
+
* };
|
|
95
|
+
* ```
|
|
96
|
+
*
|
|
97
|
+
* See the {@glink features/collaboration/annotations/annotations-custom-view Annotation custom view guide} to learn more about
|
|
98
|
+
* the possible annotation customizations.
|
|
99
|
+
*
|
|
100
|
+
* @returns The definition of a comment thread view's template.
|
|
101
|
+
*/
|
|
102
|
+
getTemplate(): TemplateDefinition;
|
|
103
|
+
/**
|
|
104
|
+
* @inheritDoc
|
|
105
|
+
*/
|
|
106
|
+
render(): void;
|
|
107
|
+
}
|
|
108
|
+
export {};
|