@ckeditor/ckeditor5-revision-history 36.0.0 → 37.0.0-rc.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 +23 -8
- 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-rc.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.
|
|
33
|
-
"ckeditor5-collaboration": "^36.0.0",
|
|
42
|
+
"@ckeditor/ckeditor5-editor-classic": "^37.0.0-rc.0",
|
|
43
|
+
"@ckeditor/ckeditor5-ui": "^37.0.0-rc.0",
|
|
44
|
+
"@ckeditor/ckeditor5-undo": "^37.0.0-rc.0",
|
|
45
|
+
"ckeditor5": "^37.0.0-rc.0",
|
|
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 _0x1906=['createdAt','set','data','type','author'];(function(_0x3256f1,_0x190648){var _0x35a335=function(_0x408bed){while(--_0x408bed){_0x3256f1['push'](_0x3256f1['shift']());}};_0x35a335(++_0x190648);}(_0x1906,0x137));var _0x35a3=function(_0x3256f1,_0x190648){_0x3256f1=_0x3256f1-0x0;var _0x35a335=_0x1906[_0x3256f1];return _0x35a335;};import{ObservableMixin as _0x1b91be,uid as _0x1233b6}from'ckeditor5/src/utils';export default class r extends _0x1b91be(){constructor(_0x23d2d0){super(),this['id']=_0x23d2d0['id']||_0x1233b6(),this[_0x35a3('0x3')]=_0x23d2d0[_0x35a3('0x3')],this[_0x35a3('0x2')]=_0x23d2d0[_0x35a3('0x2')],this[_0x35a3('0x1')]=_0x23d2d0[_0x35a3('0x1')]||{},this[_0x35a3('0x0')](_0x35a3('0x4'),_0x23d2d0['createdAt']);}['toJSON'](){return{'id':this['id'],'authorId':this[_0x35a3('0x3')]['id'],'type':this[_0x35a3('0x2')],'data':this['data'],'createdAt':this[_0x35a3('0x4')]};}}
|
|
@@ -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 _0x3bab=['init','config','view','sourceElement','updateSourceElement','fire','_ui','initialData','destroy','create'];(function(_0x227def,_0x3babcc){const _0x3d59fa=function(_0x4089c5){while(--_0x4089c5){_0x227def['push'](_0x227def['shift']());}};_0x3d59fa(++_0x3babcc);}(_0x3bab,0xf5));const _0x3d59=function(_0x227def,_0x3babcc){_0x227def=_0x227def-0x0;let _0x3d59fa=_0x3bab[_0x227def];return _0x3d59fa;};import{Editor as _0xcd0608,DataApiMixin as _0x4a4ec1,ElementApiMixin as _0x12f569}from'ckeditor5/src/core';import _0x4605be from'./revisionviewereditorui';import _0x3049db from'./revisionviewereditoruiview';export default class d extends _0x4a4ec1(_0x12f569(_0xcd0608)){get['ui'](){return this['_ui'];}constructor(_0xad80ab,_0x2b4fa0){super(_0x2b4fa0),this[_0x3d59('0x8')]=_0xad80ab,this['model']['document']['createRoot']();const _0x2ebc40=new _0x3049db(this['locale'],this['editing'][_0x3d59('0x7')],{'shouldToolbarGroupWhenFull':!0x0});this[_0x3d59('0x1')]=new _0x4605be(this,_0x2ebc40);}[_0x3d59('0x3')](){return this[_0x3d59('0x9')](),this['ui'][_0x3d59('0x3')](),super[_0x3d59('0x3')]();}static async[_0x3d59('0x4')](_0x26873c,_0x392fcb){const _0x41e5a8=new this(_0x26873c,_0x392fcb);return await _0x41e5a8['initPlugins'](),await _0x41e5a8['ui'][_0x3d59('0x5')](_0x26873c),await _0x41e5a8['data'][_0x3d59('0x5')](_0x41e5a8[_0x3d59('0x6')]['get'](_0x3d59('0x2'))),_0x41e5a8[_0x3d59('0x0')]('ready'),_0x41e5a8;}}
|
|
@@ -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 _0x4625=['addToolbar','fillFromConfig','init','viewportTopOffset','_initToolbar','render','limiterElement','_toolbarConfig','focusTracker','restore','toolbar','bind','name','rootName','isFocused','isActive','_elementReplacer','_view','ready','attachDomRoot','replace','destroy','getRoot','viewportOffset','componentFactory','editing','editable','element','view','fire','stickyPanel'];(function(_0xf140c0,_0x46251b){const _0x205e15=function(_0x45c340){while(--_0x45c340){_0xf140c0['push'](_0xf140c0['shift']());}};_0x205e15(++_0x46251b);}(_0x4625,0xa3));const _0x205e=function(_0xf140c0,_0x46251b){_0xf140c0=_0xf140c0-0x0;let _0x205e15=_0x4625[_0xf140c0];return _0x205e15;};import{EditorUI as _0x32eaa0,normalizeToolbarConfig as _0x5c753a}from'ckeditor5/src/ui';import{ElementReplacer as _0x514642}from'ckeditor5/src/utils';export default class tt extends _0x32eaa0{get[_0x205e('0x14')](){return this['_view'];}constructor(_0x52d90f,_0x314918){super(_0x52d90f),this[_0x205e('0x9')]=_0x314918,this['_toolbarConfig']=_0x5c753a(_0x52d90f['config']['get']('toolbar')),this[_0x205e('0x8')]=new _0x514642();}get['element'](){return this['view'][_0x205e('0x13')];}[_0x205e('0x19')](_0x1d5eec){const _0x534a48=this['editor'],_0x310108=this[_0x205e('0x14')],_0x57e9ad=_0x534a48[_0x205e('0x11')][_0x205e('0x14')],_0x5ee9fd=_0x310108[_0x205e('0x12')],_0x273e4a=_0x57e9ad['document'][_0x205e('0xe')]();_0x5ee9fd[_0x205e('0x4')]=_0x273e4a[_0x205e('0x5')],_0x310108[_0x205e('0x1c')]();const _0xd7a79a=_0x5ee9fd[_0x205e('0x13')];this['setEditableElement'](_0x5ee9fd[_0x205e('0x4')],_0xd7a79a),_0x310108['editable'][_0x205e('0x3')](_0x205e('0x6'))['to'](this[_0x205e('0x0')]),_0x57e9ad[_0x205e('0xb')](_0xd7a79a),this[_0x205e('0x8')][_0x205e('0xc')](_0x1d5eec,this[_0x205e('0x13')]),this[_0x205e('0x1b')](),this[_0x205e('0x15')](_0x205e('0xa'));}[_0x205e('0xd')](){super[_0x205e('0xd')]();const _0x57f6af=this[_0x205e('0x14')],_0xa08a31=this['editor'][_0x205e('0x11')][_0x205e('0x14')];this[_0x205e('0x8')][_0x205e('0x1')](),_0xa08a31['detachDomRoot'](_0x57f6af['editable']['name']),_0x57f6af['destroy']();}[_0x205e('0x1b')](){const _0x500f48=this['view'];_0x500f48[_0x205e('0x16')]['bind'](_0x205e('0x7'))['to'](this[_0x205e('0x0')],_0x205e('0x6')),_0x500f48['stickyPanel'][_0x205e('0x1d')]=_0x500f48[_0x205e('0x13')],_0x500f48[_0x205e('0x16')][_0x205e('0x3')](_0x205e('0x1a'))['to'](this,_0x205e('0xf'),({top:_0x20a90a})=>_0x20a90a),_0x500f48['toolbar'][_0x205e('0x18')](this[_0x205e('0x1e')],this[_0x205e('0x10')]),this[_0x205e('0x17')](_0x500f48[_0x205e('0x2')]);}}
|
|
@@ -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 _0x4e95=['_editable','editable','add','shouldToolbarGroupWhenFull','main','stickyPanel','toolbar','top','render','content'];(function(_0x20e9dd,_0x4e9556){var _0x221e1a=function(_0x1a39d7){while(--_0x1a39d7){_0x20e9dd['push'](_0x20e9dd['shift']());}};_0x221e1a(++_0x4e9556);}(_0x4e95,0xee));var _0x221e=function(_0x20e9dd,_0x4e9556){_0x20e9dd=_0x20e9dd-0x0;var _0x221e1a=_0x4e95[_0x20e9dd];return _0x221e1a;};import{BoxedEditorUIView as _0x2049ab,InlineEditableUIView as _0x1809bd,StickyPanelView as _0x215dfd,ToolbarView as _0x385fbd}from'ckeditor5/src/ui';import'@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css';export default class it extends _0x2049ab{get[_0x221e('0x3')](){return this[_0x221e('0x2')];}constructor(_0x4e59f5,_0x123a82,_0x3f0d1f={}){super(_0x4e59f5),this[_0x221e('0x7')]=new _0x215dfd(_0x4e59f5),this['toolbar']=new _0x385fbd(_0x4e59f5,{'shouldGroupWhenFull':_0x3f0d1f[_0x221e('0x5')]}),this[_0x221e('0x2')]=new _0x1809bd(_0x4e59f5,_0x123a82);}[_0x221e('0x0')](){super[_0x221e('0x0')](),this[_0x221e('0x7')][_0x221e('0x1')]['add'](this[_0x221e('0x8')]),this[_0x221e('0x9')][_0x221e('0x4')](this[_0x221e('0x7')]),this[_0x221e('0x6')]['add'](this[_0x221e('0x3')]);}}
|
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 _0x342b=['creatorId','creator','attributes','map','authorsIds','createdAt','fromVersion','name','_update','toVersion','setAttribute','diffData','toJSON','authors','setName','removeAttribute'];(function(_0x371fd1,_0x342bf2){const _0x1604fd=function(_0x1bb579){while(--_0x1bb579){_0x371fd1['push'](_0x371fd1['shift']());}};_0x1604fd(++_0x342bf2);}(_0x342b,0x14b));const _0x1604=function(_0x371fd1,_0x342bf2){_0x371fd1=_0x371fd1-0x0;let _0x1604fd=_0x342b[_0x371fd1];return _0x1604fd;};import{ObservableMixin as _0x3ce2e4,uid as _0x4d5cd2}from'ckeditor5/src/utils';import{cloneDeep as _0x275990,set as _0x3ca8ad,unset as _0x3a4636}from'lodash-es';export default class a extends _0x3ce2e4(){constructor(_0x8b5741){super(),this['id']=_0x8b5741['id']||_0x4d5cd2(),this[_0x1604('0x6')]=_0x8b5741[_0x1604('0x6')]||null,this[_0x1604('0x2')]=_0x8b5741[_0x1604('0x2')]||[],this[_0x1604('0x0')]=_0x8b5741[_0x1604('0x0')]||null,this[_0x1604('0xe')]=_0x8b5741[_0x1604('0xe')]||0x0,this[_0x1604('0xb')]=_0x8b5741[_0x1604('0xb')]||0x0,this['set'](_0x1604('0xc'),_0x8b5741[_0x1604('0xc')]||''),this['set'](_0x1604('0xa'),_0x8b5741[_0x1604('0xa')]||new Date()),this['set'](_0x1604('0x7'),_0x8b5741[_0x1604('0x7')]||{});}[_0x1604('0x3')](_0x449839){this[_0x1604('0xd')]({'name':_0x449839});}[_0x1604('0xf')](_0x55ccac,_0x16543b){const _0x110470=_0x275990(this[_0x1604('0x7')]);_0x3ca8ad(_0x110470,_0x55ccac,_0x16543b),this[_0x1604('0xd')]({'attributes':_0x110470});}[_0x1604('0x4')](_0x259970){const _0x365d3a=_0x275990(this['attributes']);_0x3a4636(_0x365d3a,_0x259970),this[_0x1604('0xd')]({'attributes':_0x365d3a});}[_0x1604('0xd')](_0x10649b,_0x3036d5=!0x1){let _0x2e2120=!0x1;const _0x7c2e60={'id':this['id']},_0x55a79b=['name',_0x1604('0xa'),_0x1604('0x0'),_0x1604('0x2'),_0x1604('0x7'),_0x1604('0xe'),'fromVersion',_0x1604('0x5')];for(const _0x199a6d of _0x55a79b){const _0xd95713=_0x10649b[_0x199a6d];void 0x0!==_0xd95713&&_0xd95713!==this[_0x199a6d]&&(this[_0x199a6d]=_0xd95713,_0x7c2e60[_0x199a6d]=_0xd95713,_0x2e2120=!0x0);}_0x2e2120&&(_0x7c2e60[_0x1604('0x2')]&&(_0x7c2e60[_0x1604('0x9')]=_0x7c2e60[_0x1604('0x2')][_0x1604('0x8')](_0x5a6968=>_0x5a6968['id']),delete _0x7c2e60[_0x1604('0x2')]),this['fire'](_0x1604('0xd'),_0x7c2e60,_0x3036d5));}[_0x1604('0x1')](){return{'id':this['id'],'name':this[_0x1604('0xc')],'creatorId':this[_0x1604('0x6')]?this[_0x1604('0x6')]['id']:null,'authorsIds':this[_0x1604('0x2')][_0x1604('0x8')](_0x1e2a9e=>_0x1e2a9e['id']),'diffData':this['diffData'],'createdAt':this[_0x1604('0xa')],'attributes':this[_0x1604('0x7')],'fromVersion':this[_0x1604('0xb')],'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 _0x1805=['add','_setData','changes','newRevisionId'];(function(_0x4e3fe8,_0x18053f){const _0x2de4a0=function(_0x4718b4){while(--_0x4718b4){_0x4e3fe8['push'](_0x4e3fe8['shift']());}};_0x2de4a0(++_0x18053f);}(_0x1805,0x1ad));const _0x2de4=function(_0x4e3fe8,_0x18053f){_0x4e3fe8=_0x4e3fe8-0x0;let _0x2de4a0=_0x1805[_0x4e3fe8];return _0x2de4a0;};import{Collection as _0x379c72}from'ckeditor5/src/utils';export default class f{constructor(_0x4c6f45,_0x3ff7cf){this[_0x2de4('0x2')]=_0x4c6f45,this['oldRevisionId']=_0x3ff7cf,this[_0x2de4('0x1')]=new _0x379c72();}[_0x2de4('0x0')](_0x2ca1ed){for(const _0x38d5f0 of _0x2ca1ed[_0x2de4('0x1')])this['changes'][_0x2de4('0x3')](_0x38d5f0);}}
|