@ckeditor/ckeditor5-collaboration-core 40.0.0 → 40.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +5 -5
- package/package.json +2 -2
- package/src/augmentation.d.ts +38 -38
- package/src/collaborationhistory.d.ts +21 -21
- package/src/collaborationoperation.d.ts +28 -28
- package/src/config.d.ts +102 -102
- package/src/index.d.ts +19 -18
- package/src/index.js +1 -1
- package/src/permissions.d.ts +46 -45
- package/src/permissions.js +1 -1
- package/src/suggestionstyles.d.ts +12 -12
- package/src/users/view/userview.d.ts +16 -16
- package/src/users/view/userview.js +1 -1
- package/src/users.d.ts +161 -161
- package/src/users.js +1 -1
- package/src/utils/common-translations.d.ts +9 -9
- package/src/utils/common-translations.js +1 -1
- package/src/utils/confirmmixin.d.ts +20 -20
- package/src/utils/confirmmixin.js +1 -1
- package/src/utils/confirmview.d.ts +13 -13
- 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 +22 -22
- package/src/utils/getmarkerdomelement.js +1 -1
- package/src/utils/hashobject.d.ts +8 -8
- package/src/utils/hashobject.js +1 -1
- package/src/utils/sanitizeEditorConfig.d.ts +15 -15
- package/src/utils/sanitizeEditorConfig.js +1 -1
- package/src/utils/surroundingmarkersdetector.d.ts +16 -0
- package/src/utils/surroundingmarkersdetector.js +23 -0
- package/src/utils/trim-html.d.ts +16 -16
- package/src/utils/trim-html.js +1 -1
- package/theme/suggestionmarker.css +2 -2
package/LICENSE.md
CHANGED
@@ -2,10 +2,10 @@ Software License Agreement
|
|
2
2
|
==========================
|
3
3
|
|
4
4
|
**CKEditor 5 collaboration core** (https://ckeditor.com/collaboration/)<br>
|
5
|
-
Copyright (c) 2003
|
5
|
+
Copyright (c) 2003–2023, [CKSource Holding sp. z o.o.](https://cksource.com) All rights reserved.
|
6
6
|
|
7
7
|
CKEditor 5 collaboration core is licensed under a commercial license and is protected by copyright law.
|
8
|
-
|
8
|
+
For more details about available licensing options please contact us at sales@cksource.com.
|
9
9
|
|
10
10
|
Sources of Intellectual Property Included in CKEditor 5 collaboration core
|
11
11
|
--------------------------------------------------------------------------
|
@@ -14,10 +14,10 @@ Where not otherwise indicated, all CKEditor 5 collaboration core content is
|
|
14
14
|
|
15
15
|
The following libraries are included in CKEditor 5 collaboration core under the [MIT license](https://opensource.org/licenses/MIT):
|
16
16
|
|
17
|
-
*
|
18
|
-
*
|
17
|
+
* date-fns - Copyright (c) 2021 Sasha Koss and Lesha Koss https://kossnocorp.mit-license.org.
|
18
|
+
* Lodash - Copyright (c) JS Foundation and other contributors https://js.foundation/. Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors http://underscorejs.org/.
|
19
19
|
|
20
20
|
Trademarks
|
21
21
|
----------
|
22
22
|
|
23
|
-
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks or service marks of their respective holders.
|
23
|
+
**CKEditor** is a trademark of [CKSource Holding sp. z o.o.](https://cksource.com) All other brand and product names are trademarks, registered trademarks, or service marks of their respective holders.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ckeditor/ckeditor5-collaboration-core",
|
3
|
-
"version": "40.
|
3
|
+
"version": "40.1.0",
|
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": "40.
|
34
|
+
"ckeditor5": "40.1.0",
|
35
35
|
"date-fns": "2.30.0"
|
36
36
|
},
|
37
37
|
"files": [
|
package/src/augmentation.d.ts
CHANGED
@@ -1,38 +1,38 @@
|
|
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 { LocaleConfig, Users } from './index';
|
6
|
-
import type { RealTimeCollaborationConfig } from './config';
|
7
|
-
declare module '@ckeditor/ckeditor5-core' {
|
8
|
-
interface EditorConfig {
|
9
|
-
/**
|
10
|
-
* The locale configuration of the editor.
|
11
|
-
*/
|
12
|
-
locale?: LocaleConfig;
|
13
|
-
/**
|
14
|
-
* The users plugin configuration.
|
15
|
-
*/
|
16
|
-
users?: {
|
17
|
-
/**
|
18
|
-
* User ID value that will be used for the anonymous user.
|
19
|
-
*/
|
20
|
-
anonymousUserId?: string;
|
21
|
-
/**
|
22
|
-
* Number of defined colors that are randomly assigned to users.
|
23
|
-
*/
|
24
|
-
colorsCount?: number;
|
25
|
-
};
|
26
|
-
/**
|
27
|
-
* The configuration of the real time collaboration feature.
|
28
|
-
*
|
29
|
-
* Read more in {@link module:collaboration-core/config~RealTimeCollaborationConfig}.
|
30
|
-
*
|
31
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
32
|
-
*/
|
33
|
-
collaboration?: RealTimeCollaborationConfig;
|
34
|
-
}
|
35
|
-
interface PluginsMap {
|
36
|
-
[Users.pluginName]: Users;
|
37
|
-
}
|
38
|
-
}
|
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 { LocaleConfig, Users } from './index';
|
6
|
+
import type { RealTimeCollaborationConfig } from './config';
|
7
|
+
declare module '@ckeditor/ckeditor5-core' {
|
8
|
+
interface EditorConfig {
|
9
|
+
/**
|
10
|
+
* The locale configuration of the editor.
|
11
|
+
*/
|
12
|
+
locale?: LocaleConfig;
|
13
|
+
/**
|
14
|
+
* The users plugin configuration.
|
15
|
+
*/
|
16
|
+
users?: {
|
17
|
+
/**
|
18
|
+
* User ID value that will be used for the anonymous user.
|
19
|
+
*/
|
20
|
+
anonymousUserId?: string;
|
21
|
+
/**
|
22
|
+
* Number of defined colors that are randomly assigned to users.
|
23
|
+
*/
|
24
|
+
colorsCount?: number;
|
25
|
+
};
|
26
|
+
/**
|
27
|
+
* The configuration of the real time collaboration feature.
|
28
|
+
*
|
29
|
+
* Read more in {@link module:collaboration-core/config~RealTimeCollaborationConfig}.
|
30
|
+
*
|
31
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
32
|
+
*/
|
33
|
+
collaboration?: RealTimeCollaborationConfig;
|
34
|
+
}
|
35
|
+
interface PluginsMap {
|
36
|
+
[Users.pluginName]: Users;
|
37
|
+
}
|
38
|
+
}
|
@@ -1,21 +1,21 @@
|
|
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 collaboration-core/collaborationhistory
|
7
|
-
* @publicApi
|
8
|
-
*/
|
9
|
-
import type { default as CollaborationOperation } from './collaborationoperation';
|
10
|
-
/**
|
11
|
-
* Interface compatible with {@link module:engine/model/history~History} with the difference that it uses
|
12
|
-
* {@link module:collaboration-core/collaborationoperation~CollaborationOperation} instead of regular model operations.
|
13
|
-
*/
|
14
|
-
export default interface CollaborationHistory {
|
15
|
-
_operations: Array<CollaborationOperation>;
|
16
|
-
version: number;
|
17
|
-
getOperations(fromBaseVersion?: number, toBaseVersion?: number): Array<CollaborationOperation>;
|
18
|
-
getOperation(baseVersion: number): CollaborationOperation | undefined;
|
19
|
-
addOperation(operation: CollaborationOperation): void;
|
20
|
-
reset(): void;
|
21
|
-
}
|
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 collaboration-core/collaborationhistory
|
7
|
+
* @publicApi
|
8
|
+
*/
|
9
|
+
import type { default as CollaborationOperation } from './collaborationoperation';
|
10
|
+
/**
|
11
|
+
* Interface compatible with {@link module:engine/model/history~History} with the difference that it uses
|
12
|
+
* {@link module:collaboration-core/collaborationoperation~CollaborationOperation} instead of regular model operations.
|
13
|
+
*/
|
14
|
+
export default interface CollaborationHistory {
|
15
|
+
_operations: Array<CollaborationOperation>;
|
16
|
+
version: number;
|
17
|
+
getOperations(fromBaseVersion?: number, toBaseVersion?: number): Array<CollaborationOperation>;
|
18
|
+
getOperation(baseVersion: number): CollaborationOperation | undefined;
|
19
|
+
addOperation(operation: CollaborationOperation): void;
|
20
|
+
reset(): void;
|
21
|
+
}
|
@@ -1,28 +1,28 @@
|
|
1
|
-
/**
|
2
|
-
* @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
|
3
|
-
* For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
|
4
|
-
*/
|
5
|
-
/**
|
6
|
-
* @module collaboration-core/collaborationoperation
|
7
|
-
* @publicApi
|
8
|
-
*/
|
9
|
-
import type { Operation, InsertOperation, MergeOperation, MoveOperation, SplitOperation, MarkerOperation, RootOperation, RootAttributeOperation } from 'ckeditor5/src/engine';
|
10
|
-
/**
|
11
|
-
* Extends the {@link module:engine/model/operation/operation operation}.
|
12
|
-
*/
|
13
|
-
export default interface CollaborationOperation extends Operation {
|
14
|
-
_isInit?: boolean;
|
15
|
-
_authorId?: null | string;
|
16
|
-
_isDisconnection?: boolean;
|
17
|
-
createdAt?: Date;
|
18
|
-
wasUndone?: boolean;
|
19
|
-
affectsData?: Record<string, any>;
|
20
|
-
clone(): CollaborationOperation;
|
21
|
-
}
|
22
|
-
export type InsertCollaborationOperation = CollaborationOperation & InsertOperation;
|
23
|
-
export type MoveCollaborationOperation = CollaborationOperation & MoveOperation;
|
24
|
-
export type MergeCollaborationOperation = CollaborationOperation & MergeOperation;
|
25
|
-
export type SplitCollaborationOperation = CollaborationOperation & SplitOperation;
|
26
|
-
export type MarkerCollaborationOperation = CollaborationOperation & MarkerOperation;
|
27
|
-
export type RootCollaborationOperation = CollaborationOperation & RootOperation;
|
28
|
-
export type RootAttributeCollaborationOperation = CollaborationOperation & RootAttributeOperation;
|
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 collaboration-core/collaborationoperation
|
7
|
+
* @publicApi
|
8
|
+
*/
|
9
|
+
import type { Operation, InsertOperation, MergeOperation, MoveOperation, SplitOperation, MarkerOperation, RootOperation, RootAttributeOperation } from 'ckeditor5/src/engine';
|
10
|
+
/**
|
11
|
+
* Extends the {@link module:engine/model/operation/operation operation}.
|
12
|
+
*/
|
13
|
+
export default interface CollaborationOperation extends Operation {
|
14
|
+
_isInit?: boolean;
|
15
|
+
_authorId?: null | string;
|
16
|
+
_isDisconnection?: boolean;
|
17
|
+
createdAt?: Date;
|
18
|
+
wasUndone?: boolean;
|
19
|
+
affectsData?: Record<string, any>;
|
20
|
+
clone(): CollaborationOperation;
|
21
|
+
}
|
22
|
+
export type InsertCollaborationOperation = CollaborationOperation & InsertOperation;
|
23
|
+
export type MoveCollaborationOperation = CollaborationOperation & MoveOperation;
|
24
|
+
export type MergeCollaborationOperation = CollaborationOperation & MergeOperation;
|
25
|
+
export type SplitCollaborationOperation = CollaborationOperation & SplitOperation;
|
26
|
+
export type MarkerCollaborationOperation = CollaborationOperation & MarkerOperation;
|
27
|
+
export type RootCollaborationOperation = CollaborationOperation & RootOperation;
|
28
|
+
export type RootAttributeCollaborationOperation = CollaborationOperation & RootAttributeOperation;
|
package/src/config.d.ts
CHANGED
@@ -1,102 +1,102 @@
|
|
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 collaboration-core/config
|
7
|
-
* @publicApi
|
8
|
-
*/
|
9
|
-
/**
|
10
|
-
* The locale configuration.
|
11
|
-
*
|
12
|
-
* ```ts
|
13
|
-
* ClassicEditor
|
14
|
-
* .create( {
|
15
|
-
* locale: {
|
16
|
-
* // The localization configuration.
|
17
|
-
* }
|
18
|
-
* } )
|
19
|
-
* .then( ... )
|
20
|
-
* .catch( ... );
|
21
|
-
* ```
|
22
|
-
*
|
23
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
|
24
|
-
*/
|
25
|
-
export interface LocaleConfig {
|
26
|
-
/**
|
27
|
-
* A function that formats date to the custom format. It is used in dates in annotations (balloons) displaying
|
28
|
-
* comments and suggestions details.
|
29
|
-
*
|
30
|
-
* The default formatting can be changed by setting a custom formatting function to `config.locale.dateTimeFormat`.
|
31
|
-
*
|
32
|
-
* ```ts
|
33
|
-
* import format from 'date-fns/format';
|
34
|
-
*
|
35
|
-
* ClassicEditor
|
36
|
-
* .create( document.querySelector( '#editor' ), {
|
37
|
-
* toolbar: {
|
38
|
-
* items: [ 'bold', 'italic', '|', 'comment' ]
|
39
|
-
* },
|
40
|
-
* sidebar: {
|
41
|
-
* container: document.querySelector( '#sidebar' )
|
42
|
-
* },
|
43
|
-
* locale: {
|
44
|
-
* dateTimeFormat: date => format( date, 'dd/MM/yyyy' )
|
45
|
-
* }
|
46
|
-
* } )
|
47
|
-
* .catch( error => console.error( error ) );
|
48
|
-
* ```
|
49
|
-
*
|
50
|
-
* @returns The generated date.
|
51
|
-
*/
|
52
|
-
dateTimeFormat?: (date: Date) => string;
|
53
|
-
}
|
54
|
-
/**
|
55
|
-
* The configuration of the real-time collaboration features.
|
56
|
-
*
|
57
|
-
* ```ts
|
58
|
-
* ClassicEditor
|
59
|
-
* .create( {
|
60
|
-
* collaboration: ... // Collaboration features configuration.
|
61
|
-
* } )
|
62
|
-
* .then( ... )
|
63
|
-
* .catch( ... );
|
64
|
-
* ```
|
65
|
-
*
|
66
|
-
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
67
|
-
*/
|
68
|
-
export interface RealTimeCollaborationConfig {
|
69
|
-
/**
|
70
|
-
* The channel ID is a unique ID that identifies the data loaded in the editor instance or used by
|
71
|
-
* the context instance.
|
72
|
-
*
|
73
|
-
* If specified for the editor, it is the document ID.
|
74
|
-
*
|
75
|
-
* If you are using multiple editors instances at the same time, each of them should use a different
|
76
|
-
* channel ID to connect to a specific document.
|
77
|
-
*
|
78
|
-
* If specified for context, it is the ID for all the data related to context instance.
|
79
|
-
* This ID will be used for data that is not related to an editor instance, for example comments
|
80
|
-
* outside the editor.
|
81
|
-
*
|
82
|
-
* In the case of context, the ID can be an ID of a subpage or a form, or a different entity accordingly
|
83
|
-
* to your application.
|
84
|
-
*
|
85
|
-
* The channel ID can be used to recognize entity to which piece of data belongs in integrations that use `Context`
|
86
|
-
* and context plugins. For example, if you are preparing a custom integration using the comments API,
|
87
|
-
* you can use the channel ID to recognize whether the comment was added to an editor instance
|
88
|
-
* (and which one) or to the context.
|
89
|
-
*
|
90
|
-
* ```ts
|
91
|
-
* ClassicEditor
|
92
|
-
* .create( {
|
93
|
-
* collaboration: {
|
94
|
-
* channelId: 'your-channel-id'
|
95
|
-
* }
|
96
|
-
* } )
|
97
|
-
* .then( ... )
|
98
|
-
* .catch( ... );
|
99
|
-
* ```
|
100
|
-
*/
|
101
|
-
channelId?: string;
|
102
|
-
}
|
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 collaboration-core/config
|
7
|
+
* @publicApi
|
8
|
+
*/
|
9
|
+
/**
|
10
|
+
* The locale configuration.
|
11
|
+
*
|
12
|
+
* ```ts
|
13
|
+
* ClassicEditor
|
14
|
+
* .create( {
|
15
|
+
* locale: {
|
16
|
+
* // The localization configuration.
|
17
|
+
* }
|
18
|
+
* } )
|
19
|
+
* .then( ... )
|
20
|
+
* .catch( ... );
|
21
|
+
* ```
|
22
|
+
*
|
23
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor configuration options}.
|
24
|
+
*/
|
25
|
+
export interface LocaleConfig {
|
26
|
+
/**
|
27
|
+
* A function that formats date to the custom format. It is used in dates in annotations (balloons) displaying
|
28
|
+
* comments and suggestions details.
|
29
|
+
*
|
30
|
+
* The default formatting can be changed by setting a custom formatting function to `config.locale.dateTimeFormat`.
|
31
|
+
*
|
32
|
+
* ```ts
|
33
|
+
* import format from 'date-fns/format';
|
34
|
+
*
|
35
|
+
* ClassicEditor
|
36
|
+
* .create( document.querySelector( '#editor' ), {
|
37
|
+
* toolbar: {
|
38
|
+
* items: [ 'bold', 'italic', '|', 'comment' ]
|
39
|
+
* },
|
40
|
+
* sidebar: {
|
41
|
+
* container: document.querySelector( '#sidebar' )
|
42
|
+
* },
|
43
|
+
* locale: {
|
44
|
+
* dateTimeFormat: date => format( date, 'dd/MM/yyyy' )
|
45
|
+
* }
|
46
|
+
* } )
|
47
|
+
* .catch( error => console.error( error ) );
|
48
|
+
* ```
|
49
|
+
*
|
50
|
+
* @returns The generated date.
|
51
|
+
*/
|
52
|
+
dateTimeFormat?: (date: Date) => string;
|
53
|
+
}
|
54
|
+
/**
|
55
|
+
* The configuration of the real-time collaboration features.
|
56
|
+
*
|
57
|
+
* ```ts
|
58
|
+
* ClassicEditor
|
59
|
+
* .create( {
|
60
|
+
* collaboration: ... // Collaboration features configuration.
|
61
|
+
* } )
|
62
|
+
* .then( ... )
|
63
|
+
* .catch( ... );
|
64
|
+
* ```
|
65
|
+
*
|
66
|
+
* See {@link module:core/editor/editorconfig~EditorConfig all editor options}.
|
67
|
+
*/
|
68
|
+
export interface RealTimeCollaborationConfig {
|
69
|
+
/**
|
70
|
+
* The channel ID is a unique ID that identifies the data loaded in the editor instance or used by
|
71
|
+
* the context instance.
|
72
|
+
*
|
73
|
+
* If specified for the editor, it is the document ID.
|
74
|
+
*
|
75
|
+
* If you are using multiple editors instances at the same time, each of them should use a different
|
76
|
+
* channel ID to connect to a specific document.
|
77
|
+
*
|
78
|
+
* If specified for context, it is the ID for all the data related to context instance.
|
79
|
+
* This ID will be used for data that is not related to an editor instance, for example comments
|
80
|
+
* outside the editor.
|
81
|
+
*
|
82
|
+
* In the case of context, the ID can be an ID of a subpage or a form, or a different entity accordingly
|
83
|
+
* to your application.
|
84
|
+
*
|
85
|
+
* The channel ID can be used to recognize entity to which piece of data belongs in integrations that use `Context`
|
86
|
+
* and context plugins. For example, if you are preparing a custom integration using the comments API,
|
87
|
+
* you can use the channel ID to recognize whether the comment was added to an editor instance
|
88
|
+
* (and which one) or to the context.
|
89
|
+
*
|
90
|
+
* ```ts
|
91
|
+
* ClassicEditor
|
92
|
+
* .create( {
|
93
|
+
* collaboration: {
|
94
|
+
* channelId: 'your-channel-id'
|
95
|
+
* }
|
96
|
+
* } )
|
97
|
+
* .then( ... )
|
98
|
+
* .catch( ... );
|
99
|
+
* ```
|
100
|
+
*/
|
101
|
+
channelId?: string;
|
102
|
+
}
|
package/src/index.d.ts
CHANGED
@@ -1,18 +1,19 @@
|
|
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
|
-
export { default as Permissions } from './permissions';
|
6
|
-
export { default as Users, type User } from './users';
|
7
|
-
export { default as UserView } from './users/view/userview';
|
8
|
-
export { default as getDateTimeFormatter } from './utils/getdatetimeformatter';
|
9
|
-
export { default as getMarkerDomElement, getAllMarkersDomElementsSorted } from './utils/getmarkerdomelement';
|
10
|
-
export { default as trimHtml } from './utils/trim-html';
|
11
|
-
export { default as ConfirmMixin } from './utils/confirmmixin';
|
12
|
-
export { default as hashObject } from './utils/hashobject';
|
13
|
-
export { default as sanitizeEditorConfig } from './utils/sanitizeEditorConfig';
|
14
|
-
export { default as
|
15
|
-
export { default as
|
16
|
-
export
|
17
|
-
export
|
18
|
-
|
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
|
+
export { default as Permissions } from './permissions';
|
6
|
+
export { default as Users, type User } from './users';
|
7
|
+
export { default as UserView } from './users/view/userview';
|
8
|
+
export { default as getDateTimeFormatter } from './utils/getdatetimeformatter';
|
9
|
+
export { default as getMarkerDomElement, getAllMarkersDomElementsSorted } from './utils/getmarkerdomelement';
|
10
|
+
export { default as trimHtml } from './utils/trim-html';
|
11
|
+
export { default as ConfirmMixin } from './utils/confirmmixin';
|
12
|
+
export { default as hashObject } from './utils/hashobject';
|
13
|
+
export { default as sanitizeEditorConfig } from './utils/sanitizeEditorConfig';
|
14
|
+
export { default as surroundingMarkersDetector } from './utils/surroundingmarkersdetector';
|
15
|
+
export { default as CollaborationOperation, InsertCollaborationOperation, SplitCollaborationOperation, MarkerCollaborationOperation, MoveCollaborationOperation, MergeCollaborationOperation, RootCollaborationOperation, RootAttributeCollaborationOperation } from './collaborationoperation';
|
16
|
+
export { default as CollaborationHistory } from './collaborationhistory';
|
17
|
+
export type { LocaleConfig, RealTimeCollaborationConfig } from './config';
|
18
|
+
export * from './suggestionstyles';
|
19
|
+
import './augmentation';
|
package/src/index.js
CHANGED
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
export{default as Permissions}from'./permissions';export{default as Users}from'./users';export{default as UserView}from'./users/view/userview';export{default as getDateTimeFormatter}from'./utils/getdatetimeformatter';export{default as getMarkerDomElement,getAllMarkersDomElementsSorted}from'./utils/getmarkerdomelement';export{default as trimHtml}from'./utils/trim-html';export{default as ConfirmMixin}from'./utils/confirmmixin';export{default as hashObject}from'./utils/hashobject';export{default as sanitizeEditorConfig}from'./utils/sanitizeEditorConfig';export*from'./suggestionstyles';import'./augmentation';
|
23
|
+
export{default as Permissions}from'./permissions';export{default as Users}from'./users';export{default as UserView}from'./users/view/userview';export{default as getDateTimeFormatter}from'./utils/getdatetimeformatter';export{default as getMarkerDomElement,getAllMarkersDomElementsSorted}from'./utils/getmarkerdomelement';export{default as trimHtml}from'./utils/trim-html';export{default as ConfirmMixin}from'./utils/confirmmixin';export{default as hashObject}from'./utils/hashobject';export{default as sanitizeEditorConfig}from'./utils/sanitizeEditorConfig';export{default as surroundingMarkersDetector}from'./utils/surroundingmarkersdetector';export*from'./suggestionstyles';import'./augmentation';
|
package/src/permissions.d.ts
CHANGED
@@ -1,45 +1,46 @@
|
|
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 collaboration-core/permissions
|
7
|
-
* @publicApi
|
8
|
-
*/
|
9
|
-
import { ContextPlugin } from 'ckeditor5/src/core';
|
10
|
-
/**
|
11
|
-
* The `Permissions` plugin manages permissions set for the local user.
|
12
|
-
*
|
13
|
-
* Following is the list of all defined permissions:
|
14
|
-
*
|
15
|
-
* * `document:write` - modify the content of the document,
|
16
|
-
* * `comment:write` - create, edit and remove own comments and create,
|
17
|
-
*
|
18
|
-
* * `comment:
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
*
|
25
|
-
*
|
26
|
-
*
|
27
|
-
*
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
*
|
37
|
-
*
|
38
|
-
*
|
39
|
-
* is not
|
40
|
-
*
|
41
|
-
*
|
42
|
-
* @param
|
43
|
-
|
44
|
-
|
45
|
-
|
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 collaboration-core/permissions
|
7
|
+
* @publicApi
|
8
|
+
*/
|
9
|
+
import { ContextPlugin } from 'ckeditor5/src/core';
|
10
|
+
/**
|
11
|
+
* The `Permissions` plugin manages permissions set for the local user.
|
12
|
+
*
|
13
|
+
* Following is the list of all defined permissions:
|
14
|
+
*
|
15
|
+
* * `document:write` - modify the content of the document, and resolve comment threads created by any user,
|
16
|
+
* * `comment:write` - create, edit and remove own comments and create, remove own comment threads,
|
17
|
+
* and resolve comment threads created by any user,
|
18
|
+
* * `comment:admin` - resolve and remove comment threads created by other users (enables `comment:write`).
|
19
|
+
* * `comment:modify_all` - edit and remove any comments created by other users.
|
20
|
+
*
|
21
|
+
* For example, a user with `comment:write` permission but with no `document:write` permission will be able to add
|
22
|
+
* comments but will not be able to change the document data (comments-only mode).
|
23
|
+
*
|
24
|
+
* By default, the following permissions are set: `document:write`, `comment:write`, `comment:admin`.
|
25
|
+
*
|
26
|
+
* Permissions are handled separately for each channel id (for each editor instance and context instance).
|
27
|
+
*
|
28
|
+
* See also the {@glink features/collaboration/users#user-permissions User permissions} guide to learn how to use this plugin.
|
29
|
+
*/
|
30
|
+
export default class Permissions extends ContextPlugin {
|
31
|
+
/**
|
32
|
+
* @inheritDoc
|
33
|
+
*/
|
34
|
+
static get pluginName(): "Permissions";
|
35
|
+
/**
|
36
|
+
* Sets permissions for editor/context instance with given `channelId`.
|
37
|
+
*
|
38
|
+
* If `channelId` is not set, the channel id of the editor/context to which the plugin was added will be used.
|
39
|
+
* This means that it is not required if the plugin is added to the editor configuration and {@link module:core/context~Context}
|
40
|
+
* is not used.
|
41
|
+
*
|
42
|
+
* @param permissions Permissions to set.
|
43
|
+
* @param channelId The channel ID.
|
44
|
+
*/
|
45
|
+
setPermissions(permissions: Array<string>, channelId?: string): void;
|
46
|
+
}
|
package/src/permissions.js
CHANGED
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
const
|
23
|
+
const _0x142f=['setPermissions','noPermissions','CommentsRepository','comment:admin','collaboration.channelId','includes','context','no-permissions','forceDisabled','disableReadOnlyMode','addCommentThread','comment:modify_all','has','isEnabled','config','document:write','find','plugins','commands','editors','Permissions','get','permissions-set-permissions-invalid-channel-id','pluginName'];(function(_0x272124,_0x142fff){const _0x791c89=function(_0x4c286a){while(--_0x4c286a){_0x272124['push'](_0x272124['shift']());}};_0x791c89(++_0x142fff);}(_0x142f,0x108));const _0x791c=function(_0x272124,_0x142fff){_0x272124=_0x272124-0x0;let _0x791c89=_0x142f[_0x272124];return _0x791c89;};import{ContextPlugin as _0x2e12ad,Editor as _0x2149cb}from'ckeditor5/src/core';import{CKEditorError as _0xabdcfe}from'ckeditor5/src/utils';export default class n extends _0x2e12ad{static get[_0x791c('0x17')](){return _0x791c('0x14');}[_0x791c('0x0')](_0x2a310c,_0x529305){let _0x951671;if(_0x529305||(_0x529305=this['context'][_0x791c('0xe')][_0x791c('0x15')]('collaboration.channelId')),this[_0x791c('0x6')][_0x791c('0xe')][_0x791c('0x15')](_0x791c('0x4'))==_0x529305?_0x951671=this['context']:_0x791c('0x13')in this[_0x791c('0x6')]&&this[_0x791c('0x6')][_0x791c('0x13')]&&(_0x951671=this['context']['editors'][_0x791c('0x10')](_0x4c499f=>_0x4c499f[_0x791c('0xe')][_0x791c('0x15')](_0x791c('0x4'))==_0x529305)),!_0x951671)throw new _0xabdcfe(_0x791c('0x16'),null);const _0xd932fc=_0x951671[_0x791c('0x11')],_0x9f5c31=_0xd932fc[_0x791c('0xc')](_0x791c('0x2'))?_0xd932fc[_0x791c('0x15')](_0x791c('0x2')):void 0x0,_0x4c88f2=_0xd932fc[_0x791c('0xc')]('CommentsOnly')&&_0xd932fc[_0x791c('0x15')]('CommentsOnly'),_0x3ce590=_0x2a310c[_0x791c('0x5')](_0x791c('0xf')),_0x13205f=_0x2a310c[_0x791c('0x5')](_0x791c('0xb')),_0xc44818=_0x2a310c['includes'](_0x791c('0x3')),_0x985c00=_0x2a310c[_0x791c('0x5')]('comment:write'),_0x223543=_0x985c00||_0xc44818,_0xfdd836=_0x223543||_0x13205f,_0x5804de=_0x3ce590||_0x223543;(_0x4c88f2&&(_0x4c88f2[_0x791c('0xd')]=!_0x3ce590&&_0xfdd836),_0x951671 instanceof _0x2149cb)&&(!(_0x3ce590||_0xfdd836&&_0x9f5c31)?_0x951671['enableReadOnlyMode']('no-permissions'):_0x951671[_0x791c('0x9')](_0x791c('0x7')));if(_0x9f5c31){_0x9f5c31[_0x791c('0x0')]({'admin':_0xc44818,'modifyAll':_0x13205f,'write':_0x985c00,'resolve':_0x5804de},_0x529305);const _0x438456=_0x951671 instanceof _0x2149cb&&_0x951671[_0x791c('0x12')][_0x791c('0x15')](_0x791c('0xa'));_0x438456&&(_0x223543?_0x438456['clearForceDisabled'](_0x791c('0x1')):_0x438456[_0x791c('0x8')](_0x791c('0x1')));}}}
|
@@ -1,12 +1,12 @@
|
|
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 '../theme/suggestion.css';
|
6
|
-
import '../theme/suggestionmarker.css';
|
7
|
-
import '../theme/integrations/image.css';
|
8
|
-
import '../theme/integrations/horizontalline.css';
|
9
|
-
import '../theme/integrations/mediaembed.css';
|
10
|
-
import '../theme/integrations/pagebreak.css';
|
11
|
-
import '../theme/integrations/table.css';
|
12
|
-
import '../theme/integrations/codeblock.css';
|
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 '../theme/suggestion.css';
|
6
|
+
import '../theme/suggestionmarker.css';
|
7
|
+
import '../theme/integrations/image.css';
|
8
|
+
import '../theme/integrations/horizontalline.css';
|
9
|
+
import '../theme/integrations/mediaembed.css';
|
10
|
+
import '../theme/integrations/pagebreak.css';
|
11
|
+
import '../theme/integrations/table.css';
|
12
|
+
import '../theme/integrations/codeblock.css';
|