@ckeditor/ckeditor5-comments 36.0.1 → 37.0.0-rc.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 _0x2ce1=['then','element','change','_initializeFocusCycling','editor','fire','document','keystrokes','disabledSubmit','ck-comment__input-actions','check','icon','createEditor','_editorCreationPromise','ck-comment__input-actions--submit','value','editorReady','div','Cancel','_editorConfig','trim','execute','ck-comment__input-actions--cancel','_createSubmitButton','listenTo','extendTemplate','bind','isEnabled','label','focus','cancel','Esc','render','low','focusNext','forEach','getData','view','stop','high','_isDestroyed','firstChild','submit','cancelButtonView','submitButtonView','shift\x20+\x20tab','_createCancelButton','Reply...','focusTracker','placeholder','model','setData','length','create','set','TOO_LONG_COMMENT_ALERT','add'];(function(_0x4ea645,_0x2ce153){const _0x2a290c=function(_0x2dd118){while(--_0x2dd118){_0x4ea645['push'](_0x4ea645['shift']());}};_0x2a290c(++_0x2ce153);}(_0x2ce1,0x1ae));const _0x2a29=function(_0x4ea645,_0x2ce153){_0x4ea645=_0x4ea645-0x0;let _0x2a290c=_0x2ce1[_0x4ea645];return _0x2a290c;};import{View as _0x51b2ea,ViewCollection as _0x4f7d9e,FocusCycler as _0x58b63a,ButtonView as _0x538096}from'ckeditor5/src/ui';import{FocusTracker as _0xf1f17d,KeystrokeHandler as _0x3041bb}from'ckeditor5/src/utils';import{icons as _0x2afc29}from'ckeditor5/src/core';import _0x46393d from'../commenteditor/commenteditor';import{getTranslation as _0xe247c8}from'../../../utils/common-translations';export default class Wt extends _0x51b2ea{constructor(_0x2df5ed,_0x2ec008={}){super(_0x2df5ed),this[_0x2a29('0x1e')]=null,this[_0x2a29('0x2d')]=_0x2ec008,this[_0x2a29('0x21')]=new _0x3041bb(),this[_0x2a29('0x11')]=new _0xf1f17d(),this[_0x2a29('0x17')]('value',_0x2ec008['initialData']||''),this['set'](_0x2a29('0x22'),!0x1),this[_0x2a29('0x17')]('showButtons',!0x0),this['set'](_0x2a29('0x12'),_0xe247c8(_0x2df5ed,_0x2a29('0x10'))),this[_0x2a29('0xd')]=this[_0x2a29('0x31')](),this[_0x2a29('0xc')]=this[_0x2a29('0xf')](),this['setTemplate']({'tag':_0x2a29('0x2b'),'attributes':{'class':['ck-comment__input-wrapper']},'children':[{'tag':_0x2a29('0x2b'),'attributes':{'class':[_0x2a29('0x23'),this['bindTemplate']['if']('showButtons','ck-comment__input-actions--active')]},'children':[this[_0x2a29('0xd')],this[_0x2a29('0xc')]]}]}),this[_0x2a29('0x21')][_0x2a29('0x17')](_0x2a29('0x0'),(_0x3481f9,_0x25d183)=>{this['cancelButtonView']['fire'](_0x2a29('0x2f')),_0x25d183();}),this['on'](_0x2a29('0xb'),(_0x49fb2b,_0x131b4c)=>{_0x131b4c[_0x2a29('0x15')]>0xfde8?(alert(_0xe247c8(_0x2df5ed,_0x2a29('0x18'),[_0x131b4c[_0x2a29('0x15')],0xfde8])),_0x49fb2b[_0x2a29('0x7')]()):this[_0x2a29('0x1e')][_0x2a29('0x14')]('');},{'priority':_0x2a29('0x8')});}[_0x2a29('0x1')](){super[_0x2a29('0x1')](),this[_0x2a29('0x21')][_0x2a29('0x32')](this[_0x2a29('0x1b')]),this['focusTracker']['add'](this['element']);}[_0x2a29('0x26')](){return this['editor']||(this[_0x2a29('0x1e')]=new _0x46393d(this[_0x2a29('0x2d')]),this[_0x2a29('0x27')]=this[_0x2a29('0x1e')][_0x2a29('0x16')]()[_0x2a29('0x1a')](()=>{if(this[_0x2a29('0x9')])return;const _0x48fe48=this[_0x2a29('0x1e')];this[_0x2a29('0x1b')]['insertBefore'](_0x48fe48['ui'][_0x2a29('0x1b')],this['element'][_0x2a29('0xa')]),_0x48fe48[_0x2a29('0x13')][_0x2a29('0x20')]['on'](_0x2a29('0x1c'),()=>this[_0x2a29('0x29')]=_0x48fe48[_0x2a29('0x5')]()),_0x48fe48['bind'](_0x2a29('0x12'))['to'](this),this[_0x2a29('0x1d')](this[_0x2a29('0x1e')]),this[_0x2a29('0x1f')](_0x2a29('0x2a'));})),this[_0x2a29('0x27')];}[_0x2a29('0x37')](){this[_0x2a29('0x1e')]&&this[_0x2a29('0x1e')][_0x2a29('0x37')]();}async['destroy'](){this[_0x2a29('0x9')]||(this[_0x2a29('0x9')]=!0x0,this[_0x2a29('0x1e')]&&(await this[_0x2a29('0x27')],await this[_0x2a29('0x1e')]['destroy']()),await super['destroy']());}['_createSubmitButton'](){const {locale:_0x5207fc}=this,_0x2a9aff=new _0x538096(_0x5207fc);return _0x2a9aff[_0x2a29('0x33')]({'attributes':{'class':[_0x2a29('0x28')]}}),_0x2a9aff[_0x2a29('0x36')]=_0xe247c8(_0x5207fc,'Submit'),_0x2a9aff[_0x2a29('0x25')]=_0x2afc29[_0x2a29('0x24')],_0x2a9aff['on'](_0x2a29('0x2f'),()=>{this['fire'](_0x2a29('0xb'),this[_0x2a29('0x29')]);}),_0x2a9aff[_0x2a29('0x34')](_0x2a29('0x35'))['to'](this,'value',this,_0x2a29('0x22'),(_0x164fba,_0x4445ad)=>!_0x4445ad&&!!_0x164fba[_0x2a29('0x2e')]()),_0x2a9aff;}[_0x2a29('0xf')](){const {locale:_0x3ec8ad}=this,_0x15598e=new _0x538096(_0x3ec8ad);return _0x15598e['extendTemplate']({'attributes':{'class':[_0x2a29('0x30')]}}),_0x15598e[_0x2a29('0x36')]=_0xe247c8(_0x3ec8ad,_0x2a29('0x2c')),_0x15598e[_0x2a29('0x25')]=_0x2afc29[_0x2a29('0x38')],_0x15598e['on']('execute',()=>{this[_0x2a29('0x1e')][_0x2a29('0x14')](''),this[_0x2a29('0x1f')]('cancel');}),_0x15598e;}[_0x2a29('0x1d')](_0xd3991b){const _0x356cb1=this['focusTracker'],_0x1f0b49=new _0x4f7d9e();[_0xd3991b['ui'][_0x2a29('0x6')],this[_0x2a29('0xd')],this[_0x2a29('0xc')]][_0x2a29('0x4')](_0x295000=>{_0x1f0b49[_0x2a29('0x19')](_0x295000),_0x356cb1[_0x2a29('0x19')](_0x295000['element']);});const _0x33700a=new _0x58b63a({'focusables':_0x1f0b49,'focusTracker':_0x356cb1});this[_0x2a29('0x21')][_0x2a29('0x17')]('tab',(_0x591309,_0x18726a)=>{_0x33700a[_0x2a29('0x3')](),_0x18726a();},{'priority':'low'}),this[_0x2a29('0x21')][_0x2a29('0x17')](_0x2a29('0xe'),(_0x67d799,_0x15290f)=>{_0x33700a['focusPrevious'](),_0x15290f();},{'priority':_0x2a29('0x2')});}}
|
|
@@ -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 _0x4502=['EMPTY_COMMENTS_ARCHIVE','_focusables','stopPropagation','arrowright','_keystrokes','isActive','arrowdown','length','destroy','listenTo','div','setTemplate','ck-comments-archive','bindTemplate','add','ck-hidden','_focusCycler','arrowup','shift\x20+\x20tab','high','render','tab','ck-comments-archive__content','element','ck-comments-archive__header\x20','set','isEmpty','focus','_focusTracker'];(function(_0x43cd7e,_0x4502f5){const _0x93e579=function(_0x1d2ba4){while(--_0x1d2ba4){_0x43cd7e['push'](_0x43cd7e['shift']());}};_0x93e579(++_0x4502f5);}(_0x4502,0x181));const _0x93e5=function(_0x43cd7e,_0x4502f5){_0x43cd7e=_0x43cd7e-0x0;let _0x93e579=_0x4502[_0x43cd7e];return _0x93e579;};import{View as _0x217820,FocusCycler as _0x1d2737}from'ckeditor5/src/ui';import{FocusTracker as _0x5260c1,KeystrokeHandler as _0x5dc400}from'ckeditor5/src/utils';import{getTranslation as _0x1a8430}from'../../../utils/common-translations';export default class K extends _0x217820{constructor(_0x28705e,_0x26cc2c){super(_0x28705e),this[_0x93e5('0x11')](_0x93e5('0x12'),!_0x26cc2c[_0x93e5('0x1c')]),this[_0x93e5('0x14')]=new _0x5260c1(),this[_0x93e5('0x19')]=new _0x5dc400(),this['_focusables']=_0x26cc2c,this[_0x93e5('0x8')]=new _0x1d2737({'focusables':this[_0x93e5('0x16')],'focusTracker':this[_0x93e5('0x14')],'keystrokeHandler':this[_0x93e5('0x19')],'actions':{'focusPrevious':_0x93e5('0xa'),'focusNext':_0x93e5('0xd')}}),this[_0x93e5('0x1')](_0x26cc2c,_0x93e5('0x6'),()=>{this[_0x93e5('0x12')]=!0x1;}),this['listenTo'](_0x26cc2c,'remove',(_0x326d31,_0x2b4d8d)=>{_0x2b4d8d[_0x93e5('0x1a')]&&this[_0x93e5('0x13')](),_0x26cc2c[_0x93e5('0x1c')]||(this['isEmpty']=!0x0);});const _0x3f660d=this[_0x93e5('0x5')];this[_0x93e5('0x3')]({'tag':_0x93e5('0x2'),'attributes':{'dir':'auto','class':['ck',_0x93e5('0x4')],'tabindex':-0x1},'children':[{'tag':'p','attributes':{'class':[_0x93e5('0x10')]},'children':[{'text':_0x1a8430(_0x28705e,'COMMENTS_ARCHIVE')}]},{'tag':_0x93e5('0x2'),'attributes':{'class':[_0x93e5('0xe')]},'children':[{'tag':'div','children':_0x26cc2c},{'tag':'p','attributes':{'class':['ck-comments-archive__info',_0x3f660d['if'](_0x93e5('0x12'),_0x93e5('0x7'),_0x2d289a=>!_0x2d289a)]},'children':[{'text':_0x1a8430(_0x28705e,_0x93e5('0x15'))}]}]}]});}[_0x93e5('0xc')](){super[_0x93e5('0xc')](),this[_0x93e5('0x19')]['listenTo'](this[_0x93e5('0xf')]);const _0xec6b91=_0x20914e=>_0x20914e[_0x93e5('0x17')]();this[_0x93e5('0x19')][_0x93e5('0x11')](_0x93e5('0x18'),_0xec6b91),this[_0x93e5('0x19')][_0x93e5('0x11')]('arrowleft',_0xec6b91),this['_keystrokes'][_0x93e5('0x11')](_0x93e5('0x9'),_0xec6b91),this[_0x93e5('0x19')][_0x93e5('0x11')](_0x93e5('0x1b'),_0xec6b91),this[_0x93e5('0x1')](this[_0x93e5('0xf')],'selectstart',(_0x166ed8,_0xb5d26)=>{_0xb5d26['stopPropagation']();},{'priority':_0x93e5('0xb')});}[_0x93e5('0x0')](){super[_0x93e5('0x0')](),this[_0x93e5('0x14')][_0x93e5('0x0')](),this[_0x93e5('0x19')][_0x93e5('0x0')]();}[_0x93e5('0x13')](){this[_0x93e5('0xf')][_0x93e5('0x13')]();}}
|
|
@@ -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 _0x13d8=['_model','resolved','viewUid','_findOptimalIndex','editorConfig','authoredAt','get','maxCommentsWhenCollapsed','_rearrangeExpand','_calculatePosition','maxCommentCharsWhenCollapsed','delegate','_handleInfoComment','add','setTemplate','remove','locale','comments','from','CommentView','Marked\x20as\x20resolved','insert','_handleNewCommentModel','isEditMode','_handleRemoveCommentModel','expand','refreshVisibleViews','hasDirtyComment','_updateHasDirtyComment','_collapsedCommentsView','change:isActive','_shouldCollapse','commentViews','count','isActive','ck-thread__comments','change:hasDirtyComment','resolvedBy','equal','_config','delete','listenTo','focus','resolvedCommentView','formatDateTime','element','bind','_rearrangeCollapse','isResolved','createCollection','render','length','some','set','destroy','commentUpdated','visibleViews'];(function(_0x2b55b1,_0x13d868){const _0x442f0c=function(_0x21276d){while(--_0x21276d){_0x2b55b1['push'](_0x2b55b1['shift']());}};_0x442f0c(++_0x13d868);}(_0x13d8,0x11a));const _0x442f=function(_0x2b55b1,_0x13d868){_0x2b55b1=_0x2b55b1-0x0;let _0x442f0c=_0x13d8[_0x2b55b1];return _0x442f0c;};import{View as _0xae62a1}from'ckeditor5/src/ui';import{diff as _0x9ea7a0,Collection as _0xea51fb}from'ckeditor5/src/utils';import{getTranslation as _0x48380e}from'../../../utils/common-translations';import _0x749f19 from'./collapsedcommentsview';export default class vt extends _0xae62a1{constructor(_0x3b31dc,_0x3e4d5a,_0x2feddb){super(_0x3b31dc),this[_0x442f('0x38')](_0x442f('0x1e'),!0x1),this[_0x442f('0x38')](_0x442f('0x36'),_0x3e4d5a['comments'][_0x442f('0x36')]),this[_0x442f('0x38')](_0x442f('0x25'),!0x1),this[_0x442f('0x3')]=_0x3e4d5a,this[_0x442f('0x2a')]=_0x2feddb,this[_0x442f('0x23')]=this[_0x442f('0x34')](),this[_0x442f('0x2')]=this['createCollection'](),this[_0x442f('0x2e')]=null,this[_0x442f('0x20')]=new _0x749f19(_0x3b31dc),this[_0x442f('0x20')][_0x442f('0x31')](_0x442f('0x24'))['to'](this,_0x442f('0x36'),_0x27b025=>_0x27b025-this[_0x442f('0x2a')][_0x442f('0xa')]);for(const _0x3237a8 of _0x3e4d5a[_0x442f('0x14')])this[_0x442f('0x19')](_0x3237a8);this[_0x442f('0xf')](),this['listenTo'](_0x3e4d5a['comments'],_0x442f('0x10'),(_0x5bba39,_0x429f5b)=>{const _0x4eb94f=this[_0x442f('0xc')](_0x429f5b);this[_0x442f('0x36')]++,this[_0x442f('0x19')](_0x429f5b,_0x4eb94f),this[_0x442f('0x1d')]();}),this['listenTo'](_0x3e4d5a['comments'],_0x442f('0x12'),(_0x5b1249,_0x43d7f2)=>{this[_0x442f('0x36')]--,this[_0x442f('0x1b')](_0x43d7f2),this[_0x442f('0x1d')]();}),this['listenTo'](_0x3e4d5a,_0x442f('0x1'),()=>this[_0x442f('0x1d')]()),this['listenTo'](_0x3e4d5a,'change:isResolved',()=>this['_handleInfoComment']()),this['on'](_0x442f('0x21'),()=>this[_0x442f('0x1d')]()),this['on'](_0x442f('0x27'),()=>this['refreshVisibleViews']()),this[_0x442f('0x11')]({'tag':'ul','attributes':{'class':[_0x442f('0x26')]},'children':this[_0x442f('0x2')]});}get[_0x442f('0x22')](){return this[_0x442f('0x3')]['weight']>this[_0x442f('0x2a')]['maxThreadTotalWeight']&&!this[_0x442f('0x25')]&&!this['hasDirtyComment'];}[_0x442f('0x35')](){super[_0x442f('0x35')](),this[_0x442f('0x1d')]();}['focus'](){this[_0x442f('0x30')][_0x442f('0x2d')]();}['destroy'](){this[_0x442f('0x20')][_0x442f('0x0')]();for(const _0x19aaa9 of this[_0x442f('0x23')])_0x19aaa9[_0x442f('0x0')]();super[_0x442f('0x0')]();}['refreshVisibleViews'](){this['_shouldCollapse']?this[_0x442f('0x32')]():this[_0x442f('0xb')]();}['_handleNewCommentModel'](_0x2b39ec,_0x1d9d3b){const _0x137468=new this[(_0x442f('0x2a'))]['CommentView'](this['locale'],_0x2b39ec,{'maxCommentCharsWhenCollapsed':this[_0x442f('0x2a')]['maxCommentCharsWhenCollapsed'],'formatDateTime':this[_0x442f('0x2a')][_0x442f('0x2f')],'editorConfig':this['_config']['editorConfig']});_0x137468[_0x442f('0x5')]=_0x2b39ec['id'],_0x137468['delegate']('removeComment')['to'](this),_0x137468[_0x442f('0xe')]('updateComment')['to'](this),_0x137468[_0x442f('0xe')]('resolveCommentThread')['to'](this),this[_0x442f('0x2c')](_0x137468,'change:isEditMode',()=>this['_updateHasDirtyComment']()),this[_0x442f('0x23')][_0x442f('0x10')](_0x137468,_0x1d9d3b);}['_calculatePosition'](_0x462d2b){const _0x215350=this[_0x442f('0x3')]['_findOptimalIndex'](_0x462d2b);return this[_0x442f('0x2e')]?this[_0x442f('0x2e')][_0x442f('0x8')]>_0x462d2b[_0x442f('0x8')]?_0x215350-0x1:_0x215350:_0x215350-0x1;}['_handleInfoComment'](){if(this['_model'][_0x442f('0x33')]){const _0x3007ef={'id':_0x442f('0x4'),'author':this[_0x442f('0x3')][_0x442f('0x28')],'authoredAt':this[_0x442f('0x3')]['resolvedAt'],'content':_0x48380e(this[_0x442f('0x13')],_0x442f('0x17')),'attributes':{}};this['resolvedCommentView']=new this['_config'][(_0x442f('0x16'))](this[_0x442f('0x13')],_0x3007ef,{'maxCommentCharsWhenCollapsed':this[_0x442f('0x2a')][_0x442f('0xd')],'formatDateTime':this[_0x442f('0x2a')][_0x442f('0x2f')],'editorConfig':this[_0x442f('0x2a')][_0x442f('0x7')],'isSystemComment':!0x0}),this[_0x442f('0x23')]['add'](this[_0x442f('0x2e')],this[_0x442f('0x3')][_0x442f('0x6')](_0x3007ef));}else this[_0x442f('0x2e')]&&(this[_0x442f('0x23')]['remove'](this[_0x442f('0x2e')]),this[_0x442f('0x2e')][_0x442f('0x0')](),this[_0x442f('0x2e')]=null);this[_0x442f('0x1d')]();}[_0x442f('0x1b')](_0x12bb25){const _0x47b5ba=this['commentViews'][_0x442f('0x12')](_0x12bb25['id']);this['stopListening'](_0x47b5ba),_0x47b5ba[_0x442f('0x1a')]&&this[_0x442f('0x1f')](),_0x47b5ba[_0x442f('0x0')]();}[_0x442f('0x1f')](){this[_0x442f('0x1e')]=Array[_0x442f('0x15')](this[_0x442f('0x23')])[_0x442f('0x37')](_0x3a8559=>_0x3a8559[_0x442f('0x1a')]);}[_0x442f('0x32')](){const _0x24438c=function(_0x21b8df){const _0x256e57=new _0xea51fb();for(const _0x517229 of _0x21b8df)_0x256e57['add'](_0x517229);return _0x256e57;}(this[_0x442f('0x23')]),_0x79fa3=this[_0x442f('0x20')]['count'];for(let _0x5a5cc6=0x1;_0x5a5cc6<=_0x79fa3;_0x5a5cc6++)_0x24438c[_0x442f('0x12')](0x1);for(const _0x13c022 of _0x24438c)_0x13c022['collapse']();_0x79fa3>0x0&&_0x24438c[_0x442f('0x10')](this[_0x442f('0x20')],0x1),ss(_0x9ea7a0(Array[_0x442f('0x15')](this[_0x442f('0x2')]),Array[_0x442f('0x15')](_0x24438c)),this[_0x442f('0x2')],_0x24438c);}[_0x442f('0xb')](){ss(_0x9ea7a0(Array['from'](this[_0x442f('0x2')]),Array[_0x442f('0x15')](this['commentViews'])),this[_0x442f('0x2')],this[_0x442f('0x23')]);for(const _0x3e5e91 of this[_0x442f('0x2')])_0x3e5e91[_0x442f('0x1c')]();}}function ss(_0x55f890,_0x312aa0,_0x56279a){let _0x3905e5=0x0;for(const _0x3af663 of _0x55f890)switch(_0x3af663){case _0x442f('0x18'):_0x312aa0['add'](_0x56279a[_0x442f('0x9')](_0x3905e5),_0x3905e5),_0x3905e5++;break;case _0x442f('0x2b'):_0x312aa0['remove'](_0x3905e5);break;case _0x442f('0x29'):_0x3905e5++;}}
|
|
@@ -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 _0x35ef=['bindTemplate','contextValue','remove','value','div','_model','ck-context-wrapper','.ck-context','classList','...','querySelector','scrollWidth','_trimContextValue','ck-context','ck-thread__header','element','_attachContextActions','lastIndexOf','mouseleave','execute','tooltip','reopenButtonView','isResolvable','substring','isVisible','ck-annotation__actions','locale','label','fire','add','Reopen','Comment\x20was\x20made\x20on\x20an\x20element','ck-context--quotes','icon','_createReopenButton','render','bind','.ck-context__value'];(function(_0x1dec27,_0x35ef9b){const _0x34f77f=function(_0x3c564b){while(--_0x3c564b){_0x1dec27['push'](_0x1dec27['shift']());}};_0x34f77f(++_0x35ef9b);}(_0x35ef,0xe1));const _0x34f7=function(_0x1dec27,_0x35ef9b){_0x1dec27=_0x1dec27-0x0;let _0x34f77f=_0x35ef[_0x1dec27];return _0x34f77f;};import{View as _0x2d26a7,ButtonView as _0x2923af}from'ckeditor5/src/ui';import{getTranslation as _0x53564d}from'../../../utils/common-translations';import _0x86fc85 from'../../../../theme/icons/undo.svg';export const MAX_CONTENT_LENGTH=0x96;export default class Tt extends _0x2d26a7{constructor(_0x1e619a,_0x2a9a3b){super(_0x1e619a);const _0x562c8f=this[_0x34f7('0x3')];this[_0x34f7('0x8')]=_0x2a9a3b,this[_0x34f7('0x18')]=this[_0x34f7('0x25')](),this[_0x34f7('0x1')]('hasContext')['to'](this[_0x34f7('0x8')],'context',_0x3f3dc6=>!!_0x3f3dc6),this[_0x34f7('0x1')](_0x34f7('0x4'))['to'](this['_model'],'context',_0x48138e=>_0x48138e&&_0x48138e[_0x34f7('0x6')]?this[_0x34f7('0xf')](_0x48138e['value']):_0x53564d(this[_0x34f7('0x1d')],_0x34f7('0x22'))),this['setTemplate']({'tag':_0x34f7('0x7'),'attributes':{'class':[_0x34f7('0x11')]},'children':[{'tag':_0x34f7('0x7'),'attributes':{'class':[_0x34f7('0x9')]},'children':[{'tag':_0x34f7('0x7'),'attributes':{'class':[_0x34f7('0x10'),_0x562c8f['if']('hasContext',_0x34f7('0x23'))]},'children':[{'tag':'span','attributes':{'class':['ck-context__value']},'children':[{'text':_0x562c8f['to']('contextValue')}]}]}]},{'tag':_0x34f7('0x7'),'attributes':{'class':[_0x34f7('0x1c')]},'children':[this[_0x34f7('0x18')]]}]});}[_0x34f7('0x0')](){super[_0x34f7('0x0')](),this[_0x34f7('0x13')]();}[_0x34f7('0x25')](){const _0x10784c=new _0x2923af(this['locale']);return _0x10784c[_0x34f7('0x1e')]=_0x53564d(this[_0x34f7('0x1d')],_0x34f7('0x21')),_0x10784c[_0x34f7('0x17')]=_0x53564d(this[_0x34f7('0x1d')],_0x34f7('0x21')),_0x10784c[_0x34f7('0x24')]=_0x86fc85,_0x10784c[_0x34f7('0x1')](_0x34f7('0x1b'))['to'](this['_model'],_0x34f7('0x19')),_0x10784c['on'](_0x34f7('0x16'),()=>{this[_0x34f7('0x1f')]('reopenCommentThread',this[_0x34f7('0x8')]['id']);}),_0x10784c;}[_0x34f7('0xf')](_0x1d4fc5){if(_0x1d4fc5['length']<0x96)return _0x1d4fc5;const _0x2fc4a8=_0x1d4fc5[_0x34f7('0x14')]('\x20',0x93);return _0x1d4fc5[_0x34f7('0x1a')](0x0,_0x2fc4a8>-0x1?_0x2fc4a8:0x93)+_0x34f7('0xc');}[_0x34f7('0x13')](){const _0x26e464=this[_0x34f7('0x12')][_0x34f7('0xd')](_0x34f7('0xa')),_0x2f01fb=_0x26e464['querySelector'](_0x34f7('0x2'));this['listenTo'](_0x26e464,'mouseenter',()=>{_0x2f01fb['offsetWidth']<_0x2f01fb[_0x34f7('0xe')]&&_0x26e464[_0x34f7('0xb')][_0x34f7('0x20')]('overlay');}),this['listenTo'](_0x26e464,_0x34f7('0x15'),()=>{_0x26e464[_0x34f7('0xb')][_0x34f7('0x5')]('overlay');});}}
|
|
@@ -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 _0x59e0=['value','ck-thread__input','showInput','editor','set','commentInputView','ck-comment__input-container','isFocused','extendTemplate','ck-comment__input-container--active','change:showInput','setTemplate','showButtons','ck-thread__user','bind','bindTemplate','destroy','userView'];(function(_0x5467cd,_0x59e080){var _0x18be45=function(_0x31bef4){while(--_0x31bef4){_0x5467cd['push'](_0x5467cd['shift']());}};_0x18be45(++_0x59e080);}(_0x59e0,0x1c6));var _0x18be=function(_0x5467cd,_0x59e080){_0x5467cd=_0x5467cd-0x0;var _0x18be45=_0x59e0[_0x5467cd];return _0x18be45;};import{View as _0x2f42a6}from'ckeditor5/src/ui';import _0x2278ee from'./commentinputview';import{UserView as _0x5c0de9}from'ckeditor5-collaboration/src/collaboration-core';export default class wt extends _0x2f42a6{constructor(_0xfe40ca,_0x3fe03b,_0x15fedc){super(_0xfe40ca),this[_0x18be('0x1')]=new _0x2278ee(_0xfe40ca,_0x15fedc),this[_0x18be('0x1')][_0x18be('0xa')](_0x18be('0x8'))['to'](this[_0x18be('0x1')]['focusTracker'],_0x18be('0x3'),this['commentInputView'],_0x18be('0xe'),(_0x2f376f,_0x257941)=>_0x2f376f||!!_0x257941),this[_0x18be('0x0')](_0x18be('0x10'),!0x1),this['on'](_0x18be('0x6'),()=>{this['showInput']&&!this[_0x18be('0x1')][_0x18be('0x11')]&&this['commentInputView']['createEditor']();}),this[_0x18be('0xd')]=new _0x5c0de9(_0xfe40ca,_0x3fe03b),this[_0x18be('0xd')][_0x18be('0x4')]({'attributes':{'class':_0x18be('0x9')}}),this[_0x18be('0x1')][_0x18be('0x4')]({'attributes':{'class':_0x18be('0xf')}}),this[_0x18be('0x7')]({'tag':'div','attributes':{'class':[_0x18be('0x2'),this[_0x18be('0xb')]['if']('showInput',_0x18be('0x5'))]},'children':[this['userView'],this['commentInputView']]});}['destroy'](){return this[_0x18be('0x1')][_0x18be('0xc')]()['then'](()=>super[_0x18be('0xc')]());}}
|
|
@@ -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 {};
|