@ckeditor/ckeditor5-collaboration-core 40.0.0 → 40.2.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.
@@ -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, 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, 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
+ }
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
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')));}}}
23
+ const _0x1c8f=['commands','CommentsOnly','setPermissions','get','no-permissions','isEnabled','noPermissions','permissions-set-permissions-invalid-channel-id','enableReadOnlyMode','document:write','CommentsRepository','editors','includes','comment:write','context','collaboration.channelId','pluginName','comment:modify_all','addCommentThread','plugins','Permissions','has','comment:admin','config','clearForceDisabled'];(function(_0x3f6bb3,_0x1c8fbf){const _0x3671bb=function(_0x7a50a9){while(--_0x7a50a9){_0x3f6bb3['push'](_0x3f6bb3['shift']());}};_0x3671bb(++_0x1c8fbf);}(_0x1c8f,0x16e));const _0x3671=function(_0x3f6bb3,_0x1c8fbf){_0x3f6bb3=_0x3f6bb3-0x0;let _0x3671bb=_0x1c8f[_0x3f6bb3];return _0x3671bb;};import{ContextPlugin as _0x35894c,Editor as _0x40bf17}from'ckeditor5/src/core';import{CKEditorError as _0xc209e2}from'ckeditor5/src/utils';export default class n extends _0x35894c{static get[_0x3671('0x0')](){return _0x3671('0x4');}[_0x3671('0xb')](_0x5444ca,_0x2dfb4b){let _0x57c5d0;if(_0x2dfb4b||(_0x2dfb4b=this[_0x3671('0x17')]['config'][_0x3671('0xc')](_0x3671('0x18'))),this['context']['config']['get']('collaboration.channelId')==_0x2dfb4b?_0x57c5d0=this[_0x3671('0x17')]:_0x3671('0x14')in this['context']&&this[_0x3671('0x17')][_0x3671('0x14')]&&(_0x57c5d0=this['context'][_0x3671('0x14')]['find'](_0x4162a2=>_0x4162a2[_0x3671('0x7')]['get']('collaboration.channelId')==_0x2dfb4b)),!_0x57c5d0)throw new _0xc209e2(_0x3671('0x10'),null);const _0x2fabd8=_0x57c5d0[_0x3671('0x3')],_0x5cc24f=_0x2fabd8[_0x3671('0x5')]('CommentsRepository')?_0x2fabd8['get'](_0x3671('0x13')):void 0x0,_0x14ad9f=_0x2fabd8[_0x3671('0x5')]('CommentsOnly')&&_0x2fabd8[_0x3671('0xc')](_0x3671('0xa')),_0x38f347=_0x5444ca[_0x3671('0x15')](_0x3671('0x12')),_0xd85eb1=_0x5444ca[_0x3671('0x15')](_0x3671('0x1')),_0xf8c5a0=_0x5444ca[_0x3671('0x15')](_0x3671('0x6')),_0x3a0e84=_0x5444ca[_0x3671('0x15')](_0x3671('0x16')),_0x243a6b=_0x3a0e84||_0xf8c5a0,_0x566783=_0x243a6b||_0xd85eb1,_0x5b1e4d=_0x38f347||_0x243a6b;(_0x14ad9f&&(_0x14ad9f[_0x3671('0xe')]=!_0x38f347&&_0x566783),_0x57c5d0 instanceof _0x40bf17)&&(!(_0x38f347||_0x566783&&_0x5cc24f)?_0x57c5d0[_0x3671('0x11')]('no-permissions'):_0x57c5d0['disableReadOnlyMode'](_0x3671('0xd')));if(_0x5cc24f){_0x5cc24f['setPermissions']({'admin':_0xf8c5a0,'modifyAll':_0xd85eb1,'write':_0x3a0e84,'resolve':_0x5b1e4d},_0x2dfb4b);const _0x496807=_0x57c5d0 instanceof _0x40bf17&&_0x57c5d0[_0x3671('0x9')][_0x3671('0xc')](_0x3671('0x2'));_0x496807&&(_0x243a6b?_0x496807[_0x3671('0x8')](_0x3671('0xf')):_0x496807['forceDisabled']('noPermissions'));}}}
@@ -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 _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});}}
23
+ const _0x1df4=['url(\x27','ck-user__notification','ck-user__avatar','avatar','div','content','ck\x20ck-user__name\x20ck-user__name--hidden','name','extendTemplate','initials','setTemplate','push','ck-user','ck\x20ck-user__name','ck-user__img','isAnonymous','notificationView','ck-user__icon'];(function(_0xc72dfb,_0x1df4bc){const _0x2eccc3=function(_0x91a364){while(--_0x91a364){_0xc72dfb['push'](_0xc72dfb['shift']());}};_0x2eccc3(++_0x1df4bc);}(_0x1df4,0x98));const _0x2ecc=function(_0xc72dfb,_0x1df4bc){_0xc72dfb=_0xc72dfb-0x0;let _0x2eccc3=_0x1df4[_0xc72dfb];return _0x2eccc3;};import{View as _0x24c3c8,IconView as _0x2cbf3f}from'ckeditor5/src/ui';import _0x172991 from'../../../theme/icons/notification.svg';import'../../../theme/users.css';export default class C extends _0x24c3c8{constructor(_0xe341e3,_0x39ff41,_0x100ea0){super(_0xe341e3),this[_0x2ecc('0x11')]=_0x39ff41[_0x2ecc('0x11')],this['notificationView']=null;const _0x671f48=['ck',_0x2ecc('0x6')];if(_0x39ff41[_0x2ecc('0x7')]&&_0x671f48[_0x2ecc('0x3')]('ck-user__anonymous'),_0x39ff41['avatar']&&_0x671f48[_0x2ecc('0x3')](_0x2ecc('0xc')),_0x100ea0){const _0x127798=new _0x2cbf3f();_0x127798[_0x2ecc('0x0')]({'attributes':{'class':[_0x2ecc('0x9')]}}),_0x127798[_0x2ecc('0xf')]=_0x172991,this[_0x2ecc('0x8')]={'tag':'div','attributes':{'class':['ck',_0x2ecc('0xb')],'data-cke-tooltip-position':'n','data-cke-tooltip-text':_0x100ea0},'children':[_0x127798]};}const _0x5ed59c=[{'tag':_0x2ecc('0xe'),'attributes':{'class':_0x671f48,'style':{'background-image':_0x39ff41[_0x2ecc('0xd')]?_0x2ecc('0xa')+_0x39ff41[_0x2ecc('0xd')]+'\x27)':''}}},{'tag':_0x2ecc('0xe'),'attributes':{'class':_0x39ff41[_0x2ecc('0xd')]?_0x2ecc('0x10'):_0x2ecc('0x5')},'children':[{'text':_0x39ff41[_0x2ecc('0x1')]}]}];this['notificationView']&&_0x5ed59c[_0x2ecc('0x3')](this[_0x2ecc('0x8')]),this[_0x2ecc('0x2')]({'tag':_0x2ecc('0xe'),'attributes':{'class':['ck',_0x2ecc('0x4')],'data-user-id':_0x39ff41['id']},'children':_0x5ed59c});}}
package/src/users.d.ts CHANGED
@@ -1,161 +1,161 @@
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
7
- * @publicApi
8
- */
9
- import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
10
- import { Collection } from 'ckeditor5/src/utils';
11
- import Permissions from './permissions';
12
- import '../theme/usercolors.css';
13
- /**
14
- * The `Users` plugin provides the basic interface for setting and getting users involved in the document editing process.
15
- */
16
- export default class Users extends ContextPlugin {
17
- licenseKey: string;
18
- /**
19
- * Holds all {@link module:collaboration-core/users~User users} added to the editor.
20
- *
21
- * Note, that the {@link module:collaboration-core/users~User#isAnonymous anonymous user} is always present in the editor.
22
- * You may want to filter it out when processing the users lists.
23
- *
24
- * ```ts
25
- * for ( const user of editor.plugins.get( 'Users' ).users ) {
26
- * if ( !user.isAnonymous ) {
27
- * console.log( user.name );
28
- * }
29
- * }
30
- * ```
31
- *
32
- * Use {@link #addUser} to add a new user.
33
- */
34
- readonly users: Collection<User>;
35
- /**
36
- * @inheritDoc
37
- */
38
- static get pluginName(): "Users";
39
- /**
40
- * @inheritDoc
41
- */
42
- static get requires(): readonly [typeof Permissions];
43
- /**
44
- * @inheritDoc
45
- */
46
- constructor(context: Context | Editor);
47
- /**
48
- * @inheritDoc
49
- */
50
- init(): void;
51
- /**
52
- * A reference to the local user or `null` if it has not been set.
53
- */
54
- get me(): User | null;
55
- /**
56
- * Adds a new user to the list of users.
57
- */
58
- addUser({ id, name, ...additionalData }: Partial<UserData>): User;
59
- /**
60
- * Returns the user with a given ID.
61
- */
62
- getUser(id: string): User | null;
63
- /**
64
- * Sets an {@link module:collaboration-core/users~User#isAnonymous anonymous user} as {@link #me the local user}.
65
- *
66
- * The local user ID will be set to the value of `config.users.anonymousUserId` property. All actions performed by the local user
67
- * will be contributed to the anonymous user.
68
- */
69
- useAnonymousUser(): void;
70
- /**
71
- * Sets the user with the given ID as the local user ({@link #me}).
72
- *
73
- * The local user can be only set once (this includes setting anonymous as the local user).
74
- */
75
- defineMe(userId: string): void;
76
- /**
77
- * Returns the author of the operation. It returns {@link #me} by default if it is not overwritten.
78
- */
79
- getOperationAuthor(): User | null;
80
- /**
81
- * @inheritDoc
82
- */
83
- destroy(): void;
84
- }
85
- /**
86
- * The representation of a single user that is involved in document editing.
87
- */
88
- export declare class User {
89
- /**
90
- * The ID of the user.
91
- */
92
- id: string;
93
- /**
94
- * CSS colors classes object for the user.
95
- */
96
- color: Color;
97
- /**
98
- * The name of the user.
99
- */
100
- name: string;
101
- /**
102
- * The URL pointing to the image with the avatar of the user.
103
- *
104
- * If avatar is not set, default avatar is used.
105
- */
106
- avatar: string | undefined;
107
- /**
108
- * @param data User data.
109
- * @param data.id The ID of the user.
110
- * @param data.color A helper object to generate CSS classes with the user color in the UI.
111
- * @param data.name The name of the user.
112
- * @param data.avatar The URL to the user avatar.
113
- */
114
- constructor(data: UserData);
115
- /**
116
- * Is `true` for the anonymous user, `false` otherwise.
117
- *
118
- * The anonymous user is used when there is no defined user for given resource.
119
- *
120
- * The situations when the anonymous user is used will depend on your application. For example, it can be used when the editor can be
121
- * used by "guest" users of your application, or when the original user's account was removed.
122
- */
123
- get isAnonymous(): boolean;
124
- /**
125
- * The initials of the user.
126
- *
127
- * The initials are composed from the user name's first and last words:
128
- *
129
- * * for `Joe Doe`, the initials are `JD`,
130
- * * for `Anonymous` the initials are `A`,
131
- * * for `Katie John-Newman` the initials are `KJ`,
132
- * * for `Adam Daniel Smith` the initials are `AS`.
133
- */
134
- get initials(): string;
135
- }
136
- /**
137
- * The color object used to generate specified CSS classes with an individual color number assigned to the user.
138
- */
139
- declare class Color {
140
- constructor(colorId: number);
141
- /**
142
- * Returns CSS class for user avatar background color.
143
- */
144
- getBackgroundColorClass(): string;
145
- /**
146
- * Returns CSS class for user selection highlight (the selected range).
147
- */
148
- getSelectionClass(): string;
149
- /**
150
- * Returns CSS class for user caret position element (the pipe).
151
- */
152
- getMarkerClass(): string;
153
- }
154
- type UserData = {
155
- id: string;
156
- color: Color;
157
- name: string;
158
- avatar?: string;
159
- _isAnonymous?: boolean;
160
- };
161
- export {};
1
+ /**
2
+ * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
+ * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
4
+ */
5
+ /**
6
+ * @module collaboration-core/users
7
+ * @publicApi
8
+ */
9
+ import { ContextPlugin, type Context, type Editor } from 'ckeditor5/src/core';
10
+ import { Collection } from 'ckeditor5/src/utils';
11
+ import Permissions from './permissions';
12
+ import '../theme/usercolors.css';
13
+ /**
14
+ * The `Users` plugin provides the basic interface for setting and getting users involved in the document editing process.
15
+ */
16
+ export default class Users extends ContextPlugin {
17
+ licenseKey: string;
18
+ /**
19
+ * Holds all {@link module:collaboration-core/users~User users} added to the editor.
20
+ *
21
+ * Note, that the {@link module:collaboration-core/users~User#isAnonymous anonymous user} is always present in the editor.
22
+ * You may want to filter it out when processing the users lists.
23
+ *
24
+ * ```ts
25
+ * for ( const user of editor.plugins.get( 'Users' ).users ) {
26
+ * if ( !user.isAnonymous ) {
27
+ * console.log( user.name );
28
+ * }
29
+ * }
30
+ * ```
31
+ *
32
+ * Use {@link #addUser} to add a new user.
33
+ */
34
+ readonly users: Collection<User>;
35
+ /**
36
+ * @inheritDoc
37
+ */
38
+ static get pluginName(): "Users";
39
+ /**
40
+ * @inheritDoc
41
+ */
42
+ static get requires(): readonly [typeof Permissions];
43
+ /**
44
+ * @inheritDoc
45
+ */
46
+ constructor(context: Context | Editor);
47
+ /**
48
+ * @inheritDoc
49
+ */
50
+ init(): void;
51
+ /**
52
+ * A reference to the local user or `null` if it has not been set.
53
+ */
54
+ get me(): User | null;
55
+ /**
56
+ * Adds a new user to the list of users.
57
+ */
58
+ addUser({ id, name, ...additionalData }: Partial<UserData>): User;
59
+ /**
60
+ * Returns the user with a given ID.
61
+ */
62
+ getUser(id: string): User | null;
63
+ /**
64
+ * Sets an {@link module:collaboration-core/users~User#isAnonymous anonymous user} as {@link #me the local user}.
65
+ *
66
+ * The local user ID will be set to the value of `config.users.anonymousUserId` property. All actions performed by the local user
67
+ * will be contributed to the anonymous user.
68
+ */
69
+ useAnonymousUser(): void;
70
+ /**
71
+ * Sets the user with the given ID as the local user ({@link #me}).
72
+ *
73
+ * The local user can be only set once (this includes setting anonymous as the local user).
74
+ */
75
+ defineMe(userId: string): void;
76
+ /**
77
+ * Returns the author of the operation. It returns {@link #me} by default if it is not overwritten.
78
+ */
79
+ getOperationAuthor(): User | null;
80
+ /**
81
+ * @inheritDoc
82
+ */
83
+ destroy(): void;
84
+ }
85
+ /**
86
+ * The representation of a single user that is involved in document editing.
87
+ */
88
+ export declare class User {
89
+ /**
90
+ * The ID of the user.
91
+ */
92
+ id: string;
93
+ /**
94
+ * CSS colors classes object for the user.
95
+ */
96
+ color: Color;
97
+ /**
98
+ * The name of the user.
99
+ */
100
+ name: string;
101
+ /**
102
+ * The URL pointing to the image with the avatar of the user.
103
+ *
104
+ * If avatar is not set, default avatar is used.
105
+ */
106
+ avatar: string | undefined;
107
+ /**
108
+ * @param data User data.
109
+ * @param data.id The ID of the user.
110
+ * @param data.color A helper object to generate CSS classes with the user color in the UI.
111
+ * @param data.name The name of the user.
112
+ * @param data.avatar The URL to the user avatar.
113
+ */
114
+ constructor(data: UserData);
115
+ /**
116
+ * Is `true` for the anonymous user, `false` otherwise.
117
+ *
118
+ * The anonymous user is used when there is no defined user for given resource.
119
+ *
120
+ * The situations when the anonymous user is used will depend on your application. For example, it can be used when the editor can be
121
+ * used by "guest" users of your application, or when the original user's account was removed.
122
+ */
123
+ get isAnonymous(): boolean;
124
+ /**
125
+ * The initials of the user.
126
+ *
127
+ * The initials are composed from the user name's first and last words:
128
+ *
129
+ * * for `Joe Doe`, the initials are `JD`,
130
+ * * for `Anonymous` the initials are `A`,
131
+ * * for `Katie John-Newman` the initials are `KJ`,
132
+ * * for `Adam Daniel Smith` the initials are `AS`.
133
+ */
134
+ get initials(): string;
135
+ }
136
+ /**
137
+ * The color object used to generate specified CSS classes with an individual color number assigned to the user.
138
+ */
139
+ declare class Color {
140
+ constructor(colorId: number);
141
+ /**
142
+ * Returns CSS class for user avatar background color.
143
+ */
144
+ getBackgroundColorClass(): string;
145
+ /**
146
+ * Returns CSS class for user selection highlight (the selected range).
147
+ */
148
+ getSelectionClass(): string;
149
+ /**
150
+ * Returns CSS class for user caret position element (the pipe).
151
+ */
152
+ getMarkerClass(): string;
153
+ }
154
+ type UserData = {
155
+ id: string;
156
+ color: Color;
157
+ name: string;
158
+ avatar?: string;
159
+ _isAnonymous?: boolean;
160
+ };
161
+ export {};
package/src/users.js CHANGED
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- const _0xac86=['invalid-license-key','locale','trial-license-key-reached-limit-time','requires','ck-user__selection--','users.anonymousUserId','info','users','_getNextColor','_id','getSelectionClass','get','_lastColor','define','avatar','isAnonymous','includes','_myId','addUser','destroy','licenseKeyTrialLimit:operations','charAt','context','licenseKeyTrialLimit:time','ck-user__marker--','licenseKey','Users','useAnonymousUser','licenseKeyTrial','ck-user__bg-color--','toUpperCase','_isAnonymous','trial-license-key-reached-limit-changes','users.colorsCount','users-me-already-defined','length','name','_getInitial','init','add','Anonymous','pluginName','config','defineMe','_licenseKeyCheckInterval','anonymous-user','_locale','licenseKeyTrialLimit:revisions','initials','color','getOperationAuthor','trim','getMarkerClass','getUser'];(function(_0x5083fd,_0xac86aa){const _0x3bdfc3=function(_0x5dcbee){while(--_0x5dcbee){_0x5083fd['push'](_0x5083fd['shift']());}};_0x3bdfc3(++_0xac86aa);}(_0xac86,0x1b6));const _0x3bdf=function(_0x5083fd,_0xac86aa){_0x5083fd=_0x5083fd-0x0;let _0x3bdfc3=_0xac86[_0x5083fd];return _0x3bdfc3;};import{ContextPlugin as _0x581b8d}from'ckeditor5/src/core';import{Collection as _0x703e45,CKEditorError as _0x3cb524}from'ckeditor5/src/utils';import _0x3cf163 from'./permissions';import{getTranslation as _0x52f9a9}from'./utils/common-translations';import'../theme/usercolors.css';export default class l extends _0x581b8d{static get[_0x3bdf('0x23')](){return _0x3bdf('0x14');}static get[_0x3bdf('0x33')](){return[_0x3cf163];}constructor(_0x24d58e){super(_0x24d58e),this[_0x3bdf('0x10')][_0x3bdf('0x24')][_0x3bdf('0x7')](_0x3bdf('0x35'),_0x3bdf('0x27')),this['context'][_0x3bdf('0x24')][_0x3bdf('0x7')](_0x3bdf('0x1b'),0x8),this[_0x3bdf('0x1')]=new _0x703e45(),this[_0x3bdf('0x28')]=_0x24d58e[_0x3bdf('0x31')],this['_licenseKeyCheckInterval']=null,this[_0x3bdf('0x6')]=0x0,this[_0x3bdf('0xb')]=null,this['decorate'](_0x3bdf('0x2c'));}[_0x3bdf('0x20')](){const _0x12afcb=this['context'];this['licenseKey']=_0x12afcb[_0x3bdf('0x24')][_0x3bdf('0x5')](_0x3bdf('0x13'));const _0x5b72af=[_0x3bdf('0x16'),'licenseKeyInvalid','licenseKeyValid',_0x3bdf('0xe'),_0x3bdf('0x11'),'licenseKeyTrialLimit:revisions'];this[_0x3bdf('0x26')]=setInterval(()=>{let _0x3bff87;for(const _0x20d339 in _0x12afcb){const _0x156d93=_0x12afcb[_0x20d339];if(_0x5b72af[_0x3bdf('0xa')](_0x156d93)){delete _0x12afcb[_0x20d339],_0x3bff87=_0x156d93;break;}}if('licenseKeyInvalid'===_0x3bff87)throw clearInterval(this[_0x3bdf('0x26')]),new _0x3cb524(_0x3bdf('0x30'),null);if('licenseKeyTrial'===_0x3bff87&&console[_0x3bdf('0x0')]('You\x20are\x20using\x20the\x20trial\x20version\x20of\x20CKEditor\x205\x20collaboration\x20plugin\x20with\x20limited\x20usage.\x20Make\x20sure\x20you\x20will\x20not\x20use\x20it\x20in\x20the\x20production\x20environment.'),_0x3bdf('0xe')===_0x3bff87)throw clearInterval(this[_0x3bdf('0x26')]),new _0x3cb524(_0x3bdf('0x1a'),null);if(_0x3bdf('0x11')===_0x3bff87)throw clearInterval(this[_0x3bdf('0x26')]),new _0x3cb524(_0x3bdf('0x32'),null);if(_0x3bdf('0x29')===_0x3bff87)throw clearInterval(this[_0x3bdf('0x26')]),new _0x3cb524('trial-license-key-reached-limit-revisions',null);'licenseKeyValid'===_0x3bff87&&clearInterval(this[_0x3bdf('0x26')]);},0x3e8),this['_addAnonymousUser']();}get['me'](){return null==this[_0x3bdf('0xb')]?null:this[_0x3bdf('0x2f')](this[_0x3bdf('0xb')]);}['addUser']({id:_0x325920,name:_0x8ef8ff,..._0x3a800e}){if(!_0x325920||'string'!=typeof _0x325920)throw new _0x3cb524('users-add-invalid-id');if(this[_0x3bdf('0x1')]['has'](_0x325920))throw new _0x3cb524('users-add-duplicated-id',null,{'id':_0x325920});const _0x5da33b={..._0x3a800e,'id':_0x325920,'name':a(this[_0x3bdf('0x28')],_0x8ef8ff),'color':this[_0x3bdf('0x2')]()};_0x5da33b[_0x3bdf('0x1e')]=a(this[_0x3bdf('0x28')],_0x5da33b['name']);const _0x54fafd=new User(_0x5da33b);return this[_0x3bdf('0x1')][_0x3bdf('0x21')](_0x54fafd),_0x54fafd;}[_0x3bdf('0x2f')](_0x24c69c){return this['users'][_0x3bdf('0x5')](_0x24c69c);}[_0x3bdf('0x15')](){const _0x1c99f1=this[_0x3bdf('0x10')][_0x3bdf('0x24')][_0x3bdf('0x5')]('users.anonymousUserId');this['_myId']||this[_0x3bdf('0x25')](_0x1c99f1);}['defineMe'](_0x43b9fc){if(this['_myId'])throw new _0x3cb524(_0x3bdf('0x1c'),null);if(!this[_0x3bdf('0x2f')](_0x43b9fc))throw new _0x3cb524('users-me-missing-user',null);this['_myId']=_0x43b9fc;}[_0x3bdf('0x2c')](){return this['me'];}[_0x3bdf('0xd')](){super['destroy'](),clearInterval(this['_licenseKeyCheckInterval']);}[_0x3bdf('0x2')](){const _0x59ea08=this[_0x3bdf('0x10')]['config'][_0x3bdf('0x5')](_0x3bdf('0x1b'));return this['_lastColor']>=_0x59ea08&&(this['_lastColor']=0x0),new u(this['_lastColor']++);}['_addAnonymousUser'](){const _0x9f590c=this['context']['config']['get'](_0x3bdf('0x35'));this[_0x3bdf('0xc')]({'id':_0x9f590c,'name':_0x52f9a9(this[_0x3bdf('0x28')],_0x3bdf('0x22'))})[_0x3bdf('0x19')]=!0x0;}}export class User{constructor(_0x49bd14){this['id']=_0x49bd14['id'],this[_0x3bdf('0x2b')]=_0x49bd14[_0x3bdf('0x2b')],this[_0x3bdf('0x1e')]=_0x49bd14[_0x3bdf('0x1e')],this[_0x3bdf('0x8')]=_0x49bd14['avatar'],this['_isAnonymous']=!0x1;}get[_0x3bdf('0x9')](){return this[_0x3bdf('0x19')];}get[_0x3bdf('0x2a')](){const _0x51b9ea=this['name']['split']('\x20');return 0x1===_0x51b9ea[_0x3bdf('0x1d')]?this[_0x3bdf('0x1f')](_0x51b9ea[0x0]):this[_0x3bdf('0x1f')](_0x51b9ea[0x0])+this[_0x3bdf('0x1f')](_0x51b9ea[_0x51b9ea[_0x3bdf('0x1d')]-0x1]);}[_0x3bdf('0x1f')](_0x31d9e8){return _0x31d9e8[_0x3bdf('0xf')](0x0)[_0x3bdf('0x18')]();}}function a(_0x30e2f6,_0x4714e1=''){return''==(_0x4714e1=_0x4714e1[_0x3bdf('0x2d')]())?_0x52f9a9(_0x30e2f6,_0x3bdf('0x22')):_0x4714e1;}class u{constructor(_0x565e86){this[_0x3bdf('0x3')]=_0x565e86;}['getBackgroundColorClass'](){return _0x3bdf('0x17')+this[_0x3bdf('0x3')];}[_0x3bdf('0x4')](){return _0x3bdf('0x34')+this[_0x3bdf('0x3')];}[_0x3bdf('0x2e')](){return _0x3bdf('0x12')+this[_0x3bdf('0x3')];}}
23
+ const _0x128a=['split','licenseKeyTrialLimit:operations','pluginName','users.anonymousUserId','licenseKey','licenseKeyTrialLimit:revisions','You\x20are\x20using\x20the\x20trial\x20version\x20of\x20CKEditor\x205\x20collaboration\x20plugin\x20with\x20limited\x20usage.\x20Make\x20sure\x20you\x20will\x20not\x20use\x20it\x20in\x20the\x20production\x20environment.','toUpperCase','locale','trim','_id','init','destroy','users','licenseKeyValid','string','requires','initials','_licenseKeyCheckInterval','_getInitial','includes','ck-user__marker--','add','useAnonymousUser','Anonymous','_locale','context','_getNextColor','anonymous-user','invalid-license-key','config','licenseKeyTrialLimit:time','trial-license-key-reached-limit-time','users-add-duplicated-id','define','name','decorate','getSelectionClass','getUser','avatar','users-me-already-defined','ck-user__selection--','defineMe','users-me-missing-user','trial-license-key-reached-limit-revisions','users.colorsCount','length','info','addUser','isAnonymous','trial-license-key-reached-limit-changes','has','_myId','licenseKeyTrial','_isAnonymous','_lastColor','charAt','get','licenseKeyInvalid','getMarkerClass','getOperationAuthor'];(function(_0x4ea929,_0x128a80){const _0x3bb480=function(_0x279ff5){while(--_0x279ff5){_0x4ea929['push'](_0x4ea929['shift']());}};_0x3bb480(++_0x128a80);}(_0x128a,0x1ae));const _0x3bb4=function(_0x4ea929,_0x128a80){_0x4ea929=_0x4ea929-0x0;let _0x3bb480=_0x128a[_0x4ea929];return _0x3bb480;};import{ContextPlugin as _0x44f272}from'ckeditor5/src/core';import{Collection as _0x5492b1,CKEditorError as _0x309315}from'ckeditor5/src/utils';import _0xd42d29 from'./permissions';import{getTranslation as _0x4351b5}from'./utils/common-translations';import'../theme/usercolors.css';export default class l extends _0x44f272{static get[_0x3bb4('0x3c')](){return'Users';}static get[_0x3bb4('0xd')](){return[_0xd42d29];}constructor(_0x441eea){super(_0x441eea),this['context'][_0x3bb4('0x1b')][_0x3bb4('0x1f')](_0x3bb4('0x0'),_0x3bb4('0x19')),this[_0x3bb4('0x17')][_0x3bb4('0x1b')][_0x3bb4('0x1f')](_0x3bb4('0x2a'),0x8),this[_0x3bb4('0xa')]=new _0x5492b1(),this[_0x3bb4('0x16')]=_0x441eea[_0x3bb4('0x5')],this[_0x3bb4('0xf')]=null,this[_0x3bb4('0x34')]=0x0,this[_0x3bb4('0x31')]=null,this[_0x3bb4('0x21')](_0x3bb4('0x39'));}[_0x3bb4('0x8')](){const _0x3e7cda=this[_0x3bb4('0x17')];this['licenseKey']=_0x3e7cda[_0x3bb4('0x1b')]['get'](_0x3bb4('0x1'));const _0x537009=[_0x3bb4('0x32'),_0x3bb4('0x37'),_0x3bb4('0xb'),'licenseKeyTrialLimit:operations',_0x3bb4('0x1c'),_0x3bb4('0x2')];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x22a97d;for(const _0x479048 in _0x3e7cda){const _0x35276c=_0x3e7cda[_0x479048];if(_0x537009[_0x3bb4('0x11')](_0x35276c)){delete _0x3e7cda[_0x479048],_0x22a97d=_0x35276c;break;}}if(_0x3bb4('0x37')===_0x22a97d)throw clearInterval(this[_0x3bb4('0xf')]),new _0x309315(_0x3bb4('0x1a'),null);if(_0x3bb4('0x32')===_0x22a97d&&console[_0x3bb4('0x2c')](_0x3bb4('0x3')),_0x3bb4('0x3b')===_0x22a97d)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x309315(_0x3bb4('0x2f'),null);if('licenseKeyTrialLimit:time'===_0x22a97d)throw clearInterval(this[_0x3bb4('0xf')]),new _0x309315(_0x3bb4('0x1d'),null);if(_0x3bb4('0x2')===_0x22a97d)throw clearInterval(this['_licenseKeyCheckInterval']),new _0x309315(_0x3bb4('0x29'),null);_0x3bb4('0xb')===_0x22a97d&&clearInterval(this[_0x3bb4('0xf')]);},0x3e8),this['_addAnonymousUser']();}get['me'](){return null==this[_0x3bb4('0x31')]?null:this[_0x3bb4('0x23')](this[_0x3bb4('0x31')]);}[_0x3bb4('0x2d')]({id:_0x5cc999,name:_0x3676a0,..._0x51b47c}){if(!_0x5cc999||_0x3bb4('0xc')!=typeof _0x5cc999)throw new _0x309315('users-add-invalid-id');if(this[_0x3bb4('0xa')][_0x3bb4('0x30')](_0x5cc999))throw new _0x309315(_0x3bb4('0x1e'),null,{'id':_0x5cc999});const _0xe66c35={..._0x51b47c,'id':_0x5cc999,'name':a(this[_0x3bb4('0x16')],_0x3676a0),'color':this[_0x3bb4('0x18')]()};_0xe66c35[_0x3bb4('0x20')]=a(this[_0x3bb4('0x16')],_0xe66c35[_0x3bb4('0x20')]);const _0x31919d=new User(_0xe66c35);return this[_0x3bb4('0xa')][_0x3bb4('0x13')](_0x31919d),_0x31919d;}[_0x3bb4('0x23')](_0x10403a){return this[_0x3bb4('0xa')][_0x3bb4('0x36')](_0x10403a);}[_0x3bb4('0x14')](){const _0x4d9cb5=this['context'][_0x3bb4('0x1b')]['get'](_0x3bb4('0x0'));this['_myId']||this[_0x3bb4('0x27')](_0x4d9cb5);}[_0x3bb4('0x27')](_0x5aad9e){if(this['_myId'])throw new _0x309315(_0x3bb4('0x25'),null);if(!this['getUser'](_0x5aad9e))throw new _0x309315(_0x3bb4('0x28'),null);this[_0x3bb4('0x31')]=_0x5aad9e;}[_0x3bb4('0x39')](){return this['me'];}[_0x3bb4('0x9')](){super['destroy'](),clearInterval(this[_0x3bb4('0xf')]);}[_0x3bb4('0x18')](){const _0x439ae6=this[_0x3bb4('0x17')][_0x3bb4('0x1b')][_0x3bb4('0x36')](_0x3bb4('0x2a'));return this['_lastColor']>=_0x439ae6&&(this[_0x3bb4('0x34')]=0x0),new u(this[_0x3bb4('0x34')]++);}['_addAnonymousUser'](){const _0x472873=this[_0x3bb4('0x17')][_0x3bb4('0x1b')][_0x3bb4('0x36')](_0x3bb4('0x0'));this[_0x3bb4('0x2d')]({'id':_0x472873,'name':_0x4351b5(this[_0x3bb4('0x16')],'Anonymous')})[_0x3bb4('0x33')]=!0x0;}}export class User{constructor(_0x248428){this['id']=_0x248428['id'],this['color']=_0x248428['color'],this[_0x3bb4('0x20')]=_0x248428[_0x3bb4('0x20')],this[_0x3bb4('0x24')]=_0x248428['avatar'],this[_0x3bb4('0x33')]=!0x1;}get[_0x3bb4('0x2e')](){return this[_0x3bb4('0x33')];}get[_0x3bb4('0xe')](){const _0x54b72b=this[_0x3bb4('0x20')][_0x3bb4('0x3a')]('\x20');return 0x1===_0x54b72b['length']?this['_getInitial'](_0x54b72b[0x0]):this['_getInitial'](_0x54b72b[0x0])+this[_0x3bb4('0x10')](_0x54b72b[_0x54b72b[_0x3bb4('0x2b')]-0x1]);}[_0x3bb4('0x10')](_0x5612bf){return _0x5612bf[_0x3bb4('0x35')](0x0)[_0x3bb4('0x4')]();}}function a(_0x1dd28,_0x5a50df=''){return''==(_0x5a50df=_0x5a50df[_0x3bb4('0x6')]())?_0x4351b5(_0x1dd28,_0x3bb4('0x15')):_0x5a50df;}class u{constructor(_0xb96d1c){this[_0x3bb4('0x7')]=_0xb96d1c;}['getBackgroundColorClass'](){return'ck-user__bg-color--'+this[_0x3bb4('0x7')];}[_0x3bb4('0x22')](){return _0x3bb4('0x26')+this[_0x3bb4('0x7')];}[_0x3bb4('0x38')](){return _0x3bb4('0x12')+this[_0x3bb4('0x7')];}}
@@ -1,9 +1,9 @@
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/utils/common-translations
7
- */
8
- import type { Locale } from 'ckeditor5/src/utils';
9
- export declare function getTranslation(locale: Locale, id: string): string;
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/utils/common-translations
7
+ */
8
+ import type { Locale } from 'ckeditor5/src/utils';
9
+ export declare function getTranslation(locale: Locale, id: string): string;
@@ -20,4 +20,4 @@
20
20
  *
21
21
  *
22
22
  */
23
- export function getTranslation(_0x60cc7,_0x293fbe){const t=_0x60cc7['t'];switch(_0x293fbe){case'Anonymous':return t('Anonymous');case'Yes':return t('Yes');case'No':return t('No');case'Are\x20you\x20sure?':return t('Are\x20you\x20sure?');default:return'';}}
23
+ export function getTranslation(_0x4ffdac,_0x21b646){const t=_0x4ffdac['t'];switch(_0x21b646){case'Anonymous':return t('Anonymous');case'Yes':return t('Yes');case'No':return t('No');case'Are\x20you\x20sure?':return t('Are\x20you\x20sure?');default:return'';}}