@ckeditor/ckeditor5-revision-history 40.0.0 → 40.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +3 -3
- package/build/revision-history.js +1 -1
- package/package.json +6 -6
- package/src/augmentation.d.ts +29 -29
- package/src/changeitem.d.ts +58 -58
- package/src/changeitem.js +1 -1
- package/src/editor/revisionviewereditor.d.ts +27 -27
- package/src/editor/revisionviewereditor.js +1 -1
- package/src/editor/revisionviewereditorui.d.ts +28 -28
- package/src/editor/revisionviewereditorui.js +1 -1
- package/src/editor/revisionviewereditoruiview.d.ts +43 -43
- package/src/editor/revisionviewereditoruiview.js +1 -1
- package/src/index.d.ts +15 -15
- package/src/revision.d.ts +153 -153
- package/src/revision.js +1 -1
- package/src/revisiondiff.d.ts +24 -24
- package/src/revisiondiff.js +1 -1
- package/src/revisionhistory.d.ts +99 -99
- package/src/revisionhistory.js +1 -1
- package/src/revisionhistoryadapter.d.ts +64 -64
- package/src/revisionhistoryconfig.d.ts +60 -60
- package/src/revisionsrepository.d.ts +52 -52
- package/src/revisionsrepository.js +1 -1
- package/src/revisiontracker.d.ts +81 -81
- package/src/revisiontracker.js +1 -1
- package/src/revisionviewer.d.ts +25 -25
- package/src/revisionviewer.js +1 -1
- package/src/ui/revision/createrevisionactionsdropdown.d.ts +10 -10
- package/src/ui/revision/createrevisionactionsdropdown.js +1 -1
- package/src/ui/revision/revisionauthorview.d.ts +5 -5
- package/src/ui/revision/revisionauthorview.js +1 -1
- package/src/ui/revision/revisionnameview.d.ts +5 -5
- package/src/ui/revision/revisionnameview.js +1 -1
- package/src/ui/revision/revisionview.d.ts +95 -95
- package/src/ui/revision/revisionview.js +1 -1
- package/src/ui/revision/subrevisioncollapserview.d.ts +21 -21
- package/src/ui/revision/subrevisioncollapserview.js +1 -1
- package/src/ui/revision/subrevisionview.d.ts +34 -34
- package/src/ui/revision/subrevisionview.js +1 -1
- package/src/ui/revision/utils.d.ts +5 -5
- package/src/ui/revision/utils.js +1 -1
- package/src/ui/revisionhistory/revisionhistorysaverevisionformview.d.ts +81 -81
- package/src/ui/revisionhistory/revisionhistorysaverevisionformview.js +1 -1
- package/src/ui/revisionhistory/revisionhistoryui.d.ts +26 -26
- package/src/ui/revisionhistory/revisionhistoryui.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebar.d.ts +44 -44
- package/src/ui/revisionssidebar/revisionssidebar.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebarheaderview.d.ts +5 -5
- package/src/ui/revisionssidebar/revisionssidebarheaderview.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebartimeperiodview.d.ts +29 -29
- package/src/ui/revisionssidebar/revisionssidebartimeperiodview.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebarview.d.ts +44 -44
- package/src/ui/revisionssidebar/revisionssidebarview.js +1 -1
- package/src/ui/revisionssidebar/utils.d.ts +9 -9
- package/src/ui/revisionssidebar/utils.js +1 -1
- package/src/ui/revisionviewer/changedetailsview.d.ts +22 -22
- package/src/ui/revisionviewer/changedetailsview.js +1 -1
- package/src/ui/revisionviewer/changesnavigationview.d.ts +40 -40
- package/src/ui/revisionviewer/changesnavigationview.js +1 -1
- package/src/ui/revisionviewer/revisionviewerloadingoverlay.d.ts +26 -26
- package/src/ui/revisionviewer/revisionviewerloadingoverlay.js +1 -1
- package/src/ui/revisionviewer/revisionviewerui.d.ts +28 -28
- package/src/ui/revisionviewer/revisionviewerui.js +1 -1
- package/src/utils/common-translations.d.ts +11 -11
- package/src/utils/common-translations.js +1 -1
package/src/revisionhistory.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
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')]();}}
|
|
23
|
+
const _0x4b4e=['enqueueChange','Restored','refreshPositioning','numeric','removeSelectionAttribute','isReadOnly','revisionHistory.closeRevisionViewerCallback','editor','$graveyard','Annotations','_enhanceShowRevisionViewerCallback','then','isEnabled','revisionHistory.viewerEditorElement','removeMarker','_recalculatePageBreaks','_showRevisionViewer','save','revisionHistory.editorContainer','create','commands','Users','getAttributeKeys','rootName','destroy','lazyRoots','Autosave','document','refreshVisibility','indexOf','plugins','setSelection','requires','getRoot','keys','has','toVersion','revision-history-viewer-opened','getRevisions','isAttached','revisionHistory.showRevisionViewerCallback','PaginationLookup','exitToEditing','getRevisionRootsAttributes','toLocaleTimeString','revisionHistory','toJSON','restoreRevision','_update','data','RevisionsRepository','saveRevision','change','createRangeIn','locale','getRevision','isReady','from','fromVersion','RevisionHistoryUI','_getRevisionViewerEditorConfig','setAttribute','addUser','end','_closeRevisionViewer','disableReadOnlyMode','showRevisionViewerCallback','revisionHistory.restoreRevisionCallback','enableReadOnlyMode','update','RevisionViewer','get','RevisionViewerIntegration','name','long','creator','RevisionTracker','block','changesNavigation','getMarkersGroup','closeRevisionViewerCallback','push','selection','addRoot','_cleanUp','pluginName','uiLanguage','result','addRevisionData','adapter','style','RevisionHistory','model','_viewerEditor','error','none','set','detachRoot','removeAttribute','remove','getRevisionData','display','includes','define','createdAt','_enhanceCloseRevisionViewerCallback','insert','bind','RestrictedEditingMode','config'];(function(_0x5e33c3,_0x4b4ea6){const _0x1cebbc=function(_0x3fa25e){while(--_0x3fa25e){_0x5e33c3['push'](_0x5e33c3['shift']());}};_0x1cebbc(++_0x4b4ea6);}(_0x4b4e,0x1f0));const _0x1ceb=function(_0x5e33c3,_0x4b4ea6){_0x5e33c3=_0x5e33c3-0x0;let _0x1cebbc=_0x4b4e[_0x5e33c3];return _0x1cebbc;};import{Plugin as _0x27073e}from'ckeditor5/src/core';import{CKEditorError as _0x344fa8,uid as _0x474813}from'ckeditor5/src/utils';import _0x1867f2 from'./revisiontracker';import _0x4bfb52 from'./ui/revisionhistory/revisionhistoryui';import _0x5f2602 from'./revisionviewer';import _0x45982e from'./ui/revisionviewer/revisionviewerui';import _0x3f5c71 from'./ui/revisionssidebar/revisionssidebar';import _0x209a4a from'./editor/revisionviewereditor';import{getTranslation as _0x4010e2}from'./utils/common-translations';import{sanitizeEditorConfig as _0x2f0231}from'ckeditor5-collaboration/src/collaboration-core';const g=[_0x1ceb('0x3'),_0x1ceb('0x34')];class k extends _0x27073e{static get[_0x1ceb('0x1d')](){return _0x1ceb('0x10');}constructor(_0x11a10c){super(_0x11a10c),this[_0x1ceb('0x1f')]=_0x1ceb('0x7');}}export default class b extends _0x27073e{static get[_0x1ceb('0x1d')](){return _0x1ceb('0x23');}static get[_0x1ceb('0x56')](){return[_0x1867f2,_0x4bfb52];}constructor(_0x510863){if(super(_0x510863),!this[_0x1ceb('0x3d')]['config'][_0x1ceb('0xf')](_0x1ceb('0x63')))throw new _0x344fa8('revision-history-missing-configuration',this);this['_viewerEditor']=null,this['editor'][_0x1ceb('0x35')][_0x1ceb('0x2f')](_0x1ceb('0x5e'),_0x210e99=>this[_0x1ceb('0x46')](_0x210e99)),this[_0x1ceb('0x3d')][_0x1ceb('0x35')][_0x1ceb('0x2f')](_0x1ceb('0x3c'),_0x74db51=>this[_0x1ceb('0x8')](_0x74db51)),this[_0x1ceb('0x3d')][_0x1ceb('0x35')]['define'](_0x1ceb('0xb'),_0x12664d=>this['_restoreRevision'](_0x12664d)),this[_0x1ceb('0x40')](),this[_0x1ceb('0x31')]();}set['adapter'](_0x4e8e9d){this['editor']['plugins'][_0x1ceb('0xf')]('RevisionTracker')[_0x1ceb('0x21')]=_0x4e8e9d;}get['adapter'](){return this[_0x1ceb('0x3d')][_0x1ceb('0x54')][_0x1ceb('0xf')]('RevisionTracker')[_0x1ceb('0x21')];}[_0x1ceb('0x20')](_0x51d4c0){return this[_0x1ceb('0x3d')][_0x1ceb('0x54')][_0x1ceb('0xf')]('RevisionTracker')['addRevisionData'](_0x51d4c0);}[_0x1ceb('0x6d')](_0x458886){return this[_0x1ceb('0x3d')]['plugins']['get']('RevisionsRepository')[_0x1ceb('0x6d')](_0x458886);}[_0x1ceb('0x5c')](_0x3a1dea={'toJSON':!0x1}){return this['editor'][_0x1ceb('0x54')][_0x1ceb('0xf')](_0x1ceb('0x68'))[_0x1ceb('0x5c')](_0x3a1dea);}[_0x1ceb('0x4')](){const _0x54eb77=this[_0x1ceb('0x3d')],_0x57988c=_0x2f0231(_0x54eb77,g),_0x410896=_0x54eb77[_0x1ceb('0x54')][_0x1ceb('0xf')](_0x1ceb('0x14')),_0x4cb1f4=_0x54eb77[_0x1ceb('0x54')][_0x1ceb('0xf')](_0x1ceb('0x4b'))['users'];return _0x57988c['toolbar']=[_0x1ceb('0x60'),'restoreRevision',_0x1ceb('0x16')],delete _0x57988c[_0x1ceb('0x4f')],(_0x57988c['plugins'][_0x1ceb('0x19')](k,_0x5f2602,_0x45982e,class extends _0x27073e{static get[_0x1ceb('0x56')](){return[_0x5f2602,_0x1ceb('0x4b')];}['init'](){const _0x5c1dda=this[_0x1ceb('0x3d')]['plugins'][_0x1ceb('0xf')]('Users');for(const _0x422c10 of _0x4cb1f4)_0x422c10['isAnonymous']||_0x5c1dda['getUser'](_0x422c10['id'])||_0x5c1dda[_0x1ceb('0x6')](_0x422c10);const _0x3d9967=_0x410896['repository'][_0x1ceb('0x5c')]();let _0x454b26=null;const _0x47b2a5=this['editor'][_0x1ceb('0x54')][_0x1ceb('0xf')](_0x1ceb('0xe'));_0x47b2a5[_0x1ceb('0x21')]=_0x410896[_0x1ceb('0x21')],_0x47b2a5[_0x1ceb('0x33')](_0x1ceb('0x42'))['to'](_0x410896),this['editor'][_0x1ceb('0x4a')]['get'](_0x1ceb('0x65'))[_0x1ceb('0x33')](_0x1ceb('0x42'))['to'](_0x54eb77,_0x1ceb('0x3b'),_0x59f880=>!_0x59f880);for(const _0x1cab2e of _0x3d9967){const _0x281618=null===_0x1cab2e[_0x1ceb('0x13')];if(_0x281618&&_0x1cab2e[_0x1ceb('0x5a')]===_0x1cab2e[_0x1ceb('0x2')])continue;const _0x11ec05=_0x1cab2e[_0x1ceb('0x64')]();_0x47b2a5[_0x1ceb('0x20')](_0x11ec05,(_0x11ac96,_0x3f6307,_0xda3599)=>{if(_0x281618){if(_0x454b26)_0x454b26['_update'](_0x11ac96,_0x3f6307);else{if(!_0x3f6307){const _0x1b9bb8=_0xda3599[_0x1ceb('0x64')]();_0x1b9bb8['id']=_0x474813(),_0x410896[_0x1ceb('0x69')](_0x1b9bb8,_0xda3599[_0x1ceb('0x5a')])[_0x1ceb('0x41')](_0x4e32d5=>{_0x454b26=_0x4e32d5;});}}}else _0x1cab2e[_0x1ceb('0x66')](_0x11ac96,_0x3f6307);});}}},_0x3f5c71),_0x57988c);}[_0x1ceb('0x40')](){const _0x3b84d8=this[_0x1ceb('0x3d')]['config'][_0x1ceb('0xf')]('revisionHistory')[_0x1ceb('0xa')];this['editor'][_0x1ceb('0x35')][_0x1ceb('0x28')]('revisionHistory.showRevisionViewerCallback',async()=>{this[_0x1ceb('0x3d')][_0x1ceb('0xc')](_0x1ceb('0x5b'));const _0x1c4b64=this['editor'][_0x1ceb('0x54')][_0x1ceb('0xf')](_0x1ceb('0x14'));if(this[_0x1ceb('0x3d')]['plugins'][_0x1ceb('0x59')](_0x1ceb('0x50'))){const _0x289f77=this[_0x1ceb('0x3d')][_0x1ceb('0x54')]['get'](_0x1ceb('0x50'));await _0x289f77[_0x1ceb('0x47')]();}else await _0x1c4b64[_0x1ceb('0xd')]();this[_0x1ceb('0x3d')][_0x1ceb('0x54')][_0x1ceb('0x59')]('PaginationLookup')&&this[_0x1ceb('0x3d')][_0x1ceb('0x54')][_0x1ceb('0xf')](_0x1ceb('0x5f'))[_0x1ceb('0x45')]();const _0xfcaf00=this[_0x1ceb('0x4')]();return _0x3b84d8(_0xfcaf00)['then'](_0x25efab=>{return(this[_0x1ceb('0x25')]=_0x25efab,this[_0x1ceb('0x3d')][_0x1ceb('0x54')]['has'](_0x1ceb('0x3f')))&&this[_0x1ceb('0x3d')][_0x1ceb('0x54')]['get']('Annotations')[_0x1ceb('0x52')](),_0x25efab;})['catch'](_0x25c8dc=>(console[_0x1ceb('0x26')](_0x25c8dc),this[_0x1ceb('0x3d')][_0x1ceb('0x9')]('revision-history-viewer-opened'),null));});}[_0x1ceb('0x31')](){const _0x12b0ff=this[_0x1ceb('0x3d')][_0x1ceb('0x35')][_0x1ceb('0xf')](_0x1ceb('0x63'))[_0x1ceb('0x18')];this[_0x1ceb('0x3d')]['config'][_0x1ceb('0x28')](_0x1ceb('0x3c'),()=>(this[_0x1ceb('0x3d')]['plugins']['has']('PaginationLookup')&&this['editor'][_0x1ceb('0x54')][_0x1ceb('0xf')](_0x1ceb('0x5f'))[_0x1ceb('0x45')](),this[_0x1ceb('0x25')][_0x1ceb('0x54')][_0x1ceb('0xf')](_0x1ceb('0xe'))[_0x1ceb('0x1c')](),_0x12b0ff(this['_viewerEditor'])[_0x1ceb('0x41')](()=>{if(this[_0x1ceb('0x3d')][_0x1ceb('0x9')](_0x1ceb('0x5b')),this['_viewerEditor']=null,this['editor'][_0x1ceb('0x54')]['has']('Annotations')){const _0x3edf40=this[_0x1ceb('0x3d')][_0x1ceb('0x54')]['get'](_0x1ceb('0x3f'));_0x3edf40[_0x1ceb('0x52')](),_0x3edf40[_0x1ceb('0x38')]();}})));}['_showRevisionViewer'](_0x34d753){const _0x7b6ba1=this[_0x1ceb('0x3d')]['config'][_0x1ceb('0xf')](_0x1ceb('0x48')),_0x43d2d9=this[_0x1ceb('0x3d')]['config']['get']('revisionHistory.viewerContainer'),_0x2d4078=this['editor']['config'][_0x1ceb('0xf')](_0x1ceb('0x43'));return _0x209a4a[_0x1ceb('0x49')](_0x2d4078,_0x34d753)[_0x1ceb('0x41')](_0x2ea087=>(_0x43d2d9['style'][_0x1ceb('0x2d')]=_0x1ceb('0x15'),_0x7b6ba1[_0x1ceb('0x22')][_0x1ceb('0x2d')]=_0x1ceb('0x27'),_0x2ea087));}[_0x1ceb('0x8')](_0x516b2e){const _0x4e8343=this[_0x1ceb('0x3d')][_0x1ceb('0x35')][_0x1ceb('0xf')](_0x1ceb('0x48'));return this[_0x1ceb('0x3d')]['config'][_0x1ceb('0xf')]('revisionHistory.viewerContainer')[_0x1ceb('0x22')]['display']='none',_0x4e8343[_0x1ceb('0x22')][_0x1ceb('0x2d')]='',_0x516b2e[_0x1ceb('0x4e')]();}async['_restoreRevision'](_0x1a9a43){const _0x58a25f=this[_0x1ceb('0x3d')],_0x50024b=this['_viewerEditor'][_0x1ceb('0x54')][_0x1ceb('0xf')]('RevisionViewer'),_0x41ec33=_0x58a25f[_0x1ceb('0x54')]['get'](_0x1ceb('0x14')),_0x3d583a=_0x50024b['repository'][_0x1ceb('0x6d')](_0x1a9a43);let _0x176d61,_0x481df7,_0x491e55;try{_0x176d61=await _0x50024b[_0x1ceb('0x2c')](_0x3d583a),_0x481df7=await _0x50024b[_0x1ceb('0x61')](_0x3d583a);}catch(_0x5fd677){return void console['error'](_0x5fd677);}_0x58a25f[_0x1ceb('0x24')][_0x1ceb('0x6a')](_0x1886ad=>{for(const _0x5830cd of Array[_0x1ceb('0x1')](_0x58a25f['model']['markers'][_0x1ceb('0x17')]('restrictedEditingException')))_0x1886ad[_0x1ceb('0x44')](_0x5830cd);}),_0x50024b[_0x1ceb('0x0')]=!0x1,_0x58a25f[_0x1ceb('0x24')][_0x1ceb('0x36')](_0x3b6edc=>{_0x3b6edc[_0x1ceb('0x55')](null),_0x3b6edc[_0x1ceb('0x3a')](_0x58a25f['model']['document'][_0x1ceb('0x1a')]['getAttributeKeys']());const _0x32874b=Object[_0x1ceb('0x58')](_0x176d61);for(const _0x1fbcde of _0x58a25f[_0x1ceb('0x24')]['document']['roots'])_0x1ceb('0x3e')!=_0x1fbcde['rootName']&&_0x1fbcde['isAttached']()&&!_0x32874b[_0x1ceb('0x2e')](_0x1fbcde[_0x1ceb('0x4d')])&&_0x3b6edc[_0x1ceb('0x29')](_0x1fbcde);for(const _0x34c4db of _0x32874b){let _0x3b57ac=_0x58a25f[_0x1ceb('0x24')][_0x1ceb('0x51')][_0x1ceb('0x57')](_0x34c4db);_0x3b57ac&&_0x3b57ac[_0x1ceb('0x5d')]()||(_0x3b57ac=_0x3b6edc[_0x1ceb('0x1b')](_0x34c4db));const _0x3ac7f9=_0x481df7[_0x34c4db],_0x2f0448=Object['keys'](_0x3ac7f9),_0x42378f=_0x176d61[_0x34c4db];for(const _0x4f62fc of _0x3b57ac[_0x1ceb('0x4c')]())_0x2f0448[_0x1ceb('0x2e')](_0x4f62fc)||_0x3b6edc[_0x1ceb('0x2a')](_0x4f62fc,_0x3b57ac);for(const _0x2ad47d of _0x2f0448)_0x3b6edc[_0x1ceb('0x5')](_0x2ad47d,_0x481df7[_0x34c4db][_0x2ad47d],_0x3b57ac);_0x3b6edc[_0x1ceb('0x2b')](_0x3b6edc[_0x1ceb('0x6b')](_0x3b57ac)),_0x3b6edc[_0x1ceb('0x32')](_0x58a25f[_0x1ceb('0x67')]['parse'](_0x42378f,_0x3b57ac),_0x3b57ac,0x0);}});const _0x3eff12=_0x4010e2(_0x58a25f[_0x1ceb('0x6c')],_0x1ceb('0x37'));if(_0x3d583a['name'])_0x491e55=-0x1==_0x3d583a[_0x1ceb('0x11')][_0x1ceb('0x53')](_0x3eff12)?_0x3eff12+':\x20'+_0x3d583a[_0x1ceb('0x11')]:_0x3d583a[_0x1ceb('0x11')];else _0x491e55=_0x3eff12+':\x20'+(_0x3d583a['createdAt']['toLocaleDateString'](_0x58a25f[_0x1ceb('0x6c')][_0x1ceb('0x1e')],{'month':_0x1ceb('0x12'),'day':'numeric'})+',\x20'+_0x3d583a[_0x1ceb('0x30')][_0x1ceb('0x62')](_0x58a25f[_0x1ceb('0x6c')][_0x1ceb('0x1e')],{'hour':_0x1ceb('0x39'),'minute':_0x1ceb('0x39')}));return await _0x41ec33[_0x1ceb('0x69')]({'name':_0x491e55}),_0x50024b[_0x1ceb('0x0')]=!0x0,_0x58a25f['config']['get'](_0x1ceb('0x63'))[_0x1ceb('0x18')]();}}
|
|
@@ -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
|
+
}
|