@ckeditor/ckeditor5-track-changes 39.0.2 → 40.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/LICENSE.md +1 -1
- package/README.md +1 -1
- package/build/track-changes.js +1 -1
- package/package.json +3 -3
- package/src/augmentation.d.ts +40 -40
- package/src/commands/acceptsuggestioncommand.d.ts +24 -24
- package/src/commands/acceptsuggestioncommand.js +1 -1
- package/src/commands/discardsuggestioncommand.d.ts +24 -24
- package/src/commands/discardsuggestioncommand.js +1 -1
- package/src/commands/executeonallsuggestionscommand.d.ts +24 -24
- package/src/commands/executeonallsuggestionscommand.js +1 -1
- package/src/commands/executeonselectedsuggestionscommand.d.ts +24 -24
- package/src/commands/executeonselectedsuggestionscommand.js +1 -1
- package/src/commands/trackchangescommand.d.ts +26 -26
- package/src/commands/trackchangescommand.js +1 -1
- package/src/index.d.ts +16 -16
- package/src/integrations/aiassistant.d.ts +17 -0
- package/src/integrations/aiassistant.js +23 -0
- package/src/integrations/alignment.d.ts +17 -17
- package/src/integrations/alignment.js +1 -1
- package/src/integrations/basicstyles.d.ts +17 -17
- package/src/integrations/basicstyles.js +1 -1
- package/src/integrations/blockquote.d.ts +17 -17
- package/src/integrations/blockquote.js +1 -1
- package/src/integrations/ckbox.d.ts +17 -17
- package/src/integrations/ckbox.js +1 -1
- package/src/integrations/codeblock.d.ts +17 -17
- package/src/integrations/codeblock.js +1 -1
- package/src/integrations/comments.d.ts +14 -14
- package/src/integrations/comments.js +1 -1
- package/src/integrations/deletecommand.d.ts +17 -17
- package/src/integrations/deletecommand.js +1 -1
- package/src/integrations/documentlist.d.ts +17 -17
- package/src/integrations/documentlist.js +1 -1
- package/src/integrations/documentlistproperties.d.ts +29 -29
- package/src/integrations/documentlistproperties.js +1 -1
- package/src/integrations/entercommand.d.ts +16 -16
- package/src/integrations/entercommand.js +1 -1
- package/src/integrations/findandreplace.d.ts +21 -21
- package/src/integrations/findandreplace.js +1 -1
- package/src/integrations/font.d.ts +17 -17
- package/src/integrations/font.js +1 -1
- package/src/integrations/formatpainter.d.ts +17 -17
- package/src/integrations/formatpainter.js +1 -1
- package/src/integrations/heading.d.ts +17 -17
- package/src/integrations/heading.js +1 -1
- package/src/integrations/highlight.d.ts +17 -17
- package/src/integrations/highlight.js +1 -1
- package/src/integrations/horizontalline.d.ts +17 -17
- package/src/integrations/horizontalline.js +1 -1
- package/src/integrations/htmlembed.d.ts +17 -17
- package/src/integrations/htmlembed.js +1 -1
- package/src/integrations/image.d.ts +17 -17
- package/src/integrations/image.js +1 -1
- package/src/integrations/imagereplace.d.ts +23 -23
- package/src/integrations/imagereplace.js +1 -1
- package/src/integrations/importword.d.ts +18 -18
- package/src/integrations/importword.js +1 -1
- package/src/integrations/indent.d.ts +17 -17
- package/src/integrations/indent.js +1 -1
- package/src/integrations/inputcommand.d.ts +16 -16
- package/src/integrations/inputcommand.js +1 -1
- package/src/integrations/link.d.ts +17 -17
- package/src/integrations/link.js +1 -1
- package/src/integrations/list.d.ts +17 -17
- package/src/integrations/list.js +1 -1
- package/src/integrations/listproperties.d.ts +29 -29
- package/src/integrations/listproperties.js +1 -1
- package/src/integrations/mediaembed.d.ts +17 -17
- package/src/integrations/mediaembed.js +1 -1
- package/src/integrations/mention.d.ts +17 -17
- package/src/integrations/mention.js +1 -1
- package/src/integrations/pagebreak.d.ts +17 -17
- package/src/integrations/pagebreak.js +1 -1
- package/src/integrations/paragraph.d.ts +17 -17
- package/src/integrations/paragraph.js +1 -1
- package/src/integrations/removeformat.d.ts +17 -17
- package/src/integrations/removeformat.js +1 -1
- package/src/integrations/restrictededitingmode.d.ts +17 -17
- package/src/integrations/restrictededitingmode.js +1 -1
- package/src/integrations/shiftentercommand.d.ts +16 -16
- package/src/integrations/shiftentercommand.js +1 -1
- package/src/integrations/standardeditingmode.d.ts +17 -17
- package/src/integrations/standardeditingmode.js +1 -1
- package/src/integrations/style.d.ts +18 -18
- package/src/integrations/style.js +1 -1
- package/src/integrations/table.d.ts +42 -42
- package/src/integrations/table.js +1 -1
- package/src/integrations/tablecaption.d.ts +22 -22
- package/src/integrations/tablecaption.js +1 -1
- package/src/integrations/tableclipboard.d.ts +19 -19
- package/src/integrations/tableclipboard.js +1 -1
- package/src/integrations/tablecolumnresize.d.ts +26 -26
- package/src/integrations/tablecolumnresize.js +1 -1
- package/src/integrations/tableheadings.d.ts +22 -22
- package/src/integrations/tableheadings.js +1 -1
- package/src/integrations/tablemergesplit.d.ts +22 -22
- package/src/integrations/tablemergesplit.js +1 -1
- package/src/integrations/tableofcontents.d.ts +17 -17
- package/src/integrations/tableofcontents.js +1 -1
- package/src/integrations/tableproperties.d.ts +27 -27
- package/src/integrations/tableproperties.js +1 -1
- package/src/integrations/template.d.ts +17 -17
- package/src/integrations/template.js +1 -1
- package/src/integrations/title.d.ts +17 -17
- package/src/integrations/title.js +1 -1
- package/src/integrations/undo.d.ts +17 -17
- package/src/integrations/undo.js +1 -1
- package/src/integrations/utils.d.ts +21 -21
- package/src/integrations/utils.js +1 -1
- package/src/suggestion.d.ts +276 -276
- package/src/suggestion.js +1 -1
- package/src/suggestiondescriptionfactory.d.ts +163 -163
- package/src/suggestiondescriptionfactory.js +1 -1
- package/src/trackchanges.d.ts +244 -244
- package/src/trackchanges.js +1 -1
- package/src/trackchangesconfig.d.ts +75 -75
- package/src/trackchangesdata.d.ts +41 -41
- package/src/trackchangesdata.js +1 -1
- package/src/trackchangesediting.d.ts +468 -467
- package/src/trackchangesediting.js +1 -1
- package/src/trackchangesui.d.ts +38 -38
- package/src/trackchangesui.js +1 -1
- package/src/ui/suggestioncontroller.d.ts +37 -37
- package/src/ui/suggestioncontroller.js +1 -1
- package/src/ui/view/basesuggestionthreadview.d.ts +170 -170
- package/src/ui/view/basesuggestionthreadview.js +1 -1
- package/src/ui/view/suggestionthreadview.d.ts +182 -182
- package/src/ui/view/suggestionthreadview.js +1 -1
- package/src/utils/common-translations.d.ts +9 -9
- package/src/utils/common-translations.js +1 -1
- package/src/utils/utils.d.ts +30 -30
- package/src/utils/utils.js +1 -1
- package/theme/icons/track-changes-accept.svg +1 -1
- package/theme/icons/track-changes-discard.svg +1 -1
- package/theme/icons/track-changes.svg +1 -1
package/src/trackchangesui.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const _0x8d8a=['some','addComment','arrowView','size','listenTo','CommentsUI','TrackChangesEditing','Discard\x20all\x20suggestions','getDescriptions','switchbutton','mainView','plugins','_unbindEditors','getMarkerNames','editing','getByInnerView','stopListening','push','createAnnotation','isInContent','Discard\x20all\x20selected\x20suggestions','getRanges','SuggestionThreadView','_handleSuggestionControllerDelayed','hasSuggestion','isDirty','suggestion-','suggestionLoaded','bind','_handleControllerBuffer','destroy','suggestionChanged','buttonView','EditorAnnotations','length','config','_suggestionToController','comments.editorConfig','delete','Track\x20changes','_annotationViews','activeAnnotations','define','lowest','focus','view','_updateController','actionView','type','_initializeController','commands','innerView','value','add','comments','head','map','toMany','separator','execute','acceptSelectedSuggestions','change:previous','TrackChangesUI','isOn','descriptionParts','addSourceCollector','createCommentThreadController','has','editor','discardButton','discardAllSuggestions','discardSelectedSuggestions','from','comments.maxThreadTotalWeight','unbind','commentThread','Accept\x20all\x20selected\x20suggestions','source','Annotations','get','CommentsRepository','trackChanges.disableComments','trackChanges','getJoined','_destroyController','_refreshActiveMarkers','keys','filter','locale','_descriptionFactory','componentFactory','refreshSelectedViews','registerAnnotation','getAllAdjacentSuggestions','model','button','getMarkers','commandName','_viewToController','activeMarkers','set','previous','isEnabled','_createUIButton'];(function(_0x37bf01,_0x8d8ad5){const _0x4ee02d=function(_0x263487){while(--_0x263487){_0x37bf01['push'](_0x37bf01['shift']());}};_0x4ee02d(++_0x8d8ad5);}(_0x8d8a,0x14e));const _0x4ee0=function(_0x37bf01,_0x8d8ad5){_0x37bf01=_0x37bf01-0x0;let _0x4ee02d=_0x8d8a[_0x37bf01];return _0x4ee02d;};import{Plugin as _0xbaaed1}from'ckeditor5/src/core';import{Collection as _0x3cf74f}from'ckeditor5/src/utils';import{Model as _0x326b34,SplitButtonView as _0x525d9f,createDropdown as _0x5373c7,addListToDropdown as _0x329a8a}from'ckeditor5/src/ui';import{Users as _0xf90181,getDateTimeFormatter as _0x5e25f7,getAllMarkersDomElementsSorted as _0x3ccda7}from'ckeditor5-collaboration/src/collaboration-core';import _0x5afaf1 from'./trackchangesediting';import _0x5e206b from'./ui/suggestioncontroller';import _0x55a6e2 from'./ui/view/suggestionthreadview';import{getTranslation as _0x5a85b5}from'./utils/common-translations';import _0x2365d0 from'../theme/icons/track-changes.svg';export default class d extends _0xbaaed1{static get['requires'](){return[_0x5afaf1,_0xf90181,_0x4ee0('0x3a'),_0x4ee0('0x38'),_0x4ee0('0xb')];}static get['pluginName'](){return _0x4ee0('0x28');}constructor(_0x460511){super(_0x460511),this[_0x4ee0('0xe')]=new Map(),this[_0x4ee0('0x4c')]=new Map(),this[_0x4ee0('0x12')]=new Map(),this[_0x4ee0('0x7')]=new Map();const _0x188681=this[_0x4ee0('0x2e')][_0x4ee0('0xd')];_0x188681[_0x4ee0('0x14')]('trackChanges.SuggestionThreadView',_0x55a6e2),_0x188681[_0x4ee0('0x14')](_0x4ee0('0x3b'),!0x1),this['_disableComments']=_0x188681[_0x4ee0('0x39')](_0x4ee0('0x3b'));}['_handleSuggestionControllerDelayed'](_0x559e4c,_0xe3dab0){0x0===this[_0x4ee0('0x7')][_0x4ee0('0x55')]&&setTimeout(()=>{for(const [_0x6713fb,_0x228290]of this['_handleControllerBuffer']){const _0x20b590=this['_suggestionToController'][_0x4ee0('0x2d')](_0x6713fb);_0x20b590||_0x228290?_0x20b590&&_0x228290&&this['_destroyController'](_0x6713fb):this[_0x4ee0('0x1b')](_0x6713fb);}this[_0x4ee0('0x2e')][_0x4ee0('0x5d')][_0x4ee0('0x39')](_0x4ee0('0xb'))[_0x4ee0('0x45')](),this[_0x4ee0('0x3f')](),this[_0x4ee0('0x7')]['clear']();},0xa),this[_0x4ee0('0x7')]['set'](_0x559e4c,_0xe3dab0);}['init'](){const _0x20c4f8=this[_0x4ee0('0x2e')],_0x48f899=_0x20c4f8[_0x4ee0('0x5d')]['get'](_0x4ee0('0x58')),_0x5d486f=_0x20c4f8[_0x4ee0('0x5d')][_0x4ee0('0x39')](_0x4ee0('0x38')),_0x257be5=_0x20c4f8['plugins'][_0x4ee0('0x39')](_0x4ee0('0xb')),_0x4d3c42=_0x20c4f8[_0x4ee0('0x5d')][_0x4ee0('0x39')](_0x4ee0('0x3a'));_0x20c4f8['ui'][_0x4ee0('0x44')][_0x4ee0('0x1f')](_0x4ee0('0x3c'),_0x8cce95=>this[_0x4ee0('0x51')](_0x8cce95)),_0x257be5[_0x4ee0('0x2b')](()=>{const _0x1df0f7=[];for(const [_0x1f0008,_0x496d3b]of Array[_0x4ee0('0x32')](this[_0x4ee0('0xe')])){const _0x27ecfc=_0x1f0008['getAllAdjacentSuggestions'](),_0x8f12e6=[];for(const _0x5c30dd of _0x27ecfc){if(!_0x5c30dd[_0x4ee0('0x65')])continue;if(_0x5c30dd['isMultiRange']){_0x8f12e6['push'](..._0x5c30dd[_0x4ee0('0x67')]());continue;}const _0x58a724=_0x5c30dd['getFirstRange']();if(_0x8f12e6['length']>0x0){const _0x5f5ac0=_0x8f12e6[0x0][_0x4ee0('0x3d')](_0x58a724);if(_0x5f5ac0){_0x8f12e6[0x0]=_0x5f5ac0;continue;}}_0x8f12e6[_0x4ee0('0x63')](_0x58a724);}_0x1df0f7[_0x4ee0('0x63')]([_0x496d3b[_0x4ee0('0x17')],_0x8f12e6]);}return _0x1df0f7;}),this[_0x4ee0('0x56')](_0x48f899,_0x4ee0('0x5'),(_0x6586f4,_0x21192e)=>{this[_0x4ee0('0x56')](_0x21192e,_0x4ee0('0x27'),(_0x30a7b0,_0xae2e66,_0x3aacde,_0x510c64)=>{_0x21192e['isInContent']&&(null==_0x3aacde?(this['_updateController'](_0x510c64[_0x4ee0('0x21')]),this[_0x4ee0('0x1')](_0x21192e,!0x1)):(this[_0x4ee0('0x18')](_0x3aacde['head']),this['_handleSuggestionControllerDelayed'](_0x21192e,!0x0)));}),null===_0x21192e[_0x4ee0('0x4f')]?this['_handleSuggestionControllerDelayed'](_0x21192e,!0x1):this[_0x4ee0('0x18')](_0x21192e[_0x4ee0('0x21')]);}),this[_0x4ee0('0x56')](_0x48f899,'suggestionUnloaded',(_0x23a6fc,_0x1fac39,_0xa9d706)=>{this[_0x4ee0('0x62')](_0x1fac39,_0x4ee0('0x27')),this[_0x4ee0('0x7')][_0x4ee0('0x10')](_0x1fac39);const _0x2a5278=_0xa9d706?_0xa9d706[_0x4ee0('0x21')]:_0x1fac39,_0x1e0c21=this[_0x4ee0('0xe')][_0x4ee0('0x39')](_0x2a5278);null!==_0xa9d706&&this[_0x4ee0('0x18')](_0x2a5278),null===_0xa9d706&&_0x1e0c21&&this[_0x4ee0('0x3e')](_0x1fac39);}),this['listenTo'](_0x48f899,_0x4ee0('0x9'),(_0x42c964,_0x1c5c2a)=>{this[_0x4ee0('0x18')](_0x1c5c2a);}),this[_0x4ee0('0x56')](_0x5d486f,'change:activeAnnotations',()=>{this[_0x4ee0('0x3f')]();}),this[_0x4ee0('0x56')](_0x4d3c42,_0x4ee0('0x53'),(_0x470bfe,{threadId:_0x38be82,isFromAdapter:_0x1cc0b5})=>{if(_0x1cc0b5||!_0x48f899[_0x4ee0('0x2')](_0x38be82))return;const _0x3ba74b=_0x48f899['getSuggestion'](_0x38be82);this['_suggestionToController'][_0x4ee0('0x39')](_0x3ba74b)['view'][_0x4ee0('0x16')]();},{'priority':_0x4ee0('0x15')});}[_0x4ee0('0x3f')](){const _0x2851e6=this[_0x4ee0('0x2e')]['plugins'][_0x4ee0('0x39')](_0x4ee0('0x38')),_0x64fa03=this[_0x4ee0('0x2e')][_0x4ee0('0x5d')][_0x4ee0('0x39')](_0x4ee0('0x58')),_0x2a4822=Array['from'](_0x2851e6[_0x4ee0('0x13')],_0xd6dd4=>_0xd6dd4[_0x4ee0('0x1d')])[_0x4ee0('0x41')](_0x2d227e=>this[_0x4ee0('0x4c')][_0x4ee0('0x2d')](_0x2d227e)),_0x1373cf=[];for(const _0x241bee of _0x2a4822){const _0x4730d2=this['_viewToController']['get'](_0x241bee)[_0x4ee0('0x48')][_0x4ee0('0x47')]();_0x1373cf['push'](..._0x4730d2['reduce']((_0x129f2c,_0x32b8fa)=>[..._0x129f2c,..._0x32b8fa[_0x4ee0('0x5f')]()],[]));}_0x64fa03[_0x4ee0('0x4d')]=_0x1373cf;}[_0x4ee0('0x51')](_0x2a3630){const _0x571220=_0x5373c7(_0x2a3630,_0x525d9f),_0x5de9a8=this['editor'][_0x4ee0('0x1c')][_0x4ee0('0x39')]('trackChanges'),_0x6549ff=_0x5a85b5(_0x2a3630,_0x4ee0('0x11'));_0x571220['buttonView']['set']({'tooltip':_0x6549ff,'label':_0x6549ff,'icon':_0x2365d0}),_0x571220[_0x4ee0('0xa')]['bind'](_0x4ee0('0x29'))['to'](_0x5de9a8,_0x4ee0('0x1e')),_0x571220[_0x4ee0('0xa')]['on']('execute',()=>{_0x5de9a8['execute'](),this[_0x4ee0('0x2e')][_0x4ee0('0x60')][_0x4ee0('0x17')]['focus']();});const _0x16085b=new _0x3cf74f(),_0x59a733=[{'type':_0x4ee0('0x5b'),'model':{'withText':!0x0,'label':_0x6549ff,'commandName':'trackChanges'}},{'type':_0x4ee0('0x24')},{'type':_0x4ee0('0x49'),'model':{'withText':!0x0,'label':_0x5a85b5(_0x2a3630,'Accept\x20all\x20suggestions'),'commandName':'acceptAllSuggestions'}},{'type':_0x4ee0('0x49'),'model':{'withText':!0x0,'label':_0x5a85b5(_0x2a3630,_0x4ee0('0x36')),'commandName':_0x4ee0('0x26')}},{'type':'button','model':{'withText':!0x0,'label':_0x5a85b5(_0x2a3630,_0x4ee0('0x59')),'commandName':_0x4ee0('0x30')}},{'type':_0x4ee0('0x49'),'model':{'withText':!0x0,'label':_0x5a85b5(_0x2a3630,_0x4ee0('0x66')),'commandName':_0x4ee0('0x31')}}];for(const _0x28463e of _0x59a733){let _0x368197={'type':_0x4ee0('0x24')};if(_0x28463e[_0x4ee0('0x48')]){const _0x4af64f=new _0x326b34(_0x28463e[_0x4ee0('0x48')]),_0x50ade5=this[_0x4ee0('0x2e')][_0x4ee0('0x1c')][_0x4ee0('0x39')](_0x4af64f['commandName']);_0x4af64f['bind'](_0x4ee0('0x29'),_0x4ee0('0x50'))['to'](_0x50ade5,_0x4ee0('0x1e'),_0x4ee0('0x50')),_0x368197={'type':_0x28463e[_0x4ee0('0x1a')],'model':_0x4af64f};}_0x16085b[_0x4ee0('0x1f')](_0x368197);}_0x329a8a(_0x571220,_0x16085b);const _0x4ebc6e=_0x59a733[_0x4ee0('0x41')](_0x26a363=>null!=_0x26a363[_0x4ee0('0x48')])[_0x4ee0('0x22')](_0x51008a=>this['editor']['commands'][_0x4ee0('0x39')](_0x51008a[_0x4ee0('0x48')][_0x4ee0('0x4b')])),_0x4e7223=_0x571220[_0x4ee0('0xa')];return _0x4e7223[_0x4ee0('0x19')]['unbind'](_0x4ee0('0x50')),_0x4e7223['arrowView'][_0x4ee0('0x34')](_0x4ee0('0x50')),_0x4e7223['actionView']['bind'](_0x4ee0('0x50'))['to'](_0x5de9a8,_0x4ee0('0x50')),_0x4e7223[_0x4ee0('0x54')][_0x4ee0('0x6')](_0x4ee0('0x50'))[_0x4ee0('0x23')](_0x4ebc6e,_0x4ee0('0x50'),(..._0xb93840)=>_0xb93840[_0x4ee0('0x52')](_0xce44ce=>_0xce44ce)),_0x571220['on'](_0x4ee0('0x25'),_0x484897=>{this['editor'][_0x4ee0('0x25')](_0x484897[_0x4ee0('0x37')][_0x4ee0('0x4b')]),this[_0x4ee0('0x2e')][_0x4ee0('0x60')]['view']['focus']();}),_0x571220;}[_0x4ee0('0x1b')](_0x505b18){const _0x34da10=this[_0x4ee0('0x2e')],_0x2c6b29=_0x34da10['config'],_0x5d61ed=_0x34da10[_0x4ee0('0x5d')]['get'](_0x4ee0('0x38')),_0x255c42=_0x34da10['plugins'][_0x4ee0('0x39')]('CommentsRepository'),_0x36a63c=_0x34da10[_0x4ee0('0x5d')][_0x4ee0('0x39')](_0x4ee0('0xb')),_0x4d9b92=_0x34da10[_0x4ee0('0x5d')][_0x4ee0('0x39')](_0xf90181)['me'],_0x2888d4=_0x2c6b29[_0x4ee0('0x39')]('trackChanges')[_0x4ee0('0x0')],{CommentsListView:_0x278154,CommentThreadInputView:_0x430d92}=_0x34da10['plugins'][_0x4ee0('0x39')](_0x4ee0('0x57'));let _0x1cf409,_0x1091f4;this[_0x4ee0('0x12')]['has'](_0x505b18['id'])?(_0x1091f4=this[_0x4ee0('0x12')][_0x4ee0('0x39')](_0x505b18['id']),_0x1cf409=_0x1091f4[_0x4ee0('0x5c')]):(_0x1cf409=new _0x2888d4(_0x34da10[_0x4ee0('0x42')],_0x505b18,_0x4d9b92,{'disableComments':this['_disableComments'],'editorConfig':_0x2c6b29[_0x4ee0('0x39')](_0x4ee0('0xf')),'maxCommentsWhenCollapsed':_0x2c6b29[_0x4ee0('0x39')]('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x2c6b29[_0x4ee0('0x39')](_0x4ee0('0x33')),'maxCommentCharsWhenCollapsed':_0x2c6b29[_0x4ee0('0x39')]('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x5e25f7(_0x2c6b29[_0x4ee0('0x39')](_0x4ee0('0x42'))),'CommentView':_0x2c6b29[_0x4ee0('0x39')](_0x4ee0('0x20'))['CommentView'],'CommentsListView':_0x278154,'CommentThreadInputView':_0x430d92}),_0x1cf409['acceptButton']['on'](_0x4ee0('0x25'),()=>{_0x34da10[_0x4ee0('0x60')][_0x4ee0('0x17')]['focus']();}),_0x1cf409[_0x4ee0('0x2f')]['on']('execute',()=>{_0x34da10[_0x4ee0('0x60')][_0x4ee0('0x17')][_0x4ee0('0x16')]();}),_0x1091f4=_0x5d61ed['createAnnotationView'](this['editor'][_0x4ee0('0x42')],_0x1cf409),_0x1091f4['bind'](_0x4ee0('0x3'))['to'](_0x1cf409,'isDirty'),_0x1091f4[_0x4ee0('0x6')](_0x4ee0('0xc'))['to'](_0x1cf409),_0x1091f4[_0x4ee0('0x6')]('type')['to'](_0x1cf409,_0x4ee0('0x1a'),_0x367f54=>_0x4ee0('0x4')+_0x367f54),this[_0x4ee0('0x12')]['set'](_0x505b18['id'],_0x1091f4));const _0x79c1b8=_0x255c42[_0x4ee0('0x2c')](_0x505b18[_0x4ee0('0x35')],_0x1cf409),_0x72d30b=new _0x5e206b(_0x34da10,_0x505b18,_0x1cf409,_0x79c1b8),_0x22e066=_0x505b18[_0x4ee0('0x47')]()[_0x4ee0('0x41')](_0x39e136=>_0x39e136[_0x4ee0('0x65')]);_0x1cf409[_0x4ee0('0x2a')]=_0x34da10['plugins'][_0x4ee0('0x39')]('TrackChangesEditing')[_0x4ee0('0x43')][_0x4ee0('0x5a')](_0x22e066),this[_0x4ee0('0xe')][_0x4ee0('0x4e')](_0x505b18,_0x72d30b),this[_0x4ee0('0x4c')][_0x4ee0('0x4e')](_0x1cf409,_0x72d30b);const _0x1940e8=_0x5d61ed[_0x4ee0('0x64')]({'view':_0x1091f4,'target':()=>{const _0x296fde=[],_0x38a0dd=_0x505b18[_0x4ee0('0x47')]()['filter'](_0x4e2a8e=>_0x4e2a8e[_0x4ee0('0x65')]);for(const _0x5af694 of _0x38a0dd)_0x296fde[_0x4ee0('0x63')](..._0x5af694[_0x4ee0('0x4a')]());return _0x3ccda7(_0x34da10[_0x4ee0('0x60')],_0x296fde);},'type':()=>_0x4ee0('0x4')+_0x72d30b[_0x4ee0('0x17')]['type']});_0x255c42['_bindAnnotationToEditors'](_0x1cf409,_0x1940e8),_0x5d61ed[_0x4ee0('0x1f')](_0x1940e8),_0x36a63c[_0x4ee0('0x46')](_0x1940e8);}[_0x4ee0('0x3e')](_0x195488){const _0x44db2b=this[_0x4ee0('0x2e')][_0x4ee0('0x5d')][_0x4ee0('0x39')](_0x4ee0('0x3a')),_0x119bc6=this[_0x4ee0('0x2e')][_0x4ee0('0x5d')]['get'](_0x4ee0('0x38')),_0x2e4b18=this['_suggestionToController'][_0x4ee0('0x39')](_0x195488),_0x3d1b52=_0x2e4b18[_0x4ee0('0x17')],_0x2dd69c=_0x119bc6[_0x4ee0('0x61')](_0x3d1b52);_0x44db2b[_0x4ee0('0x5e')](_0x3d1b52),_0x2dd69c&&_0x119bc6['remove'](_0x2dd69c),this[_0x4ee0('0xe')][_0x4ee0('0x10')](_0x195488),this['_viewToController'][_0x4ee0('0x10')](_0x3d1b52),_0x2e4b18[_0x4ee0('0x8')]();}[_0x4ee0('0x18')](_0x27df8a){if(!_0x27df8a[_0x4ee0('0x65')]||!this[_0x4ee0('0xe')][_0x4ee0('0x2d')](_0x27df8a))return;const _0x164afa=this[_0x4ee0('0x2e')][_0x4ee0('0x5d')][_0x4ee0('0x39')]('TrackChangesEditing'),_0x56d3f=this[_0x4ee0('0xe')][_0x4ee0('0x39')](_0x27df8a),_0x36277c=_0x27df8a[_0x4ee0('0x47')]();_0x56d3f[_0x4ee0('0x17')][_0x4ee0('0x2a')]=_0x164afa[_0x4ee0('0x43')][_0x4ee0('0x5a')](_0x36277c);}[_0x4ee0('0x8')](){for(const _0x23a002 of this[_0x4ee0('0xe')][_0x4ee0('0x40')]())this['_destroyController'](_0x23a002);for(const _0x2cc824 of this['_annotationViews']['values']())_0x2cc824[_0x4ee0('0x5c')][_0x4ee0('0x8')]();super[_0x4ee0('0x8')]();}}
|
|
23
|
+
const _0x34e4=['map','mainView','createAnnotationView','size','model','trackChanges.disableComments','suggestionLoaded','commentThread','commands','source','refreshSelectedViews','get','getJoined','separator','commandName','acceptSelectedSuggestions','_createUIButton','trackChanges.SuggestionThreadView','CommentsRepository','discardSelectedSuggestions','set','acceptAllSuggestions','_disableComments','actionView','discardAllSuggestions','from','registerAnnotation','_unbindEditors','unbind','change:activeAnnotations','TrackChangesEditing','remove','button','some','length','_suggestionToController','descriptionParts','addComment','isInContent','getRanges','_handleControllerBuffer','pluginName','focus','getMarkerNames','editor','hasSuggestion','add','_viewToController','componentFactory','type','comments.maxThreadTotalWeight','destroy','filter','trackChanges','discardButton','_handleSuggestionControllerDelayed','suggestionChanged','_destroyController','comments','_annotationViews','locale','push','lowest','addSourceCollector','stopListening','listenTo','has','previous','_refreshActiveMarkers','bind','head','view','change:previous','arrowView','Discard\x20all\x20suggestions','SuggestionThreadView','Annotations','_descriptionFactory','init','execute','toMany','comments.maxCommentCharsWhenCollapsed','CommentView','EditorAnnotations','buttonView','suggestion-','TrackChangesUI','getAllAdjacentSuggestions','activeMarkers','innerView','switchbutton','config','Discard\x20all\x20selected\x20suggestions','Accept\x20all\x20suggestions','editing','values','_updateController','getSuggestion','isEnabled','isOn','plugins','isDirty','_initializeController','reduce','getDescriptions','createAnnotation','createCommentThreadController','isMultiRange','getFirstRange','Track\x20changes'];(function(_0x4a1a0f,_0x34e439){const _0x3a46c5=function(_0x4fbe98){while(--_0x4fbe98){_0x4a1a0f['push'](_0x4a1a0f['shift']());}};_0x3a46c5(++_0x34e439);}(_0x34e4,0x19b));const _0x3a46=function(_0x4a1a0f,_0x34e439){_0x4a1a0f=_0x4a1a0f-0x0;let _0x3a46c5=_0x34e4[_0x4a1a0f];return _0x3a46c5;};import{Plugin as _0x354fab}from'ckeditor5/src/core';import{Collection as _0x2496a9}from'ckeditor5/src/utils';import{Model as _0x45cbd5,SplitButtonView as _0x289399,createDropdown as _0x2c763f,addListToDropdown as _0x4a9a16}from'ckeditor5/src/ui';import{Users as _0x37ecab,getDateTimeFormatter as _0x493ace,getAllMarkersDomElementsSorted as _0x58ff69}from'ckeditor5-collaboration/src/collaboration-core';import _0x5573af from'./trackchangesediting';import _0x3440d2 from'./ui/suggestioncontroller';import _0x10e235 from'./ui/view/suggestionthreadview';import{getTranslation as _0x36663f}from'./utils/common-translations';import _0x12c323 from'../theme/icons/track-changes.svg';export default class d extends _0x354fab{static get['requires'](){return[_0x5573af,_0x37ecab,_0x3a46('0x2f'),_0x3a46('0x69'),'EditorAnnotations'];}static get[_0x3a46('0x46')](){return _0x3a46('0x5');}constructor(_0x355027){super(_0x355027),this['_suggestionToController']=new Map(),this['_viewToController']=new Map(),this['_annotationViews']=new Map(),this[_0x3a46('0x45')]=new Map();const _0x3d309d=this['editor'][_0x3a46('0xa')];_0x3d309d['define'](_0x3a46('0x2e'),_0x10e235),_0x3d309d['define'](_0x3a46('0x22'),!0x1),this[_0x3a46('0x33')]=_0x3d309d['get']('trackChanges.disableComments');}[_0x3a46('0x54')](_0x4ebf7e,_0x3c7686){0x0===this[_0x3a46('0x45')][_0x3a46('0x20')]&&setTimeout(()=>{for(const [_0x1d5e03,_0x74fa2f]of this['_handleControllerBuffer']){const _0x24b770=this['_suggestionToController']['has'](_0x1d5e03);_0x24b770||_0x74fa2f?_0x24b770&&_0x74fa2f&&this[_0x3a46('0x56')](_0x1d5e03):this[_0x3a46('0x15')](_0x1d5e03);}this[_0x3a46('0x49')][_0x3a46('0x13')]['get'](_0x3a46('0x2'))[_0x3a46('0x27')](),this[_0x3a46('0x61')](),this[_0x3a46('0x45')]['clear']();},0xa),this['_handleControllerBuffer'][_0x3a46('0x31')](_0x4ebf7e,_0x3c7686);}[_0x3a46('0x6b')](){const _0x22730c=this[_0x3a46('0x49')],_0x296700=_0x22730c['plugins'][_0x3a46('0x28')](_0x3a46('0x3b')),_0x43e18e=_0x22730c[_0x3a46('0x13')][_0x3a46('0x28')]('Annotations'),_0x25e6ff=_0x22730c[_0x3a46('0x13')][_0x3a46('0x28')](_0x3a46('0x2')),_0xdb3f65=_0x22730c[_0x3a46('0x13')][_0x3a46('0x28')](_0x3a46('0x2f'));_0x22730c['ui'][_0x3a46('0x4d')][_0x3a46('0x4b')]('trackChanges',_0x2b91bb=>this['_createUIButton'](_0x2b91bb)),_0x25e6ff[_0x3a46('0x5c')](()=>{const _0x449e7c=[];for(const [_0x22b7fc,_0xa6e804]of Array[_0x3a46('0x36')](this[_0x3a46('0x40')])){const _0x7bf8c3=_0x22b7fc[_0x3a46('0x6')](),_0x4a5c81=[];for(const _0xe227ed of _0x7bf8c3){if(!_0xe227ed[_0x3a46('0x43')])continue;if(_0xe227ed[_0x3a46('0x1a')]){_0x4a5c81[_0x3a46('0x5a')](..._0xe227ed[_0x3a46('0x44')]());continue;}const _0x3452ef=_0xe227ed[_0x3a46('0x1b')]();if(_0x4a5c81[_0x3a46('0x3f')]>0x0){const _0x545d57=_0x4a5c81[0x0][_0x3a46('0x29')](_0x3452ef);if(_0x545d57){_0x4a5c81[0x0]=_0x545d57;continue;}}_0x4a5c81[_0x3a46('0x5a')](_0x3452ef);}_0x449e7c[_0x3a46('0x5a')]([_0xa6e804[_0x3a46('0x64')],_0x4a5c81]);}return _0x449e7c;}),this[_0x3a46('0x5e')](_0x296700,_0x3a46('0x23'),(_0x698e06,_0x262781)=>{this['listenTo'](_0x262781,_0x3a46('0x65'),(_0x4c0316,_0xf713be,_0x2b17fb,_0x24d57b)=>{_0x262781[_0x3a46('0x43')]&&(null==_0x2b17fb?(this['_updateController'](_0x24d57b[_0x3a46('0x63')]),this[_0x3a46('0x54')](_0x262781,!0x1)):(this['_updateController'](_0x2b17fb[_0x3a46('0x63')]),this['_handleSuggestionControllerDelayed'](_0x262781,!0x0)));}),null===_0x262781[_0x3a46('0x60')]?this[_0x3a46('0x54')](_0x262781,!0x1):this[_0x3a46('0xf')](_0x262781[_0x3a46('0x63')]);}),this[_0x3a46('0x5e')](_0x296700,'suggestionUnloaded',(_0xd1c7d2,_0xebe628,_0x2c2037)=>{this[_0x3a46('0x5d')](_0xebe628,_0x3a46('0x65')),this['_handleControllerBuffer']['delete'](_0xebe628);const _0x4fc42e=_0x2c2037?_0x2c2037['head']:_0xebe628,_0x5ad4fb=this[_0x3a46('0x40')]['get'](_0x4fc42e);null!==_0x2c2037&&this['_updateController'](_0x4fc42e),null===_0x2c2037&&_0x5ad4fb&&this['_destroyController'](_0xebe628);}),this['listenTo'](_0x296700,_0x3a46('0x55'),(_0x119a25,_0x480a3b)=>{this['_updateController'](_0x480a3b);}),this[_0x3a46('0x5e')](_0x43e18e,_0x3a46('0x3a'),()=>{this[_0x3a46('0x61')]();}),this[_0x3a46('0x5e')](_0xdb3f65,_0x3a46('0x42'),(_0x21ae57,{threadId:_0x4c5cab,isFromAdapter:_0xa0e724})=>{if(_0xa0e724||!_0x296700[_0x3a46('0x4a')](_0x4c5cab))return;const _0x341891=_0x296700[_0x3a46('0x10')](_0x4c5cab);this[_0x3a46('0x40')][_0x3a46('0x28')](_0x341891)[_0x3a46('0x64')][_0x3a46('0x47')]();},{'priority':_0x3a46('0x5b')});}[_0x3a46('0x61')](){const _0x38bff2=this[_0x3a46('0x49')][_0x3a46('0x13')][_0x3a46('0x28')]('Annotations'),_0x38cce5=this['editor'][_0x3a46('0x13')][_0x3a46('0x28')](_0x3a46('0x3b')),_0x1f4a04=Array[_0x3a46('0x36')](_0x38bff2['activeAnnotations'],_0x118e94=>_0x118e94[_0x3a46('0x8')])['filter'](_0x51ac0d=>this['_viewToController'][_0x3a46('0x5f')](_0x51ac0d)),_0x2456f2=[];for(const _0x3e65be of _0x1f4a04){const _0x4b29ad=this[_0x3a46('0x4c')][_0x3a46('0x28')](_0x3e65be)[_0x3a46('0x21')][_0x3a46('0x6')]();_0x2456f2[_0x3a46('0x5a')](..._0x4b29ad[_0x3a46('0x16')]((_0x47f075,_0x4a6aec)=>[..._0x47f075,..._0x4a6aec[_0x3a46('0x48')]()],[]));}_0x38cce5[_0x3a46('0x7')]=_0x2456f2;}[_0x3a46('0x2d')](_0x1ca1e5){const _0x43d33c=_0x2c763f(_0x1ca1e5,_0x289399),_0x33def0=this[_0x3a46('0x49')][_0x3a46('0x25')][_0x3a46('0x28')](_0x3a46('0x52')),_0x30ea1d=_0x36663f(_0x1ca1e5,_0x3a46('0x1c'));_0x43d33c[_0x3a46('0x3')][_0x3a46('0x31')]({'tooltip':_0x30ea1d,'label':_0x30ea1d,'icon':_0x12c323}),_0x43d33c[_0x3a46('0x3')]['bind'](_0x3a46('0x12'))['to'](_0x33def0,'value'),_0x43d33c[_0x3a46('0x3')]['on'](_0x3a46('0x6c'),()=>{_0x33def0['execute'](),this['editor'][_0x3a46('0xd')][_0x3a46('0x64')][_0x3a46('0x47')]();});const _0x20c016=new _0x2496a9(),_0x422281=[{'type':_0x3a46('0x9'),'model':{'withText':!0x0,'label':_0x30ea1d,'commandName':_0x3a46('0x52')}},{'type':'separator'},{'type':_0x3a46('0x3d'),'model':{'withText':!0x0,'label':_0x36663f(_0x1ca1e5,_0x3a46('0xc')),'commandName':_0x3a46('0x32')}},{'type':'button','model':{'withText':!0x0,'label':_0x36663f(_0x1ca1e5,'Accept\x20all\x20selected\x20suggestions'),'commandName':_0x3a46('0x2c')}},{'type':_0x3a46('0x3d'),'model':{'withText':!0x0,'label':_0x36663f(_0x1ca1e5,_0x3a46('0x67')),'commandName':_0x3a46('0x35')}},{'type':_0x3a46('0x3d'),'model':{'withText':!0x0,'label':_0x36663f(_0x1ca1e5,_0x3a46('0xb')),'commandName':_0x3a46('0x30')}}];for(const _0x340ee7 of _0x422281){let _0x1c83e2={'type':_0x3a46('0x2a')};if(_0x340ee7[_0x3a46('0x21')]){const _0x3655a8=new _0x45cbd5(_0x340ee7['model']),_0x524597=this[_0x3a46('0x49')][_0x3a46('0x25')][_0x3a46('0x28')](_0x3655a8[_0x3a46('0x2b')]);_0x3655a8['bind']('isOn',_0x3a46('0x11'))['to'](_0x524597,'value','isEnabled'),_0x1c83e2={'type':_0x340ee7[_0x3a46('0x4e')],'model':_0x3655a8};}_0x20c016[_0x3a46('0x4b')](_0x1c83e2);}_0x4a9a16(_0x43d33c,_0x20c016);const _0x1f546b=_0x422281[_0x3a46('0x51')](_0x43ee1d=>null!=_0x43ee1d['model'])[_0x3a46('0x1d')](_0x12b35f=>this[_0x3a46('0x49')][_0x3a46('0x25')][_0x3a46('0x28')](_0x12b35f[_0x3a46('0x21')][_0x3a46('0x2b')])),_0x5313e8=_0x43d33c['buttonView'];return _0x5313e8[_0x3a46('0x34')][_0x3a46('0x39')](_0x3a46('0x11')),_0x5313e8[_0x3a46('0x66')][_0x3a46('0x39')](_0x3a46('0x11')),_0x5313e8[_0x3a46('0x34')][_0x3a46('0x62')](_0x3a46('0x11'))['to'](_0x33def0,_0x3a46('0x11')),_0x5313e8['arrowView'][_0x3a46('0x62')](_0x3a46('0x11'))[_0x3a46('0x6d')](_0x1f546b,'isEnabled',(..._0x2a26e6)=>_0x2a26e6[_0x3a46('0x3e')](_0x29e2f7=>_0x29e2f7)),_0x43d33c['on'](_0x3a46('0x6c'),_0x1a57c9=>{this['editor'][_0x3a46('0x6c')](_0x1a57c9[_0x3a46('0x26')]['commandName']),this[_0x3a46('0x49')][_0x3a46('0xd')][_0x3a46('0x64')][_0x3a46('0x47')]();}),_0x43d33c;}['_initializeController'](_0x22ea8f){const _0x620848=this[_0x3a46('0x49')],_0x3d3e63=_0x620848[_0x3a46('0xa')],_0x580c4f=_0x620848['plugins'][_0x3a46('0x28')]('Annotations'),_0x5a9e74=_0x620848[_0x3a46('0x13')][_0x3a46('0x28')]('CommentsRepository'),_0xe98337=_0x620848[_0x3a46('0x13')][_0x3a46('0x28')]('EditorAnnotations'),_0x305c73=_0x620848[_0x3a46('0x13')][_0x3a46('0x28')](_0x37ecab)['me'],_0x326523=_0x3d3e63[_0x3a46('0x28')](_0x3a46('0x52'))[_0x3a46('0x68')],{CommentsListView:_0x8831a9,CommentThreadInputView:_0x48d056}=_0x620848[_0x3a46('0x13')][_0x3a46('0x28')]('CommentsUI');let _0x1b3d6a,_0x1b9cbe;this[_0x3a46('0x58')][_0x3a46('0x5f')](_0x22ea8f['id'])?(_0x1b9cbe=this[_0x3a46('0x58')]['get'](_0x22ea8f['id']),_0x1b3d6a=_0x1b9cbe[_0x3a46('0x1e')]):(_0x1b3d6a=new _0x326523(_0x620848[_0x3a46('0x59')],_0x22ea8f,_0x305c73,{'disableComments':this[_0x3a46('0x33')],'editorConfig':_0x3d3e63['get']('comments.editorConfig'),'maxCommentsWhenCollapsed':_0x3d3e63[_0x3a46('0x28')]('comments.maxCommentsWhenCollapsed'),'maxThreadTotalWeight':_0x3d3e63[_0x3a46('0x28')](_0x3a46('0x4f')),'maxCommentCharsWhenCollapsed':_0x3d3e63[_0x3a46('0x28')](_0x3a46('0x0')),'formatDateTime':_0x493ace(_0x3d3e63[_0x3a46('0x28')]('locale')),'CommentView':_0x3d3e63[_0x3a46('0x28')](_0x3a46('0x57'))[_0x3a46('0x1')],'CommentsListView':_0x8831a9,'CommentThreadInputView':_0x48d056}),_0x1b3d6a['acceptButton']['on']('execute',()=>{_0x620848['editing']['view'][_0x3a46('0x47')]();}),_0x1b3d6a[_0x3a46('0x53')]['on']('execute',()=>{_0x620848[_0x3a46('0xd')][_0x3a46('0x64')][_0x3a46('0x47')]();}),_0x1b9cbe=_0x580c4f[_0x3a46('0x1f')](this['editor']['locale'],_0x1b3d6a),_0x1b9cbe['bind'](_0x3a46('0x14'))['to'](_0x1b3d6a,'isDirty'),_0x1b9cbe[_0x3a46('0x62')](_0x3a46('0x3f'))['to'](_0x1b3d6a),_0x1b9cbe['bind'](_0x3a46('0x4e'))['to'](_0x1b3d6a,_0x3a46('0x4e'),_0x2751c2=>_0x3a46('0x4')+_0x2751c2),this[_0x3a46('0x58')][_0x3a46('0x31')](_0x22ea8f['id'],_0x1b9cbe));const _0x479b02=_0x5a9e74[_0x3a46('0x19')](_0x22ea8f[_0x3a46('0x24')],_0x1b3d6a),_0x43c3ed=new _0x3440d2(_0x620848,_0x22ea8f,_0x1b3d6a,_0x479b02),_0x4b151c=_0x22ea8f[_0x3a46('0x6')]()[_0x3a46('0x51')](_0x2389b0=>_0x2389b0[_0x3a46('0x43')]);_0x1b3d6a[_0x3a46('0x41')]=_0x620848[_0x3a46('0x13')][_0x3a46('0x28')]('TrackChangesEditing')[_0x3a46('0x6a')][_0x3a46('0x17')](_0x4b151c),this[_0x3a46('0x40')][_0x3a46('0x31')](_0x22ea8f,_0x43c3ed),this[_0x3a46('0x4c')]['set'](_0x1b3d6a,_0x43c3ed);const _0x4f2195=_0x580c4f[_0x3a46('0x18')]({'view':_0x1b9cbe,'target':()=>{const _0x23cc98=[],_0x1f50e7=_0x22ea8f['getAllAdjacentSuggestions']()[_0x3a46('0x51')](_0x33ef5b=>_0x33ef5b['isInContent']);for(const _0x37083b of _0x1f50e7)_0x23cc98[_0x3a46('0x5a')](..._0x37083b['getMarkers']());return _0x58ff69(_0x620848[_0x3a46('0xd')],_0x23cc98);},'type':()=>_0x3a46('0x4')+_0x43c3ed[_0x3a46('0x64')][_0x3a46('0x4e')]});_0x5a9e74['_bindAnnotationToEditors'](_0x1b3d6a,_0x4f2195),_0x580c4f['add'](_0x4f2195),_0xe98337[_0x3a46('0x37')](_0x4f2195);}['_destroyController'](_0xfdfab5){const _0x468882=this[_0x3a46('0x49')][_0x3a46('0x13')][_0x3a46('0x28')]('CommentsRepository'),_0x52edf2=this[_0x3a46('0x49')][_0x3a46('0x13')][_0x3a46('0x28')](_0x3a46('0x69')),_0x3e2857=this[_0x3a46('0x40')]['get'](_0xfdfab5),_0x5f310b=_0x3e2857[_0x3a46('0x64')],_0x1bbe1f=_0x52edf2['getByInnerView'](_0x5f310b);_0x468882[_0x3a46('0x38')](_0x5f310b),_0x1bbe1f&&_0x52edf2[_0x3a46('0x3c')](_0x1bbe1f),this[_0x3a46('0x40')]['delete'](_0xfdfab5),this['_viewToController']['delete'](_0x5f310b),_0x3e2857['destroy']();}[_0x3a46('0xf')](_0x2dbe8e){if(!_0x2dbe8e[_0x3a46('0x43')]||!this[_0x3a46('0x40')][_0x3a46('0x5f')](_0x2dbe8e))return;const _0x5fa178=this[_0x3a46('0x49')]['plugins'][_0x3a46('0x28')](_0x3a46('0x3b')),_0x2d94d4=this['_suggestionToController'][_0x3a46('0x28')](_0x2dbe8e),_0x48dcf4=_0x2dbe8e[_0x3a46('0x6')]();_0x2d94d4['view'][_0x3a46('0x41')]=_0x5fa178[_0x3a46('0x6a')]['getDescriptions'](_0x48dcf4);}[_0x3a46('0x50')](){for(const _0x438fe8 of this[_0x3a46('0x40')]['keys']())this['_destroyController'](_0x438fe8);for(const _0x4207d2 of this[_0x3a46('0x58')][_0x3a46('0xe')]())_0x4207d2['mainView'][_0x3a46('0x50')]();super[_0x3a46('0x50')]();}}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
import type { Editor } from 'ckeditor5/src/core';
|
|
6
|
-
import type Suggestion from '../suggestion';
|
|
7
|
-
import type BaseSuggestionThreadView from './view/basesuggestionthreadview';
|
|
8
|
-
import type { CommentThreadController } from '@ckeditor/ckeditor5-comments';
|
|
9
|
-
declare const SuggestionController_base: {
|
|
10
|
-
new (): import("ckeditor5/src/utils").Observable;
|
|
11
|
-
prototype: import("ckeditor5/src/utils").Observable;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* A controller for a suggestion.
|
|
15
|
-
*
|
|
16
|
-
* It takes a suggestion thread view, listens to events fired by that view and based on them performs actions
|
|
17
|
-
* on the provided suggestion model.
|
|
18
|
-
*/
|
|
19
|
-
export default class SuggestionController extends SuggestionController_base {
|
|
20
|
-
model: Suggestion;
|
|
21
|
-
view: BaseSuggestionThreadView;
|
|
22
|
-
commentThreadController: CommentThreadController;
|
|
23
|
-
constructor(editor: Editor, model: Suggestion, view: BaseSuggestionThreadView, commentThreadController: CommentThreadController);
|
|
24
|
-
/**
|
|
25
|
-
* Accepts the suggestion that belongs to this controller.
|
|
26
|
-
*/
|
|
27
|
-
acceptSuggestion(): void;
|
|
28
|
-
/**
|
|
29
|
-
* Discards the suggestion that belongs to this controller.
|
|
30
|
-
*/
|
|
31
|
-
discardSuggestion(): void;
|
|
32
|
-
/**
|
|
33
|
-
* Destroys `SuggestionController` instance.
|
|
34
|
-
*/
|
|
35
|
-
destroy(): void;
|
|
36
|
-
}
|
|
37
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
import type { Editor } from 'ckeditor5/src/core';
|
|
6
|
+
import type Suggestion from '../suggestion';
|
|
7
|
+
import type BaseSuggestionThreadView from './view/basesuggestionthreadview';
|
|
8
|
+
import type { CommentThreadController } from '@ckeditor/ckeditor5-comments';
|
|
9
|
+
declare const SuggestionController_base: {
|
|
10
|
+
new (): import("ckeditor5/src/utils").Observable;
|
|
11
|
+
prototype: import("ckeditor5/src/utils").Observable;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* A controller for a suggestion.
|
|
15
|
+
*
|
|
16
|
+
* It takes a suggestion thread view, listens to events fired by that view and based on them performs actions
|
|
17
|
+
* on the provided suggestion model.
|
|
18
|
+
*/
|
|
19
|
+
export default class SuggestionController extends SuggestionController_base {
|
|
20
|
+
model: Suggestion;
|
|
21
|
+
view: BaseSuggestionThreadView;
|
|
22
|
+
commentThreadController: CommentThreadController;
|
|
23
|
+
constructor(editor: Editor, model: Suggestion, view: BaseSuggestionThreadView, commentThreadController: CommentThreadController);
|
|
24
|
+
/**
|
|
25
|
+
* Accepts the suggestion that belongs to this controller.
|
|
26
|
+
*/
|
|
27
|
+
acceptSuggestion(): void;
|
|
28
|
+
/**
|
|
29
|
+
* Discards the suggestion that belongs to this controller.
|
|
30
|
+
*/
|
|
31
|
+
discardSuggestion(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Destroys `SuggestionController` instance.
|
|
34
|
+
*/
|
|
35
|
+
destroy(): void;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x571a=['_removePendingAction','listenTo','commands','acceptSuggestion','_setPendingAction','destroy','canEditAt','_editor','_pendingAction','view','bind','get','plugins','PENDING_ACTION_SUGGESTION','add','discardSuggestion','canAccept','unbind','_discardCommand','PendingActions','model','isEnabled','locale','execute','canDiscard','commentThreadController','isDirty','_acceptCommand','stopListening','getRanges'];(function(_0x20a447,_0x571a81){const _0x546ed2=function(_0x164a2b){while(--_0x164a2b){_0x20a447['push'](_0x20a447['shift']());}};_0x546ed2(++_0x571a81);}(_0x571a,0xed));const _0x546e=function(_0x20a447,_0x571a81){_0x20a447=_0x20a447-0x0;let _0x546ed2=_0x571a[_0x20a447];return _0x546ed2;};import{ObservableMixin as _0x3ead9b}from'ckeditor5/src/utils';import{getTranslation as _0x129563}from'../utils/common-translations';export default class Gt extends _0x3ead9b(){constructor(_0x26f362,_0x2b8529,_0x132492,_0xc5ebdf){super(),this[_0x546e('0x17')]=_0x2b8529,this[_0x546e('0xc')]=_0x132492,this[_0x546e('0x1c')]=_0xc5ebdf,this[_0x546e('0xa')]=_0x26f362,this['_acceptCommand']=_0x26f362[_0x546e('0x5')][_0x546e('0xe')](_0x546e('0x6')),this[_0x546e('0x15')]=_0x26f362[_0x546e('0x5')][_0x546e('0xe')](_0x546e('0x12')),this['view'][_0x546e('0xd')](_0x546e('0x18'))['to'](this[_0x546e('0x0')],this['_discardCommand'],(_0x511451,_0x235e21)=>_0x511451||_0x235e21),this[_0x546e('0xc')]['bind']('canAccept')['to'](this[_0x546e('0x0')],_0x546e('0x18'),_0xeb5fe6=>_0xeb5fe6&&this['_editor'][_0x546e('0x17')]['canEditAt'](_0x2b8529[_0x546e('0x2')]())),this[_0x546e('0xc')][_0x546e('0xd')](_0x546e('0x1b'))['to'](this[_0x546e('0x15')],_0x546e('0x18'),_0x56bd1b=>_0x56bd1b&&this[_0x546e('0xa')][_0x546e('0x17')][_0x546e('0x9')](_0x2b8529['getRanges']())),this[_0x546e('0xb')]=null,_0x132492[_0x546e('0x1d')]&&this[_0x546e('0x7')](),this[_0x546e('0x4')](_0x132492,_0x546e('0x6'),()=>this['acceptSuggestion']()),this[_0x546e('0x4')](_0x132492,'discardSuggestion',()=>this[_0x546e('0x12')]()),this['listenTo'](_0x132492,'change:isDirty',()=>{_0x132492[_0x546e('0x1d')]?this[_0x546e('0x7')]():this[_0x546e('0x3')]();});}['acceptSuggestion'](){this[_0x546e('0x0')][_0x546e('0x1a')](this[_0x546e('0x17')]['id']);}[_0x546e('0x12')](){this[_0x546e('0x15')][_0x546e('0x1a')](this['model']['id']);}[_0x546e('0x8')](){this[_0x546e('0xc')][_0x546e('0x14')](_0x546e('0x18')),this['view']['unbind'](_0x546e('0x13')),this[_0x546e('0xc')][_0x546e('0x14')](_0x546e('0x1b')),this[_0x546e('0x1')](),this[_0x546e('0x1c')][_0x546e('0x8')](),this[_0x546e('0xb')]&&this[_0x546e('0x3')]();}[_0x546e('0x7')](){const _0x317222=_0x129563(this[_0x546e('0xa')][_0x546e('0x19')],_0x546e('0x10'));this['_pendingAction']=this['_editor'][_0x546e('0xf')]['get'](_0x546e('0x16'))[_0x546e('0x11')](_0x317222);}['_removePendingAction'](){null!==this[_0x546e('0xb')]&&this[_0x546e('0xa')][_0x546e('0xf')][_0x546e('0xe')](_0x546e('0x16'))['remove'](this[_0x546e('0xb')]),this[_0x546e('0xb')]=null;}}
|
|
@@ -1,170 +1,170 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* @module track-changes/ui/view/basesuggestionthreadview
|
|
7
|
-
* @publicApi
|
|
8
|
-
*/
|
|
9
|
-
import { View } from 'ckeditor5/src/ui';
|
|
10
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
|
11
|
-
import type { EditorConfig } from 'ckeditor5/src/core';
|
|
12
|
-
import type Suggestion from '../../suggestion';
|
|
13
|
-
import type { CommentsListView, CommentThreadInputView, CommentView } from '@ckeditor/ckeditor5-comments';
|
|
14
|
-
import type { User } from 'ckeditor5-collaboration/src/collaboration-core';
|
|
15
|
-
import type { Description } from '../../suggestiondescriptionfactory';
|
|
16
|
-
/**
|
|
17
|
-
* An abstract suggestion thread view class that should be used as a base for suggestion thread view implementations.
|
|
18
|
-
* It provides some behaviors, flags and building blocks to use when creating a custom suggestion thread view class.
|
|
19
|
-
*
|
|
20
|
-
* All events fired by {@link module:comments/comments/ui/view/basecommentview~BaseCommentView}
|
|
21
|
-
* are delegated to {@link module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView}.
|
|
22
|
-
* This means that {@link module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView} can also fire these
|
|
23
|
-
* events to communicate with CKEditor 5 collaboration features.
|
|
24
|
-
*
|
|
25
|
-
* For the usage examples check the {@glink features/collaboration/annotations/annotations-custom-view
|
|
26
|
-
* Annotations custom view} guide.
|
|
27
|
-
*/
|
|
28
|
-
export default abstract class BaseSuggestionThreadView extends View {
|
|
29
|
-
/**
|
|
30
|
-
* The list of comment views. It should be used as a part of the view template when present.
|
|
31
|
-
*/
|
|
32
|
-
commentsListView: CommentsListView | null;
|
|
33
|
-
/**
|
|
34
|
-
* The comment input area view. It should be used as a part of the view template when present.
|
|
35
|
-
*/
|
|
36
|
-
commentThreadInputView: CommentThreadInputView | null;
|
|
37
|
-
/**
|
|
38
|
-
* A boolean value that informs if the comment thread view is in the active state ("highlighted").
|
|
39
|
-
* A comment thread view is in this state when it is focused or was activated by the user in any different way.
|
|
40
|
-
*
|
|
41
|
-
* @observable
|
|
42
|
-
*/
|
|
43
|
-
isActive: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Suggestion creation date.
|
|
46
|
-
*
|
|
47
|
-
* @observable
|
|
48
|
-
*/
|
|
49
|
-
authoredAt: Date | null;
|
|
50
|
-
/**
|
|
51
|
-
* Flag that indicates whether suggestion acceptation is possible.
|
|
52
|
-
*
|
|
53
|
-
* @observable
|
|
54
|
-
*/
|
|
55
|
-
canAccept: boolean;
|
|
56
|
-
/**
|
|
57
|
-
* Flag that indicates whether suggestion discarding is possible.
|
|
58
|
-
*
|
|
59
|
-
* @observable
|
|
60
|
-
*/
|
|
61
|
-
canDiscard: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Stores description entries generated for this suggestion that describe what is the suggested change.
|
|
64
|
-
* They are used to create the final description presented in the suggestion view to the user.
|
|
65
|
-
*
|
|
66
|
-
* Note that one suggestion may include multiple changes.
|
|
67
|
-
*
|
|
68
|
-
* Most cases are simple and include just one description item:
|
|
69
|
-
*
|
|
70
|
-
* ```ts
|
|
71
|
-
* [
|
|
72
|
-
* { type: 'insertion', content: '*Insert:* "Foo"' }
|
|
73
|
-
* ]
|
|
74
|
-
* ```
|
|
75
|
-
*
|
|
76
|
-
* This description item represents a suggestion for inserting the "Foo" text. The `type` property describes the performed action
|
|
77
|
-
* while the `content` property contains additional information about the action and is optional.
|
|
78
|
-
*
|
|
79
|
-
* A more complex example is presented below:
|
|
80
|
-
*
|
|
81
|
-
* ```ts
|
|
82
|
-
* [
|
|
83
|
-
* { type: 'insertion', content: '*Insert:* 2 paragraphs' },
|
|
84
|
-
* { type: 'insertion', content: '*Insert:* image' },
|
|
85
|
-
* { type: 'replace', content: '*Replace:* "Foo" *with* "Bar"' }
|
|
86
|
-
* ]
|
|
87
|
-
* ```
|
|
88
|
-
*
|
|
89
|
-
* In this example, there are three description instances (or lines). Two new (empty) paragraphs were added,
|
|
90
|
-
* an image was added and then "Foo" text was replaced by "Bar". The above structure could be rendered as:
|
|
91
|
-
*
|
|
92
|
-
* ```html
|
|
93
|
-
* <p><strong>Insert:</strong> 2 paragraphs</p>
|
|
94
|
-
* <p><strong>Insert:</strong> image</p>
|
|
95
|
-
* <p><strong>Replace:</strong> "Foo" <strong>with</strong> "Bar"</p>
|
|
96
|
-
* ```
|
|
97
|
-
*
|
|
98
|
-
* @observable
|
|
99
|
-
*/
|
|
100
|
-
descriptionParts: Array<Description>;
|
|
101
|
-
/**
|
|
102
|
-
* Informs whether the suggestion thread has any changes that have not been saved.
|
|
103
|
-
*
|
|
104
|
-
* @observable
|
|
105
|
-
*/
|
|
106
|
-
isDirty: boolean;
|
|
107
|
-
/**
|
|
108
|
-
* Informs whether the suggestion can be accepted or discarded.
|
|
109
|
-
*
|
|
110
|
-
* @observable
|
|
111
|
-
*/
|
|
112
|
-
isEnabled: boolean;
|
|
113
|
-
/**
|
|
114
|
-
* The number of items in the view, where the suggestion itself counts as one.
|
|
115
|
-
*
|
|
116
|
-
* In other words, it is equal to the number of comments in the suggestion thread view plus one.
|
|
117
|
-
*
|
|
118
|
-
* @observable
|
|
119
|
-
*/
|
|
120
|
-
readonly length: number;
|
|
121
|
-
constructor(locale: Locale, model: Suggestion, localUser: User, config: SuggestionThreadConfig);
|
|
122
|
-
/**
|
|
123
|
-
* Focuses the view.
|
|
124
|
-
*/
|
|
125
|
-
focus(): void;
|
|
126
|
-
/**
|
|
127
|
-
* @inheritDoc
|
|
128
|
-
*/
|
|
129
|
-
destroy(): void;
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Fired when a user performed an action that should lead to accepting the suggestion.
|
|
133
|
-
*
|
|
134
|
-
* This event is not fired by default by any component created by `BaseSuggestionThreadView`.
|
|
135
|
-
* If you create a view class extending `BaseSuggestionCommentView`, you should provide
|
|
136
|
-
* a UI element that will fire this event.
|
|
137
|
-
*
|
|
138
|
-
* @eventName ~BaseSuggestionThreadView#acceptSuggestion
|
|
139
|
-
*/
|
|
140
|
-
export type AcceptSuggestionEvent = {
|
|
141
|
-
name: 'acceptSuggestion';
|
|
142
|
-
args: [];
|
|
143
|
-
};
|
|
144
|
-
/**
|
|
145
|
-
* Fired when a user performed an action that should lead to discarding the suggestion.
|
|
146
|
-
*
|
|
147
|
-
* This event is not fired by default by any component created by `BaseSuggestionThreadView`.
|
|
148
|
-
* If you create a view class extending `BaseSuggestionCommentView`, you should provide
|
|
149
|
-
* a UI element that will fire this event.
|
|
150
|
-
*
|
|
151
|
-
* @eventName ~BaseSuggestionThreadView#discardSuggestion
|
|
152
|
-
*/
|
|
153
|
-
export type DiscardSuggestionEvent = {
|
|
154
|
-
name: 'discardSuggestion';
|
|
155
|
-
args: [];
|
|
156
|
-
};
|
|
157
|
-
/**
|
|
158
|
-
* Config used for suggestion thread views.
|
|
159
|
-
*/
|
|
160
|
-
export interface SuggestionThreadConfig {
|
|
161
|
-
disableComments: boolean;
|
|
162
|
-
editorConfig: EditorConfig;
|
|
163
|
-
maxCommentsWhenCollapsed: number;
|
|
164
|
-
maxThreadTotalWeight: number;
|
|
165
|
-
maxCommentCharsWhenCollapsed: number;
|
|
166
|
-
formatDateTime: (date: Date | string) => string;
|
|
167
|
-
CommentView: typeof CommentView;
|
|
168
|
-
CommentsListView: typeof CommentsListView;
|
|
169
|
-
CommentThreadInputView: typeof CommentThreadInputView;
|
|
170
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* @module track-changes/ui/view/basesuggestionthreadview
|
|
7
|
+
* @publicApi
|
|
8
|
+
*/
|
|
9
|
+
import { View } from 'ckeditor5/src/ui';
|
|
10
|
+
import type { Locale } from 'ckeditor5/src/utils';
|
|
11
|
+
import type { EditorConfig } from 'ckeditor5/src/core';
|
|
12
|
+
import type Suggestion from '../../suggestion';
|
|
13
|
+
import type { CommentsListView, CommentThreadInputView, CommentView } from '@ckeditor/ckeditor5-comments';
|
|
14
|
+
import type { User } from 'ckeditor5-collaboration/src/collaboration-core';
|
|
15
|
+
import type { Description } from '../../suggestiondescriptionfactory';
|
|
16
|
+
/**
|
|
17
|
+
* An abstract suggestion thread view class that should be used as a base for suggestion thread view implementations.
|
|
18
|
+
* It provides some behaviors, flags and building blocks to use when creating a custom suggestion thread view class.
|
|
19
|
+
*
|
|
20
|
+
* All events fired by {@link module:comments/comments/ui/view/basecommentview~BaseCommentView}
|
|
21
|
+
* are delegated to {@link module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView}.
|
|
22
|
+
* This means that {@link module:track-changes/ui/view/basesuggestionthreadview~BaseSuggestionThreadView} can also fire these
|
|
23
|
+
* events to communicate with CKEditor 5 collaboration features.
|
|
24
|
+
*
|
|
25
|
+
* For the usage examples check the {@glink features/collaboration/annotations/annotations-custom-view
|
|
26
|
+
* Annotations custom view} guide.
|
|
27
|
+
*/
|
|
28
|
+
export default abstract class BaseSuggestionThreadView extends View {
|
|
29
|
+
/**
|
|
30
|
+
* The list of comment views. It should be used as a part of the view template when present.
|
|
31
|
+
*/
|
|
32
|
+
commentsListView: CommentsListView | null;
|
|
33
|
+
/**
|
|
34
|
+
* The comment input area view. It should be used as a part of the view template when present.
|
|
35
|
+
*/
|
|
36
|
+
commentThreadInputView: CommentThreadInputView | null;
|
|
37
|
+
/**
|
|
38
|
+
* A boolean value that informs if the comment thread view is in the active state ("highlighted").
|
|
39
|
+
* A comment thread view is in this state when it is focused or was activated by the user in any different way.
|
|
40
|
+
*
|
|
41
|
+
* @observable
|
|
42
|
+
*/
|
|
43
|
+
isActive: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Suggestion creation date.
|
|
46
|
+
*
|
|
47
|
+
* @observable
|
|
48
|
+
*/
|
|
49
|
+
authoredAt: Date | null;
|
|
50
|
+
/**
|
|
51
|
+
* Flag that indicates whether suggestion acceptation is possible.
|
|
52
|
+
*
|
|
53
|
+
* @observable
|
|
54
|
+
*/
|
|
55
|
+
canAccept: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Flag that indicates whether suggestion discarding is possible.
|
|
58
|
+
*
|
|
59
|
+
* @observable
|
|
60
|
+
*/
|
|
61
|
+
canDiscard: boolean;
|
|
62
|
+
/**
|
|
63
|
+
* Stores description entries generated for this suggestion that describe what is the suggested change.
|
|
64
|
+
* They are used to create the final description presented in the suggestion view to the user.
|
|
65
|
+
*
|
|
66
|
+
* Note that one suggestion may include multiple changes.
|
|
67
|
+
*
|
|
68
|
+
* Most cases are simple and include just one description item:
|
|
69
|
+
*
|
|
70
|
+
* ```ts
|
|
71
|
+
* [
|
|
72
|
+
* { type: 'insertion', content: '*Insert:* "Foo"' }
|
|
73
|
+
* ]
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* This description item represents a suggestion for inserting the "Foo" text. The `type` property describes the performed action
|
|
77
|
+
* while the `content` property contains additional information about the action and is optional.
|
|
78
|
+
*
|
|
79
|
+
* A more complex example is presented below:
|
|
80
|
+
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* [
|
|
83
|
+
* { type: 'insertion', content: '*Insert:* 2 paragraphs' },
|
|
84
|
+
* { type: 'insertion', content: '*Insert:* image' },
|
|
85
|
+
* { type: 'replace', content: '*Replace:* "Foo" *with* "Bar"' }
|
|
86
|
+
* ]
|
|
87
|
+
* ```
|
|
88
|
+
*
|
|
89
|
+
* In this example, there are three description instances (or lines). Two new (empty) paragraphs were added,
|
|
90
|
+
* an image was added and then "Foo" text was replaced by "Bar". The above structure could be rendered as:
|
|
91
|
+
*
|
|
92
|
+
* ```html
|
|
93
|
+
* <p><strong>Insert:</strong> 2 paragraphs</p>
|
|
94
|
+
* <p><strong>Insert:</strong> image</p>
|
|
95
|
+
* <p><strong>Replace:</strong> "Foo" <strong>with</strong> "Bar"</p>
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @observable
|
|
99
|
+
*/
|
|
100
|
+
descriptionParts: Array<Description>;
|
|
101
|
+
/**
|
|
102
|
+
* Informs whether the suggestion thread has any changes that have not been saved.
|
|
103
|
+
*
|
|
104
|
+
* @observable
|
|
105
|
+
*/
|
|
106
|
+
isDirty: boolean;
|
|
107
|
+
/**
|
|
108
|
+
* Informs whether the suggestion can be accepted or discarded.
|
|
109
|
+
*
|
|
110
|
+
* @observable
|
|
111
|
+
*/
|
|
112
|
+
isEnabled: boolean;
|
|
113
|
+
/**
|
|
114
|
+
* The number of items in the view, where the suggestion itself counts as one.
|
|
115
|
+
*
|
|
116
|
+
* In other words, it is equal to the number of comments in the suggestion thread view plus one.
|
|
117
|
+
*
|
|
118
|
+
* @observable
|
|
119
|
+
*/
|
|
120
|
+
readonly length: number;
|
|
121
|
+
constructor(locale: Locale, model: Suggestion, localUser: User, config: SuggestionThreadConfig);
|
|
122
|
+
/**
|
|
123
|
+
* Focuses the view.
|
|
124
|
+
*/
|
|
125
|
+
focus(): void;
|
|
126
|
+
/**
|
|
127
|
+
* @inheritDoc
|
|
128
|
+
*/
|
|
129
|
+
destroy(): void;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Fired when a user performed an action that should lead to accepting the suggestion.
|
|
133
|
+
*
|
|
134
|
+
* This event is not fired by default by any component created by `BaseSuggestionThreadView`.
|
|
135
|
+
* If you create a view class extending `BaseSuggestionCommentView`, you should provide
|
|
136
|
+
* a UI element that will fire this event.
|
|
137
|
+
*
|
|
138
|
+
* @eventName ~BaseSuggestionThreadView#acceptSuggestion
|
|
139
|
+
*/
|
|
140
|
+
export type AcceptSuggestionEvent = {
|
|
141
|
+
name: 'acceptSuggestion';
|
|
142
|
+
args: [];
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Fired when a user performed an action that should lead to discarding the suggestion.
|
|
146
|
+
*
|
|
147
|
+
* This event is not fired by default by any component created by `BaseSuggestionThreadView`.
|
|
148
|
+
* If you create a view class extending `BaseSuggestionCommentView`, you should provide
|
|
149
|
+
* a UI element that will fire this event.
|
|
150
|
+
*
|
|
151
|
+
* @eventName ~BaseSuggestionThreadView#discardSuggestion
|
|
152
|
+
*/
|
|
153
|
+
export type DiscardSuggestionEvent = {
|
|
154
|
+
name: 'discardSuggestion';
|
|
155
|
+
args: [];
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Config used for suggestion thread views.
|
|
159
|
+
*/
|
|
160
|
+
export interface SuggestionThreadConfig {
|
|
161
|
+
disableComments: boolean;
|
|
162
|
+
editorConfig: EditorConfig;
|
|
163
|
+
maxCommentsWhenCollapsed: number;
|
|
164
|
+
maxThreadTotalWeight: number;
|
|
165
|
+
maxCommentCharsWhenCollapsed: number;
|
|
166
|
+
formatDateTime: (date: Date | string) => string;
|
|
167
|
+
CommentView: typeof CommentView;
|
|
168
|
+
CommentsListView: typeof CommentsListView;
|
|
169
|
+
CommentThreadInputView: typeof CommentThreadInputView;
|
|
170
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x4526=['showInput','assign','CommentView','locale','delegate','canAccept','hasDirtyComment','updateComment','descriptionParts','bind','_createCommentThreadInputView','_model','destroy','fire','value','authoredAt','isActive','disableComments','set','submit','focus','_createCommentViews','removeComment','disabledSubmit','isReadOnly','_config','length','isDirty','commentsListView','isEnabled','commentInputView','commentThread','commentThreadInputView','addComment','setData'];(function(_0x1c9597,_0x4526dc){const _0x2969a2=function(_0x18d4a4){while(--_0x18d4a4){_0x1c9597['push'](_0x1c9597['shift']());}};_0x2969a2(++_0x4526dc);}(_0x4526,0xdc));const _0x2969=function(_0x1c9597,_0x4526dc){_0x1c9597=_0x1c9597-0x0;let _0x2969a2=_0x4526[_0x1c9597];return _0x2969a2;};import{View as _0x31a273}from'ckeditor5/src/ui';export default class ii extends _0x31a273{constructor(_0x4b651d,_0x387431,_0x41a730,_0x24686e){super(_0x4b651d),this[_0x2969('0x12')]=null,this[_0x2969('0x16')]=null,this['set'](_0x2969('0x6'),!0x1),this[_0x2969('0x8')](_0x2969('0x5'),_0x387431[_0x2969('0x5')]),this[_0x2969('0x22')](_0x2969('0x5'))['to'](_0x387431),this[_0x2969('0x8')](_0x2969('0x21'),[]),this[_0x2969('0x8')](_0x2969('0x11'),!0x1),this[_0x2969('0x8')](_0x2969('0x13'),!0x1),this[_0x2969('0x8')](_0x2969('0x1e'),!0x1),this[_0x2969('0x8')]('canDiscard',!0x1),this[_0x2969('0x1')]=_0x387431,this['_localUser']=_0x41a730,this[_0x2969('0xf')]=_0x24686e,_0x24686e[_0x2969('0x7')]?this[_0x2969('0x8')](_0x2969('0x10'),0x1):this[_0x2969('0xb')]();}['focus'](){this['element'][_0x2969('0xa')]();}[_0x2969('0x2')](){this[_0x2969('0x12')]&&this[_0x2969('0x12')][_0x2969('0x2')](),this['commentThreadInputView']&&this[_0x2969('0x16')]['destroy'](),super[_0x2969('0x2')]();}[_0x2969('0xb')](){const {CommentsListView:_0x497576}=this[_0x2969('0xf')];this[_0x2969('0x12')]=new _0x497576(this['locale'],this['_model']['commentThread'],Object[_0x2969('0x1a')]({'CommentView':this[_0x2969('0xf')][_0x2969('0x1b')]},this['_config'])),this[_0x2969('0x12')][_0x2969('0x1d')](_0x2969('0xc'))['to'](this),this[_0x2969('0x12')][_0x2969('0x1d')](_0x2969('0x20'))['to'](this),this[_0x2969('0x12')][_0x2969('0x22')](_0x2969('0x6'))['to'](this),this[_0x2969('0x8')](_0x2969('0x10'),this[_0x2969('0x12')][_0x2969('0x10')]+0x1),this['bind']('length')['to'](this['commentsListView'],'length',_0x5c1203=>_0x5c1203+0x1),this['commentThreadInputView']=this[_0x2969('0x0')](),this['on'](_0x2969('0xc'),()=>this[_0x2969('0xa')]()),this[_0x2969('0x22')](_0x2969('0x11'))['to'](this['commentsListView'],_0x2969('0x1f'),this[_0x2969('0x16')]['commentInputView'],_0x2969('0x4'),(_0x2bf85f,_0xbf046c)=>_0x2bf85f||!!_0xbf046c);}[_0x2969('0x0')](){const {CommentThreadInputView:_0x4db2e1}=this[_0x2969('0xf')],_0x1b0f62=new _0x4db2e1(this[_0x2969('0x1c')],this['_localUser'],this[_0x2969('0xf')]['editorConfig']),_0x35efc0=_0x1b0f62[_0x2969('0x14')];return _0x1b0f62[_0x2969('0x22')](_0x2969('0x19'))['to'](this,_0x2969('0x6'),this[_0x2969('0x1')]['commentThread'],_0x2969('0xe'),_0x35efc0,_0x2969('0x4'),(_0x19f758,_0x161662,_0x2ed42d)=>!!_0x2ed42d||_0x19f758&&!_0x161662),_0x35efc0['on'](_0x2969('0x9'),(_0x4e2b1d,_0x4de29c)=>{this[_0x2969('0x3')](_0x2969('0x17'),_0x4de29c),_0x35efc0['editor'][_0x2969('0x18')]('');}),_0x35efc0['on']('cancel',()=>this[_0x2969('0xa')]()),_0x35efc0[_0x2969('0x22')](_0x2969('0xd'))['to'](this[_0x2969('0x1')][_0x2969('0x15')],_0x2969('0xe')),_0x1b0f62;}}
|