@ckeditor/ckeditor5-collaboration-core 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 (98) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/LICENSE.md +6 -6
  3. package/README.md +9 -9
  4. package/lang/translations/af.po +1 -0
  5. package/lang/translations/ar.po +1 -0
  6. package/lang/translations/az.po +1 -0
  7. package/lang/translations/bg.po +1 -0
  8. package/lang/translations/bn.po +1 -0
  9. package/lang/translations/bs.po +1 -0
  10. package/lang/translations/ca.po +1 -0
  11. package/lang/translations/cs.po +1 -0
  12. package/lang/translations/da.po +1 -0
  13. package/lang/translations/de-ch.po +1 -0
  14. package/lang/translations/de.po +1 -0
  15. package/lang/translations/el.po +1 -0
  16. package/lang/translations/en-au.po +1 -0
  17. package/lang/translations/en.po +1 -0
  18. package/lang/translations/es-co.po +1 -0
  19. package/lang/translations/es.po +1 -0
  20. package/lang/translations/et.po +1 -0
  21. package/lang/translations/fa.po +1 -0
  22. package/lang/translations/fi.po +1 -0
  23. package/lang/translations/fr.po +1 -0
  24. package/lang/translations/gl.po +1 -0
  25. package/lang/translations/he.po +1 -0
  26. package/lang/translations/hi.po +1 -0
  27. package/lang/translations/hr.po +1 -0
  28. package/lang/translations/hu.po +1 -0
  29. package/lang/translations/id.po +1 -0
  30. package/lang/translations/it.po +1 -0
  31. package/lang/translations/ja.po +1 -0
  32. package/lang/translations/jv.po +1 -0
  33. package/lang/translations/ko.po +1 -0
  34. package/lang/translations/lt.po +1 -0
  35. package/lang/translations/lv.po +1 -0
  36. package/lang/translations/ms.po +1 -0
  37. package/lang/translations/nl.po +1 -0
  38. package/lang/translations/no.po +1 -0
  39. package/lang/translations/pl.po +1 -0
  40. package/lang/translations/pt-br.po +1 -0
  41. package/lang/translations/pt.po +1 -0
  42. package/lang/translations/ro.po +1 -0
  43. package/lang/translations/ru.po +1 -0
  44. package/lang/translations/sk.po +1 -0
  45. package/lang/translations/sr-latn.po +1 -0
  46. package/lang/translations/sr.po +1 -0
  47. package/lang/translations/sv.po +1 -0
  48. package/lang/translations/th.po +1 -0
  49. package/lang/translations/tk.po +1 -0
  50. package/lang/translations/tr.po +1 -0
  51. package/lang/translations/tt.po +1 -0
  52. package/lang/translations/ug.po +1 -0
  53. package/lang/translations/uk.po +1 -0
  54. package/lang/translations/ur.po +1 -0
  55. package/lang/translations/vi.po +1 -0
  56. package/lang/translations/zh-cn.po +1 -0
  57. package/lang/translations/zh.po +1 -0
  58. package/package.json +2 -6
  59. package/src/augmentation.d.ts +38 -38
  60. package/src/collaborationhistory.d.ts +21 -21
  61. package/src/collaborationoperation.d.ts +28 -28
  62. package/src/config.d.ts +102 -102
  63. package/src/index.d.ts +18 -18
  64. package/src/permissions.d.ts +45 -45
  65. package/src/permissions.js +1 -1
  66. package/src/suggestionstyles.d.ts +12 -12
  67. package/src/users/view/userview.d.ts +16 -16
  68. package/src/users/view/userview.js +1 -1
  69. package/src/users.d.ts +161 -150
  70. package/src/users.js +1 -1
  71. package/src/utils/common-translations.d.ts +9 -9
  72. package/src/utils/common-translations.js +1 -1
  73. package/src/utils/confirmmixin.d.ts +20 -20
  74. package/src/utils/confirmmixin.js +1 -1
  75. package/src/utils/confirmview.d.ts +13 -13
  76. package/src/utils/confirmview.js +1 -1
  77. package/src/utils/getdatetimeformatter.d.ts +29 -29
  78. package/src/utils/getdatetimeformatter.js +1 -1
  79. package/src/utils/getmarkerdomelement.d.ts +22 -22
  80. package/src/utils/getmarkerdomelement.js +1 -1
  81. package/src/utils/hashobject.d.ts +8 -8
  82. package/src/utils/hashobject.js +1 -1
  83. package/src/utils/sanitizeEditorConfig.d.ts +15 -15
  84. package/src/utils/sanitizeEditorConfig.js +1 -1
  85. package/src/utils/trim-html.d.ts +16 -16
  86. package/src/utils/trim-html.js +1 -1
  87. package/theme/icons/notification.svg +1 -1
  88. package/theme/integrations/codeblock.css +9 -0
  89. package/theme/integrations/horizontalline.css +9 -0
  90. package/theme/integrations/image.css +31 -20
  91. package/theme/integrations/mediaembed.css +9 -0
  92. package/theme/integrations/pagebreak.css +9 -0
  93. package/theme/integrations/table.css +32 -23
  94. package/theme/suggestion.css +10 -1
  95. package/theme/suggestionmarker.css +2 -1
  96. package/theme/usercolormixin.css +10 -1
  97. package/theme/usercolors.css +2 -1
  98. package/theme/users.css +5 -4
