@ckeditor/ckeditor5-revision-history 39.0.1 → 40.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/LICENSE.md +6 -6
  2. package/README.md +11 -11
  3. package/build/revision-history.js +1 -1
  4. package/ckeditor5-metadata.json +1 -1
  5. package/lang/translations/af.po +1 -0
  6. package/lang/translations/ar.po +1 -0
  7. package/lang/translations/az.po +1 -0
  8. package/lang/translations/bg.po +1 -0
  9. package/lang/translations/bn.po +1 -0
  10. package/lang/translations/bs.po +1 -0
  11. package/lang/translations/ca.po +1 -0
  12. package/lang/translations/cs.po +1 -0
  13. package/lang/translations/da.po +1 -0
  14. package/lang/translations/de-ch.po +1 -0
  15. package/lang/translations/de.po +1 -0
  16. package/lang/translations/el.po +1 -0
  17. package/lang/translations/en-au.po +1 -0
  18. package/lang/translations/en-gb.po +1 -0
  19. package/lang/translations/en.po +1 -0
  20. package/lang/translations/es-co.po +1 -0
  21. package/lang/translations/es.po +1 -0
  22. package/lang/translations/et.po +1 -0
  23. package/lang/translations/fa.po +1 -0
  24. package/lang/translations/fi.po +1 -0
  25. package/lang/translations/fr.po +1 -0
  26. package/lang/translations/gl.po +1 -0
  27. package/lang/translations/he.po +1 -0
  28. package/lang/translations/hi.po +1 -0
  29. package/lang/translations/hr.po +1 -0
  30. package/lang/translations/hu.po +1 -0
  31. package/lang/translations/id.po +1 -0
  32. package/lang/translations/it.po +1 -0
  33. package/lang/translations/ja.po +1 -0
  34. package/lang/translations/jv.po +1 -0
  35. package/lang/translations/ko.po +1 -0
  36. package/lang/translations/ku.po +1 -0
  37. package/lang/translations/lt.po +1 -0
  38. package/lang/translations/lv.po +1 -0
  39. package/lang/translations/ms.po +1 -0
  40. package/lang/translations/ne.po +1 -0
  41. package/lang/translations/nl.po +1 -0
  42. package/lang/translations/no.po +1 -0
  43. package/lang/translations/pl.po +1 -0
  44. package/lang/translations/pt-br.po +1 -0
  45. package/lang/translations/pt.po +1 -0
  46. package/lang/translations/ro.po +1 -0
  47. package/lang/translations/ru.po +1 -0
  48. package/lang/translations/sk.po +1 -0
  49. package/lang/translations/sr-latn.po +1 -0
  50. package/lang/translations/sr.po +1 -0
  51. package/lang/translations/sv.po +1 -0
  52. package/lang/translations/th.po +1 -0
  53. package/lang/translations/tk.po +1 -0
  54. package/lang/translations/tr.po +1 -0
  55. package/lang/translations/tt.po +1 -0
  56. package/lang/translations/ug.po +1 -0
  57. package/lang/translations/uk.po +1 -0
  58. package/lang/translations/ur.po +1 -0
  59. package/lang/translations/vi.po +1 -0
  60. package/lang/translations/zh-cn.po +1 -0
  61. package/lang/translations/zh.po +1 -0
  62. package/package.json +6 -10
  63. package/src/augmentation.d.ts +29 -29
  64. package/src/changeitem.d.ts +58 -58
  65. package/src/changeitem.js +1 -1
  66. package/src/editor/revisionviewereditor.d.ts +27 -27
  67. package/src/editor/revisionviewereditor.js +1 -1
  68. package/src/editor/revisionviewereditorui.d.ts +28 -28
  69. package/src/editor/revisionviewereditorui.js +1 -1
  70. package/src/editor/revisionviewereditoruiview.d.ts +43 -43
  71. package/src/editor/revisionviewereditoruiview.js +1 -1
  72. package/src/index.d.ts +15 -15
  73. package/src/revision.d.ts +153 -153
  74. package/src/revision.js +1 -1
  75. package/src/revisiondiff.d.ts +24 -24
  76. package/src/revisiondiff.js +1 -1
  77. package/src/revisionhistory.d.ts +99 -99
  78. package/src/revisionhistory.js +1 -1
  79. package/src/revisionhistoryadapter.d.ts +64 -64
  80. package/src/revisionhistoryconfig.d.ts +60 -60
  81. package/src/revisionsrepository.d.ts +52 -52
  82. package/src/revisionsrepository.js +1 -1
  83. package/src/revisiontracker.d.ts +81 -81
  84. package/src/revisiontracker.js +1 -1
  85. package/src/revisionviewer.d.ts +25 -25
  86. package/src/revisionviewer.js +1 -1
  87. package/src/ui/revision/createrevisionactionsdropdown.d.ts +10 -10
  88. package/src/ui/revision/createrevisionactionsdropdown.js +1 -1
  89. package/src/ui/revision/revisionauthorview.d.ts +5 -5
  90. package/src/ui/revision/revisionauthorview.js +1 -1
  91. package/src/ui/revision/revisionnameview.d.ts +5 -5
  92. package/src/ui/revision/revisionnameview.js +1 -1
  93. package/src/ui/revision/revisionview.d.ts +95 -95
  94. package/src/ui/revision/revisionview.js +1 -1
  95. package/src/ui/revision/subrevisioncollapserview.d.ts +21 -21
  96. package/src/ui/revision/subrevisioncollapserview.js +1 -1
  97. package/src/ui/revision/subrevisionview.d.ts +34 -34
  98. package/src/ui/revision/subrevisionview.js +1 -1
  99. package/src/ui/revision/utils.d.ts +5 -5
  100. package/src/ui/revision/utils.js +1 -1
  101. package/src/ui/revisionhistory/revisionhistorysaverevisionformview.d.ts +81 -81
  102. package/src/ui/revisionhistory/revisionhistorysaverevisionformview.js +1 -1
  103. package/src/ui/revisionhistory/revisionhistoryui.d.ts +26 -26
  104. package/src/ui/revisionhistory/revisionhistoryui.js +1 -1
  105. package/src/ui/revisionssidebar/revisionssidebar.d.ts +44 -44
  106. package/src/ui/revisionssidebar/revisionssidebar.js +1 -1
  107. package/src/ui/revisionssidebar/revisionssidebarheaderview.d.ts +5 -5
  108. package/src/ui/revisionssidebar/revisionssidebarheaderview.js +1 -1
  109. package/src/ui/revisionssidebar/revisionssidebartimeperiodview.d.ts +29 -29
  110. package/src/ui/revisionssidebar/revisionssidebartimeperiodview.js +1 -1
  111. package/src/ui/revisionssidebar/revisionssidebarview.d.ts +44 -44
  112. package/src/ui/revisionssidebar/revisionssidebarview.js +1 -1
  113. package/src/ui/revisionssidebar/utils.d.ts +9 -9
  114. package/src/ui/revisionssidebar/utils.js +1 -1
  115. package/src/ui/revisionviewer/changedetailsview.d.ts +22 -22
  116. package/src/ui/revisionviewer/changedetailsview.js +1 -1
  117. package/src/ui/revisionviewer/changesnavigationview.d.ts +40 -40
  118. package/src/ui/revisionviewer/changesnavigationview.js +1 -1
  119. package/src/ui/revisionviewer/revisionviewerloadingoverlay.d.ts +26 -26
  120. package/src/ui/revisionviewer/revisionviewerloadingoverlay.js +1 -1
  121. package/src/ui/revisionviewer/revisionviewerui.d.ts +28 -28
  122. package/src/ui/revisionviewer/revisionviewerui.js +1 -1
  123. package/src/utils/common-translations.d.ts +11 -11
  124. package/src/utils/common-translations.js +1 -1
  125. package/theme/changesnavigation.css +9 -0
  126. package/theme/revision/revision.css +9 -0
  127. package/theme/revision/revisionactions.css +11 -0
  128. package/theme/revision/revisionauthor.css +9 -0
  129. package/theme/revision/revisionname.css +9 -0
  130. package/theme/revision/subrevision.css +9 -0
  131. package/theme/revision/subrevisioncollapser.css +9 -0
  132. package/theme/revisionhistorysaverevisionform.css +5 -1
  133. package/theme/revisionssidebar/revisionssidebar.css +9 -0
  134. package/theme/revisionssidebar/revisionssidebarheader.css +9 -0
  135. package/theme/revisionssidebar/revisionssidebartimeperiod.css +9 -0
  136. package/theme/revisionviewer.css +9 -0
  137. package/theme/revisionviewerloadingoverlay.css +9 -0
