@ckeditor/ckeditor5-revision-history 0.0.0-nightly-20241216.0 → 0.0.0-nightly-20241217.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.
Files changed (210) hide show
  1. package/build/revision-history.js +1 -1
  2. package/dist/index.js +5 -7
  3. package/dist/translations/af.js +1 -1
  4. package/dist/translations/af.umd.js +1 -1
  5. package/dist/translations/ar.js +1 -1
  6. package/dist/translations/ar.umd.js +1 -1
  7. package/dist/translations/ast.js +1 -1
  8. package/dist/translations/ast.umd.js +1 -1
  9. package/dist/translations/az.js +1 -1
  10. package/dist/translations/az.umd.js +1 -1
  11. package/dist/translations/bg.js +1 -1
  12. package/dist/translations/bg.umd.js +1 -1
  13. package/dist/translations/bn.js +1 -1
  14. package/dist/translations/bn.umd.js +1 -1
  15. package/dist/translations/bs.js +1 -1
  16. package/dist/translations/bs.umd.js +1 -1
  17. package/dist/translations/ca.js +1 -1
  18. package/dist/translations/ca.umd.js +1 -1
  19. package/dist/translations/cs.js +1 -1
  20. package/dist/translations/cs.umd.js +1 -1
  21. package/dist/translations/da.js +1 -1
  22. package/dist/translations/da.umd.js +1 -1
  23. package/dist/translations/de-ch.js +1 -1
  24. package/dist/translations/de-ch.umd.js +1 -1
  25. package/dist/translations/de.js +1 -1
  26. package/dist/translations/de.umd.js +1 -1
  27. package/dist/translations/el.js +1 -1
  28. package/dist/translations/el.umd.js +1 -1
  29. package/dist/translations/en-au.js +1 -1
  30. package/dist/translations/en-au.umd.js +1 -1
  31. package/dist/translations/en-gb.js +1 -1
  32. package/dist/translations/en-gb.umd.js +1 -1
  33. package/dist/translations/en.js +1 -1
  34. package/dist/translations/en.umd.js +1 -1
  35. package/dist/translations/eo.js +1 -1
  36. package/dist/translations/eo.umd.js +1 -1
  37. package/dist/translations/es-co.js +1 -1
  38. package/dist/translations/es-co.umd.js +1 -1
  39. package/dist/translations/es.js +1 -1
  40. package/dist/translations/es.umd.js +1 -1
  41. package/dist/translations/et.js +1 -1
  42. package/dist/translations/et.umd.js +1 -1
  43. package/dist/translations/eu.js +1 -1
  44. package/dist/translations/eu.umd.js +1 -1
  45. package/dist/translations/fa.js +1 -1
  46. package/dist/translations/fa.umd.js +1 -1
  47. package/dist/translations/fi.js +1 -1
  48. package/dist/translations/fi.umd.js +1 -1
  49. package/dist/translations/fr.js +1 -1
  50. package/dist/translations/fr.umd.js +1 -1
  51. package/dist/translations/gl.js +1 -1
  52. package/dist/translations/gl.umd.js +1 -1
  53. package/dist/translations/gu.js +1 -1
  54. package/dist/translations/gu.umd.js +1 -1
  55. package/dist/translations/he.js +1 -1
  56. package/dist/translations/he.umd.js +1 -1
  57. package/dist/translations/hi.js +1 -1
  58. package/dist/translations/hi.umd.js +1 -1
  59. package/dist/translations/hr.js +1 -1
  60. package/dist/translations/hr.umd.js +1 -1
  61. package/dist/translations/hu.js +1 -1
  62. package/dist/translations/hu.umd.js +1 -1
  63. package/dist/translations/hy.js +1 -1
  64. package/dist/translations/hy.umd.js +1 -1
  65. package/dist/translations/id.js +1 -1
  66. package/dist/translations/id.umd.js +1 -1
  67. package/dist/translations/it.js +1 -1
  68. package/dist/translations/it.umd.js +1 -1
  69. package/dist/translations/ja.js +1 -1
  70. package/dist/translations/ja.umd.js +1 -1
  71. package/dist/translations/jv.js +1 -1
  72. package/dist/translations/jv.umd.js +1 -1
  73. package/dist/translations/kk.js +1 -1
  74. package/dist/translations/kk.umd.js +1 -1
  75. package/dist/translations/km.js +1 -1
  76. package/dist/translations/km.umd.js +1 -1
  77. package/dist/translations/kn.js +1 -1
  78. package/dist/translations/kn.umd.js +1 -1
  79. package/dist/translations/ko.js +1 -1
  80. package/dist/translations/ko.umd.js +1 -1
  81. package/dist/translations/ku.js +1 -1
  82. package/dist/translations/ku.umd.js +1 -1
  83. package/dist/translations/lt.js +1 -1
  84. package/dist/translations/lt.umd.js +1 -1
  85. package/dist/translations/lv.js +1 -1
  86. package/dist/translations/lv.umd.js +1 -1
  87. package/dist/translations/ms.js +1 -1
  88. package/dist/translations/ms.umd.js +1 -1
  89. package/dist/translations/nb.js +1 -1
  90. package/dist/translations/nb.umd.js +1 -1
  91. package/dist/translations/ne.js +1 -1
  92. package/dist/translations/ne.umd.js +1 -1
  93. package/dist/translations/nl.js +1 -1
  94. package/dist/translations/nl.umd.js +1 -1
  95. package/dist/translations/no.js +1 -1
  96. package/dist/translations/no.umd.js +1 -1
  97. package/dist/translations/oc.js +1 -1
  98. package/dist/translations/oc.umd.js +1 -1
  99. package/dist/translations/pl.js +1 -1
  100. package/dist/translations/pl.umd.js +1 -1
  101. package/dist/translations/pt-br.js +1 -1
  102. package/dist/translations/pt-br.umd.js +1 -1
  103. package/dist/translations/pt.js +1 -1
  104. package/dist/translations/pt.umd.js +1 -1
  105. package/dist/translations/ro.js +1 -1
  106. package/dist/translations/ro.umd.js +1 -1
  107. package/dist/translations/ru.js +1 -1
  108. package/dist/translations/ru.umd.js +1 -1
  109. package/dist/translations/si.js +1 -1
  110. package/dist/translations/si.umd.js +1 -1
  111. package/dist/translations/sk.js +1 -1
  112. package/dist/translations/sk.umd.js +1 -1
  113. package/dist/translations/sl.js +1 -1
  114. package/dist/translations/sl.umd.js +1 -1
  115. package/dist/translations/sq.js +1 -1
  116. package/dist/translations/sq.umd.js +1 -1
  117. package/dist/translations/sr-latn.js +1 -1
  118. package/dist/translations/sr-latn.umd.js +1 -1
  119. package/dist/translations/sr.js +1 -1
  120. package/dist/translations/sr.umd.js +1 -1
  121. package/dist/translations/sv.js +1 -1
  122. package/dist/translations/sv.umd.js +1 -1
  123. package/dist/translations/th.js +1 -1
  124. package/dist/translations/th.umd.js +1 -1
  125. package/dist/translations/ti.js +1 -1
  126. package/dist/translations/ti.umd.js +1 -1
  127. package/dist/translations/tk.js +1 -1
  128. package/dist/translations/tk.umd.js +1 -1
  129. package/dist/translations/tr.js +1 -1
  130. package/dist/translations/tr.umd.js +1 -1
  131. package/dist/translations/tt.js +1 -1
  132. package/dist/translations/tt.umd.js +1 -1
  133. package/dist/translations/ug.js +1 -1
  134. package/dist/translations/ug.umd.js +1 -1
  135. package/dist/translations/uk.js +1 -1
  136. package/dist/translations/uk.umd.js +1 -1
  137. package/dist/translations/ur.js +1 -1
  138. package/dist/translations/ur.umd.js +1 -1
  139. package/dist/translations/uz.js +1 -1
  140. package/dist/translations/uz.umd.js +1 -1
  141. package/dist/translations/vi.js +1 -1
  142. package/dist/translations/vi.umd.js +1 -1
  143. package/dist/translations/zh-cn.js +1 -1
  144. package/dist/translations/zh-cn.umd.js +1 -1
  145. package/dist/translations/zh.js +1 -1
  146. package/dist/translations/zh.umd.js +1 -1
  147. package/package.json +27 -8
  148. package/src/changeitem.js +2 -2
  149. package/src/editor/revisionviewereditor.js +2 -2
  150. package/src/editor/revisionviewereditorui.js +1 -1
  151. package/src/editor/revisionviewereditoruiview.js +1 -1
  152. package/src/index.js +1 -1
  153. package/src/revision.js +2 -2
  154. package/src/revisiondiff.js +1 -1
  155. package/src/revisionhistory.js +1 -1
  156. package/src/revisionsrepository.js +1 -1
  157. package/src/revisiontracker.js +1 -1
  158. package/src/revisionviewer.js +1 -1
  159. package/src/ui/revision/createrevisionactionsdropdown.js +1 -1
  160. package/src/ui/revision/revisionauthorview.js +1 -1
  161. package/src/ui/revision/revisionnameview.js +1 -1
  162. package/src/ui/revision/revisionview.js +2 -2
  163. package/src/ui/revision/subrevisioncollapserview.js +1 -1
  164. package/src/ui/revision/subrevisionview.js +1 -1
  165. package/src/ui/revision/utils.js +1 -1
  166. package/src/ui/revisionhistory/revisionhistorysaverevisionformview.js +1 -1
  167. package/src/ui/revisionhistory/revisionhistoryui.js +1 -1
  168. package/src/ui/revisionssidebar/revisionssidebar.js +1 -1
  169. package/src/ui/revisionssidebar/revisionssidebarheaderview.js +1 -1
  170. package/src/ui/revisionssidebar/revisionssidebartimeperiodview.js +1 -1
  171. package/src/ui/revisionssidebar/revisionssidebarview.js +1 -1
  172. package/src/ui/revisionssidebar/utils.js +1 -1
  173. package/src/ui/revisionviewer/changedetailsview.js +1 -1
  174. package/src/ui/revisionviewer/changesnavigationview.js +1 -1
  175. package/src/ui/revisionviewer/revisionviewerloadingoverlay.js +1 -1
  176. package/src/ui/revisionviewer/revisionviewerui.js +1 -1
  177. package/src/utils/common-translations.js +1 -1
  178. package/dist/augmentation.d.ts +0 -33
  179. package/dist/changeitem.d.ts +0 -62
  180. package/dist/editor/revisionviewereditor.d.ts +0 -31
  181. package/dist/editor/revisionviewereditorui.d.ts +0 -32
  182. package/dist/editor/revisionviewereditoruiview.d.ts +0 -47
  183. package/dist/index.d.ts +0 -20
  184. package/dist/revision.d.ts +0 -157
  185. package/dist/revisiondiff.d.ts +0 -28
  186. package/dist/revisionhistory.d.ts +0 -111
  187. package/dist/revisionhistoryadapter.d.ts +0 -68
  188. package/dist/revisionhistoryconfig.d.ts +0 -75
  189. package/dist/revisionsrepository.d.ts +0 -64
  190. package/dist/revisiontracker.d.ts +0 -141
  191. package/dist/revisionviewer.d.ts +0 -119
  192. package/dist/ui/revision/createrevisionactionsdropdown.d.ts +0 -17
  193. package/dist/ui/revision/revisionauthorview.d.ts +0 -18
  194. package/dist/ui/revision/revisionnameview.d.ts +0 -34
  195. package/dist/ui/revision/revisionview.d.ts +0 -99
  196. package/dist/ui/revision/subrevisioncollapserview.d.ts +0 -25
  197. package/dist/ui/revision/subrevisionview.d.ts +0 -38
  198. package/dist/ui/revision/utils.d.ts +0 -9
  199. package/dist/ui/revisionhistory/revisionhistorysaverevisionformview.d.ts +0 -61
  200. package/dist/ui/revisionhistory/revisionhistoryui.d.ts +0 -38
  201. package/dist/ui/revisionssidebar/revisionssidebar.d.ts +0 -56
  202. package/dist/ui/revisionssidebar/revisionssidebarheaderview.d.ts +0 -20
  203. package/dist/ui/revisionssidebar/revisionssidebartimeperiodview.d.ts +0 -33
  204. package/dist/ui/revisionssidebar/revisionssidebarview.d.ts +0 -48
  205. package/dist/ui/revisionssidebar/utils.d.ts +0 -13
  206. package/dist/ui/revisionviewer/changedetailsview.d.ts +0 -26
  207. package/dist/ui/revisionviewer/changesnavigationview.d.ts +0 -44
  208. package/dist/ui/revisionviewer/revisionviewerloadingoverlay.d.ts +0 -38
  209. package/dist/ui/revisionviewer/revisionviewerui.d.ts +0 -40
  210. package/dist/utils/common-translations.d.ts +0 -15
