@ckeditor/ckeditor5-revision-history 38.1.0 → 38.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/revision-history.js +1 -1
- package/package.json +6 -6
- package/src/augmentation.d.ts +25 -25
- package/src/changeitem.d.ts +57 -57
- 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 +11 -11
- package/src/revision.d.ts +153 -153
- package/src/revision.js +1 -1
- package/src/revisiondiff.d.ts +20 -20
- package/src/revisiondiff.js +1 -1
- package/src/revisionhistory.d.ts +95 -95
- package/src/revisionhistory.js +1 -1
- package/src/revisionhistoryadapter.d.ts +60 -60
- package/src/revisionhistoryconfig.d.ts +60 -60
- package/src/revisionsrepository.d.ts +48 -48
- package/src/revisionsrepository.js +1 -1
- package/src/revisiontracker.d.ts +77 -77
- package/src/revisiontracker.js +1 -1
- package/src/revisionviewer.d.ts +21 -21
- package/src/revisionviewer.js +1 -1
- package/src/ui/revision/createrevisionactionsdropdown.d.ts +9 -9
- package/src/ui/revision/createrevisionactionsdropdown.js +1 -1
- package/src/ui/revision/revisionauthorview.d.ts +4 -4
- package/src/ui/revision/revisionauthorview.js +1 -1
- package/src/ui/revision/revisionnameview.d.ts +4 -4
- package/src/ui/revision/revisionnameview.js +1 -1
- package/src/ui/revision/revisionview.d.ts +91 -91
- package/src/ui/revision/revisionview.js +1 -1
- package/src/ui/revision/subrevisioncollapserview.d.ts +17 -17
- package/src/ui/revision/subrevisioncollapserview.js +1 -1
- package/src/ui/revision/subrevisionview.d.ts +30 -30
- package/src/ui/revision/subrevisionview.js +1 -1
- package/src/ui/revision/utils.d.ts +4 -4
- package/src/ui/revision/utils.js +1 -1
- package/src/ui/revisionhistory/revisionhistorysaverevisionformview.d.ts +80 -80
- package/src/ui/revisionhistory/revisionhistorysaverevisionformview.js +1 -1
- package/src/ui/revisionhistory/revisionhistoryui.d.ts +22 -22
- package/src/ui/revisionhistory/revisionhistoryui.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebar.d.ts +40 -40
- package/src/ui/revisionssidebar/revisionssidebar.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebarheaderview.d.ts +4 -4
- package/src/ui/revisionssidebar/revisionssidebarheaderview.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebartimeperiodview.d.ts +25 -25
- package/src/ui/revisionssidebar/revisionssidebartimeperiodview.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebarview.d.ts +40 -40
- package/src/ui/revisionssidebar/revisionssidebarview.js +1 -1
- package/src/ui/revisionssidebar/utils.d.ts +8 -8
- package/src/ui/revisionssidebar/utils.js +1 -1
- package/src/ui/revisionviewer/changedetailsview.d.ts +18 -18
- package/src/ui/revisionviewer/changedetailsview.js +1 -1
- package/src/ui/revisionviewer/changesnavigationview.d.ts +36 -36
- package/src/ui/revisionviewer/changesnavigationview.js +1 -1
- package/src/ui/revisionviewer/revisionviewerloadingoverlay.d.ts +22 -22
- package/src/ui/revisionviewer/revisionviewerloadingoverlay.js +1 -1
- package/src/ui/revisionviewer/revisionviewerui.d.ts +24 -24
- package/src/ui/revisionviewer/revisionviewerui.js +1 -1
- package/src/utils/common-translations.d.ts +7 -7
- 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 _0x1e79=['_enhanceCloseRevisionViewerCallback','RevisionViewerIntegration','refreshVisibility','isReady','block','markers','revision-history-viewer-opened','from','Users','set','saveRevision','refreshPositioning','init','_getRevisionViewerEditorConfig','getAttributeKeys','context','initialData','filter','restoreRevision','exitToEditing','revisionHistory.viewerEditorElement','setSelection','users','string','get','enqueueChange','repository','_update','constructor','closeRevisionViewerCallback','locale','map','getRootNames','toLocaleDateString','getRevisions','document','showRevisionViewerCallback','toLocaleTimeString','catch','addRevisionData','restrictedEditingException','indexOf','setAttribute','pluginName','toJSON','error','data','isReadOnly','getRevisionData','keys','config','RestrictedEditingMode','find','removeSelectionAttribute','bind','_viewerEditor','model','createdAt','push','revisionHistory.showRevisionViewerCallback','_cleanUp','DocumentOutline','style','name','has','revisionHistory.restoreRevisionCallback','names','isAnonymous','destroy','_restoreRevision','define','uiLanguage','getMarkersGroup','plugins','selection','includes','disableReadOnlyMode','PaginationLookup','creator','every','revisionHistory.viewerContainer','revisionHistory.closeRevisionViewerCallback','RevisionsRepository','_recalculatePageBreaks','toolbar','commands','insert','addRoot','builtinPlugins','getRevision','addUser','_closeRevisionViewer','extraPlugins','_showRevisionViewer','Autosave','change','parse','RevisionViewer','detachRoot','Annotations','result','then','RevisionTracker','adapter','none','function','create','requires','concat','display','numeric','_enhanceShowRevisionViewerCallback','toVersion','isEnabled','fromVersion','rootsAttributes','editor','revision-history-missing-configuration','revisionHistory.editorContainer','revisionHistory'];(function(_0xbaafe5,_0x1e7986){const _0x12b85f=function(_0x3defc9){while(--_0x3defc9){_0xbaafe5['push'](_0xbaafe5['shift']());}};_0x12b85f(++_0x1e7986);}(_0x1e79,0x95));const _0x12b8=function(_0xbaafe5,_0x1e7986){_0xbaafe5=_0xbaafe5-0x0;let _0x12b85f=_0x1e79[_0xbaafe5];return _0x12b85f;};import{Plugin as _0x8a7cc5}from'ckeditor5/src/core';import{CKEditorError as _0x40cd33,uid as _0x568850}from'ckeditor5/src/utils';import _0x3f7e0e from'./revisiontracker';import _0xad4244 from'./ui/revisionhistory/revisionhistoryui';import _0x36d3ee from'./revisionviewer';import _0x5a2107 from'./ui/revisionviewer/revisionviewerui';import _0x224689 from'./ui/revisionssidebar/revisionssidebar';import _0x555499 from'./editor/revisionviewereditor';import{getTranslation as _0x4bb1b0}from'./utils/common-translations';class p extends _0x8a7cc5{static get[_0x12b8('0xe')](){return _0x12b8('0x5c');}constructor(_0x5eafb7){super(_0x5eafb7),this[_0x12b8('0x47')]='end';}}export default class g extends _0x8a7cc5{static get[_0x12b8('0xe')](){return'RevisionHistory';}static get[_0x12b8('0x4e')](){return[_0x3f7e0e,_0xad4244];}constructor(_0x43001a){if(super(_0x43001a),!this['editor'][_0x12b8('0x15')][_0x12b8('0x73')](_0x12b8('0x5a')))throw new _0x40cd33(_0x12b8('0x58'),this);this[_0x12b8('0x1a')]=null,this['editor'][_0x12b8('0x15')][_0x12b8('0x29')](_0x12b8('0x1e'),_0x98d1e6=>this[_0x12b8('0x40')](_0x98d1e6)),this['editor'][_0x12b8('0x15')][_0x12b8('0x29')]('revisionHistory.closeRevisionViewerCallback',_0x555865=>this[_0x12b8('0x3e')](_0x555865)),this[_0x12b8('0x57')][_0x12b8('0x15')]['define'](_0x12b8('0x24'),_0x4467b2=>this[_0x12b8('0x28')](_0x4467b2)),this[_0x12b8('0x52')](),this['_enhanceCloseRevisionViewerCallback']();}set['adapter'](_0x221a74){this[_0x12b8('0x57')][_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x49'))[_0x12b8('0x4a')]=_0x221a74;}get['adapter'](){return this[_0x12b8('0x57')][_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x49'))[_0x12b8('0x4a')];}[_0x12b8('0xa')](_0x2fd4ff){return this['editor'][_0x12b8('0x2c')][_0x12b8('0x73')]('RevisionTracker')['addRevisionData'](_0x2fd4ff);}['getRevision'](_0x43a120){return this['editor'][_0x12b8('0x2c')]['get'](_0x12b8('0x35'))[_0x12b8('0x3c')](_0x43a120);}['getRevisions'](_0xb0121b={'toJSON':!0x1}){return this[_0x12b8('0x57')][_0x12b8('0x2c')]['get'](_0x12b8('0x35'))[_0x12b8('0x5')](_0xb0121b);}['_getRevisionViewerEditorConfig'](){const _0x26ccdf=[_0x12b8('0x6a')],_0x52d9d4=['RevisionTracker','RevisionHistoryUI','WebSocketGateway',_0x12b8('0x16'),_0x12b8('0x41'),_0x12b8('0x20')],_0x3ba99c={},_0x58450c=this[_0x12b8('0x57')],_0x266ae2=_0x58450c[_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x49')),_0xf0ea27=_0x58450c[_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x63'))[_0x12b8('0x71')];for(const _0x3d946f of _0x58450c[_0x12b8('0x15')][_0x12b8('0x25')]())_0x26ccdf[_0x12b8('0x2e')](_0x3d946f)||(_0x3ba99c[_0x3d946f]=_0x58450c['config'][_0x12b8('0x73')](_0x3d946f));delete _0x3ba99c[_0x12b8('0x6b')],delete _0x3ba99c[_0x12b8('0x56')],_0x3ba99c[_0x12b8('0x37')]=[_0x12b8('0x6e'),'restoreRevision','changesNavigation'];const _0x52c82c=this['editor'][_0x12b8('0x77')][_0x12b8('0x3b')]||[],_0x1546bd=_0x3ba99c[_0x12b8('0x3f')]||[];delete _0x3ba99c[_0x12b8('0x3f')];const _0x3feca3=_0x58450c['_context'][_0x12b8('0x15')]['get']('plugins')||[],_0x26ecae=_0x52c82c[_0x12b8('0x4f')](_0x3ba99c[_0x12b8('0x2c')])[_0x12b8('0x4f')](_0x1546bd)[_0x12b8('0x4f')](_0x3feca3)[_0x12b8('0x2')](_0x4ea797=>_0x12b8('0x72')==typeof _0x4ea797?_0x52c82c[_0x12b8('0x17')](_0xb0f34d=>_0xb0f34d[_0x12b8('0xe')]==_0x4ea797):_0x4ea797);_0x3ba99c[_0x12b8('0x2c')]=Array[_0x12b8('0x62')](new Set(_0x26ecae))[_0x12b8('0x6c')](_0x3f5179=>_0x55a3f7(_0x3f5179,_0x58450c[_0x12b8('0x2c')],[]));function _0x55a3f7(_0x58d5f4,_0x21c764,_0x51c43b){const _0x3ca816='function'==typeof _0x58d5f4?_0x58d5f4['pluginName']||_0x58d5f4[_0x12b8('0x22')]:_0x58d5f4;if(_0x51c43b[_0x12b8('0x2e')](_0x3ca816))return!0x0;if(_0x51c43b[_0x12b8('0x1d')](_0x3ca816),_0x52d9d4[_0x12b8('0x2e')](_0x3ca816))return!0x1;const _0x1cc699=((_0x12b8('0x4c')==typeof _0x58d5f4?_0x58d5f4:_0x21c764[_0x12b8('0x23')](_0x3ca816)?_0x21c764[_0x12b8('0x73')](_0x3ca816):{})[_0x12b8('0x4e')]||[])[_0x12b8('0x32')](_0x489807=>_0x55a3f7(_0x489807,_0x21c764,_0x51c43b));return _0x1cc699||_0x52d9d4['push'](_0x3ca816),_0x1cc699;}return _0x3ba99c[_0x12b8('0x2c')][_0x12b8('0x1d')](p,_0x36d3ee,_0x5a2107,class extends _0x8a7cc5{static get[_0x12b8('0x4e')](){return[_0x36d3ee,_0x12b8('0x63')];}[_0x12b8('0x67')](){const _0x232204=this['editor'][_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x63'));for(const _0x1fb9e7 of _0xf0ea27)_0x1fb9e7[_0x12b8('0x26')]||_0x232204['getUser'](_0x1fb9e7['id'])||_0x232204[_0x12b8('0x3d')](_0x1fb9e7);const _0x2c0a44=_0x266ae2[_0x12b8('0x75')][_0x12b8('0x5')]();let _0x1628ca=null;const _0x1c011c=this[_0x12b8('0x57')][_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x44'));_0x1c011c['adapter']=_0x266ae2[_0x12b8('0x4a')],_0x1c011c['bind'](_0x12b8('0x54'))['to'](_0x266ae2),this[_0x12b8('0x57')][_0x12b8('0x38')][_0x12b8('0x73')](_0x12b8('0x6d'))[_0x12b8('0x19')](_0x12b8('0x54'))['to'](_0x58450c,_0x12b8('0x12'),_0x240321=>!_0x240321);for(const _0x46723f of _0x2c0a44){const _0x1074a6=null===_0x46723f[_0x12b8('0x31')];if(_0x1074a6&&_0x46723f[_0x12b8('0x53')]===_0x46723f[_0x12b8('0x55')])continue;const _0x25f368=_0x46723f[_0x12b8('0xf')]();_0x1c011c[_0x12b8('0xa')](_0x25f368,(_0x4da313,_0x24ecde,_0x516fc1)=>{if(_0x1074a6){if(_0x1628ca)_0x1628ca['_update'](_0x4da313,_0x24ecde);else{if(!_0x24ecde){const _0x39b999=_0x516fc1[_0x12b8('0xf')]();_0x39b999['id']=_0x568850(),_0x266ae2['saveRevision'](_0x39b999,_0x516fc1[_0x12b8('0x53')])[_0x12b8('0x48')](_0x3bad76=>{_0x1628ca=_0x3bad76;});}}}else _0x46723f[_0x12b8('0x76')](_0x4da313,_0x24ecde);});}}},_0x224689),_0x3ba99c;}[_0x12b8('0x52')](){const _0x4bc955=this['editor']['config'][_0x12b8('0x73')](_0x12b8('0x5a'))[_0x12b8('0x7')];this[_0x12b8('0x57')]['config'][_0x12b8('0x64')](_0x12b8('0x1e'),async()=>{this['editor']['enableReadOnlyMode'](_0x12b8('0x61'));const _0x555691=this[_0x12b8('0x57')][_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x49'));if(this[_0x12b8('0x57')][_0x12b8('0x2c')][_0x12b8('0x23')]('Autosave')){const _0x8ee213=this[_0x12b8('0x57')][_0x12b8('0x2c')]['get'](_0x12b8('0x41'));await _0x8ee213['save']();}else await _0x555691['update']();this[_0x12b8('0x57')][_0x12b8('0x2c')]['has'](_0x12b8('0x30'))&&this[_0x12b8('0x57')][_0x12b8('0x2c')]['get'](_0x12b8('0x30'))[_0x12b8('0x36')]();const _0x1bdfe3=this[_0x12b8('0x68')]();return _0x4bc955(_0x1bdfe3)[_0x12b8('0x48')](_0x3067d1=>{return(this[_0x12b8('0x1a')]=_0x3067d1,this[_0x12b8('0x57')]['plugins'][_0x12b8('0x23')](_0x12b8('0x46')))&&this[_0x12b8('0x57')][_0x12b8('0x2c')][_0x12b8('0x73')]('Annotations')[_0x12b8('0x5d')](),_0x3067d1;})[_0x12b8('0x9')](_0x92fd27=>(console[_0x12b8('0x10')](_0x92fd27),this[_0x12b8('0x57')][_0x12b8('0x2f')](_0x12b8('0x61')),null));});}[_0x12b8('0x5b')](){const _0x91d48=this[_0x12b8('0x57')][_0x12b8('0x15')][_0x12b8('0x73')](_0x12b8('0x5a'))['closeRevisionViewerCallback'];this['editor'][_0x12b8('0x15')][_0x12b8('0x64')](_0x12b8('0x34'),()=>(this[_0x12b8('0x57')][_0x12b8('0x2c')]['has'](_0x12b8('0x30'))&&this[_0x12b8('0x57')][_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x30'))[_0x12b8('0x36')](),this[_0x12b8('0x1a')][_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x44'))[_0x12b8('0x1f')](),_0x91d48(this[_0x12b8('0x1a')])[_0x12b8('0x48')](()=>{if(this['editor']['disableReadOnlyMode'](_0x12b8('0x61')),this[_0x12b8('0x1a')]=null,this[_0x12b8('0x57')][_0x12b8('0x2c')][_0x12b8('0x23')]('Annotations')){const _0x170158=this[_0x12b8('0x57')][_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x46'));_0x170158[_0x12b8('0x5d')](),_0x170158[_0x12b8('0x66')]();}})));}[_0x12b8('0x40')](_0x40c8f0){const _0x57719b=this[_0x12b8('0x57')][_0x12b8('0x15')][_0x12b8('0x73')](_0x12b8('0x59')),_0x536799=this[_0x12b8('0x57')]['config'][_0x12b8('0x73')](_0x12b8('0x33')),_0x5a2f3=this[_0x12b8('0x57')]['config'][_0x12b8('0x73')](_0x12b8('0x6f'));return _0x555499[_0x12b8('0x4d')](_0x5a2f3,_0x40c8f0)[_0x12b8('0x48')](_0x2bf5be=>(_0x536799[_0x12b8('0x21')][_0x12b8('0x50')]=_0x12b8('0x5f'),_0x57719b[_0x12b8('0x21')]['display']='none',_0x2bf5be));}[_0x12b8('0x3e')](_0x47f661){const _0xb05087=this[_0x12b8('0x57')][_0x12b8('0x15')][_0x12b8('0x73')]('revisionHistory.editorContainer');return this[_0x12b8('0x57')][_0x12b8('0x15')]['get'](_0x12b8('0x33'))[_0x12b8('0x21')]['display']=_0x12b8('0x4b'),_0xb05087[_0x12b8('0x21')][_0x12b8('0x50')]='',_0x47f661[_0x12b8('0x27')]();}async[_0x12b8('0x28')](_0x4ddeb3){const _0x414017=this[_0x12b8('0x57')],_0x45bf76=this['_viewerEditor'][_0x12b8('0x2c')][_0x12b8('0x73')](_0x12b8('0x44')),_0x438874=_0x414017[_0x12b8('0x2c')][_0x12b8('0x73')]('RevisionTracker'),_0x29a53c=_0x45bf76[_0x12b8('0x75')]['getRevision'](_0x4ddeb3);let _0xef75f7,_0x1a2346,_0xe8901a;try{_0xef75f7=await _0x45bf76[_0x12b8('0x13')](_0x29a53c),_0x1a2346=await _0x45bf76['getRevisionRootsAttributes'](_0x29a53c);}catch(_0xdd0027){return void console[_0x12b8('0x10')](_0xdd0027);}_0x414017[_0x12b8('0x1b')][_0x12b8('0x42')](_0x37265a=>{for(const _0x3ada06 of Array[_0x12b8('0x62')](_0x414017['model'][_0x12b8('0x60')][_0x12b8('0x2b')](_0x12b8('0xb'))))_0x37265a['removeMarker'](_0x3ada06);}),_0x45bf76['isReady']=!0x1,_0x414017[_0x12b8('0x1b')][_0x12b8('0x74')](_0x1171b8=>{_0x1171b8[_0x12b8('0x70')](null),_0x1171b8[_0x12b8('0x18')](_0x414017[_0x12b8('0x1b')][_0x12b8('0x6')][_0x12b8('0x2d')][_0x12b8('0x69')]());for(const _0x275c86 of _0x414017[_0x12b8('0x1b')]['document'][_0x12b8('0x3')]())_0x1171b8[_0x12b8('0x45')](_0x275c86);for(const _0x2d9197 of Object[_0x12b8('0x14')](_0xef75f7)){const _0x4a75a9=_0x1171b8[_0x12b8('0x3a')](_0x2d9197);for(const _0x597d55 of Object['keys'](_0x1a2346[_0x2d9197]))_0x1171b8[_0x12b8('0xd')](_0x597d55,_0x1a2346[_0x2d9197][_0x597d55],_0x4a75a9);_0x1171b8[_0x12b8('0x39')](_0x414017[_0x12b8('0x11')][_0x12b8('0x43')](_0xef75f7[_0x2d9197],_0x4a75a9),_0x4a75a9,0x0);}});const _0xd8e8cf=_0x4bb1b0(_0x414017[_0x12b8('0x1')],'Restored');if(_0x29a53c[_0x12b8('0x22')])_0xe8901a=-0x1==_0x29a53c['name'][_0x12b8('0xc')](_0xd8e8cf)?_0xd8e8cf+':\x20'+_0x29a53c[_0x12b8('0x22')]:_0x29a53c[_0x12b8('0x22')];else _0xe8901a=_0xd8e8cf+':\x20'+(_0x29a53c['createdAt'][_0x12b8('0x4')](_0x414017[_0x12b8('0x1')][_0x12b8('0x2a')],{'month':'long','day':'numeric'})+',\x20'+_0x29a53c[_0x12b8('0x1c')][_0x12b8('0x8')](_0x414017['locale'][_0x12b8('0x2a')],{'hour':_0x12b8('0x51'),'minute':_0x12b8('0x51')}));return await _0x438874[_0x12b8('0x65')]({'name':_0xe8901a}),_0x45bf76[_0x12b8('0x5e')]=!0x0,_0x414017[_0x12b8('0x15')][_0x12b8('0x73')](_0x12b8('0x5a'))[_0x12b8('0x0')]();}}
|
|
23
|
+
const _0xe461=['DocumentOutline','destroy','Autosave','toLocaleTimeString','_showRevisionViewer','revisionHistory.restoreRevisionCallback','includes','Users','selection','style','has','closeRevisionViewerCallback','refreshVisibility','define','isEnabled','restoreRevision','getRevisions','getRevisionRootsAttributes','numeric','adapter','model','initialData','builtinPlugins','keys','addRoot','requires','Restored','find','then','catch','parse','document','PaginationLookup','revision-history-missing-configuration','editor','getAttributeKeys','bind','saveRevision','uiLanguage','getRevision','Annotations','detachRoot','_viewerEditor','string','setSelection','removeSelectionAttribute','getRevisionData','_cleanUp','revisionHistory.editorContainer','isReadOnly','changesNavigation','isReady','concat','from','restrictedEditingException','getUser','_update','revisionHistory.viewerContainer','name','push','removeMarker','display','map','_recalculatePageBreaks','function','_enhanceCloseRevisionViewerCallback','_restoreRevision','rootsAttributes','context','revisionHistory','refreshPositioning','set','end','update','addRevisionData','insert','_enhanceShowRevisionViewerCallback','RevisionViewerIntegration','disableReadOnlyMode','RevisionViewer','revisionHistory.viewerEditorElement','config','every','toVersion','constructor','createdAt','WebSocketGateway','RevisionsRepository','extraPlugins','RevisionTracker','init','RestrictedEditingMode','revisionHistory.closeRevisionViewerCallback','revision-history-viewer-opened','get','getMarkersGroup','pluginName','markers','error','toJSON','plugins','none','locale','result','enqueueChange','names','revisionHistory.showRevisionViewerCallback','_getRevisionViewerEditorConfig','RevisionHistory'];(function(_0x24430b,_0xe46103){const _0x1b6d99=function(_0x555c20){while(--_0x555c20){_0x24430b['push'](_0x24430b['shift']());}};_0x1b6d99(++_0xe46103);}(_0xe461,0xfc));const _0x1b6d=function(_0x24430b,_0xe46103){_0x24430b=_0x24430b-0x0;let _0x1b6d99=_0xe461[_0x24430b];return _0x1b6d99;};import{Plugin as _0x5c6ace}from'ckeditor5/src/core';import{CKEditorError as _0xa61ff1,uid as _0x1def92}from'ckeditor5/src/utils';import _0x1d999a from'./revisiontracker';import _0x5e8630 from'./ui/revisionhistory/revisionhistoryui';import _0x206912 from'./revisionviewer';import _0x54c77a from'./ui/revisionviewer/revisionviewerui';import _0x2c36a1 from'./ui/revisionssidebar/revisionssidebar';import _0x3f34d4 from'./editor/revisionviewereditor';import{getTranslation as _0x43aa2f}from'./utils/common-translations';class p extends _0x5c6ace{static get['pluginName'](){return _0x1b6d('0x2b');}constructor(_0x2fa76a){super(_0x2fa76a),this[_0x1b6d('0x45')]=_0x1b6d('0x26');}}export default class g extends _0x5c6ace{static get['pluginName'](){return _0x1b6d('0x4a');}static get[_0x1b6d('0x64')](){return[_0x1d999a,_0x5e8630];}constructor(_0x962b55){if(super(_0x962b55),!this['editor'][_0x1b6d('0x2f')][_0x1b6d('0x3c')](_0x1b6d('0x23')))throw new _0xa61ff1(_0x1b6d('0x6c'),this);this[_0x1b6d('0x8')]=null,this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x58')](_0x1b6d('0x48'),_0x156816=>this[_0x1b6d('0x4f')](_0x156816)),this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x58')](_0x1b6d('0x3a'),_0x4862ac=>this['_closeRevisionViewer'](_0x4862ac)),this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x58')](_0x1b6d('0x50'),_0xa2522e=>this[_0x1b6d('0x20')](_0xa2522e)),this[_0x1b6d('0x2a')](),this[_0x1b6d('0x1f')]();}set[_0x1b6d('0x5e')](_0x338278){this[_0x1b6d('0x0')][_0x1b6d('0x42')]['get']('RevisionTracker')[_0x1b6d('0x5e')]=_0x338278;}get['adapter'](){return this[_0x1b6d('0x0')][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x37'))['adapter'];}[_0x1b6d('0x28')](_0x135200){return this[_0x1b6d('0x0')][_0x1b6d('0x42')]['get']('RevisionTracker')['addRevisionData'](_0x135200);}[_0x1b6d('0x5')](_0x1ab51c){return this['editor'][_0x1b6d('0x42')][_0x1b6d('0x3c')]('RevisionsRepository')['getRevision'](_0x1ab51c);}[_0x1b6d('0x5b')](_0x4ba3c9={'toJSON':!0x1}){return this['editor']['plugins'][_0x1b6d('0x3c')](_0x1b6d('0x35'))[_0x1b6d('0x5b')](_0x4ba3c9);}['_getRevisionViewerEditorConfig'](){const _0x2bcc8d=[_0x1b6d('0x22')],_0x9cb433=[_0x1b6d('0x37'),'RevisionHistoryUI',_0x1b6d('0x34'),_0x1b6d('0x39'),_0x1b6d('0x4d'),_0x1b6d('0x4b')],_0x1ee95d={},_0x4f590a=this[_0x1b6d('0x0')],_0xccb18e=_0x4f590a[_0x1b6d('0x42')]['get'](_0x1b6d('0x37')),_0x1f6b8d=_0x4f590a[_0x1b6d('0x42')]['get']('Users')['users'];for(const _0x13ef48 of _0x4f590a[_0x1b6d('0x2f')][_0x1b6d('0x47')]())_0x2bcc8d['includes'](_0x13ef48)||(_0x1ee95d[_0x13ef48]=_0x4f590a[_0x1b6d('0x2f')][_0x1b6d('0x3c')](_0x13ef48));delete _0x1ee95d[_0x1b6d('0x60')],delete _0x1ee95d[_0x1b6d('0x21')],_0x1ee95d['toolbar']=['exitToEditing','restoreRevision',_0x1b6d('0x10')];const _0x6cb823=this[_0x1b6d('0x0')][_0x1b6d('0x32')][_0x1b6d('0x61')]||[],_0xda1a44=_0x1ee95d[_0x1b6d('0x36')]||[];delete _0x1ee95d['extraPlugins'];const _0x572441=_0x4f590a['_context']['config'][_0x1b6d('0x3c')]('plugins')||[],_0x3d7011=_0x6cb823[_0x1b6d('0x12')](_0x1ee95d[_0x1b6d('0x42')])[_0x1b6d('0x12')](_0xda1a44)[_0x1b6d('0x12')](_0x572441)[_0x1b6d('0x1c')](_0x3696dd=>_0x1b6d('0x9')==typeof _0x3696dd?_0x6cb823[_0x1b6d('0x66')](_0x5d0226=>_0x5d0226[_0x1b6d('0x3e')]==_0x3696dd):_0x3696dd);_0x1ee95d[_0x1b6d('0x42')]=Array[_0x1b6d('0x13')](new Set(_0x3d7011))['filter'](_0x27b7fe=>_0x1f1a4c(_0x27b7fe,_0x4f590a[_0x1b6d('0x42')],[]));function _0x1f1a4c(_0x410927,_0x4b20bf,_0x239dc5){const _0x52863a=_0x1b6d('0x1e')==typeof _0x410927?_0x410927['pluginName']||_0x410927[_0x1b6d('0x18')]:_0x410927;if(_0x239dc5[_0x1b6d('0x51')](_0x52863a))return!0x0;if(_0x239dc5[_0x1b6d('0x19')](_0x52863a),_0x9cb433[_0x1b6d('0x51')](_0x52863a))return!0x1;const _0x7fa6dd=((_0x1b6d('0x1e')==typeof _0x410927?_0x410927:_0x4b20bf[_0x1b6d('0x55')](_0x52863a)?_0x4b20bf[_0x1b6d('0x3c')](_0x52863a):{})[_0x1b6d('0x64')]||[])[_0x1b6d('0x30')](_0x526025=>_0x1f1a4c(_0x526025,_0x4b20bf,_0x239dc5));return _0x7fa6dd||_0x9cb433[_0x1b6d('0x19')](_0x52863a),_0x7fa6dd;}return _0x1ee95d[_0x1b6d('0x42')][_0x1b6d('0x19')](p,_0x206912,_0x54c77a,class extends _0x5c6ace{static get[_0x1b6d('0x64')](){return[_0x206912,_0x1b6d('0x52')];}[_0x1b6d('0x38')](){const _0x159bb4=this['editor'][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x52'));for(const _0x5e0104 of _0x1f6b8d)_0x5e0104['isAnonymous']||_0x159bb4[_0x1b6d('0x15')](_0x5e0104['id'])||_0x159bb4['addUser'](_0x5e0104);const _0x5a437d=_0xccb18e['repository']['getRevisions']();let _0x3500d5=null;const _0x1b33a9=this['editor'][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x2d'));_0x1b33a9[_0x1b6d('0x5e')]=_0xccb18e[_0x1b6d('0x5e')],_0x1b33a9[_0x1b6d('0x2')](_0x1b6d('0x59'))['to'](_0xccb18e),this[_0x1b6d('0x0')]['commands'][_0x1b6d('0x3c')](_0x1b6d('0x5a'))[_0x1b6d('0x2')](_0x1b6d('0x59'))['to'](_0x4f590a,_0x1b6d('0xf'),_0x629eb5=>!_0x629eb5);for(const _0x4f6c8f of _0x5a437d){const _0x19af5a=null===_0x4f6c8f['creator'];if(_0x19af5a&&_0x4f6c8f[_0x1b6d('0x31')]===_0x4f6c8f['fromVersion'])continue;const _0x354bd3=_0x4f6c8f[_0x1b6d('0x41')]();_0x1b33a9['addRevisionData'](_0x354bd3,(_0x186c10,_0x4d6129,_0x3a7e0a)=>{if(_0x19af5a){if(_0x3500d5)_0x3500d5[_0x1b6d('0x16')](_0x186c10,_0x4d6129);else{if(!_0x4d6129){const _0x51dd9a=_0x3a7e0a[_0x1b6d('0x41')]();_0x51dd9a['id']=_0x1def92(),_0xccb18e[_0x1b6d('0x3')](_0x51dd9a,_0x3a7e0a[_0x1b6d('0x31')])[_0x1b6d('0x67')](_0x2726e6=>{_0x3500d5=_0x2726e6;});}}}else _0x4f6c8f[_0x1b6d('0x16')](_0x186c10,_0x4d6129);});}}},_0x2c36a1),_0x1ee95d;}[_0x1b6d('0x2a')](){const _0x507687=this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x3c')]('revisionHistory')['showRevisionViewerCallback'];this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x25')](_0x1b6d('0x48'),async()=>{this[_0x1b6d('0x0')]['enableReadOnlyMode']('revision-history-viewer-opened');const _0x57b704=this[_0x1b6d('0x0')][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x37'));if(this[_0x1b6d('0x0')]['plugins'][_0x1b6d('0x55')](_0x1b6d('0x4d'))){const _0x1a3511=this[_0x1b6d('0x0')][_0x1b6d('0x42')][_0x1b6d('0x3c')]('Autosave');await _0x1a3511['save']();}else await _0x57b704[_0x1b6d('0x27')]();this[_0x1b6d('0x0')]['plugins'][_0x1b6d('0x55')](_0x1b6d('0x6b'))&&this[_0x1b6d('0x0')][_0x1b6d('0x42')]['get'](_0x1b6d('0x6b'))[_0x1b6d('0x1d')]();const _0x55f53c=this[_0x1b6d('0x49')]();return _0x507687(_0x55f53c)[_0x1b6d('0x67')](_0x5a3215=>{return(this[_0x1b6d('0x8')]=_0x5a3215,this['editor'][_0x1b6d('0x42')][_0x1b6d('0x55')](_0x1b6d('0x6')))&&this['editor'][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x6'))[_0x1b6d('0x57')](),_0x5a3215;})[_0x1b6d('0x68')](_0xace921=>(console[_0x1b6d('0x40')](_0xace921),this[_0x1b6d('0x0')]['disableReadOnlyMode'](_0x1b6d('0x3b')),null));});}[_0x1b6d('0x1f')](){const _0x4ce369=this[_0x1b6d('0x0')][_0x1b6d('0x2f')]['get'](_0x1b6d('0x23'))[_0x1b6d('0x56')];this[_0x1b6d('0x0')][_0x1b6d('0x2f')][_0x1b6d('0x25')](_0x1b6d('0x3a'),()=>(this[_0x1b6d('0x0')]['plugins'][_0x1b6d('0x55')](_0x1b6d('0x6b'))&&this[_0x1b6d('0x0')][_0x1b6d('0x42')][_0x1b6d('0x3c')](_0x1b6d('0x6b'))[_0x1b6d('0x1d')](),this[_0x1b6d('0x8')][_0x1b6d('0x42')][_0x1b6d('0x3c')]('RevisionViewer')[_0x1b6d('0xd')](),_0x4ce369(this[_0x1b6d('0x8')])[_0x1b6d('0x67')](()=>{if(this[_0x1b6d('0x0')][_0x1b6d('0x2c')]('revision-history-viewer-opened'),this['_viewerEditor']=null,this[_0x1b6d('0x0')][_0x1b6d('0x42')][_0x1b6d('0x55')](_0x1b6d('0x6'))){const _0x478333=this['editor'][_0x1b6d('0x42')]['get'](_0x1b6d('0x6'));_0x478333['refreshVisibility'](),_0x478333[_0x1b6d('0x24')]();}})));}[_0x1b6d('0x4f')](_0x5c3d76){const _0x5b755e=this[_0x1b6d('0x0')][_0x1b6d('0x2f')]['get'](_0x1b6d('0xe')),_0x4cbb33=this[_0x1b6d('0x0')][_0x1b6d('0x2f')]['get']('revisionHistory.viewerContainer'),_0x24b322=this[_0x1b6d('0x0')]['config'][_0x1b6d('0x3c')](_0x1b6d('0x2e'));return _0x3f34d4['create'](_0x24b322,_0x5c3d76)[_0x1b6d('0x67')](_0x32c520=>(_0x4cbb33['style'][_0x1b6d('0x1b')]='block',_0x5b755e['style'][_0x1b6d('0x1b')]=_0x1b6d('0x43'),_0x32c520));}['_closeRevisionViewer'](_0x361c6b){const _0xc2061=this[_0x1b6d('0x0')]['config'][_0x1b6d('0x3c')]('revisionHistory.editorContainer');return this[_0x1b6d('0x0')]['config']['get'](_0x1b6d('0x17'))[_0x1b6d('0x54')][_0x1b6d('0x1b')]=_0x1b6d('0x43'),_0xc2061[_0x1b6d('0x54')][_0x1b6d('0x1b')]='',_0x361c6b[_0x1b6d('0x4c')]();}async['_restoreRevision'](_0x1c0d09){const _0x45103a=this['editor'],_0x472cd5=this[_0x1b6d('0x8')][_0x1b6d('0x42')][_0x1b6d('0x3c')]('RevisionViewer'),_0x28a42c=_0x45103a['plugins'][_0x1b6d('0x3c')](_0x1b6d('0x37')),_0x27f920=_0x472cd5['repository']['getRevision'](_0x1c0d09);let _0x260523,_0x26bed9,_0x189991;try{_0x260523=await _0x472cd5[_0x1b6d('0xc')](_0x27f920),_0x26bed9=await _0x472cd5[_0x1b6d('0x5c')](_0x27f920);}catch(_0x38a1f2){return void console[_0x1b6d('0x40')](_0x38a1f2);}_0x45103a['model']['change'](_0x356aa3=>{for(const _0x4c4da6 of Array[_0x1b6d('0x13')](_0x45103a[_0x1b6d('0x5f')][_0x1b6d('0x3f')][_0x1b6d('0x3d')](_0x1b6d('0x14'))))_0x356aa3[_0x1b6d('0x1a')](_0x4c4da6);}),_0x472cd5['isReady']=!0x1,_0x45103a[_0x1b6d('0x5f')][_0x1b6d('0x46')](_0x1c5202=>{_0x1c5202[_0x1b6d('0xa')](null),_0x1c5202[_0x1b6d('0xb')](_0x45103a[_0x1b6d('0x5f')][_0x1b6d('0x6a')][_0x1b6d('0x53')][_0x1b6d('0x1')]());for(const _0x364904 of _0x45103a['model']['document']['getRootNames']())_0x1c5202[_0x1b6d('0x7')](_0x364904);for(const _0x200754 of Object['keys'](_0x260523)){const _0x1f0aad=_0x1c5202[_0x1b6d('0x63')](_0x200754);for(const _0x126a7b of Object[_0x1b6d('0x62')](_0x26bed9[_0x200754]))_0x1c5202['setAttribute'](_0x126a7b,_0x26bed9[_0x200754][_0x126a7b],_0x1f0aad);_0x1c5202[_0x1b6d('0x29')](_0x45103a['data'][_0x1b6d('0x69')](_0x260523[_0x200754],_0x1f0aad),_0x1f0aad,0x0);}});const _0x1a4aaa=_0x43aa2f(_0x45103a[_0x1b6d('0x44')],_0x1b6d('0x65'));if(_0x27f920[_0x1b6d('0x18')])_0x189991=-0x1==_0x27f920[_0x1b6d('0x18')]['indexOf'](_0x1a4aaa)?_0x1a4aaa+':\x20'+_0x27f920[_0x1b6d('0x18')]:_0x27f920['name'];else _0x189991=_0x1a4aaa+':\x20'+(_0x27f920['createdAt']['toLocaleDateString'](_0x45103a[_0x1b6d('0x44')][_0x1b6d('0x4')],{'month':'long','day':_0x1b6d('0x5d')})+',\x20'+_0x27f920[_0x1b6d('0x33')][_0x1b6d('0x4e')](_0x45103a[_0x1b6d('0x44')][_0x1b6d('0x4')],{'hour':'numeric','minute':'numeric'}));return await _0x28a42c[_0x1b6d('0x3')]({'name':_0x189991}),_0x472cd5[_0x1b6d('0x11')]=!0x0,_0x45103a[_0x1b6d('0x2f')]['get'](_0x1b6d('0x23'))['closeRevisionViewerCallback']();}}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module revision-history/revisionhistoryadapter
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import type { RevisionData } from './revision';
|
|
6
|
-
/**
|
|
7
|
-
* The revision history adapter.
|
|
8
|
-
*
|
|
9
|
-
* The revision history adapter is an object that communicates asynchronously with the data source to fetch or save
|
|
10
|
-
* the revisions data. It is used internally by the revision history feature whenever revision data is required, a revision is created,
|
|
11
|
-
* or updated.
|
|
12
|
-
*
|
|
13
|
-
* The adapter is optional. See the {@glink features/collaboration/revision-history/revision-history-integration
|
|
14
|
-
* Revision history feature integration} guide to learn more.
|
|
15
|
-
*
|
|
16
|
-
* To set the adapter, overwrite the {@link module:revision-history/revisionhistory~RevisionHistory#adapter `RevisionHistory#adapter`}
|
|
17
|
-
* property.
|
|
18
|
-
*/
|
|
19
|
-
export interface RevisionHistoryAdapter {
|
|
20
|
-
/**
|
|
21
|
-
* Called when the full revision data is required.
|
|
22
|
-
*
|
|
23
|
-
* It should return a promise that resolves with the whole revision data.
|
|
24
|
-
*/
|
|
25
|
-
getRevision(data: {
|
|
26
|
-
revisionId: string;
|
|
27
|
-
channelId: string;
|
|
28
|
-
}): Promise<RevisionData>;
|
|
29
|
-
/**
|
|
30
|
-
* Called when revision(s) data is added or updated.
|
|
31
|
-
*
|
|
32
|
-
* Multiple revisions can be added and updated at the same moment. The method is passed an array with the updated data.
|
|
33
|
-
* Each item in the array is a data object that describes a single revision. Each data object contains revision id. If the revision
|
|
34
|
-
* id does not exist in your data source (database), then a new revision should be created. Otherwise, the existing revision
|
|
35
|
-
* should be updated with passed data.
|
|
36
|
-
*
|
|
37
|
-
* The method should return a promise that is resolved when the update is completed.
|
|
38
|
-
*
|
|
39
|
-
* The `data` parameter only contains those properties of a revision that have changed.
|
|
40
|
-
*
|
|
41
|
-
* Although the `data` parameter contains `createdAt` property,
|
|
42
|
-
* the revision creation date should be set by the backend of your application
|
|
43
|
-
* to ensure that all revisions will be saved with correct dates regardless of users' local system time.
|
|
44
|
-
* It is recommended to overwrite `createdAt` value whenever it is passed in the `data` parameter.
|
|
45
|
-
*
|
|
46
|
-
* The promise may resolve with an array of objects. Each object represents an updated revision, for which `createdAt` property
|
|
47
|
-
* was set (or changed) on the backend. Each object should have `id` (string) and `createdAt` (`Date` object) properties.
|
|
48
|
-
* The returned data will be used to update revisions data in the editor with dates set on the backend.
|
|
49
|
-
*
|
|
50
|
-
* Although the `data` parameter contains `creatorId` property, you should verify the `creatorId` value when saving a revision
|
|
51
|
-
* in the database. **However, do not overwrite the value if it was set to `null`!**
|
|
52
|
-
*
|
|
53
|
-
* It is recommended to stringify `data.diffData` and `data.attributes` values to JSON and save them as strings in your database,
|
|
54
|
-
* and then to parse the strings when loading revisions.
|
|
55
|
-
*
|
|
56
|
-
* @param data Array with revisions data to add or update.
|
|
57
|
-
* @param channelId The ID of the document for which the revisions were created.
|
|
58
|
-
*/
|
|
59
|
-
updateRevisions(data: Array<RevisionData>, channelId: string): Promise<Array<RevisionData>>;
|
|
60
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module revision-history/revisionhistoryadapter
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import type { RevisionData } from './revision';
|
|
6
|
+
/**
|
|
7
|
+
* The revision history adapter.
|
|
8
|
+
*
|
|
9
|
+
* The revision history adapter is an object that communicates asynchronously with the data source to fetch or save
|
|
10
|
+
* the revisions data. It is used internally by the revision history feature whenever revision data is required, a revision is created,
|
|
11
|
+
* or updated.
|
|
12
|
+
*
|
|
13
|
+
* The adapter is optional. See the {@glink features/collaboration/revision-history/revision-history-integration
|
|
14
|
+
* Revision history feature integration} guide to learn more.
|
|
15
|
+
*
|
|
16
|
+
* To set the adapter, overwrite the {@link module:revision-history/revisionhistory~RevisionHistory#adapter `RevisionHistory#adapter`}
|
|
17
|
+
* property.
|
|
18
|
+
*/
|
|
19
|
+
export interface RevisionHistoryAdapter {
|
|
20
|
+
/**
|
|
21
|
+
* Called when the full revision data is required.
|
|
22
|
+
*
|
|
23
|
+
* It should return a promise that resolves with the whole revision data.
|
|
24
|
+
*/
|
|
25
|
+
getRevision(data: {
|
|
26
|
+
revisionId: string;
|
|
27
|
+
channelId: string;
|
|
28
|
+
}): Promise<RevisionData>;
|
|
29
|
+
/**
|
|
30
|
+
* Called when revision(s) data is added or updated.
|
|
31
|
+
*
|
|
32
|
+
* Multiple revisions can be added and updated at the same moment. The method is passed an array with the updated data.
|
|
33
|
+
* Each item in the array is a data object that describes a single revision. Each data object contains revision id. If the revision
|
|
34
|
+
* id does not exist in your data source (database), then a new revision should be created. Otherwise, the existing revision
|
|
35
|
+
* should be updated with passed data.
|
|
36
|
+
*
|
|
37
|
+
* The method should return a promise that is resolved when the update is completed.
|
|
38
|
+
*
|
|
39
|
+
* The `data` parameter only contains those properties of a revision that have changed.
|
|
40
|
+
*
|
|
41
|
+
* Although the `data` parameter contains `createdAt` property,
|
|
42
|
+
* the revision creation date should be set by the backend of your application
|
|
43
|
+
* to ensure that all revisions will be saved with correct dates regardless of users' local system time.
|
|
44
|
+
* It is recommended to overwrite `createdAt` value whenever it is passed in the `data` parameter.
|
|
45
|
+
*
|
|
46
|
+
* The promise may resolve with an array of objects. Each object represents an updated revision, for which `createdAt` property
|
|
47
|
+
* was set (or changed) on the backend. Each object should have `id` (string) and `createdAt` (`Date` object) properties.
|
|
48
|
+
* The returned data will be used to update revisions data in the editor with dates set on the backend.
|
|
49
|
+
*
|
|
50
|
+
* Although the `data` parameter contains `creatorId` property, you should verify the `creatorId` value when saving a revision
|
|
51
|
+
* in the database. **However, do not overwrite the value if it was set to `null`!**
|
|
52
|
+
*
|
|
53
|
+
* It is recommended to stringify `data.diffData` and `data.attributes` values to JSON and save them as strings in your database,
|
|
54
|
+
* and then to parse the strings when loading revisions.
|
|
55
|
+
*
|
|
56
|
+
* @param data Array with revisions data to add or update.
|
|
57
|
+
* @param channelId The ID of the document for which the revisions were created.
|
|
58
|
+
*/
|
|
59
|
+
updateRevisions(data: Array<RevisionData>, channelId: string): Promise<Array<RevisionData>>;
|
|
60
|
+
}
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module revision-history/revisionhistoryconfig
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* The configuration of the revision history feature.
|
|
7
|
-
*
|
|
8
|
-
* ```ts
|
|
9
|
-
* ClassicEditor
|
|
10
|
-
* .create( {
|
|
11
|
-
* revisionHistory: ... // Revision history feature configuration.
|
|
12
|
-
* } )
|
|
13
|
-
* .then( ... )
|
|
14
|
-
* .catch( ... );
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
18
|
-
*/
|
|
19
|
-
export interface RevisionHistoryConfig {
|
|
20
|
-
/**
|
|
21
|
-
* The DOM element that contains the DOM structure for the editor.
|
|
22
|
-
*
|
|
23
|
-
* This element will be hidden when the user opens the revision history.
|
|
24
|
-
*/
|
|
25
|
-
editorContainer: HTMLElement;
|
|
26
|
-
/**
|
|
27
|
-
* DOM element which contains the DOM structure for revision history viewer.
|
|
28
|
-
*
|
|
29
|
-
* This element should be hidden (using CSS) when the editor is initialized.
|
|
30
|
-
* This element will be shown when the user opens the revision history viewer.
|
|
31
|
-
*/
|
|
32
|
-
viewerContainer: HTMLElement;
|
|
33
|
-
/**
|
|
34
|
-
* The DOM element for the revision history viewer editor instance.
|
|
35
|
-
*
|
|
36
|
-
* This element will be used to initialize the revision history viewer editor instance and will be replaced by it. It should be empty.
|
|
37
|
-
*/
|
|
38
|
-
viewerEditorElement: HTMLElement;
|
|
39
|
-
/**
|
|
40
|
-
* The DOM element for the revision history viewer sidebar container.
|
|
41
|
-
*
|
|
42
|
-
* This element will be used as a container for the revision history viewer. The sidebar content will be inserted into it.
|
|
43
|
-
*/
|
|
44
|
-
viewerSidebarContainer: HTMLElement;
|
|
45
|
-
/**
|
|
46
|
-
* Tells the feature whether it should resume updating previously unsaved revision or should save the previously unsaved revision
|
|
47
|
-
* and create a new revision for the changes that will be introduced after the editor is initialized.
|
|
48
|
-
*
|
|
49
|
-
* By default, the previously unsaved revision is resumed after the editor is initialized.
|
|
50
|
-
*
|
|
51
|
-
* Note that only unsaved revision can be resumed.
|
|
52
|
-
*
|
|
53
|
-
* Note that for real-time collaboration, the unsaved revision will be always resumed if the real-time editing session is still active.
|
|
54
|
-
* In other words, even if this is set to `false`, the unsaved revision will be resumed, if the editing session did not end since the
|
|
55
|
-
* editor was re-initialized. Keep in mind that
|
|
56
|
-
* {@glink @cs guides/collaboration/data#temporary-and-permanent-data the editing session is active a long time} after the last user
|
|
57
|
-
* leaves the document.
|
|
58
|
-
*/
|
|
59
|
-
resumeUnsavedRevision: boolean;
|
|
60
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module revision-history/revisionhistoryconfig
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* The configuration of the revision history feature.
|
|
7
|
+
*
|
|
8
|
+
* ```ts
|
|
9
|
+
* ClassicEditor
|
|
10
|
+
* .create( {
|
|
11
|
+
* revisionHistory: ... // Revision history feature configuration.
|
|
12
|
+
* } )
|
|
13
|
+
* .then( ... )
|
|
14
|
+
* .catch( ... );
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
18
|
+
*/
|
|
19
|
+
export interface RevisionHistoryConfig {
|
|
20
|
+
/**
|
|
21
|
+
* The DOM element that contains the DOM structure for the editor.
|
|
22
|
+
*
|
|
23
|
+
* This element will be hidden when the user opens the revision history.
|
|
24
|
+
*/
|
|
25
|
+
editorContainer: HTMLElement;
|
|
26
|
+
/**
|
|
27
|
+
* DOM element which contains the DOM structure for revision history viewer.
|
|
28
|
+
*
|
|
29
|
+
* This element should be hidden (using CSS) when the editor is initialized.
|
|
30
|
+
* This element will be shown when the user opens the revision history viewer.
|
|
31
|
+
*/
|
|
32
|
+
viewerContainer: HTMLElement;
|
|
33
|
+
/**
|
|
34
|
+
* The DOM element for the revision history viewer editor instance.
|
|
35
|
+
*
|
|
36
|
+
* This element will be used to initialize the revision history viewer editor instance and will be replaced by it. It should be empty.
|
|
37
|
+
*/
|
|
38
|
+
viewerEditorElement: HTMLElement;
|
|
39
|
+
/**
|
|
40
|
+
* The DOM element for the revision history viewer sidebar container.
|
|
41
|
+
*
|
|
42
|
+
* This element will be used as a container for the revision history viewer. The sidebar content will be inserted into it.
|
|
43
|
+
*/
|
|
44
|
+
viewerSidebarContainer: HTMLElement;
|
|
45
|
+
/**
|
|
46
|
+
* Tells the feature whether it should resume updating previously unsaved revision or should save the previously unsaved revision
|
|
47
|
+
* and create a new revision for the changes that will be introduced after the editor is initialized.
|
|
48
|
+
*
|
|
49
|
+
* By default, the previously unsaved revision is resumed after the editor is initialized.
|
|
50
|
+
*
|
|
51
|
+
* Note that only unsaved revision can be resumed.
|
|
52
|
+
*
|
|
53
|
+
* Note that for real-time collaboration, the unsaved revision will be always resumed if the real-time editing session is still active.
|
|
54
|
+
* In other words, even if this is set to `false`, the unsaved revision will be resumed, if the editing session did not end since the
|
|
55
|
+
* editor was re-initialized. Keep in mind that
|
|
56
|
+
* {@glink @cs guides/collaboration/data#temporary-and-permanent-data the editing session is active a long time} after the last user
|
|
57
|
+
* leaves the document.
|
|
58
|
+
*/
|
|
59
|
+
resumeUnsavedRevision: boolean;
|
|
60
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @module revision-history/revisionsrepository
|
|
3
|
-
* @publicApi
|
|
4
|
-
*/
|
|
5
|
-
import { Users } from 'ckeditor5-collaboration/src/collaboration-core';
|
|
6
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
7
|
-
import { default as Revision, type RevisionData, type RevisionJSON } from './revision';
|
|
8
|
-
/**
|
|
9
|
-
* Manages revisions list.
|
|
10
|
-
*/
|
|
11
|
-
export default class RevisionsRepository extends Plugin {
|
|
12
|
-
static get requires(): readonly [typeof Users];
|
|
13
|
-
static get pluginName(): "RevisionsRepository";
|
|
14
|
-
get length(): number;
|
|
15
|
-
constructor(editor: Editor);
|
|
16
|
-
/**
|
|
17
|
-
* @inheritDoc
|
|
18
|
-
*/
|
|
19
|
-
afterInit(): void;
|
|
20
|
-
/**
|
|
21
|
-
* Creates a revision instance from plain object with revision data.
|
|
22
|
-
*/
|
|
23
|
-
createRevision(revisionData: RevisionData): Revision;
|
|
24
|
-
/**
|
|
25
|
-
* Adds revision to the repository on a given index.
|
|
26
|
-
*
|
|
27
|
-
* @param revision The revision instance to add.
|
|
28
|
-
* @param index Index on which the revision should be added. If not set, the revision will be added as the first revision.
|
|
29
|
-
*/
|
|
30
|
-
addRevision(revision: Revision, index?: number): void;
|
|
31
|
-
/**
|
|
32
|
-
* Returns the revision with a given revision id or at a given index.
|
|
33
|
-
*/
|
|
34
|
-
getRevision(revisionIdOrIndex: string | number): Revision | null;
|
|
35
|
-
getRevisions(options: {
|
|
36
|
-
toJSON: true;
|
|
37
|
-
}): Array<RevisionJSON>;
|
|
38
|
-
getRevisions(options?: {
|
|
39
|
-
toJSON: false;
|
|
40
|
-
}): Array<Revision>;
|
|
41
|
-
getRevisions(options: {
|
|
42
|
-
toJSON: boolean;
|
|
43
|
-
}): Array<Revision> | Array<RevisionJSON>;
|
|
44
|
-
/**
|
|
45
|
-
* Returns the index of the revision with a given revision id.
|
|
46
|
-
*/
|
|
47
|
-
getIndex(revisionId: string | Revision): number;
|
|
48
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @module revision-history/revisionsrepository
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import { Users } from 'ckeditor5-collaboration/src/collaboration-core';
|
|
6
|
+
import { Plugin, type Editor } from 'ckeditor5/src/core';
|
|
7
|
+
import { default as Revision, type RevisionData, type RevisionJSON } from './revision';
|
|
8
|
+
/**
|
|
9
|
+
* Manages revisions list.
|
|
10
|
+
*/
|
|
11
|
+
export default class RevisionsRepository extends Plugin {
|
|
12
|
+
static get requires(): readonly [typeof Users];
|
|
13
|
+
static get pluginName(): "RevisionsRepository";
|
|
14
|
+
get length(): number;
|
|
15
|
+
constructor(editor: Editor);
|
|
16
|
+
/**
|
|
17
|
+
* @inheritDoc
|
|
18
|
+
*/
|
|
19
|
+
afterInit(): void;
|
|
20
|
+
/**
|
|
21
|
+
* Creates a revision instance from plain object with revision data.
|
|
22
|
+
*/
|
|
23
|
+
createRevision(revisionData: RevisionData): Revision;
|
|
24
|
+
/**
|
|
25
|
+
* Adds revision to the repository on a given index.
|
|
26
|
+
*
|
|
27
|
+
* @param revision The revision instance to add.
|
|
28
|
+
* @param index Index on which the revision should be added. If not set, the revision will be added as the first revision.
|
|
29
|
+
*/
|
|
30
|
+
addRevision(revision: Revision, index?: number): void;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the revision with a given revision id or at a given index.
|
|
33
|
+
*/
|
|
34
|
+
getRevision(revisionIdOrIndex: string | number): Revision | null;
|
|
35
|
+
getRevisions(options: {
|
|
36
|
+
toJSON: true;
|
|
37
|
+
}): Array<RevisionJSON>;
|
|
38
|
+
getRevisions(options?: {
|
|
39
|
+
toJSON: false;
|
|
40
|
+
}): Array<Revision>;
|
|
41
|
+
getRevisions(options: {
|
|
42
|
+
toJSON: boolean;
|
|
43
|
+
}): Array<Revision> | Array<RevisionJSON>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns the index of the revision with a given revision id.
|
|
46
|
+
*/
|
|
47
|
+
getIndex(revisionId: string | Revision): number;
|
|
48
|
+
}
|