package/src/revision.d.ts CHANGED
@@ -1,153 +1,153 @@
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
- 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 {};
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
+ 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 _0x5a6f=['creator','_update','attributes','createdAt','fromVersion','fire','setAttribute','map','removeAttribute','diffData','set','authors','toVersion','authorsIds','creatorId','name'];(function(_0x2dbc9c,_0x5a6fac){const _0x161bf=function(_0xcbb1f6){while(--_0xcbb1f6){_0x2dbc9c['push'](_0x2dbc9c['shift']());}};_0x161bf(++_0x5a6fac);}(_0x5a6f,0x124));const _0x161b=function(_0x2dbc9c,_0x5a6fac){_0x2dbc9c=_0x2dbc9c-0x0;let _0x161bf=_0x5a6f[_0x2dbc9c];return _0x161bf;};import{ObservableMixin as _0x21f89a,uid as _0x22dee8}from'ckeditor5/src/utils';import{cloneDeep as _0x571ce3,set as _0x1c4de1,unset as _0x331e54}from'lodash-es';export default class a extends _0x21f89a(){constructor(_0x1964bc){super(),this['id']=_0x1964bc['id']||_0x22dee8(),this['creator']=_0x1964bc[_0x161b('0xc')]||null,this[_0x161b('0x7')]=_0x1964bc[_0x161b('0x7')]||[],this[_0x161b('0x5')]=_0x1964bc['diffData']||null,this[_0x161b('0x8')]=_0x1964bc[_0x161b('0x8')]||0x0,this[_0x161b('0x0')]=_0x1964bc[_0x161b('0x0')]||0x0,this[_0x161b('0x6')](_0x161b('0xb'),_0x1964bc[_0x161b('0xb')]||''),this[_0x161b('0x6')]('createdAt',_0x1964bc[_0x161b('0xf')]||new Date()),this[_0x161b('0x6')](_0x161b('0xe'),_0x1964bc[_0x161b('0xe')]||{});}['setName'](_0x168f72){this[_0x161b('0xd')]({'name':_0x168f72});}[_0x161b('0x2')](_0x528e3a,_0x3fd551){const _0x5c067f=_0x571ce3(this[_0x161b('0xe')]);_0x1c4de1(_0x5c067f,_0x528e3a,_0x3fd551),this[_0x161b('0xd')]({'attributes':_0x5c067f});}[_0x161b('0x4')](_0x3cd6d7){const _0x3e57aa=_0x571ce3(this[_0x161b('0xe')]);_0x331e54(_0x3e57aa,_0x3cd6d7),this['_update']({'attributes':_0x3e57aa});}[_0x161b('0xd')](_0x40d3ab,_0x174fc3=!0x1){let _0x367713=!0x1;const _0x55748e={'id':this['id']},_0x566796=['name',_0x161b('0xf'),'diffData',_0x161b('0x7'),'attributes',_0x161b('0x8'),_0x161b('0x0'),_0x161b('0xa')];for(const _0x94e2de of _0x566796){const _0x26d799=_0x40d3ab[_0x94e2de];void 0x0!==_0x26d799&&_0x26d799!==this[_0x94e2de]&&(this[_0x94e2de]=_0x26d799,_0x55748e[_0x94e2de]=_0x26d799,_0x367713=!0x0);}_0x367713&&(_0x55748e[_0x161b('0x7')]&&(_0x55748e[_0x161b('0x9')]=_0x55748e[_0x161b('0x7')][_0x161b('0x3')](_0x29cff1=>_0x29cff1['id']),delete _0x55748e['authors']),this[_0x161b('0x1')](_0x161b('0xd'),_0x55748e,_0x174fc3));}['toJSON'](){return{'id':this['id'],'name':this['name'],'creatorId':this[_0x161b('0xc')]?this['creator']['id']:null,'authorsIds':this[_0x161b('0x7')]['map'](_0x42f1a2=>_0x42f1a2['id']),'diffData':this['diffData'],'createdAt':this[_0x161b('0xf')],'attributes':this['attributes'],'fromVersion':this[_0x161b('0x0')],'toVersion':this[_0x161b('0x8')]};}}
23
+ const _0x12cc=['setAttribute','_update','setName','createdAt','map','diffData','fromVersion','name','authorsIds','toVersion','attributes','creatorId','authors','removeAttribute','set','creator'];(function(_0x46dff7,_0x12cc0f){const _0x4ca94c=function(_0x29bedf){while(--_0x29bedf){_0x46dff7['push'](_0x46dff7['shift']());}};_0x4ca94c(++_0x12cc0f);}(_0x12cc,0x18e));const _0x4ca9=function(_0x46dff7,_0x12cc0f){_0x46dff7=_0x46dff7-0x0;let _0x4ca94c=_0x12cc[_0x46dff7];return _0x4ca94c;};import{ObservableMixin as _0x3fef7e,uid as _0x168a4d}from'ckeditor5/src/utils';import{cloneDeep as _0x5aae24,set as _0xa0d48b,unset as _0x32a210}from'lodash-es';export default class a extends _0x3fef7e(){constructor(_0x3d4f89){super(),this['id']=_0x3d4f89['id']||_0x168a4d(),this['creator']=_0x3d4f89[_0x4ca9('0x1')]||null,this[_0x4ca9('0xe')]=_0x3d4f89[_0x4ca9('0xe')]||[],this[_0x4ca9('0x7')]=_0x3d4f89['diffData']||null,this[_0x4ca9('0xb')]=_0x3d4f89[_0x4ca9('0xb')]||0x0,this[_0x4ca9('0x8')]=_0x3d4f89[_0x4ca9('0x8')]||0x0,this[_0x4ca9('0x0')]('name',_0x3d4f89[_0x4ca9('0x9')]||''),this['set']('createdAt',_0x3d4f89[_0x4ca9('0x5')]||new Date()),this[_0x4ca9('0x0')](_0x4ca9('0xc'),_0x3d4f89['attributes']||{});}[_0x4ca9('0x4')](_0x1c29e4){this[_0x4ca9('0x3')]({'name':_0x1c29e4});}[_0x4ca9('0x2')](_0xc477b1,_0x4220a6){const _0x33f19f=_0x5aae24(this[_0x4ca9('0xc')]);_0xa0d48b(_0x33f19f,_0xc477b1,_0x4220a6),this[_0x4ca9('0x3')]({'attributes':_0x33f19f});}[_0x4ca9('0xf')](_0x1fb1e6){const _0x261647=_0x5aae24(this[_0x4ca9('0xc')]);_0x32a210(_0x261647,_0x1fb1e6),this[_0x4ca9('0x3')]({'attributes':_0x261647});}[_0x4ca9('0x3')](_0x50b982,_0x964490=!0x1){let _0x3579bd=!0x1;const _0x510c69={'id':this['id']},_0x13d190=['name','createdAt',_0x4ca9('0x7'),_0x4ca9('0xe'),_0x4ca9('0xc'),'toVersion','fromVersion',_0x4ca9('0xd')];for(const _0xa9df0b of _0x13d190){const _0x356476=_0x50b982[_0xa9df0b];void 0x0!==_0x356476&&_0x356476!==this[_0xa9df0b]&&(this[_0xa9df0b]=_0x356476,_0x510c69[_0xa9df0b]=_0x356476,_0x3579bd=!0x0);}_0x3579bd&&(_0x510c69[_0x4ca9('0xe')]&&(_0x510c69[_0x4ca9('0xa')]=_0x510c69['authors']['map'](_0x1008c5=>_0x1008c5['id']),delete _0x510c69[_0x4ca9('0xe')]),this['fire'](_0x4ca9('0x3'),_0x510c69,_0x964490));}['toJSON'](){return{'id':this['id'],'name':this['name'],'creatorId':this[_0x4ca9('0x1')]?this[_0x4ca9('0x1')]['id']:null,'authorsIds':this[_0x4ca9('0xe')][_0x4ca9('0x6')](_0x26912e=>_0x26912e['id']),'diffData':this[_0x4ca9('0x7')],'createdAt':this[_0x4ca9('0x5')],'attributes':this[_0x4ca9('0xc')],'fromVersion':this[_0x4ca9('0x8')],'toVersion':this[_0x4ca9('0xb')]};}}
@@ -1,24 +1,24 @@
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/revisiondiff
7
- */
8
- import { Collection } from 'ckeditor5/src/utils';
9
- import type { DocumentFragment } from 'ckeditor5/src/engine';
10
- import type ChangeItem from './changeitem';
11
- /**
12
- * Represents a difference between two document revisions.
13
- */
14
- export default class RevisionDiff {
15
- readonly newRevisionId: string;
16
- readonly oldRevisionId: string;
17
- readonly changes: Collection<ChangeItem>;
18
- constructor(newRevisionId: string, oldRevisionId: string);
19
- }
20
- export interface DiffData {
21
- model: Record<string, DocumentFragment>;
22
- attributes: Record<string, Record<string, unknown>>;
23
- changes: Array<ChangeItem>;
24
- }
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/revisiondiff
7
+ */
8
+ import { Collection } from 'ckeditor5/src/utils';
9
+ import type { DocumentFragment } from 'ckeditor5/src/engine';
10
+ import type ChangeItem from './changeitem';
11
+ /**
12
+ * Represents a difference between two document revisions.
13
+ */
14
+ export default class RevisionDiff {
15
+ readonly newRevisionId: string;
16
+ readonly oldRevisionId: string;
17
+ readonly changes: Collection<ChangeItem>;
18
+ constructor(newRevisionId: string, oldRevisionId: string);
19
+ }
20
+ export interface DiffData {
21
+ model: Record<string, DocumentFragment>;
22
+ attributes: Record<string, Record<string, unknown>>;
23
+ changes: Array<ChangeItem>;
24
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x1487=['_setChanges','newRevisionId','changes','add'];(function(_0x24653e,_0x148735){const _0x2e7f53=function(_0x4a8c3c){while(--_0x4a8c3c){_0x24653e['push'](_0x24653e['shift']());}};_0x2e7f53(++_0x148735);}(_0x1487,0xfd));const _0x2e7f=function(_0x24653e,_0x148735){_0x24653e=_0x24653e-0x0;let _0x2e7f53=_0x1487[_0x24653e];return _0x2e7f53;};import{Collection as _0x214a08}from'ckeditor5/src/utils';export default class f{constructor(_0x5bbacc,_0x9b4999){this[_0x2e7f('0x0')]=_0x5bbacc,this['oldRevisionId']=_0x9b4999,this[_0x2e7f('0x1')]=new _0x214a08();}[_0x2e7f('0x3')](_0x5efbdc){for(const _0x293b84 of _0x5efbdc)this['changes'][_0x2e7f('0x2')](_0x293b84);}}
23
+ const _0x48ba=['changes','add','_setChanges','newRevisionId'];(function(_0x2e6e8f,_0x48ba71){const _0x2418e1=function(_0x2b477f){while(--_0x2b477f){_0x2e6e8f['push'](_0x2e6e8f['shift']());}};_0x2418e1(++_0x48ba71);}(_0x48ba,0x127));const _0x2418=function(_0x2e6e8f,_0x48ba71){_0x2e6e8f=_0x2e6e8f-0x0;let _0x2418e1=_0x48ba[_0x2e6e8f];return _0x2418e1;};import{Collection as _0xcf340e}from'ckeditor5/src/utils';export default class f{constructor(_0x39c5f1,_0x5c167b){this[_0x2418('0x0')]=_0x39c5f1,this['oldRevisionId']=_0x5c167b,this[_0x2418('0x1')]=new _0xcf340e();}[_0x2418('0x3')](_0x180de3){for(const _0x2cc9c7 of _0x180de3)this['changes'][_0x2418('0x2')](_0x2cc9c7);}}
@@ -1,99 +1,99 @@
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/revisionhistory
7
- * @publicApi
8
- */
9
- import { Plugin, type Editor } from 'ckeditor5/src/core';
10
- import type { Item, Position } from 'ckeditor5/src/engine';
11
- import RevisionTracker from './revisiontracker';
12
- import RevisionHistoryUI from './ui/revisionhistory/revisionhistoryui';
13
- import type { default as Revision, RevisionJSON } from './revision';
14
- import type { RevisionHistoryAdapter } from './revisionhistoryadapter';
15
- /**
16
- * The revision history feature.
17
- *
18
- * Enables tracking and bundling changes into revisions as well as provides the default UI for browsing revisions.
19
- *
20
- * To learn more about the revision history feature refer to the
21
- * {@glink features/collaboration/revision-history/revision-history Revision history} guide.
22
- */
23
- export default class RevisionHistory extends Plugin {
24
- static get pluginName(): "RevisionHistory";
25
- static get requires(): readonly [typeof RevisionTracker, typeof RevisionHistoryUI];
26
- constructor(editor: Editor);
27
- /**
28
- * An adapter object that should communicate with the data source to fetch or save the revisions data.
29
- */
30
- set adapter(adapter: RevisionHistoryAdapter | null);
31
- get adapter(): RevisionHistoryAdapter | null;
32
- /**
33
- * Creates a revision basing on given revision data and adds it to the revision tracker and revision repository.
34
- *
35
- * The parameter of this method should be an object with revision data. You can receive such an object by calling
36
- * {@link module:revision-history/revisionhistory~RevisionHistory#getRevisions `RevisionHistory#getRevisions( { toJSON: true } )`}
37
- * or {@link module:revision-history/revision~Revision#toJSON `Revision#toJSON()`}.
38
- *
39
- * ```ts
40
- * // Get revisions data in an appropriate format.
41
- * // You can save it in your database.
42
- * const revisionsData = revisionHistory.getRevisions( { toJSON: true } );
43
- * // ...
44
- * // Use revisions data.
45
- * // That revisions data might be loaded from your database.
46
- * revisionsData.forEach( revisionData => revisionHistory.addRevisionData( revisionData ) );
47
- * ```
48
- */
49
- addRevisionData(revisionData: RevisionJSON): Revision;
50
- /**
51
- * Returns the revision with a given revision id or at a given index.
52
- */
53
- getRevision(revisionIdOrIndex: string | number): Revision | null;
54
- getRevisions(options: {
55
- toJSON: true;
56
- }): Array<RevisionJSON>;
57
- getRevisions(options: {
58
- toJSON: false;
59
- }): Array<Revision>;
60
- getRevisions(options: {
61
- toJSON: boolean;
62
- }): Array<Revision> | Array<RevisionJSON>;
63
- }
64
- export interface TapeValue {
65
- id?: number;
66
- type: 'elementStart' | 'elementEnd' | 'text';
67
- item: TapeItem;
68
- previousPosition?: Position;
69
- nextPosition?: Position;
70
- isAdded?: {
71
- userId: string;
72
- } | boolean;
73
- isRemoved?: {
74
- userId: string;
75
- };
76
- pairId?: number | null;
77
- markersStart?: Array<string>;
78
- markersEnd?: Array<string>;
79
- isIncorrect?: boolean;
80
- distance?: number;
81
- isAddSuggestion?: {
82
- userId: string;
83
- type: string;
84
- name: string;
85
- };
86
- isRemoveSuggestion?: {
87
- userId: string;
88
- type: string;
89
- name: string;
90
- };
91
- side?: number;
92
- level?: number;
93
- index?: number;
94
- }
95
- export type TapeItem = Item & {
96
- name: string;
97
- startIndex?: number;
98
- endIndex?: number;
99
- };
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/revisionhistory
7
+ * @publicApi
8
+ */
9
+ import { Plugin, type Editor } from 'ckeditor5/src/core';
10
+ import type { Item, Position } from 'ckeditor5/src/engine';
11
+ import RevisionTracker from './revisiontracker';
12
+ import RevisionHistoryUI from './ui/revisionhistory/revisionhistoryui';
13
+ import type { default as Revision, RevisionJSON } from './revision';
14
+ import type { RevisionHistoryAdapter } from './revisionhistoryadapter';
15
+ /**
16
+ * The revision history feature.
17
+ *
18
+ * Enables tracking and bundling changes into revisions as well as provides the default UI for browsing revisions.
19
+ *
20
+ * To learn more about the revision history feature refer to the
21
+ * {@glink features/collaboration/revision-history/revision-history Revision history} guide.
22
+ */
23
+ export default class RevisionHistory extends Plugin {
24
+ static get pluginName(): "RevisionHistory";
25
+ static get requires(): readonly [typeof RevisionTracker, typeof RevisionHistoryUI];
26
+ constructor(editor: Editor);
27
+ /**
28
+ * An adapter object that should communicate with the data source to fetch or save the revisions data.
29
+ */
30
+ set adapter(adapter: RevisionHistoryAdapter | null);
31
+ get adapter(): RevisionHistoryAdapter | null;
32
+ /**
33
+ * Creates a revision basing on given revision data and adds it to the revision tracker and revision repository.
34
+ *
35
+ * The parameter of this method should be an object with revision data. You can receive such an object by calling
36
+ * {@link module:revision-history/revisionhistory~RevisionHistory#getRevisions `RevisionHistory#getRevisions( { toJSON: true } )`}
37
+ * or {@link module:revision-history/revision~Revision#toJSON `Revision#toJSON()`}.
38
+ *
39
+ * ```ts
40
+ * // Get revisions data in an appropriate format.
41
+ * // You can save it in your database.
42
+ * const revisionsData = revisionHistory.getRevisions( { toJSON: true } );
43
+ * // ...
44
+ * // Use revisions data.
45
+ * // That revisions data might be loaded from your database.
46
+ * revisionsData.forEach( revisionData => revisionHistory.addRevisionData( revisionData ) );
47
+ * ```
48
+ */
49
+ addRevisionData(revisionData: RevisionJSON): Revision;
50
+ /**
51
+ * Returns the revision with a given revision id or at a given index.
52
+ */
53
+ getRevision(revisionIdOrIndex: string | number): Revision | null;
54
+ getRevisions(options: {
55
+ toJSON: true;
56
+ }): Array<RevisionJSON>;
57
+ getRevisions(options: {
58
+ toJSON: false;
59
+ }): Array<Revision>;
60
+ getRevisions(options: {
61
+ toJSON: boolean;
62
+ }): Array<Revision> | Array<RevisionJSON>;
63
+ }
64
+ export interface TapeValue {
65
+ id?: number;
66
+ type: 'elementStart' | 'elementEnd' | 'text';
67
+ item: TapeItem;
68
+ previousPosition?: Position;
69
+ nextPosition?: Position;
70
+ isAdded?: {
71
+ userId: string;
72
+ } | boolean;
73
+ isRemoved?: {
74
+ userId: string;
75
+ };
76
+ pairId?: number | null;
77
+ markersStart?: Array<string>;
78
+ markersEnd?: Array<string>;
79
+ isIncorrect?: boolean;
80
+ distance?: number;
81
+ isAddSuggestion?: {
82
+ userId: string;
83
+ type: string;
84
+ name: string;
85
+ };
86
+ isRemoveSuggestion?: {
87
+ userId: string;
88
+ type: string;
89
+ name: string;
90
+ };
91
+ side?: number;
92
+ level?: number;
93
+ index?: number;
94
+ }
95
+ export type TapeItem = Item & {
96
+ name: string;
97
+ startIndex?: number;
98
+ endIndex?: number;
99
+ };