@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.
- package/CHANGELOG.md +1 -1
- package/LICENSE.md +6 -6
- package/README.md +9 -9
- package/lang/translations/af.po +1 -0
- package/lang/translations/ar.po +1 -0
- package/lang/translations/az.po +1 -0
- package/lang/translations/bg.po +1 -0
- package/lang/translations/bn.po +1 -0
- package/lang/translations/bs.po +1 -0
- package/lang/translations/ca.po +1 -0
- package/lang/translations/cs.po +1 -0
- package/lang/translations/da.po +1 -0
- package/lang/translations/de-ch.po +1 -0
- package/lang/translations/de.po +1 -0
- package/lang/translations/el.po +1 -0
- package/lang/translations/en-au.po +1 -0
- package/lang/translations/en.po +1 -0
- package/lang/translations/es-co.po +1 -0
- package/lang/translations/es.po +1 -0
- package/lang/translations/et.po +1 -0
- package/lang/translations/fa.po +1 -0
- package/lang/translations/fi.po +1 -0
- package/lang/translations/fr.po +1 -0
- package/lang/translations/gl.po +1 -0
- package/lang/translations/he.po +1 -0
- package/lang/translations/hi.po +1 -0
- package/lang/translations/hr.po +1 -0
- package/lang/translations/hu.po +1 -0
- package/lang/translations/id.po +1 -0
- package/lang/translations/it.po +1 -0
- package/lang/translations/ja.po +1 -0
- package/lang/translations/jv.po +1 -0
- package/lang/translations/ko.po +1 -0
- package/lang/translations/lt.po +1 -0
- package/lang/translations/lv.po +1 -0
- package/lang/translations/ms.po +1 -0
- package/lang/translations/nl.po +1 -0
- package/lang/translations/no.po +1 -0
- package/lang/translations/pl.po +1 -0
- package/lang/translations/pt-br.po +1 -0
- package/lang/translations/pt.po +1 -0
- package/lang/translations/ro.po +1 -0
- package/lang/translations/ru.po +1 -0
- package/lang/translations/sk.po +1 -0
- package/lang/translations/sr-latn.po +1 -0
- package/lang/translations/sr.po +1 -0
- package/lang/translations/sv.po +1 -0
- package/lang/translations/th.po +1 -0
- package/lang/translations/tk.po +1 -0
- package/lang/translations/tr.po +1 -0
- package/lang/translations/tt.po +1 -0
- package/lang/translations/ug.po +1 -0
- package/lang/translations/uk.po +1 -0
- package/lang/translations/ur.po +1 -0
- package/lang/translations/vi.po +1 -0
- package/lang/translations/zh-cn.po +1 -0
- package/lang/translations/zh.po +1 -0
- package/package.json +2 -6
- 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 +18 -18
- package/src/permissions.d.ts +45 -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 -150
- 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/trim-html.d.ts +16 -16
- package/src/utils/trim-html.js +1 -1
- package/theme/icons/notification.svg +1 -1
- package/theme/integrations/codeblock.css +9 -0
- package/theme/integrations/horizontalline.css +9 -0
- package/theme/integrations/image.css +31 -20
- package/theme/integrations/mediaembed.css +9 -0
- package/theme/integrations/pagebreak.css +9 -0
- package/theme/integrations/table.css +32 -23
- package/theme/suggestion.css +10 -1
- package/theme/suggestionmarker.css +2 -1
- package/theme/usercolormixin.css +10 -1
- package/theme/usercolors.css +2 -1
- package/theme/users.css +5 -4
package/src/users.d.ts
CHANGED
@@ -1,150 +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
|
-
*
|
22
|
-
*
|
23
|
-
*
|
24
|
-
*
|
25
|
-
*
|
26
|
-
*
|
27
|
-
*
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
*
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
*
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
*
|
66
|
-
*
|
67
|
-
*
|
68
|
-
*/
|
69
|
-
|
70
|
-
/**
|
71
|
-
*
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
*
|
99
|
-
*/
|
100
|
-
|
101
|
-
/**
|
102
|
-
*
|
103
|
-
*
|
104
|
-
*
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
*
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
*
|
117
|
-
*
|
118
|
-
*
|
119
|
-
*
|
120
|
-
*
|
121
|
-
*
|
122
|
-
*/
|
123
|
-
get
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
*
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
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
|
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')];}}
|
@@ -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(
|
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'';}}
|
@@ -1,20 +1,20 @@
|
|
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 comments/comments/ui/view/confirmmixin
|
7
|
-
*/
|
8
|
-
import type { View } from 'ckeditor5/src/ui';
|
9
|
-
import type { Locale, Mixed } from 'ckeditor5/src/utils';
|
10
|
-
/**
|
11
|
-
* Adds interface for showing confirmation view in the specific for `CommentThreadView` and `CommentView` structure
|
12
|
-
* Confirm is always set to the `content` collection at the last position.
|
13
|
-
*/
|
14
|
-
export default function ConfirmMixin<Base extends new (...args: Array<any>) => View>(base: Base): Mixed<Base, ConfirmApi>;
|
15
|
-
export interface ConfirmApi {
|
16
|
-
isConfirm: boolean;
|
17
|
-
locale: Locale;
|
18
|
-
showConfirm(message: string, element: Element): Promise<unknown>;
|
19
|
-
cancelConfirm(): void;
|
20
|
-
}
|
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 comments/comments/ui/view/confirmmixin
|
7
|
+
*/
|
8
|
+
import type { View } from 'ckeditor5/src/ui';
|
9
|
+
import type { Locale, Mixed } from 'ckeditor5/src/utils';
|
10
|
+
/**
|
11
|
+
* Adds interface for showing confirmation view in the specific for `CommentThreadView` and `CommentView` structure
|
12
|
+
* Confirm is always set to the `content` collection at the last position.
|
13
|
+
*/
|
14
|
+
export default function ConfirmMixin<Base extends new (...args: Array<any>) => View>(base: Base): Mixed<Base, ConfirmApi>;
|
15
|
+
export interface ConfirmApi {
|
16
|
+
isConfirm: boolean;
|
17
|
+
locale: Locale;
|
18
|
+
showConfirm(message: string, element: Element): Promise<unknown>;
|
19
|
+
cancelConfirm(): void;
|
20
|
+
}
|
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
var
|
23
|
+
var _0x5e35=['remove','submit','destroy','once','showConfirm','deregisterChild','confirmView','appendChild','locale','isConfirm','render','_removeConfirm','set','cancel','registerChild','element','cancelConfirm','message','focus'];(function(_0xb43ebd,_0x5e358f){var _0x247f24=function(_0x5ec2f3){while(--_0x5ec2f3){_0xb43ebd['push'](_0xb43ebd['shift']());}};_0x247f24(++_0x5e358f);}(_0x5e35,0x93));var _0x247f=function(_0xb43ebd,_0x5e358f){_0xb43ebd=_0xb43ebd-0x0;var _0x247f24=_0x5e35[_0xb43ebd];return _0x247f24;};import _0x5ac9d2 from'./confirmview';export default function m(_0x1d2497){return class extends _0x1d2497{[_0x247f('0x9')](_0x2dee4a,_0x1a1814){return this['confirmView']=new _0x5ac9d2(this[_0x247f('0xd')]),this[_0x247f('0xb')][_0x247f('0xf')](),this['confirmView'][_0x247f('0x3')]=_0x2dee4a,this[_0x247f('0xb')][_0x247f('0x8')](_0x247f('0x12'),()=>{this[_0x247f('0x10')]();}),this[_0x247f('0xb')][_0x247f('0x8')](_0x247f('0x6'),()=>{this[_0x247f('0x10')]();}),_0x1a1814[_0x247f('0xc')](this[_0x247f('0xb')][_0x247f('0x1')]),this[_0x247f('0x0')](this[_0x247f('0xb')]),this[_0x247f('0x1')]['focus'](),this[_0x247f('0x11')](_0x247f('0xe'),!0x0),new Promise(_0x399085=>this[_0x247f('0xb')]['on'](_0x247f('0x6'),_0x399085));}[_0x247f('0x2')](){this[_0x247f('0xe')]&&this['confirmView']['fire'](_0x247f('0x12'));}[_0x247f('0x10')](){this[_0x247f('0x1')]&&this[_0x247f('0xb')]&&this['confirmView']['element']&&(this['element'][_0x247f('0x4')](),this[_0x247f('0xb')]['element'][_0x247f('0x5')](),this[_0x247f('0xa')](this[_0x247f('0xb')]),this['isConfirm']=!0x1,this['confirmView'][_0x247f('0x7')](),this['confirmView']=void 0x0);}};}
|
@@ -1,13 +1,13 @@
|
|
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 comments/comments/ui/view/confirmview
|
7
|
-
*/
|
8
|
-
import { View } from 'ckeditor5/src/ui';
|
9
|
-
import type { Locale } from 'ckeditor5/src/utils';
|
10
|
-
export default class ConfirmView extends View {
|
11
|
-
message: string;
|
12
|
-
constructor(locale: Locale);
|
13
|
-
}
|
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 comments/comments/ui/view/confirmview
|
7
|
+
*/
|
8
|
+
import { View } from 'ckeditor5/src/ui';
|
9
|
+
import type { Locale } from 'ckeditor5/src/utils';
|
10
|
+
export default class ConfirmView extends View {
|
11
|
+
message: string;
|
12
|
+
constructor(locale: Locale);
|
13
|
+
}
|
package/src/utils/confirmview.js
CHANGED
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
const
|
23
|
+
const _0x266b=['ck-thread__remove-confirm','extendTemplate','cancel','ck-thread__remove-confirm-inner','icon','execute','Yes','fire','bindTemplate','Are\x20you\x20sure?','submit','submitView','cancelView','message','label','set','_createButtonView','div'];(function(_0x1b1106,_0x266beb){const _0x2b8522=function(_0x2346ab){while(--_0x2346ab){_0x1b1106['push'](_0x1b1106['shift']());}};_0x2b8522(++_0x266beb);}(_0x266b,0xd5));const _0x2b85=function(_0x1b1106,_0x266beb){_0x1b1106=_0x1b1106-0x0;let _0x2b8522=_0x266b[_0x1b1106];return _0x2b8522;};import{View as _0x27f2f6,ButtonView as _0x59d7c5}from'ckeditor5/src/ui';import{icons as _0x4966be}from'ckeditor5/src/core';import{getTranslation as _0x557f14}from'./common-translations';export default class h extends _0x27f2f6{constructor(_0x2d02cd){super(_0x2d02cd);const _0x415686=this[_0x2b85('0xb')];this[_0x2b85('0xe')]=this['_createButtonView'](_0x2d02cd,_0x557f14(_0x2d02cd,_0x2b85('0x9')),_0x4966be['check'],_0x2b85('0xd')),this[_0x2b85('0xf')]=this[_0x2b85('0x1')](_0x2d02cd,_0x557f14(_0x2d02cd,'No'),_0x4966be[_0x2b85('0x5')],_0x2b85('0x5')),this[_0x2b85('0x0')](_0x2b85('0x10'),_0x557f14(_0x2d02cd,_0x2b85('0xc'))),this['setTemplate']({'tag':'div','attributes':{'class':[_0x2b85('0x3')]},'children':[{'tag':_0x2b85('0x2'),'attributes':{'class':_0x2b85('0x6')},'children':[{'tag':'p','children':[{'text':_0x415686['to'](_0x2b85('0x10'))}]},{'tag':_0x2b85('0x2'),'attributes':{'class':'ck-thread__remove-confirm-actions'},'children':[this[_0x2b85('0xe')],this['cancelView']]}]}]});}['_createButtonView'](_0x1484c4,_0x462e80,_0x2ad46a,_0x3c4410){const _0x5552a9=new _0x59d7c5(_0x1484c4);return _0x5552a9[_0x2b85('0x11')]=_0x462e80,_0x5552a9[_0x2b85('0x7')]=_0x2ad46a,_0x5552a9[_0x2b85('0x4')]({'attributes':{'class':'ck-thread__remove-confirm-'+_0x3c4410}}),_0x5552a9['on'](_0x2b85('0x8'),()=>this[_0x2b85('0xa')](_0x3c4410)),_0x5552a9;}}
|
@@ -1,29 +1,29 @@
|
|
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 } from '../config';
|
6
|
-
/**
|
7
|
-
* Returns a function that formats the date to the set format.
|
8
|
-
*
|
9
|
-
* The default formatting can be changed by setting a custom formatting function to `config.locale.dateTimeFormat`.
|
10
|
-
*
|
11
|
-
* ```ts
|
12
|
-
* import format from 'date-fns/format';
|
13
|
-
*
|
14
|
-
* ClassicEditor
|
15
|
-
* .create( document.querySelector( '#editor' ), {
|
16
|
-
* toolbar: {
|
17
|
-
* items: [ 'bold', 'italic', '|', 'comment' ]
|
18
|
-
* },
|
19
|
-
* sidebar: {
|
20
|
-
* container: document.querySelector( '#sidebar' )
|
21
|
-
* },
|
22
|
-
* locale: {
|
23
|
-
* dateTimeFormat: date => format( date, 'dd/MM/yyyy' )
|
24
|
-
* }
|
25
|
-
* } )
|
26
|
-
* .catch( error => console.error( error ) );
|
27
|
-
* ```
|
28
|
-
*/
|
29
|
-
export default function getDateTimeFormatter(localeConfig?: LocaleConfig): (date: Date | 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
|
+
import type { LocaleConfig } from '../config';
|
6
|
+
/**
|
7
|
+
* Returns a function that formats the date to the set format.
|
8
|
+
*
|
9
|
+
* The default formatting can be changed by setting a custom formatting function to `config.locale.dateTimeFormat`.
|
10
|
+
*
|
11
|
+
* ```ts
|
12
|
+
* import format from 'date-fns/format';
|
13
|
+
*
|
14
|
+
* ClassicEditor
|
15
|
+
* .create( document.querySelector( '#editor' ), {
|
16
|
+
* toolbar: {
|
17
|
+
* items: [ 'bold', 'italic', '|', 'comment' ]
|
18
|
+
* },
|
19
|
+
* sidebar: {
|
20
|
+
* container: document.querySelector( '#sidebar' )
|
21
|
+
* },
|
22
|
+
* locale: {
|
23
|
+
* dateTimeFormat: date => format( date, 'dd/MM/yyyy' )
|
24
|
+
* }
|
25
|
+
* } )
|
26
|
+
* .catch( error => console.error( error ) );
|
27
|
+
* ```
|
28
|
+
*/
|
29
|
+
export default function getDateTimeFormatter(localeConfig?: LocaleConfig): (date: Date | string) => string;
|
@@ -20,4 +20,4 @@
|
|
20
20
|
*
|
21
21
|
*
|
22
22
|
*/
|
23
|
-
const
|
23
|
+
const _0x57cb=['MM-dd-yyyy\x20hh:mma','\x27Yesterday\x27\x20hh:mma','function','string','dateTimeFormat','\x27Today\x27\x20hh:mma','\x27Last\x27\x20EEEE\x20hh:mma'];(function(_0x2c0902,_0x57cbb9){const _0x552e1e=function(_0xcbc1b8){while(--_0xcbc1b8){_0x2c0902['push'](_0x2c0902['shift']());}};_0x552e1e(++_0x57cbb9);}(_0x57cb,0x11d));const _0x552e=function(_0x2c0902,_0x57cbb9){_0x2c0902=_0x2c0902-0x0;let _0x552e1e=_0x57cb[_0x2c0902];return _0x552e1e;};import _0x348c8a from'date-fns/format';import _0xd90a19 from'date-fns/parseISO';import _0x2efe87 from'date-fns/differenceInCalendarDays';import{CKEditorError as _0x33a62e}from'ckeditor5/src/utils';export default function E(_0x4ead48={}){if(void 0x0!==_0x4ead48[_0x552e('0x6')]&&_0x552e('0x4')!=typeof _0x4ead48[_0x552e('0x6')])throw new _0x33a62e('invalid-date-time-format');return _0x5832e0=>{const _0x5001e9=_0x552e('0x5')==typeof _0x5832e0?_0xd90a19(_0x5832e0):_0x5832e0,_0x14bd81=new Date(),_0x2c049e=_0x2efe87(_0x14bd81,_0x5001e9);return _0x4ead48[_0x552e('0x6')]?_0x4ead48[_0x552e('0x6')](_0x5001e9):_0x348c8a(_0x5001e9,0x0===_0x2c049e?_0x552e('0x0'):0x1===_0x2c049e?_0x552e('0x3'):_0x2c049e<0x7?_0x552e('0x1'):_0x552e('0x2'));};}
|