@ckeditor/ckeditor5-revision-history 39.0.2 → 40.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/LICENSE.md +1 -1
  2. package/README.md +1 -1
  3. package/build/revision-history.js +1 -1
  4. package/ckeditor5-metadata.json +1 -1
  5. package/package.json +6 -6
  6. package/src/augmentation.d.ts +29 -29
  7. package/src/changeitem.d.ts +58 -58
  8. package/src/changeitem.js +1 -1
  9. package/src/editor/revisionviewereditor.d.ts +27 -27
  10. package/src/editor/revisionviewereditor.js +1 -1
  11. package/src/editor/revisionviewereditorui.d.ts +28 -28
  12. package/src/editor/revisionviewereditorui.js +1 -1
  13. package/src/editor/revisionviewereditoruiview.d.ts +43 -43
  14. package/src/editor/revisionviewereditoruiview.js +1 -1
  15. package/src/index.d.ts +15 -15
  16. package/src/revision.d.ts +153 -153
  17. package/src/revision.js +1 -1
  18. package/src/revisiondiff.d.ts +24 -24
  19. package/src/revisiondiff.js +1 -1
  20. package/src/revisionhistory.d.ts +99 -99
  21. package/src/revisionhistory.js +1 -1
  22. package/src/revisionhistoryadapter.d.ts +64 -64
  23. package/src/revisionhistoryconfig.d.ts +60 -60
  24. package/src/revisionsrepository.d.ts +52 -52
  25. package/src/revisionsrepository.js +1 -1
  26. package/src/revisiontracker.d.ts +81 -81
  27. package/src/revisiontracker.js +1 -1
  28. package/src/revisionviewer.d.ts +25 -25
  29. package/src/revisionviewer.js +1 -1
  30. package/src/ui/revision/createrevisionactionsdropdown.d.ts +10 -10
  31. package/src/ui/revision/createrevisionactionsdropdown.js +1 -1
  32. package/src/ui/revision/revisionauthorview.d.ts +5 -5
  33. package/src/ui/revision/revisionauthorview.js +1 -1
  34. package/src/ui/revision/revisionnameview.d.ts +5 -5
  35. package/src/ui/revision/revisionnameview.js +1 -1
  36. package/src/ui/revision/revisionview.d.ts +95 -95
  37. package/src/ui/revision/revisionview.js +1 -1
  38. package/src/ui/revision/subrevisioncollapserview.d.ts +21 -21
  39. package/src/ui/revision/subrevisioncollapserview.js +1 -1
  40. package/src/ui/revision/subrevisionview.d.ts +34 -34
  41. package/src/ui/revision/subrevisionview.js +1 -1
  42. package/src/ui/revision/utils.d.ts +5 -5
  43. package/src/ui/revision/utils.js +1 -1
  44. package/src/ui/revisionhistory/revisionhistorysaverevisionformview.d.ts +81 -81
  45. package/src/ui/revisionhistory/revisionhistorysaverevisionformview.js +1 -1
  46. package/src/ui/revisionhistory/revisionhistoryui.d.ts +26 -26
  47. package/src/ui/revisionhistory/revisionhistoryui.js +1 -1
  48. package/src/ui/revisionssidebar/revisionssidebar.d.ts +44 -44
  49. package/src/ui/revisionssidebar/revisionssidebar.js +1 -1
  50. package/src/ui/revisionssidebar/revisionssidebarheaderview.d.ts +5 -5
  51. package/src/ui/revisionssidebar/revisionssidebarheaderview.js +1 -1
  52. package/src/ui/revisionssidebar/revisionssidebartimeperiodview.d.ts +29 -29
  53. package/src/ui/revisionssidebar/revisionssidebartimeperiodview.js +1 -1
  54. package/src/ui/revisionssidebar/revisionssidebarview.d.ts +44 -44
  55. package/src/ui/revisionssidebar/revisionssidebarview.js +1 -1
  56. package/src/ui/revisionssidebar/utils.d.ts +9 -9
  57. package/src/ui/revisionssidebar/utils.js +1 -1
  58. package/src/ui/revisionviewer/changedetailsview.d.ts +22 -22
  59. package/src/ui/revisionviewer/changedetailsview.js +1 -1
  60. package/src/ui/revisionviewer/changesnavigationview.d.ts +40 -40
  61. package/src/ui/revisionviewer/changesnavigationview.js +1 -1
  62. package/src/ui/revisionviewer/revisionviewerloadingoverlay.d.ts +26 -26
  63. package/src/ui/revisionviewer/revisionviewerloadingoverlay.js +1 -1
  64. package/src/ui/revisionviewer/revisionviewerui.d.ts +28 -28
  65. package/src/ui/revisionviewer/revisionviewerui.js +1 -1
  66. package/src/utils/common-translations.d.ts +11 -11
  67. package/src/utils/common-translations.js +1 -1
  68. package/theme/changesnavigation.css +9 -0
  69. package/theme/revision/revision.css +9 -0
  70. package/theme/revision/revisionactions.css +9 -0
  71. package/theme/revision/revisionauthor.css +9 -0
  72. package/theme/revision/revisionname.css +9 -0
  73. package/theme/revision/subrevision.css +9 -0
  74. package/theme/revision/subrevisioncollapser.css +9 -0
  75. package/theme/revisionhistorysaverevisionform.css +5 -1
  76. package/theme/revisionssidebar/revisionssidebar.css +9 -0
  77. package/theme/revisionssidebar/revisionssidebarheader.css +9 -0
  78. package/theme/revisionssidebar/revisionssidebartimeperiod.css +9 -0
  79. package/theme/revisionviewer.css +9 -0
  80. package/theme/revisionviewerloadingoverlay.css +9 -0
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x3384=['catch','lazyRoots','includes','_getRevisionViewerEditorConfig','Autosave','locale','refreshVisibility','result','getRevisionData','createRangeIn','save','closeRevisionViewerCallback','creator','PaginationLookup','Restored','set','push','addUser','changesNavigation','long','toLocaleDateString','revisionHistory.restoreRevisionCallback','revisionHistory.showRevisionViewerCallback','Users','has','restrictedEditingException','from','RevisionTracker','revisionHistory.editorContainer','model','change','adapter','detachRoot','display','$graveyard','repository','RestrictedEditingMode','_closeRevisionViewer','revisionHistory.viewerContainer','revision-history-viewer-opened','document','Annotations','isAttached','bind','enableReadOnlyMode','end','addRevisionData','isReady','name','pluginName','disableReadOnlyMode','addRoot','RevisionHistoryUI','getAttributeKeys','users','_enhanceCloseRevisionViewerCallback','indexOf','toLocaleTimeString','init','toVersion','revisionHistory.viewerEditorElement','revisionHistory.closeRevisionViewerCallback','insert','parse','_showRevisionViewer','toJSON','getMarkersGroup','rootName','exitToEditing','revision-history-missing-configuration','fromVersion','error','getRevision','_enhanceShowRevisionViewerCallback','commands','editor','keys','numeric','then','update','_restoreRevision','config','isEnabled','setAttribute','remove','_viewerEditor','_update','enqueueChange','none','getUser','data','get','_recalculatePageBreaks','revisionHistory','requires','block','getRevisionRootsAttributes','create','destroy','isReadOnly','removeAttribute','style','createdAt','RevisionViewer','RevisionsRepository','RevisionHistory','refreshPositioning','_cleanUp','plugins','getRevisions','markers','define','saveRevision'];(function(_0x1e93db,_0x3384dc){const _0x3dc4b1=function(_0x4e763e){while(--_0x4e763e){_0x1e93db['push'](_0x1e93db['shift']());}};_0x3dc4b1(++_0x3384dc);}(_0x3384,0xe4));const _0x3dc4=function(_0x1e93db,_0x3384dc){_0x1e93db=_0x1e93db-0x0;let _0x3dc4b1=_0x3384[_0x1e93db];return _0x3dc4b1;};import{Plugin as _0x41f768}from'ckeditor5/src/core';import{CKEditorError as _0x108216,uid as _0x152869}from'ckeditor5/src/utils';import _0x7ffbbe from'./revisiontracker';import _0x528570 from'./ui/revisionhistory/revisionhistoryui';import _0x35e122 from'./revisionviewer';import _0x36d5d9 from'./ui/revisionviewer/revisionviewerui';import _0x1d6fc3 from'./ui/revisionssidebar/revisionssidebar';import _0x5aeb99 from'./editor/revisionviewereditor';import{getTranslation as _0x5cbc45}from'./utils/common-translations';import{sanitizeEditorConfig as _0x1e6cfa}from'ckeditor5-collaboration/src/collaboration-core';const g=[_0x3dc4('0x32'),_0x3dc4('0x22')];class k extends _0x41f768{static get['pluginName'](){return'RevisionViewerIntegration';}constructor(_0x2680ef){super(_0x2680ef),this[_0x3dc4('0x5')]=_0x3dc4('0x2b');}}export default class b extends _0x41f768{static get[_0x3dc4('0x2f')](){return _0x3dc4('0x67');}static get[_0x3dc4('0x5c')](){return[_0x7ffbbe,_0x528570];}constructor(_0x3e95b6){if(super(_0x3e95b6),!this[_0x3dc4('0x49')][_0x3dc4('0x4f')]['get'](_0x3dc4('0x5b')))throw new _0x108216(_0x3dc4('0x43'),this);this[_0x3dc4('0x53')]=null,this[_0x3dc4('0x49')][_0x3dc4('0x4f')][_0x3dc4('0x6d')]('revisionHistory.showRevisionViewerCallback',_0x4efaa6=>this[_0x3dc4('0x3e')](_0x4efaa6)),this[_0x3dc4('0x49')][_0x3dc4('0x4f')][_0x3dc4('0x6d')](_0x3dc4('0x3b'),_0x486a64=>this['_closeRevisionViewer'](_0x486a64)),this[_0x3dc4('0x49')][_0x3dc4('0x4f')]['define'](_0x3dc4('0x13'),_0x3be363=>this[_0x3dc4('0x4e')](_0x3be363)),this[_0x3dc4('0x47')](),this['_enhanceCloseRevisionViewerCallback']();}set[_0x3dc4('0x1d')](_0x92a4eb){this['editor'][_0x3dc4('0x6a')][_0x3dc4('0x59')](_0x3dc4('0x19'))['adapter']=_0x92a4eb;}get['adapter'](){return this['editor'][_0x3dc4('0x6a')]['get'](_0x3dc4('0x19'))[_0x3dc4('0x1d')];}['addRevisionData'](_0x5029e9){return this[_0x3dc4('0x49')][_0x3dc4('0x6a')][_0x3dc4('0x59')]('RevisionTracker')[_0x3dc4('0x2c')](_0x5029e9);}[_0x3dc4('0x46')](_0x3815a7){return this[_0x3dc4('0x49')][_0x3dc4('0x6a')][_0x3dc4('0x59')](_0x3dc4('0x66'))['getRevision'](_0x3815a7);}[_0x3dc4('0x6b')](_0x45d1f7={'toJSON':!0x1}){return this[_0x3dc4('0x49')]['plugins'][_0x3dc4('0x59')]('RevisionsRepository')[_0x3dc4('0x6b')](_0x45d1f7);}[_0x3dc4('0x1')](){const _0x503138=this['editor'],_0x5d96b2=_0x1e6cfa(_0x503138,g),_0x4fe360=_0x503138[_0x3dc4('0x6a')][_0x3dc4('0x59')](_0x3dc4('0x19')),_0x1d535e=_0x503138[_0x3dc4('0x6a')]['get'](_0x3dc4('0x15'))[_0x3dc4('0x34')];return _0x5d96b2['toolbar']=[_0x3dc4('0x42'),'restoreRevision',_0x3dc4('0x10')],delete _0x5d96b2[_0x3dc4('0x70')],(_0x5d96b2[_0x3dc4('0x6a')][_0x3dc4('0xe')](k,_0x35e122,_0x36d5d9,class extends _0x41f768{static get[_0x3dc4('0x5c')](){return[_0x35e122,_0x3dc4('0x15')];}[_0x3dc4('0x38')](){const _0x3dc7ad=this['editor'][_0x3dc4('0x6a')]['get']('Users');for(const _0x4c8121 of _0x1d535e)_0x4c8121['isAnonymous']||_0x3dc7ad[_0x3dc4('0x57')](_0x4c8121['id'])||_0x3dc7ad[_0x3dc4('0xf')](_0x4c8121);const _0x21a1fe=_0x4fe360['repository'][_0x3dc4('0x6b')]();let _0x3a3a83=null;const _0x3727d7=this[_0x3dc4('0x49')][_0x3dc4('0x6a')][_0x3dc4('0x59')]('RevisionViewer');_0x3727d7[_0x3dc4('0x1d')]=_0x4fe360['adapter'],_0x3727d7[_0x3dc4('0x29')](_0x3dc4('0x50'))['to'](_0x4fe360),this[_0x3dc4('0x49')][_0x3dc4('0x48')][_0x3dc4('0x59')]('restoreRevision')['bind'](_0x3dc4('0x50'))['to'](_0x503138,_0x3dc4('0x61'),_0x1e35b2=>!_0x1e35b2);for(const _0x25ee1b of _0x21a1fe){const _0x82b14a=null===_0x25ee1b[_0x3dc4('0xa')];if(_0x82b14a&&_0x25ee1b['toVersion']===_0x25ee1b[_0x3dc4('0x44')])continue;const _0x15f0f6=_0x25ee1b[_0x3dc4('0x3f')]();_0x3727d7[_0x3dc4('0x2c')](_0x15f0f6,(_0x3435c4,_0x262e5d,_0x19fb4d)=>{if(_0x82b14a){if(_0x3a3a83)_0x3a3a83[_0x3dc4('0x54')](_0x3435c4,_0x262e5d);else{if(!_0x262e5d){const _0x1a69cd=_0x19fb4d[_0x3dc4('0x3f')]();_0x1a69cd['id']=_0x152869(),_0x4fe360['saveRevision'](_0x1a69cd,_0x19fb4d[_0x3dc4('0x39')])['then'](_0x12562b=>{_0x3a3a83=_0x12562b;});}}}else _0x25ee1b[_0x3dc4('0x54')](_0x3435c4,_0x262e5d);});}}},_0x1d6fc3),_0x5d96b2);}[_0x3dc4('0x47')](){const _0x20ec2f=this['editor']['config'][_0x3dc4('0x59')](_0x3dc4('0x5b'))['showRevisionViewerCallback'];this[_0x3dc4('0x49')][_0x3dc4('0x4f')][_0x3dc4('0xd')](_0x3dc4('0x14'),async()=>{this['editor'][_0x3dc4('0x2a')](_0x3dc4('0x25'));const _0x46a3cb=this['editor']['plugins'][_0x3dc4('0x59')](_0x3dc4('0x19'));if(this[_0x3dc4('0x49')][_0x3dc4('0x6a')][_0x3dc4('0x16')](_0x3dc4('0x2'))){const _0x565ea2=this['editor'][_0x3dc4('0x6a')][_0x3dc4('0x59')]('Autosave');await _0x565ea2[_0x3dc4('0x8')]();}else await _0x46a3cb[_0x3dc4('0x4d')]();this[_0x3dc4('0x49')][_0x3dc4('0x6a')][_0x3dc4('0x16')](_0x3dc4('0xb'))&&this['editor'][_0x3dc4('0x6a')][_0x3dc4('0x59')](_0x3dc4('0xb'))[_0x3dc4('0x5a')]();const _0x19691c=this[_0x3dc4('0x1')]();return _0x20ec2f(_0x19691c)[_0x3dc4('0x4c')](_0x4cfe1b=>{return(this[_0x3dc4('0x53')]=_0x4cfe1b,this[_0x3dc4('0x49')][_0x3dc4('0x6a')]['has'](_0x3dc4('0x27')))&&this['editor'][_0x3dc4('0x6a')]['get'](_0x3dc4('0x27'))[_0x3dc4('0x4')](),_0x4cfe1b;})[_0x3dc4('0x6f')](_0x4b4b9e=>(console[_0x3dc4('0x45')](_0x4b4b9e),this[_0x3dc4('0x49')]['disableReadOnlyMode'](_0x3dc4('0x25')),null));});}[_0x3dc4('0x35')](){const _0x2164bf=this[_0x3dc4('0x49')]['config'][_0x3dc4('0x59')](_0x3dc4('0x5b'))[_0x3dc4('0x9')];this[_0x3dc4('0x49')][_0x3dc4('0x4f')][_0x3dc4('0xd')](_0x3dc4('0x3b'),()=>(this[_0x3dc4('0x49')][_0x3dc4('0x6a')]['has'](_0x3dc4('0xb'))&&this[_0x3dc4('0x49')][_0x3dc4('0x6a')][_0x3dc4('0x59')](_0x3dc4('0xb'))[_0x3dc4('0x5a')](),this[_0x3dc4('0x53')][_0x3dc4('0x6a')][_0x3dc4('0x59')]('RevisionViewer')[_0x3dc4('0x69')](),_0x2164bf(this['_viewerEditor'])['then'](()=>{if(this[_0x3dc4('0x49')][_0x3dc4('0x30')]('revision-history-viewer-opened'),this[_0x3dc4('0x53')]=null,this[_0x3dc4('0x49')][_0x3dc4('0x6a')][_0x3dc4('0x16')](_0x3dc4('0x27'))){const _0x451bb0=this[_0x3dc4('0x49')][_0x3dc4('0x6a')][_0x3dc4('0x59')](_0x3dc4('0x27'));_0x451bb0[_0x3dc4('0x4')](),_0x451bb0[_0x3dc4('0x68')]();}})));}[_0x3dc4('0x3e')](_0x21d5bd){const _0x3d93b9=this[_0x3dc4('0x49')]['config'][_0x3dc4('0x59')]('revisionHistory.editorContainer'),_0x505062=this['editor'][_0x3dc4('0x4f')][_0x3dc4('0x59')](_0x3dc4('0x24')),_0x1e8fec=this[_0x3dc4('0x49')][_0x3dc4('0x4f')][_0x3dc4('0x59')](_0x3dc4('0x3a'));return _0x5aeb99[_0x3dc4('0x5f')](_0x1e8fec,_0x21d5bd)[_0x3dc4('0x4c')](_0x10c4b3=>(_0x505062[_0x3dc4('0x63')]['display']=_0x3dc4('0x5d'),_0x3d93b9[_0x3dc4('0x63')]['display']=_0x3dc4('0x56'),_0x10c4b3));}[_0x3dc4('0x23')](_0x567d37){const _0x125184=this[_0x3dc4('0x49')][_0x3dc4('0x4f')][_0x3dc4('0x59')](_0x3dc4('0x1a'));return this[_0x3dc4('0x49')][_0x3dc4('0x4f')]['get'](_0x3dc4('0x24'))[_0x3dc4('0x63')][_0x3dc4('0x1f')]=_0x3dc4('0x56'),_0x125184[_0x3dc4('0x63')]['display']='',_0x567d37[_0x3dc4('0x60')]();}async[_0x3dc4('0x4e')](_0x2c7603){const _0x353ca7=this[_0x3dc4('0x49')],_0x5ce814=this['_viewerEditor'][_0x3dc4('0x6a')][_0x3dc4('0x59')](_0x3dc4('0x65')),_0x11ee74=_0x353ca7[_0x3dc4('0x6a')]['get'](_0x3dc4('0x19')),_0x5878b7=_0x5ce814[_0x3dc4('0x21')][_0x3dc4('0x46')](_0x2c7603);let _0x30f241,_0x218ce0,_0x1b2267;try{_0x30f241=await _0x5ce814[_0x3dc4('0x6')](_0x5878b7),_0x218ce0=await _0x5ce814[_0x3dc4('0x5e')](_0x5878b7);}catch(_0x405fd0){return void console[_0x3dc4('0x45')](_0x405fd0);}_0x353ca7[_0x3dc4('0x1b')][_0x3dc4('0x1c')](_0x30199c=>{for(const _0x40e5b1 of Array[_0x3dc4('0x18')](_0x353ca7[_0x3dc4('0x1b')][_0x3dc4('0x6c')][_0x3dc4('0x40')](_0x3dc4('0x17'))))_0x30199c['removeMarker'](_0x40e5b1);}),_0x5ce814['isReady']=!0x1,_0x353ca7[_0x3dc4('0x1b')][_0x3dc4('0x55')](_0x23803f=>{_0x23803f['setSelection'](null),_0x23803f['removeSelectionAttribute'](_0x353ca7[_0x3dc4('0x1b')]['document']['selection'][_0x3dc4('0x33')]());const _0x54fee0=Object[_0x3dc4('0x4a')](_0x30f241);for(const _0x37db33 of _0x353ca7[_0x3dc4('0x1b')][_0x3dc4('0x26')]['roots'])_0x3dc4('0x20')!=_0x37db33[_0x3dc4('0x41')]&&_0x37db33[_0x3dc4('0x28')]()&&!_0x54fee0[_0x3dc4('0x0')](_0x37db33[_0x3dc4('0x41')])&&_0x23803f[_0x3dc4('0x1e')](_0x37db33);for(const _0x42710a of _0x54fee0){let _0x5a3ce1=_0x353ca7[_0x3dc4('0x1b')][_0x3dc4('0x26')]['getRoot'](_0x42710a);_0x5a3ce1&&_0x5a3ce1[_0x3dc4('0x28')]()||(_0x5a3ce1=_0x23803f[_0x3dc4('0x31')](_0x42710a));const _0x15889a=_0x218ce0[_0x42710a],_0x1d8155=Object[_0x3dc4('0x4a')](_0x15889a),_0x52dcd4=_0x30f241[_0x42710a];for(const _0xd8d33e of _0x5a3ce1[_0x3dc4('0x33')]())_0x1d8155['includes'](_0xd8d33e)||_0x23803f[_0x3dc4('0x62')](_0xd8d33e,_0x5a3ce1);for(const _0x216f8a of _0x1d8155)_0x23803f[_0x3dc4('0x51')](_0x216f8a,_0x218ce0[_0x42710a][_0x216f8a],_0x5a3ce1);_0x23803f[_0x3dc4('0x52')](_0x23803f[_0x3dc4('0x7')](_0x5a3ce1)),_0x23803f[_0x3dc4('0x3c')](_0x353ca7[_0x3dc4('0x58')][_0x3dc4('0x3d')](_0x52dcd4,_0x5a3ce1),_0x5a3ce1,0x0);}});const _0x4404ed=_0x5cbc45(_0x353ca7[_0x3dc4('0x3')],_0x3dc4('0xc'));if(_0x5878b7[_0x3dc4('0x2e')])_0x1b2267=-0x1==_0x5878b7['name'][_0x3dc4('0x36')](_0x4404ed)?_0x4404ed+':\x20'+_0x5878b7[_0x3dc4('0x2e')]:_0x5878b7['name'];else _0x1b2267=_0x4404ed+':\x20'+(_0x5878b7[_0x3dc4('0x64')][_0x3dc4('0x12')](_0x353ca7[_0x3dc4('0x3')]['uiLanguage'],{'month':_0x3dc4('0x11'),'day':_0x3dc4('0x4b')})+',\x20'+_0x5878b7[_0x3dc4('0x64')][_0x3dc4('0x37')](_0x353ca7[_0x3dc4('0x3')]['uiLanguage'],{'hour':'numeric','minute':_0x3dc4('0x4b')}));return await _0x11ee74[_0x3dc4('0x6e')]({'name':_0x1b2267}),_0x5ce814[_0x3dc4('0x2d')]=!0x0,_0x353ca7['config'][_0x3dc4('0x59')](_0x3dc4('0x5b'))[_0x3dc4('0x9')]();}}
23
+ const _0x4635=['revisionHistory.closeRevisionViewerCallback','enqueueChange','error','name','createRangeIn','RevisionTracker','Annotations','toolbar','getRevisionRootsAttributes','RestrictedEditingMode','RevisionViewer','save','_viewerEditor','isReadOnly','_enhanceCloseRevisionViewerCallback','getRevisionData','keys','change','numeric','exitToEditing','addRevisionData','define','result','enableReadOnlyMode','getRoot','requires','revisionHistory.editorContainer','isEnabled','revisionHistory','RevisionHistory','Users','has','revisionHistory.viewerContainer','long','pluginName','set','createdAt','none','toLocaleTimeString','revisionHistory.showRevisionViewerCallback','adapter','editor','refreshVisibility','_restoreRevision','rootName','init','RevisionsRepository','creator','revision-history-viewer-opened','isAnonymous','document','isReady','create','repository','addRoot','_recalculatePageBreaks','Restored','revisionHistory.viewerEditorElement','get','_enhanceShowRevisionViewerCallback','restoreRevision','Autosave','block','_showRevisionViewer','includes','getAttributeKeys','removeSelectionAttribute','lazyRoots','refreshPositioning','_getRevisionViewerEditorConfig','setSelection','config','isAttached','parse','RevisionHistoryUI','getRevisions','model','toJSON','PaginationLookup','getRevision','toVersion','_closeRevisionViewer','roots','users','uiLanguage','remove','locale','then','closeRevisionViewerCallback','_update','from','bind','plugins','revisionHistory.restoreRevisionCallback','display','style','catch','setAttribute','commands','insert','disableReadOnlyMode','getMarkersGroup'];(function(_0x20f01d,_0x463519){const _0x59bbc9=function(_0x1a20ed){while(--_0x1a20ed){_0x20f01d['push'](_0x20f01d['shift']());}};_0x59bbc9(++_0x463519);}(_0x4635,0xee));const _0x59bb=function(_0x20f01d,_0x463519){_0x20f01d=_0x20f01d-0x0;let _0x59bbc9=_0x4635[_0x20f01d];return _0x59bbc9;};import{Plugin as _0x1d2497}from'ckeditor5/src/core';import{CKEditorError as _0x45be3c,uid as _0x1a79db}from'ckeditor5/src/utils';import _0x22e7ca from'./revisiontracker';import _0x5b456e from'./ui/revisionhistory/revisionhistoryui';import _0x2f5fb5 from'./revisionviewer';import _0x48ee95 from'./ui/revisionviewer/revisionviewerui';import _0xb9ebc8 from'./ui/revisionssidebar/revisionssidebar';import _0x1800c6 from'./editor/revisionviewereditor';import{getTranslation as _0x206527}from'./utils/common-translations';import{sanitizeEditorConfig as _0x181343}from'ckeditor5-collaboration/src/collaboration-core';const g=[_0x59bb('0x28'),_0x59bb('0x4d')];class k extends _0x1d2497{static get['pluginName'](){return'RevisionViewerIntegration';}constructor(_0x516881){super(_0x516881),this[_0x59bb('0x5a')]='end';}}export default class b extends _0x1d2497{static get[_0x59bb('0x0')](){return _0x59bb('0x61');}static get[_0x59bb('0x5d')](){return[_0x22e7ca,_0x5b456e];}constructor(_0x18d38a){if(super(_0x18d38a),!this['editor'][_0x59bb('0x25')][_0x59bb('0x18')](_0x59bb('0x60')))throw new _0x45be3c('revision-history-missing-configuration',this);this[_0x59bb('0x50')]=null,this[_0x59bb('0x7')][_0x59bb('0x25')]['define'](_0x59bb('0x5'),_0x123742=>this[_0x59bb('0x1d')](_0x123742)),this['editor'][_0x59bb('0x25')][_0x59bb('0x59')](_0x59bb('0x44'),_0x8e68be=>this['_closeRevisionViewer'](_0x8e68be)),this[_0x59bb('0x7')][_0x59bb('0x25')][_0x59bb('0x59')](_0x59bb('0x3b'),_0x139677=>this['_restoreRevision'](_0x139677)),this[_0x59bb('0x19')](),this[_0x59bb('0x52')]();}set[_0x59bb('0x6')](_0x1876ae){this['editor']['plugins']['get']('RevisionTracker')['adapter']=_0x1876ae;}get[_0x59bb('0x6')](){return this[_0x59bb('0x7')]['plugins']['get'](_0x59bb('0x49'))[_0x59bb('0x6')];}[_0x59bb('0x58')](_0x4cea1b){return this[_0x59bb('0x7')][_0x59bb('0x3a')][_0x59bb('0x18')](_0x59bb('0x49'))['addRevisionData'](_0x4cea1b);}['getRevision'](_0x2e4f6e){return this[_0x59bb('0x7')][_0x59bb('0x3a')][_0x59bb('0x18')](_0x59bb('0xc'))[_0x59bb('0x2d')](_0x2e4f6e);}[_0x59bb('0x29')](_0x317d43={'toJSON':!0x1}){return this[_0x59bb('0x7')][_0x59bb('0x3a')][_0x59bb('0x18')](_0x59bb('0xc'))['getRevisions'](_0x317d43);}['_getRevisionViewerEditorConfig'](){const _0x49ea5f=this['editor'],_0x8f651d=_0x181343(_0x49ea5f,g),_0x3819bd=_0x49ea5f[_0x59bb('0x3a')][_0x59bb('0x18')](_0x59bb('0x49')),_0x53bc5e=_0x49ea5f[_0x59bb('0x3a')]['get'](_0x59bb('0x62'))[_0x59bb('0x31')];return _0x8f651d[_0x59bb('0x4b')]=[_0x59bb('0x57'),_0x59bb('0x1a'),'changesNavigation'],delete _0x8f651d[_0x59bb('0x21')],(_0x8f651d[_0x59bb('0x3a')]['push'](k,_0x2f5fb5,_0x48ee95,class extends _0x1d2497{static get[_0x59bb('0x5d')](){return[_0x2f5fb5,_0x59bb('0x62')];}[_0x59bb('0xb')](){const _0xb62fad=this[_0x59bb('0x7')]['plugins'][_0x59bb('0x18')]('Users');for(const _0x4bab07 of _0x53bc5e)_0x4bab07[_0x59bb('0xf')]||_0xb62fad['getUser'](_0x4bab07['id'])||_0xb62fad['addUser'](_0x4bab07);const _0x2d09dd=_0x3819bd[_0x59bb('0x13')]['getRevisions']();let _0x649e2c=null;const _0x36cff9=this[_0x59bb('0x7')][_0x59bb('0x3a')][_0x59bb('0x18')](_0x59bb('0x4e'));_0x36cff9[_0x59bb('0x6')]=_0x3819bd[_0x59bb('0x6')],_0x36cff9['bind'](_0x59bb('0x5f'))['to'](_0x3819bd),this[_0x59bb('0x7')][_0x59bb('0x40')][_0x59bb('0x18')]('restoreRevision')[_0x59bb('0x39')](_0x59bb('0x5f'))['to'](_0x49ea5f,_0x59bb('0x51'),_0xf058ed=>!_0xf058ed);for(const _0x1c9b6e of _0x2d09dd){const _0x2afa08=null===_0x1c9b6e[_0x59bb('0xd')];if(_0x2afa08&&_0x1c9b6e[_0x59bb('0x2e')]===_0x1c9b6e['fromVersion'])continue;const _0x191607=_0x1c9b6e[_0x59bb('0x2b')]();_0x36cff9['addRevisionData'](_0x191607,(_0x64e2cc,_0x1931cc,_0x335cb3)=>{if(_0x2afa08){if(_0x649e2c)_0x649e2c[_0x59bb('0x37')](_0x64e2cc,_0x1931cc);else{if(!_0x1931cc){const _0x4bfb3f=_0x335cb3['toJSON']();_0x4bfb3f['id']=_0x1a79db(),_0x3819bd['saveRevision'](_0x4bfb3f,_0x335cb3[_0x59bb('0x2e')])[_0x59bb('0x35')](_0x15251a=>{_0x649e2c=_0x15251a;});}}}else _0x1c9b6e[_0x59bb('0x37')](_0x64e2cc,_0x1931cc);});}}},_0xb9ebc8),_0x8f651d);}[_0x59bb('0x19')](){const _0x2af157=this[_0x59bb('0x7')][_0x59bb('0x25')][_0x59bb('0x18')](_0x59bb('0x60'))['showRevisionViewerCallback'];this[_0x59bb('0x7')][_0x59bb('0x25')][_0x59bb('0x1')](_0x59bb('0x5'),async()=>{this[_0x59bb('0x7')][_0x59bb('0x5b')](_0x59bb('0xe'));const _0x50e733=this['editor'][_0x59bb('0x3a')][_0x59bb('0x18')](_0x59bb('0x49'));if(this[_0x59bb('0x7')][_0x59bb('0x3a')][_0x59bb('0x63')](_0x59bb('0x1b'))){const _0x57942c=this[_0x59bb('0x7')]['plugins']['get']('Autosave');await _0x57942c[_0x59bb('0x4f')]();}else await _0x50e733['update']();this['editor'][_0x59bb('0x3a')]['has'](_0x59bb('0x2c'))&&this[_0x59bb('0x7')]['plugins'][_0x59bb('0x18')](_0x59bb('0x2c'))[_0x59bb('0x15')]();const _0xf3bf49=this[_0x59bb('0x23')]();return _0x2af157(_0xf3bf49)['then'](_0x25a9a9=>{return(this[_0x59bb('0x50')]=_0x25a9a9,this[_0x59bb('0x7')][_0x59bb('0x3a')][_0x59bb('0x63')]('Annotations'))&&this[_0x59bb('0x7')]['plugins'][_0x59bb('0x18')](_0x59bb('0x4a'))[_0x59bb('0x8')](),_0x25a9a9;})[_0x59bb('0x3e')](_0x1fe8bd=>(console['error'](_0x1fe8bd),this[_0x59bb('0x7')][_0x59bb('0x42')](_0x59bb('0xe')),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x20ec90=this['editor'][_0x59bb('0x25')]['get'](_0x59bb('0x60'))[_0x59bb('0x36')];this['editor']['config'][_0x59bb('0x1')](_0x59bb('0x44'),()=>(this[_0x59bb('0x7')][_0x59bb('0x3a')][_0x59bb('0x63')]('PaginationLookup')&&this[_0x59bb('0x7')]['plugins'][_0x59bb('0x18')](_0x59bb('0x2c'))['_recalculatePageBreaks'](),this[_0x59bb('0x50')][_0x59bb('0x3a')][_0x59bb('0x18')](_0x59bb('0x4e'))['_cleanUp'](),_0x20ec90(this[_0x59bb('0x50')])[_0x59bb('0x35')](()=>{if(this['editor'][_0x59bb('0x42')]('revision-history-viewer-opened'),this[_0x59bb('0x50')]=null,this[_0x59bb('0x7')]['plugins'][_0x59bb('0x63')]('Annotations')){const _0x14ab6b=this[_0x59bb('0x7')]['plugins'][_0x59bb('0x18')](_0x59bb('0x4a'));_0x14ab6b['refreshVisibility'](),_0x14ab6b[_0x59bb('0x22')]();}})));}[_0x59bb('0x1d')](_0xa4dad3){const _0x145a50=this['editor'][_0x59bb('0x25')]['get']('revisionHistory.editorContainer'),_0x25c57f=this[_0x59bb('0x7')]['config'][_0x59bb('0x18')]('revisionHistory.viewerContainer'),_0x38a10b=this[_0x59bb('0x7')][_0x59bb('0x25')]['get'](_0x59bb('0x17'));return _0x1800c6[_0x59bb('0x12')](_0x38a10b,_0xa4dad3)[_0x59bb('0x35')](_0x2e0cdf=>(_0x25c57f[_0x59bb('0x3d')][_0x59bb('0x3c')]=_0x59bb('0x1c'),_0x145a50[_0x59bb('0x3d')][_0x59bb('0x3c')]=_0x59bb('0x3'),_0x2e0cdf));}[_0x59bb('0x2f')](_0x27ca54){const _0x3e876e=this[_0x59bb('0x7')]['config'][_0x59bb('0x18')](_0x59bb('0x5e'));return this[_0x59bb('0x7')][_0x59bb('0x25')][_0x59bb('0x18')](_0x59bb('0x64'))[_0x59bb('0x3d')]['display']=_0x59bb('0x3'),_0x3e876e[_0x59bb('0x3d')][_0x59bb('0x3c')]='',_0x27ca54['destroy']();}async[_0x59bb('0x9')](_0x434f01){const _0x57677d=this[_0x59bb('0x7')],_0x864fd=this['_viewerEditor'][_0x59bb('0x3a')][_0x59bb('0x18')](_0x59bb('0x4e')),_0x5e1ad2=_0x57677d[_0x59bb('0x3a')][_0x59bb('0x18')](_0x59bb('0x49')),_0x5977cc=_0x864fd[_0x59bb('0x13')][_0x59bb('0x2d')](_0x434f01);let _0x53f955,_0x397044,_0x41b62d;try{_0x53f955=await _0x864fd[_0x59bb('0x53')](_0x5977cc),_0x397044=await _0x864fd[_0x59bb('0x4c')](_0x5977cc);}catch(_0x8afcd5){return void console[_0x59bb('0x46')](_0x8afcd5);}_0x57677d[_0x59bb('0x2a')][_0x59bb('0x55')](_0x2b5297=>{for(const _0x40503b of Array[_0x59bb('0x38')](_0x57677d[_0x59bb('0x2a')]['markers'][_0x59bb('0x43')]('restrictedEditingException')))_0x2b5297['removeMarker'](_0x40503b);}),_0x864fd[_0x59bb('0x11')]=!0x1,_0x57677d[_0x59bb('0x2a')][_0x59bb('0x45')](_0x5896c4=>{_0x5896c4[_0x59bb('0x24')](null),_0x5896c4[_0x59bb('0x20')](_0x57677d[_0x59bb('0x2a')][_0x59bb('0x10')]['selection'][_0x59bb('0x1f')]());const _0x304409=Object[_0x59bb('0x54')](_0x53f955);for(const _0x380f9e of _0x57677d[_0x59bb('0x2a')][_0x59bb('0x10')][_0x59bb('0x30')])'$graveyard'!=_0x380f9e[_0x59bb('0xa')]&&_0x380f9e[_0x59bb('0x26')]()&&!_0x304409[_0x59bb('0x1e')](_0x380f9e[_0x59bb('0xa')])&&_0x5896c4['detachRoot'](_0x380f9e);for(const _0x5524ca of _0x304409){let _0x4cc34e=_0x57677d[_0x59bb('0x2a')]['document'][_0x59bb('0x5c')](_0x5524ca);_0x4cc34e&&_0x4cc34e[_0x59bb('0x26')]()||(_0x4cc34e=_0x5896c4[_0x59bb('0x14')](_0x5524ca));const _0x106806=_0x397044[_0x5524ca],_0x5de9b1=Object[_0x59bb('0x54')](_0x106806),_0x29d8cf=_0x53f955[_0x5524ca];for(const _0x54310b of _0x4cc34e['getAttributeKeys']())_0x5de9b1['includes'](_0x54310b)||_0x5896c4['removeAttribute'](_0x54310b,_0x4cc34e);for(const _0x1cc869 of _0x5de9b1)_0x5896c4[_0x59bb('0x3f')](_0x1cc869,_0x397044[_0x5524ca][_0x1cc869],_0x4cc34e);_0x5896c4[_0x59bb('0x33')](_0x5896c4[_0x59bb('0x48')](_0x4cc34e)),_0x5896c4[_0x59bb('0x41')](_0x57677d['data'][_0x59bb('0x27')](_0x29d8cf,_0x4cc34e),_0x4cc34e,0x0);}});const _0x567196=_0x206527(_0x57677d[_0x59bb('0x34')],_0x59bb('0x16'));if(_0x5977cc[_0x59bb('0x47')])_0x41b62d=-0x1==_0x5977cc[_0x59bb('0x47')]['indexOf'](_0x567196)?_0x567196+':\x20'+_0x5977cc[_0x59bb('0x47')]:_0x5977cc[_0x59bb('0x47')];else _0x41b62d=_0x567196+':\x20'+(_0x5977cc['createdAt']['toLocaleDateString'](_0x57677d[_0x59bb('0x34')][_0x59bb('0x32')],{'month':_0x59bb('0x65'),'day':_0x59bb('0x56')})+',\x20'+_0x5977cc[_0x59bb('0x2')][_0x59bb('0x4')](_0x57677d['locale']['uiLanguage'],{'hour':_0x59bb('0x56'),'minute':_0x59bb('0x56')}));return await _0x5e1ad2['saveRevision']({'name':_0x41b62d}),_0x864fd[_0x59bb('0x11')]=!0x0,_0x57677d[_0x59bb('0x25')][_0x59bb('0x18')]('revisionHistory')[_0x59bb('0x36')]();}}
@@ -1,64 +1,64 @@
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 revision-history/revisionhistoryadapter
7
- * @publicApi
8
- */
9
- import type { RevisionData } from './revision';
10
- /**
11
- * The revision history adapter.
12
- *
13
- * The revision history adapter is an object that communicates asynchronously with the data source to fetch or save
14
- * the revisions data. It is used internally by the revision history feature whenever revision data is required, a revision is created,
15
- * or updated.
16
- *
17
- * The adapter is optional. See the {@glink features/collaboration/revision-history/revision-history-integration
18
- * Revision history feature integration} guide to learn more.
19
- *
20
- * To set the adapter, overwrite the {@link module:revision-history/revisionhistory~RevisionHistory#adapter `RevisionHistory#adapter`}
21
- * property.
22
- */
23
- export interface RevisionHistoryAdapter {
24
- /**
25
- * Called when the full revision data is required.
26
- *
27
- * It should return a promise that resolves with the whole revision data.
28
- */
29
- getRevision(data: {
30
- revisionId: string;
31
- channelId: string;
32
- }): Promise<RevisionData>;
33
- /**
34
- * Called when revision(s) data is added or updated.
35
- *
36
- * Multiple revisions can be added and updated at the same moment. The method is passed an array with the updated data.
37
- * Each item in the array is a data object that describes a single revision. Each data object contains revision id. If the revision
38
- * id does not exist in your data source (database), then a new revision should be created. Otherwise, the existing revision
39
- * should be updated with passed data.
40
- *
41
- * The method should return a promise that is resolved when the update is completed.
42
- *
43
- * The `data` parameter only contains those properties of a revision that have changed.
44
- *
45
- * Although the `data` parameter contains `createdAt` property,
46
- * the revision creation date should be set by the backend of your application
47
- * to ensure that all revisions will be saved with correct dates regardless of users' local system time.
48
- * It is recommended to overwrite `createdAt` value whenever it is passed in the `data` parameter.
49
- *
50
- * The promise may resolve with an array of objects. Each object represents an updated revision, for which `createdAt` property
51
- * was set (or changed) on the backend. Each object should have `id` (string) and `createdAt` (`Date` object) properties.
52
- * The returned data will be used to update revisions data in the editor with dates set on the backend.
53
- *
54
- * Although the `data` parameter contains `creatorId` property, you should verify the `creatorId` value when saving a revision
55
- * in the database. **However, do not overwrite the value if it was set to `null`!**
56
- *
57
- * It is recommended to stringify `data.diffData` and `data.attributes` values to JSON and save them as strings in your database,
58
- * and then to parse the strings when loading revisions.
59
- *
60
- * @param data Array with revisions data to add or update.
61
- * @param channelId The ID of the document for which the revisions were created.
62
- */
63
- updateRevisions(data: Array<RevisionData>, channelId: string): Promise<Array<RevisionData>>;
64
- }
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 revision-history/revisionhistoryadapter
7
+ * @publicApi
8
+ */
9
+ import type { RevisionData } from './revision';
10
+ /**
11
+ * The revision history adapter.
12
+ *
13
+ * The revision history adapter is an object that communicates asynchronously with the data source to fetch or save
14
+ * the revisions data. It is used internally by the revision history feature whenever revision data is required, a revision is created,
15
+ * or updated.
16
+ *
17
+ * The adapter is optional. See the {@glink features/collaboration/revision-history/revision-history-integration
18
+ * Revision history feature integration} guide to learn more.
19
+ *
20
+ * To set the adapter, overwrite the {@link module:revision-history/revisionhistory~RevisionHistory#adapter `RevisionHistory#adapter`}
21
+ * property.
22
+ */
23
+ export interface RevisionHistoryAdapter {
24
+ /**
25
+ * Called when the full revision data is required.
26
+ *
27
+ * It should return a promise that resolves with the whole revision data.
28
+ */
29
+ getRevision(data: {
30
+ revisionId: string;
31
+ channelId: string;
32
+ }): Promise<RevisionData>;
33
+ /**
34
+ * Called when revision(s) data is added or updated.
35
+ *
36
+ * Multiple revisions can be added and updated at the same moment. The method is passed an array with the updated data.
37
+ * Each item in the array is a data object that describes a single revision. Each data object contains revision id. If the revision
38
+ * id does not exist in your data source (database), then a new revision should be created. Otherwise, the existing revision
39
+ * should be updated with passed data.
40
+ *
41
+ * The method should return a promise that is resolved when the update is completed.
42
+ *
43
+ * The `data` parameter only contains those properties of a revision that have changed.
44
+ *
45
+ * Although the `data` parameter contains `createdAt` property,
46
+ * the revision creation date should be set by the backend of your application
47
+ * to ensure that all revisions will be saved with correct dates regardless of users' local system time.
48
+ * It is recommended to overwrite `createdAt` value whenever it is passed in the `data` parameter.
49
+ *
50
+ * The promise may resolve with an array of objects. Each object represents an updated revision, for which `createdAt` property
51
+ * was set (or changed) on the backend. Each object should have `id` (string) and `createdAt` (`Date` object) properties.
52
+ * The returned data will be used to update revisions data in the editor with dates set on the backend.
53
+ *
54
+ * Although the `data` parameter contains `creatorId` property, you should verify the `creatorId` value when saving a revision
55
+ * in the database. **However, do not overwrite the value if it was set to `null`!**
56
+ *
57
+ * It is recommended to stringify `data.diffData` and `data.attributes` values to JSON and save them as strings in your database,
58
+ * and then to parse the strings when loading revisions.
59
+ *
60
+ * @param data Array with revisions data to add or update.
61
+ * @param channelId The ID of the document for which the revisions were created.
62
+ */
63
+ updateRevisions(data: Array<RevisionData>, channelId: string): Promise<Array<RevisionData>>;
64
+ }
@@ -1,60 +1,60 @@
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
- * 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
+ * @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
+ * 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,52 +1,52 @@
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 revision-history/revisionsrepository
7
- * @publicApi
8
- */
9
- import { Users } from 'ckeditor5-collaboration/src/collaboration-core';
10
- import { Plugin, type Editor } from 'ckeditor5/src/core';
11
- import { default as Revision, type RevisionData, type RevisionJSON } from './revision';
12
- /**
13
- * Manages revisions list.
14
- */
15
- export default class RevisionsRepository extends Plugin {
16
- static get requires(): readonly [typeof Users];
17
- static get pluginName(): "RevisionsRepository";
18
- get length(): number;
19
- constructor(editor: Editor);
20
- /**
21
- * @inheritDoc
22
- */
23
- afterInit(): void;
24
- /**
25
- * Creates a revision instance from plain object with revision data.
26
- */
27
- createRevision(revisionData: RevisionData): Revision;
28
- /**
29
- * Adds revision to the repository on a given index.
30
- *
31
- * @param revision The revision instance to add.
32
- * @param index Index on which the revision should be added. If not set, the revision will be added as the first revision.
33
- */
34
- addRevision(revision: Revision, index?: number): void;
35
- /**
36
- * Returns the revision with a given revision id or at a given index.
37
- */
38
- getRevision(revisionIdOrIndex: string | number): Revision | null;
39
- getRevisions(options: {
40
- toJSON: true;
41
- }): Array<RevisionJSON>;
42
- getRevisions(options?: {
43
- toJSON: false;
44
- }): Array<Revision>;
45
- getRevisions(options: {
46
- toJSON: boolean;
47
- }): Array<Revision> | Array<RevisionJSON>;
48
- /**
49
- * Returns the index of the revision with a given revision id.
50
- */
51
- getIndex(revisionId: string | Revision): number;
52
- }
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 revision-history/revisionsrepository
7
+ * @publicApi
8
+ */
9
+ import { Users } from 'ckeditor5-collaboration/src/collaboration-core';
10
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
11
+ import { default as Revision, type RevisionData, type RevisionJSON } from './revision';
12
+ /**
13
+ * Manages revisions list.
14
+ */
15
+ export default class RevisionsRepository extends Plugin {
16
+ static get requires(): readonly [typeof Users];
17
+ static get pluginName(): "RevisionsRepository";
18
+ get length(): number;
19
+ constructor(editor: Editor);
20
+ /**
21
+ * @inheritDoc
22
+ */
23
+ afterInit(): void;
24
+ /**
25
+ * Creates a revision instance from plain object with revision data.
26
+ */
27
+ createRevision(revisionData: RevisionData): Revision;
28
+ /**
29
+ * Adds revision to the repository on a given index.
30
+ *
31
+ * @param revision The revision instance to add.
32
+ * @param index Index on which the revision should be added. If not set, the revision will be added as the first revision.
33
+ */
34
+ addRevision(revision: Revision, index?: number): void;
35
+ /**
36
+ * Returns the revision with a given revision id or at a given index.
37
+ */
38
+ getRevision(revisionIdOrIndex: string | number): Revision | null;
39
+ getRevisions(options: {
40
+ toJSON: true;
41
+ }): Array<RevisionJSON>;
42
+ getRevisions(options?: {
43
+ toJSON: false;
44
+ }): Array<Revision>;
45
+ getRevisions(options: {
46
+ toJSON: boolean;
47
+ }): Array<Revision> | Array<RevisionJSON>;
48
+ /**
49
+ * Returns the index of the revision with a given revision id.
50
+ */
51
+ getIndex(revisionId: string | Revision): number;
52
+ }