@ckeditor/ckeditor5-revision-history 44.1.0-alpha.5 → 44.2.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -1
- package/README.md +1 -1
- package/build/revision-history.js +2 -2
- package/dist/index-content.css +2 -2
- package/dist/index-editor.css +6 -3
- package/dist/index.css +43 -18
- package/dist/index.js +7 -7
- package/dist/translations/af.d.ts +2 -2
- package/dist/translations/af.js +2 -2
- package/dist/translations/af.umd.js +2 -2
- package/dist/translations/ar.d.ts +2 -2
- package/dist/translations/ar.js +2 -2
- package/dist/translations/ar.umd.js +2 -2
- package/dist/translations/ast.d.ts +2 -2
- package/dist/translations/ast.js +2 -2
- package/dist/translations/ast.umd.js +2 -2
- package/dist/translations/az.d.ts +2 -2
- package/dist/translations/az.js +2 -2
- package/dist/translations/az.umd.js +2 -2
- package/dist/translations/bg.d.ts +2 -2
- package/dist/translations/bg.js +2 -2
- package/dist/translations/bg.umd.js +2 -2
- package/dist/translations/bn.d.ts +2 -2
- package/dist/translations/bn.js +2 -2
- package/dist/translations/bn.umd.js +2 -2
- package/dist/translations/bs.d.ts +2 -2
- package/dist/translations/bs.js +2 -2
- package/dist/translations/bs.umd.js +2 -2
- package/dist/translations/ca.d.ts +2 -2
- package/dist/translations/ca.js +2 -2
- package/dist/translations/ca.umd.js +2 -2
- package/dist/translations/cs.d.ts +2 -2
- package/dist/translations/cs.js +2 -2
- package/dist/translations/cs.umd.js +2 -2
- package/dist/translations/da.d.ts +2 -2
- package/dist/translations/da.js +2 -2
- package/dist/translations/da.umd.js +2 -2
- package/dist/translations/de-ch.d.ts +2 -2
- package/dist/translations/de-ch.js +2 -2
- package/dist/translations/de-ch.umd.js +2 -2
- package/dist/translations/de.d.ts +2 -2
- package/dist/translations/de.js +2 -2
- package/dist/translations/de.umd.js +2 -2
- package/dist/translations/el.d.ts +2 -2
- package/dist/translations/el.js +2 -2
- package/dist/translations/el.umd.js +2 -2
- package/dist/translations/en-au.d.ts +2 -2
- package/dist/translations/en-au.js +2 -2
- package/dist/translations/en-au.umd.js +2 -2
- package/dist/translations/en-gb.d.ts +2 -2
- package/dist/translations/en-gb.js +2 -2
- package/dist/translations/en-gb.umd.js +2 -2
- package/dist/translations/en.d.ts +2 -2
- package/dist/translations/en.js +2 -2
- package/dist/translations/en.umd.js +2 -2
- package/dist/translations/eo.d.ts +2 -2
- package/dist/translations/eo.js +2 -2
- package/dist/translations/eo.umd.js +2 -2
- package/dist/translations/es-co.d.ts +2 -2
- package/dist/translations/es-co.js +2 -2
- package/dist/translations/es-co.umd.js +2 -2
- package/dist/translations/es.d.ts +2 -2
- package/dist/translations/es.js +2 -2
- package/dist/translations/es.umd.js +2 -2
- package/dist/translations/et.d.ts +2 -2
- package/dist/translations/et.js +2 -2
- package/dist/translations/et.umd.js +2 -2
- package/dist/translations/eu.d.ts +2 -2
- package/dist/translations/eu.js +2 -2
- package/dist/translations/eu.umd.js +2 -2
- package/dist/translations/fa.d.ts +2 -2
- package/dist/translations/fa.js +2 -2
- package/dist/translations/fa.umd.js +2 -2
- package/dist/translations/fi.d.ts +2 -2
- package/dist/translations/fi.js +2 -2
- package/dist/translations/fi.umd.js +2 -2
- package/dist/translations/fr.d.ts +2 -2
- package/dist/translations/fr.js +2 -2
- package/dist/translations/fr.umd.js +2 -2
- package/dist/translations/gl.d.ts +2 -2
- package/dist/translations/gl.js +2 -2
- package/dist/translations/gl.umd.js +2 -2
- package/dist/translations/gu.d.ts +2 -2
- package/dist/translations/gu.js +2 -2
- package/dist/translations/gu.umd.js +2 -2
- package/dist/translations/he.d.ts +2 -2
- package/dist/translations/he.js +2 -2
- package/dist/translations/he.umd.js +2 -2
- package/dist/translations/hi.d.ts +2 -2
- package/dist/translations/hi.js +2 -2
- package/dist/translations/hi.umd.js +2 -2
- package/dist/translations/hr.d.ts +2 -2
- package/dist/translations/hr.js +2 -2
- package/dist/translations/hr.umd.js +2 -2
- package/dist/translations/hu.d.ts +2 -2
- package/dist/translations/hu.js +2 -2
- package/dist/translations/hu.umd.js +2 -2
- package/dist/translations/hy.d.ts +2 -2
- package/dist/translations/hy.js +2 -2
- package/dist/translations/hy.umd.js +2 -2
- package/dist/translations/id.d.ts +2 -2
- package/dist/translations/id.js +2 -2
- package/dist/translations/id.umd.js +2 -2
- package/dist/translations/it.d.ts +2 -2
- package/dist/translations/it.js +2 -2
- package/dist/translations/it.umd.js +2 -2
- package/dist/translations/ja.d.ts +2 -2
- package/dist/translations/ja.js +2 -2
- package/dist/translations/ja.umd.js +2 -2
- package/dist/translations/jv.d.ts +2 -2
- package/dist/translations/jv.js +2 -2
- package/dist/translations/jv.umd.js +2 -2
- package/dist/translations/kk.d.ts +2 -2
- package/dist/translations/kk.js +2 -2
- package/dist/translations/kk.umd.js +2 -2
- package/dist/translations/km.d.ts +2 -2
- package/dist/translations/km.js +2 -2
- package/dist/translations/km.umd.js +2 -2
- package/dist/translations/kn.d.ts +2 -2
- package/dist/translations/kn.js +2 -2
- package/dist/translations/kn.umd.js +2 -2
- package/dist/translations/ko.d.ts +2 -2
- package/dist/translations/ko.js +2 -2
- package/dist/translations/ko.umd.js +2 -2
- package/dist/translations/ku.d.ts +2 -2
- package/dist/translations/ku.js +2 -2
- package/dist/translations/ku.umd.js +2 -2
- package/dist/translations/lt.d.ts +2 -2
- package/dist/translations/lt.js +2 -2
- package/dist/translations/lt.umd.js +2 -2
- package/dist/translations/lv.d.ts +2 -2
- package/dist/translations/lv.js +2 -2
- package/dist/translations/lv.umd.js +2 -2
- package/dist/translations/ms.d.ts +2 -2
- package/dist/translations/ms.js +2 -2
- package/dist/translations/ms.umd.js +2 -2
- package/dist/translations/nb.d.ts +2 -2
- package/dist/translations/nb.js +2 -2
- package/dist/translations/nb.umd.js +2 -2
- package/dist/translations/ne.d.ts +2 -2
- package/dist/translations/ne.js +2 -2
- package/dist/translations/ne.umd.js +2 -2
- package/dist/translations/nl.d.ts +2 -2
- package/dist/translations/nl.js +2 -2
- package/dist/translations/nl.umd.js +2 -2
- package/dist/translations/no.d.ts +2 -2
- package/dist/translations/no.js +2 -2
- package/dist/translations/no.umd.js +2 -2
- package/dist/translations/oc.d.ts +2 -2
- package/dist/translations/oc.js +2 -2
- package/dist/translations/oc.umd.js +2 -2
- package/dist/translations/pl.d.ts +2 -2
- package/dist/translations/pl.js +2 -2
- package/dist/translations/pl.umd.js +2 -2
- package/dist/translations/pt-br.d.ts +2 -2
- package/dist/translations/pt-br.js +2 -2
- package/dist/translations/pt-br.umd.js +2 -2
- package/dist/translations/pt.d.ts +2 -2
- package/dist/translations/pt.js +2 -2
- package/dist/translations/pt.umd.js +2 -2
- package/dist/translations/ro.d.ts +2 -2
- package/dist/translations/ro.js +2 -2
- package/dist/translations/ro.umd.js +2 -2
- package/dist/translations/ru.d.ts +2 -2
- package/dist/translations/ru.js +2 -2
- package/dist/translations/ru.umd.js +2 -2
- package/dist/translations/si.d.ts +2 -2
- package/dist/translations/si.js +2 -2
- package/dist/translations/si.umd.js +2 -2
- package/dist/translations/sk.d.ts +2 -2
- package/dist/translations/sk.js +2 -2
- package/dist/translations/sk.umd.js +2 -2
- package/dist/translations/sl.d.ts +2 -2
- package/dist/translations/sl.js +2 -2
- package/dist/translations/sl.umd.js +2 -2
- package/dist/translations/sq.d.ts +2 -2
- package/dist/translations/sq.js +2 -2
- package/dist/translations/sq.umd.js +2 -2
- package/dist/translations/sr-latn.d.ts +2 -2
- package/dist/translations/sr-latn.js +2 -2
- package/dist/translations/sr-latn.umd.js +2 -2
- package/dist/translations/sr.d.ts +2 -2
- package/dist/translations/sr.js +2 -2
- package/dist/translations/sr.umd.js +2 -2
- package/dist/translations/sv.d.ts +2 -2
- package/dist/translations/sv.js +2 -2
- package/dist/translations/sv.umd.js +2 -2
- package/dist/translations/th.d.ts +2 -2
- package/dist/translations/th.js +2 -2
- package/dist/translations/th.umd.js +2 -2
- package/dist/translations/ti.d.ts +2 -2
- package/dist/translations/ti.js +2 -2
- package/dist/translations/ti.umd.js +2 -2
- package/dist/translations/tk.d.ts +2 -2
- package/dist/translations/tk.js +2 -2
- package/dist/translations/tk.umd.js +2 -2
- package/dist/translations/tr.d.ts +2 -2
- package/dist/translations/tr.js +2 -2
- package/dist/translations/tr.umd.js +2 -2
- package/dist/translations/tt.d.ts +2 -2
- package/dist/translations/tt.js +2 -2
- package/dist/translations/tt.umd.js +2 -2
- package/dist/translations/ug.d.ts +2 -2
- package/dist/translations/ug.js +2 -2
- package/dist/translations/ug.umd.js +2 -2
- package/dist/translations/uk.d.ts +2 -2
- package/dist/translations/uk.js +2 -2
- package/dist/translations/uk.umd.js +2 -2
- package/dist/translations/ur.d.ts +2 -2
- package/dist/translations/ur.js +2 -2
- package/dist/translations/ur.umd.js +2 -2
- package/dist/translations/uz.d.ts +2 -2
- package/dist/translations/uz.js +2 -2
- package/dist/translations/uz.umd.js +2 -2
- package/dist/translations/vi.d.ts +2 -2
- package/dist/translations/vi.js +2 -2
- package/dist/translations/vi.umd.js +2 -2
- package/dist/translations/zh-cn.d.ts +2 -2
- package/dist/translations/zh-cn.js +2 -2
- package/dist/translations/zh-cn.umd.js +2 -2
- package/dist/translations/zh.d.ts +2 -2
- package/dist/translations/zh.js +2 -2
- package/dist/translations/zh.umd.js +2 -2
- package/lang/translations/af.po +1 -1
- package/lang/translations/ar.po +1 -1
- package/lang/translations/ast.po +1 -1
- package/lang/translations/az.po +1 -1
- package/lang/translations/bg.po +1 -1
- package/lang/translations/bn.po +1 -1
- package/lang/translations/bs.po +1 -1
- package/lang/translations/ca.po +1 -1
- package/lang/translations/cs.po +1 -1
- package/lang/translations/da.po +1 -1
- package/lang/translations/de-ch.po +1 -1
- package/lang/translations/de.po +1 -1
- package/lang/translations/el.po +1 -1
- package/lang/translations/en-au.po +1 -1
- package/lang/translations/en-gb.po +1 -1
- package/lang/translations/en.po +1 -1
- package/lang/translations/eo.po +1 -1
- package/lang/translations/es-co.po +1 -1
- package/lang/translations/es.po +1 -1
- package/lang/translations/et.po +1 -1
- package/lang/translations/eu.po +1 -1
- package/lang/translations/fa.po +1 -1
- package/lang/translations/fi.po +1 -1
- package/lang/translations/fr.po +1 -1
- package/lang/translations/gl.po +1 -1
- package/lang/translations/gu.po +1 -1
- package/lang/translations/he.po +1 -1
- package/lang/translations/hi.po +1 -1
- package/lang/translations/hr.po +1 -1
- package/lang/translations/hu.po +1 -1
- package/lang/translations/hy.po +1 -1
- package/lang/translations/id.po +1 -1
- package/lang/translations/it.po +1 -1
- package/lang/translations/ja.po +1 -1
- package/lang/translations/jv.po +1 -1
- package/lang/translations/kk.po +1 -1
- package/lang/translations/km.po +1 -1
- package/lang/translations/kn.po +1 -1
- package/lang/translations/ko.po +1 -1
- package/lang/translations/ku.po +1 -1
- package/lang/translations/lt.po +1 -1
- package/lang/translations/lv.po +1 -1
- package/lang/translations/ms.po +1 -1
- package/lang/translations/nb.po +1 -1
- package/lang/translations/ne.po +1 -1
- package/lang/translations/nl.po +1 -1
- package/lang/translations/no.po +1 -1
- package/lang/translations/oc.po +1 -1
- package/lang/translations/pl.po +1 -1
- package/lang/translations/pt-br.po +1 -1
- package/lang/translations/pt.po +1 -1
- package/lang/translations/ro.po +1 -1
- package/lang/translations/ru.po +1 -1
- package/lang/translations/si.po +1 -1
- package/lang/translations/sk.po +1 -1
- package/lang/translations/sl.po +1 -1
- package/lang/translations/sq.po +1 -1
- package/lang/translations/sr-latn.po +1 -1
- package/lang/translations/sr.po +1 -1
- package/lang/translations/sv.po +1 -1
- package/lang/translations/th.po +1 -1
- package/lang/translations/ti.po +1 -1
- package/lang/translations/tk.po +1 -1
- package/lang/translations/tr.po +1 -1
- package/lang/translations/tt.po +1 -1
- package/lang/translations/ug.po +1 -1
- package/lang/translations/uk.po +1 -1
- package/lang/translations/ur.po +1 -1
- package/lang/translations/uz.po +1 -1
- package/lang/translations/vi.po +1 -1
- package/lang/translations/zh-cn.po +1 -1
- package/lang/translations/zh.po +1 -1
- package/package.json +34 -9
- package/src/augmentation.d.ts +1 -1
- package/src/augmentation.js +1 -1
- package/src/changeitem.d.ts +1 -1
- package/src/changeitem.js +3 -3
- package/src/editor/revisionviewereditor.d.ts +1 -1
- package/src/editor/revisionviewereditor.js +3 -3
- package/src/editor/revisionviewereditorui.d.ts +1 -1
- package/src/editor/revisionviewereditorui.js +2 -2
- package/src/editor/revisionviewereditoruiview.d.ts +1 -1
- package/src/editor/revisionviewereditoruiview.js +2 -2
- package/src/index.d.ts +1 -1
- package/src/index.js +2 -2
- package/src/revision.d.ts +1 -1
- package/src/revision.js +3 -3
- package/src/revisiondiff.d.ts +1 -1
- package/src/revisiondiff.js +2 -2
- package/src/revisionhistory.d.ts +18 -1
- package/src/revisionhistory.js +2 -2
- package/src/revisionhistoryadapter.d.ts +1 -1
- package/src/revisionhistoryadapter.js +1 -1
- package/src/revisionhistoryconfig.d.ts +1 -1
- package/src/revisionhistoryconfig.js +1 -1
- package/src/revisionsrepository.d.ts +1 -1
- package/src/revisionsrepository.js +2 -2
- package/src/revisiontracker.d.ts +1 -1
- package/src/revisiontracker.js +2 -2
- package/src/revisionviewer.d.ts +1 -1
- package/src/revisionviewer.js +2 -2
- package/src/ui/revision/createrevisionactionsdropdown.d.ts +1 -1
- package/src/ui/revision/createrevisionactionsdropdown.js +2 -2
- package/src/ui/revision/revisionauthorview.d.ts +1 -1
- package/src/ui/revision/revisionauthorview.js +2 -2
- package/src/ui/revision/revisionnameview.d.ts +1 -1
- package/src/ui/revision/revisionnameview.js +2 -2
- package/src/ui/revision/revisionview.d.ts +1 -1
- package/src/ui/revision/revisionview.js +3 -3
- package/src/ui/revision/subrevisioncollapserview.d.ts +1 -1
- package/src/ui/revision/subrevisioncollapserview.js +2 -2
- package/src/ui/revision/subrevisionview.d.ts +1 -1
- package/src/ui/revision/subrevisionview.js +2 -2
- package/src/ui/revision/utils.d.ts +1 -1
- package/src/ui/revision/utils.js +2 -2
- package/src/ui/revisionhistory/revisionhistorysaverevisionformview.d.ts +1 -1
- package/src/ui/revisionhistory/revisionhistorysaverevisionformview.js +2 -2
- package/src/ui/revisionhistory/revisionhistoryui.d.ts +1 -1
- package/src/ui/revisionhistory/revisionhistoryui.js +2 -2
- package/src/ui/revisionssidebar/revisionssidebar.d.ts +1 -1
- package/src/ui/revisionssidebar/revisionssidebar.js +2 -2
- package/src/ui/revisionssidebar/revisionssidebarheaderview.d.ts +1 -1
- package/src/ui/revisionssidebar/revisionssidebarheaderview.js +2 -2
- package/src/ui/revisionssidebar/revisionssidebartimeperiodview.d.ts +1 -1
- package/src/ui/revisionssidebar/revisionssidebartimeperiodview.js +2 -2
- package/src/ui/revisionssidebar/revisionssidebarview.d.ts +1 -1
- package/src/ui/revisionssidebar/revisionssidebarview.js +2 -2
- package/src/ui/revisionssidebar/utils.d.ts +1 -1
- package/src/ui/revisionssidebar/utils.js +2 -2
- package/src/ui/revisionviewer/changedetailsview.d.ts +1 -1
- package/src/ui/revisionviewer/changedetailsview.js +2 -2
- package/src/ui/revisionviewer/changesnavigationview.d.ts +1 -1
- package/src/ui/revisionviewer/changesnavigationview.js +2 -2
- package/src/ui/revisionviewer/revisionviewerloadingoverlay.d.ts +1 -1
- package/src/ui/revisionviewer/revisionviewerloadingoverlay.js +2 -2
- package/src/ui/revisionviewer/revisionviewerui.d.ts +1 -1
- package/src/ui/revisionviewer/revisionviewerui.js +2 -2
- package/src/utils/common-translations.d.ts +1 -1
- package/src/utils/common-translations.js +2 -2
- package/theme/changesnavigation.css +1 -1
- package/theme/revision/revision.css +1 -1
- package/theme/revision/revisionactions.css +1 -1
- package/theme/revision/revisionauthor.css +1 -1
- package/theme/revision/revisionname.css +1 -1
- package/theme/revision/subrevision.css +1 -1
- package/theme/revision/subrevisioncollapser.css +1 -1
- package/theme/revisionhistorysaverevisionform.css +1 -1
- package/theme/revisionssidebar/revisionssidebar.css +1 -1
- package/theme/revisionssidebar/revisionssidebarheader.css +25 -2
- package/theme/revisionssidebar/revisionssidebartimeperiod.css +1 -1
- package/theme/revisionviewer.css +1 -1
- package/theme/revisionviewerloadingoverlay.css +3 -1
- package/dist/augmentation.d.ts +0 -33
- package/dist/changeitem.d.ts +0 -62
- package/dist/editor/revisionviewereditor.d.ts +0 -31
- package/dist/editor/revisionviewereditorui.d.ts +0 -32
- package/dist/editor/revisionviewereditoruiview.d.ts +0 -47
- package/dist/index.d.ts +0 -20
- package/dist/revision.d.ts +0 -157
- package/dist/revisiondiff.d.ts +0 -28
- package/dist/revisionhistory.d.ts +0 -111
- package/dist/revisionhistoryadapter.d.ts +0 -68
- package/dist/revisionhistoryconfig.d.ts +0 -75
- package/dist/revisionsrepository.d.ts +0 -64
- package/dist/revisiontracker.d.ts +0 -141
- package/dist/revisionviewer.d.ts +0 -119
- package/dist/ui/revision/createrevisionactionsdropdown.d.ts +0 -17
- package/dist/ui/revision/revisionauthorview.d.ts +0 -18
- package/dist/ui/revision/revisionnameview.d.ts +0 -34
- package/dist/ui/revision/revisionview.d.ts +0 -99
- package/dist/ui/revision/subrevisioncollapserview.d.ts +0 -25
- package/dist/ui/revision/subrevisionview.d.ts +0 -38
- package/dist/ui/revision/utils.d.ts +0 -9
- package/dist/ui/revisionhistory/revisionhistorysaverevisionformview.d.ts +0 -61
- package/dist/ui/revisionhistory/revisionhistoryui.d.ts +0 -38
- package/dist/ui/revisionssidebar/revisionssidebar.d.ts +0 -56
- package/dist/ui/revisionssidebar/revisionssidebarheaderview.d.ts +0 -20
- package/dist/ui/revisionssidebar/revisionssidebartimeperiodview.d.ts +0 -33
- package/dist/ui/revisionssidebar/revisionssidebarview.d.ts +0 -48
- package/dist/ui/revisionssidebar/utils.d.ts +0 -13
- package/dist/ui/revisionviewer/changedetailsview.d.ts +0 -26
- package/dist/ui/revisionviewer/changesnavigationview.d.ts +0 -44
- package/dist/ui/revisionviewer/revisionviewerloadingoverlay.d.ts +0 -38
- package/dist/ui/revisionviewer/revisionviewerui.d.ts +0 -40
- package/dist/utils/common-translations.d.ts +0 -15
package/dist/revision.d.ts
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, 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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
import type { User } from 'ckeditor5-collaboration/src/collaboration-core.js';
|
|
10
|
-
declare const Revision_base: {
|
|
11
|
-
new (): import("ckeditor5/src/utils.js").Observable;
|
|
12
|
-
prototype: import("ckeditor5/src/utils.js").Observable;
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Represents a revision.
|
|
16
|
-
*/
|
|
17
|
-
export default class Revision extends /* #__PURE__ -- @preserve */ Revision_base {
|
|
18
|
-
/**
|
|
19
|
-
* Unique revision id.
|
|
20
|
-
*/
|
|
21
|
-
id: string;
|
|
22
|
-
/**
|
|
23
|
-
* The user who created the revision.
|
|
24
|
-
*
|
|
25
|
-
* The `null` value means the revision was created automatically.
|
|
26
|
-
*/
|
|
27
|
-
creator: User | null;
|
|
28
|
-
/**
|
|
29
|
-
* All users who contributed to this revision.
|
|
30
|
-
*
|
|
31
|
-
* This value can be empty if there are no changes in the revision.
|
|
32
|
-
*/
|
|
33
|
-
authors: Array<User>;
|
|
34
|
-
/**
|
|
35
|
-
* Contains data describing changes saved in this revision.
|
|
36
|
-
*
|
|
37
|
-
* An object, where the keys are the names of roots and the values are strings with the revision data for those roots.
|
|
38
|
-
*/
|
|
39
|
-
diffData: any;
|
|
40
|
-
/**
|
|
41
|
-
* Document version at which the revision ends.
|
|
42
|
-
*
|
|
43
|
-
* The revision includes changes introduced by {@link module:engine/model/operation/operation~Operation operations}
|
|
44
|
-
* with base versions starting from {@link module:revision-history/revision~Revision#fromVersion `fromVersion`} (inclusive) up to
|
|
45
|
-
* {@link module:revision-history/revision~Revision#toVersion `toVersion`} (exclusive).
|
|
46
|
-
*/
|
|
47
|
-
toVersion: number;
|
|
48
|
-
/**
|
|
49
|
-
* Document version from which the revision starts.
|
|
50
|
-
*
|
|
51
|
-
* The revision includes changes introduced by {@link module:engine/model/operation/operation~Operation operations}
|
|
52
|
-
* with base versions starting from {@link module:revision-history/revision~Revision#fromVersion `fromVersion`} (inclusive) up to
|
|
53
|
-
* {@link module:revision-history/revision~Revision#toVersion `toVersion`} (exclusive).
|
|
54
|
-
*/
|
|
55
|
-
fromVersion: number;
|
|
56
|
-
/**
|
|
57
|
-
* The revision name.
|
|
58
|
-
*
|
|
59
|
-
* If revision has not been named yet, this is an empty string.
|
|
60
|
-
*
|
|
61
|
-
* @observable
|
|
62
|
-
*/
|
|
63
|
-
name: string;
|
|
64
|
-
/**
|
|
65
|
-
* The date when the revision was created or most recently updated.
|
|
66
|
-
*
|
|
67
|
-
* @observable
|
|
68
|
-
*/
|
|
69
|
-
createdAt: Date;
|
|
70
|
-
/**
|
|
71
|
-
* Revision custom attributes. See also {@link #setAttribute} and {@link #removeAttribute}.
|
|
72
|
-
*
|
|
73
|
-
* @observable
|
|
74
|
-
*/
|
|
75
|
-
attributes: Record<string, unknown>;
|
|
76
|
-
constructor(data: RevisionData);
|
|
77
|
-
/**
|
|
78
|
-
* Sets the revision name.
|
|
79
|
-
*/
|
|
80
|
-
setName(name: string): void;
|
|
81
|
-
/**
|
|
82
|
-
* Adds revision attribute.
|
|
83
|
-
*
|
|
84
|
-
* Revision attributes are custom data that can be set and used by features built around revisions.
|
|
85
|
-
* Use it to store your feature data together with other revision data.
|
|
86
|
-
*
|
|
87
|
-
* ```ts
|
|
88
|
-
* revision.setAttribute( 'isImportant', true );
|
|
89
|
-
* ```
|
|
90
|
-
*
|
|
91
|
-
* You can group multiple values in an object, using the dot notation:
|
|
92
|
-
*
|
|
93
|
-
* ```ts
|
|
94
|
-
* revision.setAttribute( 'customData.type', 'image' );
|
|
95
|
-
* revision.setAttribute( 'customData.src', 'foo.jpg' );
|
|
96
|
-
* ```
|
|
97
|
-
*
|
|
98
|
-
* The attributes set on the revision can be accessed through the `attribute` property:
|
|
99
|
-
*
|
|
100
|
-
* ```ts
|
|
101
|
-
* const isImportant = revision.attributes.isImportant;
|
|
102
|
-
* const type = revision.attributes.customData.type;
|
|
103
|
-
* ```
|
|
104
|
-
*
|
|
105
|
-
* You can also observe the `attributes` property or bind other properties to it:
|
|
106
|
-
*
|
|
107
|
-
* ```ts
|
|
108
|
-
* myObj.bind( 'customData' ).to( revision, 'attributes', attributes => attributes.customData );
|
|
109
|
-
* revision.on( 'change:attributes', ( evt, propName, newValue, oldValue ) => { ... } );
|
|
110
|
-
* ```
|
|
111
|
-
*
|
|
112
|
-
* Whenever `setAttribute()` or `removeAttribute()` is called, the `attributes` property
|
|
113
|
-
* is re-set and the observables are refreshed.
|
|
114
|
-
*/
|
|
115
|
-
setAttribute(name: string, value: unknown): void;
|
|
116
|
-
/**
|
|
117
|
-
* Removes the revision attribute.
|
|
118
|
-
*
|
|
119
|
-
* See also {@link #setAttribute}
|
|
120
|
-
*/
|
|
121
|
-
removeAttribute(name: string): void;
|
|
122
|
-
toJSON(): RevisionJSON;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* @eventName _update
|
|
126
|
-
*/
|
|
127
|
-
export interface RevisionUpdateEvent {
|
|
128
|
-
name: '_update';
|
|
129
|
-
args: [RevisionJSON, boolean];
|
|
130
|
-
}
|
|
131
|
-
export interface RevisionJSON {
|
|
132
|
-
id: string;
|
|
133
|
-
name: string;
|
|
134
|
-
creatorId: string | null;
|
|
135
|
-
authorsIds: Array<string>;
|
|
136
|
-
diffData: any;
|
|
137
|
-
createdAt: Date;
|
|
138
|
-
attributes: Record<string, unknown>;
|
|
139
|
-
fromVersion: number;
|
|
140
|
-
toVersion: number;
|
|
141
|
-
}
|
|
142
|
-
export interface RevisionData {
|
|
143
|
-
id?: string;
|
|
144
|
-
name?: string | null;
|
|
145
|
-
creator?: User | null;
|
|
146
|
-
creatorId?: string | null;
|
|
147
|
-
authors?: Array<User>;
|
|
148
|
-
authorsIds?: Array<string>;
|
|
149
|
-
diffData?: any;
|
|
150
|
-
data?: any;
|
|
151
|
-
createdAt?: Date;
|
|
152
|
-
attributes?: Record<string, unknown>;
|
|
153
|
-
fromVersion?: number;
|
|
154
|
-
toVersion?: number;
|
|
155
|
-
isEmptyCurrent?: boolean;
|
|
156
|
-
}
|
|
157
|
-
export {};
|
package/dist/revisiondiff.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, 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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module revision-history/revisiondiff
|
|
11
|
-
*/
|
|
12
|
-
import { Collection } from 'ckeditor5/src/utils.js';
|
|
13
|
-
import type { DocumentFragment } from 'ckeditor5/src/engine.js';
|
|
14
|
-
import type ChangeItem from './changeitem.js';
|
|
15
|
-
/**
|
|
16
|
-
* Represents a difference between two document revisions.
|
|
17
|
-
*/
|
|
18
|
-
export default class RevisionDiff {
|
|
19
|
-
readonly newRevisionId: string;
|
|
20
|
-
readonly oldRevisionId: string;
|
|
21
|
-
readonly changes: Collection<ChangeItem>;
|
|
22
|
-
constructor(newRevisionId: string, oldRevisionId: string);
|
|
23
|
-
}
|
|
24
|
-
export interface DiffData {
|
|
25
|
-
model: Record<string, DocumentFragment>;
|
|
26
|
-
attributes: Record<string, Record<string, unknown>>;
|
|
27
|
-
changes: Array<ChangeItem>;
|
|
28
|
-
}
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, 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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module revision-history/revisionhistory
|
|
11
|
-
* @publicApi
|
|
12
|
-
*/
|
|
13
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
14
|
-
import type { Item, Position } from 'ckeditor5/src/engine.js';
|
|
15
|
-
import RevisionTracker from './revisiontracker.js';
|
|
16
|
-
import RevisionHistoryUI from './ui/revisionhistory/revisionhistoryui.js';
|
|
17
|
-
import type { default as Revision, RevisionJSON } from './revision.js';
|
|
18
|
-
import type { RevisionHistoryAdapter } from './revisionhistoryadapter.js';
|
|
19
|
-
/**
|
|
20
|
-
* The revision history feature.
|
|
21
|
-
*
|
|
22
|
-
* Enables tracking and bundling changes into revisions as well as provides the default UI for browsing revisions.
|
|
23
|
-
*
|
|
24
|
-
* To learn more about the revision history feature refer to the
|
|
25
|
-
* {@glink features/collaboration/revision-history/revision-history Revision history} guide.
|
|
26
|
-
*/
|
|
27
|
-
export default class RevisionHistory extends Plugin {
|
|
28
|
-
static get pluginName(): "RevisionHistory";
|
|
29
|
-
/**
|
|
30
|
-
* @inheritDoc
|
|
31
|
-
*/
|
|
32
|
-
static get isOfficialPlugin(): true;
|
|
33
|
-
/**
|
|
34
|
-
* @inheritDoc
|
|
35
|
-
*/
|
|
36
|
-
static get isPremiumPlugin(): true;
|
|
37
|
-
static get requires(): readonly [typeof RevisionTracker, typeof RevisionHistoryUI];
|
|
38
|
-
constructor(editor: Editor);
|
|
39
|
-
/**
|
|
40
|
-
* An adapter object that should communicate with the data source to fetch or save the revisions data.
|
|
41
|
-
*/
|
|
42
|
-
set adapter(adapter: RevisionHistoryAdapter | null);
|
|
43
|
-
get adapter(): RevisionHistoryAdapter | null;
|
|
44
|
-
/**
|
|
45
|
-
* Creates a revision basing on given revision data and adds it to the revision tracker and revision repository.
|
|
46
|
-
*
|
|
47
|
-
* The parameter of this method should be an object with revision data. You can receive such an object by calling
|
|
48
|
-
* {@link module:revision-history/revisionhistory~RevisionHistory#getRevisions `RevisionHistory#getRevisions( { toJSON: true } )`}
|
|
49
|
-
* or {@link module:revision-history/revision~Revision#toJSON `Revision#toJSON()`}.
|
|
50
|
-
*
|
|
51
|
-
* ```ts
|
|
52
|
-
* // Get revisions data in an appropriate format.
|
|
53
|
-
* // You can save it in your database.
|
|
54
|
-
* const revisionsData = revisionHistory.getRevisions( { toJSON: true } );
|
|
55
|
-
* // ...
|
|
56
|
-
* // Use revisions data.
|
|
57
|
-
* // That revisions data might be loaded from your database.
|
|
58
|
-
* revisionsData.forEach( revisionData => revisionHistory.addRevisionData( revisionData ) );
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
addRevisionData(revisionData: RevisionJSON): Revision;
|
|
62
|
-
/**
|
|
63
|
-
* Returns the revision with a given revision id or at a given index.
|
|
64
|
-
*/
|
|
65
|
-
getRevision(revisionIdOrIndex: string | number): Revision | null;
|
|
66
|
-
getRevisions(options: {
|
|
67
|
-
toJSON: true;
|
|
68
|
-
}): Array<RevisionJSON>;
|
|
69
|
-
getRevisions(options: {
|
|
70
|
-
toJSON: false;
|
|
71
|
-
}): Array<Revision>;
|
|
72
|
-
getRevisions(options: {
|
|
73
|
-
toJSON: boolean;
|
|
74
|
-
}): Array<Revision> | Array<RevisionJSON>;
|
|
75
|
-
}
|
|
76
|
-
export interface TapeValue {
|
|
77
|
-
id?: number;
|
|
78
|
-
type: 'elementStart' | 'elementEnd' | 'text';
|
|
79
|
-
item: TapeItem;
|
|
80
|
-
previousPosition?: Position;
|
|
81
|
-
nextPosition?: Position;
|
|
82
|
-
isAdded?: {
|
|
83
|
-
userId: string;
|
|
84
|
-
} | boolean;
|
|
85
|
-
isRemoved?: {
|
|
86
|
-
userId: string;
|
|
87
|
-
};
|
|
88
|
-
pairId?: number | null;
|
|
89
|
-
markersStart?: Array<string>;
|
|
90
|
-
markersEnd?: Array<string>;
|
|
91
|
-
isIncorrect?: boolean;
|
|
92
|
-
distance?: number;
|
|
93
|
-
isAddSuggestion?: {
|
|
94
|
-
userId: string;
|
|
95
|
-
type: string;
|
|
96
|
-
name: string;
|
|
97
|
-
};
|
|
98
|
-
isRemoveSuggestion?: {
|
|
99
|
-
userId: string;
|
|
100
|
-
type: string;
|
|
101
|
-
name: string;
|
|
102
|
-
};
|
|
103
|
-
side?: number;
|
|
104
|
-
level?: number;
|
|
105
|
-
index?: number;
|
|
106
|
-
}
|
|
107
|
-
export type TapeItem = Item & {
|
|
108
|
-
name: string;
|
|
109
|
-
startIndex?: number;
|
|
110
|
-
endIndex?: number;
|
|
111
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, 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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module revision-history/revisionhistoryadapter
|
|
11
|
-
* @publicApi
|
|
12
|
-
*/
|
|
13
|
-
import type { RevisionData } from './revision.js';
|
|
14
|
-
/**
|
|
15
|
-
* The revision history adapter.
|
|
16
|
-
*
|
|
17
|
-
* The revision history adapter is an object that communicates asynchronously with the data source to fetch or save
|
|
18
|
-
* the revisions data. It is used internally by the revision history feature whenever revision data is required, a revision is created,
|
|
19
|
-
* or updated.
|
|
20
|
-
*
|
|
21
|
-
* The adapter is optional. See the {@glink features/collaboration/revision-history/revision-history-integration
|
|
22
|
-
* Revision history feature integration} guide to learn more.
|
|
23
|
-
*
|
|
24
|
-
* To set the adapter, overwrite the {@link module:revision-history/revisionhistory~RevisionHistory#adapter `RevisionHistory#adapter`}
|
|
25
|
-
* property.
|
|
26
|
-
*/
|
|
27
|
-
export interface RevisionHistoryAdapter {
|
|
28
|
-
/**
|
|
29
|
-
* Called when the full revision data is required.
|
|
30
|
-
*
|
|
31
|
-
* It should return a promise that resolves with the whole revision data.
|
|
32
|
-
*/
|
|
33
|
-
getRevision(data: {
|
|
34
|
-
revisionId: string;
|
|
35
|
-
channelId: string;
|
|
36
|
-
}): Promise<RevisionData>;
|
|
37
|
-
/**
|
|
38
|
-
* Called when revision(s) data is added or updated.
|
|
39
|
-
*
|
|
40
|
-
* Multiple revisions can be added and updated at the same moment. The method is passed an array with the updated data.
|
|
41
|
-
* Each item in the array is a data object that describes a single revision. Each data object contains revision id. If the revision
|
|
42
|
-
* id does not exist in your data source (database), then a new revision should be created. Otherwise, the existing revision
|
|
43
|
-
* should be updated with passed data.
|
|
44
|
-
*
|
|
45
|
-
* The method should return a promise that is resolved when the update is completed.
|
|
46
|
-
*
|
|
47
|
-
* The `data` parameter only contains those properties of a revision that have changed.
|
|
48
|
-
*
|
|
49
|
-
* Although the `data` parameter contains `createdAt` property,
|
|
50
|
-
* the revision creation date should be set by the backend of your application
|
|
51
|
-
* to ensure that all revisions will be saved with correct dates regardless of users' local system time.
|
|
52
|
-
* It is recommended to overwrite `createdAt` value whenever it is passed in the `data` parameter.
|
|
53
|
-
*
|
|
54
|
-
* The promise may resolve with an array of objects. Each object represents an updated revision, for which `createdAt` property
|
|
55
|
-
* was set (or changed) on the backend. Each object should have `id` (string) and `createdAt` (`Date` object) properties.
|
|
56
|
-
* The returned data will be used to update revisions data in the editor with dates set on the backend.
|
|
57
|
-
*
|
|
58
|
-
* Although the `data` parameter contains `creatorId` property, you should verify the `creatorId` value when saving a revision
|
|
59
|
-
* in the database. **However, do not overwrite the value if it was set to `null`!**
|
|
60
|
-
*
|
|
61
|
-
* It is recommended to stringify `data.diffData` and `data.attributes` values to JSON and save them as strings in your database,
|
|
62
|
-
* and then to parse the strings when loading revisions.
|
|
63
|
-
*
|
|
64
|
-
* @param data Array with revisions data to add or update.
|
|
65
|
-
* @param channelId The ID of the document for which the revisions were created.
|
|
66
|
-
*/
|
|
67
|
-
updateRevisions(data: Array<RevisionData>, channelId: string): Promise<Array<RevisionData>>;
|
|
68
|
-
}
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, 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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* The configuration of the revision history feature.
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* ClassicEditor
|
|
14
|
-
* .create( {
|
|
15
|
-
* revisionHistory: ... // Revision history feature configuration.
|
|
16
|
-
* } )
|
|
17
|
-
* .then( ... )
|
|
18
|
-
* .catch( ... );
|
|
19
|
-
* ```
|
|
20
|
-
*
|
|
21
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
|
22
|
-
*/
|
|
23
|
-
export interface RevisionHistoryConfig {
|
|
24
|
-
/**
|
|
25
|
-
* The DOM element that contains the DOM structure for the editor.
|
|
26
|
-
*
|
|
27
|
-
* This element will be hidden when the user opens the revision history.
|
|
28
|
-
*/
|
|
29
|
-
editorContainer: HTMLElement;
|
|
30
|
-
/**
|
|
31
|
-
* DOM element which contains the DOM structure for revision history viewer.
|
|
32
|
-
*
|
|
33
|
-
* This element should be hidden (using CSS) when the editor is initialized.
|
|
34
|
-
* This element will be shown when the user opens the revision history viewer.
|
|
35
|
-
*/
|
|
36
|
-
viewerContainer: HTMLElement;
|
|
37
|
-
/**
|
|
38
|
-
* The DOM element for the revision history viewer editor instance.
|
|
39
|
-
*
|
|
40
|
-
* This element will be used to initialize the revision history viewer editor instance and will be replaced by it. It should be empty.
|
|
41
|
-
*/
|
|
42
|
-
viewerEditorElement: HTMLElement;
|
|
43
|
-
/**
|
|
44
|
-
* The DOM element for the revision history viewer sidebar container.
|
|
45
|
-
*
|
|
46
|
-
* This element will be used as a container for the revision history viewer. The sidebar content will be inserted into it.
|
|
47
|
-
*/
|
|
48
|
-
viewerSidebarContainer: HTMLElement;
|
|
49
|
-
/**
|
|
50
|
-
* Tells the feature whether it should resume updating previously unsaved revision or should save the previously unsaved revision
|
|
51
|
-
* and create a new revision for the changes that will be introduced after the editor is initialized.
|
|
52
|
-
*
|
|
53
|
-
* By default, the previously unsaved revision is resumed after the editor is initialized.
|
|
54
|
-
*
|
|
55
|
-
* Note that only unsaved revision can be resumed.
|
|
56
|
-
*
|
|
57
|
-
* Note that for real-time collaboration, the unsaved revision will be always resumed if the real-time editing session is still active.
|
|
58
|
-
* 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
|
|
59
|
-
* editor was re-initialized. Keep in mind that
|
|
60
|
-
* {@glink @cs guides/collaboration/data#temporary-and-permanent-data the editing session is active a long time} after the last user
|
|
61
|
-
* leaves the document.
|
|
62
|
-
*/
|
|
63
|
-
resumeUnsavedRevision: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Indicates if the names for revisions should be required. Defaults to `false`.
|
|
66
|
-
*
|
|
67
|
-
* If set to `true`, the user will have to provide a name when saving a new revision.
|
|
68
|
-
* If they try to change the existing revision name to an empty string,
|
|
69
|
-
* the revision name will be reverted to the previous value.
|
|
70
|
-
*
|
|
71
|
-
* It will still be possible to save a revision without a name using the feature API
|
|
72
|
-
* and to load the existing nameless revisions.
|
|
73
|
-
*/
|
|
74
|
-
requireRevisionName?: boolean;
|
|
75
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, 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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module revision-history/revisionsrepository
|
|
11
|
-
* @publicApi
|
|
12
|
-
*/
|
|
13
|
-
import { Users } from 'ckeditor5-collaboration/src/collaboration-core.js';
|
|
14
|
-
import { Plugin, type Editor } from 'ckeditor5/src/core.js';
|
|
15
|
-
import { default as Revision, type RevisionData, type RevisionJSON } from './revision.js';
|
|
16
|
-
/**
|
|
17
|
-
* Manages revisions list.
|
|
18
|
-
*/
|
|
19
|
-
export default class RevisionsRepository extends Plugin {
|
|
20
|
-
static get requires(): readonly [typeof Users];
|
|
21
|
-
static get pluginName(): "RevisionsRepository";
|
|
22
|
-
/**
|
|
23
|
-
* @inheritDoc
|
|
24
|
-
*/
|
|
25
|
-
static get isOfficialPlugin(): true;
|
|
26
|
-
/**
|
|
27
|
-
* @inheritDoc
|
|
28
|
-
*/
|
|
29
|
-
static get isPremiumPlugin(): true;
|
|
30
|
-
get length(): number;
|
|
31
|
-
constructor(editor: Editor);
|
|
32
|
-
/**
|
|
33
|
-
* @inheritDoc
|
|
34
|
-
*/
|
|
35
|
-
afterInit(): void;
|
|
36
|
-
/**
|
|
37
|
-
* Creates a revision instance from plain object with revision data.
|
|
38
|
-
*/
|
|
39
|
-
createRevision(revisionData: RevisionData): Revision;
|
|
40
|
-
/**
|
|
41
|
-
* Adds revision to the repository on a given index.
|
|
42
|
-
*
|
|
43
|
-
* @param revision The revision instance to add.
|
|
44
|
-
* @param index Index on which the revision should be added. If not set, the revision will be added as the first revision.
|
|
45
|
-
*/
|
|
46
|
-
addRevision(revision: Revision, index?: number): void;
|
|
47
|
-
/**
|
|
48
|
-
* Returns the revision with a given revision id or at a given index.
|
|
49
|
-
*/
|
|
50
|
-
getRevision(revisionIdOrIndex: string | number): Revision | null;
|
|
51
|
-
getRevisions(options: {
|
|
52
|
-
toJSON: true;
|
|
53
|
-
}): Array<RevisionJSON>;
|
|
54
|
-
getRevisions(options?: {
|
|
55
|
-
toJSON: false;
|
|
56
|
-
}): Array<Revision>;
|
|
57
|
-
getRevisions(options: {
|
|
58
|
-
toJSON: boolean;
|
|
59
|
-
}): Array<Revision> | Array<RevisionJSON>;
|
|
60
|
-
/**
|
|
61
|
-
* Returns the index of the revision with a given revision id.
|
|
62
|
-
*/
|
|
63
|
-
getIndex(revisionId: string | Revision): number;
|
|
64
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright (c) 2003-2024, 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
|
-
* @license Copyright (c) 2003-2024, CKSource Holding sp. z o.o. All rights reserved.
|
|
7
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-licensing-options
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* @module revision-history/revisiontracker
|
|
11
|
-
* @publicApi
|
|
12
|
-
*/
|
|
13
|
-
import { Users, type CollaborationHistory } from 'ckeditor5-collaboration/src/collaboration-core.js';
|
|
14
|
-
import { Plugin, PendingActions, type Editor } from 'ckeditor5/src/core.js';
|
|
15
|
-
import RevisionsRepository from './revisionsrepository.js';
|
|
16
|
-
import type { RevisionHistoryAdapter } from './revisionhistoryadapter.js';
|
|
17
|
-
import type { default as Revision, RevisionData } from './revision.js';
|
|
18
|
-
/**
|
|
19
|
-
* Creates and updates revisions based on changes of the editor content.
|
|
20
|
-
*
|
|
21
|
-
* There are always at least two revisions available for the document: the initial revision and the current revision.
|
|
22
|
-
* If those revisions have not been created for the document yet, they are created when the editor data is loaded.
|
|
23
|
-
*
|
|
24
|
-
* The initial revision contains the initial document data from when the document was loaded for the first time.
|
|
25
|
-
*
|
|
26
|
-
* The current revision contains all the unsaved document changes, that is changes which have not been saved yet as a specific revision.
|
|
27
|
-
* The current revision is always available and it is always the "top" revision (most recent).
|
|
28
|
-
*/
|
|
29
|
-
export default class RevisionTracker extends Plugin {
|
|
30
|
-
/**
|
|
31
|
-
* An adapter object that should communicate with the data source to fetch or save the revisions data.
|
|
32
|
-
*
|
|
33
|
-
* This property is also set through {@link module:revision-history/revisionhistory~RevisionHistory#adapter}.
|
|
34
|
-
*/
|
|
35
|
-
adapter: RevisionHistoryAdapter | null;
|
|
36
|
-
repository?: RevisionsRepository;
|
|
37
|
-
static get pluginName(): "RevisionTracker";
|
|
38
|
-
/**
|
|
39
|
-
* @inheritDoc
|
|
40
|
-
*/
|
|
41
|
-
static get isOfficialPlugin(): true;
|
|
42
|
-
/**
|
|
43
|
-
* @inheritDoc
|
|
44
|
-
*/
|
|
45
|
-
static get isPremiumPlugin(): true;
|
|
46
|
-
static get requires(): readonly [typeof Users, typeof RevisionsRepository, typeof PendingActions];
|
|
47
|
-
constructor(editor: Editor);
|
|
48
|
-
/**
|
|
49
|
-
* @inheritDoc
|
|
50
|
-
*/
|
|
51
|
-
init(): void;
|
|
52
|
-
afterInit(): Promise<void>;
|
|
53
|
-
/**
|
|
54
|
-
* @inheritDoc
|
|
55
|
-
*/
|
|
56
|
-
destroy(): void;
|
|
57
|
-
/**
|
|
58
|
-
* Adds the new document changes to the current revision.
|
|
59
|
-
*
|
|
60
|
-
* This method should be called before document data and revision data is saved (for example, in the autosave callback).
|
|
61
|
-
*
|
|
62
|
-
* @returns Promise that is resolved after the revision is updated locally (the promise does not wait for the adapter update).
|
|
63
|
-
*/
|
|
64
|
-
update(): Promise<void>;
|
|
65
|
-
private _loadState;
|
|
66
|
-
/**
|
|
67
|
-
* Creates and saves a new revision.
|
|
68
|
-
*
|
|
69
|
-
* ```ts
|
|
70
|
-
* // Saves all the unsaved changes as a revision without a name.
|
|
71
|
-
* const myRevision = await revisionTracker.saveRevision();
|
|
72
|
-
*
|
|
73
|
-
* // Saves all the unsaved changes as a revision named 'My revision'.
|
|
74
|
-
* const myRevision = await revisionTracker.saveRevision( { name: 'My revision' } );
|
|
75
|
-
*
|
|
76
|
-
* // Saves a revision named 'My revision'.
|
|
77
|
-
* // It will include document data with all the changes up to document version `30`.
|
|
78
|
-
* // The revision will be on "top" of the closest revision with a lower document version.
|
|
79
|
-
* // The revision diff will include all the changes since the previous revision up to document version `30`.
|
|
80
|
-
* const myRevision = await revisionTracker.saveRevision( { name: 'My revision' }, 30 );
|
|
81
|
-
* ```
|
|
82
|
-
*
|
|
83
|
-
* A new revision can be created in the middle of the revision history. In such case, already existing revisions will be
|
|
84
|
-
* appropriately updated.
|
|
85
|
-
*
|
|
86
|
-
* Using this method, a revision without a name can be created even if the
|
|
87
|
-
* {@link module:revision-history/revisionhistoryconfig~RevisionHistoryConfig#requireRevisionName `requireRevisionName` }
|
|
88
|
-
* configuration option is set to `true`.
|
|
89
|
-
*
|
|
90
|
-
* @param revisionData Revision data to set on the created revision.
|
|
91
|
-
* @param version {@link module:engine/model/document~Document#version Document version} on which the revision is saved.
|
|
92
|
-
* If not set, the revision will be saved for the current (most recent) document state.
|
|
93
|
-
* @returns Promise that resolves with the created revision after it is saved locally (the promise does not wait for the
|
|
94
|
-
* adapter update).
|
|
95
|
-
*/
|
|
96
|
-
saveRevision(revisionData?: RevisionData, version?: number | null): Promise<Revision>;
|
|
97
|
-
/**
|
|
98
|
-
* Creates a revision basing on given revision data and adds it to the revision tracker and revision repository.
|
|
99
|
-
*/
|
|
100
|
-
addRevisionData(revisionData: RevisionData): Revision;
|
|
101
|
-
/**
|
|
102
|
-
* Returns document data for given revision.
|
|
103
|
-
*
|
|
104
|
-
* The document data is HTML or other format, depending on the editor configuration.
|
|
105
|
-
*
|
|
106
|
-
* This method returns a promise which resolves with an object, where keys are root names and values are these roots' data. Most
|
|
107
|
-
* editor setups use just one root, which has the default name `main`. In this case, the promise will resolve with an object
|
|
108
|
-
* similar to this:
|
|
109
|
-
*
|
|
110
|
-
* ```ts
|
|
111
|
-
* { main: "<p>Sample document data.</p>" }
|
|
112
|
-
* ```
|
|
113
|
-
*
|
|
114
|
-
* Please note, that the data returned by this method uses
|
|
115
|
-
* {@link module:engine/dataprocessor/dataprocessor~DataProcessor#useFillerType marked fillers mode}. This means that some ` `
|
|
116
|
-
* characters in the returned data may be wrapped with `<span data-cke-filler="true"> </span>`. Take this difference into
|
|
117
|
-
* consideration if you plan to compare revision data with the data returned by `editor.getData()`.
|
|
118
|
-
*
|
|
119
|
-
* See also {@link module:revision-history/revisiontracker~RevisionTracker#getRevisionRootsAttributes}.
|
|
120
|
-
*/
|
|
121
|
-
getRevisionDocumentData(revision: Revision): Promise<Record<string, string>>;
|
|
122
|
-
/**
|
|
123
|
-
* Returns roots attributes for given revision.
|
|
124
|
-
*
|
|
125
|
-
* This method returns a promise which resolves with an object, where keys are root names and values are these roots' attributes.
|
|
126
|
-
* Most editor setups use just one root, which has the default name `main`. In this case, the promise will resolve with an object
|
|
127
|
-
* similar to this:
|
|
128
|
-
*
|
|
129
|
-
* ```ts
|
|
130
|
-
* { main: {} }
|
|
131
|
-
* ```
|
|
132
|
-
*
|
|
133
|
-
* See also {@link module:revision-history/revisiontracker~RevisionTracker#getRevisionDocumentData}.
|
|
134
|
-
*/
|
|
135
|
-
getRevisionRootsAttributes(revision: Revision): Promise<Record<string, Record<string, unknown>>>;
|
|
136
|
-
}
|
|
137
|
-
export interface RevisionSource {
|
|
138
|
-
history: CollaborationHistory;
|
|
139
|
-
getLatestVersion: () => Promise<number>;
|
|
140
|
-
getCurrentRevisionId: () => string;
|
|
141
|
-
}
|