@ckeditor/ckeditor5-revision-history 39.0.1 → 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 (137) hide show
  1. package/LICENSE.md +6 -6
  2. package/README.md +11 -11
  3. package/build/revision-history.js +1 -1
  4. package/ckeditor5-metadata.json +1 -1
  5. package/lang/translations/af.po +1 -0
  6. package/lang/translations/ar.po +1 -0
  7. package/lang/translations/az.po +1 -0
  8. package/lang/translations/bg.po +1 -0
  9. package/lang/translations/bn.po +1 -0
  10. package/lang/translations/bs.po +1 -0
  11. package/lang/translations/ca.po +1 -0
  12. package/lang/translations/cs.po +1 -0
  13. package/lang/translations/da.po +1 -0
  14. package/lang/translations/de-ch.po +1 -0
  15. package/lang/translations/de.po +1 -0
  16. package/lang/translations/el.po +1 -0
  17. package/lang/translations/en-au.po +1 -0
  18. package/lang/translations/en-gb.po +1 -0
  19. package/lang/translations/en.po +1 -0
  20. package/lang/translations/es-co.po +1 -0
  21. package/lang/translations/es.po +1 -0
  22. package/lang/translations/et.po +1 -0
  23. package/lang/translations/fa.po +1 -0
  24. package/lang/translations/fi.po +1 -0
  25. package/lang/translations/fr.po +1 -0
  26. package/lang/translations/gl.po +1 -0
  27. package/lang/translations/he.po +1 -0
  28. package/lang/translations/hi.po +1 -0
  29. package/lang/translations/hr.po +1 -0
  30. package/lang/translations/hu.po +1 -0
  31. package/lang/translations/id.po +1 -0
  32. package/lang/translations/it.po +1 -0
  33. package/lang/translations/ja.po +1 -0
  34. package/lang/translations/jv.po +1 -0
  35. package/lang/translations/ko.po +1 -0
  36. package/lang/translations/ku.po +1 -0
  37. package/lang/translations/lt.po +1 -0
  38. package/lang/translations/lv.po +1 -0
  39. package/lang/translations/ms.po +1 -0
  40. package/lang/translations/ne.po +1 -0
  41. package/lang/translations/nl.po +1 -0
  42. package/lang/translations/no.po +1 -0
  43. package/lang/translations/pl.po +1 -0
  44. package/lang/translations/pt-br.po +1 -0
  45. package/lang/translations/pt.po +1 -0
  46. package/lang/translations/ro.po +1 -0
  47. package/lang/translations/ru.po +1 -0
  48. package/lang/translations/sk.po +1 -0
  49. package/lang/translations/sr-latn.po +1 -0
  50. package/lang/translations/sr.po +1 -0
  51. package/lang/translations/sv.po +1 -0
  52. package/lang/translations/th.po +1 -0
  53. package/lang/translations/tk.po +1 -0
  54. package/lang/translations/tr.po +1 -0
  55. package/lang/translations/tt.po +1 -0
  56. package/lang/translations/ug.po +1 -0
  57. package/lang/translations/uk.po +1 -0
  58. package/lang/translations/ur.po +1 -0
  59. package/lang/translations/vi.po +1 -0
  60. package/lang/translations/zh-cn.po +1 -0
  61. package/lang/translations/zh.po +1 -0
  62. package/package.json +6 -10
  63. package/src/augmentation.d.ts +29 -29
  64. package/src/changeitem.d.ts +58 -58
  65. package/src/changeitem.js +1 -1
  66. package/src/editor/revisionviewereditor.d.ts +27 -27
  67. package/src/editor/revisionviewereditor.js +1 -1
  68. package/src/editor/revisionviewereditorui.d.ts +28 -28
  69. package/src/editor/revisionviewereditorui.js +1 -1
  70. package/src/editor/revisionviewereditoruiview.d.ts +43 -43
  71. package/src/editor/revisionviewereditoruiview.js +1 -1
  72. package/src/index.d.ts +15 -15
  73. package/src/revision.d.ts +153 -153
  74. package/src/revision.js +1 -1
  75. package/src/revisiondiff.d.ts +24 -24
  76. package/src/revisiondiff.js +1 -1
  77. package/src/revisionhistory.d.ts +99 -99
  78. package/src/revisionhistory.js +1 -1
  79. package/src/revisionhistoryadapter.d.ts +64 -64
  80. package/src/revisionhistoryconfig.d.ts +60 -60
  81. package/src/revisionsrepository.d.ts +52 -52
  82. package/src/revisionsrepository.js +1 -1
  83. package/src/revisiontracker.d.ts +81 -81
  84. package/src/revisiontracker.js +1 -1
  85. package/src/revisionviewer.d.ts +25 -25
  86. package/src/revisionviewer.js +1 -1
  87. package/src/ui/revision/createrevisionactionsdropdown.d.ts +10 -10
  88. package/src/ui/revision/createrevisionactionsdropdown.js +1 -1
  89. package/src/ui/revision/revisionauthorview.d.ts +5 -5
  90. package/src/ui/revision/revisionauthorview.js +1 -1
  91. package/src/ui/revision/revisionnameview.d.ts +5 -5
  92. package/src/ui/revision/revisionnameview.js +1 -1
  93. package/src/ui/revision/revisionview.d.ts +95 -95
  94. package/src/ui/revision/revisionview.js +1 -1
  95. package/src/ui/revision/subrevisioncollapserview.d.ts +21 -21
  96. package/src/ui/revision/subrevisioncollapserview.js +1 -1
  97. package/src/ui/revision/subrevisionview.d.ts +34 -34
  98. package/src/ui/revision/subrevisionview.js +1 -1
  99. package/src/ui/revision/utils.d.ts +5 -5
  100. package/src/ui/revision/utils.js +1 -1
  101. package/src/ui/revisionhistory/revisionhistorysaverevisionformview.d.ts +81 -81
  102. package/src/ui/revisionhistory/revisionhistorysaverevisionformview.js +1 -1
  103. package/src/ui/revisionhistory/revisionhistoryui.d.ts +26 -26
  104. package/src/ui/revisionhistory/revisionhistoryui.js +1 -1
  105. package/src/ui/revisionssidebar/revisionssidebar.d.ts +44 -44
  106. package/src/ui/revisionssidebar/revisionssidebar.js +1 -1
  107. package/src/ui/revisionssidebar/revisionssidebarheaderview.d.ts +5 -5
  108. package/src/ui/revisionssidebar/revisionssidebarheaderview.js +1 -1
  109. package/src/ui/revisionssidebar/revisionssidebartimeperiodview.d.ts +29 -29
  110. package/src/ui/revisionssidebar/revisionssidebartimeperiodview.js +1 -1
  111. package/src/ui/revisionssidebar/revisionssidebarview.d.ts +44 -44
  112. package/src/ui/revisionssidebar/revisionssidebarview.js +1 -1
  113. package/src/ui/revisionssidebar/utils.d.ts +9 -9
  114. package/src/ui/revisionssidebar/utils.js +1 -1
  115. package/src/ui/revisionviewer/changedetailsview.d.ts +22 -22
  116. package/src/ui/revisionviewer/changedetailsview.js +1 -1
  117. package/src/ui/revisionviewer/changesnavigationview.d.ts +40 -40
  118. package/src/ui/revisionviewer/changesnavigationview.js +1 -1
  119. package/src/ui/revisionviewer/revisionviewerloadingoverlay.d.ts +26 -26
  120. package/src/ui/revisionviewer/revisionviewerloadingoverlay.js +1 -1
  121. package/src/ui/revisionviewer/revisionviewerui.d.ts +28 -28
  122. package/src/ui/revisionviewer/revisionviewerui.js +1 -1
  123. package/src/utils/common-translations.d.ts +11 -11
  124. package/src/utils/common-translations.js +1 -1
  125. package/theme/changesnavigation.css +9 -0
  126. package/theme/revision/revision.css +9 -0
  127. package/theme/revision/revisionactions.css +11 -0
  128. package/theme/revision/revisionauthor.css +9 -0
  129. package/theme/revision/revisionname.css +9 -0
  130. package/theme/revision/subrevision.css +9 -0
  131. package/theme/revision/subrevisioncollapser.css +9 -0
  132. package/theme/revisionhistorysaverevisionform.css +5 -1
  133. package/theme/revisionssidebar/revisionssidebar.css +9 -0
  134. package/theme/revisionssidebar/revisionssidebarheader.css +9 -0
  135. package/theme/revisionssidebar/revisionssidebartimeperiod.css +9 -0
  136. package/theme/revisionviewer.css +9 -0
  137. package/theme/revisionviewerloadingoverlay.css +9 -0
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x50ea=['end','isAnonymous','update','restrictedEditingException','save','selection','numeric','remove','init','saveRevision','_restoreRevision','RevisionHistory','style','getAttributeKeys','createdAt','from','RevisionsRepository','users','_cleanUp','set','change','data','repository','uiLanguage','fromVersion','requires','destroy','revisionHistory.closeRevisionViewerCallback','isEnabled','creator','revision-history-viewer-opened','detachRoot','display','locale','_recalculatePageBreaks','setAttribute','isAttached','Restored','removeMarker','_closeRevisionViewer','RevisionHistoryUI','_getRevisionViewerEditorConfig','$graveyard','enqueueChange','revision-history-missing-configuration','RevisionTracker','removeSelectionAttribute','getUser','then','get','model','_enhanceCloseRevisionViewerCallback','editor','getRoot','exitToEditing','rootName','getRevisionRootsAttributes','_viewerEditor','commands','insert','parse','revisionHistory.restoreRevisionCallback','addUser','addRoot','enableReadOnlyMode','document','toVersion','pluginName','RevisionViewer','long','isReady','Annotations','revisionHistory.viewerContainer','addRevisionData','Users','define','revisionHistory','PaginationLookup','toolbar','refreshVisibility','restoreRevision','plugins','error','config','result','revisionHistory.showRevisionViewerCallback','none','includes','showRevisionViewerCallback','_update','getRevisions','roots','create','removeAttribute','adapter','has','changesNavigation','getRevision','catch','disableReadOnlyMode','bind','Autosave','toJSON','_enhanceShowRevisionViewerCallback','closeRevisionViewerCallback','name','setSelection','indexOf'];(function(_0x9657ca,_0x50ea96){const _0x395752=function(_0x39c2d1){while(--_0x39c2d1){_0x9657ca['push'](_0x9657ca['shift']());}};_0x395752(++_0x50ea96);}(_0x50ea,0x8b));const _0x3957=function(_0x9657ca,_0x50ea96){_0x9657ca=_0x9657ca-0x0;let _0x395752=_0x50ea[_0x9657ca];return _0x395752;};import{Plugin as _0x3b8f38}from'ckeditor5/src/core';import{CKEditorError as _0x2b6802,uid as _0x31a2a3}from'ckeditor5/src/utils';import _0xbb3356 from'./revisiontracker';import _0x3a971c from'./ui/revisionhistory/revisionhistoryui';import _0x229bb8 from'./revisionviewer';import _0xc0259c from'./ui/revisionviewer/revisionviewerui';import _0x178952 from'./ui/revisionssidebar/revisionssidebar';import _0x256fcd from'./editor/revisionviewereditor';import{getTranslation as _0x40b5c9}from'./utils/common-translations';import{sanitizeEditorConfig as _0x39d69c}from'ckeditor5-collaboration/src/collaboration-core';const g=[_0x3957('0x9'),'RestrictedEditingMode'];class k extends _0x3b8f38{static get[_0x3957('0x24')](){return'RevisionViewerIntegration';}constructor(_0x12971b){super(_0x12971b),this[_0x3957('0x35')]=_0x3957('0x4d');}}export default class b extends _0x3b8f38{static get[_0x3957('0x24')](){return _0x3957('0x58');}static get[_0x3957('0x66')](){return[_0xbb3356,_0x3a971c];}constructor(_0x10224d){if(super(_0x10224d),!this[_0x3957('0x15')][_0x3957('0x34')][_0x3957('0x12')](_0x3957('0x2d')))throw new _0x2b6802(_0x3957('0xd'),this);this[_0x3957('0x1a')]=null,this[_0x3957('0x15')]['config'][_0x3957('0x2c')]('revisionHistory.showRevisionViewerCallback',_0x2092cb=>this['_showRevisionViewer'](_0x2092cb)),this[_0x3957('0x15')]['config']['define'](_0x3957('0x68'),_0x4a41d8=>this[_0x3957('0x8')](_0x4a41d8)),this[_0x3957('0x15')]['config'][_0x3957('0x2c')](_0x3957('0x1e'),_0x7c1276=>this['_restoreRevision'](_0x7c1276)),this[_0x3957('0x48')](),this['_enhanceCloseRevisionViewerCallback']();}set['adapter'](_0x43fce2){this['editor']['plugins'][_0x3957('0x12')](_0x3957('0xe'))[_0x3957('0x3f')]=_0x43fce2;}get['adapter'](){return this[_0x3957('0x15')]['plugins'][_0x3957('0x12')]('RevisionTracker')[_0x3957('0x3f')];}[_0x3957('0x2a')](_0x225dc1){return this[_0x3957('0x15')][_0x3957('0x32')][_0x3957('0x12')]('RevisionTracker')[_0x3957('0x2a')](_0x225dc1);}[_0x3957('0x42')](_0x363b00){return this['editor'][_0x3957('0x32')]['get'](_0x3957('0x5d'))['getRevision'](_0x363b00);}['getRevisions'](_0x2bc733={'toJSON':!0x1}){return this[_0x3957('0x15')][_0x3957('0x32')][_0x3957('0x12')](_0x3957('0x5d'))[_0x3957('0x3b')](_0x2bc733);}['_getRevisionViewerEditorConfig'](){const _0x44da2d=this[_0x3957('0x15')],_0x19c0c7=_0x39d69c(_0x44da2d,g),_0x222098=_0x44da2d[_0x3957('0x32')][_0x3957('0x12')]('RevisionTracker'),_0x237f7e=_0x44da2d[_0x3957('0x32')]['get'](_0x3957('0x2b'))[_0x3957('0x5e')];return _0x19c0c7[_0x3957('0x2f')]=[_0x3957('0x17'),_0x3957('0x31'),_0x3957('0x41')],delete _0x19c0c7['lazyRoots'],(_0x19c0c7[_0x3957('0x32')]['push'](k,_0x229bb8,_0xc0259c,class extends _0x3b8f38{static get[_0x3957('0x66')](){return[_0x229bb8,_0x3957('0x2b')];}[_0x3957('0x55')](){const _0x24a863=this[_0x3957('0x15')]['plugins'][_0x3957('0x12')]('Users');for(const _0x2a2861 of _0x237f7e)_0x2a2861[_0x3957('0x4e')]||_0x24a863[_0x3957('0x10')](_0x2a2861['id'])||_0x24a863[_0x3957('0x1f')](_0x2a2861);const _0x4c3fe8=_0x222098[_0x3957('0x63')][_0x3957('0x3b')]();let _0x434bb7=null;const _0x20eef8=this['editor'][_0x3957('0x32')][_0x3957('0x12')]('RevisionViewer');_0x20eef8[_0x3957('0x3f')]=_0x222098['adapter'],_0x20eef8[_0x3957('0x45')](_0x3957('0x69'))['to'](_0x222098),this[_0x3957('0x15')][_0x3957('0x1b')][_0x3957('0x12')](_0x3957('0x31'))[_0x3957('0x45')](_0x3957('0x69'))['to'](_0x44da2d,'isReadOnly',_0x2a7ba2=>!_0x2a7ba2);for(const _0x193b10 of _0x4c3fe8){const _0x22c5ba=null===_0x193b10[_0x3957('0x6a')];if(_0x22c5ba&&_0x193b10[_0x3957('0x23')]===_0x193b10[_0x3957('0x65')])continue;const _0x2fdb54=_0x193b10['toJSON']();_0x20eef8[_0x3957('0x2a')](_0x2fdb54,(_0x504c86,_0x2aff45,_0x4d108f)=>{if(_0x22c5ba){if(_0x434bb7)_0x434bb7['_update'](_0x504c86,_0x2aff45);else{if(!_0x2aff45){const _0x5b92e2=_0x4d108f[_0x3957('0x47')]();_0x5b92e2['id']=_0x31a2a3(),_0x222098['saveRevision'](_0x5b92e2,_0x4d108f[_0x3957('0x23')])[_0x3957('0x11')](_0x1f9769=>{_0x434bb7=_0x1f9769;});}}}else _0x193b10[_0x3957('0x3a')](_0x504c86,_0x2aff45);});}}},_0x178952),_0x19c0c7);}[_0x3957('0x48')](){const _0x504088=this[_0x3957('0x15')]['config']['get'](_0x3957('0x2d'))[_0x3957('0x39')];this[_0x3957('0x15')][_0x3957('0x34')][_0x3957('0x60')](_0x3957('0x36'),async()=>{this[_0x3957('0x15')][_0x3957('0x21')](_0x3957('0x6b'));const _0x7105af=this[_0x3957('0x15')][_0x3957('0x32')][_0x3957('0x12')](_0x3957('0xe'));if(this[_0x3957('0x15')][_0x3957('0x32')]['has'](_0x3957('0x46'))){const _0x59a0b8=this['editor'][_0x3957('0x32')][_0x3957('0x12')](_0x3957('0x46'));await _0x59a0b8[_0x3957('0x51')]();}else await _0x7105af[_0x3957('0x4f')]();this[_0x3957('0x15')][_0x3957('0x32')]['has'](_0x3957('0x2e'))&&this[_0x3957('0x15')][_0x3957('0x32')][_0x3957('0x12')](_0x3957('0x2e'))[_0x3957('0x3')]();const _0xebf2=this[_0x3957('0xa')]();return _0x504088(_0xebf2)[_0x3957('0x11')](_0x3a85dd=>{return(this[_0x3957('0x1a')]=_0x3a85dd,this[_0x3957('0x15')][_0x3957('0x32')]['has'](_0x3957('0x28')))&&this[_0x3957('0x15')][_0x3957('0x32')][_0x3957('0x12')](_0x3957('0x28'))[_0x3957('0x30')](),_0x3a85dd;})[_0x3957('0x43')](_0xbf8624=>(console[_0x3957('0x33')](_0xbf8624),this['editor'][_0x3957('0x44')](_0x3957('0x6b')),null));});}[_0x3957('0x14')](){const _0x2977fa=this[_0x3957('0x15')][_0x3957('0x34')][_0x3957('0x12')](_0x3957('0x2d'))[_0x3957('0x49')];this[_0x3957('0x15')]['config']['set']('revisionHistory.closeRevisionViewerCallback',()=>(this[_0x3957('0x15')][_0x3957('0x32')][_0x3957('0x40')](_0x3957('0x2e'))&&this[_0x3957('0x15')][_0x3957('0x32')][_0x3957('0x12')](_0x3957('0x2e'))['_recalculatePageBreaks'](),this['_viewerEditor'][_0x3957('0x32')]['get'](_0x3957('0x25'))[_0x3957('0x5f')](),_0x2977fa(this[_0x3957('0x1a')])[_0x3957('0x11')](()=>{if(this[_0x3957('0x15')]['disableReadOnlyMode'](_0x3957('0x6b')),this[_0x3957('0x1a')]=null,this[_0x3957('0x15')][_0x3957('0x32')][_0x3957('0x40')](_0x3957('0x28'))){const _0x219caa=this['editor']['plugins']['get'](_0x3957('0x28'));_0x219caa[_0x3957('0x30')](),_0x219caa['refreshPositioning']();}})));}['_showRevisionViewer'](_0x55cbe2){const _0x31248a=this[_0x3957('0x15')][_0x3957('0x34')]['get']('revisionHistory.editorContainer'),_0x5d33e0=this['editor'][_0x3957('0x34')]['get'](_0x3957('0x29')),_0x3c271b=this[_0x3957('0x15')]['config']['get']('revisionHistory.viewerEditorElement');return _0x256fcd[_0x3957('0x3d')](_0x3c271b,_0x55cbe2)[_0x3957('0x11')](_0x3f0f1c=>(_0x5d33e0[_0x3957('0x59')]['display']='block',_0x31248a[_0x3957('0x59')]['display']=_0x3957('0x37'),_0x3f0f1c));}[_0x3957('0x8')](_0x56b1d6){const _0x1108e8=this[_0x3957('0x15')][_0x3957('0x34')][_0x3957('0x12')]('revisionHistory.editorContainer');return this[_0x3957('0x15')][_0x3957('0x34')][_0x3957('0x12')]('revisionHistory.viewerContainer')[_0x3957('0x59')]['display']=_0x3957('0x37'),_0x1108e8[_0x3957('0x59')][_0x3957('0x1')]='',_0x56b1d6[_0x3957('0x67')]();}async[_0x3957('0x57')](_0xf9837){const _0x2dbc6d=this[_0x3957('0x15')],_0x147e71=this[_0x3957('0x1a')]['plugins'][_0x3957('0x12')]('RevisionViewer'),_0x219c6d=_0x2dbc6d[_0x3957('0x32')][_0x3957('0x12')]('RevisionTracker'),_0x3490ed=_0x147e71[_0x3957('0x63')][_0x3957('0x42')](_0xf9837);let _0x1d2eae,_0x26be5e,_0x26daa7;try{_0x1d2eae=await _0x147e71['getRevisionData'](_0x3490ed),_0x26be5e=await _0x147e71[_0x3957('0x19')](_0x3490ed);}catch(_0x39dc3f){return void console[_0x3957('0x33')](_0x39dc3f);}_0x2dbc6d['model'][_0x3957('0x61')](_0x4f751b=>{for(const _0xf85668 of Array[_0x3957('0x5c')](_0x2dbc6d['model']['markers']['getMarkersGroup'](_0x3957('0x50'))))_0x4f751b[_0x3957('0x7')](_0xf85668);}),_0x147e71[_0x3957('0x27')]=!0x1,_0x2dbc6d[_0x3957('0x13')][_0x3957('0xc')](_0x279a3a=>{_0x279a3a[_0x3957('0x4b')](null),_0x279a3a[_0x3957('0xf')](_0x2dbc6d[_0x3957('0x13')][_0x3957('0x22')][_0x3957('0x52')][_0x3957('0x5a')]());const _0x574665=Object['keys'](_0x1d2eae);for(const _0x342eae of _0x2dbc6d['model'][_0x3957('0x22')][_0x3957('0x3c')])_0x3957('0xb')!=_0x342eae[_0x3957('0x18')]&&_0x342eae['isAttached']()&&!_0x574665[_0x3957('0x38')](_0x342eae[_0x3957('0x18')])&&_0x279a3a[_0x3957('0x0')](_0x342eae);for(const _0x50e1fd of _0x574665){let _0x48c18d=_0x2dbc6d[_0x3957('0x13')]['document'][_0x3957('0x16')](_0x50e1fd);_0x48c18d&&_0x48c18d[_0x3957('0x5')]()||(_0x48c18d=_0x279a3a[_0x3957('0x20')](_0x50e1fd));const _0x3695dc=_0x26be5e[_0x50e1fd],_0x67b967=Object['keys'](_0x3695dc),_0x26bb6b=_0x1d2eae[_0x50e1fd];for(const _0x5b0fbe of _0x48c18d['getAttributeKeys']())_0x67b967[_0x3957('0x38')](_0x5b0fbe)||_0x279a3a[_0x3957('0x3e')](_0x5b0fbe,_0x48c18d);for(const _0xf611bd of _0x67b967)_0x279a3a[_0x3957('0x4')](_0xf611bd,_0x26be5e[_0x50e1fd][_0xf611bd],_0x48c18d);_0x279a3a[_0x3957('0x54')](_0x279a3a['createRangeIn'](_0x48c18d)),_0x279a3a[_0x3957('0x1c')](_0x2dbc6d[_0x3957('0x62')][_0x3957('0x1d')](_0x26bb6b,_0x48c18d),_0x48c18d,0x0);}});const _0xe9a33e=_0x40b5c9(_0x2dbc6d['locale'],_0x3957('0x6'));if(_0x3490ed['name'])_0x26daa7=-0x1==_0x3490ed[_0x3957('0x4a')][_0x3957('0x4c')](_0xe9a33e)?_0xe9a33e+':\x20'+_0x3490ed[_0x3957('0x4a')]:_0x3490ed[_0x3957('0x4a')];else _0x26daa7=_0xe9a33e+':\x20'+(_0x3490ed['createdAt']['toLocaleDateString'](_0x2dbc6d['locale'][_0x3957('0x64')],{'month':_0x3957('0x26'),'day':_0x3957('0x53')})+',\x20'+_0x3490ed[_0x3957('0x5b')]['toLocaleTimeString'](_0x2dbc6d[_0x3957('0x2')]['uiLanguage'],{'hour':_0x3957('0x53'),'minute':_0x3957('0x53')}));return await _0x219c6d[_0x3957('0x56')]({'name':_0x26daa7}),_0x147e71['isReady']=!0x0,_0x2dbc6d[_0x3957('0x34')][_0x3957('0x12')](_0x3957('0x2d'))[_0x3957('0x49')]();}}
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
+ }