@@ -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,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 CollaborationOperation, InsertCollaborationOperation, SplitCollaborationOperation, MarkerCollaborationOperation, MoveCollaborationOperation, MergeCollaborationOperation, RootCollaborationOperation, RootAttributeCollaborationOperation } from './collaborationoperation';
15
- export { default as CollaborationHistory } from './collaborationhistory';
16
- export type { LocaleConfig, RealTimeCollaborationConfig } from './config';
17
- export * from './suggestionstyles';
18
- import './augmentation';
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 CollaborationOperation, InsertCollaborationOperation, SplitCollaborationOperation, MarkerCollaborationOperation, MoveCollaborationOperation, MergeCollaborationOperation, RootCollaborationOperation, RootAttributeCollaborationOperation } from './collaborationoperation';
15
+ export { default as CollaborationHistory } from './collaborationhistory';
16
+ export type { LocaleConfig, RealTimeCollaborationConfig } from './config';
17
+ export * from './suggestionstyles';
18
+ import './augmentation';
@@ -1,45 +1,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,
16
- * * `comment:write` - create, edit and remove own comments and create, resolve and remove own comment threads,
17
- * * `comment:admin` - resolve and remove comment threads created by other users (enables `comment:write`).
18
- * * `comment:modify_all` - edit and remove any comments created by other users.
19
- *
20
- * For example, a user with `comment:write` permission but with no `document:write` permission will be able to add
21
- * comments but will not be able to change the document data (comments-only mode).
22
- *
23
- * By default, the following permissions are set: `document:write`, `comment:write`, `comment:admin`.
24
- *
25
- * Permissions are handled separately for each channel id (for each editor instance and context instance).
26
- *
27
- * See also the {@glink features/collaboration/users#user-permissions User permissions} guide to learn how to use this plugin.
28
- */
29
- export default class Permissions extends ContextPlugin {
30
- /**
31
- * @inheritDoc
32
- */
33
- static get pluginName(): "Permissions";
34
- /**
35
- * Sets permissions for editor/context instance with given `channelId`.
36
- *
37
- * If `channelId` is not set, the channel id of the editor/context to which the plugin was added will be used.
38
- * This means that it is not required if the plugin is added to the editor configuration and {@link module:core/context~Context}
39
- * is not used.
40
- *
41
- * @param permissions Permissions to set.
42
- * @param channelId The channel ID.
43
- */
44
- setPermissions(permissions: Array<string>, channelId?: string): void;
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,
16
+ * * `comment:write` - create, edit and remove own comments and create, resolve and remove own comment threads,
17
+ * * `comment:admin` - resolve and remove comment threads created by other users (enables `comment:write`).
18
+ * * `comment:modify_all` - edit and remove any comments created by other users.
19
+ *
20
+ * For example, a user with `comment:write` permission but with no `document:write` permission will be able to add
21
+ * comments but will not be able to change the document data (comments-only mode).
22
+ *
23
+ * By default, the following permissions are set: `document:write`, `comment:write`, `comment:admin`.
24
+ *
25
+ * Permissions are handled separately for each channel id (for each editor instance and context instance).
26
+ *
27
+ * See also the {@glink features/collaboration/users#user-permissions User permissions} guide to learn how to use this plugin.
28
+ */
29
+ export default class Permissions extends ContextPlugin {
30
+ /**
31
+ * @inheritDoc
32
+ */
33
+ static get pluginName(): "Permissions";
34
+ /**
35
+ * Sets permissions for editor/context instance with given `channelId`.
36
+ *
37
+ * If `channelId` is not set, the channel id of the editor/context to which the plugin was added will be used.
38
+ * This means that it is not required if the plugin is added to the editor configuration and {@link module:core/context~Context}
39
+ * is not used.
40
+ *
41
+ * @param permissions Permissions to set.
42
+ * @param channelId The channel ID.
43
+ */
44
+ setPermissions(permissions: Array<string>, channelId?: string): void;
45
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xac1c=['plugins','collaboration.channelId','isEnabled','find','noPermissions','commands','permissions-set-permissions-invalid-channel-id','pluginName','CommentsRepository','disableReadOnlyMode','comment:modify_all','Permissions','no-permissions','context','get','setPermissions','forceDisabled','includes','clearForceDisabled','comment:write','enableReadOnlyMode','editors','config','CommentsOnly'];(function(_0x27fef9,_0xac1cf9){const _0x1ba86e=function(_0x340c6c){while(--_0x340c6c){_0x27fef9['push'](_0x27fef9['shift']());}};_0x1ba86e(++_0xac1cf9);}(_0xac1c,0x10c));const _0x1ba8=function(_0x27fef9,_0xac1cf9){_0x27fef9=_0x27fef9-0x0;let _0x1ba86e=_0xac1c[_0x27fef9];return _0x1ba86e;};import{ContextPlugin as _0x342656,Editor as _0x22f10f}from'ckeditor5/src/core';import{CKEditorError as _0x2aa86d}from'ckeditor5/src/utils';export default class n extends _0x342656{static get[_0x1ba8('0x3')](){return _0x1ba8('0x7');}['setPermissions'](_0x57f15c,_0x50262a){let _0x2f3068;if(_0x50262a||(_0x50262a=this[_0x1ba8('0x9')][_0x1ba8('0x12')][_0x1ba8('0xa')]('collaboration.channelId')),this['context'][_0x1ba8('0x12')][_0x1ba8('0xa')]('collaboration.channelId')==_0x50262a?_0x2f3068=this['context']:_0x1ba8('0x11')in this[_0x1ba8('0x9')]&&this[_0x1ba8('0x9')][_0x1ba8('0x11')]&&(_0x2f3068=this[_0x1ba8('0x9')][_0x1ba8('0x11')][_0x1ba8('0x17')](_0x461857=>_0x461857[_0x1ba8('0x12')][_0x1ba8('0xa')](_0x1ba8('0x15'))==_0x50262a)),!_0x2f3068)throw new _0x2aa86d(_0x1ba8('0x2'),null);const _0x4a8b4a=_0x2f3068[_0x1ba8('0x14')],_0x81c06e=_0x4a8b4a['has'](_0x1ba8('0x4'))?_0x4a8b4a[_0x1ba8('0xa')](_0x1ba8('0x4')):void 0x0,_0x183a8c=_0x4a8b4a['has'](_0x1ba8('0x13'))&&_0x4a8b4a[_0x1ba8('0xa')]('CommentsOnly'),_0x456852=_0x57f15c['includes']('document:write'),_0x37da27=_0x57f15c['includes'](_0x1ba8('0x6')),_0x1459ac=_0x57f15c[_0x1ba8('0xd')]('comment:admin'),_0x250fc0=_0x57f15c['includes'](_0x1ba8('0xf')),_0x3e7a9f=_0x250fc0||_0x1459ac,_0x5e178b=_0x3e7a9f||_0x37da27,_0x2f2bc4=_0x456852||_0x3e7a9f;(_0x183a8c&&(_0x183a8c[_0x1ba8('0x16')]=!_0x456852&&_0x5e178b),_0x2f3068 instanceof _0x22f10f)&&(!(_0x456852||_0x5e178b&&_0x81c06e)?_0x2f3068[_0x1ba8('0x10')](_0x1ba8('0x8')):_0x2f3068[_0x1ba8('0x5')]('no-permissions'));if(_0x81c06e){_0x81c06e[_0x1ba8('0xb')]({'admin':_0x1459ac,'modifyAll':_0x37da27,'write':_0x250fc0,'resolve':_0x2f2bc4},_0x50262a);const _0x54001a=_0x2f3068 instanceof _0x22f10f&&_0x2f3068[_0x1ba8('0x1')][_0x1ba8('0xa')]('addCommentThread');_0x54001a&&(_0x3e7a9f?_0x54001a[_0x1ba8('0xe')](_0x1ba8('0x0')):_0x54001a[_0x1ba8('0xc')](_0x1ba8('0x0')));}}}
23
+ const _0x589a=['no-permissions','commands','includes','context','get','editors','setPermissions','disableReadOnlyMode','noPermissions','comment:write','Permissions','collaboration.channelId','comment:admin','find','addCommentThread','permissions-set-permissions-invalid-channel-id','has','CommentsOnly','pluginName','document:write','config','CommentsRepository','isEnabled','comment:modify_all','clearForceDisabled'];(function(_0x1a2819,_0x589a4d){const _0x17aa8a=function(_0x5afd10){while(--_0x5afd10){_0x1a2819['push'](_0x1a2819['shift']());}};_0x17aa8a(++_0x589a4d);}(_0x589a,0x6a));const _0x17aa=function(_0x1a2819,_0x589a4d){_0x1a2819=_0x1a2819-0x0;let _0x17aa8a=_0x589a[_0x1a2819];return _0x17aa8a;};import{ContextPlugin as _0x3e2c45,Editor as _0x5cf335}from'ckeditor5/src/core';import{CKEditorError as _0x2d1f11}from'ckeditor5/src/utils';export default class n extends _0x3e2c45{static get[_0x17aa('0xc')](){return _0x17aa('0x4');}[_0x17aa('0x0')](_0x84380c,_0x578ab1){let _0x7196af;if(_0x578ab1||(_0x578ab1=this[_0x17aa('0x16')][_0x17aa('0xe')][_0x17aa('0x17')](_0x17aa('0x5'))),this[_0x17aa('0x16')]['config'][_0x17aa('0x17')](_0x17aa('0x5'))==_0x578ab1?_0x7196af=this[_0x17aa('0x16')]:'editors'in this[_0x17aa('0x16')]&&this[_0x17aa('0x16')]['editors']&&(_0x7196af=this[_0x17aa('0x16')][_0x17aa('0x18')][_0x17aa('0x7')](_0x93dd10=>_0x93dd10[_0x17aa('0xe')][_0x17aa('0x17')]('collaboration.channelId')==_0x578ab1)),!_0x7196af)throw new _0x2d1f11(_0x17aa('0x9'),null);const _0x5b9f05=_0x7196af['plugins'],_0x1f5480=_0x5b9f05[_0x17aa('0xa')](_0x17aa('0xf'))?_0x5b9f05['get'](_0x17aa('0xf')):void 0x0,_0xd91684=_0x5b9f05['has'](_0x17aa('0xb'))&&_0x5b9f05['get'](_0x17aa('0xb')),_0x2c292a=_0x84380c[_0x17aa('0x15')](_0x17aa('0xd')),_0x59c8c8=_0x84380c['includes'](_0x17aa('0x11')),_0x19966c=_0x84380c['includes'](_0x17aa('0x6')),_0x172ee4=_0x84380c[_0x17aa('0x15')](_0x17aa('0x3')),_0x16227e=_0x172ee4||_0x19966c,_0x38f753=_0x16227e||_0x59c8c8,_0x4582c4=_0x2c292a||_0x16227e;(_0xd91684&&(_0xd91684[_0x17aa('0x10')]=!_0x2c292a&&_0x38f753),_0x7196af instanceof _0x5cf335)&&(!(_0x2c292a||_0x38f753&&_0x1f5480)?_0x7196af['enableReadOnlyMode']('no-permissions'):_0x7196af[_0x17aa('0x1')](_0x17aa('0x13')));if(_0x1f5480){_0x1f5480[_0x17aa('0x0')]({'admin':_0x19966c,'modifyAll':_0x59c8c8,'write':_0x172ee4,'resolve':_0x4582c4},_0x578ab1);const _0x3c98de=_0x7196af instanceof _0x5cf335&&_0x7196af[_0x17aa('0x14')][_0x17aa('0x17')](_0x17aa('0x8'));_0x3c98de&&(_0x16227e?_0x3c98de[_0x17aa('0x12')](_0x17aa('0x2')):_0x3c98de['forceDisabled'](_0x17aa('0x2')));}}}
@@ -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';
@@ -1,16 +1,16 @@
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/users/view/userview
7
- */
8
- import { View, type TemplateDefinition } from 'ckeditor5/src/ui';
9
- import type { Locale } from 'ckeditor5/src/utils';
10
- import type { User } from '../../users';
11
- import '../../../theme/users.css';
12
- export default class UserView extends View {
13
- name: string;
14
- notificationView: TemplateDefinition | null;
15
- constructor(locale: Locale, user: User, notificationText?: null | string);
16
- }
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/users/view/userview
7
+ */
8
+ import { View, type TemplateDefinition } from 'ckeditor5/src/ui';
9
+ import type { Locale } from 'ckeditor5/src/utils';
10
+ import type { User } from '../../users';
11
+ import '../../../theme/users.css';
12
+ export default class UserView extends View {
13
+ name: string;
14
+ notificationView: TemplateDefinition | null;
15
+ constructor(locale: Locale, user: User, notificationText?: null | string);
16
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0x6e9b=['initials','ck-user__anonymous','ck\x20ck-user__name','ck-user__img','push','setTemplate','notificationView','ck-user','div','isAnonymous','extendTemplate','url(\x27','ck-user__notification','avatar','name','ck\x20ck-user__name\x20ck-user__name--hidden'];(function(_0x3f65b4,_0x6e9b6a){const _0x5893a8=function(_0x3b115d){while(--_0x3b115d){_0x3f65b4['push'](_0x3f65b4['shift']());}};_0x5893a8(++_0x6e9b6a);}(_0x6e9b,0x16e));const _0x5893=function(_0x3f65b4,_0x6e9b6a){_0x3f65b4=_0x3f65b4-0x0;let _0x5893a8=_0x6e9b[_0x3f65b4];return _0x5893a8;};import{View as _0x34ed80,IconView as _0xa80182}from'ckeditor5/src/ui';import _0x33880d from'../../../theme/icons/notification.svg';import'../../../theme/users.css';export default class B extends _0x34ed80{constructor(_0x155de8,_0x548b7d,_0x4e7a57){super(_0x155de8),this[_0x5893('0x0')]=_0x548b7d[_0x5893('0x0')],this[_0x5893('0x8')]=null;const _0x5e11ae=['ck',_0x5893('0x5')];if(_0x548b7d[_0x5893('0xb')]&&_0x5e11ae[_0x5893('0x6')](_0x5893('0x3')),_0x548b7d[_0x5893('0xf')]&&_0x5e11ae[_0x5893('0x6')]('ck-user__avatar'),_0x4e7a57){const _0x5ae556=new _0xa80182();_0x5ae556[_0x5893('0xc')]({'attributes':{'class':['ck-user__icon']}}),_0x5ae556['content']=_0x33880d,this[_0x5893('0x8')]={'tag':_0x5893('0xa'),'attributes':{'class':['ck',_0x5893('0xe')],'data-cke-tooltip-position':'n','data-cke-tooltip-text':_0x4e7a57},'children':[_0x5ae556]};}const _0x311cc5=[{'tag':'div','attributes':{'class':_0x5e11ae,'style':{'background-image':_0x548b7d['avatar']?_0x5893('0xd')+_0x548b7d[_0x5893('0xf')]+'\x27)':''}}},{'tag':_0x5893('0xa'),'attributes':{'class':_0x548b7d['avatar']?_0x5893('0x1'):_0x5893('0x4')},'children':[{'text':_0x548b7d[_0x5893('0x2')]}]}];this[_0x5893('0x8')]&&_0x311cc5[_0x5893('0x6')](this['notificationView']),this[_0x5893('0x7')]({'tag':_0x5893('0xa'),'attributes':{'class':['ck',_0x5893('0x9')],'data-user-id':_0x548b7d['id']},'children':_0x311cc5});}}
23
+ const _0x2d0a=['name','initials','isAnonymous','ck-user__avatar','push','url(\x27','ck-user__anonymous','ck-user__img','setTemplate','ck-user__icon','div','content','ck-user','ck-user__notification','extendTemplate','ck\x20ck-user__name\x20ck-user__name--hidden','avatar','notificationView'];(function(_0x58b4fd,_0x2d0ab4){const _0x223930=function(_0x35a5ba){while(--_0x35a5ba){_0x58b4fd['push'](_0x58b4fd['shift']());}};_0x223930(++_0x2d0ab4);}(_0x2d0a,0x1d8));const _0x2239=function(_0x58b4fd,_0x2d0ab4){_0x58b4fd=_0x58b4fd-0x0;let _0x223930=_0x2d0a[_0x58b4fd];return _0x223930;};import{View as _0x5365bc,IconView as _0x16daae}from'ckeditor5/src/ui';import _0x2c445d from'../../../theme/icons/notification.svg';import'../../../theme/users.css';export default class B extends _0x5365bc{constructor(_0x5c51ee,_0x1c7273,_0xab3048){super(_0x5c51ee),this[_0x2239('0xe')]=_0x1c7273[_0x2239('0xe')],this[_0x2239('0xd')]=null;const _0x39bf5a=['ck',_0x2239('0x3')];if(_0x1c7273[_0x2239('0x10')]&&_0x39bf5a['push'](_0x2239('0x2')),_0x1c7273[_0x2239('0xc')]&&_0x39bf5a[_0x2239('0x0')](_0x2239('0x11')),_0xab3048){const _0x4e6e20=new _0x16daae();_0x4e6e20[_0x2239('0xa')]({'attributes':{'class':[_0x2239('0x5')]}}),_0x4e6e20[_0x2239('0x7')]=_0x2c445d,this[_0x2239('0xd')]={'tag':_0x2239('0x6'),'attributes':{'class':['ck',_0x2239('0x9')],'data-cke-tooltip-position':'n','data-cke-tooltip-text':_0xab3048},'children':[_0x4e6e20]};}const _0x49928f=[{'tag':_0x2239('0x6'),'attributes':{'class':_0x39bf5a,'style':{'background-image':_0x1c7273[_0x2239('0xc')]?_0x2239('0x1')+_0x1c7273['avatar']+'\x27)':''}}},{'tag':_0x2239('0x6'),'attributes':{'class':_0x1c7273[_0x2239('0xc')]?_0x2239('0xb'):'ck\x20ck-user__name'},'children':[{'text':_0x1c7273[_0x2239('0xf')]}]}];this[_0x2239('0xd')]&&_0x49928f[_0x2239('0x0')](this[_0x2239('0xd')]),this[_0x2239('0x4')]({'tag':'div','attributes':{'class':['ck',_0x2239('0x8')],'data-user-id':_0x1c7273['id']},'children':_0x49928f});}}