@@ -1,31 +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/editor/revisionviewereditor
11
- */
12
- import { Editor, type EditorConfig } from 'ckeditor5/src/core.js';
13
- import RevisionViewerEditorUI from './revisionviewereditorui.js';
14
- declare const RevisionViewerEditor_base: import("@ckeditor/ckeditor5-utils").Mixed<typeof Editor, import("ckeditor5/src/core.js").ElementApi>;
15
- /**
16
- * Editor class used to show revision comparisons.
17
- */
18
- export default class RevisionViewerEditor extends /* #__PURE__ -- @preserve */ RevisionViewerEditor_base {
19
- get ui(): RevisionViewerEditorUI;
20
- /**
21
- * @param sourceElement Editor source element.
22
- * @param config Editor configuration.
23
- */
24
- constructor(sourceElement: HTMLElement, config?: EditorConfig);
25
- /**
26
- * @inheritDoc
27
- */
28
- destroy(): Promise<unknown>;
29
- static create(sourceElement: HTMLElement, config?: EditorConfig): Promise<RevisionViewerEditor>;
30
- }
31
- export {};
@@ -1,32 +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/editor/revisionviewereditorui
11
- */
12
- import type { Editor } from 'ckeditor5/src/core.js';
13
- import { EditorUI } from 'ckeditor5/src/ui.js';
14
- import type RevisionViewerEditorUIView from './revisionviewereditoruiview.js';
15
- export default class RevisionViewerEditorUI extends EditorUI {
16
- get view(): RevisionViewerEditorUIView;
17
- constructor(editor: Editor, view: RevisionViewerEditorUIView);
18
- /**
19
- * @inheritDoc
20
- */
21
- get element(): HTMLElement | null;
22
- /**
23
- * Initializes the UI.
24
- *
25
- * @param replacementElement The DOM element that will be the source for the created editor.
26
- */
27
- init(replacementElement: HTMLElement): void;
28
- /**
29
- * @inheritDoc
30
- */
31
- destroy(): void;
32
- }
@@ -1,47 +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/editor/revisionviewereditoruiview
11
- */
12
- import { BoxedEditorUIView, InlineEditableUIView, StickyPanelView, ToolbarView } from 'ckeditor5/src/ui.js';
13
- import type { EditingView } from 'ckeditor5/src/engine.js';
14
- import type { Locale } from 'ckeditor5/src/utils.js';
15
- import '@ckeditor/ckeditor5-editor-classic/theme/classiceditor.css';
16
- export default class RevisionViewerEditorUIView extends BoxedEditorUIView {
17
- /**
18
- * Sticky panel view instance. This is a parent view of a {@link #toolbar}
19
- * that makes toolbar sticky.
20
- */
21
- readonly stickyPanel: StickyPanelView;
22
- /**
23
- * Toolbar view instance.
24
- */
25
- readonly toolbar: ToolbarView;
26
- get editable(): InlineEditableUIView;
27
- /**
28
- * Creates an instance of the classic editor UI view.
29
- *
30
- * @param locale The {@link module:core/editor/editor~Editor#locale} instance.
31
- * @param editingView The editing view instance this view is related to.
32
- * @param options Configuration options for the view instance.
33
- */
34
- constructor(locale: Locale, editingView: EditingView, options?: RevisionViewerEditorUIViewOptions);
35
- /**
36
- * @inheritDoc
37
- */
38
- render(): void;
39
- }
40
- export interface RevisionViewerEditorUIViewOptions {
41
- /**
42
- * When set `true` enables automatic items grouping
43
- * in the main {@link module:editor-classic/classiceditoruiview~ClassicEditorUIView#toolbar toolbar}.
44
- * See {@link module:ui/toolbar/toolbarview~ToolbarOptions#shouldGroupWhenFull} to learn more.
45
- */
46
- shouldToolbarGroupWhenFull?: boolean;
47
- }
package/dist/index.d.ts DELETED
@@ -1,20 +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
- export { default as Revision } from './revision.js';
10
- export { default as RevisionHistory } from './revisionhistory.js';
11
- export { default as RevisionsRepository } from './revisionsrepository.js';
12
- export { default as RevisionViewerLoadingOverlay } from './ui/revisionviewer/revisionviewerloadingoverlay.js';
13
- export { default as RevisionHistoryUI } from './ui/revisionhistory/revisionhistoryui.js';
14
- export { default as RevisionTracker } from './revisiontracker.js';
15
- export { default as RevisionViewer, type RestoreRevisionCommand, type ShowChangeCommand } from './revisionviewer.js';
16
- export { default as RevisionsSidebar } from './ui/revisionssidebar/revisionssidebar.js';
17
- export { default as RevisionViewerUI } from './ui/revisionviewer/revisionviewerui.js';
18
- export type { RevisionData } from './revision.js';
19
- export type { RevisionHistoryConfig } from './revisionhistoryconfig.js';
20
- import './augmentation.js';
@@ -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 {};
@@ -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
- }