@ckeditor/ckeditor5-collaboration-core 38.1.0 → 38.1.1
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/package.json +2 -2
- package/src/augmentation.d.ts +34 -34
- package/src/collaborationhistory.d.ts +17 -17
- package/src/collaborationoperation.d.ts +24 -24
- package/src/config.d.ts +98 -98
- package/src/index.d.ts +13 -13
- package/src/permissions.d.ts +41 -41
- package/src/permissions.js +1 -1
- package/src/suggestionstyles.d.ts +8 -8
- package/src/users/view/userview.d.ts +12 -12
- package/src/users/view/userview.js +1 -1
- package/src/users.d.ts +146 -146
- package/src/users.js +1 -1
- package/src/utils/common-translations.d.ts +5 -5
- package/src/utils/common-translations.js +1 -1
- package/src/utils/confirmmixin.d.ts +16 -16
- package/src/utils/confirmmixin.js +1 -1
- package/src/utils/confirmview.d.ts +9 -9
- package/src/utils/confirmview.js +1 -1
- package/src/utils/getdatetimeformatter.d.ts +29 -29
- package/src/utils/getdatetimeformatter.js +1 -1
- package/src/utils/getmarkerdomelement.d.ts +21 -21
- package/src/utils/getmarkerdomelement.js +1 -1
- package/src/utils/hashobject.d.ts +4 -4
- package/src/utils/hashobject.js +1 -1
- package/src/utils/trim-html.d.ts +12 -12
- package/src/utils/trim-html.js +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-collaboration-core",
|
3
|
-
"version": "38.1.
|
3
|
+
"version": "38.1.1",
|
4
4
|
"description": "Base utilities used by CKEditor 5 collaboration features to support multiple users working together in a rich text editor.",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
@@ -31,7 +31,7 @@
|
|
31
31
|
],
|
32
32
|
"main": "src/index.js",
|
33
33
|
"dependencies": {
|
34
|
-
"ckeditor5": "38.1.
|
34
|
+
"ckeditor5": "38.1.1",
|
35
35
|
"date-fns": "^2.17.0"
|
36
36
|
},
|
37
37
|
"engines": {
|
package/src/augmentation.d.ts
CHANGED
@@ -1,34 +1,34 @@
|
|
1
|
-
import type { LocaleConfig, Users } from './index';
|
2
|
-
import type { RealTimeCollaborationConfig } from './config';
|
3
|
-
declare module '@ckeditor/ckeditor5-core' {
|
4
|
-
interface EditorConfig {
|
5
|
-
/**
|
6
|
-
* The locale configuration of the editor.
|
7
|
-
*/
|
8
|
-
locale?: LocaleConfig;
|
9
|
-
/**
|
10
|
-
* The users plugin configuration.
|
11
|
-
*/
|
12
|
-
users?: {
|
13
|
-
/**
|
14
|
-
* User ID value that will be used for the anonymous user.
|
15
|
-
*/
|
16
|
-
anonymousUserId?: string;
|
17
|
-
/**
|
18
|
-
* Number of defined colors that are randomly assigned to users.
|
19
|
-
*/
|
20
|
-
colorsCount?: number;
|
21
|
-
};
|
22
|
-
/**
|
23
|
-
* The configuration of the real time collaboration feature.
|
24
|
-
*
|
25
|
-
* Read more in {@link module:collaboration-core/config~RealTimeCollaborationConfig}.
|
26
|
-
*
|
27
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
28
|
-
*/
|
29
|
-
collaboration?: RealTimeCollaborationConfig;
|
30
|
-
}
|
31
|
-
interface PluginsMap {
|
32
|
-
[Users.pluginName]: Users;
|
33
|
-
}
|
34
|
-
}
|
1
|
+
import type { LocaleConfig, Users } from './index';
|
2
|
+
import type { RealTimeCollaborationConfig } from './config';
|
3
|
+
declare module '@ckeditor/ckeditor5-core' {
|
4
|
+
interface EditorConfig {
|
5
|
+
/**
|
6
|
+
* The locale configuration of the editor.
|
7
|
+
*/
|
8
|
+
locale?: LocaleConfig;
|
9
|
+
/**
|
10
|
+
* The users plugin configuration.
|
11
|
+
*/
|
12
|
+
users?: {
|
13
|
+
/**
|
14
|
+
* User ID value that will be used for the anonymous user.
|
15
|
+
*/
|
16
|
+
anonymousUserId?: string;
|
17
|
+
/**
|
18
|
+
* Number of defined colors that are randomly assigned to users.
|
19
|
+
*/
|
20
|
+
colorsCount?: number;
|
21
|
+
};
|
22
|
+
/**
|
23
|
+
* The configuration of the real time collaboration feature.
|
24
|
+
*
|
25
|
+
* Read more in {@link module:collaboration-core/config~RealTimeCollaborationConfig}.
|
26
|
+
*
|
27
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
28
|
+
*/
|
29
|
+
collaboration?: RealTimeCollaborationConfig;
|
30
|
+
}
|
31
|
+
interface PluginsMap {
|
32
|
+
[Users.pluginName]: Users;
|
33
|
+
}
|
34
|
+
}
|
@@ -1,17 +1,17 @@
|
|
1
|
-
/**
|
2
|
-
* @module collaboration-core/collaborationhistory
|
3
|
-
* @publicApi
|
4
|
-
*/
|
5
|
-
import type { default as CollaborationOperation } from './collaborationoperation';
|
6
|
-
/**
|
7
|
-
* Interface compatible with {@link module:engine/model/history~History} with the difference that it uses
|
8
|
-
* {@link module:collaboration-core/collaborationoperation~CollaborationOperation} instead of regular model operations.
|
9
|
-
*/
|
10
|
-
export default interface CollaborationHistory {
|
11
|
-
_operations: Array<CollaborationOperation>;
|
12
|
-
version: number;
|
13
|
-
getOperations(fromBaseVersion?: number, toBaseVersion?: number): Array<CollaborationOperation>;
|
14
|
-
getOperation(baseVersion: number): CollaborationOperation | undefined;
|
15
|
-
addOperation(operation: CollaborationOperation): void;
|
16
|
-
reset(): void;
|
17
|
-
}
|
1
|
+
/**
|
2
|
+
* @module collaboration-core/collaborationhistory
|
3
|
+
* @publicApi
|
4
|
+
*/
|
5
|
+
import type { default as CollaborationOperation } from './collaborationoperation';
|
6
|
+
/**
|
7
|
+
* Interface compatible with {@link module:engine/model/history~History} with the difference that it uses
|
8
|
+
* {@link module:collaboration-core/collaborationoperation~CollaborationOperation} instead of regular model operations.
|
9
|
+
*/
|
10
|
+
export default interface CollaborationHistory {
|
11
|
+
_operations: Array<CollaborationOperation>;
|
12
|
+
version: number;
|
13
|
+
getOperations(fromBaseVersion?: number, toBaseVersion?: number): Array<CollaborationOperation>;
|
14
|
+
getOperation(baseVersion: number): CollaborationOperation | undefined;
|
15
|
+
addOperation(operation: CollaborationOperation): void;
|
16
|
+
reset(): void;
|
17
|
+
}
|
@@ -1,24 +1,24 @@
|
|
1
|
-
/**
|
2
|
-
* @module collaboration-core/collaborationoperation
|
3
|
-
* @publicApi
|
4
|
-
*/
|
5
|
-
import type { Operation, InsertOperation, MergeOperation, MoveOperation, SplitOperation, MarkerOperation, RootOperation, RootAttributeOperation } from 'ckeditor5/src/engine';
|
6
|
-
/**
|
7
|
-
* Extends the {@link module:engine/model/operation/operation operation}.
|
8
|
-
*/
|
9
|
-
export default interface CollaborationOperation extends Operation {
|
10
|
-
_isInit?: boolean;
|
11
|
-
_authorId?: null | string;
|
12
|
-
_isDisconnection?: boolean;
|
13
|
-
createdAt?: Date;
|
14
|
-
wasUndone?: boolean;
|
15
|
-
affectsData?: Record<string, any>;
|
16
|
-
clone(): CollaborationOperation;
|
17
|
-
}
|
18
|
-
export type InsertCollaborationOperation = CollaborationOperation & InsertOperation;
|
19
|
-
export type MoveCollaborationOperation = CollaborationOperation & MoveOperation;
|
20
|
-
export type MergeCollaborationOperation = CollaborationOperation & MergeOperation;
|
21
|
-
export type SplitCollaborationOperation = CollaborationOperation & SplitOperation;
|
22
|
-
export type MarkerCollaborationOperation = CollaborationOperation & MarkerOperation;
|
23
|
-
export type RootCollaborationOperation = CollaborationOperation & RootOperation;
|
24
|
-
export type RootAttributeCollaborationOperation = CollaborationOperation & RootAttributeOperation;
|
1
|
+
/**
|
2
|
+
* @module collaboration-core/collaborationoperation
|
3
|
+
* @publicApi
|
4
|
+
*/
|
5
|
+
import type { Operation, InsertOperation, MergeOperation, MoveOperation, SplitOperation, MarkerOperation, RootOperation, RootAttributeOperation } from 'ckeditor5/src/engine';
|
6
|
+
/**
|
7
|
+
* Extends the {@link module:engine/model/operation/operation operation}.
|
8
|
+
*/
|
9
|
+
export default interface CollaborationOperation extends Operation {
|
10
|
+
_isInit?: boolean;
|
11
|
+
_authorId?: null | string;
|
12
|
+
_isDisconnection?: boolean;
|
13
|
+
createdAt?: Date;
|
14
|
+
wasUndone?: boolean;
|
15
|
+
affectsData?: Record<string, any>;
|
16
|
+
clone(): CollaborationOperation;
|
17
|
+
}
|
18
|
+
export type InsertCollaborationOperation = CollaborationOperation & InsertOperation;
|
19
|
+
export type MoveCollaborationOperation = CollaborationOperation & MoveOperation;
|
20
|
+
export type MergeCollaborationOperation = CollaborationOperation & MergeOperation;
|
21
|
+
export type SplitCollaborationOperation = CollaborationOperation & SplitOperation;
|
22
|
+
export type MarkerCollaborationOperation = CollaborationOperation & MarkerOperation;
|
23
|
+
export type RootCollaborationOperation = CollaborationOperation & RootOperation;
|
24
|
+
export type RootAttributeCollaborationOperation = CollaborationOperation & RootAttributeOperation;
|
package/src/config.d.ts
CHANGED
@@ -1,98 +1,98 @@
|
|
1
|
-
/**
|
2
|
-
* @module collaboration-core/config
|
3
|
-
* @publicApi
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* The locale configuration.
|
7
|
-
*
|
8
|
-
* ```ts
|
9
|
-
* ClassicEditor
|
10
|
-
* .create( {
|
11
|
-
* locale: {
|
12
|
-
* // The localization configuration.
|
13
|
-
* }
|
14
|
-
* } )
|
15
|
-
* .then( ... )
|
16
|
-
* .catch( ... );
|
17
|
-
* ```
|
18
|
-
*
|
19
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
|
20
|
-
*/
|
21
|
-
export interface LocaleConfig {
|
22
|
-
/**
|
23
|
-
* A function that formats date to the custom format. It is used in dates in annotations (balloons) displaying
|
24
|
-
* comments and suggestions details.
|
25
|
-
*
|
26
|
-
* The default formatting can be changed by setting a custom formatting function to `config.locale.dateTimeFormat`.
|
27
|
-
*
|
28
|
-
* ```ts
|
29
|
-
* import format from 'date-fns/format';
|
30
|
-
*
|
31
|
-
* ClassicEditor
|
32
|
-
* .create( document.querySelector( '#editor' ), {
|
33
|
-
* toolbar: {
|
34
|
-
* items: [ 'bold', 'italic', '|', 'comment' ]
|
35
|
-
* },
|
36
|
-
* sidebar: {
|
37
|
-
* container: document.querySelector( '#sidebar' )
|
38
|
-
* },
|
39
|
-
* locale: {
|
40
|
-
* dateTimeFormat: date => format( date, 'dd/MM/yyyy' )
|
41
|
-
* }
|
42
|
-
* } )
|
43
|
-
* .catch( error => console.error( error ) );
|
44
|
-
* ```
|
45
|
-
*
|
46
|
-
* @returns The generated date.
|
47
|
-
*/
|
48
|
-
dateTimeFormat?: (date: Date) => string;
|
49
|
-
}
|
50
|
-
/**
|
51
|
-
* The configuration of the real-time collaboration features.
|
52
|
-
*
|
53
|
-
* ```ts
|
54
|
-
* ClassicEditor
|
55
|
-
* .create( {
|
56
|
-
* collaboration: ... // Collaboration features configuration.
|
57
|
-
* } )
|
58
|
-
* .then( ... )
|
59
|
-
* .catch( ... );
|
60
|
-
* ```
|
61
|
-
*
|
62
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
63
|
-
*/
|
64
|
-
export interface RealTimeCollaborationConfig {
|
65
|
-
/**
|
66
|
-
* The channel ID is a unique ID that identifies the data loaded in the editor instance or used by
|
67
|
-
* the context instance.
|
68
|
-
*
|
69
|
-
* If specified for the editor, it is the document ID.
|
70
|
-
*
|
71
|
-
* If you are using multiple editors instances at the same time, each of them should use a different
|
72
|
-
* channel ID to connect to a specific document.
|
73
|
-
*
|
74
|
-
* If specified for context, it is the ID for all the data related to context instance.
|
75
|
-
* This ID will be used for data that is not related to an editor instance, for example comments
|
76
|
-
* outside the editor.
|
77
|
-
*
|
78
|
-
* In the case of context, the ID can be an ID of a subpage or a form, or a different entity accordingly
|
79
|
-
* to your application.
|
80
|
-
*
|
81
|
-
* The channel ID can be used to recognize entity to which piece of data belongs in integrations that use `Context`
|
82
|
-
* and context plugins. For example, if you are preparing a custom integration using the comments API,
|
83
|
-
* you can use the channel ID to recognize whether the comment was added to an editor instance
|
84
|
-
* (and which one) or to the context.
|
85
|
-
*
|
86
|
-
* ```ts
|
87
|
-
* ClassicEditor
|
88
|
-
* .create( {
|
89
|
-
* collaboration: {
|
90
|
-
* channelId: 'your-channel-id'
|
91
|
-
* }
|
92
|
-
* } )
|
93
|
-
* .then( ... )
|
94
|
-
* .catch( ... );
|
95
|
-
* ```
|
96
|
-
*/
|
97
|
-
channelId?: string;
|
98
|
-
}
|
1
|
+
/**
|
2
|
+
* @module collaboration-core/config
|
3
|
+
* @publicApi
|
4
|
+
*/
|
5
|
+
/**
|
6
|
+
* The locale configuration.
|
7
|
+
*
|
8
|
+
* ```ts
|
9
|
+
* ClassicEditor
|
10
|
+
* .create( {
|
11
|
+
* locale: {
|
12
|
+
* // The localization configuration.
|
13
|
+
* }
|
14
|
+
* } )
|
15
|
+
* .then( ... )
|
16
|
+
* .catch( ... );
|
17
|
+
* ```
|
18
|
+
*
|
19
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
|
20
|
+
*/
|
21
|
+
export interface LocaleConfig {
|
22
|
+
/**
|
23
|
+
* A function that formats date to the custom format. It is used in dates in annotations (balloons) displaying
|
24
|
+
* comments and suggestions details.
|
25
|
+
*
|
26
|
+
* The default formatting can be changed by setting a custom formatting function to `config.locale.dateTimeFormat`.
|
27
|
+
*
|
28
|
+
* ```ts
|
29
|
+
* import format from 'date-fns/format';
|
30
|
+
*
|
31
|
+
* ClassicEditor
|
32
|
+
* .create( document.querySelector( '#editor' ), {
|
33
|
+
* toolbar: {
|
34
|
+
* items: [ 'bold', 'italic', '|', 'comment' ]
|
35
|
+
* },
|
36
|
+
* sidebar: {
|
37
|
+
* container: document.querySelector( '#sidebar' )
|
38
|
+
* },
|
39
|
+
* locale: {
|
40
|
+
* dateTimeFormat: date => format( date, 'dd/MM/yyyy' )
|
41
|
+
* }
|
42
|
+
* } )
|
43
|
+
* .catch( error => console.error( error ) );
|
44
|
+
* ```
|
45
|
+
*
|
46
|
+
* @returns The generated date.
|
47
|
+
*/
|
48
|
+
dateTimeFormat?: (date: Date) => string;
|
49
|
+
}
|
50
|
+
/**
|
51
|
+
* The configuration of the real-time collaboration features.
|
52
|
+
*
|
53
|
+
* ```ts
|
54
|
+
* ClassicEditor
|
55
|
+
* .create( {
|
56
|
+
* collaboration: ... // Collaboration features configuration.
|
57
|
+
* } )
|
58
|
+
* .then( ... )
|
59
|
+
* .catch( ... );
|
60
|
+
* ```
|
61
|
+
*
|
62
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
63
|
+
*/
|
64
|
+
export interface RealTimeCollaborationConfig {
|
65
|
+
/**
|
66
|
+
* The channel ID is a unique ID that identifies the data loaded in the editor instance or used by
|
67
|
+
* the context instance.
|
68
|
+
*
|
69
|
+
* If specified for the editor, it is the document ID.
|
70
|
+
*
|
71
|
+
* If you are using multiple editors instances at the same time, each of them should use a different
|
72
|
+
* channel ID to connect to a specific document.
|
73
|
+
*
|
74
|
+
* If specified for context, it is the ID for all the data related to context instance.
|
75
|
+
* This ID will be used for data that is not related to an editor instance, for example comments
|
76
|
+
* outside the editor.
|
77
|
+
*
|
78
|
+
* In the case of context, the ID can be an ID of a subpage or a form, or a different entity accordingly
|
79
|
+
* to your application.
|
80
|
+
*
|
81
|
+
* The channel ID can be used to recognize entity to which piece of data belongs in integrations that use `Context`
|
82
|
+
* and context plugins. For example, if you are preparing a custom integration using the comments API,
|
83
|
+
* you can use the channel ID to recognize whether the comment was added to an editor instance
|
84
|
+
* (and which one) or to the context.
|
85
|
+
*
|
86
|
+
* ```ts
|
87
|
+
* ClassicEditor
|
88
|
+
* .create( {
|
89
|
+
* collaboration: {
|
90
|
+
* channelId: 'your-channel-id'
|
91
|
+
* }
|
92
|
+
* } )
|
93
|
+
* .then( ... )
|
94
|
+
* .catch( ... );
|
95
|
+
* ```
|
96
|
+
*/
|
97
|
+
channelId?: string;
|
98
|
+
}
|
package/src/index.d.ts
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
export { default as Permissions } from './permissions';
|
2
|
-
export { default as Users, type User } from './users';
|
3
|
-
export { default as UserView } from './users/view/userview';
|
4
|
-
export { default as getDateTimeFormatter } from './utils/getdatetimeformatter';
|
5
|
-
export { default as getMarkerDomElement, getAllMarkersDomElementsSorted } from './utils/getmarkerdomelement';
|
6
|
-
export { default as trimHtml } from './utils/trim-html';
|
7
|
-
export { default as ConfirmMixin } from './utils/confirmmixin';
|
8
|
-
export { default as hashObject } from './utils/hashobject';
|
9
|
-
export { default as CollaborationOperation, InsertCollaborationOperation, SplitCollaborationOperation, MarkerCollaborationOperation, MoveCollaborationOperation, MergeCollaborationOperation, RootCollaborationOperation, RootAttributeCollaborationOperation } from './collaborationoperation';
|
10
|
-
export { default as CollaborationHistory } from './collaborationhistory';
|
11
|
-
export type { LocaleConfig, RealTimeCollaborationConfig } from './config';
|
12
|
-
export * from './suggestionstyles';
|
13
|
-
import './augmentation';
|
1
|
+
export { default as Permissions } from './permissions';
|
2
|
+
export { default as Users, type User } from './users';
|
3
|
+
export { default as UserView } from './users/view/userview';
|
4
|
+
export { default as getDateTimeFormatter } from './utils/getdatetimeformatter';
|
5
|
+
export { default as getMarkerDomElement, getAllMarkersDomElementsSorted } from './utils/getmarkerdomelement';
|
6
|
+
export { default as trimHtml } from './utils/trim-html';
|
7
|
+
export { default as ConfirmMixin } from './utils/confirmmixin';
|
8
|
+
export { default as hashObject } from './utils/hashobject';
|
9
|
+
export { default as CollaborationOperation, InsertCollaborationOperation, SplitCollaborationOperation, MarkerCollaborationOperation, MoveCollaborationOperation, MergeCollaborationOperation, RootCollaborationOperation, RootAttributeCollaborationOperation } from './collaborationoperation';
|
10
|
+
export { default as CollaborationHistory } from './collaborationhistory';
|
11
|
+
export type { LocaleConfig, RealTimeCollaborationConfig } from './config';
|
12
|
+
export * from './suggestionstyles';
|
13
|
+
import './augmentation';
|
package/src/permissions.d.ts
CHANGED
@@ -1,41 +1,41 @@
|
|
1
|
-
/**
|
2
|
-
* @module collaboration-core/permissions
|
3
|
-
* @publicApi
|
4
|
-
*/
|
5
|
-
import { ContextPlugin } from 'ckeditor5/src/core';
|
6
|
-
/**
|
7
|
-
* The `Permissions` plugin manages permissions set for the local user.
|
8
|
-
*
|
9
|
-
* Following is the list of all defined permissions:
|
10
|
-
*
|
11
|
-
* * `document:write` - modify the content of the document,
|
12
|
-
* * `comment:write` - create, edit and remove own comments and create, resolve and remove own comment threads,
|
13
|
-
* * `comment:admin` - resolve and remove comment threads created by other users (enables `comment:write`).
|
14
|
-
* * `comment:modify_all` - edit and remove any comments created by other users.
|
15
|
-
*
|
16
|
-
* For example, a user with `comment:write` permission but with no `document:write` permission will be able to add
|
17
|
-
* comments but will not be able to change the document data (comments-only mode).
|
18
|
-
*
|
19
|
-
* By default, the following permissions are set: `document:write`, `comment:write`, `comment:admin`.
|
20
|
-
*
|
21
|
-
* Permissions are handled separately for each channel id (for each editor instance and context instance).
|
22
|
-
*
|
23
|
-
* See also the {@glink features/collaboration/users#user-permissions User permissions} guide to learn how to use this plugin.
|
24
|
-
*/
|
25
|
-
export default class Permissions extends ContextPlugin {
|
26
|
-
/**
|
27
|
-
* @inheritDoc
|
28
|
-
*/
|
29
|
-
static get pluginName(): "Permissions";
|
30
|
-
/**
|
31
|
-
* Sets permissions for editor/context instance with given `channelId`.
|
32
|
-
*
|
33
|
-
* If `channelId` is not set, the channel id of the editor/context to which the plugin was added will be used.
|
34
|
-
* This means that it is not required if the plugin is added to the editor configuration and {@link module:core/context~Context}
|
35
|
-
* is not used.
|
36
|
-
*
|
37
|
-
* @param permissions Permissions to set.
|
38
|
-
* @param channelId The channel ID.
|
39
|
-
*/
|
40
|
-
setPermissions(permissions: Array<string>, channelId?: string): void;
|
41
|
-
}
|
1
|
+
/**
|
2
|
+
* @module collaboration-core/permissions
|
3
|
+
* @publicApi
|
4
|
+
*/
|
5
|
+
import { ContextPlugin } from 'ckeditor5/src/core';
|
6
|
+
/**
|
7
|
+
* The `Permissions` plugin manages permissions set for the local user.
|
8
|
+
*
|
9
|
+
* Following is the list of all defined permissions:
|
10
|
+
*
|
11
|
+
* * `document:write` - modify the content of the document,
|
12
|
+
* * `comment:write` - create, edit and remove own comments and create, resolve and remove own comment threads,
|
13
|
+
* * `comment:admin` - resolve and remove comment threads created by other users (enables `comment:write`).
|
14
|
+
* * `comment:modify_all` - edit and remove any comments created by other users.
|
15
|
+
*
|
16
|
+
* For example, a user with `comment:write` permission but with no `document:write` permission will be able to add
|
17
|
+
* comments but will not be able to change the document data (comments-only mode).
|
18
|
+
*
|
19
|
+
* By default, the following permissions are set: `document:write`, `comment:write`, `comment:admin`.
|
20
|
+
*
|
21
|
+
* Permissions are handled separately for each channel id (for each editor instance and context instance).
|
22
|
+
*
|
23
|
+
* See also the {@glink features/collaboration/users#user-permissions User permissions} guide to learn how to use this plugin.
|
24
|
+
*/
|
25
|
+
export default class Permissions extends ContextPlugin {
|
26
|
+
/**
|
27
|
+
* @inheritDoc
|
28
|
+
*/
|
29
|
+
static get pluginName(): "Permissions";
|
30
|
+
/**
|
31
|
+
* Sets permissions for editor/context instance with given `channelId`.
|
32
|
+
*
|
33
|
+
* If `channelId` is not set, the channel id of the editor/context to which the plugin was added will be used.
|
34
|
+
* This means that it is not required if the plugin is added to the editor configuration and {@link module:core/context~Context}
|
35
|
+
* is not used.
|
36
|
+
*
|
37
|
+
* @param permissions Permissions to set.
|
38
|
+
* @param channelId The channel ID.
|
39
|
+
*/
|
40
|
+
setPermissions(permissions: Array<string>, channelId?: string): void;
|
41
|
+
}
|
package/src/permissions.js
CHANGED
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
const
|
23
|
+
const _0x50e7=['setPermissions','isEnabled','pluginName','noPermissions','config','addCommentThread','comment:admin','find','collaboration.channelId','has','permissions-set-permissions-invalid-channel-id','includes','context','get','CommentsOnly','plugins','no-permissions','editors','document:write','Permissions','commands'];(function(_0x1fe05d,_0x50e71e){const _0x344f7e=function(_0x4ee750){while(--_0x4ee750){_0x1fe05d['push'](_0x1fe05d['shift']());}};_0x344f7e(++_0x50e71e);}(_0x50e7,0xea));const _0x344f=function(_0x1fe05d,_0x50e71e){_0x1fe05d=_0x1fe05d-0x0;let _0x344f7e=_0x50e7[_0x1fe05d];return _0x344f7e;};import{ContextPlugin as _0x4a8f28,Editor as _0x4ad131}from'ckeditor5/src/core';import{CKEditorError as _0x46f7e5}from'ckeditor5/src/utils';export default class n extends _0x4a8f28{static get[_0x344f('0x14')](){return _0x344f('0x10');}[_0x344f('0x12')](_0x81b865,_0x167388){let _0x39696e;if(_0x167388||(_0x167388=this[_0x344f('0x9')][_0x344f('0x1')][_0x344f('0xa')]('collaboration.channelId')),this[_0x344f('0x9')][_0x344f('0x1')][_0x344f('0xa')](_0x344f('0x5'))==_0x167388?_0x39696e=this['context']:_0x344f('0xe')in this[_0x344f('0x9')]&&this[_0x344f('0x9')][_0x344f('0xe')]&&(_0x39696e=this[_0x344f('0x9')][_0x344f('0xe')][_0x344f('0x4')](_0x49c40d=>_0x49c40d['config'][_0x344f('0xa')](_0x344f('0x5'))==_0x167388)),!_0x39696e)throw new _0x46f7e5(_0x344f('0x7'),null);const _0x2e3740=_0x39696e[_0x344f('0xc')],_0x5bf25f=_0x2e3740[_0x344f('0x6')]('CommentsRepository')?_0x2e3740[_0x344f('0xa')]('CommentsRepository'):void 0x0,_0xa6724f=_0x2e3740[_0x344f('0x6')](_0x344f('0xb'))&&_0x2e3740['get'](_0x344f('0xb')),_0x53df8=_0x81b865[_0x344f('0x8')](_0x344f('0xf')),_0xa7e7b9=_0x81b865[_0x344f('0x8')]('comment:modify_all'),_0x1bed02=_0x81b865[_0x344f('0x8')](_0x344f('0x3')),_0x3ee7dc=_0x81b865[_0x344f('0x8')]('comment:write'),_0x68bac4=_0x3ee7dc||_0x1bed02,_0x569bfb=_0x68bac4||_0xa7e7b9,_0x5370b3=_0x53df8||_0x68bac4;(_0xa6724f&&(_0xa6724f[_0x344f('0x13')]=!_0x53df8&&_0x569bfb),_0x39696e instanceof _0x4ad131)&&(!(_0x53df8||_0x569bfb&&_0x5bf25f)?_0x39696e['enableReadOnlyMode'](_0x344f('0xd')):_0x39696e['disableReadOnlyMode'](_0x344f('0xd')));if(_0x5bf25f){_0x5bf25f[_0x344f('0x12')]({'admin':_0x1bed02,'modifyAll':_0xa7e7b9,'write':_0x3ee7dc,'resolve':_0x5370b3},_0x167388);const _0x58cf59=_0x39696e instanceof _0x4ad131&&_0x39696e[_0x344f('0x11')][_0x344f('0xa')](_0x344f('0x2'));_0x58cf59&&(_0x68bac4?_0x58cf59['clearForceDisabled'](_0x344f('0x0')):_0x58cf59['forceDisabled'](_0x344f('0x0')));}}}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import '../theme/suggestion.css';
|
2
|
-
import '../theme/suggestionmarker.css';
|
3
|
-
import '../theme/integrations/image.css';
|
4
|
-
import '../theme/integrations/horizontalline.css';
|
5
|
-
import '../theme/integrations/mediaembed.css';
|
6
|
-
import '../theme/integrations/pagebreak.css';
|
7
|
-
import '../theme/integrations/table.css';
|
8
|
-
import '../theme/integrations/codeblock.css';
|
1
|
+
import '../theme/suggestion.css';
|
2
|
+
import '../theme/suggestionmarker.css';
|
3
|
+
import '../theme/integrations/image.css';
|
4
|
+
import '../theme/integrations/horizontalline.css';
|
5
|
+
import '../theme/integrations/mediaembed.css';
|
6
|
+
import '../theme/integrations/pagebreak.css';
|
7
|
+
import '../theme/integrations/table.css';
|
8
|
+
import '../theme/integrations/codeblock.css';
|
@@ -1,12 +1,12 @@
|
|
1
|
-
/**
|
2
|
-
* @module collaboration-core/users/view/userview
|
3
|
-
*/
|
4
|
-
import { View, type TemplateDefinition } from 'ckeditor5/src/ui';
|
5
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
6
|
-
import type { User } from '../../users';
|
7
|
-
import '../../../theme/users.css';
|
8
|
-
export default class UserView extends View {
|
9
|
-
name: string;
|
10
|
-
notificationView: TemplateDefinition | null;
|
11
|
-
constructor(locale: Locale, user: User, notificationText?: null | string);
|
12
|
-
}
|
1
|
+
/**
|
2
|
+
* @module collaboration-core/users/view/userview
|
3
|
+
*/
|
4
|
+
import { View, type TemplateDefinition } from 'ckeditor5/src/ui';
|
5
|
+
import type { Locale } from 'ckeditor5/src/utils';
|
6
|
+
import type { User } from '../../users';
|
7
|
+
import '../../../theme/users.css';
|
8
|
+
export default class UserView extends View {
|
9
|
+
name: string;
|
10
|
+
notificationView: TemplateDefinition | null;
|
11
|
+
constructor(locale: Locale, user: User, notificationText?: null | string);
|
12
|
+
}
|
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
const
|
23
|
+
const _0x1a84=['ck-user__notification','avatar','ck\x20ck-user__name\x20ck-user__name--hidden','name','url(\x27','notificationView','ck-user','content','isAnonymous','ck-user__anonymous','push','ck-user__avatar','div'];(function(_0x5925e5,_0x1a841a){const _0x430d19=function(_0x18fab8){while(--_0x18fab8){_0x5925e5['push'](_0x5925e5['shift']());}};_0x430d19(++_0x1a841a);}(_0x1a84,0x1da));const _0x430d=function(_0x5925e5,_0x1a841a){_0x5925e5=_0x5925e5-0x0;let _0x430d19=_0x1a84[_0x5925e5];return _0x430d19;};import{View as _0x35c495,IconView as _0x3c4867}from'ckeditor5/src/ui';import _0x24d77e from'../../../theme/icons/notification.svg';import'../../../theme/users.css';export default class $ extends _0x35c495{constructor(_0x56ac24,_0x36e5d0,_0x4d37e8){super(_0x56ac24),this[_0x430d('0xa')]=_0x36e5d0[_0x430d('0xa')],this['notificationView']=null;const _0x3d5c45=['ck','ck-user__img'];if(_0x36e5d0[_0x430d('0x2')]&&_0x3d5c45[_0x430d('0x4')](_0x430d('0x3')),_0x36e5d0['avatar']&&_0x3d5c45[_0x430d('0x4')](_0x430d('0x5')),_0x4d37e8){const _0x478e65=new _0x3c4867();_0x478e65['extendTemplate']({'attributes':{'class':['ck-user__icon']}}),_0x478e65[_0x430d('0x1')]=_0x24d77e,this[_0x430d('0xc')]={'tag':_0x430d('0x6'),'attributes':{'class':['ck',_0x430d('0x7')],'data-cke-tooltip-position':'n','data-cke-tooltip-text':_0x4d37e8},'children':[_0x478e65]};}const _0x4fe1d7=[{'tag':_0x430d('0x6'),'attributes':{'class':_0x3d5c45,'style':{'background-image':_0x36e5d0[_0x430d('0x8')]?_0x430d('0xb')+_0x36e5d0[_0x430d('0x8')]+'\x27)':''}}},{'tag':'div','attributes':{'class':_0x36e5d0[_0x430d('0x8')]?_0x430d('0x9'):'ck\x20ck-user__name'},'children':[{'text':_0x36e5d0['initials']}]}];this[_0x430d('0xc')]&&_0x4fe1d7[_0x430d('0x4')](this[_0x430d('0xc')]),this['setTemplate']({'tag':_0x430d('0x6'),'attributes':{'class':['ck',_0x430d('0x0')],'data-user-id':_0x36e5d0['id']},'children':_0x4fe1d7});}}
|