@ckeditor/ckeditor5-revision-history 38.0.1 → 38.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/build/revision-history.js +1 -1
  2. package/package.json +13 -11
  3. package/src/augmentation.d.ts +25 -25
  4. package/src/changeitem.d.ts +57 -57
  5. package/src/changeitem.js +1 -1
  6. package/src/editor/revisionviewereditor.d.ts +27 -27
  7. package/src/editor/revisionviewereditor.js +1 -1
  8. package/src/editor/revisionviewereditorui.d.ts +28 -28
  9. package/src/editor/revisionviewereditorui.js +1 -1
  10. package/src/editor/revisionviewereditoruiview.d.ts +43 -43
  11. package/src/editor/revisionviewereditoruiview.js +1 -1
  12. package/src/index.d.ts +11 -10
  13. package/src/revision.d.ts +153 -153
  14. package/src/revision.js +1 -1
  15. package/src/revisiondiff.d.ts +20 -20
  16. package/src/revisiondiff.js +1 -1
  17. package/src/revisionhistory.d.ts +95 -93
  18. package/src/revisionhistory.js +1 -1
  19. package/src/revisionhistoryadapter.d.ts +60 -60
  20. package/src/revisionhistoryconfig.d.ts +60 -60
  21. package/src/revisionsrepository.d.ts +48 -43
  22. package/src/revisionsrepository.js +1 -1
  23. package/src/revisiontracker.d.ts +77 -72
  24. package/src/revisiontracker.js +1 -1
  25. package/src/revisionviewer.d.ts +21 -21
  26. package/src/revisionviewer.js +1 -1
  27. package/src/ui/revision/createrevisionactionsdropdown.d.ts +9 -9
  28. package/src/ui/revision/createrevisionactionsdropdown.js +1 -1
  29. package/src/ui/revision/revisionauthorview.d.ts +4 -4
  30. package/src/ui/revision/revisionauthorview.js +1 -1
  31. package/src/ui/revision/revisionnameview.d.ts +4 -4
  32. package/src/ui/revision/revisionnameview.js +1 -1
  33. package/src/ui/revision/revisionview.d.ts +91 -91
  34. package/src/ui/revision/revisionview.js +1 -1
  35. package/src/ui/revision/subrevisioncollapserview.d.ts +17 -17
  36. package/src/ui/revision/subrevisioncollapserview.js +1 -1
  37. package/src/ui/revision/subrevisionview.d.ts +30 -30
  38. package/src/ui/revision/subrevisionview.js +1 -1
  39. package/src/ui/revision/utils.d.ts +4 -4
  40. package/src/ui/revision/utils.js +1 -1
  41. package/src/ui/revisionhistory/revisionhistorysaverevisionformview.d.ts +80 -80
  42. package/src/ui/revisionhistory/revisionhistorysaverevisionformview.js +1 -1
  43. package/src/ui/revisionhistory/revisionhistoryui.d.ts +22 -21
  44. package/src/ui/revisionhistory/revisionhistoryui.js +1 -1
  45. package/src/ui/revisionssidebar/revisionssidebar.d.ts +40 -39
  46. package/src/ui/revisionssidebar/revisionssidebar.js +1 -1
  47. package/src/ui/revisionssidebar/revisionssidebarheaderview.d.ts +4 -4
  48. package/src/ui/revisionssidebar/revisionssidebarheaderview.js +1 -1
  49. package/src/ui/revisionssidebar/revisionssidebartimeperiodview.d.ts +25 -25
  50. package/src/ui/revisionssidebar/revisionssidebartimeperiodview.js +1 -1
  51. package/src/ui/revisionssidebar/revisionssidebarview.d.ts +40 -40
  52. package/src/ui/revisionssidebar/revisionssidebarview.js +1 -1
  53. package/src/ui/revisionssidebar/utils.d.ts +8 -8
  54. package/src/ui/revisionssidebar/utils.js +1 -1
  55. package/src/ui/revisionviewer/changedetailsview.d.ts +18 -18
  56. package/src/ui/revisionviewer/changedetailsview.js +1 -1
  57. package/src/ui/revisionviewer/changesnavigationview.d.ts +36 -36
  58. package/src/ui/revisionviewer/changesnavigationview.js +1 -1
  59. package/src/ui/revisionviewer/revisionviewerloadingoverlay.d.ts +22 -22
  60. package/src/ui/revisionviewer/revisionviewerloadingoverlay.js +1 -1
  61. package/src/ui/revisionviewer/revisionviewerui.d.ts +24 -22
  62. package/src/ui/revisionviewer/revisionviewerui.js +1 -1
  63. package/src/utils/common-translations.d.ts +7 -7
  64. package/src/utils/common-translations.js +1 -1
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x43db=['Autosave','_update','toolbar','changesNavigation','enqueueChange','revisionHistory','RevisionViewer','RestrictedEditingMode','addUser','repository','get','concat','users','keys','isEnabled','addRoot','showRevisionViewerCallback','getMarkersGroup','numeric','detachRoot','data','none','has','setAttribute','revisionHistory.showRevisionViewerCallback','Users','update','filter','getAttributeKeys','getRootNames','_closeRevisionViewer','revision-history-missing-configuration','model','every','pluginName','_enhanceCloseRevisionViewerCallback','creator','getRevisionRootsAttributes','restrictedEditingException','block','getRevisions','extraPlugins','builtinPlugins','init','_getRevisionViewerEditorConfig','revision-history-viewer-opened','error','RevisionsRepository','find','set','selection','display','insert','catch','_recalculatePageBreaks','fromVersion','push','createdAt','name','_showRevisionViewer','parse','plugins','long','RevisionHistoryUI','saveRevision','exitToEditing','revisionHistory.viewerContainer','enableReadOnlyMode','function','string','define','config','toLocaleDateString','_viewerEditor','_restoreRevision','style','rootsAttributes','addRevisionData','RevisionHistory','_enhanceShowRevisionViewerCallback','save','toVersion','getRevision','bind','Restored','PaginationLookup','revisionHistory.closeRevisionViewerCallback','restoreRevision','disableReadOnlyMode','RevisionTracker','adapter','editor','refreshVisibility','includes','context','then','revisionHistory.editorContainer','revisionHistory.restoreRevisionCallback','document','WebSocketGateway','constructor','getRevisionData','locale','DocumentOutline','uiLanguage','isReady','toJSON','requires','setSelection','Annotations','toLocaleTimeString'];(function(_0x389243,_0x43dbec){const _0x8a230b=function(_0x57b39e){while(--_0x57b39e){_0x389243['push'](_0x389243['shift']());}};_0x8a230b(++_0x43dbec);}(_0x43db,0x151));const _0x8a23=function(_0x389243,_0x43dbec){_0x389243=_0x389243-0x0;let _0x8a230b=_0x43db[_0x389243];return _0x8a230b;};import{Plugin as _0x483c37}from'ckeditor5/src/core';import{CKEditorError as _0x53fd35,uid as _0x1b0b6d}from'ckeditor5/src/utils';import _0x3b97aa from'./revisiontracker';import _0x54e44f from'./ui/revisionhistory/revisionhistoryui';import _0x138425 from'./revisionviewer';import _0x508132 from'./ui/revisionviewer/revisionviewerui';import _0x51b4f9 from'./ui/revisionssidebar/revisionssidebar';import _0x53ec0b from'./editor/revisionviewereditor';import{getTranslation as _0x1367f7}from'./utils/common-translations';export default class p extends _0x483c37{static get[_0x8a23('0x1e')](){return _0x8a23('0x4a');}static get[_0x8a23('0x67')](){return[_0x3b97aa,_0x54e44f];}constructor(_0x5b8dcb){if(super(_0x5b8dcb),!this[_0x8a23('0x57')][_0x8a23('0x43')][_0x8a23('0x6')]('revisionHistory'))throw new _0x53fd35(_0x8a23('0x1b'),this);this[_0x8a23('0x45')]=null,this[_0x8a23('0x57')][_0x8a23('0x43')][_0x8a23('0x42')](_0x8a23('0x14'),_0x4b47aa=>this[_0x8a23('0x37')](_0x4b47aa)),this[_0x8a23('0x57')][_0x8a23('0x43')][_0x8a23('0x42')](_0x8a23('0x52'),_0x3e2ffd=>this[_0x8a23('0x1a')](_0x3e2ffd)),this['editor'][_0x8a23('0x43')][_0x8a23('0x42')](_0x8a23('0x5d'),_0x35c956=>this[_0x8a23('0x46')](_0x35c956)),this[_0x8a23('0x4b')](),this['_enhanceCloseRevisionViewerCallback']();}set[_0x8a23('0x56')](_0x3fcc6c){this[_0x8a23('0x57')]['plugins']['get'](_0x8a23('0x55'))['adapter']=_0x3fcc6c;}get[_0x8a23('0x56')](){return this['editor']['plugins'][_0x8a23('0x6')](_0x8a23('0x55'))[_0x8a23('0x56')];}[_0x8a23('0x49')](_0x12a382){return this[_0x8a23('0x57')][_0x8a23('0x39')][_0x8a23('0x6')](_0x8a23('0x55'))[_0x8a23('0x49')](_0x12a382);}[_0x8a23('0x4e')](_0x343cc8){return this[_0x8a23('0x57')][_0x8a23('0x39')][_0x8a23('0x6')](_0x8a23('0x2b'))[_0x8a23('0x4e')](_0x343cc8);}[_0x8a23('0x24')](_0x1528eb={'toJSON':!0x1}){return this[_0x8a23('0x57')]['plugins'][_0x8a23('0x6')](_0x8a23('0x2b'))['getRevisions'](_0x1528eb);}[_0x8a23('0x28')](){const _0x240497=[_0x8a23('0x5a')],_0xc0d0fd=[_0x8a23('0x55'),_0x8a23('0x3b'),_0x8a23('0x5f'),_0x8a23('0x3'),'Autosave',_0x8a23('0x63')],_0x1f7f44={},_0x21f580=this['editor'],_0x4b25a1=_0x21f580[_0x8a23('0x39')]['get'](_0x8a23('0x55')),_0x93007c=_0x21f580[_0x8a23('0x39')][_0x8a23('0x6')](_0x8a23('0x15'))[_0x8a23('0x8')];for(const _0x14eb7d of _0x21f580[_0x8a23('0x43')]['names']())_0x240497[_0x8a23('0x59')](_0x14eb7d)||(_0x1f7f44[_0x14eb7d]=_0x21f580[_0x8a23('0x43')][_0x8a23('0x6')](_0x14eb7d));delete _0x1f7f44['initialData'],delete _0x1f7f44[_0x8a23('0x48')],_0x1f7f44[_0x8a23('0x6d')]=[_0x8a23('0x3d'),'restoreRevision',_0x8a23('0x6e')];const _0x17f643=this[_0x8a23('0x57')][_0x8a23('0x60')][_0x8a23('0x26')]||[],_0x32de73=_0x1f7f44[_0x8a23('0x25')]||[];delete _0x1f7f44[_0x8a23('0x25')];const _0x2273f3=_0x17f643[_0x8a23('0x7')](_0x1f7f44[_0x8a23('0x39')])[_0x8a23('0x7')](_0x32de73)['map'](_0x469cf9=>_0x8a23('0x41')==typeof _0x469cf9?_0x17f643[_0x8a23('0x2c')](_0x221169=>_0x221169['pluginName']==_0x469cf9):_0x469cf9);let _0x40925a=!0x1;_0x1f7f44[_0x8a23('0x39')]=Array['from'](new Set(_0x2273f3))[_0x8a23('0x17')](_0xde14e7=>_0x5d2a3a(_0xde14e7,_0x21f580[_0x8a23('0x39')],[])),_0x40925a&&_0x1f7f44['plugins']['push'](_0x21f580['plugins'][_0x8a23('0x6')](_0x8a23('0x5f'))[_0x8a23('0x60')]);function _0x5d2a3a(_0x212bac,_0x3c38e2,_0x447eeb){const _0x24611e=_0x8a23('0x40')==typeof _0x212bac?_0x212bac[_0x8a23('0x1e')]||_0x212bac[_0x8a23('0x36')]:_0x212bac;if(_0x8a23('0x5f')===_0x24611e&&(_0x40925a=!0x0),_0x447eeb[_0x8a23('0x59')](_0x24611e))return!0x0;if(_0x447eeb['push'](_0x24611e),_0xc0d0fd[_0x8a23('0x59')](_0x24611e))return!0x1;const _0x564c6f=(('function'==typeof _0x212bac?_0x212bac:_0x3c38e2['has'](_0x24611e)?_0x3c38e2[_0x8a23('0x6')](_0x24611e):{})[_0x8a23('0x67')]||[])[_0x8a23('0x1d')](_0x1dd1d1=>_0x5d2a3a(_0x1dd1d1,_0x3c38e2,_0x447eeb));return _0x564c6f||_0xc0d0fd['push'](_0x24611e),_0x564c6f;}return _0x1f7f44[_0x8a23('0x39')][_0x8a23('0x34')](_0x138425,_0x508132,class extends _0x483c37{static get[_0x8a23('0x67')](){return[_0x138425,_0x8a23('0x15')];}[_0x8a23('0x27')](){const _0x110064=this[_0x8a23('0x57')][_0x8a23('0x39')][_0x8a23('0x6')](_0x8a23('0x15'));for(const _0x5d24eb of _0x93007c)_0x5d24eb['isAnonymous']||_0x110064['getUser'](_0x5d24eb['id'])||_0x110064[_0x8a23('0x4')](_0x5d24eb);const _0x1a69ad=_0x4b25a1['repository'][_0x8a23('0x24')]();let _0x11b39d=null;const _0x1c40f5=this['editor'][_0x8a23('0x39')][_0x8a23('0x6')]('RevisionViewer');_0x1c40f5['adapter']=_0x4b25a1[_0x8a23('0x56')],_0x1c40f5[_0x8a23('0x4f')]('isEnabled')['to'](_0x4b25a1),this[_0x8a23('0x57')]['commands'][_0x8a23('0x6')](_0x8a23('0x53'))[_0x8a23('0x4f')](_0x8a23('0xa'))['to'](_0x21f580,'isReadOnly',_0x2c973c=>!_0x2c973c);for(const _0x37dcd4 of _0x1a69ad){const _0x1b8765=null===_0x37dcd4[_0x8a23('0x20')];if(_0x1b8765&&_0x37dcd4[_0x8a23('0x4d')]===_0x37dcd4[_0x8a23('0x33')])continue;const _0x39ceaa=_0x37dcd4[_0x8a23('0x66')]();_0x1c40f5[_0x8a23('0x49')](_0x39ceaa,(_0x2b7c1b,_0x24297d,_0x3bf3df)=>{if(_0x1b8765){if(_0x11b39d)_0x11b39d[_0x8a23('0x6c')](_0x2b7c1b,_0x24297d);else{if(!_0x24297d){const _0x330bff=_0x3bf3df[_0x8a23('0x66')]();_0x330bff['id']=_0x1b0b6d(),_0x4b25a1[_0x8a23('0x3c')](_0x330bff,_0x3bf3df[_0x8a23('0x4d')])['then'](_0x4f7e6f=>{_0x11b39d=_0x4f7e6f;});}}}else _0x37dcd4[_0x8a23('0x6c')](_0x2b7c1b,_0x24297d);});}}},_0x51b4f9),_0x1f7f44;}[_0x8a23('0x4b')](){const _0x91d2c3=this[_0x8a23('0x57')][_0x8a23('0x43')][_0x8a23('0x6')](_0x8a23('0x1'))[_0x8a23('0xc')];this[_0x8a23('0x57')][_0x8a23('0x43')][_0x8a23('0x2d')]('revisionHistory.showRevisionViewerCallback',async()=>{this[_0x8a23('0x57')][_0x8a23('0x3f')](_0x8a23('0x29'));const _0x320160=this[_0x8a23('0x57')][_0x8a23('0x39')][_0x8a23('0x6')]('RevisionTracker');if(this[_0x8a23('0x57')]['plugins']['has']('Autosave')){const _0x2dec8d=this[_0x8a23('0x57')][_0x8a23('0x39')][_0x8a23('0x6')](_0x8a23('0x6b'));await _0x2dec8d[_0x8a23('0x4c')]();}else await _0x320160[_0x8a23('0x16')]();this[_0x8a23('0x57')]['plugins'][_0x8a23('0x12')](_0x8a23('0x51'))&&this['editor'][_0x8a23('0x39')]['get']('PaginationLookup')['_recalculatePageBreaks']();const _0x3369e5=this[_0x8a23('0x28')]();return _0x91d2c3(_0x3369e5)[_0x8a23('0x5b')](_0x2fd0eb=>{return(this[_0x8a23('0x45')]=_0x2fd0eb,this[_0x8a23('0x57')][_0x8a23('0x39')][_0x8a23('0x12')](_0x8a23('0x69')))&&this[_0x8a23('0x57')]['plugins'][_0x8a23('0x6')]('Annotations')[_0x8a23('0x58')](),_0x2fd0eb;})[_0x8a23('0x31')](_0x224159=>(console[_0x8a23('0x2a')](_0x224159),this['editor'][_0x8a23('0x54')](_0x8a23('0x29')),null));});}[_0x8a23('0x1f')](){const _0x5a254=this[_0x8a23('0x57')][_0x8a23('0x43')]['get'](_0x8a23('0x1'))['closeRevisionViewerCallback'];this['editor'][_0x8a23('0x43')][_0x8a23('0x2d')]('revisionHistory.closeRevisionViewerCallback',()=>(this['editor'][_0x8a23('0x39')][_0x8a23('0x12')](_0x8a23('0x51'))&&this[_0x8a23('0x57')][_0x8a23('0x39')]['get'](_0x8a23('0x51'))[_0x8a23('0x32')](),this[_0x8a23('0x45')][_0x8a23('0x39')]['get'](_0x8a23('0x2'))['_cleanUp'](),_0x5a254(this[_0x8a23('0x45')])[_0x8a23('0x5b')](()=>{if(this[_0x8a23('0x57')][_0x8a23('0x54')](_0x8a23('0x29')),this[_0x8a23('0x45')]=null,this['editor'][_0x8a23('0x39')][_0x8a23('0x12')](_0x8a23('0x69'))){const _0x353916=this['editor'][_0x8a23('0x39')][_0x8a23('0x6')](_0x8a23('0x69'));_0x353916['refreshVisibility'](),_0x353916['refreshPositioning']();}})));}['_showRevisionViewer'](_0x3970d2){const _0x1e3dbb=this[_0x8a23('0x57')]['config'][_0x8a23('0x6')]('revisionHistory.editorContainer'),_0x313cb8=this[_0x8a23('0x57')]['config'][_0x8a23('0x6')](_0x8a23('0x3e')),_0x4e5e5e=this[_0x8a23('0x57')][_0x8a23('0x43')]['get']('revisionHistory.viewerEditorElement');return _0x53ec0b['create'](_0x4e5e5e,_0x3970d2)['then'](_0x3113e5=>(_0x313cb8[_0x8a23('0x47')][_0x8a23('0x2f')]=_0x8a23('0x23'),_0x1e3dbb['style'][_0x8a23('0x2f')]=_0x8a23('0x11'),_0x3113e5));}[_0x8a23('0x1a')](_0x270759){const _0x192105=this[_0x8a23('0x57')]['config'][_0x8a23('0x6')](_0x8a23('0x5c'));return this[_0x8a23('0x57')][_0x8a23('0x43')][_0x8a23('0x6')](_0x8a23('0x3e'))[_0x8a23('0x47')]['display']=_0x8a23('0x11'),_0x192105[_0x8a23('0x47')][_0x8a23('0x2f')]='',_0x270759['destroy']();}async[_0x8a23('0x46')](_0x3a2a57){const _0x51feda=this[_0x8a23('0x57')],_0x131cb4=this[_0x8a23('0x45')][_0x8a23('0x39')][_0x8a23('0x6')]('RevisionViewer'),_0x3bfcfb=_0x51feda[_0x8a23('0x39')]['get']('RevisionTracker'),_0x6f225e=_0x131cb4[_0x8a23('0x5')][_0x8a23('0x4e')](_0x3a2a57);let _0x1a89c1,_0x29567c,_0x37413a;try{_0x1a89c1=await _0x131cb4[_0x8a23('0x61')](_0x6f225e),_0x29567c=await _0x131cb4[_0x8a23('0x21')](_0x6f225e);}catch(_0x2638bf){return void console['error'](_0x2638bf);}_0x51feda[_0x8a23('0x1c')]['change'](_0xa8585f=>{for(const _0x5bd588 of Array['from'](_0x51feda[_0x8a23('0x1c')]['markers'][_0x8a23('0xd')](_0x8a23('0x22'))))_0xa8585f['removeMarker'](_0x5bd588);}),_0x131cb4[_0x8a23('0x65')]=!0x1,_0x51feda[_0x8a23('0x1c')][_0x8a23('0x0')](_0x3238bf=>{_0x3238bf[_0x8a23('0x68')](null),_0x3238bf['removeSelectionAttribute'](_0x51feda[_0x8a23('0x1c')]['document'][_0x8a23('0x2e')][_0x8a23('0x18')]());for(const _0x458db5 of _0x51feda[_0x8a23('0x1c')][_0x8a23('0x5e')][_0x8a23('0x19')]())_0x3238bf[_0x8a23('0xf')](_0x458db5);for(const _0x33ae8e of Object[_0x8a23('0x9')](_0x1a89c1)){const _0xc35b70=_0x3238bf[_0x8a23('0xb')](_0x33ae8e);for(const _0x30c594 of Object[_0x8a23('0x9')](_0x29567c[_0x33ae8e]))_0x3238bf[_0x8a23('0x13')](_0x30c594,_0x29567c[_0x33ae8e][_0x30c594],_0xc35b70);_0x3238bf[_0x8a23('0x30')](_0x51feda[_0x8a23('0x10')][_0x8a23('0x38')](_0x1a89c1[_0x33ae8e],_0xc35b70),_0xc35b70,0x0);}});const _0x4cc6e7=_0x1367f7(_0x51feda[_0x8a23('0x62')],_0x8a23('0x50'));if(_0x6f225e[_0x8a23('0x36')])_0x37413a=-0x1==_0x6f225e[_0x8a23('0x36')]['indexOf'](_0x4cc6e7)?_0x4cc6e7+':\x20'+_0x6f225e[_0x8a23('0x36')]:_0x6f225e[_0x8a23('0x36')];else _0x37413a=_0x4cc6e7+':\x20'+(_0x6f225e[_0x8a23('0x35')][_0x8a23('0x44')](_0x51feda[_0x8a23('0x62')][_0x8a23('0x64')],{'month':_0x8a23('0x3a'),'day':'numeric'})+',\x20'+_0x6f225e[_0x8a23('0x35')][_0x8a23('0x6a')](_0x51feda[_0x8a23('0x62')][_0x8a23('0x64')],{'hour':_0x8a23('0xe'),'minute':'numeric'}));return await _0x3bfcfb[_0x8a23('0x3c')]({'name':_0x37413a}),_0x131cb4[_0x8a23('0x65')]=!0x0,_0x51feda['config']['get'](_0x8a23('0x1'))['closeRevisionViewerCallback']();}}
23
+ const _0xe461=['DocumentOutline','destroy','Autosave','toLocaleTimeString','_showRevisionViewer','revisionHistory.restoreRevisionCallback','includes','Users','selection','style','has','closeRevisionViewerCallback','refreshVisibility','define','isEnabled','restoreRevision','getRevisions','getRevisionRootsAttributes','numeric','adapter','model','initialData','builtinPlugins','keys','addRoot','requires','Restored','find','then','catch','parse','document','PaginationLookup','revision-history-missing-configuration','editor','getAttributeKeys','bind','saveRevision','uiLanguage','getRevision','Annotations','detachRoot','_viewerEditor','string','setSelection','removeSelectionAttribute','getRevisionData','_cleanUp','revisionHistory.editorContainer','isReadOnly','changesNavigation','isReady','concat','from','restrictedEditingException','getUser','_update','revisionHistory.viewerContainer','name','push','removeMarker','display','map','_recalculatePageBreaks','function','_enhanceCloseRevisionViewerCallback','_restoreRevision','rootsAttributes','context','revisionHistory','refreshPositioning','set','end','update','addRevisionData','insert','_enhanceShowRevisionViewerCallback','RevisionViewerIntegration','disableReadOnlyMode','RevisionViewer','revisionHistory.viewerEditorElement','config','every','toVersion','constructor','createdAt','WebSocketGateway','RevisionsRepository','extraPlugins','RevisionTracker','init','RestrictedEditingMode','revisionHistory.closeRevisionViewerCallback','revision-history-viewer-opened','get','getMarkersGroup','pluginName','markers','error','toJSON','plugins','none','locale','result','enqueueChange','names','revisionHistory.showRevisionViewerCallback','_getRevisionViewerEditorConfig','RevisionHistory'];(function(_0x24430b,_0xe46103){const _0x1b6d99=function(_0x555c20){while(--_0x555c20){_0x24430b['push'](_0x24430b['shift']());}};_0x1b6d99(++_0xe46103);}(_0xe461,0xfc));const _0x1b6d=function(_0x24430b,_0xe46103){_0x24430b=_0x24430b-0x0;let _0x1b6d99=_0xe461[_0x24430b];return _0x1b6d99;};import{Plugin as _0x5c6ace}from'ckeditor5/src/core';import{CKEditorError as _0xa61ff1,uid as _0x1def92}from'ckeditor5/src/utils';import _0x1d999a from'./revisiontracker';import _0x5e8630 from'./ui/revisionhistory/revisionhistoryui';import _0x206912 from'./revisionviewer';import _0x54c77a from'./ui/revisionviewer/revisionviewerui';import _0x2c36a1 from'./ui/revisionssidebar/revisionssidebar';import _0x3f34d4 from'./editor/revisionviewereditor';import{getTranslation as _0x43aa2f}from'./utils/common-translations';class p extends _0x5c6ace{static get['pluginName'](){return _0x1b6d('0x2b');}constructor(_0x2fa76a){super(_0x2fa76a),this[_0x1b6d('0x45')]=_0x1b6d('0x26');}}export default class g extends _0x5c6ace{static get['pluginName'](){return _0x1b6d('0x4a');}static get[_0x1b6d('0x64')](){return[_0x1d999a,_0x5e8630];}constructor(_0x962b55){if(super(_0x962b55),!this['editor'][_0x1b6d('0x2f')][_0x1b6d('0x3c')](_0x1b6d('0x23')))throw new _0xa61ff1(_0x1b6d('0x6c'),this);this[_0x1b6d('0x8')]=null,this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x58')](_0x1b6d('0x48'),_0x156816=>this[_0x1b6d('0x4f')](_0x156816)),this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x58')](_0x1b6d('0x3a'),_0x4862ac=>this['_closeRevisionViewer'](_0x4862ac)),this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x58')](_0x1b6d('0x50'),_0xa2522e=>this[_0x1b6d('0x20')](_0xa2522e)),this[_0x1b6d('0x2a')](),this[_0x1b6d('0x1f')]();}set[_0x1b6d('0x5e')](_0x338278){this[_0x1b6d('0x0')][_0x1b6d('0x42')]['get']('RevisionTracker')[_0x1b6d('0x5e')]=_0x338278;}get['adapter'](){return this[_0x1b6d('0x0')][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x37'))['adapter'];}[_0x1b6d('0x28')](_0x135200){return this[_0x1b6d('0x0')][_0x1b6d('0x42')]['get']('RevisionTracker')['addRevisionData'](_0x135200);}[_0x1b6d('0x5')](_0x1ab51c){return this['editor'][_0x1b6d('0x42')][_0x1b6d('0x3c')]('RevisionsRepository')['getRevision'](_0x1ab51c);}[_0x1b6d('0x5b')](_0x4ba3c9={'toJSON':!0x1}){return this['editor']['plugins'][_0x1b6d('0x3c')](_0x1b6d('0x35'))[_0x1b6d('0x5b')](_0x4ba3c9);}['_getRevisionViewerEditorConfig'](){const _0x2bcc8d=[_0x1b6d('0x22')],_0x9cb433=[_0x1b6d('0x37'),'RevisionHistoryUI',_0x1b6d('0x34'),_0x1b6d('0x39'),_0x1b6d('0x4d'),_0x1b6d('0x4b')],_0x1ee95d={},_0x4f590a=this[_0x1b6d('0x0')],_0xccb18e=_0x4f590a[_0x1b6d('0x42')]['get'](_0x1b6d('0x37')),_0x1f6b8d=_0x4f590a[_0x1b6d('0x42')]['get']('Users')['users'];for(const _0x13ef48 of _0x4f590a[_0x1b6d('0x2f')][_0x1b6d('0x47')]())_0x2bcc8d['includes'](_0x13ef48)||(_0x1ee95d[_0x13ef48]=_0x4f590a[_0x1b6d('0x2f')][_0x1b6d('0x3c')](_0x13ef48));delete _0x1ee95d[_0x1b6d('0x60')],delete _0x1ee95d[_0x1b6d('0x21')],_0x1ee95d['toolbar']=['exitToEditing','restoreRevision',_0x1b6d('0x10')];const _0x6cb823=this[_0x1b6d('0x0')][_0x1b6d('0x32')][_0x1b6d('0x61')]||[],_0xda1a44=_0x1ee95d[_0x1b6d('0x36')]||[];delete _0x1ee95d['extraPlugins'];const _0x572441=_0x4f590a['_context']['config'][_0x1b6d('0x3c')]('plugins')||[],_0x3d7011=_0x6cb823[_0x1b6d('0x12')](_0x1ee95d[_0x1b6d('0x42')])[_0x1b6d('0x12')](_0xda1a44)[_0x1b6d('0x12')](_0x572441)[_0x1b6d('0x1c')](_0x3696dd=>_0x1b6d('0x9')==typeof _0x3696dd?_0x6cb823[_0x1b6d('0x66')](_0x5d0226=>_0x5d0226[_0x1b6d('0x3e')]==_0x3696dd):_0x3696dd);_0x1ee95d[_0x1b6d('0x42')]=Array[_0x1b6d('0x13')](new Set(_0x3d7011))['filter'](_0x27b7fe=>_0x1f1a4c(_0x27b7fe,_0x4f590a[_0x1b6d('0x42')],[]));function _0x1f1a4c(_0x410927,_0x4b20bf,_0x239dc5){const _0x52863a=_0x1b6d('0x1e')==typeof _0x410927?_0x410927['pluginName']||_0x410927[_0x1b6d('0x18')]:_0x410927;if(_0x239dc5[_0x1b6d('0x51')](_0x52863a))return!0x0;if(_0x239dc5[_0x1b6d('0x19')](_0x52863a),_0x9cb433[_0x1b6d('0x51')](_0x52863a))return!0x1;const _0x7fa6dd=((_0x1b6d('0x1e')==typeof _0x410927?_0x410927:_0x4b20bf[_0x1b6d('0x55')](_0x52863a)?_0x4b20bf[_0x1b6d('0x3c')](_0x52863a):{})[_0x1b6d('0x64')]||[])[_0x1b6d('0x30')](_0x526025=>_0x1f1a4c(_0x526025,_0x4b20bf,_0x239dc5));return _0x7fa6dd||_0x9cb433[_0x1b6d('0x19')](_0x52863a),_0x7fa6dd;}return _0x1ee95d[_0x1b6d('0x42')][_0x1b6d('0x19')](p,_0x206912,_0x54c77a,class extends _0x5c6ace{static get[_0x1b6d('0x64')](){return[_0x206912,_0x1b6d('0x52')];}[_0x1b6d('0x38')](){const _0x159bb4=this['editor'][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x52'));for(const _0x5e0104 of _0x1f6b8d)_0x5e0104['isAnonymous']||_0x159bb4[_0x1b6d('0x15')](_0x5e0104['id'])||_0x159bb4['addUser'](_0x5e0104);const _0x5a437d=_0xccb18e['repository']['getRevisions']();let _0x3500d5=null;const _0x1b33a9=this['editor'][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x2d'));_0x1b33a9[_0x1b6d('0x5e')]=_0xccb18e[_0x1b6d('0x5e')],_0x1b33a9[_0x1b6d('0x2')](_0x1b6d('0x59'))['to'](_0xccb18e),this[_0x1b6d('0x0')]['commands'][_0x1b6d('0x3c')](_0x1b6d('0x5a'))[_0x1b6d('0x2')](_0x1b6d('0x59'))['to'](_0x4f590a,_0x1b6d('0xf'),_0x629eb5=>!_0x629eb5);for(const _0x4f6c8f of _0x5a437d){const _0x19af5a=null===_0x4f6c8f['creator'];if(_0x19af5a&&_0x4f6c8f[_0x1b6d('0x31')]===_0x4f6c8f['fromVersion'])continue;const _0x354bd3=_0x4f6c8f[_0x1b6d('0x41')]();_0x1b33a9['addRevisionData'](_0x354bd3,(_0x186c10,_0x4d6129,_0x3a7e0a)=>{if(_0x19af5a){if(_0x3500d5)_0x3500d5[_0x1b6d('0x16')](_0x186c10,_0x4d6129);else{if(!_0x4d6129){const _0x51dd9a=_0x3a7e0a[_0x1b6d('0x41')]();_0x51dd9a['id']=_0x1def92(),_0xccb18e[_0x1b6d('0x3')](_0x51dd9a,_0x3a7e0a[_0x1b6d('0x31')])[_0x1b6d('0x67')](_0x2726e6=>{_0x3500d5=_0x2726e6;});}}}else _0x4f6c8f[_0x1b6d('0x16')](_0x186c10,_0x4d6129);});}}},_0x2c36a1),_0x1ee95d;}[_0x1b6d('0x2a')](){const _0x507687=this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x3c')]('revisionHistory')['showRevisionViewerCallback'];this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x25')](_0x1b6d('0x48'),async()=>{this[_0x1b6d('0x0')]['enableReadOnlyMode']('revision-history-viewer-opened');const _0x57b704=this[_0x1b6d('0x0')][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x37'));if(this[_0x1b6d('0x0')]['plugins'][_0x1b6d('0x55')](_0x1b6d('0x4d'))){const _0x1a3511=this[_0x1b6d('0x0')][_0x1b6d('0x42')][_0x1b6d('0x3c')]('Autosave');await _0x1a3511['save']();}else await _0x57b704[_0x1b6d('0x27')]();this[_0x1b6d('0x0')]['plugins'][_0x1b6d('0x55')](_0x1b6d('0x6b'))&&this[_0x1b6d('0x0')][_0x1b6d('0x42')]['get'](_0x1b6d('0x6b'))[_0x1b6d('0x1d')]();const _0x55f53c=this[_0x1b6d('0x49')]();return _0x507687(_0x55f53c)[_0x1b6d('0x67')](_0x5a3215=>{return(this[_0x1b6d('0x8')]=_0x5a3215,this['editor'][_0x1b6d('0x42')][_0x1b6d('0x55')](_0x1b6d('0x6')))&&this['editor'][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x6'))[_0x1b6d('0x57')](),_0x5a3215;})[_0x1b6d('0x68')](_0xace921=>(console[_0x1b6d('0x40')](_0xace921),this[_0x1b6d('0x0')]['disableReadOnlyMode'](_0x1b6d('0x3b')),null));});}[_0x1b6d('0x1f')](){const _0x4ce369=this[_0x1b6d('0x0')][_0x1b6d('0x2f')]['get'](_0x1b6d('0x23'))[_0x1b6d('0x56')];this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x25')](_0x1b6d('0x3a'),()=>(this[_0x1b6d('0x0')]['plugins'][_0x1b6d('0x55')](_0x1b6d('0x6b'))&&this[_0x1b6d('0x0')][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x6b'))[_0x1b6d('0x1d')](),this[_0x1b6d('0x8')][_0x1b6d('0x42')][_0x1b6d('0x3c')]('RevisionViewer')[_0x1b6d('0xd')](),_0x4ce369(this[_0x1b6d('0x8')])[_0x1b6d('0x67')](()=>{if(this[_0x1b6d('0x0')][_0x1b6d('0x2c')]('revision-history-viewer-opened'),this['_viewerEditor']=null,this[_0x1b6d('0x0')][_0x1b6d('0x42')][_0x1b6d('0x55')](_0x1b6d('0x6'))){const _0x478333=this['editor'][_0x1b6d('0x42')]['get'](_0x1b6d('0x6'));_0x478333['refreshVisibility'](),_0x478333[_0x1b6d('0x24')]();}})));}[_0x1b6d('0x4f')](_0x5c3d76){const _0x5b755e=this[_0x1b6d('0x0')][_0x1b6d('0x2f')]['get'](_0x1b6d('0xe')),_0x4cbb33=this[_0x1b6d('0x0')][_0x1b6d('0x2f')]['get']('revisionHistory.viewerContainer'),_0x24b322=this[_0x1b6d('0x0')]['config'][_0x1b6d('0x3c')](_0x1b6d('0x2e'));return _0x3f34d4['create'](_0x24b322,_0x5c3d76)[_0x1b6d('0x67')](_0x32c520=>(_0x4cbb33['style'][_0x1b6d('0x1b')]='block',_0x5b755e['style'][_0x1b6d('0x1b')]=_0x1b6d('0x43'),_0x32c520));}['_closeRevisionViewer'](_0x361c6b){const _0xc2061=this[_0x1b6d('0x0')]['config'][_0x1b6d('0x3c')]('revisionHistory.editorContainer');return this[_0x1b6d('0x0')]['config']['get'](_0x1b6d('0x17'))[_0x1b6d('0x54')][_0x1b6d('0x1b')]=_0x1b6d('0x43'),_0xc2061[_0x1b6d('0x54')][_0x1b6d('0x1b')]='',_0x361c6b[_0x1b6d('0x4c')]();}async['_restoreRevision'](_0x1c0d09){const _0x45103a=this['editor'],_0x472cd5=this[_0x1b6d('0x8')][_0x1b6d('0x42')][_0x1b6d('0x3c')]('RevisionViewer'),_0x28a42c=_0x45103a['plugins'][_0x1b6d('0x3c')](_0x1b6d('0x37')),_0x27f920=_0x472cd5['repository']['getRevision'](_0x1c0d09);let _0x260523,_0x26bed9,_0x189991;try{_0x260523=await _0x472cd5[_0x1b6d('0xc')](_0x27f920),_0x26bed9=await _0x472cd5[_0x1b6d('0x5c')](_0x27f920);}catch(_0x38a1f2){return void console[_0x1b6d('0x40')](_0x38a1f2);}_0x45103a['model']['change'](_0x356aa3=>{for(const _0x4c4da6 of Array[_0x1b6d('0x13')](_0x45103a[_0x1b6d('0x5f')][_0x1b6d('0x3f')][_0x1b6d('0x3d')](_0x1b6d('0x14'))))_0x356aa3[_0x1b6d('0x1a')](_0x4c4da6);}),_0x472cd5['isReady']=!0x1,_0x45103a[_0x1b6d('0x5f')][_0x1b6d('0x46')](_0x1c5202=>{_0x1c5202[_0x1b6d('0xa')](null),_0x1c5202[_0x1b6d('0xb')](_0x45103a[_0x1b6d('0x5f')][_0x1b6d('0x6a')][_0x1b6d('0x53')][_0x1b6d('0x1')]());for(const _0x364904 of _0x45103a['model']['document']['getRootNames']())_0x1c5202[_0x1b6d('0x7')](_0x364904);for(const _0x200754 of Object['keys'](_0x260523)){const _0x1f0aad=_0x1c5202[_0x1b6d('0x63')](_0x200754);for(const _0x126a7b of Object[_0x1b6d('0x62')](_0x26bed9[_0x200754]))_0x1c5202['setAttribute'](_0x126a7b,_0x26bed9[_0x200754][_0x126a7b],_0x1f0aad);_0x1c5202[_0x1b6d('0x29')](_0x45103a['data'][_0x1b6d('0x69')](_0x260523[_0x200754],_0x1f0aad),_0x1f0aad,0x0);}});const _0x1a4aaa=_0x43aa2f(_0x45103a[_0x1b6d('0x44')],_0x1b6d('0x65'));if(_0x27f920[_0x1b6d('0x18')])_0x189991=-0x1==_0x27f920[_0x1b6d('0x18')]['indexOf'](_0x1a4aaa)?_0x1a4aaa+':\x20'+_0x27f920[_0x1b6d('0x18')]:_0x27f920['name'];else _0x189991=_0x1a4aaa+':\x20'+(_0x27f920['createdAt']['toLocaleDateString'](_0x45103a[_0x1b6d('0x44')][_0x1b6d('0x4')],{'month':'long','day':_0x1b6d('0x5d')})+',\x20'+_0x27f920[_0x1b6d('0x33')][_0x1b6d('0x4e')](_0x45103a[_0x1b6d('0x44')][_0x1b6d('0x4')],{'hour':'numeric','minute':'numeric'}));return await _0x28a42c[_0x1b6d('0x3')]({'name':_0x189991}),_0x472cd5[_0x1b6d('0x11')]=!0x0,_0x45103a[_0x1b6d('0x2f')]['get'](_0x1b6d('0x23'))['closeRevisionViewerCallback']();}}
@@ -1,60 +1,60 @@
1
- /**
2
- * @module revision-history/revisionhistoryadapter
3
- * @publicApi
4
- */
5
- import type { RevisionData } from './revision';
6
- /**
7
- * The revision history adapter.
8
- *
9
- * The revision history adapter is an object that communicates asynchronously with the data source to fetch or save
10
- * the revisions data. It is used internally by the revision history feature whenever revision data is required, a revision is created,
11
- * or updated.
12
- *
13
- * The adapter is optional. See the {@glink features/collaboration/revision-history/revision-history-integration
14
- * Revision history feature integration} guide to learn more.
15
- *
16
- * To set the adapter, overwrite the {@link module:revision-history/revisionhistory~RevisionHistory#adapter `RevisionHistory#adapter`}
17
- * property.
18
- */
19
- export interface RevisionHistoryAdapter {
20
- /**
21
- * Called when the full revision data is required.
22
- *
23
- * It should return a promise that resolves with the whole revision data.
24
- */
25
- getRevision(data: {
26
- revisionId: string;
27
- channelId: string;
28
- }): Promise<RevisionData>;
29
- /**
30
- * Called when revision(s) data is added or updated.
31
- *
32
- * Multiple revisions can be added and updated at the same moment. The method is passed an array with the updated data.
33
- * Each item in the array is a data object that describes a single revision. Each data object contains revision id. If the revision
34
- * id does not exist in your data source (database), then a new revision should be created. Otherwise, the existing revision
35
- * should be updated with passed data.
36
- *
37
- * The method should return a promise that is resolved when the update is completed.
38
- *
39
- * The `data` parameter only contains those properties of a revision that have changed.
40
- *
41
- * Although the `data` parameter contains `createdAt` property,
42
- * the revision creation date should be set by the backend of your application
43
- * to ensure that all revisions will be saved with correct dates regardless of users' local system time.
44
- * It is recommended to overwrite `createdAt` value whenever it is passed in the `data` parameter.
45
- *
46
- * The promise may resolve with an array of objects. Each object represents an updated revision, for which `createdAt` property
47
- * was set (or changed) on the backend. Each object should have `id` (string) and `createdAt` (`Date` object) properties.
48
- * The returned data will be used to update revisions data in the editor with dates set on the backend.
49
- *
50
- * Although the `data` parameter contains `creatorId` property, you should verify the `creatorId` value when saving a revision
51
- * in the database. **However, do not overwrite the value if it was set to `null`!**
52
- *
53
- * It is recommended to stringify `data.diffData` and `data.attributes` values to JSON and save them as strings in your database,
54
- * and then to parse the strings when loading revisions.
55
- *
56
- * @param data Array with revisions data to add or update.
57
- * @param channelId The ID of the document for which the revisions were created.
58
- */
59
- updateRevisions(data: Array<RevisionData>, channelId: string): Promise<Array<RevisionData>>;
60
- }
1
+ /**
2
+ * @module revision-history/revisionhistoryadapter
3
+ * @publicApi
4
+ */
5
+ import type { RevisionData } from './revision';
6
+ /**
7
+ * The revision history adapter.
8
+ *
9
+ * The revision history adapter is an object that communicates asynchronously with the data source to fetch or save
10
+ * the revisions data. It is used internally by the revision history feature whenever revision data is required, a revision is created,
11
+ * or updated.
12
+ *
13
+ * The adapter is optional. See the {@glink features/collaboration/revision-history/revision-history-integration
14
+ * Revision history feature integration} guide to learn more.
15
+ *
16
+ * To set the adapter, overwrite the {@link module:revision-history/revisionhistory~RevisionHistory#adapter `RevisionHistory#adapter`}
17
+ * property.
18
+ */
19
+ export interface RevisionHistoryAdapter {
20
+ /**
21
+ * Called when the full revision data is required.
22
+ *
23
+ * It should return a promise that resolves with the whole revision data.
24
+ */
25
+ getRevision(data: {
26
+ revisionId: string;
27
+ channelId: string;
28
+ }): Promise<RevisionData>;
29
+ /**
30
+ * Called when revision(s) data is added or updated.
31
+ *
32
+ * Multiple revisions can be added and updated at the same moment. The method is passed an array with the updated data.
33
+ * Each item in the array is a data object that describes a single revision. Each data object contains revision id. If the revision
34
+ * id does not exist in your data source (database), then a new revision should be created. Otherwise, the existing revision
35
+ * should be updated with passed data.
36
+ *
37
+ * The method should return a promise that is resolved when the update is completed.
38
+ *
39
+ * The `data` parameter only contains those properties of a revision that have changed.
40
+ *
41
+ * Although the `data` parameter contains `createdAt` property,
42
+ * the revision creation date should be set by the backend of your application
43
+ * to ensure that all revisions will be saved with correct dates regardless of users' local system time.
44
+ * It is recommended to overwrite `createdAt` value whenever it is passed in the `data` parameter.
45
+ *
46
+ * The promise may resolve with an array of objects. Each object represents an updated revision, for which `createdAt` property
47
+ * was set (or changed) on the backend. Each object should have `id` (string) and `createdAt` (`Date` object) properties.
48
+ * The returned data will be used to update revisions data in the editor with dates set on the backend.
49
+ *
50
+ * Although the `data` parameter contains `creatorId` property, you should verify the `creatorId` value when saving a revision
51
+ * in the database. **However, do not overwrite the value if it was set to `null`!**
52
+ *
53
+ * It is recommended to stringify `data.diffData` and `data.attributes` values to JSON and save them as strings in your database,
54
+ * and then to parse the strings when loading revisions.
55
+ *
56
+ * @param data Array with revisions data to add or update.
57
+ * @param channelId The ID of the document for which the revisions were created.
58
+ */
59
+ updateRevisions(data: Array<RevisionData>, channelId: string): Promise<Array<RevisionData>>;
60
+ }
@@ -1,60 +1,60 @@
1
- /**
2
- * @module revision-history/revisionhistoryconfig
3
- * @publicApi
4
- */
5
- /**
6
- * The configuration of the revision history feature.
7
- *
8
- * ```ts
9
- * ClassicEditor
10
- * .create( {
11
- * revisionHistory: ... // Revision history feature configuration.
12
- * } )
13
- * .then( ... )
14
- * .catch( ... );
15
- * ```
16
- *
17
- * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
18
- */
19
- export interface RevisionHistoryConfig {
20
- /**
21
- * The DOM element that contains the DOM structure for the editor.
22
- *
23
- * This element will be hidden when the user opens the revision history.
24
- */
25
- editorContainer: HTMLElement;
26
- /**
27
- * DOM element which contains the DOM structure for revision history viewer.
28
- *
29
- * This element should be hidden (using CSS) when the editor is initialized.
30
- * This element will be shown when the user opens the revision history viewer.
31
- */
32
- viewerContainer: HTMLElement;
33
- /**
34
- * The DOM element for the revision history viewer editor instance.
35
- *
36
- * This element will be used to initialize the revision history viewer editor instance and will be replaced by it. It should be empty.
37
- */
38
- viewerEditorElement: HTMLElement;
39
- /**
40
- * The DOM element for the revision history viewer sidebar container.
41
- *
42
- * This element will be used as a container for the revision history viewer. The sidebar content will be inserted into it.
43
- */
44
- viewerSidebarContainer: HTMLElement;
45
- /**
46
- * Tells the feature whether it should resume updating previously unsaved revision or should save the previously unsaved revision
47
- * and create a new revision for the changes that will be introduced after the editor is initialized.
48
- *
49
- * By default, the previously unsaved revision is resumed after the editor is initialized.
50
- *
51
- * Note that only unsaved revision can be resumed.
52
- *
53
- * Note that for real-time collaboration, the unsaved revision will be always resumed if the real-time editing session is still active.
54
- * In other words, even if this is set to `false`, the unsaved revision will be resumed, if the editing session did not end since the
55
- * editor was re-initialized. Keep in mind that
56
- * {@glink @cs guides/collaboration/data#temporary-and-permanent-data the editing session is active a long time} after the last user
57
- * leaves the document.
58
- */
59
- resumeUnsavedRevision: boolean;
60
- }
1
+ /**
2
+ * @module revision-history/revisionhistoryconfig
3
+ * @publicApi
4
+ */
5
+ /**
6
+ * The configuration of the revision history feature.
7
+ *
8
+ * ```ts
9
+ * ClassicEditor
10
+ * .create( {
11
+ * revisionHistory: ... // Revision history feature configuration.
12
+ * } )
13
+ * .then( ... )
14
+ * .catch( ... );
15
+ * ```
16
+ *
17
+ * See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
18
+ */
19
+ export interface RevisionHistoryConfig {
20
+ /**
21
+ * The DOM element that contains the DOM structure for the editor.
22
+ *
23
+ * This element will be hidden when the user opens the revision history.
24
+ */
25
+ editorContainer: HTMLElement;
26
+ /**
27
+ * DOM element which contains the DOM structure for revision history viewer.
28
+ *
29
+ * This element should be hidden (using CSS) when the editor is initialized.
30
+ * This element will be shown when the user opens the revision history viewer.
31
+ */
32
+ viewerContainer: HTMLElement;
33
+ /**
34
+ * The DOM element for the revision history viewer editor instance.
35
+ *
36
+ * This element will be used to initialize the revision history viewer editor instance and will be replaced by it. It should be empty.
37
+ */
38
+ viewerEditorElement: HTMLElement;
39
+ /**
40
+ * The DOM element for the revision history viewer sidebar container.
41
+ *
42
+ * This element will be used as a container for the revision history viewer. The sidebar content will be inserted into it.
43
+ */
44
+ viewerSidebarContainer: HTMLElement;
45
+ /**
46
+ * Tells the feature whether it should resume updating previously unsaved revision or should save the previously unsaved revision
47
+ * and create a new revision for the changes that will be introduced after the editor is initialized.
48
+ *
49
+ * By default, the previously unsaved revision is resumed after the editor is initialized.
50
+ *
51
+ * Note that only unsaved revision can be resumed.
52
+ *
53
+ * Note that for real-time collaboration, the unsaved revision will be always resumed if the real-time editing session is still active.
54
+ * In other words, even if this is set to `false`, the unsaved revision will be resumed, if the editing session did not end since the
55
+ * editor was re-initialized. Keep in mind that
56
+ * {@glink @cs guides/collaboration/data#temporary-and-permanent-data the editing session is active a long time} after the last user
57
+ * leaves the document.
58
+ */
59
+ resumeUnsavedRevision: boolean;
60
+ }
@@ -1,43 +1,48 @@
1
- import { Plugin, type PluginDependencies, type Editor } from 'ckeditor5/src/core';
2
- import { default as Revision, type RevisionData, type RevisionJSON } from './revision';
3
- /**
4
- * Manages revisions list.
5
- */
6
- export default class RevisionsRepository extends Plugin {
7
- static get requires(): PluginDependencies;
8
- static get pluginName(): 'RevisionsRepository';
9
- get length(): number;
10
- constructor(editor: Editor);
11
- /**
12
- * @inheritDoc
13
- */
14
- afterInit(): void;
15
- /**
16
- * Creates a revision instance from plain object with revision data.
17
- */
18
- createRevision(revisionData: RevisionData): Revision;
19
- /**
20
- * Adds revision to the repository on a given index.
21
- *
22
- * @param revision The revision instance to add.
23
- * @param index Index on which the revision should be added. If not set, the revision will be added as the first revision.
24
- */
25
- addRevision(revision: Revision, index?: number): void;
26
- /**
27
- * Returns the revision with a given revision id or at a given index.
28
- */
29
- getRevision(revisionIdOrIndex: string | number): Revision | null;
30
- getRevisions(options: {
31
- toJSON: true;
32
- }): Array<RevisionJSON>;
33
- getRevisions(options?: {
34
- toJSON: false;
35
- }): Array<Revision>;
36
- getRevisions(options: {
37
- toJSON: boolean;
38
- }): Array<Revision> | Array<RevisionJSON>;
39
- /**
40
- * Returns the index of the revision with a given revision id.
41
- */
42
- getIndex(revisionId: string | Revision): number;
43
- }
1
+ /**
2
+ * @module revision-history/revisionsrepository
3
+ * @publicApi
4
+ */
5
+ import { Users } from 'ckeditor5-collaboration/src/collaboration-core';
6
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
7
+ import { default as Revision, type RevisionData, type RevisionJSON } from './revision';
8
+ /**
9
+ * Manages revisions list.
10
+ */
11
+ export default class RevisionsRepository extends Plugin {
12
+ static get requires(): readonly [typeof Users];
13
+ static get pluginName(): "RevisionsRepository";
14
+ get length(): number;
15
+ constructor(editor: Editor);
16
+ /**
17
+ * @inheritDoc
18
+ */
19
+ afterInit(): void;
20
+ /**
21
+ * Creates a revision instance from plain object with revision data.
22
+ */
23
+ createRevision(revisionData: RevisionData): Revision;
24
+ /**
25
+ * Adds revision to the repository on a given index.
26
+ *
27
+ * @param revision The revision instance to add.
28
+ * @param index Index on which the revision should be added. If not set, the revision will be added as the first revision.
29
+ */
30
+ addRevision(revision: Revision, index?: number): void;
31
+ /**
32
+ * Returns the revision with a given revision id or at a given index.
33
+ */
34
+ getRevision(revisionIdOrIndex: string | number): Revision | null;
35
+ getRevisions(options: {
36
+ toJSON: true;
37
+ }): Array<RevisionJSON>;
38
+ getRevisions(options?: {
39
+ toJSON: false;
40
+ }): Array<Revision>;
41
+ getRevisions(options: {
42
+ toJSON: boolean;
43
+ }): Array<Revision> | Array<RevisionJSON>;
44
+ /**
45
+ * Returns the index of the revision with a given revision id.
46
+ */
47
+ getIndex(revisionId: string | Revision): number;
48
+ }