@ckeditor/ckeditor5-revision-history 40.0.0 → 40.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +3 -3
- package/README.md +11 -11
- 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 _0x3dc5=['editor','none','restoreRevision','removeSelectionAttribute','adapter','_restoreRevision','refreshVisibility','includes','revisionHistory.editorContainer','getRevisionRootsAttributes','isReadOnly','plugins','revisionHistory.viewerContainer','revisionHistory.restoreRevisionCallback','_getRevisionViewerEditorConfig','removeMarker','_update','update','RevisionTracker','Annotations','error','revision-history-viewer-opened','revisionHistory','set','bind','toolbar','getRevisions','change','PaginationLookup','isEnabled','enableReadOnlyMode','from','RevisionViewerIntegration','changesNavigation','requires','insert','_cleanUp','isReady','$graveyard','isAnonymous','init','_enhanceShowRevisionViewerCallback','create','has','_enhanceCloseRevisionViewerCallback','result','RevisionViewer','define','createdAt','data','_showRevisionViewer','_recalculatePageBreaks','toJSON','refreshPositioning','disableReadOnlyMode','RevisionHistory','isAttached','revisionHistory.showRevisionViewerCallback','setAttribute','toLocaleTimeString','get','showRevisionViewerCallback','removeAttribute','revisionHistory.viewerEditorElement','parse','toLocaleDateString','remove','pluginName','addRevisionData','repository','model','push','enqueueChange','uiLanguage','getUser','Restored','fromVersion','keys','addRoot','style','rootName','lazyRoots','revisionHistory.closeRevisionViewerCallback','setSelection','then','getRevisionData','Users','RevisionsRepository','_closeRevisionViewer','getAttributeKeys','indexOf','name','commands','getMarkersGroup','revision-history-missing-configuration','catch','users','closeRevisionViewerCallback','saveRevision','RestrictedEditingMode','display','numeric','toVersion','locale','config','document','createRangeIn','getRevision','_viewerEditor','Autosave'];(function(_0x7cc542,_0x3dc5d8){const _0x2b58c0=function(_0x25e749){while(--_0x25e749){_0x7cc542['push'](_0x7cc542['shift']());}};_0x2b58c0(++_0x3dc5d8);}(_0x3dc5,0x84));const _0x2b58=function(_0x7cc542,_0x3dc5d8){_0x7cc542=_0x7cc542-0x0;let _0x2b58c0=_0x3dc5[_0x7cc542];return _0x2b58c0;};import{Plugin as _0xb6c344}from'ckeditor5/src/core';import{CKEditorError as _0xfb4ad3,uid as _0x384564}from'ckeditor5/src/utils';import _0x37fb30 from'./revisiontracker';import _0x45b8fc from'./ui/revisionhistory/revisionhistoryui';import _0x13a8e0 from'./revisionviewer';import _0x513dfc from'./ui/revisionviewer/revisionviewerui';import _0x5542f3 from'./ui/revisionssidebar/revisionssidebar';import _0x9c37ae from'./editor/revisionviewereditor';import{getTranslation as _0x3cb8ba}from'./utils/common-translations';import{sanitizeEditorConfig as _0x5086dd}from'ckeditor5-collaboration/src/collaboration-core';const g=['RevisionHistoryUI',_0x2b58('0x4d')];class k extends _0xb6c344{static get[_0x2b58('0x2d')](){return _0x2b58('0xa');}constructor(_0x14cadd){super(_0x14cadd),this[_0x2b58('0x17')]='end';}}export default class b extends _0xb6c344{static get[_0x2b58('0x2d')](){return _0x2b58('0x21');}static get[_0x2b58('0xc')](){return[_0x37fb30,_0x45b8fc];}constructor(_0x26251e){if(super(_0x26251e),!this[_0x2b58('0x58')][_0x2b58('0x52')][_0x2b58('0x26')]('revisionHistory'))throw new _0xfb4ad3(_0x2b58('0x48'),this);this[_0x2b58('0x56')]=null,this[_0x2b58('0x58')][_0x2b58('0x52')]['define'](_0x2b58('0x23'),_0x5c4988=>this['_showRevisionViewer'](_0x5c4988)),this[_0x2b58('0x58')]['config'][_0x2b58('0x19')](_0x2b58('0x3c'),_0x1496a6=>this[_0x2b58('0x42')](_0x1496a6)),this[_0x2b58('0x58')][_0x2b58('0x52')][_0x2b58('0x19')](_0x2b58('0x65'),_0x423a98=>this['_restoreRevision'](_0x423a98)),this[_0x2b58('0x13')](),this[_0x2b58('0x16')]();}set[_0x2b58('0x5c')](_0x588b99){this[_0x2b58('0x58')][_0x2b58('0x63')][_0x2b58('0x26')](_0x2b58('0x6a'))[_0x2b58('0x5c')]=_0x588b99;}get['adapter'](){return this['editor']['plugins']['get'](_0x2b58('0x6a'))['adapter'];}['addRevisionData'](_0x42ed0e){return this[_0x2b58('0x58')][_0x2b58('0x63')][_0x2b58('0x26')](_0x2b58('0x6a'))[_0x2b58('0x2e')](_0x42ed0e);}[_0x2b58('0x55')](_0x1fd49b){return this['editor'][_0x2b58('0x63')][_0x2b58('0x26')](_0x2b58('0x41'))[_0x2b58('0x55')](_0x1fd49b);}['getRevisions'](_0x1f4534={'toJSON':!0x1}){return this[_0x2b58('0x58')][_0x2b58('0x63')]['get'](_0x2b58('0x41'))[_0x2b58('0x4')](_0x1f4534);}[_0x2b58('0x66')](){const _0x2be42f=this[_0x2b58('0x58')],_0x213b6f=_0x5086dd(_0x2be42f,g),_0x5ab766=_0x2be42f[_0x2b58('0x63')]['get'](_0x2b58('0x6a')),_0x4d30f4=_0x2be42f[_0x2b58('0x63')]['get'](_0x2b58('0x40'))[_0x2b58('0x4a')];return _0x213b6f[_0x2b58('0x3')]=['exitToEditing',_0x2b58('0x5a'),_0x2b58('0xb')],delete _0x213b6f[_0x2b58('0x3b')],(_0x213b6f[_0x2b58('0x63')][_0x2b58('0x31')](k,_0x13a8e0,_0x513dfc,class extends _0xb6c344{static get[_0x2b58('0xc')](){return[_0x13a8e0,_0x2b58('0x40')];}[_0x2b58('0x12')](){const _0x38ea37=this[_0x2b58('0x58')][_0x2b58('0x63')][_0x2b58('0x26')](_0x2b58('0x40'));for(const _0x6d009 of _0x4d30f4)_0x6d009[_0x2b58('0x11')]||_0x38ea37[_0x2b58('0x34')](_0x6d009['id'])||_0x38ea37['addUser'](_0x6d009);const _0x1a51be=_0x5ab766[_0x2b58('0x2f')][_0x2b58('0x4')]();let _0x1f1f30=null;const _0x563224=this[_0x2b58('0x58')][_0x2b58('0x63')][_0x2b58('0x26')](_0x2b58('0x18'));_0x563224[_0x2b58('0x5c')]=_0x5ab766[_0x2b58('0x5c')],_0x563224['bind'](_0x2b58('0x7'))['to'](_0x5ab766),this[_0x2b58('0x58')][_0x2b58('0x46')][_0x2b58('0x26')](_0x2b58('0x5a'))[_0x2b58('0x2')]('isEnabled')['to'](_0x2be42f,_0x2b58('0x62'),_0x5cfbf2=>!_0x5cfbf2);for(const _0x341505 of _0x1a51be){const _0x4bf8cf=null===_0x341505['creator'];if(_0x4bf8cf&&_0x341505[_0x2b58('0x50')]===_0x341505[_0x2b58('0x36')])continue;const _0x47b7c2=_0x341505[_0x2b58('0x1e')]();_0x563224[_0x2b58('0x2e')](_0x47b7c2,(_0x4ea6c9,_0x32f114,_0x27fa47)=>{if(_0x4bf8cf){if(_0x1f1f30)_0x1f1f30[_0x2b58('0x68')](_0x4ea6c9,_0x32f114);else{if(!_0x32f114){const _0x536af7=_0x27fa47[_0x2b58('0x1e')]();_0x536af7['id']=_0x384564(),_0x5ab766[_0x2b58('0x4c')](_0x536af7,_0x27fa47[_0x2b58('0x50')])[_0x2b58('0x3e')](_0x3b8df0=>{_0x1f1f30=_0x3b8df0;});}}}else _0x341505['_update'](_0x4ea6c9,_0x32f114);});}}},_0x5542f3),_0x213b6f);}[_0x2b58('0x13')](){const _0x32212c=this['editor'][_0x2b58('0x52')][_0x2b58('0x26')](_0x2b58('0x0'))[_0x2b58('0x27')];this['editor'][_0x2b58('0x52')]['set'](_0x2b58('0x23'),async()=>{this['editor'][_0x2b58('0x8')]('revision-history-viewer-opened');const _0xb51552=this[_0x2b58('0x58')]['plugins'][_0x2b58('0x26')](_0x2b58('0x6a'));if(this[_0x2b58('0x58')][_0x2b58('0x63')][_0x2b58('0x15')](_0x2b58('0x57'))){const _0x4e4107=this['editor']['plugins'][_0x2b58('0x26')](_0x2b58('0x57'));await _0x4e4107['save']();}else await _0xb51552[_0x2b58('0x69')]();this[_0x2b58('0x58')][_0x2b58('0x63')][_0x2b58('0x15')](_0x2b58('0x6'))&&this[_0x2b58('0x58')][_0x2b58('0x63')][_0x2b58('0x26')](_0x2b58('0x6'))[_0x2b58('0x1d')]();const _0x3eb5c9=this[_0x2b58('0x66')]();return _0x32212c(_0x3eb5c9)[_0x2b58('0x3e')](_0x24105b=>{return(this['_viewerEditor']=_0x24105b,this[_0x2b58('0x58')]['plugins']['has'](_0x2b58('0x6b')))&&this[_0x2b58('0x58')][_0x2b58('0x63')][_0x2b58('0x26')]('Annotations')['refreshVisibility'](),_0x24105b;})[_0x2b58('0x49')](_0x4c7305=>(console[_0x2b58('0x6c')](_0x4c7305),this['editor'][_0x2b58('0x20')](_0x2b58('0x6d')),null));});}['_enhanceCloseRevisionViewerCallback'](){const _0x1a8950=this[_0x2b58('0x58')][_0x2b58('0x52')][_0x2b58('0x26')](_0x2b58('0x0'))[_0x2b58('0x4b')];this[_0x2b58('0x58')]['config'][_0x2b58('0x1')](_0x2b58('0x3c'),()=>(this[_0x2b58('0x58')][_0x2b58('0x63')][_0x2b58('0x15')](_0x2b58('0x6'))&&this[_0x2b58('0x58')][_0x2b58('0x63')]['get'](_0x2b58('0x6'))[_0x2b58('0x1d')](),this[_0x2b58('0x56')]['plugins']['get'](_0x2b58('0x18'))[_0x2b58('0xe')](),_0x1a8950(this['_viewerEditor'])[_0x2b58('0x3e')](()=>{if(this[_0x2b58('0x58')][_0x2b58('0x20')](_0x2b58('0x6d')),this[_0x2b58('0x56')]=null,this[_0x2b58('0x58')][_0x2b58('0x63')]['has'](_0x2b58('0x6b'))){const _0x41c577=this[_0x2b58('0x58')][_0x2b58('0x63')][_0x2b58('0x26')](_0x2b58('0x6b'));_0x41c577[_0x2b58('0x5e')](),_0x41c577[_0x2b58('0x1f')]();}})));}[_0x2b58('0x1c')](_0x2ac255){const _0xd72b8d=this[_0x2b58('0x58')][_0x2b58('0x52')][_0x2b58('0x26')](_0x2b58('0x60')),_0x30317c=this[_0x2b58('0x58')][_0x2b58('0x52')]['get']('revisionHistory.viewerContainer'),_0x5beea6=this[_0x2b58('0x58')][_0x2b58('0x52')]['get'](_0x2b58('0x29'));return _0x9c37ae[_0x2b58('0x14')](_0x5beea6,_0x2ac255)[_0x2b58('0x3e')](_0x5ca4de=>(_0x30317c[_0x2b58('0x39')][_0x2b58('0x4e')]='block',_0xd72b8d[_0x2b58('0x39')]['display']=_0x2b58('0x59'),_0x5ca4de));}[_0x2b58('0x42')](_0x3802ad){const _0x35f1c3=this[_0x2b58('0x58')]['config'][_0x2b58('0x26')]('revisionHistory.editorContainer');return this[_0x2b58('0x58')]['config'][_0x2b58('0x26')](_0x2b58('0x64'))['style'][_0x2b58('0x4e')]=_0x2b58('0x59'),_0x35f1c3[_0x2b58('0x39')][_0x2b58('0x4e')]='',_0x3802ad['destroy']();}async[_0x2b58('0x5d')](_0x1f7acf){const _0x263430=this[_0x2b58('0x58')],_0x9118d4=this[_0x2b58('0x56')][_0x2b58('0x63')][_0x2b58('0x26')](_0x2b58('0x18')),_0x423d59=_0x263430[_0x2b58('0x63')][_0x2b58('0x26')](_0x2b58('0x6a')),_0x50c8b2=_0x9118d4['repository']['getRevision'](_0x1f7acf);let _0x7ac4b8,_0x4e44cb,_0x3acc15;try{_0x7ac4b8=await _0x9118d4[_0x2b58('0x3f')](_0x50c8b2),_0x4e44cb=await _0x9118d4[_0x2b58('0x61')](_0x50c8b2);}catch(_0x5b76d3){return void console[_0x2b58('0x6c')](_0x5b76d3);}_0x263430['model'][_0x2b58('0x5')](_0x539b32=>{for(const _0x44c968 of Array[_0x2b58('0x9')](_0x263430['model']['markers'][_0x2b58('0x47')]('restrictedEditingException')))_0x539b32[_0x2b58('0x67')](_0x44c968);}),_0x9118d4[_0x2b58('0xf')]=!0x1,_0x263430['model'][_0x2b58('0x32')](_0x4c206f=>{_0x4c206f[_0x2b58('0x3d')](null),_0x4c206f[_0x2b58('0x5b')](_0x263430[_0x2b58('0x30')][_0x2b58('0x53')]['selection']['getAttributeKeys']());const _0x198dc4=Object[_0x2b58('0x37')](_0x7ac4b8);for(const _0x4dd45e of _0x263430[_0x2b58('0x30')][_0x2b58('0x53')]['roots'])_0x2b58('0x10')!=_0x4dd45e['rootName']&&_0x4dd45e[_0x2b58('0x22')]()&&!_0x198dc4[_0x2b58('0x5f')](_0x4dd45e[_0x2b58('0x3a')])&&_0x4c206f['detachRoot'](_0x4dd45e);for(const _0x528704 of _0x198dc4){let _0x3b02fd=_0x263430['model']['document']['getRoot'](_0x528704);_0x3b02fd&&_0x3b02fd['isAttached']()||(_0x3b02fd=_0x4c206f[_0x2b58('0x38')](_0x528704));const _0xb010fb=_0x4e44cb[_0x528704],_0x3d0738=Object[_0x2b58('0x37')](_0xb010fb),_0x3de211=_0x7ac4b8[_0x528704];for(const _0x53f150 of _0x3b02fd[_0x2b58('0x43')]())_0x3d0738[_0x2b58('0x5f')](_0x53f150)||_0x4c206f[_0x2b58('0x28')](_0x53f150,_0x3b02fd);for(const _0x1fddd5 of _0x3d0738)_0x4c206f[_0x2b58('0x24')](_0x1fddd5,_0x4e44cb[_0x528704][_0x1fddd5],_0x3b02fd);_0x4c206f[_0x2b58('0x2c')](_0x4c206f[_0x2b58('0x54')](_0x3b02fd)),_0x4c206f[_0x2b58('0xd')](_0x263430[_0x2b58('0x1b')][_0x2b58('0x2a')](_0x3de211,_0x3b02fd),_0x3b02fd,0x0);}});const _0x4cce94=_0x3cb8ba(_0x263430['locale'],_0x2b58('0x35'));if(_0x50c8b2[_0x2b58('0x45')])_0x3acc15=-0x1==_0x50c8b2[_0x2b58('0x45')][_0x2b58('0x44')](_0x4cce94)?_0x4cce94+':\x20'+_0x50c8b2[_0x2b58('0x45')]:_0x50c8b2[_0x2b58('0x45')];else _0x3acc15=_0x4cce94+':\x20'+(_0x50c8b2[_0x2b58('0x1a')][_0x2b58('0x2b')](_0x263430[_0x2b58('0x51')][_0x2b58('0x33')],{'month':'long','day':_0x2b58('0x4f')})+',\x20'+_0x50c8b2[_0x2b58('0x1a')][_0x2b58('0x25')](_0x263430['locale'][_0x2b58('0x33')],{'hour':_0x2b58('0x4f'),'minute':_0x2b58('0x4f')}));return await _0x423d59[_0x2b58('0x4c')]({'name':_0x3acc15}),_0x9118d4['isReady']=!0x0,_0x263430['config'][_0x2b58('0x26')](_0x2b58('0x0'))['closeRevisionViewerCallback']();}}
|
|
@@ -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
|
+
}
|