@ckeditor/ckeditor5-revision-history 36.0.1 → 37.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/revision-history.js +1 -1
- package/package.json +22 -7
- package/src/augmentation.d.ts +25 -0
- package/src/augmentation.js +23 -0
- package/src/changeitem.d.ts +52 -0
- package/src/changeitem.js +1 -1
- package/src/editor/revisionviewereditor.d.ts +27 -0
- package/src/editor/revisionviewereditor.js +1 -1
- package/src/editor/revisionviewereditorui.d.ts +28 -0
- package/src/editor/revisionviewereditorui.js +1 -1
- package/src/editor/revisionviewereditoruiview.d.ts +43 -0
- package/src/editor/revisionviewereditoruiview.js +1 -1
- package/src/index.d.ts +10 -0
- package/src/index.js +1 -1
- package/src/revision.d.ts +153 -0
- package/src/revision.js +1 -1
- package/src/revisiondiff.d.ts +19 -0
- package/src/revisiondiff.js +1 -1
- package/src/revisionhistory.d.ts +93 -0
- package/src/revisionhistory.js +1 -1
- package/src/revisionhistoryadapter.d.ts +60 -0
- package/src/revisionhistoryadapter.js +23 -0
- package/src/revisionhistoryconfig.d.ts +60 -0
- package/src/revisionhistoryconfig.js +23 -0
- package/src/revisionsrepository.d.ts +43 -0
- package/src/revisionsrepository.js +1 -1
- package/src/revisiontracker.d.ts +72 -0
- package/src/revisiontracker.js +1 -1
- package/src/revisionviewer.d.ts +21 -0
- package/src/revisionviewer.js +1 -1
- package/src/ui/revision/createrevisionactionsdropdown.d.ts +9 -0
- package/src/ui/revision/createrevisionactionsdropdown.js +1 -1
- package/src/ui/revision/revisionauthorview.d.ts +4 -0
- package/src/ui/revision/revisionauthorview.js +1 -1
- package/src/ui/revision/revisionnameview.d.ts +4 -0
- package/src/ui/revision/revisionnameview.js +1 -1
- package/src/ui/revision/revisionview.d.ts +91 -0
- package/src/ui/revision/revisionview.js +1 -1
- package/src/ui/revision/subrevisioncollapserview.d.ts +17 -0
- package/src/ui/revision/subrevisioncollapserview.js +1 -1
- package/src/ui/revision/subrevisionview.d.ts +30 -0
- package/src/ui/revision/subrevisionview.js +1 -1
- package/src/ui/revision/utils.d.ts +4 -0
- package/src/ui/revision/utils.js +1 -1
- package/src/ui/revisionhistory/revisionhistorysaverevisionformview.d.ts +80 -0
- package/src/ui/revisionhistory/revisionhistorysaverevisionformview.js +1 -1
- package/src/ui/revisionhistory/revisionhistoryui.d.ts +21 -0
- package/src/ui/revisionhistory/revisionhistoryui.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebar.d.ts +39 -0
- package/src/ui/revisionssidebar/revisionssidebar.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebarheaderview.d.ts +4 -0
- package/src/ui/revisionssidebar/revisionssidebarheaderview.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebartimeperiodview.d.ts +25 -0
- package/src/ui/revisionssidebar/revisionssidebartimeperiodview.js +1 -1
- package/src/ui/revisionssidebar/revisionssidebarview.d.ts +40 -0
- package/src/ui/revisionssidebar/revisionssidebarview.js +1 -1
- package/src/ui/revisionssidebar/utils.d.ts +8 -0
- package/src/ui/revisionssidebar/utils.js +1 -1
- package/src/ui/revisionviewer/changedetailsview.d.ts +18 -0
- package/src/ui/revisionviewer/changedetailsview.js +1 -1
- package/src/ui/revisionviewer/changesnavigationview.d.ts +36 -0
- package/src/ui/revisionviewer/changesnavigationview.js +1 -1
- package/src/ui/revisionviewer/revisionviewerloadingoverlay.d.ts +22 -0
- package/src/ui/revisionviewer/revisionviewerloadingoverlay.js +1 -1
- package/src/ui/revisionviewer/revisionviewerui.d.ts +22 -0
- package/src/ui/revisionviewer/revisionviewerui.js +1 -1
- package/src/utils/common-translations.d.ts +7 -0
- package/src/utils/common-translations.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-revision-history",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.0",
|
|
4
4
|
"description": "Document revision history feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -24,14 +24,29 @@
|
|
|
24
24
|
"versioning"
|
|
25
25
|
],
|
|
26
26
|
"main": "src/index.js",
|
|
27
|
+
"scripts": {
|
|
28
|
+
"dll:build": "webpack",
|
|
29
|
+
"build": "tsc -p ./tsconfig.json",
|
|
30
|
+
"postversion": "npm run build"
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"build",
|
|
34
|
+
"lang",
|
|
35
|
+
"src/**/*.js",
|
|
36
|
+
"src/**/*.d.ts",
|
|
37
|
+
"theme",
|
|
38
|
+
"ckeditor5-metadata.json",
|
|
39
|
+
"CHANGELOG.md"
|
|
40
|
+
],
|
|
27
41
|
"dependencies": {
|
|
28
|
-
"@ckeditor/ckeditor5-
|
|
29
|
-
"@ckeditor/ckeditor5-ui": "^
|
|
30
|
-
"@ckeditor/ckeditor5-undo": "^
|
|
31
|
-
"
|
|
32
|
-
"ckeditor5": "^36.0.1",
|
|
42
|
+
"@ckeditor/ckeditor5-editor-classic": "^37.0.0",
|
|
43
|
+
"@ckeditor/ckeditor5-ui": "^37.0.0",
|
|
44
|
+
"@ckeditor/ckeditor5-undo": "^37.0.0",
|
|
45
|
+
"ckeditor5": "^37.0.0",
|
|
33
46
|
"ckeditor5-collaboration": "^36.0.1",
|
|
34
47
|
"lodash-es": "^4.17.15",
|
|
35
48
|
"luxon": "^1.25.0"
|
|
36
|
-
}
|
|
49
|
+
},
|
|
50
|
+
"types": "src/index.d.ts",
|
|
51
|
+
"obfuscated": true
|
|
37
52
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { RevisionHistoryConfig, RevisionsRepository, RevisionViewerLoadingOverlay, RevisionHistoryUI, RevisionTracker, RevisionViewer, RestoreRevisionCommand, ShowChangeCommand, RevisionsSidebar, RevisionViewerUI } from './index';
|
|
2
|
+
declare module '@ckeditor/ckeditor5-core' {
|
|
3
|
+
interface EditorConfig {
|
|
4
|
+
/**
|
|
5
|
+
* The configuration of the revision history feature.
|
|
6
|
+
* Introduced by the {@link module:revision-history/revisionhistory~RevisionHistory} feature.
|
|
7
|
+
*/
|
|
8
|
+
revisionHistory?: RevisionHistoryConfig;
|
|
9
|
+
}
|
|
10
|
+
interface PluginsMap {
|
|
11
|
+
[RevisionsRepository.pluginName]: RevisionsRepository;
|
|
12
|
+
[RevisionViewerLoadingOverlay.pluginName]: RevisionViewerLoadingOverlay;
|
|
13
|
+
[RevisionHistoryUI.pluginName]: RevisionHistoryUI;
|
|
14
|
+
[RevisionTracker.pluginName]: RevisionTracker;
|
|
15
|
+
[RevisionViewer.pluginName]: RevisionViewer;
|
|
16
|
+
[RevisionViewer.pluginName]: RevisionViewer;
|
|
17
|
+
[RevisionsSidebar.pluginName]: RevisionsSidebar;
|
|
18
|
+
[RevisionViewerUI.pluginName]: RevisionViewerUI;
|
|
19
|
+
}
|
|
20
|
+
interface CommandsMap {
|
|
21
|
+
restoreRevision: RestoreRevisionCommand;
|
|
22
|
+
showPreviousChange: ShowChangeCommand<'backward'>;
|
|
23
|
+
showNextChange: ShowChangeCommand<'forward'>;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2016 - 2023, CKSource Holding sp. z o.o. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
*
|
|
5
|
+
*
|
|
6
|
+
*
|
|
7
|
+
* +---------------------------------------------------------------------------------+
|
|
8
|
+
* | |
|
|
9
|
+
* | Hello stranger! |
|
|
10
|
+
* | |
|
|
11
|
+
* | |
|
|
12
|
+
* | What you're currently looking at is the source code of a legally protected, |
|
|
13
|
+
* | proprietary software. Any attempts to deobfuscate / disassemble this code |
|
|
14
|
+
* | are forbidden and will result in legal consequences. |
|
|
15
|
+
* | |
|
|
16
|
+
* | |
|
|
17
|
+
* +---------------------------------------------------------------------------------+
|
|
18
|
+
*
|
|
19
|
+
*
|
|
20
|
+
*
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
export{};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module revision-history/changeitem
|
|
3
|
+
*/
|
|
4
|
+
import type { User } from 'ckeditor5-collaboration/src/collaboration-core';
|
|
5
|
+
declare const ChangeItem_base: {
|
|
6
|
+
new (): import("ckeditor5/src/utils").Observable;
|
|
7
|
+
prototype: import("ckeditor5/src/utils").Observable;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Represents a singular change entry in the revision or in the revisions comparison.
|
|
11
|
+
*/
|
|
12
|
+
export default class ChangeItem extends ChangeItem_base {
|
|
13
|
+
/**
|
|
14
|
+
* Unique change item id.
|
|
15
|
+
*/
|
|
16
|
+
readonly id: string;
|
|
17
|
+
/**
|
|
18
|
+
* User who created the change.
|
|
19
|
+
*/
|
|
20
|
+
readonly author: User;
|
|
21
|
+
/**
|
|
22
|
+
* Change type.
|
|
23
|
+
*/
|
|
24
|
+
readonly type: string;
|
|
25
|
+
/**
|
|
26
|
+
* Additional details about the change.
|
|
27
|
+
*/
|
|
28
|
+
readonly data: Record<string, unknown>;
|
|
29
|
+
/**
|
|
30
|
+
* The date when the change was created.
|
|
31
|
+
*
|
|
32
|
+
* @observable
|
|
33
|
+
*/
|
|
34
|
+
readonly createdAt: Date;
|
|
35
|
+
constructor(data: ChangeItemInput);
|
|
36
|
+
toJSON(): ChangeItemJSON;
|
|
37
|
+
}
|
|
38
|
+
export interface ChangeItemInput {
|
|
39
|
+
id?: string;
|
|
40
|
+
author: User;
|
|
41
|
+
type: string;
|
|
42
|
+
data: Record<string, unknown>;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
}
|
|
45
|
+
export interface ChangeItemJSON {
|
|
46
|
+
id: string;
|
|
47
|
+
authorId: string;
|
|
48
|
+
type: string;
|
|
49
|
+
data: Record<string, unknown>;
|
|
50
|
+
createdAt: Date;
|
|
51
|
+
}
|
|
52
|
+
export {};
|
package/src/changeitem.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x184d=['author','data','set','createdAt','type','toJSON'];(function(_0x3b86a1,_0x184dd0){var _0x47eaf5=function(_0x4474ca){while(--_0x4474ca){_0x3b86a1['push'](_0x3b86a1['shift']());}};_0x47eaf5(++_0x184dd0);}(_0x184d,0x15e));var _0x47ea=function(_0x3b86a1,_0x184dd0){_0x3b86a1=_0x3b86a1-0x0;var _0x47eaf5=_0x184d[_0x3b86a1];return _0x47eaf5;};import{ObservableMixin as _0x1667d2,uid as _0xde81ab}from'ckeditor5/src/utils';export default class r extends _0x1667d2(){constructor(_0x16f988){super(),this['id']=_0x16f988['id']||_0xde81ab(),this[_0x47ea('0x4')]=_0x16f988['author'],this[_0x47ea('0x2')]=_0x16f988[_0x47ea('0x2')],this[_0x47ea('0x5')]=_0x16f988[_0x47ea('0x5')]||{},this[_0x47ea('0x0')](_0x47ea('0x1'),_0x16f988[_0x47ea('0x1')]);}[_0x47ea('0x3')](){return{'id':this['id'],'authorId':this[_0x47ea('0x4')]['id'],'type':this[_0x47ea('0x2')],'data':this[_0x47ea('0x5')],'createdAt':this['createdAt']};}}
|
|
@@ -0,0 +1,27 @@
|
|
|
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/editor/revisionviewereditor
|
|
7
|
+
*/
|
|
8
|
+
import { Editor, type EditorConfig } from 'ckeditor5/src/core';
|
|
9
|
+
import RevisionViewerEditorUI from './revisionviewereditorui';
|
|
10
|
+
declare const RevisionViewerEditor_base: import("@ckeditor/ckeditor5-utils").Mixed<import("@ckeditor/ckeditor5-utils").Mixed<typeof Editor, import("ckeditor5/src/core").ElementApi>, import("ckeditor5/src/core").DataApi>;
|
|
11
|
+
/**
|
|
12
|
+
* Editor class used to show revision comparisons.
|
|
13
|
+
*/
|
|
14
|
+
export default class RevisionViewerEditor extends RevisionViewerEditor_base {
|
|
15
|
+
get ui(): RevisionViewerEditorUI;
|
|
16
|
+
/**
|
|
17
|
+
* @param sourceElement Editor source element.
|
|
18
|
+
* @param config Editor configuration.
|
|
19
|
+
*/
|
|
20
|
+
constructor(sourceElement: HTMLElement, config?: EditorConfig);
|
|
21
|
+
/**
|
|
22
|
+
* @inheritDoc
|
|
23
|
+
*/
|
|
24
|
+
destroy(): Promise<unknown>;
|
|
25
|
+
static create(sourceElement: HTMLElement, config?: EditorConfig): Promise<RevisionViewerEditor>;
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0xd56b=['fire','initialData','document','ready','destroy','init','sourceElement','create','data','get','editing','updateSourceElement','model','_ui','initPlugins','config','createRoot'];(function(_0x39aef6,_0xd56b97){const _0x4c03e2=function(_0x3de571){while(--_0x3de571){_0x39aef6['push'](_0x39aef6['shift']());}};_0x4c03e2(++_0xd56b97);}(_0xd56b,0x73));const _0x4c03=function(_0x39aef6,_0xd56b97){_0x39aef6=_0x39aef6-0x0;let _0x4c03e2=_0xd56b[_0x39aef6];return _0x4c03e2;};import{Editor as _0x206657,DataApiMixin as _0x1bf3e8,ElementApiMixin as _0x693b41}from'ckeditor5/src/core';import _0x41618d from'./revisionviewereditorui';import _0x68f7db from'./revisionviewereditoruiview';export default class d extends _0x1bf3e8(_0x693b41(_0x206657)){get['ui'](){return this[_0x4c03('0x0')];}constructor(_0x1d85f8,_0x244bcb){super(_0x244bcb),this[_0x4c03('0xa')]=_0x1d85f8,this[_0x4c03('0x10')][_0x4c03('0x6')][_0x4c03('0x3')]();const _0x328d0a=new _0x68f7db(this['locale'],this[_0x4c03('0xe')]['view'],{'shouldToolbarGroupWhenFull':!0x0});this[_0x4c03('0x0')]=new _0x41618d(this,_0x328d0a);}[_0x4c03('0x8')](){return this[_0x4c03('0xf')](),this['ui'][_0x4c03('0x8')](),super['destroy']();}static async[_0x4c03('0xb')](_0xf910bd,_0x4acd27){const _0x31c24a=new this(_0xf910bd,_0x4acd27);return await _0x31c24a[_0x4c03('0x1')](),await _0x31c24a['ui'][_0x4c03('0x9')](_0xf910bd),await _0x31c24a[_0x4c03('0xc')][_0x4c03('0x9')](_0x31c24a[_0x4c03('0x2')][_0x4c03('0xd')](_0x4c03('0x5'))),_0x31c24a[_0x4c03('0x4')](_0x4c03('0x7')),_0x31c24a;}}
|
|
@@ -0,0 +1,28 @@
|
|
|
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/editor/revisionviewereditorui
|
|
7
|
+
*/
|
|
8
|
+
import type { Editor } from 'ckeditor5/src/core';
|
|
9
|
+
import { EditorUI } from 'ckeditor5/src/ui';
|
|
10
|
+
import type RevisionViewerEditorUIView from './revisionviewereditoruiview';
|
|
11
|
+
export default class RevisionViewerEditorUI extends EditorUI {
|
|
12
|
+
get view(): RevisionViewerEditorUIView;
|
|
13
|
+
constructor(editor: Editor, view: RevisionViewerEditorUIView);
|
|
14
|
+
/**
|
|
15
|
+
* @inheritDoc
|
|
16
|
+
*/
|
|
17
|
+
get element(): HTMLElement | null;
|
|
18
|
+
/**
|
|
19
|
+
* Initializes the UI.
|
|
20
|
+
*
|
|
21
|
+
* @param replacementElement The DOM element that will be the source for the created editor.
|
|
22
|
+
*/
|
|
23
|
+
init(replacementElement: HTMLElement): void;
|
|
24
|
+
/**
|
|
25
|
+
* @inheritDoc
|
|
26
|
+
*/
|
|
27
|
+
destroy(): void;
|
|
28
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x2734=['setEditableElement','element','_initToolbar','destroy','view','stickyPanel','editable','bind','fillFromConfig','restore','getRoot','_toolbarConfig','focusTracker','componentFactory','document','name','addToolbar','ready','toolbar','_elementReplacer','config','_view','isFocused','editor','get','replace','viewportTopOffset','init'];(function(_0x50373b,_0x273401){const _0x10b9d4=function(_0x2b4a53){while(--_0x2b4a53){_0x50373b['push'](_0x50373b['shift']());}};_0x10b9d4(++_0x273401);}(_0x2734,0x1b5));const _0x10b9=function(_0x50373b,_0x273401){_0x50373b=_0x50373b-0x0;let _0x10b9d4=_0x2734[_0x50373b];return _0x10b9d4;};import{EditorUI as _0x58f3b2,normalizeToolbarConfig as _0x16a6e8}from'ckeditor5/src/ui';import{ElementReplacer as _0x32c110}from'ckeditor5/src/utils';export default class tt extends _0x58f3b2{get[_0x10b9('0xf')](){return this[_0x10b9('0x4')];}constructor(_0x3e8784,_0xb8eae0){super(_0x3e8784),this[_0x10b9('0x4')]=_0xb8eae0,this[_0x10b9('0x16')]=_0x16a6e8(_0x3e8784[_0x10b9('0x3')][_0x10b9('0x7')](_0x10b9('0x1'))),this['_elementReplacer']=new _0x32c110();}get[_0x10b9('0xc')](){return this[_0x10b9('0xf')]['element'];}[_0x10b9('0xa')](_0x4af2bd){const _0x33ff33=this[_0x10b9('0x6')],_0x4f3a5c=this['view'],_0x1fe034=_0x33ff33['editing'][_0x10b9('0xf')],_0x1de5fe=_0x4f3a5c[_0x10b9('0x11')],_0x552e67=_0x1fe034[_0x10b9('0x19')][_0x10b9('0x15')]();_0x1de5fe[_0x10b9('0x1a')]=_0x552e67['rootName'],_0x4f3a5c['render']();const _0x467657=_0x1de5fe[_0x10b9('0xc')];this[_0x10b9('0xb')](_0x1de5fe[_0x10b9('0x1a')],_0x467657),_0x4f3a5c[_0x10b9('0x11')][_0x10b9('0x12')](_0x10b9('0x5'))['to'](this[_0x10b9('0x17')]),_0x1fe034['attachDomRoot'](_0x467657),this[_0x10b9('0x2')][_0x10b9('0x8')](_0x4af2bd,this[_0x10b9('0xc')]),this[_0x10b9('0xd')](),this['fire'](_0x10b9('0x0'));}['destroy'](){super[_0x10b9('0xe')]();const _0x23c929=this[_0x10b9('0xf')],_0x1aabe0=this[_0x10b9('0x6')]['editing']['view'];this['_elementReplacer'][_0x10b9('0x14')](),_0x1aabe0['detachDomRoot'](_0x23c929[_0x10b9('0x11')][_0x10b9('0x1a')]),_0x23c929['destroy']();}[_0x10b9('0xd')](){const _0x9680d7=this[_0x10b9('0xf')];_0x9680d7['stickyPanel'][_0x10b9('0x12')]('isActive')['to'](this[_0x10b9('0x17')],_0x10b9('0x5')),_0x9680d7[_0x10b9('0x10')]['limiterElement']=_0x9680d7[_0x10b9('0xc')],_0x9680d7[_0x10b9('0x10')][_0x10b9('0x12')](_0x10b9('0x9'))['to'](this,'viewportOffset',({top:_0x55c347})=>_0x55c347),_0x9680d7[_0x10b9('0x1')][_0x10b9('0x13')](this[_0x10b9('0x16')],this[_0x10b9('0x18')]),this[_0x10b9('0x1b')](_0x9680d7[_0x10b9('0x1')]);}}
|
|
@@ -0,0 +1,43 @@
|
|
|
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/editor/revisionviewereditoruiview
|
|
7
|
+
*/
|
|
8
|
+
import { BoxedEditorUIView, InlineEditableUIView, StickyPanelView, ToolbarView } from 'ckeditor5/src/ui';
|
|
9
|
+
import type { View } from 'ckeditor5/src/engine';
|
|
10
|
+
import type { Locale } from 'ckeditor5/src/utils';
|
|
11
|
+
import '@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css';
|
|
12
|
+
export default class RevisionViewerEditorUIView extends BoxedEditorUIView {
|
|
13
|
+
/**
|
|
14
|
+
* Sticky panel view instance. This is a parent view of a {@link #toolbar}
|
|
15
|
+
* that makes toolbar sticky.
|
|
16
|
+
*/
|
|
17
|
+
readonly stickyPanel: StickyPanelView;
|
|
18
|
+
/**
|
|
19
|
+
* Toolbar view instance.
|
|
20
|
+
*/
|
|
21
|
+
readonly toolbar: ToolbarView;
|
|
22
|
+
get editable(): InlineEditableUIView;
|
|
23
|
+
/**
|
|
24
|
+
* Creates an instance of the classic editor UI view.
|
|
25
|
+
*
|
|
26
|
+
* @param locale The {@link module:core/editor/editor~Editor#locale} instance.
|
|
27
|
+
* @param editingView The editing view instance this view is related to.
|
|
28
|
+
* @param options Configuration options for the view instance.
|
|
29
|
+
*/
|
|
30
|
+
constructor(locale: Locale, editingView: View, options?: RevisionViewerEditorUIViewOptions);
|
|
31
|
+
/**
|
|
32
|
+
* @inheritDoc
|
|
33
|
+
*/
|
|
34
|
+
render(): void;
|
|
35
|
+
}
|
|
36
|
+
export interface RevisionViewerEditorUIViewOptions {
|
|
37
|
+
/**
|
|
38
|
+
* When set `true` enables automatic items grouping
|
|
39
|
+
* in the main {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#toolbar toolbar}.
|
|
40
|
+
* See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.
|
|
41
|
+
*/
|
|
42
|
+
shouldToolbarGroupWhenFull?: boolean;
|
|
43
|
+
}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x2d9a=['add','main','render','stickyPanel','_editable','shouldToolbarGroupWhenFull','toolbar','editable'];(function(_0x7624fa,_0x2d9aac){var _0x2346f4=function(_0x5a7e5a){while(--_0x5a7e5a){_0x7624fa['push'](_0x7624fa['shift']());}};_0x2346f4(++_0x2d9aac);}(_0x2d9a,0x83));var _0x2346=function(_0x7624fa,_0x2d9aac){_0x7624fa=_0x7624fa-0x0;var _0x2346f4=_0x2d9a[_0x7624fa];return _0x2346f4;};import{BoxedEditorUIView as _0x14d33f,InlineEditableUIView as _0xf36fe6,StickyPanelView as _0x3adc22,ToolbarView as _0x3121ec}from'ckeditor5/src/ui';import'@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css';export default class it extends _0x14d33f{get[_0x2346('0x4')](){return this[_0x2346('0x1')];}constructor(_0x411273,_0x58faf3,_0x4a0619={}){super(_0x411273),this['stickyPanel']=new _0x3adc22(_0x411273),this[_0x2346('0x3')]=new _0x3121ec(_0x411273,{'shouldGroupWhenFull':_0x4a0619[_0x2346('0x2')]}),this['_editable']=new _0xf36fe6(_0x411273,_0x58faf3);}[_0x2346('0x7')](){super[_0x2346('0x7')](),this[_0x2346('0x0')]['content'][_0x2346('0x5')](this[_0x2346('0x3')]),this['top'][_0x2346('0x5')](this[_0x2346('0x0')]),this[_0x2346('0x6')][_0x2346('0x5')](this['editable']);}}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as RevisionHistory } from './revisionhistory';
|
|
2
|
+
export { default as RevisionsRepository } from './revisionsrepository';
|
|
3
|
+
export { default as RevisionViewerLoadingOverlay } from './ui/revisionviewer/revisionviewerloadingoverlay';
|
|
4
|
+
export { default as RevisionHistoryUI } from './ui/revisionhistory/revisionhistoryui';
|
|
5
|
+
export { default as RevisionTracker } from './revisiontracker';
|
|
6
|
+
export { default as RevisionViewer, type RestoreRevisionCommand, type ShowChangeCommand } from './revisionviewer';
|
|
7
|
+
export { default as RevisionsSidebar } from './ui/revisionssidebar/revisionssidebar';
|
|
8
|
+
export { default as RevisionViewerUI } from './ui/revisionviewer/revisionviewerui';
|
|
9
|
+
export type { RevisionHistoryConfig } from './revisionhistoryconfig';
|
|
10
|
+
import './augmentation';
|
package/src/index.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
export{default as RevisionHistory}from'./revisionhistory';export{default as RevisionTracker}from'./revisiontracker';
|
|
23
|
+
export{default as RevisionHistory}from'./revisionhistory';export{default as RevisionsRepository}from'./revisionsrepository';export{default as RevisionViewerLoadingOverlay}from'./ui/revisionviewer/revisionviewerloadingoverlay';export{default as RevisionHistoryUI}from'./ui/revisionhistory/revisionhistoryui';export{default as RevisionTracker}from'./revisiontracker';export{default as RevisionViewer}from'./revisionviewer';export{default as RevisionsSidebar}from'./ui/revisionssidebar/revisionssidebar';export{default as RevisionViewerUI}from'./ui/revisionviewer/revisionviewerui';import'./augmentation';
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module revision-history/revision
|
|
3
|
+
* @publicApi
|
|
4
|
+
*/
|
|
5
|
+
import type { User } from 'ckeditor5-collaboration/src/collaboration-core';
|
|
6
|
+
declare const Revision_base: {
|
|
7
|
+
new (): import("ckeditor5/src/utils").Observable;
|
|
8
|
+
prototype: import("ckeditor5/src/utils").Observable;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Represents a revision.
|
|
12
|
+
*/
|
|
13
|
+
export default class Revision extends Revision_base {
|
|
14
|
+
/**
|
|
15
|
+
* Unique revision id.
|
|
16
|
+
*/
|
|
17
|
+
id: string;
|
|
18
|
+
/**
|
|
19
|
+
* The user who created the revision.
|
|
20
|
+
*
|
|
21
|
+
* The `null` value means the revision was created automatically.
|
|
22
|
+
*/
|
|
23
|
+
creator: User | null;
|
|
24
|
+
/**
|
|
25
|
+
* All users who contributed to this revision.
|
|
26
|
+
*
|
|
27
|
+
* This value can be empty if there are no changes in the revision.
|
|
28
|
+
*/
|
|
29
|
+
authors: Array<User>;
|
|
30
|
+
/**
|
|
31
|
+
* Contains data describing changes saved in this revision.
|
|
32
|
+
*
|
|
33
|
+
* An object, where the keys are the names of roots and the values are strings with the revision data for those roots.
|
|
34
|
+
*/
|
|
35
|
+
diffData: any;
|
|
36
|
+
/**
|
|
37
|
+
* Document version at which the revision ends.
|
|
38
|
+
*
|
|
39
|
+
* The revision includes changes introduced by {@link module:engine/model/operation/operation~Operation operations}
|
|
40
|
+
* with base versions starting from {@link module:revision-history/revision~Revision#fromVersion `fromVersion`} (inclusive) up to
|
|
41
|
+
* {@link module:revision-history/revision~Revision#toVersion `toVersion`} (exclusive).
|
|
42
|
+
*/
|
|
43
|
+
toVersion: number;
|
|
44
|
+
/**
|
|
45
|
+
* Document version from which the revision starts.
|
|
46
|
+
*
|
|
47
|
+
* The revision includes changes introduced by {@link module:engine/model/operation/operation~Operation operations}
|
|
48
|
+
* with base versions starting from {@link module:revision-history/revision~Revision#fromVersion `fromVersion`} (inclusive) up to
|
|
49
|
+
* {@link module:revision-history/revision~Revision#toVersion `toVersion`} (exclusive).
|
|
50
|
+
*/
|
|
51
|
+
fromVersion: number;
|
|
52
|
+
/**
|
|
53
|
+
* The revision name.
|
|
54
|
+
*
|
|
55
|
+
* If revision has not been named yet, this is an empty string.
|
|
56
|
+
*
|
|
57
|
+
* @observable
|
|
58
|
+
*/
|
|
59
|
+
name: string;
|
|
60
|
+
/**
|
|
61
|
+
* The date when the revision was created or most recently updated.
|
|
62
|
+
*
|
|
63
|
+
* @observable
|
|
64
|
+
*/
|
|
65
|
+
createdAt: Date;
|
|
66
|
+
/**
|
|
67
|
+
* Revision custom attributes. See also {@link #setAttribute} and {@link #removeAttribute}.
|
|
68
|
+
*
|
|
69
|
+
* @observable
|
|
70
|
+
*/
|
|
71
|
+
attributes: Record<string, unknown>;
|
|
72
|
+
constructor(data: RevisionData);
|
|
73
|
+
/**
|
|
74
|
+
* Sets the revision name.
|
|
75
|
+
*/
|
|
76
|
+
setName(name: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* Adds revision attribute.
|
|
79
|
+
*
|
|
80
|
+
* Revision attributes are custom data that can be set and used by features built around revisions.
|
|
81
|
+
* Use it to store your feature data together with other revision data.
|
|
82
|
+
*
|
|
83
|
+
* ```ts
|
|
84
|
+
* revision.setAttribute( 'isImportant', true );
|
|
85
|
+
* ```
|
|
86
|
+
*
|
|
87
|
+
* You can group multiple values in an object, using the dot notation:
|
|
88
|
+
*
|
|
89
|
+
* ```ts
|
|
90
|
+
* revision.setAttribute( 'customData.type', 'image' );
|
|
91
|
+
* revision.setAttribute( 'customData.src', 'foo.jpg' );
|
|
92
|
+
* ```
|
|
93
|
+
*
|
|
94
|
+
* The attributes set on the revision can be accessed through the `attribute` property:
|
|
95
|
+
*
|
|
96
|
+
* ```ts
|
|
97
|
+
* const isImportant = revision.attributes.isImportant;
|
|
98
|
+
* const type = revision.attributes.customData.type;
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* You can also observe the `attributes` property or bind other properties to it:
|
|
102
|
+
*
|
|
103
|
+
* ```ts
|
|
104
|
+
* myObj.bind( 'customData' ).to( revision, 'attributes', attributes => attributes.customData );
|
|
105
|
+
* revision.on( 'change:attributes', ( evt, propName, newValue, oldValue ) => { ... } );
|
|
106
|
+
* ```
|
|
107
|
+
*
|
|
108
|
+
* Whenever `setAttribute()` or `removeAttribute()` is called, the `attributes` property
|
|
109
|
+
* is re-set and the observables are refreshed.
|
|
110
|
+
*/
|
|
111
|
+
setAttribute(name: string, value: unknown): void;
|
|
112
|
+
/**
|
|
113
|
+
* Removes the revision attribute.
|
|
114
|
+
*
|
|
115
|
+
* See also {@link #setAttribute}
|
|
116
|
+
*/
|
|
117
|
+
removeAttribute(name: string): void;
|
|
118
|
+
toJSON(): RevisionJSON;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* @eventName _update
|
|
122
|
+
*/
|
|
123
|
+
export interface RevisionUpdateEvent {
|
|
124
|
+
name: '_update';
|
|
125
|
+
args: [RevisionJSON, boolean];
|
|
126
|
+
}
|
|
127
|
+
export interface RevisionJSON {
|
|
128
|
+
id: string;
|
|
129
|
+
name: string;
|
|
130
|
+
creatorId: string | null;
|
|
131
|
+
authorsIds: Array<string>;
|
|
132
|
+
diffData: any;
|
|
133
|
+
createdAt: Date;
|
|
134
|
+
attributes: Record<string, unknown>;
|
|
135
|
+
fromVersion: number;
|
|
136
|
+
toVersion: number;
|
|
137
|
+
}
|
|
138
|
+
export interface RevisionData {
|
|
139
|
+
id?: string;
|
|
140
|
+
name?: string | null;
|
|
141
|
+
creator?: User | null;
|
|
142
|
+
creatorId?: string | null;
|
|
143
|
+
authors?: Array<User>;
|
|
144
|
+
authorsIds?: Array<string>;
|
|
145
|
+
diffData?: any;
|
|
146
|
+
data?: any;
|
|
147
|
+
createdAt?: Date;
|
|
148
|
+
attributes?: Record<string, unknown>;
|
|
149
|
+
fromVersion?: number;
|
|
150
|
+
toVersion?: number;
|
|
151
|
+
isEmptyCurrent?: boolean;
|
|
152
|
+
}
|
|
153
|
+
export {};
|
package/src/revision.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0x22fe=['creatorId','authors','_update','attributes','set','fromVersion','name','creator','map','authorsIds','createdAt','setAttribute','diffData','toJSON','toVersion','setName'];(function(_0x5a0cc3,_0x22fe40){const _0x1d2fcd=function(_0x3d6003){while(--_0x3d6003){_0x5a0cc3['push'](_0x5a0cc3['shift']());}};_0x1d2fcd(++_0x22fe40);}(_0x22fe,0x1de));const _0x1d2f=function(_0x5a0cc3,_0x22fe40){_0x5a0cc3=_0x5a0cc3-0x0;let _0x1d2fcd=_0x22fe[_0x5a0cc3];return _0x1d2fcd;};import{ObservableMixin as _0x3e5fa0,uid as _0x101efb}from'ckeditor5/src/utils';import{cloneDeep as _0x269b74,set as _0x9a7b0d,unset as _0x40e80b}from'lodash-es';export default class a extends _0x3e5fa0(){constructor(_0x840c73){super(),this['id']=_0x840c73['id']||_0x101efb(),this[_0x1d2f('0x9')]=_0x840c73[_0x1d2f('0x9')]||null,this[_0x1d2f('0x3')]=_0x840c73['authors']||[],this[_0x1d2f('0xe')]=_0x840c73[_0x1d2f('0xe')]||null,this['toVersion']=_0x840c73[_0x1d2f('0x0')]||0x0,this[_0x1d2f('0x7')]=_0x840c73[_0x1d2f('0x7')]||0x0,this['set']('name',_0x840c73[_0x1d2f('0x8')]||''),this[_0x1d2f('0x6')](_0x1d2f('0xc'),_0x840c73[_0x1d2f('0xc')]||new Date()),this[_0x1d2f('0x6')](_0x1d2f('0x5'),_0x840c73[_0x1d2f('0x5')]||{});}[_0x1d2f('0x1')](_0x2a05e5){this[_0x1d2f('0x4')]({'name':_0x2a05e5});}[_0x1d2f('0xd')](_0x48aa90,_0x44850d){const _0x45c686=_0x269b74(this['attributes']);_0x9a7b0d(_0x45c686,_0x48aa90,_0x44850d),this[_0x1d2f('0x4')]({'attributes':_0x45c686});}['removeAttribute'](_0x3e066a){const _0x8e0ea7=_0x269b74(this[_0x1d2f('0x5')]);_0x40e80b(_0x8e0ea7,_0x3e066a),this[_0x1d2f('0x4')]({'attributes':_0x8e0ea7});}[_0x1d2f('0x4')](_0x1526d8,_0x5a1168=!0x1){let _0x362424=!0x1;const _0x2c3994={'id':this['id']},_0x38ccad=[_0x1d2f('0x8'),_0x1d2f('0xc'),_0x1d2f('0xe'),'authors',_0x1d2f('0x5'),_0x1d2f('0x0'),_0x1d2f('0x7'),_0x1d2f('0x2')];for(const _0x4a22e4 of _0x38ccad){const _0x2e1dc0=_0x1526d8[_0x4a22e4];void 0x0!==_0x2e1dc0&&_0x2e1dc0!==this[_0x4a22e4]&&(this[_0x4a22e4]=_0x2e1dc0,_0x2c3994[_0x4a22e4]=_0x2e1dc0,_0x362424=!0x0);}_0x362424&&(_0x2c3994[_0x1d2f('0x3')]&&(_0x2c3994[_0x1d2f('0xb')]=_0x2c3994['authors']['map'](_0x1f9f31=>_0x1f9f31['id']),delete _0x2c3994[_0x1d2f('0x3')]),this['fire'](_0x1d2f('0x4'),_0x2c3994,_0x5a1168));}[_0x1d2f('0xf')](){return{'id':this['id'],'name':this[_0x1d2f('0x8')],'creatorId':this[_0x1d2f('0x9')]?this[_0x1d2f('0x9')]['id']:null,'authorsIds':this[_0x1d2f('0x3')][_0x1d2f('0xa')](_0x497680=>_0x497680['id']),'diffData':this[_0x1d2f('0xe')],'createdAt':this['createdAt'],'attributes':this[_0x1d2f('0x5')],'fromVersion':this[_0x1d2f('0x7')],'toVersion':this['toVersion']};}}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module revision-history/revisiondiff
|
|
3
|
+
*/
|
|
4
|
+
import { Collection } from 'ckeditor5/src/utils';
|
|
5
|
+
import type { DocumentFragment } from 'ckeditor5/src/engine';
|
|
6
|
+
import type ChangeItem from './changeitem';
|
|
7
|
+
/**
|
|
8
|
+
* Represents a difference between two document revisions.
|
|
9
|
+
*/
|
|
10
|
+
export default class RevisionDiff {
|
|
11
|
+
readonly newRevisionId: string;
|
|
12
|
+
readonly oldRevisionId: string;
|
|
13
|
+
readonly changes: Collection<ChangeItem>;
|
|
14
|
+
constructor(newRevisionId: string, oldRevisionId: string);
|
|
15
|
+
}
|
|
16
|
+
export interface DiffData {
|
|
17
|
+
model: Record<string, DocumentFragment>;
|
|
18
|
+
changes: Array<ChangeItem>;
|
|
19
|
+
}
|
package/src/revisiondiff.js
CHANGED
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
const
|
|
23
|
+
const _0xd915=['add','changes','_setData','newRevisionId','oldRevisionId'];(function(_0x22d1e2,_0xd91595){const _0x1a31eb=function(_0x17f874){while(--_0x17f874){_0x22d1e2['push'](_0x22d1e2['shift']());}};_0x1a31eb(++_0xd91595);}(_0xd915,0xf6));const _0x1a31=function(_0x22d1e2,_0xd91595){_0x22d1e2=_0x22d1e2-0x0;let _0x1a31eb=_0xd915[_0x22d1e2];return _0x1a31eb;};import{Collection as _0x4b6e0a}from'ckeditor5/src/utils';export default class f{constructor(_0x3f8ace,_0x17fa8d){this[_0x1a31('0x2')]=_0x3f8ace,this[_0x1a31('0x3')]=_0x17fa8d,this['changes']=new _0x4b6e0a();}[_0x1a31('0x1')](_0x1c1336){for(const _0xa1326 of _0x1c1336[_0x1a31('0x0')])this[_0x1a31('0x0')][_0x1a31('0x4')](_0xa1326);}}
|