@ckeditor/ckeditor5-track-changes 40.0.0 → 40.2.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/CHANGELOG.md +15 -15
- package/LICENSE.md +3 -3
- package/README.md +1 -1
- package/build/track-changes.js +2 -2
- package/build/translations/ar.js +1 -1
- package/build/translations/az.js +1 -1
- package/build/translations/bg.js +1 -1
- package/build/translations/bn.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.js +1 -1
- package/build/translations/el.js +1 -1
- package/build/translations/en-au.js +1 -1
- package/build/translations/es.js +1 -1
- package/build/translations/et.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/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/sq.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/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 +20 -1
- package/lang/translations/ar.po +78 -2
- package/lang/translations/az.po +77 -1
- package/lang/translations/bg.po +78 -2
- package/lang/translations/bn.po +78 -2
- package/lang/translations/ca.po +78 -2
- package/lang/translations/cs.po +78 -2
- package/lang/translations/da.po +78 -2
- package/lang/translations/de.po +78 -2
- package/lang/translations/el.po +78 -2
- package/lang/translations/en-au.po +78 -2
- package/lang/translations/en.po +78 -2
- package/lang/translations/es.po +78 -2
- package/lang/translations/et.po +78 -2
- package/lang/translations/fi.po +78 -2
- package/lang/translations/fr.po +78 -2
- package/lang/translations/gl.po +90 -14
- package/lang/translations/he.po +78 -2
- package/lang/translations/hi.po +78 -2
- package/lang/translations/hr.po +78 -2
- package/lang/translations/hu.po +78 -2
- package/lang/translations/id.po +78 -2
- package/lang/translations/it.po +78 -2
- package/lang/translations/ja.po +78 -2
- package/lang/translations/ko.po +78 -2
- package/lang/translations/lt.po +78 -2
- package/lang/translations/lv.po +78 -2
- package/lang/translations/ms.po +78 -2
- package/lang/translations/nl.po +78 -2
- package/lang/translations/no.po +78 -2
- package/lang/translations/pl.po +78 -2
- package/lang/translations/pt-br.po +96 -20
- package/lang/translations/pt.po +78 -2
- package/lang/translations/ro.po +78 -2
- package/lang/translations/ru.po +78 -2
- package/lang/translations/sk.po +78 -2
- package/lang/translations/sq.po +77 -1
- package/lang/translations/sr-latn.po +78 -2
- package/lang/translations/sr.po +78 -2
- package/lang/translations/sv.po +78 -2
- package/lang/translations/th.po +78 -2
- package/lang/translations/tk.po +77 -1
- package/lang/translations/tr.po +78 -2
- package/lang/translations/tt.po +77 -1
- package/lang/translations/uk.po +78 -2
- package/lang/translations/ur.po +77 -1
- package/lang/translations/vi.po +78 -2
- package/lang/translations/zh-cn.po +78 -2
- package/lang/translations/zh.po +78 -2
- 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 -17
- package/src/integrations/aiassistant.js +1 -1
- 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 +17 -23
- package/src/integrations/imagereplace.js +1 -1
- package/src/integrations/imagestyle.d.ts +17 -0
- package/src/integrations/imagestyle.js +23 -0
- 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 +17 -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 +291 -276
- package/src/suggestion.js +1 -1
- package/src/suggestiondescriptionfactory.d.ts +183 -163
- package/src/suggestiondescriptionfactory.js +1 -1
- package/src/trackchanges.d.ts +180 -244
- package/src/trackchanges.js +1 -1
- package/src/trackchangesconfig.d.ts +78 -75
- package/src/trackchangesdata.d.ts +41 -41
- package/src/trackchangesdata.js +1 -1
- package/src/trackchangesediting.d.ts +524 -468
- 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/src/trackchangesui.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
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')]();}}
|
|
23
|
+
const _0x14a3=['focus','delete','isInContent','separator','size','keys','getFirstRange','getByInnerView','_annotationViews','reduce','listenTo','_disableComments','locale','suggestionChanged','values','buttonView','destroy','comments.editorConfig','unbind','getAllAdjacentSuggestions','isDirty','has','editor','getSuggestion','Discard\x20all\x20selected\x20suggestions','requires','_createUIButton','CommentView','previous','push','bind','define','execute','config','_handleControllerBuffer','Accept\x20all\x20suggestions','add','length','_viewToController','comments.maxThreadTotalWeight','isOn','_bindAnnotationToEditors','TrackChangesEditing','SuggestionThreadView','clear','getDescriptions','filter','remove','comments','some','descriptionParts','change:previous','getMarkerNames','_handleSuggestionControllerDelayed','_updateController','editing','addSourceCollector','plugins','from','CommentsUI','lowest','stopListening','actionView','value','discardSelectedSuggestions','getRanges','type','getJoined','EditorAnnotations','Discard\x20all\x20suggestions','isMultiRange','trackChanges','arrowView','discardButton','commands','Accept\x20all\x20selected\x20suggestions','get','_destroyController','_suggestionToController','suggestion-','set','acceptButton','createAnnotation','discardAllSuggestions','acceptAllSuggestions','view','trackChanges.disableComments','button','_initializeController','pluginName','change:activeAnnotations','suggestionLoaded','mainView','Annotations','toMany','_descriptionFactory','model','commandName','activeMarkers','_refreshActiveMarkers','isEnabled','head','registerAnnotation','CommentsRepository','comments.maxCommentsWhenCollapsed'];(function(_0x4ef4c1,_0x14a37f){const _0x34bfb6=function(_0x431644){while(--_0x431644){_0x4ef4c1['push'](_0x4ef4c1['shift']());}};_0x34bfb6(++_0x14a37f);}(_0x14a3,0x78));const _0x34bf=function(_0x4ef4c1,_0x14a37f){_0x4ef4c1=_0x4ef4c1-0x0;let _0x34bfb6=_0x14a3[_0x4ef4c1];return _0x34bfb6;};import{Plugin as _0x215801}from'ckeditor5/src/core';import{Collection as _0x5b36d7}from'ckeditor5/src/utils';import{Model as _0x3231d7,SplitButtonView as _0x1af109,createDropdown as _0x196dd1,addListToDropdown as _0x3bab50}from'ckeditor5/src/ui';import{Users as _0x31dd3b,getDateTimeFormatter as _0x48750a,getAllMarkersDomElementsSorted as _0x23ad5c}from'ckeditor5-collaboration/src/collaboration-core';import _0x43c73a from'./trackchangesediting';import _0x6fd6e2 from'./ui/suggestioncontroller';import _0x6f8056 from'./ui/view/suggestionthreadview';import{getTranslation as _0x570380}from'./utils/common-translations';import _0x2f1a9a from'../theme/icons/track-changes.svg';export default class d extends _0x215801{static get[_0x34bf('0xa')](){return[_0x43c73a,_0x31dd3b,'CommentsRepository',_0x34bf('0x4e'),_0x34bf('0x35')];}static get[_0x34bf('0x4a')](){return'TrackChangesUI';}constructor(_0x22cd31){super(_0x22cd31),this[_0x34bf('0x3f')]=new Map(),this[_0x34bf('0x17')]=new Map(),this[_0x34bf('0x62')]=new Map(),this[_0x34bf('0x13')]=new Map();const _0x56b7ba=this[_0x34bf('0x7')][_0x34bf('0x12')];_0x56b7ba['define']('trackChanges.SuggestionThreadView',_0x6f8056),_0x56b7ba[_0x34bf('0x10')](_0x34bf('0x47'),!0x1),this[_0x34bf('0x65')]=_0x56b7ba['get'](_0x34bf('0x47'));}[_0x34bf('0x26')](_0x5d729f,_0x496bb8){0x0===this[_0x34bf('0x13')][_0x34bf('0x5e')]&&setTimeout(()=>{for(const [_0x454152,_0xce4028]of this[_0x34bf('0x13')]){const _0x48593c=this[_0x34bf('0x3f')]['has'](_0x454152);_0x48593c||_0xce4028?_0x48593c&&_0xce4028&&this[_0x34bf('0x3e')](_0x454152):this[_0x34bf('0x49')](_0x454152);}this['editor'][_0x34bf('0x2a')][_0x34bf('0x3d')](_0x34bf('0x35'))['refreshSelectedViews'](),this[_0x34bf('0x54')](),this['_handleControllerBuffer'][_0x34bf('0x1d')]();},0xa),this[_0x34bf('0x13')][_0x34bf('0x41')](_0x5d729f,_0x496bb8);}['init'](){const _0x1be094=this[_0x34bf('0x7')],_0xc0c198=_0x1be094[_0x34bf('0x2a')][_0x34bf('0x3d')](_0x34bf('0x1b')),_0x445c5d=_0x1be094[_0x34bf('0x2a')][_0x34bf('0x3d')](_0x34bf('0x4e')),_0x14cb86=_0x1be094[_0x34bf('0x2a')]['get'](_0x34bf('0x35')),_0x2875dc=_0x1be094[_0x34bf('0x2a')][_0x34bf('0x3d')](_0x34bf('0x58'));_0x1be094['ui']['componentFactory'][_0x34bf('0x15')](_0x34bf('0x38'),_0x334a42=>this[_0x34bf('0xb')](_0x334a42)),_0x14cb86[_0x34bf('0x29')](()=>{const _0x1e53b2=[];for(const [_0x1a09fe,_0x58d022]of Array[_0x34bf('0x2b')](this[_0x34bf('0x3f')])){const _0x1b96d6=_0x1a09fe[_0x34bf('0x4')](),_0x1b7473=[];for(const _0x303e92 of _0x1b96d6){if(!_0x303e92['isInContent'])continue;if(_0x303e92[_0x34bf('0x37')]){_0x1b7473[_0x34bf('0xe')](..._0x303e92[_0x34bf('0x32')]());continue;}const _0x1573ca=_0x303e92[_0x34bf('0x60')]();if(_0x1b7473[_0x34bf('0x16')]>0x0){const _0x13499b=_0x1b7473[0x0][_0x34bf('0x34')](_0x1573ca);if(_0x13499b){_0x1b7473[0x0]=_0x13499b;continue;}}_0x1b7473[_0x34bf('0xe')](_0x1573ca);}_0x1e53b2[_0x34bf('0xe')]([_0x58d022['view'],_0x1b7473]);}return _0x1e53b2;}),this['listenTo'](_0xc0c198,_0x34bf('0x4c'),(_0x300fbc,_0x324d94)=>{this[_0x34bf('0x64')](_0x324d94,_0x34bf('0x24'),(_0x16c607,_0x571e4f,_0x457761,_0x24c85a)=>{_0x324d94[_0x34bf('0x5c')]&&(null==_0x457761?(this[_0x34bf('0x27')](_0x24c85a[_0x34bf('0x56')]),this[_0x34bf('0x26')](_0x324d94,!0x1)):(this[_0x34bf('0x27')](_0x457761['head']),null==_0x24c85a&&this[_0x34bf('0x26')](_0x324d94,!0x0)));}),null!==_0x324d94[_0x34bf('0xd')]?this[_0x34bf('0x27')](_0x324d94[_0x34bf('0x56')]):this[_0x34bf('0x26')](_0x324d94,!0x1);}),this['listenTo'](_0xc0c198,'suggestionUnloaded',(_0x4d5f5e,_0x2ae818,_0x32d8af)=>{this[_0x34bf('0x2e')](_0x2ae818,_0x34bf('0x24')),this[_0x34bf('0x13')]['delete'](_0x2ae818),this['_suggestionToController'][_0x34bf('0x6')](_0x2ae818)&&this['_destroyController'](_0x2ae818),_0x32d8af&&this['_updateController'](_0x32d8af[_0x34bf('0x56')]);}),this[_0x34bf('0x64')](_0xc0c198,_0x34bf('0x67'),(_0x3730f8,_0x403d11)=>{this['_updateController'](_0x403d11);}),this[_0x34bf('0x64')](_0x445c5d,_0x34bf('0x4b'),()=>{this['_refreshActiveMarkers']();}),this[_0x34bf('0x64')](_0x2875dc,'addComment',(_0x2fd7f4,{threadId:_0x5c2686,isFromAdapter:_0x490e88})=>{if(_0x490e88||!_0xc0c198['hasSuggestion'](_0x5c2686))return;const _0x2332d1=_0xc0c198[_0x34bf('0x8')](_0x5c2686);this['_suggestionToController'][_0x34bf('0x3d')](_0x2332d1)[_0x34bf('0x46')]['focus']();},{'priority':_0x34bf('0x2d')});}[_0x34bf('0x54')](){const _0x1ece8a=this[_0x34bf('0x7')][_0x34bf('0x2a')][_0x34bf('0x3d')](_0x34bf('0x4e')),_0x335f75=this['editor'][_0x34bf('0x2a')][_0x34bf('0x3d')](_0x34bf('0x1b')),_0x4cbb50=Array['from'](_0x1ece8a['activeAnnotations'],_0x496358=>_0x496358['innerView'])[_0x34bf('0x1f')](_0x5312db=>this[_0x34bf('0x17')][_0x34bf('0x6')](_0x5312db)),_0x3680b0=[];for(const _0x45ac9a of _0x4cbb50){const _0x583eca=this[_0x34bf('0x17')][_0x34bf('0x3d')](_0x45ac9a)[_0x34bf('0x51')][_0x34bf('0x4')]();_0x3680b0[_0x34bf('0xe')](..._0x583eca[_0x34bf('0x63')]((_0x5ac680,_0x28d3b3)=>[..._0x5ac680,..._0x28d3b3[_0x34bf('0x25')]()],[]));}_0x335f75[_0x34bf('0x53')]=_0x3680b0;}[_0x34bf('0xb')](_0xbc930){const _0x26f3db=_0x196dd1(_0xbc930,_0x1af109),_0x4e7c8c=this['editor']['commands'][_0x34bf('0x3d')](_0x34bf('0x38')),_0x126db3=_0x570380(_0xbc930,'Track\x20changes');_0x26f3db[_0x34bf('0x0')][_0x34bf('0x41')]({'tooltip':_0x126db3,'label':_0x126db3,'icon':_0x2f1a9a}),_0x26f3db[_0x34bf('0x0')]['bind'](_0x34bf('0x19'))['to'](_0x4e7c8c,_0x34bf('0x30')),_0x26f3db['buttonView']['on'](_0x34bf('0x11'),()=>{_0x4e7c8c[_0x34bf('0x11')](),this[_0x34bf('0x7')][_0x34bf('0x28')]['view']['focus']();});const _0x479abf=new _0x5b36d7(),_0x5d95e4=[{'type':'switchbutton','model':{'withText':!0x0,'label':_0x126db3,'commandName':'trackChanges'}},{'type':_0x34bf('0x5d')},{'type':_0x34bf('0x48'),'model':{'withText':!0x0,'label':_0x570380(_0xbc930,_0x34bf('0x14')),'commandName':_0x34bf('0x45')}},{'type':_0x34bf('0x48'),'model':{'withText':!0x0,'label':_0x570380(_0xbc930,_0x34bf('0x3c')),'commandName':'acceptSelectedSuggestions'}},{'type':_0x34bf('0x48'),'model':{'withText':!0x0,'label':_0x570380(_0xbc930,_0x34bf('0x36')),'commandName':_0x34bf('0x44')}},{'type':'button','model':{'withText':!0x0,'label':_0x570380(_0xbc930,_0x34bf('0x9')),'commandName':_0x34bf('0x31')}}];for(const _0x56148c of _0x5d95e4){let _0x15cb24={'type':_0x34bf('0x5d')};if(_0x56148c[_0x34bf('0x51')]){const _0x5aff15=new _0x3231d7(_0x56148c[_0x34bf('0x51')]),_0x2c86ad=this[_0x34bf('0x7')][_0x34bf('0x3b')][_0x34bf('0x3d')](_0x5aff15[_0x34bf('0x52')]);_0x5aff15[_0x34bf('0xf')](_0x34bf('0x19'),_0x34bf('0x55'))['to'](_0x2c86ad,'value',_0x34bf('0x55')),_0x15cb24={'type':_0x56148c[_0x34bf('0x33')],'model':_0x5aff15};}_0x479abf[_0x34bf('0x15')](_0x15cb24);}_0x3bab50(_0x26f3db,_0x479abf);const _0x7cd279=_0x5d95e4[_0x34bf('0x1f')](_0x3df3a0=>null!=_0x3df3a0[_0x34bf('0x51')])['map'](_0x4d1d25=>this[_0x34bf('0x7')][_0x34bf('0x3b')][_0x34bf('0x3d')](_0x4d1d25['model'][_0x34bf('0x52')])),_0x189e2d=_0x26f3db['buttonView'];return _0x189e2d[_0x34bf('0x2f')][_0x34bf('0x3')]('isEnabled'),_0x189e2d['arrowView']['unbind'](_0x34bf('0x55')),_0x189e2d[_0x34bf('0x2f')][_0x34bf('0xf')](_0x34bf('0x55'))['to'](_0x4e7c8c,_0x34bf('0x55')),_0x189e2d[_0x34bf('0x39')][_0x34bf('0xf')](_0x34bf('0x55'))[_0x34bf('0x4f')](_0x7cd279,'isEnabled',(..._0x215972)=>_0x215972[_0x34bf('0x22')](_0x1a049e=>_0x1a049e)),_0x26f3db['on'](_0x34bf('0x11'),_0x4a429c=>{this['editor'][_0x34bf('0x11')](_0x4a429c['source'][_0x34bf('0x52')]),this['editor'][_0x34bf('0x28')][_0x34bf('0x46')][_0x34bf('0x5a')]();}),_0x26f3db;}[_0x34bf('0x49')](_0x388fcf){const _0x23c679=this['editor'],_0x233ef0=_0x23c679[_0x34bf('0x12')],_0x2b9519=_0x23c679['plugins'][_0x34bf('0x3d')](_0x34bf('0x4e')),_0x507fa2=_0x23c679[_0x34bf('0x2a')][_0x34bf('0x3d')](_0x34bf('0x58')),_0x413b98=_0x23c679[_0x34bf('0x2a')]['get']('EditorAnnotations'),_0x5ab403=_0x23c679[_0x34bf('0x2a')][_0x34bf('0x3d')](_0x31dd3b)['me'],_0x1fca25=_0x233ef0['get'](_0x34bf('0x38'))[_0x34bf('0x1c')],{CommentsListView:_0x13323c,CommentThreadInputView:_0x151b30}=_0x23c679['plugins'][_0x34bf('0x3d')](_0x34bf('0x2c'));let _0x11dae7,_0x5e5d91;this[_0x34bf('0x62')][_0x34bf('0x6')](_0x388fcf['id'])?(_0x5e5d91=this[_0x34bf('0x62')][_0x34bf('0x3d')](_0x388fcf['id']),_0x11dae7=_0x5e5d91[_0x34bf('0x4d')]):(_0x11dae7=new _0x1fca25(_0x23c679[_0x34bf('0x66')],_0x388fcf,_0x5ab403,{'disableComments':this['_disableComments'],'editorConfig':_0x233ef0[_0x34bf('0x3d')](_0x34bf('0x2')),'maxCommentsWhenCollapsed':_0x233ef0[_0x34bf('0x3d')](_0x34bf('0x59')),'maxThreadTotalWeight':_0x233ef0[_0x34bf('0x3d')](_0x34bf('0x18')),'maxCommentCharsWhenCollapsed':_0x233ef0[_0x34bf('0x3d')]('comments.maxCommentCharsWhenCollapsed'),'formatDateTime':_0x48750a(_0x233ef0[_0x34bf('0x3d')](_0x34bf('0x66'))),'CommentView':_0x233ef0[_0x34bf('0x3d')](_0x34bf('0x21'))[_0x34bf('0xc')],'CommentsListView':_0x13323c,'CommentThreadInputView':_0x151b30}),_0x11dae7[_0x34bf('0x42')]['on'](_0x34bf('0x11'),()=>{_0x23c679['editing'][_0x34bf('0x46')][_0x34bf('0x5a')]();}),_0x11dae7[_0x34bf('0x3a')]['on'](_0x34bf('0x11'),()=>{_0x23c679[_0x34bf('0x28')][_0x34bf('0x46')][_0x34bf('0x5a')]();}),_0x5e5d91=_0x2b9519['createAnnotationView'](this[_0x34bf('0x7')][_0x34bf('0x66')],_0x11dae7),_0x5e5d91['bind'](_0x34bf('0x5'))['to'](_0x11dae7,_0x34bf('0x5')),_0x5e5d91[_0x34bf('0xf')]('length')['to'](_0x11dae7),_0x5e5d91[_0x34bf('0xf')]('type')['to'](_0x11dae7,_0x34bf('0x33'),_0x27a5d4=>_0x34bf('0x40')+_0x27a5d4),this['_annotationViews'][_0x34bf('0x41')](_0x388fcf['id'],_0x5e5d91));const _0x158fb2=_0x507fa2['createCommentThreadController'](_0x388fcf['commentThread'],_0x11dae7),_0x1a4446=new _0x6fd6e2(_0x23c679,_0x388fcf,_0x11dae7,_0x158fb2),_0x24f1f3=_0x388fcf[_0x34bf('0x4')]()[_0x34bf('0x1f')](_0x797993=>_0x797993[_0x34bf('0x5c')]);_0x11dae7[_0x34bf('0x23')]=_0x23c679['plugins']['get']('TrackChangesEditing')[_0x34bf('0x50')][_0x34bf('0x1e')](_0x24f1f3),this[_0x34bf('0x3f')][_0x34bf('0x41')](_0x388fcf,_0x1a4446),this[_0x34bf('0x17')][_0x34bf('0x41')](_0x11dae7,_0x1a4446);const _0x5e481c=_0x2b9519[_0x34bf('0x43')]({'view':_0x5e5d91,'target':()=>{const _0x13b13b=[],_0xf2de65=_0x388fcf[_0x34bf('0x4')]()[_0x34bf('0x1f')](_0x4dff2f=>_0x4dff2f[_0x34bf('0x5c')]);for(const _0x39f36a of _0xf2de65)_0x13b13b[_0x34bf('0xe')](..._0x39f36a['getMarkers']());return _0x23ad5c(_0x23c679[_0x34bf('0x28')],_0x13b13b);},'type':()=>_0x34bf('0x40')+_0x1a4446[_0x34bf('0x46')]['type']});_0x507fa2[_0x34bf('0x1a')](_0x11dae7,_0x5e481c),_0x2b9519[_0x34bf('0x15')](_0x5e481c),_0x413b98[_0x34bf('0x57')](_0x5e481c);}[_0x34bf('0x3e')](_0x345924){const _0x28cfd9=this[_0x34bf('0x7')][_0x34bf('0x2a')][_0x34bf('0x3d')](_0x34bf('0x58')),_0x15b335=this['editor'][_0x34bf('0x2a')][_0x34bf('0x3d')](_0x34bf('0x4e')),_0x1b9fdd=this[_0x34bf('0x3f')][_0x34bf('0x3d')](_0x345924),_0x3e95c6=_0x1b9fdd[_0x34bf('0x46')],_0x3b69dc=_0x15b335[_0x34bf('0x61')](_0x3e95c6);_0x28cfd9['_unbindEditors'](_0x3e95c6),_0x3b69dc&&_0x15b335[_0x34bf('0x20')](_0x3b69dc),this['_suggestionToController']['delete'](_0x345924),this[_0x34bf('0x17')][_0x34bf('0x5b')](_0x3e95c6),_0x1b9fdd[_0x34bf('0x1')]();}[_0x34bf('0x27')](_0x569be8){if(!_0x569be8['isInContent']||!this['_suggestionToController'][_0x34bf('0x6')](_0x569be8))return;const _0x5fd338=this[_0x34bf('0x7')][_0x34bf('0x2a')][_0x34bf('0x3d')]('TrackChangesEditing'),_0x3b895b=this[_0x34bf('0x3f')][_0x34bf('0x3d')](_0x569be8),_0x1f497c=_0x569be8[_0x34bf('0x4')]();_0x3b895b[_0x34bf('0x46')][_0x34bf('0x23')]=_0x5fd338[_0x34bf('0x50')][_0x34bf('0x1e')](_0x1f497c);}[_0x34bf('0x1')](){for(const _0x1a798e of this[_0x34bf('0x3f')][_0x34bf('0x5f')]())this[_0x34bf('0x3e')](_0x1a798e);for(const _0x57260d of this['_annotationViews'][_0x34bf('0x68')]())_0x57260d[_0x34bf('0x4d')][_0x34bf('0x1')]();super['destroy']();}}
|
|
@@ -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 _0x3cdc=['_removePendingAction','_pendingAction','acceptSuggestion','canDiscard','canEditAt','_discardCommand','isEnabled','commentThreadController','add','view','getRanges','PENDING_ACTION_SUGGESTION','remove','canAccept','listenTo','model','PendingActions','isDirty','get','discardSuggestion','_acceptCommand','_editor','change:isDirty','locale','plugins','execute','unbind','_setPendingAction','destroy','stopListening','bind'];(function(_0x3d3c0c,_0x3cdc74){const _0x1b1a43=function(_0x34d89d){while(--_0x34d89d){_0x3d3c0c['push'](_0x3d3c0c['shift']());}};_0x1b1a43(++_0x3cdc74);}(_0x3cdc,0x165));const _0x1b1a=function(_0x3d3c0c,_0x3cdc74){_0x3d3c0c=_0x3d3c0c-0x0;let _0x1b1a43=_0x3cdc[_0x3d3c0c];return _0x1b1a43;};import{ObservableMixin as _0x5817e6}from'ckeditor5/src/utils';import{getTranslation as _0x5af9bc}from'../utils/common-translations';export default class Qt extends _0x5817e6(){constructor(_0x2f2e73,_0x62132a,_0x55f8e8,_0x4d6f91){super(),this[_0x1b1a('0x1e')]=_0x62132a,this[_0x1b1a('0x18')]=_0x55f8e8,this[_0x1b1a('0x16')]=_0x4d6f91,this[_0x1b1a('0x5')]=_0x2f2e73,this[_0x1b1a('0x4')]=_0x2f2e73['commands'][_0x1b1a('0x2')]('acceptSuggestion'),this[_0x1b1a('0x14')]=_0x2f2e73['commands'][_0x1b1a('0x2')](_0x1b1a('0x3')),this['view']['bind'](_0x1b1a('0x15'))['to'](this[_0x1b1a('0x4')],this[_0x1b1a('0x14')],(_0x595758,_0x4ab9a6)=>_0x595758||_0x4ab9a6),this[_0x1b1a('0x18')]['bind']('canAccept')['to'](this[_0x1b1a('0x4')],'isEnabled',_0x3fb4f2=>_0x3fb4f2&&this[_0x1b1a('0x5')][_0x1b1a('0x1e')][_0x1b1a('0x13')](_0x62132a[_0x1b1a('0x19')]())),this[_0x1b1a('0x18')][_0x1b1a('0xe')](_0x1b1a('0x12'))['to'](this[_0x1b1a('0x14')],'isEnabled',_0x47b17d=>_0x47b17d&&this[_0x1b1a('0x5')][_0x1b1a('0x1e')][_0x1b1a('0x13')](_0x62132a[_0x1b1a('0x19')]())),this[_0x1b1a('0x10')]=null,_0x55f8e8[_0x1b1a('0x1')]&&this[_0x1b1a('0xb')](),this[_0x1b1a('0x1d')](_0x55f8e8,_0x1b1a('0x11'),()=>this[_0x1b1a('0x11')]()),this[_0x1b1a('0x1d')](_0x55f8e8,_0x1b1a('0x3'),()=>this[_0x1b1a('0x3')]()),this[_0x1b1a('0x1d')](_0x55f8e8,_0x1b1a('0x6'),()=>{_0x55f8e8[_0x1b1a('0x1')]?this[_0x1b1a('0xb')]():this['_removePendingAction']();});}[_0x1b1a('0x11')](){this[_0x1b1a('0x4')][_0x1b1a('0x9')](this[_0x1b1a('0x1e')]['id']);}[_0x1b1a('0x3')](){this['_discardCommand'][_0x1b1a('0x9')](this['model']['id']);}[_0x1b1a('0xc')](){this[_0x1b1a('0x18')]['unbind']('isEnabled'),this[_0x1b1a('0x18')]['unbind'](_0x1b1a('0x1c')),this[_0x1b1a('0x18')][_0x1b1a('0xa')](_0x1b1a('0x12')),this[_0x1b1a('0xd')](),this['commentThreadController'][_0x1b1a('0xc')](),this['_pendingAction']&&this['_removePendingAction']();}['_setPendingAction'](){const _0x32af96=_0x5af9bc(this[_0x1b1a('0x5')][_0x1b1a('0x7')],_0x1b1a('0x1a'));this[_0x1b1a('0x10')]=this[_0x1b1a('0x5')][_0x1b1a('0x8')][_0x1b1a('0x2')](_0x1b1a('0x0'))[_0x1b1a('0x17')](_0x32af96);}[_0x1b1a('0xf')](){null!==this[_0x1b1a('0x10')]&&this[_0x1b1a('0x5')][_0x1b1a('0x8')][_0x1b1a('0x2')](_0x1b1a('0x0'))[_0x1b1a('0x1b')](this[_0x1b1a('0x10')]),this[_0x1b1a('0x10')]=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 _0x41f8=['_createCommentViews','showInput','locale','cancel','addComment','CommentView','_localUser','isEnabled','hasDirtyComment','focus','_config','canDiscard','removeComment','set','commentInputView','length','commentThread','delegate','fire','isReadOnly','editor','_model','authoredAt','destroy','_createCommentThreadInputView','commentsListView','commentThreadInputView','disabledSubmit','updateComment','value','isActive','isDirty','bind','descriptionParts'];(function(_0x10e553,_0x41f80a){const _0x38577c=function(_0x3a85f0){while(--_0x3a85f0){_0x10e553['push'](_0x10e553['shift']());}};_0x38577c(++_0x41f80a);}(_0x41f8,0xab));const _0x3857=function(_0x10e553,_0x41f80a){_0x10e553=_0x10e553-0x0;let _0x38577c=_0x41f8[_0x10e553];return _0x38577c;};import{View as _0x6b3e06}from'ckeditor5/src/ui';export default class si extends _0x6b3e06{constructor(_0x59b49a,_0x3cf086,_0x2331c5,_0x38f05d){super(_0x59b49a),this['commentsListView']=null,this[_0x3857('0x19')]=null,this['set'](_0x3857('0x1d'),!0x1),this[_0x3857('0xc')](_0x3857('0x15'),_0x3cf086[_0x3857('0x15')]),this[_0x3857('0x1f')](_0x3857('0x15'))['to'](_0x3cf086),this[_0x3857('0xc')](_0x3857('0x20'),[]),this[_0x3857('0xc')](_0x3857('0x1e'),!0x1),this['set'](_0x3857('0x6'),!0x1),this['set']('canAccept',!0x1),this[_0x3857('0xc')](_0x3857('0xa'),!0x1),this[_0x3857('0x14')]=_0x3cf086,this[_0x3857('0x5')]=_0x2331c5,this[_0x3857('0x9')]=_0x38f05d,_0x38f05d['disableComments']?this[_0x3857('0xc')](_0x3857('0xe'),0x1):this['_createCommentViews']();}[_0x3857('0x8')](){this['element'][_0x3857('0x8')]();}['destroy'](){this[_0x3857('0x18')]&&this['commentsListView'][_0x3857('0x16')](),this[_0x3857('0x19')]&&this[_0x3857('0x19')][_0x3857('0x16')](),super[_0x3857('0x16')]();}[_0x3857('0x21')](){const {CommentsListView:_0x4c5df3}=this['_config'];this[_0x3857('0x18')]=new _0x4c5df3(this[_0x3857('0x1')],this[_0x3857('0x14')][_0x3857('0xf')],Object['assign']({'CommentView':this[_0x3857('0x9')][_0x3857('0x4')]},this[_0x3857('0x9')])),this[_0x3857('0x18')]['delegate'](_0x3857('0xb'))['to'](this),this['commentsListView'][_0x3857('0x10')](_0x3857('0x1b'))['to'](this),this['commentsListView'][_0x3857('0x1f')](_0x3857('0x1d'))['to'](this),this[_0x3857('0xc')](_0x3857('0xe'),this[_0x3857('0x18')][_0x3857('0xe')]+0x1),this[_0x3857('0x1f')](_0x3857('0xe'))['to'](this['commentsListView'],'length',_0x5b09d3=>_0x5b09d3+0x1),this[_0x3857('0x19')]=this['_createCommentThreadInputView'](),this['on'](_0x3857('0xb'),()=>this[_0x3857('0x8')]()),this[_0x3857('0x1f')](_0x3857('0x1e'))['to'](this[_0x3857('0x18')],_0x3857('0x7'),this[_0x3857('0x19')][_0x3857('0xd')],'value',(_0x4af6a6,_0x54e6e9)=>_0x4af6a6||!!_0x54e6e9);}[_0x3857('0x17')](){const {CommentThreadInputView:_0x3c2def}=this['_config'],_0x5c5b4b=new _0x3c2def(this[_0x3857('0x1')],this[_0x3857('0x5')],this[_0x3857('0x9')]['editorConfig']),_0x3de0cf=_0x5c5b4b[_0x3857('0xd')];return _0x5c5b4b[_0x3857('0x1f')](_0x3857('0x0'))['to'](this,_0x3857('0x1d'),this[_0x3857('0x14')][_0x3857('0xf')],_0x3857('0x12'),_0x3de0cf,_0x3857('0x1c'),(_0x53243d,_0x482d31,_0x5894e1)=>!!_0x5894e1||_0x53243d&&!_0x482d31),_0x3de0cf['on']('submit',(_0x11aa58,_0x5e8694)=>{this[_0x3857('0x11')](_0x3857('0x3'),_0x5e8694),_0x3de0cf[_0x3857('0x13')]['setData']('');}),_0x3de0cf['on'](_0x3857('0x2'),()=>this['focus']()),_0x3de0cf[_0x3857('0x1f')](_0x3857('0x1a'))['to'](this[_0x3857('0x14')][_0x3857('0xf')],_0x3857('0x12')),_0x5c5b4b;}}
|